LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: goodix[P]gdix_hid_firmware_update/gtx9/gtx9_i2c_update.cpp
// Function: gdix_flash_package(unsigned char, unsigned char*, unsigned int, unsigned short)
static int gdix_flash_package(uint8_t subsys_type, uint8_t *pkg,
							  uint32_t flash_addr, uint16_t pkg_len)
{
	int ret, retry;
	struct goodix_flash_cmd flash_cmd;

	retry = 2;
	do {
		ret = i2c_write(0x13410, pkg, pkg_len);
		if (ret < 0) {
			gdix_err("Failed to write firmware packet\n");
			return ret;
		}

		flash_cmd.status = 0;
		flash_cmd.ack = 0;
		flash_cmd.len = 11;
		flash_cmd.cmd = 0xBB;
		flash_cmd.fw_type = subsys_type;
		flash_cmd.fw_len = pkg_len;
		flash_cmd.fw_addr = flash_addr;

		gdix_append_checksum(&(flash_cmd.buf[2]), 9, CHECKSUM_MODE_U8_LE);

		ret = gdix_send_flash_cmd(&flash_cmd);
		if (!ret) {
			gdix_dbg("success write package to 0x%x, len %d\n", flash_addr,
					 pkg_len - 4);
			return 0;
		}
	} while (ret < 0 && --retry);

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movw %cx, %ax
movb %dil, %cl
movb %cl, -0x5(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movw %ax, -0x16(%rbp)
movl $0x2, -0x20(%rbp)
movq -0x10(%rbp), %rsi
movzwl -0x16(%rbp), %edx
movl $0x13410, %edi          # imm = 0x13410
callq 0x15870
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jge 0x1710d
jmp 0x170d0
leaq 0xf1c2(%rip), %rax      # 0x26299
testb $0x1, (%rax)
je 0x17100
movq 0xeef5(%rip), %rax      # 0x25fd8
movq (%rax), %rdi
leaq 0x8b7f(%rip), %rsi      # 0x1fc6c
leaq 0x8baa(%rip), %rdx      # 0x1fc9e
movl $0x299, %ecx            # imm = 0x299
movb $0x0, %al
callq 0x5190
jmp 0x17102
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x171d1
movb $0x0, -0x30(%rbp)
movb $0x0, -0x2f(%rbp)
movb $0xb, -0x2e(%rbp)
movb $-0x45, -0x2d(%rbp)
movb -0x5(%rbp), %al
movb %al, -0x2c(%rbp)
movw -0x16(%rbp), %ax
movw %ax, -0x2b(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x29(%rbp)
leaq -0x30(%rbp), %rdi
addq $0x2, %rdi
movl $0x9, %esi
xorl %edx, %edx
callq 0x14fc0
leaq -0x30(%rbp), %rdi
callq 0x171e0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x171a1
jmp 0x17159
leaq 0xf139(%rip), %rax      # 0x26299
testb $0x1, (%rax)
je 0x17196
movq 0xee4c(%rip), %rax      # 0x25fb8
movq (%rax), %rdi
movl -0x14(%rbp), %r8d
movzwl -0x16(%rbp), %r9d
subl $0x4, %r9d
leaq 0x8b2e(%rip), %rsi      # 0x1fcb1
leaq 0x8b14(%rip), %rdx      # 0x1fc9e
movl $0x2aa, %ecx            # imm = 0x2AA
movb $0x0, %al
callq 0x5190
jmp 0x17198
movl $0x0, -0x4(%rbp)
jmp 0x171d1
jmp 0x171a3
xorl %eax, %eax
cmpl $0x0, -0x1c(%rbp)
movb %al, -0x31(%rbp)
jge 0x171c0
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, %eax
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x170b3
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: goodix[P]gdix_hid_firmware_update/berlin_a/brla.cpp
// Function: BrlADevice::BrlADevice()
BrlADevice::BrlADevice()
{
	m_fd = -1;
	m_firmwareVersionMajor = 0;
	m_firmwareVersionMinor = 0;
	m_sensorID = 0;
	m_configID = 0;
	memset(m_pid, 0, sizeof(m_pid));
	memset(m_vid, 0, sizeof(m_vid));
	m_deviceOpen = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
callq 0xf7d0
movq -0x10(%rbp), %rdi
leaq 0xd29c(%rip), %rax      # 0x25b70
addq $0x10, %rax
movq %rax, (%rdi)
movl $0xffffffff, 0xc(%rdi)  # imm = 0xFFFFFFFF
movl $0x0, 0x24(%rdi)
movl $0x0, 0x28(%rdi)
movb $0x0, 0x1c(%rdi)
movl $0x0, 0x20(%rdi)
addq $0x10, %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x50a0
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x50a0
movq -0x10(%rbp), %rax
movb $0x0, 0x8(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: goodix[P]gdix_hid_firmware_update/berlin_a/brla.cpp
// Function: BrlADevice::Open(char const*)
int BrlADevice::Open(const char *filename)
{
	if (!filename)
		return -EINVAL;

	m_fd = open(filename, O_RDWR);
	if (m_fd < 0)
		return -EINVAL;

	m_deviceOpen = true;

	return SetBasicProperties();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x18958
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x18994
movq -0x18(%rbp), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0x51e0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
cmpl $0x0, 0xc(%rax)
jge 0x18980
movl $0xffffffea, -0x4(%rbp) # imm = 0xFFFFFFEA
jmp 0x18994
movq -0x20(%rbp), %rdi
movb $0x1, 0x8(%rdi)
movq (%rdi), %rax
callq *0xa0(%rax)
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: goodix[P]gdix_hid_firmware_update/berlin_a/brla.cpp
// Function: BrlADevice::Close()
void BrlADevice::Close()
{
	if (!m_deviceOpen)
		return;
	close(m_fd);
	m_fd = -1;
	m_deviceOpen = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
testb $0x1, 0x8(%rax)
jne 0x189bc
jmp 0x189d7
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x5200
movq -0x10(%rbp), %rax
movl $0xffffffff, 0xc(%rax)  # imm = 0xFFFFFFFF
movb $0x0, 0x8(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: goodix[P]gdix_hid_firmware_update/berlin_a/brla_firmware_image.cpp
// Function: BrlAFirmwareImage::BrlAFirmwareImage()
BrlAFirmwareImage::BrlAFirmwareImage()
{
	m_firmwareCfgID = 0;
	memset(m_firmwarePID, 0, sizeof(m_firmwarePID));
	memset(m_firmwareVID, 0, sizeof(m_firmwareVID));
	memset(&m_firmwareSummary, 0, sizeof(m_firmwareSummary));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
callq 0x5310
movq -0x10(%rbp), %rdi
leaq 0xc09c(%rip), %rax      # 0x25c50
addq $0x10, %rax
movq %rax, (%rdi)
movl $0x0, 0x44(%rdi)
addq $0x38, %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x50a0
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x50a0
movq -0x10(%rbp), %rdi
addq $0x48, %rdi
xorl %esi, %esi
movl $0x492, %edx            # imm = 0x492
callq 0x50a0
addq $0x10, %rsp
popq %rbp
retq
// File: AGWA[P]logmailer/logmailer.cpp
// Function: get_hostname[abi:cxx11]()
static std::string get_hostname ()
{
#ifndef HOST_NAME_MAX
#define HOST_NAME_MAX 255
#endif
	char	buffer[HOST_NAME_MAX + 1];
	buffer[HOST_NAME_MAX] = '\0';
	if (gethostname(buffer, HOST_NAME_MAX) == -1) {
		throw System_error("gethostname", "", errno);
	}
	return buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x180(%rbp)
movq %rdi, %rax
movq %rax, -0x178(%rbp)
movq %rdi, -0x8(%rbp)
movb $0x0, -0x11(%rbp)
leaq -0x110(%rbp), %rdi
movl $0xff, %esi
callq 0x3470
cmpl $-0x1, %eax
jne 0x3d30
movb $0x1, -0x16a(%rbp)
movl $0x48, %edi
callq 0x3160
movq %rax, -0x190(%rbp)
leaq -0x131(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x3510
movq -0x188(%rbp), %rdx
leaq 0x34dd(%rip), %rsi      # 0x7104
leaq -0x130(%rbp), %rdi
callq 0x5dd0
jmp 0x3c35
leaq -0x169(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0x3510
movq -0x198(%rbp), %rdx
leaq 0x35fb(%rip), %rsi      # 0x7251
leaq -0x168(%rbp), %rdi
callq 0x5dd0
jmp 0x3c64
callq 0x3030
movq -0x190(%rbp), %rdi
movl (%rax), %ecx
leaq -0x130(%rbp), %rsi
leaq -0x168(%rbp), %rdx
callq 0x5e80
jmp 0x3c87
movq -0x190(%rbp), %rdi
movb $0x0, -0x16a(%rbp)
leaq 0x50ec(%rip), %rsi      # 0x8d88
leaq 0x224d(%rip), %rdx      # 0x5ef0
callq 0x34e0
jmp 0x3da5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x3d0b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x3cf3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x3588
leaq -0x169(%rbp), %rdi
callq 0x32f0
leaq -0x130(%rbp), %rdi
callq 0x3588
leaq -0x131(%rbp), %rdi
callq 0x32f0
testb $0x1, -0x16a(%rbp)
jne 0x3d22
jmp 0x3d2e
movq -0x190(%rbp), %rdi
callq 0x31c0
jmp 0x3d99
leaq -0x16b(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x3510
movq -0x180(%rbp), %rdi
movq -0x1a0(%rbp), %rdx
leaq -0x110(%rbp), %rsi
callq 0x5dd0
jmp 0x3d5f
leaq -0x16b(%rbp), %rdi
callq 0x32f0
movq -0x178(%rbp), %rax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
leaq -0x16b(%rbp), %rdi
callq 0x32f0
movq -0x140(%rbp), %rdi
callq 0x3500
nopw %cs:(%rax,%rax)
// File: AGWA[P]logmailer/logmailer.cpp
// Function: init_signals()
static void init_signals ()
{
	struct sigaction		siginfo;

	sigemptyset(&siginfo.sa_mask);
	sigaddset(&siginfo.sa_mask, SIGINT);
	sigaddset(&siginfo.sa_mask, SIGTERM);
	sigaddset(&siginfo.sa_mask, SIGUSR1);

	// SIGINT and SIGTERM
	siginfo.sa_flags = 0;
	siginfo.sa_handler = graceful_termination_handler;
	sigaction(SIGINT, &siginfo, NULL);
	sigaction(SIGTERM, &siginfo, NULL);

	// SIGUSR1
	siginfo.sa_flags = 0;
	siginfo.sa_handler = request_flush_handler;
	sigaction(SIGUSR1, &siginfo, NULL);

	// SIGPIPE
	siginfo.sa_flags = 0;
	siginfo.sa_handler = SIG_IGN;
	sigaction(SIGPIPE, &siginfo, NULL);

	// Block SIGINT, SIGTERM, SIGUSR1; they will be unblocked
	// at a convenient time
	sigprocmask(SIG_BLOCK, &siginfo.sa_mask, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
leaq -0x98(%rbp), %rdi
addq $0x8, %rdi
callq 0x33a0
leaq -0x98(%rbp), %rdi
addq $0x8, %rdi
movl $0x2, %esi
callq 0x3480
leaq -0x98(%rbp), %rdi
addq $0x8, %rdi
movl $0xf, %esi
callq 0x3480
leaq -0x98(%rbp), %rdi
addq $0x8, %rdi
movl $0xa, %esi
callq 0x3480
movl $0x0, -0x10(%rbp)
leaq 0x378(%rip), %rax       # 0x4dc0
movq %rax, -0x98(%rbp)
movl $0x2, %edi
leaq -0x98(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x33b0
movl $0xf, %edi
leaq -0x98(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x33b0
movl $0x0, -0x10(%rbp)
leaq 0x359(%rip), %rax       # 0x4de0
movq %rax, -0x98(%rbp)
movl $0xa, %edi
leaq -0x98(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x33b0
movl $0x0, -0x10(%rbp)
movl $0x1, %eax
movq %rax, -0x98(%rbp)
movl $0xd, %edi
leaq -0x98(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x33b0
leaq -0x98(%rbp), %rsi
addq $0x8, %rsi
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %edx
callq 0x3150
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: AGWA[P]logmailer/logmailer.cpp
// Function: get_time()
static std::time_t get_time ()
{
#if defined(CLOCK_MONOTONIC) || defined(CLOCK_MONOTONIC_RAW)
	struct timespec tp;
#if defined(CLOCK_MONOTONIC_RAW)
	if (clock_gettime(CLOCK_MONOTONIC_RAW, &tp) == 0) {
		return tp.tv_sec;
	}
#endif
#if defined(CLOCK_MONOTONIC)
	if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) {
		return tp.tv_sec;
	}
#endif
#endif
	return std::time(NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x4, %edi
leaq -0x18(%rbp), %rsi
callq 0x3250
cmpl $0x0, %eax
jne 0x4e25
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4e4f
movl $0x1, %edi
leaq -0x18(%rbp), %rsi
callq 0x3250
cmpl $0x0, %eax
jne 0x4e42
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4e4f
xorl %eax, %eax
movl %eax, %edi
callq 0x3260
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: AGWA[P]logmailer/logmailer.cpp
// Function: find_last_newline(char const*, unsigned long)
static const char* find_last_newline (const char* base, std::size_t len)
{
	for (const char* p = base + len; p > base;) {
		--p;
		if (*p == '\n') {
			return p;
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jbe 0x4ea6
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x4ea4
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4eae
jmp 0x4e78
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: AGWA[P]logmailer/logmailer.cpp
// Function: count_newlines(char const*, unsigned long)
static std::size_t count_newlines (const char* p, std::size_t len)
{
	std::size_t cnt = 0;
	while (len--) {
		if (*p++ == '\n') {
			++cnt;
		}
	}
	return cnt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x10(%rbp)
cmpq $0x0, %rax
je 0x542e
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x542c
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x53f4
movq -0x18(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: AGWA[P]logmailer/logmailer.cpp
// Function: Log_mailer::open_fifo()
void open_fifo ()
	{
		close_fifo();

		if ((fd = open(fifo_path.c_str(), O_RDONLY | O_NONBLOCK)) == -1) {
			throw System_error("open", fifo_path.c_str(), errno);
		}
		set_cloexec(fd, true);

		// try opening the FIFO for write so that we never get end-of-file when reading from it
		wfd = open(fifo_path.c_str(), O_WRONLY | O_NONBLOCK);
		if (wfd != -1) {
			set_cloexec(wfd, true);
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x61b0
movq -0x70(%rbp), %rdi
callq 0x3100
movq %rax, %rdi
movl $0x800, %esi            # imm = 0x800
movb $0x0, %al
callq 0x31d0
movq -0x70(%rbp), %rcx
movl %eax, 0x78(%rcx)
cmpl $-0x1, %eax
jne 0x56bb
movb $0x1, -0x62(%rbp)
movl $0x48, %edi
callq 0x3160
movq %rax, -0x80(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x3510
movq -0x78(%rbp), %rdx
leaq 0x1c67(%rip), %rsi      # 0x7245
leaq -0x28(%rbp), %rdi
callq 0x5dd0
jmp 0x55e9
movq -0x70(%rbp), %rdi
callq 0x3100
movq %rax, -0x90(%rbp)
leaq -0x61(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x3510
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
leaq -0x60(%rbp), %rdi
callq 0x5dd0
jmp 0x5622
callq 0x3030
movq -0x80(%rbp), %rdi
movl (%rax), %ecx
leaq -0x28(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x5e80
jmp 0x563c
movq -0x80(%rbp), %rdi
movb $0x0, -0x62(%rbp)
leaq 0x373d(%rip), %rsi      # 0x8d88
leaq 0x89e(%rip), %rdx       # 0x5ef0
callq 0x34e0
jmp 0x5716
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x569f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x568d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3588
leaq -0x61(%rbp), %rdi
callq 0x32f0
leaq -0x28(%rbp), %rdi
callq 0x3588
leaq -0x29(%rbp), %rdi
callq 0x32f0
testb $0x1, -0x62(%rbp)
jne 0x56b0
jmp 0x56b9
movq -0x80(%rbp), %rdi
callq 0x31c0
jmp 0x570d
movq -0x70(%rbp), %rax
movl 0x78(%rax), %edi
movl $0x1, %esi
callq 0x4af0
movq -0x70(%rbp), %rdi
callq 0x3100
movq %rax, %rdi
movl $0x801, %esi            # imm = 0x801
movb $0x0, %al
callq 0x31d0
movl %eax, %ecx
movq -0x70(%rbp), %rax
movl %ecx, 0x7c(%rax)
cmpl $-0x1, 0x7c(%rax)
je 0x5704
movq -0x70(%rbp), %rax
movl 0x7c(%rax), %edi
movl $0x1, %esi
callq 0x4af0
addq $0x90, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x3500
nopw %cs:(%rax,%rax)
// File: AGWA[P]logmailer/logmailer.cpp
// Function: Log_mailer::close_fifo()
void close_fifo ()
	{
		if (wfd != -1) {
			close(wfd);
			wfd = -1;
		}
		if (fd != -1) {
			close(fd);
			fd = -1;
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpl $-0x1, 0x7c(%rax)
je 0x61e1
movq -0x10(%rbp), %rax
movl 0x7c(%rax), %edi
callq 0x3560
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x7c(%rax) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x78(%rax)
je 0x6202
movq -0x10(%rbp), %rax
movl 0x78(%rax), %edi
callq 0x3560
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x78(%rax) # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: AGWA[P]logmailer/logmailer.cpp
// Function: Log_mailer::flush()
void flush ()
	{
		if (!has_complete_message()) {
			return;
		}

		const char* const	message = buffer.data();
		const std::size_t	message_len = last_newline + 1;
		send_mail(recipient, format_subject(message, message_len), message, message_len);

		buffer.erase(0, last_newline + 1);
		last_newline = std::string::npos;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x6310
testb $0x1, %al
jne 0x6252
jmp 0x62e6
movq -0x50(%rbp), %rdi
subq $-0x80, %rdi
callq 0x3180
movq -0x50(%rbp), %rsi
movq %rax, -0x10(%rbp)
movq 0xa0(%rsi), %rax
incq %rax
movq %rax, -0x18(%rbp)
movq %rsi, %rax
addq $0x20, %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq -0x38(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x6330
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x4ec0
jmp 0x62ac
leaq -0x38(%rbp), %rdi
callq 0x3588
movq -0x50(%rbp), %rax
movq %rax, %rdi
addq $0x80, %rdi
movq 0xa0(%rax), %rdx
addq $0x1, %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x3080
movq -0x50(%rbp), %rax
movq $-0x1, 0xa0(%rax)
addq $0x60, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3588
movq -0x40(%rbp), %rdi
callq 0x3500
nopw (%rax,%rax)
// File: AGWA[P]logmailer/logmailer.cpp
// Function: Log_mailer::format_subject[abi:cxx11](char const*, unsigned long) const
std::string format_subject (const char* message, std::size_t message_len) const
	{
		std::ostringstream	subject;
		const char*		p = subject_format.c_str();
		while (p[0]) {
			if (p[0] == '%' && p[1] == 'h') {
				subject << hostname;
				p += 2;
			} else if (p[0] == '%' && p[1] == 'c') {
				subject << count_newlines(message, message_len);
				p += 2;
			} else if (p[0] == '%' && p[1] == '%') {
				subject << '%';
				p += 2;
			} else if (p[0] == '%' && p[1]) {
				p += 2;
			} else if (p[0] == '%') {
				++p;
			} else {
				subject << p[0];
				++p;
			}
		}
		return subject.str();
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x1c8(%rbp)
movq %rdi, %rax
movq %rax, -0x1c0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1b8(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x33d0
movq -0x1b8(%rbp), %rdi
addq $0x40, %rdi
callq 0x3100
movq %rax, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rax
cmpb $0x0, (%rax)
je 0x653c
movq -0x1a0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0x6408
movq -0x1a0(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x68, %eax
jne 0x6408
leaq 0x2f38(%rip), %rsi      # 0x92f8
leaq -0x198(%rbp), %rdi
callq 0x3240
jmp 0x63ce
movq -0x1a0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x1a0(%rbp)
jmp 0x6537
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1a8(%rbp)
movl %eax, -0x1ac(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x30a0
jmp 0x656d
movq -0x1a0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0x6469
movq -0x1a0(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x63, %eax
jne 0x6469
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x53e0
movq %rax, -0x1d0(%rbp)
jmp 0x643d
movq -0x1d0(%rbp), %rsi
leaq -0x198(%rbp), %rdi
callq 0x3090
jmp 0x6452
movq -0x1a0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x1a0(%rbp)
jmp 0x6535
movq -0x1a0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0x64b2
movq -0x1a0(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x25, %eax
jne 0x64b2
leaq -0x198(%rbp), %rdi
movl $0x25, %esi
callq 0x3350
jmp 0x649b
movq -0x1a0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x1a0(%rbp)
jmp 0x6533
movq -0x1a0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0x64e2
movq -0x1a0(%rbp), %rax
cmpb $0x0, 0x1(%rax)
je 0x64e2
movq -0x1a0(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x1a0(%rbp)
jmp 0x6531
movq -0x1a0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0x6505
movq -0x1a0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1a0(%rbp)
jmp 0x652f
movq -0x1a0(%rbp), %rax
movsbl (%rax), %esi
leaq -0x198(%rbp), %rdi
callq 0x3350
jmp 0x651d
movq -0x1a0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1a0(%rbp)
jmp 0x6531
jmp 0x6533
jmp 0x6535
jmp 0x6537
jmp 0x638a
movq -0x1c8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x32b0
jmp 0x6551
leaq -0x198(%rbp), %rdi
callq 0x30a0
movq -0x1c0(%rbp), %rax
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
movq -0x1a8(%rbp), %rdi
callq 0x3500
// File: ljc2154[P]Rummy/rummy.cpp
// Function: main
int main(int argc, char **argv)
{
	State state = initializeState();
	printState(state);
	while (gameOver(state) == false)
	{
		playUserTurn(state);
		if (gameOver(state))
			break;
		playAgentTurn(state);
		printState(state);
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x78(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x14d0
movq -0x230(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x3fe0
jmp 0x12fe
leaq -0xe0(%rbp), %rdi
callq 0x1630
jmp 0x130c
leaq -0xe0(%rbp), %rdi
callq 0x40c0
leaq -0x158(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3fe0
jmp 0x132a
leaq -0x158(%rbp), %rdi
callq 0x16b0
movb %al, -0x231(%rbp)
jmp 0x133e
movb -0x231(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x238(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x40c0
movl -0x238(%rbp), %eax
cmpl $0x0, %eax
jne 0x1494
leaq -0x78(%rbp), %rdi
callq 0x18b0
jmp 0x1375
leaq -0x1c0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3fe0
jmp 0x1387
leaq -0x1c0(%rbp), %rdi
callq 0x16b0
movb %al, -0x239(%rbp)
jmp 0x139b
leaq -0x1c0(%rbp), %rdi
callq 0x40c0
movb -0x239(%rbp), %al
testb $0x1, %al
jne 0x13b6
jmp 0x1438
jmp 0x1494
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
jmp 0x14b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x40c0
jmp 0x14b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x40c0
jmp 0x14b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x40c0
jmp 0x14b0
leaq -0x78(%rbp), %rdi
callq 0x1ea0
jmp 0x1443
leaq -0x228(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3fe0
jmp 0x1455
leaq -0x228(%rbp), %rdi
callq 0x1630
jmp 0x1463
leaq -0x228(%rbp), %rdi
callq 0x40c0
jmp 0x1318
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe8(%rbp)
movl %eax, -0xec(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x40c0
jmp 0x14b0
movl $0x0, -0x4(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x40c0
movl -0x4(%rbp), %eax
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
leaq -0x78(%rbp), %rdi
callq 0x40c0
movq -0xe8(%rbp), %rdi
callq 0x1170
nopw %cs:(%rax,%rax)
// File: ljc2154[P]Rummy/rummy.cpp
// Function: initializeState()
State initializeState()
{
	State state;
	state.deck = getNewDeck();
	state.remaining = initializeRemaining();
	dealCards(state.deck, state.userHand, state.agentHand);
	adjustRemaining(state.remaining, state.agentHand);
	mergeSort(state.userHand, 0, state.userHand.size());
	state.turnCard = 52;
	return state;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x78(%rbp)
movq %rdi, %rax
movq %rax, -0x70(%rbp)
movq %rdi, -0x8(%rbp)
movb $0x0, -0x9(%rbp)
callq 0x4410
leaq -0x28(%rbp), %rdi
callq 0x20e0
jmp 0x14fe
movq -0x78(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movq %rsi, -0x80(%rbp)
callq 0x4460
movq -0x80(%rbp), %rdi
callq 0x41e0
leaq -0x50(%rbp), %rdi
callq 0x2170
jmp 0x1523
movq -0x78(%rbp), %rdi
addq $0x48, %rdi
leaq -0x50(%rbp), %rsi
movq %rsi, -0x88(%rbp)
callq 0x4490
movq -0x88(%rbp), %rdi
callq 0x42a0
movq -0x78(%rbp), %rdi
movq %rdi, %rsi
addq $0x30, %rsi
movq %rdi, %rdx
addq $0x18, %rdx
callq 0x2200
jmp 0x1560
movq -0x78(%rbp), %rsi
movq %rsi, %rax
addq $0x48, %rax
movq %rax, -0x90(%rbp)
addq $0x18, %rsi
leaq -0x68(%rbp), %rdi
callq 0x44c0
jmp 0x1581
movq -0x90(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x2280
jmp 0x1593
leaq -0x68(%rbp), %rdi
callq 0x41e0
movq -0x78(%rbp), %rdi
addq $0x30, %rdi
movq %rdi, -0x98(%rbp)
callq 0x4130
movq -0x98(%rbp), %rdi
movl %eax, %edx
xorl %esi, %esi
callq 0x22f0
jmp 0x15c2
movq -0x78(%rbp), %rax
movl $0x34, 0x60(%rax)
movb $0x1, -0x9(%rbp)
testb $0x1, -0x9(%rbp)
jne 0x1607
jmp 0x15fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x1614
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x41e0
jmp 0x1614
movq -0x78(%rbp), %rdi
callq 0x40c0
movq -0x70(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x40c0
movq -0x30(%rbp), %rdi
callq 0x1170
nopw %cs:(%rax,%rax)
// File: ljc2154[P]Rummy/rummy.cpp
// Function: printState(State)
void printState(State state)
{
	//printHand(state.agentHand);
	printOpponentHandandDeck();
	if (state.turnCard < 52)
		printTurnCard(state.turnCard);
	printHand(state.userHand);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
callq 0x2520
movq -0x38(%rbp), %rdi
cmpl $0x34, 0x60(%rdi)
jge 0x165b
movq -0x38(%rbp), %rax
movl 0x60(%rax), %edi
callq 0x2690
movq -0x38(%rbp), %rsi
addq $0x30, %rsi
leaq -0x20(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0x44c0
movq -0x40(%rbp), %rdi
callq 0x27d0
jmp 0x167b
leaq -0x20(%rbp), %rdi
callq 0x41e0
addq $0x40, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x41e0
movq -0x28(%rbp), %rdi
callq 0x1170
nopl (%rax,%rax)
// File: ljc2154[P]Rummy/rummy.cpp
// Function: gameOver(State)
bool gameOver(State state)
{
	/* Check if user won */
	if (isWinner(state.userHand))
	{
		cout << "You won the game!" << endl;
		printHand(state.userHand);
		return true;
	}

	/* Check if agent won */
	if (isWinner(state.agentHand))
	{
		cout << "Read 'em and weep!" << endl;
		printHand(state.agentHand);
		cout << "You lost the game :(" << endl;
		return true;
	}

	/* No player has won */
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, %rsi
movq %rsi, -0x98(%rbp)
movq %rsi, -0x10(%rbp)
addq $0x30, %rsi
leaq -0x28(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x44c0
movq -0x90(%rbp), %rdi
callq 0x2ad0
movb %al, -0x81(%rbp)
jmp 0x16f1
leaq -0x28(%rbp), %rdi
callq 0x41e0
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x1709
jmp 0x179a
movq 0x98c0(%rip), %rdi      # 0xafd0
leaq 0x58f4(%rip), %rsi      # 0x700b
callq 0x10f0
movq %rax, %rdi
movq 0x989a(%rip), %rsi      # 0xafc0
callq 0x1120
movq -0x98(%rbp), %rsi
addq $0x30, %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x44c0
movq -0xa0(%rbp), %rdi
callq 0x27d0
jmp 0x1754
leaq -0x50(%rbp), %rdi
callq 0x41e0
movb $0x1, -0x1(%rbp)
jmp 0x188f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x41e0
jmp 0x189d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x41e0
jmp 0x189d
movq -0x98(%rbp), %rsi
addq $0x18, %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x44c0
movq -0xb0(%rbp), %rdi
callq 0x2ad0
movb %al, -0xa1(%rbp)
jmp 0x17c9
leaq -0x68(%rbp), %rdi
callq 0x41e0
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x17e1
jmp 0x188b
movq 0x97e8(%rip), %rdi      # 0xafd0
leaq 0x582e(%rip), %rsi      # 0x701d
callq 0x10f0
movq %rax, %rdi
movq 0x97c2(%rip), %rsi      # 0xafc0
callq 0x1120
movq -0x98(%rbp), %rsi
addq $0x18, %rsi
leaq -0x80(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x44c0
movq -0xb8(%rbp), %rdi
callq 0x27d0
jmp 0x182c
leaq -0x80(%rbp), %rdi
callq 0x41e0
movq 0x9794(%rip), %rdi      # 0xafd0
leaq 0x57ed(%rip), %rsi      # 0x7030
callq 0x10f0
movq %rax, %rdi
movq 0x976e(%rip), %rsi      # 0xafc0
callq 0x1120
movb $0x1, -0x1(%rbp)
jmp 0x188f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x41e0
jmp 0x189d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x41e0
jmp 0x189d
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xc0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x1170
nopw %cs:(%rax,%rax)
// File: ljc2154[P]Rummy/rummy.cpp
// Function: playAgentTurn(State&)
void playAgentTurn(State &state)
{
	/* Must be rewritten with dropCard function */
	if (takeTurnCard(state))
	{
		cout << "The computer took the turn card!" << endl;
		int turnCard = state.turnCard;
		state.agentHand.push_back(turnCard);
		state.turnCard = removeWorstCard(state);
	}
	else
	{
		cout << "The computer drew from the deck." << endl;
		state.agentHand.push_back(state.deck.back());
		state.remaining.remove(state.deck.back());
		state.deck.pop_back();
		state.turnCard = removeWorstCard(state);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
leaq -0x70(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x3fe0
movq -0x90(%rbp), %rdi
callq 0x39e0
movb %al, -0x81(%rbp)
jmp 0x1ed7
leaq -0x70(%rbp), %rdi
callq 0x40c0
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x1eec
jmp 0x1f5a
movq 0x90dd(%rip), %rdi      # 0xafd0
leaq 0x5274(%rip), %rsi      # 0x716e
callq 0x10f0
movq %rax, %rdi
movq 0x90b7(%rip), %rsi      # 0xafc0
callq 0x1120
movq -0x8(%rbp), %rax
movl 0x60(%rax), %eax
movl %eax, -0x80(%rbp)
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
leaq -0x80(%rbp), %rsi
callq 0x4170
movq -0x8(%rbp), %rdi
callq 0x3d40
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x60(%rax)
jmp 0x1fe5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x40c0
jmp 0x1fee
movq 0x906f(%rip), %rdi      # 0xafd0
leaq 0x5227(%rip), %rsi      # 0x718f
callq 0x10f0
movq %rax, %rdi
movq 0x9049(%rip), %rsi      # 0xafc0
callq 0x1120
movq -0x8(%rbp), %rax
addq $0x18, %rax
movq %rax, -0xa0(%rbp)
movq -0x8(%rbp), %rdi
callq 0x42c0
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x4170
movq -0x8(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rdi
callq 0x42c0
movq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x4330
movq -0x8(%rbp), %rdi
callq 0x4300
movq -0x8(%rbp), %rdi
callq 0x3d40
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x60(%rax)
addq $0xa0, %rsp
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x1170
nopw (%rax,%rax)
// File: ljc2154[P]Rummy/rummy.cpp
// Function: shuffle(std::vector<int, std::allocator<int>>&)
void shuffle(vector<int> &deck)
{
	srand(time(NULL));
	int size = deck.size();
	for (int i = size-1; i >0; i--)
	{
		int swapPos = rand() % i;
		swap(deck, i, swapPos);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x10d0
movl %eax, %edi
callq 0x10e0
movq -0x8(%rbp), %rdi
callq 0x4130
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jle 0x20cd
callq 0x1040
cltd
idivl -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x2000
movl -0x10(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x20a1
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: ljc2154[P]Rummy/rummy.cpp
// Function: getNewDeck()
vector<int> getNewDeck()
{
	vector<int> deck;
	for (int i = 0; i < 52; i++)
	{
		deck.push_back(i);
	}
	shuffle(deck);
	return deck;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x30(%rbp)
movq %rdi, %rax
movq %rax, -0x28(%rbp)
movq %rdi, -0x8(%rbp)
movb $0x0, -0x9(%rbp)
callq 0x4150
movl $0x0, -0x10(%rbp)
cmpl $0x34, -0x10(%rbp)
jge 0x2140
movq -0x30(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x4170
jmp 0x211c
jmp 0x211e
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2107
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x41e0
jmp 0x2166
movq -0x30(%rbp), %rdi
callq 0x2070
movb $0x1, -0x9(%rbp)
testb $0x1, -0x9(%rbp)
jne 0x215c
movq -0x30(%rbp), %rdi
callq 0x41e0
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x1170
nop
// File: ljc2154[P]Rummy/rummy.cpp
// Function: initializeRemaining[abi:cxx11]()
list<int> initializeRemaining()
{
	list<int> remaining;
	for (int i = 0; i < 52; i++)
		remaining.push_back(i);
	return remaining;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x30(%rbp)
movq %rdi, %rax
movq %rax, -0x28(%rbp)
movq %rdi, -0x8(%rbp)
movb $0x0, -0x9(%rbp)
callq 0x4240
movl $0x0, -0x10(%rbp)
cmpl $0x34, -0x10(%rbp)
jge 0x21d0
movq -0x30(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x4260
jmp 0x21ac
jmp 0x21ae
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2197
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x42a0
jmp 0x21ed
movb $0x1, -0x9(%rbp)
testb $0x1, -0x9(%rbp)
jne 0x21e3
movq -0x30(%rbp), %rdi
callq 0x42a0
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x1170
nopw %cs:(%rax,%rax)
// File: ljc2154[P]Rummy/rummy.cpp
// Function: dealCards(std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&)
void dealCards(vector<int> &deck, vector<int> &userHand, vector<int> &agentHand)
{
	for (int i = 0; i < 14; i ++)
	{
		int topCard = deck.back();
		deck.pop_back();
		if (i%2 == 0)
			userHand.push_back(topCard);
		else
			agentHand.push_back(topCard);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0xe, -0x1c(%rbp)
jge 0x2271
movq -0x8(%rbp), %rdi
callq 0x42c0
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4300
movl -0x1c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x2257
movq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x4170
jmp 0x2264
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x4170
jmp 0x2266
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x221b
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: ljc2154[P]Rummy/rummy.cpp
// Function: mergeSort(std::vector<int, std::allocator<int>>&, int, int)
void mergeSort(vector<int> &integers, int start, int finish)
{
	if ((finish - start) <= 1)
		return;
	int m = (finish - start) / 2;
	mergeSort(integers, start, start+m);
	mergeSort(integers, start+m, finish);

	vector<int> temp;
	merge(integers, start, start+m, finish, temp);
	int tempIndex = 0;
	for (int i = start; i < finish; i++)
		integers[i] = temp[tempIndex++];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0x10(%rbp), %eax
subl -0xc(%rbp), %eax
cmpl $0x1, %eax
jg 0x2312
jmp 0x2406
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
subl %ecx, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
sarl %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x14(%rbp), %eax
movl %esi, %edx
addl %eax, %edx
callq 0x22f0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x14(%rbp), %eax
addl %eax, %esi
movl -0x10(%rbp), %edx
callq 0x22f0
leaq -0x30(%rbp), %rdi
callq 0x4150
movq -0x8(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x44c0
jmp 0x2365
movl -0xc(%rbp), %esi
movl -0x14(%rbp), %eax
movl %esi, %edx
addl %eax, %edx
movl -0x10(%rbp), %ecx
leaq -0x48(%rbp), %rdi
leaq -0x30(%rbp), %r8
callq 0x2980
jmp 0x2381
leaq -0x48(%rbp), %rdi
callq 0x41e0
movl $0x0, -0x58(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x23fd
movl -0x58(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x58(%rbp)
movslq %eax, %rsi
leaq -0x30(%rbp), %rdi
callq 0x4110
movl (%rax), %eax
movl %eax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x5c(%rbp), %rsi
callq 0x4110
movl -0x60(%rbp), %ecx
movl %ecx, (%rax)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x2397
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x240c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x41e0
jmp 0x240c
leaq -0x30(%rbp), %rdi
callq 0x41e0
addq $0x60, %rsp
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x41e0
movq -0x50(%rbp), %rdi
callq 0x1170
nop
// File: ljc2154[P]Rummy/rummy.cpp
// Function: getSuit(int)
char getSuit(int i)
{
	if (i < 13)
		return '&';
	else if (i < 26)
		return '%';
	else if (i < 39)
		return '$';
	else
		return '@';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
cmpl $0xd, -0x8(%rbp)
jge 0x2433
movb $0x26, -0x1(%rbp)
jmp 0x244f
cmpl $0x1a, -0x8(%rbp)
jge 0x243f
movb $0x25, -0x1(%rbp)
jmp 0x244f
cmpl $0x27, -0x8(%rbp)
jge 0x244b
movb $0x24, -0x1(%rbp)
jmp 0x244f
movb $0x40, -0x1(%rbp)
movb -0x1(%rbp), %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: ljc2154[P]Rummy/rummy.cpp
// Function: getRank(int)
char getRank(int i)
{
	int rank = i % 13;
	if (rank == 0)
		return 'A';
	if (rank == 1)
		return '2';
	if (rank == 2)
		return '3';
	if (rank == 3)
		return '4';
	if (rank == 4)
		return '5';
	if (rank == 5)
		return '6';
	if (rank == 6)
		return '7';
	if (rank == 7)
		return '8';
	if (rank == 8)
		return '9';
	if (rank == 9)
		return 'T';
	if (rank == 10)
		return 'J';
	if (rank == 11)
		return 'Q';
	return 'K';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl $0xd, %ecx
cltd
idivl %ecx
movl %edx, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x2484
movb $0x41, -0x1(%rbp)
jmp 0x250c
cmpl $0x1, -0xc(%rbp)
jne 0x2490
movb $0x32, -0x1(%rbp)
jmp 0x250c
cmpl $0x2, -0xc(%rbp)
jne 0x249c
movb $0x33, -0x1(%rbp)
jmp 0x250c
cmpl $0x3, -0xc(%rbp)
jne 0x24a8
movb $0x34, -0x1(%rbp)
jmp 0x250c
cmpl $0x4, -0xc(%rbp)
jne 0x24b4
movb $0x35, -0x1(%rbp)
jmp 0x250c
cmpl $0x5, -0xc(%rbp)
jne 0x24c0
movb $0x36, -0x1(%rbp)
jmp 0x250c
cmpl $0x6, -0xc(%rbp)
jne 0x24cc
movb $0x37, -0x1(%rbp)
jmp 0x250c
cmpl $0x7, -0xc(%rbp)
jne 0x24d8
movb $0x38, -0x1(%rbp)
jmp 0x250c
cmpl $0x8, -0xc(%rbp)
jne 0x24e4
movb $0x39, -0x1(%rbp)
jmp 0x250c
cmpl $0x9, -0xc(%rbp)
jne 0x24f0
movb $0x54, -0x1(%rbp)
jmp 0x250c
cmpl $0xa, -0xc(%rbp)
jne 0x24fc
movb $0x4a, -0x1(%rbp)
jmp 0x250c
cmpl $0xb, -0xc(%rbp)
jne 0x2508
movb $0x51, -0x1(%rbp)
jmp 0x250c
movb $0x4b, -0x1(%rbp)
movb -0x1(%rbp), %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: ljc2154[P]Rummy/rummy.cpp
// Function: printOpponentHandandDeck()
void printOpponentHandandDeck()
{
	/* Printing out what looks like opponent's hand */
	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < 56; j++)
		{
			int k = j % 8;
			if (k == 7)
				cout << "* ";
			else if (i == 0 || i == 9 || k == 0)
				cout << "*";
			else
				cout << "?";
		}
		cout << endl;
	}
	cout << endl;

	/* Printing out what looks like a deck */
	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < 8; j++)
		{
			if (i == 0 || i == 9 || j == 0 || j == 7)
				cout << "*";
			else
				cout << "?";
		}
		cout << endl;
	}
	cout << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
cmpl $0xa, -0x4(%rbp)
jge 0x25d9
movl $0x0, -0x8(%rbp)
cmpl $0x38, -0x8(%rbp)
jge 0x25b8
movl -0x8(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, -0xc(%rbp)
cmpl $0x7, -0xc(%rbp)
jne 0x256f
movq 0x8a6f(%rip), %rdi      # 0xafd0
leaq 0x4a9c(%rip), %rsi      # 0x7004
callq 0x10f0
jmp 0x25ab
cmpl $0x0, -0x4(%rbp)
je 0x2581
cmpl $0x9, -0x4(%rbp)
je 0x2581
cmpl $0x0, -0xc(%rbp)
jne 0x2596
movq 0x8a48(%rip), %rdi      # 0xafd0
leaq 0x4a78(%rip), %rsi      # 0x7007
callq 0x10f0
jmp 0x25a9
movq 0x8a33(%rip), %rdi      # 0xafd0
leaq 0x4a65(%rip), %rsi      # 0x7009
callq 0x10f0
jmp 0x25ab
jmp 0x25ad
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x2540
movq 0x8a11(%rip), %rdi      # 0xafd0
movq 0x89fa(%rip), %rsi      # 0xafc0
callq 0x1120
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x252f
movq 0x89f0(%rip), %rdi      # 0xafd0
movq 0x89d9(%rip), %rsi      # 0xafc0
callq 0x1120
movl $0x0, -0x10(%rbp)
cmpl $0xa, -0x10(%rbp)
jge 0x2671
movl $0x0, -0x14(%rbp)
cmpl $0x8, -0x14(%rbp)
jge 0x2653
cmpl $0x0, -0x10(%rbp)
je 0x261e
cmpl $0x9, -0x10(%rbp)
je 0x261e
cmpl $0x0, -0x14(%rbp)
je 0x261e
cmpl $0x7, -0x14(%rbp)
jne 0x2633
movq 0x89ab(%rip), %rdi      # 0xafd0
leaq 0x49db(%rip), %rsi      # 0x7007
callq 0x10f0
jmp 0x2646
movq 0x8996(%rip), %rdi      # 0xafd0
leaq 0x49c8(%rip), %rsi      # 0x7009
callq 0x10f0
jmp 0x2648
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2600
movq 0x8976(%rip), %rdi      # 0xafd0
movq 0x895f(%rip), %rsi      # 0xafc0
callq 0x1120
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x25f3
movq 0x8958(%rip), %rdi      # 0xafd0
movq 0x8941(%rip), %rsi      # 0xafc0
callq 0x1120
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: ljc2154[P]Rummy/rummy.cpp
// Function: printTurnCard(int)
void printTurnCard(int v)
{
	char suit = getSuit(v);
	char rank = getRank(v);
	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < 8; j++)
		{
			if (i == 0 || i == 9 || j == 0 || j == 7)
				cout << "*";
			else if ((j == 1 && i == 1) || (j == 6 && i == 8) || (j == 3 && i == 4))
				cout << rank;
			else if ((j == 6 && i == 1) || (j == 1 && i == 8) || (j == 4 && i == 5))
				cout << suit;
			else
				cout << " ";
		}
		cout << endl;
	}
	cout << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %edi
callq 0x2420
movb %al, -0x5(%rbp)
movl -0x4(%rbp), %edi
callq 0x2460
movb %al, -0x6(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0xa, -0xc(%rbp)
jge 0x27b7
movl $0x0, -0x10(%rbp)
cmpl $0x8, -0x10(%rbp)
jge 0x2796
cmpl $0x0, -0xc(%rbp)
je 0x26eb
cmpl $0x9, -0xc(%rbp)
je 0x26eb
cmpl $0x0, -0x10(%rbp)
je 0x26eb
cmpl $0x7, -0x10(%rbp)
jne 0x2703
movq 0x88de(%rip), %rdi      # 0xafd0
leaq 0x490e(%rip), %rsi      # 0x7007
callq 0x10f0
jmp 0x2786
cmpl $0x1, -0x10(%rbp)
jne 0x270f
cmpl $0x1, -0xc(%rbp)
je 0x2727
cmpl $0x6, -0x10(%rbp)
jne 0x271b
cmpl $0x8, -0xc(%rbp)
je 0x2727
cmpl $0x3, -0x10(%rbp)
jne 0x2739
cmpl $0x4, -0xc(%rbp)
jne 0x2739
movq 0x88a2(%rip), %rdi      # 0xafd0
movsbl -0x6(%rbp), %esi
callq 0x1130
jmp 0x2784
cmpl $0x6, -0x10(%rbp)
jne 0x2745
cmpl $0x1, -0xc(%rbp)
je 0x275d
cmpl $0x1, -0x10(%rbp)
jne 0x2751
cmpl $0x8, -0xc(%rbp)
je 0x275d
cmpl $0x4, -0x10(%rbp)
jne 0x276f
cmpl $0x5, -0xc(%rbp)
jne 0x276f
movq 0x886c(%rip), %rdi      # 0xafd0
movsbl -0x5(%rbp), %esi
callq 0x1130
jmp 0x2782
movq 0x885a(%rip), %rdi      # 0xafd0
leaq 0x4888(%rip), %rsi      # 0x7005
callq 0x10f0
jmp 0x2784
jmp 0x2786
jmp 0x2788
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x26c9
movq 0x8833(%rip), %rdi      # 0xafd0
movq 0x881c(%rip), %rsi      # 0xafc0
callq 0x1120
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x26b8
movq 0x8812(%rip), %rdi      # 0xafd0
movq 0x87fb(%rip), %rsi      # 0xafc0
callq 0x1120
addq $0x10, %rsp
popq %rbp
retq
// File: ljc2154[P]Rummy/rummy.cpp
// Function: printHand(std::vector<int, std::allocator<int>>)
void printHand(vector<int> hand)
{
	int size = hand.size();
	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < size; j++)
		{
			char rank = getRank((hand[j]));
			char suit = getSuit((hand[j]));
			for (int k = 0; k < 8; k++)
			{
				if (k == 7)
					cout << "* ";
				else if (i == 0 || i == 9 || k == 0)
					cout << "*";
				else if ((k == 1 && i == 1) || (k == 6 && i == 8) || (k == 3 && i == 4))
					cout << rank;
				else if ((k == 6 && i == 1) || (k == 1 && i == 8) || (k == 4 && i == 5))
					cout << suit;
				else
					cout << " ";
			}
		}
		cout << endl;
	}
	cout << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x28(%rbp)
movq %rdi, -0x8(%rbp)
callq 0x4130
movl %eax, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0xa, -0x10(%rbp)
jge 0x2959
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x2938
movq -0x28(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x4110
movl (%rax), %edi
callq 0x2460
movq -0x28(%rbp), %rdi
movb %al, -0x15(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x4110
movl (%rax), %edi
callq 0x2420
movb %al, -0x16(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x8, -0x1c(%rbp)
jge 0x2928
cmpl $0x7, -0x1c(%rbp)
jne 0x2869
movq 0x8778(%rip), %rdi      # 0xafd0
leaq 0x47a5(%rip), %rsi      # 0x7004
callq 0x10f0
jmp 0x2918
cmpl $0x0, -0x10(%rbp)
je 0x287b
cmpl $0x9, -0x10(%rbp)
je 0x287b
cmpl $0x0, -0x1c(%rbp)
jne 0x2893
movq 0x874e(%rip), %rdi      # 0xafd0
leaq 0x477e(%rip), %rsi      # 0x7007
callq 0x10f0
jmp 0x2916
cmpl $0x1, -0x1c(%rbp)
jne 0x289f
cmpl $0x1, -0x10(%rbp)
je 0x28b7
cmpl $0x6, -0x1c(%rbp)
jne 0x28ab
cmpl $0x8, -0x10(%rbp)
je 0x28b7
cmpl $0x3, -0x1c(%rbp)
jne 0x28c9
cmpl $0x4, -0x10(%rbp)
jne 0x28c9
movq 0x8712(%rip), %rdi      # 0xafd0
movsbl -0x15(%rbp), %esi
callq 0x1130
jmp 0x2914
cmpl $0x6, -0x1c(%rbp)
jne 0x28d5
cmpl $0x1, -0x10(%rbp)
je 0x28ed
cmpl $0x1, -0x1c(%rbp)
jne 0x28e1
cmpl $0x8, -0x10(%rbp)
je 0x28ed
cmpl $0x4, -0x1c(%rbp)
jne 0x28ff
cmpl $0x5, -0x10(%rbp)
jne 0x28ff
movq 0x86dc(%rip), %rdi      # 0xafd0
movsbl -0x16(%rbp), %esi
callq 0x1130
jmp 0x2912
movq 0x86ca(%rip), %rdi      # 0xafd0
leaq 0x46f8(%rip), %rsi      # 0x7005
callq 0x10f0
jmp 0x2914
jmp 0x2916
jmp 0x2918
jmp 0x291a
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2841
jmp 0x292a
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2800
movq 0x8691(%rip), %rdi      # 0xafd0
movq 0x867a(%rip), %rsi      # 0xafc0
callq 0x1120
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x27ef
movq 0x8670(%rip), %rdi      # 0xafd0
movq 0x8659(%rip), %rsi      # 0xafc0
callq 0x1120
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: ljc2154[P]Rummy/rummy.cpp
// Function: merge(std::vector<int, std::allocator<int>>, int, int, int, std::vector<int, std::allocator<int>>&)
void merge(vector<int> integers, int a1, int m, int b2, vector<int> &output)
{
	int a2, b1;
	a2 = b1 = m;
	while (a1 < a2 && b1 < b2)
	{
		if (integers[a1] <= integers[b1])
			output.push_back(integers[a1++]);
		else
			output.push_back(integers[b1++]);
	}

	while (a1 < a2)
		output.push_back(integers[a1++]);
	while (b1 < b2)
		output.push_back(integers[b1++]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x30(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq %r8, -0x20(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x28(%rbp)
movl %eax, -0x24(%rbp)
movl -0xc(%rbp), %ecx
xorl %eax, %eax
cmpl -0x24(%rbp), %ecx
movb %al, -0x31(%rbp)
jge 0x29bf
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
setl %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x29cb
jmp 0x2a51
movq -0x30(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x4110
movq -0x30(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x38(%rbp)
movslq -0x28(%rbp), %rsi
callq 0x4110
movq %rax, %rcx
movl -0x38(%rbp), %eax
cmpl (%rcx), %eax
jg 0x2a21
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rsi
callq 0x4110
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x4170
jmp 0x2a4c
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movl -0x28(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x28(%rbp)
movslq %eax, %rsi
callq 0x4110
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x4170
jmp 0x29a6
jmp 0x2a53
movl -0xc(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x2a88
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
movslq %eax, %rsi
callq 0x4110
movq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0x4170
jmp 0x2a53
jmp 0x2a8a
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x2abf
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x28(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x28(%rbp)
movslq %eax, %rsi
callq 0x4110
movq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x4170
jmp 0x2a8a
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)