LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/riyuu/server/riyuu_server.c
// Function: riyuu_tcp_bind(char*, unsigned short)
void riyuu_tcp_bind(char *addr, uint16_t port)
{
	socklen_t clilen;
	int sockfd, *new_sock_fd;
	struct sockaddr_in serv_addr, cli_addr;
	threadpool thpool;

	sockfd = socket(AF_INET, SOCK_STREAM, 0);

	if (sockfd < 0) {
		perror("Error opening socket");
		exit(1);
	}

	bzero((char *) &serv_addr, sizeof(serv_addr));
	serv_addr.sin_family = AF_INET;
	serv_addr.sin_addr.s_addr = inet_addr(addr);
	serv_addr.sin_port = htons(port);
	if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) {
		perror("Error on binding");
		exit(1);
	}
	listen(sockfd, 5);
	clilen = sizeof(cli_addr);

	printf("Listening on %s:%d...\n", addr, port);

	thpool = thpool_init(5);

	// signal(SIGPIPE, SIG_IGN);

	while (1) {
		new_sock_fd = (int *)malloc(sizeof(int));

		*new_sock_fd = accept(sockfd, (struct sockaddr *)&cli_addr, &clilen);
		if (*new_sock_fd < 0) {
			perror("Error on accept");
		}

		thpool_add_work(thpool, riyuu_thread_worker, (void *)new_sock_fd);
	}

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x21a0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0xae53
leaq 0x1781(%rip), %rdi      # 0xc5c5
callq 0x20e0
movl $0x1, %edi
callq 0x21d0
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x20f0
movw $0x2, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2330
movl %eax, -0x2c(%rbp)
movzwl -0xa(%rbp), %edi
callq 0x21f0
movw %ax, -0x2e(%rbp)
movl -0x14(%rbp), %edi
leaq -0x30(%rbp), %rsi
movl $0x10, %edx
callq 0x22c0
cmpl $0x0, %eax
jge 0xaeae
leaq 0x173b(%rip), %rdi      # 0xc5da
callq 0x20e0
movl $0x1, %edi
callq 0x21d0
movl -0x14(%rbp), %edi
movl $0x5, %esi
callq 0x2320
movl $0x10, -0x10(%rbp)
movq -0x8(%rbp), %rsi
movzwl -0xa(%rbp), %edx
leaq 0x171a(%rip), %rdi      # 0xc5eb
movb $0x0, %al
callq 0x2030
movl $0x5, %edi
callq 0x24e0
movq %rax, -0x48(%rbp)
movl $0x4, %edi
callq 0x2370
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %edi
leaq -0x40(%rbp), %rsi
leaq -0x10(%rbp), %rdx
callq 0x2260
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
jge 0xaf21
leaq 0x16e6(%rip), %rdi      # 0xc602
callq 0x20e0
movq -0x48(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0xa0(%rip), %rsi        # 0xafd0
callq 0x27f0
jmp 0xaee6
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/riyuu/server/riyuu_server.c
// Function: riyuu_socket_setopt(int)
bool riyuu_socket_setopt(int sock_fd)
{
	struct timeval timeout;

	timeout.tv_sec = 30;
	timeout.tv_usec = 0;

	if (setsockopt(sock_fd, SOL_SOCKET, SO_RCVTIMEO, (void *)&timeout, sizeof(timeout)) < 0) {
		perror("setsockopt failed\n");
		return false;
	}

	if (setsockopt(sock_fd, SOL_SOCKET, SO_SNDTIMEO, (void *)&timeout, sizeof(timeout)) < 0) {
		perror("setsockopt failed\n");
		return false;
	}

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq $0x1e, -0x18(%rbp)
movq $0x0, -0x10(%rbp)
movl -0x8(%rbp), %edi
movl $0x1, %esi
movl $0x14, %edx
leaq -0x18(%rbp), %rcx
movl $0x10, %r8d
callq 0x2060
cmpl $0x0, %eax
jge 0xaf8e
leaq 0x15c4(%rip), %rdi      # 0xc547
callq 0x20e0
movb $0x0, -0x1(%rbp)
jmp 0xafc5
movl -0x8(%rbp), %edi
movl $0x1, %esi
movl $0x15, %edx
leaq -0x18(%rbp), %rcx
movl $0x10, %r8d
callq 0x2060
cmpl $0x0, %eax
jge 0xafc1
leaq 0x1591(%rip), %rdi      # 0xc547
callq 0x20e0
movb $0x0, -0x1(%rbp)
jmp 0xafc5
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/riyuu/server/riyuu_server.c
// Function: riyuu_thread_worker(void*)
void *riyuu_thread_worker(void *_fd)
{
	#define sock_fd (*((int *)_fd))

	riyuu_data *req;
	riyuu_data *tmp;
	bool exec_return = false;

	if (!riyuu_socket_setopt(sock_fd)) {
		goto out;
	}

	req = (riyuu_data *)malloc(sizeof(riyuu_data));
	if (req == NULL) {
		printf("Cannot allocate memory!\n");
		goto out;
	}

	printf("A new client connected with fd: %d\n", sock_fd);

	while (1) {
		ssize_t n;

		// Read data size.
		n = read(sock_fd, &(req->data_size), sizeof(uint32_t));
		if (n < 0) {
			perror("Error read");
			break;
		}

		write(sock_fd, "OK", 2);

		PRINTF_DEBUG("Got data length: %d\n", req->data_size);

		// Read data.
		req->data = (char *)malloc(sizeof(char) * req->data_size);

		n = read(sock_fd, req->data, req->data_size);
		if (n < 0) {
			perror("Error read");
			break;
		}
		
		PRINTF_DEBUG("Got data: %s\n", req->data);

		// // Process the request.
		// exec_return = riyuu_exec_request(sock_fd, req);
		// free(req);

		// if (!exec_return) break;
	}

	out:
	close(sock_fd);
	free(_fd);

	#undef sock_fd

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movb $0x0, -0x19(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0xaf40
testb $0x1, %al
jne 0xaff4
jmp 0xb0f8
movl $0x10, %edi
callq 0x2370
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xb01c
leaq 0x154a(%rip), %rdi      # 0xc55a
movb $0x0, %al
callq 0x2030
jmp 0xb0f8
movq -0x8(%rbp), %rax
movl (%rax), %esi
leaq 0x154a(%rip), %rdi      # 0xc573
movb $0x0, %al
callq 0x2030
movq -0x8(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movl $0x4, %edx
callq 0x2220
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jge 0xb060
leaq 0x1541(%rip), %rdi      # 0xc597
callq 0x20e0
jmp 0xb0f6
movq -0x8(%rbp), %rax
movl (%rax), %edi
leaq 0x1479(%rip), %rsi      # 0xc4e6
movl $0x2, %edx
callq 0x22e0
movq -0x10(%rbp), %rax
movl (%rax), %esi
leaq 0x151e(%rip), %rdi      # 0xc5a2
movb $0x0, %al
callq 0x2030
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, %edi
shlq $0x0, %rdi
callq 0x2370
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, %edx
callq 0x2220
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jge 0xb0db
leaq 0x14c3(%rip), %rdi      # 0xc597
callq 0x20e0
jmp 0xb0f6
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x14cd(%rip), %rdi      # 0xc5b7
movb $0x0, %al
callq 0x2030
jmp 0xb030
jmp 0xb0f8
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x2090
movq -0x8(%rbp), %rdi
callq 0x2360
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/ls4154[P]hash-c/sha224_check.c
// Function: main
int main(int argc, char **argv)
{
	int fd = STDIN_FILENO;
	if (argc > 1 && (fd = open(argv[1], O_RDONLY)) < 0) {
		fprintf(stderr, "%s : cannot access '%s'\n", argv[0], argv[1]);
		exit(EXIT_FAILURE);
	}

	struct sha224_ctx ctx;
	sha224_init(&ctx);

	int total = 0;
	int rd = 0;
	while ((rd = read(fd, buffer + total, CHUNK_SIZE - total)) > 0) {
		total += rd;
		if (total >= CHUNK_SIZE) {
			sha224_update(&ctx, buffer);
			total = 0;
		}
	}
	sha224_update_last(&ctx, buffer, total);

	for (int i = 0; i < WORD_CNT - 1; ++i)
		printf("%08x", ctx.h[i]);
	printf("\n");

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x1, -0x8(%rbp)
jle 0x120d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x1080
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jge 0x120d
movq 0x2e15(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
leaq 0xe08(%rip), %rsi       # 0x2004
movb $0x0, %al
callq 0x1060
movl $0x1, %edi
callq 0x1090
leaq -0x40(%rbp), %rdi
callq 0x12d0
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x14(%rbp), %edi
movslq -0x44(%rbp), %rax
leaq 0x2e3e(%rip), %rsi      # 0x4070
addq %rax, %rsi
movl $0x40, %eax
subl -0x44(%rbp), %eax
movslq %eax, %rdx
callq 0x1050
movl %eax, -0x48(%rbp)
cmpl $0x0, %eax
jle 0x1275
movl -0x48(%rbp), %eax
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
cmpl $0x40, -0x44(%rbp)
jl 0x1273
leaq -0x40(%rbp), %rdi
leaq 0x2e09(%rip), %rsi      # 0x4070
callq 0x1340
movl $0x0, -0x44(%rbp)
jmp 0x1224
movslq -0x44(%rbp), %rdx
leaq -0x40(%rbp), %rdi
leaq 0x2dec(%rip), %rsi      # 0x4070
callq 0x1850
movl $0x0, -0x4c(%rbp)
cmpl $0x7, -0x4c(%rbp)
jge 0x12b7
movslq -0x4c(%rbp), %rax
movl -0x40(%rbp,%rax,4), %esi
leaq 0xd78(%rip), %rdi       # 0x201d
movb $0x0, %al
callq 0x1030
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1290
leaq 0xd5d(%rip), %rdi       # 0x201b
movb $0x0, %al
callq 0x1030
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ls4154[P]hash-c/sha224.c
// Function: sha224_init
void sha224_init(struct sha224_ctx *ctx)
{
	ctx->h[0] = 0xc1059ed8;
	ctx->h[1] = 0x367cd507;
	ctx->h[2] = 0x3070dd17;
	ctx->h[3] = 0xf70e5939;
	ctx->h[4] = 0xffc00b31;
	ctx->h[5] = 0x68581511;
	ctx->h[6] = 0x64f98fa7;
	ctx->h[7] = 0xbefa4fa4;

	ctx->len = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0xc1059ed8, (%rax)     # imm = 0xC1059ED8
movq -0x8(%rbp), %rax
movl $0x367cd507, 0x4(%rax)  # imm = 0x367CD507
movq -0x8(%rbp), %rax
movl $0x3070dd17, 0x8(%rax)  # imm = 0x3070DD17
movq -0x8(%rbp), %rax
movl $0xf70e5939, 0xc(%rax)  # imm = 0xF70E5939
movq -0x8(%rbp), %rax
movl $0xffc00b31, 0x10(%rax) # imm = 0xFFC00B31
movq -0x8(%rbp), %rax
movl $0x68581511, 0x14(%rax) # imm = 0x68581511
movq -0x8(%rbp), %rax
movl $0x64f98fa7, 0x18(%rax) # imm = 0x64F98FA7
movq -0x8(%rbp), %rax
movl $0xbefa4fa4, 0x1c(%rax) # imm = 0xBEFA4FA4
movq -0x8(%rbp), %rax
movq $0x0, 0x20(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ls4154[P]hash-c/sha224.c
// Function: sha224_update_last
void sha224_update_last(struct sha224_ctx *ctx, byte_t *chunk, len_t len)
{
	ctx->len += len;
	len_t bit_len = ctx->len * 8;

	byte_t padding[64];
	memset(padding, 0, sizeof(padding));

	memcpy(padding, chunk, len);
	*(padding + len) = 0x80;

	if (len >= 56) {
		_sha224_iterate(ctx, padding);
		memset(padding, 0, sizeof(padding));
	}

	byte_t *ptr = padding + 56;
	for (int i = 7; i >= 0; --i) {
		*ptr = (bit_len >> 8 * i) & 0xFF;
		++ptr;
	}
	_sha224_iterate(ctx, padding);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
addq 0x20(%rax), %rcx
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
shlq $0x3, %rax
movq %rax, -0x20(%rbp)
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x1040
leaq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x1070
movq -0x18(%rbp), %rax
movb $-0x80, -0x60(%rbp,%rax)
cmpq $0x38, -0x18(%rbp)
jb 0x18d2
movq -0x8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x1380
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x1040
leaq -0x60(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x68(%rbp)
movl $0x7, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
jl 0x191f
movq -0x20(%rbp), %rax
movl -0x6c(%rbp), %ecx
shll $0x3, %ecx
movl %ecx, %ecx
shrq %cl, %rax
andq $0xff, %rax
movb %al, %cl
movq -0x68(%rbp), %rax
movb %cl, (%rax)
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
movl -0x6c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x18e5
movq -0x8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x1380
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ls4154[P]hash-c/sha224.c
// Function: sha224_offline
void sha224_offline(struct sha224_ctx *ctx, byte_t *msg, len_t len)
{
	sha224_init(ctx);

	while (len >= 64) {
		sha224_update(ctx, msg);

		msg += 64;
		len -= 64;
	}

	sha224_update_last(ctx, msg, len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x12d0
cmpq $0x40, -0x18(%rbp)
jb 0x198b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1340
movq -0x10(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
subq $0x40, %rax
movq %rax, -0x18(%rbp)
jmp 0x195d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x1850
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/audio.c
// Function: AUD_init
void AUD_init(Audio* audio, int sampleRate) {
    SDL_Init(SDL_INIT_AUDIO);

    audio->sampleRate = sampleRate;
    for (int i = 0; i < 4; ++i) {
        AudioChannel channel;
        channel.frequency = 0.0;
        channel.amplitude = 4400.0;
        channel.time = 0.0;
        audio->channels[i] = channel;
    }

    SDL_AudioSpec want;
    want.freq = audio->sampleRate;
    want.format = AUDIO_S16SYS;
    want.channels = 1;
    want.samples = 2048;
    want.callback = audioCallback;
    want.userdata = audio;

    SDL_AudioSpec have;
    //SDL_OpenAudio(&want, &have);
    audio->deviceId = SDL_OpenAudioDevice(NULL, 0, &want, &have, SDL_AUDIO_ALLOW_ANY_CHANGE);

    SDL_PauseAudioDevice(audio->deviceId, false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x10, %edi
callq 0x2150
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movl $0x0, -0x10(%rbp)
cmpl $0x4, -0x10(%rbp)
jge 0x240a
xorps %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0xbc48(%rip), %xmm0     # 0xe008
movsd %xmm0, -0x28(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
addq $0x8, %rax
movslq -0x10(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x18(%rax)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x23aa
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x50(%rbp)
movw $0x8010, -0x4c(%rbp)    # imm = 0x8010
movb $0x1, -0x4a(%rbp)
movw $0x800, -0x48(%rbp)     # imm = 0x800
leaq 0x45(%rip), %rax        # 0x2470
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
xorl %eax, %eax
movl %eax, %edi
xorl %esi, %esi
leaq -0x50(%rbp), %rdx
leaq -0x70(%rbp), %rcx
movl $0xf, %r8d
callq 0x21e0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movl (%rax), %edi
xorl %esi, %esi
callq 0x2200
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/audio.c
// Function: audioCallback
void audioCallback(void *user_data, uint8_t *raw_buffer, int bytes) {
    Audio* audio = user_data;
    int16_t* snd = (int16_t*) raw_buffer;
	int len = bytes / sizeof(*snd);

    for (int i = 0; i < len; ++i) {
        snd[i] = 0;

        for (int j = 0; j < 3; ++j) {
            AudioChannel* channel = &(audio->channels[j]);
            double sine = sin(channel->time);
            double ampMultiplier = (sine > 0) - (sine < 0);
            snd[i] += (channel->amplitude * ampMultiplier) / 3;

            channel->time += channel->frequency * 2.0f * M_PI / audio->sampleRate;
            if (channel->time >= (2.0f * M_PI)) channel->time -= (2.0f * M_PI);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movslq -0x14(%rbp), %rax
shrq %rax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x25e3
movq -0x28(%rbp), %rax
movslq -0x30(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movl $0x0, -0x34(%rbp)
cmpl $0x3, -0x34(%rbp)
jge 0x25d3
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
shlq $0x5, %rcx
leaq 0x8(%rax,%rcx), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movsd 0x10(%rax), %xmm0
callq 0x2090
movsd %xmm0, -0x48(%rbp)
movsd -0x48(%rbp), %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm0, %xmm1
seta %al
movzbl %al, %eax
ucomisd %xmm1, %xmm0
seta %cl
movzbl %cl, %ecx
subl %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x40(%rbp), %rax
movsd 0x8(%rax), %xmm1
movsd -0x50(%rbp), %xmm0
mulsd %xmm0, %xmm1
movsd 0xbaf0(%rip), %xmm0     # 0xe028
divsd %xmm0, %xmm1
movq -0x28(%rbp), %rax
movslq -0x30(%rbp), %rdx
movq %rdx, %rcx
movswl (%rax,%rdx,2), %edx
cvtsi2sd %edx, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %edx
movw %dx, (%rax,%rcx,2)
movq -0x40(%rbp), %rax
movsd 0xbab9(%rip), %xmm0     # 0xe020
mulsd (%rax), %xmm0
movsd 0xbaa5(%rip), %xmm1     # 0xe018
mulsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
cvtsi2sdl 0x4(%rax), %xmm1
divsd %xmm1, %xmm0
movq -0x40(%rbp), %rax
addsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rax)
movq -0x40(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd 0xba6d(%rip), %xmm1     # 0xe010
ucomisd %xmm1, %xmm0
jb 0x25c3
movq -0x40(%rbp), %rax
movsd 0x10(%rax), %xmm0
movsd 0xba56(%rip), %xmm1     # 0xe010
subsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rax)
jmp 0x25c5
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x24c5
jmp 0x25d5
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x24a4
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/audio.c
// Function: AUD_destroy
void AUD_destroy(Audio* audio) {
    SDL_PauseAudioDevice(audio->deviceId, true);
    SDL_AudioQuit();
    free(audio);
    audio = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edi
movl $0x1, %esi
callq 0x2200
callq 0x2270
movq -0x8(%rbp), %rdi
callq 0x21c0
movq $0x0, -0x8(%rbp)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/audio.c
// Function: AUD_update
void AUD_update(Audio* audio, Memory* mem) {
    unsigned int x;

    x = ((mem->logicalMemory[REG_NR14] & 0x7) << 8) | mem->logicalMemory[REG_NR13];
    audio->channels[0].frequency = 131072.0 / (2048.0 - x);
    if (audio->channels[0].frequency < 100.0) audio->channels[0].frequency = 0.0;

    x = ((mem->logicalMemory[REG_NR24] & 0x7) << 8) | mem->logicalMemory[REG_NR23];
    audio->channels[1].frequency = 131072.0 / (2048.0 - x);
    if (audio->channels[1].frequency < 100.0) audio->channels[1].frequency = 0.0;

    x = ((mem->logicalMemory[REG_NR34] & 0x7) << 8) | mem->logicalMemory[REG_NR33];
    audio->channels[2].frequency = getBit(mem->logicalMemory[REG_NR30], 7) ? (65536.0 / (2048.0 - x)) : 0.0;
    if (audio->channels[0].frequency < 100.0) audio->channels[0].frequency = 0.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movzbl 0xff14(%rcx), %eax
andl $0x7, %eax
shll $0x8, %eax
movzbl 0xff13(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0xb9d3(%rip), %xmm1     # 0xe040
subsd %xmm0, %xmm1
movsd 0xb9bf(%rip), %xmm0     # 0xe038
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movq -0x8(%rbp), %rax
movsd 0xb99e(%rip), %xmm0     # 0xe030
ucomisd 0x8(%rax), %xmm0
jbe 0x26a5
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rax)
movq -0x10(%rbp), %rcx
movzbl 0xff19(%rcx), %eax
andl $0x7, %eax
shll $0x8, %eax
movzbl 0xff18(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0xb96e(%rip), %xmm1     # 0xe040
subsd %xmm0, %xmm1
movsd 0xb95a(%rip), %xmm0     # 0xe038
divsd %xmm1, %xmm0
movq -0x8(%rbp), %rax
movsd %xmm0, 0x28(%rax)
movq -0x8(%rbp), %rax
movsd 0xb939(%rip), %xmm0     # 0xe030
ucomisd 0x28(%rax), %xmm0
jbe 0x270a
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x28(%rax)
movq -0x10(%rbp), %rax
movzbl 0xff1e(%rax), %eax
andl $0x7, %eax
shll $0x8, %eax
movq -0x10(%rbp), %rcx
movzbl 0xff1d(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl $0x7, %esi
movzbl 0xff1a(%rax), %edi
callq 0x27b0
movzbl %al, %eax
cmpl $0x0, %eax
je 0x276f
movl -0x14(%rbp), %eax
cvtsi2sd %rax, %xmm0
movsd 0xb8e8(%rip), %xmm1     # 0xe040
subsd %xmm0, %xmm1
movsd 0xb8e4(%rip), %xmm0     # 0xe048
divsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x2779
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x2779
movsd -0x20(%rbp), %xmm0
movq -0x8(%rbp), %rax
movsd %xmm0, 0x48(%rax)
movq -0x8(%rbp), %rax
movsd 0xb89d(%rip), %xmm0     # 0xe030
ucomisd 0x8(%rax), %xmm0
jbe 0x27a6
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/cartridge.c
// Function: CART_init
void CART_init(Cartridge* cart, Memory* mem) {
    // Set header data
    memcpy(cart->title, mem->romBanks + 0x0134, 16);
    cart->title[16] = '\0';
    cart->type = mem->romBanks[0x0147];
    cart->romSize = mem->romBanks[0x0148];
    cart->ramSize = mem->romBanks[0x0149];

    // Set default register values (usually 0)
    cart->RAMG = 0;
    cart->BANK1 = 1;
    cart->BANK2 = 0;
    cart->MODE = 0;
    cart->ROMB = 0;
    cart->ROMB0 = 0;
    cart->ROMB1 = 0;
    cart->RAMB = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10018(%rcx), %rcx
movq 0x134(%rcx), %rdx
movq %rdx, (%rax)
movq 0x13c(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x10018(%rax), %rax
movb 0x147(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x11(%rax)
movq -0x10(%rbp), %rax
movq 0x10018(%rax), %rax
movb 0x148(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x12(%rax)
movq -0x10(%rbp), %rax
movq 0x10018(%rax), %rax
movb 0x149(%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x13(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x14(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x15(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x16(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x17(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x19(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x1a(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x1b(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/cartridge.c
// Function: MBC1
static void MBC1(Memory* mem, uint16_t address, uint8_t value) {
    Cartridge* cart = mem->cartridge;

    if (address <= 0x1FFF) {
        cart->RAMG = value & 0xF;
        mem->extRamEnabled = (cart->RAMG == 0xA);

    } else if (address <= 0x3FFF) {
        cart->BANK1 = value & 0x1F;
        if (cart->BANK1 == 0x00) cart->BANK1 = 0x01;
        if (cart->MODE == 0) {
            MEM_setRomBank(mem, (cart->BANK2 << 5) | cart->BANK1);
        } else {
            MEM_setRomBank(mem, cart->BANK1);
        }

    } else if (address <= 0x5FFF) {
        cart->BANK2 = value & 0x3;
        if (cart->MODE == 0) {
            MEM_setRomBank(mem, (cart->BANK2 << 5) | cart->BANK1);
        } else {
            MEM_setRamBank(mem, cart->BANK2);
        }

    } else if (address <= 0x7FFF) {
        cart->MODE = value & 0x1;

    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dl, %al
movw %si, %cx
movq %rdi, -0x8(%rbp)
movw %cx, -0xa(%rbp)
movb %al, -0xb(%rbp)
movq -0x8(%rbp), %rax
movq 0x10038(%rax), %rax
movq %rax, -0x18(%rbp)
movzwl -0xa(%rbp), %eax
cmpl $0x1fff, %eax           # imm = 0x1FFF
jg 0x2932
movzbl -0xb(%rbp), %eax
andl $0xf, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x14(%rax)
movq -0x18(%rbp), %rax
movzbl 0x14(%rax), %eax
cmpl $0xa, %eax
sete %cl
movq -0x8(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x10034(%rax)
jmp 0x2a24
movzwl -0xa(%rbp), %eax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0x29a5
movzbl -0xb(%rbp), %eax
andl $0x1f, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x15(%rax)
movq -0x18(%rbp), %rax
movzbl 0x15(%rax), %eax
cmpl $0x0, %eax
jne 0x2962
movq -0x18(%rbp), %rax
movb $0x1, 0x15(%rax)
movq -0x18(%rbp), %rax
movzbl 0x17(%rax), %eax
cmpl $0x0, %eax
jne 0x2992
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movzbl 0x16(%rax), %eax
shll $0x5, %eax
movq -0x18(%rbp), %rcx
movzbl 0x15(%rcx), %ecx
orl %ecx, %eax
movzbl %al, %esi
callq 0xd4a0
jmp 0x29a3
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movzbl 0x15(%rax), %esi
callq 0xd4a0
jmp 0x2a22
movzwl -0xa(%rbp), %eax
cmpl $0x5fff, %eax           # imm = 0x5FFF
jg 0x2a03
movzbl -0xb(%rbp), %eax
andl $0x3, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x16(%rax)
movq -0x18(%rbp), %rax
movzbl 0x17(%rax), %eax
cmpl $0x0, %eax
jne 0x29f0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movzbl 0x16(%rax), %eax
shll $0x5, %eax
movq -0x18(%rbp), %rcx
movzbl 0x15(%rcx), %ecx
orl %ecx, %eax
movzbl %al, %esi
callq 0xd4a0
jmp 0x2a01
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movzbl 0x16(%rax), %esi
callq 0xd580
jmp 0x2a20
movzwl -0xa(%rbp), %eax
cmpl $0x7fff, %eax           # imm = 0x7FFF
jg 0x2a1e
movzbl -0xb(%rbp), %eax
andl $0x1, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x17(%rax)
jmp 0x2a20
jmp 0x2a22
jmp 0x2a24
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/cartridge.c
// Function: MBC3
static void MBC3(Memory* mem, uint16_t address, uint8_t value) {
    //unimplemented(MEM_getByte(mem, 0x0147)); // TODO: MBC3
    Cartridge* cart = mem->cartridge;

    if (address <= 0x1FFF) {
        cart->RAMG = value & 0xF;
        mem->extRamEnabled = (cart->RAMG == 0xA);

    } else if (address <= 0x3FFF) {
        cart->ROMB = value & 0x7F;
        if (cart->ROMB == 0) cart->ROMB = 1;
        MEM_setRomBank(mem, cart->ROMB);

    } else if (address <= 0x5FFF) {

    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dl, %al
movw %si, %cx
movq %rdi, -0x8(%rbp)
movw %cx, -0xa(%rbp)
movb %al, -0xb(%rbp)
movq -0x8(%rbp), %rax
movq 0x10038(%rax), %rax
movq %rax, -0x18(%rbp)
movzwl -0xa(%rbp), %eax
cmpl $0x1fff, %eax           # imm = 0x1FFF
jg 0x2d4f
movzbl -0xb(%rbp), %eax
andl $0xf, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x14(%rax)
movq -0x18(%rbp), %rax
movzbl 0x14(%rax), %eax
cmpl $0xa, %eax
sete %cl
movq -0x8(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x10034(%rax)
jmp 0x2da3
movzwl -0xa(%rbp), %eax
cmpl $0x3fff, %eax           # imm = 0x3FFF
jg 0x2d92
movzbl -0xb(%rbp), %eax
andl $0x7f, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x18(%rax)
movq -0x18(%rbp), %rax
movzbl 0x18(%rax), %eax
cmpl $0x0, %eax
jne 0x2d7f
movq -0x18(%rbp), %rax
movb $0x1, 0x18(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movzbl 0x18(%rax), %esi
callq 0xd4a0
jmp 0x2da1
movzwl -0xa(%rbp), %eax
cmpl $0x5fff, %eax           # imm = 0x5FFF
jg 0x2d9f
jmp 0x2d9f
jmp 0x2da1
jmp 0x2da3
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/cartridge.c
// Function: CART_mbcDispatch
void CART_mbcDispatch(Memory* mem, uint16_t address, uint8_t value) {
    uint8_t mbcCode = MEM_getByte(mem, 0x0147);
    void (*mbcFunction)(Memory*, uint16_t, uint8_t) = MBC_MAP[mbcCode];
    if (mbcFunction == NULL) {
        printf("Undefined MBC: 0x%x\n", mbcCode);
    } else {
        mbcFunction(mem, address, value);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dl, %al
movw %si, %cx
movq %rdi, -0x8(%rbp)
movw %cx, -0xa(%rbp)
movb %al, -0xb(%rbp)
movq -0x8(%rbp), %rdi
movl $0x147, %esi            # imm = 0x147
callq 0xcd50
movb %al, -0xc(%rbp)
movzbl -0xc(%rbp), %eax
movl %eax, %ecx
leaq 0xf0ea(%rip), %rax      # 0x12150
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3089
movzbl -0xc(%rbp), %esi
leaq 0xafd0(%rip), %rdi      # 0xe050
movb $0x0, %al
callq 0x2050
jmp 0x309e
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rdi
movw -0xa(%rbp), %cx
movzwl %cx, %esi
movzbl -0xb(%rbp), %edx
callq *%rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/cpu.c
// Function: CPU_init
void CPU_init(CPU* cpu) {
    // Init everything
    cpu->A = 0x01; cpu->F = 0xB0;
    cpu->B = 0x00; cpu->C = 0x13;
    cpu->D = 0x00; cpu->E = 0xD8;
    cpu->H = 0x01; cpu->L = 0x4D;
    /*cpu->A = 0x11; cpu->F = 0x80;
    cpu->B = 0x00; cpu->C = 0x00;
    cpu->D = 0xFF; cpu->E = 0x56;
    cpu->H = 0x00; cpu->L = 0x0D;*/
    cpu->SP = 0xFFFE;
    cpu->PC = 0x100; // address where code starts
    cpu->IME = 0;
    cpu->opcode = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb $0x1, 0x3(%rax)
movq -0x8(%rbp), %rax
movb $-0x50, 0x2(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x5(%rax)
movq -0x8(%rbp), %rax
movb $0x13, 0x4(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x7(%rax)
movq -0x8(%rbp), %rax
movb $-0x28, 0x6(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x9(%rax)
movq -0x8(%rbp), %rax
movb $0x4d, 0x8(%rax)
movq -0x8(%rbp), %rax
movw $0xfffe, 0xa(%rax)      # imm = 0xFFFE
movq -0x8(%rbp), %rax
movw $0x100, 0xc(%rax)       # imm = 0x100
movq -0x8(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_INC_n
static inline void ASM_INC_n(CPU* cpu, uint8_t* reg) {
    uint8_t result = *reg + 1;
    CPU_setFlagZ(cpu, result == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, (*reg & 0x10) != (result & 0x10));
    *reg = result;
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
addl $0x1, %eax
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x31d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
andl $0x10, %eax
movzbl -0x11(%rbp), %ecx
andl $0x10, %ecx
cmpl %ecx, %eax
setne %al
andb $0x1, %al
movzbl %al, %esi
callq 0x32a0
movb -0x11(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x1, %ecx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_DEC_n
static inline void ASM_DEC_n(CPU* cpu, uint8_t* reg) {
    uint8_t result = *reg - 1;
    CPU_setFlagZ(cpu, result == 0);
    CPU_setFlagN(cpu, 1);
    CPU_setFlagH(cpu, (*reg & 0x10) != (result & 0x10));
    *reg = result;
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
subl $0x1, %eax
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x31d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
andl $0x10, %eax
movzbl -0x11(%rbp), %ecx
andl $0x10, %ecx
cmpl %ecx, %eax
setne %al
andb $0x1, %al
movzbl %al, %esi
callq 0x32a0
movb -0x11(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x1, %ecx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_RLCA
static inline void ASM_RLCA(CPU* cpu) {
    uint8_t bit7 = getBit(cpu->A, 7);
    cpu->A = (cpu->A << 1) | bit7;
    CPU_setFlagZ(cpu, 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, (int) bit7);
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x7, %esi
movzbl 0x3(%rax), %edi
callq 0x3120
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %eax
shll %eax
movzbl -0x9(%rbp), %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x31d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x32a0
movq -0x8(%rbp), %rdi
movzbl -0x9(%rbp), %esi
callq 0x32e0
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x1, %ecx
movw %cx, 0xc(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_LD_nn_SP
static inline void ASM_LD_nn_SP(CPU* cpu, Memory* mem) {
    //cpu->SP = (MEM_getByte(mem, cpu->PC + 2) << 8) | MEM_getByte(mem, cpu->PC + 1);
    uint16_t address = (MEM_getByte(mem, cpu->PC + 2) << 8) | MEM_getByte(mem, cpu->PC + 1);
    MEM_setByte(mem, address, cpu->SP & 0xFF);
    MEM_setByte(mem, address + 1, (cpu->SP & 0xFF00) >> 8);
    cpu->PC += 3;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %eax
addl $0x2, %eax
movzwl %ax, %esi
callq 0xcd50
movzbl %al, %eax
shll $0x8, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %eax
addl $0x1, %eax
movzwl %ax, %esi
callq 0xcd50
movb %al, %cl
movl -0x18(%rbp), %eax
movzbl %cl, %ecx
orl %ecx, %eax
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rdi
movw -0x12(%rbp), %cx
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0xff, %eax
movzwl %cx, %esi
movzbl %al, %edx
callq 0xce30
movq -0x10(%rbp), %rdi
movzwl -0x12(%rbp), %eax
addl $0x1, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movzwl %cx, %esi
movzbl %al, %edx
callq 0xce30
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x3, %ecx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_ADD_HL_n
static inline void ASM_ADD_HL_n(CPU* cpu, uint16_t* reg) {
    uint16_t result = cpu->HL + *reg;
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, ((cpu->HL ^ *reg ^ (result & 0xFFFF)) & 0x1000) != 0);
    CPU_setFlagC(cpu, result < cpu->HL);
    cpu->HL = result;
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
movzwl (%rcx), %ecx
addl %ecx, %eax
movw %ax, -0x12(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
movzwl (%rcx), %ecx
xorl %ecx, %eax
movzwl -0x12(%rbp), %ecx
andl $0xffff, %ecx           # imm = 0xFFFF
xorl %ecx, %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %esi
callq 0x32a0
movq -0x8(%rbp), %rdi
movzwl -0x12(%rbp), %eax
movq -0x8(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
cmpl %ecx, %eax
setl %al
andb $0x1, %al
movzbl %al, %esi
callq 0x32e0
movw -0x12(%rbp), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x1, %ecx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_JP_cc_nn
static inline int ASM_JP_cc_nn(CPU* cpu, Memory* mem, int ccCode) {
    int cond = 0;
    switch (ccCode) {
        case PARAM_CC_Z:
            cond = CPU_getFlagZ(cpu);
            break;
        case PARAM_CC_NZ:
            cond = !CPU_getFlagZ(cpu);
            break;
        case PARAM_CC_C:
            cond = CPU_getFlagC(cpu);
            break;
        case PARAM_CC_NC:
            cond = !CPU_getFlagC(cpu);
            break;
    }
    if (cond) {
        cpu->PC = (MEM_getByte(mem, cpu->PC + 2) << 8) | MEM_getByte(mem, cpu->PC + 1);
        return 1;
    } else {
        cpu->PC += 3;
        return 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x1c(%rbp), %eax
addl $-0x64, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x3, %eax
ja 0x84ef
movq -0x28(%rbp), %rax
leaq 0x63ea(%rip), %rcx      # 0xe880
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
callq 0x30f0
movl %eax, -0x20(%rbp)
jmp 0x84ef
movq -0x10(%rbp), %rdi
callq 0x30f0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x20(%rbp)
jmp 0x84ef
movq -0x10(%rbp), %rdi
callq 0x31a0
movl %eax, -0x20(%rbp)
jmp 0x84ef
movq -0x10(%rbp), %rdi
callq 0x31a0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x854a
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl 0xc(%rax), %eax
addl $0x2, %eax
movzwl %ax, %esi
callq 0xcd50
movzbl %al, %eax
shll $0x8, %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl 0xc(%rax), %eax
addl $0x1, %eax
movzwl %ax, %esi
callq 0xcd50
movb %al, %cl
movl -0x2c(%rbp), %eax
movzbl %cl, %ecx
orl %ecx, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0xc(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x8560
movq -0x10(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x3, %ecx
movw %cx, 0xc(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_RRCA
static inline void ASM_RRCA(CPU* cpu) {
    uint8_t bit0 = cpu->A & 1;
    cpu->A = (cpu->A >> 1) | (bit0 << 7);
    CPU_setFlagZ(cpu, 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, (int) bit0);
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %eax
andl $0x1, %eax
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %eax
sarl %eax
movzbl -0x9(%rbp), %ecx
shll $0x7, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x31d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x32a0
movq -0x8(%rbp), %rdi
movzbl -0x9(%rbp), %esi
callq 0x32e0
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x1, %ecx
movw %cx, 0xc(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_RLA
static inline void ASM_RLA(CPU* cpu) {
    uint8_t bit7 = getBit(cpu->A, 7);
    cpu->A = (cpu->A << 1) | (uint8_t) CPU_getFlagC(cpu);
    CPU_setFlagZ(cpu, 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, (int) bit7);
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x7, %esi
movzbl 0x3(%rax), %edi
callq 0x3120
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %eax
shll %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x31a0
movl %eax, %ecx
movl -0x10(%rbp), %eax
movzbl %cl, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x31d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x32a0
movq -0x8(%rbp), %rdi
movzbl -0x9(%rbp), %esi
callq 0x32e0
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x1, %ecx
movw %cx, 0xc(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_RRA
static inline void ASM_RRA(CPU* cpu) {
    uint8_t bit0 = cpu->A & 1;
    cpu->A = (cpu->A >> 1) | (CPU_getFlagC(cpu) << 7);
    CPU_setFlagZ(cpu, 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, 0);
    CPU_setFlagC(cpu, (int) bit0);
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %eax
andl $0x1, %eax
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %eax
sarl %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x31a0
movl %eax, %ecx
movl -0x10(%rbp), %eax
shll $0x7, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x31d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x32a0
movq -0x8(%rbp), %rdi
movzbl -0x9(%rbp), %esi
callq 0x32e0
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x1, %ecx
movw %cx, 0xc(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_JR_cc_n
static inline int ASM_JR_cc_n(CPU* cpu, Memory* mem, int ccCode) {
    int cond = 0;
    switch (ccCode) {
        case PARAM_CC_Z:
            cond = CPU_getFlagZ(cpu);
            break;
        case PARAM_CC_NZ:
            cond = !CPU_getFlagZ(cpu);
            break;
        case PARAM_CC_C:
            cond = CPU_getFlagC(cpu);
            break;
        case PARAM_CC_NC:
            cond = !CPU_getFlagC(cpu);
            break;
    }
    if (cond) {
        cpu->PC += ((int8_t) MEM_getByte(mem, cpu->PC + 1)) + 2;
        return 1;
    } else {
        cpu->PC += 2;
        return 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x1c(%rbp), %eax
addl $-0x64, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x3, %eax
ja 0x87ef
movq -0x28(%rbp), %rax
leaq 0x60fa(%rip), %rcx      # 0xe890
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
callq 0x30f0
movl %eax, -0x20(%rbp)
jmp 0x87ef
movq -0x10(%rbp), %rdi
callq 0x30f0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x20(%rbp)
jmp 0x87ef
movq -0x10(%rbp), %rdi
callq 0x31a0
movl %eax, -0x20(%rbp)
jmp 0x87ef
movq -0x10(%rbp), %rdi
callq 0x31a0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x8829
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl 0xc(%rax), %eax
addl $0x1, %eax
movzwl %ax, %esi
callq 0xcd50
movsbl %al, %edx
addl $0x2, %edx
movq -0x10(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl %edx, %ecx
movw %cx, 0xc(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x883f
movq -0x10(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0xc(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_LDI_HL_A
static inline void ASM_LDI_HL_A(CPU* cpu, Memory* mem) {
    uint16_t address = (cpu->H << 8) | cpu->L;
    MEM_setByte(mem, address, cpu->A);
    ++address;
    cpu->H = (address & 0xFF00) >> 8;
    cpu->L = address & 0x00FF;
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x9(%rax), %eax
shll $0x8, %eax
movq -0x8(%rbp), %rcx
movzbl 0x8(%rcx), %ecx
orl %ecx, %eax
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rdi
movw -0x12(%rbp), %cx
movq -0x8(%rbp), %rax
movzwl %cx, %esi
movzbl 0x3(%rax), %edx
callq 0xce30
movw -0x12(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x12(%rbp)
movzwl -0x12(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x9(%rax)
movzwl -0x12(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x1, %ecx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_DAA
static inline void ASM_DAA(CPU* cpu) {
    if (!CPU_getFlagN(cpu)) {  // after an addition, adjust if (half-)carry occurred or if result is out of bounds
        if (CPU_getFlagC(cpu) || cpu->A > 0x99) { cpu->A += 0x60; CPU_setFlagC(cpu, 1); }
        if (CPU_getFlagH(cpu) || (cpu->A & 0x0f) > 0x09) { cpu->A += 0x6; }
    } else {  // after a subtraction, only adjust if (half-)carry occurred
        if (CPU_getFlagC(cpu)) { cpu->A -= 0x60; }
        if (CPU_getFlagH(cpu)) { cpu->A -= 0x6; }
    }
    CPU_setFlagZ(cpu, cpu->A == 0);
    CPU_setFlagH(cpu, 0);
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3140
cmpl $0x0, %eax
jne 0x89b1
movq -0x8(%rbp), %rdi
callq 0x31a0
cmpl $0x0, %eax
jne 0x8967
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %eax
cmpl $0x99, %eax
jle 0x8983
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %ecx
addl $0x60, %ecx
movb %cl, 0x3(%rax)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x32e0
movq -0x8(%rbp), %rdi
callq 0x3170
cmpl $0x0, %eax
jne 0x89a1
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %eax
andl $0xf, %eax
cmpl $0x9, %eax
jle 0x89af
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %ecx
addl $0x6, %ecx
movb %cl, 0x3(%rax)
jmp 0x89eb
movq -0x8(%rbp), %rdi
callq 0x31a0
cmpl $0x0, %eax
je 0x89cd
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %ecx
subl $0x60, %ecx
movb %cl, 0x3(%rax)
movq -0x8(%rbp), %rdi
callq 0x3170
cmpl $0x0, %eax
je 0x89e9
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %ecx
subl $0x6, %ecx
movb %cl, 0x3(%rax)
jmp 0x89eb
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x31d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x32a0
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x1, %ecx
movw %cx, 0xc(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_LDI_A_HL
static inline void ASM_LDI_A_HL(CPU* cpu, Memory* mem) {
    uint16_t address = (cpu->H << 8) | cpu->L;
    cpu->A = MEM_getByte(mem, address);
    ++address;
    cpu->H = (address & 0xFF00) >> 8;
    cpu->L = address & 0x00FF;
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x9(%rax), %eax
shll $0x8, %eax
movq -0x8(%rbp), %rcx
movzbl 0x8(%rcx), %ecx
orl %ecx, %eax
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rdi
movzwl -0x12(%rbp), %esi
callq 0xcd50
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x3(%rax)
movw -0x12(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x12(%rbp)
movzwl -0x12(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x9(%rax)
movzwl -0x12(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x1, %ecx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_CPL
static inline void ASM_CPL(CPU* cpu) {
    cpu->A = ~(cpu->A);
    CPU_setFlagN(cpu, 1);
    CPU_setFlagH(cpu, 1);
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %eax
xorl $-0x1, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x32a0
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x1, %ecx
movw %cx, 0xc(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/qad114[P]yobeboy/src/asm.h
// Function: ASM_INC_m
static inline void ASM_INC_m(CPU* cpu, Memory* mem, uint16_t address) {
    uint8_t result = MEM_getByte(mem, address) + 1;
    CPU_setFlagZ(cpu, result == 0);
    CPU_setFlagN(cpu, 0);
    CPU_setFlagH(cpu, (MEM_getByte(mem, address) & 0x10) != (result & 0x10));
    MEM_setByte(mem, address, result);
    cpu->PC += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %dx, %ax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rdi
movzwl -0x12(%rbp), %esi
callq 0xcd50
movzbl %al, %eax
addl $0x1, %eax
movb %al, -0x13(%rbp)
movq -0x8(%rbp), %rdi
movzbl -0x13(%rbp), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x31d0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x3260
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movzwl -0x12(%rbp), %esi
callq 0xcd50
movq -0x20(%rbp), %rdi
movzbl %al, %eax
andl $0x10, %eax
movzbl -0x13(%rbp), %ecx
andl $0x10, %ecx
cmpl %ecx, %eax
setne %al
andb $0x1, %al
movzbl %al, %esi
callq 0x32a0
movq -0x10(%rbp), %rdi
movw -0x12(%rbp), %ax
movzwl %ax, %esi
movzbl -0x13(%rbp), %edx
callq 0xce30
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
addl $0x1, %ecx
movw %cx, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nop