LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/hoehermann[P]TypedJNI/typedjni.cpp
// Function: TypedJNI::GetMethodID(JNIEnv_*, _jclass*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
jmethodID TypedJNI::GetMethodID(JNIEnv *env, const jclass cls, const std::string name, const std::string & signature) {
    jmethodID mid = env->GetMethodID(cls, name.c_str(), signature.c_str());
    if (mid == NULL) {
        throw TypedJNIError("Failed to find method '"+name+"' "+signature+".");
    }
    return mid;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq (%rdx), %rdx
movq (%rcx), %rcx
movq (%rdi), %rax
callq *0x108(%rax)
testq %rax, %rax
je 0x6b78
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x30e0
movq %rax, %rbx
leaq 0x29b4(%rip), %rsi      # 0x9540
leaq 0x40(%rsp), %rdi
movq %r15, %rdx
callq 0x782c
leaq 0x299d(%rip), %rsi      # 0x953d
leaq 0x40(%rsp), %rdi
callq 0x32a0
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6bcb
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x6bd7
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x60(%rsp), %rdi
movq %r14, %rdx
callq 0x77d2
leaq 0x29a3(%rip), %rsi      # 0x95a8
leaq 0x60(%rsp), %rdi
callq 0x32a0
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x6c32
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x6c3f
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x31f0
leaq 0x5f5b(%rip), %rax      # 0xcbc8
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0x5f67(%rip), %rsi      # 0xcbe0
movq 0x6348(%rip), %rdx      # 0xcfc8
movq %rbx, %rdi
callq 0x3260
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0x6caa
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x31b0
jmp 0x6caa
movq %rax, %r14
movb $0x1, %bpl
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6ccd
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x31b0
jmp 0x6ccd
movq %rax, %r14
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x6ceb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x31b0
jmp 0x6ceb
movq %rax, %r14
movb $0x1, %bpl
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6d0e
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x31b0
jmp 0x6d0e
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x6d1b
movq %rbx, %rdi
callq 0x3120
movq %r14, %rdi
callq 0x3280
nop
// File: /workspace/github_cpp_makefile_star2_O1/hoehermann[P]TypedJNI/typedjni.cpp
// Function: TypedJNIEnv::find_class(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
TypedJNIClass TypedJNIEnv::find_class(std::string name) {
    jclass cls = env->FindClass(name.c_str());
    if (cls == NULL) {
        throw TypedJNIError("Failed to find class '"+name+"'.");
    }
    return TypedJNIClass(env, cls);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movq (%rsi), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
testq %rax, %rax
je 0x75ca
movq %rax, %rdx
movq 0x10(%rbx), %rax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x30e0
movq %rax, %rbx
leaq 0x201c(%rip), %rsi      # 0x95fa
leaq 0x28(%rsp), %rdi
movq %r14, %rdx
callq 0x782c
leaq 0x1fb5(%rip), %rsi      # 0x95a7
leaq 0x28(%rsp), %rdi
callq 0x32a0
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x761d
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x762a
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x31f0
leaq 0x5570(%rip), %rax      # 0xcbc8
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0x557c(%rip), %rsi      # 0xcbe0
movq 0x595d(%rip), %rdx      # 0xcfc8
movq %rbx, %rdi
callq 0x3260
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x7695
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x31b0
jmp 0x7695
movq %rax, %r14
movb $0x1, %bpl
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x76b8
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x31b0
jmp 0x76b8
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x76c5
movq %rbx, %rdi
callq 0x3120
movq %r14, %rdi
callq 0x3280
nop
// File: /workspace/github_cpp_makefile_star2_O1/sykeben[P]overos/os/kernel.cpp
// Function: settitle(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void settitle(string titleMsg) {
	#ifdef WIN32
		string title = "title ";
		title += titleMsg.c_str();
	#else
		string title = "echo -en \"\\033]0;";
		title += titleMsg.c_str();
		title += "\\a\"";
	#endif
	system(title.c_str());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xbee(%rip), %rsi       # 0x300a
leaq 0xbf8(%rip), %rdx       # 0x301b
leaq -0x38(%rbp), %r14
movq %r14, %rdi
callq 0x2c5a
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x2180
leaq 0xbdb(%rip), %rsi       # 0x301c
leaq -0x38(%rbp), %rdi
callq 0x2180
movq -0x38(%rbp), %rdi
callq 0x2080
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x2468
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x20b0
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x248b
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x20b0
movq %rbx, %rdi
callq 0x2160
// File: /workspace/github_cpp_makefile_star2_O1/sykeben[P]overos/os/kernel.cpp
// Function: fexists(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool fexists(const string& name) {
    if (FILE *file = fopen(name.c_str(), "r")) {
        fclose(file);
        return true;
    } else {
        return false;
    }   
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq (%rdi), %rdi
leaq 0xb65(%rip), %rsi       # 0x3008
callq 0x20f0
movq %rax, %rbx
testq %rax, %rax
je 0x24b8
movq %rbx, %rdi
callq 0x20a0
testq %rbx, %rbx
setne %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/SYZYGYfpga[P]brain-tools/src/sequencer-brain.cpp
// Function: i2cWrite(int, int, unsigned short, int, int, unsigned char*)
int i2cWrite (int i2c_file, int i2c_addr, uint16_t sub_addr,
              int sub_addr_length, int length, uint8_t data[32])
{
	uint8_t *buffer = (uint8_t *)malloc((length * sizeof(uint8_t)) + sub_addr_length);
	int i;

	memcpy(buffer + sub_addr_length, data, length * sizeof(uint8_t));

	// Set I2C address
	if (ioctl(i2c_file, I2C_SLAVE, i2c_addr) < 0) {
		return -1;
	}

	if (sub_addr_length == 2) {
		buffer[0] = (sub_addr >> 8) & 0xFF;
		buffer[1] = sub_addr & 0xFF;
	} else {
		buffer[0] = sub_addr & 0xFF;
	}

	for (i = 0; i < I2C_CHECK_COUNT; i++) {
		// The DNA Spec allows an MCU to NAK subsequent writes when multiple
		// writes are performed, keep trying for I2C_CHECK_COUNT tries before
		// giving up.
		if (write(i2c_file, buffer, sub_addr_length + length)
		      == (length + sub_addr_length)) {
			return 0;
		}
	}

	// We gave up trying to write
	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movl %r8d, %ebp
movl %ecx, %r12d
movl %edx, 0x8(%rsp)
movl %esi, 0xc(%rsp)
movl %edi, %ebx
movslq %r8d, %r13
movslq %ecx, %r15
leaq (%r15,%r13), %rdi
callq 0x10e0
movq %rax, %r14
addq %rax, %r15
movq %r15, %rdi
movq 0x10(%rsp), %rsi
movq %r13, %rdx
callq 0x10a0
movl $0x703, %esi            # imm = 0x703
movl %ebx, %edi
movl 0xc(%rsp), %edx
xorl %eax, %eax
callq 0x1110
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x1339
cmpl $0x2, %r12d
jne 0x130c
movl 0x8(%rsp), %eax
rolw $0x8, %ax
movw %ax, (%r14)
jmp 0x1313
movl 0x8(%rsp), %eax
movb %al, (%r14)
addl %r12d, %ebp
movslq %ebp, %r15
movl $0x7d0, %ebp            # imm = 0x7D0
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1060
cmpq %r15, %rax
je 0x1336
decl %ebp
jne 0x131e
jmp 0x1339
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/SYZYGYfpga[P]brain-tools/src/sequencer-brain.cpp
// Function: i2cRead(int, int, unsigned short, int, int, unsigned char*)
int i2cRead (int i2c_file, int i2c_addr, uint16_t sub_addr,
             int sub_addr_length, int length, uint8_t data[32])
{
	uint8_t temp_buf[2];

	// Set I2C address
	if (ioctl(i2c_file, I2C_SLAVE, i2c_addr) < 0) {
		return -1;
	}

	if (sub_addr_length == 2) {
		temp_buf[0] = (sub_addr >> 8) & 0xFF;
		temp_buf[1] = sub_addr & 0xFF;
	} else {
		temp_buf[0] = sub_addr & 0xFF;
	}

	if (write(i2c_file, temp_buf, sub_addr_length) != sub_addr_length) {
		return -1;
	}

	if (read(i2c_file, data, length) != length) {
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movl %r8d, %ebp
movl %ecx, %r12d
movl %edx, %r13d
movl %esi, %edx
movl %edi, %r14d
movl $0x703, %esi            # imm = 0x703
xorl %eax, %eax
callq 0x1110
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x13cb
cmpl $0x2, %r12d
jne 0x1390
rolw $0x8, %r13w
movw %r13w, 0x6(%rsp)
jmp 0x1395
movb %r13b, 0x6(%rsp)
movslq %r12d, %r12
leaq 0x6(%rsp), %rsi
movl %r14d, %edi
movq %r12, %rdx
callq 0x1060
cmpq %r12, %rax
jne 0x13cb
movslq %ebp, %r12
movl %r14d, %edi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x1120
xorl %r15d, %r15d
cmpq %r12, %rax
setne %r15b
negl %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/SYZYGYfpga[P]brain-tools/src/sequencer-brain.cpp
// Function: writeMCU(int, unsigned short, int, unsigned char*, int)
int writeMCU (int i2c_file, uint16_t port_addr, int sub_addr, uint8_t *data,
              int length)
{
	int temp_length, current_sub_addr;

	// Useful for debug
	//printf("Writing %d bytes to 0x%X, sub-address 0x%X\n", length, port_addr, sub_addr);

	current_sub_addr = sub_addr;

	while (length > 0) {
		temp_length = (length > 32) ? 32 : length;

		if (i2cWrite(i2c_file, port_addr, current_sub_addr, 2, temp_length,
		             &data[(current_sub_addr - sub_addr)]) != 0) {
			return -1;
		}

		current_sub_addr += temp_length;
		length -= temp_length;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
xorl %eax, %eax
testl %r8d, %r8d
jle 0x1446
movl %r8d, %ebp
movl %edx, %r14d
movl %edi, %r12d
movzwl %si, %r13d
movl %edx, %r15d
cmpl $0x20, %ebp
movl $0x20, %ebx
cmovll %ebp, %ebx
movl %r15d, %eax
subl %r14d, %eax
movslq %eax, %r9
addq (%rsp), %r9
movzwl %r15w, %edx
movl %r12d, %edi
movl %r13d, %esi
movl $0x2, %ecx
movl %ebx, %r8d
callq 0x1294
testl %eax, %eax
jne 0x1441
addl %ebx, %r15d
subl %ebx, %ebp
jg 0x1403
xorl %eax, %eax
jmp 0x1446
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/SYZYGYfpga[P]brain-tools/src/sequencer-brain.cpp
// Function: readMCU(int, unsigned short, int, unsigned char*, int)
int readMCU (int i2c_file, uint16_t port_addr, int sub_addr, uint8_t *data,
             int length)
{
	int current_sub_addr, temp_length;

	// Useful for debug
	//printf("Reading %d bytes from 0x%X, sub-address 0x%X\n", length, port_addr, sub_addr);

	current_sub_addr = sub_addr;

	while (length > 0) {
		temp_length = (length > 32) ? 32 : length;

		if (i2cRead(i2c_file, port_addr, current_sub_addr, 2, temp_length,
		            &data[(current_sub_addr - sub_addr)]) != 0) {
			return -1;
		}

		current_sub_addr += temp_length;
		length -= temp_length;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
xorl %eax, %eax
testl %r8d, %r8d
jle 0x14be
movl %r8d, %ebp
movl %edx, %r14d
movl %edi, %r12d
movzwl %si, %r13d
movl %edx, %r15d
cmpl $0x20, %ebp
movl $0x20, %ebx
cmovll %ebp, %ebx
movl %r15d, %eax
subl %r14d, %eax
movslq %eax, %r9
addq (%rsp), %r9
movzwl %r15w, %edx
movl %r12d, %edi
movl %r13d, %esi
movl $0x2, %ecx
movl %ebx, %r8d
callq 0x134b
testl %eax, %eax
jne 0x14b9
addl %ebx, %r15d
subl %ebx, %ebp
jg 0x147b
xorl %eax, %eax
jmp 0x14be
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/SYZYGYfpga[P]brain-tools/src/sequencer-brain.cpp
// Function: printHelp(char*)
void printHelp (char *progname)
{
	printf("Usage: %s [option [argument]] <i2c device>\n", progname);
	printf("  <i2c device> is required for all commands. It must contain the\n");
	printf("               path to the Linux i2c device\n");
	printf("\n");
	printf("  Exactly one of the following options must be specified:\n");
	printf("    -h - print this text\n");
	printf("    -w <filename> - write a binary DNA to a peripheral, takes the DNA filename\n");
	printf("                    as an argument\n");
	printf("    -d <filename> - dump the DNA from a peripheral to a binary file, takes the\n");
	printf("                    DNA filename as an argument\n");
	printf("\n");
	printf("  Examples:\n");
	printf("    Dump DNA from the MCU on Port 1:\n");
	printf("      %s -d seq_file.bin -p 1 /dev/i2c-1\n", progname);
	printf("    Set VIO1 to 3.3V:\n");
	printf("      %s -s -1 330 /dev/i2c-1\n", progname);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xb0b(%rip), %rdi       # 0x2004
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0xd8b(%rip), %rdi       # 0x2295
callq 0x1130
leaq 0xdc0(%rip), %rdi       # 0x22d6
callq 0x1130
movl $0xa, %edi
callq 0x10f0
leaq 0xdd6(%rip), %rdi       # 0x2302
callq 0x1130
leaq 0xe04(%rip), %rdi       # 0x233c
callq 0x1130
leaq 0xe11(%rip), %rdi       # 0x2355
callq 0x1130
leaq 0xe54(%rip), %rdi       # 0x23a4
callq 0x1130
leaq 0xe6b(%rip), %rdi       # 0x23c7
callq 0x1130
leaq 0xeae(%rip), %rdi       # 0x2416
callq 0x1130
movl $0xa, %edi
callq 0x10f0
leaq 0xec8(%rip), %rdi       # 0x2446
callq 0x1130
leaq 0xec8(%rip), %rdi       # 0x2452
callq 0x1130
leaq 0xa9a(%rip), %rdi       # 0x2030
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0xed0(%rip), %rdi       # 0x2477
callq 0x1130
leaq 0xaa7(%rip), %rdi       # 0x205a
movq %rbx, %rsi
xorl %eax, %eax
popq %rbx
jmp 0x1030
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./aids.hpp
// Function: aids::read_file_as_string_view(char const*)
Maybe<String_View> read_file_as_string_view(const char *filename)
    {
        FILE *f = fopen(filename, "rb");
        if (!f) return {};
        defer(fclose(f));

        int err = fseek(f, 0, SEEK_END);
        if (err < 0) return {};

        long size = ftell(f);
        if (size < 0) return {};

        err = fseek(f, 0, SEEK_SET);
        if (err < 0) return {};

        auto data = malloc(size);
        if (!data) return {};

        size_t read_size = fread(data, 1, size, f);
        if (read_size != (size_t) size && ferror(f)) return {};

        return {true, {static_cast<size_t>(size), static_cast<const char*>(data)}};
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x90a5(%rip), %rsi      # 0xa398
movq %rax, %rdi
callq 0x10e0
testq %rax, %rax
je 0x1386
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x10d0
testl %eax, %eax
js 0x136e
movq %r14, %rdi
callq 0x1030
testq %rax, %rax
js 0x136e
movq %rax, %r15
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10d0
testl %eax, %eax
js 0x136e
movq %r15, %rdi
callq 0x1110
testq %rax, %rax
je 0x136e
movq %rax, %r12
movl $0x1, %esi
movq %rax, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x1130
cmpq %r15, %rax
je 0x13a0
movq %r14, %rdi
callq 0x1180
testl %eax, %eax
je 0x13a0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq %r14, %rdi
callq 0x10a0
jmp 0x1394
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, (%rbx)
movq %r15, 0x8(%rbx)
movq %r12, 0x10(%rbx)
jmp 0x137c
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./aids.hpp
// Function: aids::sprint1(aids::String_Buffer*, char const*)
void sprint1(String_Buffer *buffer, const char *cstr)
    {
        int n = snprintf(
            buffer->data + buffer->size,
            buffer->capacity - buffer->size,
            "%s", cstr);
        buffer->size = min(buffer->size + n, buffer->capacity - 1);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rcx
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x10(%rdi), %rax
movq 0x8(%rdi), %rdi
addq %rax, %rdi
subq %rax, %rsi
leaq 0x8fb0(%rip), %rdx      # 0xa39b
xorl %eax, %eax
callq 0x1140
cltq
addq 0x10(%rbx), %rax
movq (%rbx), %rcx
decq %rcx
cmpq %rax, %rcx
cmovaeq %rax, %rcx
movq %rcx, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./aids.hpp
// Function: aids::sprint1(aids::String_Buffer*, aids::String_View)
void sprint1(String_Buffer *buffer, String_View view)
    {
        int n = snprintf(
            buffer->data + buffer->size,
            buffer->capacity - buffer->size,
            "%.*s", (int) view.count, view.data);
        buffer->size = min(buffer->size + n, buffer->capacity - 1);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdx, %r8
movq %rsi, %rcx
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x10(%rdi), %rax
movq 0x8(%rdi), %rdi
addq %rax, %rdi
subq %rax, %rsi
leaq 0x8f67(%rip), %rdx      # 0xa39e
xorl %eax, %eax
callq 0x1140
cltq
addq 0x10(%rbx), %rax
movq (%rbx), %rcx
decq %rcx
cmpq %rax, %rcx
cmovaeq %rax, %rcx
movq %rcx, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./aids.hpp
// Function: aids::sprint1(aids::String_Buffer*, char)
void sprint1(String_Buffer *buffer, char c)
    {
        int n = snprintf(
            buffer->data + buffer->size,
            buffer->capacity - buffer->size,
            "%c", c);
        buffer->size = min(buffer->size + n, buffer->capacity - 1);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %ecx
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x10(%rdi), %rax
movq 0x8(%rdi), %rdi
addq %rax, %rdi
subq %rax, %rsi
leaq 0x8f24(%rip), %rdx      # 0xa3a3
xorl %eax, %eax
callq 0x1140
cltq
addq 0x10(%rbx), %rax
movq (%rbx), %rcx
decq %rcx
cmpq %rax, %rcx
cmovaeq %rax, %rcx
movq %rcx, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./aids.hpp
// Function: aids::sprint1(aids::String_Buffer*, float)
void sprint1(String_Buffer *buffer, float f)
    {
        int n = snprintf(
            buffer->data + buffer->size,
            buffer->capacity - buffer->size,
            "%f", f);
        buffer->size = min(buffer->size + n, buffer->capacity - 1);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x10(%rdi), %rax
movq 0x8(%rdi), %rdi
addq %rax, %rdi
subq %rax, %rsi
cvtss2sd %xmm0, %xmm0
leaq 0x8edd(%rip), %rdx      # 0xa3a6
movb $0x1, %al
callq 0x1140
cltq
addq 0x10(%rbx), %rax
movq (%rbx), %rcx
decq %rcx
cmpq %rax, %rcx
cmovaeq %rax, %rcx
movq %rcx, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./aids.hpp
// Function: aids::sprint1(aids::String_Buffer*, unsigned long long)
void sprint1(String_Buffer *buffer, unsigned long long x)
    {
        int n = snprintf(
            buffer->data + buffer->size,
            buffer->capacity - buffer->size,
            "%llu", x);
        buffer->size = min(buffer->size + n, buffer->capacity - 1);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rcx
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x10(%rdi), %rax
movq 0x8(%rdi), %rdi
addq %rax, %rdi
subq %rax, %rsi
leaq 0x8e97(%rip), %rdx      # 0xa3a9
xorl %eax, %eax
callq 0x1140
cltq
addq 0x10(%rbx), %rax
movq (%rbx), %rcx
decq %rcx
cmpq %rax, %rcx
cmovaeq %rax, %rcx
movq %rcx, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./aids.hpp
// Function: aids::sprint1(aids::String_Buffer*, unsigned int)
void sprint1(String_Buffer *buffer, unsigned int x)
    {
        int n = snprintf(
            buffer->data + buffer->size,
            buffer->capacity - buffer->size,
            "%u", x);
        buffer->size = min(buffer->size + n, buffer->capacity - 1);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %ecx
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x10(%rdi), %rax
movq 0x8(%rdi), %rdi
addq %rax, %rdi
subq %rax, %rsi
leaq 0x8e54(%rip), %rdx      # 0xa3ae
xorl %eax, %eax
callq 0x1140
cltq
addq 0x10(%rbx), %rax
movq (%rbx), %rcx
decq %rcx
cmpq %rax, %rcx
cmovaeq %rax, %rcx
movq %rcx, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./aids.hpp
// Function: aids::sprint1(aids::String_Buffer*, int)
void sprint1(String_Buffer *buffer, int x)
    {
        int n = snprintf(
            buffer->data + buffer->size,
            buffer->capacity - buffer->size,
            "%d", x);
        buffer->size = min(buffer->size + n, buffer->capacity - 1);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %ecx
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x10(%rdi), %rax
movq 0x8(%rdi), %rdi
addq %rax, %rdi
subq %rax, %rsi
leaq 0x8dca(%rip), %rdx      # 0xa3b5
xorl %eax, %eax
callq 0x1140
cltq
addq 0x10(%rbx), %rax
movq (%rbx), %rcx
decq %rcx
cmpq %rax, %rcx
cmovaeq %rax, %rcx
movq %rcx, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./aids.hpp
// Function: aids::sprint1(aids::String_Buffer*, long)
void sprint1(String_Buffer *buffer, long int x)
    {
        int n = snprintf(
            buffer->data + buffer->size,
            buffer->capacity - buffer->size,
            "%ld", x);
        buffer->size = min(buffer->size + n, buffer->capacity - 1);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rcx
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x10(%rdi), %rax
movq 0x8(%rdi), %rdi
addq %rax, %rdi
subq %rax, %rsi
leaq 0x8d84(%rip), %rdx      # 0xa3b8
xorl %eax, %eax
callq 0x1140
cltq
addq 0x10(%rbx), %rax
movq (%rbx), %rcx
decq %rcx
cmpq %rax, %rcx
cmovaeq %rax, %rcx
movq %rcx, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./aids.hpp
// Function: aids::print1(_IO_FILE*, aids::Escape)
void print1(FILE *stream, Escape escape)
    {
        for (size_t i = 0; i < escape.unwrap.count; ++i) {
            switch (escape.unwrap.data[i]) {
            case '\a': print(stream, "\\a"); break;
            case '\b': print(stream, "\\b"); break;
            case '\f': print(stream, "\\f"); break;
            case '\n': print(stream, "\\n"); break;
            case '\r': print(stream, "\\r"); break;
            case '\t': print(stream, "\\t"); break;
            case '\v': print(stream, "\\v"); break;
            default: print(stream, escape.unwrap.data[i]);
            }
        }
    }

// Assembly:
testq %rsi, %rsi
je 0x19eb
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
leaq 0x86ed(%rip), %r12      # 0xa010
movzbl (%rbx,%r13), %eax
leal -0x7(%rax), %ecx
cmpl $0x6, %ecx
ja 0x1985
movslq (%r12,%rcx,4), %rax
addq %r12, %rax
jmpq *%rax
movl $0x1, %esi
movl $0x2, %edx
leaq 0x8a7d(%rip), %rdi      # 0xa3c7
jmp 0x19c9
movl $0x1, %esi
movl $0x2, %edx
leaq 0x8a7c(%rip), %rdi      # 0xa3d9
jmp 0x19c9
movl $0x1, %esi
movl $0x2, %edx
leaq 0x8a66(%rip), %rdi      # 0xa3d6
jmp 0x19c9
movl $0x1, %esi
movl $0x2, %edx
leaq 0x8a4d(%rip), %rdi      # 0xa3d0
jmp 0x19c9
movsbl %al, %edi
movq %r15, %rsi
callq 0x1100
jmp 0x19d1
movl $0x1, %esi
movl $0x2, %edx
leaq 0x8a27(%rip), %rdi      # 0xa3ca
jmp 0x19c9
movl $0x1, %esi
movl $0x2, %edx
leaq 0x8a17(%rip), %rdi      # 0xa3cd
jmp 0x19c9
movl $0x1, %esi
movl $0x2, %edx
leaq 0x8a0a(%rip), %rdi      # 0xa3d3
movq %r15, %rcx
callq 0x1190
incq %r13
cmpq %r13, %r14
jne 0x1923
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_type_checker.cpp
// Function: Type_Checker::type_of_name(unsigned long, aids::String_View) const
Type Type_Checker::type_of_name(size_t offset, String_View name) const
{
    auto scope0 = scope;

    while (scope0) {
        Args_List *args_list = scope0->args_list;
        while (args_list) {
            if (name == args_list->var_def.name) {
                return args_list->var_def.type;
            }
            args_list = args_list->next;
        }
        scope0 = scope0->next;
    }

    reporter.fail(offset, "Could not find name `", name, "` in the current scope");
    return Type::Unchecked;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, -0x40(%rbp)
movq %rdi, -0x38(%rbp)
movq 0x28(%rdi), %r15
testq %r15, %r15
je 0x1bdc
movq (%r15), %r13
testq %r13, %r13
sete %r12b
je 0x1bb7
cmpq %r14, (%r13)
jne 0x1bb1
movq 0x8(%r13), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x10c0
testl %eax, %eax
je 0x1bbd
movq 0x18(%r13), %r13
jmp 0x1b8f
movq 0x8(%r15), %r15
jmp 0x1bc4
movl 0x10(%r13), %eax
movl %eax, -0x2c(%rbp)
testb $0x1, %r12b
jne 0x1b87
movl -0x2c(%rbp), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
leaq 0x87f1(%rip), %rdx      # 0xa3dc
leaq 0x8800(%rip), %r9       # 0xa3f2
movq -0x40(%rbp), %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x70a4
nop
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_type_checker.cpp
// Function: Type_Checker::push_scope(Args_List*)
void Type_Checker::push_scope(Args_List *args_list)
{
    auto scope0 = memory->alloc<Scope>();
    scope0->args_list = args_list;
    scope0->next = scope;
    scope = scope0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movl $0x1, %esi
callq 0x70d2
movq %rbx, (%rax)
movq 0x28(%r14), %rcx
movq %rcx, 0x8(%rax)
movq %rax, 0x28(%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_type_checker.cpp
// Function: Type_Checker::push_var_def(Var_Def)
void Type_Checker::push_var_def(Var_Def var_def)
{
    assert(scope);
    auto args_list = memory->alloc<Args_List>();
    args_list->var_def = var_def;
    args_list->next = scope->args_list;
    scope->args_list = args_list;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpq $0x0, 0x28(%rdi)
je 0x1caa
movq %rdi, %rbx
leaq 0x10(%rbp), %r14
movq (%rdi), %rdi
movl $0x1, %esi
callq 0x715a
movups (%r14), %xmm0
movups %xmm0, (%rax)
movq 0x10(%r14), %rcx
movq %rcx, 0x10(%rax)
movq 0x28(%rbx), %rcx
movq (%rcx), %rdx
movq %rdx, 0x18(%rax)
movq %rax, (%rcx)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x8752(%rip), %rdi      # 0xa403
leaq 0x8751(%rip), %rsi      # 0xa409
leaq 0x8784(%rip), %rcx      # 0xa443
movl $0x26, %edx
callq 0x1090
nop
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_type_checker.cpp
// Function: Type_Checker::cast_expression_to(Expression*, Type)
Expression *Type_Checker::cast_expression_to(Expression *expression, Type type)
{
    Expression *cast_expression = memory->alloc<Expression>();
    cast_expression->kind = Expression_Kind::Type_Cast;
    cast_expression->type = type;
    cast_expression->offset = expression->offset;
    cast_expression->type_cast.type = cast_expression->type;
    cast_expression->type_cast.expression = expression;
    return cast_expression;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq (%rdi), %rdi
movl $0x1, %esi
callq 0x71e2
movl $0x4, (%rax)
movl %ebx, 0x4(%rax)
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%rax)
movl %ebx, 0x10(%rax)
movq %r14, 0x18(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_type_checker.cpp
// Function: is_expression_implicitly_convertible_to(Expression*, Type)
bool is_expression_implicitly_convertible_to(Expression *expression, Type target_type)
{
    assert(expression->type != Type::Unchecked && "Unchecked type in a checked context");
    assert(target_type != Type::Unchecked && "Unchecked type in a checked context");

    for (size_t i = 0; i < implicit_conversion_table_count; ++i) {
        const size_t SOURCE = 0;
        const size_t TARGET = 1;
        if (implicit_conversion_table[i][SOURCE] == expression->type &&
            implicit_conversion_table[i][TARGET] == target_type) {
            return true;
        }
    }

    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x4(%rdi), %ecx
testl %ecx, %ecx
je 0x1d3d
testl %esi, %esi
je 0x1d5c
movb $0x1, %al
xorl %edi, %edi
leaq 0x8626(%rip), %rdx      # 0xa340
cmpl %ecx, (%rdx,%rdi,8)
jne 0x1d25
cmpl %esi, 0x4(%rdx,%rdi,8)
je 0x1d39
cmpq $0xa, %rdi
leaq 0x1(%rdi), %r8
setb %al
movq %r8, %rdi
cmpq $0xb, %r8
jne 0x1d1a
andb $0x1, %al
popq %rbp
retq
leaq 0x8728(%rip), %rdi      # 0xa46c
leaq 0x86be(%rip), %rsi      # 0xa409
leaq 0x8767(%rip), %rcx      # 0xa4b9
movl $0x55, %edx
callq 0x1090
leaq 0x8797(%rip), %rdi      # 0xa4fa
leaq 0x869f(%rip), %rsi      # 0xa409
leaq 0x8748(%rip), %rcx      # 0xa4b9
movl $0x56, %edx
callq 0x1090
nop
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_type_checker.cpp
// Function: Type_Checker::try_implicitly_convert_expression_to(Expression*, Type)
Expression *Type_Checker::try_implicitly_convert_expression_to(Expression *expression, Type cast_type)
{
    if (is_expression_implicitly_convertible_to(expression, cast_type)) {
        return cast_expression_to(expression, cast_type);
    } else {
        reporter.fail(expression->offset, "Expression of type `", expression->type, "` is not convertable to `", cast_type, "`");
    }

    return expression;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
movl %edx, %esi
callq 0x1d00
testb %al, %al
je 0x1dcc
movq (%r15), %rdi
movl $0x1, %esi
callq 0x71e2
movl $0x4, (%rax)
movl %ebx, 0x4(%rax)
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%rax)
movl %ebx, 0x10(%rax)
movq %r14, 0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %r15
movq 0x8(%r14), %rsi
movl 0x4(%r14), %ecx
leaq 0x88a2(%rip), %rax      # 0xa681
movq %rax, (%rsp)
leaq 0x8758(%rip), %rdx      # 0xa542
leaq 0x8766(%rip), %r8       # 0xa557
movq %r15, %rdi
movl %ebx, %r9d
callq 0x726a
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_type_checker.cpp
// Function: Type_Checker::check_types_of_local_var_def(Local_Var_Def*, Type)
void Type_Checker::check_types_of_local_var_def(Local_Var_Def *local_var_def, Type expected_type)
{
    local_var_def->value = try_implicitly_convert_expression_to(
        check_types_of_expression(local_var_def->value),
        local_var_def->def.type);

    const auto TYPE_OF_LOCAL_VAR_DEF = Type::U0;

    if (expected_type != TYPE_OF_LOCAL_VAR_DEF) {
        // TODO: use offset of the local_var_def itself instead of its value;
        reporter.fail(local_var_def->value->offset, "Expected statement of type `", expected_type, "`, but local variable definition has the type `", TYPE_OF_LOCAL_VAR_DEF, "`");
    }

    push_var_def(local_var_def->def);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movq 0x18(%rsi), %r12
movq %r12, %rsi
callq 0x1e92
movl 0x10(%r15), %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1d7c
movq %rax, 0x18(%r15)
cmpl $0x1, %r14d
jne 0x1e5f
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x1c66
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %rbx
movq 0x8(%rax), %rsi
leaq 0x8813(%rip), %rax      # 0xa681
movq %rax, (%rsp)
leaq 0x86f8(%rip), %rdx      # 0xa571
leaq 0x870e(%rip), %r8       # 0xa58e
movq %rbx, %rdi
movl %r14d, %ecx
movl $0x1, %r9d
callq 0x726a
nop
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_type_checker.cpp
// Function: Type_Checker::check_types_of_while(While*, Type)
void Type_Checker::check_types_of_while(While *hwile, Type expected_type)
{
    hwile->condition = try_implicitly_convert_expression_to(
        check_types_of_expression(hwile->condition),
        Type::Bool);
    // TODO: use offset of the hwile body itself instead of its condition
    check_types_of_block(hwile->condition->offset, hwile->body, Type::U0);

    const auto TYPE_OF_WHILE = Type::U0;
    if (expected_type != TYPE_OF_WHILE) {
        // TODO: use offset of the hwile itself instead of its condition;
        reporter.fail(hwile->condition->offset, "Expected statement of type `", expected_type, "`, but while-loop construction has the type `", TYPE_OF_WHILE, "`");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %r12
movq %r12, %rsi
callq 0x1e92
movq %r14, %rdi
movq %r12, %rsi
movl $0x5, %edx
callq 0x1d7c
movq %rax, (%r15)
movq 0x8(%rax), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
movl $0x1, %ecx
callq 0x2204
cmpl $0x1, %ebx
jne 0x21d0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %r14
movq (%r15), %rax
movq 0x8(%rax), %rsi
leaq 0x849f(%rip), %rax      # 0xa681
movq %rax, (%rsp)
leaq 0x8384(%rip), %rdx      # 0xa571
leaq 0x83ca(%rip), %r8       # 0xa5be
movq %r14, %rdi
movl %ebx, %ecx
movl $0x1, %r9d
callq 0x726a
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_type_checker.cpp
// Function: Type_Checker::check_types_of_block(unsigned long, Block*, Type)
void Type_Checker::check_types_of_block(size_t offset, Block *block, Type expected_type)
{
    push_scope();

    if (!block) {
        const Type TYPE_OF_EMPTY_BLOCK = Type::U0;
        if (expected_type != TYPE_OF_EMPTY_BLOCK) {
            reporter.fail(offset, "Expected type `", expected_type, "` but empty block has type `", TYPE_OF_EMPTY_BLOCK, "`");
        }
    }

    while (block && block->next != nullptr) {
        check_types_of_statement(&block->statement, Type::U0);
        block = block->next;
    }

    if (block) {
        check_types_of_statement(&block->statement, expected_type);
    }

    pop_scope();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq (%rdi), %rdi
movl $0x1, %esi
callq 0x70d2
movq $0x0, (%rax)
movq 0x28(%rbx), %rcx
movq %rcx, 0x8(%rax)
movq %rax, 0x28(%rbx)
testq %r15, %r15
sete %al
cmpl $0x1, %r14d
setne %cl
testb %cl, %al
jne 0x229e
testq %r15, %r15
je 0x2280
cmpq $0x0, 0x30(%r15)
je 0x2272
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x247e
movq 0x30(%r15), %r15
jmp 0x2250
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x247e
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x22cf
movq 0x8(%rax), %rax
movq %rax, 0x28(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %rbx
leaq 0x83d8(%rip), %rax      # 0xa681
movq %rax, (%rsp)
leaq 0x849d(%rip), %rdx      # 0xa751
leaq 0x84a6(%rip), %r8       # 0xa761
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %ecx
movl $0x1, %r9d
callq 0x726a
leaq 0x812d(%rip), %rdi      # 0xa403
leaq 0x812c(%rip), %rsi      # 0xa409
leaq 0x8140(%rip), %rcx      # 0xa424
movl $0x20, %edx
callq 0x1090
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_type_checker.cpp
// Function: Type_Checker::check_types_of_if(If*, Type)
void Type_Checker::check_types_of_if(If *iph, Type expected_type)
{
    iph->condition = try_implicitly_convert_expression_to(
        check_types_of_expression(iph->condition),
        Type::Bool);
    // TODO: use offsets of the `then` and `else` blocks themselves instead of the if condition
    check_types_of_block(iph->condition->offset, iph->then, expected_type);
    check_types_of_block(iph->condition->offset, iph->elze, expected_type);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %r12
movq %r12, %rsi
callq 0x1e92
movq %r15, %rdi
movq %r12, %rsi
movl $0x5, %edx
callq 0x1d7c
movq %rax, (%r14)
movq 0x8(%rax), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
movl %ebx, %ecx
callq 0x2204
movq (%r14), %rax
movq 0x10(%r14), %rdx
movq 0x8(%rax), %rsi
movq %r15, %rdi
movl %ebx, %ecx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2204
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_type_checker.cpp
// Function: Type_Checker::check_types_of_assignment(Assignment*, Type)
void Type_Checker::check_types_of_assignment(Assignment *assignment, Type expected_type)
{
    // TODO: check_types_of_assignment should report errors on the assignment's offset, not its value one
    // TODO: assigment could be an expression that has the type of the variable it assigns
    size_t offset = assignment->value->offset;
    assignment->value = try_implicitly_convert_expression_to(
        check_types_of_expression(assignment->value),
        type_of_name(offset, assignment->var_name));

    const auto TYPE_OF_ASSIGNMENT = Type::U0;
    if (expected_type != TYPE_OF_ASSIGNMENT) {
        // TODO: use offset of the assignment itself instead of its value
        reporter.fail(assignment->value->offset, "Expected statement of type `", expected_type, "`, but assignment has the type `", TYPE_OF_ASSIGNMENT, "`");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movq 0x10(%rsi), %r12
movq 0x8(%r12), %r13
movq %r12, %rsi
callq 0x1e92
movq (%r15), %rdx
movq 0x8(%r15), %rcx
movq %r14, %rdi
movq %r13, %rsi
callq 0x1b64
movq %r14, %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0x1d7c
movq %rax, 0x10(%r15)
cmpl $0x1, %ebx
jne 0x23ac
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %r14
movq 0x8(%rax), %rsi
leaq 0x82c6(%rip), %rax      # 0xa681
movq %rax, (%rsp)
leaq 0x81ab(%rip), %rdx      # 0xa571
leaq 0x821f(%rip), %r8       # 0xa5ec
movq %r14, %rdi
movl %ebx, %ecx
movl $0x1, %r9d
callq 0x726a
nop
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_type_checker.cpp
// Function: Type_Checker::check_types_of_return(Return*, Type)
void Type_Checker::check_types_of_return(Return *reeturn, Type expected_type)
{
    assert(current_func_def && "Type checking return statement outside of a Func_Def context");
    reeturn->value = try_implicitly_convert_expression_to(
        check_types_of_expression(reeturn->value),
        current_func_def->return_type);

    const auto TYPE_OF_RETURN = Type::U0;
    if (expected_type != TYPE_OF_RETURN) {
        // TODO: use offset of the assignment itself instead of its value
        reporter.fail(reeturn->value->offset, "Expected statement of type `", expected_type, "`, but return has the type `", TYPE_OF_RETURN, "`");
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpq $0x0, 0x30(%rdi)
je 0x242e
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %r12
movq %r12, %rsi
callq 0x1e92
movq 0x30(%r14), %rax
movl 0x18(%rax), %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x1d7c
movq %rax, (%r15)
cmpl $0x1, %ebx
jne 0x244d
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8273(%rip), %rdi      # 0xa6a8
leaq 0x7fcd(%rip), %rsi      # 0xa409
leaq 0x82b8(%rip), %rcx      # 0xa6fb
movl $0xfd, %edx
callq 0x1090
addq $0x8, %r14
movq 0x8(%rax), %rsi
leaq 0x8225(%rip), %rax      # 0xa681
movq %rax, (%rsp)
leaq 0x810a(%rip), %rdx      # 0xa571
leaq 0x82c6(%rip), %r8       # 0xa734
movq %r14, %rdi
movl %ebx, %ecx
movl $0x1, %r9d
callq 0x726a
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_type_checker.cpp
// Function: Type_Checker::check_types_of_statement(Statement*, Type)
void Type_Checker::check_types_of_statement(Statement *statement, Type expected_type)
{
    switch (statement->kind) {
    case Statement_Kind::Local_Var_Def:
        check_types_of_local_var_def(&statement->local_var_def, expected_type);
        break;
    case Statement_Kind::While:
        check_types_of_while(&statement->hwile, expected_type);
        break;
    case Statement_Kind::If:
        check_types_of_if(&statement->iph, expected_type);
        break;
    case Statement_Kind::Assignment:
        check_types_of_assignment(&statement->assignment, expected_type);
        break;
    case Statement_Kind::Expression:
        statement->expression = try_implicitly_convert_expression_to(
            check_types_of_expression(statement->expression),
            expected_type);
        break;
    case Statement_Kind::Return:
        check_types_of_return(&statement->reeturn, expected_type);
        break;
    }

    statement->type = expected_type;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movl (%rsi), %eax
cmpq $0x5, %rax
ja 0x251d
movq %rdi, %r15
leaq 0x7bb8(%rip), %rcx      # 0xa05c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10(%r14), %rsi
movq %r15, %rdi
movl %ebx, %edx
callq 0x1dfc
jmp 0x251d
movq 0x10(%r14), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x1e92
movq %r15, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x1d7c
movq %rax, 0x10(%r14)
jmp 0x251d
leaq 0x10(%r14), %rsi
movq %r15, %rdi
movl %ebx, %edx
callq 0x22ee
jmp 0x251d
leaq 0x10(%r14), %rsi
movq %r15, %rdi
movl %ebx, %edx
callq 0x234e
jmp 0x251d
leaq 0x10(%r14), %rsi
movq %r15, %rdi
movl %ebx, %edx
callq 0x2174
jmp 0x251d
leaq 0x10(%r14), %rsi
movq %r15, %rdi
movl %ebx, %edx
callq 0x23de
movl %ebx, 0x4(%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_type_checker.cpp
// Function: Type_Checker::check_types_of_func_def(Func_Def*)
void Type_Checker::check_types_of_func_def(Func_Def *func_def)
{
    assert(current_func_def == nullptr &&
           "Checking types of Func_Def in the contenxt of other Func_Def. This kinda stuff is not supported yet.");
    current_func_def = func_def;
    push_scope(func_def->args_list);
    // TODO: use offset of the body instead of func_def
    check_types_of_block(func_def->offset, func_def->body, func_def->return_type);
    current_func_def = nullptr;
    pop_scope();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpq $0x0, 0x30(%rdi)
jne 0x259d
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, 0x30(%rdi)
movq 0x10(%rsi), %r15
movq (%rdi), %rdi
movl $0x1, %esi
callq 0x70d2
movq %r15, (%rax)
movq 0x28(%rbx), %rcx
movq %rcx, 0x8(%rax)
movq %rax, 0x28(%rbx)
movq 0x28(%r14), %rsi
movq 0x20(%r14), %rdx
movl 0x18(%r14), %ecx
movq %rbx, %rdi
callq 0x2204
movq $0x0, 0x30(%rbx)
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x25bc
movq 0x8(%rax), %rax
movq %rax, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x81da(%rip), %rdi      # 0xa77e
leaq 0x7e5e(%rip), %rsi      # 0xa409
leaq 0x8252(%rip), %rcx      # 0xa804
movl $0x13f, %edx            # imm = 0x13F
callq 0x1090
leaq 0x7e40(%rip), %rdi      # 0xa403
leaq 0x7e3f(%rip), %rsi      # 0xa409
leaq 0x7e53(%rip), %rcx      # 0xa424
movl $0x20, %edx
callq 0x1090
nop
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_parser.cpp
// Function: print1(_IO_FILE*, Top_Level_Def*)
void print1(FILE *stream, Top_Level_Def *top_level_def)
{
    print(stream, "(");
    while (top_level_def) {
        print(stream, top_level_def->func_def, " ");
        top_level_def = top_level_def->next;
    }
    print(stream, ")");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x28, %edi
movq %rbx, %rsi
callq 0x1100
testq %r14, %r14
je 0x32cc
leaq 0x71c9(%rip), %r13      # 0xa441
leaq 0x7710(%rip), %r15      # 0xa98f
leaq 0x77a4(%rip), %r12      # 0xaa2a
movq (%r14), %rdx
movq 0x8(%r14), %rcx
movq 0x10(%r14), %r9
movl 0x18(%r14), %eax
subq $0x8, %rsp
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %r8
pushq %r13
pushq 0x20(%r14)
pushq %r15
pushq %rax
pushq %r15
callq 0x7a44
addq $0x30, %rsp
movl $0x20, %edi
movq %rbx, %rsi
callq 0x1100
movq 0x30(%r14), %r14
testq %r14, %r14
jne 0x3286
movl $0x29, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1100
// File: /workspace/github_cpp_makefile_star2_O1/tsoding[P]wcc/src/./wcc_parser.cpp
// Function: print1(_IO_FILE*, Expression_Kind)
void print1(FILE *stream, Expression_Kind expression_kind)
{
    switch (expression_kind) {
    case Expression_Kind::Number_Literal:
        print(stream, "Number_Literal");
        break;
    case Expression_Kind::Variable:
        print(stream, "Variable");
        break;
    case Expression_Kind::Plus:
        print(stream, "Plus");
        break;
    case Expression_Kind::Greater:
        print(stream, "Greater");
        break;
    case Expression_Kind::Type_Cast:
        print(stream, "Type_Cast");
        break;
    case Expression_Kind::Less_Equals:
        print(stream, "Less_Equals");
        break;
    case Expression_Kind::Minus:
        print(stream, "Minus");
        break;
    case Expression_Kind::Rem:
        print(stream, "Rem");
        break;
    case Expression_Kind::And:
        print(stream, "And");
        break;
    case Expression_Kind::Multiply:
        print(stream, "Multiply");
        break;
    case Expression_Kind::Equals:
        print(stream, "Equals");
        break;
    case Expression_Kind::Bool_Literal:
        print(stream, "Bool_Literal");
        break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0xb, %esi
ja 0x3401
movq %rdi, %rcx
movl %esi, %eax
leaq 0x6e31(%rip), %rdx      # 0xa14c
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
leaq 0x7558(%rip), %rdi      # 0xa883
movl $0x1, %esi
movl $0xe, %edx
jmp 0x33fb
leaq 0x767d(%rip), %rdi      # 0xa9be
movl $0x1, %esi
movl $0xc, %edx
jmp 0x33fb
leaq 0x7654(%rip), %rdi      # 0xa9ab
movl $0x1, %esi
movl $0x9, %edx
jmp 0x33fb
leaq 0x7648(%rip), %rdi      # 0xa9b5
jmp 0x33a5
leaq 0x7536(%rip), %rdi      # 0xa8ac
movl $0x1, %esi
movl $0x4, %edx
jmp 0x33fb
leaq 0x750f(%rip), %rdi      # 0xa898
movl $0x1, %esi
movl $0x7, %edx
jmp 0x33fb
leaq 0x753c(%rip), %rdi      # 0xa8d8
jmp 0x33f1
leaq 0x75fd(%rip), %rdi      # 0xa9a2
movl $0x1, %esi
movl $0x8, %edx
jmp 0x33fb
leaq 0x74e8(%rip), %rdi      # 0xa8a0
movl $0x1, %esi
movl $0xb, %edx
jmp 0x33fb
leaq 0x74f3(%rip), %rdi      # 0xa8be
movl $0x1, %esi
movl $0x5, %edx
jmp 0x33fb
leaq 0x7516(%rip), %rdi      # 0xa8f4
movl $0x1, %esi
movl $0x6, %edx
jmp 0x33fb
leaq 0x74e3(%rip), %rdi      # 0xa8d4
movl $0x1, %esi
movl $0x3, %edx
popq %rbp
jmp 0x1190
popq %rbp
retq