// File: /workspace/github_c_makefile_star2_O1/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 0x35318
movl (%r14), %eax
cmpl $0x42f, %eax            # imm = 0x42F
jle 0x34f1f
cmpl $0x430, %eax            # imm = 0x430
je 0x34fa4
cmpl $0x440, %eax            # imm = 0x440
jne 0x35140
cmpl $0x1, 0x44(%r14)
jne 0x35394
movq 0x48(%r14), %rax
movq (%rax), %r14
movl $0x2a, %edi
jmp 0x350fe
cmpl $0x420, %eax            # imm = 0x420
jne 0x3510b
cmpl $0x2, 0x44(%r14)
jne 0x35375
movq 0x48(%r14), %rax
movq (%rax), %r15
cmpl $0x421, (%r15)          # imm = 0x421
jne 0x35356
movq 0x8(%rax), %r14
cmpl $0x0, 0x44(%r15)
jle 0x34eda
xorl %r12d, %r12d
movq 0x48(%r15), %rax
movq (%rax,%r12,8), %r13
cmpl $0x300, (%r13)          # imm = 0x300
jne 0x352a9
movl $0x5b, %edi
movq %rbx, %rsi
callq 0x30c0
movq 0x10(%r13), %rdi
movq %rbx, %rsi
callq 0x3cb8
movl $0x5d, %edi
movq %rbx, %rsi
callq 0x30c0
incq %r12
movslq 0x44(%r15), %rax
cmpq %rax, %r12
jl 0x34f57
jmp 0x34eda
movl 0x44(%r14), %ecx
leal -0x1(%rcx), %eax
cmpl $0x2, %eax
jae 0x353b3
movq 0x48(%r14), %rax
cmpl $0x2, %ecx
jne 0x34fc3
movq 0x8(%rax), %r14
jmp 0x34fc6
xorl %r14d, %r14d
movq (%rax), %r15
testq %r15, %r15
je 0x35337
cmpl $0x0, 0x44(%r15)
jle 0x350f0
movq 0x48(%r15), %rax
movq (%rax), %rax
cmpl $0xa02, (%rax)          # imm = 0xA02
jne 0x353f1
cmpl $0x2, 0x44(%rax)
jne 0x35410
movq 0x48(%rax), %rax
movq (%rax), %rcx
cmpl $0x200, (%rcx)          # imm = 0x200
jne 0x35419
movq 0x8(%rax), %r13
movq 0x10(%rcx), %rdi
movq %rbx, %rsi
callq 0x3cb8
leaq 0x19785(%rip), %rdi     # 0x4e7a9
movq %rbx, %rsi
callq 0x30b0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x34ec6
cmpl $0x2, 0x44(%r15)
jl 0x350f0
movl $0x1, %r12d
movq 0x48(%r15), %rax
movq (%rax,%r12,8), %r13
movl (%r13), %eax
andl $-0x2, %eax
cmpl $0xa02, %eax            # imm = 0xA02
jne 0x352c8
leaq 0xdf8d(%rip), %rdi      # 0x42ff6
movq %rbx, %rsi
callq 0x30b0
movl (%r13), %eax
cmpl $0xa02, %eax            # imm = 0xA02
je 0x35098
cmpl $0xa03, %eax            # imm = 0xA03
jne 0x352f9
leaq 0xd852(%rip), %rdi      # 0x428e0
movq %rbx, %rsi
callq 0x30b0
jmp 0x350e0
cmpl $0x2, 0x44(%r13)
jne 0x352e7
movq 0x48(%r13), %rax
movq (%rax), %rcx
cmpl $0x200, (%rcx)          # imm = 0x200
jne 0x352f0
movq 0x8(%rax), %r13
movq 0x10(%rcx), %rdi
movq %rbx, %rsi
callq 0x3cb8
leaq 0x196dc(%rip), %rdi     # 0x4e7a9
movq %rbx, %rsi
callq 0x30b0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x34ec6
incq %r12
movslq 0x44(%r15), %rax
cmpq %rax, %r12
jl 0x35048
testq %r14, %r14
je 0x3529a
movl $0x3a, %edi
movq %rbx, %rsi
callq 0x30c0
jmp 0x34eda
addl $0xfffffc00, %eax       # imm = 0xFFFFFC00
cmpl $0x10, %eax
ja 0x353d2
leaq 0x16600(%rip), %rcx     # 0x4b720
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x44(%r14)
jne 0x35438
leaq 0xd586(%rip), %rdi      # 0x426c1
jmp 0x35284
cmpl $0x4ff, %eax            # imm = 0x4FF
jne 0x353d2
cmpl $0x0, 0x44(%r14)
jne 0x355ac
leaq 0x10a48(%rip), %rdi     # 0x45ba5
jmp 0x35284
cmpl $0x0, 0x44(%r14)
jne 0x35457
leaq 0xd552(%rip), %rdi      # 0x426c6
jmp 0x35284
cmpl $0x0, 0x44(%r14)
jne 0x35476
leaq 0xd541(%rip), %rdi      # 0x426cc
jmp 0x35284
cmpl $0x0, 0x44(%r14)
jne 0x35495
leaq 0xd53f(%rip), %rdi      # 0x426e1
jmp 0x35284
cmpl $0x0, 0x44(%r14)
jne 0x354b4
leaq 0xd514(%rip), %rdi      # 0x426cd
jmp 0x35284
cmpl $0x0, 0x44(%r14)
jne 0x354d3
leaq 0xd4f7(%rip), %rdi      # 0x426c7
jmp 0x35284
cmpl $0x0, 0x44(%r14)
jne 0x354f2
leaq 0xd4ec(%rip), %rdi      # 0x426d3
jmp 0x35284
cmpl $0x0, 0x44(%r14)
jne 0x35511
leaq 0xd4dd(%rip), %rdi      # 0x426db
jmp 0x35284
cmpl $0x0, 0x44(%r14)
jne 0x35530
leaq 0xd4bf(%rip), %rdi      # 0x426d4
jmp 0x35284
cmpl $0x0, 0x44(%r14)
jne 0x3554f
leaq 0xd4b1(%rip), %rdi      # 0x426da
jmp 0x35284
cmpl $0x1, 0x44(%r14)
jne 0x3556e
leaq 0xec6d(%rip), %rdi      # 0x43eaa
movq %rbx, %rsi
callq 0x30b0
movq 0x48(%r14), %rax
movq (%rax), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jne 0x355cb
movq 0x10(%rax), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3cb8
cmpl $0x0, 0x44(%r14)
jne 0x3558d
leaq 0xd463(%rip), %rdi      # 0x426e7
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 0xd4d2(%rip), %rdi      # 0x42782
leaq 0x165a3(%rip), %rsi     # 0x4b85a
leaq 0x1948b(%rip), %rcx     # 0x4e749
movl $0x167e, %edx           # imm = 0x167E
callq 0x30a0
leaq 0xd62e(%rip), %rdi      # 0x428fd
leaq 0x16584(%rip), %rsi     # 0x4b85a
leaq 0x1949b(%rip), %rcx     # 0x4e778
movl $0x1624, %edx           # imm = 0x1624
callq 0x30a0
leaq 0xd5f6(%rip), %rdi      # 0x428e4
jmp 0x35300
leaq 0xd419(%rip), %rdi      # 0x42710
jmp 0x35300
leaq 0xb084(%rip), %rdi      # 0x40384
leaq 0x16553(%rip), %rsi     # 0x4b85a
leaq 0x1946a(%rip), %rcx     # 0x4e778
movl $0x1628, %edx           # imm = 0x1628
callq 0x30a0
leaq 0xea77(%rip), %rdi      # 0x43d96
leaq 0x16534(%rip), %rsi     # 0x4b85a
leaq 0x1941c(%rip), %rcx     # 0x4e749
movl $0x1630, %edx           # imm = 0x1630
callq 0x30a0
leaq 0xea58(%rip), %rdi      # 0x43d96
leaq 0x16515(%rip), %rsi     # 0x4b85a
leaq 0x1942c(%rip), %rcx     # 0x4e778
movl $0x15ff, %edx           # imm = 0x15FF
callq 0x30a0
leaq 0xd3d7(%rip), %rdi      # 0x42734
leaq 0x164f6(%rip), %rsi     # 0x4b85a
leaq 0x193de(%rip), %rcx     # 0x4e749
movl $0x1679, %edx           # imm = 0x1679
callq 0x30a0
leaq 0x168d9(%rip), %rdi     # 0x4bc55
leaq 0x164d7(%rip), %rsi     # 0x4b85a
leaq 0x193bf(%rip), %rcx     # 0x4e749
movl $0x1677, %edx           # imm = 0x1677
callq 0x30a0
leaq 0x17355(%rip), %rdi     # 0x4c6f0
leaq 0x164b8(%rip), %rsi     # 0x4b85a
leaq 0x193a0(%rip), %rcx     # 0x4e749
movl $0x169b, %edx           # imm = 0x169B
callq 0x30a0
leaq 0x16885(%rip), %rdi     # 0x4bc3f
leaq 0x16499(%rip), %rsi     # 0x4b85a
leaq 0x19381(%rip), %rcx     # 0x4e749
movl $0x1689, %edx           # imm = 0x1689
callq 0x30a0
leaq 0xafab(%rip), %rdi      # 0x40384
leaq 0x1647a(%rip), %rsi     # 0x4b85a
leaq 0x19362(%rip), %rcx     # 0x4e749
movl $0x16a9, %edx           # imm = 0x16A9
callq 0x30a0
leaq 0xd4bb(%rip), %rdi      # 0x428b3
leaq 0x1645b(%rip), %rsi     # 0x4b85a
leaq 0x19372(%rip), %rcx     # 0x4e778
movl $0x1604, %edx           # imm = 0x1604
callq 0x30a0
leaq 0xd4cd(%rip), %rdi      # 0x428e4
jmp 0x35420
leaq 0xd2f0(%rip), %rdi      # 0x42710
leaq 0x16433(%rip), %rsi     # 0x4b85a
leaq 0x1934a(%rip), %rcx     # 0x4e778
movl $0x161f, %edx           # imm = 0x161F
callq 0x30a0
leaq 0x167a1(%rip), %rdi     # 0x4bbe0
leaq 0x16414(%rip), %rsi     # 0x4b85a
leaq 0x192fc(%rip), %rcx     # 0x4e749
movl $0x1635, %edx           # imm = 0x1635
callq 0x30a0
leaq 0x16782(%rip), %rdi     # 0x4bbe0
leaq 0x163f5(%rip), %rsi     # 0x4b85a
leaq 0x192dd(%rip), %rcx     # 0x4e749
movl $0x163f, %edx           # imm = 0x163F
callq 0x30a0
leaq 0x16763(%rip), %rdi     # 0x4bbe0
leaq 0x163d6(%rip), %rsi     # 0x4b85a
leaq 0x192be(%rip), %rcx     # 0x4e749
movl $0x1649, %edx           # imm = 0x1649
callq 0x30a0
leaq 0x16744(%rip), %rdi     # 0x4bbe0
leaq 0x163b7(%rip), %rsi     # 0x4b85a
leaq 0x1929f(%rip), %rcx     # 0x4e749
movl $0x1662, %edx           # imm = 0x1662
callq 0x30a0
leaq 0x16725(%rip), %rdi     # 0x4bbe0
leaq 0x16398(%rip), %rsi     # 0x4b85a
leaq 0x19280(%rip), %rcx     # 0x4e749
movl $0x1644, %edx           # imm = 0x1644
callq 0x30a0
leaq 0x16706(%rip), %rdi     # 0x4bbe0
leaq 0x16379(%rip), %rsi     # 0x4b85a
leaq 0x19261(%rip), %rcx     # 0x4e749
movl $0x163a, %edx           # imm = 0x163A
callq 0x30a0
leaq 0x166e7(%rip), %rdi     # 0x4bbe0
leaq 0x1635a(%rip), %rsi     # 0x4b85a
leaq 0x19242(%rip), %rcx     # 0x4e749
movl $0x1653, %edx           # imm = 0x1653
callq 0x30a0
leaq 0x166c8(%rip), %rdi     # 0x4bbe0
leaq 0x1633b(%rip), %rsi     # 0x4b85a
leaq 0x19223(%rip), %rcx     # 0x4e749
movl $0x1658, %edx           # imm = 0x1658
callq 0x30a0
leaq 0x166a9(%rip), %rdi     # 0x4bbe0
leaq 0x1631c(%rip), %rsi     # 0x4b85a
leaq 0x19204(%rip), %rcx     # 0x4e749
movl $0x164e, %edx           # imm = 0x164E
callq 0x30a0
leaq 0x1668a(%rip), %rdi     # 0x4bbe0
leaq 0x162fd(%rip), %rsi     # 0x4b85a
leaq 0x191e5(%rip), %rcx     # 0x4e749
movl $0x165d, %edx           # imm = 0x165D
callq 0x30a0
leaq 0x1717b(%rip), %rdi     # 0x4c6f0
leaq 0x162de(%rip), %rsi     # 0x4b85a
leaq 0x191c6(%rip), %rcx     # 0x4e749
movl $0x166c, %edx           # imm = 0x166C
callq 0x30a0
leaq 0x1664c(%rip), %rdi     # 0x4bbe0
leaq 0x162bf(%rip), %rsi     # 0x4b85a
leaq 0x191a7(%rip), %rcx     # 0x4e749
movl $0x1667, %edx           # imm = 0x1667
callq 0x30a0
leaq 0x1662d(%rip), %rdi     # 0x4bbe0
leaq 0x162a0(%rip), %rsi     # 0x4b85a
leaq 0x19188(%rip), %rcx     # 0x4e749
movl $0x16a4, %edx           # imm = 0x16A4
callq 0x30a0
leaq 0xd13e(%rip), %rdi      # 0x42710
leaq 0x16281(%rip), %rsi     # 0x4b85a
leaq 0x19169(%rip), %rcx     # 0x4e749
movl $0x1671, %edx           # imm = 0x1671
callq 0x30a0
nop