// File: /workspace/github_c_makefile_star2_O2/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 0x165f5
movl (%rax), %eax
movl %eax, 0x119f0(%rip)     # 0x2e6d0
leaq 0x11959(%rip), %rdi     # 0x2e640
movl %ebp, %esi
movq %rbx, %rdx
callq 0x11d14
testl %eax, %eax
jne 0x1ce78
cmpl $0x0, 0x119d8(%rip)     # 0x2e6d8
jne 0x1ce84
cmpl $0x0, 0x119c7(%rip)     # 0x2e6d4
jne 0x1ce8e
movl 0x119b7(%rip), %ebx     # 0x2e6d0
xorl %eax, %eax
callq 0x165f5
movl %ebx, (%rax)
cmpl $0x0, 0x1199b(%rip)     # 0x2e6c4
je 0x1cdde
cmpq $0x0, 0x11919(%rip)     # 0x2e650
jne 0x1cd4c
leaq 0x7236(%rip), %rdi      # 0x23f76
callq 0x3620
movq %rax, 0x11904(%rip)     # 0x2e650
callq 0x30e0
testl %eax, %eax
js 0x1cf37
jne 0x1cea8
callq 0x1cf8e
testl %eax, %eax
jne 0x1cf37
xorl %edi, %edi
callq 0x35f0
movq 0x118de(%rip), %rax     # 0x2e658
testq %rax, %rax
je 0x1cd84
cmpb $0x0, (%rax)
jne 0x1cd90
leaq 0x7251(%rip), %rdi      # 0x23fdc
callq 0x1694e
callq 0x33f0
testl %eax, %eax
js 0x1cf37
leaq 0x5bc5(%rip), %rdi      # 0x22969
callq 0x3530
testl %eax, %eax
js 0x1cf37
leaq 0x71fc(%rip), %rdi      # 0x23fb4
pushq $0x1
popq %rsi
xorl %eax, %eax
callq 0x3270
testl %eax, %eax
je 0x1ce25
movl %eax, %ebx
pushq $0x1
popq %rsi
movl %eax, %edi
callq 0x3330
pushq $0x2
popq %rsi
movl %ebx, %edi
callq 0x3330
jmp 0x1ce35
callq 0x1cf8e
pushq $0x1
popq %rbx
testl %eax, %eax
jne 0x1ce5c
callq 0x1d6bc
testl %eax, %eax
je 0x1ce63
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0x1ce5c
leaq 0x65bc(%rip), %rsi      # 0x233c2
leaq 0x65c0(%rip), %rdx      # 0x233cd
leaq 0x65be(%rip), %r8       # 0x233d2
pushq $0x3
popq %rdi
movl $0x5d6, %ecx            # imm = 0x5D6
xorl %eax, %eax
callq 0x1662e
jmp 0x1ce5c
pushq $0x1
popq %rdi
callq 0x3680
pushq $0x2
popq %rdi
callq 0x3680
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x3680
callq 0x1d6bc
testl %eax, %eax
jne 0x1cf07
callq 0x1ecd9
leaq 0x117e9(%rip), %rdi     # 0x2e640
callq 0x12ecf
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
callq 0x1ecd9
leaq 0x117d1(%rip), %rdi     # 0x2e640
callq 0x12ecf
xorl %ebx, %ebx
jmp 0x1ce5c
callq 0x1cf64
pushq $-0x1
jmp 0x1cf39
callq 0x1cf64
jmp 0x1cf5d
leaq 0x6519(%rip), %rdi      # 0x233ae
leaq 0x70d1(%rip), %rsi      # 0x23f6d
xorl %eax, %eax
callq 0x3050
jmp 0x1cf5d
movq 0x117a1(%rip), %rdi     # 0x2e650
testq %rdi, %rdi
je 0x1cf5d
movl %eax, %ebx
leaq 0x736c(%rip), %rsi      # 0x2422d
callq 0x3440
testq %rax, %rax
jne 0x1cf3f
xorl %eax, %eax
callq 0x165f5
cmpl $0x2, (%rax)
jl 0x1ce7d
movq 0x11772(%rip), %r9      # 0x2e650
leaq 0x64dd(%rip), %rsi      # 0x233c2
leaq 0x70a1(%rip), %rdx      # 0x23f8d
leaq 0x70ab(%rip), %r8       # 0x23f9e
pushq $0x2
popq %rdi
movl $0x57c, %ecx            # imm = 0x57C
xorl %eax, %eax
callq 0x1662e
jmp 0x1ce7d
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0x1cf37
leaq 0x64a8(%rip), %rsi      # 0x233c2
leaq 0x706c(%rip), %rdx      # 0x23f8d
leaq 0x7096(%rip), %r8       # 0x23fbe
pushq $0x3
popq %rdi
movl $0x5a5, %ecx            # imm = 0x5A5
xorl %eax, %eax
callq 0x1662e
pushq $0x1
popq %rdi
callq 0x3470
movq %rax, %r14
leaq 0x57cc(%rip), %rsi      # 0x22715
movq %rax, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x3520
movq %r14, %rdi
callq 0x3390
xorl %edi, %edi
callq 0x3470