// File: chhylp123[P]hifiasm/rcut.cpp
// Function: load_debug_phasing(char const*, kv_u_trans_t**, ma_ug_t**, asg_t**, double*, unsigned int*, signed char**, unsigned int*, bubble_type**, kv_u_trans_t**)
void load_debug_phasing(const char* fn, kv_u_trans_t **ta, ma_ug_t **ug, asg_t **read_g, double *f_rate, 
uint32_t *renew_s, int8_t **s, uint32_t *is_sys, bubble_type **bub, kv_u_trans_t **ref)
{
	fprintf(stderr, "\n[M::%s]\n", __func__);
    char *buf = (char*)calloc(strlen(fn) + 50, 1);
    sprintf(buf, "%s.hic.dbg.dump.bin", fn);
    FILE *fp = fopen(buf, "r");

	CALLOC((*ta), 1); load_kv_u_trans_t(*ta, fp);///ta
	CALLOC((*ug), 1); load_ma_ug_t(*ug, fp);///ug
	CALLOC((*read_g), 1); load_asg_t((*read_g), fp);///read_g

	fread(f_rate, sizeof((*f_rate)), 1, fp);///f_rate
	fread(renew_s, sizeof((*renew_s)), 1, fp);///renew_s
	CALLOC((*s), (*ug)->g->n_seq); fread(*s, sizeof((*(*s))), (*ug)->g->n_seq, fp);///s
	fread(is_sys, sizeof((*is_sys)), 1, fp);///is_sys

	CALLOC((*bub), 1); load_bubble_type(*bub, fp);///bub
	CALLOC((*ref), 1); load_kv_u_trans_t(*ref, fp);///ta

	load_rid(&R_INF, fp);///read id

	fclose(fp);
    free(buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq 0x198449(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x16158b(%rip), %rsi    # 0x38d12c
leaq 0x162557(%rip), %rdx    # 0x38e0ff
movb $0x0, %al
callq 0x22a0
movq -0x8(%rbp), %rdi
callq 0x20a0
movq %rax, %rdi
addq $0x32, %rdi
movl $0x1, %esi
callq 0x2140
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x8(%rbp), %rdx
leaq 0x1624e2(%rip), %rsi    # 0x38e0be
movb $0x0, %al
callq 0x2050
movq -0x38(%rbp), %rdi
leaq 0x1647e8(%rip), %rsi    # 0x3903d6
callq 0x2200
movq %rax, -0x40(%rbp)
movl $0x1, %edi
movl $0x30, %esi
callq 0x2140
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x22b470
movl $0x1, %edi
movl $0x38, %esi
callq 0x2140
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x22b740
movl $0x1, %edi
movl $0x48, %esi
callq 0x2140
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x22b550
movq -0x28(%rbp), %rdi
movq -0x40(%rbp), %rcx
movl $0x8, %esi
movl $0x1, %edx
callq 0x22e0
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x22e0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x2140
movq %rax, %rcx
movq 0x10(%rbp), %rax
movq %rcx, (%rax)
movq 0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl %eax, %edx
movq -0x40(%rbp), %rcx
movl $0x1, %esi
callq 0x22e0
movq 0x18(%rbp), %rdi
movq -0x40(%rbp), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x22e0
movl $0x1, %edi
movl $0x110, %esi            # imm = 0x110
callq 0x2140
movq %rax, %rcx
movq 0x20(%rbp), %rax
movq %rcx, (%rax)
movq 0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x22b910
movl $0x1, %edi
movl $0x30, %esi
callq 0x2140
movq %rax, %rcx
movq 0x28(%rbp), %rax
movq %rcx, (%rax)
movq 0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x22b470
movq -0x40(%rbp), %rsi
leaq 0x199565(%rip), %rdi    # 0x3c52d0
callq 0x22b390
movq -0x40(%rbp), %rdi
callq 0x21a0
movq -0x38(%rbp), %rdi
callq 0x2210
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)