// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/string_type.c
// Function: prv_get_string_details
static bool prv_get_string_details(subtilis_parser_t *p, subtilis_exp_t *a2,
				   subtilis_ir_operand_t *a2_size,
				   subtilis_ir_operand_t *a2_data,
				   char **a2_tmp, subtilis_error_t *err)
{
	size_t len;
	bool retval = true;
	subtilis_ir_operand_t op1;
	subtilis_ir_operand_t op2;

	switch (a2->type.type) {
	case SUBTILIS_TYPE_CONST_STRING:
		len = subtilis_buffer_get_size(&a2->exp.str) - 1;
		if (len == 0) {
			retval = false;
			goto cleanup;
		}

		op1.integer = len;
		a2_size->reg = subtilis_ir_section_add_instr2(
		    p->current, SUBTILIS_OP_INSTR_MOVI_I32, op1, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;

		*a2_tmp = a2->temporary;
		a2_data->reg = subtilis_string_type_lca_const(
		    p, subtilis_buffer_get_string(&a2->exp.str), len, err);
		break;
	case SUBTILIS_TYPE_STRING:
		op2.integer = SUBTIILIS_STRING_SIZE_OFF;
		a2_size->reg = subtilis_ir_section_add_instr(
		    p->current, SUBTILIS_OP_INSTR_LOADO_I32, a2->exp.ir_op, op2,
		    err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;

		*a2_tmp = a2->temporary;
		a2_data->reg =
		    subtilis_reference_get_data(p, a2->exp.ir_op.reg, 0, err);
		break;
	default:
		subtilis_error_set_string_expected(err, p->l->stream->name,
						   p->l->line);
	}

cleanup:

	subtilis_exp_delete(a2);

	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movb $0x1, -0x39(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x54(%rbp)
subl $0x3, %eax
je 0x6b1a5
jmp 0x6b194
movl -0x54(%rbp), %eax
subl $0x7, %eax
je 0x6b253
jmp 0x6b2ce
movq -0x10(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
callq 0x16270
subq $0x1, %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x6b1cd
movb $0x0, -0x39(%rbp)
jmp 0x6b300
movq -0x38(%rbp), %rax
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x30(%rbp), %rcx
movq -0x48(%rbp), %rdx
movl $0x1b, %esi
callq 0x38490
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b206
jmp 0x6b300
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
callq 0x16760
movq -0x60(%rbp), %rdi
movq %rax, %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x65d80
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x6b2fe
movl $0x0, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %r8
movq 0x148(%rax), %rdx
movq -0x50(%rbp), %rcx
movl $0x12, %esi
callq 0x38230
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6b294
jmp 0x6b300
movq -0x10(%rbp), %rax
movq 0x158(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x148(%rax), %rsi
movq -0x30(%rbp), %rcx
xorl %eax, %eax
movl %eax, %edx
callq 0x6d1e0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x6b2fe
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %ecx
movl $0x49, %esi
leaq 0x41764(%rip), %r8      # 0xaca57
movl $0xd39, %r9d            # imm = 0xD39
callq 0x15930
jmp 0x6b300
movq -0x10(%rbp), %rdi
callq 0x36ee0
movb -0x39(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)