// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/frontend/semantics.c
// Function: calc_type_align
static size_t _calc_type_align(
	ParserContext *ctx,
	ParserASTNode *node,
	ParserASTNode *node_type
) {
	assert(ctx);
	assert(node);
	assert(node_type);

	switch (node_type->type) {
		case FE_NODE_TYPE_CHAR: {
			return 1;
		}
		case FE_NODE_TYPE_INT8: {
			return 1;
		}
		case FE_NODE_TYPE_INT16: {
			return 2;
		}
		case FE_NODE_TYPE_INT32: {
			return 4;
		}
		case FE_NODE_TYPE_INT64: {
			return 8;
		}
		case FE_NODE_TYPE_UINT8: {
			return 1;
		}
		case FE_NODE_TYPE_UINT16: {
			return 2;
		}
		case FE_NODE_TYPE_UINT32: {
			return 4;
		}
		case FE_NODE_TYPE_UINT64: {
			return 8;
		}
		case FE_NODE_TYPE_FLOAT: {
			return 4;
		}
		case FE_NODE_TYPE_DOUBLE: {
			return 8;
		}
		case FE_NODE_TYPE_VA_LIST: {
			return 1;
		}
		case FE_NODE_TYPE_STRUCT: {
			return _calc_struct_type_align(ctx, node, node_type);
		}
		case FE_NODE_TYPE_ARRAY: {
			assert(node_type->nchilds == 2);

			ParserASTNode *node_array_type = node_type->childs[1];
			assert(node_array_type);

			return _calc_type_align(ctx, node, node_array_type);
		}
		case FE_NODE_TYPE_FUNC: {
			return 0;
		}
		case FE_NODE_TYPE_POINTER: {
			if (ctx->arch == FE_ARCH_32) {
				return 4;
			} else if (ctx->arch == FE_ARCH_64) {
				return 8;
			} else {
				assert(0);
				return 0;
			}
		}
		case FE_NODE_TYPE_VOID: {
			return 1;
		}
		default: {
			assert(0);
			return 0;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x4f16d
jmp 0x4f18c
leaq 0x2d3e2(%rip), %rdi     # 0x7c556
leaq 0x2f0cf(%rip), %rsi     # 0x7e24a
movl $0x738, %edx            # imm = 0x738
leaq 0x2f500(%rip), %rcx     # 0x7e687
callq 0x30a0
cmpq $0x0, -0x18(%rbp)
je 0x4f195
jmp 0x4f1b4
leaq 0x26e37(%rip), %rdi     # 0x75fd3
leaq 0x2f0a7(%rip), %rsi     # 0x7e24a
movl $0x739, %edx            # imm = 0x739
leaq 0x2f4d8(%rip), %rcx     # 0x7e687
callq 0x30a0
cmpq $0x0, -0x20(%rbp)
je 0x4f1bd
jmp 0x4f1dc
leaq 0x2556f(%rip), %rdi     # 0x74733
leaq 0x2f07f(%rip), %rsi     # 0x7e24a
movl $0x73a, %edx            # imm = 0x73A
leaq 0x2f4b0(%rip), %rcx     # 0x7e687
callq 0x30a0
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
subl $0x400, %eax            # imm = 0x400
je 0x4f2f5
jmp 0x4f1f2
movl -0x2c(%rbp), %eax
subl $0x401, %eax            # imm = 0x401
je 0x4f302
jmp 0x4f202
movl -0x2c(%rbp), %eax
subl $0x402, %eax            # imm = 0x402
je 0x4f30f
jmp 0x4f212
movl -0x2c(%rbp), %eax
subl $0x403, %eax            # imm = 0x403
je 0x4f31c
jmp 0x4f222
movl -0x2c(%rbp), %eax
subl $0x404, %eax            # imm = 0x404
je 0x4f329
jmp 0x4f232
movl -0x2c(%rbp), %eax
subl $0x405, %eax            # imm = 0x405
je 0x4f336
jmp 0x4f242
movl -0x2c(%rbp), %eax
subl $0x406, %eax            # imm = 0x406
je 0x4f343
jmp 0x4f252
movl -0x2c(%rbp), %eax
subl $0x407, %eax            # imm = 0x407
je 0x4f350
jmp 0x4f262
movl -0x2c(%rbp), %eax
subl $0x408, %eax            # imm = 0x408
je 0x4f35d
jmp 0x4f272
movl -0x2c(%rbp), %eax
subl $0x409, %eax            # imm = 0x409
je 0x4f36a
jmp 0x4f282
movl -0x2c(%rbp), %eax
subl $0x40a, %eax            # imm = 0x40A
je 0x4f377
jmp 0x4f292
movl -0x2c(%rbp), %eax
subl $0x40b, %eax            # imm = 0x40B
je 0x4f384
jmp 0x4f2a2
movl -0x2c(%rbp), %eax
subl $0x410, %eax            # imm = 0x410
je 0x4f391
jmp 0x4f2b2
movl -0x2c(%rbp), %eax
subl $0x420, %eax            # imm = 0x420
je 0x4f3ab
jmp 0x4f2c2
movl -0x2c(%rbp), %eax
subl $0x430, %eax            # imm = 0x430
je 0x4f425
jmp 0x4f2d2
movl -0x2c(%rbp), %eax
subl $0x440, %eax            # imm = 0x440
je 0x4f42f
jmp 0x4f2e2
movl -0x2c(%rbp), %eax
subl $0x4ff, %eax            # imm = 0x4FF
je 0x4f476
jmp 0x4f480
movq $0x1, -0x8(%rbp)
jmp 0x4f49f
movq $0x1, -0x8(%rbp)
jmp 0x4f49f
movq $0x2, -0x8(%rbp)
jmp 0x4f49f
movq $0x4, -0x8(%rbp)
jmp 0x4f49f
movq $0x8, -0x8(%rbp)
jmp 0x4f49f
movq $0x1, -0x8(%rbp)
jmp 0x4f49f
movq $0x2, -0x8(%rbp)
jmp 0x4f49f
movq $0x4, -0x8(%rbp)
jmp 0x4f49f
movq $0x8, -0x8(%rbp)
jmp 0x4f49f
movq $0x4, -0x8(%rbp)
jmp 0x4f49f
movq $0x8, -0x8(%rbp)
jmp 0x4f49f
movq $0x1, -0x8(%rbp)
jmp 0x4f49f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x501f0
movq %rax, -0x8(%rbp)
jmp 0x4f49f
movq -0x20(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x4f3b7
jmp 0x4f3d6
leaq 0x2548a(%rip), %rdi     # 0x74848
leaq 0x2ee85(%rip), %rsi     # 0x7e24a
movl $0x765, %edx            # imm = 0x765
leaq 0x2f2b6(%rip), %rcx     # 0x7e687
callq 0x30a0
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x4f3ef
jmp 0x4f40e
leaq 0x2f2dc(%rip), %rdi     # 0x7e6d2
leaq 0x2ee4d(%rip), %rsi     # 0x7e24a
movl $0x768, %edx            # imm = 0x768
leaq 0x2f27e(%rip), %rcx     # 0x7e687
callq 0x30a0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x4f150
movq %rax, -0x8(%rbp)
jmp 0x4f49f
movq $0x0, -0x8(%rbp)
jmp 0x4f49f
movq -0x10(%rbp), %rax
cmpl $0x1, 0x30(%rax)
jne 0x4f443
movq $0x4, -0x8(%rbp)
jmp 0x4f49f
movq -0x10(%rbp), %rax
cmpl $0x2, 0x30(%rax)
jne 0x4f457
movq $0x8, -0x8(%rbp)
jmp 0x4f49f
leaq 0x22ffd(%rip), %rdi     # 0x7245b
leaq 0x2ede5(%rip), %rsi     # 0x7e24a
movl $0x775, %edx            # imm = 0x775
leaq 0x2f216(%rip), %rcx     # 0x7e687
callq 0x30a0
movq $0x1, -0x8(%rbp)
jmp 0x4f49f
leaq 0x22fd4(%rip), %rdi     # 0x7245b
leaq 0x2edbc(%rip), %rsi     # 0x7e24a
movl $0x77d, %edx            # imm = 0x77D
leaq 0x2f1ed(%rip), %rcx     # 0x7e687
callq 0x30a0
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)