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

	switch (node->type) {
		case BE_NODE_TYPE_CHAR: {
			assert(node->nchilds == 0);
			fputs("char", file);
			break;
		}
		case BE_NODE_TYPE_INT8: {
			assert(node->nchilds == 0);
			fputs("int8", file);
			break;
		}
		case BE_NODE_TYPE_UINT8: {
			assert(node->nchilds == 0);
			fputs("uint8", file);
			break;
		}
		case BE_NODE_TYPE_INT16: {
			assert(node->nchilds == 0);
			fputs("int16", file);
			break;
		}
		case BE_NODE_TYPE_UINT16: {
			assert(node->nchilds == 0);
			fputs("uint16", file);
			break;
		}
		case BE_NODE_TYPE_INT32: {
			assert(node->nchilds == 0);
			fputs("int32", file);
			break;
		}
		case BE_NODE_TYPE_UINT32: {
			assert(node->nchilds == 0);
			fputs("uint32", file);
			break;
		}
		case BE_NODE_TYPE_INT64: {
			assert(node->nchilds == 0);
			fputs("int64", file);
			break;
		}
		case BE_NODE_TYPE_UINT64: {
			assert(node->nchilds == 0);
			fputs("uint64", file);
			break;
		}
		case BE_NODE_TYPE_FLOAT: {
			assert(node->nchilds == 0);
			fputs("float", file);
			break;
		}
		case BE_NODE_TYPE_DOUBLE: {
			assert(node->nchilds == 0);
			fputs("double", file);
			break;
		}
		case BE_NODE_TYPE_STRUCT: {
			assert(node->nchilds == 1);

			fputs("struct ", file);

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

			cmn_print_token(node_id->token, file);
			break;
		}
		case BE_NODE_TYPE_ARRAY: {
			assert(node->nchilds == 2);
			ParserASTNode *node_array_dims = node->childs[0];
			assert(node_array_dims->type == BE_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 == BE_NODE_LITERAL_UINT);
				fputc('[', file);
				cmn_print_token(node_array_dim->token, file);
				fputc(']', file);
			}

			_print_type_node(node_t, file);

			break;
		}
		case BE_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 BE_NODE_TYPE_POINTER: {
			assert(node->nchilds == 1);
			ParserASTNode *node_t = node->childs[0];

			fputc('*', file);

			_print_type_node(node_t, file);
			break;
		}
		case BE_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 0x34248
movq %rsi, %rbx
movq %rdi, %r14
movl (%r14), %eax
cmpl $0x42f, %eax            # imm = 0x42F
jle 0x34054
cmpl $0x430, %eax            # imm = 0x430
je 0x340dd
cmpl $0x440, %eax            # imm = 0x440
jne 0x3429c
cmpl $0x1, 0x44(%r14)
jne 0x344d1
movq 0x48(%r14), %rax
movq (%rax), %r14
movl $0x2a, %edi
jmp 0x34237
cmpl $0x420, %eax            # imm = 0x420
jne 0x34267
cmpl $0x2, 0x44(%r14)
jne 0x344b2
movq 0x48(%r14), %rax
movq (%rax), %r15
cmpl $0x421, (%r15)          # imm = 0x421
jne 0x34493
movq 0x8(%rax), %r14
cmpl $0x0, 0x44(%r15)
jle 0x3423f
xorl %r12d, %r12d
movq 0x48(%r15), %rax
movq (%rax,%r12,8), %r13
cmpl $0x300, (%r13)          # imm = 0x300
jne 0x34405
movl $0x5b, %edi
movq %rbx, %rsi
callq 0x30c0
movq 0x10(%r13), %rdi
movq %rbx, %rsi
callq 0x3c6c
movl $0x5d, %edi
movq %rbx, %rsi
callq 0x30c0
incq %r12
movslq 0x44(%r15), %rax
cmpq %rax, %r12
jl 0x34090
jmp 0x3423f
movl 0x44(%r14), %ecx
leal -0x1(%rcx), %eax
cmpl $0x2, %eax
jae 0x344f0
movq 0x48(%r14), %rax
cmpl $0x2, %ecx
jne 0x340fc
movq 0x8(%rax), %r14
jmp 0x340ff
xorl %r14d, %r14d
movq (%rax), %r15
testq %r15, %r15
je 0x34474
cmpl $0x0, 0x44(%r15)
jle 0x34229
movq 0x48(%r15), %rax
movq (%rax), %rax
cmpl $0xa02, (%rax)          # imm = 0xA02
jne 0x3452e
cmpl $0x2, 0x44(%rax)
jne 0x3454d
movq 0x48(%rax), %rax
movq (%rax), %rcx
cmpl $0x200, (%rcx)          # imm = 0x200
jne 0x34556
movq 0x8(%rax), %r13
movq 0x10(%rcx), %rdi
movq %rbx, %rsi
callq 0x3c6c
leaq 0x1acea(%rip), %rdi     # 0x4ee47
movq %rbx, %rsi
callq 0x30b0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x33ffb
cmpl $0x2, 0x44(%r15)
jl 0x34229
movl $0x1, %r12d
movq 0x48(%r15), %rax
movq (%rax,%r12,8), %r13
movl (%r13), %eax
andl $-0x2, %eax
cmpl $0xa02, %eax            # imm = 0xA02
jne 0x34424
leaq 0x1ad0d(%rip), %rdi     # 0x4eeaf
movq %rbx, %rsi
callq 0x30b0
movl (%r13), %eax
cmpl $0xa02, %eax            # imm = 0xA02
je 0x341d1
cmpl $0xa03, %eax            # imm = 0xA03
jne 0x34455
leaq 0x140af(%rip), %rdi     # 0x48276
movq %rbx, %rsi
callq 0x30b0
jmp 0x34219
cmpl $0x2, 0x44(%r13)
jne 0x34443
movq 0x48(%r13), %rax
movq (%rax), %rcx
cmpl $0x200, (%rcx)          # imm = 0x200
jne 0x3444c
movq 0x8(%rax), %r13
movq 0x10(%rcx), %rdi
movq %rbx, %rsi
callq 0x3c6c
leaq 0x1ac41(%rip), %rdi     # 0x4ee47
movq %rbx, %rsi
callq 0x30b0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x33ffb
incq %r12
movslq 0x44(%r15), %rax
cmpq %rax, %r12
jl 0x34181
movl $0x3a, %edi
testq %r14, %r14
je 0x343f6
movq %rbx, %rsi
callq 0x30c0
testq %r14, %r14
jne 0x34018
leaq 0xccbc(%rip), %rdi      # 0x40f0b
leaq 0x17eea(%rip), %rsi     # 0x4c140
leaq 0x1ab50(%rip), %rcx     # 0x4edad
movl $0x189d, %edx           # imm = 0x189D
callq 0x30a0
addl $0xfffffc00, %eax       # imm = 0xFFFFFC00
cmpl $0x10, %eax
ja 0x3450f
leaq 0x17db4(%rip), %rcx     # 0x4c030
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x44(%r14)
jne 0x34575
leaq 0x13c94(%rip), %rdi     # 0x47f2b
jmp 0x343e0
cmpl $0x4ff, %eax            # imm = 0x4FF
jne 0x3450f
cmpl $0x0, 0x44(%r14)
jne 0x346e9
leaq 0x1ab2b(%rip), %rdi     # 0x4ede4
jmp 0x343e0
cmpl $0x0, 0x44(%r14)
jne 0x34594
leaq 0x13c60(%rip), %rdi     # 0x47f30
jmp 0x343e0
cmpl $0x0, 0x44(%r14)
jne 0x345b3
leaq 0x13c4f(%rip), %rdi     # 0x47f36
jmp 0x343e0
cmpl $0x0, 0x44(%r14)
jne 0x345d2
leaq 0x13c4d(%rip), %rdi     # 0x47f4b
jmp 0x343e0
cmpl $0x0, 0x44(%r14)
jne 0x345f1
leaq 0x13c22(%rip), %rdi     # 0x47f37
jmp 0x343e0
cmpl $0x0, 0x44(%r14)
jne 0x34610
leaq 0x13c05(%rip), %rdi     # 0x47f31
jmp 0x343e0
cmpl $0x0, 0x44(%r14)
jne 0x3462f
leaq 0x13bfa(%rip), %rdi     # 0x47f3d
jmp 0x343e0
cmpl $0x0, 0x44(%r14)
jne 0x3464e
leaq 0x13beb(%rip), %rdi     # 0x47f45
jmp 0x343e0
cmpl $0x0, 0x44(%r14)
jne 0x3466d
leaq 0x13bcd(%rip), %rdi     # 0x47f3e
jmp 0x343e0
cmpl $0x0, 0x44(%r14)
jne 0x3468c
leaq 0x13bbf(%rip), %rdi     # 0x47f44
jmp 0x343e0
cmpl $0x1, 0x44(%r14)
jne 0x346ab
leaq 0x1aa43(%rip), %rdi     # 0x4eddc
movq %rbx, %rsi
callq 0x30b0
movq 0x48(%r14), %rax
movq (%rax), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jne 0x34708
movq 0x10(%rax), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3c6c
cmpl $0x0, 0x44(%r14)
jne 0x346ca
leaq 0x13b71(%rip), %rdi     # 0x47f51
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 0x18164(%rip), %rdi     # 0x4c570
leaq 0x17d2d(%rip), %rsi     # 0x4c140
leaq 0x1a993(%rip), %rcx     # 0x4edad
movl $0x18eb, %edx           # imm = 0x18EB
callq 0x30a0
leaq 0x1aa1e(%rip), %rdi     # 0x4ee49
leaq 0x17d0e(%rip), %rsi     # 0x4c140
leaq 0x1a9b0(%rip), %rcx     # 0x4ede9
movl $0x1891, %edx           # imm = 0x1891
callq 0x30a0
leaq 0x1819e(%rip), %rdi     # 0x4c5e8
jmp 0x3445c
leaq 0xd341(%rip), %rdi      # 0x41794
jmp 0x3445c
leaq 0x9f0d(%rip), %rdi      # 0x3e369
leaq 0x17cdd(%rip), %rsi     # 0x4c140
leaq 0x1a97f(%rip), %rcx     # 0x4ede9
movl $0x1895, %edx           # imm = 0x1895
callq 0x30a0
leaq 0xca90(%rip), %rdi      # 0x40f0b
leaq 0x17cbe(%rip), %rsi     # 0x4c140
leaq 0x1a960(%rip), %rcx     # 0x4ede9
movl $0x186c, %edx           # imm = 0x186C
callq 0x30a0
leaq 0x180a5(%rip), %rdi     # 0x4c53f
leaq 0x17c9f(%rip), %rsi     # 0x4c140
leaq 0x1a905(%rip), %rcx     # 0x4edad
movl $0x18e6, %edx           # imm = 0x18E6
callq 0x30a0
leaq 0x1811c(%rip), %rdi     # 0x4c5d5
leaq 0x17c80(%rip), %rsi     # 0x4c140
leaq 0x1a8e6(%rip), %rcx     # 0x4edad
movl $0x18e4, %edx           # imm = 0x18E4
callq 0x30a0
leaq 0xd6c9(%rip), %rdi      # 0x41ba1
leaq 0x17c61(%rip), %rsi     # 0x4c140
leaq 0x1a8c7(%rip), %rcx     # 0x4edad
movl $0x1908, %edx           # imm = 0x1908
callq 0x30a0
leaq 0x180c8(%rip), %rdi     # 0x4c5bf
leaq 0x17c42(%rip), %rsi     # 0x4c140
leaq 0x1a8a8(%rip), %rcx     # 0x4edad
movl $0x18f6, %edx           # imm = 0x18F6
callq 0x30a0
leaq 0x9e53(%rip), %rdi      # 0x3e369
leaq 0x17c23(%rip), %rsi     # 0x4c140
leaq 0x1a889(%rip), %rcx     # 0x4edad
movl $0x1916, %edx           # imm = 0x1916
callq 0x30a0
leaq 0x1a8e5(%rip), %rdi     # 0x4ee1a
leaq 0x17c04(%rip), %rsi     # 0x4c140
leaq 0x1a8a6(%rip), %rcx     # 0x4ede9
movl $0x1871, %edx           # imm = 0x1871
callq 0x30a0
leaq 0x18094(%rip), %rdi     # 0x4c5e8
jmp 0x3455d
leaq 0xd237(%rip), %rdi      # 0x41794
leaq 0x17bdc(%rip), %rsi     # 0x4c140
leaq 0x1a87e(%rip), %rcx     # 0x4ede9
movl $0x188c, %edx           # imm = 0x188C
callq 0x30a0
leaq 0x17f86(%rip), %rdi     # 0x4c502
leaq 0x17bbd(%rip), %rsi     # 0x4c140
leaq 0x1a823(%rip), %rcx     # 0x4edad
movl $0x18a2, %edx           # imm = 0x18A2
callq 0x30a0
leaq 0x17f67(%rip), %rdi     # 0x4c502
leaq 0x17b9e(%rip), %rsi     # 0x4c140
leaq 0x1a804(%rip), %rcx     # 0x4edad
movl $0x18ac, %edx           # imm = 0x18AC
callq 0x30a0
leaq 0x17f48(%rip), %rdi     # 0x4c502
leaq 0x17b7f(%rip), %rsi     # 0x4c140
leaq 0x1a7e5(%rip), %rcx     # 0x4edad
movl $0x18b6, %edx           # imm = 0x18B6
callq 0x30a0
leaq 0x17f29(%rip), %rdi     # 0x4c502
leaq 0x17b60(%rip), %rsi     # 0x4c140
leaq 0x1a7c6(%rip), %rcx     # 0x4edad
movl $0x18cf, %edx           # imm = 0x18CF
callq 0x30a0
leaq 0x17f0a(%rip), %rdi     # 0x4c502
leaq 0x17b41(%rip), %rsi     # 0x4c140
leaq 0x1a7a7(%rip), %rcx     # 0x4edad
movl $0x18b1, %edx           # imm = 0x18B1
callq 0x30a0
leaq 0x17eeb(%rip), %rdi     # 0x4c502
leaq 0x17b22(%rip), %rsi     # 0x4c140
leaq 0x1a788(%rip), %rcx     # 0x4edad
movl $0x18a7, %edx           # imm = 0x18A7
callq 0x30a0
leaq 0x17ecc(%rip), %rdi     # 0x4c502
leaq 0x17b03(%rip), %rsi     # 0x4c140
leaq 0x1a769(%rip), %rcx     # 0x4edad
movl $0x18c0, %edx           # imm = 0x18C0
callq 0x30a0
leaq 0x17ead(%rip), %rdi     # 0x4c502
leaq 0x17ae4(%rip), %rsi     # 0x4c140
leaq 0x1a74a(%rip), %rcx     # 0x4edad
movl $0x18c5, %edx           # imm = 0x18C5
callq 0x30a0
leaq 0x17e8e(%rip), %rdi     # 0x4c502
leaq 0x17ac5(%rip), %rsi     # 0x4c140
leaq 0x1a72b(%rip), %rcx     # 0x4edad
movl $0x18bb, %edx           # imm = 0x18BB
callq 0x30a0
leaq 0x17e6f(%rip), %rdi     # 0x4c502
leaq 0x17aa6(%rip), %rsi     # 0x4c140
leaq 0x1a70c(%rip), %rcx     # 0x4edad
movl $0x18ca, %edx           # imm = 0x18CA
callq 0x30a0
leaq 0xd4ef(%rip), %rdi      # 0x41ba1
leaq 0x17a87(%rip), %rsi     # 0x4c140
leaq 0x1a6ed(%rip), %rcx     # 0x4edad
movl $0x18d9, %edx           # imm = 0x18D9
callq 0x30a0
leaq 0x17e31(%rip), %rdi     # 0x4c502
leaq 0x17a68(%rip), %rsi     # 0x4c140
leaq 0x1a6ce(%rip), %rcx     # 0x4edad
movl $0x18d4, %edx           # imm = 0x18D4
callq 0x30a0
leaq 0x17e12(%rip), %rdi     # 0x4c502
leaq 0x17a49(%rip), %rsi     # 0x4c140
leaq 0x1a6af(%rip), %rcx     # 0x4edad
movl $0x1911, %edx           # imm = 0x1911
callq 0x30a0
leaq 0xd085(%rip), %rdi      # 0x41794
leaq 0x17a2a(%rip), %rsi     # 0x4c140
leaq 0x1a690(%rip), %rcx     # 0x4edad
movl $0x18de, %edx           # imm = 0x18DE
callq 0x30a0
nop