LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/bios.c
// Function: BIOS_StrNCmp
int32_t BIOS_StrNCmp(uint32_t str1,uint32_t str2,uint32_t maxlen)
{
	uint32_t i = 0;
	while (i < maxlen)
	{
		int8_t c1 = EMU_ReadS8(str1 + i);
		int8_t c2 = EMU_ReadS8(str2 + i);
		if (c1 != c2)
			return c1 - c2;
		else if (c1 == 0)
			return 0;
		i++;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movl %esi, %r14d
movl %edi, %r15d
xorl %ebx, %ebx
subl $0x1, %ebp
jb 0x134814
movl %r15d, %edi
callq 0x135394
movl %eax, %r12d
movl %r14d, %edi
callq 0x135394
cmpb %al, %r12b
jne 0x13480b
incl %r15d
incl %r14d
testb %r12b, %r12b
jne 0x1347e1
jmp 0x134814
movsbl %r12b, %ebx
movsbl %al, %eax
subl %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/bios.c
// Function: BIOS_StrCpy
uint32_t BIOS_StrCpy(uint32_t dest,uint32_t src)
{
	uint32_t i = 0;
	uint8_t c = 1;
	while (c)
	{
		EMU_Write8(dest + i,c = EMU_ReadU8(src + i));
		i++;
	}
	return dest;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %ebx
movb $0x1, %r15b
movl %edi, %r14d
testb %r15b, %r15b
je 0x134851
movl %ebp, %edi
callq 0x13539c
movl %eax, %r15d
movzbl %al, %esi
movl %r14d, %edi
callq 0x13583c
incl %ebp
incl %r14d
jmp 0x134830
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/bios.c
// Function: BIOS_BCopy
uint32_t BIOS_BCopy(uint32_t src,uint32_t dest,int32_t len)
{
	if (!src)
		return src;
	if (len < 0)
		return src;
	for (uint32_t i = 0;i < len;i++)
		EMU_Write8(dest + i,EMU_ReadU8(src + i));
	return src;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebp
testl %edi, %edi
sete %al
testl %edx, %edx
sets %cl
orb %al, %cl
je 0x1348a7
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %edx, %ebx
movl %esi, %r14d
movl %ebp, %r15d
subl $0x1, %ebx
jb 0x13489a
movl %r15d, %edi
callq 0x13539c
movzbl %al, %esi
movl %r14d, %edi
callq 0x13583c
incl %r14d
incl %r15d
jmp 0x1348af
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/bios.c
// Function: BIOS_MemSet
uint32_t BIOS_MemSet(uint32_t dest,uint8_t value,int32_t len)
{
	if (!dest)
		return dest;
	if (len < 0)
		return dest;
	for (uint32_t i = 0;i < len;i++)
		EMU_Write8(dest + i,value);
	return dest;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebp
testl %edi, %edi
sete %al
testl %edx, %edx
sets %cl
orb %al, %cl
je 0x1348fc
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %edx, %ebx
movzbl %sil, %r14d
movl %ebp, %r15d
subl $0x1, %ebx
jb 0x1348ef
movl %r15d, %edi
movl %r14d, %esi
callq 0x13583c
incl %r15d
jmp 0x134905
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/bios.c
// Function: BIOS_MemCpy
uint32_t BIOS_MemCpy(uint32_t dest,uint32_t src,int32_t len)
{
	if (!dest)
		return dest;
	if (len < 0)
		return dest;
	for (uint32_t i = 0;i < len;i++)
		EMU_Write8(dest + i,EMU_ReadU8(src + i));
	return dest;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebp
testl %edi, %edi
sete %al
testl %edx, %edx
sets %cl
orb %al, %cl
je 0x13493e
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %edx, %ebx
movl %esi, %r14d
movl %ebp, %r15d
subl $0x1, %ebx
jb 0x134931
movl %r14d, %edi
callq 0x13539c
movzbl %al, %esi
movl %r15d, %edi
callq 0x13583c
incl %r15d
incl %r14d
jmp 0x134946
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/bios.c
// Function: BIOS_DeliverEvent
void BIOS_DeliverEvent(uint32_t evclass,uint32_t spec)
{
	for (int i = 0;i < BIOS_MAXEVENTS;i++)
	{
		struct biosevent *event = &events[i];
		if (!event->enabled)
			continue;
		if (event->evclass != evclass)
			continue;
		if (event->spec != spec)
			continue;
		if (event->mode == 0x1000)
			EMU_Invoke(event->func,0);
		else
			event->busy = 0;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
pushq $0x18
popq %r14
leaq 0x25709(%rip), %r15     # 0x15a0b0
cmpq $0x1d8, %r14            # imm = 0x1D8
je 0x1349ec
cmpl $0x0, -0x14(%r14,%r15)
je 0x1349e6
cmpl %ebp, -0xc(%r14,%r15)
jne 0x1349e6
cmpl %ebx, -0x8(%r14,%r15)
jne 0x1349e6
cmpl $0x1000, -0x4(%r14,%r15) # imm = 0x1000
jne 0x1349e0
movl (%r14,%r15), %edi
xorl %esi, %esi
xorl %eax, %eax
callq 0x136157
jmp 0x1349e6
andl $0x0, -0x10(%r14,%r15)
addq $0x1c, %r14
jmp 0x1349a7
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/bios.c
// Function: BIOS_OpenEvent
uint32_t BIOS_OpenEvent(uint32_t evclass,uint32_t spec,uint32_t mode,uint32_t func)
{
	for (int i = 0;i < BIOS_MAXEVENTS;i++)
	{
		struct biosevent *event = &events[i];
		if (!event->allocated)
		{
			event->allocated = 1;
			event->busy = 1;
			event->evclass = evclass;
			event->spec = spec;
			event->mode = mode;
			event->func = func;
			return i;
		}
	}
	abort();
}

// Assembly:
pushq %rax
leaq 0x256b1(%rip), %r8      # 0x15a0b0
xorl %eax, %eax
cmpq $0x10, %rax
je 0x134a33
cmpl $0x0, (%r8)
je 0x134a16
incq %rax
addq $0x1c, %r8
jmp 0x134a01
pushq $0x1
popq %r9
movl %r9d, (%r8)
movl %r9d, 0x8(%r8)
movl %edi, 0xc(%r8)
movl %esi, 0x10(%r8)
movl %edx, 0x14(%r8)
movl %ecx, 0x18(%r8)
popq %rcx
retq
callq 0x1070
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/bios.c
// Function: BIOS_TestEvent
int BIOS_TestEvent(uint32_t event)
{
	if (event >= BIOS_MAXEVENTS)
		abort();
	if (!events[event].enabled)
		return 0;
	if (events[event].busy)
		return 0;
	events[event].busy = 1;
	return 1;
}

// Assembly:
cmpl $0x10, %edi
jae 0x134a68
movl %edi, %eax
imulq $0x1c, %rax, %rdx
leaq 0x25666(%rip), %rcx     # 0x15a0b0
xorl %eax, %eax
cmpl $0x0, 0x4(%rdx,%rcx)
je 0x134a5c
addq %rdx, %rcx
cmpl $0x0, 0x8(%rcx)
je 0x134a5d
retq
movl $0x1, 0x8(%rcx)
pushq $0x1
popq %rax
retq
pushq %rax
callq 0x1070
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/bios.c
// Function: BIOS_EnableEvent
int BIOS_EnableEvent(uint32_t event)
{
	if (event >= BIOS_MAXEVENTS)
		abort();
	events[event].enabled = 1;
	return 1;
}

// Assembly:
cmpl $0x10, %edi
jae 0x134a8c
movl %edi, %eax
imulq $0x1c, %rax, %rax
leaq 0x25630(%rip), %rcx     # 0x15a0b0
movl $0x1, 0x4(%rax,%rcx)
pushq $0x1
popq %rax
retq
pushq %rax
callq 0x1070
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/gte.c
// Function: GTE_GetRegister
uint32_t GTE_GetRegister(int reg)
{
	if (reg < 32)
		return PCSX_ReadCOPData(2,reg);
	else
		return PCSX_ReadCOPControl(2,reg - 32);
}

// Assembly:
movl %edi, %esi
cmpl $0x1f, %edi
jg 0x134cb6
leaq 0x25602(%rip), %rax     # 0x15a2b0
movq (%rax), %rax
pushq $0x2
popq %rdi
jmpq *%rax
leaq 0x25603(%rip), %rax     # 0x15a2c0
movq (%rax), %rax
addl $-0x20, %esi
pushq $0x2
popq %rdi
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/gte.c
// Function: GTE_SetRegister
void GTE_SetRegister(int reg,uint32_t value)
{
	if (reg < 32)
		PCSX_WriteCOPData(2,reg,value);
	else
		PCSX_WriteCOPControl(2,reg - 32,value);
}

// Assembly:
movl %esi, %edx
movl %edi, %esi
cmpl $0x1f, %edi
jg 0x134ce0
leaq 0x255e0(%rip), %rax     # 0x15a2b8
movq (%rax), %rax
pushq $0x2
popq %rdi
jmpq *%rax
leaq 0x255e1(%rip), %rax     # 0x15a2c8
movq (%rax), %rax
addl $-0x20, %esi
pushq $0x2
popq %rdi
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/emu.c
// Function: EMU_Init
void EMU_Init(void)
{
	extern void ZZ_Init(void);
	PCSX_Init();
	EMU_codemap[0x28] = BIOS_Execute;
	EMU_codemap[0x2C] = BIOS_Execute;
	EMU_codemap[0x30] = BIOS_Execute;
	EMU_codemap[0x221] = EMU_DummyMethod;
	for (int i = 0;i < EMU_RAMWORDS;i++)
	{
		if (!EMU_codemap[i])
			EMU_codemap[i] = EMU_ExecuteUnrecognizedCode;
	}
	ZZ_Init();
}

// Assembly:
pushq %rax
callq 0x134e20
leaq -0x8b0(%rip), %rax      # 0x134a92
movq %rax, 0x25157(%rip)     # 0x15a4a0
movq %rax, 0x25170(%rip)     # 0x15a4c0
movq %rax, 0x25189(%rip)     # 0x15a4e0
leaq -0x34(%rip), %rax       # 0x13532a
movq %rax, 0x26103(%rip)     # 0x15b468
xorl %eax, %eax
leaq 0x24ff2(%rip), %rcx     # 0x15a360
leaq -0x7d(%rip), %rdx       # 0x1352f8
cmpq $0x400000, %rax         # imm = 0x400000
je 0x13538e
cmpq $0x0, (%rax,%rcx)
jne 0x135388
movq %rdx, (%rax,%rcx)
addq $0x8, %rax
jmp 0x135375
popq %rax
jmp 0x1344
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/emu.c
// Function: EMU_ReadU8
uint8_t EMU_ReadU8(uint32_t address)
{
	if (address >= 0x80000000 && address <= 0x801FFFFF)
	{
normal:
		{
			uint32_t (*codehandler)(uint32_t) = EMU_codemap[(address & 0x1FFFFF) >> 2];
			if (codehandler != EMU_ExecuteUnrecognizedCode)
			{
				SDL_LogError(LOG_EMU,"Reading code as data");
			}
		}
		return EMU_ram[(address & 0x1FFFFF) >> 2] >> (address & 3) * 8;
	}
	else if (address >= 0x0 && address <= 0x1FFFFF)
	{
		goto normal;
	}
	else if (address >= 0xA0000000 && address <= 0xA01FFFFF)
	{
		goto normal;
	}
	else if (address >= 0x1F800000 && address <= 0x1F8003FF)
	{
		return EMU_scratch[(address & 0x3FF) >> 2] >> (address & 3) * 8;
	}
	else switch (address)
	{
	case 0x1F801040:
		return PAD_Read();
	case 0x1F801800:
		return CDR_GetStatus();
	case 0x1F801801:
		return CDR_ReadResponse();
	case 0x1F801802:
		return CDR_Read();
	case 0x1F801803:
		return CDR_Read3();
	default:
		SDL_LogError(LOG_EMU,"Unrecognized 8-bit read address %.8X",address);
		return PCSX_Read8(address);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
testl $0x7fe00000, %edi       # imm = 0x7FE00000
setne %al
movl %edi, %ecx
andl $0xffe00000, %ecx       # imm = 0xFFE00000
cmpl $0xa0000000, %ecx       # imm = 0xA0000000
setne %cl
testb %cl, %al
jne 0x135400
movl %ebx, %r14d
shrl $0x2, %r14d
andl $0x7ffff, %r14d         # imm = 0x7FFFF
leaq 0x24f8b(%rip), %rax     # 0x15a360
leaq -0xe4(%rip), %rcx       # 0x1352f8
cmpq %rcx, (%rax,%r14,8)
je 0x1353f3
leaq 0x4cf5(%rip), %rsi      # 0x13a0de
pushq $0x13
popq %rdi
xorl %eax, %eax
callq 0x10d0
movq 0x424f66(%rip), %rax    # 0x55a360
movl (%rax,%r14,4), %eax
jmp 0x135420
movl %ebx, %eax
andl $0xfffffc00, %eax       # imm = 0xFFFFFC00
cmpl $0x1f800000, %eax       # imm = 0x1F800000
jne 0x13542f
movq 0x424f53(%rip), %rax    # 0x55a368
movl %ebx, %ecx
andl $0x3fc, %ecx            # imm = 0x3FC
movl (%rax,%rcx), %eax
shll $0x3, %ebx
movl %ebx, %ecx
shrl %cl, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leal -0x1f801800(%rbx), %eax
cmpl $0x3, %eax
ja 0x135456
leaq 0x3aab(%rip), %rcx      # 0x138eec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1250
cmpl $0x1f801040, %ebx       # imm = 0x1F801040
jne 0x13546a
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x120c
leaq 0x4c82(%rip), %rsi      # 0x13a0f3
pushq $0x13
popq %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x10d0
leaq 0x24dfc(%rip), %rax     # 0x15a280
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1273
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x128f
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1281
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/emu.c
// Function: EMU_ReadLeft
void EMU_ReadLeft(uint32_t address,uint32_t *valueref)
{
	static uint32_t mask[4] = {0xFFFFFF,0xFFFF,0xFF,0};
	static int shift[4] = {24,16,8,0};
	uint32_t value = EMU_ReadU32(address & ~3);
	*valueref &= mask[address & 3];
	*valueref |= value << shift[address & 3];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
andl $-0x4, %edi
callq 0x1356f5
andl $0x3, %r14d
shll $0x2, %r14d
leaq 0x42b5(%rip), %rdx      # 0x13a270
leaq 0x42ce(%rip), %rcx      # 0x13a290
movb (%r14,%rcx), %cl
movl (%rbx), %esi
shll %cl, %eax
andl (%r14,%rdx), %esi
orl %esi, %eax
movl %eax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/emu.c
// Function: EMU_ReadRight
void EMU_ReadRight(uint32_t address,uint32_t *valueref)
{
	static uint32_t mask[4] = {0,0xFF000000,0xFFFF0000,0xFFFFFF00};
	static int shift[4] = {0,8,16,24};
	uint32_t value = EMU_ReadU32(address & ~3);
	*valueref &= mask[address & 3];
	*valueref |= value >> shift[address & 3];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
andl $-0x4, %edi
callq 0x1356f5
andl $0x3, %r14d
shll $0x2, %r14d
leaq 0x42a5(%rip), %rdx      # 0x13a2a0
leaq 0x42be(%rip), %rcx      # 0x13a2c0
movb (%r14,%rcx), %cl
movl (%rbx), %esi
shrl %cl, %eax
andl (%r14,%rdx), %esi
orl %esi, %eax
movl %eax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/emu.c
// Function: EMU_WriteLeft
void EMU_WriteLeft(uint32_t address,uint32_t value)
{
	static uint32_t mask[4] = {0xFFFFFF00,0xFFFF0000,0xFF000000,0};
	static int shift[4] = {24,16,8,0};
	uint32_t memvalue = EMU_ReadU32(address & ~3);
	memvalue &= mask[address & 3];
	memvalue |= value >> shift[address & 3];
	EMU_Write32(address & ~3,memvalue);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %r14d
movl %edi, %ebp
andl $-0x4, %ebp
movl %ebp, %edi
callq 0x1356f5
andl $0x3, %r14d
shll $0x2, %r14d
leaq 0x4242(%rip), %rcx      # 0x13a280
andl (%r14,%rcx), %eax
leaq 0x4247(%rip), %rcx      # 0x13a290
movb (%r14,%rcx), %cl
shrl %cl, %ebx
orl %eax, %ebx
movl %ebp, %edi
movl %ebx, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x135d4c
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/emu.c
// Function: EMU_WriteRight
void EMU_WriteRight(uint32_t address,uint32_t value)
{
	static uint32_t mask[4] = {0,0xFF,0xFFFF,0xFFFFFF};
	static int shift[4] = {0,8,16,24};
	uint32_t memvalue = EMU_ReadU32(address & ~3);
	memvalue &= mask[address & 3];
	memvalue |= value << shift[address & 3];
	EMU_Write32(address & ~3,memvalue);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %r14d
movl %edi, %ebp
andl $-0x4, %ebp
movl %ebp, %edi
callq 0x1356f5
andl $0x3, %r14d
shll $0x2, %r14d
leaq 0x422e(%rip), %rcx      # 0x13a2b0
andl (%r14,%rcx), %eax
leaq 0x4233(%rip), %rcx      # 0x13a2c0
movb (%r14,%rcx), %cl
shll %cl, %ebx
orl %eax, %ebx
movl %ebp, %edi
movl %ebx, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x135d4c
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/emu.c
// Function: EMU_SDivide
void EMU_SDivide(int32_t a,int32_t b)
{
	if (b)
	{
		LO = a / b;
		HI = a % b;
	}
	else
	{
		LO = 0xFFFFFFFF;
		HI = a;
	}
}

// Assembly:
testl %esi, %esi
je 0x136112
movq 0x2424d(%rip), %rcx     # 0x15a350
movl %edi, %eax
cltd
idivl %esi
movl %eax, 0x80(%rcx)
movl %edx, %edi
jmp 0x136120
movq 0x24237(%rip), %rcx     # 0x15a350
orl $-0x1, 0x80(%rcx)
movl %edi, 0x84(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/emu.c
// Function: EMU_UDivide
void EMU_UDivide(uint32_t a,uint32_t b)
{
	if (b)
	{
		LO = a / b;
		HI = a % b;
	}
	else
	{
		LO = 0xFFFFFFFF;
		HI = a;
	}
}

// Assembly:
testl %esi, %esi
je 0x136142
movq 0x2421e(%rip), %rcx     # 0x15a350
movl %edi, %eax
xorl %edx, %edx
divl %esi
movl %eax, 0x80(%rcx)
movl %edx, %edi
jmp 0x136150
movq 0x24207(%rip), %rcx     # 0x15a350
orl $-0x1, 0x80(%rcx)
movl %edi, 0x84(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/emu.c
// Function: EMU_RunInterrupts
void EMU_RunInterrupts(void)
{
	uint32_t pc = PCSX_RunInterrupts(0xDEADBEEF);
	while (pc != 0xDEADBEEF)
	{
		if (pc & 3)
			SDL_LogError(LOG_EMU,"Program counter is unaligned");
		pc = EMU_codemap[(pc & 0x1FFFFF) >> 2](pc);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0xdeadbeef, %ebp       # imm = 0xDEADBEEF
leaq 0x23e8b(%rip), %rax     # 0x15a2e8
leaq 0x23efc(%rip), %r15     # 0x15a360
leaq 0x3dd9(%rip), %rbx      # 0x13a244
pushq $0x13
popq %r14
movl %ebp, %edi
callq *(%rax)
cmpl $0xdeadbeef, %eax       # imm = 0xDEADBEEF
je 0x13649c
movl %eax, %ebp
testb $0x3, %bpl
je 0x13648f
movl %r14d, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10d0
movl %ebp, %eax
andl $0x1ffffc, %eax         # imm = 0x1FFFFC
leaq (%r15,%rax,2), %rax
jmp 0x13646f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/gool_mips.cc
// Function: GOOL_MIPS_ExecuteFromZZ
void GOOL_MIPS_ExecuteFromZZ(uint32_t pc)
{
	struct goolenv env;
	env.pc = pc;
	env.pcfar = pc + 4;
	env.language = env.languagefar = GOOL_LANGUAGE_MIPS;
	RA = 0xDEADBEEF;
	while (env.pc != 0xDEADBEEF)
	{
		uint32_t instruction = EMU_ReadU32(env.pc);
		env.oldpc = env.pc;
		env.pc = env.pcfar;
		env.pcfar = env.pcfar + 4;
		env.language = env.languagefar;
		GOOL_MIPS_ExecuteOnce(&env,instruction);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq 0xc(%rsp), %rbx
movl %edi, 0x4(%rbx)
leal 0x4(%rdi), %eax
movl %eax, 0x8(%rbx)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0xc(%rbx)
leaq 0x23a83(%rip), %rax     # 0x15a350
movq (%rax), %rax
movl $0xdeadbeef, 0x7c(%rax) # imm = 0xDEADBEEF
leaq 0x22ed2(%rip), %r14     # 0x1597b0
leaq -0x69(%rip), %r15       # 0x13687c
cmpl $0xdeadbeef, %edi       # imm = 0xDEADBEEF
je 0x13692e
callq 0x1356f5
movl 0x10(%rsp), %ecx
movl 0x14(%rsp), %edx
movl %ecx, 0xc(%rsp)
movl %edx, 0x10(%rsp)
addl $0x4, %edx
movl %edx, 0x14(%rsp)
movl 0x1c(%rsp), %ecx
movl %ecx, 0x18(%rsp)
movl %eax, %ecx
shrl $0x1a, %ecx
movq (%r14,%rcx,8), %rcx
testq %rcx, %rcx
cmoveq %r15, %rcx
movq %rbx, %rdi
movl %eax, %esi
callq *%rcx
movl 0x10(%rsp), %edi
jmp 0x1368e5
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/ns.cc
// Function: NS_1254C
int32_t NS_1254C(emuptr<struct nspage> nspage)
{
	if (nspage->type == 0x1)
	{
		return -255;
	}
	if (nspage->magic != 0x1234)
	{
		return -18;
	}
	for (int32_t i = nspage->entrycount - 1;i >= 0;i--)
	{
		*(uint32_t *)&nspage->entries[i] += (uint32_t)nspage;
		for (int32_t ii = nspage->entries[i]->itemcount;ii >= 0;ii--)
		{
			*(uint32_t *)&nspage->entries[i]->items[ii] += (uint32_t)nspage->entries[i];
		}
	}
	*(uint32_t *)&nspage->entries[nspage->entrycount] += (uint32_t)nspage;
	return -255;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebp
callq 0x1360a2
movl $0xffffff01, %ebx       # imm = 0xFFFFFF01
cmpw $0x1, 0x2(%rax)
je 0x136fce
movl %ebp, %edi
callq 0x1360a2
cmpw $0x1234, (%rax)         # imm = 0x1234
jne 0x136fb9
movl %ebp, %edi
callq 0x1360a2
movl 0x8(%rax), %r15d
movl %ebp, %edi
callq 0x1360a2
movq %rax, %r14
testl %r15d, %r15d
jle 0x136fbe
decq %r15
addl %ebp, 0x10(%r14,%r15,4)
movl %ebp, %edi
callq 0x1360a2
leaq (%rax,%r15,4), %rdi
addq $0x10, %rdi
callq 0x137292
movl 0xc(%rax), %r14d
testl %r14d, %r14d
js 0x136f58
movl %ebp, %edi
callq 0x1360a2
movl 0x10(%rax,%r15,4), %r12d
movl %ebp, %edi
callq 0x1360a2
leaq (%rax,%r15,4), %rdi
addq $0x10, %rdi
callq 0x137292
movl %r14d, %ecx
addl %r12d, 0x10(%rax,%rcx,4)
decl %r14d
jmp 0x136f87
pushq $-0x12
popq %rbx
jmp 0x136fce
movl %ebp, %edi
callq 0x1360a2
movslq 0x8(%rax), %rax
addl %ebp, 0x10(%r14,%rax,4)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/core.cc
// Function: CORE_Main
int CORE_Main(void)
{
	EMU_Invoke(0x80049E6C,0);
	EMU_Write32(0x8005F43C,1);
	EMU_Invoke(0x80015738,0);
	CORE_Loop(0x3C);
	EMU_Invoke(0x800158C4,0);
	return 0;
}

// Assembly:
pushq %rax
movl $0x80049e6c, %edi       # imm = 0x80049E6C
xorl %esi, %esi
xorl %eax, %eax
callq 0x136157
pushq $0x1
popq %rsi
movl $0x8005f43c, %edi       # imm = 0x8005F43C
callq 0x135d4c
movl $0x80015738, %edi       # imm = 0x80015738
xorl %esi, %esi
xorl %eax, %eax
callq 0x136157
pushq $0x3c
popq %rdi
callq 0x1372e0
movl $0x800158c4, %edi       # imm = 0x800158C4
xorl %esi, %esi
xorl %eax, %eax
callq 0x136157
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/core.cc
// Function: CORE_Start
void CORE_Start(void)
{
	for (uint32_t i = 0x8005F53C;i < 0x8006F488;i += 4)
	{
		EMU_Write32(i,0);
	}
	V0 = EMU_ReadU32(0x8005F420);
	V0 = EMU_CheckedAdd(V0,-8);
	SP = V0 | 0x80000000;
	A1 = V0 - EMU_ReadU32(0x8005F41C) - 0x6F488;
	EMU_Write32(0x8005CDC4,A1);
	EMU_Write32(0x8005CDC0,0x8006F488);
	EMU_Write32(0x8005F5B8,RA); // $RA is garbage here
	GP = 0x8005F414;
	FP = SP;
	EMU_Invoke(0x8001144C,2,0x8006F48C,A1);
	CORE_Main();
	EMU_Break(1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0x8005f53c, %ebx       # imm = 0x8005F53C
cmpl $0x8006f488, %ebx       # imm = 0x8006F488
jae 0x137d2c
movl %ebx, %edi
xorl %esi, %esi
callq 0x135d4c
addl $0x4, %ebx
jmp 0x137d16
movl $0x8005f420, %edi       # imm = 0x8005F420
callq 0x1356f5
leaq 0x22613(%rip), %r14     # 0x15a350
movq (%r14), %rcx
leal -0x8(%rax), %ebx
movl %ebx, 0x8(%rcx)
movl %ebx, %eax
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, 0x74(%rcx)
movl $0x8005f41c, %edi       # imm = 0x8005F41C
callq 0x1356f5
subl %eax, %ebx
addl $0xfff90b78, %ebx       # imm = 0xFFF90B78
movq (%r14), %rax
movl %ebx, 0x14(%rax)
movl $0x8005cdc4, %edi       # imm = 0x8005CDC4
movl %ebx, %esi
callq 0x135d4c
movl $0x8005cdc0, %edi       # imm = 0x8005CDC0
movl $0x8006f488, %esi       # imm = 0x8006F488
callq 0x135d4c
movq (%r14), %rax
movl 0x7c(%rax), %esi
movl $0x8005f5b8, %edi       # imm = 0x8005F5B8
callq 0x135d4c
movq (%r14), %rax
movl $0x8005f414, 0x70(%rax) # imm = 0x8005F414
movl 0x14(%rax), %ecx
movl 0x74(%rax), %edx
movl %edx, 0x78(%rax)
pushq $0x2
popq %rsi
movl $0x8001144c, %edi       # imm = 0x8001144C
movl $0x8006f48c, %edx       # imm = 0x8006F48C
xorl %eax, %eax
callq 0x136157
callq 0x13729c
pushq $0x1
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1363c7
// File: /workspace/github_c_makefile_star2_O2/ughman[P]c2c/src/core.cc
// Function: CORE_VSync
void CORE_VSync(int32_t count,int32_t timeout)
{
	timeout <<= 15;
	while ((int32_t)EMU_ReadU32(0x8005DF30) < count)
	{
		if (!timeout--)
		{
			EMU_Invoke(0x80049424,1,0x80010CE0);
			EMU_Invoke(0x8004A054,1,0);
			EMU_Invoke(0x8004A900,2,3,0);
			break;
		}
		EMU_Cycle(20);
		EMU_RunInterrupts();
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
shll $0xf, %ebx
negl %ebx
pushq $0x14
popq %r14
movl $0x8005df30, %edi       # imm = 0x8005DF30
callq 0x1356f5
cmpl %ebp, %eax
jge 0x137e02
testl %ebx, %ebx
je 0x137e07
movl %r14d, %edi
callq 0x136441
callq 0x13644a
incl %ebx
jmp 0x137ddf
popq %rbx
popq %r14
popq %rbp
retq
pushq $0x1
popq %rbx
movl $0x80049424, %edi       # imm = 0x80049424
movl %ebx, %esi
movl $0x80010ce0, %edx       # imm = 0x80010CE0
xorl %eax, %eax
callq 0x136157
movl $0x8004a054, %edi       # imm = 0x8004A054
movl %ebx, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x136157
pushq $0x2
popq %rsi
pushq $0x3
popq %rdx
movl $0x8004a900, %edi       # imm = 0x8004A900
xorl %ecx, %ecx
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x136157
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: findhints
int
findhints (void)
{
    int i, n, mutated = 0;

    n = findmoves();
    if (n < 2) {
        /* Each call to pairs() can mutate the board state, making the
         * hints very, very cryptic... so later undo the mutations.
         */
        for (i = 0; i < 9; ++i) {
            count_set_digits(i, idx_row);
            pairs(i, idx_row);

            count_set_digits(i, idx_column);
            pairs(i, idx_column);

            count_set_digits(i, idx_block);
            pairs(i, idx_block);
        }
        mutated = 1;
        n = findmoves();
    }
    if (n < 2) {
        for (i = 0; i < 9; ++i) {
            block(i);
            common(i);
        }
        mutated = 1;
        n = findmoves();
    }

    /* Sort the possible moves, and allow just one hint per square */
    if (0 < n) {
        int i, j;

        qsort(possible, n, sizeof(int), cmpindex);
        for (i = 0, j = 1; j < n; ++j) {
            if (GET_INDEX(possible[i]) == GET_INDEX(possible[j])) {
                /* Let the user make mistakes - do not assume the
                 * board is in a consistent state.
                 */
                if (GET_DIGIT(possible[i]) == GET_DIGIT(possible[j])) {
                    possible[i] |= possible[j];
                }
            } else {
                i = j;
            }
        }
        n = i + 1;
    }

    /* Undo any mutations of the board state */
    if (mutated) {
        reapply();
    }
    return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
callq 0x25c1
movl %eax, %ebx
cmpl $0x1, %eax
jle 0x24c7
movl %ebx, %ebp
jmp 0x2555
xorl %ebp, %ebp
leaq 0x1d3(%rip), %r14       # 0x26a3
leaq 0x2e1(%rip), %r15       # 0x27b8
leaq 0x2e0(%rip), %r12       # 0x27be
cmpl $0x9, %ebp
je 0x2523
movl %ebp, %edi
movq %r14, %rsi
callq 0x2640
movl %ebp, %edi
movq %r14, %rsi
callq 0x26a9
movl %ebp, %edi
movq %r15, %rsi
callq 0x2640
movl %ebp, %edi
movq %r15, %rsi
callq 0x26a9
movl %ebp, %edi
movq %r12, %rsi
callq 0x2640
movl %ebp, %edi
movq %r12, %rsi
callq 0x26a9
incl %ebp
jmp 0x24de
callq 0x25c1
cmpl $0x1, %eax
jg 0x2546
xorl %ebp, %ebp
cmpl $0x9, %ebp
je 0x254a
movl %ebp, %edi
callq 0x27df
movl %ebp, %edi
callq 0x28a0
incl %ebp
jmp 0x252f
movl %eax, %ebp
jmp 0x2555
callq 0x25c1
movl %eax, %ebp
testl %eax, %eax
jle 0x25b1
movl %ebp, %r14d
leaq 0xbca1(%rip), %r15      # 0xe200
leaq 0x42e(%rip), %rcx       # 0x2994
pushq $0x4
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x2070
xorl %ebp, %ebp
pushq $0x1
popq %rax
cmpq %rax, %r14
je 0x25aa
movslq %ebp, %rcx
movl (%r15,%rcx,4), %edx
movl (%r15,%rax,4), %esi
movl %esi, %edi
xorl %edx, %edi
testb $0x7f, %dil
je 0x2597
movl %eax, %ebp
jmp 0x25a5
testl $0xf0000, %edi          # imm = 0xF0000
jne 0x25a5
orl %edx, %esi
movl %esi, (%r15,%rcx,4)
incq %rax
jmp 0x2579
incl %ebp
cmpl $0x1, %ebx
jg 0x25b6
callq 0x29a1
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: findmoves
static
int
findmoves (void)
{
    int el;

    idx_possible = 0;
    for (el = 0; el < 9; ++el) {
        if (-1 == singles(el, idx_row, HINT_ROW)        ||
            -1 == singles(el, idx_column, HINT_COLUMN)  ||
            -1 == singles(el, idx_block, HINT_BLOCK)) {
            return -1;
        }
    }
    return idx_possible;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
andl $0x0, 0xce90(%rip)      # 0xf460
xorl %ebp, %ebp
leaq 0xca(%rip), %r14        # 0x26a3
pushq $-0x1
popq %rbx
leaq 0x1d5(%rip), %r15       # 0x27b8
leaq 0x1d4(%rip), %r12       # 0x27be
cmpl $0x9, %ebp
je 0x262f
movl %ebp, %edi
movq %r14, %rsi
movl $0x1000000, %edx        # imm = 0x1000000
callq 0x510e
cmpl $-0x1, %eax
je 0x2635
movl %ebp, %edi
movq %r15, %rsi
movl $0x2000000, %edx        # imm = 0x2000000
callq 0x510e
cmpl $-0x1, %eax
je 0x2635
movl %ebp, %edi
movq %r12, %rsi
movl $0x4000000, %edx        # imm = 0x4000000
callq 0x510e
incl %ebp
cmpl $-0x1, %eax
jne 0x25ea
jmp 0x2635
movl 0xce2b(%rip), %ebx      # 0xf460
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: count_set_digits
static
void
count_set_digits (int el, int (*idx_fn)(int, int))
{
    int i;
    memset(counts, 0x00, sizeof(counts));
    for (i = 0; i < 9; ++i) {
        digits[i] = numset(board[(*idx_fn)(el, i)]);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
xorps %xmm0, %xmm0
movaps %xmm0, 0xce29(%rip)     # 0xf480
andl $0x0, 0xce32(%rip)      # 0xf490
movaps %xmm0, 0xce0b(%rip)     # 0xf470
leaq 0xcf84(%rip), %r15      # 0xf5f0
xorl %r14d, %r14d
leaq 0xce2a(%rip), %r12      # 0xf4a0
cmpq $0x9, %r14
je 0x269a
movl %ebp, %edi
movl %r14d, %esi
callq *%rbx
cltq
movl (%r12,%rax,4), %edi
callq 0x52a8
movl %eax, (%r15)
incq %r14
addq $0x4, %r15
jmp 0x2676
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: pairs
static
void
pairs (int el, int (*idx_fn)(int, int))
{
    int i, j, k, mask, idx;
    for (i = 0; i < 8; ++i) {
        if (7 == digits[i]) { /* 2 digits unknown */
            for (j = i + 1; j < 9; ++j) {
                idx = (*idx_fn)(el, i);
                if (STATE(idx) == STATE((*idx_fn)(el, j))) {
                    /* Found a row/column pair - mask other entries */
                    mask = STATE_MASK ^ (STATE_MASK & board[idx]);
                    for (k = 0; k < i; ++k) {
                        board[(*idx_fn)(el, k)] |= mask;
                    }
                    for (k = i + 1; k < j; ++k) {
                        board[(*idx_fn)(el, k)] |= mask;
                    }
                    for (k = j + 1; k < 9; ++k) {
                        board[(*idx_fn)(el, k)] |= mask;
                    }
                    digits[j] = -1; /* now processed */
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movl %edi, %ebp
pushq $0x1
popq %rax
movq %rax, 0x8(%rsp)
xorl %esi, %esi
leaq 0xcdd3(%rip), %r13      # 0xf4a0
cmpq $0x8, %rsi
je 0x27a9
leaq 0xcf12(%rip), %rax      # 0xf5f0
cmpl $0x7, (%rax,%rsi,4)
jne 0x279c
movq 0x8(%rsp), %r15
movq %rsi, 0x10(%rsp)
cmpq $0x9, %r15
je 0x279c
movl %ebp, %edi
callq *%rbx
movslq %eax, %r14
movl (%r13,%r14,4), %r12d
movl %ebp, %edi
movl %r15d, %esi
callq *%rbx
cltq
xorl (%r13,%rax,4), %r12d
testw $0xff80, %r12w          # imm = 0xFF80
jne 0x278f
movl (%r13,%r14,4), %r14d
notl %r14d
andl $0xff80, %r14d          # imm = 0xFF80
xorl %r12d, %r12d
cmpq %r12, 0x10(%rsp)
je 0x274a
movl %ebp, %edi
movl %r12d, %esi
callq *%rbx
cltq
orl %r14d, (%r13,%rax,4)
incq %r12
jmp 0x2730
movq 0x8(%rsp), %r12
cmpq %r12, %r15
jbe 0x2767
movl %ebp, %edi
movl %r12d, %esi
callq *%rbx
cltq
orl %r14d, (%r13,%rax,4)
incq %r12
jmp 0x274f
movl %r15d, %r12d
cmpl $0x7, %r12d
ja 0x2783
incl %r12d
movl %ebp, %edi
movl %r12d, %esi
callq *%rbx
cltq
orl %r14d, (%r13,%rax,4)
jmp 0x276a
leaq 0xce66(%rip), %rax      # 0xf5f0
orl $-0x1, (%rax,%r15,4)
incq %r15
movq 0x10(%rsp), %rsi
jmp 0x26f2
incq %rsi
incq 0x8(%rsp)
jmp 0x26cd
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: block
static
void
block (int el)
{
    int i, idx, row, col;

    /* Find first unknown square */
    for (i = 0; i < 9 && !IS_EMPTY(idx = idx_block(el, i)); ++i) {
       ;
    }
    if (i < 9) {
        assert(IS_EMPTY(idx));
        row = ROW(idx);
        col = COLUMN(idx);
        for (++i; i < 9; ++i) {
            idx = idx_block(el, i);
            if (IS_EMPTY(idx)) {
                if (ROW(idx) != row) {
                    row = -1;
                }
                if (COLUMN(idx) != col) {
                    col = -1;
                }
            }
        }
        if (0 <= row) {
            exblock(el, row, idx_row);
        }
        if (0 <= col) {
            exblock(el, col, idx_column);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
xorl %ebp, %ebp
leaq 0xccab(%rip), %r12      # 0xf4a0
cmpl $0x9, %ebp
je 0x2891
movl %ebx, %edi
movl %ebp, %esi
callq 0x27be
movslq %eax, %rcx
testb $0xf, 0x2(%r12,%rcx,4)
je 0x2816
incl %ebp
jmp 0x27f5
pushq $0x9
popq %rcx
cltd
idivl %ecx
movl %eax, %r15d
movl %edx, %r14d
pushq $-0x1
popq %r13
cmpl $0x7, %ebp
ja 0x2857
incl %ebp
movl %ebx, %edi
movl %ebp, %esi
callq 0x27be
movslq %eax, %rcx
testb $0xf, 0x2(%r12,%rcx,4)
jne 0x2826
cltd
pushq $0x9
popq %rcx
idivl %ecx
cmpl %r15d, %eax
cmovnel %r13d, %r15d
cmpl %r14d, %edx
cmovnel %r13d, %r14d
jmp 0x2826
testl %r15d, %r15d
js 0x286d
leaq -0x1c0(%rip), %rdx      # 0x26a3
movl %ebx, %edi
movl %r15d, %esi
callq 0x52d1
testl %r14d, %r14d
js 0x2891
leaq -0xc1(%rip), %rdx       # 0x27b8
movl %ebx, %edi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x52d1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: common
static
void
common (int el)
{
    int i, idx, row, col, digit, mask;

    for (digit = 1; digit <= 9; ++digit) {
        mask = DIGIT_STATE(digit);
        row = col = -1;  /* Value '9' indicates invalid */
        for (i = 0; i < 9; ++i) {
            /* Digit possible? */
            idx = idx_block(el, i);
            if (IS_EMPTY(idx) && 0 == (board[idx] & mask)) {
                if (row < 0) {
                    row = ROW(idx);
                } else if (row != ROW(idx)) {
                    row = 9; /* Digit appears in multiple rows */
                }
                if (col < 0) {
                    col = COLUMN(idx);
                } else if (col != COLUMN(idx)) {
                    col = 9; /* Digit appears in multiple columns */
                }
            }
        }
        if (-1 != row && row < 9) {
            exmask(mask, el, row, idx_row);
        }
        if (-1 != col && col < 9) {
            exmask(mask, el, col, idx_column);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x1
popq %rcx
leaq 0xcbe9(%rip), %rbp      # 0xf4a0
cmpl $0xa, %ecx
je 0x2985
pushq $0x40
popq %r12
movl %ecx, 0x4(%rsp)
shll %cl, %r12d
xorl %r15d, %r15d
pushq $-0x1
popq %r13
movl %r13d, %r14d
cmpl $0x9, %r15d
je 0x292e
movl %ebx, %edi
movl %r15d, %esi
callq 0x27be
movslq %eax, %rcx
movl (%rbp,%rcx,4), %ecx
movl %ecx, %edx
andl $0xf0000, %edx          # imm = 0xF0000
andl %r12d, %ecx
orl %edx, %ecx
jne 0x2929
cltd
pushq $0x9
popq %rcx
idivl %ecx
movl %r14d, %ecx
cmpl %eax, %r14d
je 0x290c
pushq $0x9
popq %rcx
testl %r14d, %r14d
movl %ecx, %r14d
cmovsl %eax, %r14d
testl %r13d, %r13d
js 0x2926
cmpl %edx, %r13d
je 0x2929
pushq $0x9
popq %r13
jmp 0x2929
movl %edx, %r13d
incl %r15d
jmp 0x28d5
cmpl $-0x1, %r14d
sete %al
cmpl $0x9, %r14d
setge %cl
orb %al, %cl
jne 0x2954
movl %r12d, %edi
movl %ebx, %esi
movl %r14d, %edx
leaq -0x2ac(%rip), %rcx      # 0x26a3
callq 0x5345
cmpl $-0x1, %r13d
sete %al
cmpl $0x9, %r13d
setge %cl
orb %al, %cl
jne 0x297a
movl %r12d, %edi
movl %ebx, %esi
movl %r13d, %edx
leaq -0x1bd(%rip), %rcx      # 0x27b8
callq 0x5345
movl 0x4(%rsp), %ecx
incl %ecx
jmp 0x28b7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: reapply
static
int
reapply (void)
{
    int digit, idx, j;
    int allok = 0;
    memset(board, 0x00, sizeof(board));
    for (j = 0; j < idx_history; ++j) {
        if (!(history[j] & IGNORED) && 0 != GET_DIGIT(history[j])) {
            idx = GET_INDEX(history[j]);
            digit = GET_DIGIT(history[j]);
            if (!IS_EMPTY(idx) || DISALLOWED(idx, digit)) {
                allok = -1;
            }
            board[idx] = SET_DIGIT(digit);
            if (history[j] & FIXED) {
                board[idx] |= FIXED;
            }
            update(idx);
        }
    }
    return allok;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0xcaf0(%rip), %rbx      # 0xf4a0
xorl %r14d, %r14d
movl $0x144, %edx            # imm = 0x144
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2190
leaq 0xcc57(%rip), %r15      # 0xf620
movl 0xcc45(%rip), %eax      # 0xf614
pushq $-0x1
popq %r12
xorl %ebp, %ebp
movslq %eax, %rcx
cmpq %rcx, %r14
jge 0x2a2c
movl (%r15), %edx
btl $0x16, %edx
jb 0x2a23
movl %edx, %ecx
shrl $0x10, %ecx
andl $0xf, %ecx
je 0x2a23
movl %edx, %edi
andl $0x7f, %edi
movl %edi, %eax
movl (%rbx,%rax,4), %eax
testl $0xf0000, %eax          # imm = 0xF0000
jne 0x2a07
shrl %cl, %eax
testb $0x40, %al
je 0x2a0a
movl %r12d, %ebp
shll $0x10, %ecx
andl $0x100000, %edx         # imm = 0x100000
orl %ecx, %edx
movl %edx, (%rbx,%rdi,4)
callq 0x53cb
movl 0xcbf1(%rip), %eax      # 0xf614
incq %r14
addq $0x4, %r15
jmp 0x29d5
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: clear_hints
static
void
clear_hints (void)
{
    int i;
    for (i = 0; i < 9; ++i) {
        mvaddch(TOP + 1 + i + i / 3, LEFT - 2, ' ');
        mvaddch(TOP + 1 + i + i / 3, RIGHT + 2, ' ');
        mvaddch(TOP - 1, LEFT + 2 + 2 * (i + i / 3), ' ');
        mvaddch(BOTTOM + 1, LEFT + 2 + 2 * (i + i / 3), ' ');
    }
    have_hint = 0;
    move_to(curx, cury);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
pushq $0x9
popq %r15
pushq $0x7
popq %r12
movq 0xb1be(%rip), %r13      # 0xdfd8
movl %ebx, %eax
xorl %edx, %edx
pushq $0x3
popq %rcx
divl %ecx
subl $0x1, %r15d
jb 0x2ec4
movl %eax, %ebp
leal (%r12,%rbp), %r14d
movq (%r13), %rdi
movl %r14d, %esi
pushq $0x19
popq %rdx
callq 0x22d0
cmpl $-0x1, %eax
je 0x2e53
movq (%r13), %rdi
pushq $0x20
popq %rsi
callq 0x2300
movq (%r13), %rdi
movl %r14d, %esi
pushq $0x35
popq %rdx
callq 0x22d0
cmpl $-0x1, %eax
je 0x2e73
movq (%r13), %rdi
pushq $0x20
popq %rsi
callq 0x2300
addl %ebx, %ebp
movq (%r13), %rdi
leal 0x1d(,%rbp,2), %ebp
pushq $0x5
popq %rsi
movl %ebp, %edx
callq 0x22d0
cmpl $-0x1, %eax
je 0x2e9b
movq (%r13), %rdi
pushq $0x20
popq %rsi
callq 0x2300
movq (%r13), %rdi
pushq $0x13
popq %rsi
movl %ebp, %edx
callq 0x22d0
cmpl $-0x1, %eax
je 0x2eba
movq (%r13), %rdi
pushq $0x20
popq %rsi
callq 0x2300
incl %ebx
incl %r12d
jmp 0x2e1a
movb $0x0, 0xb47d(%rip)      # 0xe348
movl 0xcb1b(%rip), %edi      # 0xf9ec
movl 0xcb19(%rip), %esi      # 0xf9f0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x546b
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: set_status
static
void
set_status (const char * txt)
{
    mvaddstr(STATUS_LINE,
             (int)((LINE_SIZE - strlen(txt)) / 2),
             (char *)txt);

    move_to(curx, cury);
    wrefresh(stdscr);
    have_status = 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0xb0df(%rip), %r15      # 0xdfd8
movq (%r15), %r14
callq 0x2100
pushq $0x50
popq %rdx
subq %rax, %rdx
shrq %rdx
pushq $0x14
popq %rsi
movq %r14, %rdi
callq 0x22d0
cmpl $-0x1, %eax
je 0x2f28
movq (%r15), %rdi
pushq $-0x1
popq %rdx
movq %rbx, %rsi
callq 0x2360
movl 0xcabe(%rip), %edi      # 0xf9ec
movl 0xcabc(%rip), %esi      # 0xf9f0
callq 0x546b
movq (%r15), %rdi
callq 0x2180
movb $0x1, 0xcaac(%rip)      # 0xf9f4
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: open_precanned
static
int
open_precanned (const char * filename)
{
    n_precanned = 0;
    precanned = fopen(filename, "r");
    if (0 != precanned) {
        while (0 == read_board(precanned, 0)) {
            ++n_precanned;
        }
    }
    /* return 0 on success, -1 on failure. */
    return (n_precanned > 0) - 1;
}

// Assembly:
pushq %rax
andl $0x0, 0xbfc5(%rip)      # 0xf3c0
leaq 0x72b8(%rip), %rsi      # 0xa6ba
callq 0x22c0
movq %rax, 0xafa2(%rip)      # 0xe3b0
testq %rax, %rax
je 0x3430
movq %rax, %rdi
xorl %esi, %esi
callq 0x54b2
testl %eax, %eax
jne 0x3430
incl 0xbf99(%rip)            # 0xf3c0
movq 0xaf82(%rip), %rdi      # 0xe3b0
jmp 0x3416
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: open_template
static
void
open_template (const char * filename)
{
    n_tmplt = 0;
    ftmplt = topen(filename, "r");
    if (0 != ftmplt) {
        while (0 == read_board(ftmplt, 1)) {
            ++n_tmplt;
        }
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
andl $0x0, 0xbfc3(%rip)      # 0xf400
leaq 0x7276(%rip), %rsi      # 0xa6ba
callq 0x22c0
movq %rax, %rdi
testq %rax, %rax
je 0x3475
movq %rdi, 0xbf90(%rip)      # 0xf3e8
pushq $0x1
popq %rbx
movl %ebx, %esi
callq 0x54b2
testl %eax, %eax
jne 0x3490
incl 0xbf94(%rip)            # 0xf400
movq 0xbf75(%rip), %rdi      # 0xf3e8
jmp 0x345b
leaq 0x7406(%rip), %rdi      # 0xa882
movq %rbx, %rsi
callq 0x2210
testl %eax, %eax
je 0x3492
andq $0x0, 0xbf58(%rip)      # 0xf3e8
popq %rbx
retq
movb $0x1, 0xc7d7(%rip)      # 0xfc70
andl $0x0, 0xc7d4(%rip)      # 0xfc74
leaq 0xc6f1(%rip), %rdi      # 0xfb98
jmp 0x3451
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: write_default_template
static
int
write_default_template(const char *     template_path)
{
    int     ret = -1;
    FILE *  f   = fopen(template_path, "r");
    if (0 == f) {
        f = fopen(template_path, "w");
        if (0 != f) {
            size_t i;
            for (i = 0; i < sizeof(default_template); ++i) {
                unsigned char ch = default_template[i];
                int j;
                for (j = 0; j < 4; ++j) {
                    fprintf(f, "%c", dtct[ch & 3]);
                    ch >>= 2;
                }
            }
            ret = fclose(f);
        }
    } else {
        fclose(f);
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x71fc(%rip), %rsi      # 0xa6ba
callq 0x22c0
testq %rax, %rax
je 0x34e2
movq %rax, %rdi
callq 0x20e0
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6801(%rip), %rsi      # 0x9cea
movq %rbx, %rdi
callq 0x22c0
testq %rax, %rax
je 0x34d0
movq %rax, %rbx
xorl %r14d, %r14d
pushq $0x4
popq %r15
leaq 0x76bd(%rip), %r12      # 0xabc4
cmpq $0x1773, %r14           # imm = 0x1773
je 0x3545
leaq 0x4ca9(%rip), %rax      # 0x81c0
movb (%r14,%rax), %r13b
movl %r15d, %ebp
subl $0x1, %ebp
jb 0x3540
movzbl %r13b, %r13d
movl %r13d, %eax
andl $0x3, %eax
movsbl (%rax,%r12), %edi
movq %rbx, %rsi
callq 0x21c0
shrb $0x2, %r13b
jmp 0x351e
incq %r14
jmp 0x3507
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20e0
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: cleanup_curses_and_more
static
void
cleanup_curses_and_more (void)
{
    if (opened != NULL) {
        fclose(opened);
        opened = NULL;
    }
    if (precanned != NULL) {
        fclose(precanned);
        precanned = NULL;
    }
    tclose(ftmplt);
    ftmplt = NULL;
    move(LAST_LINE, 0);
    wrefresh(stdscr);
    endwin();
}

// Assembly:
pushq %rbx
movq 0xb46a(%rip), %rdi      # 0xfc78
testq %rdi, %rdi
je 0x4820
callq 0x20e0
andq $0x0, 0xb458(%rip)      # 0xfc78
movq 0x9b89(%rip), %rdi      # 0xe3b0
testq %rdi, %rdi
je 0x4839
callq 0x20e0
andq $0x0, 0x9b77(%rip)      # 0xe3b0
movq 0xaba8(%rip), %rdi      # 0xf3e8
leaq 0xb351(%rip), %rax      # 0xfb98
cmpq %rax, %rdi
je 0x4858
testq %rdi, %rdi
je 0x4866
callq 0x20e0
jmp 0x4866
movb $0x0, 0xb411(%rip)      # 0xfc70
andl $0x0, 0xb40e(%rip)      # 0xfc74
andq $0x0, 0xab7a(%rip)      # 0xf3e8
movq 0x9763(%rip), %rbx      # 0xdfd8
movq (%rbx), %rdi
pushq $0x17
popq %rsi
xorl %edx, %edx
callq 0x22d0
movq (%rbx), %rdi
callq 0x2180
popq %rbx
jmp 0x2350
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: load_board
static
void
load_board (void)
{
    int i = 0;
    if (opened) {
        /* Select next board */
        i = read_board(opened, 0);
        if (i--) {
            fclose(opened);
            opened = NULL;
        }
    } else if (precanned &&
               (0 == opt_random ||
                (0 == rand() % 3 && 0 < n_precanned))) {
        /* Select random board */
        i = rand() % n_precanned;
        fseek(precanned, 0, SEEK_SET);
        while (0 <= i && 0 == read_board(precanned, 0)) {
            --i;
        }
    }
    if (i != -1) {
        set_status("generating a random board... (please wait)");
        generate();
        clear_status();
    }

    /* Shameless plug... */
    set_status("Su-Do-Ku by Michael Kennett");

    render();
    write_title(title);

    curx = cury = 8;    /* move_next() takes care of this... */
    move_next();
    completed = is_complete();
    num_hints = -1;
    time(&start_time);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq 0xac68(%rip), %rdi      # 0xfc78
testq %rdi, %rdi
je 0x503a
xorl %esi, %esi
callq 0x54b2
testl %eax, %eax
je 0x50b9
movq 0xac4d(%rip), %rdi      # 0xfc78
callq 0x20e0
andq $0x0, 0xac40(%rip)      # 0xfc78
jmp 0x50a3
cmpq $0x0, 0x936e(%rip)      # 0xe3b0
je 0x50a3
cmpb $0x0, 0xa391(%rip)      # 0xf3dc
jne 0x5065
callq 0x2380
pushq $0x3
popq %rcx
cltd
idivl %ecx
testl %edx, %edx
jne 0x50a3
cmpl $0x0, 0xa35d(%rip)      # 0xf3c0
jle 0x50a3
callq 0x2380
cltd
idivl 0xa34f(%rip)            # 0xf3c0
movl %edx, %ebx
movq 0x9336(%rip), %rdi      # 0xe3b0
xorl %esi, %esi
xorl %edx, %edx
callq 0x2270
leal 0x1(%rbx), %ebp
decl %ebp
js 0x509e
movq 0x931f(%rip), %rdi      # 0xe3b0
xorl %esi, %esi
callq 0x54b2
testl %eax, %eax
je 0x5086
jmp 0x50a3
cmpl $-0x2, %ebx
jg 0x50b9
leaq 0x56c1(%rip), %rdi      # 0xa76b
callq 0x2eea
callq 0x4890
callq 0x6089
leaq 0x56d6(%rip), %rdi      # 0xa796
callq 0x2eea
callq 0x60c0
leaq 0xa33f(%rip), %rdi      # 0xf410
callq 0x5ff5
pushq $0x8
popq %rax
movl %eax, 0xa911(%rip)      # 0xf9f0
movl %eax, 0xa907(%rip)      # 0xf9ec
callq 0x621d
callq 0x6283
orl $-0x1, 0x9256(%rip)     # 0xe34c
movl %eax, 0xabe4(%rip)      # 0xfce0
leaq 0xabd5(%rip), %rdi      # 0xfcd8
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2250
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: numset
static
int
numset (int mask)
{
    int i, n = 0;
    for (i = STATE_SHIFT + 1; i <= STATE_SHIFT + 9; ++i) {
        if (mask & (1<<i)) {
            ++n;
        } else {
            ++counts[i - STATE_SHIFT - 1];
        }
    }
    return n;
}

// Assembly:
xorl %ecx, %ecx
pushq $0x7
popq %rdx
leaq 0xa1bc(%rip), %rsi      # 0xf470
xorl %eax, %eax
cmpq $0x24, %rcx
je 0x52d0
btl %edx, %edi
jae 0x52c5
incl %eax
jmp 0x52c8
incl (%rcx,%rsi)
addq $0x4, %rcx
incl %edx
jmp 0x52b6
retq
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: exblock
static
void
exblock (int block, int el, int (*idx_fn)(int, int))
{
    int i, idx, mask;

    /* By assumption, all unknown squares in the block appear in the
     * same row/column, so to construct a mask for these squares, it
     * is sufficient to invert the mask for the known squares in the
     * block.
     */
    mask = 0;
    for (i = 0; i < 9; ++i) {
        idx = idx_block(block, i);
        if (!IS_EMPTY(idx)) {
            mask |= DIGIT_STATE(DIGIT(idx));
        }
    }
    exmask(mask ^ STATE_MASK, block, el, idx_fn);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movl %esi, %ebp
movl %edi, %r14d
xorl %r15d, %r15d
leaq 0xa1b1(%rip), %r13      # 0xf4a0
pushq $0x40
popq %rbx
xorl %r12d, %r12d
cmpl $0x9, %r15d
je 0x5322
movl %r14d, %edi
movl %r15d, %esi
callq 0x27be
cltq
movzwl 0x2(%r13,%rax,4), %ecx
andl $0xf, %ecx
movl %ebx, %eax
shll %cl, %eax
testl %ecx, %ecx
cmovel %ecx, %eax
orl %eax, %r12d
incl %r15d
jmp 0x52f5
xorl $0xff80, %r12d          # imm = 0xFF80
movl %r12d, %edi
movl %r14d, %esi
movl %ebp, %edx
movq (%rsp), %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5345
// File: /workspace/github_c_makefile_star2_O2/cinemast[P]sudoku/sudoku.c
// Function: exmask
static
void
exmask (int mask, int block, int el, int (*idx_fn)(int, int))
{
    int i, idx;

    for (i = 0; i < 9; ++i) {
        idx = (*idx_fn)(el, i);
        if (block != BLOCK(idx) && IS_EMPTY(idx)) {
            board[idx] |= mask;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r14d
movl %edi, 0x4(%rsp)
xorl %r12d, %r12d
pushq $0x9
popq %r15
movb $0x3, %r13b
cmpl $0x9, %r12d
je 0x53bc
movl %ebp, %edi
movl %r12d, %esi
callq *%rbx
movl %eax, %ecx
cltd
pushq $0x1b
popq %rsi
idivl %esi
leal (%rax,%rax,2), %esi
movl %ecx, %eax
cltd
idivl %r15d
movsbl %dl, %eax
idivb %r13b
movsbl %al, %eax
addl %esi, %eax
cmpl %r14d, %eax
je 0x53b7
movslq %ecx, %rax
leaq 0xa102(%rip), %rcx      # 0xf4a0
movl (%rcx,%rax,4), %ecx
testl $0xf0000, %ecx          # imm = 0xF0000
jne 0x53b7
orl 0x4(%rsp), %ecx
leaq 0xa0ec(%rip), %rdx      # 0xf4a0
movl %ecx, (%rdx,%rax,4)
incl %r12d
jmp 0x5366
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq