LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/./phpspy_trace.c
// Function: copy_executor_globals_70
static int copy_executor_globals(trace_context_t *context, zend_executor_globals *executor_globals) {
    int rv;
    executor_globals->current_execute_data = NULL;
    try_copy_proc_mem("executor_globals", (void*)context->target.executor_globals_addr, executor_globals, sizeof(*executor_globals));
    return PHPSPY_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, 0x1e0(%rax)
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x18(%rbp), %rcx
leaq 0x224cc(%rip), %rsi     # 0x34c74
movl $0x1e8, %r8d            # imm = 0x1E8
callq 0x12680
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
je 0x127c3
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x127cc
jmp 0x127c5
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x34(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x6230
movq $0x0, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rdx
leaq 0x21d91(%rip), %rsi     # 0x34c92
leaq -0x3c(%rbp), %rcx
movl $0x8, %r8d
callq 0x12680
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x12f23
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x12fa6
jmp 0x12f25
jmp 0x12f27
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x3c(%rbp), %rdx
leaq 0x220ff(%rip), %rsi     # 0x35037
leaq -0x34(%rbp), %rcx
movl $0x20, %r8d
callq 0x12680
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x12f57
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x12fa6
jmp 0x12f59
movq -0x24(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x758(%rax)
movq -0x1c(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x760(%rax)
movq -0x10(%rbp), %rax
movq 0x798(%rax), %rax
movq -0x10(%rbp), %rdi
movl $0x6, %esi
callq *%rax
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x12f9d
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x12fa6
jmp 0x12f9f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
movq -0x38(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x55(%rbp), %rcx
movl $0x19, %r8d
callq 0x12680
movl %eax, -0x3c(%rbp)
cmpl $0x0, %eax
je 0x131a5
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1326a
jmp 0x131a7
movq -0x45(%rbp), %rax
movq %rax, -0x60(%rbp)
movl $0x1, %eax
cmpq -0x30(%rbp), %rax
jbe 0x131c5
movl $0x1, %eax
movq %rax, -0x68(%rbp)
jmp 0x131cd
movq -0x30(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq -0x68(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x131e8
movq -0x45(%rbp), %rax
movq %rax, -0x70(%rbp)
jmp 0x13212
movl $0x1, %eax
cmpq -0x30(%rbp), %rax
jbe 0x131fe
movl $0x1, %eax
movq %rax, -0x78(%rbp)
jmp 0x13206
movq -0x30(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
addq $0x18, %rdx
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rax
movq (%rax), %r8
callq 0x12680
movl %eax, -0x3c(%rbp)
cmpl $0x0, %eax
je 0x1324f
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1326a
jmp 0x13251
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/./phpspy_trace.c
// Function: sprint_zval_70
static int sprint_zval(trace_context_t *context, zval *lzval, char *buf, size_t buf_size, size_t *buf_len) {
    int rv;
    int type;
    type = (int)lzval->u1.v.type;
    switch (type) {
        case IS_LONG:
            snprintf(buf, buf_size, "%ld", lzval->value.lval);
            *buf_len = strlen(buf);
            break;
        case IS_DOUBLE:
            snprintf(buf, buf_size, "%f", lzval->value.dval);
            *buf_len = strlen(buf);
            break;
        case IS_STRING:
            try(rv, sprint_zstring(context, "zval", lzval->value.str, buf, buf_size, buf_len));
            break;
        case IS_ARRAY:
            try(rv, sprint_zarray(context, lzval->value.arr, buf, buf_size, buf_len));
            break;
        default:
            /* TODO handle other zval types */
            /* fprintf(context->fout, "value not supported, found type: %d\n", type); */
            return PHPSPY_ERR;
    }
    return PHPSPY_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
addl $-0x4, %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x3, %eax
ja 0x14723
movq -0x40(%rbp), %rax
leaq 0x1de61(%rip), %rcx     # 0x324a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rcx
leaq 0x2097c(%rip), %rdx     # 0x34fe2
movb $0x0, %al
callq 0x61d0
movq -0x20(%rbp), %rdi
callq 0x6160
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x1472c
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rax
movsd (%rax), %xmm0
leaq 0x20e9a(%rip), %rdx     # 0x35536
movb $0x1, %al
callq 0x61d0
movq -0x20(%rbp), %rdi
callq 0x6160
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x1472c
jmp 0x146ba
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
leaq 0x20905(%rip), %rsi     # 0x34fdd
callq 0x13140
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0x146ed
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x14733
jmp 0x146ef
jmp 0x1472c
jmp 0x146f3
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x14740
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0x1471f
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x14733
jmp 0x14721
jmp 0x1472c
movl $0x1, -0x4(%rbp)
jmp 0x14733
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/./phpspy_trace.c
// Function: sprint_zarray_70
static int sprint_zarray(trace_context_t *context, zend_array *rzarray, char *buf, size_t buf_size, size_t *buf_len) {
    int rv;
    int i;
    int array_len;
    size_t tmp_len;
    Bucket buckets[PHPSPY_MAX_ARRAY_BUCKETS];
    zend_array lzarray;
    char *obuf;

    obuf = buf;
    try_copy_proc_mem("array", rzarray, &lzarray, sizeof(lzarray));

    array_len = PHPSPY_MIN(lzarray.nNumOfElements, PHPSPY_MAX_ARRAY_BUCKETS);
    try_copy_proc_mem("buckets", lzarray.arData, buckets, sizeof(Bucket) * array_len);

    for (i = 0; i < array_len; i++) {
        try(rv, sprint_zarray_bucket(context, buckets + i, buf, buf_size, &tmp_len));
        buf_size -= tmp_len;
        buf += tmp_len;

        /* TODO Introduce a string class to clean this silliness up */
        if (buf_size >= 2) {
            *buf = ',';
            --buf_size;
            ++buf;
        }
    }

    *buf_len = (size_t)(buf - obuf);

    return PHPSPY_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1090, %rsp           # imm = 0x1090
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x1080(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rdx
leaq 0x2086b(%rip), %rsi     # 0x34fe6
leaq -0x1074(%rbp), %rcx
movl $0x24, %r8d
callq 0x12680
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0x147a0
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x148ca
jmp 0x147a2
cmpl $0x80, -0x1058(%rbp)
jae 0x147bc
movl -0x1058(%rbp), %eax
movl %eax, -0x1084(%rbp)
jmp 0x147c9
movl $0x80, %eax
movl %eax, -0x1084(%rbp)
jmp 0x147c9
movl -0x1084(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x1064(%rbp), %rdx
leaq -0x1050(%rbp), %rcx
movslq -0x3c(%rbp), %r8
shlq $0x5, %r8
leaq 0x207f7(%rip), %rsi     # 0x34fec
callq 0x12680
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0x1480d
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x148ca
jmp 0x1480f
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x148ae
jmp 0x14824
movq -0x10(%rbp), %rdi
leaq -0x1050(%rbp), %rsi
movslq -0x38(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq -0x48(%rbp), %r8
callq 0x148e0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0x1485b
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x148ca
jmp 0x1485d
movq -0x48(%rbp), %rcx
movq -0x28(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x48(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x2, -0x28(%rbp)
jb 0x1489e
movq -0x20(%rbp), %rax
movb $0x2c, (%rax)
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x148a0
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x14816
movq -0x20(%rbp), %rcx
movq -0x1080(%rbp), %rax
subq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1090, %rsp           # imm = 0x1090
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/./phpspy_trace.c
// Function: sprint_zarray_bucket_70
static int sprint_zarray_bucket(trace_context_t *context, Bucket *lbucket, char *buf, size_t buf_size, size_t *buf_len) {
    int rv;
    char tmp_key[PHPSPY_STR_SIZE];
    size_t tmp_len;
    char *obuf;

    obuf = buf;

    if (lbucket->key != NULL) {
        try(rv, sprint_zstring(context, "array_key", lbucket->key, tmp_key, sizeof(tmp_key), &tmp_len));

        /* TODO Introduce a string class to clean this silliness up */
        if (buf_size > tmp_len + 1 + 1) {
            snprintf(buf, buf_size, "%s=", tmp_key);
            buf_size -= tmp_len + 1;
            buf += tmp_len + 1;
        }
    }

    try(rv, sprint_zval(context, &lbucket->val, buf, buf_size, &tmp_len));
    buf += tmp_len;

    *buf_len = (size_t)(buf - obuf);
    return PHPSPY_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x149bc
jmp 0x1491b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdx
leaq -0x140(%rbp), %rcx
leaq 0x206bf(%rip), %rsi     # 0x34ff4
movl $0x100, %r8d            # imm = 0x100
leaq -0x148(%rbp), %r9
callq 0x13140
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0x1495a
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x14a17
jmp 0x1495c
movq -0x28(%rbp), %rax
movq -0x148(%rbp), %rcx
addq $0x1, %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jbe 0x149ba
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq -0x140(%rbp), %rcx
leaq 0x20674(%rip), %rdx     # 0x34ffe
movb $0x0, %al
callq 0x61d0
movq -0x148(%rbp), %rcx
addq $0x1, %rcx
movq -0x28(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x148(%rbp), %rax
addq $0x1, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x149bc
jmp 0x149be
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq -0x148(%rbp), %r8
callq 0x14600
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0x149ea
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x14a17
jmp 0x149ec
movq -0x148(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x150(%rbp), %rax
subq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/./phpspy_trace.c
// Function: sprint_zarray_val70
static int sprint_zarray_val(trace_context_t *context, zend_array *rzarray, const char *key, char *buf, size_t buf_size, size_t *buf_len) {
    int rv;
    Bucket bucket;

    try(rv, copy_zarray_bucket(context, rzarray, key, &bucket));
    try(rv, sprint_zval(context, &bucket.val, buf, buf_size, buf_len));

    return PHPSPY_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x5c(%rbp), %rcx
callq 0x14a30
movl %eax, -0x3c(%rbp)
cmpl $0x0, %eax
je 0x14c55
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x14c8b
jmp 0x14c57
jmp 0x14c59
movq -0x10(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %r8
callq 0x14600
movl %eax, -0x3c(%rbp)
cmpl $0x0, %eax
je 0x14c82
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x14c8b
jmp 0x14c84
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/pgrep.c
// Function: main_pgrep
int main_pgrep() {
    long i;

    if (opt_num_workers < 1) {
        log_error("Expected max concurrent workers (-T) > 0\n");
        exit(1);
    }

    pthread_create(&signal_thread, NULL, run_signal_thread, NULL);
    block_all_signals();

    init_work_threads();

    for (i = 0; i < opt_num_workers; i++) {
        pthread_create(&work_threads[i], NULL, run_work_thread, (void*)i);
    }

    if (opt_time_limit_ms > 0) {
        alarm(PHPSPY_MAX(1, opt_time_limit_ms / 1000));
    }

    pgrep_for_pids();

    for (i = 0; i < opt_num_workers; i++) {
        pthread_join(work_threads[i], NULL);
    }
    pthread_join(signal_thread, NULL);

    deinit_work_threads();

    log_error("main_pgrep finished gracefully\n");
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x107c5(%rip), %rax     # 0x3a324
cmpl $0x1, (%rax)
jge 0x29b7c
leaq 0xb4ea(%rip), %rdi      # 0x35055
movb $0x0, %al
callq 0x9cc0
movl $0x1, %edi
callq 0x6580
leaq 0x12a2d(%rip), %rdi     # 0x3c5b0
xorl %eax, %eax
movl %eax, %ecx
leaq 0x132(%rip), %rdx       # 0x29cc0
movq %rcx, %rsi
callq 0x6470
callq 0x2a3d0
callq 0x2a2b0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
leaq 0x10771(%rip), %rcx     # 0x3a324
movslq (%rcx), %rcx
cmpq %rcx, %rax
jge 0x29bef
movq 0x129f6(%rip), %rdi     # 0x3c5b8
movq -0x8(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x8(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq 0x2e4(%rip), %rdx       # 0x29ec0
callq 0x6470
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x29ba8
leaq 0x1291a(%rip), %rax     # 0x3c510
cmpq $0x0, (%rax)
jle 0x29c4b
leaq 0x1290d(%rip), %rax     # 0x3c510
movq (%rax), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, %rcx
movl $0x1, %eax
cmpq %rcx, %rax
jle 0x29c28
movl $0x1, %eax
movq %rax, -0x10(%rbp)
jmp 0x29c40
leaq 0x128e1(%rip), %rax     # 0x3c510
movq (%rax), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl %eax, %edi
callq 0x6250
callq 0x29fb0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
leaq 0x106c1(%rip), %rcx     # 0x3a324
movslq (%rcx), %rcx
cmpq %rcx, %rax
jge 0x29c91
movq 0x12946(%rip), %rax     # 0x3c5b8
movq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6590
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x29c58
movq 0x12918(%rip), %rdi     # 0x3c5b0
xorl %eax, %eax
movl %eax, %esi
callq 0x6590
callq 0x2a380
leaq 0xb3d2(%rip), %rdi      # 0x3507f
movb $0x0, %al
callq 0x9cc0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl %eax, -0xc(%rbp)
leaq 0x1266a(%rip), %rax     # 0x3c544
cmpl $0x0, (%rax)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x29ee8
jmp 0x29f65
movl $0x63, %edi
callq 0x2a160
cmpl $0x0, %eax
je 0x29ef9
jmp 0x29f65
movq 0x126c8(%rip), %rax     # 0x3c5c8
movl 0x126ba(%rip), %ecx     # 0x3c5c0
addl $-0x1, %ecx
movl %ecx, 0x126b1(%rip)     # 0x3c5c0
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq 0x1273c(%rip), %rax     # 0x3c658
movslq -0xc(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
leaq 0x126d6(%rip), %rdi     # 0x3c600
callq 0x62d0
leaq 0x126fa(%rip), %rdi     # 0x3c630
callq 0x63d0
movq 0x12716(%rip), %rax     # 0x3c658
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %edi
callq 0x96c0
movq 0x12703(%rip), %rax     # 0x3c658
movslq -0xc(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x29ed3
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/pgrep.c
// Function: write_done_pipe
void write_done_pipe() {
    int rv, ignore;
    if (done_pipe[1] >= 0) {
        ignore = 1;
        rv = write(done_pipe[1], &ignore, sizeof(int));
    }
    (void)rv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpl $0x0, 0x11f05(%rip)     # 0x3be84
jl 0x29f9f
movl $0x1, -0x8(%rbp)
movl 0x11ef6(%rip), %edi     # 0x3be84
leaq -0x8(%rbp), %rsi
movl $0x4, %edx
callq 0x6120
movl %eax, -0x4(%rbp)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movb %dil, %al
movb %al, -0x5(%rbp)
leaq 0x124bb(%rip), %rdi     # 0x3c630
callq 0x6600
leaq 0x123c3(%rip), %rax     # 0x3c544
cmpl $0x0, (%rax)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x2a18f
jmp 0x2a1fa
movsbl -0x5(%rbp), %eax
cmpl $0x70, %eax
jne 0x2a1ab
movl 0x12422(%rip), %eax     # 0x3c5c0
leaq 0x1017f(%rip), %rcx     # 0x3a324
cmpl (%rcx), %eax
jge 0x2a1ab
jmp 0x2a1fa
cmpl $0x0, 0x1240e(%rip)     # 0x3c5c0
jle 0x2a1b6
jmp 0x2a1fa
jmp 0x2a1b8
xorl %edi, %edi
leaq -0x18(%rbp), %rsi
callq 0x6110
movq -0x18(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x18(%rbp)
movsbl -0x5(%rbp), %ecx
leaq 0x123f6(%rip), %rdi     # 0x3c5d0
leaq 0x1241f(%rip), %rax     # 0x3c600
cmpl $0x70, %ecx
cmoveq %rax, %rdi
leaq 0x12441(%rip), %rsi     # 0x3c630
leaq -0x18(%rbp), %rdx
callq 0x6490
jmp 0x2a17a
leaq 0x12343(%rip), %rax     # 0x3c544
cmpl $0x0, (%rax)
je 0x2a21b
leaq 0x12423(%rip), %rdi     # 0x3c630
callq 0x63d0
movl $0x1, -0x4(%rbp)
jmp 0x2a222
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/pgrep.c
// Function: is_already_attached
static int is_already_attached(int pid) {
    int i;
    for (i = 0; i < opt_num_workers; i++) {
        if (attached_pids[i] == pid) {
            return 1;
        } else if (i < avail_pids_count && avail_pids[i] == pid) {
            return 1;
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
leaq 0x100dc(%rip), %rcx     # 0x3a324
cmpl (%rcx), %eax
jge 0x2a29e
movq 0x12405(%rip), %rax     # 0x3c658
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x8(%rbp), %eax
jne 0x2a268
movl $0x1, -0x4(%rbp)
jmp 0x2a2a5
movl -0xc(%rbp), %eax
cmpl 0x1234f(%rip), %eax     # 0x3c5c0
jge 0x2a28f
movq 0x1234e(%rip), %rax     # 0x3c5c8
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x8(%rbp), %eax
jne 0x2a28f
movl $0x1, -0x4(%rbp)
jmp 0x2a2a5
jmp 0x2a291
jmp 0x2a293
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2a23e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/pgrep.c
// Function: init_work_threads
static void init_work_threads() {
    avail_pids = calloc(opt_num_workers, sizeof(int));
    attached_pids = calloc(opt_num_workers, sizeof(int));
    work_threads = calloc(opt_num_workers, sizeof(pthread_t));
    if (!avail_pids || !attached_pids || !work_threads) {
        errno = ENOMEM;
        perror("calloc");
        exit(1);
    }
    pthread_mutex_init(&mutex, NULL);
    pthread_cond_init(&can_produce, NULL);
    pthread_cond_init(&can_consume, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x10069(%rip), %rax     # 0x3a324
movslq (%rax), %rdi
movl $0x4, %esi
callq 0x62f0
movq %rax, 0x122f9(%rip)     # 0x3c5c8
leaq 0x1004e(%rip), %rax     # 0x3a324
movslq (%rax), %rdi
movl $0x4, %esi
callq 0x62f0
movq %rax, 0x1236e(%rip)     # 0x3c658
leaq 0x10033(%rip), %rax     # 0x3a324
movslq (%rax), %rdi
movl $0x8, %esi
callq 0x62f0
movq %rax, 0x122b3(%rip)     # 0x3c5b8
cmpq $0x0, 0x122bb(%rip)     # 0x3c5c8
je 0x2a323
cmpq $0x0, 0x12341(%rip)     # 0x3c658
je 0x2a323
cmpq $0x0, 0x12297(%rip)     # 0x3c5b8
jne 0x2a344
callq 0x6060
movl $0xc, (%rax)
leaq 0xad73(%rip), %rdi      # 0x350a8
callq 0x6520
movl $0x1, %edi
callq 0x6580
leaq 0x122e5(%rip), %rdi     # 0x3c630
xorl %eax, %eax
movl %eax, %esi
callq 0x65c0
leaq 0x122a5(%rip), %rdi     # 0x3c600
xorl %eax, %eax
movl %eax, %esi
callq 0x63a0
leaq 0x12265(%rip), %rdi     # 0x3c5d0
xorl %eax, %eax
movl %eax, %esi
callq 0x63a0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/pgrep.c
// Function: deinit_work_threads
static void deinit_work_threads() {
    free(avail_pids);
    free(attached_pids);
    free(work_threads);
    pthread_mutex_destroy(&mutex);
    pthread_cond_destroy(&can_produce);
    pthread_cond_destroy(&can_consume);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x1223d(%rip), %rdi     # 0x3c5c8
callq 0x6050
movq 0x122c1(%rip), %rdi     # 0x3c658
callq 0x6050
movq 0x12215(%rip), %rdi     # 0x3c5b8
callq 0x6050
leaq 0x12281(%rip), %rdi     # 0x3c630
callq 0x61b0
leaq 0x12245(%rip), %rdi     # 0x3c600
callq 0x64d0
leaq 0x12209(%rip), %rdi     # 0x3c5d0
callq 0x64d0
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/pgrep.c
// Function: block_all_signals
static int block_all_signals() {
    int rv;
    sigset_t set;
    try(rv, sigfillset(&set));
    try(rv, sigprocmask(SIG_BLOCK, &set, NULL));
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
leaq -0x88(%rbp), %rdi
callq 0x6350
movl %eax, -0x8(%rbp)
cmpl $0x0, %eax
je 0x2a3f7
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2a426
jmp 0x2a3f9
jmp 0x2a3fb
xorl %edi, %edi
leaq -0x88(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x6040
movl %eax, -0x8(%rbp)
cmpl $0x0, %eax
je 0x2a41d
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x2a426
jmp 0x2a41f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/top.c
// Function: filter_child_args
static void filter_child_args(int argc, char **argv) {
    int i;
    for (i = 0; i < argc; i++) {
        if (strncmp(argv[i], "-o",            sizeof("-o")-1)            == 0
         || strncmp(argv[i], "--output",      sizeof("--output")-1)      == 0
        ) {
            argv[i][1] = '#';
            argv[i][2] = '\0';
        }
        if (strncmp(argv[i], "-1",            sizeof("-1")-1)            == 0
         || strncmp(argv[i], "--single-line", sizeof("--single-line")-1) == 0
         || strncmp(argv[i], "-t",            sizeof("-t")-1)            == 0
         || strncmp(argv[i], "--top",         sizeof("--top")-1)         == 0
        ) {
            argv[i][1] = '@';
            argv[i][2] = '\0';
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x2ab3e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa6ef(%rip), %rsi      # 0x35124
movl $0x2, %edx
callq 0x6080
cmpl $0x0, %eax
je 0x2aa66
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa6d0(%rip), %rsi      # 0x35127
movl $0x8, %edx
callq 0x6080
cmpl $0x0, %eax
jne 0x2aa86
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movb $0x23, 0x1(%rax)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movb $0x0, 0x2(%rax)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa697(%rip), %rsi      # 0x35130
movl $0x2, %edx
callq 0x6080
cmpl $0x0, %eax
je 0x2ab0e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa678(%rip), %rsi      # 0x35133
movl $0xd, %edx
callq 0x6080
cmpl $0x0, %eax
je 0x2ab0e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa664(%rip), %rsi      # 0x35141
movl $0x2, %edx
callq 0x6080
cmpl $0x0, %eax
je 0x2ab0e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa645(%rip), %rsi      # 0x35144
movl $0x5, %edx
callq 0x6080
cmpl $0x0, %eax
jne 0x2ab2e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movb $0x40, 0x1(%rax)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movb $0x0, 0x2(%rax)
jmp 0x2ab30
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2aa16
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/top.c
// Function: fork_child
static int fork_child(int argc, char **argv, pid_t *pid, int *outfd, int *errfd) {
    int pout[2], perr[2];
    (void)argc;
    if (pipe(pout) < 0 || pipe(perr) < 0) {
        perror("pipe");
        return 1;
    }
    *pid = fork();
    if (*pid == 0) {
        close(pout[0]);
        dup2(pout[1], STDOUT_FILENO);
        close(pout[1]);

        close(perr[0]);
        dup2(perr[1], STDERR_FILENO);
        close(perr[1]);

        execvp(argv[0], argv);
        perror("execvp");
        exit(1);
    } else if (*pid < 0) {
        perror("fork");
        return 1;
    }
    close(pout[1]);
    close(perr[1]);
    *outfd = pout[0];
    *errfd = perr[0];
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x6270
cmpl $0x0, %eax
jl 0x2ab87
leaq -0x38(%rbp), %rdi
callq 0x6270
cmpl $0x0, %eax
jge 0x2ab9f
leaq 0xa591(%rip), %rdi      # 0x3511f
callq 0x6520
movl $0x1, -0x4(%rbp)
jmp 0x2ac5e
callq 0x65e0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x2ac15
movl -0x30(%rbp), %edi
callq 0x6260
movl -0x2c(%rbp), %edi
movl $0x1, %esi
callq 0x6180
movl -0x2c(%rbp), %edi
callq 0x6260
movl -0x38(%rbp), %edi
callq 0x6260
movl -0x34(%rbp), %edi
movl $0x2, %esi
callq 0x6180
movl -0x34(%rbp), %edi
callq 0x6260
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x6560
leaq 0xa01c(%rip), %rdi      # 0x34c22
callq 0x6520
movl $0x1, %edi
callq 0x6580
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jge 0x2ac33
leaq 0xa004(%rip), %rdi      # 0x34c29
callq 0x6520
movl $0x1, -0x4(%rbp)
jmp 0x2ac5e
jmp 0x2ac35
movl -0x2c(%rbp), %edi
callq 0x6260
movl -0x34(%rbp), %edi
callq 0x6260
movl -0x30(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x38(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/top.c
// Function: read_child_out
static void read_child_out(int fd) {
    size_t rem, line_len;
    char *nl;

    ssize_t read_rv;
    rem = BUF_SIZE - buf_len;
    if (rem < 1) {
        buf_len = 0;
        rem = BUF_SIZE;
    }

    if ((read_rv = read(fd, buf + buf_len, rem)) < 0) {
        perror("read");
        return;
    } else if (read_rv == 0) {
        done = 1;
        return;
    }
    buf_len += read_rv;

    while ((nl = memchr(buf, '\n', buf_len)) != NULL) {
        line_len = nl-buf;
        handle_line(buf, line_len);
        memmove(buf, nl+1, buf_len-(line_len+1));
        buf_len -= line_len+1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl $0x200, %eax            # imm = 0x200
subq 0x11bd9(%rip), %rax     # 0x3c860
movq %rax, -0x10(%rbp)
cmpq $0x1, -0x10(%rbp)
jae 0x2aca5
movq $0x0, 0x11bc3(%rip) # 0x3c860
movq $0x200, -0x10(%rbp)     # imm = 0x200
movl -0x4(%rbp), %edi
leaq 0x11bc1(%rip), %rsi     # 0x3c870
addq 0x11baa(%rip), %rsi     # 0x3c860
movq -0x10(%rbp), %rdx
callq 0x62a0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jge 0x2acda
leaq 0xa47a(%rip), %rdi      # 0x3514a
callq 0x6520
jmp 0x2ad91
cmpq $0x0, -0x28(%rbp)
jne 0x2acf3
leaq 0x1185c(%rip), %rax     # 0x3c544
movl $0x1, (%rax)
jmp 0x2ad91
jmp 0x2acf5
movq -0x28(%rbp), %rax
addq 0x11b60(%rip), %rax     # 0x3c860
movq %rax, 0x11b59(%rip)     # 0x3c860
movq 0x11b52(%rip), %rdx     # 0x3c860
leaq 0x11b5b(%rip), %rdi     # 0x3c870
movl $0xa, %esi
callq 0x6290
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x2ad91
movq -0x20(%rbp), %rax
leaq 0x11b3c(%rip), %rcx     # 0x3c870
subq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl %eax, %esi
leaq 0x11b28(%rip), %rdi     # 0x3c870
callq 0x2af20
movq -0x20(%rbp), %rsi
addq $0x1, %rsi
movq 0x11b04(%rip), %rdx     # 0x3c860
movq -0x18(%rbp), %rax
addq $0x1, %rax
subq %rax, %rdx
leaq 0x11b02(%rip), %rdi     # 0x3c870
callq 0x6480
movq -0x18(%rbp), %rcx
addq $0x1, %rcx
movq 0x11ade(%rip), %rax     # 0x3c860
subq %rcx, %rax
movq %rax, 0x11ad4(%rip)     # 0x3c860
jmp 0x2ad07
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/top.c
// Function: read_child_err
static void read_child_err(int fd) {
    /* TODO DRY with read_child_out */
    char buf[BUF_SIZE];
    char *nl;
    size_t buf_pos;
    ssize_t read_rv;
    if ((read_rv = read(fd, buf, BUF_SIZE)) < 0) {
        perror("read");
        return;
    } else if (read_rv == 0) {
        done = 1;
        return;
    }
    buf_pos = 0;
    while (read_rv > 0 && (nl = memchr(buf+buf_pos, '\n', read_rv)) != NULL) {
        total_err_count += 1;
        buf_pos += nl-buf+1;
        read_rv -= nl-buf+1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %edi
leaq -0x210(%rbp), %rsi
movl $0x200, %edx            # imm = 0x200
callq 0x62a0
movq %rax, -0x228(%rbp)
cmpq $0x0, %rax
jge 0x2ade0
leaq 0xa374(%rip), %rdi      # 0x3514a
callq 0x6520
jmp 0x2aeba
cmpq $0x0, -0x228(%rbp)
jne 0x2adfc
leaq 0x11753(%rip), %rax     # 0x3c544
movl $0x1, (%rax)
jmp 0x2aeba
jmp 0x2adfe
movq $0x0, -0x220(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x228(%rbp)
movb %al, -0x229(%rbp)
jle 0x2ae4e
leaq -0x210(%rbp), %rdi
addq -0x220(%rbp), %rdi
movq -0x228(%rbp), %rdx
movl $0xa, %esi
callq 0x6290
movq %rax, -0x218(%rbp)
cmpq $0x0, %rax
setne %al
movb %al, -0x229(%rbp)
movb -0x229(%rbp), %al
testb $0x1, %al
jne 0x2ae5a
jmp 0x2aeba
movq 0x11c37(%rip), %rax     # 0x3ca98
addq $0x1, %rax
movq %rax, 0x11c2c(%rip)     # 0x3ca98
movq -0x218(%rbp), %rax
leaq -0x210(%rbp), %rcx
subq %rcx, %rax
addq $0x1, %rax
addq -0x220(%rbp), %rax
movq %rax, -0x220(%rbp)
movq -0x218(%rbp), %rcx
leaq -0x210(%rbp), %rax
subq %rax, %rcx
addq $0x1, %rcx
movq -0x228(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x228(%rbp)
jmp 0x2ae09
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/top.c
// Function: handle_event
static void handle_event(struct tb_event *event) {
    if (event->type != TB_EVENT_KEY) {
        return;
    } else if (event->ch == 'q') {
        done = 1;
    } else if (event->ch == 'p') {
        is_paused = 1 - is_paused;
    }
    /* TODO other commands in top mode */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x1, %eax
je 0x2aee6
jmp 0x2af1e
movq -0x8(%rbp), %rax
cmpl $0x71, 0x4(%rax)
jne 0x2aeff
leaq 0x1164d(%rip), %rax     # 0x3c544
movl $0x1, (%rax)
jmp 0x2af1c
movq -0x8(%rbp), %rax
cmpl $0x70, 0x4(%rax)
jne 0x2af1a
movl $0x1, %eax
subl 0x11b8c(%rip), %eax     # 0x3caa0
movl %eax, 0x11b86(%rip)     # 0x3caa0
jmp 0x2af1c
jmp 0x2af1e
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x100(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x100(%rcx), %rax
jne 0x2c5d7
movq -0x28(%rbp), %rax
movq 0x108(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x108(%rcx), %rax
jne 0x2c5ac
movq -0x28(%rbp), %rax
movq 0x110(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x110(%rcx), %rax
jne 0x2c581
movq -0x28(%rbp), %rax
movq 0x118(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x118(%rcx), %rax
jne 0x2c556
movl $0x0, -0x4(%rbp)
jmp 0x2c600
movq -0x28(%rbp), %rax
movq 0x118(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x118(%rax), %rsi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x1, %ecx
cmpq %rsi, %rdx
cmoval %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x2c600
movq -0x28(%rbp), %rax
movq 0x110(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x110(%rax), %rsi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x1, %ecx
cmpq %rsi, %rdx
cmoval %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x2c600
movq -0x28(%rbp), %rax
movq 0x108(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x108(%rax), %rsi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x1, %ecx
cmpq %rsi, %rdx
cmoval %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x2c600
movq -0x28(%rbp), %rax
movq 0x100(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x100(%rax), %rsi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x1, %ecx
cmpq %rsi, %rdx
cmoval %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/addr_objdump.c
// Function: get_symbol_addr
int get_symbol_addr(addr_memo_t *memo, pid_t pid, const char *symbol, uint64_t *raddr) {
    char *php_bin_path, *php_bin_path_root;
    uint64_t *php_base_addr;
    uint64_t addr_offset;
    php_bin_path = memo->php_bin_path;
    php_bin_path_root = memo->php_bin_path_root;
    php_base_addr = &memo->php_base_addr;
    if (*php_bin_path == '\0' && get_php_bin_path(pid, php_bin_path_root, php_bin_path) != 0) {
        return 1;
    } else if (*php_base_addr == 0 && get_php_base_addr(pid, php_bin_path_root, php_bin_path, php_base_addr) != 0) {
        return 1;
    } else if (get_symbol_offset(php_bin_path_root, symbol, &addr_offset) != 0) {
        return 1;
    }
    *raddr = *php_base_addr + addr_offset;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
addq $0x200, %rax            # imm = 0x200
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x2c805
movl -0x14(%rbp), %edi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x2c880
cmpl $0x0, %eax
je 0x2c805
movl $0x1, -0x4(%rbp)
jmp 0x2c86d
movq -0x40(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2c831
movl -0x14(%rbp), %edi
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x40(%rbp), %rcx
callq 0x2c9b0
cmpl $0x0, %eax
je 0x2c831
movl $0x1, -0x4(%rbp)
jmp 0x2c86d
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x2cb30
cmpl $0x0, %eax
je 0x2c850
movl $0x1, -0x4(%rbp)
jmp 0x2c86d
jmp 0x2c852
jmp 0x2c854
movq -0x40(%rbp), %rax
movq (%rax), %rcx
addq -0x48(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/addr_objdump.c
// Function: get_php_bin_path
static int get_php_bin_path(pid_t pid, char *path_root, char *path) {
    char buf[PHPSPY_STR_SIZE];
    char libname[PHPSPY_STR_SIZE];
    if (shell_escape(opt_libname_awk_patt, libname, sizeof(libname), "opt_libname_awk_patt")) {
        return 1;
    }
    char *cmd_fmt = "awk -ve=1 -vp=%s '$0~p{print $NF; e=0; exit} END{exit e}' /proc/%d/maps"
        " || readlink /proc/%d/exe";
    if (popen_read_line(buf, sizeof(buf), cmd_fmt, libname, (int)pid, (int)pid) != 0) {
        log_error("get_php_bin_path: Failed\n");
        return 1;
    }
    if (snprintf(path_root, PHPSPY_STR_SIZE, "/proc/%d/root/%s", (int)pid, buf) > PHPSPY_STR_SIZE - 1) {
        log_error("get_php_bin_path: snprintf overflow\n");
        return 1;
    }
    if (access(path_root, F_OK) != 0) {
        snprintf(path_root, PHPSPY_STR_SIZE, "/proc/%d/exe", (int)pid);
    }
    strcpy(path, buf);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq 0xdacb(%rip), %rax      # 0x3a368
movq (%rax), %rdi
leaq -0x220(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
leaq 0x846d(%rip), %rcx      # 0x34d20
callq 0x2c610
cmpl $0x0, %eax
je 0x2c8c9
movl $0x1, -0x4(%rbp)
jmp 0x2c99f
leaq 0x899b(%rip), %rax      # 0x3526b
movq %rax, -0x228(%rbp)
leaq -0x120(%rbp), %rdi
movq -0x228(%rbp), %rdx
leaq -0x220(%rbp), %rcx
movl -0x8(%rbp), %r8d
movl -0x8(%rbp), %r9d
movl $0x100, %esi            # imm = 0x100
movb $0x0, %al
callq 0x2cc00
cmpl $0x0, %eax
je 0x2c91f
leaq 0x89c0(%rip), %rdi      # 0x352cc
movb $0x0, %al
callq 0x9cc0
movl $0x1, -0x4(%rbp)
jmp 0x2c99f
movq -0x10(%rbp), %rdi
movl -0x8(%rbp), %ecx
leaq -0x120(%rbp), %r8
movl $0x100, %esi            # imm = 0x100
leaq 0x89ad(%rip), %rdx      # 0x352e6
movb $0x0, %al
callq 0x61d0
cmpl $0xff, %eax
jle 0x2c95e
leaq 0x89a9(%rip), %rdi      # 0x352f7
movb $0x0, %al
callq 0x9cc0
movl $0x1, -0x4(%rbp)
jmp 0x2c99f
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x64f0
cmpl $0x0, %eax
je 0x2c988
movq -0x10(%rbp), %rdi
movl -0x8(%rbp), %ecx
movl $0x100, %esi            # imm = 0x100
leaq 0x893e(%rip), %rdx      # 0x352bf
movb $0x0, %al
callq 0x61d0
movq -0x18(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x6090
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/addr_objdump.c
// Function: get_symbol_offset
static int get_symbol_offset(char *path_root, const char *symbol, uint64_t *raddr) {
    char buf[PHPSPY_STR_SIZE];
    char arg_buf[PHPSPY_STR_SIZE];
    char *cmd_fmt = "objdump -Tt %s | awk '/ %s$/{print $1; exit}'";
    if (shell_escape(path_root, arg_buf, sizeof(arg_buf), "path_root")) {
        return 1;
    }
    if (popen_read_line(buf, sizeof(buf), cmd_fmt, arg_buf, symbol) != 0) {
        log_error("get_symbol_offset: Failed\n");
        return 1;
    }
    *raddr = strtoull(buf, NULL, 16);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq 0x88eb(%rip), %rax      # 0x35439
movq %rax, -0x228(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x220(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
leaq 0x886a(%rip), %rcx      # 0x353d6
callq 0x2c610
cmpl $0x0, %eax
je 0x2cb7f
movl $0x1, -0x4(%rbp)
jmp 0x2cbe6
leaq -0x120(%rbp), %rdi
movq -0x228(%rbp), %rdx
leaq -0x220(%rbp), %rcx
movq -0x18(%rbp), %r8
movl $0x100, %esi            # imm = 0x100
movb $0x0, %al
callq 0x2cc00
cmpl $0x0, %eax
je 0x2cbc0
leaq 0x88b7(%rip), %rdi      # 0x35467
movb $0x0, %al
callq 0x9cc0
movl $0x1, -0x4(%rbp)
jmp 0x2cbe6
leaq -0x120(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x10, %edx
callq 0x62e0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/adsr[P]phpspy/event_fout.c
// Function: event_handler_fout_open
static int event_handler_fout_open(int *fd) {
    int tfd = -1, errno_saved;
    char *path, *apath = NULL;

    if (strcmp(opt_path_output, "-") == 0) {
        tfd = dup(STDOUT_FILENO);
        if (tfd < 0) {
            perror("event_handler_fout_open: dup");
            return PHPSPY_ERR;
        }
        *fd = tfd;
        return PHPSPY_OK;
    }

    if (strstr(opt_path_output, "%d") != NULL) {
        if (asprintf(&apath, opt_path_output, gettid()) < 0) {
            errno = ENOMEM;
            perror("event_handler_fout_open: asprintf");
            return PHPSPY_ERR;
        }
        path = apath;
    } else {
        path = opt_path_output;
    }

    tfd = open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
    errno_saved = errno;

    if (apath) {
        free(apath);
    }

    if (tfd < 0) {
        errno = errno_saved;
        perror("event_handler_fout_open: open");
        return PHPSPY_ERR;
    }

    *fd = tfd;
    return PHPSPY_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movq $0x0, -0x28(%rbp)
leaq 0xcb26(%rip), %rax      # 0x3a338
movq (%rax), %rdi
leaq 0x52de(%rip), %rsi      # 0x32afa
callq 0x6310
cmpl $0x0, %eax
jne 0x2d866
movl $0x1, %edi
callq 0x6200
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x2d851
leaq 0x7d96(%rip), %rdi      # 0x355d6
callq 0x6520
movl $0x1, -0x4(%rbp)
jmp 0x2d95b
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x2d95b
leaq 0xcacb(%rip), %rax      # 0x3a338
movq (%rax), %rdi
leaq 0x7ce8(%rip), %rsi      # 0x3555f
callq 0x65f0
cmpq $0x0, %rax
je 0x2d8e0
leaq 0xcaaf(%rip), %rax      # 0x3a338
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movl $0xba, %edi
movb $0x0, %al
callq 0x6330
movq -0x30(%rbp), %rsi
movq %rax, %rdx
leaq -0x28(%rbp), %rdi
movb $0x0, %al
callq 0x6450
cmpl $0x0, %eax
jge 0x2d8d6
callq 0x6060
movl $0xc, (%rax)
leaq 0x7d2e(%rip), %rdi      # 0x355f3
callq 0x6520
movl $0x1, -0x4(%rbp)
jmp 0x2d95b
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x2d8ee
leaq 0xca51(%rip), %rax      # 0x3a338
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x241, %esi            # imm = 0x241
movl $0x1a4, %edx            # imm = 0x1A4
movb $0x0, %al
callq 0x64e0
movl %eax, -0x14(%rbp)
callq 0x6060
movl (%rax), %eax
movl %eax, -0x18(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x2d920
movq -0x28(%rbp), %rdi
callq 0x6050
cmpl $0x0, -0x14(%rbp)
jge 0x2d94b
movl -0x18(%rbp), %eax
movl %eax, -0x34(%rbp)
callq 0x6060
movl -0x34(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x7cd8(%rip), %rdi      # 0x35615
callq 0x6520
movl $0x1, -0x4(%rbp)
jmp 0x2d95b
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)