// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: subtilis_builtin_ir_call_deref_array_recs_gen
void subtilis_builtin_ir_call_deref_array_recs_gen(subtilis_parser_t *p,
						   size_t el_start_reg,
						   size_t el_size_reg,
						   size_t el_destruct_reg,
						   subtilis_error_t *err)
{
	subtilis_ir_section_t *fn;
	const subtilis_type_t *ptype[3];
	subtilis_ir_arg_t *args;
	char *name_copy;
	const char *name = "_deref_array_recs";

	ptype[0] = &subtilis_type_integer;
	ptype[1] = &subtilis_type_integer;
	ptype[2] = &subtilis_type_integer;

	fn = prv_add_args(p, name, 3, ptype, &subtilis_type_void, err);
	if (err->type != SUBTILIS_ERROR_OK) {
		if (err->type != SUBTILIS_ERROR_ALREADY_DEFINED)
			return;
		subtilis_error_init(err);
	} else {
		prv_builtins_ir_deref_array_recs_gen(p, fn, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return;
	}

	name_copy = malloc(strlen(name) + 1);
	if (!name_copy) {
		subtilis_error_set_oom(err);
		return;
	}
	strcpy(name_copy, name);

	args = malloc(sizeof(*args) * 3);
	if (!args) {
		free(name_copy);
		subtilis_error_set_oom(err);
		return;
	}

	args[0].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[0].reg = el_start_reg;
	args[1].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[1].reg = el_size_reg;
	args[2].type = SUBTILIS_IR_REG_TYPE_INTEGER;
	args[2].reg = el_destruct_reg;

	(void)subtilis_exp_add_call(p, name_copy, SUBTILIS_BUILTINS_MAX, NULL,
				    args, &subtilis_type_void, 3, false, err);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
leaq 0x69a8a(%rip), %rax     # 0xac240
movq %rax, -0x68(%rbp)
leaq 0x6910f(%rip), %rax     # 0xab8d0
movq %rax, -0x50(%rbp)
leaq 0x69104(%rip), %rax     # 0xab8d0
movq %rax, -0x48(%rbp)
leaq 0x690f9(%rip), %rax     # 0xab8d0
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rsi
leaq -0x50(%rbp), %rcx
movq -0x28(%rbp), %r9
movl $0x3, %edx
leaq 0x694b1(%rip), %r8      # 0xabca8
callq 0x42960
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x42822
movq -0x28(%rbp), %rax
cmpl $0x20, (%rax)
je 0x42817
jmp 0x42948
movq -0x28(%rbp), %rdi
callq 0x15670
jmp 0x42843
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x429b0
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x42841
jmp 0x42948
jmp 0x42843
movq -0x68(%rbp), %rdi
callq 0x120d0
movq %rax, %rdi
addq $0x1, %rdi
callq 0x121b0
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x42882
movq -0x28(%rbp), %rdi
movl $0x1, %esi
leaq 0x699df(%rip), %rdx     # 0xac252
movl $0x969, %ecx            # imm = 0x969
callq 0x158e0
jmp 0x42948
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x12060
movl $0x48, %edi
callq 0x121b0
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x428c9
movq -0x60(%rbp), %rdi
callq 0x12290
movq -0x28(%rbp), %rdi
movl $0x1, %esi
leaq 0x69995(%rip), %rdx     # 0xac252
movl $0x971, %ecx            # imm = 0x971
callq 0x158e0
jmp 0x42948
movq -0x58(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x58(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x18(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x58(%rbp), %rax
movl $0x0, 0x30(%rax)
movq -0x20(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %r8
movq -0x28(%rbp), %rax
movl $0x9, %edx
xorl %ecx, %ecx
leaq 0x6937d(%rip), %r9      # 0xabca8
xorl %r10d, %r10d
movq $0x3, (%rsp)
movl $0x0, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x36f50
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)