// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/string_type.c
// Function: prv_string_str_const
static subtilis_exp_t *prv_string_str_const(subtilis_parser_t *p,
					    subtilis_exp_t *count,
					    subtilis_exp_t *str,
					    subtilis_error_t *err)
{
	int32_t i;
	char *copy = NULL;

	if (count->exp.ir_op.integer <= 0) {
		subtilis_buffer_reset(&str->exp.str);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		subtilis_buffer_zero_terminate(&str->exp.str, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
		subtilis_exp_delete(count);
		return str;
	}

	copy = malloc(subtilis_buffer_get_size(&str->exp.str) + 1);
	if (!copy) {
		subtilis_error_set_oom(err);
		goto cleanup;
	}
	strcpy(copy, subtilis_buffer_get_string(&str->exp.str));
	subtilis_buffer_remove_terminator(&str->exp.str);
	for (i = 1; i < count->exp.ir_op.integer; i++) {
		subtilis_buffer_append_string(&str->exp.str, copy, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto cleanup;
	}
	subtilis_buffer_zero_terminate(&str->exp.str, err);
	if (err->type != SUBTILIS_ERROR_OK)
		goto cleanup;

	free(copy);
	subtilis_exp_delete(count);
	return str;

cleanup:

	free(copy);
	subtilis_exp_delete(count);
	subtilis_exp_delete(str);

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x148(%rax)
jg 0x6a623
movq -0x20(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
callq 0x16690
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6a5eb
jmp 0x6a71e
movq -0x20(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
movq -0x28(%rbp), %rsi
callq 0x16560
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6a60d
jmp 0x6a71e
movq -0x18(%rbp), %rdi
callq 0x36ee0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6a741
movq -0x20(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
callq 0x16270
movq %rax, %rdi
addq $0x1, %rdi
callq 0x121b0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x6a669
movq -0x28(%rbp), %rdi
movl $0x1, %esi
leaq 0x423fd(%rip), %rdx     # 0xaca57
movl $0xafb, %ecx            # imm = 0xAFB
callq 0x158e0
jmp 0x6a71e
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
callq 0x16760
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x12060
movq -0x20(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
callq 0x165d0
movl $0x1, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x148(%rcx), %eax
jge 0x6a6e3
movq -0x20(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
movq -0x38(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x16310
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6a6d6
jmp 0x6a71e
jmp 0x6a6d8
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x6a6a4
movq -0x20(%rbp), %rdi
addq $0x148, %rdi            # imm = 0x148
movq -0x28(%rbp), %rsi
callq 0x16560
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x6a702
jmp 0x6a71e
movq -0x38(%rbp), %rdi
callq 0x12290
movq -0x18(%rbp), %rdi
callq 0x36ee0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6a741
movq -0x38(%rbp), %rdi
callq 0x12290
movq -0x18(%rbp), %rdi
callq 0x36ee0
movq -0x20(%rbp), %rdi
callq 0x36ee0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)