LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_rdata_write_any
static int ns_rdata_write_any(serialize_ctx *ctx, stream_t *s, ns_rr_t *rr)
{
	if (rr->rdata != NULL) {
		if (stream_write(s, rr->rdata, rr->rdlength) != rr->rdlength)
			return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x2c93f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x20(%rbp), %rax
movzwl 0x10(%rax), %edx
callq 0x2d9e0
movq -0x20(%rbp), %rcx
movzwl 0x10(%rcx), %ecx
cmpl %ecx, %eax
je 0x2c93d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c946
jmp 0x2c93f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/ns_msg.c
// Function: ns_write_cstring
static int ns_write_cstring(serialize_ctx *ctx, stream_t *s, char *str)
{
	int len;

	len = str != NULL ? (int)strlen(str) : 0;

	if (stream_writei8(s, len) != 1)
		return -1;

	if (stream_write(s, str, len) != len)
		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)
cmpq $0x0, -0x20(%rbp)
je 0x2c979
movq -0x20(%rbp), %rdi
callq 0x3180
movl %eax, -0x28(%rbp)
jmp 0x2c980
xorl %eax, %eax
movl %eax, -0x28(%rbp)
jmp 0x2c980
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x1, %edx
callq 0x2dc90
cmpl $0x1, %eax
je 0x2c9a5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c9ca
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x2d9e0
cmpl -0x24(%rbp), %eax
je 0x2c9c3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2c9ca
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/sha1.c
// Function: sha1_init
void sha1_init(sha1nfo *s) {
	if (big_endian == -1) {
		int a = 0x1234;
		char b = *(char *)&a;
		if (b == 0x12)
			big_endian = 1;
		else
			big_endian = 0;
	}
	s->state[0] = 0x67452301;
	s->state[1] = 0xefcdab89;
	s->state[2] = 0x98badcfe;
	s->state[3] = 0x10325476;
	s->state[4] = 0xc3d2e1f0;
	s->byteCount = 0;
	s->bufferOffset = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
cmpl $-0x1, 0x14be9(%rip)    # 0x41b18
jne 0x2cf5f
movl $0x1234, -0xc(%rbp)     # imm = 0x1234
movb -0xc(%rbp), %al
movb %al, -0xd(%rbp)
movsbl -0xd(%rbp), %eax
cmpl $0x12, %eax
jne 0x2cf53
movl $0x1, 0x14bc7(%rip)     # 0x41b18
jmp 0x2cf5d
movl $0x0, 0x14bbb(%rip)     # 0x41b18
jmp 0x2cf5f
movq -0x8(%rbp), %rax
movl $0x67452301, 0x40(%rax) # imm = 0x67452301
movq -0x8(%rbp), %rax
movl $0xefcdab89, 0x44(%rax) # imm = 0xEFCDAB89
movq -0x8(%rbp), %rax
movl $0x98badcfe, 0x48(%rax) # imm = 0x98BADCFE
movq -0x8(%rbp), %rax
movl $0x10325476, 0x4c(%rax) # imm = 0x10325476
movq -0x8(%rbp), %rax
movl $0xc3d2e1f0, 0x50(%rax) # imm = 0xC3D2E1F0
movq -0x8(%rbp), %rax
movl $0x0, 0x54(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x58(%rax)
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/sha1.c
// Function: sha1_addUncounted
void sha1_addUncounted(sha1nfo *s, uint8_t data) {
	uint8_t * const b = (uint8_t*) s->buffer;
	if (big_endian)
		b[s->bufferOffset] = data;
	else
		b[s->bufferOffset ^ 3] = data;
	s->bufferOffset++;
	if (s->bufferOffset == BLOCK_LENGTH) {
		sha1_hashBlock(s);
		s->bufferOffset = 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, 0x14927(%rip)     # 0x41b18
je 0x2d207
movb -0x9(%rbp), %dl
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movzbl 0x58(%rcx), %ecx
movb %dl, (%rax,%rcx)
jmp 0x2d21f
movb -0x9(%rbp), %dl
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movzbl 0x58(%rcx), %ecx
xorl $0x3, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movb 0x58(%rax), %cl
addb $0x1, %cl
movb %cl, 0x58(%rax)
movq -0x8(%rbp), %rax
movzbl 0x58(%rax), %eax
cmpl $0x40, %eax
jne 0x2d24a
movq -0x8(%rbp), %rdi
callq 0x2cfe0
movq -0x8(%rbp), %rax
movb $0x0, 0x58(%rax)
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/sha1.c
// Function: sha1_pad
void sha1_pad(sha1nfo *s) {
	// Implement SHA-1 padding (fips180-2 Â§5.1.1)

	// Pad with 0x80 followed by 0x00 until the end of the block
	sha1_addUncounted(s, 0x80);
	while (s->bufferOffset != 56) sha1_addUncounted(s, 0x00);

	// Append length in the last 8 bytes
	sha1_addUncounted(s, 0); // We're only using 32 bit lengths
	sha1_addUncounted(s, 0); // But SHA-1 supports 64 bit lengths
	sha1_addUncounted(s, 0); // So zero pad the top bits
	sha1_addUncounted(s, s->byteCount >> 29); // Shifting to multiply by 8
	sha1_addUncounted(s, s->byteCount >> 21); // as SHA-1 supports bitstreams as well as
	sha1_addUncounted(s, s->byteCount >> 13); // byte.
	sha1_addUncounted(s, s->byteCount >> 5);
	sha1_addUncounted(s, s->byteCount << 3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x80, %esi
callq 0x2d1d0
movq -0x8(%rbp), %rax
movzbl 0x58(%rax), %eax
cmpl $0x38, %eax
je 0x2d314
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2d1d0
jmp 0x2d2fa
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2d1d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2d1d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2d1d0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x54(%rax), %eax
shrl $0x1d, %eax
movzbl %al, %esi
callq 0x2d1d0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x54(%rax), %eax
shrl $0x15, %eax
movzbl %al, %esi
callq 0x2d1d0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x54(%rax), %eax
shrl $0xd, %eax
movzbl %al, %esi
callq 0x2d1d0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x54(%rax), %eax
shrl $0x5, %eax
movzbl %al, %esi
callq 0x2d1d0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x54(%rax), %eax
shll $0x3, %eax
movzbl %al, %esi
callq 0x2d1d0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/sha1.c
// Function: sha1_result
uint8_t* sha1_result(sha1nfo *s) {
	// Pad to complete the last block
	sha1_pad(s);

	if (!big_endian) {
		// Swap byte order back
		int i;
		for (i = 0; i < 5; i++) {
			s->state[i] =
				(((s->state[i]) << 24) & 0xff000000)
				| (((s->state[i]) << 8) & 0x00ff0000)
				| (((s->state[i]) >> 8) & 0x0000ff00)
				| (((s->state[i]) >> 24) & 0x000000ff);
		}
	}

	// Return pointer to hash (20 characters)
	return (uint8_t*) s->state;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2d2e0
cmpl $0x0, 0x1474c(%rip)     # 0x41b18
jne 0x2d44b
movl $0x0, -0xc(%rbp)
cmpl $0x5, -0xc(%rbp)
jge 0x2d449
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movl 0x40(%rax,%rcx,4), %edx
shll $0x18, %edx
andl $0xff000000, %edx       # imm = 0xFF000000
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movl 0x40(%rax,%rcx,4), %eax
shll $0x8, %eax
andl $0xff0000, %eax         # imm = 0xFF0000
orl %eax, %edx
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movl 0x40(%rax,%rcx,4), %eax
shrl $0x8, %eax
andl $0xff00, %eax           # imm = 0xFF00
orl %eax, %edx
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movl 0x40(%rax,%rcx,4), %eax
shrl $0x18, %eax
andl $0xff, %eax
orl %eax, %edx
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movl %edx, 0x40(%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2d3d5
jmp 0x2d44b
movq -0x8(%rbp), %rax
addq $0x40, %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/sha1.c
// Function: sha1_initHmac
void sha1_initHmac(sha1nfo *s, const uint8_t* key, int keyLength) {
	uint8_t i;
	memset(s->keyBuffer, 0, BLOCK_LENGTH);
	if (keyLength > BLOCK_LENGTH) {
		// Hash long keys
		sha1_init(s);
		for (;keyLength--;) sha1_writebyte(s, *key++);
		memcpy(s->keyBuffer, sha1_result(s), HASH_LENGTH);
	} else {
		// Block length keys are used as is
		memcpy(s->keyBuffer, key, keyLength);
	}
	// Start inner hash
	sha1_init(s);
	for (i=0; i<BLOCK_LENGTH; i++) {
		sha1_writebyte(s, s->keyBuffer[i] ^ HMAC_IPAD);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
addq $0x59, %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x3200
cmpl $0x40, -0x14(%rbp)
jle 0x2d4f2
movq -0x8(%rbp), %rdi
callq 0x2cf20
movl -0x14(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x14(%rbp)
cmpl $0x0, %eax
je 0x2d4c3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movzbl (%rax), %esi
callq 0x2d250
jmp 0x2d496
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2d3b0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x59(%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x61(%rax)
movl 0x10(%rcx), %ecx
movl %ecx, 0x69(%rax)
jmp 0x2d507
movq -0x8(%rbp), %rdi
addq $0x59, %rdi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
callq 0x32d0
movq -0x8(%rbp), %rdi
callq 0x2cf20
movb $0x0, -0x15(%rbp)
movzbl -0x15(%rbp), %eax
cmpl $0x40, %eax
jge 0x2d543
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movzbl -0x15(%rbp), %ecx
movzbl 0x59(%rax,%rcx), %eax
xorl $0x36, %eax
movzbl %al, %esi
callq 0x2d250
movb -0x15(%rbp), %al
addb $0x1, %al
movb %al, -0x15(%rbp)
jmp 0x2d514
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/sha1.c
// Function: sha1_resultHmac
uint8_t* sha1_resultHmac(sha1nfo *s) {
	uint8_t i;
	// Complete inner hash
	memcpy(s->innerHash,sha1_result(s),HASH_LENGTH);
	// Calculate outer hash
	sha1_init(s);
	for (i=0; i<BLOCK_LENGTH; i++) sha1_writebyte(s, s->keyBuffer[i] ^ HMAC_OPAD);
	for (i=0; i<HASH_LENGTH; i++) sha1_writebyte(s, s->innerHash[i]);
	return sha1_result(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2d3b0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x99(%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0xa1(%rax)
movl 0x10(%rcx), %ecx
movl %ecx, 0xa9(%rax)
movq -0x8(%rbp), %rdi
callq 0x2cf20
movb $0x0, -0x9(%rbp)
movzbl -0x9(%rbp), %eax
cmpl $0x40, %eax
jge 0x2d5ce
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movzbl -0x9(%rbp), %ecx
movzbl 0x59(%rax,%rcx), %eax
xorl $0x5c, %eax
movzbl %al, %esi
callq 0x2d250
movb -0x9(%rbp), %al
addb $0x1, %al
movb %al, -0x9(%rbp)
jmp 0x2d59f
movb $0x0, -0x9(%rbp)
movzbl -0x9(%rbp), %eax
cmpl $0x14, %eax
jge 0x2d5fe
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movzbl -0x9(%rbp), %ecx
movzbl 0x99(%rax,%rcx), %esi
callq 0x2d250
movb -0x9(%rbp), %al
addb $0x1, %al
movb %al, -0x9(%rbp)
jmp 0x2d5d2
movq -0x8(%rbp), %rdi
callq 0x2d3b0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/main.c
// Function: main
int main(int argc, char** argv)
{
#ifdef WINDOWS
	win_init();
	log_init();
#endif

	conf.log_level = loglevel;

	if (conf_parse_args(&conf, argc, argv) != 0) {
		usage();
		exit(-1);
		return EXIT_FAILURE;
	}

	if (conf.is_print_help) {
		usage();
		exit(0);
		return EXIT_SUCCESS;
	}

	if (conf.is_print_version) {
		printf(DOHCLIENT_NAME " v" DOHCLIENT_VERSION "%s\n", git_version());
		exit(0);
		return EXIT_SUCCESS;
	}

	loglevel = conf.log_level;

	if (conf.daemonize) {
		run_as_daemonize();
		return EXIT_SUCCESS;
	}

	if (init_dohclient() != 0)
		return EXIT_FAILURE;

	if (do_loop() != 0) {
		loge("Exit with error\n");
		return EXIT_FAILURE;
	}

	uninit_dohclient();

	conf_free(&conf);

	print_leak();

	return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, %al
callq 0x242d0
movl (%rax), %eax
movl %eax, 0x12003(%rip)     # 0x41bb8
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq 0x11f65(%rip), %rdi     # 0x41b28
callq 0x1c620
cmpl $0x0, %eax
je 0x2fbdc
callq 0x2fcd0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3470
cmpl $0x0, 0x11fdd(%rip)     # 0x41bc0
je 0x2fbf1
callq 0x2fcd0
xorl %edi, %edi
callq 0x3470
cmpl $0x0, 0x11fc4(%rip)     # 0x41bbc
je 0x2fc17
callq 0x2fd10
movq %rax, %rsi
leaq 0x8fa5(%rip), %rdi      # 0x38bae
movb $0x0, %al
callq 0x3050
xorl %edi, %edi
callq 0x3470
movl 0x11f9b(%rip), %eax     # 0x41bb8
movl %eax, -0x14(%rbp)
movb $0x0, %al
callq 0x242d0
movl -0x14(%rbp), %ecx
movl %ecx, (%rax)
cmpl $0x0, 0x11f79(%rip)     # 0x41bac
je 0x2fc43
callq 0x2fd50
movl $0x0, -0x4(%rbp)
jmp 0x2fcc1
callq 0x2ff60
cmpl $0x0, %eax
je 0x2fc56
movl $0x1, -0x4(%rbp)
jmp 0x2fcc1
callq 0x308f0
cmpl $0x0, %eax
je 0x2fc9f
jmp 0x2fc62
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x2fc94
movl $0x3, %edi
leaq 0x8f48(%rip), %rsi      # 0x38bc2
leaq 0x8f4c(%rip), %rdx      # 0x38bcd
movl $0x5d6, %ecx            # imm = 0x5D6
leaq 0x8f45(%rip), %r8       # 0x38bd2
movb $0x0, %al
callq 0x243b0
jmp 0x2fc96
movl $0x1, -0x4(%rbp)
jmp 0x2fcc1
callq 0x33440
leaq 0x11e7d(%rip), %rdi     # 0x41b28
callq 0x1de50
xorl %eax, %eax
testb $0x1, %al
jne 0x2fcb8
jmp 0x2fcba
jmp 0x2fcb0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/main.c
// Function: server_udp_recv
static int server_udp_recv(int listen_index)
{
	listen_t* ctx = listens + listen_index;
	sock_t sock = ctx->usock;
	int nread;
	char buffer[NS_PAYLOAD_SIZE + 1];
	struct sockaddr_storage from = { 0 };
	int fromlen = sizeof(struct sockaddr_storage);

	nread = udp_recv(sock, buffer, sizeof(buffer),
		(struct sockaddr*) & from, &fromlen);

	if (nread == -1)
		return -1;

	if (nread == 0)
		return 0;

	logv("server  recv %d bytes - %s \tproto:udp\n",
		nread, get_addrname((struct sockaddr*) & from));

	if (loglevel > LOG_DEBUG) {
		bprint(buffer, nread);
	}

	if (nread > NS_PAYLOAD_SIZE) {
		loge("too large dns-message\n");
		return -1;
	}

	buffer[nread] = '\0'; /* so, can print as string */

	if (server_recv_msg(buffer, nread, listen_index, &from, fromlen, FALSE)) {
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4b0, %rsp            # imm = 0x4B0
movl %edi, -0x8(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x110d7(%rip), %rax     # 0x42a90
imulq $0x90, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x8c(%rax), %eax
movl %eax, -0x14(%rbp)
leaq -0x4a0(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x3200
movl $0x80, -0x4a4(%rbp)
movl -0x14(%rbp), %edi
leaq -0x420(%rbp), %rsi
movl $0x401, %edx            # imm = 0x401
leaq -0x4a0(%rbp), %rcx
leaq -0x4a4(%rbp), %r8
callq 0x26960
movl %eax, -0x18(%rbp)
cmpl $-0x1, -0x18(%rbp)
jne 0x31a28
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x31b49
cmpl $0x0, -0x18(%rbp)
jne 0x31a3a
movl $0x0, -0x4(%rbp)
jmp 0x31b49
jmp 0x31a3c
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x31a8e
movl -0x18(%rbp), %eax
movl %eax, -0x4a8(%rbp)
leaq -0x4a0(%rbp), %rdi
callq 0x25020
movl -0x4a8(%rbp), %r9d
movl $0x8, %edi
leaq 0x7152(%rip), %rsi      # 0x38bc2
leaq 0x7f5e(%rip), %rdx      # 0x399d5
movl $0x28d, %ecx            # imm = 0x28D
leaq 0x7f62(%rip), %r8       # 0x399e5
movq %rax, (%rsp)
movb $0x0, %al
callq 0x243b0
jmp 0x31a90
movb $0x0, %al
callq 0x242d0
cmpl $0x7, (%rax)
jle 0x31abd
jmp 0x31a9e
movb $0x0, %al
callq 0x242d0
cmpl $0x7, (%rax)
jl 0x31ab9
leaq -0x420(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x2e3d0
jmp 0x31abb
jmp 0x31abd
cmpl $0x400, -0x18(%rbp)     # imm = 0x400
jle 0x31b05
jmp 0x31ac8
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x31afa
movl $0x3, %edi
leaq 0x70e2(%rip), %rsi      # 0x38bc2
leaq 0x7eee(%rip), %rdx      # 0x399d5
movl $0x294, %ecx            # imm = 0x294
leaq 0x7f19(%rip), %r8       # 0x39a0c
movb $0x0, %al
callq 0x243b0
jmp 0x31afc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x31b49
movslq -0x18(%rbp), %rax
movb $0x0, -0x420(%rbp,%rax)
leaq -0x420(%rbp), %rdi
movl -0x18(%rbp), %esi
movl -0x8(%rbp), %edx
movl -0x4a4(%rbp), %r8d
leaq -0x4a0(%rbp), %rcx
xorl %r9d, %r9d
callq 0x320b0
cmpl $0x0, %eax
je 0x31b42
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x31b49
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x4b0, %rsp            # imm = 0x4B0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/main.c
// Function: peer_write
static int peer_write(peer_t* peer)
{
	sock_t sock = peer->conn.sock;
	stream_t* s = &peer->conn.ws;
	int nsend;

	nsend = tcp_send(sock, s);

	if (nsend == -1)
		return -1;

	if (nsend == 0)
		return 0;

	peer->conn.tx += nsend;

	logv("write to %s\n", get_sockname(sock));

	if (is_close_after_rsp(&peer->conn)) {
		/* wait 3 seconds */
		close_after(&peer->conn, 3);
	}
	else {
		update_expire(&peer->conn);
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %edi
movq -0x20(%rbp), %rsi
callq 0x265a0
movl %eax, -0x24(%rbp)
cmpl $-0x1, -0x24(%rbp)
jne 0x31d42
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x31dce
cmpl $0x0, -0x24(%rbp)
jne 0x31d51
movl $0x0, -0x4(%rbp)
jmp 0x31dce
movslq -0x24(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0x60(%rax), %rcx
movq %rcx, 0x60(%rax)
movb $0x0, %al
callq 0x242d0
cmpl $0x8, (%rax)
jl 0x31d9e
movl -0x14(%rbp), %edi
callq 0x25120
movq %rax, %r9
movl $0x8, %edi
leaq 0x6e3e(%rip), %rsi      # 0x38bc2
leaq 0x7de9(%rip), %rdx      # 0x39b74
movl $0x33d, %ecx            # imm = 0x33D
leaq 0x7de8(%rip), %r8       # 0x39b7f
movb $0x0, %al
callq 0x243b0
jmp 0x31da0
movq -0x10(%rbp), %rdi
callq 0x33420
cmpl $0x0, %eax
je 0x31dbe
movq -0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x32070
jmp 0x31dc7
movq -0x10(%rbp), %rdi
callq 0x32040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/main.c
// Function: peer_close
static void peer_close(peer_t* peer)
{
	dlitem_t* cur, * nxt;
	req_t* req;
	dllist_remove(&peer->conn.entry);
	dllist_foreach(&peer->reqs, cur, nxt,
		req_t, req, entry_peer) {
		req_remove(req);
	}
#if DOHCLIENT_CACHE_API
	if (peer->hsctx)
		hsctx_free(peer->hsctx);
#endif
	peer_destroy(peer);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x68, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
addq $0x70, %rcx
cmpq %rcx, %rax
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x31e88
jmp 0x31eba
movq -0x20(%rbp), %rdi
callq 0x32f60
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 $0x68, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x31e6e
movq -0x8(%rbp), %rdi
callq 0x26e10
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/main.c
// Function: req_check_expire
static void req_check_expire(time_t now)
{
	dlitem_t* cur, * nxt;
	req_t* req;
	dllist_foreach(&reqs, cur, nxt, req_t, req, entry) {
		if (req->expire > 0 && req->expire <= now) {
			loge("request timeout (id:%d) - %s %s %s\n",
				req->id,
				ns_typename(req->msg->qrs[0].qtype),
				ns_classname(req->msg->qrs[0].qclass),
				req->msg->qrs[0].qname);
			req_remove(req);
		}
		else {
			break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq 0xfcf5(%rip), %rax      # 0x41bd8
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
movq %rax, %rcx
addq $0x58, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0xfccb(%rip), %rax      # 0x41bd8
cmpq %rax, -0x10(%rbp)
sete %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x31f1f
jmp 0x32014
movq -0x20(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jle 0x31fe4
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
cmpq -0x8(%rbp), %rax
jg 0x31fe4
jmp 0x31f42
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x31fd7
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movzwl 0x8(%rax), %edi
callq 0x27a50
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movzwl 0xa(%rax), %edi
callq 0x27d20
movl -0x2c(%rbp), %r9d
movq -0x28(%rbp), %r11
movq %rax, %r10
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movl $0x3, %edi
leaq 0x6c13(%rip), %rsi      # 0x38bc2
leaq 0x7bd6(%rip), %rdx      # 0x39b8c
movl $0x1a4, %ecx            # imm = 0x1A4
leaq 0x7bdb(%rip), %r8       # 0x39b9d
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x243b0
jmp 0x31fd9
movq -0x20(%rbp), %rdi
callq 0x32f60
jmp 0x31fe6
jmp 0x32014
jmp 0x31fe8
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 $0x58, %rcx
subq %rcx, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x31f06
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/main.c
// Function: server_recv_msg
static int server_recv_msg(const char *data, int datalen,
	int listen,
	void *from, int fromlen, int fromtcp)
{
	req_t* req;

#if DOHCLIENT_CACHE_API
	if (conf.cache_api) {
		int r;

		r = cache_api_try_parse(cache, data, datalen, &listens[listen],
				from, fromlen, fromtcp);
		if (r == 0) {
			return 0;
		}
		else if (r == -1) {
			return -1;
		}
	}
#endif

	req = req_add_new(data, datalen, listen, from, fromlen, fromtcp);
	if (!req) {
		return -1;
	}

	if (hosts) {
		return hosts->query(hosts, req->msg, hosts_cb, req);
	}
	else {
		return cache->query(cache, req->msg, cache_cb, req);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movl -0x28(%rbp), %r9d
callq 0x32170
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x320fd
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3215d
cmpq $0x0, 0x10963(%rip)     # 0x42a68
je 0x32133
movq 0x1095a(%rip), %rax     # 0x42a68
movq 0x40(%rax), %rax
movq 0x1094f(%rip), %rdi     # 0x42a68
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rsi
movq -0x30(%rbp), %rcx
leaq 0x2d4(%rip), %rdx       # 0x32400
callq *%rax
movl %eax, -0x4(%rbp)
jmp 0x3215d
movq 0x10936(%rip), %rax     # 0x42a70
movq 0x40(%rax), %rax
movq 0x1092b(%rip), %rdi     # 0x42a70
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rsi
movq -0x30(%rbp), %rcx
leaq 0x348(%rip), %rdx       # 0x324a0
callq *%rax
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/main.c
// Function: hosts_cb
static int hosts_cb(channel_t* ctx,
	int status,
	ns_msg_t* result,
	int fromcache,
	int trust,
	void* state)
{
	req_t* req = state;

	if (status || !result || result->qdcount < 1) {
		return cache->query(cache, req->msg, cache_cb, req);
	}
	else {
		return _query_cb(ctx, status, result, fromcache, trust, state);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x32440
cmpq $0x0, -0x20(%rbp)
je 0x32440
movq -0x20(%rbp), %rax
movzwl 0x4(%rax), %eax
cmpl $0x1, %eax
jge 0x3246c
movq 0x10629(%rip), %rax     # 0x42a70
movq 0x40(%rax), %rax
movq 0x1061e(%rip), %rdi     # 0x42a70
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %rsi
movq -0x38(%rbp), %rcx
leaq 0x3b(%rip), %rdx        # 0x324a0
callq *%rax
movl %eax, -0x4(%rbp)
jmp 0x3248a
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
movq -0x30(%rbp), %r9
callq 0x329a0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/main.c
// Function: cache_cb
static int cache_cb(channel_t* ctx,
	int status,
	ns_msg_t* result,
	int fromcache,
	int trust,
	void* state)
{
	req_t* req = state;

	if (status || !result || result->qdcount < 1) {
		chooser_t chooser[1] = {0};
		channel_t* channel;
		int n = 0, r;
		while ((channel = choose_channel(chooser)) != NULL) {
			r = channel->query(channel, req->msg, query_cb, req);
			if (r == 0) {
				n++;
			}
		}
		if (n > 0)
			return 0;
	}
	return _query_cb(ctx, status, result, fromcache, trust, state);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x324e0
cmpq $0x0, -0x20(%rbp)
je 0x324e0
movq -0x20(%rbp), %rax
movzwl 0x4(%rax), %eax
cmpl $0x1, %eax
jge 0x32550
leaq -0x3c(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x3200
movl $0x0, -0x4c(%rbp)
leaq -0x3c(%rbp), %rdi
callq 0x33120
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0x3253f
movq -0x48(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x48(%rbp), %rdi
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %rsi
movq -0x38(%rbp), %rcx
leaq 0xd47(%rip), %rdx       # 0x33270
callq *%rax
movl %eax, -0x50(%rbp)
cmpl $0x0, -0x50(%rbp)
jne 0x3253d
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x324f7
cmpl $0x0, -0x4c(%rbp)
jle 0x3254e
movl $0x0, -0x4(%rbp)
jmp 0x3256e
jmp 0x32550
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
movq -0x30(%rbp), %r9
callq 0x329a0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/main.c
// Function: msg_check
static int msg_check(ns_msg_t* msg)
{
	ns_flags_t flags;
	if (!msg ||
		msg->qdcount < 1 ||
		!msg->qrs[0].qname ||
		!msg->qrs[0].qname[0]) {
		loge("no question\n");
		return FALSE;
	}
	else if (msg->qdcount > 1) {
		logw("multi questions\n");
	}
	flags = ns_get_flags(msg);
	if (flags.qr)
		return FALSE;
	if (flags.opcode)
		return FALSE;
	if (flags.tc)
		return FALSE;
	if (msg->qrs->qtype != NS_QTYPE_A && msg->qrs->qtype != NS_QTYPE_AAAA)
		return FALSE;
	if (msg->qrs->qclass != NS_QCLASS_IN)
		return FALSE;
	return TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x325be
movq -0x10(%rbp), %rax
movzwl 0x4(%rax), %eax
cmpl $0x1, %eax
jl 0x325be
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpq $0x0, (%rax)
je 0x325be
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
cmpb $0x0, (%rax)
jne 0x32600
jmp 0x325c0
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x325f2
movl $0x3, %edi
leaq 0x65ea(%rip), %rsi      # 0x38bc2
leaq 0x7484(%rip), %rdx      # 0x39a63
movl $0xbd, %ecx
leaq 0x41e2(%rip), %r8       # 0x367cd
movb $0x0, %al
callq 0x243b0
jmp 0x325f4
movl $0x0, -0x4(%rbp)
jmp 0x326ee
movq -0x10(%rbp), %rax
movzwl 0x4(%rax), %eax
cmpl $0x1, %eax
jle 0x32645
jmp 0x3260f
movb $0x0, %al
callq 0x242d0
cmpl $0x4, (%rax)
jl 0x32641
movl $0x4, %edi
leaq 0x659b(%rip), %rsi      # 0x38bc2
leaq 0x7435(%rip), %rdx      # 0x39a63
movl $0xc1, %ecx
leaq 0x7433(%rip), %r8       # 0x39a6d
movb $0x0, %al
callq 0x243b0
jmp 0x32643
jmp 0x32645
jmp 0x32647
movq -0x10(%rbp), %rdi
callq 0x26e80
movw %ax, -0x14(%rbp)
movw -0x14(%rbp), %ax
movw %ax, -0x12(%rbp)
movw -0x12(%rbp), %ax
andw $0x1, %ax
cmpb $0x0, %al
je 0x32671
movl $0x0, -0x4(%rbp)
jmp 0x326ee
movw -0x12(%rbp), %ax
shrw %ax
andw $0xf, %ax
cmpb $0x0, %al
je 0x32689
movl $0x0, -0x4(%rbp)
jmp 0x326ee
movw -0x12(%rbp), %ax
shrw $0x6, %ax
andw $0x1, %ax
cmpb $0x0, %al
je 0x326a2
movl $0x0, -0x4(%rbp)
jmp 0x326ee
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movzwl 0x8(%rax), %eax
cmpl $0x1, %eax
je 0x326cd
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movzwl 0x8(%rax), %eax
cmpl $0x1c, %eax
je 0x326cd
movl $0x0, -0x4(%rbp)
jmp 0x326ee
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movzwl 0xa(%rax), %eax
cmpl $0x1, %eax
je 0x326e7
movl $0x0, -0x4(%rbp)
jmp 0x326ee
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/main.c
// Function: reqdic_add
static int reqdic_add(req_t *req, const char* key)
{
	struct rbnode_t* n;
	rbn_t* rbn;

	n = rbtree_lookup(&reqdic, (void*)key);
	if (n) {
		rbn = rbtree_container_of(n, rbn_t, node);
		dllist_add(&rbn->reqs, &req->entry_rbn);
	}
	else {
		rbn = (rbn_t*)malloc(sizeof(rbn_t));
		if (!rbn) {
			loge("alloc\n");
			return FALSE;
		}
		memset(rbn, 0, sizeof(rbn_t));
		dllist_init(&rbn->reqs);
		rbn->key = strdup(key);
		rbn->ctime = OS_GetTickCount();
		rbn->node.key = rbn->key;
		rbtree_insert(&reqdic, &rbn->node);
		dllist_add(&rbn->reqs, &req->entry_rbn);
		logd("reqdic added - %s\n", rbn->key);
	}
	return TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rsi
leaq 0xf4ad(%rip), %rdi      # 0x41be8
callq 0x3b10
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x327aa
xorl %eax, %eax
movq %rax, %rcx
addq $0x10, %rcx
subq %rcx, %rax
addq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
addq $0x38, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x10(%rbp), %rcx
addq $0x78, %rcx
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
addq $0x78, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x40(%rax)
jmp 0x328fe
movl $0x48, %edi
callq 0x34d0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x32801
jmp 0x327c1
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x327f3
movl $0x3, %edi
leaq 0x63e9(%rip), %rsi      # 0x38bc2
leaq 0x729e(%rip), %rdx      # 0x39a7e
movl $0xe4, %ecx
leaq 0x46ab(%rip), %r8       # 0x36e97
movb $0x0, %al
callq 0x243b0
jmp 0x327f5
movl $0x0, -0x4(%rbp)
jmp 0x32905
movq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x3200
movq -0x28(%rbp), %rcx
addq $0x38, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x28(%rbp), %rcx
addq $0x38, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x18(%rbp), %rdi
callq 0x3620
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movb $0x0, %al
callq 0x26e40
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rsi
addq $0x10, %rsi
leaq 0xf374(%rip), %rdi      # 0x41be8
callq 0x3790
movq -0x28(%rbp), %rcx
addq $0x38, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x10(%rbp), %rcx
addq $0x78, %rcx
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
addq $0x78, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x40(%rax)
jmp 0x328c1
movb $0x0, %al
callq 0x242d0
cmpl $0x7, (%rax)
jl 0x328fa
movq -0x28(%rbp), %rax
movq (%rax), %r9
movl $0x7, %edi
leaq 0x62e2(%rip), %rsi      # 0x38bc2
leaq 0x7197(%rip), %rdx      # 0x39a7e
movl $0xee, %ecx
leaq 0x7196(%rip), %r8       # 0x39a89
movb $0x0, %al
callq 0x243b0
jmp 0x328fc
jmp 0x328fe
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/main.c
// Function: reqdic_find
static rbn_t* reqdic_find(const char* key)
{
	rbn_t* rbn = NULL;
	struct rbnode_t* n;

	n = rbtree_lookup(&reqdic, key);

	if (n) {
		rbn = rbtree_container_of(n, rbn_t, node);
	}

	return rbn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rsi
leaq 0xef49(%rip), %rdi      # 0x41be8
callq 0x3b10
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x32cc3
xorl %eax, %eax
movq %rax, %rcx
addq $0x10, %rcx
subq %rcx, %rax
addq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/main.c
// Function: req_remove
static void req_remove(req_t* req)
{
	peer_t* peer;
	const char* key;
	if (req->fromtcp) {
		peer = req->from;
		dllist_remove(&req->entry_peer);
	}
	dllist_remove(&req->entry);
	key = req_key(req);
	reqdic_remove(req, key);
	logd("request removed (id:%d) - %s\n",
		req->id,
		key);
	req_destroy(req);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x24(%rax)
je 0x32fab
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq %rcx, 0x8(%rax)
jmp 0x32fab
jmp 0x32fad
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
callq 0x32700
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x33040
movb $0x0, %al
callq 0x242d0
cmpl $0x7, (%rax)
jl 0x3302f
movq -0x8(%rbp), %rax
movl (%rax), %r9d
movq -0x18(%rbp), %rax
movl $0x7, %edi
leaq 0x5bb1(%rip), %rsi      # 0x38bc2
leaq 0x6ace(%rip), %rdx      # 0x39ae6
movl $0x158, %ecx            # imm = 0x158
leaq 0x6acd(%rip), %r8       # 0x39af1
movq %rax, (%rsp)
movb $0x0, %al
callq 0x243b0
jmp 0x33031
movq -0x8(%rbp), %rdi
callq 0x1e340
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/main.c
// Function: reqdic_remove
static void reqdic_remove(req_t* req, const char* key)
{
	rbn_t* rbn;

	dllist_remove(&req->entry_rbn);

	/* empty list, so remove the rb-tree node */
	if (req->entry_rbn.prev->next == req->entry_rbn.prev) {
		rbn = rbtree_container_of(req->entry_rbn.prev, rbn_t, reqs.head);
		rbtree_remove(&reqdic, &rbn->node);
		logd("reqdic removed - %s\n", rbn->key);
		free(rbn->key);
		free(rbn);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x80(%rcx), %rax
jne 0x33117
movq -0x8(%rbp), %rcx
xorl %eax, %eax
movq %rax, %rdx
addq $0x38, %rdx
subq %rdx, %rax
addq 0x80(%rcx), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
addq $0x10, %rsi
leaq 0xeb26(%rip), %rdi      # 0x41be8
callq 0x3b90
movb $0x0, %al
callq 0x242d0
cmpl $0x7, (%rax)
jl 0x33100
movq -0x18(%rbp), %rax
movq (%rax), %r9
movl $0x7, %edi
leaq 0x5adc(%rip), %rsi      # 0x38bc2
leaq 0x6a22(%rip), %rdx      # 0x39b0f
movl $0xfe, %ecx
leaq 0x6a24(%rip), %r8       # 0x39b1d
movb $0x0, %al
callq 0x243b0
jmp 0x33102
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x3460
movq -0x18(%rbp), %rdi
callq 0x3460
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/GangZhuo[P]dohclient/src/main.c
// Function: choose_channel
static channel_t *choose_channel(chooser_t *chooser)
{
	channel_t *ch = NULL;
	int i;
	if (!chooser)
		return NULL;
	switch (conf.channel_choose_mode) {
		case CHOOSE_MODE_CONCUR:
			if (chooser->current >= channel_num)
				return NULL;
			i = chooser->current++;
			ch = channels[i];
			break;
		case CHOOSE_MODE_POLL:
			if (chooser->current)
				return NULL;
			i = (++last_choosed_channel) % channel_num;
			chooser->current = i + 1;
			ch = channels[i];
			break;
		case CHOOSE_MODE_RANDOM:
		default:
			if (chooser->current)
				return NULL;
			if (channel_num > 1) {
				i = rand() % channel_num;
			}
			else {
				i = 0;
			}
			chooser->current = i + 1;
			ch = channels[i];
			break;
	}
	return ch;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x33148
movq $0x0, -0x8(%rbp)
jmp 0x33262
movl 0xea5a(%rip), %eax      # 0x41ba8
movl %eax, -0x20(%rbp)
testl %eax, %eax
je 0x33205
jmp 0x3315b
movl -0x20(%rbp), %eax
subl $0x1, %eax
je 0x33172
jmp 0x33165
movl -0x20(%rbp), %eax
subl $0x2, %eax
je 0x331b5
jmp 0x33207
movq -0x10(%rbp), %rax
movl (%rax), %eax
cmpl 0xf8fa(%rip), %eax      # 0x42a78
jl 0x3318d
movq $0x0, -0x8(%rbp)
jmp 0x33262
movq -0x10(%rbp), %rcx
movl (%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, (%rcx)
movl %eax, -0x1c(%rbp)
movq 0xf8dc(%rip), %rax      # 0x42a80
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
jmp 0x3325a
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x331cb
movq $0x0, -0x8(%rbp)
jmp 0x33262
movl 0xea27(%rip), %eax      # 0x41bf8
addl $0x1, %eax
movl %eax, 0xea1e(%rip)      # 0x41bf8
cltd
idivl 0xf897(%rip)            # 0x42a78
movl %edx, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq 0xf889(%rip), %rax      # 0x42a80
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
jmp 0x3325a
jmp 0x33207
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
je 0x3321a
movq $0x0, -0x8(%rbp)
jmp 0x33262
cmpl $0x1, 0xf857(%rip)      # 0x42a78
jle 0x33234
callq 0x3100
cltd
idivl 0xf849(%rip)            # 0x42a78
movl %edx, -0x1c(%rbp)
jmp 0x3323b
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq 0xf832(%rip), %rax      # 0x42a80
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
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/main.c
// Function: peer_handle_recv
static int peer_handle_recv(peer_t* peer)
{
	stream_t* s = &peer->conn.rs;
	int msglen, left;

#if DOHCLIENT_CACHE_API
	if (conf.cache_api && peer->is_hs) {
		return hs_onrecv(peer);
	}
#endif

	while ((left = stream_rsize(s)) >= 6) {
		msglen = stream_geti(s, s->pos, 2);
		if (msglen > NS_PAYLOAD_SIZE) {
#if DOHCLIENT_CACHE_API
			if (conf.cache_api && hs_can_parse(s->array + s->pos)) {
				return hs_onrecv(peer);
			}
			else
#endif
			{
				loge("too large dns-message (msglen=0x%.4x)\n", msglen);
				return -1;
			}
		}
		else if (left >= (msglen + 2)) {
			if (server_recv_msg(s->array + s->pos + 2, msglen, peer->listen, peer, 0, TRUE)) {
				return -1;
			}
			else {
				s->pos += (msglen + 2);
			}
		}
		else {
			break;
		}
	}

	if (s->pos > 0) {
		if (stream_quake(s)) {
			loge("stream_quake() failed\n");
			return -1;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
subl 0xc(%rcx), %eax
movl %eax, -0x20(%rbp)
cmpl $0x6, %eax
jl 0x333b1
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %esi
movl $0x2, %edx
callq 0x2dee0
movl %eax, -0x1c(%rbp)
cmpl $0x400, -0x1c(%rbp)     # imm = 0x400
jle 0x33349
jmp 0x33305
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x3333b
movl -0x1c(%rbp), %r9d
movl $0x3, %edi
leaq 0x58a1(%rip), %rsi      # 0x38bc2
leaq 0x683b(%rip), %rdx      # 0x39b63
movl $0x2e1, %ecx            # imm = 0x2E1
leaq 0x3853(%rip), %r8       # 0x36b87
movb $0x0, %al
callq 0x243b0
jmp 0x3333d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x33411
movl -0x20(%rbp), %eax
movl -0x1c(%rbp), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jl 0x333a8
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movslq 0xc(%rax), %rax
addq %rax, %rdi
addq $0x2, %rdi
movl -0x1c(%rbp), %esi
movq -0x10(%rbp), %rax
movl 0x68(%rax), %edx
movq -0x10(%rbp), %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x320b0
cmpl $0x0, %eax
je 0x33396
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x33411
movl -0x1c(%rbp), %ecx
addl $0x2, %ecx
movq -0x18(%rbp), %rax
addl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
jmp 0x333aa
jmp 0x333b1
jmp 0x333ac
jmp 0x332c8
movq -0x18(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jle 0x3340a
movq -0x18(%rbp), %rdi
callq 0x2d870
cmpl $0x0, %eax
je 0x33408
jmp 0x333cb
movb $0x0, %al
callq 0x242d0
cmpl $0x3, (%rax)
jl 0x333fd
movl $0x3, %edi
leaq 0x57df(%rip), %rsi      # 0x38bc2
leaq 0x6779(%rip), %rdx      # 0x39b63
movl $0x2f4, %ecx            # imm = 0x2F4
leaq 0x37b8(%rip), %r8       # 0x36bae
movb $0x0, %al
callq 0x243b0
jmp 0x333ff
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x33411
jmp 0x3340a
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/unsorted0/speclist.c
// Function: getline_1
void getline_1(FILE *in,int *linenum,int *linelen,int *t)
{
int b1,b2,f;

b1=fgetc(in);
b2=fgetc(in);
*linenum=b1*256+b2;
(*t)-=2;

b1=fgetc(in);
b2=fgetc(in);
*linelen=b1+256*b2;
(*t)-=2;

for(f=0;f<*linelen;f++)
  {
  linebuf[f]=fgetc(in);
  (*t)--;
  }
}

// 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
callq 0x2090
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2090
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %ecx
shll $0x8, %ecx
addl -0x28(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %ecx
subl $0x2, %ecx
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
callq 0x2090
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2090
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %eax
shll $0x8, %eax
addl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movl (%rax), %ecx
subl $0x2, %ecx
movl %ecx, (%rax)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x225f
movq -0x8(%rbp), %rdi
callq 0x2090
movb %al, %dl
movslq -0x2c(%rbp), %rcx
leaq 0x362a(%rip), %rax      # 0x5870
movb %dl, (%rax,%rcx)
movq -0x20(%rbp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2225
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/unsorted0/speclist.c
// Function: xlatline
void xlatline(int linelen)
{
int f;

for(f=0;f<linelen-1;f++)
  {
  if((linebuf[0]!=234)&&(linebuf[f]==14))
    f+=5;  /* avoid inline FP numbers - but ok for REMs */
  else
    printf("%s",charset[linebuf[f]]);
  }
printf("\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl -0x4(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x22f3
movzbl 0x35da(%rip), %eax      # 0x5870
cmpl $0xea, %eax
je 0x22bc
movslq -0x8(%rbp), %rcx
leaq 0x35c8(%rip), %rax      # 0x5870
movzbl (%rax,%rcx), %eax
cmpl $0xe, %eax
jne 0x22bc
movl -0x8(%rbp), %eax
addl $0x5, %eax
movl %eax, -0x8(%rbp)
jmp 0x22e6
movslq -0x8(%rbp), %rcx
leaq 0x35a9(%rip), %rax      # 0x5870
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x2d8c(%rip), %rax      # 0x5060
movq (%rax,%rcx,8), %rsi
leaq 0x106f(%rip), %rdi      # 0x334e
movb $0x0, %al
callq 0x2030
jmp 0x22e8
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x2282
leaq 0x1087(%rip), %rdi      # 0x3381
movb $0x0, %al
callq 0x2030
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/unsorted0/speclist.c
// Function: thrashfile
void thrashfile(FILE *in)
{
int linelen,linenum,total;

total=progtotal;

getline_1(in,&linenum,&linelen,&total);
while(total>3)
  {
  printf("%4d",linenum);
  xlatline(linelen);
  getline_1(in,&linenum,&linelen,&total);
  }
printf("%4d",linenum);
xlatline(linelen);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl 0xb54e(%rip), %eax      # 0xd870
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
leaq -0xc(%rbp), %rdx
leaq -0x14(%rbp), %rcx
callq 0x21a0
cmpl $0x3, -0x14(%rbp)
jle 0x2370
movl -0x10(%rbp), %esi
leaq 0x1007(%rip), %rdi      # 0x3351
movb $0x0, %al
callq 0x2030
movl -0xc(%rbp), %edi
callq 0x2270
movq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
leaq -0xc(%rbp), %rdx
leaq -0x14(%rbp), %rcx
callq 0x21a0
jmp 0x233a
movl -0x10(%rbp), %esi
leaq 0xfd7(%rip), %rdi       # 0x3351
movb $0x0, %al
callq 0x2030
movl -0xc(%rbp), %edi
callq 0x2270
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/unsorted0/speclist.c
// Function: main
int main(int argc,char *argv[])
{
FILE *in;

if(argc!=3)
  {
  printf("Speclist - PD by RJM for improbabledesigns.\n\n");
  printf("Lists ZX Spectrum raw basic program files to stdout.\n\n");
  printf("Usage:  speclist infile prog_offset >outfile.txt\n");
  exit(1);
  }

if((in=fopen(argv[1],"rb"))==NULL)
  fprintf(stderr,"Error: couldn't open file '%s'\n",argv[1]),exit(1);

progtotal=atoi(argv[2]);
thrashfile(in);      /* process it */
fclose(in);

exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x3, -0x8(%rbp)
je 0x23e0
leaq 0xfa2(%rip), %rdi       # 0x3355
movb $0x0, %al
callq 0x2030
leaq 0xfc2(%rip), %rdi       # 0x3383
movb $0x0, %al
callq 0x2030
leaq 0xfeb(%rip), %rdi       # 0x33ba
movb $0x0, %al
callq 0x2030
movl $0x1, %edi
callq 0x2060
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xffd(%rip), %rsi       # 0x33ec
callq 0x2050
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x2428
movq 0x2bdb(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0xfd8(%rip), %rsi       # 0x33ef
movb $0x0, %al
callq 0x2070
movl $0x1, %edi
callq 0x2060
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2080
movl %eax, 0xb435(%rip)      # 0xd870
movq -0x18(%rbp), %rdi
callq 0x2310
movq -0x18(%rbp), %rdi
callq 0x2040
xorl %edi, %edi
callq 0x2060
// File: /workspace/github_c_makefile_star2_O0/neovim[P]libvterm/bin/unterm.c
// Function: dump_row
void dump_row(int row)
{
  VTermPos pos = { .row = row, .col = 0 };
  VTermScreenCell prevcell = { 0 };
  vterm_state_get_default_colors(vterm_obtain_state(vt), &prevcell.fg, &prevcell.bg);

  while(pos.col < cols) {
    VTermScreenCell cell;
    vterm_screen_get_cell(vts, pos, &cell);

    dump_cell(&cell, &prevcell);

    pos.col += cell.width;
    prevcell = cell;
  }

  dump_eol(&prevcell);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0xc(%rbp)
movl $0x0, -0x8(%rbp)
leaq -0x34(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x1090
movq 0x3e61(%rip), %rdi      # 0x5140
callq 0x1100
movq %rax, %rdi
leaq -0x34(%rbp), %rsi
addq $0x20, %rsi
leaq -0x34(%rbp), %rdx
addq $0x24, %rdx
callq 0x1120
movl -0x8(%rbp), %eax
cmpl 0x3e43(%rip), %eax      # 0x5148
jge 0x1346
movq 0x3e42(%rip), %rdi      # 0x5150
movq -0xc(%rbp), %rsi
leaq -0x5c(%rbp), %rdx
callq 0x1180
leaq -0x5c(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x1360
movsbl -0x44(%rbp), %eax
addl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
leaq -0x34(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
movl $0x28, %edx
callq 0x10f0
jmp 0x12fc
leaq -0x34(%rbp), %rdi
callq 0x18a0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)