LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/config.c
// Function: conf_add_channel
static int conf_add_channel(config_t* conf, const char *channel)
{
	char** channels;
	int num = 0;
	char** p;

	p = conf->channels;
	while (p && *p) {
		num++;
		p++;
	}
	
	channels = (char**)realloc(conf->channels, sizeof(char*) * (num + 2));

	if (!channels) {
		loge("alloc\n");
		return -1;
	}

	conf->channels = channels;
	channels[num++] = strdup(channel);
	channels[num] = NULL;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x30(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x30(%rbp)
movb %al, -0x31(%rbp)
je 0x1c9ad
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x1c9b6
jmp 0x1c9cd
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
jmp 0x1c993
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdi
movl -0x24(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x35c0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1ca31
jmp 0x1c9f4
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1ca26
movl $0x3, %edi
leaq 0x1a7dd(%rip), %rsi     # 0x371e9
leaq 0x1a981(%rip), %rdx     # 0x37394
movl $0x1e, %ecx
leaq 0x1a478(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x1ca28
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1ca76
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x18(%rbp), %rdi
callq 0x3620
movq %rax, %rdx
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x24(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/config.c
// Function: conf_add_channel_args
static int conf_add_channel_args(config_t* conf, const char* args)
{
	char** channel_args;
	int num = 0;
	char** p;

	p = conf->channel_args;
	while (p && *p) {
		num++;
		p++;
	}

	channel_args = (char**)realloc(conf->channel_args, sizeof(char*) * (num + 2));

	if (!channel_args) {
		loge("alloc\n");
		return -1;
	}

	conf->channel_args = channel_args;
	channel_args[num++] = strdup(args);
	channel_args[num] = NULL;

	return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rax
movq %rax, -0x30(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x30(%rbp)
movb %al, -0x31(%rbp)
je 0x1cabd
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x1cac6
jmp 0x1cadd
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
jmp 0x1caa3
movq -0x10(%rbp), %rax
movq 0x78(%rax), %rdi
movl -0x24(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x35c0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1cb41
jmp 0x1cb04
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1cb36
movl $0x3, %edi
leaq 0x1a6cd(%rip), %rsi     # 0x371e9
leaq 0x1a882(%rip), %rdx     # 0x373a5
movl $0x38, %ecx
leaq 0x1a368(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x1cb38
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1cb86
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x18(%rbp), %rdi
callq 0x3620
movq %rax, %rdx
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x24(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/config.c
// Function: parse_option
static void parse_option(char* ln, char** option, char** name, char** value)
{
	char* p = ln;

	*option = p;
	*name = NULL;
	*value = NULL;

	while (*p && !isspace((int)(*((unsigned char*)p)))) p++;

	if (!(*p))
		return;

	*p = '\0';

	p = ltrim(p + 1);

	*name = p;

	while (*p && !isspace((int)(*((unsigned char*)p)))) p++;

	if (!(*p))
		return;

	*p = '\0';

	p = ltrim(p + 1);

	*value = trim_quote(p);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x28(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x29(%rbp)
je 0x1dd78
callq 0x33e0
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movzbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x1dd81
jmp 0x1dd8f
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1dd41
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x1dd9d
jmp 0x1de44
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
movq -0x28(%rbp), %rdi
addq $0x1, %rdi
callq 0x2ef90
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x2a(%rbp)
je 0x1ddf7
callq 0x33e0
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movzbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x2a(%rbp)
movb -0x2a(%rbp), %al
testb $0x1, %al
jne 0x1de00
jmp 0x1de0e
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1ddc0
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x1de19
jmp 0x1de44
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
movq -0x28(%rbp), %rdi
addq $0x1, %rdi
callq 0x2ef90
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x2f0a0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/dns_request.c
// Function: req_destroy
void req_destroy(req_t* req)
{
	if (req) {
		if (req->fromlen > 0)
			free(req->from);
		if (req->msg) {
			ns_msg_free(req->msg);
			free(req->msg);
		}
		free(req);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1e398
movq -0x8(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jle 0x1e36a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3460
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1e38f
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x27870
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3460
movq -0x8(%rbp), %rdi
callq 0x3460
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_request_create
http_request_t* http_request_create(
	const char *method, const char *path,
	const char *host, int keep_alive)
{
	http_request_t* req = (http_request_t*)malloc(sizeof(http_request_t));
	if (!req) {
		loge("alloc\n");
		return NULL;
	}

	memset(req, 0, sizeof(http_request_t));

	dllist_init(&req->headers);

	req->method = method;
	req->path = path;
	req->host = host;
	req->keep_alive = keep_alive;

	return req;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl $0x68, %edi
callq 0x34d0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x1e43c
jmp 0x1e3fe
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1e430
movl $0x3, %edi
leaq 0x19006(%rip), %rsi     # 0x3741c
leaq 0x1900a(%rip), %rdx     # 0x37427
movl $0x106, %ecx            # imm = 0x106
leaq 0x18a6e(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x1e432
movq $0x0, -0x8(%rbp)
jmp 0x1e4a1
movq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x68, %edx
callq 0x3200
movq -0x30(%rbp), %rcx
addq $0x18, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rcx
addq $0x18, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_request_destroy
void http_request_destroy(http_request_t *request)
{
	if (request) {
		dlitem_t* cur, * nxt;
		http_header_t* header;
		if (request->conn) {
			request->conn->request = NULL;
		}
		dllist_foreach(&request->headers, cur, nxt,
			http_header_t, header, entry) {
			dllist_remove(&header->entry);
			free(header);
		}
		free(request->tag);
		free(request);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1e59b
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x1e4e5
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq $0x0, 0xa0(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x10, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
addq $0x18, %rcx
cmpq %rcx, %rax
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1e52a
jmp 0x1e585
jmp 0x1e52c
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rdi
callq 0x3460
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x10, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x1e510
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x3460
movq -0x8(%rbp), %rdi
callq 0x3460
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_request_find_header
http_header_t* http_request_find_header(http_request_t* request,
	const char* name)
{
	dlitem_t* cur, * nxt;
	http_header_t* header;
	dllist_foreach(&request->headers, cur, nxt,
		http_header_t, header, entry) {
		if (strcmp(header->name, name) == 0) {
			return header;
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x10, %rcx
subq %rcx, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x18, %rcx
cmpq %rcx, %rax
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1e605
jmp 0x1e64f
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x3500
cmpl $0x0, %eax
jne 0x1e624
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1e657
jmp 0x1e626
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x10, %rcx
subq %rcx, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x1e5eb
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_request_get_header
const char* http_request_get_header(http_request_t* request,
	const char* name)
{
	http_header_t* header = 
		http_request_find_header(request, name);
	if (header) {
		return header->value;
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1e5b0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1e6a6
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1e6ae
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_request_set_header
int http_request_set_header(http_request_t* request,
	const char *name, const char *value)
{
	http_header_t* header =
		http_request_find_header(request, name);
	if (header) {
		header->value = (char*)value;
	}
	else {
		header = (http_header_t*)malloc(sizeof(http_header_t));
		if (!header) {
			loge("alloc\n");
			return -1;
		}

		memset(header, 0, sizeof(http_header_t));

		header->name = (char*)name;
		header->value = (char*)value;

		dllist_add(&request->headers, &header->entry);
	}

	if (strcmp(name, "Host") == 0) {
		request->host = value;
	}

	if (strcmp(name, "Connection") == 0) {
		request->keep_alive = strcmp(value, "keep-alive") == 0;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1e5b0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1e6fd
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x1e7c0
movl $0x20, %edi
callq 0x34d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1e754
jmp 0x1e714
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1e746
movl $0x3, %edi
leaq 0x18cf0(%rip), %rsi     # 0x3741c
leaq 0x18d08(%rip), %rdx     # 0x3743b
movl $0x14c, %ecx            # imm = 0x14C
leaq 0x18758(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x1e748
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1e81f
movq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x3200
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
addq $0x18, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rcx
addq $0x10, %rcx
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
addq $0x10, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x1e7c0
movq -0x18(%rbp), %rdi
leaq 0x18c88(%rip), %rsi     # 0x37453
callq 0x3500
cmpl $0x0, %eax
jne 0x1e7e1
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
leaq 0x18c6c(%rip), %rsi     # 0x37458
callq 0x3500
cmpl $0x0, %eax
jne 0x1e818
movq -0x20(%rbp), %rdi
leaq 0x1789e(%rip), %rsi     # 0x3609f
callq 0x3500
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x34(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_request_set_host
void http_request_set_host(http_request_t* request,
	const char* value)
{
	request->host = value;
	http_header_t* header =
		http_request_find_header(request, "Host");
	if (header) {
		header->value = (char*)value;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
leaq 0x18a6c(%rip), %rsi     # 0x37453
callq 0x1e5b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1ea03
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_request_header_next
int http_request_header_next(http_request_t* request, struct dliterator_t* iterator,
	const char** name, const char** value)
{
	int r = dliterator_next(&request->headers, iterator);
	if (r && (name || value)) {
		http_header_t* header =
			dllist_container_of(iterator->cur, http_header_t, entry);
		if (name) *name = header->name;
		if (value) *value = header->value;
	}
	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rsi
callq 0x1eb00
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x1eaf4
cmpq $0x0, -0x18(%rbp)
jne 0x1eab0
cmpq $0x0, -0x20(%rbp)
je 0x1eaf4
movq -0x10(%rbp), %rcx
xorl %eax, %eax
movq %rax, %rdx
addq $0x10, %rdx
subq %rdx, %rax
addq (%rcx), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1eadc
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x1eaf2
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x1eaf4
movl -0x24(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/dllist.h
// Function: dliterator_next
static inline int dliterator_next(struct dllist_t* list, struct dliterator_t* iterator)
{
    if (!iterator->cur) {
        iterator->cur = dllist_start(list);
        iterator->nxt = iterator->cur->next;
    }
    else {
        iterator->cur = iterator->nxt;
        iterator->nxt = iterator->cur->next;
    }
    return !dllist_is_end(list, iterator->cur);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x1eb38
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x1eb59
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
cmpq %rcx, %rax
sete %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_request_serialize
int http_request_serialize(/*write stream*/stream_t* s, http_request_t* req)
{
	if (http_request_headers_serialize(s, req) == -1) {
		loge("http_request_headers_serialize()\n");
		return -1;
	}

	if (strcmp(req->method, "POST") == 0) {
		if (req->data_len > 0) {
			if (stream_appends(s, req->data, req->data_len) == -1) {
				loge("stream_appendf()\n");
				return -1;
			}
		}
	}

	return s->size - s->pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1eb80
cmpl $-0x1, %eax
jne 0x1ef44
jmp 0x1ef04
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1ef36
movl $0x3, %edi
leaq 0x18500(%rip), %rsi     # 0x3741c
leaq 0x185c4(%rip), %rdx     # 0x374e7
movl $0x206, %ecx            # imm = 0x206
leaq 0x185cf(%rip), %r8      # 0x374fe
movb $0x0, %al
callq 0x243b0
jmp 0x1ef38
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1efd7
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x164b9(%rip), %rsi     # 0x3540b
callq 0x3500
cmpl $0x0, %eax
jne 0x1efc6
movq -0x18(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jle 0x1efc4
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x30(%rax), %edx
callq 0x2e140
cmpl $-0x1, %eax
jne 0x1efc2
jmp 0x1ef85
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1efb7
movl $0x3, %edi
leaq 0x1847f(%rip), %rsi     # 0x3741c
leaq 0x18543(%rip), %rdx     # 0x374e7
movl $0x20d, %ecx            # imm = 0x20D
leaq 0x175c1(%rip), %r8      # 0x36571
movb $0x0, %al
callq 0x243b0
jmp 0x1efb9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1efd7
jmp 0x1efc4
jmp 0x1efc6
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0xc(%rcx), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_response_create
http_response_t* http_response_create()
{
	http_response_t* res = (http_response_t*)malloc(sizeof(http_response_t));
	if (!res) {
		loge("alloc\n");
		return NULL;
	}

	memset(res, 0, sizeof(http_response_t));

	dllist_init(&res->headers);

	stream_init(&res->data);

	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x40, %edi
callq 0x34d0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1f03d
jmp 0x1efff
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1f031
movl $0x3, %edi
leaq 0x18405(%rip), %rsi     # 0x3741c
leaq 0x18502(%rip), %rdx     # 0x37520
movl $0x21c, %ecx            # imm = 0x21C
leaq 0x17e6d(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x1f033
movq $0x0, -0x8(%rbp)
jmp 0x1f082
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x3200
movq -0x10(%rbp), %rcx
addq $0x10, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rcx
addq $0x10, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
callq 0x2d610
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_response_destroy
void http_response_destroy(http_response_t* response)
{
	if (response) {
		dlitem_t* cur, * nxt;
		http_header_t* header;
		if (response->conn) {
			response->conn->response = NULL;
		}
		dllist_foreach(&response->headers, cur, nxt,
			http_header_t, header, entry) {
			dllist_remove(&header->entry);
			free(header->name);
			free(header->value);
			free(header);
		}
		free(response->status_text);
		stream_free(&response->data);
		free(response);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1f1a4
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x1f0c5
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq $0x0, 0xa8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x10, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
addq $0x10, %rcx
cmpq %rcx, %rax
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1f10a
jmp 0x1f181
jmp 0x1f10c
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x3460
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3460
movq -0x20(%rbp), %rdi
callq 0x3460
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x10, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x1f0f0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3460
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
callq 0x2d640
movq -0x8(%rbp), %rdi
callq 0x3460
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_response_find_header
http_header_t* http_response_find_header(http_response_t* response,
	const char* name)
{
	dlitem_t* cur, * nxt;
	http_header_t* header;
	dllist_foreach(&response->headers, cur, nxt,
		http_header_t, header, entry) {
		if (strcmp(header->name, name) == 0) {
			return header;
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x10, %rcx
subq %rcx, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x10, %rcx
cmpq %rcx, %rax
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1f205
jmp 0x1f24f
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x3500
cmpl $0x0, %eax
jne 0x1f224
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1f257
jmp 0x1f226
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x10, %rcx
subq %rcx, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x1f1eb
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_response_get_header
const char* http_response_get_header(http_response_t* response,
	const char* name)
{
	http_header_t* header =
		http_response_find_header(response, name);
	if (header) {
		return header->value;
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1f1b0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1f2a6
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1f2ae
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_response_add_header
int http_response_add_header(http_response_t* response,
	const char* name, const char* value)
{
	http_header_t* header;

	header = (http_header_t*)malloc(sizeof(http_header_t));
	if (!header) {
		loge("alloc\n");
		return -1;
	}

	memset(header, 0, sizeof(http_header_t));

	header->name = strdup(name);
	header->value = strdup(value);

	dllist_add(&response->headers, &header->entry);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x20, %edi
callq 0x34d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1f32b
jmp 0x1f2eb
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1f31d
movl $0x3, %edi
leaq 0x18119(%rip), %rsi     # 0x3741c
leaq 0x1822b(%rip), %rdx     # 0x37535
movl $0x25e, %ecx            # imm = 0x25E
leaq 0x17b81(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x1f31f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1f3ac
movq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x3200
movq -0x18(%rbp), %rdi
callq 0x3620
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rdi
callq 0x3620
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
addq $0x10, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rcx
addq $0x10, %rcx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
addq $0x10, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_response_set_header
int http_response_set_header(http_response_t* response,
	const char* name, const char* value)
{
	http_header_t* header =
		http_response_find_header(response, name);
	if (header) {
		free(header->value);
		header->value = strdup(value);
		return 0;
	}
	else {
		return http_response_add_header(response, name, value);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1f1b0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1f416
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3460
movq -0x20(%rbp), %rdi
callq 0x3620
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x1f42a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x1f2c0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_response_header_next
int http_response_header_next(http_response_t* response, struct dliterator_t* iterator,
	const char** name, const char** value)
{
	int r = dliterator_next(&response->headers, iterator);
	if (r && (name || value)) {
		http_header_t* header =
			dllist_container_of(iterator->cur, http_header_t, entry);
		if (name) *name = header->name;
		if (value) *value = header->value;
	}
	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
movq -0x10(%rbp), %rsi
callq 0x1eb00
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x1f4f4
cmpq $0x0, -0x18(%rbp)
jne 0x1f4b0
cmpq $0x0, -0x20(%rbp)
je 0x1f4f4
movq -0x10(%rbp), %rcx
xorl %eax, %eax
movq %rax, %rdx
addq $0x10, %rdx
subq %rdx, %rax
addq (%rcx), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1f4dc
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x1f4f2
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x1f4f4
movl -0x24(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_response_append_data
int http_response_append_data(http_response_t* response,
	const char* data, int data_len)
{
	if (stream_appends(&response->data, data, data_len) == -1) {
		loge("stream_appends()\n");
		return -1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x2e140
cmpl $-0x1, %eax
jne 0x1f59b
jmp 0x1f55e
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1f590
movl $0x3, %edi
leaq 0x17ea6(%rip), %rsi     # 0x3741c
leaq 0x17fd1(%rip), %rdx     # 0x3754e
movl $0x298, %ecx            # imm = 0x298
leaq 0x17fdf(%rip), %r8      # 0x37568
movb $0x0, %al
callq 0x243b0
jmp 0x1f592
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1f5a2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_response_headers_serialize
int http_response_headers_serialize(/*write stream*/stream_t* s, http_response_t* response)
{
	struct dliterator_t it;
	const char* name;
	const char* value;
	int have_connection = FALSE;
	int have_host = FALSE;

	if (stream_appendf(s,
		"HTTP/%d.%d %d %s\r\n",
		response->http_major,
		response->http_minor,
		response->status_code,
		response->status_text) == -1) {
		loge("stream_appendf()\n");
		return -1;
	}

	dliterator_reset(&it);

	while (http_response_header_next(response, &it, &name, &value)) {
		if (stream_appendf(s, "%s: %s\r\n", name, value) == -1) {
			loge("stream_appendf()\n");
			return -1;
		}
	}

	if (stream_appends(s, "\r\n", 2) == -1) {
		loge("stream_appendf()\n");
		return -1;
	}

	return s->size - s->pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movzwl (%rax), %edx
movq -0x18(%rbp), %rax
movzwl 0x2(%rax), %ecx
movq -0x18(%rbp), %rax
movl 0x4(%rax), %r8d
movq -0x18(%rbp), %rax
movq 0x8(%rax), %r9
leaq 0x17f82(%rip), %rsi     # 0x3757a
movb $0x0, %al
callq 0x2e2a0
cmpl $-0x1, %eax
jne 0x1f646
jmp 0x1f606
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1f638
movl $0x3, %edi
leaq 0x17dfe(%rip), %rsi     # 0x3741c
leaq 0x17f68(%rip), %rdx     # 0x3758d
movl $0x2ac, %ecx            # imm = 0x2AC
leaq 0x16f40(%rip), %r8      # 0x36571
movb $0x0, %al
callq 0x243b0
jmp 0x1f63a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1f733
leaq -0x28(%rbp), %rdi
callq 0x1eeb0
movq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x30(%rbp), %rdx
leaq -0x38(%rbp), %rcx
callq 0x1f470
cmpl $0x0, %eax
je 0x1f6c9
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
leaq 0x17e2f(%rip), %rsi     # 0x374ab
movb $0x0, %al
callq 0x2e2a0
cmpl $-0x1, %eax
jne 0x1f6c7
jmp 0x1f68a
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1f6bc
movl $0x3, %edi
leaq 0x17d7a(%rip), %rsi     # 0x3741c
leaq 0x17ee4(%rip), %rdx     # 0x3758d
movl $0x2b4, %ecx            # imm = 0x2B4
leaq 0x16ebc(%rip), %r8      # 0x36571
movb $0x0, %al
callq 0x243b0
jmp 0x1f6be
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1f733
jmp 0x1f64f
movq -0x10(%rbp), %rdi
leaq 0x17e10(%rip), %rsi     # 0x374e4
movl $0x2, %edx
callq 0x2e140
cmpl $-0x1, %eax
jne 0x1f722
jmp 0x1f6e5
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1f717
movl $0x3, %edi
leaq 0x17d1f(%rip), %rsi     # 0x3741c
leaq 0x17e89(%rip), %rdx     # 0x3758d
movl $0x2ba, %ecx            # imm = 0x2BA
leaq 0x16e61(%rip), %r8      # 0x36571
movb $0x0, %al
callq 0x243b0
jmp 0x1f719
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1f733
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0xc(%rcx), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_response_serialize
int http_response_serialize(/*write stream*/stream_t* s, http_response_t* response)
{
	if (http_response_headers_serialize(s, response) == -1) {
		loge("http_response_headers_serialize()\n");
		return -1;
	}

	if (response->data.size > 0) {
		if (stream_appends(s, response->data.array, response->data.size) == -1) {
			loge("stream_appendf()\n");
			return -1;
		}
	}

	return s->size - s->pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1f5b0
cmpl $-0x1, %eax
jne 0x1f7a1
jmp 0x1f764
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1f796
movl $0x3, %edi
leaq 0x17ca0(%rip), %rsi     # 0x3741c
leaq 0x17e2a(%rip), %rdx     # 0x375ad
movl $0x2c4, %ecx            # imm = 0x2C4
leaq 0x17e36(%rip), %r8      # 0x375c5
movb $0x0, %al
callq 0x243b0
jmp 0x1f798
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1f81a
movq -0x18(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jle 0x1f809
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x28(%rax), %edx
callq 0x2e140
cmpl $-0x1, %eax
jne 0x1f807
jmp 0x1f7ca
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1f7fc
movl $0x3, %edi
leaq 0x17c3a(%rip), %rsi     # 0x3741c
leaq 0x17dc4(%rip), %rdx     # 0x375ad
movl $0x2ca, %ecx            # imm = 0x2CA
leaq 0x16d7c(%rip), %r8      # 0x36571
movb $0x0, %al
callq 0x243b0
jmp 0x1f7fe
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1f81a
jmp 0x1f809
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0xc(%rcx), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_create
http_ctx_t* http_create(
	const proxy_t* proxies,
	const int proxy_num,
	int timeout)
{
	http_ctx_t* ctx = (http_ctx_t*)malloc(sizeof(http_ctx_t));
	if (!ctx) {
		loge("alloc\n");
		return NULL;
	}

	memset(ctx, 0, sizeof(http_ctx_t));

	rbtree_init(&ctx->pool, rbcmp);

	ctx->proxies = proxies;
	ctx->proxy_num = proxy_num;
	ctx->timeout = timeout;

	return ctx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl $0x20, %edi
callq 0x34d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1fc97
jmp 0x1fc59
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x1fc8b
movl $0x3, %edi
leaq 0x177ab(%rip), %rsi     # 0x3741c
leaq 0x17aaf(%rip), %rdx     # 0x37727
movl $0x741, %ecx            # imm = 0x741
leaq 0x17213(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x1fc8d
movq $0x0, -0x8(%rbp)
jmp 0x1fce9
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x3200
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
leaq 0x43(%rip), %rcx        # 0x1fd00
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x18(%rax)
movl -0x18(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: rbcmp
static int rbcmp(const void* a, const void* b)
{
	pool_key_t* x = (pool_key_t*)a;
	pool_key_t* y = (pool_key_t*)b;
	int r;
	if (x->addr.addr.ss_family != y->addr.addr.ss_family)
		r = ((int)x->addr.addr.ss_family) - ((int)y->addr.addr.ss_family);
	else if (x->addr.addr.ss_family != AF_INET) {
		r = memcmp(
			&((struct sockaddr_in*)(&x->addr.addr))->sin_addr,
			&((struct sockaddr_in*)&y->addr.addr)->sin_addr,
			4);
	}
	else {
		r = memcmp(
			&((struct sockaddr_in6*)(&x->addr.addr))->sin6_addr,
			&((struct sockaddr_in6*)&y->addr.addr)->sin6_addr,
			16);
	}

	if (r == 0) {
		r = x->use_proxy - y->use_proxy;
	}

	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
movq -0x20(%rbp), %rcx
movzwl (%rcx), %ecx
cmpl %ecx, %eax
je 0x1fd47
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
movq -0x20(%rbp), %rcx
movzwl (%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x24(%rbp)
jmp 0x1fd91
movq -0x18(%rbp), %rax
movzwl (%rax), %eax
cmpl $0x2, %eax
je 0x1fd72
movq -0x18(%rbp), %rdi
addq $0x4, %rdi
movq -0x20(%rbp), %rsi
addq $0x4, %rsi
movl $0x4, %edx
callq 0x3190
movl %eax, -0x24(%rbp)
jmp 0x1fd8f
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movq -0x20(%rbp), %rsi
addq $0x8, %rsi
movl $0x10, %edx
callq 0x3190
movl %eax, -0x24(%rbp)
jmp 0x1fd91
cmpl $0x0, -0x24(%rbp)
jne 0x1fdae
movq -0x18(%rbp), %rax
movl 0x88(%rax), %eax
movq -0x20(%rbp), %rcx
subl 0x88(%rcx), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_fdset
sock_t http_fdset(http_ctx_t* ctx,
	fd_set* readset, fd_set* writeset, fd_set* errorset)
{
	http_fdset_state state = {
		.ctx = ctx,
		.readset = readset,
		.writeset = writeset,
		.errorset = errorset,
		.maxfd = 0
	};

	rbtree_foreach_preorder(&ctx->pool, rb_fdset_func, &state);

	return state.maxfd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x16(%rip), %rsi        # 0x1fea0
leaq -0x48(%rbp), %rdx
callq 0x4160
movl -0x28(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: rb_fdset_func
static int rb_fdset_func(rbtree_t* tree, rbnode_t* n, void* state)
{
	http_fdset_state* st = (http_fdset_state*)state;
	http_pool_item_t* pi = rbtree_container_of(n, http_pool_item_t, rbn);
	/* "fly" should be first, then "idle", then "busy". */
	/* otherwise, some connection maybe processed twice. */
	dl_fdset_func(&pi->fly_conns, st);
	dl_fdset_func(&pi->idle_conns, st);
	dl_fdset_func(&pi->busy_conns, st);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0xd0, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
addq $0xb0, %rdi
movq -0x20(%rbp), %rsi
callq 0x20f30
movq -0x28(%rbp), %rdi
addq $0x90, %rdi
movq -0x20(%rbp), %rsi
callq 0x20f30
movq -0x28(%rbp), %rdi
addq $0xa0, %rdi
movq -0x20(%rbp), %rsi
callq 0x20f30
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_step
int http_step(http_ctx_t* ctx,
	fd_set* readset, fd_set* writeset, fd_set* errorset)
{
	http_step_state state = {
		.ctx = ctx,
		.readset = readset,
		.writeset = writeset,
		.errorset = errorset,
	};

	rbtree_foreach_preorder(&ctx->pool, rb_step_func, &state);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x1d(%rip), %rsi        # 0x1ff80
leaq -0x40(%rbp), %rdx
callq 0x4160
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: rb_step_func
static int rb_step_func(rbtree_t* tree, rbnode_t* n, void* state)
{
	http_step_state* st = (http_step_state*)state;
	http_pool_item_t* pi = rbtree_container_of(n, http_pool_item_t, rbn);
	dl_step_func(&pi->idle_conns, st);
	dl_step_func(&pi->busy_conns, st);
	dl_step_func(&pi->fly_conns, st);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0xd0, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
addq $0x90, %rdi
movq -0x20(%rbp), %rsi
callq 0x21510
movq -0x28(%rbp), %rdi
addq $0xa0, %rdi
movq -0x20(%rbp), %rsi
callq 0x21510
movq -0x28(%rbp), %rdi
addq $0xb0, %rdi
movq -0x20(%rbp), %rsi
callq 0x21510
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_proxy_handshake
static int http_proxy_handshake(http_ctx_t *ctx, http_conn_t *conn)
{
	const proxy_t *proxy = ctx->proxies + conn->proxy_index;

	switch (proxy->proxy_type) {
		case SOCKS5_PROXY:
			return http_socks5_handshake(ctx, conn);
		case HTTP_PROXY:
			return http_hp_handshake(ctx, conn);
		default:
			loge("unsupport proxy type");
			return -1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0xf8, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
testl %eax, %eax
je 0x206b7
jmp 0x206ad
movl -0x24(%rbp), %eax
subl $0x1, %eax
je 0x206c9
jmp 0x206db
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x23170
movl %eax, -0x4(%rbp)
jmp 0x20718
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x23850
movl %eax, -0x4(%rbp)
jmp 0x20718
jmp 0x206dd
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x2070f
movl $0x3, %edi
leaq 0x16d27(%rip), %rsi     # 0x3741c
leaq 0x17092(%rip), %rdx     # 0x3778e
movl $0x4d6, %ecx            # imm = 0x4D6
leaq 0x16232(%rip), %r8      # 0x3693a
movb $0x0, %al
callq 0x243b0
jmp 0x20711
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_conn_close
static void http_conn_close(http_conn_t* conn)
{
	conn->conn.status = cs_closing;
	http_move_to_fly(conn);
	if (conn->conn.sock) {
		shutdown(conn->conn.sock, SHUT_RDWR);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x3, 0x48(%rax)
movq -0x8(%rbp), %rdi
callq 0x241c0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x2092b
movq -0x8(%rbp), %rax
movl 0x10(%rax), %edi
movl $0x2, %esi
callq 0x34e0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_pool_item_free
static void http_pool_item_free(http_pool_item_t* item)
{
	http_pool_item_free_conns(&item->fly_conns);
	http_pool_item_free_conns(&item->idle_conns);
	http_pool_item_free_conns(&item->busy_conns);
	free(item);

	logv("free http pool\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0xb0, %rdi
callq 0x20cc0
movq -0x8(%rbp), %rdi
addq $0x90, %rdi
callq 0x20cc0
movq -0x8(%rbp), %rdi
addq $0xa0, %rdi
callq 0x20cc0
movq -0x8(%rbp), %rdi
callq 0x3460
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x20cb7
movl $0x8, %edi
leaq 0x1677f(%rip), %rsi     # 0x3741c
leaq 0x16b4a(%rip), %rdx     # 0x377ee
movl $0xcf, %ecx
leaq 0x16b52(%rip), %r8      # 0x37802
movb $0x0, %al
callq 0x243b0
jmp 0x20cb9
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_pool_item_free_conns
static void http_pool_item_free_conns(dllist_t *conns)
{
	dlitem_t* cur, * nxt;
	http_conn_t* conn;
	dllist_foreach(conns, cur, nxt,
		http_conn_t, conn, entry) {
		dllist_remove(&conn->entry);
		http_conn_free(conn);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x90, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq %rcx, %rax
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x20d0f
jmp 0x20d79
jmp 0x20d11
movq -0x20(%rbp), %rax
movq 0x90(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x98(%rax), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq 0x98(%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x90(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rdi
callq 0x20d80
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x90, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x20cf9
addq $0x20, %rsp
popq %rbp
retq
nop