// File: /workspace/github_c_makefile_star2_O2/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 $0x68, %rsp
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
leaq 0x3d700(%rip), %rax     # 0x6e8c8
leaq 0x50(%rsp), %rcx
movq %rax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rax, 0x10(%rcx)
leaq 0x3e028(%rip), %rsi     # 0x6f207
leaq 0x3daba(%rip), %r8      # 0x6eca0
pushq $0x3
popq %rdx
movq %rbx, %r9
callq 0x314be
movl (%rbx), %ecx
testl %ecx, %ecx
je 0x31289
cmpl $0x20, %ecx
jne 0x31447
movq %rbx, %rdi
callq 0x140a4
pushq $0x12
popq %rdi
callq 0x121d0
testq %rax, %rax
je 0x31456
movq %rax, %rbp
movups 0x3dfe0(%rip), %xmm0    # 0x6f207
movups %xmm0, (%rax)
movw $0x73, 0x10(%rax)
pushq $0x48
popq %rdi
callq 0x121d0
testq %rax, %rax
je 0x3146a
andl $0x0, (%rax)
movq %r13, 0x8(%rax)
andl $0x0, 0x18(%rax)
movq %r12, 0x20(%rax)
andl $0x0, 0x30(%rax)
movq %r15, 0x38(%rax)
movq %rbx, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
movq $0x3, (%rsp)
leaq 0x3da2f(%rip), %r9      # 0x6eca0
pushq $0x9
popq %rdx
movq %r14, %rdi
movq %rbp, %rsi
xorl %ecx, %ecx
movq %rax, %r8
callq 0x29dcc
jmp 0x31447
movq %r15, 0x48(%rsp)
movq 0x48(%r14), %rcx
movq %rcx, 0x40(%rsp)
movq %rax, 0x48(%r14)
movq %rax, %rdi
callq 0x2b774
movq %rax, %rbp
movq 0x48(%r14), %rdi
callq 0x2b774
movq %rax, 0x30(%rsp)
movq 0x48(%r14), %rdi
callq 0x2b774
movq %rax, 0x28(%rsp)
movq 0x48(%r14), %rdi
callq 0x2b774
movq %rax, 0x38(%rsp)
movq 0x48(%r14), %rdi
pushq $0x12
popq %rsi
pushq $0x4
popq %rdx
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x2a819
cmpl $0x0, (%rbx)
jne 0x3143e
movq %rax, %r15
movq 0x48(%r14), %rdi
pushq $0x12
popq %rsi
pushq $0x4
popq %rdx
pushq $0x8
popq %rcx
movq %rbx, %r8
callq 0x2a819
movq %rax, 0x20(%rsp)
cmpl $0x0, (%rbx)
jne 0x3143e
movq 0x48(%r14), %rdi
pushq $0x43
popq %rsi
movq %r15, %rdx
movq %rbp, %rcx
movq 0x38(%rsp), %r8
movq %rbx, %r9
callq 0x2a8c1
cmpl $0x0, (%rbx)
jne 0x3143e
movq 0x48(%r14), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x2b781
cmpl $0x0, (%rbx)
jne 0x3143e
movq 0x48(%r14), %rdi
pushq $0x7a
popq %rsi
movq 0x20(%rsp), %rdx
movq %rbx, %rcx
callq 0x2a981
cmpl $0x0, (%rbx)
jne 0x3143e
movq 0x48(%r14), %rdi
pushq $0x2d
popq %rsi
pushq $0x1
popq %rcx
movq %rax, %rdx
movq %rbx, %r8
callq 0x2a819
cmpl $0x0, (%rbx)
jne 0x3143e
movq 0x48(%r14), %rdi
pushq $0x43
popq %rsi
movq %rax, %rdx
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %r8
movq %rbx, %r9
callq 0x2a8c1
cmpl $0x0, (%rbx)
jne 0x3143e
movq 0x48(%r14), %rdi
movq 0x30(%rsp), %rsi
movq %rbx, %rdx
callq 0x2b781
cmpl $0x0, (%rbx)
jne 0x3143e
movq 0x48(%r14), %rdi
pushq $0x12
popq %rsi
pushq $0x4
popq %rdx
pushq $0xc
popq %rcx
movq %rbx, %r8
callq 0x2a819
cmpl $0x0, (%rbx)
jne 0x3143e
pushq $0x5
popq %rcx
pushq $0x6
popq %r8
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movq %rax, %rdx
movq %rbx, %r9
callq 0x41e2e
cmpl $0x0, (%rbx)
jne 0x3143e
movq 0x48(%r14), %rdi
movq 0x28(%rsp), %rsi
movq %rbx, %rdx
callq 0x2b781
cmpl $0x0, (%rbx)
jne 0x3143e
movq %r14, %rdi
movq 0x20(%rsp), %rsi
movq %rbx, %rdx
callq 0x4a982
cmpl $0x0, (%rbx)
jne 0x3143e
movq 0x48(%r14), %rdi
movq 0x38(%rsp), %rsi
movq %rbx, %rdx
callq 0x2b781
cmpl $0x0, (%rbx)
je 0x31497
movq 0x40(%rsp), %rax
movq %rax, 0x48(%r14)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3ddbc(%rip), %rdx     # 0x6f219
pushq $0x1
popq %rsi
movq %rbx, %rdi
movl $0x969, %ecx            # imm = 0x969
jmp 0x31484
movq %rbp, %rdi
callq 0x122c0
leaq 0x3dda0(%rip), %rdx     # 0x6f219
pushq $0x1
popq %rsi
movq %rbx, %rdi
movl $0x971, %ecx            # imm = 0x971
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1429e
movq 0x48(%r14), %rdi
pushq $0x46
popq %rsi
movq %rbx, %rdx
callq 0x2a9af
cmpl $0x0, (%rbx)
movq 0x40(%rsp), %rax
movq %rax, 0x48(%r14)
movq 0x48(%rsp), %r15
jne 0x31447
jmp 0x3120c