LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/rroa[P]PUCMM_2D_Asteroids/Asteroids/main.cpp
// Function: main
int main(int argc, char* argv[])
{
#if _MSC_VER && _DEBUG
	// https://msdn.microsoft.com/en-us/library/x98tx3cf.aspx
	// This will help you detect leaks when using Visual C++
	// Uncomment this line to start getting reports!
	assert(_CrtCheckMemory());
	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif

	// Create Game Object
	//
	Engine::Game* game = new Engine::Game("Asteroids!", WIDTH, HEIGHT);

	// Initialize game
	//
	if(!game->OnInit())
	{
		std::cout << "Game Init error!\n";
		return -1;
	}

	// Execute game
	//
	game->OnExecute();

	// Delete game object
	//
	delete game;

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl $0xb0, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x681(%rip), %rsi       # 0x52d0
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x4ce6
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
movl $0x470, %edx            # imm = 0x470
movl $0x280, %ecx            # imm = 0x280
callq 0x24bc
leaq 0x8(%rsp), %rdi
callq 0x2250
movq %rbx, %rdi
callq 0x2a6a
testb %al, %al
je 0x4ca0
movq %rbx, %rdi
callq 0x26be
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
xorl %eax, %eax
jmp 0x4cb6
movq 0x3331(%rip), %rdi      # 0x7fd8
leaq 0x62d(%rip), %rsi       # 0x52db
callq 0x2200
pushq $-0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x2250
jmp 0x4cd0
movq %rax, %r14
movl $0xb0, %esi
movq %rbx, %rdi
callq 0x20a0
movq %r14, %rdi
callq 0x2230
nop
// File: /workspace/github_c_makefile_star2_O2/janmojzis[P]mcencrypt/_randreplace.c
// Function: main
int main(int argc, char **argv) {

    unsigned long long a;
    unsigned long long b;

    limits();

    input = memreadall(&inputlen, 0);
    if (!input) die_temp(NAME, "read message failed");

    randombytes(&a, sizeof a);
    randombytes(&b, sizeof b);

    input[a % inputlen] += 1 + (b % 255);

    if (writeall(1, input, inputlen) == -1) die_temp(NAME, "write message failed");
    if (fsyncfd(1) == -1) die_temp(NAME, "write message failed");

    die(0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
callq 0x51bc
leaq 0x9e70(%rip), %rdi      # 0xb0b0
xorl %esi, %esi
callq 0x51f8
movq %rax, 0x9e5a(%rip)      # 0xb0a8
testq %rax, %rax
jne 0x1266
leaq 0x5daa(%rip), %rdi      # 0x7004
leaq 0x5db0(%rip), %rsi      # 0x7011
callq 0x46a7
leaq 0x8(%rsp), %rbx
pushq $0x8
popq %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5df4
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x5df4
movq (%r15), %rax
movl $0xff, %ecx
xorl %edx, %edx
divq %rcx
movq %rdx, %rcx
movq 0x9e09(%rip), %rsi      # 0xb0a8
movq (%rbx), %rax
xorl %edx, %edx
divq 0x9e05(%rip)            # 0xb0b0
addb (%rsi,%rdx), %cl
incb %cl
movb %cl, (%rsi,%rdx)
movq 0x9df6(%rip), %rdx      # 0xb0b0
pushq $0x1
popq %rdi
callq 0x6458
cmpl $-0x1, %eax
jne 0x12da
leaq 0x5d36(%rip), %rdi      # 0x7004
leaq 0x5d50(%rip), %rsi      # 0x7025
callq 0x46a7
pushq $0x1
popq %rdi
callq 0x4c94
cmpl $-0x1, %eax
jne 0x12fa
leaq 0x5d16(%rip), %rdi      # 0x7004
leaq 0x5d30(%rip), %rsi      # 0x7025
callq 0x46a7
xorl %edi, %edi
callq 0x4757
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/motet-a[P]libforks/tests/stop_server_only.c
// Function: main
int main() {
  libforks_ServerConn conn;
  check(libforks_start(&conn) == libforks_OK);

  int socket_fd;
  int child_pid;

  check(libforks_fork(
    conn,
    &child_pid, // pid_ptr
    &socket_fd, // socket_fd_ptr
    NULL, // exit_fd_ptr
    child_main
  ) == libforks_OK);

  check(libforks_stop_server_only(conn) == libforks_OK);

  // The child process is now daemonized and still running.
  // Try to communicate with it.

  check(write(socket_fd, "a", 1) == 1);
  char c;
  check(read(socket_fd, &c, 1) == 1);
  check(c == 'b');

  while (true) {
    if (kill(child_pid, 0) == -1) {
      check(errno == ESRCH);
      break;
    }
  }

  return 0;
}

// Assembly:
subq $0x18, %rsp
leaq 0x10(%rsp), %rdi
callq 0x17d6
testl %eax, %eax
jne 0x1389
movq 0x10(%rsp), %rdi
leaq 0xf7(%rip), %r8         # 0x1405
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
xorl %ecx, %ecx
callq 0x20d2
testl %eax, %eax
jne 0x1394
movq 0x10(%rsp), %rdi
callq 0x21e1
testl %eax, %eax
jne 0x139f
movl 0x8(%rsp), %edi
leaq 0x1d84(%rip), %rsi      # 0x30c0
pushq $0x1
popq %rdx
callq 0x1080
cmpq $0x1, %rax
jne 0x13aa
movl 0x8(%rsp), %edi
leaq 0x7(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x10f0
cmpq $0x1, %rax
jne 0x13b5
cmpb $0x62, 0x7(%rsp)
jne 0x13c0
movl 0xc(%rsp), %edi
xorl %esi, %esi
callq 0x1150
cmpl $-0x1, %eax
jne 0x1368
callq 0x1050
cmpl $0x3, (%rax)
jne 0x13cb
xorl %eax, %eax
addq $0x18, %rsp
retq
leaq 0x1c74(%rip), %rdi      # 0x3004
pushq $0xd
jmp 0x13d4
leaq 0x1ca7(%rip), %rdi      # 0x3042
pushq $0x18
jmp 0x13d4
leaq 0x1ceb(%rip), %rdi      # 0x3091
pushq $0x1a
jmp 0x13d4
leaq 0x1d11(%rip), %rdi      # 0x30c2
pushq $0x1f
jmp 0x13d4
leaq 0x1d24(%rip), %rdi      # 0x30e0
pushq $0x21
jmp 0x13d4
leaq 0x1d35(%rip), %rdi      # 0x30fc
pushq $0x22
jmp 0x13d4
leaq 0x1d33(%rip), %rdi      # 0x3105
pushq $0x26
popq %rsi
callq 0x13da
// File: /workspace/github_c_makefile_star2_O2/motet-a[P]libforks/tests/stop_server_only.c
// Function: child_main
static void child_main(libforks_ServerConn conn, int socket_fd) {
  check(libforks_free_conn(conn) == libforks_OK);
  char c;
  check(read(socket_fd, &c, 1) == 1);
  check(c == 'a');
  check(write(socket_fd, "b", 1) == 1);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
callq 0x229f
testl %eax, %eax
jne 0x144e
leaq 0xf(%rsp), %rsi
pushq $0x1
popq %rdx
movl %ebx, %edi
callq 0x10f0
cmpq $0x1, %rax
jne 0x1459
cmpb $0x61, 0xf(%rsp)
jne 0x1464
leaq 0x1d29(%rip), %rsi      # 0x3161
pushq $0x1
popq %rdx
movl %ebx, %edi
callq 0x1080
cmpq $0x1, %rax
jne 0x146f
addq $0x10, %rsp
popq %rbx
retq
leaq 0x1cdb(%rip), %rdi      # 0x3130
pushq $0x4
jmp 0x1478
leaq 0x1c80(%rip), %rdi      # 0x30e0
pushq $0x6
jmp 0x1478
leaq 0x1ced(%rip), %rdi      # 0x3158
pushq $0x7
jmp 0x1478
leaq 0x1ced(%rip), %rdi      # 0x3163
pushq $0x8
popq %rsi
callq 0x13da
nop
// File: /workspace/github_c_makefile_star2_O2/ninewise[P]st/st.c
// Function: newterm
void
newterm(const Arg* a)
{
	switch (fork()) {
	case -1:
		die("fork failed: %s\n", strerror(errno));
		break;
	case 0:
		chdir(getcwd_by_pid(pid));
		execlp("st", "./st", NULL);
		break;
	}
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
callq 0x57e0
testl %eax, %eax
je 0x6fc7
cmpl $-0x1, %eax
je 0x7012
addq $0x20, %rsp
popq %rbx
retq
movl 0xd897(%rip), %ecx      # 0x14864
leaq 0x67d3(%rip), %rdx      # 0xd7a7
movq %rsp, %rbx
pushq $0x20
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x50c0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x53d0
movq %rax, %rdi
callq 0x5060
leaq 0x6649(%rip), %rdi      # 0xd646
leaq 0x6640(%rip), %rsi      # 0xd644
xorl %edx, %edx
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
jmp 0x5220
callq 0x55a0
movl (%rax), %edi
callq 0x5460
leaq 0x65b3(%rip), %rdi      # 0xd5d8
movq %rax, %rsi
xorl %eax, %eax
callq 0x5a56
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/packet_implem.c
// Function: pkt_compute_crc1
uint32_t pkt_compute_crc1(const pkt_t *pkt) {
	// Copy the packet and set the TR of that copy
	pkt_t p = *pkt;
	p.tr = 0;
	return crc32(0, (unsigned char *) &p, HEADER_SIZE - sizeof (pkt->crc1));
}

// Assembly:
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdi, %rsi
movq %rsp, %rbx
movl $0x210, %edx            # imm = 0x210
movq %rbx, %rdi
callq 0x10f0
andb $-0x21, (%rbx)
pushq $0x8
popq %rdx
xorl %edi, %edi
movq %rbx, %rsi
callq 0x1070
addq $0x210, %rsp            # imm = 0x210
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/packet_implem.c
// Function: pkt_get_total_size
size_t pkt_get_total_size(const pkt_t *pkt) {
	size_t payload_size = pkt_get_length(pkt) * sizeof (*pkt->payload);
	size_t total_size = HEADER_SIZE + payload_size;
	if (payload_size > 0) {
		total_size += sizeof (pkt->crc2);
	}
	return total_size;
}

// Assembly:
testb $0x20, (%rdi)
jne 0x136a
movzwl 0x2(%rdi), %eax
testw %ax, %ax
je 0x136a
rolw $0x8, %ax
movzwl %ax, %eax
addq $0x10, %rax
retq
pushq $0xc
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/packet_implem.c
// Function: pkt_decode
pkt_status_code pkt_decode(const char *data, const size_t len, pkt_t *pkt) {
	if (data == NULL || len < HEADER_SIZE) {
		return E_NOHEADER;
	}

	size_t read = 0;

	memcpy(pkt, data + read, HEADER_SIZE);
	read += HEADER_SIZE;

	size_t payload_size = pkt_get_length(pkt) * sizeof (*pkt->payload);

	/* Field errors should be returned in the order those fields are
	 * declared in the struct. We could return E_UNCONSISTENT if the packet
	 * has a payload and isn't of type PTYPE_DATA, but we don't since it
	 * isn't specified and thus doing so might break other implementations
	 * (albeit buggy ones). */
	if (pkt_get_type(pkt) == 0) {
		return E_TYPE;
	} else if (pkt_get_type(pkt) != PTYPE_DATA && pkt_get_tr(pkt) != 0) {
		return E_TR;
	} else if (pkt_get_window(pkt) > MAX_WINDOW_SIZE) {
		return E_WINDOW;
	} else if (payload_size > MAX_PAYLOAD_SIZE) {
		/* FIXME: pkt_get_length returns 0 when the packet has been
		 * truncated, regardless of the value of length field. Thus, in
		 * that case we can't reliably check whether the length field
		 * overflows the maximum size given by the specification. */
		return E_LENGTH;
	} else if (len != pkt_get_total_size(pkt)) {
		// Return now in order to prevent a potential buffer overflow
		return E_UNCONSISTENT;
	} else if (pkt_get_crc1(pkt) != pkt_compute_crc1(pkt)) {
		return E_CRC;
	}

	// No-op if payload empty
	memcpy(pkt->payload, data + read, payload_size);
	read += payload_size;

	// Prevent memcpy from overflowing
	if (payload_size > 0) {
		memcpy(&pkt->crc2, data + read, sizeof (pkt->crc2));
		if (pkt_get_crc2(pkt) != pkt_compute_crc2(pkt, payload_size)) {
			return E_CRC;
		}
	}

	return PKT_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
sete %al
cmpq $0xc, %rsi
setb %cl
orb %al, %cl
je 0x139f
pushq $0x8
jmp 0x144b
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl 0x8(%rdi), %eax
movl %eax, 0x8(%rdx)
movq (%rdi), %rax
movq %rax, (%rdx)
movzbl %al, %edx
testb $0x20, %al
jne 0x13c5
movzwl 0x2(%rbx), %ecx
rolw $0x8, %cx
jmp 0x13c7
xorl %ecx, %ecx
shrl $0x6, %edx
je 0x13e5
cmpl $0x1, %edx
je 0x13d5
testb $0x20, %al
jne 0x1445
movzwl %cx, %r12d
cmpw $0x200, %r12w           # imm = 0x200
jbe 0x13e9
pushq $0x3
jmp 0x144b
pushq $0x1
jmp 0x144b
movq %rbx, %rdi
callq 0x1350
cmpq %r15, %rax
jne 0x1449
movl 0x8(%rbx), %r15d
bswapl %r15d
movq %rbx, %rdi
callq 0x130e
pushq $0x4
popq %rbp
cmpl %eax, %r15d
jne 0x144c
leaq 0xc(%rbx), %rdi
leaq 0xc(%r14), %rsi
movq %r12, %rdx
callq 0x10f0
testq %r12, %r12
je 0x1441
movl 0xc(%r14,%r12), %r14d
movl %r14d, 0x20c(%rbx)
bswapl %r14d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1342
cmpl %eax, %r14d
jne 0x144c
xorl %ebp, %ebp
jmp 0x144c
pushq $0x2
jmp 0x144b
pushq $0x9
popq %rbp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/packet_implem.c
// Function: pkt_encode
pkt_status_code pkt_encode(const pkt_t *pkt, char *buf, size_t *len) {
	pkt_t p = *pkt;

	if (pkt_get_type(&p) == 0) {
		return E_TYPE;
	} else if (pkt_get_total_size(&p) > *len) {
		*len = 0;
		return E_NOMEM;
	}

	size_t payload_size = pkt_get_length(&p) * sizeof (*p.payload);
	pkt_set_crc1(&p, pkt_compute_crc1(&p));
	pkt_set_crc2(&p, pkt_compute_crc2(&p, payload_size));

	size_t written = 0;
	memcpy(buf + written, &p, HEADER_SIZE + payload_size);
	written += HEADER_SIZE + payload_size;

	if (payload_size > 0) {
		memcpy(buf + written, &p.crc2, sizeof (p.crc2));
		written += sizeof (p.crc2);
	}

	*len = written;
	return PKT_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %rsi
leaq 0x8(%rsp), %r14
movl $0x210, %edx            # imm = 0x210
movq %r14, %rdi
callq 0x10f0
movb (%r14), %bpl
cmpb $0x40, %bpl
jae 0x14b8
pushq $0x1
popq %r14
jmp 0x1539
leaq 0x8(%rsp), %rdi
callq 0x1350
xorl %r14d, %r14d
cmpq (%rbx), %rax
jbe 0x14d2
pushq $0x7
popq %r14
xorl %ebp, %ebp
jmp 0x1536
leaq 0x8(%rsp), %rcx
movzwl 0x2(%rcx), %eax
rolw $0x8, %ax
testb $0x20, %bpl
cmovnel %r14d, %eax
movzwl %ax, %r12d
movq %rcx, %rbp
movq %rcx, %rdi
callq 0x130e
bswapl %eax
movl %eax, 0x8(%rbp)
movq %rbp, %rdi
movq %r12, %rsi
callq 0x1342
movl %eax, %r13d
bswapl %r13d
movl %r13d, 0x20c(%rbp)
movq %rbp, %rsi
leaq 0xc(%r12), %rbp
movq %r15, %rdi
movq %rbp, %rdx
callq 0x10f0
testw %r12w, %r12w
je 0x1536
movl %r13d, 0xc(%r15,%r12)
leaq 0x10(%r12), %rbp
movq %rbp, (%rbx)
movl %r14d, %eax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/packet_implem.c
// Function: pkt_set_length
pkt_status_code pkt_set_length(pkt_t *pkt, const uint16_t length) {
	if (length > MAX_PAYLOAD_SIZE) {
		return E_LENGTH;
	}

	// Maintain the invariant that unused slots are zeroed out
	uint16_t unused = (MAX_PAYLOAD_SIZE - length) * sizeof (*pkt->payload);
	memset(pkt->payload + length, 0, unused);

	pkt->length = htons(length);
	return PKT_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
cmpw $0x200, %bx             # imm = 0x200
jbe 0x1605
pushq $0x3
popq %rbp
jmp 0x162e
movq %rdi, %r14
movl $0x200, %eax            # imm = 0x200
subl %ebx, %eax
movzwl %bx, %ecx
addq %rcx, %rdi
addq $0xc, %rdi
movzwl %ax, %edx
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x10c0
rolw $0x8, %bx
movw %bx, 0x2(%r14)
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/packet_implem.c
// Function: pkt_set_payload
pkt_status_code pkt_set_payload(pkt_t *pkt, const char *data, const uint16_t length) {
	uint16_t actual = length;
	if (data == NULL) {
		actual = 0;
	}

	pkt_status_code code = pkt_set_length(pkt, actual);
	if (code != PKT_OK) {
		return code;
	}

	memcpy(pkt->payload, data, actual);
	return PKT_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
xorl %ebx, %ebx
testq %rsi, %rsi
cmovel %ebx, %ebp
cmpw $0x200, %bp             # imm = 0x200
jbe 0x165e
pushq $0x3
popq %rbx
jmp 0x169b
movq %rsi, %r14
movq %rdi, %r15
movl $0x200, %eax            # imm = 0x200
subl %ebp, %eax
leaq 0xc(%rdi), %r12
movzwl %bp, %r13d
addq %r13, %rdi
addq $0xc, %rdi
movzwl %ax, %edx
xorl %esi, %esi
callq 0x10c0
rolw $0x8, %bp
movw %bp, 0x2(%r15)
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x10f0
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/sprt[P]lossless-transport/src/util.c
// Function: print_time
void print_time(void) {
	struct timespec tp;
	if (clock_gettime(CLOCK_MONOTONIC, &tp) == -1) {
		abort();
	}
	double secs = tp.tv_sec + ((double) tp.tv_nsec) / 1000000000;
	fprintf(stderr, "[%7.3f] ", secs);
}

// Assembly:
subq $0x18, %rsp
pushq $0x1
popq %rdi
leaq 0x8(%rsp), %rsi
callq 0x1080
cmpl $-0x1, %eax
je 0x16f9
cvtsi2sdq 0x8(%rsp), %xmm1
cvtsi2sdq 0x10(%rsp), %xmm0
divsd 0x19b8(%rip), %xmm0     # 0x3090
addsd %xmm1, %xmm0
movq 0x4915(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
leaq 0x19ab(%rip), %rsi      # 0x3098
movb $0x1, %al
callq 0x10e0
addq $0x18, %rsp
retq
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/util.c
// Function: log_msg
void log_msg(const char *fmt, ...) {
	print_time();
	va_list args;
	va_start(args, fmt);
	vfprintf(stderr, fmt, args);
	va_end(args);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x175f
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)
callq 0x16ac
movq %rsp, %rdx
movq %r14, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x486d(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x1160
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/util.c
// Function: exit_msg
void exit_msg(const char *fmt, ...) {
	print_time();
	va_list args;
	va_start(args, fmt);
	vfprintf(stderr, fmt, args);
	va_end(args);
	exit(1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x1814
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)
callq 0x16ac
movq %rsp, %rdx
movq %r14, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x47b8(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x1160
pushq $0x1
popq %rdi
callq 0x1190
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/util.c
// Function: pkt_repr
char *pkt_repr(pkt_t *pkt) {
	if (pkt == NULL) {
		return "(nil)";
	}

	char *type;
	switch (pkt_get_type(pkt)) {
		case PTYPE_ACK:  type = "ACK";     break;
		case PTYPE_DATA: type = "DATA";    break;
		case PTYPE_NACK: type = "NACK";    break;
		default:         type = "UNKNOWN";
	}

	int len = sprintf(pkt_fmt_buf, "{Type=%s, TR=%d, Win=%d, Seq=%d, Time=%d, Len=%d}",
		type, pkt_get_tr(pkt), pkt_get_window(pkt), pkt_get_seqnum(pkt),
		pkt_get_timestamp(pkt), pkt_get_length(pkt));
	if (len < 0) {
		abort();
	}

	return pkt_fmt_buf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x18ec
movq %rdi, %rbx
callq 0x1457
decl %eax
cmpl $0x2, %eax
ja 0x18f5
movl %eax, %eax
leaq 0x18c1(%rip), %rcx      # 0x31a4
movslq (%rcx,%rax,4), %r14
addq %rcx, %r14
jmp 0x18fc
leaq 0x17dd(%rip), %rbx      # 0x30d0
jmp 0x1965
leaq 0x175e(%rip), %r14      # 0x305a
movq %rbx, %rdi
callq 0x145e
movzbl %al, %ebp
movq %rbx, %rdi
callq 0x1466
movzbl %al, %r15d
movq %rbx, %rdi
callq 0x157f
movzbl %al, %r12d
movq %rbx, %rdi
callq 0x1583
movl %eax, %r13d
movq %rbx, %rdi
callq 0x136e
movzwl %ax, %r10d
leaq 0x47f3(%rip), %rbx      # 0x6130
leaq 0x179c(%rip), %rsi      # 0x30e0
movq %rbx, %rdi
movq %r14, %rdx
movl %ebp, %ecx
movl %r15d, %r8d
movl %r12d, %r9d
xorl %eax, %eax
pushq %r10
pushq %r13
callq 0x1180
addq $0x10, %rsp
testl %eax, %eax
js 0x1977
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/util.c
// Function: parse_args
void parse_args(int argc, char **argv,
                char **hostname, uint16_t *port, char **filename) {
	int c;
	while ((c = getopt(argc, argv, "f:h")) != -1) {
		switch (c) {
		case 'f':
			*filename = optarg;
			break;
		case 'h':
		case '?':
			exit_usage(argv);
			break;
		default:
			abort(); // unreachable
		}
	}

	if (optind + 2 != argc) {
		fprintf(stderr, "%s: wrong number of arguments\n", argv[0]);
		exit_usage(argv);
	}

	*hostname = argv[optind++];
	*port = atoi(argv[optind]);

	if (*port == 0 || *port >> 16) {
		fprintf(stderr, "%s: port must be an integer between 1 and 65535\n", argv[0]);
		exit_usage(argv);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r12
movq %rcx, (%rsp)
movq %rdx, %r15
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x1775(%rip), %r13      # 0x3112
movq 0x4634(%rip), %r14      # 0x5fd8
movl %ebp, %edi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x1150
cmpl $0x66, %eax
jne 0x19bf
movq (%r14), %rax
movq %rax, (%r12)
jmp 0x19a4
cmpl $-0x1, %eax
jne 0x1a06
movq 0x4605(%rip), %rcx      # 0x5fd0
movslq (%rcx), %rax
leal 0x2(%rax), %edx
cmpl %ebp, %edx
jne 0x1a1d
leal 0x1(%rax), %edx
movl %edx, (%rcx)
movq (%rbx,%rax,8), %rcx
movq %rcx, (%r15)
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1170
movq (%rsp), %rcx
movw %ax, (%rcx)
testw %ax, %ax
je 0x1a33
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3f, %eax
je 0x1a10
cmpl $0x68, %eax
jne 0x1a18
movq %rbx, %rdi
callq 0x1894
callq 0x1050
movq 0x45d4(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq (%rbx), %rdx
leaq 0x16e5(%rip), %rsi      # 0x3116
jmp 0x1a47
movq 0x45be(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq (%rbx), %rdx
leaq 0x16ee(%rip), %rsi      # 0x3135
xorl %eax, %eax
callq 0x10e0
jmp 0x1a10
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/util.c
// Function: create_socket
int create_socket(struct sockaddr_in6 *source_addr, int src_port,
                  struct sockaddr_in6 *dest_addr, int dst_port) {
	int sockfd = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
	if (sockfd == -1) {
		log_perror("socket");
		return -1;
	}

	if (source_addr != NULL && src_port > 0) {
		source_addr->sin6_port = htons(src_port);
		if (bind(sockfd, (struct sockaddr *) source_addr, sizeof (*source_addr)) != 0) {
			log_perror("bind");
			return -1;
		}
	}

	if (dest_addr != NULL && dst_port > 0) {
		dest_addr->sin6_port = htons(dst_port);
		if (connect(sockfd, (struct sockaddr *) dest_addr, sizeof (*dest_addr)) != 0) {
			log_perror("connect");
			return -1;
		}
	}

	return sockfd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, %r15
pushq $0xa
popq %rdi
pushq $0x2
popq %rsi
pushq $0x11
popq %rdx
callq 0x11f0
cmpl $-0x1, %eax
je 0x1b53
movl %eax, %ebx
testq %r15, %r15
sete %al
testl %r12d, %r12d
setle %cl
orb %al, %cl
jne 0x1b21
rolw $0x8, %r12w
movw %r12w, 0x2(%r15)
pushq $0x1c
popq %rdx
movl %ebx, %edi
movq %r15, %rsi
callq 0x1120
testl %eax, %eax
je 0x1b21
leaq 0x164e(%rip), %rdi      # 0x316d
jmp 0x1b5a
testq %r14, %r14
sete %al
testl %ebp, %ebp
setle %cl
orb %al, %cl
jne 0x1b62
rolw $0x8, %bp
movw %bp, 0x2(%r14)
pushq $0x1c
popq %rdx
movl %ebx, %edi
movq %r14, %rsi
callq 0x11a0
testl %eax, %eax
je 0x1b62
leaq 0x1621(%rip), %rdi      # 0x3172
jmp 0x1b5a
leaq 0x160c(%rip), %rdi      # 0x3166
callq 0x17a1
pushq $-0x1
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/util.c
// Function: send_packet
int send_packet(int sockfd, pkt_t *pkt) {
	char buf[MAX_PACKET_SIZE];
	size_t len = MAX_PACKET_SIZE;
	if (pkt_encode(pkt, buf, &len) != PKT_OK) {
		exit_msg("Error encoding packet: %d\n");
	}
	return send(sockfd, buf, len, 0);
}

// Assembly:
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rsi, %rax
movl %edi, %ebx
leaq 0x8(%rsp), %rdx
movq $0x210, (%rdx)          # imm = 0x210
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x147a
testl %eax, %eax
jne 0x1bb3
movq 0x8(%rsp), %rdx
leaq 0x10(%rsp), %rsi
movl %ebx, %edi
xorl %ecx, %ecx
callq 0x1090
addq $0x220, %rsp            # imm = 0x220
popq %rbx
retq
leaq 0x15c0(%rip), %rdi      # 0x317a
xorl %eax, %eax
callq 0x17b3
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/util.c
// Function: get_monotime
uint32_t get_monotime(void) {
	static bool first_call = true; /* whether this is the first call */
	static struct timeval first; /* unnormalized value returned by the first call */
	static struct timeval last; /* unnormalized value returned by the last call */

	struct timespec now_tp;
	if (clock_gettime(CLOCK_MONOTONIC, &now_tp) == -1) {
		exit_perror("clock_gettime");
	}

	/* Convert the timespec to a timeval */
	struct timeval now;
	now.tv_sec = now_tp.tv_sec;
	now.tv_usec = now_tp.tv_nsec / 1000;

	if (first_call) {
		/* Remember the value of the first call to normalize to 0 later */
		first = now;
		first_call = false;
	} else if (timercmp(&now, &last, <) || !timercmp(&now, &last, !=)) {
		/* Increment if not strictly greater than the last time returned */

		struct timeval us;
		us.tv_sec = 0;
		us.tv_usec = 1;

		struct timeval res;
		timeradd(&last, &us, &res);
		now = res;
	}

	/* Save the time we're returning for later calls */
	last = now;

	/* Normalize to start at 0 */
	struct timeval res;
	timersub(&now, &first, &res);
	now = res;

	/* Convert to microseconds */
	return now.tv_sec * 1000000 + now.tv_usec;
}

// Assembly:
subq $0x18, %rsp
pushq $0x1
popq %rdi
leaq 0x8(%rsp), %rsi
callq 0x1080
cmpl $-0x1, %eax
je 0x1c93
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
cmpb $0x0, 0x493a(%rip)      # 0x6530
je 0x1c12
movq 0x4949(%rip), %rcx      # 0x6548
cmpq %rcx, %rsi
jne 0x1c29
movq 0x4945(%rip), %rdx      # 0x6550
cmpq %rdx, %rax
jle 0x1c32
jmp 0x1c54
movq %rsi, 0x491f(%rip)      # 0x6538
movq %rax, 0x4920(%rip)      # 0x6540
movb $0x1, 0x4909(%rip)      # 0x6530
jmp 0x1c54
jge 0x1c54
movq 0x491e(%rip), %rdx      # 0x6550
leaq 0x1(%rdx), %rax
leaq -0xf423f(%rdx), %rsi
xorl %edi, %edi
cmpq $0xf423f, %rdx          # imm = 0xF423F
setge %dil
cmovgeq %rsi, %rax
addq %rdi, %rcx
movq %rcx, %rsi
movq %rsi, 0x48ed(%rip)      # 0x6548
movq %rax, 0x48ee(%rip)      # 0x6550
subl 0x48d0(%rip), %esi      # 0x6538
subq 0x48d1(%rip), %rax      # 0x6540
leal 0xf4240(%rax), %ecx
movq %rax, %rdx
sarq $0x3f, %rdx
addl %esi, %edx
imull $0xf4240, %edx, %edx    # imm = 0xF4240
testq %rax, %rax
cmovnsl %eax, %ecx
addl %edx, %ecx
movl %ecx, %eax
addq $0x18, %rsp
retq
leaq 0x14fb(%rip), %rdi      # 0x3195
callq 0x1853
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/window.c
// Function: window_create
window_t *window_create(size_t size, size_t max_size, size_t max_seqnum) {
	if (size > max_size) {
		return NULL;
	}
	window_t *w = calloc(1, sizeof (window_t));
	if (w == NULL) {
		return NULL;
	}
	w->size = size;
	w->capacity = max_size;
	w->max_seqnum = max_seqnum; /* TODO: check valid */
	return w;
}

// Assembly:
cmpq %rsi, %rdi
jbe 0x1cb4
xorl %eax, %eax
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x10d0
testq %rax, %rax
je 0x1cdf
movq %r15, 0x10(%rax)
movq %r14, 0x8(%rax)
movq %rbx, (%rax)
jmp 0x1ce1
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/window.c
// Function: window_free
void window_free(window_t *w) {
	struct node *cur = w->front;
	while (cur != NULL) {
		struct node *next = cur->next;
		free(cur);
		cur = next;
	}
	free(w);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0x1d05
movq 0x8(%rdi), %r14
callq 0x1030
movq %r14, %rdi
jmp 0x1cf2
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/window.c
// Function: window_has
bool window_has(window_t *w, size_t seqnum) {
	if (w->size == 0) {
		return false;
	}
	if (window_start(w) > window_end(w)) { /* Example: 3 [4 5 0 1] 2 */
		return window_start(w) <= seqnum || seqnum <= window_end(w);
	}
	return window_start(w) <= seqnum && seqnum <= window_end(w);
}

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x1da7
movq (%rdi), %r8
movq 0x18(%rdi), %rcx
addq %rcx, %rax
decq %rax
incq %r8
xorl %edx, %edx
divq %r8
cmpq %rdx, %rcx
jbe 0x1daa
cmpq %rsi, %rdx
setae %dl
cmpq %rsi, %rcx
setbe %al
orb %dl, %al
retq
xorl %eax, %eax
retq
cmpq %rsi, %rdx
setae %dl
cmpq %rsi, %rcx
setbe %al
andb %dl, %al
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/window.c
// Function: window_push
int window_push(window_t *w, pkt_t *pkt) {
	if (window_full(w)) {
		return -1;
	}

	struct node *front = calloc(1, sizeof (struct node));
	if (front == NULL) {
		return -1;
	}

	front->pkt = pkt;
	front->next = w->front;
	w->front = front;

	w->bufsize++;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x20(%rdi), %r15
pushq $-0x1
popq %rbp
cmpq 0x8(%rdi), %r15
je 0x1e1c
movq %rdi, %rbx
cmpq 0x10(%rdi), %r15
jae 0x1e1c
movq %rsi, %r14
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0x10d0
testq %rax, %rax
je 0x1e1c
movq %r14, (%rax)
movq 0x28(%rbx), %rcx
movq %rcx, 0x8(%rax)
movq %rax, 0x28(%rbx)
incq %r15
movq %r15, 0x20(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/window.c
// Function: window_find_seqnum
pkt_t *window_find_seqnum(window_t *w, size_t seqnum) {
	struct node *cur = w->front;
	while (cur != NULL) {
		if (pkt_get_seqnum(cur->pkt) == seqnum) {
			return cur->pkt;
		}
		cur = cur->next;
	}
	/* Reached only if there's no match */
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
addq $0x28, %r14
xorl %ebx, %ebx
movq (%r14), %r14
testq %r14, %r14
je 0x1e8c
movq (%r14), %rdi
callq 0x157f
movzbl %al, %eax
cmpq %r15, %rax
je 0x1e89
addq $0x8, %r14
jmp 0x1e6b
movq (%r14), %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/window.c
// Function: window_update_timestamp
int window_update_timestamp(window_t *w, uint32_t old_time, uint32_t new_time) {
	struct node *cur = w->front;
	while (cur != NULL) {
		if (pkt_get_timestamp(cur->pkt) == old_time) {
			pkt_set_timestamp(cur->pkt, new_time);
			return 0;
		}
		cur = cur->next;
	}
	/* Reached only if there's no match */
	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r14
addq $0x28, %r14
pushq $-0x1
popq %rbp
movq (%r14), %r14
testq %r14, %r14
je 0x1ed2
movq (%r14), %rdi
callq 0x1583
cmpl %r15d, %eax
je 0x1ec6
addq $0x8, %r14
jmp 0x1eab
movq (%r14), %rdi
movl %ebx, %esi
callq 0x1635
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/window.c
// Function: window_pop_node
pkt_t *window_pop_node(window_t *w, struct node **node) {
	if (*node == NULL) {
		return NULL;
	}

	pkt_t *pkt = (*node)->pkt;

	struct node *tmp = *node;
	*node = (*node)->next;
	free(tmp);

	w->bufsize--;
	return pkt;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x1f03
movq (%rdi), %rbx
movq 0x8(%rdi), %rax
movq %rax, (%rsi)
callq 0x1030
decq 0x20(%r14)
jmp 0x1f05
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/window.c
// Function: window_pop_timestamp
pkt_t *window_pop_timestamp(window_t *w, uint32_t timestamp) {
	struct node **cur = &w->front;
	struct node **match = cur;
	while (*cur != NULL) {
		if (pkt_get_timestamp((*cur)->pkt) == timestamp) {
			match = cur;
			break;
		}
		cur = &(*cur)->next;
	}
	return window_pop_node(w, match);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
movq %r14, %r15
movq (%r15), %rax
testq %rax, %rax
je 0x1f43
movq (%rax), %rdi
callq 0x1583
cmpl %ebp, %eax
je 0x1f40
movq (%r15), %r15
addq $0x8, %r15
jmp 0x1f23
movq %r15, %r14
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1edf
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/window.c
// Function: window_find_min_timestamp
struct node **window_find_min_timestamp(window_t *w) {
	struct node **cur = &w->front;
	struct node **min = cur;
	while (*cur != NULL) {
		if (pkt_get_timestamp((*cur)->pkt) < pkt_get_timestamp((*min)->pkt)) {
			min = cur;
		}
		cur = &(*cur)->next;
	}
	return min;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
addq $0x28, %rbx
movq %rbx, %r14
movq (%rbx), %rax
testq %rax, %rax
je 0x1f99
movq (%rax), %rdi
callq 0x1583
movl %eax, %ebp
movq (%r14), %rax
movq (%rax), %rdi
callq 0x1583
movq %rbx, %rcx
cmpl %eax, %ebp
jb 0x1f8d
movq %r14, %rcx
movq (%rbx), %rbx
addq $0x8, %rbx
movq %rcx, %r14
jmp 0x1f66
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/window.c
// Function: window_peek_min_timestamp
pkt_t *window_peek_min_timestamp(window_t *w) {
	struct node **min = window_find_min_timestamp(w);
	if (*min == NULL) {
		return NULL;
	}
	return (*min)->pkt;
}

// Assembly:
pushq %rax
callq 0x1f58
movq (%rax), %rax
testq %rax, %rax
je 0x1fb4
movq (%rax), %rax
jmp 0x1fb6
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/window.c
// Function: window_find_min_seqnum
struct node **window_find_min_seqnum(window_t *w) {
	struct node **cur = &w->front;
	struct node **min = cur;
	while (*cur != NULL) {
		if (pkt_get_seqnum((*cur)->pkt) < pkt_get_seqnum((*min)->pkt)) {
			min = cur;
		}
		cur = &(*cur)->next;
	}
	return min;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
addq $0x28, %rbx
movq %rbx, %r14
movq (%rbx), %rax
testq %rax, %rax
je 0x200f
movq (%rax), %rdi
callq 0x157f
movl %eax, %ebp
movq (%r14), %rax
movq (%rax), %rdi
callq 0x157f
movq %rbx, %rcx
cmpb %al, %bpl
jb 0x2003
movq %r14, %rcx
movq (%rbx), %rbx
addq $0x8, %rbx
movq %rcx, %r14
jmp 0x1fdb
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/window.c
// Function: window_peek_min_seqnum
pkt_t *window_peek_min_seqnum(window_t *w) {
	struct node **min = window_find_min_seqnum(w);
	if (*min == NULL) {
		return NULL;
	}
	return (*min)->pkt;
}

// Assembly:
pushq %rax
callq 0x1fcd
movq (%rax), %rax
testq %rax, %rax
je 0x202a
movq (%rax), %rax
jmp 0x202c
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/receiver.c
// Function: wait_for_client
int wait_for_client(void) {
	char buf[MAX_PACKET_SIZE];
	struct sockaddr_in6 addr;
	socklen_t addrlen = sizeof (addr);

	/* Wait for a packet from anyone */
	if (recvfrom(sockfd, buf, MAX_PACKET_SIZE, MSG_PEEK, (struct sockaddr *) &addr, &addrlen) == -1) {
		log_perror("recvfrom");
		return -1;
	}

	/* For UDP, connecting merely implies setting the address to which data
	 * is sent by default, and the only address from which data is received. */
	if (connect(sockfd, (struct sockaddr *) &addr, addrlen) == -1) {
		log_perror("connect");
		return -1;
	}

	return 0;
}

// Assembly:
subq $0x238, %rsp            # imm = 0x238
movq %rsp, %r9
movl $0x1c, (%r9)
movl 0x40b5(%rip), %edi      # 0x6110
leaq 0x20(%rsp), %rsi
pushq $0x2
popq %rcx
leaq 0x4(%rsp), %r8
movl $0x210, %edx            # imm = 0x210
callq 0x1110
cmpq $-0x1, %rax
je 0x209d
movl 0x4092(%rip), %edi      # 0x6110
movl (%rsp), %edx
leaq 0x4(%rsp), %rsi
callq 0x11a0
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0x20ac
leaq 0x10d7(%rip), %rdi      # 0x3172
jmp 0x20a4
leaq 0x1157(%rip), %rdi      # 0x31fb
callq 0x17a1
pushq $-0x1
popq %rax
addq $0x238, %rsp            # imm = 0x238
retq
// File: /workspace/github_c_makefile_star2_O2/sprt[P]lossless-transport/src/receiver.c
// Function: main
int main(int argc, char **argv) {
	parse_args(argc, argv, &hostname, &port, &filename);

	if (filename == NULL) {
		outfile = stdout;
	} else {
		outfile = fopen(filename, "wb+");
		if (outfile == NULL) {
			exit_perror("fopen");
		}
	}

	w = window_create(MAX_WINDOW_SIZE, MAX_WINDOW_SIZE, 255);
	if (w == NULL) {
		exit_msg("Could not create window\n");
	}

	struct sockaddr_in6 addr;
	const char *err = real_address(hostname, &addr);
	if (err != NULL) {
		exit_msg("real_address: %s\n", err);
	}

	/* Bind the socket */
	sockfd = create_socket(&addr, port, NULL, -1);
	if (sockfd == -1) {
		exit(1);
	}

	log_msg("Waiting for sender...\n");
	if (wait_for_client() == -1) {
		exit_msg("Error waiting for sender\n");
	}

	log_msg("Received first packet, connected\n");

	while (true) {
		/* This is probably the line you're looking for */
		main_loop();
	}

	window_free(w);
	fclose(outfile);

	return 0;
}

// Assembly:
subq $0x28, %rsp
leaq 0x3fd1(%rip), %rdx      # 0x6568
leaq 0x3fd2(%rip), %rcx      # 0x6570
leaq 0x3fd3(%rip), %r8       # 0x6578
callq 0x197c
movq 0x3fc7(%rip), %rdi      # 0x6578
testq %rdi, %rdi
je 0x25dc
leaq 0xe81(%rip), %rsi       # 0x343e
callq 0x1130
movq %rax, 0x3f97(%rip)      # 0x6560
testq %rax, %rax
jne 0x25ed
leaq 0xe6d(%rip), %rdi       # 0x3442
callq 0x1853
jmp 0x25ed
movq 0x39e5(%rip), %rax      # 0x5fc8
movq (%rax), %rax
movq %rax, 0x3f73(%rip)      # 0x6560
pushq $0x1f
popq %rdi
movl $0xff, %edx
movq %rdi, %rsi
callq 0x1cac
movq %rax, 0x3f54(%rip)      # 0x6558
testq %rax, %rax
jne 0x2617
leaq 0xe38(%rip), %rdi       # 0x3448
xorl %eax, %eax
callq 0x17b3
movq 0x3f4a(%rip), %rdi      # 0x6568
leaq 0xc(%rsp), %rsi
callq 0x1a50
testq %rax, %rax
je 0x263e
leaq 0xe2d(%rip), %rdi       # 0x3461
movq %rax, %rsi
xorl %eax, %eax
callq 0x17b3
movzwl 0x3f2b(%rip), %esi      # 0x6570
leaq 0xc(%rsp), %rdi
pushq $-0x1
popq %rcx
xorl %edx, %edx
callq 0x1ac5
movl %eax, 0x3ab6(%rip)      # 0x6110
cmpl $-0x1, %eax
je 0x269a
leaq 0xe0d(%rip), %rdi       # 0x3473
xorl %eax, %eax
callq 0x16fe
callq 0x2044
cmpl $-0x1, %eax
jne 0x2685
leaq 0xe0c(%rip), %rdi       # 0x348a
xorl %eax, %eax
callq 0x17b3
leaq 0xe18(%rip), %rdi       # 0x34a4
xorl %eax, %eax
callq 0x16fe
callq 0x20b4
jmp 0x2693
pushq $0x1
popq %rdi
callq 0x1190
// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/tst/hex.c
// Function: main
int main() {
    for (char a = 'a'; a <= 'f'; a++) {
        assert(isHex(a));
    }
    for (char a = 'A'; a <= 'F'; a++) {
        assert(isHex(a));
    }
    for (char a = '0'; a <= '9'; a++) {
        assert(isHex(a));
    }

    const char thirtySix[] = "24";
    uint8_t parsedThirtySix = hexString16ToUint8(thirtySix);
    assert(parsedThirtySix == 36);
    return 0;
}

// Assembly:
pushq %rbx
pushq $0x32
popq %rdi
callq 0x1189
movl %eax, %ebx
shlb $0x4, %bl
pushq $0x34
popq %rdi
callq 0x1189
addb %bl, %al
cmpb $0x24, %al
jne 0x116c
xorl %eax, %eax
popq %rbx
retq
leaq 0xea6(%rip), %rdi       # 0x2019
leaq 0xe8a(%rip), %rsi       # 0x2004
leaq 0xe8d(%rip), %rcx       # 0x200e
pushq $0x12
popq %rdx
callq 0x1030
// File: /workspace/github_c_makefile_star2_O2/stanfordnlp[P]GloVe/src/cooccur.c
// Function: hashsearch
HASHREC *hashsearch(HASHREC **ht, char *w) {
    HASHREC     *htmp, *hprv;
    unsigned int hval = HASHFN(w, TSIZE, SEED);
    for (hprv = NULL, htmp=ht[hval]; htmp != NULL && scmp(htmp->word, w) != 0; hprv = htmp, htmp = htmp->next);
    if ( htmp != NULL && hprv!=NULL ) { // move to front on access
        hprv->next = htmp->next;
        htmp->next = ht[hval];
        ht[hval] = htmp;
    }
    return(htmp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movl $0x100000, %esi         # imm = 0x100000
movl $0x11b049, %edx         # imm = 0x11B049
callq 0x28c0
movl %eax, %eax
leaq (%r14,%rax,8), %r15
xorl %r12d, %r12d
movq %r15, %rax
movq (%rax), %r14
testq %r14, %r14
je 0x1340
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x28a4
testl %eax, %eax
je 0x1328
leaq 0x10(%r14), %rax
movq %r14, %r12
jmp 0x1308
testq %r12, %r12
je 0x1340
movq 0x10(%r14), %rax
movq %rax, 0x10(%r12)
movq (%r15), %rax
movq %rax, 0x10(%r14)
movq %r14, (%r15)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/stanfordnlp[P]GloVe/src/cooccur.c
// Function: hashinsert
void hashinsert(HASHREC **ht, char *w, long long id) {
    HASHREC     *htmp, *hprv;
    unsigned int hval = HASHFN(w, TSIZE, SEED);
    for (hprv = NULL, htmp = ht[hval]; htmp != NULL && scmp(htmp->word, w) != 0; hprv = htmp, htmp = htmp->next);
    if (htmp == NULL) {
        htmp = (HASHREC *) malloc(sizeof(HASHREC));
        htmp->word = (char *) malloc(strlen(w) + 1);
        strcpy(htmp->word, w);
        htmp->num = id;
        htmp->next = NULL;
        if (hprv == NULL) ht[hval] = htmp;
        else hprv->next = htmp;
    }
    else fprintf(stderr, "Error, duplicate entry located: %s.\n",htmp->word);
    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
movl $0x100000, %esi         # imm = 0x100000
movl $0x11b049, %edx         # imm = 0x11B049
callq 0x28c0
movl %eax, %eax
leaq (%r15,%rax,8), %r12
xorl %r13d, %r13d
movq %r12, %rax
movq (%rax), %r15
testq %r15, %r15
je 0x139f
movq (%r15), %rdi
movq %r14, %rsi
callq 0x28a4
testl %eax, %eax
je 0x13eb
leaq 0x10(%r15), %rax
movq %r15, %r13
jmp 0x137f
pushq $0x18
popq %rdi
callq 0x1170
movq %rax, %r15
movq %r14, %rdi
callq 0x10e0
leaq 0x1(%rax), %rdi
callq 0x1170
movq %rax, (%r15)
movq %rax, %rdi
movq %r14, %rsi
callq 0x1060
movq %rbx, 0x8(%r15)
andq $0x0, 0x10(%r15)
testq %r13, %r13
je 0x13dd
movq %r15, 0x10(%r13)
jmp 0x13e1
movq %r15, (%r12)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x4c06(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movq (%r15), %rdx
leaq 0x1c61(%rip), %rsi      # 0x3060
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1150
// File: /workspace/github_c_makefile_star2_O2/stanfordnlp[P]GloVe/src/cooccur.c
// Function: write_chunk
int write_chunk(CREC *cr, long long length, FILE *fout) {
    if (length == 0) return 0;

    long long a = 0;
    CREC old = cr[a];
    
    for (a = 1; a < length; a++) {
        if (cr[a].word1 == old.word1 && cr[a].word2 == old.word2) {
            old.val += cr[a].val;
            continue;
        }
        fwrite(&old, sizeof(CREC), 1, fout);
        old = cr[a];
    }
    fwrite(&old, sizeof(CREC), 1, fout);
    return 0;
}

// Assembly:
testq %rsi, %rsi
je 0x14b6
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movupd (%rdi), %xmm0
movq %rsp, %rax
movapd %xmm0, (%rax)
addq $0x10, %r15
pushq $0x1
popq %r12
pushq $0x10
popq %rbp
movq %r12, %r13
cmpq %r14, %r13
jge 0x1497
movl (%r15), %eax
cmpl (%rsp), %eax
jne 0x1473
movl 0x4(%r15), %eax
cmpl 0x4(%rsp), %eax
jne 0x1473
movsd 0x8(%r15), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x148e
movq %rsp, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x11d0
movupd (%r15), %xmm0
movapd %xmm0, (%rsp)
incq %r13
addq $0x10, %r15
jmp 0x1448
movq %rsp, %rdi
pushq $0x10
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x11d0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/stanfordnlp[P]GloVe/src/cooccur.c
// Function: insert
void insert(CRECID *pq, CRECID new, int size) {
    int j = size - 1, p;
    pq[j] = new;
    while ( (p=(j-1)/2) >= 0 ) {
        if (compare_crecid(pq[p],pq[j]) > 0) {swap_entry(pq,p,j); j = p;}
        else break;
    }
}

// Assembly:
decl %esi
movslq %esi, %rax
imulq $0x18, %rax, %rax
movq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rdi,%rax)
movaps 0x8(%rsp), %xmm0
movups %xmm0, (%rdi,%rax)
movl $0x2, %ecx
leal -0x1(%rsi), %eax
cltd
idivl %ecx
testl %esi, %esi
js 0x15b4
movl %eax, %edx
imulq $0x18, %rdx, %r8
movl %esi, %edx
imulq $0x18, %rdx, %rdx
movl (%rdi,%r8), %esi
movl 0x4(%rdi,%r8), %r8d
subl 0x4(%rdi,%rdx), %r8d
subl (%rdi,%rdx), %esi
cmovel %r8d, %esi
testl %esi, %esi
jle 0x15b4
addq %rdi, %rdx
movslq %eax, %rsi
imulq $0x18, %rsi, %rsi
movq 0x10(%rdi,%rsi), %r8
movq %r8, -0x8(%rsp)
movups (%rdi,%rsi), %xmm0
movaps %xmm0, -0x18(%rsp)
movq 0x10(%rdx), %r8
movq %r8, 0x10(%rdi,%rsi)
movups (%rdx), %xmm0
movups %xmm0, (%rdi,%rsi)
movq -0x8(%rsp), %rsi
movq %rsi, 0x10(%rdx)
movaps -0x18(%rsp), %xmm0
movups %xmm0, (%rdx)
movl %eax, %esi
jmp 0x1543
retq
// File: /workspace/github_c_makefile_star2_O2/stanfordnlp[P]GloVe/src/cooccur.c
// Function: delete
void delete(CRECID *pq, int size) {
    int j, p = 0;
    pq[p] = pq[size - 1];
    while ( (j = 2*p+1) < size - 1 ) {
        if (j == size - 2) {
            if (compare_crecid(pq[p],pq[j]) > 0) swap_entry(pq,p,j);
            return;
        }
        else {
            if (compare_crecid(pq[j], pq[j+1]) < 0) {
                if (compare_crecid(pq[p],pq[j]) > 0) {swap_entry(pq,p,j); p = j;}
                else return;
            }
            else {
                if (compare_crecid(pq[p],pq[j+1]) > 0) {swap_entry(pq,p,j+1); p = j + 1;}
                else return;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leal -0x1(%rsi), %eax
movslq %eax, %rcx
imulq $0x18, %rcx, %rcx
movq 0x10(%rdi,%rcx), %rdx
movq %rdx, 0x10(%rdi)
movups (%rdi,%rcx), %xmm0
movups %xmm0, (%rdi)
addl $-0x3, %esi
xorl %r8d, %r8d
leal 0x1(,%r8,2), %ecx
cmpl %eax, %ecx
jge 0x173b
leal (%r8,%r8), %edx
movslq %r8d, %r8
movslq %ecx, %r9
cmpl %esi, %edx
je 0x16e8
imulq $0x18, %r9, %r9
addl $0x2, %edx
movslq %edx, %r10
imulq $0x18, %r10, %r10
movl (%rdi,%r10), %r11d
movl 0x4(%rdi,%r10), %r14d
movl (%rdi,%r9), %ebx
movl 0x4(%rdi,%r9), %r15d
movl %r15d, %ebp
subl %r14d, %ebp
movl %ebx, %r13d
subl %r11d, %r13d
cmovel %ebp, %r13d
imulq $0x18, %r8, %r12
leaq (%rdi,%r12), %r8
movl (%rdi,%r12), %ebp
movl 0x4(%rdi,%r12), %r12d
testl %r13d, %r13d
js 0x1698
subl %r14d, %r12d
subl %r11d, %ebp
cmovel %r12d, %ebp
testl %ebp, %ebp
jle 0x173b
addq %rdi, %r10
movq 0x10(%r8), %rcx
movq %rcx, -0x8(%rsp)
movups (%r8), %xmm0
movaps %xmm0, -0x18(%rsp)
movq 0x10(%r10), %rcx
movq %rcx, 0x10(%r8)
movups (%r10), %xmm0
movups %xmm0, (%r8)
movq -0x8(%rsp), %rcx
movq %rcx, 0x10(%r10)
movaps -0x18(%rsp), %xmm0
movups %xmm0, (%r10)
movl %edx, %r8d
jmp 0x15df
subl %r15d, %r12d
subl %ebx, %ebp
cmovel %r12d, %ebp
testl %ebp, %ebp
jle 0x173b
addq %rdi, %r9
movq 0x10(%r8), %rdx
movq %rdx, -0x8(%rsp)
movups (%r8), %xmm0
movaps %xmm0, -0x18(%rsp)
movq 0x10(%r9), %rdx
movq %rdx, 0x10(%r8)
movups (%r9), %xmm0
movups %xmm0, (%r8)
movq -0x8(%rsp), %rdx
movq %rdx, 0x10(%r9)
movaps -0x18(%rsp), %xmm0
movups %xmm0, (%r9)
movl %ecx, %r8d
jmp 0x15df
imulq $0x18, %r8, %rcx
imulq $0x18, %r9, %rax
movl (%rdi,%rcx), %edx
movl 0x4(%rdi,%rcx), %esi
subl 0x4(%rdi,%rax), %esi
subl (%rdi,%rax), %edx
cmovel %esi, %edx
testl %edx, %edx
jle 0x173b
addq %rdi, %rcx
addq %rdi, %rax
movq 0x10(%rcx), %rdx
movq %rdx, -0x8(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, -0x18(%rsp)
movq 0x10(%rax), %rdx
movq %rdx, 0x10(%rcx)
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq -0x8(%rsp), %rcx
movq %rcx, 0x10(%rax)
movaps -0x18(%rsp), %xmm0
movups %xmm0, (%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/stanfordnlp[P]GloVe/src/cooccur.c
// Function: merge_write
int merge_write(CRECID new, CRECID *old, FILE *fout) {
    if (new.word1 == old->word1 && new.word2 == old->word2) {
        old->val += new.val;
        return 0; // Indicates duplicate entry
    }
    fwrite(old, sizeof(CREC), 1, fout);
    *old = new;
    return 1; // Actually wrote to file
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rcx
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movl (%r14), %eax
cmpl (%rdi), %eax
jne 0x1779
movl 0x4(%r14), %eax
cmpl 0x4(%rbx), %eax
jne 0x1779
movsd 0x8(%r14), %xmm0
addsd 0x8(%rbx), %xmm0
movsd %xmm0, 0x8(%rbx)
xorl %eax, %eax
jmp 0x179b
pushq $0x10
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x11d0
movupd (%r14), %xmm0
movupd %xmm0, (%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/stanfordnlp[P]GloVe/src/cooccur.c
// Function: free_resources
void free_resources(HASHREC** vocab_hash, CREC *cr, long long *lookup, 
                    long long *history, real *bigram_table) {
    free_table(vocab_hash);
    free(cr);
    free(lookup);
    free(history);
    free(bigram_table);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
callq 0x2a57
movq %r12, %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1030