// File: /workspace/github_c_makefile_star2_O3/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
testq %rdi, %rdi
je 0x342f6
movq %rsi, %rbx
movq %rdi, %r14
movl (%r14), %eax
cmpl $0x42f, %eax            # imm = 0x42F
jle 0x34102
cmpl $0x430, %eax            # imm = 0x430
je 0x3418b
cmpl $0x440, %eax            # imm = 0x440
jne 0x3434a
cmpl $0x1, 0x44(%r14)
jne 0x3457f
movq 0x48(%r14), %rax
movq (%rax), %r14
movl $0x2a, %edi
jmp 0x342e5
cmpl $0x420, %eax            # imm = 0x420
jne 0x34315
cmpl $0x2, 0x44(%r14)
jne 0x34560
movq 0x48(%r14), %rax
movq (%rax), %r15
cmpl $0x421, (%r15)          # imm = 0x421
jne 0x34541
movq 0x8(%rax), %r14
cmpl $0x0, 0x44(%r15)
jle 0x342ed
xorl %r12d, %r12d
movq 0x48(%r15), %rax
movq (%rax,%r12,8), %r13
cmpl $0x300, (%r13)          # imm = 0x300
jne 0x344b3
movl $0x5b, %edi
movq %rbx, %rsi
callq 0x30c0
movq 0x10(%r13), %rdi
movq %rbx, %rsi
callq 0x3cac
movl $0x5d, %edi
movq %rbx, %rsi
callq 0x30c0
incq %r12
movslq 0x44(%r15), %rax
cmpq %rax, %r12
jl 0x3413e
jmp 0x342ed
movl 0x44(%r14), %ecx
leal -0x1(%rcx), %eax
cmpl $0x2, %eax
jae 0x3459e
movq 0x48(%r14), %rax
cmpl $0x2, %ecx
jne 0x341aa
movq 0x8(%rax), %r14
jmp 0x341ad
xorl %r14d, %r14d
movq (%rax), %r15
testq %r15, %r15
je 0x34522
cmpl $0x0, 0x44(%r15)
jle 0x342d7
movq 0x48(%r15), %rax
movq (%rax), %rax
cmpl $0xa02, (%rax)          # imm = 0xA02
jne 0x345dc
cmpl $0x2, 0x44(%rax)
jne 0x345fb
movq 0x48(%rax), %rax
movq (%rax), %rcx
cmpl $0x200, (%rcx)          # imm = 0x200
jne 0x34604
movq 0x8(%rax), %r13
movq 0x10(%rcx), %rdi
movq %rbx, %rsi
callq 0x3cac
leaq 0x195e7(%rip), %rdi     # 0x4d7f2
movq %rbx, %rsi
callq 0x30b0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x340a9
cmpl $0x2, 0x44(%r15)
jl 0x342d7
movl $0x1, %r12d
movq 0x48(%r15), %rax
movq (%rax,%r12,8), %r13
movl (%r13), %eax
andl $-0x2, %eax
cmpl $0xa02, %eax            # imm = 0xA02
jne 0x344d2
leaq 0xddf2(%rip), %rdi      # 0x42042
movq %rbx, %rsi
callq 0x30b0
movl (%r13), %eax
cmpl $0xa02, %eax            # imm = 0xA02
je 0x3427f
cmpl $0xa03, %eax            # imm = 0xA03
jne 0x34503
leaq 0xd6b7(%rip), %rdi      # 0x4192c
movq %rbx, %rsi
callq 0x30b0
jmp 0x342c7
cmpl $0x2, 0x44(%r13)
jne 0x344f1
movq 0x48(%r13), %rax
movq (%rax), %rcx
cmpl $0x200, (%rcx)          # imm = 0x200
jne 0x344fa
movq 0x8(%rax), %r13
movq 0x10(%rcx), %rdi
movq %rbx, %rsi
callq 0x3cac
leaq 0x1953e(%rip), %rdi     # 0x4d7f2
movq %rbx, %rsi
callq 0x30b0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x340a9
incq %r12
movslq 0x44(%r15), %rax
cmpq %rax, %r12
jl 0x3422f
movl $0x3a, %edi
testq %r14, %r14
je 0x344a4
movq %rbx, %rsi
callq 0x30c0
testq %r14, %r14
jne 0x340c6
leaq 0xeae5(%rip), %rdi      # 0x42de2
leaq 0x165f6(%rip), %rsi     # 0x4a8fa
leaq 0x19487(%rip), %rcx     # 0x4d792
movl $0x1630, %edx           # imm = 0x1630
callq 0x30a0
addl $0xfffffc00, %eax       # imm = 0xFFFFFC00
cmpl $0x10, %eax
ja 0x345bd
leaq 0x164c6(%rip), %rcx     # 0x4a7f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x44(%r14)
jne 0x34623
leaq 0xd3c8(%rip), %rdi      # 0x4170d
jmp 0x3448e
cmpl $0x4ff, %eax            # imm = 0x4FF
jne 0x345bd
cmpl $0x0, 0x44(%r14)
jne 0x34797
leaq 0x1090e(%rip), %rdi     # 0x44c75
jmp 0x3448e
cmpl $0x0, 0x44(%r14)
jne 0x34642
leaq 0xd394(%rip), %rdi      # 0x41712
jmp 0x3448e
cmpl $0x0, 0x44(%r14)
jne 0x34661
leaq 0xd383(%rip), %rdi      # 0x41718
jmp 0x3448e
cmpl $0x0, 0x44(%r14)
jne 0x34680
leaq 0xd381(%rip), %rdi      # 0x4172d
jmp 0x3448e
cmpl $0x0, 0x44(%r14)
jne 0x3469f
leaq 0xd356(%rip), %rdi      # 0x41719
jmp 0x3448e
cmpl $0x0, 0x44(%r14)
jne 0x346be
leaq 0xd339(%rip), %rdi      # 0x41713
jmp 0x3448e
cmpl $0x0, 0x44(%r14)
jne 0x346dd
leaq 0xd32e(%rip), %rdi      # 0x4171f
jmp 0x3448e
cmpl $0x0, 0x44(%r14)
jne 0x346fc
leaq 0xd31f(%rip), %rdi      # 0x41727
jmp 0x3448e
cmpl $0x0, 0x44(%r14)
jne 0x3471b
leaq 0xd301(%rip), %rdi      # 0x41720
jmp 0x3448e
cmpl $0x0, 0x44(%r14)
jne 0x3473a
leaq 0xd2f3(%rip), %rdi      # 0x41726
jmp 0x3448e
cmpl $0x1, 0x44(%r14)
jne 0x34759
leaq 0xeaaf(%rip), %rdi      # 0x42ef6
movq %rbx, %rsi
callq 0x30b0
movq 0x48(%r14), %rax
movq (%rax), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jne 0x347b6
movq 0x10(%rax), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3cac
cmpl $0x0, 0x44(%r14)
jne 0x34778
leaq 0xd2a5(%rip), %rdi      # 0x41733
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 0xd314(%rip), %rdi      # 0x417ce
leaq 0x16439(%rip), %rsi     # 0x4a8fa
leaq 0x192ca(%rip), %rcx     # 0x4d792
movl $0x167e, %edx           # imm = 0x167E
callq 0x30a0
leaq 0xd470(%rip), %rdi      # 0x41949
leaq 0x1641a(%rip), %rsi     # 0x4a8fa
leaq 0x192da(%rip), %rcx     # 0x4d7c1
movl $0x1624, %edx           # imm = 0x1624
callq 0x30a0
leaq 0xd438(%rip), %rdi      # 0x41930
jmp 0x3450a
leaq 0xd25b(%rip), %rdi      # 0x4175c
jmp 0x3450a
leaq 0xae56(%rip), %rdi      # 0x3f360
leaq 0x163e9(%rip), %rsi     # 0x4a8fa
leaq 0x192a9(%rip), %rcx     # 0x4d7c1
movl $0x1628, %edx           # imm = 0x1628
callq 0x30a0
leaq 0xe8b9(%rip), %rdi      # 0x42de2
leaq 0x163ca(%rip), %rsi     # 0x4a8fa
leaq 0x1928a(%rip), %rcx     # 0x4d7c1
movl $0x15ff, %edx           # imm = 0x15FF
callq 0x30a0
leaq 0xd238(%rip), %rdi      # 0x41780
leaq 0x163ab(%rip), %rsi     # 0x4a8fa
leaq 0x1923c(%rip), %rcx     # 0x4d792
movl $0x1679, %edx           # imm = 0x1679
callq 0x30a0
leaq 0x1678e(%rip), %rdi     # 0x4acf5
leaq 0x1638c(%rip), %rsi     # 0x4a8fa
leaq 0x1921d(%rip), %rcx     # 0x4d792
movl $0x1677, %edx           # imm = 0x1677
callq 0x30a0
leaq 0x1720a(%rip), %rdi     # 0x4b790
leaq 0x1636d(%rip), %rsi     # 0x4a8fa
leaq 0x191fe(%rip), %rcx     # 0x4d792
movl $0x169b, %edx           # imm = 0x169B
callq 0x30a0
leaq 0x1673a(%rip), %rdi     # 0x4acdf
leaq 0x1634e(%rip), %rsi     # 0x4a8fa
leaq 0x191df(%rip), %rcx     # 0x4d792
movl $0x1689, %edx           # imm = 0x1689
callq 0x30a0
leaq 0xad9c(%rip), %rdi      # 0x3f360
leaq 0x1632f(%rip), %rsi     # 0x4a8fa
leaq 0x191c0(%rip), %rcx     # 0x4d792
movl $0x16a9, %edx           # imm = 0x16A9
callq 0x30a0
leaq 0xd31c(%rip), %rdi      # 0x418ff
leaq 0x16310(%rip), %rsi     # 0x4a8fa
leaq 0x191d0(%rip), %rcx     # 0x4d7c1
movl $0x1604, %edx           # imm = 0x1604
callq 0x30a0
leaq 0xd32e(%rip), %rdi      # 0x41930
jmp 0x3460b
leaq 0xd151(%rip), %rdi      # 0x4175c
leaq 0x162e8(%rip), %rsi     # 0x4a8fa
leaq 0x191a8(%rip), %rcx     # 0x4d7c1
movl $0x161f, %edx           # imm = 0x161F
callq 0x30a0
leaq 0x16656(%rip), %rdi     # 0x4ac80
leaq 0x162c9(%rip), %rsi     # 0x4a8fa
leaq 0x1915a(%rip), %rcx     # 0x4d792
movl $0x1635, %edx           # imm = 0x1635
callq 0x30a0
leaq 0x16637(%rip), %rdi     # 0x4ac80
leaq 0x162aa(%rip), %rsi     # 0x4a8fa
leaq 0x1913b(%rip), %rcx     # 0x4d792
movl $0x163f, %edx           # imm = 0x163F
callq 0x30a0
leaq 0x16618(%rip), %rdi     # 0x4ac80
leaq 0x1628b(%rip), %rsi     # 0x4a8fa
leaq 0x1911c(%rip), %rcx     # 0x4d792
movl $0x1649, %edx           # imm = 0x1649
callq 0x30a0
leaq 0x165f9(%rip), %rdi     # 0x4ac80
leaq 0x1626c(%rip), %rsi     # 0x4a8fa
leaq 0x190fd(%rip), %rcx     # 0x4d792
movl $0x1662, %edx           # imm = 0x1662
callq 0x30a0
leaq 0x165da(%rip), %rdi     # 0x4ac80
leaq 0x1624d(%rip), %rsi     # 0x4a8fa
leaq 0x190de(%rip), %rcx     # 0x4d792
movl $0x1644, %edx           # imm = 0x1644
callq 0x30a0
leaq 0x165bb(%rip), %rdi     # 0x4ac80
leaq 0x1622e(%rip), %rsi     # 0x4a8fa
leaq 0x190bf(%rip), %rcx     # 0x4d792
movl $0x163a, %edx           # imm = 0x163A
callq 0x30a0
leaq 0x1659c(%rip), %rdi     # 0x4ac80
leaq 0x1620f(%rip), %rsi     # 0x4a8fa
leaq 0x190a0(%rip), %rcx     # 0x4d792
movl $0x1653, %edx           # imm = 0x1653
callq 0x30a0
leaq 0x1657d(%rip), %rdi     # 0x4ac80
leaq 0x161f0(%rip), %rsi     # 0x4a8fa
leaq 0x19081(%rip), %rcx     # 0x4d792
movl $0x1658, %edx           # imm = 0x1658
callq 0x30a0
leaq 0x1655e(%rip), %rdi     # 0x4ac80
leaq 0x161d1(%rip), %rsi     # 0x4a8fa
leaq 0x19062(%rip), %rcx     # 0x4d792
movl $0x164e, %edx           # imm = 0x164E
callq 0x30a0
leaq 0x1653f(%rip), %rdi     # 0x4ac80
leaq 0x161b2(%rip), %rsi     # 0x4a8fa
leaq 0x19043(%rip), %rcx     # 0x4d792
movl $0x165d, %edx           # imm = 0x165D
callq 0x30a0
leaq 0x17030(%rip), %rdi     # 0x4b790
leaq 0x16193(%rip), %rsi     # 0x4a8fa
leaq 0x19024(%rip), %rcx     # 0x4d792
movl $0x166c, %edx           # imm = 0x166C
callq 0x30a0
leaq 0x16501(%rip), %rdi     # 0x4ac80
leaq 0x16174(%rip), %rsi     # 0x4a8fa
leaq 0x19005(%rip), %rcx     # 0x4d792
movl $0x1667, %edx           # imm = 0x1667
callq 0x30a0
leaq 0x164e2(%rip), %rdi     # 0x4ac80
leaq 0x16155(%rip), %rsi     # 0x4a8fa
leaq 0x18fe6(%rip), %rcx     # 0x4d792
movl $0x16a4, %edx           # imm = 0x16A4
callq 0x30a0
leaq 0xcf9f(%rip), %rdi      # 0x4175c
leaq 0x16136(%rip), %rsi     # 0x4a8fa
leaq 0x18fc7(%rip), %rcx     # 0x4d792
movl $0x1671, %edx           # imm = 0x1671
callq 0x30a0
nopl (%rax)