// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x120d0
movq %rax, %rdi
addq $0x1, %rdi
callq 0x121b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x3e712
movq -0x18(%rbp), %rdi
movl $0x1, %esi
leaq 0x6d97d(%rip), %rdx     # 0xac080
movl $0x1ef, %ecx            # imm = 0x1EF
callq 0x158e0
jmp 0x3e99c
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x12060
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
imulq $0x148, 0x28(%rax), %rdi # imm = 0x148
callq 0x121b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x3e77d
movq -0x18(%rbp), %rdi
movl $0x1, %esi
leaq 0x6d912(%rip), %rdx     # 0xac080
movl $0x1f6, %ecx            # imm = 0x1F6
callq 0x158e0
jmp 0x3e993
movq -0x10(%rbp), %rax
imulq $0x18, 0x28(%rax), %rdi
callq 0x121b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x3e7c0
movq -0x18(%rbp), %rdi
movl $0x1, %esi
leaq 0x6d8cf(%rip), %rdx     # 0xac080
movl $0x1fb, %ecx            # imm = 0x1FB
callq 0x158e0
jmp 0x3e993
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x3e991
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
imulq $0x18, 0x20(%rcx), %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x120d0
movq %rax, %rdi
addq $0x1, %rdi
callq 0x121b0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdx
imulq $0x18, 0x20(%rdx), %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
imulq $0x18, 0x20(%rcx), %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
jne 0x3e855
movq -0x18(%rbp), %rdi
movl $0x1, %esi
leaq 0x6d83a(%rip), %rdx     # 0xac080
movl $0x202, %ecx            # imm = 0x202
callq 0x158e0
jmp 0x3e993
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
imulq $0x18, 0x20(%rcx), %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
imulq $0x18, 0x20(%rcx), %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x12060
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
imulq $0x18, 0x20(%rcx), %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdx
imulq $0x18, 0x20(%rdx), %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
imulq $0x18, 0x20(%rcx), %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdx
imulq $0x18, 0x20(%rdx), %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
imulq $0x18, 0x20(%rcx), %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdx
imulq $0x18, 0x20(%rdx), %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
imulq $0x148, 0x20(%rax), %rax # imm = 0x148
addq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x8(%rbp), %rax
imulq $0x148, 0x20(%rax), %rax # imm = 0x148
addq %rax, %rsi
movq -0x18(%rbp), %rdx
callq 0x3dec0
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x3e970
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
imulq $0x18, 0x20(%rcx), %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x12290
jmp 0x3e993
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x3e7c8
jmp 0x3e99c
movq -0x8(%rbp), %rdi
callq 0x3e460
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)