// File: /workspace/github_c_makefile_star2_O2/howerj[P]eweb/main.c
// Function: main
int main(int argc, char **argv) {
	eweb_getopt_t opt = { .init = 0, .error = 1 };
	int ch = -1;
	unsigned port = 8080;
	eweb_threading_mode_e mode = EWEB_TM_MULTI_THREADS_E;
	while ((ch = eweb_getopt(&opt, argc, argv, "hp:m:")) != -1) {
		switch (ch) {
		case 'h': return help(argv[0]); break;
		case 'p': port = atoi(opt.arg); break;
		case 'm': mode = resolve_mode(opt.arg); break;
		default:
			  help(argv[0]);
			  return EXIT_FAILURE;
		}
	}
	if (opt.index != argc) {
		fprintf(stderr, "Unexpected extra arguments\n");
		help(argv[0]);
		return EXIT_FAILURE;
	}
	eweb_os_t *w = eweb_os_new(NULL, mode);
	if (!w) {
		fprintf(stderr, "os allocation failed\n");
		return EXIT_FAILURE;
	}

	w->log(w, EWEB_OK, "hit CTRL-C to terminate");
	const int r = eweb_server(w, port, send_response) == EWEB_OK ? EXIT_SUCCESS : EXIT_FAILURE;
	eweb_os_delete(w);
	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, 0x4(%rsp)
movq %rsi, 0x8(%rsp)
testq %rsi, %rsi
je 0x2719
pushq $0x3
popq %rbp
movl $0x1f90, 0x14(%rsp)     # imm = 0x1F90
movb $0x1, %r12b
xorl %r15d, %r15d
leaq 0x3019(%rip), %rbx      # 0x548d
xorl %r13d, %r13d
testb $0x1, %r12b
pushq $0x1
popq %rax
cmovnel %eax, %r15d
cmovneq %rbx, %r13
movb (%r13), %r12b
testb %r12b, %r12b
jne 0x24d0
cmpl 0x4(%rsp), %r15d
jge 0x2618
movslq %r15d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %r13
cmpb $0x2d, (%r13)
jne 0x2618
movzbl 0x1(%r13), %eax
movb $0x2d, %r12b
testl %eax, %eax
je 0x25c4
cmpl $0x2d, %eax
je 0x2666
incq %r13
movl %eax, %r12d
cmpb $0x3a, %r12b
je 0x26a7
movsbl %r12b, %r14d
leaq 0x2b1f(%rip), %rdi      # 0x5004
movl %r14d, %esi
pushq $0x6
popq %rdx
callq 0x2150
testq %rax, %rax
je 0x260e
incq %r13
cmpb $0x3a, 0x1(%rax)
movb (%r13), %al
jne 0x252f
testb %al, %al
jne 0x2524
incl %r15d
cmpl 0x4(%rsp), %r15d
jge 0x26e7
movslq %r15d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %r13
movq %r13, %r14
incl %r15d
movq %rbx, %r13
jmp 0x2538
cmpb $0x1, %al
adcl $0x0, %r15d
xorl %r14d, %r14d
cmpb $0x6d, %r12b
jne 0x25cd
testq %r14, %r14
je 0x26fa
movq %r14, %rdi
leaq 0x3fb3(%rip), %rsi      # 0x6508
callq 0x2170
xorl %r12d, %r12d
pushq $0x3
popq %rbp
testl %eax, %eax
je 0x2477
movq %r14, %rdi
leaq 0x2f89(%rip), %rsi      # 0x54fb
callq 0x2170
xorl %r12d, %r12d
pushq $0x2
popq %rbp
testl %eax, %eax
je 0x2477
movq %r14, %rdi
leaq 0x2f71(%rip), %rsi      # 0x5500
callq 0x2170
xorl %r12d, %r12d
pushq $0x1
popq %rbp
testl %eax, %eax
je 0x2477
movq 0x6a27(%rip), %rax      # 0x8fd0
movq (%rax), %rdi
leaq 0x2f54(%rip), %rsi      # 0x5507
movq %r14, %rdx
xorl %eax, %eax
callq 0x2190
xorl %ebp, %ebp
jmp 0x2477
pushq $0x2d
popq %r14
jmp 0x24de
movzbl %r12b, %eax
cmpl $0xff, %eax
je 0x2618
cmpl $0x70, %eax
jne 0x25f1
movq %r14, %rdi
callq 0x22a0
movl %eax, 0x14(%rsp)
xorl %r12d, %r12d
jmp 0x2477
cmpl $0x68, %eax
jne 0x26c6
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x2736
xorl %ebp, %ebp
jmp 0x26d6
cmpb $0x2d, %r12b
jne 0x26ab
cmpl 0x4(%rsp), %r15d
jne 0x266b
xorl %edi, %edi
movl %ebp, %esi
callq 0x48b6
testq %rax, %rax
je 0x2689
movq %rax, %rbx
leaq 0x2a05(%rip), %rdx      # 0x503c
movq %rax, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq *0x50(%rbx)
leaq 0x16d(%rip), %rdx       # 0x27b5
movq %rbx, %rdi
movl 0x14(%rsp), %esi
callq 0x3c21
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
movq %rbx, %rdi
callq 0x493a
jmp 0x26d6
incl %r15d
jmp 0x2618
movq 0x697e(%rip), %rax      # 0x8ff0
movq (%rax), %rcx
leaq 0x298e(%rip), %rdi      # 0x500a
pushq $0x1b
popq %rsi
pushq $0x1
popq %rdx
callq 0x22c0
jmp 0x26c6
movq 0x6960(%rip), %rax      # 0x8ff0
movq (%rax), %rcx
leaq 0x298c(%rip), %rdi      # 0x5026
pushq $0x15
popq %rsi
pushq $0x1
popq %rdx
callq 0x22c0
jmp 0x26d3
pushq $0x3a
popq %r14
movq 0x693e(%rip), %rax      # 0x8ff0
movq (%rax), %rdi
leaq 0x29ed(%rip), %rsi      # 0x50a9
movl %r14d, %edx
xorl %eax, %eax
callq 0x2190
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x2736
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x6902(%rip), %rax      # 0x8ff0
movq (%rax), %rdi
leaq 0x29c7(%rip), %rsi      # 0x50bf
jmp 0x26bc
leaq 0x2dc6(%rip), %rdi      # 0x54c7
leaq 0x294c(%rip), %rsi      # 0x5054
leaq 0x2dbb(%rip), %rcx      # 0x54ca
movl $0x114, %edx            # imm = 0x114
callq 0x20e0
leaq 0x2984(%rip), %rdi      # 0x50a4
leaq 0x292d(%rip), %rsi      # 0x5054
leaq 0x292d(%rip), %rcx      # 0x505b
pushq $0x1e
popq %rdx
callq 0x20e0