LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x24a0
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x24(%rcx)
movb %al, -0x21(%rbp)
jne 0x7c70
movq -0x10(%rbp), %rax
cmpl $0x0, 0x28(%rax)
setne %al
xorb $-0x1, %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x7c79
jmp 0x7c93
movq -0x10(%rbp), %rdi
addq $0x88, %rdi
movq -0x10(%rbp), %rsi
addq $0x30, %rsi
callq 0x2110
jmp 0x7c51
movq -0x10(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0x7ca2
jmp 0x7d2e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x1c(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x1c(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
cltd
idivl 0x18(%rcx)
movq -0x10(%rbp), %rax
movl %edx, 0x1c(%rax)
movq -0x10(%rbp), %rax
movl 0x24(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x24(%rax)
movq -0x10(%rbp), %rdi
addq $0x58, %rdi
callq 0x20a0
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x22d0
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rdi
callq *%rax
jmp 0x7c44
movq -0x10(%rbp), %rax
movl 0x14(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x22d0
xorl %eax, %eax
movl %eax, %edi
callq 0x22e0
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x7d7f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7e13
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x7dd7
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2030
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x24a0
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x2180
movq -0x10(%rbp), %rdi
addq $0x58, %rdi
callq 0x23a0
movq -0x10(%rbp), %rdi
addq $0x88, %rdi
callq 0x23a0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x7dfb
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2030
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rdi
callq 0x2030
movq $0x0, -0x10(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x7fde
movl $0x4, %edi
leaq 0x1ed7(%rip), %rsi      # 0x9e96
leaq 0x1fc5(%rip), %rdx      # 0x9f8b
movl $0xd6, %ecx
leaq 0x1eec(%rip), %r8       # 0x9ebe
movb $0x0, %al
callq 0x6450
jmp 0x811b
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x24a0
cmpl $0x0, %eax
je 0x801b
movl $0x4, %edi
leaq 0x1e9a(%rip), %rsi      # 0x9e96
leaq 0x1f88(%rip), %rdx      # 0x9f8b
movl $0xdc, %ecx
leaq 0x1fb3(%rip), %r8       # 0x9fc2
movb $0x0, %al
callq 0x6450
jmp 0x811b
movq -0x10(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0x8050
movl $0x4, %edi
leaq 0x1e65(%rip), %rsi      # 0x9e96
leaq 0x1f53(%rip), %rdx      # 0x9f8b
movl $0xe2, %ecx
leaq 0x1f5a(%rip), %r8       # 0x9f9e
movb $0x0, %al
callq 0x6450
jmp 0x811b
movq -0x10(%rbp), %rax
movl $0x1, 0x28(%rax)
movq -0x10(%rbp), %rdi
addq $0x88, %rdi
callq 0x20a0
cmpl $0x0, %eax
jne 0x8082
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x22d0
cmpl $0x0, %eax
je 0x80aa
movl $0x4, %edi
leaq 0x1e08(%rip), %rsi      # 0x9e96
leaq 0x1ef6(%rip), %rdx      # 0x9f8b
movl $0xec, %ecx
leaq 0x1f14(%rip), %r8       # 0x9fb5
movb $0x0, %al
callq 0x6450
jmp 0x811b
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jge 0x810d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2440
cmpl $0x0, %eax
je 0x8100
movl $0x4, %edi
leaq 0x1db0(%rip), %rsi      # 0x9e96
leaq 0x1e9e(%rip), %rdx      # 0x9f8b
movl $0xf3, %ecx
leaq 0x1ed6(%rip), %r8       # 0x9fcf
movb $0x0, %al
callq 0x6450
jmp 0x8102
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x80b1
movq -0x10(%rbp), %rdi
callq 0x7d60
movl %eax, -0x4(%rbp)
jmp 0x8122
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %edi
movl $0x3, %esi
movb $0x0, %al
callq 0x20e0
movl %eax, -0xc(%rbp)
cmpl $-0x1, %eax
jne 0x8181
movl $0x4, %edi
leaq 0x1e85(%rip), %rsi      # 0x9fe3
leaq 0x1e91(%rip), %rdx      # 0x9ff6
movl $0x1e, %ecx
leaq 0x1e95(%rip), %r8       # 0xa006
movb $0x0, %al
callq 0x6450
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x81d8
movl -0xc(%rbp), %eax
orl $0x800, %eax            # imm = 0x800
movl %eax, -0x10(%rbp)
movl -0x8(%rbp), %edi
movl -0x10(%rbp), %edx
movl $0x4, %esi
movb $0x0, %al
callq 0x20e0
cmpl $-0x1, %eax
jne 0x81d2
movl $0x4, %edi
leaq 0x1e34(%rip), %rsi      # 0x9fe3
leaq 0x1e40(%rip), %rdx      # 0x9ff6
movl $0x26, %ecx
leaq 0x1e5a(%rip), %r8       # 0xa01c
movb $0x0, %al
callq 0x6450
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x81d8
movl -0xc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0xa0, %rsp
leaq -0xa0(%rbp), %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x21d0
movl $0x1, %eax
movq %rax, -0xa0(%rbp)
movl $0x0, -0x18(%rbp)
movl $0xd, %edi
leaq -0xa0(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x20b0
cmpl $0x0, %eax
je 0x826a
movl $0x4, %edi
leaq 0x1d9c(%rip), %rsi      # 0x9fe3
leaq 0x1de4(%rip), %rdx      # 0xa032
movl $0x3a, %ecx
leaq 0x1de7(%rip), %r8       # 0xa041
movb $0x0, %al
callq 0x6450
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8271
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
testb %al, %al
je 0x5505
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r9, -0xa8(%rbp)
movq %r8, -0xb0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rsi, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
leaq 0x1fffd(%rip), %rax     # 0x25530
movq (%rax), %rdi
leaq 0x15b1f(%rip), %rsi     # 0x1b05c
movb $0x0, %al
callq 0x3300
cmpq $0x0, -0x8(%rbp)
je 0x55a4
leaq -0x20(%rbp), %rax
leaq -0xd0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
leaq 0x1ffba(%rip), %rax     # 0x25530
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x34e0
leaq 0x1ffa3(%rip), %rax     # 0x25530
movq (%rax), %rdi
leaq 0x15af2(%rip), %rsi     # 0x1b089
movb $0x0, %al
callq 0x3300
leaq -0x20(%rbp), %rax
jmp 0x55ca
leaq 0x1ff85(%rip), %rax     # 0x25530
movq (%rax), %rdi
leaq 0x15ad0(%rip), %rsi     # 0x1b085
leaq 0x1e7d4(%rip), %rdx     # 0x23d90
addq $0x684, %rdx            # imm = 0x684
movb $0x0, %al
callq 0x3300
movq 0x1d9ff(%rip), %rax     # 0x22fd0
movq (%rax), %rsi
leaq 0x1e7b5(%rip), %rdi     # 0x23d90
movl $0x60, %edx
movl $0xa, %ecx
callq 0x7860
movl $0x1, %edi
callq 0x3530
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/getopt2.c
// Function: getopt_init
void getopt_init(getopt_t *_this, int ignore_case)
{
	_this->ignore_case = ignore_case;
	// clear list
	_this->nonoption_descr = NULL;
	_this->option_descrs[0] = NULL;
	_this->cur_option_argval[0] = NULL;
	_this->curerror = GETOPT_STATUS_OK;
	_this->curerrortext[0] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x348(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x680(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x684(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5e58
movq -0x10(%rbp), %rax
movq 0x338(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0x5e58
movl $0x1, -0x4(%rbp)
jmp 0x5f01
movq -0x10(%rbp), %rax
cmpq $0x0, 0x338(%rax)
jne 0x5e72
movl $0x0, -0x4(%rbp)
jmp 0x5f01
cmpq $0x0, -0x18(%rbp)
jne 0x5e82
movl $0x0, -0x4(%rbp)
jmp 0x5f01
movq -0x10(%rbp), %rax
movq 0x338(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0x5ebe
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x338(%rax), %rax
movq 0x8(%rax), %rdx
callq 0x5f10
cmpl $0x0, %eax
jne 0x5ebe
movl $0x1, -0x4(%rbp)
jmp 0x5f01
movq -0x10(%rbp), %rax
movq 0x338(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x5efa
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x338(%rax), %rax
movq 0x10(%rax), %rdx
callq 0x5f10
cmpl $0x0, %eax
jne 0x5efa
movl $0x1, -0x4(%rbp)
jmp 0x5f01
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/getopt2.c
// Function: getopt_strcmp
static int getopt_strcmp(getopt_t *_this, char *s1, char *s2) {
	if (_this->ignore_case)
		return strcasecmp(s1, s2);
	else
		return strcmp(s1, s2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5f3f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x3050
movl %eax, -0x4(%rbp)
jmp 0x5f4f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x32d0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/getopt2.c
// Function: get_dashed_option_name
static char *get_dashed_option_name(char *clinearg) {
	char *res = NULL;
	if (!strncmp(clinearg, "--", 2))
		res = clinearg + 2;
	else if (!strncmp(clinearg, "-", 1))
		res = clinearg + 1;
#ifdef WIN32
	else if (!strncmp(clinearg, "/", 1))
		res = clinearg + 1;
#endif
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x150e9(%rip), %rsi     # 0x1b408
movl $0x2, %edx
callq 0x30b0
cmpl $0x0, %eax
jne 0x633c
movq -0x8(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
jmp 0x6364
movq -0x8(%rbp), %rdi
leaq 0x150c2(%rip), %rsi     # 0x1b409
movl $0x1, %edx
callq 0x30b0
cmpl $0x0, %eax
jne 0x6362
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x6364
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x338(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x6853
movq -0x10(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x6370
movl %eax, -0x4(%rbp)
jmp 0x68da
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x68f0
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jge 0x688d
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rcx
movl $0xfffffffc, %edx       # imm = 0xFFFFFFFC
xorl %eax, %eax
movl %eax, %r8d
callq 0x69e0
movl %eax, -0x4(%rbp)
jmp 0x68da
movl -0x28(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x670(%rcx), %eax
jl 0x68a5
movl $0x0, -0x4(%rbp)
jmp 0x68da
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq 0x348(%rax,%rcx,8), %rsi
movl -0x24(%rbp), %eax
movl %eax, %edx
callq 0x3090
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/getopt2.c
// Function: getopt_optionargidx
static int getopt_optionargidx(getopt_t *_this, getopt_option_descr_t  *odesc, char *argname)
{
	int  i;
	for (i = 0; i < odesc->fix_arg_count; i++)
		if (!getopt_strcmp(_this, argname, odesc->fix_args[i]))
			return i;
	for (i = odesc->fix_arg_count; i < odesc->max_arg_count; i++)
		if (!getopt_strcmp(_this, argname, odesc->var_args[i - odesc->fix_arg_count]))
			return i;
	return getopt_arg_error(_this, odesc, GETOPT_STATUS_ARGNOTSET, argname, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x678(%rcx), %eax
jge 0x6951
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rdx
callq 0x5f10
cmpl $0x0, %eax
jne 0x6944
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x69ce
jmp 0x6946
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x690b
movq -0x18(%rbp), %rax
movl 0x678(%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x67c(%rcx), %eax
jge 0x69b0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movq -0x18(%rbp), %rdx
subl 0x678(%rdx), %ecx
movslq %ecx, %rcx
movq 0x340(%rax,%rcx,8), %rdx
callq 0x5f10
cmpl $0x0, %eax
jne 0x69a3
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x69ce
jmp 0x69a5
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x695e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl $0xfffffffb, %edx       # imm = 0xFFFFFFFB
xorl %eax, %eax
movl %eax, %r8d
callq 0x69e0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/getopt2.c
// Function: getopt_arg_error
static int getopt_arg_error(getopt_t *_this, getopt_option_descr_t *odesc, int error, char *argname, char *argval) {
	_this->curerror = error;
	switch (error) {
	case GETOPT_STATUS_ILLEGALARG:
		snprintf(_this->curerrortext, sizeof(_this->curerrortext),
			"Option \"%s\" has no argument \"%s\"", odesc->long_name, argname);
		break;
	case GETOPT_STATUS_ARGNOTSET:
		snprintf(_this->curerrortext, sizeof(_this->curerrortext),
			"Optional argument \"%s\" for option \"%s\" not set", argname, odesc->long_name);
		break;
	case GETOPT_STATUS_ARGFORMATINT:
		snprintf(_this->curerrortext, sizeof(_this->curerrortext),
			"Argument \"%s\" of option \"%s\" has value \"%s\", which is no integer", argname, odesc->long_name, argval);
		break;
	case GETOPT_STATUS_ARGFORMATHEX:
		snprintf(_this->curerrortext, sizeof(_this->curerrortext),
			"Argument \"%s\" of option \"%s\" has value \"%s\", which is no hex integer", argname, odesc->long_name, argval);
		break;
	}
	return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x680(%rax)
movl -0x14(%rbp), %eax
addl $0x7, %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x3, %eax
ja 0x6aea
movq -0x30(%rbp), %rax
leaq 0x148d4(%rip), %rcx     # 0x1b2fc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
addq $0x684, %rdi            # imm = 0x684
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x20(%rbp), %r8
movl $0x101, %esi            # imm = 0x101
leaq 0x14b86(%rip), %rdx     # 0x1b5da
movb $0x0, %al
callq 0x31d0
jmp 0x6aea
movq -0x8(%rbp), %rdi
addq $0x684, %rdi            # imm = 0x684
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %r8
movl $0x101, %esi            # imm = 0x101
leaq 0x14b78(%rip), %rdx     # 0x1b5fb
movb $0x0, %al
callq 0x31d0
jmp 0x6aea
movq -0x8(%rbp), %rdi
addq $0x684, %rdi            # imm = 0x684
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %r8
movq -0x28(%rbp), %r9
movl $0x101, %esi            # imm = 0x101
leaq 0x14b77(%rip), %rdx     # 0x1b62a
movb $0x0, %al
callq 0x31d0
jmp 0x6aea
movq -0x8(%rbp), %rdi
addq $0x684, %rdi            # imm = 0x684
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %r8
movq -0x28(%rbp), %r9
movl $0x101, %esi            # imm = 0x101
leaq 0x14b88(%rip), %rdx     # 0x1b66b
movb $0x0, %al
callq 0x31d0
movl -0x14(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x140(%rbp), %rdx
movl $0x101, %ecx            # imm = 0x101
callq 0x6810
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jg 0x6b41
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6b94
leaq -0x140(%rbp), %rdi
leaq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x3320
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
cmpb $0x0, (%rax)
je 0x6b8d
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x338(%rax), %rsi
movq -0x18(%rbp), %rcx
leaq -0x140(%rbp), %r8
movl $0xfffffffa, %edx       # imm = 0xFFFFFFFA
callq 0x69e0
movl %eax, -0x4(%rbp)
jmp 0x6b94
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x140(%rbp), %rdx
movl $0x101, %ecx            # imm = 0x101
callq 0x6810
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jg 0x6be1
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6c34
leaq -0x140(%rbp), %rdi
leaq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x34f0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
cmpb $0x0, (%rax)
je 0x6c2d
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x338(%rax), %rsi
movq -0x18(%rbp), %rcx
leaq -0x140(%rbp), %r8
movl $0xfffffffa, %edx       # imm = 0xFFFFFFFA
callq 0x69e0
movl %eax, -0x4(%rbp)
jmp 0x6c34
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x140(%rbp), %rdx
movl $0x101, %ecx            # imm = 0x101
callq 0x6810
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jg 0x6c81
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6cd7
leaq -0x140(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x8, %edx
callq 0x3320
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
cmpb $0x0, (%rax)
je 0x6cd0
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x338(%rax), %rsi
movq -0x18(%rbp), %rcx
leaq -0x140(%rbp), %r8
movl $0xfffffff9, %edx       # imm = 0xFFFFFFF9
callq 0x69e0
movl %eax, -0x4(%rbp)
jmp 0x6cd7
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x140(%rbp), %rdx
movl $0x101, %ecx            # imm = 0x101
callq 0x6810
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jg 0x6d31
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x6d87
leaq -0x140(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movl $0x10, %edx
callq 0x3320
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
cmpb $0x0, (%rax)
je 0x6d80
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x338(%rax), %rsi
movq -0x18(%rbp), %rcx
leaq -0x140(%rbp), %r8
movl $0xfffffff9, %edx       # imm = 0xFFFFFFF9
callq 0x69e0
movl %eax, -0x4(%rbp)
jmp 0x6d87
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x7311
movq -0x10(%rbp), %rdi
callq 0x3190
movl 0x10(%rbp), %ecx
cmpq %rcx, %rax
jbe 0x7357
movq -0x10(%rbp), %rdi
callq 0x3190
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3190
movq %rax, %rcx
movq -0x38(%rbp), %rax
addq %rcx, %rax
movl -0x28(%rbp), %ecx
cmpq %rcx, %rax
jbe 0x7357
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x15974(%rip), %rsi     # 0x1cc94
movb $0x0, %al
callq 0x3300
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl 0x10(%rbp), %eax
jae 0x734c
movq -0x10(%rbp), %rax
movl -0x2c(%rbp), %ecx
movb $0x20, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x732e
movq -0x10(%rbp), %rax
movl -0x2c(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movslq -0x14(%rbp), %rdx
callq 0x3250
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/getopt2.c
// Function: getopt_help_commandline
void getopt_help_commandline(getopt_t *_this, FILE *stream, unsigned linelen, unsigned indent)
{
	int	i;
	char linebuff[2 * GETOPT_MAX_LINELEN];
	char phrase[2 * GETOPT_MAX_LINELEN];
	linebuff[0] = 0;
	for (i = 0; i < _this->argc; i++) {
		if (i == 0)
			snprintf(phrase, sizeof(phrase), "\"%s\"", _this->argv[i]);
		else
			snprintf(phrase, sizeof(phrase), " \"%s\"", _this->argv[i]);
		output_append(stream, linebuff, sizeof(linebuff), phrase, /*linebreak*/0, linelen, indent);
	}

	fprintf(stream, "%s\n", linebuff);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x430, %rsp            # imm = 0x430
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movb $0x0, -0x220(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0xb70(%rcx), %eax
jge 0x783d
cmpl $0x0, -0x1c(%rbp)
jne 0x77dc
leaq -0x420(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq 0xb78(%rax,%rcx,8), %rcx
movl $0x200, %esi            # imm = 0x200
leaq 0x13ef5(%rip), %rdx     # 0x1b6c8
movb $0x0, %al
callq 0x31d0
jmp 0x7806
leaq -0x420(%rbp), %rdi
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq 0xb78(%rax,%rcx,8), %rcx
movl $0x200, %esi            # imm = 0x200
leaq 0x13ec8(%rip), %rdx     # 0x1b6c7
movb $0x0, %al
callq 0x31d0
movq -0x10(%rbp), %rdi
leaq -0x220(%rbp), %rsi
leaq -0x420(%rbp), %rcx
movl -0x14(%rbp), %r9d
movl -0x18(%rbp), %eax
movl $0x200, %edx            # imm = 0x200
xorl %r8d, %r8d
movl %eax, (%rsp)
callq 0x72b0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7797
movq -0x10(%rbp), %rdi
leaq -0x220(%rbp), %rdx
leaq 0x15445(%rip), %rsi     # 0x1cc94
movb $0x0, %al
callq 0x3300
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/getopt2.c
// Function: getopt_print_multilinestring
static void getopt_print_multilinestring(FILE *stream, char *linebuff, unsigned linebuffsize, char *text, unsigned linelen, unsigned indent)
{
	char *s_text;
	char *s_start, *s;

	s_start = s_text = strdup(text); // print multiline info. make writeable copy
	while (*s_start) {
		s = s_start;
		// seach end of substring
		while (*s && *s != '\n') s++;
		if (*s) { // substr seperator
			*s = '\0'; // terminate

			output_append(stream, linebuff, linebuffsize, s_start, /*linebreak*/s_start != s_text, linelen, indent);
			s_start = s + 1; // advance to start of next substr
		}
		else { // last substr
			output_append(stream, linebuff, linebuffsize, s_start, /*linebreak*/s_start != s_text, linelen, indent);
			s_start = s; // stop
		}
	}
	free(s_text);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3560
movq %rax, -0x30(%rbp)
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpb $0x0, (%rax)
je 0x79b6
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x41(%rbp)
je 0x7916
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
setne %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x791f
jmp 0x792d
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x78f5
movq -0x40(%rbp), %rax
cmpb $0x0, (%rax)
je 0x797a
movq -0x40(%rbp), %rax
movb $0x0, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x38(%rbp), %rcx
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
setne %al
andb $0x1, %al
movzbl %al, %r8d
movl -0x24(%rbp), %r9d
movl -0x28(%rbp), %eax
movl %eax, (%rsp)
callq 0x72b0
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x79b1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x38(%rbp), %rcx
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
setne %al
andb $0x1, %al
movzbl %al, %r8d
movl -0x24(%rbp), %r9d
movl -0x28(%rbp), %eax
movl %eax, (%rsp)
callq 0x72b0
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x78e0
movq -0x30(%rbp), %rdi
callq 0x3040
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/tu58drive.c
// Function: tu58image_create
image_t *tu58image_create(int32_t unit, int forced_data_size) {
	if (!IMAGE_UNIT_VALID(unit)) {
		fatal("bad unit %d", unit); //terminates
	}
	if (tu58_image[unit] != NULL)
		fatal("tu58image_create(): duplicate allocation"); //terminates

	tu58_image[unit] = image_create(devTU58, unit, forced_data_size);
	return tu58_image[unit];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
cmpl $0x0, -0x4(%rbp)
jge 0x7a3b
cmpl $0x8, -0x4(%rbp)
jl 0x7a3b
movl -0x4(%rbp), %esi
leaq 0x14064(%rip), %rdi     # 0x1ba98
movb $0x0, %al
callq 0xd140
movslq -0x4(%rbp), %rcx
leaq 0x1d73a(%rip), %rax     # 0x25180
cmpq $0x0, (%rax,%rcx,8)
je 0x7a5b
leaq 0x13d58(%rip), %rdi     # 0x1b7ac
movb $0x0, %al
callq 0xd140
movl -0x4(%rbp), %esi
movl -0x8(%rbp), %edx
movl $0x1, %edi
callq 0x95c0
movq %rax, %rdx
movslq -0x4(%rbp), %rcx
leaq 0x1d707(%rip), %rax     # 0x25180
movq %rdx, (%rax,%rcx,8)
movslq -0x4(%rbp), %rcx
leaq 0x1d6f8(%rip), %rax     # 0x25180
movq (%rax,%rcx,8), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/tu58drive.c
// Function: tu58image_get
image_t *tu58image_get(int32_t unit) {
	if (!IMAGE_UNIT_VALID(unit)) {
		fatal("bad unit %d", unit);
		return NULL; // not reached
	}
	return tu58_image[unit];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jge 0x7ad2
cmpl $0x8, -0xc(%rbp)
jl 0x7ad2
movl -0xc(%rbp), %esi
leaq 0x13fd7(%rip), %rdi     # 0x1ba98
movb $0x0, %al
callq 0xd140
movq $0x0, -0x8(%rbp)
jmp 0x7ae5
movslq -0xc(%rbp), %rcx
leaq 0x1d6a3(%rip), %rax     # 0x25180
movq (%rax,%rcx,8), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/tu58drive.c
// Function: tu58images_closeall
void tu58images_closeall(void) {
	image_t *img;
	int32_t unit;
	for (unit = 0; unit < TU58_DEVICECOUNT; unit++) {
		img = tu58_image[unit];
		if (img) {
			if (img->open)
				image_sync(img);
			image_destroy(img);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0xc(%rbp)
cmpl $0x8, -0xc(%rbp)
jge 0x7b4b
movslq -0xc(%rbp), %rcx
leaq 0x1d670(%rip), %rax     # 0x25180
movq (%rax,%rcx,8), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x7b3e
movq -0x8(%rbp), %rax
cmpb $0x0, 0xf4(%rax)
je 0x7b35
movq -0x8(%rbp), %rdi
callq 0xa520
movq -0x8(%rbp), %rdi
callq 0xa5b0
jmp 0x7b40
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7aff
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/tu58drive.c
// Function: tu58images_sync_all
void tu58images_sync_all() {
	image_t *img;
	int32_t unit;

	if (!opt_synctimeout_sec)
		return; // not wanted

	for (unit = 0; unit < TU58_DEVICECOUNT; unit++) {
		img = tu58_image[unit];

		if (img && img->open) {
			if (opt_debug)
				info("unit %d sync ", unit);
			image_sync(img); // does locking
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x1c211(%rip), %rax     # 0x23d80
cmpl $0x0, (%rax)
jne 0x7b76
jmp 0x7be0
movl $0x0, -0xc(%rbp)
cmpl $0x8, -0xc(%rbp)
jge 0x7be0
movslq -0xc(%rbp), %rcx
leaq 0x1d5f2(%rip), %rax     # 0x25180
movq (%rax,%rcx,8), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x7bd3
movq -0x8(%rbp), %rax
movsbl 0xf4(%rax), %eax
cmpl $0x0, %eax
je 0x7bd3
leaq 0x1c1c0(%rip), %rax     # 0x23d74
cmpl $0x0, (%rax)
je 0x7bca
movl -0xc(%rbp), %esi
leaq 0x13c12(%rip), %rdi     # 0x1b7d5
movb $0x0, %al
callq 0xcf60
movq -0x8(%rbp), %rdi
callq 0xa520
jmp 0x7bd5
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7b7d
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/tu58drive.c
// Function: reinit
static void reinit(void) {
	// clear all buffers, wait a bit
	serial_devrxinit(&tu58_serial);
	serial_devtxinit(&tu58_serial);
	delay_ms(5);

	// init sequence, send immediately
	serial_devtxstart(&tu58_serial);
	serial_devtxput(&tu58_serial, TUF_INIT);
	serial_devtxput(&tu58_serial, TUF_INIT);
	serial_devtxflush(&tu58_serial);

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1d1dd(%rip), %rdi     # 0x251c8
callq 0xa740
leaq 0x1d1d1(%rip), %rdi     # 0x251c8
callq 0xa6f0
movl $0x5, %edi
callq 0xd2a0
leaq 0x1d1bb(%rip), %rdi     # 0x251c8
callq 0xa6a0
leaq 0x1d1af(%rip), %rdi     # 0x251c8
movl $0x4, %esi
callq 0xa9b0
leaq 0x1d19e(%rip), %rdi     # 0x251c8
movl $0x4, %esi
callq 0xa9b0
leaq 0x1d18d(%rip), %rdi     # 0x251c8
callq 0xa8a0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/tu58drive.c
// Function: bootio
static void bootio(void) {
	image_t *img;
	int32_t unit;
	int32_t count;
	uint8_t buffer[TU_BOOT_LEN];

	// check unit number for validity
	unit = serial_devrxget(&tu58_serial);
	img = tu58image_get(unit);
	if (!img || !img->open) {
		error("bootio bad unit %d", unit);
		return;
	}

	if (opt_verbose)
		info("%-8s unit=%d blk=0x%04X cnt=0x%04X", "boot", unit, 0,
		TU_BOOT_LEN);

	// seek to block zero, should never be an error :-)
	if (image_blockseek(img, 0, 0, 0)) {
		error("boot seek error unit %d", unit);
		return;
	}

	// read one block of data
	if ((count = image_read(img, buffer, TU_BOOT_LEN)) != TU_BOOT_LEN) {
		error("boot file read error unit %d, expected %d, received %d", unit,
		TU_BOOT_LEN, count);
		return;
	}

	// write one block of data to serial line
	if ((count = serial_devtxwrite(&tu58_serial, buffer, TU_BOOT_LEN)) != TU_BOOT_LEN) {
		error("boot serial write error unit %d, expected %d, received %d", unit,
		TU_BOOT_LEN, count);
		return;
	}

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
leaq 0x1cc86(%rip), %rdi     # 0x251c8
callq 0xa940
movzbl %al, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %edi
callq 0x7aa0
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x856d
movq -0x8(%rbp), %rax
cmpb $0x0, 0xf4(%rax)
jne 0x8583
movl -0xc(%rbp), %esi
leaq 0x13750(%rip), %rdi     # 0x1bcc7
movb $0x0, %al
callq 0xce70
jmp 0x864f
leaq 0x1b7da(%rip), %rax     # 0x23d64
cmpl $0x0, (%rax)
je 0x85af
movl -0xc(%rbp), %edx
leaq 0x13741(%rip), %rdi     # 0x1bcda
leaq 0x123ed(%rip), %rsi     # 0x1a98d
xorl %ecx, %ecx
movl $0x200, %r8d            # imm = 0x200
movb $0x0, %al
callq 0xcf60
movq -0x8(%rbp), %rdi
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq 0x9f00
cmpl $0x0, %eax
je 0x85d6
movl -0xc(%rbp), %esi
leaq 0x13730(%rip), %rdi     # 0x1bcfd
movb $0x0, %al
callq 0xce70
jmp 0x864f
movq -0x8(%rbp), %rdi
leaq -0x210(%rbp), %rsi
movl $0x200, %edx            # imm = 0x200
callq 0xa020
movl %eax, -0x10(%rbp)
cmpl $0x200, %eax            # imm = 0x200
je 0x8610
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %ecx
leaq 0x13713(%rip), %rdi     # 0x1bd15
movl $0x200, %edx            # imm = 0x200
movb $0x0, %al
callq 0xce70
jmp 0x864f
leaq -0x210(%rbp), %rsi
leaq 0x1cbaa(%rip), %rdi     # 0x251c8
movl $0x200, %edx            # imm = 0x200
callq 0xa830
movl %eax, -0x10(%rbp)
cmpl $0x200, %eax            # imm = 0x200
je 0x864d
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %ecx
leaq 0x1370d(%rip), %rdi     # 0x1bd4c
movl $0x200, %edx            # imm = 0x200
movb $0x0, %al
callq 0xce70
jmp 0x864f
jmp 0x864f
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/tu58drive.c
// Function: tu58_monitor
void* tu58_monitor(void* none) {
	int32_t sts;
	uint64_t now;
	uint64_t next_sync_time;
	UNUSED(none) ;

	next_sync_time = now_ms() + opt_synctimeout_sec * 1000;
	for (;;) {

		// check for any error
		switch (sts = serial_devrxerror(&tu58_serial)) {
		case DEV_ERROR: // error
		case DEV_BREAK: // break
			// kill and restart the emulator
			if (opt_verbose)
				info("BREAK detected");
#ifdef THIS_DOES_NOT_YET_WORK_RELIABLY
			if (pthread_cancel(tu58_server))
			error("unable to cancel emulation thread");
			if (pthread_join(tu58_server, NULL))
			error("unable to join on emulation thread");
			if (pthread_create(&tu58_server, NULL, run, NULL))
			error("unable to restart emulation thread");
#endif // THIS_DOES_NOT_YET_WORK_RELIABLY
			break;
		case DEV_OK: // OK
			break;
		case DEV_NYI: // not yet implemented
			// return (void*)1;
			break;
		default: // something else...
			error("monitor(): unknown flag %d", sts);
			break;
		}
		now = now_ms();
		// image_*() routines have, mutex locking, so no change while saving possible
		if (next_sync_time < now
				&& tu58_serial.rx_lasttime_ms + opt_synctimeout_sec * 1000 < now
				&& tu58_serial.tx_lasttime_ms + opt_synctimeout_sec * 1000 < now) {
			// next sync time passed, and RS232 inactive
			tu58images_sync_all();
			next_sync_time = now + opt_synctimeout_sec * 1000;
		}

		// bit of a delay, loop again
		delay_ms(5);

	}

	return (void*) 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movb $0x0, %al
callq 0xd2c0
leaq 0x1b706(%rip), %rcx     # 0x23d80
imull $0x3e8, (%rcx), %ecx    # imm = 0x3E8
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
leaq 0x1cb37(%rip), %rdi     # 0x251c8
callq 0xa790
movl %eax, -0xc(%rbp)
movl %eax, %ecx
movl %ecx, -0x24(%rbp)
subl $-0x1, %eax
je 0x86d8
jmp 0x86a5
movl -0x24(%rbp), %eax
testl %eax, %eax
je 0x86d6
jmp 0x86ae
movl -0x24(%rbp), %eax
decl %eax
subl $0x1, %eax
ja 0x86da
jmp 0x86ba
leaq 0x1b6a3(%rip), %rax     # 0x23d64
cmpl $0x0, (%rax)
je 0x86d4
leaq 0x13230(%rip), %rdi     # 0x1b8fd
movb $0x0, %al
callq 0xcf60
jmp 0x86eb
jmp 0x86eb
jmp 0x86eb
movl -0xc(%rbp), %esi
leaq 0x13228(%rip), %rdi     # 0x1b90c
movb $0x0, %al
callq 0xce70
movb $0x0, %al
callq 0xd2c0
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x8760
movq 0x1cad1(%rip), %rax     # 0x251d8
leaq 0x1b672(%rip), %rcx     # 0x23d80
imull $0x3e8, (%rcx), %ecx    # imm = 0x3E8
movslq %ecx, %rcx
addq %rcx, %rax
cmpq -0x18(%rbp), %rax
jae 0x8760
movq 0x1cab9(%rip), %rax     # 0x251e0
leaq 0x1b652(%rip), %rcx     # 0x23d80
imull $0x3e8, (%rcx), %ecx    # imm = 0x3E8
movslq %ecx, %rcx
addq %rcx, %rax
cmpq -0x18(%rbp), %rax
jae 0x8760
callq 0x7b60
movq -0x18(%rbp), %rax
leaq 0x1b630(%rip), %rcx     # 0x23d80
imull $0x3e8, (%rcx), %ecx    # imm = 0x3E8
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl $0x5, %edi
callq 0xd2a0
jmp 0x868a
nop
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/tu58drive.c
// Function: getpacket
static int32_t getpacket(tu_packet *pkt) {
	int32_t count = pkt->cmd.length + 2; // +2 for checksum bytes
	uint8_t *ptr = (uint8_t *) pkt + 2; // skip over flag/length bytes
	uint16_t rcvchk, expchk;

	// get remaining packet bytes, incl two checksum bytes
	while (--count >= 0)
		*ptr++ = serial_devrxget(&tu58_serial);

	// get checksum bytes
	rcvchk = (ptr[-1] << 8) | (ptr[-2] << 0);

	// compute expected checksum
	expchk = checksum(pkt);

	// for debug...
	if (opt_debug)
		dumppacket(pkt, "getpacket");

	// message on error
	if (expchk != rcvchk)
		error("getpacket checksum error: exp=0x%04X rcv=0x%04X", expchk, rcvchk);

	// return checksum match indication
	return (expchk != rcvchk);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
addl $0x2, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, %eax
jl 0x87c5
leaq 0x1ca1d(%rip), %rdi     # 0x251c8
callq 0xa940
movb %al, %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
jmp 0x8796
movq -0x18(%rbp), %rax
movzbl -0x1(%rax), %eax
shll $0x8, %eax
movq -0x18(%rbp), %rcx
movzbl -0x2(%rcx), %ecx
shll $0x0, %ecx
orl %ecx, %eax
movw %ax, -0x1a(%rbp)
movq -0x8(%rbp), %rdi
callq 0x9390
movw %ax, -0x1c(%rbp)
leaq 0x1b57f(%rip), %rax     # 0x23d74
cmpl $0x0, (%rax)
je 0x880a
movq -0x8(%rbp), %rdi
leaq 0x13233(%rip), %rsi     # 0x1ba38
callq 0x9420
movzwl -0x1c(%rbp), %eax
movzwl -0x1a(%rbp), %ecx
cmpl %ecx, %eax
je 0x882c
movzwl -0x1c(%rbp), %esi
movzwl -0x1a(%rbp), %edx
leaq 0x1321d(%rip), %rdi     # 0x1ba42
movb $0x0, %al
callq 0xce70
movzwl -0x1c(%rbp), %eax
movzwl -0x1a(%rbp), %ecx
cmpl %ecx, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/tu58drive.c
// Function: endpacket
static void endpacket(uint8_t unit, uint8_t code, uint16_t count, uint16_t status) {
	static tu_cmdpkt ek = { TUF_CTRL, TU_CTRL_LEN, TUO_END, 0, 0, 0, 0, 0, 0, -1 };

	ek.unit = unit;
	ek.modifier = code; // success/fail code
	ek.count = count;
	ek.block = status; // summary status

	putpacket((tu_packet *) &ek);
	serial_devtxflush(&tu58_serial); // finish packet transmit

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %cx, %ax
movw %dx, %cx
movb %sil, %dl
movb %dil, %sil
movb %sil, -0x1(%rbp)
movb %dl, -0x2(%rbp)
movw %cx, -0x4(%rbp)
movw %ax, -0x6(%rbp)
movb -0x1(%rbp), %al
movb %al, 0x1ad7c(%rip)      # 0x235f8
movb -0x2(%rbp), %al
movb %al, 0x1ad72(%rip)      # 0x235f7
movw -0x4(%rbp), %ax
movw %ax, 0x1ad6c(%rip)      # 0x235fc
movw -0x6(%rbp), %ax
movw %ax, 0x1ad63(%rip)      # 0x235fe
leaq 0x1ad52(%rip), %rdi     # 0x235f4
callq 0x9290
leaq 0x1c91a(%rip), %rdi     # 0x251c8
callq 0xa8a0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)