LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_conn_free
static void http_conn_free(http_conn_t *conn)
{
	if (conn->request) {
		http_call_callback(conn->request, HTTP_ABORT, conn->response);
	}
	if (conn->response) {
		conn->response->conn = NULL;
		conn->response = NULL;
	}
	if (conn->ssl) {
		SSL_free(conn->ssl);
	}
	conn_free(&conn->conn);
	stream_free(&conn->field.name);
	stream_free(&conn->field.value);
	stream_free(&conn->proxy_stream);
	free(conn->tag);
	free(conn);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0xa0(%rax)
je 0x20dba
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rdx
movl $0x1, %esi
callq 0x20ea0
movq -0x8(%rbp), %rax
cmpq $0x0, 0xa8(%rax)
je 0x20dea
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rax
movq $0x0, 0x38(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xa8(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x78(%rax)
je 0x20e02
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x3210
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
callq 0x26bd0
movq -0x8(%rbp), %rdi
addq $0xd0, %rdi
callq 0x2d640
movq -0x8(%rbp), %rdi
addq $0xd0, %rdi
addq $0x18, %rdi
callq 0x2d640
movq -0x8(%rbp), %rdi
addq $0x110, %rdi            # imm = 0x110
callq 0x2d640
movq -0x8(%rbp), %rax
movq 0x128(%rax), %rdi
callq 0x3460
movq -0x8(%rbp), %rdi
callq 0x3460
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x20e8e
movl $0x8, %edi
leaq 0x165a8(%rip), %rsi     # 0x3741c
leaq 0x16997(%rip), %rdx     # 0x37812
movl $0xba, %ecx
leaq 0x1699a(%rip), %r8      # 0x37821
movb $0x0, %al
callq 0x243b0
jmp 0x20e90
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_call_callback
static void http_call_callback(http_request_t* req, int err, http_response_t *res)
{
	if (!req) return;
	if (req->conn) {
		req->conn->request = NULL;
		req->conn = NULL;
	}
	if (req->callback) {
		req->callback(err, req, res, req->cb_state);
		req->callback = NULL;
		req->cb_state = NULL;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x20ebc
jmp 0x20f26
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x20ee6
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq $0x0, 0xa0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x20f26
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movl -0xc(%rbp), %edi
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rcx
movq 0x48(%rcx), %rcx
callq *%rax
movq -0x8(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x48(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_remove_conn
static void http_remove_conn(http_conn_t* conn)
{
	dllist_remove(&conn->entry);
	if (conn->status == HTTP_CONN_ST_FLY)
		conn->pool->fly_count--;
	else if (conn->status == HTTP_CONN_ST_IDLE)
		conn->pool->idle_count--;
	else if (conn->status == HTTP_CONN_ST_BUSY)
		conn->pool->busy_count--;
	conn->status = HTTP_CONN_ST_NONE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x84(%rax)
jne 0x22204
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movl 0xc8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc8(%rax)
jmp 0x22258
movq -0x8(%rbp), %rax
cmpl $0x2, 0x84(%rax)
jne 0x2222d
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movl 0xc0(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc0(%rax)
jmp 0x22256
movq -0x8(%rbp), %rax
cmpl $0x3, 0x84(%rax)
jne 0x22254
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movl 0xc4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc4(%rax)
jmp 0x22256
jmp 0x22258
movq -0x8(%rbp), %rax
movl $0x0, 0x84(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_ssl_errstr
static const char *http_ssl_errstr(int err)
{
	switch (err) {
	case SSL_ERROR_NONE:
		return "SSL_ERROR_NONE";
	case SSL_ERROR_SSL:
		return "SSL_ERROR_SSL";
	case SSL_ERROR_WANT_READ:
		return "SSL_ERROR_WANT_READ";
	case SSL_ERROR_WANT_WRITE:
		return "SSL_ERROR_WANT_WRITE";
	case SSL_ERROR_WANT_X509_LOOKUP:
		return "SSL_ERROR_WANT_X509_LOOKUP";
	case SSL_ERROR_SYSCALL:
		return "SSL_ERROR_SYSCALL";
	case SSL_ERROR_ZERO_RETURN:
		return "SSL_ERROR_ZERO_RETURN";
	case SSL_ERROR_WANT_CONNECT:
		return "SSL_ERROR_WANT_CONNECT";
	case SSL_ERROR_WANT_ACCEPT:
		return "SSL_ERROR_WANT_ACCEPT";
	case SSL_ERROR_WANT_ASYNC:
		return "SSL_ERROR_WANT_ASYNC";
	case SSL_ERROR_WANT_ASYNC_JOB:
		return "SSL_ERROR_WANT_ASYNC_JOB";
	case SSL_ERROR_WANT_CLIENT_HELLO_CB:
		return "SSL_ERROR_WANT_CLIENT_HELLO_CB";
	default:
		return "";
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq %rax, -0x18(%rbp)
subq $0xb, %rax
ja 0x22341
movq -0x18(%rbp), %rax
leaq 0x1513d(%rip), %rcx     # 0x373d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x155f8(%rip), %rax     # 0x3789b
movq %rax, -0x8(%rbp)
jmp 0x2234c
leaq 0x155f7(%rip), %rax     # 0x378aa
movq %rax, -0x8(%rbp)
jmp 0x2234c
leaq 0x155f5(%rip), %rax     # 0x378b8
movq %rax, -0x8(%rbp)
jmp 0x2234c
leaq 0x155f9(%rip), %rax     # 0x378cc
movq %rax, -0x8(%rbp)
jmp 0x2234c
leaq 0x15601(%rip), %rax     # 0x378e1
movq %rax, -0x8(%rbp)
jmp 0x2234c
leaq 0x1560f(%rip), %rax     # 0x378fc
movq %rax, -0x8(%rbp)
jmp 0x2234c
leaq 0x15614(%rip), %rax     # 0x3790e
movq %rax, -0x8(%rbp)
jmp 0x2234c
leaq 0x1561d(%rip), %rax     # 0x37924
movq %rax, -0x8(%rbp)
jmp 0x2234c
leaq 0x15627(%rip), %rax     # 0x3793b
movq %rax, -0x8(%rbp)
jmp 0x2234c
leaq 0x15630(%rip), %rax     # 0x37951
movq %rax, -0x8(%rbp)
jmp 0x2234c
leaq 0x15638(%rip), %rax     # 0x37966
movq %rax, -0x8(%rbp)
jmp 0x2234c
leaq 0x15644(%rip), %rax     # 0x3797f
movq %rax, -0x8(%rbp)
jmp 0x2234c
leaq 0x1519e(%rip), %rax     # 0x374e6
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: on_status
static int on_status(http_parser* parser, const char* at, size_t length)
{
	http_conn_t* conn = (http_conn_t*)parser->data;
	http_response_t* response = conn->response;
	response->status_code = parser->status_code;
	response->status_text = http_strdup(at, length);
	response->http_major = parser->http_major;
	response->http_minor = parser->http_minor;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %ecx
andl $0xffff, %ecx           # imm = 0xFFFF
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl %eax, %esi
callq 0x228a0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movw 0x10(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, (%rax)
movq -0x8(%rbp), %rax
movw 0x12(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x2(%rax)
xorl %eax, %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: on_header_field
static int on_header_field(http_parser* parser, const char* at, size_t length)
{
	http_conn_t* conn = (http_conn_t*)parser->data;

	if (conn->field.status == fs_value) {
		if (on_header_field_complete(parser))
			return -1;
	}

	conn->field.status = fs_name;

	if (stream_writes(&conn->field.name, at, (int)length) == -1) {
		loge("stream_writes()\n");
		return -1;
	}

	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), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x2, 0x100(%rax)
jne 0x22496
movq -0x10(%rbp), %rdi
callq 0x22940
cmpl $0x0, %eax
je 0x22494
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22509
jmp 0x22496
movq -0x28(%rbp), %rax
movl $0x1, 0x100(%rax)
movq -0x28(%rbp), %rdi
addq $0xd0, %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rax
movl %eax, %edx
callq 0x2da80
cmpl $-0x1, %eax
jne 0x22502
jmp 0x224c5
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x224f7
movl $0x3, %edi
leaq 0x14f3f(%rip), %rsi     # 0x3741c
leaq 0x154c6(%rip), %rdx     # 0x379aa
movl $0x604, %ecx            # imm = 0x604
leaq 0x154ca(%rip), %r8      # 0x379ba
movb $0x0, %al
callq 0x243b0
jmp 0x224f9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x22509
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: on_header_value
static int on_header_value(http_parser* parser, const char* at, size_t length)
{
	http_conn_t* conn = (http_conn_t*)parser->data;

	conn->field.status = fs_value;

	if (stream_writes(&conn->field.value, at, (int)length) == -1) {
		loge("stream_writes()\n");
		return -1;
	}

	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), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl $0x2, 0x100(%rax)
movq -0x28(%rbp), %rdi
addq $0xd0, %rdi
addq $0x18, %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rax
movl %eax, %edx
callq 0x2da80
cmpl $-0x1, %eax
jne 0x225b0
jmp 0x22573
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x225a5
movl $0x3, %edi
leaq 0x14e91(%rip), %rsi     # 0x3741c
leaq 0x15439(%rip), %rdx     # 0x379cb
movl $0x612, %ecx            # imm = 0x612
leaq 0x1541c(%rip), %r8      # 0x379ba
movb $0x0, %al
callq 0x243b0
jmp 0x225a7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x225b7
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: on_headers_complete
static int on_headers_complete(http_parser* parser)
{
	http_conn_t* conn = (http_conn_t*)parser->data;

	if (conn->field.status != fs_none) {
		if (on_header_field_complete(parser))
			return -1;
	}

	conn->keep_alive = http_should_keep_alive(parser);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x100(%rax)
je 0x225fe
movq -0x10(%rbp), %rdi
callq 0x22940
cmpl $0x0, %eax
je 0x225fc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2261a
jmp 0x225fe
movq -0x10(%rbp), %rdi
callq 0xa750
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x108(%rax)
movl $0x0, -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: on_body
static int on_body(http_parser* parser, const char* at, size_t length)
{
	http_conn_t* conn = (http_conn_t*)parser->data;
	http_response_t* response = conn->response;

	if (http_response_append_data(response, at, (int)length) == -1) {
		loge("http_response_append_data()\n");
		return -1;
	}
	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), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rax
movl %eax, %edx
callq 0x1f530
cmpl $-0x1, %eax
jne 0x226b6
jmp 0x22679
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x226ab
movl $0x3, %edi
leaq 0x14d8b(%rip), %rsi     # 0x3741c
leaq 0x15343(%rip), %rdx     # 0x379db
movl $0x62d, %ecx            # imm = 0x62D
leaq 0x1533f(%rip), %r8      # 0x379e3
movb $0x0, %al
callq 0x243b0
jmp 0x226ad
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x226bd
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: on_message_complete
static int on_message_complete(http_parser* parser)
{
	http_conn_t* conn = (http_conn_t*)parser->data;
	http_request_t* request = conn->request;
	http_response_t* response = conn->response;

	if (loglevel > LOG_DEBUG) {
		stream_t s = STREAM_INIT();
		http_request_headers_serialize(&s, request);
		logv("Request Headers:\r\n%s\r\n", s.array);
		stream_reset(&s);
		http_response_headers_serialize(&s, response);
		logv("Response:\r\n%s\r\n%s%s",
			s.array,
			response->status_code != 200 ? (const char*)response->data.array : "",
			response->status_code != 200 ? "\r\n" : "");
		stream_free(&s);
	}

	http_call_callback(request, HTTP_OK, response);

	if (conn->keep_alive) {
		http_move_to_idle(conn);
	}
	else {
		http_conn_close(conn);
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x20(%rbp)
movb $0x0, %al
callq 0x242d0
cmpl $0x7, (%rax)
jle 0x22827
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x3200
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x1eb80
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x22769
movq -0x38(%rbp), %r9
movl $0x8, %edi
leaq 0x14ccd(%rip), %rsi     # 0x3741c
leaq 0x152aa(%rip), %rdx     # 0x37a00
movl $0x63c, %ecx            # imm = 0x63C
leaq 0x152b2(%rip), %r8      # 0x37a14
movb $0x0, %al
callq 0x243b0
jmp 0x2276b
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x1f5b0
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x2281c
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
cmpl $0xc8, 0x4(%rax)
je 0x227b9
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x227c6
leaq 0x14d26(%rip), %rax     # 0x374e6
movq %rax, -0x48(%rbp)
jmp 0x227c6
movq -0x40(%rbp), %r9
movq -0x48(%rbp), %r10
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edx
leaq 0x14d0a(%rip), %rax     # 0x374e6
leaq 0x14d01(%rip), %rcx     # 0x374e4
cmpl $0xc8, %edx
cmovneq %rcx, %rax
movl $0x8, %edi
leaq 0x14c23(%rip), %rsi     # 0x3741c
leaq 0x15200(%rip), %rdx     # 0x37a00
movl $0x642, %ecx            # imm = 0x642
leaq 0x1521f(%rip), %r8      # 0x37a2b
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x243b0
jmp 0x2281e
leaq -0x38(%rbp), %rdi
callq 0x2d640
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %esi, %esi
callq 0x20ea0
movq -0x10(%rbp), %rax
cmpl $0x0, 0x108(%rax)
je 0x2284e
movq -0x10(%rbp), %rdi
callq 0x229e0
jmp 0x22857
movq -0x10(%rbp), %rdi
callq 0x208f0
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: http_strdup
static char* http_strdup(const char* s, int len)
{
	char* r = (char*)malloc(len + 1);
	if (!r) {
		loge("alloc\n");
		return NULL;
	}
	memcpy(r, s, len);
	r[len] = '\0';
	return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x34d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x22908
jmp 0x228ca
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x228fc
movl $0x3, %edi
leaq 0x14b3a(%rip), %rsi     # 0x3741c
leaq 0x150b5(%rip), %rdx     # 0x3799e
movl $0xf7, %ecx
leaq 0x145a2(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x228fe
movq $0x0, -0x8(%rbp)
jmp 0x2292d
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
callq 0x32d0
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/http.c
// Function: on_header_field_complete
static int on_header_field_complete(http_parser* parser)
{
	http_conn_t* conn = (http_conn_t*)parser->data;
	http_response_t* response = conn->response;

	http_response_add_header(response,
		conn->field.name.array,
		conn->field.value.array);

	stream_reset(&conn->field.name);
	stream_reset(&conn->field.value);
	conn->field.status = fs_none;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xd0(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0xe8(%rax), %rdx
callq 0x1f2c0
movq -0x10(%rbp), %rax
movl $0x0, 0xdc(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xd8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xf4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xf0(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x100(%rax)
xorl %eax, %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_pool_item_create
static http_pool_item_t* http_pool_item_create(http_ctx_t* ctx, sockaddr_t* addr, int use_proxy)
{
	http_pool_item_t* pi = NULL;
	pi = (http_pool_item_t*)malloc(sizeof(http_pool_item_t));
	if (!pi) {
		loge("alloc\n");
		return NULL;
	}

	memset(pi, 0, sizeof(http_pool_item_t));
	dllist_init(&pi->busy_conns);
	dllist_init(&pi->fly_conns);
	dllist_init(&pi->idle_conns);
	memcpy(&pi->key.addr, addr, sizeof(sockaddr_t));
	pi->key.use_proxy = use_proxy;
	pi->rbn.key = &pi->key;
	rbtree_insert(&ctx->pool, &pi->rbn);

	logv("http_pool_item_create()\n");

	return pi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq $0x0, -0x28(%rbp)
movl $0xf8, %edi
callq 0x34d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x22ee3
jmp 0x22ea2
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x22ed4
movl $0x3, %edi
leaq 0x14562(%rip), %rsi     # 0x3741c
leaq 0x14c6b(%rip), %rdx     # 0x37b2c
movl $0x526, %ecx            # imm = 0x526
leaq 0x13fca(%rip), %r8      # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x22ed6
movq $0x0, -0x8(%rbp)
jmp 0x22ff9
movq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0xf8, %edx
callq 0x3200
movq -0x28(%rbp), %rcx
addq $0xa0, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xa0(%rax)
movq -0x28(%rbp), %rcx
addq $0xa0, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xa8(%rax)
jmp 0x22f21
movq -0x28(%rbp), %rcx
addq $0xb0, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xb0(%rax)
movq -0x28(%rbp), %rcx
addq $0xb0, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xb8(%rax)
jmp 0x22f4f
movq -0x28(%rbp), %rcx
addq $0x90, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x90(%rax)
movq -0x28(%rbp), %rcx
addq $0x90, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x98(%rax)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x88, %edx
callq 0x32d0
movl -0x1c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x88(%rax)
movq -0x28(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xd0(%rax)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0xd0, %rsi
callq 0x3790
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x22fef
movl $0x8, %edi
leaq 0x14447(%rip), %rsi     # 0x3741c
leaq 0x14b50(%rip), %rdx     # 0x37b2c
movl $0x533, %ecx            # imm = 0x533
leaq 0x14b5a(%rip), %r8      # 0x37b42
movb $0x0, %al
callq 0x243b0
jmp 0x22ff1
movq -0x28(%rbp), %rax
movq %rax, -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/ns_msg.c
// Function: ns_get_flags
ns_flags_t ns_get_flags(ns_msg_t *msg)
{
	ns_flags_t f;
	int v = msg->flags;
	f.qr = (v >> 15) & 1;
	f.opcode = (v >> 11) & 0xf;
	f.aa = (v >> 10) & 1;
	f.tc = (v >> 9) & 1;
	f.rd = (v >> 8) & 1;
	f.ra = (v >> 7) & 1;
	f.z = (v >> 4) & 0x7;
	f.rcode = v & 0xf;
	return f;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x2(%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
sarl $0xf, %eax
andl $0x1, %eax
movzbl %al, %eax
movw %ax, %cx
movw -0x2(%rbp), %ax
andw $0x1, %cx
andw $-0x2, %ax
orw %cx, %ax
movw %ax, -0x2(%rbp)
movl -0x14(%rbp), %eax
sarl $0xb, %eax
andl $0xf, %eax
movzbl %al, %eax
movw %ax, %cx
movw -0x2(%rbp), %ax
andw $0xf, %cx
shlw %cx
andw $-0x1f, %ax
orw %cx, %ax
movw %ax, -0x2(%rbp)
movl -0x14(%rbp), %eax
sarl $0xa, %eax
andl $0x1, %eax
movzbl %al, %eax
movw %ax, %cx
movw -0x2(%rbp), %ax
andw $0x1, %cx
shlw $0x5, %cx
andw $-0x21, %ax
orw %cx, %ax
movw %ax, -0x2(%rbp)
movl -0x14(%rbp), %eax
sarl $0x9, %eax
andl $0x1, %eax
movzbl %al, %eax
movw %ax, %cx
movw -0x2(%rbp), %ax
andw $0x1, %cx
shlw $0x6, %cx
andw $-0x41, %ax
orw %cx, %ax
movw %ax, -0x2(%rbp)
movl -0x14(%rbp), %eax
sarl $0x8, %eax
andl $0x1, %eax
movzbl %al, %eax
movw %ax, %cx
movw -0x2(%rbp), %ax
andw $0x1, %cx
shlw $0x7, %cx
andw $0xff7f, %ax            # imm = 0xFF7F
orw %cx, %ax
movw %ax, -0x2(%rbp)
movl -0x14(%rbp), %eax
sarl $0x7, %eax
andl $0x1, %eax
movzbl %al, %eax
movw %ax, %cx
movw -0x2(%rbp), %ax
andw $0x1, %cx
shlw $0x8, %cx
andw $0xfeff, %ax            # imm = 0xFEFF
orw %cx, %ax
movw %ax, -0x2(%rbp)
movl -0x14(%rbp), %eax
sarl $0x4, %eax
andl $0x7, %eax
movzbl %al, %eax
movw %ax, %cx
movw -0x2(%rbp), %ax
andw $0x7, %cx
shlw $0x9, %cx
andw $0xf1ff, %ax            # imm = 0xF1FF
orw %cx, %ax
movw %ax, -0x2(%rbp)
movl -0x14(%rbp), %eax
andl $0xf, %eax
movzbl %al, %eax
movw %ax, %cx
movw -0x2(%rbp), %ax
andw $0xf, %cx
shlw $0xc, %cx
andw $0xfff, %ax             # imm = 0xFFF
orw %cx, %ax
movw %ax, -0x2(%rbp)
movw -0x2(%rbp), %ax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_set_flags
uint16_t ns_set_flags(ns_msg_t *msg, const ns_flags_t *flags)
{
	int32_t rv = 0;
	rv |= ((int)flags->qr & 1) << 15;
	rv |= ((int)flags->opcode & 0xf) << 11;
	rv |= ((int)flags->aa & 1) << 10;
	rv |= ((int)flags->tc & 1) << 9;
	rv |= ((int)flags->rd & 1) << 8;
	rv |= ((int)flags->ra & 1) << 7;
	rv |= ((int)flags->z & 7) << 4;
	rv |= ((int)flags->rcode & 0xf);
	if (msg)
		msg->flags = (uint16_t)(rv & 0xffff);
	return (uint16_t)(rv & 0xffff);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rax
movw (%rax), %ax
andw $0x1, %ax
movzbl %al, %eax
andl $0x1, %eax
shll $0xf, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw %ax
andw $0xf, %ax
movzbl %al, %eax
andl $0xf, %eax
shll $0xb, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0x5, %ax
andw $0x1, %ax
movzbl %al, %eax
andl $0x1, %eax
shll $0xa, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0x6, %ax
andw $0x1, %ax
movzbl %al, %eax
andl $0x1, %eax
shll $0x9, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0x7, %ax
andw $0x1, %ax
movzbl %al, %eax
andl $0x1, %eax
shll $0x8, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0x8, %ax
andw $0x1, %ax
movzbl %al, %eax
andl $0x1, %eax
shll $0x7, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0x9, %ax
andw $0x7, %ax
movzbl %al, %eax
andl $0x7, %eax
shll $0x4, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movw (%rax), %ax
shrw $0xc, %ax
movzbl %al, %eax
andl $0xf, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x270e1
movl -0x14(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x2(%rax)
movl -0x14(%rbp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_get_ttl
uint32_t ns_get_ttl(const ns_msg_t* msg)
{
	int i, rrcount;
	uint32_t ttl = 0;
	ns_rr_t* rr;

	rrcount = ns_rrcount(msg);
	for (i = 0; i < rrcount; i++) {
		rr = msg->rrs + i;
		if (rr->ttl > 0 && rr->type != NS_TYPE_OPT) {
			if (ttl == 0 || ttl > rr->ttl) ttl = rr->ttl;
		}
	}

	return ttl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x6(%rax), %eax
movq -0x8(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
addl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x10(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x271b6
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jbe 0x271a9
movq -0x20(%rbp), %rax
movzwl 0x8(%rax), %eax
cmpl $0x29, %eax
je 0x271a9
cmpl $0x0, -0x14(%rbp)
je 0x2719d
movl -0x14(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jbe 0x271a7
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x14(%rbp)
jmp 0x271a9
jmp 0x271ab
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x27155
movl -0x14(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_qr_clone
ns_qr_t* ns_qr_clone(const ns_qr_t* array, int num)
{
	ns_qr_t* copy, * dst;
	const ns_qr_t* src;
	int i;
	if (!array)
		return NULL;
	copy = (ns_qr_t*)malloc(sizeof(ns_qr_t) * num);
	if (!copy) {
		loge("alloc \n");
		return NULL;
	}
	memset(copy, 0, sizeof(ns_qr_t) * num);
	for (i = 0; i < num; i++) {
		src = array + i;
		dst = copy + i;
		dst->qname = src->qname ? strdup(src->qname) : NULL;
		dst->qtype = src->qtype;
		dst->qclass = src->qclass;
	}
	return copy;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x271e3
movq $0x0, -0x8(%rbp)
jmp 0x272ef
movslq -0x14(%rbp), %rdi
shlq $0x4, %rdi
callq 0x34d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x2723e
jmp 0x271fd
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x2722f
movl $0x3, %edi
leaq 0x111ff(%rip), %rsi     # 0x38414
leaq 0x11205(%rip), %rdx     # 0x38421
movl $0x6c, %ecx
leaq 0xe9a4(%rip), %r8       # 0x35bcc
movb $0x0, %al
callq 0x243b0
jmp 0x27231
movq $0x0, -0x8(%rbp)
jmp 0x272ef
movq -0x20(%rbp), %rdi
movslq -0x14(%rbp), %rdx
shlq $0x4, %rdx
xorl %esi, %esi
callq 0x3200
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x272e7
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
je 0x272a6
movq -0x30(%rbp), %rax
movq (%rax), %rdi
callq 0x3620
movq %rax, -0x40(%rbp)
jmp 0x272ae
xorl %eax, %eax
movq %rax, -0x40(%rbp)
jmp 0x272ae
movq -0x40(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movw 0x8(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x30(%rbp), %rax
movw 0xa(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0xa(%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x27258
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_msg_clone_rdata
static void* ns_msg_clone_rdata(const ns_rr_t* rr)
{
	switch (rr->type) {
	case NS_TYPE_HINFO:
		return ns_rdata_clone_hinfo(rr);
	case NS_TYPE_CNAME:
	case NS_TYPE_MB:
	case NS_TYPE_MD:
	case NS_TYPE_MF:
	case NS_TYPE_MG:
	case NS_TYPE_MR:
	case NS_TYPE_NS:
	case NS_TYPE_PTR:
		return ns_rdata_clone_domainname(rr);
	case NS_TYPE_MINFO:
		return ns_rdata_clone_minfo(rr);
		break;
	case NS_TYPE_MX:
		return ns_rdata_clone_mx(rr);
	case NS_TYPE_SOA:
		return ns_rdata_clone_soa(rr);
	case NS_TYPE_OPT:
		return ns_rdata_clone_opts(rr);
	case NS_TYPE_NULL:
	default:
		return ns_rdata_clone_any(rr);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x8(%rax), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x27, %eax
ja 0x275b2
movq -0x18(%rbp), %rax
leaq 0x10ba3(%rip), %rcx     # 0x380f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
callq 0x2aed0
movq %rax, -0x8(%rbp)
jmp 0x275bf
movq -0x10(%rbp), %rdi
callq 0x2af70
movq %rax, -0x8(%rbp)
jmp 0x275bf
movq -0x10(%rbp), %rdi
callq 0x2afb0
movq %rax, -0x8(%rbp)
jmp 0x275bf
movq -0x10(%rbp), %rdi
callq 0x2b050
movq %rax, -0x8(%rbp)
jmp 0x275bf
movq -0x10(%rbp), %rdi
callq 0x2b0d0
movq %rax, -0x8(%rbp)
jmp 0x275bf
movq -0x10(%rbp), %rdi
callq 0x2b180
movq %rax, -0x8(%rbp)
jmp 0x275bf
jmp 0x275b2
movq -0x10(%rbp), %rdi
callq 0x2b370
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_msg_free_rdata
static void ns_msg_free_rdata(ns_rr_t *rr)
{
    switch (rr->type) {
        case NS_TYPE_HINFO:
            ns_rdata_free_hinfo(rr);
            break;
        case NS_TYPE_CNAME:
        case NS_TYPE_MB:
        case NS_TYPE_MD:
        case NS_TYPE_MF:
        case NS_TYPE_MG:
        case NS_TYPE_MR:
        case NS_TYPE_NS:
        case NS_TYPE_PTR:
            ns_rdata_free_domainname(rr);
            break;
        case NS_TYPE_MINFO:
            ns_rdata_free_minfo(rr);
            break;
        case NS_TYPE_MX:
            ns_rdata_free_mx(rr);
            break;
        case NS_TYPE_SOA:
            ns_rdata_free_soa(rr);
            break;
        case NS_TYPE_OPT:
            ns_rdata_free_opts(rr);
            break;
        case NS_TYPE_NULL:
        default:
            ns_rdata_free_any(rr);
            break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x10(%rbp)
subl $0x27, %eax
ja 0x2764a
movq -0x10(%rbp), %rax
leaq 0x10b93(%rip), %rcx     # 0x38190
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
callq 0x2b3c0
jmp 0x27653
movq -0x8(%rbp), %rdi
callq 0x2b400
jmp 0x27653
movq -0x8(%rbp), %rdi
callq 0x2b410
jmp 0x27653
movq -0x8(%rbp), %rdi
callq 0x2b450
jmp 0x27653
movq -0x8(%rbp), %rdi
callq 0x2b490
jmp 0x27653
movq -0x8(%rbp), %rdi
callq 0x291a0
jmp 0x27653
jmp 0x2764a
movq -0x8(%rbp), %rdi
callq 0x2b4d0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_msg_free
void ns_msg_free(ns_msg_t *msg)
{
	int i, rrcount;
	if (msg) {
        if (msg->qrs) {
            for (i = 0; i < msg->qdcount; i++) {
                ns_msg_free_qr(msg->qrs + i);
            }
            free(msg->qrs);
        }

        if (msg->rrs) {
            for (i = 0, rrcount = ns_rrcount(msg);
                    i < rrcount; i++) {
                ns_msg_free_rr(msg->rrs + i);
            }
            free(msg->rrs);
        }
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x27943
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x278d8
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movzwl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jge 0x278cb
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0xc(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
callq 0x28450
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x27899
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x3460
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x27941
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x6(%rax), %eax
movq -0x8(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
addl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x27934
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movslq -0xc(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0x28470
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x27909
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3460
jmp 0x27943
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: qr_key
const char* qr_key(const ns_qr_t* qr)
{
	static char key[REQ_KEY_SIZE];
	int n;

	if (!qr)
		return NULL;

	n = snprintf(key, sizeof(key), "%s %s %s",
		ns_typename(qr->qtype),
		ns_classname(qr->qclass),
		qr->qname ? qr->qname : "");

	if (n <= 0 || n >= sizeof(key)) {
		loge("snprintf() error\n");
		return NULL;
	}

	return key;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x27970
movq $0x0, -0x8(%rbp)
jmp 0x27a3c
movq -0x10(%rbp), %rax
movzwl 0x8(%rax), %edi
callq 0x27a50
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %edi
callq 0x27d20
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x279a9
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x279b6
leaq 0xfb36(%rip), %rax      # 0x374e6
movq %rax, -0x30(%rbp)
jmp 0x279b6
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r9
leaq 0x1a307(%rip), %rdi     # 0x41cd0
movl $0x10f, %esi            # imm = 0x10F
leaq 0x10d5d(%rip), %rdx     # 0x38732
movb $0x0, %al
callq 0x35a0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jle 0x279f1
movslq -0x14(%rbp), %rax
cmpq $0x10f, %rax            # imm = 0x10F
jb 0x27a31
jmp 0x279f3
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x27a25
movl $0x3, %edi
leaq 0x10a09(%rip), %rsi     # 0x38414
leaq 0x10a49(%rip), %rdx     # 0x3845b
movl $0x14f, %ecx            # imm = 0x14F
leaq 0x10a44(%rip), %r8      # 0x38462
movb $0x0, %al
callq 0x243b0
jmp 0x27a27
movq $0x0, -0x8(%rbp)
jmp 0x27a3c
leaq 0x1a298(%rip), %rax     # 0x41cd0
movq %rax, -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/ns_msg.c
// Function: ns_classname
const char *ns_classname(uint16_t cls)
{
	static char num[20] = {0};
    switch (cls) {
        case NS_QCLASS_IN: return "IN";
        case NS_QCLASS_CS: return "CS";
        case NS_QCLASS_CH: return "CH";
        case NS_QCLASS_HS: return "HS";
        case NS_QCLASS_ANY:return "ANY";
        default:
			snprintf(num, sizeof(num) - 1, "QCLASS(%d)", (int)cls);
			return num;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %di, %ax
movw %ax, -0xa(%rbp)
movzwl -0xa(%rbp), %eax
movl %eax, -0x10(%rbp)
subl $0x1, %eax
je 0x27d67
jmp 0x27d3d
movl -0x10(%rbp), %eax
subl $0x2, %eax
je 0x27d74
jmp 0x27d47
movl -0x10(%rbp), %eax
subl $0x3, %eax
je 0x27d81
jmp 0x27d51
movl -0x10(%rbp), %eax
subl $0x4, %eax
je 0x27d8e
jmp 0x27d5b
movl -0x10(%rbp), %eax
subl $0xff, %eax
je 0x27d9b
jmp 0x27da8
leaq 0x109ab(%rip), %rax     # 0x38719
movq %rax, -0x8(%rbp)
jmp 0x27dd1
leaq 0xe673(%rip), %rax      # 0x363ee
movq %rax, -0x8(%rbp)
jmp 0x27dd1
leaq 0xd6fd(%rip), %rax      # 0x35485
movq %rax, -0x8(%rbp)
jmp 0x27dd1
leaq 0x10987(%rip), %rax     # 0x3871c
movq %rax, -0x8(%rbp)
jmp 0x27dd1
leaq 0x10969(%rip), %rax     # 0x3870b
movq %rax, -0x8(%rbp)
jmp 0x27dd1
movzwl -0xa(%rbp), %ecx
leaq 0x1a04d(%rip), %rdi     # 0x41e00
movl $0x13, %esi
leaq 0x10960(%rip), %rdx     # 0x3871f
movb $0x0, %al
callq 0x35a0
leaq 0x1a033(%rip), %rax     # 0x41e00
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: msg_answers
const char* msg_answers(const ns_msg_t* msg)
{
	stream_t s = STREAM_INIT();
	const char* answers = get_answers(&s, msg);
	stream_free(&s);
	return answers;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x3200
movq -0x8(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x27e20
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x2d640
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_read_rdata
static int ns_read_rdata(ns_rr_t *rr, stream_t *s)
{

    switch (rr->type) {
        case NS_TYPE_HINFO:
            return ns_rdata_read_hinfo(rr, s);
        case NS_TYPE_CNAME:
        case NS_TYPE_MB:
        case NS_TYPE_MD:
        case NS_TYPE_MF:
        case NS_TYPE_MG:
        case NS_TYPE_MR:
        case NS_TYPE_NS:
        case NS_TYPE_PTR:
            return ns_rdata_read_domainname(rr, s);
        case NS_TYPE_MINFO:
            return ns_rdata_read_minfo(rr, s);
        case NS_TYPE_MX:
            return ns_rdata_read_mx(rr, s);
       case NS_TYPE_SOA:
            return ns_rdata_read_soa(rr, s);
       case NS_TYPE_OPT:
            return ns_rdata_read_opts(rr, s);
        case NS_TYPE_NULL:
        default:
            return ns_rdata_read_any(rr, s);
     }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x8(%rax), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x27, %eax
ja 0x28fec
movq -0x20(%rbp), %rax
leaq 0xf2bb(%rip), %rcx      # 0x38230
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2b4e0
movl %eax, -0x4(%rbp)
jmp 0x28ffc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2b590
movl %eax, -0x4(%rbp)
jmp 0x28ffc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2b5f0
movl %eax, -0x4(%rbp)
jmp 0x28ffc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2b6a0
movl %eax, -0x4(%rbp)
jmp 0x28ffc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2b760
movl %eax, -0x4(%rbp)
jmp 0x28ffc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2b8a0
movl %eax, -0x4(%rbp)
jmp 0x28ffc
jmp 0x28fec
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2bb90
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/ns_msg.c
// Function: ns_find_rr
ns_rr_t *ns_find_rr(ns_msg_t *msg, int type)
{
	int i, rrcount;
	ns_rr_t *rr;

	rrcount = ns_rrcount(msg);
	for (i = rrcount - 1; i >= 0; i--) {
		rr = msg->rrs + i;
		if (rr->type == type) {
			return rr;
		}
	}

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x6(%rax), %eax
movq -0x10(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
addl %ecx, %eax
movq -0x10(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jl 0x29084
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x18(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movzwl 0x8(%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0x29077
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2908c
jmp 0x29079
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x29043
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_remove_rr
int ns_remove_rr(ns_msg_t* msg, ns_rr_t *rr)
{
	int i, rrcount;
	ns_rr_t* p;

	rrcount = ns_rrcount(msg);
	for (i = rrcount - 1; i >= 0; i--) {
		p = msg->rrs + i;
		if (p == rr) {
			ns_rdata_free_opts(rr);
			free(rr->rdata);
			memmove(msg->rrs + i, msg->rrs + i + 1,
				(rrcount - i - 1) * sizeof(ns_rr_t));
			msg->arcount--;
			return 0;
		}
	}

	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x6(%rax), %eax
movq -0x10(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
addl %ecx, %eax
movq -0x10(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jl 0x29181
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x29171
movq -0x18(%rbp), %rdi
callq 0x291a0
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3460
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movslq -0x1c(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movslq -0x1c(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
addq $0x20, %rsi
movl -0x20(%rbp), %eax
subl -0x1c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdx
shlq $0x5, %rdx
callq 0x35b0
movq -0x10(%rbp), %rax
movw 0xa(%rax), %cx
addw $-0x1, %cx
movw %cx, 0xa(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x29188
jmp 0x29173
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x290d8
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/ns_msg.c
// Function: ns_rdata_free_opts
static void ns_rdata_free_opts(ns_rr_t *rr)
{
	ns_optlist_t *opts = rr->rdata;
    ns_opt_t *opt;
    
	if (opts != NULL && opts->opts != NULL) {
        int i;
        for (i = 0; i < opts->optcount; i++) {
            opt = opts->opts + i;
            ns_free_opt(opt);
        }
        free(opts->opts);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x29212
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x29212
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x29206
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x295c0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x291d0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3460
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_add_optrr
ns_rr_t *ns_add_optrr(ns_msg_t *msg)
{
    ns_rr_t *rr, *rrs;

    rrs = realloc(msg->rrs, ((int)ns_rrcount(msg) + 1) * sizeof(ns_rr_t));
    if (rrs == NULL) {
        loge("alloc\n");
        return NULL;
    }
    msg->rrs = rrs;
    rr = msg->rrs + ns_rrcount(msg);
    msg->arcount++;
    memset(rr, 0, sizeof(ns_rr_t));
    rr->type = NS_TYPE_OPT;
    rr->cls = NS_PAYLOAD_SIZE;
    rr->ttl = (NS_EDNS_VERSION << 16) & 0xFF0000;
    return rr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movzwl 0x6(%rax), %eax
movq -0x10(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
addl %ecx, %eax
movq -0x10(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
addl %ecx, %eax
addl $0x1, %eax
movslq %eax, %rsi
shlq $0x5, %rsi
callq 0x35c0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x292ad
jmp 0x2926c
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x2929e
movl $0x3, %edi
leaq 0xf190(%rip), %rsi      # 0x38414
leaq 0xf247(%rip), %rdx      # 0x384d2
movl $0x416, %ecx            # imm = 0x416
leaq 0xdc00(%rip), %r8       # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x292a0
movq $0x0, -0x8(%rbp)
jmp 0x29332
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movzwl 0x6(%rcx), %ecx
movq -0x10(%rbp), %rdx
movzwl 0x8(%rdx), %edx
addl %edx, %ecx
movq -0x10(%rbp), %rdx
movzwl 0xa(%rdx), %edx
addl %edx, %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movw 0xa(%rax), %cx
addw $0x1, %cx
movw %cx, 0xa(%rax)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x3200
movq -0x18(%rbp), %rax
movw $0x29, 0x8(%rax)
movq -0x18(%rbp), %rax
movw $0x400, 0xa(%rax)       # imm = 0x400
movq -0x18(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_remove_optrr
int ns_remove_optrr(ns_msg_t *msg)
{
    int i, rrcount;
    ns_rr_t *rr;

    rrcount = ns_rrcount(msg);
    for (i = rrcount - 1; i >= 0; i--) {
        rr = msg->rrs + i;
        if (rr->type == NS_TYPE_OPT) {
            break;
        }
    }
    if (i >= 0) {
        ns_rdata_free_opts(rr);
        free(rr->rdata);
        memmove(msg->rrs + i, msg->rrs + i + 1,
                (rrcount - i - 1) * sizeof(ns_rr_t));
        msg->arcount--;
        return 0;
    }
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x6(%rax), %eax
movq -0x10(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
addl %ecx, %eax
movq -0x10(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x293ad
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x8(%rax), %eax
cmpl $0x29, %eax
jne 0x293a0
jmp 0x293ad
jmp 0x293a2
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x29374
cmpl $0x0, -0x14(%rbp)
jl 0x29421
movq -0x20(%rbp), %rdi
callq 0x291a0
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3460
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movslq -0x14(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movslq -0x14(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
addq $0x20, %rsi
movl -0x18(%rbp), %eax
subl -0x14(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdx
shlq $0x5, %rdx
callq 0x35b0
movq -0x10(%rbp), %rax
movw 0xa(%rax), %cx
addw $-0x1, %cx
movw %cx, 0xa(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x29428
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
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/ns_msg.c
// Function: ns_optrr_find_opt
ns_opt_t *ns_optrr_find_opt(ns_rr_t *rr, uint16_t code)
{
	ns_optlist_t *opts = rr->rdata;
    ns_opt_t *opt;
    int i;
    if (opts != NULL) {
        for (i = 0; i < opts->optcount; i++) {
            opt = opts->opts + i;
            if (opt->code == code) {
                return opt;
            }
        }
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %si, %ax
movq %rdi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x294b3
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x294b1
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movzwl (%rax), %eax
movzwl -0x12(%rbp), %ecx
cmpl %ecx, %eax
jne 0x294a4
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x294bb
jmp 0x294a6
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x29469
jmp 0x294b3
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)