// File: /workspace/github_c_makefile_star2_O3/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, 0xc(%rsp)
movq %rsi, 0x10(%rsp)
testq %rsi, %rsi
je 0x275e
xorl %r15d, %r15d
movb $0x1, %r14b
movl $0x1f90, %ebp           # imm = 0x1F90
movl $0x3, 0x8(%rsp)
leaq 0x2f97(%rip), %rbx      # 0x548d
xorl %r13d, %r13d
testb $0x1, %r14b
movl $0x1, %eax
cmovnel %eax, %r13d
cmovneq %rbx, %r15
movb (%r15), %r14b
testb %r14b, %r14b
jne 0x254e
cmpl 0xc(%rsp), %r13d
jge 0x26a6
movslq %r13d, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %r15
cmpb $0x2d, (%r15)
jne 0x26a6
movzbl 0x1(%r15), %r14d
testl %r14d, %r14d
je 0x26a6
cmpl $0x2d, %r14d
je 0x26a3
incq %r15
cmpb $0x3a, %r14b
je 0x2707
movsbl %r14b, %r12d
movl $0x6, %edx
leaq 0x2a9c(%rip), %rdi      # 0x5004
movl %r12d, %esi
callq 0x2150
testq %rax, %rax
je 0x269b
incq %r15
cmpb $0x3a, 0x1(%rax)
movb (%r15), %al
jne 0x25ae
testb %al, %al
jne 0x25a3
incl %r13d
cmpl 0xc(%rsp), %r13d
jge 0x274b
movslq %r13d, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %r15
movq %r15, %r12
incl %r13d
movq %rbx, %r15
jmp 0x25b7
cmpb $0x1, %al
adcl $0x0, %r13d
xorl %r12d, %r12d
cmpb $0x70, %r14b
jne 0x25cf
movq %r12, %rdi
callq 0x22a0
movl %eax, %ebp
xorl %r14d, %r14d
jmp 0x24f9
movzbl %r14b, %eax
cmpl $0xff, %eax
je 0x26a6
cmpl $0x6d, %eax
jne 0x267e
testq %r12, %r12
je 0x277d
movq %r12, %rdi
leaq 0x3f0e(%rip), %rsi      # 0x6508
callq 0x2170
xorl %r14d, %r14d
movl $0x3, 0x8(%rsp)
testl %eax, %eax
je 0x24f9
movq %r12, %rdi
leaq 0x2edf(%rip), %rsi      # 0x54fb
callq 0x2170
movl $0x2, 0x8(%rsp)
xorl %r14d, %r14d
testl %eax, %eax
je 0x24f9
movq %r12, %rdi
leaq 0x2ec2(%rip), %rsi      # 0x5500
callq 0x2170
movl $0x1, 0x8(%rsp)
xorl %r14d, %r14d
testl %eax, %eax
je 0x24f9
movq 0x6973(%rip), %rax      # 0x8fd0
movq (%rax), %rdi
leaq 0x2ea0(%rip), %rsi      # 0x5507
movq %r12, %rdx
xorl %eax, %eax
callq 0x2190
movl $0x0, 0x8(%rsp)
jmp 0x24f9
cmpl $0x68, %eax
jne 0x2728
movq 0x10(%rsp), %rax
movq (%rax), %rdi
callq 0x279c
xorl %ebp, %ebp
jmp 0x273a
cmpb $0x2d, %r14b
je 0x26a6
jmp 0x270d
incl %r13d
cmpl 0xc(%rsp), %r13d
jne 0x26f4
xorl %edi, %edi
movl 0x8(%rsp), %esi
callq 0x4b41
testq %rax, %rax
je 0x2700
movq %rax, %rbx
leaq 0x2975(%rip), %rdx      # 0x503c
movq %rax, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq *0x50(%rbx)
leaq 0x145(%rip), %rdx       # 0x281d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3df4
xorl %ebp, %ebp
testl %eax, %eax
setne %bpl
movq %rbx, %rdi
callq 0x4bc7
jmp 0x273a
movq 0x10(%rsp), %rdi
callq 0x2350
jmp 0x2735
callq 0x2379
jmp 0x2735
movl $0x3a, %r12d
movq 0x68dc(%rip), %rax      # 0x8ff0
movq (%rax), %rdi
leaq 0x298b(%rip), %rsi      # 0x50a9
movl %r12d, %edx
xorl %eax, %eax
callq 0x2190
movq 0x10(%rsp), %rax
movq (%rax), %rdi
callq 0x279c
movl $0x1, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x689e(%rip), %rax      # 0x8ff0
movq (%rax), %rdi
leaq 0x2963(%rip), %rsi      # 0x50bf
jmp 0x271e
leaq 0x293f(%rip), %rdi      # 0x50a4
leaq 0x28e8(%rip), %rsi      # 0x5054
leaq 0x28e8(%rip), %rcx      # 0x505b
movl $0x1e, %edx
callq 0x20e0
leaq 0x2d43(%rip), %rdi      # 0x54c7
leaq 0x28c9(%rip), %rsi      # 0x5054
leaq 0x2d38(%rip), %rcx      # 0x54ca
movl $0x114, %edx            # imm = 0x114
callq 0x20e0