/*
 * Copyright (c) 2026, Chloe M.
 * Provided under the BSD-3 clause.
 *
 * Description: C-runtime entry
 * Author:      Chloe M.
 */

#include <ptapi/syscall.h>

    .text
    .globl _start
_start:
    xor %rbp, %rbp  /* Terminate callstack */
    call Main       /* Enter program main */

    push %rax               /* Push the status code */
    mov $SYS_EXIT, %rax     /* Prepare the exit */
    pop %rdi                /* Pop the status code */
    int $0x2E               /* To the reaper queue we go */
    ud2
