LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_write_header
int eweb_write_header(eweb_os_t *w, const int socket_fd, const char *head, long content_len) {
	assert(w);
	assert(head);
	int r = EWEB_OK;
	char cl[64+1] = { 0 };
	string_t *header = string_new(w, 255);
	if (!header)
		goto fail;
	if (!string_add(w, header, head))
		goto fail;
	if (!string_add(w, header, "\nContent-Length: "))
		goto fail;
	snprintf(cl, sizeof(cl), "%ld", content_len);
	if (!string_add(w, header, cl))
		goto fail;
	if (!string_add(w, header, "\r\n\r\n"))
		goto fail;
	const long wlen = header->used_bytes - 1;
	if (w->write(w, socket_fd, string_chars(w, header), wlen) != wlen)
		r = EWEB_ERROR;
	string_free(w, header);
	return r;
fail:
	string_free(w, header);
	return EWEB_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
testq %rdi, %rdi
je 0x2e38
movq %rdx, %r12
testq %rdx, %rdx
je 0x2e57
movq %rcx, %r15
movl %esi, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movb $0x0, 0x40(%rsp)
movl $0xff, %esi
callq 0x2e76
movq %rax, %r14
testq %rax, %rax
je 0x2e1b
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2f18
testq %rax, %rax
je 0x2e1b
leaq 0x2b3d(%rip), %rdx      # 0x58d9
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2f18
testq %rax, %rax
je 0x2e1b
leaq 0x2b38(%rip), %rdx      # 0x58eb
movq %rsp, %r12
pushq $0x41
popq %rsi
movq %r12, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x20d0
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2f18
testq %rax, %rax
je 0x2e1b
leaq 0x2b0f(%rip), %rdx      # 0x58ef
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2f18
testq %rax, %rax
je 0x2e1b
movq (%r14), %rdx
movq 0x10(%r14), %r15
decq %r15
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rcx
callq *0x30(%rbx)
xorl %ebp, %ebp
cmpq %r15, %rax
setne %bpl
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2fc6
jmp 0x2e29
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2fc6
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26ee(%rip), %rdi      # 0x552d
leaq 0x2a45(%rip), %rsi      # 0x588b
leaq 0x2a45(%rip), %rcx      # 0x5892
movl $0x80, %edx
callq 0x20e0
leaq 0x2a76(%rip), %rdi      # 0x58d4
leaq 0x2a26(%rip), %rsi      # 0x588b
leaq 0x2a26(%rip), %rcx      # 0x5892
movl $0x81, %edx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: string_new
string_t *string_new(eweb_os_t *w, const long increments) {
	string_t *s = eweb_malloc_or_die(w, sizeof(*s));
	if (!s)
		goto fail;
	if (bcreate(w, s, 1, increments) != EWEB_OK)
		goto fail;
	if (badd(w, s, "\0", 1) != EWEB_OK)
		goto fail;
	return s;
fail:
	string_free(w, s);
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
pushq $0x28
popq %rsi
callq 0x3b18
movq %rax, %rbx
testq %rax, %rax
je 0x2ee3
testq %r14, %r14
je 0x2ef9
movq $0x1, 0x18(%rbx)
movq %r15, 0x20(%rbx)
pushq $0x1
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3d77
movq %rax, (%rbx)
testq %rax, %rax
je 0x2ee3
movq 0x18(%rbx), %rax
imulq 0x20(%rbx), %rax
movq %rax, 0x8(%rbx)
andq $0x0, 0x10(%rbx)
leaq 0x3395(%rip), %rdx      # 0x6266
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x40d4
testl %eax, %eax
je 0x2ef0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2fc6
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x262d(%rip), %rdi      # 0x552d
leaq 0x2984(%rip), %rsi      # 0x588b
leaq 0x32dc(%rip), %rcx      # 0x61ea
movl $0x207, %edx            # imm = 0x207
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: string_add
string_t *string_add(eweb_os_t *w, string_t * s, const char *char_array) {
	assert(s);
	assert(char_array);
	s->used_bytes--;
	if (badd(w, s, char_array, strlen(char_array) + 1) != EWEB_OK)
		return NULL;
	return s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x2f5f
movq %rdx, %r14
testq %rdx, %rdx
je 0x2f7e
movq %rsi, %rbx
movq %rdi, %r15
decq 0x10(%rsi)
movq %r14, %rdi
callq 0x20b0
leaq 0x1(%rax), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x40d4
xorl %ecx, %ecx
testl %eax, %eax
cmoveq %rbx, %rcx
movq %rcx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3416(%rip), %rdi      # 0x637c
leaq 0x291e(%rip), %rsi      # 0x588b
leaq 0x313f(%rip), %rcx      # 0x60b3
movl $0x241, %edx            # imm = 0x241
callq 0x20e0
leaq 0x316a(%rip), %rdi      # 0x60ef
leaq 0x28ff(%rip), %rsi      # 0x588b
leaq 0x3120(%rip), %rcx      # 0x60b3
movl $0x242, %edx            # imm = 0x242
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_write_html
int eweb_write_html(eweb_os_t *w, const int socket_fd, const char *head, const char *html) {
	assert(w);
	assert(head);
	assert(html);
	const long r = eweb_write_header(w, socket_fd, head, strlen(html));
	if (r != EWEB_OK)
		return r;
	const long wlen = strlen(html);
	return w->write(w, socket_fd, html, wlen) == wlen ? EWEB_OK : EWEB_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x309e
movq %rdx, %r15
testq %rdx, %rdx
je 0x30bd
movq %rcx, %rbx
testq %rcx, %rcx
je 0x30dc
movl %esi, %ebp
movq %rdi, %r14
movq %rbx, %rdi
callq 0x20b0
movq %r14, %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %rax, %rcx
callq 0x2d24
testl %eax, %eax
je 0x306e
pushq $0x1
popq %rax
jmp 0x3093
movq %rbx, %rdi
callq 0x20b0
movq %rax, %r15
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
movq %rax, %rcx
callq *0x30(%r14)
movq %rax, %rcx
xorl %eax, %eax
cmpq %r15, %rcx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2488(%rip), %rdi      # 0x552d
leaq 0x27df(%rip), %rsi      # 0x588b
leaq 0x2841(%rip), %rcx      # 0x58f4
movl $0x9b, %edx
callq 0x20e0
leaq 0x2810(%rip), %rdi      # 0x58d4
leaq 0x27c0(%rip), %rsi      # 0x588b
leaq 0x2822(%rip), %rcx      # 0x58f4
movl $0x9c, %edx
callq 0x20e0
leaq 0x24b3(%rip), %rdi      # 0x5596
leaq 0x27a1(%rip), %rsi      # 0x588b
leaq 0x2803(%rip), %rcx      # 0x58f4
movl $0x9d, %edx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_forbidden_403
int eweb_forbidden_403(eweb_os_t *w, eweb_os_hit_args_t *args, const char *info) {
	assert(args);
	assert(info);
	const int r = eweb_write_html(w, args->socketfd,
		"HTTP/1.1 403 Forbidden\nServer: eweb\nConnection: close\nContent-Type: text/html",
		"<!DOCTYPE html>\n"
		"<html><head>\n<title>403 Forbidden</title>\n"
		"</head><body>\n<h1>Forbidden</h1>\nThe requested URL, file type or operation is not allowed.\n</body>"
		"</html>");
	w->log(w, EWEB_OK, "403 FORBIDDEN: %s/%d", info, args->socketfd);
	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x3152
movq %rdx, %r14
testq %rdx, %rdx
je 0x3171
movq %rsi, %r15
movq %rdi, %rbx
movl 0x40(%rsi), %esi
leaq 0x286f(%rip), %rdx      # 0x598e
leaq 0x28b6(%rip), %rcx      # 0x59dc
callq 0x3024
movl %eax, %ebp
movl 0x40(%r15), %r8d
leaq 0x2948(%rip), %rdx      # 0x5a80
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rcx
xorl %eax, %eax
callq *0x50(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x27e3(%rip), %rdi      # 0x593c
leaq 0x272b(%rip), %rsi      # 0x588b
leaq 0x27da(%rip), %rcx      # 0x5941
movl $0xa6, %edx
callq 0x20e0
leaq 0x2811(%rip), %rdi      # 0x5989
leaq 0x270c(%rip), %rsi      # 0x588b
leaq 0x27bb(%rip), %rcx      # 0x5941
movl $0xa7, %edx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_not_found_404
int eweb_not_found_404(eweb_os_t *w, eweb_os_hit_args_t *args, const char *info) {
	assert(args);
	assert(info);
	const int r = eweb_write_html(w, args->socketfd,
		"HTTP/1.1 404 Not Found\nServer: eweb\nConnection: close\nContent-Type: text/html",
		"<!DOCTYPE html>\n"
		"<html><head>\n<title>404 Not Found</title>\n"
		"</head><body>\n<h1>Not Found</h1>\nThe requested URL was not found on this server.\n</body></html>");
	w->log(w, EWEB_OK, "404 NOT FOUND: %s/%d", info, args->socketfd);
	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x31e7
movq %rdx, %r14
testq %rdx, %rdx
je 0x3206
movq %rsi, %r15
movq %rdi, %rbx
movl 0x40(%rsi), %esi
leaq 0x2929(%rip), %rdx      # 0x5add
leaq 0x2970(%rip), %rcx      # 0x5b2b
callq 0x3024
movl %eax, %ebp
movl 0x40(%r15), %r8d
leaq 0x29f8(%rip), %rdx      # 0x5bc5
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rcx
xorl %eax, %eax
callq *0x50(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x274e(%rip), %rdi      # 0x593c
leaq 0x2696(%rip), %rsi      # 0x588b
leaq 0x2899(%rip), %rcx      # 0x5a95
movl $0xb3, %edx
callq 0x20e0
leaq 0x277c(%rip), %rdi      # 0x5989
leaq 0x2677(%rip), %rsi      # 0x588b
leaq 0x287a(%rip), %rcx      # 0x5a95
movl $0xb4, %edx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_ok_200
int eweb_ok_200(eweb_os_t *w, eweb_os_hit_args_t *args, const char *custom_headers, const char *html, const char *path) {
	assert(w);
	string_t *headers = string_new(w, 255);
	if (!headers)
		goto fail;
	if (!string_add(w, headers, "HTTP/1.1 200 OK\nServer: eweb\nCache-Control: no-cache\nPragma: no-cache"))
		goto fail;
	if (!custom_headers)
		if (!string_add(w, headers, custom_headers))
			goto fail;
	eweb_write_html(w, args->socketfd, string_chars(w, headers), html);
	string_free(w, headers);
	w->log(w, EWEB_OK, "200 OK: %s/%d", path, args->socketfd);
	return EWEB_OK;
fail:
	string_free(w, headers);
	w->log(w, EWEB_ERROR, "Failed to serve (200)");
	return EWEB_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x32f2
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %rbx
movl $0xff, %esi
callq 0x2e76
movq %rax, %r13
testq %rax, %rax
je 0x32c2
leaq 0x29d6(%rip), %rdx      # 0x5c37
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2f18
testq %rax, %rax
je 0x32c2
testq %rbp, %rbp
jne 0x3288
movq %rbx, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2f18
testq %rax, %rax
je 0x32c2
movl 0x40(%r15), %esi
movq (%r13), %rdx
movq %rbx, %rdi
movq %r12, %rcx
callq 0x3024
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2fc6
movl 0x40(%r15), %r8d
leaq 0x29cc(%rip), %rdx      # 0x5c7d
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rcx
xorl %eax, %eax
callq *0x50(%rbx)
jmp 0x32e1
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2fc6
leaq 0x29b7(%rip), %rdx      # 0x5c8b
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq *0x50(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2234(%rip), %rdi      # 0x552d
leaq 0x258b(%rip), %rsi      # 0x588b
leaq 0x28d3(%rip), %rcx      # 0x5bda
movl $0xbf, %edx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_get_header
eweb_http_header_t eweb_get_header(const char *name, const char *request, const long max_len) {
	assert(name);
	assert(request);
	eweb_http_header_t retval = { .name = { 0 } };
	size_t x = 0;
	char *ptr = strstr(request, name);
	char * const end = ptr + max_len;
	strncpy(retval.name, name, sizeof(retval.name) - 1);
	retval.name[sizeof(retval.name) - 1] = 0;

	if (!ptr) {
		retval.value[0] = 0;
		return retval;
	}

	while (*ptr++ != ':' && ptr <= end) ; // !?
	while (isblank(*++ptr) && ptr <= end) ; // !?
	while (x < (sizeof(retval.value) - 1)/*!!*/ && *ptr != '\r' && *ptr != '\n' && ptr <= end)
		retval.value[x++] = *ptr++;
	retval.value[x] = 0;
	return retval;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x33e5
movq %rdx, %r12
testq %rdx, %rdx
je 0x3404
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %rbx
addq $0x32, %rdi
movl $0xff, %edx
xorl %esi, %esi
callq 0x2100
movq %r12, %rdi
movq %r15, %rsi
callq 0x2300
movq %rax, %r12
pushq $0x31
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2060
movb $0x0, 0x31(%rbx)
testq %r12, %r12
je 0x33d6
addq %r12, %r14
incq %r12
leaq 0x1(%r12), %r15
cmpb $0x3a, -0x1(%r12)
je 0x3387
cmpq %r14, %r12
movq %r15, %r12
jbe 0x3372
callq 0x2320
movq (%rax), %rcx
movsbq (%r15), %rdx
leaq 0x1(%r15), %rax
testb $0x1, (%rcx,%rdx,2)
je 0x33a5
cmpq %r14, %r15
movq %rax, %r15
jbe 0x338f
decq %rax
xorl %ecx, %ecx
cmpq $0xfe, %rcx
je 0x33d1
movzbl (%rax), %edx
cmpl $0xa, %edx
je 0x33d1
cmpl $0xd, %edx
je 0x33d1
cmpq %r14, %rax
ja 0x33d1
incq %rax
movb %dl, 0x32(%rbx,%rcx)
incq %rcx
jmp 0x33aa
movb $0x0, 0x32(%rbx,%rcx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x28b5(%rip), %rdi      # 0x5ca1
leaq 0x2498(%rip), %rsi      # 0x588b
leaq 0x28ac(%rip), %rcx      # 0x5ca6
movl $0xd3, %edx
callq 0x20e0
leaq 0x21b6(%rip), %rdi      # 0x55c1
leaq 0x2479(%rip), %rsi      # 0x588b
leaq 0x288d(%rip), %rcx      # 0x5ca6
movl $0xd4, %edx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_get_body_start
static long eweb_get_body_start(const char *request) { /* return the starting index of the request body, or end of the HTTP headers */
	assert(request);
	const char *ptr = strstr(request, "\r\n\r\n"); // !!
	return !ptr ? -1 : (ptr + 4) - request;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x3a9c
movq %rdi, %rbx
leaq 0x1e73(%rip), %rsi      # 0x58ef
callq 0x2300
movq %rax, %rdx
subq %rbx, %rdx
addq $0x4, %rdx
xorl %ecx, %ecx
cmpq $0x1, %rax
sbbq %rcx, %rcx
orq %rdx, %rcx
movq %rcx, %rax
popq %rbx
retq
leaq 0x1b1e(%rip), %rdi      # 0x55c1
leaq 0x1de1(%rip), %rsi      # 0x588b
leaq 0x2675(%rip), %rcx      # 0x6126
movl $0xea, %edx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_finish_hit
static int eweb_finish_hit(eweb_os_t *w, eweb_os_hit_args_t *args, int exit_code) {
	assert(args);
	UNUSED(exit_code);
	w->close(w, args->socketfd);
	string_free(w, args->buffer);
	eweb_free(w, args->headers);
	eweb_clear_form_values(w, args);
	eweb_free(w, args->content_type);
	eweb_free(w, args);
	w->thread_exit(w, exit_code);
	return EWEB_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movl 0x40(%rsi), %esi
callq *0x40(%rdi)
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x2fc6
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x3f84
movq %r14, %rdi
movq %r15, %rsi
callq 0x4190
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x3f84
movq %r14, %rdi
movq %r15, %rsi
callq 0x3f84
movq 0x78(%r14), %rax
movq %r14, %rdi
movl %ebx, %esi
popq %rbx
popq %r14
popq %r15
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_malloc_or_die
void *eweb_malloc_or_die(eweb_os_t *w, size_t num_bytes) {
	assert(w);
	assert(!(w->allocation_error));
	void *mem = w->allocator.malloc(w->allocator.arena, num_bytes);
	if (!mem) {
		w->allocation_error = 1;
		w->log(w, EWEB_ERROR, "malloc of %zu bytes failed", num_bytes);
		w->exit(w, 1);
	}
	return mem;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3b75
movq %rdi, %rbx
testb $0x1, 0x98(%rdi)
jne 0x3b94
movq %rsi, %r14
movq 0x18(%rbx), %rdi
callq *(%rbx)
movq %rax, %r15
testq %rax, %rax
jne 0x3b67
orb $0x1, 0x98(%rbx)
leaq 0x2446(%rip), %rdx      # 0x5f95
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rcx
xorl %eax, %eax
callq *0x50(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq *0x58(%rbx)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19b1(%rip), %rdi      # 0x552d
leaq 0x1d08(%rip), %rsi      # 0x588b
leaq 0x23c6(%rip), %rcx      # 0x5f50
movl $0x1db, %edx            # imm = 0x1DB
callq 0x20e0
leaq 0x23e3(%rip), %rdi      # 0x5f7e
leaq 0x1ce9(%rip), %rsi      # 0x588b
leaq 0x23a7(%rip), %rcx      # 0x5f50
movl $0x1dc, %edx            # imm = 0x1DC
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_server
int eweb_server(eweb_os_t *w, unsigned port, responder_cb_t responder_func) {
	assert(w);
	if (w->init(w) < 0)
		return w->log(w, EWEB_ERROR, "initialization failed");

	if (!port) {
		port = 8080;
		w->log(w->file, EWEB_OK, "using default port (%u)", port);
	}

	w->log(w, EWEB_OK, "eweb server initialized (port = %u), (mode = %u)", port, w->threading_mode);

	const int listenfd = w->open(w, port);
	if (listenfd < 0)
		return w->log(w, EWEB_ERROR, "open failed");

	for (unsigned long hit = 1;;hit++) {
		const int socketfd = w->accept(w, listenfd);
		if (socketfd < 0) {
			/*if (!doing_shutdown) */
			w->log(w, EWEB_ERROR, "accept failed");
			continue;
		}

		eweb_os_hit_args_t *args = eweb_calloc_or_die(w, 1, sizeof(struct eweb_os_hit_args));
		if (!args) {
			w->close(w, socketfd);
			goto fail;
		}
		args->hit = hit;
		args->socketfd = socketfd;
		args->listenfd = listenfd;
		args->responder_function = responder_func;
		args->w = w;

		/* !! Who cleans up on failure? */
		const long rval = w->thread_new(w, args);
		if (rval != EWEB_OK) {
			w->log(w, EWEB_ERROR, "thread new failed");
			continue;
		}
	}
	return EWEB_OK;
fail:
	w->close(w, listenfd);
	return EWEB_ERROR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
testq %rdi, %rdi
je 0x3d58
movl %esi, %ebp
movq %rdi, %rbx
callq *0x60(%rdi)
testq %rax, %rax
js 0x3d28
testl %ebp, %ebp
jne 0x3c6d
movq 0x88(%rbx), %rdi
leaq 0x21e7(%rip), %rdx      # 0x5e43
movl $0x1f90, %ebp           # imm = 0x1F90
xorl %esi, %esi
movl $0x1f90, %ecx           # imm = 0x1F90
xorl %eax, %eax
callq *0x50(%rbx)
movl 0x98(%rbx), %r8d
shrl %r8d
andl $0x3, %r8d
leaq 0x21d9(%rip), %rdx      # 0x5e5b
movq %rbx, %rdi
xorl %esi, %esi
movl %ebp, %ecx
xorl %eax, %eax
callq *0x50(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq *0x20(%rbx)
movq %rax, %r12
testl %r12d, %r12d
js 0x3d31
pushq $0x1
popq %r14
leaq 0x21eb(%rip), %rbp      # 0x5e98
pushq $0x1
popq %r15
movq %rbx, %rdi
movl %r12d, %esi
callq *0x28(%rbx)
movq %rax, %r13
movq %rbp, %rdx
testl %r13d, %r13d
js 0x3d04
movq %rbx, %rdi
pushq $0x1
popq %rsi
pushq $0x50
popq %rdx
callq 0x3d77
testq %rax, %rax
je 0x3d14
movq %r14, 0x38(%rax)
movl %r13d, 0x40(%rax)
movl %r12d, 0x44(%rax)
movq (%rsp), %rcx
movq %rcx, (%rax)
movq %rbx, 0x48(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq *0x70(%rbx)
leaq 0x21a7(%rip), %rdx      # 0x5ea6
testq %rax, %rax
je 0x3d0f
movq %rbx, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq *0x50(%rbx)
incq %r14
jmp 0x3cb1
movq %rbx, %rdi
movl %r13d, %esi
callq *0x40(%rbx)
movq %rbx, %rdi
movl %r12d, %esi
callq *0x40(%rbx)
jmp 0x3d46
leaq 0x20fe(%rip), %rdx      # 0x5e2d
jmp 0x3d38
leaq 0x2154(%rip), %rdx      # 0x5e8c
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq *0x50(%rbx)
movq %rax, %r15
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17ce(%rip), %rdi      # 0x552d
leaq 0x1b25(%rip), %rsi      # 0x588b
leaq 0x2085(%rip), %rcx      # 0x5df2
movl $0x170, %edx            # imm = 0x170
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_calloc_or_die
void *eweb_calloc_or_die(eweb_os_t *w, const size_t num, const size_t size) {
	assert(w);
	assert(!(w->allocation_error));
	void *mem = w->allocator.malloc(w->allocator.arena, num * size); /**@todo check for overflow! */
	if (!mem) {
		w->allocation_error = 1;
		w->log(w, EWEB_ERROR, "calloc failed [%zu x %zu] bytes", num, size);
		w->exit(w, 1);
	}
	memset(mem, 0, num * size);
	return mem;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3df9
movq %rdi, %rbx
testb $0x1, 0x98(%rdi)
jne 0x3e18
movq %rdx, %r15
movq %rsi, %r12
movq 0x18(%rbx), %rdi
movq %rdx, %r14
imulq %rsi, %r14
movq %r14, %rsi
callq *(%rbx)
movq %rax, %r13
testq %rax, %rax
jne 0x3dde
orb $0x1, 0x98(%rbx)
leaq 0x2282(%rip), %rdx      # 0x6045
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rcx
movq %r15, %r8
xorl %eax, %eax
callq *0x50(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq *0x58(%rbx)
movq %r13, %rdi
xorl %esi, %esi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
leaq 0x172d(%rip), %rdi      # 0x552d
leaq 0x1a84(%rip), %rsi      # 0x588b
leaq 0x21f5(%rip), %rcx      # 0x6003
movl $0x1f3, %edx            # imm = 0x1F3
callq 0x20e0
leaq 0x215f(%rip), %rdi      # 0x5f7e
leaq 0x1a65(%rip), %rsi      # 0x588b
leaq 0x21d6(%rip), %rcx      # 0x6003
movl $0x1f4, %edx            # imm = 0x1F4
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_url_decode
int eweb_url_decode(eweb_os_t *w, char *s) {
	assert(s);
	const size_t len = strlen(s);
	char *s_copy = eweb_calloc_or_die(w, 1, len + 1);
	if (!s_copy)
		return EWEB_ERROR;
	char *ptr = s_copy;

	for (size_t i = 0; i < len; i++) {
		if (s[i] == '+') {
			*ptr++ = ' ';
		} else if ((s[i] != '%') || (!isxdigit(s[i + 1]) || !isxdigit(s[i + 2]))) {
			*ptr++ = s[i];
		} else {
			*ptr++ = ((eweb_decode_char(s[i + 1]) << 4) | eweb_decode_char(s[i + 2]));
			i += 2;
		}
	}
	*ptr = 0;
	memcpy(s, s_copy, len + 1);
	eweb_free(w, s_copy);
	return EWEB_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rsi, %rsi
je 0x3f3f
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x20b0
movq %rax, 0x8(%rsp)
leaq 0x1(%rax), %r15
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x3d77
testq %rax, %rax
je 0x3f2d
movq %r15, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
xorl %r15d, %r15d
movq %rax, 0x10(%rsp)
movq %rax, %r12
movq 0x8(%rsp), %rbx
cmpq %rbx, %r15
jae 0x3f02
movzbl (%r14,%r15), %ebp
cmpl $0x2b, %ebp
je 0x3ef3
cmpl $0x25, %ebp
jne 0x3ef6
callq 0x2320
movq (%rax), %rcx
movsbq 0x1(%r14,%r15), %rax
testb $0x10, 0x1(%rcx,%rax,2)
je 0x3ef6
movsbq 0x2(%r14,%r15), %r13
testb $0x10, 0x1(%rcx,%r13,2)
je 0x3ef6
addq $0x2, %r15
movsbl %al, %edi
callq 0x3f5e
movl %eax, %ebx
shlb $0x4, %bl
movsbl %r13b, %edi
callq 0x3f5e
movl %eax, %ebp
orb %bl, %bpl
movq 0x8(%rsp), %rbx
jmp 0x3ef6
movb $0x20, %bpl
movb %bpl, (%r12)
incq %r12
incq %r15
jmp 0x3e96
movb $0x0, (%r12)
movq %r14, %rdi
movq 0x10(%rsp), %rbx
movq %rbx, %rsi
movq 0x18(%rsp), %rdx
callq 0x21b0
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x3f84
xorl %eax, %eax
jmp 0x3f30
pushq $0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2436(%rip), %rdi      # 0x637c
leaq 0x193e(%rip), %rsi      # 0x588b
leaq 0x1f64(%rip), %rcx      # 0x5eb8
movl $0x1a2, %edx            # imm = 0x1A2
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_free
void eweb_free(eweb_os_t *w, void *ptr) {
	assert(w);
	if (!ptr)
		return;
	w->allocator.free(w->allocator.arena, ptr);
}

// Assembly:
testq %rdi, %rdi
je 0x3f99
testq %rsi, %rsi
je 0x3f98
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %rdi
jmpq *%rax
retq
pushq %rax
leaq 0x158c(%rip), %rdi      # 0x552d
leaq 0x18e3(%rip), %rsi      # 0x588b
leaq 0x20b6(%rip), %rcx      # 0x6065
movl $0x200, %edx            # imm = 0x200
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_form_value
char *eweb_form_value(eweb_os_hit_args_t *args, const long i) {
	assert(args);
	if (i >= args->form_value_counter || i < 0)
		return NULL;
	return args->form_values[i].value;
}

// Assembly:
testq %rdi, %rdi
je 0x3fd9
xorl %eax, %eax
testq %rsi, %rsi
js 0x3fd8
cmpq %rsi, 0x30(%rdi)
jle 0x3fd8
movq 0x20(%rdi), %rax
imulq $0x18, %rsi, %rcx
movq 0x8(%rax,%rcx), %rax
retq
pushq %rax
leaq 0x195b(%rip), %rdi      # 0x593c
leaq 0x18a3(%rip), %rsi      # 0x588b
leaq 0x1ef2(%rip), %rcx      # 0x5ee1
movl $0x1bf, %edx            # imm = 0x1BF
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_form_name
char *eweb_form_name(eweb_os_hit_args_t *args, const long i) {
	assert(args);
	if (i >= args->form_value_counter || i < 0)
		return NULL;
	return args->form_values[i].name;
}

// Assembly:
testq %rdi, %rdi
je 0x4018
xorl %eax, %eax
testq %rsi, %rsi
js 0x4017
cmpq %rsi, 0x30(%rdi)
jle 0x4017
movq 0x20(%rdi), %rax
imulq $0x18, %rsi, %rcx
movq (%rax,%rcx), %rax
retq
pushq %rax
leaq 0x191c(%rip), %rdi      # 0x593c
leaq 0x1864(%rip), %rsi      # 0x588b
leaq 0x1eeb(%rip), %rcx      # 0x5f19
movl $0x1c6, %edx            # imm = 0x1C6
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_realloc_or_die
void *eweb_realloc_or_die(eweb_os_t *w, void *ptr, size_t num_bytes) {
	assert(w);
	assert(!(w->allocation_error));
	void *mem = w->allocator.realloc(w->allocator.arena, ptr, num_bytes);
	if (!mem) {
		w->allocation_error = 1;
		w->log(w, EWEB_ERROR, "realloc of %zu bytes failed", num_bytes);
		w->exit(w, 1);
	}
	return mem;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x4096
movq %rdi, %rbx
testb $0x1, 0x98(%rdi)
jne 0x40b5
movq %rdx, %r14
movq 0x18(%rbx), %rdi
callq *0x8(%rbx)
movq %rax, %r15
testq %rax, %rax
jne 0x4088
orb $0x1, 0x98(%rbx)
leaq 0x1f77(%rip), %rdx      # 0x5fe7
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rcx
xorl %eax, %eax
callq *0x50(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
callq *0x58(%rbx)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1490(%rip), %rdi      # 0x552d
leaq 0x17e7(%rip), %rsi      # 0x588b
leaq 0x1f05(%rip), %rcx      # 0x5fb0
movl $0x1e7, %edx            # imm = 0x1E7
callq 0x20e0
leaq 0x1ec2(%rip), %rdi      # 0x5f7e
leaq 0x17c8(%rip), %rsi      # 0x588b
leaq 0x1ee6(%rip), %rcx      # 0x5fb0
movl $0x1e8, %edx            # imm = 0x1E8
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: badd
static int badd(eweb_os_t *w, block_t *b, const void *data, const long len) {
	assert(b);
	assert(data);
	if ((b->alloc_bytes - b->used_bytes) < len) {
		while ((b->alloc_bytes - b->used_bytes) < len) // !?
			b->alloc_bytes += (b->chunk_size * b->elem_bytes);
		void *p = b->ptr;
		if (!(p = eweb_realloc_or_die(w, b->ptr, b->alloc_bytes)))
			return EWEB_ERROR;
		b->ptr = p;
	}
	memcpy((char*)b->ptr + b->used_bytes, data, len);
	b->used_bytes += len;
	memset((char*)b->ptr + b->used_bytes, 0, b->alloc_bytes - b->used_bytes);
	return EWEB_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdx, %rdx
je 0x4171
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rax
movq 0x8(%rsi), %rdx
movq 0x10(%rsi), %rdi
movq %rdx, %rcx
subq %rdi, %rcx
cmpq %rbx, %rcx
jl 0x4116
movq (%r14), %rax
jmp 0x4138
movq 0x18(%r14), %rcx
imulq 0x20(%r14), %rcx
addq %rcx, %rdx
movq %rdx, 0x8(%r14)
movq %rdx, %rcx
subq %rdi, %rcx
cmpq %rbx, %rcx
jl 0x4106
movq (%r14), %rsi
movq %rax, %rdi
callq 0x4038
testq %rax, %rax
je 0x416c
movq %rax, (%r14)
movq 0x10(%r14), %rdi
addq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x21b0
addq 0x10(%r14), %rbx
movq %rbx, 0x10(%r14)
movq (%r14), %rdi
addq %rbx, %rdi
movq 0x8(%r14), %rdx
subq %rbx, %rdx
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x2100
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
pushq $0x1
popq %rbx
jmp 0x4164
leaq 0x20e9(%rip), %rdi      # 0x6261
leaq 0x170c(%rip), %rsi      # 0x588b
leaq 0x20a0(%rip), %rcx      # 0x6226
movl $0x214, %edx            # imm = 0x214
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_clear_form_values
static int eweb_clear_form_values(eweb_os_t *w, eweb_os_hit_args_t *args) {
	assert(args);
	if (!args->form_values)
		return EWEB_OK;
	for (args->form_value_counter--; args->form_value_counter >= 0; args->form_value_counter--)
		eweb_free(w, args->form_values[args->form_value_counter].data);
	eweb_free(w, args->form_values);
	args->form_values = NULL;
	return EWEB_OK;
}

// Assembly:
cmpq $0x0, 0x20(%rsi)
je 0x41dd
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x20(%rbx), %rsi
movq 0x30(%rbx), %rcx
leaq -0x1(%rcx), %rax
movq %rax, 0x30(%rbx)
testq %rcx, %rcx
jle 0x41c9
imulq $0x18, %rax, %rax
movq 0x10(%rsi,%rax), %rsi
movq %r14, %rdi
callq 0x3f84
jmp 0x41a1
movq %r14, %rdi
callq 0x3f84
andq $0x0, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/eweb.c
// Function: eweb_strtok
static char *eweb_strtok(char *restrict s, const char *restrict sep, char **restrict p) {
	if (!s && !(s = *p))
		return NULL;
	s += strspn(s, sep);
	if (!*s)
		return *p = 0;
	*p = s + strcspn(s, sep);
	if (**p)
		*(*p)++ = 0;
	else
		*p = 0;
	return s;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x41f5
movq (%r14), %rbx
testq %rbx, %rbx
je 0x4235
leaq 0x1fda(%rip), %rsi      # 0x61d6
movq %rbx, %rdi
callq 0x2120
cmpb $0x0, (%rbx,%rax)
je 0x4231
addq %rax, %rbx
leaq 0x1fc2(%rip), %rsi      # 0x61d6
movq %rbx, %rdi
callq 0x2140
cmpb $0x0, (%rbx,%rax)
je 0x4239
addq %rbx, %rax
leaq 0x1(%rax), %rcx
movq %rcx, (%r14)
movb $0x0, (%rax)
jmp 0x423d
andq $0x0, (%r14)
xorl %ebx, %ebx
jmp 0x423d
andq $0x0, (%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/unix.c
// Function: eweb_accept
static long eweb_accept(eweb_os_t *w, int listenfd) {
	assert(w);
	struct sockaddr_in cli_addr = { 0 };
	if (doing_shutdown)
		return -1;
	socklen_t length = sizeof(cli_addr);
	errno = 0;
	const int socketfd = accept(listenfd, (struct sockaddr *)&cli_addr, &length);
	if (socketfd < 0) {
		w->log(w, EWEB_ERROR, "accept failed: %s", strerror(errno));
		return socketfd;
	}

	struct timeval timeout = { .tv_sec = 60, .tv_usec = 0 };
	errno = 0;
	if (setsockopt(socketfd, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(struct timeval)) < 0) {
		w->log(w, EWEB_ERROR, "setsocketopt(SO_RCVTIMEO) failed: %s", strerror(errno));
		w->close(w, socketfd);
		return -1;
	}
	return socketfd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
testq %rdi, %rdi
je 0x44b9
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
cmpl $0x0, 0x4dbf(%rip)      # 0x91b4
je 0x4405
pushq $-0x1
popq %rax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %esi, %ebp
movq %rdi, %rbx
leaq 0xc(%rsp), %r15
movl $0x10, (%r15)
callq 0x2050
movq %rax, %r14
andl $0x0, (%rax)
leaq 0x10(%rsp), %rsi
movl %ebp, %edi
movq %r15, %rdx
callq 0x2290
movl %eax, %ebp
testl %eax, %eax
js 0x4462
movups 0x211b(%rip), %xmm0     # 0x6558
leaq 0x20(%rsp), %rcx
movaps %xmm0, (%rcx)
andl $0x0, (%r14)
pushq $0x1
popq %rsi
pushq $0x14
popq %rdx
pushq $0x10
popq %r8
movl %ebp, %edi
callq 0x2090
testl %eax, %eax
js 0x448b
movl %ebp, %eax
jmp 0x43fa
movq 0x50(%rbx), %r15
movl (%r14), %edi
callq 0x22d0
leaq 0x1ed2(%rip), %rdx      # 0x6347
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq *%r15
movslq %ebp, %rax
jmp 0x43fa
movq 0x50(%rbx), %r15
movl (%r14), %edi
callq 0x22d0
leaq 0x1ebb(%rip), %rdx      # 0x6359
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq *%r15
movq %rbx, %rdi
movl %ebp, %esi
callq *0x40(%rbx)
jmp 0x43f7
leaq 0x106d(%rip), %rdi      # 0x552d
leaq 0x1db1(%rip), %rsi      # 0x6278
leaq 0x1e56(%rip), %rcx      # 0x6324
pushq $0x7b
popq %rdx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/unix.c
// Function: eweb_sleep
static long eweb_sleep(eweb_os_t *w, unsigned seconds) {
	assert(w);
	UNUSED(w);
	long i = seconds;
	while((i = sleep(i)));
	return EWEB_OK;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x4586
movl %esi, %eax
movl %eax, %edi
callq 0x22e0
testl %eax, %eax
jne 0x4577
xorl %eax, %eax
popq %rcx
retq
leaq 0xfa0(%rip), %rdi       # 0x552d
leaq 0x1ce4(%rip), %rsi      # 0x6278
leaq 0x1e6e(%rip), %rcx      # 0x6409
movl $0xb5, %edx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/unix.c
// Function: eweb_log
static long eweb_log(eweb_os_t *w, int error, const char *fmt, ...) {
	assert(w);
	FILE *output = w->file ? w->file : stderr;
	va_list ap;
	va_start(ap, fmt);
	fprintf(output, "%d: ", error);
	vfprintf(output, fmt, ap);
	fputc('\n', output);
	va_end(ap);
	fflush(output);
	return error;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x45fd
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
testq %rdi, %rdi
je 0x468f
movq %rdx, %r14
movl %esi, %ebx
movq 0x88(%rdi), %r15
testq %r15, %r15
jne 0x4621
movq 0x49d2(%rip), %rax      # 0x8ff0
movq (%rax), %r15
leaq 0x20(%rsp), %rax
movq %rsp, %r12
movq %rax, 0x10(%r12)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%r12)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%r12)
leaq 0x1e17(%rip), %rsi      # 0x6467
movq %r15, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x2190
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2280
pushq $0xa
popq %rdi
movq %r15, %rsi
callq 0x2130
movq %r15, %rdi
callq 0x21e0
movslq %ebx, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xe97(%rip), %rdi       # 0x552d
leaq 0x1bdb(%rip), %rsi      # 0x6278
leaq 0x1d90(%rip), %rcx      # 0x6434
pushq $0x2a
popq %rdx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/unix.c
// Function: eweb_init
static long eweb_init(eweb_os_t *w) {
	UNUSED(w);
#ifndef SIGCLD
	signal(SIGCHLD, SIG_IGN);
#else
	signal(SIGCLD, SIG_IGN);
#endif
	signal(SIGHUP,  SIG_IGN); /* ignore terminal hangups */
	signal(SIGPIPE, SIG_IGN); /* ignore broken pipes */
	return 0;
}

// Assembly:
pushq %rbx
pushq $0x11
popq %rdi
pushq $0x1
popq %rbx
movq %rbx, %rsi
callq 0x2180
pushq $0x1
popq %rdi
movq %rbx, %rsi
callq 0x2180
pushq $0xd
popq %rdi
movq %rbx, %rsi
callq 0x2180
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/unix.c
// Function: eweb_thread_new
static long eweb_thread_new(eweb_os_t *w, eweb_os_hit_args_t *args) {
	assert(w);
	assert(args);
	if (w->threading_mode == EWEB_TM_SINGLE_THREAD_E) { /**@todo allow configurable mode selection */
		return eweb_hit(w, args);
	} else if (w->threading_mode == EWEB_TM_MULTI_PROCESS_E) {
		errno = 0;
		const int pid = fork();
		if (pid < 0)
			return w->log(w, EWEB_ERROR, "failed to fork(): %d", strerror(errno));
		if (pid == 0) { /* child */
			close(args->listenfd);
			return eweb_hit(w, args); /* never returns */
		}
		close(args->socketfd);
	} else if (w->threading_mode == EWEB_TM_MULTI_THREADS_E) {
		pthread_t thread_id; /** ??? */
		if (pthread_create(&thread_id, NULL, eweb_thread_main, args) != 0)
			return w->log(w, EWEB_ERROR, "failed to create thread");
	} else {
		w->log(w, EWEB_ERROR, "invalid threading MODE: %u", w->threading_mode);
		abort();
	}
	return EWEB_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x480a
movq %rsi, %r14
testq %rsi, %rsi
je 0x4829
movq %rdi, %rbx
movl 0x98(%rdi), %eax
shrl %eax
andl $0x3, %eax
leaq 0x1b0c(%rip), %rcx      # 0x6268
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3423
cltq
jmp 0x47c5
callq 0x2050
movq %rax, %r15
andl $0x0, (%rax)
callq 0x22f0
testl %eax, %eax
js 0x47cf
je 0x47fc
movl 0x40(%r14), %edi
callq 0x2110
jmp 0x47c3
leaq 0x1f4(%rip), %rdx       # 0x4990
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
movq %r14, %rcx
callq 0x2240
testl %eax, %eax
je 0x47c3
leaq 0x1d41(%rip), %rdx      # 0x64f7
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq *0x50(%rbx)
jmp 0x47c5
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x50(%rbx), %r14
movl (%r15), %edi
callq 0x22d0
leaq 0x1d00(%rip), %rdx      # 0x64e2
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
movq %r14, %r8
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmpq *%r8
movl 0x44(%r14), %edi
callq 0x2110
jmp 0x4765
leaq 0xd1c(%rip), %rdi       # 0x552d
leaq 0x1a60(%rip), %rsi      # 0x6278
leaq 0x1c8b(%rip), %rcx      # 0x64aa
movl $0xd2, %edx
callq 0x20e0
leaq 0x110c(%rip), %rdi      # 0x593c
leaq 0x1a41(%rip), %rsi      # 0x6278
leaq 0x1c6c(%rip), %rcx      # 0x64aa
movl $0xd3, %edx
callq 0x20e0
leaq 0x1cc0(%rip), %rdx      # 0x650f
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %eax, %eax
callq *0x50(%rbx)
callq 0x2040
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/unix.c
// Function: eweb_thread_exit
static long eweb_thread_exit(eweb_os_t *w, int exit_code) {
	assert(w);
	UNUSED(w);
	if (w->threading_mode == EWEB_TM_MULTI_PROCESS_E) {
		w->exit(w, exit_code);
	} else if (w->threading_mode == EWEB_TM_MULTI_THREADS_E) {
		UNUSED(exit_code);
		pthread_exit(NULL);
	} else {
		UNUSED(exit_code);
	}
	return EWEB_OK;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x488a
movl 0x98(%rdi), %eax
shrl %eax
andl $0x3, %eax
cmpl $0x2, %eax
je 0x4883
cmpl $0x3, %eax
jne 0x4886
xorl %edi, %edi
callq 0x21c0
callq *0x58(%rdi)
xorl %eax, %eax
popq %rcx
retq
leaq 0xc9c(%rip), %rdi       # 0x552d
leaq 0x19e0(%rip), %rsi      # 0x6278
leaq 0x1c8b(%rip), %rcx      # 0x652a
movl $0xbd, %edx
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/unix.c
// Function: eweb_os_new
eweb_os_t *eweb_os_new(eweb_allocator_t *allocator, eweb_threading_mode_e mode) {
	eweb_os_t *w = NULL;
	const eweb_allocator_t *a = allocator ? allocator : &eweb_os_default_allocator;
	w = a->malloc(a->arena, sizeof(*w));
	if (!w)
		return w;
	memset(w, 0, sizeof(*w));
	*w = eweb_os;
	w->file = stderr;
	w->allocator = *a;
	switch (mode) {
	case EWEB_TM_SINGLE_THREAD_E: break;
	case EWEB_TM_MULTI_PROCESS_E: break;
	default: /* fall through */
	case EWEB_TM_MULTI_THREADS_E:
		mode = EWEB_TM_MULTI_THREADS_E;
		break;
	}
	w->threading_mode = mode;
	return w;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
testq %rdi, %rdi
leaq 0x44f9(%rip), %r15      # 0x8dc0
cmovneq %rdi, %r15
movq 0x18(%r15), %rdi
movl $0xa0, %esi
callq *(%r15)
movq %rax, %r14
testq %rax, %rax
je 0x4931
leaq 0x443a(%rip), %rsi      # 0x8d20
movl $0xa0, %edx
movq %r14, %rdi
callq 0x21b0
movq 0x46f6(%rip), %rax      # 0x8ff0
movq (%rax), %rax
movq %rax, 0x88(%r14)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
leal -0x1(%rbx), %eax
addb %bl, %bl
andb $0x6, %bl
cmpl $0x2, %eax
movzbl %bl, %eax
pushq $0x6
popq %rcx
cmovbl %eax, %ecx
movb %cl, 0x98(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/unix.c
// Function: inthandler
static void inthandler(int sig) {
	if (doing_shutdown == 1)
		return;
	doing_shutdown = 1;
	fputs("web-server shutting down\n", stderr); // !!
	close(listenfd);
	if (sig != SIGUSR1)
		exit(0);
}

// Assembly:
pushq %rbx
movl 0x4860(%rip), %eax      # 0x91b4
cmpl $0x1, %eax
jne 0x495b
popq %rbx
retq
movl %edi, %ebx
movl $0x1, 0x484d(%rip)      # 0x91b4
movq 0x4682(%rip), %rax      # 0x8ff0
movq (%rax), %rsi
leaq 0x1992(%rip), %rdi      # 0x630a
callq 0x20f0
xorl %edi, %edi
callq 0x2110
cmpl $0xa, %ebx
je 0x4959
xorl %edi, %edi
callq 0x22b0
// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/unix.c
// Function: eweb_thread_main
static void *eweb_thread_main(void *targs) {
	eweb_os_hit_args_t *args = (struct eweb_os_hit_args *)targs;
	pthread_detach(pthread_self());
	eweb_hit(args->w, args);
	return NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2250
movq %rax, %rdi
callq 0x21f0
movq 0x48(%rbx), %rdi
movq %rbx, %rsi
callq 0x3423
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/silverneko[P]miku/isolate/isolate.c
// Function: set_dir_action
static int set_dir_action(char *arg)
{
  arg = xstrdup(arg);

  char *colon = strchr(arg, ':');
  unsigned int flags = 0;
  while (colon)
    {
      *colon++ = 0;
      char *next = strchr(colon, ':');
      if (next)
	*next = 0;
      flags |= parse_dir_option(colon);
      colon = next;
    }

  char *eq = strchr(arg, '=');
  if (eq)
    {
      *eq++ = 0;
      return add_dir_rule(arg, (*eq ? eq : NULL), flags);
    }
  else
    {
      char *out = xmalloc(1 + strlen(arg) + 1);
      sprintf(out, "/%s", arg);
      return add_dir_rule(arg, out, flags);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x3791
pushq $0x3a
popq %rsi
movq %rax, (%rsp)
movq %rax, %rdi
callq 0x21f0
movq %rax, %r15
xorl %r14d, %r14d
leaq 0x1bf7(%rip), %rbp      # 0x5108
testq %r15, %r15
je 0x3569
movb $0x0, (%r15)
incq %r15
movq %r15, %rdi
pushq $0x3a
popq %rsi
callq 0x21f0
movq %rax, %r12
testq %rax, %rax
je 0x3535
movb $0x0, (%r12)
movq %rbp, %r13
xorl %ebx, %ebx
cmpq $0x5, %rbx
je 0x35d7
movslq (%r13), %rsi
addq %rbp, %rsi
movq %r15, %rdi
callq 0x22f0
testl %eax, %eax
je 0x3560
incq %rbx
addq $0x4, %r13
jmp 0x353a
btsl %ebx, %r14d
movq %r12, %r15
jmp 0x3511
pushq $0x3d
popq %rsi
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x21f0
testq %rax, %rax
je 0x3593
movq %rax, %rcx
incq %rcx
movb $0x0, (%rax)
xorl %r15d, %r15d
cmpb $0x0, 0x1(%rax)
cmovneq %rcx, %r15
jmp 0x35bb
movq %rbx, %rdi
callq 0x2180
leaq 0x2(%rax), %rdi
callq 0x386e
movq %rax, %r15
leaq 0x1fb3(%rip), %rsi      # 0x5561
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2460
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x37ac
leaq 0x1d7f(%rip), %rdi      # 0x535d
movq %r15, %rsi
xorl %eax, %eax
callq 0x3696
// File: /workspace/github_c_makefile_star2_O2/silverneko[P]miku/isolate/isolate.c
// Function: xstrdup
static char *
xstrdup(char *str)
{
  char *p = strdup(str);
  if (!p)
    die("Out of memory");
  return p;
}

// Assembly:
pushq %rax
callq 0x2490
testq %rax, %rax
je 0x379e
popq %rcx
retq
leaq 0x1baa(%rip), %rdi      # 0x534f
xorl %eax, %eax
callq 0x3696
// File: /workspace/github_c_makefile_star2_O2/silverneko[P]miku/isolate/isolate.c
// Function: add_dir_rule
static int add_dir_rule(char *in, char *out, unsigned int flags)
{
  // Make sure that "in" is relative
  while (in[0] == '/')
    in++;
  if (!*in)
    return 0;

  // Check "out"
  if (flags & DIR_FLAG_FS)
    {
      if (!out || out[0] == '/')
	return 0;
    }
  else
    {
      if (out && out[0] != '/' && strncmp(out, "./", 2))
	return 0;
    }

  // Override an existing rule
  struct dir_rule *r;
  for (r = first_dir_rule; r; r = r->next)
    if (!strcmp(r->inside, in))
      break;

  // Add a new rule
  if (!r)
    {
      r = xmalloc(sizeof(*r));
      r->inside = in;
      *last_dir_rule = r;
      last_dir_rule = &r->next;
      r->next = NULL;
    }
  r->outside = out;
  r->flags = flags;
  return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movzbl (%r15), %eax
cmpl $0x2f, %eax
jne 0x37ca
incq %r15
jmp 0x37bc
testl %eax, %eax
jne 0x37d5
xorl %eax, %eax
jmp 0x3862
testb $0x4, %bl
jne 0x37f8
testq %r14, %r14
je 0x3805
movzbl (%r14), %ecx
cmpl $0x2f, %ecx
je 0x3805
xorl %eax, %eax
cmpl $0x2e, %ecx
jne 0x3862
cmpb $0x2f, 0x1(%r14)
je 0x3805
jmp 0x3862
xorl %eax, %eax
testq %r14, %r14
je 0x3862
cmpb $0x2f, (%r14)
je 0x3862
leaq 0x5b24(%rip), %r12      # 0x9330
movq (%r12), %r12
testq %r12, %r12
je 0x382b
movq (%r12), %rdi
movq %r15, %rsi
callq 0x22f0
testl %eax, %eax
je 0x3855
addq $0x18, %r12
jmp 0x380c
pushq $0x20
popq %rdi
callq 0x386e
movq %rax, %r12
movq %r15, (%rax)
movq 0x5a38(%rip), %rax      # 0x9278
movq %r12, (%rax)
leaq 0x18(%r12), %rax
movq %rax, 0x5a29(%rip)      # 0x9278
andq $0x0, 0x18(%r12)
movq %r14, 0x8(%r12)
movl %ebx, 0x10(%r12)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/silverneko[P]miku/isolate/isolate.c
// Function: xmalloc
static void *
xmalloc(size_t size)
{
  void *p = malloc(size);
  if (!p)
    die("Out of memory");
  return p;
}

// Assembly:
pushq %rax
callq 0x2360
testq %rax, %rax
je 0x387b
popq %rcx
retq
leaq 0x1acd(%rip), %rdi      # 0x534f
xorl %eax, %eax
callq 0x3696
// File: /workspace/github_c_makefile_star2_O2/silverneko[P]miku/isolate/isolate.c
// Function: box_exit
static void NONRET
box_exit(int rc)
{
  if (box_pid > 0)
    {
      kill(-box_pid, SIGKILL);
      kill(box_pid, SIGKILL);
      meta_printf("killed:1\n");

      struct rusage rus;
      int p, stat;
      do
	p = wait4(box_pid, &stat, 0, &rus);
      while (p < 0 && errno == EINTR);
      if (p < 0)
	fprintf(stderr, "UGH: Lost track of the process (%m)\n");
      else
	final_stats(&rus);
    }

  if (rc < 2 && cleanup_ownership)
    {
      chowntree("box", orig_uid, orig_gid);
    }

  meta_close();
  exit(rc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movl %edi, %ebx
movl 0x59eb(%rip), %edi      # 0x9350
testl %edi, %edi
jle 0x39d3
negl %edi
pushq $0x9
popq %rbp
movl %ebp, %esi
callq 0x2340
movl 0x59d5(%rip), %edi      # 0x9350
movl %ebp, %esi
callq 0x2340
leaq 0x1a74(%rip), %rdi      # 0x53fd
xorl %eax, %eax
callq 0x38b1
leaq 0x4(%rsp), %r14
leaq 0x8(%rsp), %r15
movl 0x59b0(%rip), %edi      # 0x9350
movq %r14, %rsi
xorl %edx, %edx
movq %r15, %rcx
callq 0x23f0
testl %eax, %eax
jns 0x39fe
callq 0x2060
cmpl $0x4, (%rax)
je 0x399a
movq 0x5636(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x1a3b(%rip), %rsi      # 0x5407
xorl %eax, %eax
callq 0x2300
cmpl $0x1, %ebx
jg 0x39f2
testb $0x1, 0x5975(%rip)      # 0x9354
je 0x39f2
movl 0x5941(%rip), %edi      # 0x9328
movl 0x593f(%rip), %esi      # 0x932c
callq 0x3b12
callq 0x3b37
movl %ebx, %edi
callq 0x2470
leaq 0x8(%rsp), %rdi
callq 0x3a0a
jmp 0x39d3
// File: /workspace/github_c_makefile_star2_O2/silverneko[P]miku/isolate/isolate.c
// Function: final_stats
static void
final_stats(struct rusage *rus)
{
  total_ms = get_run_time_ms(rus);
  wall_ms = get_wall_time_ms();

  meta_printf("time:%d.%03d\n", total_ms/1000, total_ms%1000);
  meta_printf("time-wall:%d.%03d\n", wall_ms/1000, wall_ms%1000);
  meta_printf("max-rss:%ld\n", rus->ru_maxrss);
  meta_printf("csw-voluntary:%ld\n", rus->ru_nvcsw);
  meta_printf("csw-forced:%ld\n", rus->ru_nivcsw);

  cg_stats();
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %rbx
callq 0x3b54
movl %eax, 0x5937(%rip)      # 0x9358
callq 0x3d3a
movl %eax, 0x5930(%rip)      # 0x935c
movl 0x5926(%rip), %eax      # 0x9358
movl $0x3e8, %ebp            # imm = 0x3E8
cltd
idivl %ebp
leaq 0x19eb(%rip), %rdi      # 0x542c
movl %eax, %esi
xorl %eax, %eax
callq 0x38b1
movl 0x590c(%rip), %eax      # 0x935c
cltd
idivl %ebp
leaq 0x19e0(%rip), %rdi      # 0x543a
movl %eax, %esi
xorl %eax, %eax
callq 0x38b1
movq 0x20(%rbx), %rsi
leaq 0x19df(%rip), %rdi      # 0x544d
xorl %eax, %eax
callq 0x38b1
movq 0x80(%rbx), %rsi
leaq 0x19d7(%rip), %rdi      # 0x545a
xorl %eax, %eax
callq 0x38b1
movq 0x88(%rbx), %rsi
leaq 0x19d5(%rip), %rdi      # 0x546d
xorl %eax, %eax
callq 0x38b1
cmpb $0x1, 0x582a(%rip)      # 0x92d0
jne 0x3b08
leaq 0x1af4(%rip), %rsi      # 0x55a3
xorl %ebx, %ebx
movq %rsp, %rdx
xorl %edi, %edi
callq 0x3d8b
testl %eax, %eax
je 0x3aca
movq %rsp, %rdi
callq 0x22e0
movq %rax, %rbx
leaq 0x1aed(%rip), %rsi      # 0x55be
movq %rsp, %rdx
xorl %edi, %edi
callq 0x3d8b
testl %eax, %eax
je 0x3aee
movq %rsp, %rdi
callq 0x22e0
cmpq %rbx, %rax
cmovaq %rax, %rbx
testq %rbx, %rbx
je 0x3b08
shrq $0xa, %rbx
leaq 0x1ae1(%rip), %rdi      # 0x55df
movq %rbx, %rsi
xorl %eax, %eax
callq 0x38b1
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %rbp
retq