LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: tb_hide_cursor
int tb_hide_cursor(void) {
    if_not_init_return();
    int rv;
    if (global.cursor_x >= 0) {
        if_err_return(rv,
            bytebuf_puts(&global.out, global.caps[TB_CAP_HIDE_CURSOR]));
    }
    global.cursor_x = -1;
    global.cursor_y = -1;
    return TB_OK;
}

// Assembly:
cmpl $0x0, 0x1dd78(%rip)     # 0x25c8c
je 0x7f55
cmpl $0x0, 0x1db6b(%rip)     # 0x25a88
js 0x7f47
pushq %rbx
movq 0x1dc61(%rip), %rbx     # 0x25b88
movq %rbx, %rdi
callq 0x6160
leaq 0x1dcda(%rip), %rdi     # 0x25c10
movq %rbx, %rsi
movq %rax, %rdx
callq 0x8728
testl %eax, %eax
popq %rbx
je 0x7f47
retq
movq $-0x1, 0x1db36(%rip) # 0x25a88
xorl %eax, %eax
retq
movl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: tb_set_cell_ex
int tb_set_cell_ex(int x, int y, uint32_t *ch, size_t nch, uintattr_t fg,
    uintattr_t bg) {
    if_not_init_return();
    int rv;
    struct tb_cell *cell;
    if_err_return(rv, cellbuf_get(&global.back, x, y, &cell));
    if_err_return(rv, cell_set(cell, ch, nch, fg, bg));
    return TB_OK;
}

