// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/main.c
// Function: main
int main(int argc, char** argv)
{
#ifdef WINDOWS
	win_init();
	log_init();
#endif

	conf.log_level = loglevel;

	if (conf_parse_args(&conf, argc, argv) != 0) {
		usage();
		exit(-1);
		return EXIT_FAILURE;
	}

	if (conf.is_print_help) {
		usage();
		exit(0);
		return EXIT_SUCCESS;
	}

	if (conf.is_print_version) {
		printf(DOHCLIENT_NAME " v" DOHCLIENT_VERSION "%s\n", git_version());
		exit(0);
		return EXIT_SUCCESS;
	}

	loglevel = conf.log_level;

	if (conf.daemonize) {
		run_as_daemonize();
		return EXIT_SUCCESS;
	}

	if (init_dohclient() != 0)
		return EXIT_FAILURE;

	if (do_loop() != 0) {
		loge("Exit with error\n");
		return EXIT_FAILURE;
	}

	uninit_dohclient();

	conf_free(&conf);

	print_leak();

	return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
xorl %eax, %eax
callq 0x176e5
movl (%rax), %eax
movl %eax, 0xf384(%rip)      # 0x2d6c0
leaq 0xf2ed(%rip), %rdi      # 0x2d630
movl %ebp, %esi
movq %rbx, %rdx
callq 0x12860
testl %eax, %eax
jne 0x1e4e2
cmpl $0x0, 0xf36c(%rip)      # 0x2d6c8
jne 0x1e4f1
cmpl $0x0, 0xf35b(%rip)      # 0x2d6c4
jne 0x1e4fb
movl 0xf34b(%rip), %ebx      # 0x2d6c0
xorl %eax, %eax
callq 0x176e5
movl %ebx, (%rax)
cmpl $0x0, 0xf32f(%rip)      # 0x2d6b4
je 0x1e440
cmpq $0x0, 0xf2ad(%rip)      # 0x2d640
jne 0x1e3a8
leaq 0x7bec(%rip), %rdi      # 0x25f88
callq 0x3610
movq %rax, 0xf298(%rip)      # 0x2d640
callq 0x30e0
testl %eax, %eax
js 0x1e5a8
jne 0x1e515
callq 0x1e601
testl %eax, %eax
jne 0x1e5a8
xorl %edi, %edi
callq 0x35e0
movq 0xf272(%rip), %rax      # 0x2d648
testq %rax, %rax
je 0x1e3e0
cmpb $0x0, (%rax)
jne 0x1e3ec
leaq 0x7c07(%rip), %rdi      # 0x25fee
callq 0x17a05
callq 0x33e0
testl %eax, %eax
js 0x1e5a8
leaq 0x6549(%rip), %rdi      # 0x24949
callq 0x3520
testl %eax, %eax
js 0x1e5a8
leaq 0x7bb2(%rip), %rdi      # 0x25fc6
movl $0x1, %esi
xorl %eax, %eax
callq 0x3260
testl %eax, %eax
je 0x1e48b
movl %eax, %ebx
movl %eax, %edi
movl $0x1, %esi
callq 0x3320
movl %ebx, %edi
movl $0x2, %esi
callq 0x3320
jmp 0x1e49f
callq 0x1e601
movl $0x1, %ebx
testl %eax, %eax
jne 0x1e4c6
callq 0x1edde
testl %eax, %eax
je 0x1e4cd
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x1e4c6
leaq 0x6f6a(%rip), %rsi      # 0x253d4
leaq 0x6f6e(%rip), %rdx      # 0x253df
leaq 0x6f6c(%rip), %r8       # 0x253e4
movl $0x3, %edi
movl $0x5d6, %ecx            # imm = 0x5D6
xorl %eax, %eax
callq 0x1771e
jmp 0x1e4c6
movl $0x1, %edi
callq 0x3670
movl $0x2, %edi
callq 0x3670
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x3670
callq 0x1edde
testl %eax, %eax
jne 0x1e576
callq 0x20565
leaq 0xf16f(%rip), %rdi      # 0x2d630
callq 0x13ad8
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
callq 0x20565
leaq 0xf157(%rip), %rdi      # 0x2d630
callq 0x13ad8
xorl %ebx, %ebx
jmp 0x1e4c6
callq 0x1e5d7
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3460
callq 0x1e5d7
jmp 0x1e5d0
leaq 0x6ebe(%rip), %rdi      # 0x253c0
leaq 0x7a76(%rip), %rsi      # 0x25f7f
xorl %eax, %eax
callq 0x3050
jmp 0x1e5d0
movq 0xf124(%rip), %rdi      # 0x2d640
testq %rdi, %rdi
je 0x1e5d0
movl %eax, %ebx
leaq 0x7d11(%rip), %rsi      # 0x2623f
callq 0x3430
testq %rax, %rax
jne 0x1e5b2
xorl %eax, %eax
callq 0x176e5
cmpl $0x2, (%rax)
jl 0x1e4e7
movq 0xf0f5(%rip), %r9       # 0x2d640
leaq 0x6e82(%rip), %rsi      # 0x253d4
leaq 0x7a46(%rip), %rdx      # 0x25f9f
leaq 0x7a50(%rip), %r8       # 0x25fb0
movl $0x2, %edi
movl $0x57c, %ecx            # imm = 0x57C
xorl %eax, %eax
callq 0x1771e
jmp 0x1e4e7
xorl %eax, %eax
callq 0x176e5
cmpl $0x3, (%rax)
jl 0x1e5a8
leaq 0x6e4b(%rip), %rsi      # 0x253d4
leaq 0x7a0f(%rip), %rdx      # 0x25f9f
leaq 0x7a39(%rip), %r8       # 0x25fd0
movl $0x3, %edi
movl $0x5a5, %ecx            # imm = 0x5A5
xorl %eax, %eax
callq 0x1771e
movl $0x1, %edi
callq 0x3460
movq %rax, %r14
leaq 0x6139(%rip), %rsi      # 0x246f5
movq %rax, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x3510
movq %r14, %rdi
callq 0x3380
xorl %edi, %edi
callq 0x3460