// File: /workspace/github_c_makefile_star2_O2/markdryan[P]subtilis/common/type.c
// Function: prv_init_copy_rec
static void prv_init_copy_rec(subtilis_type_rec_t *dst,
			      const subtilis_type_rec_t *src,
			      subtilis_error_t *err)
{
	size_t i;

	dst->alignment = src->alignment;
	dst->num_fields = 0;
	dst->fields = NULL;
	dst->field_types = NULL;

	dst->name = malloc(strlen(src->name) + 1);
	if (!dst->name) {
		subtilis_error_set_oom(err);
		return;
	}
	strcpy(dst->name, src->name);
	dst->max_fields = src->max_fields;
	dst->field_types = malloc(src->max_fields * sizeof(*dst->field_types));
	if (!dst->field_types) {
		subtilis_error_set_oom(err);
		goto cleanup;
	}
	dst->fields = malloc(src->max_fields * sizeof(*dst->fields));
	if (!dst->fields) {
		subtilis_error_set_oom(err);
		goto cleanup;
	}
	for (i = 0; i < src->num_fields; i++) {
		dst->fields[dst->num_fields].name =
		    malloc(strlen(src->fields[dst->num_fields].name) + 1);
		if (!dst->fields[dst->num_fields].name) {
			subtilis_error_set_oom(err);
			goto cleanup;
		}
		strcpy(dst->fields[dst->num_fields].name,
		       src->fields[dst->num_fields].name);
		dst->fields[dst->num_fields].size =
		    src->fields[dst->num_fields].size;
		dst->fields[dst->num_fields].alignment =
		    src->fields[dst->num_fields].alignment;
		dst->fields[dst->num_fields].vec_dim =
		    src->fields[dst->num_fields].vec_dim;
		subtilis_type_init_copy(&dst->field_types[dst->num_fields],
					&src->field_types[dst->num_fields],
					err);
		if (err->type != SUBTILIS_ERROR_OK) {
			free(dst->fields[dst->num_fields].name);
			goto cleanup;
		}
		dst->num_fields++;
	}

	return;

cleanup:
	prv_rec_type_free(dst);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %eax
movl %eax, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
andq $0x0, 0x20(%rdi)
movq 0x8(%rsi), %rdi
callq 0x120f0
leaq 0x1(%rax), %rdi
callq 0x121d0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x2e0df
movq 0x8(%r14), %rsi
movq %rax, %rdi
callq 0x12070
movq %r14, %rax
movq %rbx, %r14
movq %rax, %r13
movq 0x28(%rax), %rbx
movq %rbx, 0x28(%r14)
imulq $0x148, %rbx, %rdi      # imm = 0x148
callq 0x121d0
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0x2e104
imulq $0x18, %rbx, %rdi
callq 0x121d0
movq %rax, 0x18(%r14)
testq %rax, %rax
movq %r14, %rbx
je 0x2e120
leaq 0x10(%rbx), %rax
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
xorl %eax, %eax
movq %r12, (%rsp)
cmpq 0x20(%r13), %rax
jae 0x2e139
movq %rax, 0x10(%rsp)
movq 0x18(%r13), %r12
imulq $0x18, %rbp, %r14
movq (%r12,%r14), %rdi
callq 0x120f0
leaq 0x1(%rax), %rdi
callq 0x121d0
movq %rbx, %r15
movq 0x18(%rbx), %rbx
movq %rax, (%rbx,%r14)
testq %rax, %rax
je 0x2e148
leaq (%r12,%r14), %rcx
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x12070
movq 0x8(%r12,%r14), %rax
movq %rax, 0x8(%rbx,%r14)
movl 0x10(%r12,%r14), %eax
movl %eax, 0x10(%rbx,%r14)
imulq $0x148, %rbp, %rsi      # imm = 0x148
movq 0x8(%rsp), %rax
movq (%rax), %rdi
addq %rsi, %rdi
addq 0x10(%r13), %rsi
movq (%rsp), %r12
movq %r12, %rdx
callq 0x2db73
cmpl $0x0, (%r12)
jne 0x2e165
movq %r15, %rbx
movq 0x20(%r15), %rbp
incq %rbp
movq %rbp, 0x20(%r15)
movq 0x10(%rsp), %rax
incq %rax
jmp 0x2e037
leaq 0x40f92(%rip), %rdx     # 0x6f078
pushq $0x1
popq %rsi
movq %r12, %rdi
movl $0x1ef, %ecx            # imm = 0x1EF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1429e
leaq 0x40f6d(%rip), %rdx     # 0x6f078
pushq $0x1
popq %rsi
movq %r12, %rdi
movl $0x1f6, %ecx            # imm = 0x1F6
callq 0x1429e
movq %r14, %rbx
jmp 0x2e17a
leaq 0x40f51(%rip), %rdx     # 0x6f078
pushq $0x1
popq %rsi
movq %r12, %rdi
movl $0x1fb, %ecx            # imm = 0x1FB
callq 0x1429e
jmp 0x2e17a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x40f29(%rip), %rdx     # 0x6f078
pushq $0x1
popq %rsi
movq (%rsp), %rdi
movl $0x202, %ecx            # imm = 0x202
callq 0x1429e
movq %r15, %rbx
jmp 0x2e17a
movq %r15, %rbx
movq 0x18(%r15), %rax
imulq $0x18, 0x20(%r15), %rcx
movq (%rax,%rcx), %rdi
callq 0x122c0
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2de25