// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/backend/asmgen_gas32.c
// Function: asm_constexpr
static void _asm_constexpr(
	ASMGeneratorGas32Context *ctx,
	ResizableString *rstr_val,
	ParserASTNode *node_constexpr
) {
	assert(ctx);
	assert(rstr_val);
	assert(node_constexpr);
	assert(BE_EXPR_AST_NODE_GET_CONSTANT(node_constexpr));

	switch (BE_EXPR_AST_NODE_GET_CONSTANT_TYPE(node_constexpr)) {
		case BE_TYPE_CHAR: {
			char str[128];
			snprintf(
				str, sizeof(str), "%d",
				BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_CHAR_VAL(node_constexpr)
			);
			rstr_append_with_cstr(rstr_val, str);
			break;
		}
		case BE_TYPE_INT8: {
			char str[128];
			snprintf(
				str, sizeof(str), "%d",
				BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_INT8_VAL(node_constexpr)
			);
			rstr_append_with_cstr(rstr_val, str);
			break;
		}
		case BE_TYPE_INT16: {
			char str[128];
			snprintf(
				str, sizeof(str), "%d",
				BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_INT16_VAL(node_constexpr)
			);
			rstr_append_with_cstr(rstr_val, str);
			break;
		}
		case BE_TYPE_INT32: {
			char str[128];
			snprintf(
				str, sizeof(str), "%d",
				BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_INT32_VAL(node_constexpr)
			);
			rstr_append_with_cstr(rstr_val, str);
			break;
		}
		case BE_TYPE_INT64: {
			char str[128];
			snprintf(
				str, sizeof(str), "%lld",
				BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_INT64_VAL(node_constexpr)
			);
			rstr_append_with_cstr(rstr_val, str);
			break;
		}
		case BE_TYPE_UINT8: {
			char str[128];
			snprintf(
				str, sizeof(str), "%u",
				BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_UINT8_VAL(node_constexpr)
			);
			rstr_append_with_cstr(rstr_val, str);
			break;
		}
		case BE_TYPE_UINT16: {
			char str[128];
			snprintf(
				str, sizeof(str), "%u",
				BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_UINT16_VAL(node_constexpr)
			);
			rstr_append_with_cstr(rstr_val, str);
			break;
		}
		case BE_TYPE_UINT32: {
			char str[128];
			snprintf(
				str, sizeof(str), "%u",
				BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_UINT32_VAL(node_constexpr)
			);
			rstr_append_with_cstr(rstr_val, str);
			break;
		}
		case BE_TYPE_UINT64: {
			char str[128];
			snprintf(
				str, sizeof(str), "%llu",
				BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_UINT64_VAL(node_constexpr)
			);
			rstr_append_with_cstr(rstr_val, str);
			break;
		}
		case BE_TYPE_FLOAT: {
			char str[128];
			float val = BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_FLOAT_VAL(node_constexpr);
			snprintf(
				str, sizeof(str), "%u",
				*(uint32_t *)&val
			);
			rstr_append_with_cstr(rstr_val, str);
			break;
		}
		case BE_TYPE_DOUBLE: {
			char str[128];
			double val = BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_DOUBLE_VAL(node_constexpr);
			snprintf(
				str, sizeof(str), "%llu",
				*(uint64_t *)&val
			);
			rstr_append_with_cstr(rstr_val, str);
			break;
		}
		case BE_TYPE_POINTER: {
			if (BE_EXPR_AST_NODE_GET_HAS_CONSTSTR(node_constexpr)) {
				BeParserConstexprString *conststr = BE_EXPR_AST_NODE_GET_CONSTSTR(node_constexpr);
				uint64_t ptr_val = BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_POINTER_VAL(node_constexpr);

				ResizableString conststr_name;
				rstr_init(&conststr_name);

				int len = _new_string(ctx, &conststr_name, conststr->str, conststr->len);

				rstr_appendf(
					rstr_val,
					"%s + %llu",
					RSTR_CSTR(&conststr_name),
					ptr_val
				);

				rstr_free(&conststr_name);
			} else {
				char str[128];
				uint64_t val = BE_EXPR_AST_NODE_GET_CONSTEXPR_RESULT_POINTER_VAL(node_constexpr);
				snprintf(
					str, sizeof(str), "%llu",
					val
				);
				rstr_append_with_cstr(rstr_val, str);
			}
			break;
		}
		default: {
			assert(0);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x680, %rsp            # imm = 0x680
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x11100
jmp 0x1111f
leaq 0x6f05a(%rip), %rdi     # 0x80161
leaq 0x647ea(%rip), %rsi     # 0x758f8
movl $0xb3b, %edx            # imm = 0xB3B
leaq 0x64d3c(%rip), %rcx     # 0x75e56
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x11128
jmp 0x11147
leaq 0x64d7b(%rip), %rdi     # 0x75eaa
leaq 0x647c2(%rip), %rsi     # 0x758f8
movl $0xb3c, %edx            # imm = 0xB3C
leaq 0x64d14(%rip), %rcx     # 0x75e56
callq 0x30a0
cmpq $0x0, -0x18(%rbp)
je 0x11150
jmp 0x1116f
leaq 0x64cc2(%rip), %rdi     # 0x75e19
leaq 0x6479a(%rip), %rsi     # 0x758f8
movl $0xb3d, %edx            # imm = 0xB3D
leaq 0x64cec(%rip), %rcx     # 0x75e56
callq 0x30a0
movq -0x18(%rbp), %rax
testb $0x1, 0x70(%rax)
je 0x1117b
jmp 0x1119a
leaq 0x64ca6(%rip), %rdi     # 0x75e28
leaq 0x6476f(%rip), %rsi     # 0x758f8
movl $0xb3e, %edx            # imm = 0xB3E
leaq 0x64cc1(%rip), %rcx     # 0x75e56
callq 0x30a0
movq -0x18(%rbp), %rax
movzbl 0x71(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x670(%rbp)
subl $0xf, %eax
ja 0x1157b
movq -0x670(%rbp), %rax
leaq 0x642d0(%rip), %rcx     # 0x75494
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0xa0(%rbp), %rdi
movq -0x18(%rbp), %rax
movsbl 0x88(%rax), %ecx
movl $0x80, %esi
leaq 0x76764(%rip), %rdx     # 0x8794f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x8d70
jmp 0x1159a
leaq -0x120(%rbp), %rdi
movq -0x18(%rbp), %rax
movsbl 0x88(%rax), %ecx
movl $0x80, %esi
leaq 0x7672a(%rip), %rdx     # 0x8794f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x8d70
jmp 0x1159a
leaq -0x1a0(%rbp), %rdi
movq -0x18(%rbp), %rax
movswl 0x88(%rax), %ecx
movl $0x80, %esi
leaq 0x766f0(%rip), %rdx     # 0x8794f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x8d70
jmp 0x1159a
leaq -0x220(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x88(%rax), %ecx
movl $0x80, %esi
leaq 0x766b7(%rip), %rdx     # 0x8794f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x8d70
jmp 0x1159a
leaq -0x2a0(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rcx
movl $0x80, %esi
leaq 0x6a20d(%rip), %rdx     # 0x7b4df
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x8d70
jmp 0x1159a
leaq -0x320(%rbp), %rdi
movq -0x18(%rbp), %rax
movzbl 0x88(%rax), %ecx
movl $0x80, %esi
leaq 0x65763(%rip), %rdx     # 0x76a6f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x8d70
jmp 0x1159a
leaq -0x3a0(%rbp), %rdi
movq -0x18(%rbp), %rax
movzwl 0x88(%rax), %ecx
movl $0x80, %esi
leaq 0x65729(%rip), %rdx     # 0x76a6f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0x8d70
jmp 0x1159a
leaq -0x420(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x88(%rax), %ecx
movl $0x80, %esi
leaq 0x656f0(%rip), %rdx     # 0x76a6f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x8d70
jmp 0x1159a
leaq -0x4a0(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rcx
movl $0x80, %esi
leaq 0x64aff(%rip), %rdx     # 0x75eb8
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
callq 0x8d70
jmp 0x1159a
movq -0x18(%rbp), %rax
movss 0x88(%rax), %xmm0
movss %xmm0, -0x524(%rbp)
leaq -0x520(%rbp), %rdi
movl -0x524(%rbp), %ecx
movl $0x80, %esi
leaq 0x6566d(%rip), %rdx     # 0x76a6f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x520(%rbp), %rsi
callq 0x8d70
jmp 0x1159a
movq -0x18(%rbp), %rax
movsd 0x88(%rax), %xmm0
movsd %xmm0, -0x5b8(%rbp)
leaq -0x5b0(%rbp), %rdi
movq -0x5b8(%rbp), %rcx
movl $0x80, %esi
leaq 0x64a6c(%rip), %rdx     # 0x75eb8
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x5b0(%rbp), %rsi
callq 0x8d70
jmp 0x1159a
movq -0x18(%rbp), %rax
testb $0x1, 0x72(%rax)
je 0x11536
movq -0x18(%rbp), %rax
addq $0x60, %rax
addq $0x18, %rax
movq %rax, -0x5c0(%rbp)
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x5c8(%rbp)
leaq -0x5d8(%rbp), %rdi
callq 0x8c90
movq -0x8(%rbp), %rdi
movq -0x5c0(%rbp), %rax
movq (%rax), %rdx
movq -0x5c0(%rbp), %rax
movq 0x8(%rax), %rcx
leaq -0x5d8(%rbp), %rsi
callq 0x115b0
movl %eax, -0x5dc(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x678(%rbp)
cmpq $0x0, -0x5d0(%rbp)
jne 0x114f7
leaq 0x64a51(%rip), %rax     # 0x75f3f
movq %rax, -0x680(%rbp)
jmp 0x11505
movq -0x5d0(%rbp), %rax
movq %rax, -0x680(%rbp)
movq -0x678(%rbp), %rdi
movq -0x680(%rbp), %rdx
movq -0x5c8(%rbp), %rcx
leaq 0x64992(%rip), %rsi     # 0x75eb3
movb $0x0, %al
callq 0x94d0
leaq -0x5d8(%rbp), %rdi
callq 0x9310
jmp 0x11579
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x668(%rbp)
leaq -0x660(%rbp), %rdi
movq -0x668(%rbp), %rcx
movl $0x80, %esi
leaq 0x64956(%rip), %rdx     # 0x75eb8
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x660(%rbp), %rsi
callq 0x8d70
jmp 0x1159a
leaq 0x61ed8(%rip), %rdi     # 0x7345a
leaq 0x6436f(%rip), %rsi     # 0x758f8
movl $0xbc4, %edx            # imm = 0xBC4
leaq 0x648c1(%rip), %rcx     # 0x75e56
callq 0x30a0
addq $0x680, %rsp            # imm = 0x680
popq %rbp
retq
nopw %cs:(%rax,%rax)