// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/assembler/ins.c
// Function: get_size
size_t _get_size(
	ParserContext *ctx,
	ParserASTNode *node
) {
	assert(ctx);
	assert(node);

	if (node->type == ASM_NODE_REG) {
		InsRegister *ins_reg = ASM_REG_AST_NODE_GET_REG(node);
		assert(ins_reg);

		switch (ins_reg->type) {
			case INS_REGISTER_GENERAL_1BYTE: {
				return 1;
			}
			case INS_REGISTER_GENERAL_2BYTE: {
				return 2;
			}
			case INS_REGISTER_GENERAL_4BYTE: {
				return 4;
			}
			case INS_REGISTER_GENERAL_8BYTE: {
				return 8;
			}
			default: {
				assert(0);
				return 0;
			}
		}
	} else if (node->type == ASM_NODE_MEM) {
		int type = ASM_MEM_AST_NODE_GET_TYPE(node);

		switch (type) {
			case ASM_MEM_TYPE_BYTE: {
				return 1;
			}
			case ASM_MEM_TYPE_WORD: {
				return 2;
			}
			case ASM_MEM_TYPE_DWORD: {
				return 4;
			}
			case ASM_MEM_TYPE_QWORD: {
				return 8;
			}
			default: {
				assert(0);
				return 0;
			}
		}
	} else {
		assert(0);
		return 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1c3c9
jmp 0x1c3e8
leaq 0x31791(%rip), %rdi     # 0x4db61
leaq 0x2d525(%rip), %rsi     # 0x498fc
movl $0x544, %edx            # imm = 0x544
leaq 0x2dc13(%rip), %rcx     # 0x49ff6
callq 0xa0b0
cmpq $0x0, -0x18(%rbp)
je 0x1c3f1
jmp 0x1c410
leaq 0x2ec8f(%rip), %rdi     # 0x4b087
leaq 0x2d4fd(%rip), %rsi     # 0x498fc
movl $0x545, %edx            # imm = 0x545
leaq 0x2dbeb(%rip), %rcx     # 0x49ff6
callq 0xa0b0
movq -0x18(%rbp), %rax
cmpl $0x500, (%rax)          # imm = 0x500
jne 0x1c4d0
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1c435
jmp 0x1c454
leaq 0x2d741(%rip), %rdi     # 0x49b7d
leaq 0x2d4b9(%rip), %rsi     # 0x498fc
movl $0x549, %edx            # imm = 0x549
leaq 0x2dba7(%rip), %rcx     # 0x49ff6
callq 0xa0b0
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x3, %eax
ja 0x1c4b1
movq -0x30(%rbp), %rax
leaq 0x2d478(%rip), %rcx     # 0x498ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq $0x1, -0x8(%rbp)
jmp 0x1c570
movq $0x2, -0x8(%rbp)
jmp 0x1c570
movq $0x4, -0x8(%rbp)
jmp 0x1c570
movq $0x8, -0x8(%rbp)
jmp 0x1c570
leaq 0x2afad(%rip), %rdi     # 0x47465
leaq 0x2d43d(%rip), %rsi     # 0x498fc
movl $0x559, %edx            # imm = 0x559
leaq 0x2db2b(%rip), %rcx     # 0x49ff6
callq 0xa0b0
movq -0x18(%rbp), %rax
cmpl $0x600, (%rax)          # imm = 0x600
jne 0x1c551
movq -0x18(%rbp), %rax
movl 0x64(%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x3, %eax
ja 0x1c532
movq -0x38(%rbp), %rax
leaq 0x2d3db(%rip), %rcx     # 0x498dc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq $0x1, -0x8(%rbp)
jmp 0x1c570
movq $0x2, -0x8(%rbp)
jmp 0x1c570
movq $0x4, -0x8(%rbp)
jmp 0x1c570
movq $0x8, -0x8(%rbp)
jmp 0x1c570
leaq 0x2af2c(%rip), %rdi     # 0x47465
leaq 0x2d3bc(%rip), %rsi     # 0x498fc
movl $0x56e, %edx            # imm = 0x56E
leaq 0x2daaa(%rip), %rcx     # 0x49ff6
callq 0xa0b0
leaq 0x2af0d(%rip), %rdi     # 0x47465
leaq 0x2d39d(%rip), %rsi     # 0x498fc
movl $0x573, %edx            # imm = 0x573
leaq 0x2da8b(%rip), %rcx     # 0x49ff6
callq 0xa0b0
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)