// Assembly:
cmpl $0x0, 0x1dcbd(%rip)     # 0x25c8c
je 0x8016
movl $0xfffffff7, %eax       # imm = 0xFFFFFFF7
xorl %ecx, %ecx
testl %edi, %edi
js 0x801c
movl $0x0, %r10d
testl %esi, %esi
js 0x801f
movl 0x1dc3b(%rip), %r11d    # 0x25c28
cmpl %edi, %r11d
jle 0x801f
cmpl %esi, 0x1dc34(%rip)     # 0x25c2c
jle 0x801f
imull %esi, %r11d
addl %edi, %r11d
shlq $0x3, %r11
addq 0x1dc24(%rip), %r11     # 0x25c30
xorl %eax, %eax
movb $0x1, %r10b
movq %r11, %rcx
jmp 0x801f
movl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
retq
xorl %r10d, %r10d
testb %r10b, %r10b
je 0x801b
xorl %eax, %eax
movl $0x0, %esi
testq %rdx, %rdx
je 0x8032
movl (%rdx), %esi
movl %esi, (%rcx)
movw %r8w, 0x4(%rcx)
movw %r9w, 0x6(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: tb_set_input_mode
int tb_set_input_mode(int mode) {
    if_not_init_return();
    if (mode == TB_INPUT_CURRENT) {
        return global.input_mode;
    }

    if ((mode & (TB_INPUT_ESC | TB_INPUT_ALT)) == 0) {
        mode |= TB_INPUT_ESC;
    }

    if ((mode & (TB_INPUT_ESC | TB_INPUT_ALT)) == (TB_INPUT_ESC | TB_INPUT_ALT))
    {
        mode &= ~TB_INPUT_ALT;
    }

    if (mode & TB_INPUT_MOUSE) {
        bytebuf_puts(&global.out, TB_HARDCAP_ENTER_MOUSE);
        bytebuf_flush(&global.out, global.wfd);
    } else {
        bytebuf_puts(&global.out, TB_HARDCAP_EXIT_MOUSE);
        bytebuf_flush(&global.out, global.wfd);
    }

    global.input_mode = mode;
    return TB_OK;
}

// Assembly:
cmpl $0x0, 0x1dc38(%rip)     # 0x25c8c
je 0x80b0
testl %edi, %edi
je 0x80b6
pushq %rbx
xorl %eax, %eax
testb $0x3, %dil
sete %al
orl %edi, %eax
movl %eax, %ecx
notl %ecx
movl %eax, %ebx
andl $-0x3, %ebx
testb $0x3, %cl
cmovnel %eax, %ebx
testb $0x4, %bl
leaq 0x147ff(%rip), %rax     # 0x1c87e
leaq 0x147d7(%rip), %rsi     # 0x1c85d
cmoveq %rax, %rsi
leaq 0x1db7f(%rip), %rdi     # 0x25c10
movl $0x20, %edx
callq 0x8728
movl 0x1d9cf(%rip), %edi     # 0x25a70
callq 0x7dbd
movl %ebx, 0x1d9f4(%rip)     # 0x25aa0
xorl %eax, %eax
popq %rbx
retq
movl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
retq
movl 0x1d9e4(%rip), %eax     # 0x25aa0
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: tb_set_output_mode
int tb_set_output_mode(int mode) {
    if_not_init_return();
    switch (mode) {
        case TB_OUTPUT_CURRENT:
            return global.output_mode;
        case TB_OUTPUT_NORMAL:
        case TB_OUTPUT_256:
        case TB_OUTPUT_216:
        case TB_OUTPUT_GRAYSCALE:
#ifdef TB_OPT_TRUECOLOR
        case TB_OUTPUT_TRUECOLOR:
#endif
            global.last_fg = ~global.fg;
            global.last_bg = ~global.bg;
            global.output_mode = mode;
            return TB_OK;
    }
    return TB_ERR;
}

// Assembly:
cmpl $0x0, 0x1dbc8(%rip)     # 0x25c8c
je 0x80f6
leal -0x1(%rdi), %eax
cmpl $0x4, %eax
jae 0x80fc
movl 0x1d9c4(%rip), %eax     # 0x25a98
notl %eax
movw %ax, 0x1d9bf(%rip)      # 0x25a9c
movzwl 0x1d9b6(%rip), %eax     # 0x25a9a
notl %eax
movw %ax, 0x1d9b1(%rip)      # 0x25a9e
movl %edi, 0x1d9b1(%rip)     # 0x25aa4
xorl %eax, %eax
retq
movl $0xfffffff8, %eax       # imm = 0xFFFFFFF8
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %edi, %edi
jne 0x80f5
movl 0x1d999(%rip), %eax     # 0x25aa4
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: tb_print_ex
int tb_print_ex(int x, int y, uintattr_t fg, uintattr_t bg, size_t *out_w,
    const char *str) {
    int rv;
    uint32_t uni;
    int w, ix = x;
    if (out_w) {
        *out_w = 0;
    }
    while (*str) {
        str += tb_utf8_char_to_unicode(&uni, str);
        w = wcwidth((wchar_t)uni);
        if (w < 0) {
            w = 1;
        }
        if (w == 0 && x > ix) {
            if_err_return(rv, tb_extend_cell(x - 1, y, uni));
        } else {
            if_err_return(rv, tb_set_cell(x, y, uni, fg, bg));
        }
        x += w;
        if (out_w) {
            *out_w += w;
        }
    }
    return TB_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbx
movq %r8, %r14
movl %ecx, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %esi, 0x8(%rsp)
movl %edi, %r12d
testq %r8, %r8
je 0x8442
movq $0x0, (%r14)
cmpb $0x0, (%rbx)
je 0x8527
movl %r12d, %r13d
leaq 0x14(%rsp), %rdi
movq %rbx, %rsi
callq 0x8545
movl %eax, %r15d
movl 0x14(%rsp), %ebp
movl %ebp, %edi
callq 0x63c0
testl %eax, %eax
movl $0x1, %ecx
cmovsl %ecx, %eax
testl %eax, %eax
sete %cl
cmpl %r12d, %r13d
setg %sil
andb %cl, %sil
movl 0x1d804(%rip), %edx     # 0x25c8c
cmpb $0x1, %sil
je 0x852b
testl %edx, %edx
je 0x84e4
movl $0xfffffff7, %ecx       # imm = 0xFFFFFFF7
xorl %edx, %edx
testl %r13d, %r13d
js 0x84eb
movl $0x0, %esi
cmpl $0x0, 0x8(%rsp)
js 0x84ed
movl 0x1d774(%rip), %edi     # 0x25c28
cmpl %r13d, %edi
jle 0x84ed
movl 0x8(%rsp), %r8d
cmpl %r8d, 0x1d767(%rip)     # 0x25c2c
jle 0x84ed
imull 0x8(%rsp), %edi
addl %r13d, %edi
shlq $0x3, %rdi
addq 0x1d756(%rip), %rdi     # 0x25c30
xorl %ecx, %ecx
movb $0x1, %sil
movq %rdi, %rdx
jmp 0x84ed
movl $0xfffffff8, %ecx       # imm = 0xFFFFFFF8
jmp 0x8506
xorl %esi, %esi
testb %sil, %sil
je 0x8506
movl %ebp, (%rdx)
movl 0xc(%rsp), %ecx
movw %cx, 0x4(%rdx)
movl 0x10(%rsp), %ecx
movw %cx, 0x6(%rdx)
xorl %ecx, %ecx
testl %ecx, %ecx
jne 0x8534
testq %r14, %r14
je 0x8515
movslq %eax, %rcx
addq %rcx, (%r14)
movslq %r15d, %rcx
addq %rcx, %rbx
addl %eax, %r13d
cmpb $0x0, (%rbx)
jne 0x844e
xorl %ecx, %ecx
jmp 0x8534
xorl %ecx, %ecx
negl %edx
sbbl %ecx, %ecx
orl $-0x8, %ecx
movl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: tb_printf
int tb_printf(int x, int y, uintattr_t fg, uintattr_t bg, const char *fmt,
    ...) {
    int rv;
    va_list vl;
    va_start(vl, fmt);
    rv = tb_printf_inner(x, y, fg, bg, NULL, fmt, vl);
    va_end(vl);
    return rv;
}

// Assembly:
subq $0xe8, %rsp
movq %r8, %r10
leaq 0x30(%rsp), %r8
movq %r9, 0x28(%r8)
testb %al, %al
je 0x85f7
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
leaq 0x10(%rsp), %rax
movq %r8, 0x10(%rax)
leaq 0xf0(%rsp), %r8
movq %r8, 0x8(%rax)
movabsq $0x3000000028, %r8      # imm = 0x3000000028
movq %r8, (%rax)
movq %rax, (%rsp)
xorl %r8d, %r8d
movq %r10, %r9
callq 0x8630
addq $0xe8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: tb_printf_inner
int tb_printf_inner(int x, int y, uintattr_t fg, uintattr_t bg, size_t *out_w,
    const char *fmt, va_list vl) {
    int rv;
    char buf[TB_OPT_PRINTF_BUF];
    rv = vsnprintf(buf, sizeof(buf), fmt, vl);
    if (rv < 0 || rv >= (int)sizeof(buf)) {
        return TB_ERR;
    }
    return tb_print_ex(x, y, fg, bg, out_w, buf);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %r8, %rbx
movl %ecx, %r14d
movl %edx, %r12d
movl %esi, %ebp
movl %edi, %r15d
movq 0x1030(%rsp), %rcx
movq %rsp, %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r9, %rdx
callq 0x60f0
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0xfff, %ecx            # imm = 0xFFF
ja 0x868c
movzwl %r12w, %edx
movzwl %r14w, %ecx
movq %rsp, %r9
movl %r15d, %edi
movl %ebp, %esi
movq %rbx, %r8
callq 0x8413
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: tb_printf_ex
int tb_printf_ex(int x, int y, uintattr_t fg, uintattr_t bg, size_t *out_w,
    const char *fmt, ...) {
    int rv;
    va_list vl;
    va_start(vl, fmt);
    rv = tb_printf_inner(x, y, fg, bg, out_w, fmt, vl);
    va_end(vl);
    return rv;
}

// Assembly:
subq $0xe8, %rsp
testb %al, %al
je 0x86e1
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
leaq 0x30(%rsp), %rax
leaq 0x10(%rsp), %r10
movq %rax, 0x10(%r10)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r10)
movabsq $0x3000000030, %rax     # imm = 0x3000000030
movq %rax, (%r10)
movq %r10, (%rsp)
callq 0x8630
addq $0xe8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: bytebuf_nputs
static int bytebuf_nputs(struct bytebuf_t *b, const char *str, size_t nstr) {
    int rv;
    if_err_return(rv, bytebuf_reserve(b, b->len + nstr + 1));
    memcpy(b->buf + b->len, str, nstr);
    b->len += nstr;
    b->buf[b->len] = '\0';
    return TB_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rdx
leaq (%rbx,%rax), %rcx
incq %rcx
xorl %eax, %eax
movb $0x1, %bpl
cmpq %rcx, %rdx
jae 0x8799
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, %r12
addq %rdx, %rdx
cmpq %rcx, %r12
jb 0x875a
movq (%r14), %rdi
testq %rdi, %rdi
je 0x8777
movq %r12, %rsi
callq 0x6430
jmp 0x877f
movq %r12, %rdi
callq 0x63e0
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x8792
movq %rcx, (%r14)
movq %r12, 0x10(%r14)
jmp 0x8799
movl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
xorl %ebp, %ebp
testb %bpl, %bpl
je 0x87c1
movq (%r14), %rdi
addq 0x8(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x6360
addq 0x8(%r14), %rbx
movq %rbx, 0x8(%r14)
movq (%r14), %rax
movb $0x0, (%rax,%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: tb_sendf
int tb_sendf(const char *fmt, ...) {
    int rv;
    char buf[TB_OPT_PRINTF_BUF];
    va_list vl;
    va_start(vl, fmt);
    rv = vsnprintf(buf, sizeof(buf), fmt, vl);
    va_end(vl);
    if (rv < 0 || rv >= (int)sizeof(buf)) {
        return TB_ERR;
    }
    return tb_send(buf, (size_t)rv);
}

// Assembly:
subq $0x10d8, %rsp           # imm = 0x10D8
movq %rdi, %r10
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x8828
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %rdi, 0x10(%rcx)
leaq 0x10e0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rcx)
leaq 0xd0(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r10, %rdx
callq 0x60f0
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0xfff, %ecx            # imm = 0xFFF
ja 0x8882
movl %ecx, %edx
leaq 0x1d39b(%rip), %rdi     # 0x25c10
leaq 0xd0(%rsp), %rsi
callq 0x8728
addq $0x10d8, %rsp           # imm = 0x10D8
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/phpspy.c
// Function: log_error
void log_error(const char *fmt, ...) {
    va_list args;
    if (log_error_enabled) {
        va_start(args, fmt);
        vfprintf(stderr, fmt, args);
    }
}

// Assembly:
subq $0xd8, %rsp
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0xae2a
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
cmpl $0x0, 0x1a54f(%rip)     # 0x25380
jne 0xae3b
addq $0xd8, %rsp
retq
movq %rdi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x1a186(%rip), %rax     # 0x24ff0
movq (%rax), %rdi
movq %r10, %rsi
callq 0x6550
jmp 0xae33
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/phpspy.c
// Function: clock_get
static void clock_get(struct timespec *ts) {
    if (clock_gettime(CLOCK_MONOTONIC_RAW, ts) == -1) {
        perror("clock_gettime");
        ts->tv_sec = 0;
        ts->tv_nsec = 0;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x4, %edi
movq %rbx, %rsi
callq 0x6110
cmpl $-0x1, %eax
je 0x1337d
popq %rbx
retq
leaq 0xb7cf(%rip), %rdi      # 0x1eb53
callq 0x6530
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
jmp 0x1337b
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/phpspy.c
// Function: phpspy_zend_inline_hash_func
uint64_t phpspy_zend_inline_hash_func(const char *str, size_t len) {
    /* Adapted from zend_string.h */
    uint64_t hash;
    hash = 5381UL;

    for (; len >= 8; len -= 8) {
        hash = ((hash << 5) + hash) + *str++;
        hash = ((hash << 5) + hash) + *str++;
        hash = ((hash << 5) + hash) + *str++;
        hash = ((hash << 5) + hash) + *str++;
        hash = ((hash << 5) + hash) + *str++;
        hash = ((hash << 5) + hash) + *str++;
        hash = ((hash << 5) + hash) + *str++;
        hash = ((hash << 5) + hash) + *str++;
    }
    switch (len) {
        case 7: hash = ((hash << 5) + hash) + *str++; /* fallthrough... */
        case 6: hash = ((hash << 5) + hash) + *str++; /* fallthrough... */
        case 5: hash = ((hash << 5) + hash) + *str++; /* fallthrough... */
        case 4: hash = ((hash << 5) + hash) + *str++; /* fallthrough... */
        case 3: hash = ((hash << 5) + hash) + *str++; /* fallthrough... */
        case 2: hash = ((hash << 5) + hash) + *str++; /* fallthrough... */
        case 1: hash = ((hash << 5) + hash) + *str++; break;
        case 0: break;
    }

    return hash | 0x8000000000000000UL;
}

// Assembly:
movl $0x1505, %eax           # imm = 0x1505
cmpq $0x8, %rsi
jb 0x1342c
movq %rax, %rcx
shlq $0x5, %rcx
addq %rax, %rcx
movsbq (%rdi), %rax
addq %rcx, %rax
movsbq 0x1(%rdi), %rcx
addq %rax, %rcx
shlq $0x5, %rax
addq %rax, %rcx
movsbq 0x2(%rdi), %rax
addq %rcx, %rax
shlq $0x5, %rcx
addq %rcx, %rax
movsbq 0x3(%rdi), %rcx
addq %rax, %rcx
shlq $0x5, %rax
addq %rax, %rcx
movsbq 0x4(%rdi), %rax
addq %rcx, %rax
shlq $0x5, %rcx
addq %rcx, %rax
movsbq 0x5(%rdi), %rcx
addq %rax, %rcx
shlq $0x5, %rax
addq %rax, %rcx
movsbq 0x6(%rdi), %rdx
addq %rcx, %rdx
shlq $0x5, %rcx
addq %rcx, %rdx
movsbq 0x7(%rdi), %rax
addq %rdx, %rax
shlq $0x5, %rdx
addq $0x8, %rdi
addq %rdx, %rax
addq $-0x8, %rsi
cmpq $0x7, %rsi
ja 0x133a0
leaq 0x9181(%rip), %rcx      # 0x1c5b4
movslq (%rcx,%rsi,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movq %rax, %rcx
shlq $0x5, %rcx
addq %rax, %rcx
movsbq (%rdi), %rax
incq %rdi
addq %rcx, %rax
movq %rax, %rcx
shlq $0x5, %rcx
addq %rax, %rcx
movsbq (%rdi), %rax
incq %rdi
addq %rcx, %rax
movq %rax, %rcx
shlq $0x5, %rcx
addq %rax, %rcx
movsbq (%rdi), %rax
incq %rdi
addq %rcx, %rax
movq %rax, %rcx
shlq $0x5, %rcx
addq %rax, %rcx
movsbq (%rdi), %rax
incq %rdi
addq %rcx, %rax
movq %rax, %rcx
shlq $0x5, %rcx
addq %rax, %rcx
movsbq (%rdi), %rax
incq %rdi
addq %rcx, %rax
movq %rax, %rcx
shlq $0x5, %rcx
addq %rax, %rcx
movsbq (%rdi), %rax
incq %rdi
addq %rcx, %rax
movq %rax, %rcx
shlq $0x5, %rcx
addq %rax, %rcx
movsbq (%rdi), %rax
addq %rcx, %rax
btsq $0x3f, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: load_terminfo_from_path
static int load_terminfo_from_path(const char *path, const char *term) {
    int rv;
    char tmp[PATH_MAX];

    // Look for term at this terminfo location, e.g., <terminfo>/x/xterm
    snprintf_or_return(rv, tmp, sizeof(tmp), "%s/%c/%s", path, term[0], term);
    if_ok_return(rv, read_terminfo_path(tmp));

#ifdef __APPLE__
    // Try the Darwin equivalent path, e.g., <terminfo>/78/xterm
    snprintf_or_return(rv, tmp, sizeof(tmp), "%s/%x/%s", path, term[0], term);
    return read_terminfo_path(tmp);
#endif

    return TB_ERR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1098, %rsp           # imm = 0x1098
movq %rsi, %r9
movq %rdi, %rcx
movsbl (%rsi), %r8d
leaq 0xaa2f(%rip), %rdx      # 0x1df18
leaq 0x90(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
xorl %eax, %eax
callq 0x61d0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0xfff, %eax            # imm = 0xFFF
ja 0x13548
leaq 0xaa11(%rip), %rsi      # 0x1df21
leaq 0x90(%rsp), %rdi
callq 0x6520
testq %rax, %rax
je 0x13548
movq %rax, %rbx
movq %rax, %rdi
callq 0x6380
movq %rsp, %rsi
movl %eax, %edi
callq 0x65f0
testl %eax, %eax
je 0x13558
movq %rbx, %rdi
callq 0x6140
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x1098, %rsp           # imm = 0x1098
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x63e0
testq %rax, %rax
je 0x1353b
movq %rax, %r14
movl $0x1, %esi
movq %rax, %rdi
movq %r15, %rdx
movq %rbx, %rcx
callq 0x60e0
cmpq %r15, %rax
jne 0x1359f
movq %r14, 0x1251c(%rip)     # 0x25aa8
movq %r15, 0x1251d(%rip)     # 0x25ab0
movq %rbx, %rdi
callq 0x6140
xorl %ebp, %ebp
jmp 0x13548
movq %rbx, %rdi
callq 0x6140
movq %r14, %rdi
callq 0x6050
jmp 0x13543
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: cap_trie_add
static int cap_trie_add(const char *cap, uint16_t key, uint8_t mod) {
    struct cap_trie_t *next, *node = &global.cap_trie;
    size_t i, j;
    for (i = 0; cap[i] != '\0'; i++) {
        char c = cap[i];
        next = NULL;

        // Check if c is already a child of node
        for (j = 0; j < node->nchildren; j++) {
            if (node->children[j].c == c) {
                next = &node->children[j];
                break;
            }
        }
        if (!next) {
            // We need to add a new child to node
            node->nchildren += 1;
            node->children =
                tb_realloc(node->children, sizeof(*node) * node->nchildren);
            if (!node->children) {
                return TB_ERR_MEM;
            }
            next = &node->children[node->nchildren - 1];
            memset(next, 0, sizeof(*next));
            next->c = c;
        }

        // Continue
        node = next;
    }

    if (node->is_leaf) {
        // Already a leaf here
        return TB_ERR_CAP_COLLISION;
    }

    node->is_leaf = 1;
    node->key = key;
    node->mod = mod;
    return TB_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, 0x4(%rsp)
movl %esi, %ebp
movb (%rdi), %r13b
testb %r13b, %r13b
je 0x1365d
movq %rdi, %r14
leaq 0x12600(%rip), %r15     # 0x25bd8
xorl %r12d, %r12d
movq 0x10(%r15), %rsi
testq %rsi, %rsi
je 0x135f9
movq 0x8(%r15), %rax
movq %rsi, %rcx
cmpb %r13b, (%rax)
je 0x135fb
addq $0x20, %rax
decq %rcx
jne 0x135eb
xorl %eax, %eax
movb $0x1, %bl
testq %rax, %rax
je 0x13607
movq %rax, %r15
jmp 0x1364a
incq %rsi
movq %rsi, 0x10(%r15)
movq 0x8(%r15), %rdi
shlq $0x5, %rsi
callq 0x6430
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x13648
movq 0x10(%r15), %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %r15
addq $-0x20, %r15
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax,%rcx)
movups %xmm0, -0x10(%rax,%rcx)
movb %r13b, -0x20(%rax,%rcx)
jmp 0x1364a
xorl %ebx, %ebx
testb %bl, %bl
je 0x13689
movb 0x1(%r14,%r12), %r13b
incq %r12
testb %r13b, %r13b
jne 0x135db
jmp 0x13664
leaq 0x12574(%rip), %r15     # 0x25bd8
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
cmpl $0x0, 0x18(%r15)
jne 0x1368e
movl $0x1, 0x18(%r15)
movw %bp, 0x1c(%r15)
movl 0x4(%rsp), %eax
movb %al, 0x1e(%r15)
xorl %eax, %eax
jmp 0x1368e
movl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: cellbuf_free
static int cellbuf_free(struct cellbuf_t *c) {
    if (c->cells) {
        int i;
        for (i = 0; i < c->width * c->height; i++) {
            cell_free(&c->cells[i]);
        }
        tb_free(c->cells);
    }
    memset(c, 0, sizeof(*c));
    return TB_OK;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x13714
movl 0x4(%rbx), %eax
imull (%rbx), %eax
testl %eax, %eax
jle 0x1370b
xorl %eax, %eax
movq 0x8(%rbx), %rcx
movq $0x0, (%rcx,%rax,8)
incq %rax
movslq (%rbx), %rcx
movslq 0x4(%rbx), %rdx
imulq %rcx, %rdx
cmpq %rdx, %rax
jl 0x136ec
movq 0x8(%rbx), %rdi
callq 0x6050
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: cap_trie_deinit
static int cap_trie_deinit(struct cap_trie_t *node) {
    size_t j;
    for (j = 0; j < node->nchildren; j++) {
        cap_trie_deinit(&node->children[j]);
    }
    if (node->children) {
        tb_free(node->children);
    }
    memset(node, 0, sizeof(*node));
    return TB_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x10(%rdi)
je 0x1374a
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x8(%rbx), %rdi
addq %r14, %rdi
callq 0x1371c
incq %r15
addq $0x20, %r14
cmpq 0x10(%rbx), %r15
jb 0x13731
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x13758
callq 0x6050
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: extract_esc_user
static int extract_esc_user(struct tb_event *event, int is_post) {
    int rv;
    size_t consumed = 0;
    struct bytebuf_t *in = &global.in;
    int (*fn)(struct tb_event *, size_t *);

    fn = is_post ? global.fn_extract_esc_post : global.fn_extract_esc_pre;

    if (!fn) {
        return TB_ERR;
    }

    rv = fn(event, &consumed);
    if (rv == TB_OK) {
        bytebuf_shift(in, consumed);
    }

    if_ok_or_need_more_return(rv, rv);
    return TB_ERR;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq $0x0, (%rsp)
xorl %eax, %eax
testl %esi, %esi
setne %al
leaq 0x11d5a(%rip), %rcx     # 0x25a68
movq 0x228(%rcx,%rax,8), %rax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x13d63
movq %rsp, %rsi
callq *%rax
movl %eax, %ebx
cmpl $-0x2, %eax
je 0x13d63
testl %ebx, %ebx
jne 0x13d5e
movq (%rsp), %r14
movq 0x11ec5(%rip), %rdx     # 0x25c00
cmpq %r14, %rdx
cmovbq %rdx, %r14
subq %r14, %rdx
movq 0x11eac(%rip), %rdi     # 0x25bf8
leaq (%rdi,%r14), %rsi
callq 0x6490
subq %r14, 0x11ea4(%rip)     # 0x25c00
jmp 0x13d63
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/vendor/termbox2/termbox2.h
// Function: cellbuf_resize
static int cellbuf_resize(struct cellbuf_t *c, int w, int h) {
    int rv;

    int ow = c->width;
    int oh = c->height;

    if (ow == w && oh == h) {
        return TB_OK;
    }

    w = w < 1 ? 1 : w;
    h = h < 1 ? 1 : h;

    int minw = (w < ow) ? w : ow;
    int minh = (h < oh) ? h : oh;

    struct tb_cell *prev = c->cells;

    if_err_return(rv, cellbuf_init(c, w, h));
    if_err_return(rv, cellbuf_clear(c));

    int x, y;
    for (x = 0; x < minw; x++) {
        for (y = 0; y < minh; y++) {
            struct tb_cell *src, *dst;
            src = &prev[(y * ow) + x];
            if_err_return(rv, cellbuf_get(c, x, y, &dst));
            if_err_return(rv, cell_copy(dst, src));
        }
    }

    tb_free(prev);

    return TB_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %r12d
movq %rdi, %r15
movl (%rdi), %ebx
movl 0x4(%rdi), %esi
movl %ebx, %edi
xorl %r12d, %edi
movl %esi, %ecx
xorl %edx, %ecx
xorl %eax, %eax
orl %edi, %ecx
je 0x13f2e
cmpl $0x2, %r12d
movl $0x1, %ebp
cmovll %ebp, %r12d
cmpl $0x2, %edx
cmovgel %edx, %ebp
cmpl %ebx, %r12d
movl %ebx, %eax
cmovll %r12d, %eax
movl %eax, 0x4(%rsp)
cmpl %esi, %ebp
movl %esi, 0x1c(%rsp)
cmovll %ebp, %esi
movl %esi, 0x8(%rsp)
movq 0x8(%r15), %rax
movq %rax, 0x10(%rsp)
movq %rbp, %r13
imulq %r12, %r13
shlq $0x3, %r13
movq %r13, %rdi
callq 0x63e0
movq %rax, %r14
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0x13e06
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x6230
xorl %eax, %eax
movl %r12d, (%r15)
movl %ebp, 0x4(%r15)
jmp 0x13e0b
movl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
testq %r14, %r14
je 0x13f2e
movslq (%r15), %rax
movslq 0x4(%r15), %rcx
movl %ecx, %edi
imull %eax, %edi
testl %edi, %edi
jle 0x13e53
movzwl 0x11c6d(%rip), %edx     # 0x25a98
movzwl 0x11c68(%rip), %esi     # 0x25a9a
movl %edi, %edi
xorl %r8d, %r8d
movl $0x20, (%r14,%r8,8)
movw %dx, 0x4(%r14,%r8,8)
movw %si, 0x6(%r14,%r8,8)
incq %r8
cmpq %r8, %rdi
jne 0x13e37
testl %ebx, %ebx
jle 0x13f1c
movl 0x4(%rsp), %edx
movq %rdx, 0x20(%rsp)
movl 0x8(%rsp), %esi
movq 0x10(%rsp), %rdx
leaq 0x6(%rdx), %r11
shlq $0x3, %rbx
leaq (,%rax,8), %r8
xorl %r9d, %r9d
cmpl $0x0, 0x1c(%rsp)
movq %r11, 0x8(%rsp)
jle 0x13f01
movq %r14, %r10
xorl %r15d, %r15d
cmpq %rax, %r9
setl %r12b
cmpq %rcx, %r15
setl %bpl
andb %r12b, %bpl
movl $0x0, %r12d
cmovneq %r10, %r12
cmpb $0x1, %bpl
jne 0x13ec1
cmpq $0x0, 0x10(%rsp)
je 0x13ed2
movl -0x6(%r11), %r13d
jmp 0x13ed5
movzbl %bpl, %r12d
leal (%r12,%r12,8), %edx
addl $-0x9, %edx
movl %edx, 0x4(%rsp)
jmp 0x13eee
xorl %r13d, %r13d
movzwl -0x2(%r11), %edx
movzwl (%r11), %edi
movl %r13d, (%r12)
movw %dx, 0x4(%r12)
movw %di, 0x6(%r12)
testb %bpl, %bpl
je 0x13f2a
incq %r15
addq %rbx, %r11
addq %r8, %r10
cmpq %r15, %rsi
jne 0x13e92
incq %r9
movq 0x8(%rsp), %r11
addq $0x8, %r11
addq $0x8, %r14
cmpq 0x20(%rsp), %r9
jne 0x13e80
movq 0x10(%rsp), %rdi
callq 0x6050
xorl %eax, %eax
jmp 0x13f2e
movl 0x4(%rsp), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/phpspy.c
// Function: atoi_with_min_or_exit
static int atoi_with_min_or_exit(const char *name, const char *str, int min) {
    long result = strtol_with_min_or_exit(name, str, min);
    #if LONG_MAX > INT_MAX
    if (result > INT_MAX) {
        log_error("Expected value that could fit in a C int for %s, got '%s'\n", name, str);
        usage(stderr, 1);
    }
    #endif
    return (int)result;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x13fe6
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
jge 0x13fbe
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xa9b4(%rip), %rdi      # 0x1e979
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xadcf
movq 0x11017(%rip), %rax     # 0x24ff0
movq (%rax), %rdi
movl $0x1, %esi
callq 0xae77
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/phpspy.c
// Function: strtol_with_min_or_exit
static long strtol_with_min_or_exit(const char *name, const char *str, int min) {
    long result;
    char *end;
    errno = 0;
    result = strtol(str, &end, 10);
    if (end <= str || *end != '\0') {
        /* e.g. reject -H '', -H invalid, -H 5000suffix */
        log_error("Expected integer for %s, got '%s'\n", name, str);
        usage(stderr, 1);
    }
    if (result < min) {
        /* e.g. reject -H 0 */
        log_error("Expected integer >= %d for %s, got '%s'\n", min, name, str);
        usage(stderr, 1);
    }
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x6060
movl $0x0, (%rax)
movq %rsp, %r15
movq %rbx, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x6340
movq (%r15), %rcx
cmpq %rbx, %rcx
jbe 0x14033
cmpb $0x0, (%rcx)
jne 0x14033
movslq %ebp, %rcx
cmpq %rcx, %rax
jl 0x14049
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa97a(%rip), %rdi      # 0x1e9b4
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0xadcf
jmp 0x1405f
leaq 0xa987(%rip), %rdi      # 0x1e9d7
movl %ebp, %esi
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0xadcf
movq 0x10f8a(%rip), %rax     # 0x24ff0
movq (%rax), %rdi
movl $0x1, %esi
callq 0xae77
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/phpspy.c
// Function: redirect_child_stdio
static void redirect_child_stdio(int proc_fd, char *opt_path) {
    char *redir_path;
    FILE *redir_file;
    if (strcmp(opt_path, "-") == 0) {
        return;
    } else if (strstr(opt_path, "%d") != NULL) {
        if (asprintf(&redir_path, opt_path, getpid()) < 0) {
            errno = ENOMEM;
            perror("asprintf");
            exit(1);
        }
    } else {
        if ((redir_path = strdup(opt_path)) == NULL) {
            perror("strdup");
            exit(1);
        }
    }
    if ((redir_file = fopen(redir_path, "w")) == NULL) {
        perror("fopen");
        free(redir_path);
        exit(1);
    }
    dup2(fileno(redir_file), proc_fd);
    fclose(redir_file);
    free(redir_path);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
leaq 0x8913(%rip), %rsi      # 0x1c996
movq %r14, %rdi
callq 0x6310
testl %eax, %eax
je 0x1410b
leaq 0xb359(%rip), %rsi      # 0x1f3ef
movq %r14, %rdi
callq 0x6610
testq %rax, %rax
je 0x140c0
callq 0x6130
movq %rsp, %rdi
movq %r14, %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x6460
testl %eax, %eax
jns 0x140d1
callq 0x66b4
movq %r14, %rdi
callq 0x65c0
movq %rax, (%rsp)
testq %rax, %rax
je 0x1411b
movq (%rsp), %rdi
leaq 0xaa1d(%rip), %rsi      # 0x1eaf9
callq 0x6520
testq %rax, %rax
je 0x14113
movq %rax, %r14
movq %rax, %rdi
callq 0x6380
movl %eax, %edi
movl %ebx, %esi
callq 0x6180
movq %r14, %rdi
callq 0x6140
movq (%rsp), %rdi
callq 0x6050
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rsp, %rdi
callq 0x66d4
callq 0x66f4
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/phpspy.c
// Function: copy_proc_mem
static int copy_proc_mem(pid_t pid, const char *what, void *raddr, void *laddr, size_t size) {
    struct iovec local[1];
    struct iovec remote[1];

    if (raddr == NULL) {
        log_error("copy_proc_mem: Not copying %s; raddr is NULL\n", what);
        return PHPSPY_ERR;
    }

    local[0].iov_base = laddr;
    local[0].iov_len = size;
    remote[0].iov_base = raddr;
    remote[0].iov_len = size;

    if (process_vm_readv(pid, local, 1, remote, 1, 0) == -1) {
        if (errno == ESRCH) { /* No such process */
            perror("process_vm_readv");
            return PHPSPY_ERR | PHPSPY_ERR_PID_DEAD;
        }
        log_error("copy_proc_mem: Failed to copy %s; err=%s raddr=%p size=%lu\n", what, strerror(errno), raddr, size);
        return PHPSPY_ERR;
    }

    return PHPSPY_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
testq %rdx, %rdx
je 0x14617
movq %r8, %r14
movq %rdx, %r15
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
movq %r8, 0x8(%rsi)
movq %rsp, %rcx
movq %rdx, (%rcx)
movq %r8, 0x8(%rcx)
xorl %r12d, %r12d
movl $0x1, %edx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x6300
cmpq $-0x1, %rax
jne 0x1462e
callq 0x6060
movl (%rax), %edi
cmpl $0x3, %edi
je 0x1463d
callq 0x65d0
leaq 0xa7e9(%rip), %rdi      # 0x1edeb
movq %rbx, %rsi
movq %rax, %rdx
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0xadcf
jmp 0x14628
leaq 0xa78e(%rip), %rdi      # 0x1edac
movq %rbx, %rsi
xorl %eax, %eax
callq 0xadcf
movl $0x1, %r12d
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xa796(%rip), %rdi      # 0x1edda
callq 0x6530
movl $0x3, %r12d
jmp 0x1462e
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/./phpspy_trace.c
// Function: trace_memory_info_70
static int trace_memory_info(trace_context_t *context) {
    #ifdef USE_ZEND
    (void)context;
    return PHPSPY_ERR; /* zend_alloc_globals is not public */
    #else
    int rv;
    zend_mm_heap mm_heap;
    zend_alloc_globals alloc_globals;
    trace_target_t *target;

    memset(&mm_heap, 0, sizeof(mm_heap));
    alloc_globals.mm_heap = NULL;
    target = &context->target;

    try_copy_proc_mem("alloc_globals", (void*)target->alloc_globals_addr, &alloc_globals, sizeof(alloc_globals));
    try_copy_proc_mem("mm_heap", alloc_globals.mm_heap, &mm_heap, sizeof(mm_heap));
    context->event.mem.size = mm_heap.size;
    context->event.mem.peak = mm_heap.peak;

    try(rv, context->event_handler(context, PHPSPY_TRACE_EVENT_MEM));

    return PHPSPY_OK;

    #endif
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
leaq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
movl (%rdi), %edi
movq 0x18(%rbx), %rdx
leaq 0xa4af(%rip), %rsi      # 0x1eb2e
movl $0x8, %r8d
callq 0x1459f
testl %eax, %eax
jne 0x146d6
movl (%rbx), %edi
movq 0x8(%rsp), %rdx
leaq 0xa837(%rip), %rsi      # 0x1eed3
leaq 0x10(%rsp), %rcx
movl $0x20, %r8d
callq 0x1459f
testl %eax, %eax
jne 0x146d6
movq 0x20(%rsp), %rax
movq %rax, 0x758(%rbx)
movq 0x28(%rsp), %rax
movq %rax, 0x760(%rbx)
movq %rbx, %rdi
movl $0x6, %esi
callq *0x798(%rbx)
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/./phpspy_trace.c
// Function: trace_globals_70
static int trace_globals(trace_context_t *context) {
    int rv;
    glopeek_entry_t *gentry, *gentry_tmp;
    zend_array *garray;
    zend_array *symtable;
    Bucket lbucket;

    /* Find the remote address of executor_globals.symbol_table */
    symtable = (zend_array *)(context->target.executor_globals_addr + offsetof(zend_executor_globals, symbol_table));

    HASH_ITER(hh, glopeek_map, gentry, gentry_tmp) {

        /* Point garray at the zend_array where this global variable resides */
        if (gentry->gloname[0]) {
            try(rv, copy_zarray_bucket(context, symtable, gentry->gloname, &lbucket));
            garray = lbucket.val.value.arr;
        } else {
            garray = symtable;
        }

        /* Print the element within the array */

        rv = sprint_zarray_val(context, garray, gentry->varname, context->buf, sizeof(context->buf), &context->buf_len);

        if (rv == PHPSPY_OK) {
            context->event.glopeek.gentry = gentry;
            context->event.glopeek.zval_str = context->buf;
            try(rv, context->event_handler(context, PHPSPY_TRACE_EVENT_GLOPEEK));
        }
    }

    return PHPSPY_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x11a34(%rip), %rbp     # 0x26128
xorl %eax, %eax
testq %rbp, %rbp
je 0x14704
movq 0x310(%rbp), %rcx
jmp 0x14706
xorl %ecx, %ecx
testq %rbp, %rbp
je 0x147d1
movl $0x130, %r14d           # imm = 0x130
addq 0x8(%rbx), %r14
leaq 0x7a8(%rbx), %r15
leaq 0x8a8(%rbx), %rax
movq %rax, (%rsp)
leaq 0x28(%rsp), %r13
movq %rcx, %r12
cmpb $0x0, 0x100(%rbp)
je 0x1475e
leaq 0x100(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x8(%rsp), %rcx
callq 0x14a7f
testl %eax, %eax
jne 0x147d1
movq 0x8(%rsp), %rsi
jmp 0x14761
movq %r14, %rsi
leaq 0x200(%rbp), %rdx
movq %rbx, %rdi
movq %r13, %rcx
callq 0x14a7f
testl %eax, %eax
jne 0x147b2
movl $0x100, %ecx            # imm = 0x100
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq (%rsp), %r8
callq 0x1486c
testl %eax, %eax
jne 0x147b2
movq %rbp, 0x780(%rbx)
movq %r15, 0x788(%rbx)
movq %rbx, %rdi
movl $0x4, %esi
callq *0x798(%rbx)
testl %eax, %eax
jne 0x147d1
testq %r12, %r12
je 0x147c1
movq 0x310(%r12), %rcx
jmp 0x147c3
xorl %ecx, %ecx
movq %r12, %rbp
testq %r12, %r12
jne 0x14730
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/./phpspy_trace.c
// Function: sprint_zstring_70
static int sprint_zstring(trace_context_t *context, const char *what, zend_string *rzstring, char *buf, size_t buf_size, size_t *buf_len) {
    int rv;
    zend_string lzstring;

    *buf = '\0';
    *buf_len = 0;
    try_copy_proc_mem(what, rzstring, &lzstring, sizeof(lzstring));
    *buf_len = PHPSPY_MIN(lzstring.len, PHPSPY_MAX(1, buf_size)-1);
    try_copy_proc_mem(what, ((char*)rzstring) + offsetof(zend_string, val), buf, *buf_len);
    *(buf + (int)*buf_len) = '\0';

    return PHPSPY_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
movb $0x0, (%rcx)
movq $0x0, (%r9)
movl (%rdi), %edi
leaq 0xf(%rsp), %rcx
movl $0x19, %r8d
callq 0x1459f
testl %eax, %eax
jne 0x1485d
cmpq $0x1, %r15
adcq $-0x1, %r15
movq 0x1f(%rsp), %rax
cmpq %r15, %rax
cmovbq %rax, %r15
movq %r15, (%rbx)
movl (%rbp), %edi
addq $0x18, %r12
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
movq %r15, %r8
callq 0x1459f
testl %eax, %eax
jne 0x1485d
movslq (%rbx), %rax
movb $0x0, (%r14,%rax)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/./phpspy_trace.c
// Function: copy_zarray_bucket_70
static int copy_zarray_bucket(trace_context_t *context, zend_array *rzarray, const char *key, Bucket *lbucket) {
    int rv;
    zend_array lzarray;
    uint32_t hash_table_size;
    uint64_t hash_val;
    uint32_t hash_index;
    uint32_t hash_table_val;
    uint32_t *hash_bucket;
    char tmp_key[PHPSPY_STR_SIZE];
    size_t tmp_len;

    try_copy_proc_mem("array", rzarray, &lzarray, sizeof(lzarray));

    hash_val = phpspy_zend_inline_hash_func(key, strlen(key));
    hash_table_size = (uint32_t)(-1 * (int32_t)lzarray.nTableMask);
    hash_index = hash_val % hash_table_size;

    try_copy_proc_mem("hash_table_val", ((uint32_t*)lzarray.arData) - hash_table_size + hash_index, &hash_table_val, sizeof(uint32_t));

    hash_bucket = &hash_table_val;

    do {
        if (*hash_bucket == (uint32_t)-1) return PHPSPY_ERR;

        /* Copy the next bucket from array data */
        try_copy_proc_mem("bucket", lzarray.arData + *hash_bucket, lbucket, sizeof(Bucket));

        if (lbucket->key == NULL) {
            break;
        }

        /* On hash collision, advance to the next bucket */
        try(rv, sprint_zstring(context, "array_key", lbucket->key, tmp_key, sizeof(tmp_key), &tmp_len));

        if (strcmp(key, tmp_key) == 0) {
            hash_bucket = NULL;
        } else {
            hash_bucket = &lbucket->val.u2.next;
        }
    } while (hash_bucket);

    return PHPSPY_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %rdx
movq %rdi, %r15
movl (%rdi), %edi
leaq 0xa3dd(%rip), %rsi      # 0x1ee82
leaq 0x1c(%rsp), %rcx
movl $0x24, %r8d
callq 0x1459f
testl %eax, %eax
jne 0x14b08
movq %r14, %rdi
callq 0x6160
movq %r14, %rdi
movq %rax, %rsi
callq 0x13391
xorl %ecx, %ecx
subl 0x28(%rsp), %ecx
xorl %edx, %edx
divq %rcx
movl (%r15), %edi
movq 0x2c(%rsp), %rax
shlq $0x2, %rcx
subq %rcx, %rax
leaq (%rax,%rdx,4), %rdx
leaq 0xa3ea(%rip), %rsi      # 0x1eedb
leaq 0xc(%rsp), %r13
movl $0x4, %r8d
movq %r13, %rcx
callq 0x1459f
testl %eax, %eax
je 0x14b1a
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc(%rbx), %r12
leaq 0x40(%rsp), %rbp
movl (%r13), %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rdx
je 0x14bae
movl (%r15), %edi
shlq $0x5, %rdx
addq 0x2c(%rsp), %rdx
movl $0x20, %r8d
leaq 0xa3a0(%rip), %rsi      # 0x1eeea
movq %rbx, %rcx
callq 0x1459f
testl %eax, %eax
jne 0x14b08
movq 0x18(%rbx), %rdx
testq %rdx, %rdx
je 0x14bb8
movl $0x100, %r8d            # imm = 0x100
movq %r15, %rdi
leaq 0xa321(%rip), %rsi      # 0x1ee90
movq %rbp, %rcx
leaq 0x10(%rsp), %r9
callq 0x147e0
testl %eax, %eax
jne 0x14b08
movq %r14, %rdi
movq %rbp, %rsi
callq 0x6310
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
je 0x14b9d
movq %r12, %r13
jne 0x14b23
jmp 0x14b08
movl $0x0, %r13d
jne 0x14b23
jmp 0x14b08
movl $0x1, %eax
jmp 0x14b08
xorl %eax, %eax
jmp 0x14b08
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/pgrep.c
// Function: run_signal_thread
static void *run_signal_thread(void *arg) {
    int rv, ignore;
    fd_set rfds;
    struct timeval tv;
    struct sigaction sa;

    (void)arg;

    /* Create done_pipe */
    rv = pipe(done_pipe);
    rv = fcntl(done_pipe[1], F_SETFL, O_NONBLOCK);

    /* Install signal handler */
    memset(&sa, 0, sizeof(struct sigaction));
    sa.sa_handler = handle_signal;
    sigaction(SIGINT, &sa, NULL);
    sigaction(SIGTERM, &sa, NULL);
    sigaction(SIGHUP, &sa, NULL);
    sigaction(SIGALRM, &sa, NULL);
    sa.sa_handler = SIG_IGN;
    sigaction(SIGPIPE, &sa, NULL);

    /* Wait for write on done_pipe from write_done_pipe */
    do {
        FD_ZERO(&rfds);
        FD_SET(done_pipe[0], &rfds);
        tv.tv_sec = 1;
        tv.tv_usec = 0;
        rv = select(done_pipe[0]+1, &rfds, NULL, NULL, &tv);
    } while (rv < 1);

    /* Read pipe for fun */
    rv = read(done_pipe[0], &ignore, sizeof(int));

    /* Set done flag; wake up all threads */
    done = 1;
    pthread_mutex_lock(&mutex);
    pthread_cond_broadcast(&can_consume);
    pthread_cond_broadcast(&can_produce);
    pthread_mutex_unlock(&mutex);

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x140, %rsp            # imm = 0x140
leaq 0xd9d4(%rip), %rdi      # 0x25a50
callq 0x6270
movl 0xd9cd(%rip), %edi      # 0x25a54
movl $0x4, %esi
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x6100
leaq 0xa8(%rsp), %rbx
movl $0x98, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6230
leaq 0x2c0(%rip), %rax       # 0x18376
movq %rax, (%rbx)
movl $0x2, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x60d0
movl $0xf, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x60d0
movl $0x1, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x60d0
movl $0xe, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x60d0
movq $0x1, (%rbx)
movl $0xd, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x60d0
movl $0x1, %r15d
leaq 0x20(%rsp), %rbx
leaq 0x10(%rsp), %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movl 0xd8fe(%rip), %edi      # 0x25a50
leal 0x3f(%rdi), %eax
testl %edi, %edi
cmovnsl %edi, %eax
movl %eax, %edx
andl $-0x40, %edx
movl %edi, %ecx
subl %edx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
sarl $0x6, %eax
cltq
orq %rdx, 0x20(%rsp,%rax,8)
movq %r15, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
incl %edi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r8
callq 0x6390
testl %eax, %eax
jle 0x1811b
movl 0xd8b2(%rip), %edi      # 0x25a50
leaq 0xc(%rsp), %rsi
movl $0x4, %edx
callq 0x62b0
leaq 0xdf60(%rip), %rax      # 0x26114
movl $0x1, (%rax)
leaq 0xe03f(%rip), %rbx      # 0x26200
movq %rbx, %rdi
callq 0x6620
leaq 0xdfd0(%rip), %rdi      # 0x261a0
callq 0x60a0
leaq 0xdff4(%rip), %rdi      # 0x261d0
callq 0x60a0
movq %rbx, %rdi
callq 0x63d0
xorl %eax, %eax
addq $0x140, %rsp            # imm = 0x140
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/pgrep.c
// Function: run_work_thread
static void *run_work_thread(void *arg) {
    int worker_num;
    worker_num = (long)arg;
    while (!done) {
        if (wait_for_turn('c')) break;
        attached_pids[worker_num] = avail_pids[--avail_pids_count];
        pthread_cond_signal(&can_produce);
        pthread_mutex_unlock(&mutex);
        main_pid(attached_pids[worker_num]);
        attached_pids[worker_num] = 0;
    }
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0xdf0d(%rip), %r15      # 0x26114
cmpl $0x0, (%r15)
jne 0x18288
movslq %edi, %r12
leaq 0xdfb9(%rip), %rbx      # 0x261d0
leaq 0xdfe2(%rip), %r14      # 0x26200
movl $0x63, %edi
callq 0x182bb
testl %eax, %eax
jne 0x18288
movq 0xdf65(%rip), %rax      # 0x26198
movslq 0xdf56(%rip), %rcx      # 0x26190
leaq -0x1(%rcx), %rdx
movl %edx, 0xdf4c(%rip)      # 0x26190
movl -0x4(%rax,%rcx,4), %eax
movq 0xdfd9(%rip), %rcx      # 0x26228
movl %eax, (%rcx,%r12,4)
movq %rbx, %rdi
callq 0x62d0
movq %r14, %rdi
callq 0x63d0
movq 0xdfbe(%rip), %rax      # 0x26228
movl (%rax,%r12,4), %edi
callq 0xa4d2
movq 0xdfae(%rip), %rax      # 0x26228
movl $0x0, (%rax,%r12,4)
cmpl $0x0, (%r15)
je 0x1821e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/pgrep.c
// Function: wait_for_turn
static int wait_for_turn(char producer_or_consumer) {
    struct timespec timeout;
    pthread_mutex_lock(&mutex);
    while (!done) {
        if (producer_or_consumer == 'p' && avail_pids_count < opt_num_workers) {
            break;
        } else if (avail_pids_count > 0) {
            break;
        }
        clock_gettime(CLOCK_REALTIME, &timeout);
        timeout.tv_sec += 2;
        pthread_cond_timedwait(
            producer_or_consumer == 'p' ? &can_produce : &can_consume,
            &mutex,
            &timeout
        );
    }
    if (done) {
        pthread_mutex_unlock(&mutex);
        return 1;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebx
leaq 0xdf2e(%rip), %rdi      # 0x26200
callq 0x6620
leaq 0xde36(%rip), %r13      # 0x26114
cmpl $0x0, (%r13)
sete %cl
jne 0x18356
leaq 0x8(%rsp), %r14
leaq 0xdf0c(%rip), %r15      # 0x26200
leaq 0xdea5(%rip), %rbp      # 0x261a0
movl 0xde8f(%rip), %eax      # 0x26190
cmpb $0x70, %bl
jne 0x1831e
testl %eax, %eax
jg 0x1834f
leaq 0xdebf(%rip), %r12      # 0x261d0
leaq 0xd01c(%rip), %rdx      # 0x25334
cmpl (%rdx), %eax
jge 0x18325
jmp 0x1834f
movq %rbp, %r12
testl %eax, %eax
jg 0x1834f
xorl %edi, %edi
movq %r14, %rsi
callq 0x6110
addq $0x2, 0x8(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x64a0
cmpl $0x0, (%r13)
sete %cl
je 0x182fb
jmp 0x18356
xorl %eax, %eax
testb $0x1, %cl
jne 0x18367
leaq 0xdea3(%rip), %rdi      # 0x26200
callq 0x63d0
movl $0x1, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/top.c
// Function: func_list_compare
static int func_list_compare(const void *a, const void *b) {
    func_entry_t *fa, *fb;
    fa = *((func_entry_t**)a);
    fb = *((func_entry_t**)b);
    if (fb->count_excl == fa->count_excl) {
        if (fb->count_incl == fa->count_incl) {
            if (fb->total_count_excl == fa->total_count_excl) {
                if (fb->total_count_incl == fa->total_count_incl) {
                    return 0;
                }
                return fb->total_count_incl > fa->total_count_incl ? 1 : -1;
            }
            return fb->total_count_excl > fa->total_count_excl ? 1 : -1;
        }
        return fb->count_incl > fa->count_incl ? 1 : -1;
    }
    return fb->count_excl > fa->count_excl ? 1 : -1;
}

// Assembly:
movq (%rdi), %rax
movq (%rsi), %rcx
movq 0x100(%rcx), %rdx
movq 0x100(%rax), %rsi
cmpq %rsi, %rdx
jne 0x19564
movq 0x108(%rcx), %rdx
movq 0x108(%rax), %rsi
cmpq %rsi, %rdx
jne 0x19564
movq 0x110(%rcx), %rdx
movq 0x110(%rax), %rsi
cmpq %rsi, %rdx
jne 0x19564
movq 0x118(%rcx), %rcx
movq 0x118(%rax), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
je 0x1956f
xorl %eax, %eax
cmpq %rcx, %rdx
jmp 0x19569
xorl %eax, %eax
cmpq %rdx, %rsi
adcl $-0x1, %eax
orl $0x1, %eax
retq