LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/http/http_timer.c
// Function: expire_timers
int expire_timers() {
    rbtree_node_t* node;
    http_timer_t* timer;
    http_request_t* ev;

    //while (timer_rbtree.root != &timer_nil) {
    for ( ;; ) {
        //DBG("expire timer pid:%u ready to lock\n", pthread_self());
        pthread_mutex_lock(&timer_mutex);

        //DBG("expire timer pid:%u locked\n", pthread_self());
        
        /* 定时器为空，即红黑树为空 */
        if (timer_rbtree.root == &timer_nil) {
            break;
        }

        /* 获取红黑树中最左边的节点即键最小的节点 */
        if ((node = rbtree_get_min(&timer_rbtree)) == NULL) {
            log_error("get min failed.");
            pthread_mutex_unlock(&timer_mutex);
            return -1;
        }

        update_current_msec();

        /* 计算是否超时 */
        if ((msec_int_t)(node->key - current_msec) <= 0) {
            /* 如果超时 */
            /* 删除红黑树中的节点 */
            rbtree_delete(&timer_rbtree, node);

            pthread_mutex_unlock(&timer_mutex);


            /* 通过偏移量获取 timer 指针 */
            timer = (http_timer_t*) ((char*)node - offsetof(http_timer_t, timer_node));

            /* 标记红黑树中已经不监控该事件 */
            timer->timer_set = 0;

            /* 通过偏移量获取事件指针 */
            ev = (http_request_t*) ((char*)timer - offsetof(http_request_t, timer));
            
            /* 标记事件已超时 */
            timer->timeout = 1;

            /* 执行回调函数 */
            if (timer->handler) {
                timer->handler((void*)ev);
            }

            continue;
        }


        break;
    }

    pthread_mutex_unlock(&timer_mutex);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x65f8(%rip), %rdi      # 0xb320
callq 0x2480
movq 0x65a4(%rip), %rax      # 0xb2d8
xorl %ebx, %ebx
leaq 0x65b3(%rip), %r13      # 0xb2f0
cmpq %r13, %rax
je 0x4df1
leaq 0x658b(%rip), %r14      # 0xb2d8
leaq 0x65cc(%rip), %r15      # 0xb320
movq %r14, %rdi
callq 0x510c
testq %rax, %rax
je 0x4dc6
movq %rax, %r12
callq 0x4fe3
movq (%r12), %rax
subq 0x65d4(%rip), %rax      # 0xb348
testq %rax, %rax
jg 0x4df1
movq %r14, %rdi
movq %r12, %rsi
callq 0x54f6
movq %r15, %rdi
callq 0x22b0
movb 0x38(%r12), %al
andb $-0x4, %al
orb $0x2, %al
movb %al, 0x38(%r12)
movq 0x30(%r12), %rax
testq %rax, %rax
je 0x4db0
addq $-0x20a8, %r12          # imm = 0xDF58
movq %r12, %rdi
callq *%rax
movq %r15, %rdi
callq 0x2480
movq 0x6519(%rip), %rax      # 0xb2d8
cmpq %r13, %rax
jne 0x4d54
jmp 0x4df1
leaq 0x2e57(%rip), %rsi      # 0x7c24
leaq 0x2eb5(%rip), %rdx      # 0x7c89
leaq 0x2ebc(%rip), %r8       # 0x7c97
movl $0x4, %edi
movl $0x78, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
leaq 0x6528(%rip), %rdi      # 0xb320
callq 0x22b0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/http/http_timer.c
// Function: add_timer
int add_timer(void* http_request, msec_t timeout, timer_handler_t* handler) {
    http_request_t* ev;
    http_timer_t* timer;

    if (http_request == NULL) {
        log_error("event ptr is NULL.");
        return -1;
    }

    if (timeout <= 0) {
        log_error("timeout is invalid.");
        return -1;
    }

    ev = (http_request_t*)http_request;
    timer = &(ev->timer);

    if (timer->timer_set) {
        /* 如果定时器已被设置，则先删除再添加 */
        //log_debug("delete timer first?");
        delete_timer(ev);
    }

    /* 设置标记位和回调函数 */
    timer->timer_set = 1;
    timer->timeout = 0;
    timer->handler = handler;

    update_current_msec();

    /* 设置超时时间 */
    timer->timer_node.key = current_msec + timeout;

    pthread_mutex_lock(&timer_mutex);

    /* 向红黑树中插入节点 */
    //log_debug("ready to insert:%d", timer->timer_node.key);
    if (rbtree_insert(&timer_rbtree, &(timer->timer_node)) != 0) {
        log_error("rbtree insert failed.");
        pthread_mutex_unlock(&timer_mutex);
        return -1;
    }

    pthread_mutex_unlock(&timer_mutex);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x4ed0
movq %rsi, %rbx
testq %rsi, %rsi
je 0x4ef1
movq %rdx, %r12
movq %rdi, %r15
leaq 0x20a8(%rdi), %r14
movb 0x20e0(%rdi), %al
testb $0x1, %al
je 0x4e54
movq %r15, %rdi
callq 0x4f35
movb 0x20e0(%r15), %al
andb $-0x4, %al
incb %al
movb %al, 0x20e0(%r15)
movq %r12, 0x20d8(%r15)
callq 0x4fe3
addq 0x64d6(%rip), %rbx      # 0xb348
movq %rbx, 0x20a8(%r15)
leaq 0x64a0(%rip), %rdi      # 0xb320
callq 0x2480
leaq 0x644c(%rip), %rdi      # 0xb2d8
movq %r14, %rsi
callq 0x52dc
testl %eax, %eax
je 0x4f25
leaq 0x2d81(%rip), %rsi      # 0x7c24
leaq 0x2dfd(%rip), %rdx      # 0x7ca7
leaq 0x2e27(%rip), %r8       # 0x7cd8
movl $0x4, %edi
movl $0xce, %ecx
xorl %eax, %eax
callq 0x252a
leaq 0x6457(%rip), %rdi      # 0xb320
callq 0x22b0
jmp 0x4f17
leaq 0x2d4d(%rip), %rsi      # 0x7c24
leaq 0x2dc9(%rip), %rdx      # 0x7ca7
leaq 0x2dcc(%rip), %r8       # 0x7cb1
movl $0x4, %edi
movl $0xad, %ecx
jmp 0x4f10
leaq 0x2d2c(%rip), %rsi      # 0x7c24
leaq 0x2da8(%rip), %rdx      # 0x7ca7
leaq 0x2dbe(%rip), %r8       # 0x7cc4
movl $0x4, %edi
movl $0xb2, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x63f4(%rip), %rdi      # 0xb320
callq 0x22b0
xorl %eax, %eax
jmp 0x4f1c
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/http/http_timer.c
// Function: delete_timer
int delete_timer(void* http_request) {
    http_request_t* ev;

    if (http_request == NULL) {
        log_error("event ptr is NULL.");
        return -1;
    }

    ev = (http_request_t*)http_request;

    pthread_mutex_lock(&timer_mutex);

    /* 删除红黑树中的节点 */
    //log_debug("ready to delete:%d", (ev->timer).timer_node.key);
    if (rbtree_delete(&timer_rbtree, &((ev->timer).timer_node)) != 0) {
        log_error("delete rbtree node failed.");
        pthread_mutex_unlock(&timer_mutex);
        return -1;
    }

    pthread_mutex_unlock(&timer_mutex);

    /* 标记红黑树中已经不监控该事件 */
    (ev->timer).timer_set = 0;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x4f9a
movq %rdi, %rbx
leaq 0x63d6(%rip), %rdi      # 0xb320
callq 0x2480
leaq 0x20a8(%rbx), %rsi
leaq 0x637b(%rip), %rdi      # 0xb2d8
callq 0x54f6
testl %eax, %eax
je 0x4fc7
leaq 0x2cb7(%rip), %rsi      # 0x7c24
leaq 0x2d7a(%rip), %rdx      # 0x7cee
leaq 0x2d80(%rip), %r8       # 0x7cfb
movl $0x4, %edi
movl $0xea, %ecx
xorl %eax, %eax
callq 0x252a
leaq 0x638d(%rip), %rdi      # 0xb320
callq 0x22b0
jmp 0x4fc0
leaq 0x2c83(%rip), %rsi      # 0x7c24
leaq 0x2d46(%rip), %rdx      # 0x7cee
leaq 0x2d02(%rip), %r8       # 0x7cb1
movl $0x4, %edi
movl $0xdf, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4fdc
leaq 0x6352(%rip), %rdi      # 0xb320
callq 0x22b0
andb $-0x2, 0x20e0(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/rbtree.c
// Function: rbtree_init
int rbtree_init(volatile rbtree_t* tree, rbtree_node_t* nil, rbtree_insert_func* insert) {
    if (tree == NULL) {
        log_error("rbtree ptr is NULL.");
        return -1;
    }

    rbtree_dye_black(nil);
    tree->root = nil;
    tree->nil = nil;
    tree->insert = insert;

    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x50db
movb $0x0, 0x8(%rsi)
movq %rsi, (%rdi)
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x2cde(%rip), %rsi      # 0x7dc4
leaq 0x2ce9(%rip), %rdx      # 0x7dd6
leaq 0x2cee(%rip), %r8       # 0x7de2
movl $0x4, %edi
movl $0x16, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/rbtree.c
// Function: rbtree_get_min
rbtree_node_t* rbtree_get_min(volatile rbtree_t* tree) {
    rbtree_node_t* node;
    rbtree_node_t* nil;

    if (tree == NULL) {
        log_error("rbtree ptr is NULL.");
        return NULL;
    }
    
    node = tree->root;
    nil = tree->nil;

    if (node == nil) {
        return NULL;
    }

    while (node->left_son != nil) {
        node = node->left_son;
    }

    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x5131
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
cmpq %rax, %rcx
je 0x515b
movq %rcx, %rbx
movq 0x10(%rcx), %rcx
cmpq %rax, %rcx
jne 0x5123
jmp 0x515d
leaq 0x2c8c(%rip), %rsi      # 0x7dc4
leaq 0x2cb7(%rip), %rdx      # 0x7df6
leaq 0x2c9c(%rip), %r8       # 0x7de2
xorl %ebx, %ebx
movl $0x4, %edi
movl $0x2a, %ecx
xorl %eax, %eax
callq 0x252a
jmp 0x515d
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/rbtree.c
// Function: rbtree_find
rbtree_node_t* rbtree_find(volatile rbtree_t* tree, rbtree_key_t key) {
    rbtree_node_t* now;
    rbtree_node_t* nil;
    rbtree_insert_func* insert;

    if (tree == NULL) {
        log_error("rbtree ptr is NULL.");
        return NULL;
    }

    now = tree->root;
    nil = tree->nil;
    insert = tree->insert;

    while (now != nil) {
        /* 通过有符号数比较进行的查找方式 */
        if (insert == rbtree_insert_value) {
            if ((rbtree_key_int_t)key < (rbtree_key_int_t)now->key) {
                now = now->left_son;
            } else if ((rbtree_key_int_t)key > (rbtree_key_int_t)now->key) {
                now = now->right_son;
            } else {
                return now;
            }
        } else if (insert == rbtree_insert_uvalue) {
            /* 通过无符号数比较进行的查找方式 */
            if (key < now->key) {
                now = now->left_son;
            } else if (key > now->key) {
                now = now->right_son;
            } else {
                return now;
            }
        } else if (insert == rbtree_insert_timer) {
            /* timer 的查找方式 */
            if ((rbtree_key_int_t)(key - now->key) < 0) {
                now = now->left_son;
            } else if ((rbtree_key_int_t)(key - now->key) > 0) {
                now = now->right_son;
            } else {
                return now;
            }
        }
    }

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x51f6
movq (%rdi), %rbx
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rcx
cmpq %rax, %rbx
je 0x51f2
leaq 0x9b(%rip), %rdx        # 0x5228
leaq 0xd0(%rip), %rdi        # 0x5264
leaq 0x105(%rip), %r8        # 0x52a0
cmpq %rdx, %rcx
je 0x51b9
cmpq %rdi, %rcx
je 0x51ce
cmpq %r8, %rcx
jne 0x51ed
cmpq (%rbx), %rsi
js 0x51e3
movl $0x18, %r9d
jne 0x51e9
jmp 0x521e
movl $0x10, %r9d
cmpq %rsi, (%rbx)
jg 0x51e9
movl $0x18, %r9d
jl 0x51e9
jmp 0x521e
movl $0x10, %r9d
cmpq %rsi, (%rbx)
ja 0x51e9
movl $0x18, %r9d
jb 0x51e9
jmp 0x521e
movl $0x10, %r9d
movq (%rbx,%r9), %rbx
cmpq %rax, %rbx
jne 0x519b
xorl %ebx, %ebx
jmp 0x521e
leaq 0x2bc7(%rip), %rsi      # 0x7dc4
leaq 0x2c01(%rip), %rdx      # 0x7e05
leaq 0x2bd7(%rip), %r8       # 0x7de2
xorl %ebx, %ebx
movl $0x4, %edi
movl $0x52, %ecx
xorl %eax, %eax
callq 0x252a
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/rio.c
// Function: rio_readn
ssize_t rio_readn(int fd, void* usrbuf, size_t* n) {
    size_t nleft = *n;              /* 剩余多少字节未读 */
    ssize_t nread;
    char* bufp = (char*)usrbuf;     /* 读到 usrbuf 的位置 */
    
    while (nleft > 0) {
        if ((nread = read(fd, bufp, nleft)) < 0) {
            if (errno != EINTR) {   /* 当 read 被中断则忽略，否则返回错误 */
                *n = *n - nleft;
                return -1;
            }
        } else if (nread == 0) {    /* 读到 EOF */
            break;
        } else {
            bufp += nread;
            nleft -= nread;
        }
    }
    return (*n - nleft);            /* 返回读了多少字节 */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdx), %r14
testq %r14, %r14
je 0x59e3
movq %rdx, %rbx
movq %rsi, %r15
movl %edi, %r12d
movl %r12d, %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2200
testq %rax, %rax
js 0x59c9
je 0x59db
addq %rax, %r15
subq %rax, %r14
jmp 0x59d3
callq 0x2050
cmpl $0x4, (%rax)
jne 0x59e7
testq %r14, %r14
jne 0x59ac
xorl %r14d, %r14d
movq (%rbx), %rax
subq %r14, %rax
jmp 0x59f1
xorl %eax, %eax
jmp 0x59f1
subq %r14, (%rbx)
movq $-0x1, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/rio.c
// Function: rio_writen
ssize_t rio_writen(int fd, void* usrbuf, size_t n) {
    size_t nleft = n;       /* 剩余多少字节未写 */
    ssize_t nwrite;       
    char* bufp = usrbuf;    /* 从 usrbuf 写的位置 */

    while (nleft > 0) {
        if ((nwrite = write(fd, bufp, nleft)) <= 0) {
            if (errno != EINTR && errno != EAGAIN) {   /* 当 write 被中断则忽略，否则返回错误 */
                return -1;
            }
        } else {
            bufp += nwrite;
            nleft -= nwrite;
        }
    }
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdx, %rdx
je 0x5a49
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r15d
movq %rdx, %r12
movl %r15d, %edi
movq %r14, %rsi
movq %r12, %rdx
callq 0x20f0
testq %rax, %rax
jle 0x5a31
addq %rax, %r14
subq %rax, %r12
jmp 0x5a42
callq 0x2050
movl (%rax), %eax
cmpl $0x4, %eax
je 0x5a42
cmpl $0xb, %eax
jne 0x5a4d
testq %r12, %r12
jne 0x5a16
jmp 0x5a54
xorl %ebx, %ebx
jmp 0x5a54
movq $-0x1, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/rio.c
// Function: rio_readn_buf
ssize_t	rio_readn_buf(rio_t* rp, void* usrbuf, size_t n) {
    size_t nleft = n;       /* 剩余多少字节未读 */
    ssize_t nread;
    char* bufp = usrbuf;    /* 读到 usrbuf 的位置 */

    while (nleft > 0) {
        if ((nread = rio_read(rp, bufp, nleft)) < 0) {
            return -1;
        } else if (nread == 0) {
            return 0;       /* 读到 EOF，返回 0 */
        } else {
            bufp += nread;
            nleft -= nread;
        }
    }
    return (n - nleft);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdx, %rdx
je 0x5ab3
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x5aca
testq %rax, %rax
js 0x5ab7
je 0x5ab3
addq %rax, %r14
subq %rax, %r12
jne 0x5a94
jmp 0x5abe
xorl %ebx, %ebx
jmp 0x5abe
movq $-0x1, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/rio.c
// Function: rio_read
static ssize_t rio_read(rio_t* rp, char* usrbuf, size_t n) {
    size_t cnt;

    while (rp->rio_unread <= 0) {   /* 当内部缓冲区没有内容可读时 */
        if ((rp->rio_unread = read(rp->rio_fd, rp->rio_buf, sizeof rp->rio_buf)) < 0) {
            if (errno != EINTR) {   /* 当 read 被中断则忽略，否则返回错误 */
                return -1;
            }
        } else if (rp->rio_unread == 0) {
            return 0;               /* 读到 EOF，返回 0 */
        } else {
            rp->rio_bufptr = rp->rio_buf;
        }
    }
    
    cnt = rp->rio_unread < n ? rp->rio_unread : n;  /* 实际读到的字节数 */
    memcpy(usrbuf, rp->rio_bufptr, cnt);
    rp->rio_bufptr += cnt;
    rp->rio_unread -= cnt;
    return cnt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x8(%rdi), %rax
testq %rax, %rax
jle 0x5b11
cmpq %rbx, %rax
cmovbq %rax, %rbx
movq 0x10(%r14), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x2280
addq %rbx, 0x10(%r14)
subq %rbx, 0x8(%r14)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18(%r14), %r12
movl (%r14), %edi
movl $0x2000, %edx           # imm = 0x2000
movq %r12, %rsi
callq 0x2200
movq %rax, 0x8(%r14)
testq %rax, %rax
jns 0x5b41
callq 0x2050
cmpl $0x4, (%rax)
je 0x5b15
movq $-0x1, %rbx
jmp 0x5b05
je 0x5b49
movq %r12, 0x10(%r14)
jmp 0x5ae7
xorl %ebx, %ebx
jmp 0x5b05
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/rio.c
// Function: rio_readline_buf
ssize_t	rio_readline_buf(rio_t* rp, void* usrbuf, size_t maxlen) {
    size_t n, rc;
    char c;
    char* bufp = usrbuf;

    for (n = 1; n <= maxlen; ++ n) {
        if ((rc = rio_read(rp, &c, 1)) == 1) {
            *bufp ++ = c;
            if (c == '\n') {        /* 读到换行符 */ 
                n ++ ;
                break;
            }
        } else if (rc == 0) {       /* 读到 EOF */
            break;
        } else {
            return -1;
        }
    }
    *bufp = '\0';
    return (n - 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
testq %rdx, %rdx
je 0x5b9f
movq %rdx, %r15
movq %rdi, %r12
movl $0x1, %ebx
leaq -0x29(%rbp), %r13
movl $0x1, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x5aca
cmpq $0x1, %rax
jne 0x5ba3
movb -0x29(%rbp), %al
movb %al, (%r14)
incq %r14
cmpb $0xa, %al
je 0x5bab
incq %rbx
cmpq %r15, %rbx
jbe 0x5b72
jmp 0x5ba8
xorl %ebx, %ebx
jmp 0x5bab
testq %rax, %rax
jne 0x5bc1
decq %rbx
movb $0x0, (%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $-0x1, %rbx
jmp 0x5baf
nop
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/threadpool.c
// Function: threadpool_worker
static void* threadpool_worker(void* threadpool) {

    threadpool_t* pool = (threadpool_t*)threadpool;
    threadpool_task_t task;

    for ( ;; ) {
        /* 获取互斥锁 */
        pthread_mutex_lock(&(pool->lock_mutex));

        /* 当任务队列中任务数为空，工作线程阻塞在 nempty_cond 上 */
        while ((pool->task_num == 0) && (!pool->shutdown)) {
            pthread_cond_wait(&(pool->nempty_cond), &(pool->lock_mutex));
        }
        
        /* 若线程池关闭，则线程终止 */
        if (pool->shutdown) {
            break;
        }

        /* 从任务队列首部取任务 */
        task.func = pool->task_queue[pool->task_queue_front].func;
        task.args = pool->task_queue[pool->task_queue_front].args;
        
        /* 循环队列 */
        pool->task_queue_front = (pool->task_queue_front + 1) % pool->task_queue_size;
        pool->task_num -- ;

        /* 取完任务则广播任务队列未满条件 */
        pthread_cond_broadcast(&(pool->nfull_cond));
        /* 解开互斥锁 */
        pthread_mutex_unlock(&(pool->lock_mutex));

        /* 执行任务 */
        (*(task.func))(task.args);
    }

    /* 终止线程 */
    pool->thread_running -- ;
    pthread_mutex_unlock(&(pool->lock_mutex));
    pthread_exit(NULL);

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x30(%rdi), %rbx
leaq 0x88(%rdi), %r15
leaq 0x58(%rdi), %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
callq 0x2480
movl 0x24(%r14), %ecx
testl %ecx, %ecx
jne 0x5df0
cmpl $0x0, 0x28(%r14)
jne 0x5e37
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2110
jmp 0x5dd4
cmpl $0x0, 0x28(%r14)
jne 0x5e37
movq 0x8(%r14), %rdx
movslq 0x1c(%r14), %rsi
leal 0x1(%rsi), %eax
shlq $0x4, %rsi
movq (%rdx,%rsi), %r12
movq 0x8(%rdx,%rsi), %r13
cltd
idivl 0x18(%r14)
movl %edx, 0x1c(%r14)
decl %ecx
movl %ecx, 0x24(%r14)
movq -0x30(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x22b0
movq %r13, %rdi
callq *%r12
jmp 0x5dcc
decl 0x14(%r14)
movq %rbx, %rdi
callq 0x22b0
xorl %edi, %edi
callq 0x22c0
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/threadpool.c
// Function: threadpool_free
static int threadpool_free(threadpool_t* threadpool) {
    if (threadpool == NULL) {
        return -1;
    }

    /* 释放线程 tid 数组空间 */
    if (threadpool->threads) {
        free(threadpool->threads);
        threadpool->threads = NULL;

        /* 由于初始化互斥量和条件变量在 threads 之前，所以此处一定已经初始化成功 */
        pthread_mutex_lock(&(threadpool->lock_mutex));
        pthread_mutex_destroy(&(threadpool->lock_mutex));
        pthread_cond_destroy(&(threadpool->nfull_cond));
        pthread_cond_destroy(&(threadpool->nempty_cond));
    }

    /* 释放任务队列空间 */
    if (threadpool->task_queue) {
        free(threadpool->task_queue);
        threadpool->task_queue = NULL;
    }

    /* 释放线程池空间 */
    free(threadpool);
    threadpool = NULL;

    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x5eb3
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x5e96
callq 0x2030
movq $0x0, (%rbx)
leaq 0x30(%rbx), %r14
movq %r14, %rdi
callq 0x2480
movq %r14, %rdi
callq 0x2170
leaq 0x58(%rbx), %rdi
callq 0x2370
leaq 0x88(%rbx), %rdi
callq 0x2370
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x5ea4
callq 0x2030
movq %rbx, %rdi
callq 0x2030
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/threadpool.c
// Function: threadpool_add_task
int threadpool_add_task(threadpool_t* threadpool, task_function_t* func, void* args) {
    if (threadpool == NULL || func == NULL) {
        log_error("arguments invalid.");
        return -1;
    }

    /* 加锁 */
    pthread_mutex_lock(&(threadpool->lock_mutex));

    /* 如果任务队列中任务已满，则阻塞在条件 nfull_cond 上 */
    while ((threadpool->task_num == threadpool->task_queue_size) && (!threadpool->shutdown)) {
        pthread_cond_wait(&(threadpool->nfull_cond), &(threadpool->lock_mutex));
    }

    /* 如果线程池已经关闭 */
    if (threadpool->shutdown) {
        pthread_mutex_unlock(&(threadpool->lock_mutex));
        log_error("threadpool already shutdown.");
        return -1;
    }

    /* 添加任务到任务队列尾部 */
    threadpool->task_queue[threadpool->task_queue_rear].func = func;
    threadpool->task_queue[threadpool->task_queue_rear].args = args;
    threadpool->task_queue_rear = (threadpool->task_queue_rear + 1) % threadpool->task_queue_size;
    threadpool->task_num ++ ;

    /* 通知一个阻塞在 nempty_cond 上的线程并解锁互斥锁 */
    pthread_cond_signal(&(threadpool->nempty_cond));
    pthread_mutex_unlock(&(threadpool->lock_mutex));

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
setne %al
testq %rsi, %rsi
setne %cl
testb %cl, %al
jne 0x5ef8
leaq 0x1faf(%rip), %rsi      # 0x7e8d
leaq 0x206c(%rip), %rdx      # 0x7f51
leaq 0x1fc9(%rip), %r8       # 0x7eb5
movl $0x4, %edi
movl $0x8b, %ecx
jmp 0x5f63
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x30(%rdi), %r14
movq %r14, %rdi
callq 0x2480
movl 0x18(%rbx), %esi
movl 0x24(%rbx), %ecx
cmpl %esi, %ecx
jne 0x5f36
leaq 0x58(%rbx), %r13
cmpl $0x0, 0x28(%rbx)
jne 0x5f3c
movq %r13, %rdi
movq %r14, %rsi
callq 0x2110
movl 0x18(%rbx), %esi
movl 0x24(%rbx), %ecx
cmpl %esi, %ecx
je 0x5f1b
cmpl $0x0, 0x28(%rbx)
je 0x5f7e
movq %r14, %rdi
callq 0x22b0
leaq 0x1f42(%rip), %rsi      # 0x7e8d
leaq 0x1fff(%rip), %rdx      # 0x7f51
leaq 0x200c(%rip), %r8       # 0x7f65
movl $0x4, %edi
movl $0x9a, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rdx
movslq 0x20(%rbx), %rdi
leal 0x1(%rdi), %eax
shlq $0x4, %rdi
movq %r12, (%rdx,%rdi)
movq %r15, 0x8(%rdx,%rdi)
cltd
idivl %esi
movl %edx, 0x20(%rbx)
incl %ecx
movl %ecx, 0x24(%rbx)
addq $0x88, %rbx
movq %rbx, %rdi
callq 0x2220
movq %r14, %rdi
callq 0x22b0
xorl %eax, %eax
jmp 0x5f6f
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/threadpool.c
// Function: threadpool_destroy
int threadpool_destroy(threadpool_t* threadpool) {
    int i;

    do {
        if (threadpool == NULL) {
            log_error("arguments invalid.");
            break;
        }

        /* 取得互斥锁资源 */
        if (pthread_mutex_lock(&(threadpool->lock_mutex)) != 0) {
            log_error("lock failed.");
            break;
        }

        /* 如果线程池已经关闭，则直接返回 */
        if (threadpool->shutdown) {
            log_error("already shutting down.");
            break;
        }

        /* 将线程池设置为关闭 */
        threadpool->shutdown = 1;

        /* 广播通知线程终止并解锁 */
        if ((pthread_cond_broadcast(&(threadpool->nempty_cond)) != 0) ||
            (pthread_mutex_unlock(&(threadpool->lock_mutex)) != 0)) {
            log_error("threadpool unlock failed.");
            break;
        }

        /* 回收线程池中的所有线程 */
        for (i = 0; i < threadpool->thread_running; ++ i) {
            if (pthread_join(threadpool->threads[i], NULL) != 0) {
                log_error("thread join failed.");
            }
        }

        return threadpool_free(threadpool);

    } while (0);

    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x6006
movq %rdi, %rbx
leaq 0x30(%rdi), %r14
movq %r14, %rdi
callq 0x2480
testl %eax, %eax
je 0x6027
leaq 0x1ea4(%rip), %rsi      # 0x7e8d
leaq 0x1f92(%rip), %rdx      # 0x7f82
leaq 0x1fc2(%rip), %r8       # 0x7fb9
movl $0x4, %edi
movl $0xdc, %ecx
jmp 0x6090
leaq 0x1e80(%rip), %rsi      # 0x7e8d
leaq 0x1f6e(%rip), %rdx      # 0x7f82
leaq 0x1e9a(%rip), %r8       # 0x7eb5
movl $0x4, %edi
movl $0xd6, %ecx
jmp 0x6090
cmpl $0x0, 0x28(%rbx)
je 0x604e
leaq 0x1e59(%rip), %rsi      # 0x7e8d
leaq 0x1f47(%rip), %rdx      # 0x7f82
leaq 0x1f53(%rip), %r8       # 0x7f95
movl $0x4, %edi
movl $0xe2, %ecx
jmp 0x6090
movl $0x1, 0x28(%rbx)
leaq 0x88(%rbx), %rdi
callq 0x20a0
testl %eax, %eax
jne 0x6071
movq %r14, %rdi
callq 0x22b0
testl %eax, %eax
je 0x60ab
leaq 0x1e15(%rip), %rsi      # 0x7e8d
leaq 0x1f03(%rip), %rdx      # 0x7f82
leaq 0x1f26(%rip), %r8       # 0x7fac
movl $0x4, %edi
movl $0xec, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x14(%rbx)
jle 0x6101
leaq 0x1dd5(%rip), %r14      # 0x7e8d
leaq 0x1ec3(%rip), %r15      # 0x7f82
leaq 0x1f00(%rip), %r12      # 0x7fc6
xorl %r13d, %r13d
movq (%rbx), %rax
movq (%rax,%r13,8), %rdi
xorl %esi, %esi
callq 0x2420
testl %eax, %eax
je 0x60f5
movl $0x4, %edi
movq %r14, %rsi
movq %r15, %rdx
movl $0xf3, %ecx
movq %r12, %r8
xorl %eax, %eax
callq 0x252a
incq %r13
movslq 0x14(%rbx), %rax
cmpq %rax, %r13
jl 0x60c9
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5e4a
nop
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/utility.c
// Function: set_nonblocking
int set_nonblocking(int fd)
{
    int old_option;
    int new_option;

    if ((old_option = fcntl(fd, F_GETFL)) == -1)
    {
        log_error("get fd option failed.");
        return -1;
    }

    new_option = old_option | O_NONBLOCK;

    if (fcntl(fd, F_SETFL, new_option) == -1)
    {
        log_error("set fd option failed.");
        return -1;
    }

    return old_option;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %r14d
movl $0x3, %esi
xorl %eax, %eax
callq 0x20e0
cmpl $-0x1, %eax
je 0x6172
movl %eax, %ebx
movl %eax, %edx
orl $0x800, %edx            # imm = 0x800
movl %r14d, %edi
movl $0x4, %esi
xorl %eax, %eax
callq 0x20e0
cmpl $-0x1, %eax
jne 0x619d
leaq 0x1e82(%rip), %rsi      # 0x7fda
leaq 0x1e8e(%rip), %rdx      # 0x7fed
leaq 0x1ead(%rip), %r8       # 0x8013
movl $0x4, %edi
movl $0x26, %ecx
jmp 0x6191
leaq 0x1e61(%rip), %rsi      # 0x7fda
leaq 0x1e6d(%rip), %rdx      # 0x7fed
leaq 0x1e76(%rip), %r8       # 0x7ffd
movl $0x4, %edi
movl $0x1e, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/utility.c
// Function: ignore_sigpipe
int ignore_sigpipe()
{
    struct sigaction sa;

    memset(&sa, 0, sizeof(sa));
    sa.sa_handler = SIG_IGN;
    sa.sa_flags = 0;

    if (sigaction(SIGPIPE, &sa, NULL))
    {
        log_error("ignore SIGPIPE signal failed.");
        return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xa0, %rsp
leaq -0xa0(%rbp), %r14
xorl %ebx, %ebx
movl $0x90, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x21b0
movq $0x1, -0x8(%r14)
leaq -0xa8(%rbp), %rsi
movl $0xd, %edi
xorl %edx, %edx
callq 0x20b0
testl %eax, %eax
je 0x6214
leaq 0x1dea(%rip), %rsi      # 0x7fda
leaq 0x1e32(%rip), %rdx      # 0x8029
leaq 0x1e3a(%rip), %r8       # 0x8038
movl $0x4, %edi
movl $0x3a, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/j-hoppe[P]tu58fs/main.c
// Function: help
void help() {
	char **s;
	fprintf(ferr, "\n");
	fprintf(ferr, "NAME\n");
	fprintf(ferr, "\n");
	fprintf(ferr, "%s\n", version);
	fprintf(ferr, "%s\n", copyright);

	fprintf(ferr, "\n");
	fprintf(ferr, "SYNOPSIS\n");
	fprintf(ferr, "\n");
	fprintf(ferr, "Command line options are processed strictly left-to-right. \n\n");
	// getopt must be initialized to print the syntax
	getopt_help(&getopt_parser, stdout, arg_menu_linewidth, 10, PROGNAME);
	fprintf(ferr, "\n");
	fprintf(ferr, "EXAMPLES\n");
	fprintf(ferr, "\n");
	for (s = examples; *s; s++)
		fputs(*s, ferr);

	fprintf(ferr, "\n");
	fprintf(ferr, "SEE ALSO\n");
	fprintf(ferr, "\n");
	fprintf(ferr, "Online docs: www.retrocmp.com/tools/tu58fs \n");
	fprintf(ferr, "Repository: https://github.com/j-hoppe/tu58fs\n");
	fprintf(ferr, "Contact: j_hoppe@t-online.de\n");
	fprintf(ferr, "\n");
	exit(1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x1ab49(%rip), %r14     # 0x1e230
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3290
movq (%r14), %rcx
leaq 0xe932(%rip), %rdi      # 0x12030
movl $0x5, %esi
movl $0x1, %edx
callq 0x3550
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3290
movq (%r14), %rdi
leaq 0x126ba(%rip), %rbx     # 0x15dde
leaq 0x18bf5(%rip), %rdx     # 0x1c320
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3310
movq (%r14), %rdi
leaq 0x18c41(%rip), %rdx     # 0x1c380
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3310
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3290
movq (%r14), %rcx
leaq 0xe8d6(%rip), %rdi      # 0x12036
movl $0x9, %esi
movl $0x1, %edx
callq 0x3550
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3290
movq (%r14), %rcx
leaq 0xe8ba(%rip), %rdi      # 0x12040
movl $0x3d, %esi
movl $0x1, %edx
callq 0x3550
movq 0x18834(%rip), %rax     # 0x1bfd0
movq (%rax), %rsi
movl 0x18b6f(%rip), %edx     # 0x1c314
leaq 0x192e4(%rip), %rdi     # 0x1ca90
leaq 0xe8cb(%rip), %r8       # 0x1207e
movl $0xa, %ecx
callq 0x5e1f
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3290
movq (%r14), %rcx
leaq 0xe8b1(%rip), %rdi      # 0x12085
movl $0x9, %esi
movl $0x1, %edx
callq 0x3550
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3290
leaq 0xeb86(%rip), %rdi      # 0x1237d
leaq 0x1840a(%rip), %rbx     # 0x1bc08
movq (%r14), %rsi
callq 0x3210
movq (%rbx), %rdi
addq $0x8, %rbx
testq %rdi, %rdi
jne 0x37fe
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3290
movq (%r14), %rcx
leaq 0xe866(%rip), %rdi      # 0x1208f
movl $0x9, %esi
movl $0x1, %edx
callq 0x3550
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3290
movq (%r14), %rcx
leaq 0xe84a(%rip), %rdi      # 0x12099
movl $0x2c, %esi
movl $0x1, %edx
callq 0x3550
movq (%r14), %rcx
leaq 0xe85e(%rip), %rdi      # 0x120c6
movl $0x2e, %esi
movl $0x1, %edx
callq 0x3550
movq (%r14), %rcx
leaq 0xe874(%rip), %rdi      # 0x120f5
movl $0x1d, %esi
movl $0x1, %edx
callq 0x3550
movq (%r14), %rsi
movl $0xa, %edi
callq 0x3290
movl $0x1, %edi
callq 0x3540
// File: /workspace/github_c_makefile_star2_O3/j-hoppe[P]tu58fs/main.c
// Function: commandline_option_error
static void commandline_option_error(char *errtext, ...) {
	va_list args;
	fprintf(ferr, "Error while parsing commandline option:\n");
	if (errtext) {
		va_start(args, errtext);
		vfprintf(ferr, errtext, args);
		fprintf(ferr, "\nSyntax:  ");
		va_end(args);
	} else
		fprintf(ferr, "  %s\nSyntax:  ", getopt_parser.curerrortext);
	getopt_help_option(&getopt_parser, stdout, 96, 10);
	exit(1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
movq %rsi, 0x28(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x503d
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)
leaq 0x191ec(%rip), %r14     # 0x1e230
movq (%r14), %rcx
leaq 0xf03a(%rip), %rdi      # 0x14088
movl $0x28, %esi
movl $0x1, %edx
callq 0x3550
testq %rbx, %rbx
jne 0x507c
movq (%r14), %rdi
leaq 0xf045(%rip), %rsi      # 0x140b1
leaq 0x180a1(%rip), %rdx     # 0x1d114
xorl %eax, %eax
callq 0x3310
jmp 0x50c5
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x34f0
movq (%r14), %rcx
leaq 0xefff(%rip), %rdi      # 0x140b5
movl $0xa, %esi
movl $0x1, %edx
callq 0x3550
movq 0x16f04(%rip), %rax     # 0x1bfd0
movq (%rax), %rsi
leaq 0x179ba(%rip), %rdi     # 0x1ca90
movl $0x60, %edx
movl $0xa, %ecx
callq 0x6600
movl $0x1, %edi
callq 0x3540
nop
// File: /workspace/github_c_makefile_star2_O3/j-hoppe[P]tu58fs/getopt2.c
// Function: getopt_isoption
int getopt_isoption(getopt_t *_this, char *name)
{
	if (name == NULL && _this->cur_option == _this->nonoption_descr)
		return 1; // were parsing the non-option args
	if (!_this->cur_option)
		return 0; // not equal
	if (!name) // nonoption args already tested
		return 0;
	// names NULL for nonoption-args
	if (_this->cur_option->short_name && !getopt_strcmp(_this, name, _this->cur_option->short_name))
		return 1;
	if (_this->cur_option->long_name && !getopt_strcmp(_this, name, _this->cur_option->long_name))
		return 1;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movq 0x338(%rdi), %r12
xorl %ebx, %ebx
testq %rsi, %rsi
je 0x53ea
testq %r12, %r12
je 0x542a
movq %rsi, %r14
movq 0x8(%r12), %rsi
testq %rsi, %rsi
je 0x53ff
cmpl $0x0, (%r15)
je 0x53f3
movq %r14, %rdi
callq 0x3060
jmp 0x53fb
cmpq 0x8(%r15), %r12
sete %bl
jmp 0x542a
movq %r14, %rdi
callq 0x32e0
testl %eax, %eax
je 0x5425
movq 0x10(%r12), %rsi
testq %rsi, %rsi
je 0x542a
cmpl $0x0, (%r15)
je 0x5419
movq %r14, %rdi
callq 0x3060
jmp 0x5421
movq %r14, %rdi
callq 0x32e0
testl %eax, %eax
jne 0x542a
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/j-hoppe[P]tu58fs/getopt2.c
// Function: getopt_parse_error
static int getopt_parse_error(getopt_t *_this, int error)
{
	_this->curerror = error;
	switch (error) {
	case GETOPT_STATUS_ILLEGALOPTION:
		snprintf(_this->curerrortext, sizeof(_this->curerrortext),
			"Undefined option at \"%s\"", _this->curtoken);
		break;
	case GETOPT_STATUS_MINARGCOUNT:
		if (_this->cur_option == _this->nonoption_descr)
			snprintf(_this->curerrortext, sizeof(_this->curerrortext),
				"Less than %d non-option arguments at \"%s\"",
				_this->cur_option->fix_arg_count, _this->curtoken);
		else
			snprintf(_this->curerrortext, sizeof(_this->curerrortext),
				"Less than %d arguments for option \"%s\" at \"%s\"",
				_this->cur_option->fix_arg_count, _this->cur_option->long_name, _this->curtoken);
		break;
	case GETOPT_STATUS_MAXARGCOUNT:
		if (_this->cur_option == _this->nonoption_descr)
			snprintf(_this->curerrortext, sizeof(_this->curerrortext),
				"More than %d non-option arguments at \"%s\"", _this->cur_option->max_arg_count, _this->curtoken);
		else
			snprintf(_this->curerrortext, sizeof(_this->curerrortext),
				"More than %d arguments for option \"%s\" at \"%s\"",
				_this->cur_option->max_arg_count, _this->cur_option->long_name, _this->curtoken);
		break;
	}
	return error;
}

// Assembly:
pushq %rbx
movl %esi, %ebx
movl %esi, 0x680(%rdi)
cmpl $-0x3, %esi
je 0x577a
cmpl $-0x2, %ebx
jne 0x57b7
movq 0x338(%rdi), %rdx
leaq 0x684(%rdi), %rax
movl 0x678(%rdx), %ecx
cmpq 0x8(%rdi), %rdx
je 0x57da
movq 0x10(%rdx), %r8
movq 0x678(%rdi), %r9
leaq 0xedf4(%rip), %rdx      # 0x1456c
jmp 0x57a6
movq 0x338(%rdi), %rdx
leaq 0x684(%rdi), %rax
movl 0x67c(%rdx), %ecx
cmpq 0x8(%rdi), %rdx
je 0x57ea
movq 0x10(%rdx), %r8
movq 0x678(%rdi), %r9
leaq 0xee1f(%rip), %rdx      # 0x145c5
movl $0x101, %esi            # imm = 0x101
movq %rax, %rdi
xorl %eax, %eax
callq 0x31d0
jmp 0x5807
movq 0x678(%rdi), %rcx
addq $0x684, %rdi            # imm = 0x684
leaq 0xed5d(%rip), %rdx      # 0x14529
movl $0x101, %esi            # imm = 0x101
xorl %eax, %eax
callq 0x31d0
jmp 0x5807
movq 0x678(%rdi), %r8
leaq 0xed5a(%rip), %rdx      # 0x14542
jmp 0x57f8
movq 0x678(%rdi), %r8
leaq 0xeda3(%rip), %rdx      # 0x1459b
movl $0x101, %esi            # imm = 0x101
movq %rax, %rdi
xorl %eax, %eax
callq 0x31d0
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/j-hoppe[P]tu58fs/getopt2.c
// Function: getopt_arg_s
int getopt_arg_s(getopt_t *_this, char *argname, char *val, unsigned valsize)
{
	int argidx;
	getopt_option_descr_t  *odesc = _this->cur_option;
	if (!odesc)
		return getopt_parse_error(_this, GETOPT_STATUS_ILLEGALOPTION);
	argidx = getopt_optionargidx(_this, odesc, argname);
	if (argidx < 0)
		return getopt_arg_error(_this, odesc, GETOPT_STATUS_ILLEGALARG, argname, NULL);
	if (argidx >= (int)_this->cur_option_argvalcount)
		// only n args specified, but this has list place > n
		// the optional argument [argidx] is not given in the arguument list
		return GETOPT_STATUS_EOF;
	//		return getopt_arg_error(_this, odesc, GETOPT_STATUS_ARGNOTSET, argname, NULL);
	strncpy(val, _this->cur_option_argval[argidx], valsize);
	val[valsize - 1] = 0;
	return GETOPT_STATUS_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r15
movq 0x338(%rdi), %r13
testq %r13, %r13
je 0x5ad7
movq %rsi, %r14
movq %rdx, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movslq 0x678(%r13), %r12
testq %r12, %r12
jle 0x5a62
movl (%r15), %ebx
xorl %ebp, %ebp
movq 0x18(%r13,%rbp,8), %rsi
movq %r14, %rdi
testl %ebx, %ebx
je 0x5a4d
callq 0x3060
jmp 0x5a52
callq 0x32e0
testl %eax, %eax
je 0x5b17
incq %rbp
cmpq %rbp, %r12
jne 0x5a3a
movq %r15, (%rsp)
movl 0x67c(%r13), %ebp
cmpl %ebp, %r12d
jge 0x5aa5
movq (%rsp), %rax
movl (%rax), %r15d
subl %r12d, %ebp
xorl %ebx, %ebx
movq 0x340(%r13,%rbx,8), %rsi
movq %r14, %rdi
testl %r15d, %r15d
je 0x5a95
callq 0x3060
jmp 0x5a9a
callq 0x32e0
testl %eax, %eax
je 0x5b0d
incq %rbx
cmpl %ebx, %ebp
jne 0x5a7e
movq (%rsp), %r15
movl $0xfffffffb, 0x680(%r15) # imm = 0xFFFFFFFB
leaq 0x684(%r15), %rdi
movq 0x10(%r13), %r8
leaq 0xeb4f(%rip), %rdx      # 0x14615
movl $0x101, %esi            # imm = 0x101
movq %r14, %rcx
xorl %eax, %eax
callq 0x31d0
jmp 0x5b56
movl $0xffffffff, 0x680(%r15) # imm = 0xFFFFFFFF
movq 0x678(%r15), %rcx
addq $0x684, %r15            # imm = 0x684
leaq 0xea32(%rip), %rdx      # 0x14529
movl $0x101, %esi            # imm = 0x101
movq %r15, %rdi
xorl %eax, %eax
callq 0x31d0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x5b8a
addq %rbx, %r12
movq %r12, %rbp
movq (%rsp), %r15
testl %ebp, %ebp
js 0x5b56
xorl %eax, %eax
cmpl %ebp, 0x670(%r15)
jle 0x5b8a
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movq 0x348(%r15,%rbp,8), %rsi
movq 0x10(%rsp), %rbx
movl %ebx, %edx
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x30a0
decl %ebx
movb $0x0, (%r14,%rbx)
movl $0x1, %eax
jmp 0x5b8a
movl $0xfffffffc, 0x680(%r15) # imm = 0xFFFFFFFC
addq $0x684, %r15            # imm = 0x684
movq 0x10(%r13), %rcx
leaq 0xea81(%rip), %rdx      # 0x145f4
movl $0x101, %esi            # imm = 0x101
movq %r15, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x31d0
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/j-hoppe[P]tu58fs/getopt2.c
// Function: getopt_arg_i
int getopt_arg_i(getopt_t *_this, char *argname, int *val)
{
	int res;
	char *endptr;
	char buff[GETOPT_MAX_LINELEN + 1];
	res = getopt_arg_s(_this, argname, buff, sizeof(buff));
	if (res <= 0) // error or EOF
		return res;
	*val = strtol(buff, &endptr, 0);
	if (*endptr) // stop char: error
		return getopt_arg_error(_this, _this->cur_option, GETOPT_STATUS_ARGFORMATINT, argname, buff);
	return GETOPT_STATUS_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %rdx
movl $0x101, %ecx            # imm = 0x101
callq 0x59fb
testl %eax, %eax
jle 0x5c2a
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
xorl %edx, %edx
callq 0x3330
movl %eax, (%r15)
movq (%r12), %rax
cmpb $0x0, (%rax)
je 0x5c25
movq 0x338(%r14), %rax
movl $0xfffffffa, 0x680(%r14) # imm = 0xFFFFFFFA
addq $0x684, %r14            # imm = 0x684
movq 0x10(%rax), %r8
leaq 0xea3d(%rip), %rdx      # 0x14644
leaq 0x10(%rsp), %r9
movl $0x101, %esi            # imm = 0x101
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x31d0
movl $0xfffffffa, %eax       # imm = 0xFFFFFFFA
jmp 0x5c2a
movl $0x1, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/j-hoppe[P]tu58fs/getopt2.c
// Function: getopt_arg_u
int getopt_arg_u(getopt_t *_this, char *argname, unsigned *val)
{
	int res;
	char *endptr;
	char buff[GETOPT_MAX_LINELEN + 1];
	res = getopt_arg_s(_this, argname, buff, sizeof(buff));
	if (res <= 0) // error or EOF
		return res;
	*val = strtoul(buff, &endptr, 0);
	if (*endptr) // stop char: error
		return getopt_arg_error(_this, _this->cur_option, GETOPT_STATUS_ARGFORMATINT, argname, buff);
	return GETOPT_STATUS_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %rdx
movl $0x101, %ecx            # imm = 0x101
callq 0x59fb
testl %eax, %eax
jle 0x5cca
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
xorl %edx, %edx
callq 0x3500
movl %eax, (%r15)
movq (%r12), %rax
cmpb $0x0, (%rax)
je 0x5cc5
movq 0x338(%r14), %rax
movl $0xfffffffa, 0x680(%r14) # imm = 0xFFFFFFFA
addq $0x684, %r14            # imm = 0x684
movq 0x10(%rax), %r8
leaq 0xe99d(%rip), %rdx      # 0x14644
leaq 0x10(%rsp), %r9
movl $0x101, %esi            # imm = 0x101
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x31d0
movl $0xfffffffa, %eax       # imm = 0xFFFFFFFA
jmp 0x5cca
movl $0x1, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/j-hoppe[P]tu58fs/getopt2.c
// Function: getopt_arg_o
int getopt_arg_o(getopt_t *_this, char *argname, int *val)
{
	int res;
	char *endptr;
	char buff[GETOPT_MAX_LINELEN + 1];
	res = getopt_arg_s(_this, argname, buff, sizeof(buff));
	if (res <= 0) // error or EOF
		return res;
	*val = strtol(buff, &endptr, 8);
	if (*endptr) // stop char: error
		return getopt_arg_error(_this, _this->cur_option, GETOPT_STATUS_ARGFORMATHEX, argname, buff);
	return GETOPT_STATUS_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %rdx
movl $0x101, %ecx            # imm = 0x101
callq 0x59fb
testl %eax, %eax
jle 0x5d6d
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
movl $0x8, %edx
callq 0x3330
movl %eax, (%r15)
movq (%r12), %rax
cmpb $0x0, (%rax)
je 0x5d68
movq 0x338(%r14), %rax
movl $0xfffffff9, 0x680(%r14) # imm = 0xFFFFFFF9
addq $0x684, %r14            # imm = 0x684
movq 0x10(%rax), %r8
leaq 0xe93b(%rip), %rdx      # 0x14685
leaq 0x10(%rsp), %r9
movl $0x101, %esi            # imm = 0x101
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x31d0
movl $0xfffffff9, %eax       # imm = 0xFFFFFFF9
jmp 0x5d6d
movl $0x1, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/j-hoppe[P]tu58fs/getopt2.c
// Function: getopt_arg_h
int getopt_arg_h(getopt_t *_this, char *argname, int *val)
{
	int res;
	char *endptr;
	char buff[GETOPT_MAX_LINELEN + 1];
	res = getopt_arg_s(_this, argname, buff, sizeof(buff));
	if (res <= 0) // error or EOF
		return res;
	*val = strtol(buff, &endptr, 16);
	if (*endptr) // stop char: error
		return getopt_arg_error(_this, _this->cur_option, GETOPT_STATUS_ARGFORMATHEX, argname, buff);
	return GETOPT_STATUS_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %rdx
movl $0x101, %ecx            # imm = 0x101
callq 0x59fb
testl %eax, %eax
jle 0x5e10
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %r12
movq %r12, %rsi
movl $0x10, %edx
callq 0x3330
movl %eax, (%r15)
movq (%r12), %rax
cmpb $0x0, (%rax)
je 0x5e0b
movq 0x338(%r14), %rax
movl $0xfffffff9, 0x680(%r14) # imm = 0xFFFFFFF9
addq $0x684, %r14            # imm = 0x684
movq 0x10(%rax), %r8
leaq 0xe898(%rip), %rdx      # 0x14685
leaq 0x10(%rsp), %r9
movl $0x101, %esi            # imm = 0x101
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x31d0
movl $0xfffffff9, %eax       # imm = 0xFFFFFFF9
jmp 0x5e10
movl $0x1, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/j-hoppe[P]tu58fs/getopt2.c
// Function: output_append
static void output_append(FILE *stream, char *line, int linesize, char *s, int linebreak, unsigned linelen, unsigned indent)
{
	unsigned _i_;
	if (linebreak
		|| (strlen(line) > indent && (strlen(line) + strlen(s)) > linelen)) {
		// prevent the indent from prev line to be accounted for another line break
		fprintf(stream, "%s\n", line); \
			for (_i_ = 0; _i_ < indent; _i_++) line[_i_] = ' ';
		line[_i_] = 0;
	}
	strncat(line, s, linesize);
	line[linesize - 1] = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
testl %ecx, %ecx
je 0x6246
leaq 0xfbc6(%rip), %rsi      # 0x15dde
xorl %r12d, %r12d
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3310
testl %ebp, %ebp
je 0x623f
movl %ebp, %r12d
movq %rbx, %rdi
movl $0x20, %esi
movq %r12, %rdx
callq 0x3220
movb $0x0, (%rbx,%r12)
jmp 0x626e
movl %r8d, %r12d
movq %rbx, %rdi
callq 0x3190
movq %rax, %r13
movl %ebp, %eax
cmpq %rax, %r13
jbe 0x626e
movq %r14, %rdi
callq 0x3190
addq %r13, %rax
movl %r12d, %ecx
cmpq %rcx, %rax
ja 0x6211
movl $0x200, %edx            # imm = 0x200
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3250
movb $0x0, 0x1ff(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq