// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/arch/arm32/arm_expression.c
// Function: prv_string_str
static subtilis_arm_exp_val_t *prv_string_str(subtilis_arm_ass_context_t *c,
					      subtilis_error_t *err)
{
	const char *tbuf;
	subtilis_buffer_t buf;
	size_t i;
	size_t string_len;
	int32_t repeat;
	const char *seed_string;
	subtilis_arm_exp_val_t *retval = NULL;
	subtilis_arm_exp_val_t *count = NULL;
	subtilis_arm_exp_val_t *string = NULL;

	subtilis_lexer_get(c->l, c->t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	tbuf = subtilis_token_get_text(c->t);
	if (strcmp(tbuf, "(")) {
		subtilis_error_set_expected(err, "( ", tbuf, c->l->stream->name,
					    c->l->line);
		return NULL;
	}

	count = subtilis_arm_exp_val_get(c, err);
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	repeat = prv_exp_to_int(c, count, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	tbuf = subtilis_token_get_text(c->t);
	if ((c->t->type != SUBTILIS_TOKEN_OPERATOR) || strcmp(tbuf, ",")) {
		subtilis_error_set_expected(err, ",", tbuf, c->l->stream->name,
					    c->l->line);
		goto cleanup;
	}

	string = subtilis_arm_exp_val_get(c, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	if (string->type != SUBTILIS_ARM_EXP_TYPE_STRING) {
		subtilis_error_set_const_string_expected(
		    err, c->l->stream->name, c->l->line);
		goto cleanup;
	}

	tbuf = subtilis_token_get_text(c->t);
	if ((c->t->type != SUBTILIS_TOKEN_OPERATOR) || strcmp(tbuf, ")")) {
		subtilis_error_set_right_bkt_expected(
		    err, tbuf, c->l->stream->name, c->l->line);
		goto cleanup;
	}

	subtilis_lexer_get(c->l, c->t, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	string_len = subtilis_buffer_get_size(&string->val.buf) - 1;
	seed_string = subtilis_buffer_get_string(&string->val.buf);
	subtilis_buffer_init(&buf, (count->val.integer * string_len) + 1);

	for (i = 0; i < repeat; i++) {
		subtilis_buffer_append(&buf, seed_string, string_len, err);
		if (err->type != SUBTILIS_ERROR_OK) {
			subtilis_buffer_free(&buf);
			goto cleanup;
		}
	}
	subtilis_buffer_zero_terminate(&buf, err);
	if (err->type != SUBTILIS_ERROR_OK) {
		subtilis_buffer_free(&buf);
		goto cleanup;
	}

	retval = subtilis_arm_exp_new_str(&buf, err);
	subtilis_buffer_free(&buf);

cleanup:

	subtilis_arm_exp_val_free(count);
	subtilis_arm_exp_val_free(string);

	return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x133f0
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9defa
movq $0x0, -0x8(%rbp)
jmp 0x9e21b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x12d70
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq 0xd386(%rip), %rsi      # 0xab29c
callq 0x12140
cmpl $0x0, %eax
je 0x9df71
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0xc9b6(%rip), %rdx      # 0xaa902
leaq 0x104ad(%rip), %rax     # 0xae400
movq %rax, (%rsp)
movl $0x528, 0x8(%rsp)       # imm = 0x528
callq 0x156d0
movq $0x0, -0x8(%rbp)
jmp 0x9e21b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9b4f0
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9df98
movq $0x0, -0x8(%rbp)
jmp 0x9e21b
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x9e330
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9dfba
jmp 0x9e201
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x12d70
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x2, (%rax)
jne 0x9dfed
movq -0x20(%rbp), %rdi
leaq 0xc5c6(%rip), %rsi      # 0xaa5a9
callq 0x12140
cmpl $0x0, %eax
je 0x9e036
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x38(%rax), %r9d
movl $0x1d, %esi
leaq 0xc590(%rip), %rdx      # 0xaa5a9
leaq 0x103e0(%rip), %rax     # 0xae400
movq %rax, (%rsp)
movl $0x537, 0x8(%rsp)       # imm = 0x537
callq 0x156d0
jmp 0x9e201
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9b4f0
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9e055
jmp 0x9e201
movq -0x68(%rbp), %rax
cmpl $0x8, (%rax)
je 0x9e095
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x38(%rax), %ecx
movl $0x4a, %esi
leaq 0x1037b(%rip), %r8      # 0xae400
movl $0x541, %r9d            # imm = 0x541
callq 0x15930
jmp 0x9e201
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x12d70
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x2, (%rax)
jne 0x9e0c8
movq -0x20(%rbp), %rdi
leaq 0xca93(%rip), %rsi      # 0xaab51
callq 0x12140
cmpl $0x0, %eax
je 0x9e111
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x30(%rax), %r8
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x38(%rax), %r9d
movl $0x16, %esi
leaq 0xd182(%rip), %rcx      # 0xab276
leaq 0x10305(%rip), %rax     # 0xae400
movq %rax, (%rsp)
movl $0x548, 0x8(%rsp)       # imm = 0x548
callq 0x156d0
jmp 0x9e201
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x133f0
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9e138
jmp 0x9e201
movq -0x68(%rbp), %rdi
addq $0x8, %rdi
callq 0x16270
subq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x68(%rbp), %rdi
addq $0x8, %rdi
callq 0x16760
movq %rax, -0x50(%rbp)
movq -0x60(%rbp), %rax
movslq 0x8(%rax), %rsi
imulq -0x40(%rbp), %rsi
addq $0x1, %rsi
leaq -0x30(%rbp), %rdi
callq 0x15f80
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
cmpq %rcx, %rax
jae 0x9e1c6
movq -0x50(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq -0x30(%rbp), %rdi
callq 0x16200
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9e1b6
leaq -0x30(%rbp), %rdi
callq 0x16650
jmp 0x9e201
jmp 0x9e1b8
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x9e180
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x16560
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x9e1e7
leaq -0x30(%rbp), %rdi
callq 0x16650
jmp 0x9e201
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x9a510
movq %rax, -0x58(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x16650
movq -0x60(%rbp), %rdi
callq 0x9a4c0
movq -0x68(%rbp), %rdi
callq 0x9a4c0
movq -0x58(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)