// File: /workspace/github_c_makefile_star2_O2/GangZhuo[P]dohclient/src/channel_doh.c
// Function: doh_http_query
static int doh_http_query(channel_req_t* rq, subnet_t* subnet)
{
	channel_doh_t* c = rq->ctx;
	http_request_t* req;
	int r;

	req = doh_build_post_request(rq, subnet);
	if (!req) {
		loge("doh_build_post_request() error\n");
		return -1;
	}

	req = c->post
		? doh_build_post_request(rq, subnet)
		: doh_build_get_request(rq, subnet);
	if (!req) {
		loge("%s error\n",
			c->post
			? "doh_build_post_request()"
			: "doh_build_get_request()");
		return -1;
	}

	r = http_send(c->http, &c->http_addr, c->use_proxy, req, c->timeout, http_cb, rq);
	if (r) {
		loge("http_send() error\n");
		free(http_request_get_data(req, NULL));
		http_request_destroy(req);
		return -1;
	}

	return r;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x60(%rdi), %r12
callq 0xd1ae
testq %rax, %rax
je 0xcd46
cmpl $0x0, 0x88(%r12)
je 0xcd82
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd1ae
movq %rax, %r14
jmp 0xd097
xorl %eax, %eax
callq 0x165f5
pushq $-0x1
popq %rbx
cmpl $0x3, (%rax)
jl 0xd17c
leaq 0x142a9(%rip), %rsi     # 0x21009
leaq 0x143aa(%rip), %rdx     # 0x21111
leaq 0x143b2(%rip), %r8      # 0x21120
pushq $0x3
popq %rdi
movl $0x2f2, %ecx            # imm = 0x2F2
xorl %eax, %eax
callq 0x1662e
jmp 0xd17c
movq 0x60(%rbx), %r13
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x18296
movq %r15, %rdi
movq %rbx, %rsi
callq 0xda4f
testq %r14, %r14
je 0xce2a
leaq 0x28(%rsp), %rdi
pushq $0x29
popq %rsi
callq 0x19ad8
testq %rax, %rax
jne 0xcdd6
leaq 0x28(%rsp), %rdi
callq 0x19bdc
testq %rax, %rax
je 0xcf8e
movw $0x400, 0xa(%rax)       # imm = 0x400
movl 0x90(%r14), %edx
addq $0x10, %r14
movq %rax, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x1a257
testl %eax, %eax
je 0xce2a
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0xcfbe
leaq 0x141fa(%rip), %rsi     # 0x21009
leaq 0x1412a(%rip), %rdx     # 0x20f40
leaq 0x1403a(%rip), %r8      # 0x20e57
pushq $0x3
popq %rdi
movl $0x2a9, %ecx            # imm = 0x2A9
jmp 0xcfb7
leaq 0x10(%rsp), %rdi
leaq 0x28(%rsp), %rsi
xorl %edx, %edx
callq 0x1a2cd
testl %eax, %eax
jle 0xcf20
leaq 0x28(%rsp), %rdi
callq 0x188ce
movq 0x10(%rsp), %rdi
movl 0x18(%rsp), %esi
leaq 0x4c(%rsp), %rdx
pushq $0x1
popq %r8
xorl %ecx, %ecx
callq 0x7b8c
testq %rax, %rax
je 0xcf5c
movq %rax, %r14
leaq 0x10(%rsp), %rdi
andq $0x0, 0x8(%rdi)
movq 0x128(%r13), %rdx
leaq 0x140e3(%rip), %rsi     # 0x20f6d
movq %rax, %rcx
xorl %eax, %eax
callq 0x1bf2d
cmpl $-0x1, %eax
je 0xcfcd
movq %r14, %rdi
callq 0x3460
movq 0x10(%rsp), %rsi
movq 0x120(%r13), %rdx
movl 0x130(%r13), %ecx
leaq 0x12efa(%rip), %rdi     # 0x1fdb9
callq 0x13234
testq %rax, %rax
je 0xcff8
movq %rax, %r14
leaq 0x14018(%rip), %rsi     # 0x20eef
leaq 0x1401e(%rip), %rdx     # 0x20efc
movq %rax, %rdi
callq 0x1336f
testl %eax, %eax
je 0xd034
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0xd082
leaq 0x14104(%rip), %rsi     # 0x21009
leaq 0x14034(%rip), %rdx     # 0x20f40
leaq 0x14001(%rip), %r8      # 0x20f14
pushq $0x3
popq %rdi
movl $0x2d5, %ecx            # imm = 0x2D5
jmp 0xd07b
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0xcf50
leaq 0x140d6(%rip), %rsi     # 0x21009
leaq 0x14006(%rip), %rdx     # 0x20f40
leaq 0x1382b(%rip), %r8      # 0x2076c
pushq $0x3
popq %rdi
movl $0x2b0, %ecx            # imm = 0x2B0
xorl %eax, %eax
callq 0x1662e
leaq 0x10(%rsp), %rdi
callq 0x1b8a6
jmp 0xcfbe
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0xd028
leaq 0x14096(%rip), %rsi     # 0x21009
leaq 0x13fc6(%rip), %rdx     # 0x20f40
leaq 0x13fd5(%rip), %r8      # 0x20f56
pushq $0x3
popq %rdi
movl $0x2ba, %ecx            # imm = 0x2BA
jmp 0xd021
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0xcfbe
leaq 0x14068(%rip), %rsi     # 0x21009
leaq 0x13f98(%rip), %rdx     # 0x20f40
leaq 0x13e83(%rip), %r8      # 0x20e32
pushq $0x3
popq %rdi
movl $0x2a0, %ecx            # imm = 0x2A0
xorl %eax, %eax
callq 0x1662e
leaq 0x28(%rsp), %rdi
callq 0x188ce
jmp 0xd094
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0xd028
leaq 0x14029(%rip), %rsi     # 0x21009
leaq 0x13f59(%rip), %rdx     # 0x20f40
leaq 0x13f89(%rip), %r8      # 0x20f77
pushq $0x3
popq %rdi
movl $0x2c5, %ecx            # imm = 0x2C5
jmp 0xd021
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0xd028
leaq 0x13ffe(%rip), %rsi     # 0x21009
leaq 0x13f2e(%rip), %rdx     # 0x20f40
leaq 0x13eb9(%rip), %r8      # 0x20ed2
pushq $0x3
popq %rdi
movl $0x2ce, %ecx            # imm = 0x2CE
xorl %eax, %eax
callq 0x1662e
leaq 0x10(%rsp), %rdi
callq 0x1b8a6
jmp 0xd094
leaq 0x13efa(%rip), %rsi     # 0x20f35
leaq 0x13efa(%rip), %rdx     # 0x20f3c
movq %r14, %rdi
callq 0x1336f
testl %eax, %eax
je 0xd18c
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0xd082
leaq 0x13fa4(%rip), %rsi     # 0x21009
leaq 0x13ed4(%rip), %rdx     # 0x20f40
leaq 0x13ea1(%rip), %r8      # 0x20f14
pushq $0x3
popq %rdi
movl $0x2dd, %ecx            # imm = 0x2DD
xorl %eax, %eax
callq 0x1662e
leaq 0x10(%rsp), %rdi
callq 0x1b8a6
movq %r14, %rdi
callq 0x132b5
xorl %r14d, %r14d
testq %r14, %r14
je 0xd12a
movq 0x80(%r12), %rdi
leaq 0x90(%r12), %rsi
movl 0x134(%r12), %edx
movl 0x13c(%r12), %r8d
movq %rbx, (%rsp)
leaq 0x40b(%rip), %r9        # 0xd4d6
movq %r14, %rcx
callq 0x14297
testl %eax, %eax
je 0xd17a
xorl %eax, %eax
callq 0x165f5
cmpl $0x3, (%rax)
jl 0xd10b
leaq 0x13f1b(%rip), %rsi     # 0x21009
leaq 0x1401c(%rip), %rdx     # 0x21111
leaq 0x13dac(%rip), %r8      # 0x20ea8
pushq $0x3
popq %rdi
movl $0x303, %ecx            # imm = 0x303
xorl %eax, %eax
callq 0x1662e
movq %r14, %rdi
xorl %esi, %esi
callq 0x134c8
movq %rax, %rdi
callq 0x3460
movq %r14, %rdi
callq 0x132b5
pushq $-0x1
popq %rbx
jmp 0xd17c
xorl %eax, %eax
callq 0x165f5
pushq $-0x1
popq %rbx
cmpl $0x3, (%rax)
jl 0xd17c
cmpl $0x0, 0x88(%r12)
leaq 0x13d47(%rip), %rax     # 0x20e90
leaq 0x13d27(%rip), %r9      # 0x20e77
cmoveq %rax, %r9
leaq 0x13eae(%rip), %rsi     # 0x21009
leaq 0x13faf(%rip), %rdx     # 0x21111
leaq 0x13d04(%rip), %r8      # 0x20e6d
pushq $0x3
popq %rdi
movl $0x2fd, %ecx            # imm = 0x2FD
xorl %eax, %eax
callq 0x1662e
jmp 0xd17c
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x10(%rsp), %rsi
movl 0x18(%rsp), %edx
movq %r14, %rdi
callq 0x134d7
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x13474
jmp 0xd097