LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/akw0088[P]openssl/base64_dec.c
// Function: main
int main(int argc, char *argv[])
{
	if (argc < 2)
	{
		printf("Usage: base64_dec file.base64\r\n");
		return -1;
	}

	unsigned int size = 0;

	char *buffer = get_file(argv[1], &size);
	if (buffer == NULL)
	{
		printf("Unable to open %s\r\n", argv[1]);
		return -1;
	}

	unsigned char *decode = (unsigned char *)malloc(size);
	if (decode == NULL)
	{
		perror("malloc failed");
		return -1;
	}
	memset(decode, 0, size);
	size_t length = size;



	printf("Base64: %s\n", buffer);
	base64decode(buffer, strlen(buffer), decode, &length);
	printf("decode: %s\nlength %d\n", decode, (int)length);


	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x1, %edi
jg 0x1352
leaq 0xd42(%rip), %rdi       # 0x208a
callq 0x1040
jmp 0x13f2
movq %rsi, %rbx
leaq -0x2c(%rbp), %rsi
movl $0x0, (%rsi)
movq 0x8(%rbx), %rdi
callq 0x11fc
testq %rax, %rax
je 0x13e0
movq %rax, %r14
movl -0x2c(%rbp), %r12d
movq %r12, %rdi
callq 0x10b0
testq %rax, %rax
je 0x1408
movq %rax, %r15
xorl %ebx, %ebx
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x1090
leaq -0x38(%rbp), %r13
movq %r12, (%r13)
leaq 0xca6(%rip), %rdi       # 0x204c
movq %r14, %rsi
xorl %eax, %eax
callq 0x1080
movq %r14, %rdi
callq 0x1070
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x1572
movl (%r13), %edx
leaq 0xc84(%rip), %rdi       # 0x2058
movq %r15, %rsi
xorl %eax, %eax
callq 0x1080
jmp 0x13f7
movq 0x8(%rbx), %rsi
leaq 0xc3f(%rip), %rdi       # 0x202a
xorl %eax, %eax
callq 0x1080
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc2f(%rip), %rdi       # 0x203e
callq 0x10e0
jmp 0x13f2
nop
// File: /workspace/github_cpp_makefile_star2_O1/akw0088[P]openssl/base64.c
// Function: base64decode
int base64decode(char *in, size_t inLen, unsigned char *out, size_t *outLen)
{
	char *end = in + inLen;
	char iter = 0;
	uint32_t buf = 0;
	size_t len = 0;

	while (in < end) {
		unsigned char c = d[*in++];

		switch (c) {
		case WHITESPACE: continue;   /* skip whitespace */
		case INVALID:    return 1;   /* invalid input, return error */
		case EQUALS:                 /* pad character, end of data */
			in = end;
			continue;
		default:
			buf = buf << 6 | c;
			iter++; // increment the number of iteration
					/* If the buffer is full, split it into bytes */
			if (iter == 4) {
				if ((len += 3) > *outLen) return 1; /* buffer overflow */
				*(out++) = (buf >> 16) & 255;
				*(out++) = (buf >> 8) & 255;
				*(out++) = buf & 255;
				buf = 0; iter = 0;

			}
		}
	}

	if (iter == 3) {
		if ((len += 2) > *outLen) return 1; /* buffer overflow */
		*(out++) = (buf >> 10) & 255;
		*(out++) = (buf >> 2) & 255;
	}
	else if (iter == 2) {
		if (++len > *outLen) return 1; /* buffer overflow */
		*(out++) = (buf >> 4) & 255;
	}

	*outLen = len; /* modify to reflect the actual output size */
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
movq %rcx, %r8
testq %rsi, %rsi
jle 0x160e
addq %rdi, %rsi
xorl %r9d, %r9d
leaq 0xb70(%rip), %rcx       # 0x2100
xorl %ebx, %ebx
xorl %eax, %eax
movsbq (%rdi), %r10
incq %rdi
movzbl (%r10,%rcx), %r11d
movl $0x2, %r10d
cmpl $0x40, %r11d
je 0x1601
cmpl $0x41, %r11d
je 0x15c0
cmpl $0x42, %r11d
jne 0x15c5
movl $0x1, %r10d
jmp 0x1601
movq %rsi, %rdi
jmp 0x1601
shll $0x6, %ebx
orl %ebx, %r11d
incb %al
xorl %r10d, %r10d
cmpb $0x4, %al
jne 0x15e3
addq $0x3, %r9
movl $0x1, %r10d
cmpq (%r8), %r9
jbe 0x15e8
movl %r11d, %ebx
jmp 0x1601
movl %ebx, %eax
shrl $0x10, %eax
movb %al, (%rdx)
movb %bh, 0x1(%rdx)
movb %r11b, 0x2(%rdx)
addq $0x3, %rdx
xorl %eax, %eax
xorl %ebx, %ebx
xorl %r10d, %r10d
testb $0x1, %r10b
jne 0x165d
cmpq %rsi, %rdi
jb 0x1594
jmp 0x1615
xorl %eax, %eax
xorl %ebx, %ebx
xorl %r9d, %r9d
cmpb $0x2, %al
je 0x1640
movzbl %al, %eax
cmpl $0x3, %eax
jne 0x1656
addq $0x2, %r9
movl $0x1, %eax
cmpq (%r8), %r9
ja 0x1662
movl %ebx, %eax
shrl $0xa, %eax
movb %al, (%rdx)
incq %rdx
movl $0x2, %ecx
jmp 0x1652
incq %r9
movl $0x4, %ecx
movl $0x1, %eax
cmpq (%r8), %r9
ja 0x1662
shrl %cl, %ebx
movb %bl, (%rdx)
movq %r9, (%r8)
xorl %eax, %eax
jmp 0x1662
movl $0x1, %eax
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/roberty65[P]bServer/frame/testClient/testBenchmark.cpp
// Function: sync_worker(void*)
static void *sync_worker(void *p)
{
	int id = (int)(long)p;
	char tag[128]; snprintf(tag, sizeof tag, "thread-%d", id);

	size_t msize = sizeof(struct proto_h16_head) + pkgSize;
	char *reqbuf = new char[msize];
	char *rspbuf = new char[msize];

	memset(reqbuf, 0, msize);
	memset(rspbuf, 0, msize);

	int fd = -1; 

	while (true) {	
		if (fd < 0) {
			fd = beyondy::XbsClient(host, O_NONBLOCK, timeout);
			if (fd < 0) {
				fprintf(stdout, "%s connect failed: %m\n", tag);
				continue;
			}
		}

		if (__send_req(fd, cmd, reqbuf, pkgSize, tag) < 0) {
			fprintf(stdout, "%s send req failed: %m\n", tag);
			close(fd); fd = -1;
			continue;
		}
		else {
			++pkgSent[id];
			byteSent[id] += pkgSize;
		}

		if (__read_rsp(fd, rspbuf, pkgSize, tag) < 0) {
			fprintf(stdout, "%s read rsp failed: %m\n", tag);
			close(fd); fd = -1;
			continue;	
		}
		else {
			++pkgRspd[id];
			byteRspd[id] += pkgSize;
		}
	}

	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %r12
leaq 0x197f(%rip), %rdx      # 0x413e
movq %rsp, %rbx
movl $0x80, %esi
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x2240
movslq 0x3995(%rip), %r13      # 0x6170
addq $0x10, %r13
movq %r13, %rdi
callq 0x2030
movq %rax, %r14
movq %r13, %rdi
callq 0x2030
movq %rax, %r15
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x2100
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x2100
movslq %r12d, %rbp
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq 0x3799(%rip), %r13      # 0x5fb8
testl %r12d, %r12d
jns 0x2845
movq 0x394d(%rip), %rdi      # 0x6178
movl $0x2710, %edx           # imm = 0x2710
movl $0x800, %esi            # imm = 0x800
callq 0x34df
movl %eax, %r12d
testl %eax, %eax
js 0x28e9
movl 0x391d(%rip), %esi      # 0x6168
movl 0x391f(%rip), %ecx      # 0x6170
movl %r12d, %edi
movq %r14, %rdx
movq %rbx, %r8
callq 0x2a81
testl %eax, %eax
js 0x28b4
movq 0x391e(%rip), %rax      # 0x6188
incq (%rax,%rbp,8)
movslq 0x38fb(%rip), %rdx      # 0x6170
movq 0x3914(%rip), %rax      # 0x6190
addq %rdx, (%rax,%rbp,8)
movl %r12d, %edi
movq %r15, %rsi
movq %rbx, %rcx
callq 0x2b37
testl %eax, %eax
js 0x28c1
movq 0x38ff(%rip), %rax      # 0x6198
incq (%rax,%rbp,8)
movslq 0x38cc(%rip), %rax      # 0x6170
movq 0x38f5(%rip), %rcx      # 0x61a0
addq %rax, (%rcx,%rbp,8)
jmp 0x281f
movq (%r13), %rdi
leaq 0x18a0(%rip), %rsi      # 0x415f
jmp 0x28cc
movq (%r13), %rdi
leaq 0x18ab(%rip), %rsi      # 0x4177
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2200
movl %r12d, %edi
callq 0x22a0
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x281f
movq (%r13), %rdi
leaq 0x1854(%rip), %rsi      # 0x4148
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2200
jmp 0x281f
// File: /workspace/github_cpp_makefile_star2_O1/roberty65[P]bServer/frame/testClient/testBenchmark.cpp
// Function: async_worker(void*)
static void *async_worker(void *p)
{
	int id = (int)(long)p;
	char tag[128]; snprintf(tag, sizeof tag, "thread-%d", id);

	size_t msize = sizeof(struct proto_h16_head) + pkgSize;
	char *reqbuf = new char[msize];
	char *rspbuf = new char[msize];

	memset(reqbuf, 0, msize);
	memset(rspbuf, 0, msize);

	int fd = -1;
	while (true) {	
 		if (fd < 0) {
			fd = beyondy::XbsClient(host, O_NONBLOCK, timeout);
			if (fd < 0) {
				fprintf(stdout, "%s connect failed: %m\n", tag);
				continue;	
			}
		}

		int events = beyondy::XbsWaitPollable(fd, POLLIN|POLLOUT, 10);
		if (events == -1) continue;

		if (events & POLLOUT) {
			if (__send_req(fd, cmd, reqbuf, pkgSize, tag) < 0) {
				fprintf(stdout, "%s send req failed: %m\n", tag);
				close(fd); fd = -1;
				continue;
			}

			++pkgSent[id];
			byteSent[id] += pkgSize;
		}

		if (events & POLLIN) {
			if (__read_rsp(fd, rspbuf, pkgSize, tag) < 0) {
				fprintf(stdout, "%s send req failed: %m\n", tag);
				close(fd); fd = -1;
				continue;
			}

			++pkgRspd[id];
			byteRspd[id] += pkgSize;
		}
	}

	return NULL;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %r12
leaq 0x1820(%rip), %rdx      # 0x413e
movq %rsp, %rbx
movl $0x80, %esi
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x2240
movslq 0x3836(%rip), %r13      # 0x6170
addq $0x10, %r13
movq %r13, %rdi
callq 0x2030
movq %rax, %r14
movq %r13, %rdi
callq 0x2030
movq %rax, %r15
movq %r14, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x2100
movq %r15, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x2100
movslq %r12d, %r13
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %ebp, %ebp
jns 0x299a
movq 0x37f7(%rip), %rdi      # 0x6178
movl $0x2710, %edx           # imm = 0x2710
movl $0x800, %esi            # imm = 0x800
callq 0x34df
movl %eax, %ebp
testl %eax, %eax
js 0x2a3a
movl $0xa, %edx
movl %ebp, %edi
movl $0x5, %esi
callq 0x2bac
cmpl $-0x1, %eax
je 0x2976
movl %eax, %r12d
testb $0x4, %r12b
je 0x29f7
movl 0x37a9(%rip), %esi      # 0x6168
movl 0x37ab(%rip), %ecx      # 0x6170
movl %ebp, %edi
movq %r14, %rdx
movq %rbx, %r8
callq 0x2a81
testl %eax, %eax
js 0x2a5a
movq 0x37a7(%rip), %rax      # 0x6188
incq (%rax,%r13,8)
movslq 0x3784(%rip), %rax      # 0x6170
movq 0x379d(%rip), %rcx      # 0x6190
addq %rax, (%rcx,%r13,8)
testb $0x1, %r12b
je 0x2976
movl 0x3769(%rip), %edx      # 0x6170
movl %ebp, %edi
movq %r15, %rsi
movq %rbx, %rcx
callq 0x2b37
testl %eax, %eax
js 0x2a5a
movq 0x3779(%rip), %rax      # 0x6198
incq (%rax,%r13,8)
movslq 0x3746(%rip), %rax      # 0x6170
movq 0x376f(%rip), %rcx      # 0x61a0
addq %rax, (%rcx,%r13,8)
jmp 0x2976
movq 0x3577(%rip), %rax      # 0x5fb8
movq (%rax), %rdi
leaq 0x16fd(%rip), %rsi      # 0x4148
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2200
jmp 0x2976
movq 0x3557(%rip), %rax      # 0x5fb8
movq (%rax), %rdi
leaq 0x16f4(%rip), %rsi      # 0x415f
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2200
movl %ebp, %edi
callq 0x22a0
jmp 0x2971
// File: /workspace/github_cpp_makefile_star2_O1/roberty65[P]bServer/frame/testClient/testBenchmark.cpp
// Function: _send_req(int, int, char*, int, char const*)
static int __send_req(int fd, int cmd, char *reqbuf, int size, const char *tag)
{
	struct proto_h16_head *h = (struct proto_h16_head *)reqbuf;
	int msize = size + sizeof(*h);

	h->len = msize;
	h->cmd = cmd;
	h->ver = 1;
	h->syn = 2;
	h->ack = 3;
	*(int *)(h + 1) = 0; // to tell echo rsp immediately

	while (true) {
		ssize_t wlen = beyondy::XbsWriteN(fd, reqbuf, msize, timeout);
		if (wlen < 0 && errno == EINTR) continue;
		if (wlen != msize) {
			fprintf(stdout, "FAIL: %s pkg-size=%d, write req failed: %m\n", tag, size);
			return -1;	
		}

		break;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %r14d
movq %rdx, %r15
movl %edi, %ebp
leal 0x10(%r14), %eax
movl %eax, (%rdx)
movw %si, 0x4(%rdx)
movw $0x1, 0x6(%rdx)
movabsq $0x300000002, %rcx      # imm = 0x300000002
movq %rcx, 0x8(%rdx)
movl $0x0, 0x10(%rdx)
movslq %eax, %r12
movl $0x2710, %ecx           # imm = 0x2710
movl %ebp, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2c4b
movq %rax, %r13
testq %rax, %rax
jns 0x2ae8
callq 0x2040
movl $0x2, %ecx
cmpl $0x4, (%rax)
je 0x2b15
movl $0x3, %ecx
cmpq %r12, %r13
je 0x2b15
movq 0x34bf(%rip), %rax      # 0x5fb8
movq (%rax), %rdi
leaq 0x168c(%rip), %rsi      # 0x418f
movq %rbx, %rdx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x2200
movl $0x1, %ecx
cmpl $0x2, %ecx
je 0x2abf
cmpl $0x3, %ecx
jne 0x2b23
xorl %eax, %eax
jmp 0x2b28
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/roberty65[P]bServer/frame/testClient/testBenchmark.cpp
// Function: _read_rsp(int, char*, int, char const*)
static int __read_rsp(int fd, char *rspbuf, int size, const char *tag)
{
	while (true) {
		int msize = size + sizeof(struct proto_h16_head);
		ssize_t rlen = beyondy::XbsReadN(fd, rspbuf, msize, timeout);

		if (rlen != msize) {
			fprintf(stdout, "FAIL: %s pkg-size=%d, read rsp failed: %m\n", tag, msize);
			return -1;	
		}

		break;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r14
movl %edx, %ebp
addl $0x10, %ebp
movslq %ebp, %rbx
movl $0x2710, %ecx           # imm = 0x2710
movq %rbx, %rdx
callq 0x2e49
movq %rax, %r15
cmpq %rbx, %rax
je 0x2b7b
movq 0x3453(%rip), %rax      # 0x5fb8
movq (%rax), %rdi
leaq 0x164c(%rip), %rsi      # 0x41bb
movq %r14, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2200
xorl %eax, %eax
cmpq %rbx, %r15
setne %al
negl %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/akw0088[P]openssl/base64_enc.c
// Function: main
int main(int argc, char *argv[])
{
	if (argc < 2)
	{
		printf("Usage: base64_enc file.bin\r\n");
		return -1;
	}

	unsigned int size = 0;

	char *encode = get_file(argv[1], &size);
	int buf_size = (size / 3) * 4;
	if (size % 3)
		buf_size += 4;

	char *buffer = (char *)malloc(buf_size);
	if (buffer == NULL)
	{
		perror("malloc failed");
		return -1;
	}

	memset(buffer, 0, buf_size);
	base64encode(encode, size, buffer, buf_size);
	buffer[buf_size] = 0;
	printf("Base64: %s\n", buffer);

	write_file((char *)"file.base64", buffer, buf_size);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x1, %edi
jg 0x1345
leaq 0xd37(%rip), %rdi       # 0x206c
callq 0x1040
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x13e1
leaq -0x2c(%rbp), %rbx
movl $0x0, (%rbx)
movq 0x8(%rsi), %rdi
movq %rbx, %rsi
callq 0x11ec
movq %rax, %r14
movl (%rbx), %ebx
movl $0xaaaaaaab, %eax       # imm = 0xAAAAAAAB
imulq %rbx, %rax
shrq $0x20, %rax
addl %eax, %eax
andl $-0x4, %eax
imull $0xaaaaaaab, %ebx, %ecx # imm = 0xAAAAAAAB
leal 0x4(%rax), %edx
cmpl $0x55555556, %ecx       # imm = 0x55555556
cmovbl %eax, %edx
movslq %edx, %r15
movq %r15, %rdi
callq 0x10a0
testq %rax, %rax
je 0x13f3
movq %rax, %r13
xorl %r12d, %r12d
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1080
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x1404
movb $0x0, (%r13,%r15)
leaq 0xc73(%rip), %rdi       # 0x2038
movq %r13, %rsi
xorl %eax, %eax
callq 0x1070
leaq 0xc6e(%rip), %rdi       # 0x2044
movq %r13, %rsi
movl %r15d, %edx
callq 0x129e
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc30(%rip), %rdi       # 0x202a
callq 0x10d0
jmp 0x133a
// File: /workspace/github_cpp_makefile_star2_O1/eschwabe[P]interview-practice/src/towers.cpp
// Function: MoveDisc(Adapter<std::stack<int, std::deque<int, std::allocator<int>>>>&, Adapter<std::stack<int, std::deque<int, std::allocator<int>>>>&, Adapter<std::stack<int, std::deque<int, std::allocator<int>>>>&, int)
void MoveDisc(MyStack& source, MyStack& dest, MyStack& temp, int count) {
    if(count == 0) {
        return;
    }
    if(count > 1) {
        MoveDisc(source, dest, temp, count-1);
    }

    MoveDisc(dest, temp, source, count-1);
    dest.push(source.top());
    source.pop();
    PrintStacks(s_source, s_dest, s_temp);
    MoveDisc(temp, dest, source, count-1);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r12
movq %rsi, %r14
leaq 0x2bb0(%rip), %r13      # 0x4170
leaq 0x2b59(%rip), %rbp      # 0x4120
testl %ebx, %ebx
je 0x1664
movq %rdi, %r15
cmpl $0x2, %ebx
jl 0x15e8
leal -0x1(%rbx), %ecx
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x15a6
decl %ebx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
movl %ebx, %ecx
callq 0x15a6
movq 0x30(%r15), %rsi
cmpq 0x38(%r15), %rsi
jne 0x1614
movq 0x48(%r15), %rax
movq -0x8(%rax), %rsi
movl $0x200, %eax            # imm = 0x200
addq %rax, %rsi
addq $-0x4, %rsi
movq 0x30(%r14), %rax
movq 0x40(%r14), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x1637
movl (%rsi), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x30(%r14)
jmp 0x163f
movq %r14, %rdi
callq 0x18fa
movq %r15, %rdi
callq 0x1b0e
leaq 0x2a82(%rip), %rdi      # 0x40d0
movq %r13, %rsi
movq %rbp, %rdx
callq 0x136c
movq %r12, %rdi
movq %r15, %r12
jmp 0x15c7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/eschwabe[P]interview-practice/src/towers.cpp
// Function: main
int main()
{

    const int N = 3;
    for(int i = N; i > 0; --i) {
        s_source.push(i);
    }

    PrintStacks(s_source, s_dest, s_temp);

    MoveDisc(s_source, s_dest, s_temp, N);

    PrintStacks(s_source, s_dest, s_temp);

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0xc(%rsp), %rbx
movl $0x3, (%rbx)
movl $0x3, %eax
leaq 0x2a3d(%rip), %r14      # 0x40d0
movq 0x2a66(%rip), %rcx      # 0x4100
movq 0x2a6f(%rip), %rdx      # 0x4110
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0x16b9
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x2a49(%rip)      # 0x4100
jmp 0x16c4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18fa
movl 0xc(%rsp), %ecx
leal -0x1(%rcx), %eax
movl %eax, 0xc(%rsp)
cmpl $0x1, %ecx
jg 0x1693
leaq 0x29f5(%rip), %rbx      # 0x40d0
leaq 0x2a8e(%rip), %r14      # 0x4170
leaq 0x2a37(%rip), %r15      # 0x4120
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x136c
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movl $0x3, %ecx
callq 0x15a6
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x136c
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/graphitemaster[P]smbf/smbf.cpp
// Function: u::getline[abi:cxx11](u::file&)
u::optional<u::string> getline(u::file &fp) {
    u::string s;
    for (;;) {
        char buf[256];
        if (!fgets(buf, sizeof(buf), fp.get())) {
            if (feof(fp.get())) {
                if (s.empty())
                    return u::none;
                else
                    return u::move(s);
            }
            abort();
        }
        size_t n = strlen(buf);
        if (n && buf[n - 1] == '\n')
            --n;
        s.append(buf, n);
        if (n < sizeof(buf) - 1)
            return u::move(s);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq $0x0, -0x8(%rbp)
movb $0x0, (%rbp)
movq (%rsi), %rdx
leaq 0x20(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x21f0
testq %rax, %rax
je 0x257b
leaq 0x20(%rsp), %r15
movq %rsp, %r12
movq %r15, %rdi
callq 0x2080
testq %rax, %rax
je 0x254c
movq %rax, %r13
cmpb $0xa, 0x1f(%rsp,%rax)
jne 0x254f
decq %r13
jmp 0x254f
xorl %r13d, %r13d
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x2040
cmpq $0xfe, %r13
jbe 0x25ae
movq (%r14), %rdx
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x21f0
testq %rax, %rax
jne 0x2530
movq (%r14), %rdi
callq 0x21d0
testl %eax, %eax
je 0x25fe
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
je 0x25d0
movb $0x1, (%rbx)
leaq 0x8(%rbx), %rdi
leaq 0x18(%rbx), %rax
movq %rax, 0x8(%rbx)
movq (%rsp), %rsi
addq %rsi, %rdx
callq 0x54a6
jmp 0x25d3
movb $0x1, (%rbx)
leaq 0x8(%rbx), %rdi
leaq 0x18(%rbx), %rax
movq %rax, 0x8(%rbx)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
addq %rsi, %rdx
callq 0x54a6
jmp 0x25d3
movb $0x0, (%rbx)
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x25e9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2120
movq %rbx, %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x20b0
jmp 0x2607
jmp 0x2607
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x2620
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2120
movq %rbx, %rdi
callq 0x2220
// File: /workspace/github_cpp_makefile_star2_O1/graphitemaster[P]smbf/smbf.cpp
// Function: vertexCacheData::findTriangle(unsigned long)
size_t vertexCacheData::findTriangle(size_t triangle) {
    for (size_t i = 0; i < indices.size(); i++)
        if (indices[i] == triangle)
            return i;
    return (size_t)-1;
}

// Assembly:
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
movq $-0x1, %rax
subq %rcx, %rdx
je 0x265d
sarq $0x3, %rdx
cmpq $0x1, %rdx
adcq $0x0, %rdx
xorl %edi, %edi
cmpq %rsi, (%rcx,%rdi,8)
je 0x265e
incq %rdi
cmpq %rdi, %rdx
jne 0x264f
retq
movq %rdi, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/graphitemaster[P]smbf/smbf.cpp
// Function: vertexCacheData::moveTriangle(unsigned long)
void vertexCacheData::moveTriangle(size_t triangle) {
    size_t index = findTriangle(triangle);
    assert(index != (size_t)-1);

    // Erase the index and add it to the end
    indices.erase(indices.begin() + index,
                  indices.begin() + index + 1);
    indices.push_back(triangle);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
movq (%rdi), %rax
movq 0x8(%rdi), %rdx
movq $-0x1, %rcx
movq %rdx, %rdi
subq %rax, %rdi
je 0x26ab
sarq $0x3, %rdi
cmpq $0x1, %rdi
adcq $0x0, %rdi
xorl %r8d, %r8d
cmpq %rsi, (%rax,%r8,8)
je 0x26a8
incq %r8
cmpq %r8, %rdi
jne 0x2698
jmp 0x26ab
movq %r8, %rcx
cmpq $-0x1, %rcx
je 0x2716
leaq (%rax,%rcx,8), %r14
leaq (%rax,%rcx,8), %r15
addq $0x8, %r15
subq %r15, %rdx
je 0x26cd
movq %r14, %rdi
movq %r15, %rsi
callq 0x2200
movq 0x8(%rbx), %rax
movq %rax, %rcx
subq %r15, %rcx
addq %rcx, %r14
cmpq %r14, %rax
je 0x26e3
movq %r14, 0x8(%rbx)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x26ff
movq 0x8(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x270c
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x5da8
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x49cb(%rip), %rdi      # 0x70e8
leaq 0x49d8(%rip), %rsi      # 0x70fc
leaq 0x49da(%rip), %rcx      # 0x7105
movl $0x324, %edx            # imm = 0x324
callq 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/graphitemaster[P]smbf/smbf.cpp
// Function: vertexCache::addVertex(unsigned long)
void vertexCache::addVertex(size_t vertex) {
    size_t w = findVertex(vertex);
    // remove the vertex for later reinsertion at the top
    if (w != (size_t)-1)
        removeVertex(w);
    else // not found, cache miss!
        m_misses++;
    // shift all vertices down to make room for the new top vertex
    for (size_t i = 39; i != 0; i--)
        m_cache[i] = m_cache[i - 1];
    // add new vertex to cache
    m_cache[0] = vertex;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
cmpq %rbx, (%r14,%rax,8)
je 0x27d6
incq %rax
cmpq $0x20, %rax
jne 0x27c0
movq $-0x1, %rax
cmpq $-0x1, %rax
je 0x27fa
cmpq $0x25, %rax
ja 0x2801
movq 0x8(%r14,%rax,8), %rcx
movq %rcx, (%r14,%rax,8)
leaq 0x1(%rax), %rcx
movq %rcx, %rax
cmpq $0x26, %rcx
jne 0x27e2
jmp 0x2801
incq 0x140(%r14)
leaq 0x8(%r14), %rdi
movl $0x138, %edx            # imm = 0x138
movq %r14, %rsi
callq 0x2200
movq %rbx, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/graphitemaster[P]smbf/smbf.cpp
// Function: vertexCache::getCacheMissCount(std::vector<unsigned long, std::allocator<unsigned long>> const&)
size_t vertexCache::getCacheMissCount(const u::vector<size_t> &indices) {
    clear();
    for (auto &it : indices)
        addVertex(it);
    return m_misses;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x140, %edx            # imm = 0x140
movl $0xff, %esi
callq 0x20a0
movq $0x0, 0x140(%rbx)
movq (%r14), %r15
movq 0x8(%r14), %r14
cmpq %r14, %r15
je 0x2888
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x27b4
addq $0x8, %r15
jmp 0x2872
movq 0x140(%rbx), %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/graphitemaster[P]smbf/smbf.cpp
// Function: vertexCacheOptimizer::optimize(std::vector<unsigned long, std::allocator<unsigned long>>&)
vertexCacheOptimizer::result vertexCacheOptimizer::optimize(u::vector<size_t> &indices) {
    size_t find = (size_t)-1;
    for (size_t i = 0; i < indices.size(); i++)
        if (find == (size_t)-1 || (find != (size_t)-1 && indices[i] > find))
            find = indices[i];
    if (find == (size_t)-1)
        return kErrorNoVertices;

    result begin = init(indices, find + 1);
    if (begin != kSuccess)
        return begin;

    // Process
    while (process())
        ;

    // Rewrite the indices
    for (size_t i = 0; i < m_drawList.size(); i++)
        for (size_t j = 0; j < 3; j++)
            indices[3 * i + j] = m_triangles[m_drawList[i]].vertices[j];

    return kSuccess;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
subq %rax, %rcx
je 0x2944
sarq $0x3, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
movq $-0x1, %rdx
xorl %esi, %esi
cmpq $-0x1, %rdx
je 0x2936
cmpq %rdx, (%rax,%rsi,8)
jbe 0x293a
movq (%rax,%rsi,8), %rdx
incq %rsi
cmpq %rsi, %rcx
jne 0x292a
jmp 0x294b
movq $-0x1, %rdx
cmpq $-0x1, %rdx
je 0x2a29
incq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2a38
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x2a2e
movabsq $-0x3333333333333333, %r15 # imm = 0xCCCCCCCCCCCCCCCD
movq 0x20(%r14), %r12
movq 0x50(%r14), %r13
subq 0x48(%r14), %r13
subq 0x18(%r14), %r12
sarq $0x3, %r13
sarq $0x3, %r12
imulq %r15, %r12
cmpq %r12, %r13
je 0x29d3
movq 0x1a8(%r14), %rsi
movq %r14, %rdi
callq 0x2f42
movq %r14, %rdi
callq 0x3028
movq %r14, %rdi
testb %al, %al
je 0x29c2
callq 0x3122
jmp 0x29c7
callq 0x2d6e
movq %rax, 0x1a8(%r14)
cmpq %r12, %r13
jne 0x297c
movq 0x48(%r14), %rax
movq 0x50(%r14), %rcx
subq %rax, %rcx
je 0x2a25
sarq $0x3, %rcx
movq 0x18(%r14), %rdx
movq (%rbx), %rsi
cmpq $0x1, %rcx
adcq $0x0, %rcx
addq $0x8, %rdx
xorl %edi, %edi
xorl %r8d, %r8d
movq (%rax,%rdi,8), %r9
leaq (%r9,%r9,4), %r9
leaq (%rdx,%r9,8), %r9
movq (%r9,%r8,8), %r9
movq %r9, (%rsi,%r8,8)
incq %r8
cmpq $0x3, %r8
jne 0x29fc
incq %rdi
addq $0x18, %rsi
cmpq %rcx, %rdi
jne 0x29f9
xorl %eax, %eax
jmp 0x2a2e
movl $0x2, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/graphitemaster[P]smbf/smbf.cpp
// Function: vertexCacheOptimizer::fullScoreRecalculation()
size_t vertexCacheOptimizer::fullScoreRecalculation() {
    // Calculate score for all vertices
    for (size_t i = 0; i < m_vertices.size(); i++)
        m_vertices[i].currentScore = calcVertexScore(i);

    // Calculate scores for all active triangles
    float maxScore = 0.0f;
    size_t maxScoreTriangle = (size_t)-1;
    bool firstTime = true;

    for (size_t i = 0; i < m_triangles.size(); i++) {
        auto &it = m_triangles[i];
        if (it.rendered)
            continue;

        // Sum the score of all the triangle's vertices
        float sum = m_vertices[it.vertices[0]].currentScore +
                    m_vertices[it.vertices[1]].currentScore +
                    m_vertices[it.vertices[2]].currentScore;
        it.currentScore = sum;

        if (firstTime || sum > maxScore) {
            firstTime = false;
            maxScore = sum;
            maxScoreTriangle = i;
        }
    }

    return maxScoreTriangle;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rcx
cmpq %rcx, 0x8(%rdi)
je 0x2db3
movl $0x20, %r15d
xorl %r14d, %r14d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2c98
movq (%rbx), %rcx
movss %xmm0, (%rcx,%r15)
incq %r14
movq 0x8(%rbx), %rax
subq %rcx, %rax
sarq $0x6, %rax
addq $0x40, %r15
cmpq %rax, %r14
jb 0x2d88
movq 0x18(%rbx), %rdx
movq 0x20(%rbx), %rax
subq %rdx, %rax
je 0x2e58
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rsi # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rsi
cmpq $0x1, %rsi
adcq $0x0, %rsi
movq $-0x1, %rax
movb $0x1, %dil
xorps %xmm0, %xmm0
xorl %r8d, %r8d
xorl %r9d, %r9d
cmpb $0x0, (%rdx)
jne 0x2e4a
movq 0x8(%rdx), %r10
movq 0x10(%rdx), %r11
shlq $0x6, %r10
movss 0x20(%rcx,%r10), %xmm1
shlq $0x6, %r11
addss 0x20(%rcx,%r11), %xmm1
movq 0x18(%rdx), %r10
shlq $0x6, %r10
addss 0x20(%rcx,%r10), %xmm1
movss %xmm1, 0x4(%rdx)
ucomiss %xmm0, %xmm1
seta %r10b
orb %dil, %r10b
testb $0x1, %r10b
cmovneq %r9, %rax
movzbl %dil, %edi
cmovnel %r8d, %edi
jne 0x2e47
movaps %xmm0, %xmm1
movaps %xmm1, %xmm0
incq %r9
addq $0x28, %rdx
cmpq %r9, %rsi
jne 0x2df1
jmp 0x2e5f
movq $-0x1, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/graphitemaster[P]smbf/smbf.cpp
// Function: vertexCacheOptimizer::initialPass()
vertexCacheOptimizer::result vertexCacheOptimizer::initialPass() {
    for (size_t i = 0; i < m_indices.size(); i++) {
        size_t index = m_indices[i];
        if (index == (size_t)-1 || index >= m_vertices.size())
            return kErrorInvalidIndex;
        m_vertices[index].totalValence++;
        m_vertices[index].remainingValence++;
        m_vertices[index].indices.push_back(i / 3);
    }
    m_bestTriangle = fullScoreRecalculation();
    return kSuccess;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rdi), %rax
cmpq %rax, 0x38(%rdi)
setne %dl
je 0x2f24
movq (%rax), %rcx
cmpq $-0x1, %rcx
je 0x2f1a
movl $0x1, %r15d
movabsq $-0x5555555555555555, %r12 # imm = 0xAAAAAAAAAAAAAAAB
movq %rsp, %r14
movq (%rbx), %r8
movq 0x8(%rbx), %rax
subq %r8, %rax
sarq $0x6, %rax
cmpq %rax, %rcx
jae 0x2f1a
leaq -0x1(%r15), %rax
shlq $0x6, %rcx
leaq (%r8,%rcx), %rdi
incq 0x28(%r8,%rcx)
incq 0x30(%r8,%rcx)
mulq %r12
shrq %rdx
movq %rdx, (%rsp)
movq 0x8(%r8,%rcx), %rsi
cmpq 0x10(%r8,%rcx), %rsi
je 0x2eee
movq %rdx, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x2ef6
movq %r14, %rdx
callq 0x5ee4
movq 0x30(%rbx), %rax
movq 0x38(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rcx, %r15
setb %dl
jae 0x2f24
movq (%rax,%r15,8), %rcx
incq %r15
cmpq $-0x1, %rcx
jne 0x2ea2
movl $0x1, %eax
testb $0x1, %dl
jne 0x2f35
movq %rbx, %rdi
callq 0x2d6e
movq %rax, 0x1a8(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/graphitemaster[P]smbf/smbf.cpp
// Function: vertexCacheOptimizer::addTriangle(unsigned long)
void vertexCacheOptimizer::addTriangle(size_t triangle) {
    // reset all cache positions
    for (size_t i = 0; i < 32; i++) {
        size_t find = m_vertexCache.getCachedVertex(i);
        if (find == (size_t)-1)
            continue;
        m_vertices[find].cachePosition = (size_t)-1;
    }

    triangleCacheData *t = &m_triangles[triangle];
    if (t->rendered)
        return;

    for (size_t i = 0; i < 3; i++) {
        // Add all the triangle's vertices to the cache
        m_vertexCache.addVertex(t->vertices[i]);
        vertexCacheData *v = &m_vertices[t->vertices[i]];

        // Decrease the remaining valence.
        v->remainingValence--;

        // Move the added triangle to the end of the vertex's triangle index
        // list such that the first `remainingValence' triangles in the index
        // list are only the active ones.
        v->moveTriangle(triangle);
    }

    // It's been rendered, mark it
    m_drawList.push_back(triangle);
    t->rendered = true;

    // Update all the vertex cache positions
    for (size_t i = 0; i < 32; i++) {
        size_t index = m_vertexCache.getCachedVertex(i);
        if (index == (size_t)-1)
            continue;
        m_vertices[index].cachePosition = i;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, (%rsp)
movq (%rdi), %rax
movl $0xc, %ecx
movq (%rbx,%rcx,8), %rdx
cmpq $-0x1, %rdx
je 0x2f70
shlq $0x6, %rdx
movq $-0x1, 0x18(%rax,%rdx)
incq %rcx
cmpq $0x2c, %rcx
jne 0x2f59
movq (%rsp), %rcx
movq 0x18(%rbx), %rax
leaq (%rcx,%rcx,4), %rcx
cmpb $0x0, (%rax,%rcx,8)
jne 0x301c
leaq (%rax,%rcx,8), %r15
leaq 0x60(%rbx), %r14
movl $0x1, %r12d
movq (%r15,%r12,8), %rsi
movq %r14, %rdi
callq 0x27b4
movq (%r15,%r12,8), %rax
movq (%rbx), %rcx
shlq $0x6, %rax
leaq (%rcx,%rax), %rdi
decq 0x30(%rcx,%rax)
movq (%rsp), %rsi
callq 0x2662
incq %r12
cmpq $0x4, %r12
jne 0x2f9d
movq 0x50(%rbx), %rsi
cmpq 0x58(%rbx), %rsi
je 0x2fea
movq (%rsp), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x50(%rbx)
jmp 0x2ff6
leaq 0x48(%rbx), %rdi
movq %rsp, %rdx
callq 0x5da8
movb $0x1, (%r15)
movq (%rbx), %rax
xorl %ecx, %ecx
movq 0x60(%rbx,%rcx,8), %rdx
cmpq $-0x1, %rdx
je 0x3013
shlq $0x6, %rdx
movq %rcx, 0x18(%rax,%rdx)
incq %rcx
cmpq $0x20, %rcx
jne 0x2fff
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/graphitemaster[P]smbf/smbf.cpp
// Function: vertexCacheOptimizer::cleanFlags()
bool vertexCacheOptimizer::cleanFlags() {
    bool found = false;
    for (size_t i = 0; i < 32; i++) {
        size_t find = m_vertexCache.getCachedVertex(i);
        if (find == (size_t)-1)
            continue;

        vertexCacheData *v = &m_vertices[find];
        for (size_t j = 0; j < v->remainingValence; j++) {
            triangleCacheData *t = &m_triangles[v->indices[j]];
            found = true;
            // Clear flags
            t->calculated = false;
            for (size_t k = 0; k < 3; k++)
                m_vertices[t->vertices[k]].calculated = false;
        }
    }
    return found;
}

// Assembly:
pushq %rbx
movq (%rdi), %rcx
movq 0x18(%rdi), %rdx
xorl %eax, %eax
xorl %esi, %esi
movq 0x60(%rdi,%rsi,8), %r9
cmpq $-0x1, %r9
je 0x308d
shlq $0x6, %r9
movq 0x30(%rcx,%r9), %r8
testq %r8, %r8
je 0x308d
addq %rcx, %r9
movq (%r9), %rax
xorl %r9d, %r9d
movq (%rax,%r9,8), %r10
leaq (%r10,%r10,4), %r10
leaq (%rdx,%r10,8), %r10
movb $0x0, 0x20(%r10)
movl $0x1, %r11d
movq (%r10,%r11,8), %rbx
shlq $0x6, %rbx
movb $0x0, 0x38(%rcx,%rbx)
incq %r11
cmpq $0x4, %r11
jne 0x306d
incq %r9
cmpq %r8, %r9
jne 0x3056
movb $0x1, %al
incq %rsi
cmpq $0x20, %rsi
jne 0x3034
andb $0x1, %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/graphitemaster[P]smbf/smbf.cpp
// Function: vertexCacheOptimizer::triangleScoreRecalculation(unsigned long)
void vertexCacheOptimizer::triangleScoreRecalculation(size_t triangle) {
    triangleCacheData *t = &m_triangles[triangle];

    // Calculate vertex scores
    float sum = 0.0f;
    for (size_t i = 0; i < 3; i++) {
        vertexCacheData *v = &m_vertices[t->vertices[i]];
        float score = v->calculated ? v->currentScore : calcVertexScore(t->vertices[i]);
        v->currentScore = score;
        v->calculated = true;
        sum += score;
    }

    t->currentScore = sum;
    t->calculated = true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq (%rsi,%rsi,4), %r14
shlq $0x3, %r14
addq 0x18(%rdi), %r14
xorps %xmm1, %xmm1
movl $0x1, %r15d
movq (%r14,%r15,8), %rsi
movq (%rbx), %rax
movq %rsi, %rcx
shlq $0x6, %rcx
leaq (%rax,%rcx), %r12
cmpb $0x1, 0x38(%rax,%rcx)
jne 0x30dc
movss 0x20(%r12), %xmm0
jmp 0x30f0
movq %rbx, %rdi
movss %xmm1, 0x4(%rsp)
callq 0x2c98
movss 0x4(%rsp), %xmm1
movss %xmm0, 0x20(%r12)
movb $0x1, 0x38(%r12)
addss %xmm0, %xmm1
incq %r15
cmpq $0x4, %r15
jne 0x30ba
movss %xmm1, 0x4(%r14)
movb $0x1, 0x20(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/graphitemaster[P]smbf/smbf.cpp
// Function: vertexCacheOptimizer::partialScoreRecalculation()
size_t vertexCacheOptimizer::partialScoreRecalculation() {
    // Iterate through all the vertices of the cache
    bool firstTime = true;
    float maxScore = 0.0f;
    size_t maxScoreTriangle = (size_t)-1;
    for (size_t i = 0; i < 32; i++) {
        size_t find = m_vertexCache.getCachedVertex(i);
        if (find == (size_t)-1)
            continue;

        vertexCacheData *v = &m_vertices[find];

        // Iterate through all the active triangles of this vertex
        for (size_t j = 0; j < v->remainingValence; j++) {
            size_t triangle = v->indices[j];
            triangleCacheData *t = &m_triangles[triangle];

            // Calculate triangle score if it isn't already calculated
            if (!t->calculated)
                triangleScoreRecalculation(triangle);

            float score = t->currentScore;
            // Found a triangle to process
            if (firstTime || score > maxScore) {
                firstTime = false;
                maxScore = score;
                maxScoreTriangle = triangle;
            }
        }
    }
    return maxScoreTriangle;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r12
movq $-0x1, %rax
xorps %xmm1, %xmm1
movb $0x1, %bpl
xorl %edx, %edx
xorl %ecx, %ecx
movq %rcx, 0x10(%rsp)
movq 0x60(%r12,%rcx,8), %rcx
cmpq $-0x1, %rcx
je 0x31e6
movq (%r12), %rsi
shlq $0x6, %rcx
cmpq $0x0, 0x30(%rsi,%rcx)
je 0x31e6
addq %rcx, %rsi
xorl %r13d, %r13d
movq %rsi, 0x18(%rsp)
movq (%rsi), %rcx
movq (%rcx,%r13,8), %r15
movq 0x18(%r12), %r14
leaq (%r15,%r15,4), %rbx
cmpb $0x0, 0x20(%r14,%rbx,8)
jne 0x31b3
movq %r12, %rdi
movq %r15, %rsi
movq %rax, 0x20(%rsp)
movss %xmm1, 0xc(%rsp)
callq 0x309a
movq 0x18(%rsp), %rsi
movss 0xc(%rsp), %xmm1
xorl %edx, %edx
movq 0x20(%rsp), %rax
leaq (%r14,%rbx,8), %rcx
movss 0x4(%rcx), %xmm0
ucomiss %xmm1, %xmm0
seta %cl
orb %bpl, %cl
testb $0x1, %cl
cmovneq %r15, %rax
jne 0x31d1
movaps %xmm1, %xmm0
movzbl %bpl, %ebp
cmovnel %edx, %ebp
incq %r13
movaps %xmm0, %xmm1
cmpq 0x30(%rsi), %r13
jb 0x3173
jmp 0x31e9
movaps %xmm1, %xmm0
movq 0x10(%rsp), %rcx
incq %rcx
movaps %xmm0, %xmm1
cmpq $0x20, %rcx
jne 0x3144
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/graphitemaster[P]smbf/smbf.cpp
// Function: u::sscanf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char const*, ...)
inline int sscanf(const u::string &thing, const char *fmt, ...) {
    va_list va;
    va_start(va, fmt);
    int value = detail::c99vsscanf(thing.c_str(), fmt, va);
    va_end(va);
    return value;
}

// Assembly:
subq $0xd8, %rsp
leaq 0x20(%rsp), %r10
movq %rdx, 0x10(%r10)
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x529d
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)
movq %rsp, %rdx
movq %r10, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq (%rdi), %rdi
callq 0x2170
addq $0xd8, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/mgo1977[P]c---parsing-argument-options/./Parser.h
// Function: Parser::findOption(char)
BaseOption*
Parser::findOption(char shortOption) {

    // iterate over the array and search for the short option
    for(int index=0; index < options.size(); ++index) {

        BaseOption* option = options.at(index);

        if ( option->matches( shortOption ) )
            return option;

    }

    return NULL;

}

// Assembly:
movq 0x60(%rdi), %rcx
movq 0x68(%rdi), %rdx
subq %rcx, %rdx
je 0x3d89
pushq %rbp
movq %rsp, %rbp
sarq $0x3, %rdx
cmpq $0x1, %rdx
adcq $0x0, %rdx
xorl %edi, %edi
movq (%rcx,%rdi,8), %r8
cmpb %sil, 0x8(%r8)
cmoveq %r8, %rax
je 0x3d87
incq %rdi
cmpq %rdi, %rdx
jne 0x3d6f
xorl %eax, %eax
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/mgo1977[P]c---parsing-argument-options/./Parser.h
// Function: Parser::getOptionText[abi:cxx11](BaseOption*, char const*)
std::string
Parser::getOptionText(BaseOption* option, const char* separator) {

    std::string optionBase;

    if ( option->hasShortOption() ) {
        optionBase += "-";
        optionBase += option->getShortOption();
    }

    if ( option->hasLongOption() ) {

        if ( option->hasShortOption() )
            optionBase += separator;

        optionBase += "--" + option->getLongOption();
    }

    return optionBase;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r15
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r12
movq %r12, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
cmpb $0x0, 0x8(%rdx)
je 0x454d
leaq 0x2b8a(%rip), %rsi      # 0x70c2
movq %rbx, %rdi
callq 0x3340
movsbl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x3170
cmpq $0x0, 0x18(%r14)
je 0x461d
cmpb $0x0, 0x8(%r14)
je 0x456a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3340
leaq -0x58(%rbp), %r15
movq %r15, -0x10(%r15)
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x6370
leaq 0x2b34(%rip), %rcx      # 0x70c1
leaq -0x68(%rbp), %rdi
movl $0x2, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3200
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x45c4
movq %rdx, -0x48(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x38(%rbp)
jmp 0x45cc
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, -0x40(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0x3070
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x4608
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x461d
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x31d0
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x464c
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x464c
movq %rax, %r14
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x4668
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x4668
jmp 0x4665
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x467c
movq (%r12), %rsi
incq %rsi
callq 0x31d0
movq %r14, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O1/mgo1977[P]c---parsing-argument-options/./Parser.h
// Function: BaseOption::bestMatch(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
int bestMatch(const std::string& lOption) const {

        // The idea is to determine the number of chars
        // that matches the requested option
        int matches = 0;

        // is greater don't waste time
        if ( lOption.size() > longOption.size() )
            return matches;

        for(int index=0; index < lOption.size(); ++index) {
            if ( std::tolower(lOption[index]) == std::tolower(longOption[index]) )
                matches++;
            else
                return matches;
        }

        return matches;

    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x8(%rsi), %r15
leaq -0x1(%r15), %rax
xorl %ebx, %ebx
cmpq 0x18(%rdi), %rax
jae 0x5479
movq (%rsi), %r12
movq 0x10(%rdi), %r13
cmpq $0x1, %r15
adcq $0x0, %r15
xorl %ebx, %ebx
movsbl (%r12,%rbx), %edi
callq 0x3260
movl %eax, %r14d
movsbl (%r13,%rbx), %edi
callq 0x3260
cmpl %eax, %r14d
jne 0x5479
incq %rbx
cmpq %rbx, %r15
jne 0x5451
movq %r15, %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/mgo1977[P]c---parsing-argument-options/./Parser.h
// Function: Option<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::getValue()
TYPE getValue() {

        if ( ! found )
            return defaultValue;
        else
            return value;

    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzbl 0x58(%rsi), %ecx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
xorl $0x1, %ecx
shll $0x5, %ecx
movq 0x60(%rcx,%rsi), %rax
movq 0x68(%rcx,%rsi), %rdx
addq %rax, %rdx
movq %rax, %rsi
callq 0x6370
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/mgo1977[P]c---parsing-argument-options/./Parser.h
// Function: BaseOption::toLower(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
std::string toLower(const std::string& original) const {
        std::string lc = original;

        for(int index=0; index<lc.size(); ++index)
            lc[index] = std::tolower(lc[index]);

        return lc;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
callq 0x6370
cmpq $0x0, 0x8(%rbx)
je 0x5891
xorl %r14d, %r14d
movq (%rbx), %r15
movsbl (%r15,%r14), %edi
callq 0x3260
movb %al, (%r15,%r14)
incq %r14
cmpq %r14, 0x8(%rbx)
ja 0x5877
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/mgo1977[P]c---parsing-argument-options/./Parser.h
// Function: bool canBeConvertedTo<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool canBeConvertedTo(const std::string& str) {

    T result;

    std::stringstream text(str);

    if ( text >> result )
        return true;
    else
        return false;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, %rsi
leaq -0x20(%rbp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq -0x1b8(%rbp), %rdi
movl $0x18, %edx
callq 0x32c0
leaq -0x1b8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3240
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x20(%rax,%rcx), %ebx
movq 0x3e80(%rip), %rsi      # 0x9fb8
leaq -0x1b8(%rbp), %rdi
callq 0x3140
leaq -0x138(%rbp), %rdi
callq 0x3080
movq -0x30(%rbp), %rdi
cmpq %r14, %rdi
je 0x6165
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x31d0
testb $0x5, %bl
sete %al
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
movq 0x3e37(%rip), %rsi      # 0x9fb8
leaq -0x1b8(%rbp), %rdi
callq 0x3140
leaq -0x138(%rbp), %rdi
callq 0x3080
jmp 0x619e
movq %rax, %rbx
movq -0x30(%rbp), %rdi
cmpq %r14, %rdi
je 0x61b3
movq -0x20(%rbp), %rsi
incq %rsi
callq 0x31d0
movq %rbx, %rdi
callq 0x3320
// File: /workspace/github_cpp_makefile_star2_O1/mgo1977[P]c---parsing-argument-options/./Parser.h
// Function: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> fromString<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
T fromString(const std::string& str) {

    T result;

    std::stringstream text(str);

    text >> result;

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
leaq -0x1a0(%rbp), %rdi
movl $0x18, %edx
callq 0x32c0
leaq -0x1a0(%rbp), %rdi
movq %rbx, %rsi
callq 0x3240
movq 0x3db0(%rip), %rsi      # 0x9fb8
leaq -0x1a0(%rbp), %rdi
callq 0x3140
leaq -0x120(%rbp), %rdi
callq 0x3080
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x3d7d(%rip), %rsi      # 0x9fb8
leaq -0x1a0(%rbp), %rdi
callq 0x3140
leaq -0x120(%rbp), %rdi
callq 0x3080
jmp 0x6258
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x626b
movq (%r15), %rsi
incq %rsi
callq 0x31d0
movq %r14, %rdi
callq 0x3320
nop