LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/sgsfak[P]c-ocgeo/src/ocgeo.c
// Function: ocgeo_reverse
bool ocgeo_reverse(double lat, double lng, const char* api_key,
        ocgeo_params_t* params, ocgeo_response_t* response)
{
    sds q = sdsempty();
    q = sdscatprintf(q, "%.8F,%.8F", lat, lng);
    bool ok = do_request(false, q, api_key, params, response);
    sdsfree(q);
    return ok;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
callq 0x28ff
leaq 0x586d(%rip), %rsi      # 0x75ad
movq %rax, %rdi
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movb $0x2, %al
callq 0x2d7d
movq %rax, %r12
xorl %edi, %edi
movq %rax, %rsi
movq %r15, %rdx
movq %r14, %rcx
movq %rbx, %r8
callq 0x1960
movl %eax, %ebx
movq %r12, %rdi
callq 0x299f
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/sgsfak[P]c-ocgeo/src/ocgeo.c
// Function: ocgeo_response_cleanup
void ocgeo_response_cleanup(ocgeo_response_t* r)
{
    if (r == NULL)
        return;

    ocgeo_result_t* result;
    foreach_ocgeo_result(result, r) {
        free(result->bounds);
        free(result->timezone);
        free(result->roadinfo);
        free(result->currency);
    }
    r->total_results = 0;
    free(r->results);
    r->results = NULL;
    cJSON_Delete(r->internal);
    r->internal = NULL;
	sdsfree(r->url);
	r->url = NULL;
}

// Assembly:
testq %rdi, %rdi
je 0x1e22
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %r14
cmpl $0x0, 0x24(%rdi)
je 0x1deb
movq 0x8(%r14), %rdi
callq 0x11f8
movq 0xb8(%r14), %rdi
callq 0x11f8
movq 0xc0(%r14), %rdi
callq 0x11f8
movq 0xc8(%r14), %rdi
callq 0x11f8
addq $0xe8, %r14
movq 0x28(%rbx), %rdi
movslq 0x24(%rbx), %rax
imulq $0xe8, %rax, %rax
addq %rdi, %rax
cmpq %rax, %r14
jne 0x1d9e
jmp 0x1dee
movq %r14, %rdi
movl $0x0, 0x24(%rbx)
callq 0x11f8
xorl %r14d, %r14d
movq %r14, 0x28(%rbx)
movq 0x30(%rbx), %rdi
callq 0x3bf8
movq %r14, 0x30(%rbx)
movq 0x10(%rbx), %rdi
callq 0x299f
movq %r14, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/sgsfak[P]c-ocgeo/src/ocgeo.c
// Function: ocgeo_response_get_str
const char* ocgeo_response_get_str(ocgeo_result_t* r, const char* path, bool* ok)
{
    cJSON* js = get_json_field(r->internal, path);
    if (js == NULL || cJSON_IsNull(js) || !cJSON_IsString(js)) {
        *ok = false;
        return NULL;
    }
    *ok = true;
    return js->valuestring;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq 0xe0(%rdi), %rdi
callq 0x1e6c
testq %rax, %rax
je 0x1e4a
movq %rax, %r14
movq %rax, %rdi
callq 0x5bcc
testl %eax, %eax
je 0x1e57
movb $0x0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x3b42
testl %eax, %eax
je 0x1e4a
movb $0x1, (%rbx)
movq 0x20(%r14), %rax
jmp 0x1e4f
// File: /workspace/github_c_makefile_star2_O3/sgsfak[P]c-ocgeo/src/ocgeo.c
// Function: get_json_field
static
cJSON* get_json_field(cJSON* parent, const char* path)
{
    static const char* sep = ".";

    if (parent == NULL)
        return NULL;
    int n = 0;
    sds* fields = sdssplitlen(path, strlen(path), sep, 1, &n);
    if (fields == NULL)
        return NULL;

    cJSON* current = parent;
    for (int k = 0; k<n && current != NULL; ++k) {
        int index = str_to_maybe_int(fields[k]);
        if (index >= 0)
            current = cJSON_GetArrayItem(current, index);
        else
            current = cJSON_GetObjectItemCaseSensitive(current, fields[k]);
    }
    sdsfreesplitres(fields, n);
    return current;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1f72
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4(%rsp), %r15
movl $0x0, (%r15)
movq %rsi, %rdi
callq 0x1090
leaq 0x5973(%rip), %rdx      # 0x7811
movq %r14, %rdi
movl %eax, %esi
movl $0x1, %ecx
movq %r15, %r8
callq 0x2fbd
testq %rax, %rax
je 0x1f72
movq %rax, %r14
movl 0x4(%rsp), %esi
testl %esi, %esi
jle 0x1f68
xorl %r15d, %r15d
leaq 0x55ce(%rip), %r12      # 0x74a0
movq (%r14,%r15,8), %rsi
movslq -0x8(%rsi), %rcx
movl $0x0, %eax
testq %rcx, %rcx
jle 0x1f3b
xorl %edx, %edx
xorl %eax, %eax
movzbl (%rsi,%rdx), %edi
addl $-0x30, %edi
cmpl $0x9, %edi
ja 0x1f47
leal (%rax,%rax,4), %r8d
leal (%rax,%r8,2), %eax
movslq (%r12,%rdi,4), %rdi
addq %r12, %rdi
jmpq *%rdi
incl %eax
jmp 0x1f2f
addl $0x4, %eax
jmp 0x1f2f
addl $0x9, %eax
jmp 0x1f2f
addl $0x2, %eax
jmp 0x1f2f
addl $0x3, %eax
jmp 0x1f2f
addl $0x7, %eax
jmp 0x1f2f
addl $0x5, %eax
jmp 0x1f2f
addl $0x6, %eax
jmp 0x1f2f
addl $0x8, %eax
incq %rdx
cmpq %rdx, %rcx
jne 0x1ee8
testl %eax, %eax
js 0x1f47
movq %rbx, %rdi
movl %eax, %esi
callq 0x48a1
jmp 0x1f4f
movq %rbx, %rdi
callq 0x49a1
movq %rax, %rbx
incq %r15
movslq 0x4(%rsp), %rsi
cmpq %rsi, %r15
jge 0x1f68
testq %rbx, %rbx
jne 0x1ed2
movq %r14, %rdi
callq 0x3185
jmp 0x1f74
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/sgsfak[P]c-ocgeo/src/ocgeo.c
// Function: ocgeo_response_get_int
int ocgeo_response_get_int(ocgeo_result_t* r, const char* path, bool* ok)
{
    cJSON* js = get_json_field(r->internal, path);
    if (js == NULL || cJSON_IsNull(js) || !cJSON_IsNumber(js)) {
        *ok = false;
        return 0;
    }
    *ok = true;
    return js->valueint;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq 0xe0(%rdi), %rdi
callq 0x1e6c
testq %rax, %rax
je 0x1faa
movq %rax, %r14
movq %rax, %rdi
callq 0x5bcc
testl %eax, %eax
je 0x1fb7
movb $0x0, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x5bdb
testl %eax, %eax
je 0x1faa
movb $0x1, (%rbx)
movl 0x28(%r14), %eax
jmp 0x1faf
// File: /workspace/github_c_makefile_star2_O3/sgsfak[P]c-ocgeo/src/ocgeo.c
// Function: ocgeo_response_get_dbl
double ocgeo_response_get_dbl(ocgeo_result_t* r, const char* path, bool* ok)
{
    cJSON* js = get_json_field(r->internal, path);
    if (js == NULL || cJSON_IsNull(js) || !cJSON_IsNumber(js)) {
        *ok = false;
        return 0.0;
    }
    *ok = true;
    return js->valuedouble;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq 0xe0(%rdi), %rdi
callq 0x1e6c
testq %rax, %rax
je 0x1ff3
movq %rax, %r14
movq %rax, %rdi
callq 0x5bcc
testl %eax, %eax
je 0x2001
movb $0x0, (%rbx)
xorps %xmm0, %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x5bdb
testl %eax, %eax
je 0x1ff3
movb $0x1, (%rbx)
movsd 0x30(%r14), %xmm0
jmp 0x1ff9
// File: /workspace/github_c_makefile_star2_O3/stv0g[P]c11-queues/mpmc_test_fib.c
// Function: producer
int producer(void *ctx)
{
	//printf("producer\n"); //DELETEME
	struct mpmc_queue *q = (struct mpmc_queue *) ctx;
	
	srand((unsigned) time(0) + thread_get_id());
	size_t pause = rand() % 1000;

	/* Wait for global start signal */
	while (g_start == 0)
		thrd_yield();
	
		/* Wait for a random time */
	for (size_t i = 0; i != pause; i += 1)
		nop();
	
	/* Enqueue */
	for (unsigned long count = 0, n1 = 0, n2 = 1; count < N; count++) {
		fibs[count] = n1 + n2;
		
		void *fibptr = (void *) &fibs[count];
		
		if (!mpmc_queue_push(q, fibptr)) {
			printf("Queue push failed at count %lu\n", count);
			return -1;
		}
		
		n1 = n2; n2 = fibs[count];
	}
	
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %edi, %edi
callq 0x1090
leal -0x1(%rax), %edi
callq 0x1080
callq 0x10f0
movslq %eax, %r14
imulq $0x10624dd3, %r14, %rax # imm = 0x10624DD3
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x26, %rax
addl %ecx, %eax
imull $0x3e8, %eax, %eax      # imm = 0x3E8
subl %eax, %r14d
cmpl $0x0, 0x2e57(%rip)      # 0x40a0
jne 0x1252
callq 0x1070
jmp 0x1242
testl %r14d, %r14d
je 0x1261
movslq %r14d, %rax
pause
decq %rax
jne 0x125a
movl $0x1, 0x2e45(%rip)      # 0x40b0
leaq 0x2e3e(%rip), %rsi      # 0x40b0
movq %rbx, %rdi
callq 0x169b
testl %eax, %eax
je 0x12cb
movl $0x1, %ecx
leaq 0x2e2a(%rip), %r15      # 0x40b4
movq $-0x1, %r14
cmpq $0x1312cfe, %r14        # imm = 0x1312CFE
je 0x12e6
movl -0x4(%r15), %ebp
addl %ebp, %ecx
movl %ecx, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x169b
addq $0x4, %r15
incq %r14
movl %ebp, %ecx
testl %eax, %eax
jne 0x1291
xorl %ebx, %ebx
cmpq $0x1312cff, %r14        # imm = 0x1312CFF
sbbl %ebx, %ebx
incq %r14
jmp 0x12d3
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
xorl %r14d, %r14d
leaq 0xd2a(%rip), %rdi       # 0x2004
movq %r14, %rsi
xorl %eax, %eax
callq 0x1060
jmp 0x12e8
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stv0g[P]c11-queues/mpmc_test_fib.c
// Function: consumer
int consumer(void *ctx)
{
	//printf("consumer\n"); 	//DELETEME
	struct mpmc_queue *q = (struct mpmc_queue *) ctx;
	
	srand((unsigned) time(0) + thread_get_id());
	size_t pause = rand() % 1000;

	/* Wait for global start signal */
	while (g_start == 0)
		thrd_yield();
	
	/* Wait for a random time */
	for (size_t i = 0; i != pause; i += 1)
		nop();
	
	/* Dequeue */
	for (unsigned long count = 0, n1 = 0, n2 = 1; count < N; count++) {
		int fib = n1 + n2;
		int *pulled;
		
		while (!mpmc_queue_pull(q, (void **) &pulled)) {
			//printf("Queue empty: %d\n", temp);
			//return -1;
		}
		
		if (*pulled != fib) {
			printf("Pulled != fib\n");
			return -1;
		}		
		
		n1 = n2; n2 = fib;
	}
	
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %edi, %edi
callq 0x1090
leal -0x1(%rax), %edi
callq 0x1080
callq 0x10f0
movslq %eax, %r14
imulq $0x10624dd3, %r14, %rax # imm = 0x10624DD3
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x26, %rax
addl %ecx, %eax
imull $0x3e8, %eax, %eax      # imm = 0x3E8
subl %eax, %r14d
cmpl $0x0, 0x2d62(%rip)      # 0x40a0
jne 0x1347
callq 0x1070
jmp 0x1337
testl %r14d, %r14d
je 0x1356
movslq %r14d, %rax
pause
decq %rax
jne 0x134f
movl $0x1, %eax
movb $0x1, %bpl
xorl %r15d, %r15d
movq %rsp, %r14
xorl %r12d, %r12d
movq %r15, %r13
movq %rax, %r15
addq %rax, %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0x16e0
testl %eax, %eax
je 0x1370
movq (%rsp), %rax
cmpl %r13d, (%rax)
jne 0x13ab
movslq %r13d, %rax
cmpq $0x1312cff, %r12        # imm = 0x1312CFF
leaq 0x1(%r12), %rcx
setb %bpl
movq %rcx, %r12
cmpq $0x1312d00, %rcx        # imm = 0x1312D00
jne 0x1367
xorl %eax, %eax
jmp 0x13c0
leaq 0xce2(%rip), %rdi       # 0x2094
callq 0x1040
movzbl %bpl, %eax
andl $0x1, %eax
negl %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stv0g[P]c11-queues/mpmc_test_fib.c
// Function: test_single_threaded
int test_single_threaded(struct mpmc_queue *q)
{
	int resp, resc;
	g_start = 1;
	
	resp = producer(q);
	if (resp)
		printf("Enqueuing failed\n");
	
	resc = consumer(q);
	if (resc)
		printf("Consumer failed\n");
	
	if (resc || resp)
		printf("Single Thread Test Failed\n");
	else
		printf("Single Thread Test Complete\n");
	
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl $0x1, 0x2cc0(%rip)      # 0x40a0
callq 0x1204
movl %eax, %ebx
testl %eax, %eax
je 0x13f7
leaq 0xcb0(%rip), %rdi       # 0x20a2
callq 0x1040
movq %r14, %rdi
callq 0x12f5
movl %eax, %ebp
testl %eax, %eax
je 0x1411
leaq 0xca7(%rip), %rdi       # 0x20b3
callq 0x1040
orl %ebx, %ebp
leaq 0xca9(%rip), %rax       # 0x20c3
leaq 0xcbe(%rip), %rdi       # 0x20df
cmoveq %rax, %rdi
callq 0x1040
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stv0g[P]c11-queues/mpmc_test_fib.c
// Function: test_multi_threaded
int test_multi_threaded(struct mpmc_queue *q)
{
	thrd_t thrp, thrc;
	int resp, resc;
	
	g_start = 0;
	
	thrd_create(&thrp, consumer, q);	/** @todo Why producer thread runs earlier? */
	thrd_create(&thrc, producer, q);
	
	sleep(1);

	uint64_t start_tsc_time, end_tsc_time;

	start_tsc_time = rdtscp();
	g_start = 1;

	thrd_join(thrp, &resp);
	thrd_join(thrc, &resc);
	
	end_tsc_time = rdtscp();

	if (resc || resp)
		printf("Queue Test failed\n");
	else
		printf("Two-thread Test Complete\n");
	
	printf("cycles/op for rdtsc %lu\n", (end_tsc_time - start_tsc_time)/N);

	size_t used = mpmc_queue_available(q);
	if (used > 0)
		printf("%zu slots in use? There is something wrong with the test\n", used);
	
	int ret = mpmc_queue_destroy(q);
	if (ret)
		printf("Failed to destroy queue: %d\n", ret);
	
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movl $0x0, 0x2c55(%rip)      # 0x40a0
leaq -0x15d(%rip), %rdx      # 0x12f5
leaq 0x18(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
movq %rbx, %rcx
callq 0x10c0
leaq -0x267(%rip), %rdx      # 0x1204
leaq 0x10(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
movq %rbx, %rcx
callq 0x10c0
movl $0x1, %edi
callq 0x10e0
rdtsc
shlq $0x20, %rdx
orq %rdx, %rax
movq %rax, %r14
movl $0x1, 0x2c03(%rip)      # 0x40a0
movq (%r15), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x10d0
movq (%r15), %r13
movq (%r12), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x10d0
orl (%r15), %r13d
leaq 0xc47(%rip), %rax       # 0x2112
leaq 0xc27(%rip), %rdi       # 0x20f9
cmovneq %rax, %rdi
rdtsc
shlq $0x20, %rdx
orq %rdx, %rax
movq %rax, %r15
callq 0x1040
subq %r14, %r15
movabsq $-0x29406b2a1a85bd43, %rcx # imm = 0xD6BF94D5E57A42BD
movq %r15, %rax
mulq %rcx
shrq $0x18, %rdx
leaq 0xb1f(%rip), %rdi       # 0x2024
movq %rdx, %rsi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x1689
testq %rax, %rax
je 0x152d
leaq 0xb1a(%rip), %rdi       # 0x203d
movq %rax, %rsi
xorl %eax, %eax
callq 0x1060
movq %rbx, %rdi
callq 0x166d
testl %eax, %eax
je 0x1549
leaq 0xb37(%rip), %rdi       # 0x2077
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/stv0g[P]c11-queues/mpmc_queue.c
// Function: mpmc_queue_init
int mpmc_queue_init(struct mpmc_queue *q, size_t size, const struct memtype *mem)
{
	/* Queue size must be 2 exponent */
	if ((size < 2) || ((size & (size - 1)) != 0))
		return -1;

	q->mem = mem;
	q->buffer_mask = size - 1;
	q->buffer = memory_alloc(q->mem, sizeof(q->buffer[0]) * size);
	if (!q->buffer)
		return -2;
	
	for (size_t i = 0; i != size; i += 1)
		atomic_store_explicit(&q->buffer[i].sequence, i, memory_order_relaxed);

	atomic_store_explicit(&q->tail, 0, memory_order_relaxed);
	atomic_store_explicit(&q->head, 0, memory_order_relaxed);
	
	return 0;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x2, %rsi
jb 0x166c
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rcx
shrq %rcx
movabsq $0x5555555555555555, %rsi # imm = 0x5555555555555555
andq %rcx, %rsi
movq %r14, %rcx
subq %rsi, %rcx
movabsq $0x3333333333333333, %rsi # imm = 0x3333333333333333
movq %rcx, %rdi
andq %rsi, %rdi
shrq $0x2, %rcx
andq %rsi, %rcx
addq %rdi, %rcx
movq %rcx, %rsi
shrq $0x4, %rsi
addq %rcx, %rsi
movabsq $0xf0f0f0f0f0f0f0f, %rcx # imm = 0xF0F0F0F0F0F0F0F
andq %rsi, %rcx
movabsq $0x101010101010101, %rsi # imm = 0x101010101010101
imulq %rcx, %rsi
shrq $0x38, %rsi
cmpl $0x1, %esi
ja 0x1665
leaq -0x1(%r14), %rax
movq %rdx, 0x40(%rbx)
movq %rax, 0x48(%rbx)
movq %r14, %rsi
shlq $0x4, %rsi
movq %rdx, %rdi
callq 0x17c8
movq %rax, 0x50(%rbx)
testq %rax, %rax
je 0x1660
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x50(%rbx), %rdx
movq %rcx, (%rdx,%rax)
incq %rcx
addq $0x10, %rax
cmpq %rcx, %r14
jne 0x1632
movq $0x0, 0x98(%rbx)
movq $0x0, 0xe0(%rbx)
xorl %eax, %eax
jmp 0x1665
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/stv0g[P]c11-queues/mpmc_queue.c
// Function: mpmc_queue_push_many
int mpmc_queue_push_many(struct mpmc_queue *q, void *ptr[], size_t cnt)
{
	int ret;
	size_t i;

	for (i = 0; i < cnt; i++) {
		ret = mpmc_queue_push(q, ptr[i]);
		if (!ret)
			break;
	}
	
	return i;
}

// Assembly:
xorl %ecx, %ecx
testq %rdx, %rdx
je 0x1780
movq (%rsi,%rcx,8), %r8
movq 0x98(%rdi), %rax
movq 0x50(%rdi), %r9
movq 0x48(%rdi), %r10
andq %rax, %r10
shlq $0x4, %r10
movq (%r9,%r10), %r11
cmpq %rax, %r11
jne 0x1767
leaq 0x1(%rax), %r11
lock
cmpxchgq %r11, 0x98(%rdi)
jne 0x173e
jmp 0x176b
jge 0x1737
jmp 0x1780
addq %r10, %r9
movq %r8, 0x8(%r9)
movq %r11, (%r9)
incq %rcx
cmpq %rdx, %rcx
jne 0x1733
movq %rdx, %rcx
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/stv0g[P]c11-queues/mpmc_queue.c
// Function: mpmc_queue_pull_many
int mpmc_queue_pull_many(struct mpmc_queue *q, void **ptr[], size_t cnt)
{
	int ret;
	size_t i;

	for (i = 0; i < cnt; i++) {
		ret = mpmc_queue_pull(q, ptr[i]);
		if (!ret)
			break;
	}
	
	return i;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x17b8
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %ebx, %ebx
movq (%r15,%rbx,8), %rsi
movq %r12, %rdi
callq 0x16e0
testl %eax, %eax
je 0x17ba
incq %rbx
cmpq %rbx, %r14
jne 0x179b
movq %r14, %rbx
jmp 0x17ba
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/config.c
// Function: to_interger
static long to_interger(char* st, char* ed) {
    long result;
    char* p;

    result = 0;

    for (p = st; p <= ed; ++ p) {
        if (!isdigit(*p)) {
            return -1;
        }

        result = result * 10 + (*p - '0');

        if (result < 0) {
            return -1;
        }
    }

    return result;
}

// Assembly:
cmpq %rsi, %rdi
jbe 0x332b
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2490
movq (%rax), %rcx
xorl %edx, %edx
movsbq (%r14), %rsi
movq $-0x1, %rax
testb $0x8, 0x1(%rcx,%rsi,2)
je 0x336d
leaq (%rdx,%rdx,4), %rdx
leaq (%rsi,%rdx,2), %rdx
addq $-0x30, %rdx
js 0x336d
incq %r14
movq %rdx, %rax
cmpq %rbx, %r14
jbe 0x3342
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/epoll.c
// Function: epoll_create_fd
epoll_t* epoll_create_fd(int flags) {
    epoll_t* epoll = NULL;

    do {
        if ((epoll = (epoll_t*)malloc(sizeof(epoll_t))) == NULL) {
            log_error("epoll malloc failed.");
            break;
        }

        /* 创建 epoll 文件描述符 */
        if ((epoll->epollfd = epoll_create1(flags)) < 0) {
            log_error("epoll fd create failed.");
            break;
        }

        if ((epoll->events = (epoll_event*)malloc(sizeof(epoll_event) * MAX_EVENTS)) == NULL) {
            log_error("events malloc failed.");
            break;
        }

        return epoll;

    } while (0);

    if (epoll_free(epoll) != 0) {
        log_error("epoll free failed.");
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %r14d
movl $0x10, %edi
callq 0x22d0
movq %rax, %rbx
testq %rax, %rax
je 0x33d2
movl %r14d, %edi
callq 0x2450
movl %eax, (%rbx)
testl %eax, %eax
js 0x33f3
movl $0x3000, %edi           # imm = 0x3000
callq 0x22d0
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0x3423
leaq 0x40d4(%rip), %rsi      # 0x748c
leaq 0x40de(%rip), %rdx      # 0x749d
leaq 0x4114(%rip), %r8       # 0x74da
movl $0x4, %edi
movl $0x22, %ecx
jmp 0x3412
leaq 0x40b3(%rip), %rsi      # 0x748c
leaq 0x40bd(%rip), %rdx      # 0x749d
leaq 0x40c6(%rip), %r8       # 0x74ad
movl $0x4, %edi
movl $0x17, %ecx
jmp 0x3412
leaq 0x4092(%rip), %rsi      # 0x748c
leaq 0x409c(%rip), %rdx      # 0x749d
leaq 0x40ba(%rip), %r8       # 0x74c2
movl $0x4, %edi
movl $0x1d, %ecx
xorl %eax, %eax
callq 0x252a
movq %rbx, %rdi
callq 0x342b
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/epoll.c
// Function: epoll_free
int epoll_free(epoll_t* epoll) {
    if (epoll != NULL) {
        free(epoll->events);
        epoll->events = NULL;
        free(epoll);
        epoll = NULL;
    }

    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x3450
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x2030
movq %rbx, %rdi
callq 0x2030
addq $0x8, %rsp
popq %rbx
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/epoll.c
// Function: epoll_add_fd
int epoll_add_fd(epoll_t* epoll, int fd, epoll_event* event) {

    if (epoll == NULL) {
        log_error("epoll is null.");
        return -1;
    }

    /* 添加监听事件 */
    if (epoll_ctl(epoll->epollfd, EPOLL_CTL_ADD, fd, event) != 0) {
        log_error("epoll add fd failed.");
        return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x3492
movq %rdx, %rcx
movl %esi, %edx
movl (%rdi), %edi
movl $0x1, %esi
callq 0x21f0
testl %eax, %eax
je 0x34bf
leaq 0x4014(%rip), %rsi      # 0x748c
leaq 0x4071(%rip), %rdx      # 0x74f0
leaq 0x4086(%rip), %r8       # 0x750c
movl $0x4, %edi
movl $0x3c, %ecx
jmp 0x34b1
leaq 0x3ff3(%rip), %rsi      # 0x748c
leaq 0x4050(%rip), %rdx      # 0x74f0
leaq 0x4056(%rip), %r8       # 0x74fd
movl $0x4, %edi
movl $0x36, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x34c1
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/epoll.c
// Function: epoll_modify_fd
int epoll_modify_fd(epoll_t* epoll, int fd, epoll_event* event) {

    if (epoll == NULL) {
        log_error("epoll is null.");
        return -1;
    }

    /* 修改监听事件 */
    if (epoll_ctl(epoll->epollfd, EPOLL_CTL_MOD, fd, event) != 0) {
        log_error("epoll mod failed.");
        return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x3502
movq %rdx, %rcx
movl %esi, %edx
movl (%rdi), %edi
movl $0x3, %esi
callq 0x21f0
testl %eax, %eax
je 0x352f
leaq 0x3fa4(%rip), %rsi      # 0x748c
leaq 0x4032(%rip), %rdx      # 0x7521
leaq 0x403b(%rip), %r8       # 0x7531
movl $0x4, %edi
movl $0x4f, %ecx
jmp 0x3521
leaq 0x3f83(%rip), %rsi      # 0x748c
leaq 0x4011(%rip), %rdx      # 0x7521
leaq 0x3fe6(%rip), %r8       # 0x74fd
movl $0x4, %edi
movl $0x49, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3531
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/epoll.c
// Function: epoll_delete_fd
int epoll_delete_fd(epoll_t* epoll, int fd, epoll_event* event) {
    
    if (epoll == NULL) {
        log_error("epoll is null.");
        return -1;
    }

    /* 删除监听事件 */
    if (epoll_ctl(epoll->epollfd, EPOLL_CTL_DEL, fd, event) != 0) {
        log_error("epoll delete failed.");
        return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x3572
movq %rdx, %rcx
movl %esi, %edx
movl (%rdi), %edi
movl $0x2, %esi
callq 0x21f0
testl %eax, %eax
je 0x359f
leaq 0x3f34(%rip), %rsi      # 0x748c
leaq 0x3fe4(%rip), %rdx      # 0x7543
leaq 0x3fed(%rip), %r8       # 0x7553
movl $0x4, %edi
movl $0x62, %ecx
jmp 0x3591
leaq 0x3f13(%rip), %rsi      # 0x748c
leaq 0x3fc3(%rip), %rdx      # 0x7543
leaq 0x3f76(%rip), %r8       # 0x74fd
movl $0x4, %edi
movl $0x5c, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x35a1
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/core/epoll.c
// Function: epoll_wait_event
int epoll_wait_event(epoll_t* epoll, int maxevents, int timeout) {
    int n;
    int events_num;

    if (epoll == NULL) {
        log_error("epoll is null.");
        return -1;
    }

    /* 最大事件数与宏 MAX_EVENTS 取较小值 */
    events_num = maxevents < MAX_EVENTS ? maxevents : MAX_EVENTS;
    /* 等待就绪事件 */
    if ((n = epoll_wait(epoll->epollfd, epoll->events, events_num, timeout)) < 0) {
        log_error("epoll wait failed.");
    }

    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x35f5
movl %edx, %ecx
movl $0x400, %edx            # imm = 0x400
cmpl %edx, %esi
cmovll %esi, %edx
movl (%rdi), %eax
movq 0x8(%rdi), %rsi
movl %eax, %edi
callq 0x2330
movl %eax, %ebx
testl %eax, %eax
jns 0x3620
leaq 0x3eb8(%rip), %rsi      # 0x748c
leaq 0x3f8d(%rip), %rdx      # 0x7568
leaq 0x3b74(%rip), %r8       # 0x7156
movl $0x4, %edi
movl $0x79, %ecx
xorl %eax, %eax
callq 0x252a
jmp 0x3620
leaq 0x3e90(%rip), %rsi      # 0x748c
leaq 0x3f65(%rip), %rdx      # 0x7568
leaq 0x3ef3(%rip), %r8       # 0x74fd
movl $0x4, %edi
movl $0x71, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/http/http.c
// Function: http_init_connection
int http_init_connection(int connfd, epoll_t* epoll, config_t* config) {
    http_request_t* rq;
    struct epoll_event epev;

    /* 非阻塞读写 */
    set_nonblocking(connfd);

    if ((rq = http_request_init(connfd, epoll, config)) == NULL) {
        log_error("http_request_t init failed.");
        return -1;
    }

    /* 设置 epoll 监听 connfd 上的读事件，边缘触发 */
    epev.data.ptr = (void*)rq;
    epev.events = EPOLLIN | EPOLLET | EPOLLONESHOT;

    epoll_add_fd(epoll, connfd, &epev);

    /* 添加事件到定时器，设置超时回调函数 */
    add_timer((void*)rq, rq->timeout, http_close_connection);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r14
movl %edi, %ebx
callq 0x6118
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x494b
testq %rax, %rax
je 0x368d
movq %rax, %r15
leaq -0x24(%rbp), %rdx
movq %rax, 0x4(%rdx)
movl $0xc0000001, (%rdx)     # imm = 0xC0000001
movq %r14, %rdi
movl %ebx, %esi
callq 0x3453
movq 0x20e8(%r15), %rsi
leaq 0x42(%rip), %rdx        # 0x36c3
movq %r15, %rdi
callq 0x4e0e
xorl %eax, %eax
jmp 0x36b8
leaq 0x3ee5(%rip), %rsi      # 0x7579
leaq 0x3eee(%rip), %rdx      # 0x7589
leaq 0x3efc(%rip), %r8       # 0x759e
movl $0x4, %edi
movl $0x4b, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/http/http.c
// Function: http_close_connection
int http_close_connection(void* http_request) {
    http_request_t* rq;

    rq = (http_request_t*) http_request;
    
    close(rq->fd);

    http_request_destroy(rq);

    log_info("connection closed.");

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %edi
callq 0x21d0
movq %rbx, %rdi
callq 0x4ba7
leaq 0x3e97(%rip), %rsi      # 0x7579
leaq 0x3f86(%rip), %rdx      # 0x766f
leaq 0x3f95(%rip), %r8       # 0x7685
movl $0x2, %edi
movl $0x13c, %ecx            # imm = 0x13C
xorl %eax, %eax
callq 0x252a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/http/http.c
// Function: create_listenfd
int create_listenfd(unsigned short port) {
    int listenfd;
    int optval;
    struct sockaddr_in servaddr;

    /* 创建 socket 描述符 */
    if ((listenfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
        log_error("create socket failed.");
        return -1;
    }

    /* 设置 SO_REUSEADDR 关闭服务端的 TIME_WAIT */
    if (setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, (const void *)&optval , sizeof(int)) < 0) {
        log_error("set listenfd reuse adress error.");
	    return -1;
    }

    /* 设置地址与端口号 */
    bzero(&servaddr, sizeof(servaddr));
    servaddr.sin_family = AF_INET;
    servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
    servaddr.sin_port = htons((unsigned short)port);

    /* 绑定地址与端口号 */
    if (bind(listenfd, (struct sockaddr*)&servaddr, sizeof(servaddr)) < 0) {
        log_error("bind error.");
        return -1;
    }

    /* 将描述符设置为监听描述符 */
    if (listen(listenfd, BACKLOG) < 0) {
        log_error("listen error.");
        return -1;
    }

    return listenfd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edi, %r14d
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x24a0
testl %eax, %eax
js 0x37bd
movl %eax, %ebx
leaq -0x14(%rbp), %rcx
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x20d0
testl %eax, %eax
js 0x37de
leaq -0x24(%rbp), %rsi
movq $0x0, 0x8(%rsi)
movw $0x2, (%rsi)
movl $0x0, 0x4(%rsi)
rolw $0x8, %r14w
movw %r14w, 0x2(%rsi)
movl %ebx, %edi
movl $0x10, %edx
callq 0x2340
testl %eax, %eax
js 0x37ff
movl %ebx, %edi
movl $0x400, %esi            # imm = 0x400
callq 0x2300
testl %eax, %eax
jns 0x382a
leaq 0x3dd6(%rip), %rsi      # 0x7579
leaq 0x3e10(%rip), %rdx      # 0x75ba
leaq 0x3e5c(%rip), %r8       # 0x760d
movl $0x4, %edi
movl $0x7c, %ecx
jmp 0x381e
leaq 0x3db5(%rip), %rsi      # 0x7579
leaq 0x3def(%rip), %rdx      # 0x75ba
leaq 0x3df8(%rip), %r8       # 0x75ca
movl $0x4, %edi
movl $0x64, %ecx
jmp 0x381e
leaq 0x3d94(%rip), %rsi      # 0x7579
leaq 0x3dce(%rip), %rdx      # 0x75ba
leaq 0x3ded(%rip), %r8       # 0x75e0
movl $0x4, %edi
movl $0x6a, %ecx
jmp 0x381e
leaq 0x3d73(%rip), %rsi      # 0x7579
leaq 0x3dad(%rip), %rdx      # 0x75ba
leaq 0x3ded(%rip), %r8       # 0x7601
movl $0x4, %edi
movl $0x76, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/http/http.c
// Function: serve_error
static int serve_error(http_request_t* rq, unsigned status) {
    char body[MAXMSG] = { '\0' };
    int length;

    sprintf(body, "<html><head>");
    sprintf(body, "%s<title>%d %s</title></head>", body, status, get_shortmsg(status));
    sprintf(body, "%s<body bgcolor=\"LightSkyBlue\" align=\"center\">", body);
    sprintf(body, "%s<h1>%d %s</h1><hr>", body, status, get_shortmsg(status));
    sprintf(body, "%s<em>%s</em>", body, SERVER_NAME);
    sprintf(body, "%s</body></html>", body);

    length = strlen(body);

    serve_headers(rq, NULL, "text/html; charset=UTF-8", length, status);

    if (rio_writen(rq->fd, body, length) < 0) {
        log_error("write error.");
        return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movl %esi, %r14d
movq %rdi, %rbx
leaq -0x1013(%rbp), %r15
movl $0xff3, %edx            # imm = 0xFF3
movq %r15, %rdi
xorl %esi, %esi
callq 0x21b0
movabsq $0x683c3e6c6d74683c, %rax # imm = 0x683C3E6C6D74683C
movq %rax, -0xd(%r15)
movabsq $0x3e646165683c3e, %rax # imm = 0x3E646165683C3E
movq %rax, -0x8(%r15)
movl %r14d, %edi
callq 0x4176
movq %rax, %r12
leaq 0x3c5f(%rip), %rsi      # 0x7a14
leaq -0x1020(%rbp), %r15
movq %r15, %rdi
movq %r15, %rdx
movl %r14d, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x23e0
leaq 0x3c5c(%rip), %rsi      # 0x7a32
movq %r15, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x23e0
leaq 0x3c77(%rip), %rsi      # 0x7a61
movq %r15, %rdi
movq %r15, %rdx
movl %r14d, %ecx
movq %r12, %r8
xorl %eax, %eax
callq 0x23e0
leaq 0x3c72(%rip), %rsi      # 0x7a76
leaq 0x38f0(%rip), %rcx      # 0x76fb
movq %r15, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x23e0
leaq 0x3c65(%rip), %rsi      # 0x7a84
movq %r15, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x23e0
movq %r15, %rdi
callq 0x2130
movslq %eax, %r12
leaq 0x3a3b(%rip), %rdx      # 0x7879
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rcx
movl %r14d, %r8d
callq 0x3e96
movl (%rbx), %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x59fa
testq %rax, %rax
jns 0x3e86
leaq 0x3712(%rip), %rsi      # 0x7579
leaq 0x3c27(%rip), %rdx      # 0x7a95
leaq 0x3856(%rip), %r8       # 0x76cb
movl $0x4, %edi
movl $0x1e2, %ecx            # imm = 0x1E2
xorl %eax, %eax
callq 0x252a
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/http/http.c
// Function: get_shortmsg
static char* get_shortmsg(unsigned status) {
    switch (status) {
    case HTTP_CONTINUE:
        return "Continue";

    case HTTP_OK:
        return "OK";

    case HTTP_MOVED_PERMANENTLY:
        return "Moved Permanently";

    case HTTP_MOVED_TEMPORARILY:
        return "Found";
        
    case HTTP_NOT_MODIFIED:
        return "Not Modified";
        
    case HTTP_BAD_REQUEST:
        return "Bad Request";
        
    case HTTP_FORBIDDEN:
        return "Forbidden";
        
    case HTTP_NOT_FOUND:
        return "Not Found";
    
    case HTTP_PRECONDITION_FAILED:
        return "Precondition Failed";
        
    case HTTP_INTERNAL_SERVER_ERROR:
        return "Internal Server Error";

    case HTTP_NOT_IMPLEMENTED:
        return "Not Implemented";

    case HTTP_VERSION_NOT_SUPPORTED:
        return "HTTP Version not supported";
    
    default:
        break;
    }

    return "";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x192, %edi            # imm = 0x192
jg 0x41b7
cmpl $0x12d, %edi            # imm = 0x12D
jg 0x41eb
cmpl $0x64, %edi
je 0x422d
cmpl $0xc8, %edi
je 0x4251
cmpl $0x12d, %edi            # imm = 0x12D
jne 0x4275
leaq 0x3619(%rip), %rax      # 0x77cb
jmp 0x427c
cmpl $0x1f3, %edi            # imm = 0x1F3
jg 0x420c
cmpl $0x193, %edi            # imm = 0x193
je 0x4236
cmpl $0x194, %edi            # imm = 0x194
je 0x425a
cmpl $0x19c, %edi            # imm = 0x19C
jne 0x4275
leaq 0x3624(%rip), %rax      # 0x780a
jmp 0x427c
cmpl $0x12e, %edi            # imm = 0x12E
je 0x423f
cmpl $0x130, %edi            # imm = 0x130
je 0x4263
cmpl $0x190, %edi            # imm = 0x190
jne 0x4275
leaq 0x35e0(%rip), %rax      # 0x77ea
jmp 0x427c
cmpl $0x1f4, %edi            # imm = 0x1F4
je 0x4248
cmpl $0x1f5, %edi            # imm = 0x1F5
je 0x426c
cmpl $0x1f9, %edi            # imm = 0x1F9
jne 0x4275
leaq 0x3619(%rip), %rax      # 0x7844
jmp 0x427c
leaq 0x358b(%rip), %rax      # 0x77bf
jmp 0x427c
leaq 0x35b9(%rip), %rax      # 0x77f6
jmp 0x427c
leaq 0x35be(%rip), %rax      # 0x7804
jmp 0x427c
leaq 0x35cf(%rip), %rax      # 0x781e
jmp 0x427c
leaq 0x3570(%rip), %rax      # 0x77c8
jmp 0x427c
leaq 0x359f(%rip), %rax      # 0x7800
jmp 0x427c
leaq 0x3573(%rip), %rax      # 0x77dd
jmp 0x427c
leaq 0x35c1(%rip), %rax      # 0x7834
jmp 0x427c
leaq 0x34f5(%rip), %rax      # 0x7771
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/http/http_request.c
// Function: http_process_date
static int http_process_date(http_request_t* rq, http_headers_out_t* out, char* st, char* ed) {
    struct tm time;

    if (!strptime(st, "%a, %d %b %Y %H:%M:%S GMT", &time)) {
        log_error("date error.");
        return REQUEST_ERROR;
    }

    out->rtime = mktime(&time);

    return HTTP_OK;    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rdi
movq %rsi, %rbx
leaq 0x2f0e(%rip), %rsi      # 0x7707
leaq -0x40(%rbp), %rdx
callq 0x2430
testq %rax, %rax
je 0x481b
leaq -0x40(%rbp), %rdi
callq 0x2310
movq %rax, 0x8(%rbx)
movl $0xc8, %eax
jmp 0x4846
leaq 0x3319(%rip), %rsi      # 0x7b3b
leaq 0x339d(%rip), %rdx      # 0x7bc6
leaq 0x33a8(%rip), %r8       # 0x7bd8
movl $0x4, %edi
movl $0xc2, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/http/http_request.c
// Function: http_process_if_modified_since
static int http_process_if_modified_since(http_request_t* rq, http_headers_out_t* out, char* st, char* ed) {
    struct tm time;
    time_t ims;

    if (!strptime(st, "%a, %d %b %Y %H:%M:%S GMT", &time)) {
        log_error("date error.");
        return REQUEST_ERROR;
    }

    ims = mktime(&time);

    if (ims < out->mtime) {
        out->if_modified = 1;   /* 返回 200 */
        out->status = HTTP_OK;
    } else {
        out->if_modified = 2;   /* 返回 304 */
        out->status = HTTP_NOT_MODIFIED;
    }

    return HTTP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rdi
movq %rsi, %rbx
leaq 0x2ea4(%rip), %rsi      # 0x7707
leaq -0x40(%rbp), %rdx
callq 0x2430
testq %rax, %rax
je 0x489d
leaq -0x40(%rbp), %rdi
callq 0x2310
movl $0xcf, %ecx
andl (%rbx), %ecx
cmpq 0x10(%rbx), %rax
movl $0xc810, %eax           # imm = 0xC810
movl $0x13020, %edx          # imm = 0x13020
cmovll %eax, %edx
orl %ecx, %edx
movl %edx, (%rbx)
movl $0xc8, %eax
jmp 0x48c8
leaq 0x3297(%rip), %rsi      # 0x7b3b
leaq 0x3339(%rip), %rdx      # 0x7be4
leaq 0x3326(%rip), %r8       # 0x7bd8
movl $0x4, %edi
movl $0xd0, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/http/http_request.c
// Function: http_process_if_unmodified_since
static int http_process_if_unmodified_since(http_request_t* rq, http_headers_out_t* out, char* st, char* ed) {
    struct tm time;
    time_t iums;

    if (strptime(st, "%a, %d %b %Y %H:%M:%S GMT", &time)) {
        log_error("date error.");
        return REQUEST_ERROR;
    }

    iums = mktime(&time);

    if (iums > out->mtime) {
        out->if_unmodified = 1; /* 返回 412 */
        out->status = HTTP_PRECONDITION_FAILED;
    }

    return HTTP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rdi
movq %rsi, %rbx
leaq 0x2e22(%rip), %rsi      # 0x7707
leaq -0x40(%rbp), %rdx
callq 0x2430
testq %rax, %rax
je 0x4920
leaq 0x3241(%rip), %rsi      # 0x7b3b
leaq 0x3302(%rip), %rdx      # 0x7c03
leaq 0x32d0(%rip), %r8       # 0x7bd8
movl $0x4, %edi
movl $0xe6, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4944
leaq -0x40(%rbp), %rdi
callq 0x2310
movq %rax, %rcx
movl $0xc8, %eax
cmpq 0x10(%rbx), %rcx
jle 0x4944
movl (%rbx), %ecx
andl $0x3f, %ecx
orl $0x19c40, %ecx          # imm = 0x19C40
movl %ecx, (%rbx)
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/http/http_request.c
// Function: http_request_init
http_request_t* http_request_init(int fd, epoll_t* epoll, config_t* config) {
    http_request_t* rq;

    if ((rq = (http_request_t*)malloc(sizeof(http_request_t))) == NULL) {
        log_error("http_request_t malloc failed.");
        return NULL;
    }

    rq->fd = fd;
    rq->epoll = epoll;
    rq->state = 0;
    rq->have_args = 0;
    rq->bufst = &(rq->buf[0]);
    rq->bufed = &(rq->buf[0]);
    rq->handler = http_process_request_line;    /* 初始时解析请求行 */
    rq->timer.timer_set = 0;
    rq->timer.handler = http_close_connection;  /* 定时器超时回调函数 */
    if (config) {
        rq->root = config->root;
        rq->defile = config->defile;
        rq->timeout = config->timeout;
    }
    
    init_list_head(&(rq->headers_list_head));   /* 初始化链表 */

    return rq;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %r12d
movl $0x20f8, %edi           # imm = 0x20F8
callq 0x22d0
movq %rax, %rbx
testq %rax, %rax
je 0x49f6
movl %r12d, (%rbx)
movq %r15, 0x8(%rbx)
xorl %eax, %eax
movl %eax, 0x48(%rbx)
movl %eax, 0x50(%rbx)
leaq 0x98(%rbx), %rax
movq %rax, 0x2098(%rbx)
movq %rax, 0x20a0(%rbx)
leaq 0x88(%rip), %rax        # 0x4a28
movq %rax, 0x20f0(%rbx)
movb $0x0, 0x20e0(%rbx)
leaq -0x12f2(%rip), %rax     # 0x36c3
movq %rax, 0x20d8(%rbx)
testq %r14, %r14
je 0x49e8
leaq 0x8(%r14), %rax
movq %rax, 0x88(%rbx)
leaq 0x108(%r14), %rax
movq %rax, 0x90(%rbx)
movq 0x208(%r14), %rax
movq %rax, 0x20e8(%rbx)
movq %rbx, %rdi
addq $0x58, %rdi
callq 0x5038
jmp 0x4a1c
leaq 0x313e(%rip), %rsi      # 0x7b3b
leaq 0x314f(%rip), %rdx      # 0x7b53
leaq 0x315a(%rip), %r8       # 0x7b65
movl $0x4, %edi
movl $0x29, %ecx
xorl %eax, %eax
callq 0x252a
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/http/http_request.c
// Function: http_process_request_line
static int http_process_request_line(http_request_t* rq) {
    int ret;

    if (rq->timer.timeout) {
        return REQUEST_TIMEOUT;
    }

    if ((ret = http_parse_request_line(rq)) == REQUEST_OK) {
        /* 当返回 REQUEST_OK 时，请求行已解析完毕，继续解析首部字段 */
        rq->handler = http_process_request_headers;
        return http_process_request_headers(rq);
    }
    
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
testb $0x2, 0x20e0(%rdi)
jne 0x4a72
movq %rdi, %rbx
callq 0x4280
testl %eax, %eax
jne 0x4a72
leaq 0x17c(%rip), %rax       # 0x4bcb
movq %rax, 0x20f0(%rbx)
testb $0x2, 0x20e0(%rbx)
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
jne 0x4a72
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4583
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ttoobne[P]bohttpd/src/http/http_request.c
// Function: http_headers_out_init
http_headers_out_t* http_headers_out_init() {
    http_headers_out_t* out;

    if ((out = (http_headers_out_t*)malloc(sizeof(http_headers_out_t))) == NULL) {
        log_error("http_headers_out_t malloc failed.");
        return NULL;
    }

    out->keep_alive = 0;
    out->if_modified = 0;
    out->if_unmodified = 0;
    out->status = 0;

    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x18, %edi
callq 0x22d0
movq %rax, %rbx
testq %rax, %rax
je 0x4a99
movl $0x0, (%rbx)
jmp 0x4abf
leaq 0x309b(%rip), %rsi      # 0x7b3b
leaq 0x30dc(%rip), %rdx      # 0x7b83
leaq 0x30eb(%rip), %r8       # 0x7b99
movl $0x4, %edi
movl $0x48, %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/http/http_request.c
// Function: http_analyze_headers
int http_analyze_headers(http_request_t* rq, http_headers_out_t* out) {
    http_header_t* pos;
    list_head_t* head;
    list_head_t* now;
    list_head_t* next;
    http_headers_in_t* in;
    int len;

    /* 获取链表头 */
    head = &(rq->headers_list_head);

    /* 遍历链表中的每一个节点 */
    list_for_each_entry(pos, head, list_node) {
        /* 对于每一个节点循环判断与每一个字段名是否匹配 */
        len = pos->header_name_end - pos->header_name_start + 1;
        for (in = http_headers_in; strlen(in->name) > 0; ++ in) {
            /* 如果匹配，则执行相应处理函数 */
            if (!strncmp(in->name, pos->header_name_start, len)) {
                if (in->handler != NULL) {
                    in->handler(rq, out, pos->header_value_start, pos->header_value_end);
                }

                break;
            }
        }
    }

    /* 销毁链表中的所有节点 */
    now = head->next;
    while (now != head) {
        next = now->next;
        pos = list_entry(now, http_header_t, list_node);

        list_del(now);
        free(pos);
        pos = NULL;

        now = next;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x40(%rbp)
leaq 0x58(%rdi), %r15
movq %rdi, -0x30(%rbp)
movq 0x60(%rdi), %rbx
cmpq %r15, %rbx
je 0x4b75
movq 0x6776(%rip), %r14      # 0xb270
movq %r15, -0x38(%rbp)
cmpb $0x0, (%r14)
je 0x4b64
movq 0x10(%rbx), %r12
movl 0x18(%rbx), %eax
subl %r12d, %eax
incl %eax
movslq %eax, %r13
leaq 0x6766(%rip), %r15      # 0xb280
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2070
testl %eax, %eax
je 0x4b3e
movq (%r15), %rdi
addq $0x10, %r15
cmpb $0x0, (%rdi)
jne 0x4b1d
movq -0x38(%rbp), %r15
jmp 0x4b64
movq -0x8(%r15), %rax
testq %rax, %rax
movq -0x38(%rbp), %r15
je 0x4b64
movq 0x20(%rbx), %rdx
movq 0x28(%rbx), %rcx
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq *%rax
movq 0x670c(%rip), %r14      # 0xb270
movq 0x8(%rbx), %rbx
cmpq %r15, %rbx
jne 0x4afe
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rbx
cmpq %r15, %rbx
je 0x4b96
movq 0x8(%rbx), %r14
movq %rbx, %rdi
callq 0x5094
movq %rbx, %rdi
callq 0x2030
movq %r14, %rbx
cmpq %r15, %r14
jne 0x4b7a
xorl %eax, %eax
addq $0x18, %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: init_timer
int init_timer() {
    /* 初始化的主要工作就是初始化一颗红黑树 */
    if (rbtree_init(&timer_rbtree, &timer_nil, rbtree_insert_timer) != 0) {
        log_error("rbtree init error.");
        return -1;
    }

    /* 初始化互斥锁，用于多线程使用定时器的同步操作 */
    if (pthread_mutex_init(&timer_mutex, NULL) != 0) {
        log_error("timer mutex init failed.");
        return -1;
    }

    /* 初始化 current_msec ，可做可不做 */
    if (update_current_msec() != 0) {
        log_error("get current time error.");
        return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x66e3(%rip), %rdi      # 0xb2d8
leaq 0x66f4(%rip), %rsi      # 0xb2f0
leaq 0x69d(%rip), %rdx       # 0x52a0
callq 0x50c4
testl %eax, %eax
je 0x4c2d
leaq 0x3011(%rip), %rsi      # 0x7c24
leaq 0x3020(%rip), %rdx      # 0x7c3a
leaq 0x3024(%rip), %r8       # 0x7c45
movl $0x4, %edi
movl $0x1c, %ecx
jmp 0x4c8a
leaq 0x66ec(%rip), %rdi      # 0xb320
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x2440
testl %eax, %eax
je 0x4c62
leaq 0x2fdc(%rip), %rsi      # 0x7c24
leaq 0x2feb(%rip), %rdx      # 0x7c3a
leaq 0x3002(%rip), %r8       # 0x7c58
movl $0x4, %edi
movl $0x22, %ecx
jmp 0x4c8a
callq 0x4fe3
testl %eax, %eax
je 0x4c96
leaq 0x2fb2(%rip), %rsi      # 0x7c24
leaq 0x2fc1(%rip), %rdx      # 0x7c3a
leaq 0x2ff1(%rip), %r8       # 0x7c71
movl $0x4, %edi
movl $0x28, %ecx
xorl %eax, %eax
callq 0x252a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq