// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
leaq 0x418a4(%rip), %rax     # 0x748f8
leaq 0x30(%rsp), %rcx
movq %rax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rax, 0x10(%rcx)
subq $0x8, %rsp
leaq 0x421c8(%rip), %rsi     # 0x75237
leaq 0x41c5a(%rip), %r8      # 0x74cd0
movl $0x3, %edx
xorl %r9d, %r9d
pushq %rbx
callq 0x34307
addq $0x10, %rsp
movl (%rbx), %ecx
testl %ecx, %ecx
je 0x330a4
cmpl $0x20, %ecx
jne 0x3329b
movq %rbx, %rdi
callq 0x14404
jmp 0x332a1
movq %r15, 0x28(%rsp)
movq 0x48(%r14), %rcx
movq %rcx, 0x20(%rsp)
movq %rax, 0x48(%r14)
movq %rax, %rdi
callq 0x2d00a
movq %rax, %rbp
movq 0x48(%r14), %rdi
callq 0x2d00a
movq %rax, 0x10(%rsp)
movq 0x48(%r14), %rdi
callq 0x2d00a
movq %rax, 0x8(%rsp)
movq 0x48(%r14), %rdi
callq 0x2d00a
movq %rax, 0x18(%rsp)
movq 0x48(%r14), %rdi
movl $0x4, %edx
movl $0x12, %esi
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x2c00f
cmpl $0x0, (%rbx)
jne 0x33288
movq %rax, %r15
movq 0x48(%r14), %rdi
movl $0x4, %edx
movl $0x8, %ecx
movl $0x12, %esi
movq %rbx, %r8
callq 0x2c00f
movq %rax, (%rsp)
cmpl $0x0, (%rbx)
jne 0x33288
movq 0x48(%r14), %rdi
movl $0x43, %esi
movq %r15, %rdx
movq %rbp, %rcx
movq 0x18(%rsp), %r8
movq %rbx, %r9
callq 0x2c0c2
cmpl $0x0, (%rbx)
jne 0x33288
movq 0x48(%r14), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x2d017
cmpl $0x0, (%rbx)
jne 0x33288
movq 0x48(%r14), %rdi
movl $0x7a, %esi
movq (%rsp), %rdx
movq %rbx, %rcx
callq 0x2c189
cmpl $0x0, (%rbx)
jne 0x33288
movq 0x48(%r14), %rdi
movl $0x1, %ecx
movl $0x2d, %esi
movq %rax, %rdx
movq %rbx, %r8
callq 0x2c00f
cmpl $0x0, (%rbx)
jne 0x33288
movq 0x48(%r14), %rdi
movl $0x43, %esi
movq %rax, %rdx
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %r8
movq %rbx, %r9
callq 0x2c0c2
cmpl $0x0, (%rbx)
jne 0x33288
movq 0x48(%r14), %rdi
movq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x2d017
cmpl $0x0, (%rbx)
jne 0x33288
movq 0x48(%r14), %rdi
movl $0x4, %edx
movl $0xc, %ecx
movl $0x12, %esi
movq %rbx, %r8
callq 0x2c00f
cmpl $0x0, (%rbx)
jne 0x33288
movl $0x5, %ecx
movl $0x6, %r8d
movq %r14, %rdi
movq (%rsp), %rsi
movq %rax, %rdx
movq %rbx, %r9
callq 0x4462a
cmpl $0x0, (%rbx)
jne 0x33288
movq 0x48(%r14), %rdi
movq 0x8(%rsp), %rsi
movq %rbx, %rdx
callq 0x2d017
cmpl $0x0, (%rbx)
jne 0x33288
movq %r14, %rdi
movq (%rsp), %rsi
movq %rbx, %rdx
callq 0x4d5af
cmpl $0x0, (%rbx)
jne 0x33288
movq 0x48(%r14), %rdi
movq 0x18(%rsp), %rsi
movq %rbx, %rdx
callq 0x2d017
cmpl $0x0, (%rbx)
jne 0x33288
movq 0x48(%r14), %rdi
movl $0x46, %esi
movq %rbx, %rdx
callq 0x2c1b7
movq 0x20(%rsp), %rax
movq %rax, 0x48(%r14)
cmpl $0x0, (%rbx)
movq 0x28(%rsp), %r15
je 0x332a1
addq $0x48, %rsp
jmp 0x33315
movl $0x12, %edi
callq 0x121d0
testq %rax, %rax
je 0x33320
movq %rax, %rbp
movups 0x41f7d(%rip), %xmm0    # 0x75237
movups %xmm0, (%rax)
movw $0x73, 0x10(%rax)
movl $0x48, %edi
callq 0x121d0
testq %rax, %rax
je 0x33336
xorl %r10d, %r10d
movl %r10d, (%rax)
movq %r13, 0x8(%rax)
movl %r10d, 0x18(%rax)
movq %r12, 0x20(%rax)
movl %r10d, 0x30(%rax)
movq %r15, 0x38(%rax)
subq $0x8, %rsp
leaq 0x419d9(%rip), %r9      # 0x74cd0
movq %r14, %rdi
movq %rbp, %rsi
movl $0x9, %edx
xorl %ecx, %ecx
movq %rax, %r8
pushq %rbx
pushq %r10
pushq $0x3
callq 0x2b507
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x41f22(%rip), %rdx     # 0x75249
movq %rbx, %rdi
movl $0x1, %esi
movl $0x969, %ecx            # imm = 0x969
jmp 0x33352
movq %rbp, %rdi
callq 0x122c0
leaq 0x41f04(%rip), %rdx     # 0x75249
movq %rbx, %rdi
movl $0x1, %esi
movl $0x971, %ecx            # imm = 0x971
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x145f4