// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/backend/asmgen_gas64.c
// Function: asm_constexpr
static void _asm_constexpr(
	ASMGeneratorGas64Context *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), "0x%X",
				*(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), "0x%llX",
				*(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), "0x%llX",
					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 0x29820
jmp 0x2983f
leaq 0x5693a(%rip), %rdi     # 0x80161
leaq 0x512d6(%rip), %rsi     # 0x7ab04
movl $0x9ea, %edx            # imm = 0x9EA
leaq 0x51553(%rip), %rcx     # 0x7ad8d
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x29848
jmp 0x29867
leaq 0x4c65b(%rip), %rdi     # 0x75eaa
leaq 0x512ae(%rip), %rsi     # 0x7ab04
movl $0x9eb, %edx            # imm = 0x9EB
leaq 0x5152b(%rip), %rcx     # 0x7ad8d
callq 0x30a0
cmpq $0x0, -0x18(%rbp)
je 0x29870
jmp 0x2988f
leaq 0x4c5a2(%rip), %rdi     # 0x75e19
leaq 0x51286(%rip), %rsi     # 0x7ab04
movl $0x9ec, %edx            # imm = 0x9EC
leaq 0x51503(%rip), %rcx     # 0x7ad8d
callq 0x30a0
movq -0x18(%rbp), %rax
testb $0x1, 0x70(%rax)
je 0x2989b
jmp 0x298ba
leaq 0x4c586(%rip), %rdi     # 0x75e28
leaq 0x5125b(%rip), %rsi     # 0x7ab04
movl $0x9ed, %edx            # imm = 0x9ED
leaq 0x514d8(%rip), %rcx     # 0x7ad8d
callq 0x30a0
movq -0x18(%rbp), %rax
movzbl 0x71(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x670(%rbp)
subl $0xf, %eax
ja 0x29c9b
movq -0x670(%rbp), %rax
leaq 0x50d3c(%rip), %rcx     # 0x7a620
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 0x5e044(%rip), %rdx     # 0x8794f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x8d70
jmp 0x29cba
leaq -0x120(%rbp), %rdi
movq -0x18(%rbp), %rax
movsbl 0x88(%rax), %ecx
movl $0x80, %esi
leaq 0x5e00a(%rip), %rdx     # 0x8794f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x8d70
jmp 0x29cba
leaq -0x1a0(%rbp), %rdi
movq -0x18(%rbp), %rax
movswl 0x88(%rax), %ecx
movl $0x80, %esi
leaq 0x5dfd0(%rip), %rdx     # 0x8794f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x8d70
jmp 0x29cba
leaq -0x220(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x88(%rax), %ecx
movl $0x80, %esi
leaq 0x5df97(%rip), %rdx     # 0x8794f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x8d70
jmp 0x29cba
leaq -0x2a0(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rcx
movl $0x80, %esi
leaq 0x51aed(%rip), %rdx     # 0x7b4df
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x8d70
jmp 0x29cba
leaq -0x320(%rbp), %rdi
movq -0x18(%rbp), %rax
movzbl 0x88(%rax), %ecx
movl $0x80, %esi
leaq 0x4d043(%rip), %rdx     # 0x76a6f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x8d70
jmp 0x29cba
leaq -0x3a0(%rbp), %rdi
movq -0x18(%rbp), %rax
movzwl 0x88(%rax), %ecx
movl $0x80, %esi
leaq 0x4d009(%rip), %rdx     # 0x76a6f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
callq 0x8d70
jmp 0x29cba
leaq -0x420(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x88(%rax), %ecx
movl $0x80, %esi
leaq 0x4cfd0(%rip), %rdx     # 0x76a6f
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x8d70
jmp 0x29cba
leaq -0x4a0(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rcx
movl $0x80, %esi
leaq 0x4c3df(%rip), %rdx     # 0x75eb8
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
callq 0x8d70
jmp 0x29cba
movq -0x18(%rbp), %rax
movss 0x88(%rax), %xmm0
movss %xmm0, -0x524(%rbp)
leaq -0x520(%rbp), %rdi
movl -0x524(%rbp), %ecx
movl $0x80, %esi
leaq 0x519c3(%rip), %rdx     # 0x7b4e5
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x520(%rbp), %rsi
callq 0x8d70
jmp 0x29cba
movq -0x18(%rbp), %rax
movsd 0x88(%rax), %xmm0
movsd %xmm0, -0x5b8(%rbp)
leaq -0x5b0(%rbp), %rdi
movq -0x5b8(%rbp), %rcx
movl $0x80, %esi
leaq 0x5197f(%rip), %rdx     # 0x7b4eb
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x5b0(%rbp), %rsi
callq 0x8d70
jmp 0x29cba
movq -0x18(%rbp), %rax
testb $0x1, 0x72(%rax)
je 0x29c56
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 0x29cd0
movl %eax, -0x5dc(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x678(%rbp)
cmpq $0x0, -0x5d0(%rbp)
jne 0x29c17
leaq 0x4c331(%rip), %rax     # 0x75f3f
movq %rax, -0x680(%rbp)
jmp 0x29c25
movq -0x5d0(%rbp), %rax
movq %rax, -0x680(%rbp)
movq -0x678(%rbp), %rdi
movq -0x680(%rbp), %rdx
movq -0x5c8(%rbp), %rcx
leaq 0x4c272(%rip), %rsi     # 0x75eb3
movb $0x0, %al
callq 0x94d0
leaq -0x5d8(%rbp), %rdi
callq 0x9310
jmp 0x29c99
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x668(%rbp)
leaq -0x660(%rbp), %rdi
movq -0x668(%rbp), %rcx
movl $0x80, %esi
leaq 0x51869(%rip), %rdx     # 0x7b4eb
movb $0x0, %al
callq 0x3090
movq -0x10(%rbp), %rdi
leaq -0x660(%rbp), %rsi
callq 0x8d70
jmp 0x29cba
leaq 0x497b8(%rip), %rdi     # 0x7345a
leaq 0x50e5b(%rip), %rsi     # 0x7ab04
movl $0xa73, %edx            # imm = 0xA73
leaq 0x510d8(%rip), %rcx     # 0x7ad8d
callq 0x30a0
addq $0x680, %rsp            # imm = 0x680
popq %rbp
retq
nopw %cs:(%rax,%rax)