// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x50(%rdi), %r14
leaq (,%r14,8), %r15
movq %r15, %rdi
callq 0x2280
movq %rax, 0x20(%rbx)
movq 0x18(%rbx), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x2160
movq %r15, %rdi
callq 0x2280
movq %rax, 0x10(%rbx)
leaq 0x24cdbc(%rip), %rax    # 0x253758
cmpq $0x0, 0x2b0(%rax)
je 0x69b2
movq %r15, %rdi
callq 0x2280
movq %rax, 0x30(%rbx)
xorl %r15d, %r15d
testq %r14, %r14
movl $0x0, %r12d
cmovgq %r14, %r12
cmpq %r15, %r12
je 0x6a0f
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rdi
shrq $0x2, %rdi
incq %rdi
callq 0x2280
movq 0x10(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x30(%rbx), %r13
testq %r13, %r13
je 0x6a0a
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rdi
movq %rdi, %rax
shrq %rax
andl $0x1, %edi
addq %rax, %rdi
callq 0x2280
movq %rax, (%r13,%r15,8)
incq %r15
jmp 0x69c2
imulq $0x28, %r14, %r15
movq %r15, %rdi
callq 0x2280
movq %rax, 0x68(%rbx)
movq %r15, %rdi
callq 0x2280
movq %rax, 0x70(%rbx)
imulq $0x18, %r14, %r15
movq %r15, %rdi
callq 0x2280
movq %rax, 0x78(%rbx)
movq %r15, %rdi
callq 0x2280
movq %rax, 0x80(%rbx)
pushq $0x1c
popq %r15
xorl %r12d, %r12d
xorl %r13d, %r13d
cmpq %r14, %r13
jge 0x6ad3
movq 0x68(%rbx), %rax
andl $0x0, -0x10(%rax,%r15)
movq 0x70(%rbx), %rcx
andl $0x0, -0x10(%rcx,%r15)
andl $0x0, -0x14(%rax,%r15)
andl $0x0, -0x14(%rcx,%r15)
andq $0x0, -0x1c(%rax,%r15)
andq $0x0, -0x1c(%rcx,%r15)
andl $0x0, (%rax,%r15)
andl $0x0, (%rcx,%r15)
andl $0x0, -0x4(%rax,%r15)
andl $0x0, -0x4(%rcx,%r15)
andq $0x0, -0xc(%rax,%r15)
andq $0x0, -0xc(%rcx,%r15)
movq 0x78(%rbx), %rdi
addq %r12, %rdi
callq 0x6964f
movq 0x80(%rbx), %rdi
addq %r12, %rdi
callq 0x6964f
incq %r13
movq 0x50(%rbx), %r14
addq $0x28, %r15
addq $0x18, %r12
jmp 0x6a54
movq 0x60(%rbx), %rdi
callq 0x2280
movq %rax, 0x8(%rbx)
pushq $0x8
popq %rsi
movq %r14, %rdi
callq 0x2120
movq %rax, (%rbx)
pushq $0x1
popq %rdi
movq %r14, %rsi
callq 0x2120
movq %rax, 0x28(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq