// File: chhylp123[P]hifiasm/Process_Read.cpp
// Function: malloc_All_reads(All_reads*)
void malloc_All_reads(All_reads* r)
{
	r->read_size = (uint64_t*)malloc(sizeof(uint64_t)*r->total_reads);
	memcpy(r->read_size, r->read_length, sizeof(uint64_t)*r->total_reads);

	r->read_sperate = (uint8_t**)malloc(sizeof(uint8_t*)*r->total_reads);
	if(asm_opt.is_sc) MALLOC(r->rsc, r->total_reads);

	long long i = 0;
	for (i = 0; i < (long long)r->total_reads; i++)
	{
		r->read_sperate[i] = (uint8_t*)malloc(sizeof(uint8_t)*(r->read_length[i]/4+1));
		if(r->rsc) MALLOC(r->rsc[i], (r->read_length[i]/sc_bn) + ((r->read_length[i]%sc_bn)?1:0));
	}

	r->cigars = (Compressed_Cigar_record*)malloc(sizeof(Compressed_Cigar_record)*r->total_reads);
	r->second_round_cigar = (Compressed_Cigar_record*)malloc(sizeof(Compressed_Cigar_record)*r->total_reads);
	r->paf = (ma_hit_t_alloc*)malloc(sizeof(ma_hit_t_alloc)*r->total_reads);
	r->reverse_paf = (ma_hit_t_alloc*)malloc(sizeof(ma_hit_t_alloc)*r->total_reads);
	///r->pb_regions = (kvec_t_u64_warp*)malloc(r->total_reads*sizeof(kvec_t_u64_warp));

	for (i = 0; i < (long long)r->total_reads; i++)
	{
		r->second_round_cigar[i].size = r->cigars[i].size = 0;
		r->second_round_cigar[i].length = r->cigars[i].length = 0;
		r->second_round_cigar[i].record = r->cigars[i].record = NULL;

		r->second_round_cigar[i].lost_base_size = r->cigars[i].lost_base_size = 0;
		r->second_round_cigar[i].lost_base_length = r->cigars[i].lost_base_length = 0;
		r->second_round_cigar[i].lost_base = r->cigars[i].lost_base = NULL;
		init_ma_hit_t_alloc(&(r->paf[i]));
		init_ma_hit_t_alloc(&(r->reverse_paf[i]));
		///kv_init(r->pb_regions[i].a);
	}

	r->name = (char*)malloc(sizeof(char)*r->total_name_length);
	r->N_site = (uint64_t**)calloc(r->total_reads, sizeof(uint64_t*));
	r->trio_flag = (uint8_t*)malloc(r->total_reads*sizeof(uint8_t));
	memset(r->trio_flag, AMBIGU, r->total_reads*sizeof(uint8_t));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
shlq $0x3, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdx
shlq $0x3, %rdx
callq 0x2180
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
shlq $0x3, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
leaq 0x3bb4cc(%rip), %rax    # 0x3c47f8
cmpq $0x0, 0x2b0(%rax)
je 0x9352
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
shlq $0x3, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jge 0x941c
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
shrq $0x2, %rdi
addq $0x1, %rdi
shlq $0x0, %rdi
callq 0x2270
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x9409
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
shrq %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
andq $0x1, %rdx
xorl %eax, %eax
movl $0x1, %ecx
cmpq $0x0, %rdx
cmovnel %ecx, %eax
cltq
addq %rax, %rdi
shlq $0x0, %rdi
callq 0x2270
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x940b
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x9362
movq -0x8(%rbp), %rax
imulq $0x28, 0x50(%rax), %rdi
callq 0x2270
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rax
imulq $0x28, 0x50(%rax), %rdi
callq 0x2270
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x8(%rbp), %rax
imulq $0x18, 0x50(%rax), %rdi
callq 0x2270
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x8(%rbp), %rax
imulq $0x18, 0x50(%rax), %rdi
callq 0x2270
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x80(%rax)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jge 0x95f1
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl $0x0, 0xc(%rax)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl $0x0, 0xc(%rax)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl $0x0, 0x1c(%rax)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl $0x0, 0x1c(%rax)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rdi
imulq $0x18, -0x10(%rbp), %rax
addq %rax, %rdi
callq 0xce060
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rdi
imulq $0x18, -0x10(%rbp), %rax
addq %rax, %rdi
callq 0xce060
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x948b
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rdi
shlq $0x0, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
movl $0x8, %esi
callq 0x2140
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
shlq $0x0, %rdi
callq 0x2270
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdx
shlq $0x0, %rdx
xorl %esi, %esi
callq 0x2100
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)