LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/xping.c
// Function: usage
void
usage(const char *whine)
{
	if (whine != NULL) {
		fprintf(stderr, "%s\n", whine);
	}
	fprintf(stderr,
	    "usage: xping [-46ABCTVah] [-c count] [-i interval] [-w width] "
	    "host [host [...]]\n"
	    "\n");
	exit(EX_USAGE);
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x263a
movq %rdi, %rdx
movq 0x59af(%rip), %rax      # 0x7fd8
movq (%rax), %rdi
leaq 0x2aa6(%rip), %rsi      # 0x50d9
xorl %eax, %eax
callq 0x2310
movq 0x5997(%rip), %rax      # 0x7fd8
movq (%rax), %rcx
leaq 0x29e9(%rip), %rdi      # 0x5034
pushq $0x51
popq %rsi
pushq $0x1
popq %rdx
callq 0x23e0
pushq $0x40
popq %rdi
callq 0x2260
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/xping.c
// Function: target_add
static int
target_add(const char *line)
{
	struct target *t;

	t = (struct target *)calloc(1, sizeof(*t));
	if (t == NULL)
		return -1;
	memset(t->res, ' ', sizeof(t->res));
	strncat(t->host, line, sizeof(t->host) - 1);
	DL_APPEND(list, t);
	t->prb = probe_new(line, t);
	if (t->prb == NULL) {
		free(t);
		return -1;
	}
	numtargets++;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
pushq $0x1
popq %rdi
movl $0x1a0, %esi            # imm = 0x1A0
callq 0x2120
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0x2bd6
movq %rax, %r14
leaq 0x44(%rax), %rdi
pushq $0x20
popq %rsi
movl $0x12d, %edx            # imm = 0x12D
callq 0x20e0
pushq $0x3f
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2130
movq 0x5700(%rip), %rax      # 0x8270
testq %rax, %rax
je 0x2b92
movq 0x190(%rax), %rcx
addq $0x190, %rax            # imm = 0x190
movq %rcx, 0x190(%r14)
movq %r14, 0x198(%rcx)
jmp 0x2ba2
movq %r14, 0x56d7(%rip)      # 0x8270
movq %r14, %rax
addq $0x190, %rax            # imm = 0x190
movq %r14, (%rax)
andq $0x0, 0x198(%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x2e23
movq %rax, 0x178(%r14)
testq %rax, %rax
je 0x2bce
incl 0x569e(%rip)            # 0x8268
xorl %ebx, %ebx
jmp 0x2bd6
movq %r14, %rdi
callq 0x2250
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/xping.c
// Function: cleanup
static void
cleanup(void)
{
	struct target *t, *t_tmp;

	DL_FOREACH_SAFE(list, t, t_tmp) {
		event_free(t->ev_write);
		probe_free(t->prb);
		free(t);
	}
	probe_cleanup();
	evdns_base_free(dns, 0);
	event_base_free(ev_base);
#ifdef libevent_global_shutdown
	libevent_global_shutdown();
#endif /* !libevent_global_shutdown */
	close(fd4);
	close(fd6);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x5687(%rip), %rbx      # 0x8270
testq %rbx, %rbx
je 0x2c1a
movq 0x180(%rbx), %rdi
movq 0x198(%rbx), %r14
callq 0x2380
movq 0x178(%rbx), %rdi
callq 0x30f0
movq %rbx, %rdi
callq 0x2250
movq %r14, %rbx
jmp 0x2be9
xorl %eax, %eax
callq 0x2e17
movq 0x5678(%rip), %rdi      # 0x82a0
xorl %esi, %esi
callq 0x2340
movq 0x5642(%rip), %rdi      # 0x8278
callq 0x22e0
movl 0x563f(%rip), %edi      # 0x8280
callq 0x23f0
movl 0x563c(%rip), %edi      # 0x8288
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x23f0
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/xping.c
// Function: target_probe_sched
static void
target_probe_sched(int fd, short what, void *thunk)
{
	struct target *t = thunk;

	event_free(t->ev_write);
	t->ev_write = event_new(ev_base, -1, EV_PERSIST, target_probe, t);
	event_add(t->ev_write, &tv_interval);
	target_probe(fd, what, thunk);
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movq 0x180(%rdx), %rdi
callq 0x2380
movq 0x5609(%rip), %rdi      # 0x8278
leaq 0x2c(%rip), %rcx        # 0x2ca2
pushq $-0x1
popq %rsi
pushq $0x10
popq %rdx
movq %rbx, %r8
callq 0x2180
movq %rax, 0x180(%rbx)
leaq 0x55fe(%rip), %rsi      # 0x8290
movq %rax, %rdi
callq 0x20b0
xorl %esi, %esi
movq %rbx, %rdx
popq %rbx
jmp 0x2ca2
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/xping.c
// Function: target_probe
static void
target_probe(int fd, short what, void *thunk)
{
	struct target *t = thunk;

	/* Missed request */
	if (t->npkts > 0 && GETRES(t, -1) != '.') {
		if (GETRES(t, -1) == ' ')
			target_mark(t, t->npkts - 1, '?');
		if (A_flag == 1)
			bell();
		else if (A_flag >= 2 &&
		    GETRES(t, -4) == '.' &&
		    GETRES(t, -3) == '.' &&
		    GETRES(t, -2) != '.' &&
		    GETRES(t, -1) != '.')
			bell();
	}

	/* Check packet count limit */
	if (c_count && t->npkts >= c_count) {
		numcomplete++;
		event_del(t->ev_write);
		if (numcomplete >= numtargets) {
			event_base_loopexit(ev_base, NULL);
		}
		return;
	}

	/* Transmit request */
	t->res[t->npkts % NUM] = ' ';
	probe_send(t->prb, t->npkts);
	t->npkts++;

	ui_update(t);
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
movl 0x40(%rdx), %esi
testl %esi, %esi
jle 0x2d35
decl %esi
movl $0x12c, %ecx            # imm = 0x12C
movl %esi, %eax
xorl %edx, %edx
divl %ecx
movzbl 0x44(%rbx,%rdx), %eax
cmpl $0x2e, %eax
je 0x2d35
cmpl $0x20, %eax
jne 0x2cd8
pushq $0x3f
popq %rdx
movq %rbx, %rdi
callq 0x2530
movl 0x5572(%rip), %eax      # 0x8250
cmpl $0x1, %eax
jne 0x2cea
callq 0x25f9
jmp 0x2d35
jle 0x2d35
movl 0x40(%rbx), %ecx
leal -0x4(%rcx), %eax
movl $0x12c, %esi            # imm = 0x12C
cltd
idivl %esi
movslq %edx, %rax
cmpb $0x2e, 0x44(%rbx,%rax)
jne 0x2d35
leal -0x3(%rcx), %eax
cltd
idivl %esi
movslq %edx, %rax
cmpb $0x2e, 0x44(%rbx,%rax)
jne 0x2d35
leal -0x2(%rcx), %eax
cltd
idivl %esi
movslq %edx, %rax
cmpb $0x2e, 0x44(%rbx,%rax)
je 0x2d35
decl %ecx
movl %ecx, %eax
cltd
idivl %esi
movslq %edx, %rax
cmpb $0x2e, 0x44(%rbx,%rax)
jne 0x2ce3
movl 0x5511(%rip), %ecx      # 0x824c
testl %ecx, %ecx
sete %dl
movl 0x40(%rbx), %eax
cmpl %ecx, %eax
setl %cl
orb %dl, %cl
je 0x2d78
movl $0x12c, %ecx            # imm = 0x12C
cltd
idivl %ecx
movslq %edx, %rax
movb $0x20, 0x44(%rbx,%rax)
movq 0x178(%rbx), %rdi
movl 0x40(%rbx), %esi
callq 0x31aa
incl 0x40(%rbx)
movq %rbx, %rdi
popq %rbx
jmpq *0x54b0(%rip)           # 0x8228
incl 0x54ee(%rip)            # 0x826c
movq 0x180(%rbx), %rdi
callq 0x23a0
movl 0x54dc(%rip), %eax      # 0x826c
cmpl 0x54d2(%rip), %eax      # 0x8268
jge 0x2d9a
popq %rbx
retq
movq 0x54d7(%rip), %rdi      # 0x8278
xorl %esi, %esi
popq %rbx
jmp 0x2160
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/http.c
// Function: probe_setup
void
probe_setup()
{
	tv_timeout.tv_sec = 3 * i_interval / 1000;
	tv_timeout.tv_usec = 3 * i_interval % 1000 * 1000;
	if (regcomp(&re_target, "^(https?:(//)?)?"
            "([0-9A-Za-z.-]+)(\\[([0-9A-Fa-f.:]+)\\])?(:[0-9]+)?(/[^ ]*)?$",
	    REG_EXTENDED | REG_NEWLINE) != 0) {
		fprintf(stderr,
		    "regcomp: error compiling regular expression\n");
		exit(1);
	}
#ifdef WITH_SSL
	SSL_library_init();
#endif /* WITH_SSL */
}

// Assembly:
pushq %rax
leaq 0x5464(%rip), %rax      # 0x8218
imull $0x3, (%rax), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
cltq
movq %rax, 0x54e0(%rip)      # 0x82a8
imull $0x3e8, %edx, %eax      # imm = 0x3E8
cltq
movq %rax, 0x54d9(%rip)      # 0x82b0
leaq 0x54da(%rip), %rdi      # 0x82b8
leaq 0x243b(%rip), %rsi      # 0x5220
pushq $0x5
popq %rdx
callq 0x2220
testl %eax, %eax
jne 0x2df3
popq %rax
retq
movq 0x51de(%rip), %rax      # 0x7fd8
movq (%rax), %rcx
leaq 0x2468(%rip), %rdi      # 0x526c
pushq $0x2c
popq %rsi
pushq $0x1
popq %rdx
callq 0x23e0
pushq $0x1
popq %rdi
callq 0x2260
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/http.c
// Function: resolved
static void
resolved(int af, void *address, void *thunk)
{
	struct probe *prb = thunk;
	if (af == AF_INET6) {
		sin6(prb)->sin6_family = AF_INET6;
		memmove(&sin6(prb)->sin6_addr, (struct in6_addr *)address,
		    sizeof(sin6(prb)->sin6_addr));
		prb->resolved = 1;
	} else if (af == AF_INET) {
		sin(prb)->sin_family = AF_INET;
		memmove(&sin(prb)->sin_addr, (struct in_addr *)address,
		    sizeof(sin(prb)->sin_addr));
		prb->resolved = 1;
	} else if (af == 0) {
		prb->resolved = 0;
	}
	target_resolved(prb->owner, af, address);
}

// Assembly:
movq %rdx, %rax
movq %rsi, %rdx
movl %edi, %esi
movl %edi, %ecx
testl %edi, %edi
je 0x30e1
cmpl $0x2, %esi
je 0x30d3
cmpl $0xa, %esi
jne 0x30e4
movw $0xa, 0x44(%rax)
movups (%rdx), %xmm0
movups %xmm0, 0x4c(%rax)
jmp 0x30de
movw $0x2, 0x44(%rax)
movl (%rdx), %ecx
movl %ecx, 0x48(%rax)
pushq $0x1
popq %rcx
movl %ecx, 0x40(%rax)
movq 0xb0(%rax), %rdi
jmp 0x260b
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/http.c
// Function: probe_free
void probe_free(struct probe *prb)
{
	struct session *s, *s_tmp;

	LL_FOREACH_SAFE(prb->sessions, s, s_tmp) {
		session_free(s);
	}
	if (prb->dnstask)
		dnstask_free(prb->dnstask);
	free(prb);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xa0(%rdi), %rdi
testq %rdi, %rdi
je 0x3111
movq 0x30(%rdi), %r14
callq 0x3131
movq %r14, %rdi
jmp 0x30fe
movq 0xa8(%rbx), %rdi
testq %rdi, %rdi
je 0x3122
callq 0x3ef0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2250
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/http.c
// Function: session_free
static void
session_free(struct session *session)
{

	if (session->statusline)
		free(session->statusline);
	LL_DELETE(session->prb->sessions, session);
	if (session->ev_timeout)
		event_free(session->ev_timeout);
	if (session->bev) {
		bufferevent_disable(session->bev, EV_READ|EV_WRITE);
		bufferevent_free(session->bev);
	}
	free(session);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x2250
movq (%rbx), %rax
movq 0xa0(%rax), %rcx
cmpq %rbx, %rcx
je 0x316c
movq %rcx, %rax
movq 0x30(%rcx), %rcx
testq %rcx, %rcx
je 0x315e
cmpq %rbx, %rcx
jne 0x314d
testq %rcx, %rcx
je 0x3179
addq $0x30, %rax
movq %rbx, %rcx
jmp 0x3172
addq $0xa0, %rax
movq 0x30(%rcx), %rcx
movq %rcx, (%rax)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x3187
callq 0x2380
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x31a1
pushq $0x6
popq %rsi
callq 0x2330
movq 0x10(%rbx), %rdi
callq 0x2060
movq %rbx, %rdi
popq %rbx
jmp 0x2250
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/http.c
// Function: session_readcb_status
static void
session_readcb_status(struct bufferevent *bev, void *thunk)
{
	struct session *session = thunk;
	struct evbuffer *evbuf = bufferevent_get_input(bev);
	size_t len;
	char *line;
	char *protocol;
	char *number;

	line = evbuffer_readln(evbuf, &len, EVBUFFER_EOL_CRLF);
	if (line == NULL) {
		if (evbuffer_get_length(evbuf) > 2048) {
			session_free(session);
			return;
		} else
			return; /* wait for more data */
	}
	session->statusline = line;
	/* Parse response line */
	protocol = strsep(&line, " ");
	if (line == NULL) {
		session_free(session);
		return;
	}
	number = strsep(&line, " ");
	if (line == NULL) {
		session_free(session);
		return;
	}
	(void)protocol;
	(void)number;
	if (atoi(number) < 400 && atoi(number) >= 200 ) {
		session->completed = 1;
	} else {
		target_mark(session->prb->owner, session->seq, '%');
	}
	/* Drain the response on future callbacks */
	bufferevent_setcb(session->bev, session_readcb_drain, NULL,
	    session_eventcb, session);
	session_readcb_drain(bev, session);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2140
movq %rax, %r15
leaq 0x8(%rsp), %rsi
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x21d0
movq %rax, (%rsp)
testq %rax, %rax
je 0x33e4
movq %rax, 0x20(%rbx)
leaq 0x1f54(%rip), %rsi      # 0x52f2
movq %rsp, %r15
movq %r15, %rdi
callq 0x20f0
cmpq $0x0, (%r15)
je 0x33f4
leaq 0x1f3c(%rip), %rsi      # 0x52f2
movq %rsp, %r15
movq %r15, %rdi
callq 0x20f0
cmpq $0x0, (%r15)
je 0x33f4
movq %rax, %rdi
callq 0x2350
addl $0xffffff38, %eax       # imm = 0xFFFFFF38
cmpl $0xc7, %eax
ja 0x33fe
movl $0x1, 0x28(%rbx)
jmp 0x3413
movq %r15, %rdi
callq 0x21c0
cmpq $0x801, %rax            # imm = 0x801
jb 0x3437
movq %rbx, %rdi
callq 0x3131
jmp 0x3437
movq (%rbx), %rax
movq 0xb0(%rax), %rdi
movl 0x8(%rbx), %esi
pushq $0x25
popq %rdx
callq 0x2530
movq 0x10(%rbx), %rdi
leaq 0xfa(%rip), %rsi        # 0x3518
leaq 0x1c(%rip), %rcx        # 0x3441
xorl %edx, %edx
movq %rbx, %r8
callq 0x21a0
movq %r14, %rdi
callq 0x3518
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/http.c
// Function: session_eventcb
static void
session_eventcb(struct bufferevent *bev, short what, void *thunk)
{
	struct session *session = thunk;
	switch (what & ~(BEV_EVENT_READING|BEV_EVENT_WRITING)) {
	case BEV_EVENT_CONNECTED:
		session_send(session);
		return;
	case BEV_EVENT_EOF:
		bufferevent_disable(bev, EV_READ|EV_WRITE);
		if (session->completed)
			target_mark(session->prb->owner, session->seq, '.');
		else
			target_mark(session->prb->owner, session->seq, '%');
		break;
	case BEV_EVENT_ERROR:
		bufferevent_disable(bev, EV_READ|EV_WRITE);
		target_mark(session->prb->owner, session->seq, '#');
		break;
	case BEV_EVENT_TIMEOUT:
		target_mark(session->prb->owner, session->seq, '?');
		break;
	}
	session_free(session);
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
andl $0xfffc, %esi           # imm = 0xFFFC
movswl %si, %eax
addl $-0x10, %eax
roll $0x1c, %eax
cmpl $0x7, %eax
ja 0x34e7
leaq 0x1c9c(%rip), %rcx      # 0x5100
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x6
popq %rsi
callq 0x2330
cmpl $0x0, 0x28(%rbx)
movq (%rbx), %rax
movq 0xb0(%rax), %rdi
movl 0x8(%rbx), %esi
je 0x34df
pushq $0x2e
jmp 0x34e1
movq (%rbx), %rax
movq 0xb0(%rax), %rdi
movl 0x8(%rbx), %esi
pushq $0x3f
jmp 0x34e1
pushq $0x6
popq %rsi
callq 0x2330
movq (%rbx), %rax
movq 0xb0(%rax), %rdi
movl 0x8(%rbx), %esi
pushq $0x23
jmp 0x34e1
movq 0x10(%rbx), %rdi
callq 0x2070
movq (%rbx), %rcx
leaq 0x60(%rcx), %rdx
leaq 0x1e27(%rip), %rsi      # 0x52f4
leaq 0x1f4e(%rip), %r8       # 0x5422
movq %rax, %rdi
xorl %eax, %eax
popq %rbx
jmp 0x2100
pushq $0x25
popq %rdx
callq 0x2530
movq %rbx, %rdi
popq %rbx
jmp 0x3131
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/termio.c
// Function: getmaxx
int
getmaxx(void)
{
	struct winsize wsz;
	char *p;

	if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &wsz) != -1 &&
	    wsz.ws_col > 0)
		return (wsz.ws_col);
	else if ((p = getenv("COLUMNS")) != NULL && *p != '\0')
		return atoi(p);
	else
		return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
pushq $0x1
popq %rdi
movq %rsp, %r14
movl $0x5413, %esi           # imm = 0x5413
movq %r14, %rdx
xorl %eax, %eax
callq 0x2300
cmpl $-0x1, %eax
setne %cl
movzwl 0x2(%r14), %eax
testw %ax, %ax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x3570
movzwl %ax, %ebx
jmp 0x3590
leaq 0x1df1(%rip), %rdi      # 0x5368
callq 0x2270
testq %rax, %rax
je 0x3590
cmpb $0x0, (%rax)
je 0x3590
movq %rax, %rdi
callq 0x2350
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/termio.c
// Function: getmaxy
int
getmaxy(void)
{
	struct winsize wsz;
	char *p;

	if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &wsz) != -1 &&
	    wsz.ws_row > 0)
		return (wsz.ws_row);
	else if ((p = getenv("ROWS")) != NULL && *p != '\0')
		return atoi(p);
	else
		return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
pushq $0x1
popq %rdi
movq %rsp, %r14
movl $0x5413, %esi           # imm = 0x5413
movq %r14, %rdx
xorl %eax, %eax
callq 0x2300
cmpl $-0x1, %eax
setne %cl
movzwl (%r14), %eax
testw %ax, %ax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x35d1
movzwl %ax, %ebx
jmp 0x35f1
leaq 0x1d98(%rip), %rdi      # 0x5370
callq 0x2270
testq %rax, %rax
je 0x35f1
cmpb $0x0, (%rax)
je 0x35f1
movq %rax, %rdi
callq 0x2350
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/termio.c
// Function: move
void
move(int row, int col)
{
	fprintf(stdout, "%c[u", 0x1b);
	if (row > 0)
		fprintf(stdout, "%c[%dB", 0x1b, row);
	if (col > 0)
		fprintf(stdout, "%c[%dC", 0x1b, col);
	cursor_y = row;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movl %edi, %ebx
movq 0x49a6(%rip), %r14      # 0x7fb0
movq (%r14), %rdi
leaq 0x1d61(%rip), %rsi      # 0x5375
pushq $0x1b
popq %rdx
xorl %eax, %eax
callq 0x2310
testl %ebx, %ebx
jle 0x3638
movq (%r14), %rdi
leaq 0x1d4e(%rip), %rsi      # 0x537a
pushq $0x1b
popq %rdx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2310
testl %ebp, %ebp
jle 0x3652
movq (%r14), %rdi
leaq 0x1d3b(%rip), %rsi      # 0x5381
pushq $0x1b
popq %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2310
movl %ebx, 0x4ca0(%rip)      # 0x82f8
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/termio.c
// Function: sigwinch
void
sigwinch(int sig)
{
	if (cursor_y > 0)
		fprintf(stdout, "%c[%dA\r", 0x1b, cursor_y);
	fprintf(stdout, "\r%c[s", 0x1b);
	cursor_y = 0;
	fprintf(stdout, "%c[2K\r", 0x1b);
	clrtobot();
	termio_update(NULL); /* XXX: this is probably a bad idea */
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x4c91(%rip), %ecx      # 0x82f8
testl %ecx, %ecx
jle 0x3686
movq 0x493e(%rip), %rax      # 0x7fb0
movq (%rax), %rdi
leaq 0x1d0c(%rip), %rsi      # 0x5388
pushq $0x1b
popq %rdx
xorl %eax, %eax
callq 0x2310
movq 0x4923(%rip), %r14      # 0x7fb0
movq (%r14), %rdi
leaq 0x1cf9(%rip), %rsi      # 0x5390
pushq $0x1b
popq %rbx
movl %ebx, %edx
xorl %eax, %eax
callq 0x2310
andl $0x0, 0x4c4e(%rip)      # 0x82f8
movq (%r14), %rdi
leaq 0x1ce2(%rip), %rsi      # 0x5396
movl %ebx, %edx
xorl %eax, %eax
callq 0x2310
callq 0x36d0
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x36eb
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/termio.c
// Function: drawchar
static void
drawchar(int ch)
{


	if (!B_flag) {
		addch(ch);
	} else {
		printw("%s%c\x1b[0m", getcolor(ch), ch);
	}
}

// Assembly:
leaq 0x4735(%rip), %rax      # 0x8254
cmpl $0x0, (%rax)
je 0x3b49
leal -0x21(%rdi), %eax
cmpl $0x4, %eax
jbe 0x3b58
cmpl $0x2e, %edi
je 0x3b95
cmpl $0x40, %edi
je 0x3b9e
cmpl $0x3f, %edi
je 0x3b71
cmpl $0x3a, %edi
jne 0x3b7a
leaq 0x187f(%rip), %rsi      # 0x53c6
jmp 0x3ba5
movq 0x4460(%rip), %rax      # 0x7fb0
movq (%rax), %rsi
jmp 0x22a0
leaq 0x17f5(%rip), %rcx      # 0x5354
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1877(%rip), %rsi      # 0x53e6
jmp 0x3ba5
leaq 0x1856(%rip), %rsi      # 0x53ce
jmp 0x3ba5
leaq 0x157b(%rip), %rsi      # 0x50fc
jmp 0x3ba5
leaq 0x184c(%rip), %rsi      # 0x53d6
jmp 0x3ba5
leaq 0x185b(%rip), %rsi      # 0x53ee
jmp 0x3ba5
leaq 0x1822(%rip), %rsi      # 0x53be
jmp 0x3ba5
leaq 0x1839(%rip), %rsi      # 0x53de
movl %edi, %edx
xorl %eax, %eax
jmp 0x3bab
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/termio.c
// Function: mvprintw
static void
mvprintw(int row, int col, const char *fmt, ...)
{
	va_list ap;

	move(row, col);
	fprintf(stdout, "%c[K", 0x1b);
	va_start(ap, fmt);
	vfprintf(stdout, fmt, ap);
	va_end(ap);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdx, %rbx
leaq 0x20(%rsp), %r14
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x3cb9
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
xorl %esi, %esi
callq 0x35fb
movq 0x42e9(%rip), %r15      # 0x7fb0
movq (%r15), %rdi
leaq 0x16e8(%rip), %rsi      # 0x53b9
pushq $0x1b
popq %rdx
xorl %eax, %eax
callq 0x2310
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movq %r14, 0x10(%rdx)
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x22d0
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/report.c
// Function: report_cleanup
void report_cleanup()
{
	struct target *t;
	int i, imax, ifirst, ilast;

	t = list;
	if (t == NULL)
		return;

	imax = MIN(t->npkts, NUM);
	ifirst = (t->npkts > imax ? t->npkts - imax : 0);
	ilast = t->npkts;

	DL_FOREACH(list, t) {
		fprintf(stdout, "%*.*s", w_width, w_width, t->host);
		if (w_width)
			fputc(' ', stdout);
		for (i=ifirst; i<ilast; i++) {
			if (i < t->npkts) fputc(t->res[i % NUM], stdout);
			else fputc(' ', stdout);
		}
		fputc('\n', stdout);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x4548(%rip), %rax      # 0x8270
movq (%rax), %rbx
testq %rbx, %rbx
je 0x3de2
movl 0x40(%rbx), %r13d
movl $0x12c, %r14d           # imm = 0x12C
cmpl %r14d, %r13d
movl $0x12c, %eax            # imm = 0x12C
cmovll %r13d, %eax
movl %r13d, %ecx
subl %eax, %ecx
xorl %eax, %eax
cmpl $0x12d, %r13d           # imm = 0x12D
cmovll %eax, %ecx
movl %ecx, 0x4(%rsp)
movq 0x424a(%rip), %r15      # 0x7fb0
pushq $0x20
popq %rbp
testq %rbx, %rbx
je 0x3de2
movq (%r15), %rdi
leaq 0x44a4(%rip), %r12      # 0x821c
movl (%r12), %ecx
leaq 0x1699(%rip), %rsi      # 0x541c
movl %ecx, %edx
movq %rbx, %r8
xorl %eax, %eax
callq 0x2310
cmpl $0x0, (%r12)
je 0x3da0
movq (%r15), %rsi
movl %ebp, %edi
callq 0x22a0
movl 0x4(%rsp), %r12d
cmpl %r13d, %r12d
jge 0x3dce
movl %ebp, %edi
cmpl 0x40(%rbx), %r12d
jge 0x3dc1
movl %r12d, %eax
cltd
idivl %r14d
movslq %edx, %rax
movsbl 0x44(%rbx,%rax), %edi
movq (%r15), %rsi
callq 0x22a0
incl %r12d
jmp 0x3da5
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x22a0
movq 0x198(%rbx), %rbx
jmp 0x3d69
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/dnstask.c
// Function: dnstask_new
struct dnstask *
dnstask_new(const char *hostname, dnstask_cb_type cb, void *thunk)
{
	struct dnstask *task;
	struct timeval tv;

	task = calloc(1, sizeof(*task));
	if (task == NULL)
		return NULL;
	assert(strlen(hostname) + 1 <= sizeof(task->host));
	strncat(task->host, hostname, sizeof(task->host) - 1);
	task->cb = cb;
	task->thunk = thunk;
	task->ev_resolve = event_new(ev_base, -1, 0, sendquery, task);
	if (task->ev_resolve == NULL) {
		free(task);
		return NULL;
	}
	evutil_timerclear(&tv);
	event_add(task->ev_resolve, &tv);
	return task;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
pushq $0x1
popq %rdi
pushq $0x58
popq %rsi
callq 0x2120
testq %rax, %rax
je 0x3e87
movq %rax, %rbx
movq %r12, %rdi
callq 0x20c0
incq %rax
cmpq $0x41, %rax
jae 0x3e98
movq %rbx, %rdi
addq $0x10, %rdi
pushq $0x3f
popq %rdx
movq %r12, %rsi
callq 0x2130
movq %r15, (%rbx)
movq %r14, 0x8(%rbx)
leaq 0x442c(%rip), %rax      # 0x8278
movq (%rax), %rdi
leaq 0x61(%rip), %rcx        # 0x3eb7
pushq $-0x1
popq %rsi
xorl %edx, %edx
movq %rbx, %r8
callq 0x2180
movq %rax, 0x50(%rbx)
testq %rax, %rax
je 0x3e7f
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
movq %rax, %rdi
callq 0x20b0
jmp 0x3e89
movq %rbx, %rdi
callq 0x2250
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x158a(%rip), %rdi      # 0x5429
leaq 0x15ae(%rip), %rsi      # 0x5454
leaq 0x15b1(%rip), %rcx      # 0x545e
movl $0x85, %edx
callq 0x2110
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/dnstask.c
// Function: sendquery
static void
sendquery(int fd, short what, void *thunk)
{
	struct dnstask *task = thunk;
	if (!v4_flag) {
		evdns_base_resolve_ipv6(dns, task->host, 0,
		    response_ipv6, task);
	} else {
		evdns_base_resolve_ipv4(dns, task->host, 0,
		    response_ipv4, task);
	}

}

// Assembly:
movq %rdx, %r8
leaq 0x439f(%rip), %rax      # 0x8260
leaq 0x10(%rdx), %rsi
cmpl $0x0, (%rax)
leaq 0x43d1(%rip), %rax      # 0x82a0
movq (%rax), %rdi
je 0x3ee2
leaq 0xc8(%rip), %rcx        # 0x3fa3
xorl %edx, %edx
jmp 0x2290
leaq 0x1d(%rip), %rcx        # 0x3f06
xorl %edx, %edx
jmp 0x2190
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/dnstask.c
// Function: response_ipv6
static void
response_ipv6(int result, char type, int count, int ttl, void *addresses,
    void *thunk)
{
	struct dnstask *task = thunk;

	if (result == DNS_ERR_NONE && count > 0) {
		task->cb(AF_INET6, addresses, task->thunk);
		/* Schedule new request, enforce a lower bound on ttl. */
		if (T_flag)
			reschedule(task->ev_resolve, MAX(ttl, 1));
	} else {
		if (!v6_flag) {
			evdns_base_resolve_ipv4(dns, task->host, 0,
			    response_ipv4, thunk);
		} else {
			/* neg-TTL might be search domain's */
			reschedule(task->ev_resolve, 60);
			task->cb(0, NULL, task->thunk);
		}
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %r9, %rbx
movl %ecx, %ebp
testl %edi, %edi
setne %al
testl %edx, %edx
setle %cl
orb %al, %cl
jne 0x3f4c
movq 0x8(%rbx), %rdx
pushq $0xa
popq %rdi
movq %r8, %rsi
callq *(%rbx)
leaq 0x432d(%rip), %rax      # 0x825c
cmpl $0x0, (%rax)
je 0x3f77
movq 0x50(%rbx), %rdi
cmpl $0x2, %ebp
pushq $0x1
popq %rsi
cmovgel %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4001
leaq 0x4311(%rip), %rax      # 0x8264
cmpl $0x0, (%rax)
je 0x3f7e
movq 0x50(%rbx), %rdi
pushq $0x3c
popq %rsi
callq 0x4001
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
xorl %edi, %edi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x431b(%rip), %rax      # 0x82a0
movq (%rax), %rdi
leaq 0x10(%rbx), %rsi
leaq 0x10(%rip), %rcx        # 0x3fa3
xorl %edx, %edx
movq %rbx, %r8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2290
// File: /workspace/github_c_makefile_star2_O2/martintopholm[P]xping/dnstask.c
// Function: response_ipv4
static void
response_ipv4(int result, char type, int count, int ttl, void *addresses,
    void *thunk)
{
	struct dnstask *task = thunk;

	if (result == DNS_ERR_NONE && count > 0) {
		task->cb(AF_INET, addresses, task->thunk);
		/* Schedule new request, enforce a lower bound on ttl. */
		if (T_flag)
			reschedule(task->ev_resolve, MAX(ttl, 1));
	} else {
		task->cb(0, NULL, task->thunk);
		/* neg-TTL might be search domain's */
		reschedule(task->ev_resolve, 60);
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %r9, %rbx
movl %ecx, %ebp
testl %edi, %edi
setne %cl
testl %edx, %edx
setle %sil
movq (%r9), %rax
movq 0x8(%r9), %rdx
orb %cl, %sil
jne 0x3fe5
pushq $0x2
popq %rdi
movq %r8, %rsi
callq *%rax
leaq 0x428b(%rip), %rax      # 0x825c
cmpl $0x0, (%rax)
je 0x3ffa
movq 0x50(%rbx), %rdi
cmpl $0x2, %ebp
pushq $0x1
popq %rsi
cmovgel %ebp, %esi
jmp 0x3ff2
xorl %edi, %edi
xorl %esi, %esi
callq *%rax
movq 0x50(%rbx), %rdi
pushq $0x3c
popq %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4001
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/KhronosGroup[P]dfdutils/interpretdfd.c
// Function: bit_ceil
static uint32_t bit_ceil(uint32_t x) {
    x -= 1;
    for (uint32_t i = 0; i < sizeof(x) * 8; ++i)
        if (1u << i > x)
            return 1u << i;
    return 0;
}

// Assembly:
decl %edi
xorl %ecx, %ecx
pushq $0x1
popq %rdx
cmpl $0x20, %ecx
je 0x16b3
movl %edx, %eax
shll %cl, %eax
incl %ecx
cmpl %edi, %eax
jbe 0x16a3
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/KhronosGroup[P]dfdutils/createdfd.c
// Function: writeHeader
static uint32_t *writeHeader(int numSamples, int bytes, int suffix,
                             channels_infotype infotype)
{
    uint32_t *DFD = (uint32_t *) malloc(sizeof(uint32_t) *
                                        (1 + KHR_DF_WORD_SAMPLESTART +
                                         numSamples * KHR_DF_WORD_SAMPLEWORDS));
    uint32_t* BDFD = DFD+1;
    DFD[0] = sizeof(uint32_t) *
        (1 + KHR_DF_WORD_SAMPLESTART +
         numSamples * KHR_DF_WORD_SAMPLEWORDS);
    BDFD[KHR_DF_WORD_VENDORID] =
        (KHR_DF_VENDORID_KHRONOS << KHR_DF_SHIFT_VENDORID) |
        (KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT << KHR_DF_SHIFT_DESCRIPTORTYPE);
    BDFD[KHR_DF_WORD_VERSIONNUMBER] =
        (KHR_DF_VERSIONNUMBER_LATEST << KHR_DF_SHIFT_VERSIONNUMBER) |
        (((uint32_t)sizeof(uint32_t) *
          (KHR_DF_WORD_SAMPLESTART +
           numSamples * KHR_DF_WORD_SAMPLEWORDS)
          << KHR_DF_SHIFT_DESCRIPTORBLOCKSIZE));
    BDFD[KHR_DF_WORD_MODEL] =
        ((KHR_DF_MODEL_RGBSDA << KHR_DF_SHIFT_MODEL) | /* Only supported model */
         (KHR_DF_FLAG_ALPHA_STRAIGHT << KHR_DF_SHIFT_FLAGS));
    if (infotype == i_COLOR) {
        BDFD[KHR_DF_WORD_PRIMARIES] |= KHR_DF_PRIMARIES_BT709 << KHR_DF_SHIFT_PRIMARIES; /* Assumed */
    } else {
        BDFD[KHR_DF_WORD_PRIMARIES] |= KHR_DF_PRIMARIES_UNSPECIFIED << KHR_DF_SHIFT_PRIMARIES;
    }
    if (suffix == s_SRGB) {
        BDFD[KHR_DF_WORD_TRANSFER] |= KHR_DF_TRANSFER_SRGB << KHR_DF_SHIFT_TRANSFER;
    } else {
        BDFD[KHR_DF_WORD_TRANSFER] |= KHR_DF_TRANSFER_LINEAR << KHR_DF_SHIFT_TRANSFER;
    }
    BDFD[KHR_DF_WORD_TEXELBLOCKDIMENSION0] = 0; /* Only 1x1x1x1 texel blocks supported */
    BDFD[KHR_DF_WORD_BYTESPLANE0] = bytes; /* bytesPlane0 = bytes, bytesPlane3..1 = 0 */
    BDFD[KHR_DF_WORD_BYTESPLANE4] = 0; /* bytesPlane7..5 = 0 */
    return DFD;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %ebx
movl %edi, %r15d
leal (,%r15,4), %eax
cltq
leaq 0x1c(,%rax,4), %r12
movq %r12, %rdi
callq 0x1080
movl %r12d, (%rax)
andl $0x0, 0x4(%rax)
shll $0x14, %r15d
addl $0x180002, %r15d        # imm = 0x180002
movl %r15d, 0x8(%rax)
xorl %ecx, %ecx
testl %ebp, %ebp
sete %cl
shll $0x8, %ecx
xorl %edx, %edx
cmpl $0x8, %r14d
sete %dl
shll $0x10, %edx
addl %edx, %ecx
addl $0x10001, %ecx          # imm = 0x10001
movl %ecx, 0xc(%rax)
andl $0x0, 0x10(%rax)
movl %ebx, 0x14(%rax)
andl $0x0, 0x18(%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/KhronosGroup[P]dfdutils/createdfd.c
// Function: createDFDDepthStencil
uint32_t *createDFDDepthStencil(int depthBits,
                                int stencilBits,
                                int sizeBytes)
{
    /* N.B. Little-endian is assumed. */
    uint32_t *DFD = 0;
    DFD = writeHeader((depthBits > 0) + (stencilBits > 0),
                      sizeBytes, s_UNORM, i_NON_COLOR);
    if (depthBits == 32) {
        writeSample(DFD, 0, KHR_DF_CHANNEL_RGBSDA_DEPTH,
                    32, 0,
                    1, 1, s_SFLOAT);
    } else if (depthBits > 0) {
        writeSample(DFD, 0, KHR_DF_CHANNEL_RGBSDA_DEPTH,
                    depthBits, 0,
                    1, 1, s_UNORM);
    }
    if (stencilBits > 0) {
        if (depthBits > 0) {
            writeSample(DFD, 1, KHR_DF_CHANNEL_RGBSDA_STENCIL,
                        stencilBits, depthBits,
                        1, 1, s_UINT);
        } else {
            writeSample(DFD, 0, KHR_DF_CHANNEL_RGBSDA_STENCIL,
                        stencilBits, 0,
                        1, 1, s_UINT);
        }
    }
    return DFD;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
xorl %eax, %eax
testl %edi, %edi
setg %al
xorl %edi, %edi
testl %esi, %esi
setg %dil
addl %eax, %edi
pushq $0x1
popq %rcx
movl %edx, %esi
xorl %edx, %edx
callq 0x1833
movq %rax, %r14
cmpl $0x20, %ebp
jne 0x1fee
movaps 0x2329(%rip), %xmm0     # 0x4310
movups %xmm0, 0x1c(%r14)
jmp 0x201a
testl %ebp, %ebp
jle 0x2042
subq $0x10, %rsp
andl $0x0, 0x8(%rsp)
movl $0x1, (%rsp)
pushq $0xe
popq %rdx
pushq $0x1
popq %r9
movq %r14, %rdi
xorl %esi, %esi
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x18aa
popq %rax
popq %rcx
testl %ebx, %ebx
jle 0x203a
pushq $0xd
popq %rdx
pushq $0x1
popq %rsi
movq %r14, %rdi
movl %ebx, %ecx
movl %ebp, %r8d
movl %esi, %r9d
pushq $0x4
pushq $0x1
callq 0x18aa
popq %rax
popq %rcx
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
testl %ebx, %ebx
jle 0x203a
pushq $0xd
popq %rdx
pushq $0x1
popq %r9
movq %r14, %rdi
xorl %esi, %esi
movl %ebx, %ecx
xorl %r8d, %r8d
jmp 0x202f
// File: /workspace/github_c_makefile_star2_O2/KhronosGroup[P]dfdutils/createdfd.c
// Function: createDFDAlpha
uint32_t *createDFDAlpha(int bigEndian, int bytes,
                         enum VkSuffix suffix) {
    uint32_t *DFD;
    int channel = 3; /* alpha channel */
    if (bigEndian) {
        int channelByte;
        /* Number of samples = number of channels * bytes per channel */
        DFD = writeHeader(bytes, bytes, suffix, i_COLOR);
        /* Loop over the bytes that constitute a channel */
        for (channelByte = 0; channelByte < bytes; ++channelByte) {
            writeSample(DFD, channelByte, channel,
                        8, 8 * (bytes - channelByte - 1),
                        channelByte == bytes-1, channelByte == 0, suffix);
        }
    } else { /* Little-endian */
        /* One sample per channel */
        DFD = writeHeader(1, bytes, suffix, i_COLOR);
        writeSample(DFD, 0, channel,
                    8 * bytes, 0,
                    1, 1, suffix);
    }
    return DFD;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
testl %edi, %edi
je 0x20cf
xorl %ebp, %ebp
movl %r15d, %edi
movl %r15d, %esi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x1833
movq %rax, %r14
testl %r15d, %r15d
movl $0x0, %r12d
cmovgl %r15d, %r12d
leal -0x1(%r15), %r13d
leal -0x8(,%r15,8), %r15d
cmpl %ebp, %r12d
je 0x2102
xorl %r9d, %r9d
cmpl %ebp, %r13d
sete %r9b
xorl %eax, %eax
testl %ebp, %ebp
sete %al
movq %r14, %rdi
movl %ebp, %esi
pushq $0x3
popq %rdx
pushq $0x8
popq %rcx
movl %r15d, %r8d
pushq %rbx
pushq %rax
callq 0x18aa
popq %rax
popq %rcx
incl %ebp
addl $-0x8, %r15d
jmp 0x209a
pushq $0x1
popq %rbp
movl %ebp, %edi
movl %r15d, %esi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x1833
movq %rax, %r14
shll $0x3, %r15d
pushq $0x3
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
movl %r15d, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %rbx
pushq $0x1
callq 0x18aa
popq %rax
popq %rcx
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/KhronosGroup[P]dfdutils/printdfd.c
// Function: printFlagBits
static void printFlagBits(uint32_t flags, const char*(*toStringFn)(uint32_t, bool)) {
    bool first = true;
    for (uint32_t bit_index = 0; bit_index < 32; ++bit_index) {
        uint32_t bit_mask = 1u << bit_index;
        bool bit_value = (bit_mask & (uint32_t) flags) != 0;

        const char* comma = first ? "" : ", ";
        const char* str = toStringFn(bit_index, bit_value);
        if (str) {
            printf("%s%s", comma, str);
            first = false;
        } else if (bit_value) {
            printf("%s%u", comma, bit_mask);
            first = false;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
movb $0x1, %r12b
xorl %r14d, %r14d
cmpl $0x20, %r14d
je 0x3047
pushq $0x1
popq %r13
movl %r14d, %ecx
shll %cl, %r13d
xorl %esi, %esi
btl %r14d, %ebp
setb %sil
testb $0x1, %r12b
leaq 0x2dde(%rip), %r15      # 0x5dd6
leaq 0x2abf(%rip), %rax      # 0x5abe
cmovneq %rax, %r15
movl %r14d, %edi
callq *%rbx
testq %rax, %rax
je 0x3026
xorl %r12d, %r12d
leaq 0x2dc2(%rip), %rdi      # 0x5dd9
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1050
jmp 0x3042
testl %ebp, %r13d
je 0x3042
xorl %r12d, %r12d
leaq 0x2b8c(%rip), %rdi      # 0x5bc1
movq %r15, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x1050
incl %r14d
jmp 0x2fd3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/KhronosGroup[P]dfdutils/printdfd.c
// Function: printFlagBitsJSON
static void printFlagBitsJSON(uint32_t indent, const char* nl, uint32_t flags, const char*(*toStringFn)(uint32_t, bool)) {
    bool first = true;
    for (uint32_t bit_index = 0; bit_index < 32; ++bit_index) {
        uint32_t bit_mask = 1u << bit_index;
        bool bit_value = (bit_mask & (uint32_t) flags) != 0;

        const char* str = toStringFn(bit_index, bit_value);
        if (str) {
            printf("%s%s%*s\"%s\"", first ? "" : ",", first ? "" : nl, indent, "", str);
            first = false;
        } else if (bit_value) {
            printf("%s%s%*s%u", first ? "" : ",", first ? "" : nl, indent, "", bit_mask);
            first = false;
        }
    }
    if (!first)
        printf("%s", nl);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, 0x10(%rsp)
movl %edi, 0xc(%rsp)
movb $0x1, %r15b
xorl %r12d, %r12d
leaq 0x211e(%rip), %r13      # 0x5abe
cmpl $0x20, %r12d
je 0x3a3b
pushq $0x1
popq %rbx
movl %r12d, %ecx
shll %cl, %ebx
xorl %esi, %esi
btl %r12d, %ebp
setb %sil
movl %r12d, %edi
callq *%r14
testq %rax, %rax
je 0x39fc
testb $0x1, %r15b
leaq 0x2418(%rip), %rsi      # 0x5dea
cmovneq %r13, %rsi
movq 0x10(%rsp), %rdx
cmovneq %r13, %rdx
xorl %r15d, %r15d
leaq 0x23f5(%rip), %rdi      # 0x5dde
movl 0xc(%rsp), %ecx
movq %r13, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x1050
jmp 0x3a33
testl %ebp, %ebx
je 0x3a33
testb $0x1, %r15b
leaq 0x23df(%rip), %rsi      # 0x5dea
cmovneq %r13, %rsi
movq 0x10(%rsp), %rdx
cmovneq %r13, %rdx
xorl %r15d, %r15d
leaq 0x23ca(%rip), %rdi      # 0x5dec
movl 0xc(%rsp), %ecx
movq %r13, %r8
movl %ebx, %r9d
xorl %eax, %eax
callq 0x1050
incl %r12d
jmp 0x39a0
testb $0x1, %r15b
je 0x3a50
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x229a(%rip), %rdi      # 0x5cf1
movq 0x10(%rsp), %rsi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1050
// File: /workspace/github_c_makefile_star2_O2/w4kfu[P]HommI/Pal/main.c
// Function: main
int main(int argc, char *argv[])
{
	char *filename = NULL;
	FILE *fin = NULL;
	int width, heigth;
	int square_width = 32, square_height = 32;
	unsigned char *pal = NULL;

	if (argc != 2)
	{
		fprintf(stderr, "%s <*.PAL>\n", argv[0]);
		return EXIT_FAILURE;
	}
	filename = argv[1];
	if (!(fin = fopen(filename, "rb")))
	{
		perror("fopen()");
		return EXIT_FAILURE;
	}
	if (!(pal = init_palette(fin)))
	{
		fclose(fin);
		return EXIT_FAILURE;
	}
	width = square_width * 16;
	heigth = square_height * 16;
	pal = expand_palette(pal, square_width, square_height);
	if (pal)
	{
		writeImage("./extract/test.png", width, heigth, pal, "pal");
	}
	return 0;
}

// Assembly:
pushq %rbx
cmpl $0x2, %edi
jne 0x1556
movq 0x8(%rsi), %rdi
leaq 0xb8d(%rip), %rsi       # 0x2084
callq 0x1140
testq %rax, %rax
je 0x1573
movq %rax, %rbx
movq %rax, %rdi
callq 0x15ca
testq %rax, %rax
je 0x1547
pushq $0x20
popq %rdx
movq %rax, %rdi
movl %edx, %esi
callq 0x1679
xorl %ebx, %ebx
testq %rax, %rax
je 0x1552
leaq 0xb5b(%rip), %rdi       # 0x2087
leaq 0xb67(%rip), %r8        # 0x209a
movl $0x200, %esi            # imm = 0x200
movl $0x200, %edx            # imm = 0x200
movq %rax, %rcx
callq 0x1296
jmp 0x1552
movq %rbx, %rdi
callq 0x1070
pushq $0x1
popq %rbx
movl %ebx, %eax
popq %rbx
retq
movq 0x2a9b(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq (%rsi), %rdx
leaq 0xb0e(%rip), %rsi       # 0x2078
xorl %eax, %eax
callq 0x10c0
jmp 0x154f
leaq 0xa8d(%rip), %rdi       # 0x2007
callq 0x1150
jmp 0x154f
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/w4kfu[P]HommI/Pal/pal.c
// Function: open_palette
unsigned char *open_palette(char *filename)
{
	FILE *fin = NULL;
	unsigned char *pal = NULL;

	if (!(fin = fopen(filename, "rb")))
	{
		perror("fopen()");
		return NULL;
	}
	pal = init_palette(fin);
	fclose(fin);
	return pal;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xaf5(%rip), %rsi       # 0x2084
callq 0x1140
testq %rax, %rax
je 0x15ba
movq %rax, %rbx
movq %rax, %rdi
callq 0x15ca
movq %rax, %r14
movq %rbx, %rdi
callq 0x1070
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xa46(%rip), %rdi       # 0x2007
callq 0x1150
xorl %eax, %eax
jmp 0x15b2
// File: /workspace/github_c_makefile_star2_O2/w4kfu[P]HommI/Pal/pal.c
// Function: init_palette
unsigned char *init_palette(FILE *fin)
{
	unsigned char *pal = NULL;
	unsigned int filesize;

	if (!(pal = malloc(sizeof (struct color) * 256)))
	{
		perror("malloc()");
		return NULL;
	}
        fseek(fin, 0, SEEK_END);
        filesize = ftell(fin);
        fseek(fin, 0, SEEK_SET);
	if (filesize != (256 * 3))
	{
		fprintf(stderr, "[-] Palette not handled\n");
		free(pal);
		return NULL;
	}
	if (fread(pal, 1, filesize, fin) != filesize)
	{
		perror("fread()");
		free(pal);
		return NULL;
	}
	return pal;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movl $0x300, %edi            # imm = 0x300
callq 0x1110
testq %rax, %rax
je 0x1635
movq %rax, %rbx
pushq $0x2
popq %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x1120
movq %r14, %rdi
callq 0x10d0
movq %rax, %r15
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1120
cmpl $0x300, %r15d           # imm = 0x300
jne 0x1643
pushq $0x1
popq %rsi
movl $0x300, %edx            # imm = 0x300
movq %rbx, %rdi
movq %r14, %rcx
callq 0x1050
cmpq $0x300, %rax            # imm = 0x300
jne 0x1661
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0xa62(%rip), %rdi       # 0x209e
callq 0x1150
jmp 0x1675
movq 0x29ae(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xa53(%rip), %rdi       # 0x20a7
pushq $0x18
popq %rsi
pushq $0x1
popq %rdx
callq 0x1170
jmp 0x166d
leaq 0xa58(%rip), %rdi       # 0x20c0
callq 0x1150
movq %rbx, %rdi
callq 0x1040
xorl %ebx, %ebx
jmp 0x162c
// File: /workspace/github_c_makefile_star2_O2/w4kfu[P]HommI/Pal/pal.c
// Function: expand_palette
unsigned char *expand_palette(unsigned char *pal, unsigned square_width, unsigned square_height)
{
	unsigned char *newpal = NULL;
	unsigned char *spal = NULL;
	unsigned int i, j, k, l;

	if (!(newpal = malloc(sizeof (char) * 256 * 3 * square_width * square_height)))
	{
		perror("malloc()");
		return NULL;
	}
	spal = newpal;
	for (i = 0; i < 16; i++)
	{
		for (j = 0; j < square_height; j++)
		{
			for (k = 0; k < 16; k++)
			{
				struct color *rgb;
				rgb = (struct color*)&pal[(k + (i * 16)) * 3];
				for (l = 0; l < square_width; l++)
				{
					memcpy(newpal, rgb, sizeof (struct color));
					newpal += 3;
				}
			}
		}
	}
	return spal;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movl %esi, %eax
movl %edx, %ecx
imulq %rax, %rcx
imulq $0x300, %rcx, %rdi      # imm = 0x300
callq 0x1110
movq %rax, %r15
testq %rax, %rax
je 0x16fd
xorl %eax, %eax
movq %r15, %rcx
cmpq $0x10, %rax
je 0x1709
movq %rax, %rdx
shlq $0x4, %rdx
xorl %esi, %esi
cmpl %ebx, %esi
je 0x16f8
xorl %edi, %edi
cmpq $0x10, %rdi
je 0x16f4
movq %rdi, %r8
orq %rdx, %r8
leaq (%r8,%r8,2), %r8
addq %r14, %r8
movl %ebp, %r9d
subl $0x1, %r9d
jb 0x16ef
movb 0x2(%r8), %r10b
movb %r10b, 0x2(%rcx)
movzwl (%r8), %r10d
movw %r10w, (%rcx)
addq $0x3, %rcx
jmp 0x16d3
incq %rdi
jmp 0x16bd
incl %esi
jmp 0x16b7
incq %rax
jmp 0x16a8
leaq 0x99a(%rip), %rdi       # 0x209e
callq 0x1150
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/s3/dns.c
// Function: callback_read_len
static int
callback_read_len(void * cookie, ssize_t readlen)
{
	struct dns_reader * DR = cookie;

	/* If we failed to read a size_t, something is seriously wrong. */
	if (readlen != sizeof(size_t))
		goto err1;

	/* Sanity-check. */
	if (DR->addrlen > SSIZE_MAX)
		goto err1;

	/* Allocate space to hold the address. */
	if ((DR->addr = malloc(DR->addrlen)) == NULL)
		goto err0;

	/* Read the address. */
	if ((DR->read_cookie = network_read(DR->s, DR->addr, DR->addrlen,
	    DR->addrlen, callback_read_addr, DR)) == NULL)
		goto err1;

	/* Success! */
	return (0);

err1:
	warnp("Error reading address via socket");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
pushq $-0x1
popq %rbp
cmpq $0x8, %rsi
jne 0x33cc
movq %rdi, %rbx
movq 0x10(%rdi), %r14
testq %r14, %r14
js 0x33cc
movq %r14, %rdi
callq 0x2340
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x33fa
movl 0x8(%rbx), %edi
leaq 0x7e(%rip), %r8         # 0x342b
movq %rax, %rsi
movq %r14, %rdx
movq %r14, %rcx
movq %rbx, %r9
callq 0x6dd8
movq %rax, %rcx
movq %rax, 0x20(%rbx)
xorl %eax, %eax
testq %rcx, %rcx
jne 0x33fc
callq 0x20a0
cmpl $0x0, (%rax)
je 0x33ec
movq %rax, %rbx
leaq 0xcf66(%rip), %rdi      # 0x10346
xorl %eax, %eax
callq 0x945d
andl $0x0, (%rbx)
jmp 0x33fa
leaq 0xcf53(%rip), %rdi      # 0x10346
xorl %eax, %eax
callq 0x95ec
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/s3/dns.c
// Function: callback_read_addr
static int
callback_read_addr(void * cookie, ssize_t readlen)
{
	struct dns_reader * DR = cookie;
	struct sock_addr * sa;

	/* If we failed to read, something is seriously wrong. */
	if (readlen != (ssize_t)DR->addrlen)
		goto err1;

	/* Parse the address. */
	if ((sa = sock_addr_deserialize(DR->addr, DR->addrlen)) == NULL)
		goto err0;

	/* Free the serialized address. */
	free(DR->addr);
	DR->addr = NULL;

	/* Add the address to the S3 request queue. */
	if (s3_request_queue_addaddr(DR->Q, sa, 600)) {
		warnp("Error adding S3 endpoint address");
		sock_addr_free(sa);
		goto err0;
	}

	/* Free the parsed address. */
	sock_addr_free(sa);

	/* Start reading another address. */
	if ((DR->read_cookie = network_read(DR->s, (uint8_t *)&DR->addrlen,
	    sizeof(size_t), sizeof(size_t), callback_read_len, DR)) == NULL)
		goto err1;

	/* Success! */
	return (0);

err1:
	warnp("Error reading address via socket");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $-0x1
popq %rbp
cmpq %rsi, 0x10(%rdi)
jne 0x34d0
movq %rdi, %r14
movq 0x18(%rdi), %rdi
callq 0x9179
testq %rax, %rax
je 0x3516
movq %rax, %rbx
movq 0x18(%r14), %rdi
callq 0x2040
andq $0x0, 0x18(%r14)
movq (%r14), %rdi
movq %rbx, %rsi
movl $0x258, %edx            # imm = 0x258
callq 0xa2fe
testl %eax, %eax
je 0x349a
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3500
movq %rax, %r14
leaq 0xccd3(%rip), %rdi      # 0x10160
xorl %eax, %eax
callq 0x945d
andl $0x0, (%r14)
jmp 0x350e
leaq 0x10(%r14), %r15
movq %rbx, %rdi
callq 0x8b4b
movl 0x8(%r14), %edi
leaq -0x138(%rip), %r8       # 0x3379
pushq $0x8
popq %rcx
movq %r15, %rsi
movq %rcx, %rdx
movq %r14, %r9
callq 0x6dd8
movq %rax, %rcx
movq %rax, 0x20(%r14)
xorl %eax, %eax
testq %rcx, %rcx
jne 0x3518
callq 0x20a0
cmpl $0x0, (%rax)
je 0x34f0
movq %rax, %rbx
leaq 0xce62(%rip), %rdi      # 0x10346
xorl %eax, %eax
callq 0x945d
andl $0x0, (%rbx)
jmp 0x3516
leaq 0xce4f(%rip), %rdi      # 0x10346
xorl %eax, %eax
callq 0x95ec
jmp 0x3516
leaq 0xcc59(%rip), %rdi      # 0x10160
xorl %eax, %eax
callq 0x95ec
movq %rbx, %rdi
callq 0x8b4b
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/s3/dispatch.c
// Function: dispatch_accept
struct dispatch_state *
dispatch_accept(struct s3_request_queue * Q, int s)
{
	struct dispatch_state * D;

	/* Allocate space for dispatcher state. */
	if ((D = malloc(sizeof(struct dispatch_state))) == NULL)
		goto err0;

	/* Initialize dispatcher. */
	D->Q = Q;
	D->ip_head = D->ip_tail = NULL;

	/* Accept a connection. */
	D->accepting = 1;
	if (network_accept(s, callback_accept, D) == NULL)
		goto err1;

	/* Success! */
	return (D);

err1:
	free(D);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
pushq $0x38
popq %rdi
callq 0x2340
testq %rax, %rax
je 0x356c
movq %rax, %rbx
movq %r14, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movl $0x1, 0x18(%rax)
leaq 0x21(%rip), %rsi        # 0x3576
movl %ebp, %edi
movq %rax, %rdx
callq 0x6950
testq %rax, %rax
jne 0x356e
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq