// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/frontend/irgen_c.c
// Function: ir_type
static void _ir_type(
	IRGeneratorCContext *ctx,
	ResizableString *rstr,
	ParserASTNode *node_type
) {
	assert(ctx);
	assert(rstr);
	assert(node_type);

	switch (node_type->type) {
		case FE_NODE_TYPE_CHAR: {
			rstr_prepend_with_cstr(rstr, "char ");
			break;
		}
		case FE_NODE_TYPE_INT8: {
			rstr_prepend_with_cstr(rstr, "int8_t ");
			break;
		}
		case FE_NODE_TYPE_UINT8: {
			rstr_prepend_with_cstr(rstr, "uint8_t ");
			break;
		}
		case FE_NODE_TYPE_INT16: {
			rstr_prepend_with_cstr(rstr, "int16_t ");
			break;
		}
		case FE_NODE_TYPE_UINT16: {
			rstr_prepend_with_cstr(rstr, "uint16_t ");
			break;
		}
		case FE_NODE_TYPE_INT32: {
			rstr_prepend_with_cstr(rstr, "int32_t ");
			break;
		}
		case FE_NODE_TYPE_UINT32: {
			rstr_prepend_with_cstr(rstr, "uint32_t ");
			break;
		}
		case FE_NODE_TYPE_INT64: {
			rstr_prepend_with_cstr(rstr, "int64_t ");
			break;
		}
		case FE_NODE_TYPE_UINT64: {
			rstr_prepend_with_cstr(rstr, "uint64_t ");
			break;
		}
		case FE_NODE_TYPE_FLOAT: {
			rstr_prepend_with_cstr(rstr, "float ");
			break;
		}
		case FE_NODE_TYPE_DOUBLE: {
			rstr_prepend_with_cstr(rstr, "double ");
			break;
		}
		case FE_NODE_TYPE_VA_LIST: {
			rstr_prepend_with_cstr(rstr, "va_list ");
			break;
		}
		case FE_NODE_TYPE_STRUCT: {
			assert(node_type->nchilds == 1);

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

			rstr_prepend_with_cstr(rstr, " ");
			rstr_prepend_with_raw(rstr, node_id->token->content, node_id->token->len);
			rstr_prepend_with_cstr(rstr, "struct ");
			break;
		}
		case FE_NODE_TYPE_ARRAY: {
			assert(node_type->nchilds == 2);
			ParserASTNode *node_array_dims = node_type->childs[0];
			assert(node_array_dims->type == FE_NODE_TYPE_ARRAY_DIMS);
			ParserASTNode *node_t = node_type->childs[1];

			rstr_prepend_with_cstr(rstr, "(");
			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);
				rstr_append_with_cstr(rstr, "[");
				rstr_append_with_raw(rstr, node_array_dim->token->content, node_array_dim->token->len);
				rstr_append_with_cstr(rstr, "]");
			}
			rstr_append_with_cstr(rstr, ")");

			_ir_type(ctx, rstr, node_t);
			break;
		}
		case FE_NODE_TYPE_FUNC: {
			assert(node_type->nchilds == 1 || node_type->nchilds == 2);
			ParserASTNode *node_params = NULL;
			ParserASTNode *node_t = NULL;

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

			rstr_prepend_with_cstr(rstr, "(");
			rstr_append_with_cstr(rstr, ")(");
			_ir_func_params(ctx, rstr, node_params);
			rstr_append_with_cstr(rstr, ")");

			if (node_t != NULL) {
				_ir_type(ctx, rstr, node_t);
			} else {
				rstr_prepend_with_cstr(rstr, "void(");
				rstr_append_with_cstr(rstr, ")");
			}
			break;
		}
		case FE_NODE_TYPE_POINTER: {
			assert(node_type->nchilds == 1);
			ParserASTNode *node_t = node_type->childs[0];
			
			rstr_prepend_with_cstr(rstr, "(*");
			rstr_append_with_cstr(rstr, ")");

			_ir_type(ctx, rstr, node_t);
			break;
		}
		case FE_NODE_TYPE_VOID: {
			rstr_prepend_with_cstr(rstr, "void ");
			break;
		}
		default: {
			assert(0);
			break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x216dd
jmp 0x216fc
leaq 0x5ae72(%rip), %rdi     # 0x7c556
leaq 0x556fd(%rip), %rsi     # 0x76de8
movl $0x27, %edx
leaq 0x558ac(%rip), %rcx     # 0x76fa3
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x21705
jmp 0x21724
leaq 0x51402(%rip), %rdi     # 0x72b0e
leaq 0x556d5(%rip), %rsi     # 0x76de8
movl $0x28, %edx
leaq 0x55884(%rip), %rcx     # 0x76fa3
callq 0x30a0
cmpq $0x0, -0x18(%rbp)
je 0x2172d
jmp 0x2174c
leaq 0x52fff(%rip), %rdi     # 0x74733
leaq 0x556ad(%rip), %rsi     # 0x76de8
movl $0x29, %edx
leaq 0x5585c(%rip), %rcx     # 0x76fa3
callq 0x30a0
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
subl $0x400, %eax            # imm = 0x400
je 0x21865
jmp 0x21762
movl -0x5c(%rbp), %eax
subl $0x401, %eax            # imm = 0x401
je 0x2187a
jmp 0x21772
movl -0x5c(%rbp), %eax
subl $0x402, %eax            # imm = 0x402
je 0x218a4
jmp 0x21782
movl -0x5c(%rbp), %eax
subl $0x403, %eax            # imm = 0x403
je 0x218ce
jmp 0x21792
movl -0x5c(%rbp), %eax
subl $0x404, %eax            # imm = 0x404
je 0x218f8
jmp 0x217a2
movl -0x5c(%rbp), %eax
subl $0x405, %eax            # imm = 0x405
je 0x2188f
jmp 0x217b2
movl -0x5c(%rbp), %eax
subl $0x406, %eax            # imm = 0x406
je 0x218b9
jmp 0x217c2
movl -0x5c(%rbp), %eax
subl $0x407, %eax            # imm = 0x407
je 0x218e3
jmp 0x217d2
movl -0x5c(%rbp), %eax
subl $0x408, %eax            # imm = 0x408
je 0x2190d
jmp 0x217e2
movl -0x5c(%rbp), %eax
subl $0x409, %eax            # imm = 0x409
je 0x21922
jmp 0x217f2
movl -0x5c(%rbp), %eax
subl $0x40a, %eax            # imm = 0x40A
je 0x21937
jmp 0x21802
movl -0x5c(%rbp), %eax
subl $0x40b, %eax            # imm = 0x40B
je 0x2194c
jmp 0x21812
movl -0x5c(%rbp), %eax
subl $0x410, %eax            # imm = 0x410
je 0x21961
jmp 0x21822
movl -0x5c(%rbp), %eax
subl $0x420, %eax            # imm = 0x420
je 0x21a0d
jmp 0x21832
movl -0x5c(%rbp), %eax
subl $0x430, %eax            # imm = 0x430
je 0x21b60
jmp 0x21842
movl -0x5c(%rbp), %eax
subl $0x440, %eax            # imm = 0x440
je 0x21c4e
jmp 0x21852
movl -0x5c(%rbp), %eax
subl $0x4ff, %eax            # imm = 0x4FF
je 0x21cbb
jmp 0x21ccd
movq -0x10(%rbp), %rdi
leaq 0x5577c(%rip), %rsi     # 0x76fec
callq 0x9aa0
jmp 0x21cec
movq -0x10(%rbp), %rdi
leaq 0x5576e(%rip), %rsi     # 0x76ff3
callq 0x9aa0
jmp 0x21cec
movq -0x10(%rbp), %rdi
leaq 0x55758(%rip), %rsi     # 0x76ff2
callq 0x9aa0
jmp 0x21cec
movq -0x10(%rbp), %rdi
leaq 0x5574d(%rip), %rsi     # 0x76ffc
callq 0x9aa0
jmp 0x21cec
movq -0x10(%rbp), %rdi
leaq 0x55737(%rip), %rsi     # 0x76ffb
callq 0x9aa0
jmp 0x21cec
movq -0x10(%rbp), %rdi
leaq 0x5572d(%rip), %rsi     # 0x77006
callq 0x9aa0
jmp 0x21cec
movq -0x10(%rbp), %rdi
leaq 0x55717(%rip), %rsi     # 0x77005
callq 0x9aa0
jmp 0x21cec
movq -0x10(%rbp), %rdi
leaq 0x5570d(%rip), %rsi     # 0x77010
callq 0x9aa0
jmp 0x21cec
movq -0x10(%rbp), %rdi
leaq 0x556f7(%rip), %rsi     # 0x7700f
callq 0x9aa0
jmp 0x21cec
movq -0x10(%rbp), %rdi
leaq 0x556ec(%rip), %rsi     # 0x77019
callq 0x9aa0
jmp 0x21cec
movq -0x10(%rbp), %rdi
leaq 0x556de(%rip), %rsi     # 0x77020
callq 0x9aa0
jmp 0x21cec
movq -0x10(%rbp), %rdi
leaq 0x556d1(%rip), %rsi     # 0x77028
callq 0x9aa0
jmp 0x21cec
movq -0x18(%rbp), %rax
cmpl $0x1, 0x44(%rax)
jne 0x2196d
jmp 0x2198c
leaq 0x52e00(%rip), %rdi     # 0x74774
leaq 0x5546d(%rip), %rsi     # 0x76de8
movl $0x5d, %edx
leaq 0x5561c(%rip), %rcx     # 0x76fa3
callq 0x30a0
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jne 0x219a9
jmp 0x219c8
leaq 0x52ddc(%rip), %rdi     # 0x7478c
leaq 0x55431(%rip), %rsi     # 0x76de8
movl $0x60, %edx
leaq 0x555e0(%rip), %rcx     # 0x76fa3
callq 0x30a0
movq -0x10(%rbp), %rdi
leaq 0x51a81(%rip), %rsi     # 0x73454
callq 0x9aa0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x4(%rax), %edx
callq 0x9b10
movq -0x10(%rbp), %rdi
leaq 0x546e4(%rip), %rsi     # 0x760e7
callq 0x9aa0
jmp 0x21cec
movq -0x18(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x21a19
jmp 0x21a38
leaq 0x52e28(%rip), %rdi     # 0x74848
leaq 0x553c1(%rip), %rsi     # 0x76de8
movl $0x68, %edx
leaq 0x55570(%rip), %rcx     # 0x76fa3
callq 0x30a0
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x421, (%rax)          # imm = 0x421
jne 0x21a55
jmp 0x21a74
leaq 0x52d54(%rip), %rdi     # 0x747b0
leaq 0x55385(%rip), %rsi     # 0x76de8
movl $0x6a, %edx
leaq 0x55534(%rip), %rcx     # 0x76fa3
callq 0x30a0
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x55fce(%rip), %rsi     # 0x77a5d
callq 0x9aa0
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jge 0x21b3a
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpl $0x300, (%rax)          # imm = 0x300
jne 0x21acd
jmp 0x21aec
leaq 0x52d2a(%rip), %rdi     # 0x747fe
leaq 0x5530d(%rip), %rsi     # 0x76de8
movl $0x70, %edx
leaq 0x554bc(%rip), %rcx     # 0x76fa3
callq 0x30a0
movq -0x10(%rbp), %rdi
leaq 0x52d34(%rip), %rsi     # 0x7482b
callq 0x8d70
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x4(%rax), %edx
callq 0x8f90
movq -0x10(%rbp), %rdi
leaq 0x5d5f6(%rip), %rsi     # 0x7f11d
callq 0x8d70
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x21a9b
movq -0x10(%rbp), %rdi
leaq 0x55459(%rip), %rsi     # 0x76f9e
callq 0x8d70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x216c0
jmp 0x21cec
movq -0x18(%rbp), %rax
cmpl $0x1, 0x44(%rax)
je 0x21b74
movq -0x18(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x21b76
jmp 0x21b95
leaq 0x52cb0(%rip), %rdi     # 0x7482d
leaq 0x55264(%rip), %rsi     # 0x76de8
movl $0x7b, %edx
leaq 0x55413(%rip), %rcx     # 0x76fa3
callq 0x30a0
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x21bce
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x55e84(%rip), %rsi     # 0x77a5d
callq 0x9aa0
movq -0x10(%rbp), %rdi
leaq 0x55448(%rip), %rsi     # 0x77031
callq 0x8d70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x21e30
movq -0x10(%rbp), %rdi
leaq 0x55394(%rip), %rsi     # 0x76f9e
callq 0x8d70
cmpq $0x0, -0x50(%rbp)
je 0x21c29
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x216c0
jmp 0x21c49
movq -0x10(%rbp), %rdi
leaq 0x55400(%rip), %rsi     # 0x77034
callq 0x9aa0
movq -0x10(%rbp), %rdi
leaq 0x5535a(%rip), %rsi     # 0x76f9e
callq 0x8d70
jmp 0x21cec
movq -0x18(%rbp), %rax
cmpl $0x1, 0x44(%rax)
jne 0x21c5a
jmp 0x21c79
leaq 0x52b13(%rip), %rdi     # 0x74774
leaq 0x55180(%rip), %rsi     # 0x76de8
movl $0x92, %edx
leaq 0x5532f(%rip), %rcx     # 0x76fa3
callq 0x30a0
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x553a7(%rip), %rsi     # 0x7703a
callq 0x9aa0
movq -0x10(%rbp), %rdi
leaq 0x552fb(%rip), %rsi     # 0x76f9e
callq 0x8d70
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0x216c0
jmp 0x21cec
movq -0x10(%rbp), %rdi
leaq 0x55377(%rip), %rsi     # 0x7703d
callq 0x9aa0
jmp 0x21cec
leaq 0x50787(%rip), %rdi     # 0x7245b
leaq 0x5510d(%rip), %rsi     # 0x76de8
movl $0xa0, %edx
leaq 0x552bc(%rip), %rcx     # 0x76fa3
callq 0x30a0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)