// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/main.c
// Function: uninit_dohclient
static void uninit_dohclient()
{
	dlitem_t* cur, * nxt;
	peer_t* peer;
	req_t* req;
	int i;

	for (i = 0; i < listen_num; i++) {
		listen_t* listen = listens + i;
		if (listen->sock)
			close(listen->sock);
		if (listen->usock)
			close(listen->usock);
	}

	listen_num = 0;

	dllist_foreach(&peers, cur, nxt,
		peer_t, peer, conn.entry) {
		peer_close(peer);
	}

	dllist_foreach(&reqs, cur, nxt,
		req_t, req, entry) {
		req_remove(req);
	}

	rbtree_init(&reqdic, req_rbkeycmp);

	if (channels) {
		for (i = 0; i < channel_num; i++) {
			channels[i]->destroy(channels[i]);
		}
		free(channels);
		channels = NULL;
		channel_num = 0;
	}

	if (cache) {
		if (save_cache_when_close) {
			cache_save_cachedb(cache, conf.cachedb_autosave);
		}
		cache->destroy(cache);
		cache = NULL;
	}

	if (hosts) {
		hosts->destroy(hosts);
		hosts = NULL;
	}

	chnroute_free(chnr);
	chnr = NULL;

	chnroute_free(blacklist);
	blacklist = NULL;

	proxy_num = 0;

	http_uninit();

	if (is_use_logfile()) {
		close_logfile();
	}

	if (is_use_syslog()) {
		close_syslog();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl 0xfab8(%rip), %eax      # 0x42f10
jge 0x334b8
movslq -0x24(%rbp), %rcx
leaq 0xf62b(%rip), %rax      # 0x42a90
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, 0x88(%rax)
je 0x3348f
movq -0x30(%rbp), %rax
movl 0x88(%rax), %edi
callq 0x3680
movq -0x30(%rbp), %rax
cmpl $0x0, 0x8c(%rax)
je 0x334ab
movq -0x30(%rbp), %rax
movl 0x8c(%rax), %edi
callq 0x3680
jmp 0x334ad
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x3344f
movl $0x0, 0xfa4e(%rip)      # 0x42f10
movq 0xe6ff(%rip), %rax      # 0x41bc8
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x40, %rcx
subq %rcx, %rax
addq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq 0xe6d5(%rip), %rax      # 0x41bc8
cmpq %rax, -0x8(%rbp)
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x33502
jmp 0x33534
movq -0x18(%rbp), %rdi
callq 0x31e10
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x40, %rcx
subq %rcx, %rax
addq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x334ec
movq 0xe69d(%rip), %rax      # 0x41bd8
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x58, %rcx
subq %rcx, %rax
addq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0xe673(%rip), %rax      # 0x41bd8
cmpq %rax, -0x8(%rbp)
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x33574
jmp 0x335a6
movq -0x20(%rbp), %rdi
callq 0x32f60
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x58, %rcx
subq %rcx, %rax
addq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x3355e
jmp 0x335a8
movq $0x0, 0xe635(%rip) # 0x41be8
leaq -0xc5a(%rip), %rax      # 0x32960
movq %rax, 0xe62f(%rip)      # 0x41bf0
cmpq $0x0, 0xf4b7(%rip)      # 0x42a80
je 0x3362d
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl 0xf49d(%rip), %eax      # 0x42a78
jge 0x3360c
movq 0xf49c(%rip), %rax      # 0x42a80
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x48(%rax), %rax
movq 0xf489(%rip), %rcx      # 0x42a80
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rdi
callq *%rax
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x335d2
movq 0xf46d(%rip), %rdi      # 0x42a80
callq 0x3460
movq $0x0, 0xf45d(%rip) # 0x42a80
movl $0x0, 0xf44b(%rip)      # 0x42a78
cmpq $0x0, 0xf43b(%rip)      # 0x42a70
je 0x33672
cmpl $0x0, 0xf8d6(%rip)      # 0x42f14
je 0x33653
movq 0xf429(%rip), %rdi      # 0x42a70
movq 0xe53a(%rip), %rsi      # 0x41b88
callq 0xcb80
movq 0xf416(%rip), %rax      # 0x42a70
movq 0x48(%rax), %rax
movq 0xf40b(%rip), %rdi      # 0x42a70
callq *%rax
movq $0x0, 0xf3fe(%rip) # 0x42a70
cmpq $0x0, 0xf3ee(%rip)      # 0x42a68
je 0x3369b
movq 0xf3e5(%rip), %rax      # 0x42a68
movq 0x48(%rax), %rax
movq 0xf3da(%rip), %rdi      # 0x42a68
callq *%rax
movq $0x0, 0xf3cd(%rip) # 0x42a68
movq 0xf3b6(%rip), %rdi      # 0x42a58
callq 0x1c2a0
movq $0x0, 0xf3a6(%rip) # 0x42a58
movq 0xf3a7(%rip), %rdi      # 0x42a60
callq 0x1c2a0
movq $0x0, 0xf397(%rip) # 0x42a60
movl $0x0, 0xf37d(%rip)      # 0x42a50
movb $0x0, %al
callq 0x1fc00
movb $0x0, %al
callq 0x24960
cmpl $0x0, %eax
je 0x336ed
movb $0x0, %al
callq 0x24870
movb $0x0, %al
callq 0x24950
cmpl $0x0, %eax
je 0x33700
movb $0x0, %al
callq 0x24910
addq $0x30, %rsp
popq %rbp
retq