LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/maandree[P]libkeccak/digest.c
// Function: libkeccak_fast_update
int
libkeccak_fast_update(struct libkeccak_state *restrict state, const void *restrict msg, size_t msglen)
{
	size_t len;
	auto unsigned char *restrict new;

	if (__builtin_expect(state->mptr + msglen > state->mlen, 0)) {
		state->mlen += msglen;
		new = realloc(state->M, state->mlen * sizeof(char));
		if (!new) {
			state->mlen -= msglen;
			return -1;
		}
		state->M = new;
	}

	__builtin_memcpy(state->M + state->mptr, msg, msglen * sizeof(char));
	state->mptr += msglen;
	len = state->mptr;
	len -= state->mptr % (size_t)(state->r >> 3);
	state->mptr -= len;

	libkeccak_absorption_phase(state, state->M, len);
	__builtin_memmove(state->M, state->M + len, state->mptr * sizeof(char));

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %r14
movq 0x108(%rdi), %rbp
movq 0x110(%rdi), %r13
leaq (%rdx,%rbp), %rbx
cmpq %r13, %rbx
ja 0x253b
movq 0x118(%r14), %r12
addq %r12, %rbp
movq %rbp, %rdi
movq %r15, %rdx
callq 0x10a0
movq 0xc8(%r14), %rcx
sarq $0x3, %rcx
xorl %r15d, %r15d
movq %rbx, %rax
xorl %edx, %edx
divq %rcx
subq %rdx, %rbx
movq %rdx, 0x108(%r14)
movq %r14, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x175a
movq 0x108(%r14), %rdx
movq 0x118(%r14), %rdi
addq %rdi, %rbx
movq %rbx, %rsi
callq 0x10d0
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, (%rsp)
leaq (%r15,%r13), %rsi
movq %rsi, 0x110(%r14)
movq 0x118(%r14), %rdi
callq 0x10c0
testq %rax, %rax
je 0x256e
movq %rax, %r12
movq %rax, 0x118(%r14)
movq (%rsp), %rsi
jmp 0x24d4
movq %r13, 0x110(%r14)
pushq $-0x1
popq %r15
jmp 0x2529
// File: /workspace/github_c_makefile_star2_O2/maandree[P]libkeccak/digest.c
// Function: libkeccak_update
int
libkeccak_update(struct libkeccak_state *restrict state, const void *restrict msg, size_t msglen)
{
	size_t len;
	auto unsigned char *restrict new;

	if (__builtin_expect(state->mptr + msglen > state->mlen, 0)) {
		state->mlen += msglen;
		new = malloc(state->mlen * sizeof(char));
		if (!new) {
			state->mlen -= msglen;
			return -1;
		}
		libkeccak_state_wipe_message(state);
		free(state->M);
		state->M = new;
	}

	__builtin_memcpy(state->M + state->mptr, msg, msglen * sizeof(char));
	state->mptr += msglen;
	len = state->mptr;
	len -= state->mptr % (size_t)(state->r >> 3);
	state->mptr -= len;

	libkeccak_absorption_phase(state, state->M, len);
	__builtin_memmove(state->M, state->M + len, state->mptr * sizeof(char));

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x108(%rdi), %rdi
movq 0x110(%r14), %r13
leaq (%rdi,%rdx), %rax
cmpq %r13, %rax
ja 0x2618
movq 0x118(%r14), %r12
addq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x10a0
addq 0x108(%r14), %rbx
movq 0xc8(%r14), %rcx
movq 0x118(%r14), %rsi
sarq $0x3, %rcx
xorl %r15d, %r15d
movq %rbx, %rax
xorl %edx, %edx
divq %rcx
subq %rdx, %rbx
movq %rdx, 0x108(%r14)
movq %r14, %rdi
movq %rbx, %rdx
callq 0x175a
movq 0x108(%r14), %rdx
movq 0x118(%r14), %rdi
addq %rdi, %rbx
movq %rbx, %rsi
callq 0x10d0
movl %r15d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq (%rbx,%r13), %rdi
movq %rdi, 0x110(%r14)
callq 0x10b0
testq %rax, %rax
je 0x2657
movq %rax, %r12
movq %r14, %rdi
callq 0x4390
movq 0x118(%r14), %rdi
callq 0x1030
movq %r12, 0x118(%r14)
movq 0x108(%r14), %rdi
jmp 0x25ab
movq %r13, 0x110(%r14)
pushq $-0x1
popq %r15
jmp 0x260b
// File: /workspace/github_c_makefile_star2_O2/maandree[P]libkeccak/digest.c
// Function: libkeccak_zerocopy_digest
void
libkeccak_zerocopy_digest(struct libkeccak_state *restrict state, void *restrict msg_, size_t msglen,
                          size_t bits, const char *restrict suffix, void *restrict hashsum)
{
	unsigned char *restrict msg = msg_;
	register long int rr = state->r >> 3;
	auto size_t suffix_len = suffix ? __builtin_strlen(suffix) : 0;
	register long int i;

	if (!msg) {
		msglen = 0;
		bits = 0;
	} else {
		msglen += bits >> 3;
		bits &= 7;
	}

	if (bits)
		msg[msglen] = msg[msglen] & (unsigned char)((1 << bits) - 1);
	if (__builtin_expect(!!suffix_len, 1)) {
		if (!bits)
			msg[msglen] = 0;
		while (suffix_len--) {
			msg[msglen] |= (unsigned char)((*suffix++ & 1) << bits++);
			if (bits == 8) {
				bits = 0;
				msg[++msglen] = 0;
			}
		}
	}
	if (bits)
		msglen++;

	msglen = libkeccak_pad10star1((size_t)state->r, msg, msglen, bits);
	libkeccak_absorption_phase(state, msg, msglen);

	if (hashsum) {
		libkeccak_squeezing_phase(state, rr, (state->n + 7) >> 3, state->w >> 3, hashsum);
	} else {
		for (i = (state->n - 1) / state->r; i--;)
			libkeccak_f(state);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, %rbp
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq 0xc8(%rdi), %rax
movq %rax, (%rsp)
testq %r8, %r8
je 0x269b
movq %rbp, %rdi
callq 0x1050
jmp 0x269d
xorl %eax, %eax
movq %r13, %rdx
shrq $0x3, %rdx
addq %r14, %rdx
andq $0x7, %r13
je 0x26cb
movb $-0x1, %sil
movl %r13d, %ecx
shlb %cl, %sil
notb %sil
andb %sil, (%r12,%rdx)
testq %rax, %rax
movq %r15, %r14
movq (%rsp), %r15
jne 0x26e7
jmp 0x2721
testq %rax, %rax
movq %r15, %r14
je 0x26d9
movq (%rsp), %r15
jmp 0x26e2
xorl %r13d, %r13d
movq (%rsp), %r15
jmp 0x2721
movb $0x0, (%r12,%rdx)
xorl %esi, %esi
cmpq %rsi, %rax
je 0x271e
movzbl (%rbp,%rsi), %edi
andl $0x1, %edi
leal (%rsi,%r13), %ecx
shll %cl, %edi
orb %dil, (%r12,%rdx)
leaq (%rsi,%r13), %rcx
incq %rcx
incq %rsi
cmpq $0x8, %rcx
jne 0x26e9
incq %rdx
addq %rsi, %rbp
subq %rsi, %rax
xorl %r13d, %r13d
jmp 0x26e2
addq %rsi, %r13
cmpq $0x1, %r13
sbbq $-0x1, %rdx
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rcx
callq 0x27b5
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x175a
movq 0xd8(%rbx), %rdx
testq %r14, %r14
je 0x2784
sarq $0x3, %r15
addq $0x7, %rdx
sarq $0x3, %rdx
movq 0xe8(%rbx), %rcx
sarq $0x3, %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %r8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1110
decq %rdx
movq %rdx, %rax
cqto
idivq 0xc8(%rbx)
movq %rax, %r14
subq $0x1, %r14
jb 0x27a6
movq %rbx, %rdi
callq 0x285b
jmp 0x2796
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/maandree[P]libkeccak/digest.c
// Function: libkeccak_pad10star1
LIBKECCAK_GCC_ONLY(__attribute__((__nonnull__, __nothrow__, __gnu_inline__)))
static inline size_t
libkeccak_pad10star1(register size_t r, unsigned char *msg, size_t msglen, register size_t bits)
{
	register size_t nrf = msglen - !!bits;
	register size_t len = (nrf << 3) | bits;
	register size_t ll = len % r;
	register unsigned char b = (unsigned char)(bits ? (msg[nrf] | (1 << bits)) : 1);

	if (r - 8 <= ll && ll <= r - 2) {
		msg[nrf] = (unsigned char)(b ^ 0x80);
		msglen = nrf + 1;
	} else {
		len = ++nrf << 3;
		len = (len - (len % r) + (r - 8)) >> 3;
		msglen = len + 1;

		msg[nrf - 1] = b;
		__builtin_memset(&msg[nrf], 0, (len - nrf) * sizeof(char));
		msg[len] = (unsigned char)0x80;
	}
	return msglen;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r8
movq %rsi, %rbx
xorl %eax, %eax
testq %rcx, %rcx
setne %al
subq %rax, %r8
leaq (,%r8,8), %rax
orq %rcx, %rax
xorl %edx, %edx
divq %rdi
testq %rcx, %rcx
je 0x27ea
pushq $0x1
popq %rsi
shll %cl, %esi
orb (%rbx,%r8), %sil
jmp 0x27ed
movb $0x1, %sil
leaq -0x8(%rdi), %rcx
cmpq %rdx, %rcx
seta %al
leaq -0x2(%rdi), %r9
cmpq %r9, %rdx
seta %dl
orb %al, %dl
je 0x2845
leaq 0x1(%r8), %r9
leaq 0x8(,%r8,8), %rax
xorl %edx, %edx
divq %rdi
leaq (%rcx,%r8,8), %r14
addq $0x8, %r14
subq %rdx, %r14
shrq $0x3, %r14
leaq (%rbx,%r8), %rdi
incq %rdi
movb %sil, -0x1(%rdi)
movq %r14, %rdx
subq %r9, %rdx
xorl %esi, %esi
callq 0x1070
movb $-0x80, %sil
movq %r14, %r8
jmp 0x2849
addb $-0x80, %sil
movb %sil, (%rbx,%r8)
incq %r8
movq %r8, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/maandree[P]libkeccak/libkeccak_state_initialise.c
// Function: libkeccak_state_initialise
int
libkeccak_state_initialise(struct libkeccak_state *restrict state, const struct libkeccak_spec *restrict spec)
{
	long int x;

	state->r = spec->bitrate;
	state->n = spec->output;
	state->c = spec->capacity;
	state->b = state->r + state->c;
	state->w = x = state->b / 25;
	state->l = 0;

	if (x & 0xF0L) {
		state->l |= 4;
		x >>= 4;
	}
	if (x & 0x0CL) {
		state->l |= 2;
		x >>= 2;
	}
	if (x & 0x02L) {
		state->l |= 1;
	}

	state->nr = 12 + (state->l << 1);
	state->wmod = (state->w == 64) ? ~0ULL : (uint64_t)((1ULL << state->w) - 1);
	for (x = 0; x < 25; x++)
		state->S.w64[x] = 0;
	state->mptr = 0;
	state->mlen = (size_t)(state->r * state->b) >> 2;

	state->M = malloc(state->mlen * sizeof(char));
	return state->M == NULL ? -1 : 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %rcx
movq %rcx, 0xc8(%rdi)
movq 0x8(%rsi), %rdi
movups 0x8(%rsi), %xmm0
movups %xmm0, 0xd0(%rbx)
leaq (%rdi,%rcx), %rax
movq %rax, 0xe0(%rbx)
pushq $0x19
popq %rsi
cqto
idivq %rsi
movq %rax, 0xe8(%rbx)
movl %eax, %edx
andl $0xf0, %edx
movq %rax, %rsi
sarq $0x4, %rsi
xorl %r8d, %r8d
testq %rdx, %rdx
cmoveq %rax, %rsi
setne %r8b
shll $0x2, %r8d
movl %esi, %r9d
andl $0xc, %r9d
leaq 0x2(%r8), %r10
movl %esi, %r11d
shrl $0x2, %r11d
testq %r9, %r9
cmoveq %r8, %r10
cmoveq %rsi, %r11
orq %r9, %rdx
andl $0x2, %r11d
movl %r11d, %r8d
shrl %r8d
orq %r10, %r8
xorl %esi, %esi
orq %r11, %rdx
leaq 0xc(%r8,%r8), %rdx
cmoveq %rsi, %r8
movq %r8, 0xf8(%rbx)
movq %rdx, 0x100(%rbx)
leaq -0x640(%rdi,%rcx), %rdx
pushq $-0x1
popq %rdi
movq %rdi, %r8
movl %eax, %ecx
shlq %cl, %r8
cmpq $0x19, %rdx
notq %r8
cmovbq %rdi, %r8
movq %r8, 0xf0(%rbx)
cmpq $0x19, %rsi
je 0x4356
andq $0x0, (%rbx,%rsi,8)
incq %rsi
jmp 0x4346
andq $0x0, 0x108(%rbx)
movq 0xe0(%rbx), %rdi
imulq 0xc8(%rbx), %rdi
shrq $0x2, %rdi
movq %rdi, 0x110(%rbx)
callq 0x10b0
movq %rax, 0x118(%rbx)
xorl %ecx, %ecx
cmpq $0x1, %rax
sbbl %ecx, %ecx
movl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/maandree[P]libkeccak/extra/libkeccak_state_wipe_message.c
// Function: libkeccak_state_wipe_message
void
libkeccak_state_wipe_message(volatile struct libkeccak_state *state)
{
	volatile unsigned char *restrict M = state->M;
	size_t i;

	for (i = 0; i < state->mptr; i++)
		M[i] = 0;
}

// Assembly:
movq 0x118(%rdi), %rax
xorl %ecx, %ecx
cmpq 0x108(%rdi), %rcx
jae 0x43ab
movb $0x0, (%rax,%rcx)
incq %rcx
jmp 0x4399
retq
// File: /workspace/github_c_makefile_star2_O2/maandree[P]libkeccak/util/libkeccak_behex_lower.c
// Function: libkeccak_behex_lower
void
libkeccak_behex_lower(char *restrict output, const void *restrict hashsum_, size_t n)
{
	const unsigned char *restrict hashsum = hashsum_;

	output[2 * n] = '\0';
	while (n--) {
		output[2 * n + 0] = "0123456789abcdef"[(hashsum[n] >> 4) & 15];
		output[2 * n + 1] = "0123456789abcdef"[(hashsum[n] >> 0) & 15];
	}
}

// Assembly:
leaq (%rdx,%rdx), %r9
xorl %r8d, %r8d
leaq 0xf48(%rip), %rax       # 0x5302
movq %rdx, %rcx
movb %r8b, (%rdi,%r9)
subq $0x1, %rcx
jb 0x43ef
movzbl -0x1(%rsi,%rdx), %edx
movl %edx, %r8d
shrl $0x4, %r8d
movb (%r8,%rax), %r8b
movb %r8b, (%rdi,%rcx,2)
andl $0xf, %edx
movb (%rdx,%rax), %r8b
leaq 0x1(,%rcx,2), %r9
movq %rcx, %rdx
jmp 0x43bd
retq
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/client/main.c
// Function: kill_workers
static void kill_workers(struct client_config *config)
{
	unsigned int i;

	for (i = 0; i < config->n_threads; i++)
		config->workers_data[i].test_finished = 1;
	for (i = 0; i < config->n_threads; i++)
		pthread_kill(config->workers_data[i].tid, SIGUSR1);
	for (i = 0; i < config->n_threads; i++)
		pthread_join(config->workers_data[i].tid, NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x1c(%rdi), %eax
pushq $0x64
popq %rcx
xorl %edx, %edx
cmpq %rax, %rdx
jae 0x2da8
movq 0x70(%rbx), %rsi
movl $0x1, (%rsi,%rcx)
incq %rdx
subq $-0x80, %rcx
jmp 0x2d8f
pushq $0x28
popq %r14
xorl %r15d, %r15d
pushq $0xa
popq %rbp
movl %eax, %ecx
cmpq %rcx, %r15
jae 0x2dd4
movq 0x70(%rbx), %rax
movq (%rax,%r14), %rdi
movl %ebp, %esi
callq 0x21c0
incq %r15
movl 0x1c(%rbx), %eax
subq $-0x80, %r14
jmp 0x2db2
pushq $0x28
popq %r14
xorl %r15d, %r15d
movl %eax, %eax
cmpq %rax, %r15
jae 0x2dfd
movq 0x70(%rbx), %rax
movq (%rax,%r14), %rdi
xorl %esi, %esi
callq 0x2330
incq %r15
movl 0x1c(%rbx), %eax
subq $-0x80, %r14
jmp 0x2ddb
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/client/../wsync.h
// Function: wsync_set_state
static inline void wsync_set_state(struct worker_sync *ws, unsigned int state)
{
	pthread_mutex_lock(&ws->mtx);
	ws->state = state;
	pthread_cond_broadcast(&ws->cv);
	pthread_mutex_unlock(&ws->mtx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x5ee7(%rip), %r14      # 0x92c8
movq %r14, %rdi
callq 0x2360
movl %ebx, 0x5c(%r14)
leaq 0x28(%r14), %rdi
callq 0x2080
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2200
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/client/../wsync.h
// Function: wsync_wait_for_counter
static inline void wsync_wait_for_counter(struct worker_sync *ws,
					  unsigned int count)
{
	pthread_mutex_lock(&ws->mtx);
	while (ws->counter < count)
		pthread_cond_wait(&ws->cv, &ws->mtx);
	pthread_mutex_unlock(&ws->mtx);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x5eb5(%rip), %r14      # 0x92c8
movq %r14, %rdi
callq 0x2360
leaq 0x28(%r14), %r15
cmpl %ebx, 0x58(%r14)
jae 0x3432
movq %r15, %rdi
movq %r14, %rsi
callq 0x20d0
jmp 0x341f
leaq 0x5e8f(%rip), %rdi      # 0x92c8
popq %rbx
popq %r14
popq %r15
jmp 0x2200
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/client/worker.c
// Function: worker_setup
int worker_setup(struct client_worker_data *data)
{
	int val;
	int ret;
	int sd;

	sd = socket(test_addr.sa.sa_family, SOCK_STREAM, IPPROTO_TCP);
	if (sd < 0) {
		ret = -errno;
		perror("socket");
		return ret;
	}

	if (client_config.tcp_nodelay) {
		val = 1;
		ret = setsockopt(sd, SOL_TCP, TCP_NODELAY, &val, sizeof(val));
		if (ret < 0) {
			ret = -errno;
			perror("setsockopt(TCP_NODELAY)");
			return ret;
		}
	}
	if (client_config.rcvbuf_size) {
		val = client_config.rcvbuf_size;
		ret = setsockopt(sd, SOL_SOCKET, SO_RCVBUF, &val, sizeof(val));
		if (ret < 0) {
			ret = -errno;
			perror("setsockopt(SO_RCVBUF)");
			return ret;
		}
	}
	if (client_config.sndbuf_size) {
		val = client_config.sndbuf_size;
		ret = setsockopt(sd, SOL_SOCKET, SO_SNDBUF, &val, sizeof(val));
		if (ret < 0) {
			ret = -errno;
			perror("setsockopt(SO_SNDBUF)");
			return ret;
		}
	}

	data->sd = sd;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movzwl 0x5e76(%rip), %edi      # 0x9328
pushq $0x1
popq %rsi
pushq $0x6
popq %rdx
callq 0x2380
testl %eax, %eax
js 0x3551
movl %eax, %ebp
leaq 0x5d12(%rip), %r14      # 0x91e0
cmpb $0x1, 0x44(%r14)
jne 0x34f9
leaq 0xc(%rsp), %rcx
movl $0x1, (%rcx)
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
pushq $0x4
popq %r8
movl %ebp, %edi
callq 0x20b0
testl %eax, %eax
js 0x3587
movl 0x38(%r14), %eax
testl %eax, %eax
je 0x351d
leaq 0xc(%rsp), %rcx
movl %eax, (%rcx)
pushq $0x1
popq %rsi
pushq $0x8
popq %rdx
pushq $0x4
popq %r8
movl %ebp, %edi
callq 0x20b0
testl %eax, %eax
js 0x3563
movl 0x3c(%r14), %eax
testl %eax, %eax
je 0x3541
leaq 0xc(%rsp), %rcx
movl %eax, (%rcx)
pushq $0x1
popq %rsi
pushq $0x7
popq %rdx
pushq $0x4
popq %r8
movl %ebp, %edi
callq 0x20b0
testl %eax, %eax
js 0x3575
movl %ebp, 0x4(%rbx)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
callq 0x2070
xorl %ebx, %ebx
subl (%rax), %ebx
leaq 0x1cff(%rip), %rdi      # 0x5260
jmp 0x3597
callq 0x2070
xorl %ebx, %ebx
subl (%rax), %ebx
leaq 0x1d0c(%rip), %rdi      # 0x527f
jmp 0x3597
callq 0x2070
xorl %ebx, %ebx
subl (%rax), %ebx
leaq 0x1d10(%rip), %rdi      # 0x5295
jmp 0x3597
callq 0x2070
xorl %ebx, %ebx
subl (%rax), %ebx
leaq 0x1cd0(%rip), %rdi      # 0x5267
callq 0x2280
jmp 0x3546
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/client/worker.c
// Function: worker_connect
int worker_connect(struct client_worker_data *data)
{
	union sockaddr_any local_addr;
	socklen_t addr_len;
	int ret;

	ret = sockaddr_length(&test_addr);
	if (ret < 0)
		return ret;
	addr_len = ret;
	ret = connect(data->sd, &test_addr.sa, addr_len);
	if (ret < 0)
		return ret;

	addr_len = sizeof(local_addr);
	ret = getsockname(data->sd, &local_addr.sa, &addr_len);
	if (ret < 0) {
		ret = -errno;
		goto err_close;
	}
	ret = sockaddr_get_port(&local_addr);
	if (ret < 0)
		goto err_close;
	data->client_port = ret;

	return 0;
err_close:
	close(data->sd);
	return ret;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x28, %rsp
movzwl 0x5d7d(%rip), %ecx      # 0x9328
cmpw $0xa, %cx
pushq $0x1c
popq %rax
pushq $-0x16
popq %rbp
cmovnel %ebp, %eax
cmpw $0x2, %cx
pushq $0x10
popq %rdx
cmovnel %eax, %edx
testl %edx, %edx
js 0x3629
movq %rdi, %rbx
movl 0x4(%rdi), %edi
leaq 0x5d55(%rip), %rsi      # 0x9328
callq 0x22e0
testl %eax, %eax
js 0x3629
leaq 0x8(%rsp), %rdx
movl $0x1c, (%rdx)
movl 0x4(%rbx), %edi
leaq 0xc(%rsp), %rsi
callq 0x22a0
testl %eax, %eax
js 0x3616
movzwl 0xc(%rsp), %eax
orl $0x8, %eax
cmpl $0xa, %eax
jne 0x361f
movzwl 0xe(%rsp), %eax
rolw $0x8, %ax
movw %ax, 0x8(%rbx)
xorl %eax, %eax
jmp 0x3629
callq 0x2070
xorl %ebp, %ebp
subl (%rax), %ebp
movl 0x4(%rbx), %edi
callq 0x2180
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/client/worker.c
// Function: worker_run_test
int worker_run_test(struct client_worker_data *data)
{
	bool get_reply = data->reply;
	bool eof = false;
	int ret;

	data->status = 0;
	while (!eof && !data->test_finished) {
		ret = send_msg(data);
		if (ret < 0) {
			data->status = -1;
			break;
		}
		if (data->test_finished)
			break;
		if (get_reply) {
			ret = recv_msg(data, &eof);
			if (ret < 0) {
				data->status = -1;
				break;
			}
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb 0x18(%rdi), %bpl
andl $0x0, 0x60(%rdi)
cmpl $0x0, 0x64(%rbx)
jne 0x3765
movq 0x10(%rbx), %r14
movq 0x20(%rbx), %r15
testq %r15, %r15
je 0x374f
cmpl $0x0, 0x64(%rbx)
jne 0x3765
movl 0x4(%rbx), %edi
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x2110
testq %rax, %rax
jns 0x368a
callq 0x2070
movl (%rax), %ecx
cmpl $0x4, %ecx
je 0x365d
jmp 0x36b1
addq %rax, %r14
subq %rax, %r15
movdqu 0x50(%rbx), %xmm0
movq %rax, %xmm1
movdqa 0x1bae(%rip), %xmm2     # 0x5250
punpcklqdq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0]
paddq %xmm0, %xmm2
movdqu %xmm2, 0x50(%rbx)
jmp 0x3654
cmpl $0x20, %ecx
jne 0x36ba
xorl %ecx, %ecx
jmp 0x36bc
negl %ecx
movl %ecx, 0x60(%rbx)
cmpl $0x0, (%rax)
jg 0x3761
cmpl $0x0, 0x64(%rbx)
jne 0x3765
testb %bpl, %bpl
je 0x3642
movq 0x10(%rbx), %r14
movq 0x20(%rbx), %r15
testq %r15, %r15
je 0x3758
cmpl $0x0, 0x64(%rbx)
jne 0x3642
movl 0x4(%rbx), %edi
movq %r14, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x2040
testq %rax, %rax
jns 0x3715
callq 0x2070
movl (%rax), %eax
cmpl $0x4, %eax
je 0x36e8
jmp 0x373e
je 0x3765
addq %rax, %r14
subq %rax, %r15
movdqu 0x38(%rbx), %xmm0
movq %rax, %xmm1
movdqa 0x1b21(%rip), %xmm2     # 0x5250
punpcklqdq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0]
paddq %xmm0, %xmm2
movdqu %xmm2, 0x38(%rbx)
jmp 0x36e3
movl %eax, %ecx
negl %ecx
movl %ecx, 0x60(%rbx)
testl %eax, %eax
jle 0x3642
jmp 0x3761
incq 0x48(%rbx)
jmp 0x36c8
incq 0x30(%rbx)
jmp 0x3642
orl $-0x1, 0x60(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/client/worker.c
// Function: worker_main
void *worker_main(void * _data)
{
	struct client_worker_data *data = _data;
	int ret;

	data->status = -1;
	worker_setup(data);
	pthread_cleanup_push(cleanup_close, data);
	wsync_inc_counter(&client_worker_sync);

	wsync_wait_for_state(&client_worker_sync, WS_CONNECT);
	ret = worker_connect(data);
	if (ret < 0)
		goto out;
	wsync_inc_counter(&client_worker_sync);

	wsync_wait_for_state(&client_worker_sync, WS_RUN);
	ret = worker_run_test(data);
	if (ret < 0 || data->test_finished)
		goto out;

out:
	pthread_cleanup_pop(1);
	return NULL;
}

// Assembly:
pushq %rbx
subq $0x70, %rsp
movq %rdi, %rbx
orl $-0x1, 0x60(%rdi)
callq 0x34a0
movq %rsp, %rdi
xorl %esi, %esi
callq 0x2340
testl %eax, %eax
jne 0x37df
movq %rsp, %rdi
callq 0x2300
callq 0x37f7
pushq $0x1
popq %rdi
callq 0x3822
movq %rbx, %rdi
callq 0x359e
testl %eax, %eax
js 0x37c7
callq 0x37f7
pushq $0x2
popq %rdi
callq 0x3822
movq %rbx, %rdi
callq 0x3630
movq %rsp, %rdi
callq 0x2130
movq %rbx, %rdi
callq 0x37ef
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
retq
movq %rbx, %rdi
callq 0x37ef
movq %rsp, %rdi
callq 0x2220
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/client/../wsync.h
// Function: wsync_inc_counter
static inline void wsync_inc_counter(struct worker_sync *ws)
{
	pthread_mutex_lock(&ws->mtx);
	ws->counter++;
	pthread_cond_broadcast(&ws->cv);
	pthread_mutex_unlock(&ws->mtx);
}

// Assembly:
pushq %rbx
leaq 0x5ac9(%rip), %rbx      # 0x92c8
movq %rbx, %rdi
callq 0x2360
incl 0x5b13(%rip)            # 0x9320
leaq 0x5adc(%rip), %rdi      # 0x92f0
callq 0x2080
movq %rbx, %rdi
popq %rbx
jmp 0x2200
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/client/../wsync.h
// Function: wsync_wait_for_state
static inline void wsync_wait_for_state(struct worker_sync *ws,
					unsigned int state)
{
	pthread_mutex_lock(&ws->mtx);
	while (ws->state != state)
		pthread_cond_wait(&ws->cv, &ws->mtx);
	pthread_mutex_unlock(&ws->mtx);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x5a98(%rip), %r14      # 0x92c8
movq %r14, %rdi
callq 0x2360
leaq 0x5ab1(%rip), %r15      # 0x92f0
cmpl %ebx, 0x5adf(%rip)      # 0x9324
je 0x3854
movq %r15, %rdi
movq %r14, %rsi
callq 0x20d0
jmp 0x383f
leaq 0x5a6d(%rip), %rdi      # 0x92c8
popq %rbx
popq %r14
popq %r15
jmp 0x2200
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/client/worker.c
// Function: start_client_worker
int start_client_worker(struct client_worker_data *data)
{
	pthread_attr_t attr;
	int ret;

	ret = pthread_attr_init(&attr);
	if (ret)
		return -ret;
	ret = pthread_attr_setstacksize(&attr, WORKER_STACK_SIZE);
	if (ret)
		return -ret;
	ret = pthread_create(&data->tid, &attr, worker_main, data);

	pthread_attr_destroy(&attr);
	return -ret;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2190
testl %eax, %eax
jne 0x3891
leaq 0x8(%rsp), %rdi
movl $0x4000, %esi           # imm = 0x4000
callq 0x2390
testl %eax, %eax
je 0x38a0
movl %eax, %ebp
negl %ebp
movl %ebp, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x28(%rbx), %rdi
leaq -0x139(%rip), %rdx      # 0x3772
leaq 0x8(%rsp), %r14
movq %r14, %rsi
movq %rbx, %rcx
callq 0x2250
movl %eax, %ebp
movq %r14, %rdi
callq 0x22c0
jmp 0x3893
nop
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/client/cmdline.c
// Function: name_lookup
static int name_lookup(const char *name, const char *const names[],
		       unsigned int names_count)
{
	unsigned int i;

	for (i = 0; i < names_count; i++)
		if (!strcasecmp(name, names[i]))
			return i;

	return -ENOENT;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %r12d
xorl %r15d, %r15d
pushq $-0x2
popq %rbp
cmpq %r15, %r12
je 0x3e53
movq (%rbx,%r15,8), %rsi
movq %r14, %rdi
callq 0x2060
testl %eax, %eax
je 0x3e50
incq %r15
jmp 0x3e36
movl %r15d, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/stats.c
// Function: print_count
void print_count(uint64_t val, const struct print_options *opts)
{
	unsigned int base = opts->binary_prefix ? 1024 : 1000;
	const char *unit_str = unit_names[opts->unit];
	const char prefixes[] = " KMGT";
	const char *prefix = &prefixes[0];
	double dval;

	if (opts->exact) {
		printf("%*" PRIu64 " %s", opts->width, val, unit_str);
		return;
	}
	if (val < 20 * base) {
		printf("%5" PRIu64 "    %s", val, unit_str);
		return;
	}

	dval = val / base;
	prefix++;
	while ((dval >= 20 * base) && *prefix) {
		dval /= base;
		prefix++;
	}
	printf("%7.1lf %c%s", dval, *prefix, unit_str);

}

// Assembly:
movq %rdi, %rdx
cmpb $0x0, 0x9(%rsi)
movl $0x400, %eax            # imm = 0x400
movl $0x3e8, %edi            # imm = 0x3E8
cmovnel %eax, %edi
movl (%rsi), %eax
leaq 0x4edd(%rip), %rcx      # 0x8db0
movq (%rcx,%rax,8), %rcx
cmpb $0x1, 0x8(%rsi)
jne 0x3eee
movl 0x4(%rsi), %esi
leaq 0x2189(%rip), %rdi      # 0x6070
xorl %eax, %eax
jmp 0x2120
imull $0x14, %edi, %esi
cmpq %rdx, %rsi
jbe 0x3f0a
leaq 0x217b(%rip), %rdi      # 0x6078
movq %rdx, %rsi
movq %rcx, %rdx
xorl %eax, %eax
jmp 0x2120
movl %edi, %r8d
movq %rdx, %rax
xorl %edx, %edx
divq %r8
cvtsi2sd %rax, %xmm0
cvtsi2sd %esi, %xmm1
xorl %edx, %edx
cvtsi2sd %edi, %xmm2
leaq 0x2169(%rip), %rax      # 0x6094
ucomisd %xmm1, %xmm0
jb 0x3f40
cmpq $0x4, %rdx
je 0x3f4d
divsd %xmm2, %xmm0
incq %rdx
jmp 0x3f2b
leaq 0x2148(%rip), %rax      # 0x608f
addq %rdx, %rax
incq %rax
movsbl (%rax), %esi
leaq 0x212c(%rip), %rdi      # 0x6083
movq %rcx, %rdx
movb $0x1, %al
jmp 0x2120
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/stats.c
// Function: print_rate
void print_rate(double val, const struct print_options *opts)
{
	unsigned int base = opts->binary_prefix ? 1024 : 1000;
	const char *unit_str = unit_names[opts->unit];
	const char prefixes[] = " KMGT";
	const char *prefix = &prefixes[0];

	if (opts->exact) {
		printf("%*.1lf %s/s", opts->width, val, unit_str);
		return;
	}

	while (val >= 20000 && *prefix) {
		val /= base;
		prefix++;
	}
	printf("%7.1lf %c%s/s", val, *prefix, unit_str);

}

// Assembly:
movl (%rdi), %eax
leaq 0x4e46(%rip), %rcx      # 0x8db0
movq (%rcx,%rax,8), %rdx
cmpb $0x0, 0x8(%rdi)
je 0x3f85
movl 0x4(%rdi), %esi
leaq 0x2117(%rip), %rdi      # 0x6095
movb $0x1, %al
jmp 0x2120
cmpb $0x0, 0x9(%rdi)
jne 0x3f95
movsd 0x20a5(%rip), %xmm1     # 0x6038
jmp 0x3f9d
movsd 0x2093(%rip), %xmm1     # 0x6030
xorl %ecx, %ecx
movsd 0x2099(%rip), %xmm2     # 0x6040
leaq 0x20e6(%rip), %rax      # 0x6094
ucomisd %xmm2, %xmm0
jb 0x3fc3
cmpq $-0x5, %rcx
je 0x3fcd
divsd %xmm1, %xmm0
decq %rcx
jmp 0x3fae
leaq 0x20c5(%rip), %rax      # 0x608f
subq %rcx, %rax
movsbl (%rax), %esi
leaq 0x20ca(%rip), %rdi      # 0x60a1
movb $0x1, %al
jmp 0x2120
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/stats.c
// Function: xfer_stats_print_raw
void xfer_stats_print_raw(const struct xfer_stats *stats, unsigned int id)
{
	if (id == XFER_STATS_TOTAL)
		fputs("total    ", stdout);
	else
		printf("%-8u ", id);

	xfer_stats_1_print(&stats->rx);
	fputs("    ", stdout);
	xfer_stats_1_print(&stats->tx);
	putchar('\n');
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $-0x1, %esi
je 0x4068
leaq 0x2091(%rip), %rdi      # 0x60f0
xorl %eax, %eax
callq 0x2120
jmp 0x407e
movq 0x4f61(%rip), %rax      # 0x8fd0
movq (%rax), %rsi
leaq 0x206d(%rip), %rdi      # 0x60e6
callq 0x2150
movq %rbx, %rdi
callq 0x40b1
movq 0x4f43(%rip), %rax      # 0x8fd0
movq (%rax), %rsi
leaq 0x2089(%rip), %rdi      # 0x6120
callq 0x2150
addq $0x18, %rbx
movq %rbx, %rdi
callq 0x40b1
pushq $0xa
popq %rdi
popq %rbx
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O2/mkubecek[P]nperf/stats.c
// Function: xfer_stats_thread_footer
void xfer_stats_thread_footer(double sum, double sum_sqr, unsigned int n,
			      const struct print_options *opts)
{
	double avg, mdev;

	avg = sum / n;
	mdev = mdev_n(sum, sum_sqr, n);
	fputs("thread average ", stdout);
	print_rate(avg, opts);
	fputs(", mdev ", stdout);
	print_rate(mdev, opts);
	printf(" (%.1lf%%)\n", 100 * mdev / avg);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movl %edi, %eax
cvtsi2sd %rax, %xmm2
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm0
mulsd %xmm2, %xmm1
subsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jb 0x40fb
sqrtsd %xmm1, %xmm0
jmp 0x411a
movapd %xmm1, %xmm0
movapd %xmm2, (%rsp)
movapd %xmm3, 0x10(%rsp)
callq 0x2310
movapd 0x10(%rsp), %xmm3
movapd (%rsp), %xmm2
unpcklpd %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0]
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
divpd %xmm2, %xmm0
movapd %xmm0, (%rsp)
movq 0x4e9e(%rip), %r14      # 0x8fd0
movq (%r14), %rsi
leaq 0x1fba(%rip), %rdi      # 0x60f6
callq 0x2150
movaps (%rsp), %xmm0
movhlps %xmm0, %xmm0            # xmm0 = xmm0[1,1]
movaps %xmm0, 0x10(%rsp)
movq %rbx, %rdi
callq 0x3f61
movq (%r14), %rsi
leaq 0x1fa7(%rip), %rdi      # 0x6106
callq 0x2150
movaps (%rsp), %xmm0
movq %rbx, %rdi
callq 0x3f61
movapd (%rsp), %xmm0
mulsd 0xeab(%rip), %xmm0      # 0x5028
divsd 0x10(%rsp), %xmm0
leaq 0x1f84(%rip), %rdi      # 0x610e
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r14
jmp 0x2120
// File: /workspace/github_c_makefile_star2_O2/kobolt[P]curses-collection/invaders/loop.c
// Function: loop
void loop(void)
{
  long cycle;
  iface_action_t action;
  
  game_init();
  iface_init();

  iface_redraw_screen();
  for (cycle = 0;; cycle++) {

    action = iface_get_action();

    /* Perform player action. */
    switch (action) {
    case ACTION_EXIT:
      iface_set_end_msg("Player gave up!");
      return;

    case ACTION_RESIZE:
      if (iface_invalid_size()) {
        iface_set_end_msg("Invalid resize of terminal!");
        return;
      }
      break;

    case ACTION_SHOOT:
      game_fire_shot();
      break;

    case ACTION_MOVE_LEFT:
      game_state.player_pos--;
      if (game_state.player_pos < 2)
        game_state.player_pos = 2;
      break;

    case ACTION_MOVE_RIGHT:
      game_state.player_pos++;
      if (game_state.player_pos > (GAME_MAP_WIDTH - 3))
        game_state.player_pos = GAME_MAP_WIDTH - 3;
      break;

    case ACTION_NONE:
      break;
    }

    if (game_handle_invaders(cycle)) {
      iface_flash_screen();
      iface_set_end_msg("Player could not stop the invaders in time!");
      return;
    }

    if (game_handle_shot())
      iface_flash_screen();

    if (game_handle_bombs()) {
      iface_flash_screen();
      iface_set_end_msg("Player died from an invader's bomb!");
      return;
    }

    if (game_invaders_alive() == 0)
      break; /* Won. */

    iface_redraw_screen();

    usleep(50000);
  }

  iface_set_end_msg("Success! Invader attack has been stopped!");
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x1a38
callq 0x13b4
callq 0x15b1
xorl %r14d, %r14d
leaq 0x1d55(%rip), %rbx      # 0x3018
leaq 0x1d7a(%rip), %r15      # 0x3044
leaq 0x1d33(%rip), %r12      # 0x3004
leaq 0x3e68(%rip), %r13      # 0x5140
callq 0x152a
decl %eax
cmpl $0x4, %eax
ja 0x132b
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
callq 0x14dd
testl %eax, %eax
je 0x132b
jmp 0x139c
movzwl 0xa(%r13), %eax
incl %eax
cmpw $0x4d, %ax
pushq $0x4d
popq %rcx
cmovgel %ecx, %eax
jmp 0x1326
callq 0x1ae0
jmp 0x132b
movzwl 0xa(%r13), %eax
decl %eax
cmpw $0x3, %ax
pushq $0x2
popq %rcx
cmovll %ecx, %eax
movw %ax, 0xa(%r13)
movq %r14, %rdi
callq 0x1b07
testl %eax, %eax
jne 0x1375
callq 0x1cda
testl %eax, %eax
je 0x1345
callq 0x1a2d
callq 0x1e62
testl %eax, %eax
jne 0x136e
callq 0x1ab6
testl %eax, %eax
je 0x137f
callq 0x15b1
movl $0xc350, %edi           # imm = 0xC350
callq 0x1190
incq %r14
jmp 0x12d8
leaq 0x1cfb(%rip), %r15      # 0x3070
callq 0x1a2d
movq %r15, %rbx
jmp 0x1386
leaq 0x1d0e(%rip), %rbx      # 0x3094
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x150c
leaq 0x1c85(%rip), %rbx      # 0x3028
jmp 0x1386
// File: /workspace/github_c_makefile_star2_O2/kobolt[P]curses-collection/invaders/iface.c
// Function: iface_init
void iface_init(void)
{
  initscr();
  atexit(iface_exit_handler);
  noecho();
  keypad(stdscr, TRUE);
  timeout(0); /* Non-blocking mode */

  if (iface_invalid_size()) {
    strncpy(iface_end_msg, 
      "Invalid size of terminal. (Must be atleast 80x24.)", IFACE_END_MSG_MAX);
    exit(0);
  }

  strncpy(iface_end_msg, "Abnormal termination.", IFACE_END_MSG_MAX);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x1080
leaq 0x61(%rip), %rdi        # 0x1427
callq 0x2000
callq 0x1060
movq 0x3c09(%rip), %rbx      # 0x4fe0
movq (%rbx), %rdi
pushq $0x1
popq %rsi
callq 0x10a0
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x10e0
callq 0x14dd
leaq 0x3cf8(%rip), %rdi      # 0x50f0
testl %eax, %eax
jne 0x1411
leaq 0x1d78(%rip), %rsi      # 0x317b
pushq $0x50
popq %rdx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x10d0
leaq 0x1db4(%rip), %rsi      # 0x31cc
pushq $0x50
popq %rdx
callq 0x10d0
xorl %edi, %edi
callq 0x1140
// File: /workspace/github_c_makefile_star2_O2/kobolt[P]curses-collection/invaders/iface.c
// Function: iface_exit_handler
static void iface_exit_handler(void)
{
  char *rating;

  if (game_state.score >= 3000)
    rating = "Perfect";
  else if (game_state.score > 2500)
    rating = "Very Good";
  else if (game_state.score > 2000)
    rating = "Good";
  else if (game_state.score > 1000)
    rating = "Mediocre";
  else if (game_state.score > 0)
    rating = "Poor";
  else
    rating = "Horrible";

  endwin();
  printf("\n%s\n", iface_end_msg);
  printf("%d invaders survived, and %d shots were wasted.\n",
    game_invaders_alive(), game_state.wasted_shots);
  printf("Score: %ld (%s)\n", game_state.score, rating);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x3d0b(%rip), %r14      # 0x5140
movq (%r14), %rax
cmpq $0xbb7, %rax            # imm = 0xBB7
jle 0x1449
leaq 0x1cc4(%rip), %rbx      # 0x310b
jmp 0x1491
cmpq $0x9c4, %rax            # imm = 0x9C4
jle 0x145a
leaq 0x1cbb(%rip), %rbx      # 0x3113
jmp 0x1491
cmpq $0x7d0, %rax            # imm = 0x7D0
jle 0x146b
leaq 0x1caf(%rip), %rbx      # 0x3118
jmp 0x1491
cmpq $0x3e8, %rax            # imm = 0x3E8
jle 0x147c
leaq 0x1ca3(%rip), %rbx      # 0x311d
jmp 0x1491
testq %rax, %rax
leaq 0x1ca0(%rip), %rax      # 0x3126
leaq 0x1c9e(%rip), %rbx      # 0x312b
cmovgq %rax, %rbx
callq 0x1150
leaq 0x1c97(%rip), %rdi      # 0x3134
leaq 0x3c4c(%rip), %rsi      # 0x50f0
xorl %eax, %eax
callq 0x1070
callq 0x1ab6
movswl 0x8(%r14), %edx
leaq 0x1c7d(%rip), %rdi      # 0x3139
movl %eax, %esi
xorl %eax, %eax
callq 0x1070
movq (%r14), %rsi
leaq 0x1c9b(%rip), %rdi      # 0x316a
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x1070
// File: /workspace/github_c_makefile_star2_O2/kobolt[P]curses-collection/invaders/iface.c
// Function: iface_invalid_size
int iface_invalid_size(void)
{
  int maxy, maxx;

  getmaxyx(stdscr, maxy, maxx);

  if (maxy < GAME_MAP_HEIGHT)
    return 1;
  else if (maxx < GAME_MAP_WIDTH)
    return 1;
  else
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x3af8(%rip), %rax      # 0x4fe0
movq (%rax), %rcx
testq %rcx, %rcx
je 0x1501
xorl %eax, %eax
cmpw $0x4f, 0x6(%rcx)
setl %dl
cmpw $0x16, 0x4(%rcx)
jg 0x1508
movl $0x1, %eax
jmp 0x150a
movb %dl, %al
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/kobolt[P]curses-collection/invaders/iface.c
// Function: iface_get_action
iface_action_t iface_get_action(void)
{
  int c;
  iface_action_t action;

  action = ACTION_NONE; /* Default. */

  /* Read character buffer until empty. */
  while ((c = getch()) != ERR) {
    switch (c) {
    case KEY_RESIZE:
      return ACTION_RESIZE;
    case ' ':
    case KEY_UP:
      action = ACTION_SHOOT;
      break;
    case KEY_LEFT:
      action = ACTION_MOVE_LEFT;
      break;
    case KEY_RIGHT:
      action = ACTION_MOVE_RIGHT;
      break;
    case 'q':
    case 'Q':
    case '\e':
      return ACTION_EXIT;
    default:
      break;
    }
  }

  return action;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
movq 0x3a9f(%rip), %r14      # 0x4fe0
pushq $0x5
popq %r15
pushq $0x4
popq %r12
pushq $0x3
popq %r13
movq (%r14), %rdi
callq 0x1050
cmpl $-0x1, %eax
je 0x15a0
cmpl $0x1b, %eax
je 0x1599
cmpl $0x20, %eax
je 0x158f
cmpl $0x51, %eax
je 0x1599
cmpl $0x71, %eax
je 0x1599
cmpl $0x103, %eax            # imm = 0x103
je 0x158f
cmpl $0x19a, %eax            # imm = 0x19A
je 0x159d
cmpl $0x105, %eax            # imm = 0x105
je 0x1594
cmpl $0x104, %eax            # imm = 0x104
jne 0x154d
movl %r13d, %ebx
jmp 0x154d
movl %r15d, %ebx
jmp 0x154d
movl %r12d, %ebx
jmp 0x154d
pushq $0x1
jmp 0x159f
pushq $0x2
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/kobolt[P]curses-collection/invaders/game.c
// Function: game_init
void game_init(void)
{
  int i, j;

  srand(time(NULL));

  game_state.score = 0;
  game_state.wasted_shots = 0;
  game_state.player_pos = GAME_MAP_WIDTH / 2;
  game_state.invaders_pos_x = game_state.invaders_pos_y = 0;
  game_state.invaders_moving_right = 1;
  game_state.shot_pos_x = game_state.shot_pos_y = -1;
  game_state.bomb_pos_x = game_state.bomb_pos_y = -1;

  for (i = 0; i < GAME_INVADERS; i++) {
    game_state.invader_alive[i] = true;
  }

  for (i = 0; i < GAME_SHIELDS; i++) {
    for (j = 0; j < GAME_SHIELD_PARTS; j++) {
      game_state.shield_intact[i][j] = true;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %edi, %edi
callq 0x10f0
movl %eax, %edi
callq 0x10b0
andq $0x0, 0x36ee(%rip)      # 0x5140
movq $0x280000, 0x36eb(%rip) # imm = 0x280000
movw $0x1, 0x36ea(%rip)      # 0x5150
orq $-0x1, 0x36e4(%rip)     # 0x5152
pushq $-0x1e
popq %rax
leaq 0x36c8(%rip), %rcx      # 0x5140
testq %rax, %rax
je 0x1a87
movb $0x1, 0x38(%rax,%rcx)
incq %rax
jmp 0x1a78
leaq 0x36ea(%rip), %rax      # 0x5178
xorl %ecx, %ecx
pushq $-0xa
popq %rdx
cmpq $0x8, %rcx
je 0x1ab4
movq %rdx, %rsi
testq %rsi, %rsi
je 0x1aab
movb $0x1, 0xa(%rax,%rsi)
incq %rsi
jmp 0x1a9c
incq %rcx
addq $0xa, %rax
jmp 0x1a93
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/kobolt[P]curses-collection/invaders/game.c
// Function: game_invaders_alive
int game_invaders_alive(void)
{
  int i, n = 0;
  for (i = 0; i < GAME_INVADERS; i++) {
    if (game_state.invader_alive[i])
      n++;
  }
  return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
movabsq $-0x1e, %rcx
leaq 0x3673(%rip), %rdx      # 0x5140
testq %rcx, %rcx
je 0x1ade
movzbl 0x38(%rcx,%rdx), %esi
addl %esi, %eax
incq %rcx
jmp 0x1acd
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/Keith-S-Thompson[P]kst-time-utils/usleep-until.c
// Function: main
int main(int argc, char **argv) {
    if (argc < 2) {
        usage_error(argv[0]);
    }
    const int seconds = atoi(argv[1]);
    if (seconds <= 0) {
        usage_error(argv[0]);
    }

    struct timeval tv;
    gettimeofday(&tv, NULL);

    time_t sleep_seconds = seconds - tv.tv_sec % seconds - 1;
    suseconds_t sleep_useconds = ONE_MILLION - tv.tv_usec;
    if (sleep_useconds == ONE_MILLION) {
        sleep_useconds = 0;
        sleep_seconds ++;
    }

    usleep(ONE_MILLION * (useconds_t)sleep_seconds + sleep_useconds);

    if (argc > 2) {
        execvp(argv[2], argv+2);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
cmpl $0x1, %edi
jle 0x121c
movl %edi, %ebp
movq 0x8(%rbx), %rdi
callq 0x1060
testl %eax, %eax
jle 0x121c
movl %eax, %r14d
xorl %r12d, %r12d
movq %rsp, %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x1030
movl %r14d, %ecx
movq (%r15), %rax
movq 0x8(%r15), %rsi
cqto
idivq %rcx
subl %edx, %r14d
movl $0xf4240, %eax          # imm = 0xF4240
subl %esi, %eax
xorl %ecx, %ecx
testq %rsi, %rsi
cmovel %r12d, %eax
setne %cl
subl %ecx, %r14d
imull $0xf4240, %r14d, %edi   # imm = 0xF4240
addl %eax, %edi
callq 0x1080
cmpl $0x2, %ebp
je 0x120d
movq 0x10(%rbx), %rdi
addq $0x10, %rbx
movq %rbx, %rsi
callq 0x1050
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rdi
callq 0x1224
// File: /workspace/github_c_makefile_star2_O2/garbeam[P]st/st.c
// Function: ttyread
size_t
ttyread(void)
{
	static char buf[BUFSIZ];
	static int buflen = 0;
	int written;
	int ret;

	/* append read bytes to unprocessed bytes */
	if ((ret = read(cmdfd, buf+buflen, LEN(buf)-buflen)) < 0)
		die("couldn't read from shell: %s\n", strerror(errno));
	buflen += ret;

	written = twrite(buf, buflen, 0);
	buflen -= written;
	/* keep any uncomplete utf8 char for the next call */
	if (buflen > 0)
		memmove(buf, buf + written, buflen);

	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0xe20c(%rip), %edi      # 0x14778
movslq 0x1020d(%rip), %rax     # 0x16780
leaq 0xe206(%rip), %rsi      # 0x14780
addq %rax, %rsi
movl $0x2000, %edx           # imm = 0x2000
subq %rax, %rdx
callq 0x51c0
movq %rax, %rbx
testl %ebx, %ebx
js 0x65e1
movl 0x101e9(%rip), %esi     # 0x16780
addl %ebx, %esi
movl %esi, 0x101e1(%rip)     # 0x16780
leaq 0xe1da(%rip), %r14      # 0x14780
movq %r14, %rdi
xorl %edx, %edx
callq 0x65fe
movl 0x101ca(%rip), %ecx     # 0x16780
subl %eax, %ecx
movl %ecx, 0x101c2(%rip)     # 0x16780
jle 0x65d0
movslq %eax, %rsi
addq %r14, %rsi
movl %ecx, %edx
movq %r14, %rdi
callq 0x54d0
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x5560
movl (%rax), %edi
callq 0x5420
leaq 0x7011(%rip), %rdi      # 0xd605
movq %rax, %rsi
xorl %eax, %eax
callq 0x5a16
// File: /workspace/github_c_makefile_star2_O2/garbeam[P]st/st.c
// Function: draw
void
draw(void)
{
	int cx = term.c.x;

	if (!xstartdraw())
		return;

	/* adjust cursor position */
	LIMIT(term.ocx, 0, term.col-1);
	LIMIT(term.ocy, 0, term.row-1);
	if (term.line[term.ocy][term.ocx].mode & ATTR_WDUMMY)
		term.ocx--;
	if (term.line[term.c.y][cx].mode & ATTR_WDUMMY)
		cx--;

	drawregion(0, 0, term.col, term.row);
	xdrawcursor(cx, term.c.y, term.line[term.c.y][cx],
			term.ocx, term.ocy, term.line[term.ocy][term.ocx]);
	term.ocx = cx, term.ocy = term.c.y;
	xfinishdraw();
	xximspot(term.ocx, term.ocy);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movslq 0xd51f(%rip), %r15      # 0x14740
callq 0x9bc9
testl %eax, %eax
je 0x738c
movl 0xd518(%rip), %edx      # 0x1474c
xorl %ecx, %ecx
movl $0x0, %eax
testl %edx, %edx
js 0x724c
movl 0xd4cf(%rip), %eax      # 0x14714
decl %eax
cmpl %eax, %edx
cmovll %edx, %eax
movl %eax, 0xd4fa(%rip)      # 0x1474c
movl 0xd4f8(%rip), %edx      # 0x14750
testl %edx, %edx
js 0x7269
movl 0xd4ae(%rip), %ecx      # 0x14710
decl %ecx
cmpl %ecx, %edx
cmovll %edx, %ecx
movl %ecx, 0xd4e1(%rip)      # 0x14750
movq 0xd4a2(%rip), %rdx      # 0x14718
movslq %ecx, %rcx
movq (%rdx,%rcx,8), %rcx
movslq %eax, %rsi
shlq $0x4, %rsi
testb $0x4, 0x5(%rcx,%rsi)
je 0x7293
decl %eax
movl %eax, 0xd4b9(%rip)      # 0x1474c
movslq 0xd4aa(%rip), %rax      # 0x14744
movq (%rdx,%rax,8), %rax
movq %r15, %rcx
shlq $0x4, %rcx
movl 0x4(%rax,%rcx), %eax
shll $0x5, %eax
movswl %ax, %ebp
sarl $0xf, %ebp
movl 0xd45c(%rip), %ebx      # 0x14714
movl 0xd451(%rip), %r12d     # 0x14710
xorl %r14d, %r14d
testl %r12d, %r12d
cmovlel %r14d, %r12d
cmpq %r14, %r12
je 0x72fd
movq 0xd453(%rip), %rax      # 0x14728
cmpl $0x0, (%rax,%r14,4)
je 0x72f8
andl $0x0, (%rax,%r14,4)
movq 0xd430(%rip), %rax      # 0x14718
movq (%rax,%r14,8), %rdi
xorl %esi, %esi
movl %r14d, %edx
movl %ebx, %ecx
callq 0x9bd3
incq %r14
jmp 0x72c9
addl %ebp, %r15d
movslq 0xd43d(%rip), %rsi      # 0x14744
movq 0xd40a(%rip), %rax      # 0x14718
movq (%rax,%rsi,8), %rcx
movslq %r15d, %rbx
movq %rbx, %rdi
shlq $0x4, %rdi
movslq 0xd429(%rip), %r8       # 0x1474c
movslq 0xd426(%rip), %r9       # 0x14750
movq (%rax,%r9,8), %rax
movq %r8, %r10
shlq $0x4, %r10
movq (%rcx,%rdi), %rdx
movq 0x8(%rcx,%rdi), %rcx
movups (%rax,%r10), %xmm0
movaps %xmm0, 0x10(%rsp)
movaps 0x10(%rsp), %xmm0
movups %xmm0, (%rsp)
movl %ebx, %edi
callq 0x986b
movl %ebx, 0xd3ee(%rip)      # 0x1474c
movl 0xd3e0(%rip), %eax      # 0x14744
movl %eax, 0xd3e6(%rip)      # 0x14750
callq 0xa65d
movl 0xd3d7(%rip), %edi      # 0x1474c
movl 0xd3d5(%rip), %esi      # 0x14750
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa6e8
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/garbeam[P]st/st.c
// Function: selscroll
void
selscroll(int orig, int n)
{
	if (sel.ob.x == -1)
		return;

	if (BETWEEN(sel.ob.y, orig, term.bot) || BETWEEN(sel.oe.y, orig, term.bot)) {
		if ((sel.ob.y += n) > term.bot || (sel.oe.y += n) < term.top) {
			selclear();
			return;
		}
		if (sel.type == SEL_RECTANGULAR) {
			if (sel.ob.y < term.top)
				sel.ob.y = term.top;
			if (sel.oe.y > term.bot)
				sel.oe.y = term.bot;
		} else {
			if (sel.ob.y < term.top) {
				sel.ob.y = term.top;
				sel.ob.x = 0;
			}
			if (sel.oe.y > term.bot) {
				sel.oe.y = term.bot;
				sel.oe.x = term.col;
			}
		}
		selnormalize();
	}
}

// Assembly:
cmpl $-0x1, 0xb35d(%rip)     # 0x146fc
je 0x93d7
movl 0xb359(%rip), %ecx      # 0x14700
cmpl %edi, %ecx
setl %dl
movl 0xb3a6(%rip), %eax      # 0x14758
cmpl %eax, %ecx
setg %r8b
orb %dl, %r8b
cmpb $0x1, %r8b
jne 0x93d8
movl 0xb341(%rip), %edx      # 0x14708
cmpl %edi, %edx
setl %dil
cmpl %eax, %edx
setg %dl
orb %dil, %dl
je 0x93d8
retq
addl %esi, %ecx
movl %ecx, 0xb320(%rip)      # 0x14700
cmpl %eax, %ecx
jg 0x5c56
addl 0xb31a(%rip), %esi      # 0x14708
movl %esi, 0xb314(%rip)      # 0x14708
movl 0xb35a(%rip), %edx      # 0x14754
cmpl %edx, %esi
jl 0x5c56
cmpl $0x2, 0xb2db(%rip)      # 0x146e4
jne 0x9428
cmpl %edx, %ecx
jge 0x9415
movl %edx, 0xb2eb(%rip)      # 0x14700
cmpl %eax, %esi
jle 0x5c7f
movl %eax, 0xb2e5(%rip)      # 0x14708
jmp 0x5c7f
cmpl %edx, %ecx
jge 0x9439
movl %edx, 0xb2ce(%rip)      # 0x14700
andl $0x0, 0xb2c3(%rip)      # 0x146fc
cmpl %eax, %esi
jle 0x5c7f
movl %eax, 0xb2c1(%rip)      # 0x14708
movl 0xb2c7(%rip), %eax      # 0x14714
movl %eax, 0xb2b1(%rip)      # 0x14704
jmp 0x5c7f
// File: /workspace/github_c_makefile_star2_O2/garbeam[P]st/x.c
// Function: xximspot
void
xximspot(int x, int y)
{
	XPoint spot = { borderpx + x * win.cw, borderpx + (y + 1) * win.ch };
	XVaNestedList attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL);

	XSetICValues(xw.xic, XNPreeditAttributes, attr, NULL);
	XFree(attr);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
imull 0xc7c0(%rip), %edi      # 0x16eb4
addl $0x2, %edi
leaq 0xc(%rsp), %rdx
movw %di, (%rdx)
incl %esi
imull 0xc7a8(%rip), %esi      # 0x16eb0
addl $0x2, %esi
movw %si, 0x2(%rdx)
leaq 0x3476(%rip), %rsi      # 0xdb8c
xorl %edi, %edi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x56a0
movq %rax, %rbx
movq 0xc6d5(%rip), %rdi      # 0x16e00
leaq 0x3467(%rip), %rsi      # 0xdb99
movq %rax, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x5240
movq %rbx, %rdi
callq 0x5090
addq $0x10, %rsp
popq %rbx
retq