LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/marsh.c
// Function: janet_marshal_ptr
void janet_marshal_ptr(JanetMarshalContext *ctx, const void *ptr) {
    if (!(ctx->flags & JANET_MARSHAL_UNSAFE)) {
        janet_panic("can only marshal pointers in unsafe mode");
    }
    MarshalState *st = (MarshalState *)(ctx->m_state);
    pushpointer(st, ptr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
testb $0x2, 0x12(%rdi)
je 0x2fb1d
movq (%rdi), %rcx
leaq -0x8(%rbp), %rax
movq %rsi, (%rax)
movq (%rcx), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0x17925
addq $0x10, %rsp
popq %rbp
retq
leaq 0x3101d(%rip), %rdi     # 0x60b41
callq 0x19263
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/marsh.c
// Function: janet_marshal
void janet_marshal(
    JanetBuffer *buf,
    Janet x,
    JanetTable *rreg,
    int flags) {
    MarshalState st;
    st.buf = buf;
    st.nextid = 0;
    st.seen_defs = NULL;
    st.seen_envs = NULL;
    st.rreg = rreg;
    st.maybe_cycles = !(flags & JANET_MARSHAL_NO_CYCLES);
    janet_table_init(&st.seen, 0);
    marshal_one(&st, x, flags);
    janet_table_deinit(&st.seen);
    janet_v_free(st.seen_envs);
    janet_v_free(st.seen_defs);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movl %ecx, %ebx
movq %rsi, %r14
leaq -0x70(%rbp), %r15
movq %rdi, -0x8(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%r15)
movl $0x0, 0x48(%r15)
movq %rdx, 0x30(%r15)
xorl %eax, %eax
btl $0x12, %ecx
setae %al
movl %eax, 0x4c(%r15)
movq %r15, %rdi
xorl %esi, %esi
callq 0x47df0
leaq -0x78(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x2fb6f
movq %r15, %rdi
callq 0x47e7c
movq 0x40(%r12), %rdi
testq %rdi, %rdi
je 0x305c5
addq $-0x8, %rdi
callq 0x2c187
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x305d7
addq $-0x8, %rdi
callq 0x2c187
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/marsh.c
// Function: readint
static int32_t readint(UnmarshalState *st, const uint8_t **atdata) {
    const uint8_t *data = *atdata;
    int32_t ret;
    MARSH_EOS(st, data);
    if (*data < 128) {
        ret = *data++;
    } else if (*data < 192) {
        MARSH_EOS(st, data + 1);
        uint32_t uret = ((data[0] & 0x3F) << 8) + data[1];
        /* Sign extend 18 MSBs */
        uret |= (uret >> 13) ? 0xFFFFC000 : 0;
        ret = (int32_t)uret;
        data += 2;
    } else if (*data == LB_INTEGER) {
        MARSH_EOS(st, data + 4);
        uint32_t ui = ((uint32_t)(data[1]) << 24) |
                      ((uint32_t)(data[2]) << 16) |
                      ((uint32_t)(data[3]) << 8) |
                      (uint32_t)(data[4]);
        ret = (int32_t)ui;
        data += 5;
    } else {
        janet_panicf("expected integer, got byte %x at index %d",
                     *data,
                     data - st->start);
        ret = 0;
    }
    *atdata = data;
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rsi), %rdx
movq 0xf0(%rdi), %rcx
cmpq %rcx, %rdx
jae 0x30690
movzbl (%rdx), %eax
movl $0x1, %r8d
testb %al, %al
jns 0x30688
cmpb $-0x41, %al
ja 0x3066d
leaq 0x1(%rdx), %rdi
cmpq %rcx, %rdi
jae 0x30690
andl $0x3f, %eax
shll $0x8, %eax
movzbl (%rdi), %ecx
xorl %edi, %edi
cmpl $0x2000, %eax           # imm = 0x2000
setb %dil
shll $0xe, %edi
orl %ecx, %edi
addl %edi, %eax
addl $0xffffc000, %eax       # imm = 0xFFFFC000
movl $0x2, %r8d
jmp 0x30688
cmpl $0xcd, %eax
jne 0x3069c
leaq 0x4(%rdx), %rax
cmpq %rcx, %rax
jae 0x30690
movl 0x1(%rdx), %eax
bswapl %eax
movl $0x5, %r8d
addq %r8, %rdx
movq %rdx, (%rsi)
popq %rbp
retq
leaq 0x304f5(%rip), %rdi     # 0x60b8c
callq 0x19263
subq 0xe8(%rdi), %rdx
leaq 0x3060b(%rip), %rdi     # 0x60cb5
movl %eax, %esi
xorl %eax, %eax
callq 0x1917b
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/marsh.c
// Function: janet_unmarshal_ptr
void *janet_unmarshal_ptr(JanetMarshalContext *ctx) {
    if (!(ctx->flags & JANET_MARSHAL_UNSAFE)) {
        janet_panic("can only unmarshal pointers in unsafe mode");
    }
    UnmarshalState *st = (UnmarshalState *)(ctx->u_state);
    void *ptr;
    MARSH_EOS(st, ctx->data + sizeof(void *) - 1);
    memcpy((char *) &ptr, ctx->data, sizeof(void *));
    ctx->data += sizeof(void *);
    return ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testb $0x2, 0x12(%rdi)
je 0x30762
movq 0x8(%rdi), %rax
movq 0x18(%rdi), %rcx
leaq 0x7(%rcx), %rdx
cmpq 0xf0(%rax), %rdx
jae 0x3076e
movq (%rcx), %rax
addq $0x8, %rcx
movq %rcx, 0x18(%rdi)
popq %rbp
retq
leaq 0x3043c(%rip), %rdi     # 0x60ba5
callq 0x19263
leaq 0x30417(%rip), %rdi     # 0x60b8c
callq 0x19263
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/marsh.c
// Function: janet_unmarshal_bytes
void janet_unmarshal_bytes(JanetMarshalContext *ctx, uint8_t *dest, size_t len) {
    UnmarshalState *st = (UnmarshalState *)(ctx->u_state);
    MARSH_EOS(st, ctx->data + len - 1);
    safe_memcpy(dest, ctx->data, len);
    ctx->data += len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq 0x8(%rdi), %rcx
movq 0x18(%rdi), %rax
addq %rax, %rdx
decq %rdx
cmpq 0xf0(%rcx), %rdx
jae 0x307e1
movq %rdi, %r14
movq %rsi, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x49017
addq %rbx, 0x18(%r14)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x303a4(%rip), %rdi     # 0x60b8c
callq 0x19263
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/marsh.c
// Function: janet_unmarshal_abstract_reuse
void janet_unmarshal_abstract_reuse(JanetMarshalContext *ctx, void *p) {
    UnmarshalState *st = (UnmarshalState *)(ctx->u_state);
    if (ctx->at == NULL) {
        janet_panicf("janet_unmarshal_abstract called more than once");
    }
    janet_v_push(st->lookup, janet_wrap_abstract(p));
    ctx->at = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpq $0x0, 0x20(%rdi)
je 0x31535
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %r15
movq 0xc8(%r15), %rdi
testq %rdi, %rdi
je 0x314e4
movl -0x4(%rdi), %eax
incl %eax
cmpl -0x8(%rdi), %eax
jl 0x314fa
movl $0x1, %esi
movl $0x8, %edx
callq 0x4c0b4
movq %rax, 0xc8(%r15)
movq 0xc8(%r15), %r15
movslq -0x4(%r15), %r12
leal 0x1(%r12), %eax
movl %eax, -0x4(%r15)
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %r14, %rdi
callq 0x4f9f2
movq %rax, (%r15,%r12,8)
movq $0x0, 0x20(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2f694(%rip), %rdi     # 0x60bd0
xorl %eax, %eax
callq 0x1917b
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/marsh.c
// Function: janet_unmarshal
Janet janet_unmarshal(
    const uint8_t *bytes,
    size_t len,
    int flags,
    JanetTable *reg,
    const uint8_t **next) {
    UnmarshalState st;
    st.start = bytes;
    st.end = bytes + len;
    st.lookup_defs = NULL;
    st.lookup_envs = NULL;
    st.lookup = NULL;
    st.reg = reg;
    Janet out;
    const uint8_t *nextbytes = unmarshal_one(&st, bytes, &out, flags);
    if (next) *next = nextbytes;
    janet_v_free(st.lookup_defs);
    janet_v_free(st.lookup_envs);
    janet_v_free(st.lookup);
    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %r8, %rbx
movl %edx, %eax
movq %rdi, %r8
leaq -0x108(%rbp), %rdi
movq %r8, 0xe8(%rdi)
addq %r8, %rsi
movq %rsi, 0xf0(%rdi)
movq $0x0, 0xc8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0xd8(%rdi)
movq %rcx, 0xd0(%rdi)
leaq -0x10(%rbp), %rdx
movq %r8, %rsi
movl %eax, %ecx
callq 0x30822
testq %rbx, %rbx
je 0x315da
movq %rax, (%rbx)
movq -0x28(%rbp), %rdi
testq %rdi, %rdi
je 0x315ec
addq $-0x8, %rdi
callq 0x2c187
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x315fe
addq $-0x8, %rdi
callq 0x2c187
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x31610
addq $-0x8, %rdi
callq 0x2c187
movq -0x10(%rbp), %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/marsh.c
// Function: marshal_one_abstract
static void marshal_one_abstract(MarshalState *st, Janet x, int flags) {
    void *abstract = janet_unwrap_abstract(x);
#ifdef JANET_EV
    /* Threaded abstract types get passed through as pointers in the unsafe mode */
    if ((flags & JANET_MARSHAL_UNSAFE) &&
            (JANET_MEMORY_THREADED_ABSTRACT == (janet_abstract_head(abstract)->gc.flags & JANET_MEM_TYPEBITS))) {

        /* Increment refcount before sending message. This prevents a "death in transit" problem
         * where a message is garbage collected while in transit between two threads - i.e., the sending threads
         * loses the reference and runs a garbage collection before the receiving thread gets the message. */
        janet_abstract_incref(abstract);
        pushbyte(st, LB_THREADED_ABSTRACT);
        pushbytes(st, (uint8_t *) &abstract, sizeof(abstract));
        MARK_SEEN();
        return;
    }
#endif
    const JanetAbstractType *at = janet_abstract_type(abstract);
    if (at->marshal) {
        pushbyte(st, LB_ABSTRACT);
        marshal_one(st, janet_csymbolv(at->name), flags + 1);
        JanetMarshalContext context = {st, NULL, flags + 1, NULL, at};
        at->marshal(abstract, &context);
    } else {
        janet_panicf("cannot marshal %p", x);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x4f838
movq %rax, -0x28(%rbp)
btl $0x11, %r15d
jae 0x3186f
cmpb $0xd, -0x20(%rax)
jne 0x3186f
movq %rax, %rdi
callq 0x14683
movq (%rbx), %rdi
movl $0xe0, %esi
callq 0x179a7
movq (%rbx), %rdi
leaq -0x28(%rbp), %rsi
movl $0x8, %edx
callq 0x17925
cmpl $0x0, 0x54(%rbx)
je 0x318d6
leaq 0x8(%rbx), %r15
movl 0x50(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x50(%rbx)
cvtsi2sd %eax, %xmm0
callq 0x4fab8
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x481b3
jmp 0x318d6
movq -0x10(%rax), %r12
cmpq $0x0, 0x28(%r12)
je 0x318e3
movq (%rbx), %rdi
movl $0xd9, %esi
callq 0x179a7
movq (%r12), %rdi
callq 0x47cd3
movabsq $-0x5800000000000, %rsi # imm = 0xFFFA800000000000
movq %rax, %rdi
callq 0x4f9ad
incl %r15d
movq %rbx, %rdi
movq %rax, %rsi
movl %r15d, %edx
callq 0x2fb6f
leaq -0x50(%rbp), %rsi
movq %rbx, (%rsi)
xorl %eax, %eax
movq %rax, 0x8(%rsi)
movl %r15d, 0x10(%rsi)
movq %rax, 0x18(%rsi)
movq %r12, 0x20(%rsi)
movq -0x28(%rbp), %rdi
callq *0x28(%r12)
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2f372(%rip), %rdi     # 0x60c5c
movq %r14, %rsi
xorl %eax, %eax
callq 0x1917b
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/marsh.c
// Function: janet_marshal_u32s
static void janet_marshal_u32s(MarshalState *st, const uint32_t *u32s, int32_t n) {
    for (int32_t i = 0; i < n; i++) {
        pushbyte(st, u32s[i] & 0xFF);
        pushbyte(st, (u32s[i] >> 8) & 0xFF);
        pushbyte(st, (u32s[i] >> 16) & 0xFF);
        pushbyte(st, (u32s[i] >> 24) & 0xFF);
    }
}

// Assembly:
testl %edx, %edx
jle 0x320cd
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %r15d
xorl %r12d, %r12d
movzbl (%rbx,%r12,4), %esi
movq (%r14), %rdi
callq 0x179a7
movzbl 0x1(%rbx,%r12,4), %esi
movq (%r14), %rdi
callq 0x179a7
movzbl 0x2(%rbx,%r12,4), %esi
movq (%r14), %rdi
callq 0x179a7
movzbl 0x3(%rbx,%r12,4), %esi
movq (%r14), %rdi
callq 0x179a7
incq %r12
cmpq %r12, %r15
jne 0x32086
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/marsh.c
// Function: readnat
static int32_t readnat(UnmarshalState *st, const uint8_t **atdata) {
    int32_t ret = readint(st, atdata);
    if (ret < 0) {
        janet_panicf("expected integer >= 0, got %d", ret);
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x30618
testl %eax, %eax
js 0x320dd
popq %rbp
retq
leaq 0x2ed4a(%rip), %rdi     # 0x60e2e
movl %eax, %esi
xorl %eax, %eax
callq 0x1917b
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/marsh.c
// Function: unmarshal_one_abstract
static const uint8_t *unmarshal_one_abstract(UnmarshalState *st, const uint8_t *data, Janet *out, int flags) {
    Janet key;
    data = unmarshal_one(st, data, &key, flags + 1);
    const JanetAbstractType *at = janet_get_abstract_type(key);
    if (at == NULL) janet_panic("unknown abstract type");
    if (at->unmarshal) {
        JanetMarshalContext context = {NULL, st, flags, data, at};
        void *abst = at->unmarshal(&context);
        janet_assert(abst != NULL, "null pointer abstract");
        *out = janet_wrap_abstract(abst);
        if (context.at != NULL) {
            janet_panic("janet_unmarshal_abstract not called");
        }
        return context.data;
    }
    janet_panic("invalid abstract type - no unmarshal function pointer");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %r14d
movq %rdx, %rbx
movq %rdi, %r15
leal 0x1(%r14), %ecx
leaq -0x30(%rbp), %r13
movq %r13, %rdx
callq 0x30822
movq %rax, %r12
movq (%r13), %rdi
callq 0x49c37
testq %rax, %rax
je 0x32ef0
movq 0x30(%rax), %rcx
testq %rcx, %rcx
je 0x32efc
leaq -0x58(%rbp), %rdi
movq $0x0, (%rdi)
movq %r15, 0x8(%rdi)
movl %r14d, 0x10(%rdi)
movq %r12, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq *%rcx
testq %rax, %rax
je 0x32f08
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %rax, %rdi
callq 0x4f9f2
movq %rax, (%rbx)
cmpq $0x0, -0x38(%rbp)
jne 0x32f0d
movq -0x40(%rbp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2e0a5(%rip), %rdi     # 0x60f9c
callq 0x19263
leaq 0x2e0e9(%rip), %rdi     # 0x60fec
callq 0x19263
callq 0x13c2c
leaq 0x2e0b4(%rip), %rdi     # 0x60fc8
callq 0x19263
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/marsh.c
// Function: janet_unmarshal_u32s
static const uint8_t *janet_unmarshal_u32s(UnmarshalState *st, const uint8_t *data, uint32_t *into, int32_t n) {
    for (int32_t i = 0; i < n; i++) {
        MARSH_EOS(st, data + 3);
        into[i] =
            (uint32_t)(data[0]) |
            ((uint32_t)(data[1]) << 8) |
            ((uint32_t)(data[2]) << 16) |
            ((uint32_t)(data[3]) << 24);
        data += 4;
    }
    return data;
}

// Assembly:
testl %ecx, %ecx
jle 0x32f4e
movq 0xf0(%rdi), %rax
movl %ecx, %ecx
shlq $0x2, %rcx
leaq 0x3(%rsi), %r8
xorl %edi, %edi
leaq (%r8,%rdi), %r9
cmpq %rax, %r9
jae 0x32f52
movl -0x3(%r8,%rdi), %r9d
movl %r9d, (%rdx,%rdi)
addq $0x4, %rdi
cmpq %rdi, %rcx
jne 0x32f30
addq %rdi, %rsi
movq %rsi, %rax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x2dc2f(%rip), %rdi     # 0x60b8c
callq 0x19263
nop
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/math.c
// Function: janet_rng_marshal
static void janet_rng_marshal(void *p, JanetMarshalContext *ctx) {
    JanetRNG *rng = (JanetRNG *)p;
    janet_marshal_abstract(ctx, p);
    janet_marshal_int(ctx, (int32_t) rng->a);
    janet_marshal_int(ctx, (int32_t) rng->b);
    janet_marshal_int(ctx, (int32_t) rng->c);
    janet_marshal_int(ctx, (int32_t) rng->d);
    janet_marshal_int(ctx, (int32_t) rng->counter);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0x304eb
movl (%r14), %esi
movq %rbx, %rdi
callq 0x2fa6f
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x2fa6f
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x2fa6f
movl 0xc(%r14), %esi
movq %rbx, %rdi
callq 0x2fa6f
movl 0x10(%r14), %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2fa6f
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/math.c
// Function: janet_rng_unmarshal
static void *janet_rng_unmarshal(JanetMarshalContext *ctx) {
    JanetRNG *rng = janet_unmarshal_abstract(ctx, sizeof(JanetRNG));
    rng->a = (uint32_t) janet_unmarshal_int(ctx);
    rng->b = (uint32_t) janet_unmarshal_int(ctx);
    rng->c = (uint32_t) janet_unmarshal_int(ctx);
    rng->d = (uint32_t) janet_unmarshal_int(ctx);
    rng->counter = (uint32_t) janet_unmarshal_int(ctx);
    return rng;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x14, %esi
callq 0x31543
movq %rax, %r14
movq %rbx, %rdi
callq 0x30606
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x30606
movl %eax, 0x4(%r14)
movq %rbx, %rdi
callq 0x30606
movl %eax, 0x8(%r14)
movq %rbx, %rdi
callq 0x30606
movl %eax, 0xc(%r14)
movq %rbx, %rdi
callq 0x30606
movl %eax, 0x10(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/math.c
// Function: janet_rng_seed
void janet_rng_seed(JanetRNG *rng, uint32_t seed) {
    rng->a = seed;
    rng->b = 0x97654321u;
    rng->c = 123871873u;
    rng->d = 0xf23f56c8u;
    rng->counter = 0u;
    /* First several numbers aren't that random. */
    for (int i = 0; i < 16; i++) janet_rng_u32(rng);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %esi, (%rdi)
movaps 0x2dfb7(%rip), %xmm0    # 0x61040
movups %xmm0, 0x4(%rdi)
movl $0x7622281, %r10d       # imm = 0x7622281
movl $0xf23f56c8, %r9d       # imm = 0xF23F56C8
movl $0x10, %ecx
movl $0x97654321, %eax       # imm = 0x97654321
movl %eax, %edx
movl %r10d, %r8d
movl %esi, %eax
movl %r9d, %esi
shrl $0x2, %esi
xorl %r9d, %esi
movl %eax, %r9d
shll $0x4, %r9d
xorl %eax, %r9d
xorl %esi, %r9d
addl %esi, %esi
xorl %r9d, %esi
movl %r10d, %r9d
movl %edx, %r10d
decl %ecx
jne 0x330a3
movl %r8d, 0xc(%rdi)
movl %esi, (%rdi)
movl %edx, 0x8(%rdi)
movl %eax, 0x4(%rdi)
movl $0x587c50, 0x10(%rdi)   # imm = 0x587C50
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/math.c
// Function: janet_rng_u32
uint32_t janet_rng_u32(JanetRNG *rng) {
    /* Algorithm "xorwow" from p. 5 of Marsaglia, "Xorshift RNGs" */
    uint32_t t = rng->d;
    uint32_t const s = rng->a;
    rng->d = rng->c;
    rng->c = rng->b;
    rng->b = s;
    t ^= t >> 2;
    t ^= t << 1;
    t ^= s ^ (s << 4);
    rng->a = t;
    rng->counter += 362437;
    return t + rng->counter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0xc(%rdi), %eax
movl (%rdi), %ecx
movq 0x4(%rdi), %rdx
movq %rdx, 0x8(%rdi)
movl %ecx, 0x4(%rdi)
movl %eax, %edx
shrl $0x2, %edx
xorl %eax, %edx
movl %ecx, %eax
shll $0x4, %eax
xorl %ecx, %eax
xorl %edx, %eax
addl %edx, %edx
xorl %eax, %edx
movl %edx, (%rdi)
movl 0x10(%rdi), %eax
leal 0x587c5(%rax), %ecx
movl %ecx, 0x10(%rdi)
addl %edx, %eax
addl $0x587c5, %eax          # imm = 0x587C5
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/math.c
// Function: janet_rng_longseed
void janet_rng_longseed(JanetRNG *rng, const uint8_t *bytes, int32_t len) {
    uint8_t state[16] = {0};
    for (int32_t i = 0; i < len; i++)
        state[i & 0xF] ^= bytes[i];
    rng->a = state[0] + ((uint32_t) state[1] << 8) + ((uint32_t) state[2] << 16) + ((uint32_t) state[3] << 24);
    rng->b = state[4] + ((uint32_t) state[5] << 8) + ((uint32_t) state[6] << 16) + ((uint32_t) state[7] << 24);
    rng->c = state[8] + ((uint32_t) state[9] << 8) + ((uint32_t) state[10] << 16) + ((uint32_t) state[11] << 24);
    rng->d = state[12] + ((uint32_t) state[13] << 8) + ((uint32_t) state[14] << 16) + ((uint32_t) state[15] << 24);
    rng->counter = 0u;
    /* a, b, c, d can't all be 0 */
    if (rng->a == 0) rng->a = 1u;
    for (int i = 0; i < 16; i++) janet_rng_u32(rng);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorps %xmm0, %xmm0
movaps %xmm0, -0x10(%rbp)
testl %edx, %edx
jle 0x3314d
movl %edx, %eax
xorl %ecx, %ecx
movb (%rsi,%rcx), %dl
movl %ecx, %r8d
andl $0xf, %r8d
xorb %dl, -0x10(%rbp,%r8)
incq %rcx
cmpq %rcx, %rax
jne 0x33136
movl -0x10(%rbp), %eax
movl %eax, (%rdi)
movl -0xc(%rbp), %ecx
movl %ecx, 0x4(%rdi)
movl -0x8(%rbp), %ecx
movl %ecx, 0x8(%rdi)
movl -0x4(%rbp), %ecx
movl %ecx, 0xc(%rdi)
movl $0x0, 0x10(%rdi)
testl %eax, %eax
jne 0x33175
movl $0x1, (%rdi)
movl 0xc(%rdi), %r10d
movl (%rdi), %edx
movl 0x4(%rdi), %ecx
movl 0x8(%rdi), %r11d
movl 0x10(%rdi), %eax
movl $0x10, %esi
movl %ecx, %r8d
movl %r11d, %r9d
movl %edx, %ecx
movl %r10d, %edx
shrl $0x2, %edx
xorl %r10d, %edx
movl %ecx, %r10d
shll $0x4, %r10d
xorl %ecx, %r10d
xorl %edx, %r10d
addl %edx, %edx
xorl %r10d, %edx
movl %r11d, %r10d
movl %r8d, %r11d
decl %esi
jne 0x3318a
addl $0x587c50, %eax         # imm = 0x587C50
movl %r9d, 0xc(%rdi)
movl %edx, (%rdi)
movl %r8d, 0x8(%rdi)
movl %ecx, 0x4(%rdi)
movl %eax, 0x10(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/math.c
// Function: janet_rng_double
double janet_rng_double(JanetRNG *rng) {
    uint32_t hi = janet_rng_u32(rng);
    uint32_t lo = janet_rng_u32(rng);
    uint64_t big = (uint64_t)(lo) | (((uint64_t) hi) << 32);
    return ldexp((double)(big >> (64 - 52)), -52);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0xc(%rdi), %ecx
movl 0x8(%rdi), %edx
movl (%rdi), %esi
movl 0x4(%rdi), %r8d
movl %ecx, %eax
shrl $0x2, %eax
xorl %ecx, %eax
movl %esi, %ecx
shll $0x4, %ecx
xorl %esi, %ecx
xorl %eax, %ecx
addl %eax, %eax
xorl %ecx, %eax
movl 0x10(%rdi), %r9d
leal (%r9,%rax), %ecx
addl $0x587c5, %ecx          # imm = 0x587C5
movl %r8d, 0xc(%rdi)
movl %esi, 0x8(%rdi)
movl %eax, 0x4(%rdi)
movl %edx, %esi
shrl $0x2, %esi
xorl %edx, %esi
leal (%rsi,%rsi), %edx
xorl %esi, %edx
xorl %eax, %edx
shll $0x4, %eax
xorl %edx, %eax
movl %eax, (%rdi)
addl %r9d, %eax
addl $0xb0f8a, %eax          # imm = 0xB0F8A
movl %r9d, %edx
addl $0xb0f8a, %edx          # imm = 0xB0F8A
movl %edx, 0x10(%rdi)
shlq $0x20, %rcx
orq %rax, %rcx
shrq $0xc, %rcx
cvtsi2sd %rcx, %xmm0
movl $0xffffffcc, %edi       # imm = 0xFFFFFFCC
popq %rbp
jmp 0x12130
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/math.c
// Function: rng_get_4bytes
static void rng_get_4bytes(JanetRNG *rng, uint8_t *buf) {
    uint32_t word = janet_rng_u32(rng);
    buf[0] = word & 0xFF;
    buf[1] = (word >> 8) & 0xFF;
    buf[2] = (word >> 16) & 0xFF;
    buf[3] = (word >> 24) & 0xFF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0xc(%rdi), %eax
movl (%rdi), %ecx
movq 0x4(%rdi), %rdx
movq %rdx, 0x8(%rdi)
movl %ecx, 0x4(%rdi)
movl %eax, %edx
shrl $0x2, %edx
xorl %eax, %edx
movl %ecx, %eax
shll $0x4, %eax
xorl %ecx, %eax
xorl %edx, %eax
addl %edx, %edx
xorl %eax, %edx
movl %edx, (%rdi)
movl 0x10(%rdi), %eax
leal 0x587c5(%rax), %ecx
movl %ecx, 0x10(%rdi)
leal 0x587c5(%rax,%rdx), %eax
movb %al, (%rsi)
movb %ah, 0x1(%rsi)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x2(%rsi)
shrl $0x18, %eax
movb %al, 0x3(%rsi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/math.c
// Function: janet_gcd
static double janet_gcd(double x, double y) {
    if (isnan(x) || isnan(y)) {
#ifdef NAN
        return NAN;
#else
        return 0.0 / 0.0;
#endif
    }
    if (isinf(x) || isinf(y)) return INFINITY;
    while (y != 0) {
        double temp = y;
        y = fmod(x, y);
        x = temp;
    }
    return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
ucomisd %xmm1, %xmm0
jp 0x33e22
movq %xmm0, %rax
btrq $0x3f, %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
cmpq %rcx, %rax
sete %al
movq %xmm1, %rdx
btrq $0x3f, %rdx
cmpq %rcx, %rdx
sete %cl
orb %al, %cl
je 0x33de3
movsd 0x261bf(%rip), %xmm2    # 0x59fa0
jmp 0x33e18
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jne 0x33def
jnp 0x33e14
movsd %xmm1, -0x8(%rbp)
callq 0x124c0
xorpd %xmm3, %xmm3
movsd -0x8(%rbp), %xmm2
movapd %xmm0, %xmm1
ucomisd %xmm3, %xmm0
movapd %xmm2, %xmm0
jne 0x33def
jp 0x33def
jmp 0x33e18
movapd %xmm0, %xmm2
movapd %xmm2, %xmm0
addq $0x10, %rsp
popq %rbp
retq
movsd 0x2d226(%rip), %xmm2    # 0x61050
jmp 0x33e18
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/net.c
// Function: net_callback_connect
void net_callback_connect(JanetFiber *fiber, JanetAsyncEvent event) {
    JanetStream *stream = fiber->ev_stream;
    switch (event) {
        default:
            break;
#ifndef JANET_WINDOWS
        /* Wait until we have an actual event before checking.
         * Windows doesn't support async connect with this, just try immediately.*/
        case JANET_ASYNC_EVENT_INIT:
#endif
        case JANET_ASYNC_EVENT_DEINIT:
            return;
        case JANET_ASYNC_EVENT_CLOSE:
            janet_cancel(fiber, janet_cstringv("stream closed"));
            janet_async_end(fiber);
            return;
    }
#ifdef JANET_WINDOWS
    int res = 0;
    int size = sizeof(res);
    int r = getsockopt((SOCKET)stream->handle, SOL_SOCKET, SO_ERROR, (char *)&res, &size);
#else
    int res = 0;
    socklen_t size = sizeof res;
    int r = getsockopt(stream->handle, SOL_SOCKET, SO_ERROR, &res, &size);
#endif
    if (r == 0) {
        if (res == 0) {
            janet_schedule(fiber, janet_wrap_abstract(stream));
        } else {
            janet_cancel(fiber, janet_cstringv(janet_strerror(res)));
            stream->flags |= JANET_STREAM_TOCLOSE;
        }
    } else {
        janet_cancel(fiber, janet_ev_lasterr());
        stream->flags |= JANET_STREAM_TOCLOSE;
    }
    janet_async_end(fiber);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
testl %esi, %esi
je 0x34225
cmpl $0x2, %esi
je 0x34225
movq %rdi, %rbx
cmpl $0x3, %esi
jne 0x341b1
leaq 0x2788a(%rip), %rdi     # 0x5ba09
callq 0x4516c
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
movq %rax, %rdi
callq 0x4f9ad
movq %rbx, %rdi
movq %rax, %rsi
callq 0x22cdf
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x226b4
movq 0x58(%rbx), %r14
leaq -0x14(%rbp), %rcx
movl $0x0, (%rcx)
leaq -0x18(%rbp), %r8
movl $0x4, (%r8)
movl (%r14), %edi
movl $0x1, %esi
movl $0x4, %edx
callq 0x12560
testl %eax, %eax
je 0x341e7
callq 0x25958
jmp 0x3420d
movl -0x14(%rbp), %edi
testl %edi, %edi
je 0x3422e
callq 0x4a8ae
movq %rax, %rdi
callq 0x4516c
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
movq %rax, %rdi
callq 0x4f9ad
movq %rbx, %rdi
movq %rax, %rsi
callq 0x22cdf
orb $0x1, 0x6(%r14)
movq %rbx, %rdi
callq 0x226b4
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %r14, %rdi
callq 0x4f9f2
movq %rbx, %rdi
movq %rax, %rsi
callq 0x22cf0
jmp 0x3421d
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/net.c
// Function: janet_get_sockettype
static int janet_get_sockettype(Janet *argv, int32_t argc, int32_t n) {
    JanetKeyword stype = janet_optkeyword(argv, argc, n, NULL);
    int socktype = SOCK_DGRAM;
    if ((NULL == stype) || !janet_cstrcmp(stype, "stream")) {
        socktype = SOCK_STREAM;
    } else if (janet_cstrcmp(stype, "datagram")) {
        janet_panicf("expected socket type as :stream or :datagram, got %v", argv[n]);
    }
    return socktype;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x19700
movl $0x1, %r14d
testq %rax, %rax
je 0x345f3
movq %rax, %r15
leaq 0x274df(%rip), %rsi     # 0x5baad
movq %rax, %rdi
callq 0x4920e
testl %eax, %eax
je 0x345f3
leaq 0x2f1a1(%rip), %rsi     # 0x63782
movq %r15, %rdi
callq 0x4920e
movl $0x2, %r14d
testl %eax, %eax
jne 0x34601
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %rsi
leaq 0x2f17f(%rip), %rdi     # 0x6378b
xorl %eax, %eax
callq 0x1917b
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/net.c
// Function: serverify_socket
static const char *serverify_socket(JSock sfd, int reuse_addr, int reuse_port) {
    /* Set various socket options */
    int enable = 1;
    if (reuse_addr) {
        if (setsockopt(sfd, SOL_SOCKET, SO_REUSEADDR, (char *) &enable, sizeof(int)) < 0) {
            return "setsockopt(SO_REUSEADDR) failed";
        }
    }
    if (reuse_port) {
#ifdef SO_REUSEPORT
        if (setsockopt(sfd, SOL_SOCKET, SO_REUSEPORT, &enable, sizeof(int)) < 0) {
            return "setsockopt(SO_REUSEPORT) failed";
        }
#else
        (void) reuse_port;
#endif
    }
    janet_net_socknoblock(sfd);
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movl %edi, %ebx
movl $0x1, -0x14(%rbp)
testl %esi, %esi
je 0x34e09
leaq -0x14(%rbp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x121f0
testl %eax, %eax
js 0x34e57
testl %r14d, %r14d
je 0x34e2d
leaq -0x14(%rbp), %rcx
movl %ebx, %edi
movl $0x1, %esi
movl $0xf, %edx
movl $0x4, %r8d
callq 0x121f0
testl %eax, %eax
js 0x34e60
xorl %r14d, %r14d
movl %ebx, %edi
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x12920
orl $0x800, %eax            # imm = 0x800
movl %ebx, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x12920
jmp 0x34e67
leaq 0x2e986(%rip), %r14     # 0x637e4
jmp 0x34e67
leaq 0x2e99d(%rip), %r14     # 0x63804
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/net.c
// Function: janet_so_getname
static Janet janet_so_getname(const void *sa_any) {
    const struct sockaddr *sa = sa_any;
    char buffer[SA_ADDRSTRLEN];
    switch (sa->sa_family) {
        default:
            janet_panic("unknown address family");
        case AF_INET: {
            const struct sockaddr_in *sai = sa_any;
            if (!inet_ntop(AF_INET, &(sai->sin_addr), buffer, sizeof(buffer))) {
                janet_panic("unable to decode ipv4 host address");
            }
            Janet pair[2] = {janet_cstringv(buffer), janet_wrap_integer(ntohs(sai->sin_port))};
            return janet_wrap_tuple(janet_tuple_n(pair, 2));
        }
#ifndef JANET_NO_IPV6
        case AF_INET6: {
            const struct sockaddr_in6 *sai6 = sa_any;
            if (!inet_ntop(AF_INET6, &(sai6->sin6_addr), buffer, sizeof(buffer))) {
                janet_panic("unable to decode ipv4 host address");
            }
            Janet pair[2] = {janet_cstringv(buffer), janet_wrap_integer(ntohs(sai6->sin6_port))};
            return janet_wrap_tuple(janet_tuple_n(pair, 2));
        }
#endif
#ifndef JANET_WINDOWS
        case AF_UNIX: {
            const struct sockaddr_un *sun = sa_any;
            Janet pathname;
            if (sun->sun_path[0] == '\0') {
                memcpy(buffer, sun->sun_path, sizeof(sun->sun_path));
                buffer[0] = '@';
                pathname = janet_cstringv(buffer);
            } else {
                pathname = janet_cstringv(sun->sun_path);
            }
            return janet_wrap_tuple(janet_tuple_n(&pathname, 1));
        }
#endif
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
movzwl (%rdi), %eax
cmpl $0x1, %eax
je 0x34fd1
cmpl $0x2, %eax
je 0x34f67
cmpl $0xa, %eax
jne 0x3504a
leaq 0x8(%rbx), %rsi
leaq -0x90(%rbp), %rdx
movl $0xa, %edi
jmp 0x34f77
leaq 0x4(%rbx), %rsi
leaq -0x90(%rbp), %rdx
movl $0x2, %edi
movl $0x6d, %ecx
callq 0x12030
testq %rax, %rax
je 0x3503e
leaq -0x90(%rbp), %rdi
callq 0x4516c
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
movq %rax, %rdi
callq 0x4f9ad
leaq -0x20(%rbp), %r14
movq %rax, (%r14)
movzwl 0x2(%rbx), %eax
rolw $0x8, %ax
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
callq 0x4fab8
movq %rax, 0x8(%r14)
movq %r14, %rdi
movl $0x2, %esi
jmp 0x3501b
leaq 0x2(%rbx), %rsi
cmpb $0x0, 0x2(%rbx)
jne 0x34ff5
leaq -0x90(%rbp), %rbx
movl $0x6c, %edx
movq %rbx, %rdi
callq 0x12680
movb $0x40, (%rbx)
movq %rbx, %rsi
movq %rsi, %rdi
callq 0x4516c
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
movq %rax, %rdi
callq 0x4f9ad
leaq -0x20(%rbp), %rdi
movq %rax, (%rdi)
movl $0x1, %esi
callq 0x48a9f
movabsq $-0x4000000000000, %rsi # imm = 0xFFFC000000000000
movq %rax, %rdi
callq 0x4f9ad
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2e7f6(%rip), %rdi     # 0x6383b
callq 0x19263
leaq 0x2e7d3(%rip), %rdi     # 0x63824
callq 0x19263
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/net.c
// Function: janet_sched_accept
JANET_NO_RETURN static void janet_sched_accept(JanetStream *stream, JanetFunction *fun) {
    NetStateAccept *state = janet_malloc(sizeof(NetStateAccept));
    memset(state, 0, sizeof(NetStateAccept));
    state->function = fun;
    if (fun) janet_stream_level_triggered(stream);
    janet_async_start(stream, JANET_ASYNC_LISTEN_READ, net_callback_accept, state);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movl $0x8, %edi
callq 0x12770
movq %rax, %r14
movq %r15, (%rax)
testq %r15, %r15
je 0x351cf
movq %rbx, %rdi
callq 0x25456
leaq -0xf89(%rip), %rdx      # 0x3424d
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rcx
callq 0x2282d
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/os.c
// Function: os_proc_wait_impl
static Janet
#endif
os_proc_wait_impl(JanetProc *proc) {
    if (proc->flags & (JANET_PROC_WAITED | JANET_PROC_WAITING)) {
        janet_panicf("cannot wait twice on a process");
    }
#ifdef JANET_EV
    /* Event loop implementation - threaded call */
    proc->flags |= JANET_PROC_WAITING;
    JanetEVGenericMessage targs;
    memset(&targs, 0, sizeof(targs));
    targs.argp = proc;
    targs.fiber = janet_root_fiber();
    targs.argi = (uint32_t) targs.fiber->sched_id;
    janet_gcroot(janet_wrap_abstract(proc));
    janet_gcroot(janet_wrap_fiber(targs.fiber));
    janet_ev_threaded_call(janet_proc_wait_subr, targs, janet_proc_wait_cb);
    janet_await();
#else
    /* Non evented implementation */
    proc->flags |= JANET_PROC_WAITED;
    int status = 0;
#ifdef JANET_WINDOWS
    WaitForSingleObject(proc->pHandle, INFINITE);
    GetExitCodeProcess(proc->pHandle, &status);
    if (!(proc->flags & JANET_PROC_CLOSED)) {
        proc->flags |= JANET_PROC_CLOSED;
        CloseHandle(proc->pHandle);
        CloseHandle(proc->tHandle);
    }
#else
    waitpid(proc->pid, &status, 0);
#endif
    proc->return_code = (int32_t) status;
    return janet_wrap_integer(proc->return_code);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x48, %rsp
movl (%rdi), %eax
testb $0x6, %al
jne 0x35b42
movq %rdi, %rbx
orl $0x4, %eax
movl %eax, (%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
movaps %xmm0, -0x20(%rbp)
movq %rdi, -0x28(%rbp)
callq 0x2a2a1
movq %rax, -0x18(%rbp)
movl 0x48(%rax), %eax
movl %eax, -0x2c(%rbp)
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %rbx, %rdi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b5e5
movq -0x18(%rbp), %rdi
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
callq 0x4f9f2
movq %rax, %rdi
callq 0x2b5e5
movaps -0x30(%rbp), %xmm0
movaps -0x20(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x2d5a(%rip), %rdi      # 0x3888b
leaq 0x2e13(%rip), %rsi      # 0x3894b
callq 0x255a5
callq 0x2286e
leaq 0x3189c(%rip), %rdi     # 0x673e5
xorl %eax, %eax
callq 0x1917b
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/os.c
// Function: get_signal_kw
static int get_signal_kw(const Janet *argv, int32_t n) {
    JanetKeyword signal_kw = janet_getkeyword(argv, n);
    const struct keyword_signal *ptr = signal_keywords;
    while (ptr->keyword) {
        if (!janet_cstrcmp(signal_kw, ptr->keyword)) {
            return ptr->signal;
        }
        ptr++;
    }
    janet_panicf("undefined signal %v", argv[n]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
callq 0x19505
movq %rax, %r15
leaq 0x31759(%rip), %rsi     # 0x673a2
leaq 0x4e320(%rip), %r12     # 0x83f70
movq %r15, %rdi
callq 0x4920e
testl %eax, %eax
je 0x35c7e
movq (%r12), %rsi
addq $0x10, %r12
testq %rsi, %rsi
jne 0x35c50
movl %r14d, %eax
movq (%rbx,%rax,8), %rsi
leaq 0x317ea(%rip), %rdi     # 0x67461
xorl %eax, %eax
callq 0x1917b
movl -0x8(%r12), %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/os.c
// Function: janet_signal_trampoline
static void janet_signal_trampoline(int sig) {
    /* Do not interact with global janet state here except for janet_ev_post_event, unsafe! */
    JanetEVGenericMessage msg;
    memset(&msg, 0, sizeof(msg));
    msg.tag = sig;
    msg.argi = 1;
    janet_interpreter_interrupt(NULL);
    janet_ev_post_event(&janet_vm, janet_signal_callback, msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, -0x20(%rbp)
movaps %xmm0, -0x10(%rbp)
movl %edi, -0x20(%rbp)
movl $0x1, -0x1c(%rbp)
xorl %edi, %edi
callq 0x44fe7
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movaps -0x20(%rbp), %xmm0
movaps -0x10(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x2acd(%rip), %rsi      # 0x38a2f
movq %rax, %rdi
callq 0x2454b
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/os.c
// Function: janet_signal_trampoline_no_interrupt
static void janet_signal_trampoline_no_interrupt(int sig) {
    /* Do not interact with global janet state here except for janet_ev_post_event, unsafe! */
    JanetEVGenericMessage msg;
    memset(&msg, 0, sizeof(msg));
    msg.tag = sig;
    janet_ev_post_event(&janet_vm, janet_signal_callback, msg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, -0x20(%rbp)
movaps %xmm0, -0x10(%rbp)
movl %edi, -0x20(%rbp)
movq %fs:0x0, %rax
leaq -0x348(%rax), %rax
movaps -0x20(%rbp), %xmm0
movaps -0x10(%rbp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0x2a81(%rip), %rsi      # 0x38a2f
movq %rax, %rdi
callq 0x2454b
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/os.c
// Function: os_shell_subr
static JanetEVGenericMessage os_shell_subr(JanetEVGenericMessage args) {
    int stat = system((const char *) args.argp);
    janet_free(args.argp);
    if (args.argi) {
        args.tag = JANET_EV_TCTAG_INTEGER;
    } else {
        args.tag = JANET_EV_TCTAG_BOOLEAN;
    }
    args.argi = stat;
    return args;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rbp), %r14
movq %r14, %rdi
callq 0x12340
movl %eax, %r15d
movq %r14, %rdi
callq 0x120b0
cmpl $0x0, 0x14(%rbp)
movl $0x8, %eax
movl $0x1, %ecx
cmovel %eax, %ecx
movl %ecx, 0x10(%rbp)
movl %r15d, 0x14(%rbp)
movaps 0x20(%rbp), %xmm0
movups %xmm0, 0x10(%rbx)
movl 0x10(%rbp), %eax
movl %eax, (%rbx)
movl 0x14(%rbp), %eax
movl %eax, 0x4(%rbx)
movq 0x18(%rbp), %rax
movq %rax, 0x8(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/os.c
// Function: time_to_tm
static struct tm *time_to_tm(const Janet *argv, int32_t argc, int32_t n, struct tm *t_infos) {
    time_t t;
    if (argc > n && !janet_checktype(argv[n], JANET_NIL)) {
        int64_t integer = janet_getinteger64(argv, n);
        t = (time_t) integer;
    } else {
        time(&t);
    }
    struct tm *t_info = NULL;
    if (argc > n + 1 && janet_truthy(argv[n + 1])) {
        /* local time */
#ifdef JANET_WINDOWS
        _tzset();
        localtime_s(t_infos, &t);
        t_info = t_infos;
#else
        tzset();
        t_info = localtime_r(&t, t_infos);
#endif
    } else {
        /* utc time */
#ifdef JANET_WINDOWS
        gmtime_s(t_infos, &t);
        t_info = t_infos;
#else
        t_info = gmtime_r(&t, t_infos);
#endif
    }
    return t_info;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %r14d
movl %esi, %r12d
movq %rdi, %r15
movabsq $-0x800000000000, %r13  # imm = 0xFFFF800000000000
cmpl %edx, %esi
jle 0x3747d
movl %r14d, %eax
movq (%r15,%rax,8), %rax
andq %r13, %rax
movabsq $-0x7800000000000, %rcx # imm = 0xFFF8800000000000
cmpq %rcx, %rax
jne 0x37488
leaq -0x30(%rbp), %rdi
callq 0x126f0
jmp 0x37497
movq %r15, %rdi
movl %r14d, %esi
callq 0x19c12
movq %rax, -0x30(%rbp)
incl %r14d
cmpl %r12d, %r14d
jge 0x374cb
movl %r14d, %eax
movq (%r15,%rax,8), %rax
andq %rax, %r13
movabsq $-0x7800000000000, %rcx # imm = 0xFFF8800000000000
cmpq %rcx, %r13
je 0x374cb
movabsq $-0x7000000000000, %rcx # imm = 0xFFF9000000000000
cmpq %rcx, %r13
jne 0x374d9
testb $0x1, %al
jne 0x374d9
leaq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x123d0
jmp 0x374ea
callq 0x126d0
leaq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x12170
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/os.c
// Function: entry_getint
static timeint_t entry_getint(Janet env_entry, char *field) {
    Janet i;
    if (janet_checktype(env_entry, JANET_TABLE)) {
        JanetTable *entry = janet_unwrap_table(env_entry);
        i = janet_table_get(entry, janet_ckeywordv(field));
    } else if (janet_checktype(env_entry, JANET_STRUCT)) {
        const JanetKV *entry = janet_unwrap_struct(env_entry);
        i = janet_struct_get(entry, janet_ckeywordv(field));
    } else {
        return 0;
    }

    if (janet_checktype(i, JANET_NIL)) {
        return 0;
    }

#ifdef JANET_WINDOWS
    if (!janet_checkint(i)) {
        janet_panicf("bad slot #%s, expected 32 bit signed integer, got %v",
                     field, i);
    }
#else
    if (!janet_checkint64(i)) {
        janet_panicf("bad slot #%s, expected 64 bit signed integer, got %v",
                     field, i);
    }
#endif

    return (timeint_t)janet_unwrap_number(i);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movabsq $-0x800000000000, %r15  # imm = 0xFFFF800000000000
movq %rdi, %rax
andq %r15, %rax
movabsq $-0x3000000000000, %rcx # imm = 0xFFFD000000000000
cmpq %rcx, %rax
je 0x37869
movabsq $-0x3800000000000, %rcx # imm = 0xFFFC800000000000
cmpq %rcx, %rax
jne 0x378ab
callq 0x4f838
movq %rax, %r14
movq %rbx, %rdi
callq 0x47cd3
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4f9ad
movq %r14, %rdi
movq %rax, %rsi
callq 0x47f51
jmp 0x37896
callq 0x4f838
movq %rax, %r14
movq %rbx, %rdi
callq 0x47cd3
movabsq $-0x5000000000000, %rsi # imm = 0xFFFB000000000000
movq %rax, %rdi
callq 0x4f9ad
movq %r14, %rdi
movq %rax, %rsi
callq 0x47388
movq %rax, %r14
andq %rax, %r15
movabsq $-0x7800000000000, %rax # imm = 0xFFF8800000000000
cmpq %rax, %r15
jne 0x378af
xorl %eax, %eax
jmp 0x378c5
movq %r14, %rdi
callq 0x4a4f0
testl %eax, %eax
je 0x378d0
movq %r14, %xmm0
cvttsd2si %xmm0, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2fcd4(%rip), %rdi     # 0x675ab
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1917b
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/os.c
// Function: os_make_permstring
static Janet os_make_permstring(int32_t permissions) {
    uint8_t bytes[9] = {0};
    bytes[0] = (permissions & 0400) ? 'r' : '-';
    bytes[1] = (permissions & 0200) ? 'w' : '-';
    bytes[2] = (permissions & 0100) ? 'x' : '-';
    bytes[3] = (permissions & 0040) ? 'r' : '-';
    bytes[4] = (permissions & 0020) ? 'w' : '-';
    bytes[5] = (permissions & 0010) ? 'x' : '-';
    bytes[6] = (permissions & 0004) ? 'r' : '-';
    bytes[7] = (permissions & 0002) ? 'w' : '-';
    bytes[8] = (permissions & 0001) ? 'x' : '-';
    return janet_stringv(bytes, sizeof(bytes));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, %eax
leaq -0x10(%rbp), %rdi
movq $0x0, (%rdi)
btl $0x8, %eax
movl $0x2d, %ecx
movl $0x72, %edx
movl $0x72, %esi
cmovael %ecx, %esi
movb %sil, (%rdi)
testb %al, %al
movl $0x77, %esi
movl $0x77, %r8d
cmovnsl %ecx, %r8d
movb %r8b, 0x1(%rdi)
testb $0x40, %al
movl $0x78, %r8d
cmovel %ecx, %r8d
movb %r8b, 0x2(%rdi)
testb $0x20, %al
movl $0x72, %r8d
cmovel %ecx, %r8d
movl $0x78, %r9d
movb %r8b, 0x3(%rdi)
testb $0x10, %al
movl $0x77, %r8d
cmovel %ecx, %r8d
movb %r8b, 0x4(%rdi)
testb $0x8, %al
movl $0x78, %r8d
cmovel %ecx, %r8d
movb %r8b, 0x5(%rdi)
testb $0x4, %al
cmovel %ecx, %edx
movb %dl, 0x6(%rdi)
testb $0x2, %al
cmovel %ecx, %esi
movb %sil, 0x7(%rdi)
testb $0x1, %al
cmovel %ecx, %r9d
movb %r9b, 0x8(%rdi)
movl $0x9, %esi
callq 0x45094
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
movq %rax, %rdi
callq 0x4f9ad
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/os.c
// Function: os_get_unix_mode
static int32_t os_get_unix_mode(const Janet *argv, int32_t n) {
    int32_t unix_mode;
    if (janet_checkint(argv[n])) {
        /* Integer mode */
        int32_t x = janet_unwrap_integer(argv[n]);
        if (x < 0 || x > 0777) {
            janet_panicf("bad slot #%d, expected integer in range [0, 8r777], got %v", n, argv[n]);
        }
        unix_mode = x;
    } else {
        /* Bytes mode */
        JanetByteView bytes = janet_getbytes(argv, n);
        if (bytes.len != 9) {
            janet_panicf("bad slot #%d: expected byte sequence of length 9, got %v", n, argv[n]);
        }
        unix_mode = os_parse_permstring(bytes.bytes);
    }
    return unix_mode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %r15d
movq (%rdi,%r15,8), %rdi
callq 0x4a41f
testl %eax, %eax
je 0x384d5
cvttsd2si (%r14,%r15,8), %ecx
cmpl $0x200, %ecx            # imm = 0x200
jb 0x3854b
movq (%r14,%r15,8), %rdx
leaq 0x2f175(%rip), %rdi     # 0x67645
jmp 0x38563
movq %r14, %rdi
movl %ebx, %esi
callq 0x199cf
cmpl $0x9, %edx
jne 0x38558
xorl %ecx, %ecx
cmpb $0x72, (%rax)
sete %cl
shll $0x8, %ecx
cmpb $0x77, 0x1(%rax)
leal 0x80(%rcx), %edx
cmovnel %ecx, %edx
leal 0x40(%rdx), %ecx
cmpb $0x78, 0x2(%rax)
cmovnel %edx, %ecx
leal 0x20(%rcx), %edx
cmpb $0x72, 0x3(%rax)
cmovnel %ecx, %edx
movl %edx, %ecx
orl $0x10, %ecx
cmpb $0x77, 0x4(%rax)
cmovnel %edx, %ecx
movl %ecx, %edx
orl $0x8, %edx
cmpb $0x78, 0x5(%rax)
cmovnel %ecx, %edx
movl %edx, %ecx
orl $0x4, %ecx
cmpb $0x72, 0x6(%rax)
cmovnel %edx, %ecx
movl %ecx, %edx
orl $0x2, %edx
cmpb $0x77, 0x7(%rax)
cmovnel %ecx, %edx
xorl %ecx, %ecx
cmpb $0x78, 0x8(%rax)
sete %cl
orl %edx, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq (%r14,%r15,8), %rdx
leaq 0x2f11d(%rip), %rdi     # 0x67680
movl %ebx, %esi
xorl %eax, %eax
callq 0x1917b
// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/os.c
// Function: janet_proc_wait_cb
static void janet_proc_wait_cb(JanetEVGenericMessage args) {
    JanetProc *proc = (JanetProc *) args.argp;
    if (NULL != proc) {
        int status = args.tag;
        proc->return_code = (int32_t) status;
        proc->flags |= JANET_PROC_WAITED;
        proc->flags &= ~JANET_PROC_WAITING;
        janet_gcunroot(janet_wrap_abstract(proc));
        janet_gcunroot(janet_wrap_fiber(args.fiber));
        uint32_t sched_id = (uint32_t) args.argi;
        if (janet_fiber_can_resume(args.fiber) && args.fiber->sched_id == sched_id) {
            if ((status != 0) && (proc->flags & JANET_PROC_ERROR_NONZERO)) {
                JanetString s = janet_formatc("command failed with non-zero exit code %d", status);
                janet_cancel(args.fiber, janet_wrap_string(s));
            } else {
                janet_schedule(args.fiber, janet_wrap_integer(status));
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x18(%rbp), %r15
testq %r15, %r15
je 0x389f1
leaq 0x10(%rbp), %r12
movl (%r12), %ebx
movl %ebx, 0x8(%r15)
movl (%r15), %eax
andl $-0x7, %eax
orl $0x2, %eax
movl %eax, (%r15)
movabsq $-0x1000000000000, %rsi # imm = 0xFFFF000000000000
movq %r15, %rdi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2bd0b
movq 0x18(%r12), %r14
movabsq $-0x6800000000000, %rsi # imm = 0xFFF9800000000000
movq %r14, %rdi
callq 0x4f9f2
movq %rax, %rdi
callq 0x2bd0b
movl 0x4(%r12), %r12d
movq %r14, %rdi
callq 0x2a67c
testl %eax, %eax
je 0x389f1
cmpl %r12d, 0x48(%r14)
jne 0x389f1
testl %ebx, %ebx
je 0x389d5
testb $0x8, (%r15)
jne 0x389fa
cvtsi2sd %ebx, %xmm0
callq 0x4fab8
movq %r14, %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x22cf0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2ea36(%rip), %rdi     # 0x67437
movl %ebx, %esi
xorl %eax, %eax
callq 0x3fd86
movabsq $-0x6000000000000, %rsi # imm = 0xFFFA000000000000
movq %rax, %rdi
callq 0x4f9ad
movq %r14, %rdi
movq %rax, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x22cdf