// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/string_type.c
// Function: prv_asc_var
static subtilis_exp_t *prv_asc_var(subtilis_parser_t *p,
				   subtilis_ir_operand_t str,
				   subtilis_error_t *err)
{
	subtilis_ir_operand_t size;
	subtilis_ir_operand_t data_reg;
	subtilis_ir_operand_t byte_reg;
	subtilis_ir_operand_t zero;
	subtilis_ir_operand_t neg1;
	subtilis_ir_operand_t gtzero;
	subtilis_ir_operand_t offset;

	offset.integer = SUBTIILIS_STRING_SIZE_OFF;
	size.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_LOADO_I32, str, offset, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	zero.label = subtilis_ir_section_new_label(p->current);
	gtzero.label = subtilis_ir_section_new_label(p->current);

	neg1.integer = -1;
	byte_reg.reg = subtilis_ir_section_add_instr2(
	    p->current, SUBTILIS_OP_INSTR_MOVI_I32, neg1, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	subtilis_ir_section_add_instr_reg(p->current, SUBTILIS_OP_INSTR_JMPC,
					  size, gtzero, zero, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	subtilis_ir_section_add_label(p->current, gtzero.label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;
	offset.integer = SUBTIILIS_STRING_DATA_OFF;
	data_reg.reg = subtilis_ir_section_add_instr(
	    p->current, SUBTILIS_OP_INSTR_LOADO_I32, str, offset, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	offset.integer = 0;
	subtilis_ir_section_add_instr_reg(p->current,
					  SUBTILIS_OP_INSTR_LOADO_I8, byte_reg,
					  data_reg, offset, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	subtilis_ir_section_add_label(p->current, zero.label, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	return subtilis_exp_new_int32_var(byte_reg.reg, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rsi, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x20(%rbp), %r8
movq -0x10(%rbp), %rdx
movq -0x58(%rbp), %rcx
movl $0x12, %esi
callq 0x38230
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x675b3
movq $0x0, -0x8(%rbp)
jmp 0x67726
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x39940
movq %rax, -0x50(%rbp)
movl $0xffffffff, -0x48(%rbp) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x20(%rbp), %rcx
movq -0x48(%rbp), %rdx
movl $0x1b, %esi
callq 0x38490
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x67610
movq $0x0, -0x8(%rbp)
jmp 0x67726
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x20(%rbp), %r9
movq -0x28(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x40(%rbp), %r8
movl $0x43, %esi
callq 0x38360
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x67648
movq $0x0, -0x8(%rbp)
jmp 0x67726
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x50(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x39960
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x67673
movq $0x0, -0x8(%rbp)
jmp 0x67726
movl $0x4, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x20(%rbp), %r8
movq -0x10(%rbp), %rdx
movq -0x58(%rbp), %rcx
movl $0x12, %esi
callq 0x38230
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x676af
movq $0x0, -0x8(%rbp)
jmp 0x67726
movl $0x0, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x20(%rbp), %r9
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x58(%rbp), %r8
movl $0x11, %esi
callq 0x38360
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x676eb
movq $0x0, -0x8(%rbp)
jmp 0x67726
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x40(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x39960
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0x67713
movq $0x0, -0x8(%rbp)
jmp 0x67726
movq -0x38(%rbp), %rax
movl %eax, %edi
movq -0x20(%rbp), %rsi
callq 0x37770
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq