// File: /workspace/github_c_makefile_star2_O2/Ihsoh[P]ilang/compiler/frontend/semantics.c
// Function: print_type_node
static void _print_type_node(ParserASTNode *node, FILE *file) {
	assert(node);
	assert(file);

	switch (node->type) {
		case FE_NODE_TYPE_CHAR: {
			assert(node->nchilds == 0);
			fputs("char", file);
			break;
		}
		case FE_NODE_TYPE_INT8: {
			assert(node->nchilds == 0);
			fputs("int8", file);
			break;
		}
		case FE_NODE_TYPE_UINT8: {
			assert(node->nchilds == 0);
			fputs("uint8", file);
			break;
		}
		case FE_NODE_TYPE_INT16: {
			assert(node->nchilds == 0);
			fputs("int16", file);
			break;
		}
		case FE_NODE_TYPE_UINT16: {
			assert(node->nchilds == 0);
			fputs("uint16", file);
			break;
		}
		case FE_NODE_TYPE_INT32: {
			assert(node->nchilds == 0);
			fputs("int32", file);
			break;
		}
		case FE_NODE_TYPE_UINT32: {
			assert(node->nchilds == 0);
			fputs("uint32", file);
			break;
		}
		case FE_NODE_TYPE_INT64: {
			assert(node->nchilds == 0);
			fputs("int64", file);
			break;
		}
		case FE_NODE_TYPE_UINT64: {
			assert(node->nchilds == 0);
			fputs("uint64", file);
			break;
		}
		case FE_NODE_TYPE_FLOAT: {
			assert(node->nchilds == 0);
			fputs("float", file);
			break;
		}
		case FE_NODE_TYPE_DOUBLE: {
			assert(node->nchilds == 0);
			fputs("double", file);
			break;
		}
		case FE_NODE_TYPE_STRUCT: {
			assert(node->nchilds == 1);

			fputs("struct ", file);

			ParserASTNode *node_id = node->childs[0];
			assert(node_id->type == FE_NODE_IDENTIFIER);

			cmn_print_token(node_id->token, file);
			break;
		}
		case FE_NODE_TYPE_ARRAY: {
			assert(node->nchilds == 2);
			ParserASTNode *node_array_dims = node->childs[0];
			assert(node_array_dims->type == FE_NODE_TYPE_ARRAY_DIMS);
			ParserASTNode *node_t = node->childs[1];

			for (int i = 0; i < node_array_dims->nchilds; i++) {
				ParserASTNode *node_array_dim = node_array_dims->childs[i];
				assert(node_array_dim->type == FE_NODE_LITERAL_UINT);
				fputc('[', file);
				cmn_print_token(node_array_dim->token, file);
				fputc(']', file);
			}

			_print_type_node(node_t, file);

			break;
		}
		case FE_NODE_TYPE_FUNC: {
			assert(node->nchilds == 1 || node->nchilds == 2);
			ParserASTNode *node_params = NULL;
			ParserASTNode *node_t = NULL;

			node_params = node->childs[0];
			if (node->nchilds == 2) {
				node_t = node->childs[1];
			}

			_print_func_params(node_params, file);

			if (node_t != NULL) {
				fputc(':', file);
				_print_type_node(node_t, file);
			}
			break;
		}
		case FE_NODE_TYPE_POINTER: {
			assert(node->nchilds == 1);
			ParserASTNode *node_t = node->childs[0];

			fputc('*', file);

			_print_type_node(node_t, file);
			break;
		}
		case FE_NODE_TYPE_VOID: {
			assert(node->nchilds == 0);
			fputs("void", file);
			break;
		}
		default: {
			assert(0);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %r14, %r14
je 0x31fd2
movl (%r14), %eax
cmpl $0x420, %eax            # imm = 0x420
je 0x31c0b
cmpl $0x430, %eax            # imm = 0x430
je 0x31c77
cmpl $0x440, %eax            # imm = 0x440
jne 0x31dd4
cmpl $0x1, 0x44(%r14)
jne 0x3202f
movq 0x48(%r14), %rax
movq (%rax), %r14
pushq $0x2a
popq %rdi
jmp 0x31dc7
cmpl $0x2, 0x44(%r14)
jne 0x3208c
movq 0x48(%r14), %rax
movq (%rax), %r15
cmpl $0x421, (%r15)          # imm = 0x421
jne 0x3206d
movq 0x8(%rax), %r14
xorl %r12d, %r12d
movslq 0x44(%r15), %rax
cmpq %rax, %r12
jge 0x31bc8
movq 0x48(%r15), %rax
movq (%rax,%r12,8), %r13
cmpl $0x300, (%r13)          # imm = 0x300
jne 0x31f63
pushq $0x5b
popq %rdi
movq %rbx, %rsi
callq 0x30c0
movq 0x10(%r13), %rdi
movq %rbx, %rsi
callq 0x3a60
pushq $0x5d
popq %rdi
movq %rbx, %rsi
callq 0x30c0
incq %r12
jmp 0x31c31
movl 0x44(%r14), %ecx
leal -0x1(%rcx), %eax
cmpl $0x2, %eax
jae 0x32010
movq 0x48(%r14), %rax
cmpl $0x2, %ecx
jne 0x31c96
movq 0x8(%rax), %r14
jmp 0x31c99
xorl %r14d, %r14d
movq (%rax), %r15
testq %r15, %r15
je 0x3204e
cmpl $0x0, 0x44(%r15)
jle 0x31dbb
movq 0x48(%r15), %rax
movq (%rax), %rax
cmpl $0xa02, (%rax)          # imm = 0xA02
jne 0x320b4
cmpl $0x2, 0x44(%rax)
jne 0x320ab
movq 0x48(%rax), %rax
movq (%rax), %rcx
cmpl $0x200, (%rcx)          # imm = 0x200
jne 0x320d3
movq 0x8(%rax), %r12
movq 0x10(%rcx), %rdi
movq %rbx, %rsi
callq 0x3a60
leaq 0x18b3b(%rip), %rdi     # 0x4a832
movq %rbx, %rsi
callq 0x30b0
movq %r12, %rdi
movq %rbx, %rsi
callq 0x31bb4
pushq $0x1
popq %r12
movslq 0x44(%r15), %rax
cmpq %rax, %r12
jge 0x31dbb
movq 0x48(%r15), %rax
movq (%rax,%r12,8), %r13
movl (%r13), %eax
andl $-0x2, %eax
cmpl $0xa02, %eax            # imm = 0xA02
jne 0x31f82
leaq 0xd316(%rip), %rdi      # 0x3f052
movq %rbx, %rsi
callq 0x30b0
movl (%r13), %eax
cmpl $0xa02, %eax            # imm = 0xA02
je 0x31d6b
cmpl $0xa03, %eax            # imm = 0xA03
jne 0x31fb3
leaq 0xcbdb(%rip), %rdi      # 0x3e93c
movq %rbx, %rsi
callq 0x30b0
jmp 0x31db3
cmpl $0x2, 0x44(%r13)
jne 0x31fa1
movq 0x48(%r13), %rax
movq (%rax), %rcx
cmpl $0x200, (%rcx)          # imm = 0x200
jne 0x31faa
movq 0x8(%rax), %r13
movq 0x10(%rcx), %rdi
movq %rbx, %rsi
callq 0x3a60
leaq 0x18a92(%rip), %rdi     # 0x4a832
movq %rbx, %rsi
callq 0x30b0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x31bb4
incq %r12
jmp 0x31d0e
pushq $0x3a
popq %rdi
testq %r14, %r14
je 0x31f54
movq %rbx, %rsi
callq 0x30c0
jmp 0x31bc8
leal -0x400(%rax), %ecx
cmpl $0x10, %ecx
ja 0x31e06
leaq 0x15a4a(%rip), %rax     # 0x47830
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpl $0x0, 0x44(%r14)
jne 0x320f2
leaq 0xc91c(%rip), %rdi      # 0x3e71d
jmp 0x31f3e
cmpl $0x4ff, %eax            # imm = 0x4FF
jne 0x31ff1
cmpl $0x0, 0x44(%r14)
jne 0x32285
leaq 0xfe96(%rip), %rdi      # 0x41cb9
jmp 0x31f3e
cmpl $0x0, 0x44(%r14)
jne 0x32111
leaq 0xc909(%rip), %rdi      # 0x3e743
jmp 0x31f3e
cmpl $0x1, 0x44(%r14)
jne 0x32130
leaq 0xe0b5(%rip), %rdi      # 0x3ff06
movq %rbx, %rsi
callq 0x30b0
movq 0x48(%r14), %rax
movq (%rax), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jne 0x32266
movq 0x10(%rax), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3a60
cmpl $0x0, 0x44(%r14)
jne 0x3214f
leaq 0xc88a(%rip), %rdi      # 0x3e722
jmp 0x31f3e
cmpl $0x0, 0x44(%r14)
jne 0x3216e
leaq 0xc88e(%rip), %rdi      # 0x3e73d
jmp 0x31f3e
cmpl $0x0, 0x44(%r14)
jne 0x3218d
leaq 0xc870(%rip), %rdi      # 0x3e736
jmp 0x31f3e
cmpl $0x0, 0x44(%r14)
jne 0x321ac
leaq 0xc856(%rip), %rdi      # 0x3e730
jmp 0x31f3e
cmpl $0x0, 0x44(%r14)
jne 0x321cb
leaq 0xc841(%rip), %rdi      # 0x3e72f
jmp 0x31f3e
cmpl $0x0, 0x44(%r14)
jne 0x321ea
leaq 0xc826(%rip), %rdi      # 0x3e728
jmp 0x31f3e
cmpl $0x0, 0x44(%r14)
jne 0x32209
leaq 0xc813(%rip), %rdi      # 0x3e729
jmp 0x31f3e
cmpl $0x0, 0x44(%r14)
jne 0x32228
leaq 0xc7f9(%rip), %rdi      # 0x3e723
jmp 0x31f3e
cmpl $0x0, 0x44(%r14)
jne 0x32247
leaq 0xc7f9(%rip), %rdi      # 0x3e737
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30b0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc874(%rip), %rdi      # 0x3e7de
leaq 0x159c9(%rip), %rsi     # 0x4793a
leaq 0x1885a(%rip), %rcx     # 0x4a7d2
movl $0x167e, %edx           # imm = 0x167E
callq 0x30a0
leaq 0xc9d0(%rip), %rdi      # 0x3e959
leaq 0x159aa(%rip), %rsi     # 0x4793a
leaq 0x1886a(%rip), %rcx     # 0x4a801
movl $0x1624, %edx           # imm = 0x1624
callq 0x30a0
leaq 0xc998(%rip), %rdi      # 0x3e940
jmp 0x31fba
leaq 0xc7bb(%rip), %rdi      # 0x3e76c
jmp 0x31fba
leaq 0xa3a6(%rip), %rdi      # 0x3c360
leaq 0x15979(%rip), %rsi     # 0x4793a
leaq 0x18839(%rip), %rcx     # 0x4a801
movl $0x1628, %edx           # imm = 0x1628
callq 0x30a0
leaq 0xde19(%rip), %rdi      # 0x3fdf2
leaq 0x1595a(%rip), %rsi     # 0x4793a
leaq 0x187eb(%rip), %rcx     # 0x4a7d2
movl $0x1630, %edx           # imm = 0x1630
callq 0x30a0
leaq 0xa368(%rip), %rdi      # 0x3c360
leaq 0x1593b(%rip), %rsi     # 0x4793a
leaq 0x187cc(%rip), %rcx     # 0x4a7d2
movl $0x16a9, %edx           # imm = 0x16A9
callq 0x30a0
leaq 0x15d08(%rip), %rdi     # 0x47d1f
leaq 0x1591c(%rip), %rsi     # 0x4793a
leaq 0x187ad(%rip), %rcx     # 0x4a7d2
movl $0x1689, %edx           # imm = 0x1689
callq 0x30a0
leaq 0x1679a(%rip), %rdi     # 0x487d0
leaq 0x158fd(%rip), %rsi     # 0x4793a
leaq 0x1878e(%rip), %rcx     # 0x4a7d2
movl $0x169b, %edx           # imm = 0x169B
callq 0x30a0
leaq 0xdd9d(%rip), %rdi      # 0x3fdf2
leaq 0x158de(%rip), %rsi     # 0x4793a
leaq 0x1879e(%rip), %rcx     # 0x4a801
movl $0x15ff, %edx           # imm = 0x15FF
callq 0x30a0
leaq 0xc71c(%rip), %rdi      # 0x3e790
leaq 0x158bf(%rip), %rsi     # 0x4793a
leaq 0x18750(%rip), %rcx     # 0x4a7d2
movl $0x1679, %edx           # imm = 0x1679
callq 0x30a0
leaq 0x15ca2(%rip), %rdi     # 0x47d35
leaq 0x158a0(%rip), %rsi     # 0x4793a
leaq 0x18731(%rip), %rcx     # 0x4a7d2
movl $0x1677, %edx           # imm = 0x1677
callq 0x30a0
leaq 0xc88e(%rip), %rdi      # 0x3e940
jmp 0x320da
leaq 0xc854(%rip), %rdi      # 0x3e90f
leaq 0x15878(%rip), %rsi     # 0x4793a
leaq 0x18738(%rip), %rcx     # 0x4a801
movl $0x1604, %edx           # imm = 0x1604
callq 0x30a0
leaq 0xc692(%rip), %rdi      # 0x3e76c
leaq 0x15859(%rip), %rsi     # 0x4793a
leaq 0x18719(%rip), %rcx     # 0x4a801
movl $0x161f, %edx           # imm = 0x161F
callq 0x30a0
leaq 0x15bc7(%rip), %rdi     # 0x47cc0
leaq 0x1583a(%rip), %rsi     # 0x4793a
leaq 0x186cb(%rip), %rcx     # 0x4a7d2
movl $0x1635, %edx           # imm = 0x1635
callq 0x30a0
leaq 0x15ba8(%rip), %rdi     # 0x47cc0
leaq 0x1581b(%rip), %rsi     # 0x4793a
leaq 0x186ac(%rip), %rcx     # 0x4a7d2
movl $0x1667, %edx           # imm = 0x1667
callq 0x30a0
leaq 0x16699(%rip), %rdi     # 0x487d0
leaq 0x157fc(%rip), %rsi     # 0x4793a
leaq 0x1868d(%rip), %rcx     # 0x4a7d2
movl $0x166c, %edx           # imm = 0x166C
callq 0x30a0
leaq 0x15b6a(%rip), %rdi     # 0x47cc0
leaq 0x157dd(%rip), %rsi     # 0x4793a
leaq 0x1866e(%rip), %rcx     # 0x4a7d2
movl $0x163f, %edx           # imm = 0x163F
callq 0x30a0
leaq 0x15b4b(%rip), %rdi     # 0x47cc0
leaq 0x157be(%rip), %rsi     # 0x4793a
leaq 0x1864f(%rip), %rcx     # 0x4a7d2
movl $0x1662, %edx           # imm = 0x1662
callq 0x30a0
leaq 0x15b2c(%rip), %rdi     # 0x47cc0
leaq 0x1579f(%rip), %rsi     # 0x4793a
leaq 0x18630(%rip), %rcx     # 0x4a7d2
movl $0x165d, %edx           # imm = 0x165D
callq 0x30a0
leaq 0x15b0d(%rip), %rdi     # 0x47cc0
leaq 0x15780(%rip), %rsi     # 0x4793a
leaq 0x18611(%rip), %rcx     # 0x4a7d2
movl $0x164e, %edx           # imm = 0x164E
callq 0x30a0
leaq 0x15aee(%rip), %rdi     # 0x47cc0
leaq 0x15761(%rip), %rsi     # 0x4793a
leaq 0x185f2(%rip), %rcx     # 0x4a7d2
movl $0x1653, %edx           # imm = 0x1653
callq 0x30a0
leaq 0x15acf(%rip), %rdi     # 0x47cc0
leaq 0x15742(%rip), %rsi     # 0x4793a
leaq 0x185d3(%rip), %rcx     # 0x4a7d2
movl $0x1649, %edx           # imm = 0x1649
callq 0x30a0
leaq 0x15ab0(%rip), %rdi     # 0x47cc0
leaq 0x15723(%rip), %rsi     # 0x4793a
leaq 0x185b4(%rip), %rcx     # 0x4a7d2
movl $0x1644, %edx           # imm = 0x1644
callq 0x30a0
leaq 0x15a91(%rip), %rdi     # 0x47cc0
leaq 0x15704(%rip), %rsi     # 0x4793a
leaq 0x18595(%rip), %rcx     # 0x4a7d2
movl $0x163a, %edx           # imm = 0x163A
callq 0x30a0
leaq 0x15a72(%rip), %rdi     # 0x47cc0
leaq 0x156e5(%rip), %rsi     # 0x4793a
leaq 0x18576(%rip), %rcx     # 0x4a7d2
movl $0x1658, %edx           # imm = 0x1658
callq 0x30a0
leaq 0xc4ff(%rip), %rdi      # 0x3e76c
leaq 0x156c6(%rip), %rsi     # 0x4793a
leaq 0x18557(%rip), %rcx     # 0x4a7d2
movl $0x1671, %edx           # imm = 0x1671
callq 0x30a0
leaq 0x15a34(%rip), %rdi     # 0x47cc0
leaq 0x156a7(%rip), %rsi     # 0x4793a
leaq 0x18538(%rip), %rcx     # 0x4a7d2
movl $0x16a4, %edx           # imm = 0x16A4
callq 0x30a0