// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movq %rcx, %rbp
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r12
movq 0x88(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x124dd8(%rip), %rax    # 0x252fe0
movq (%rax), %rdi
leaq 0xc01a9(%rip), %rsi     # 0x1ee3bb
leaq 0xc1186(%rip), %rdx     # 0x1ef39f
xorl %eax, %eax
callq 0x22b0
movq %r12, %rdi
callq 0x2090
leaq 0x32(%rax), %rdi
pushq $0x1
popq %r15
movq %r15, %rsi
callq 0x2120
movq %rax, %rbx
leaq 0xc111c(%rip), %rsi     # 0x1ef35e
movq %rax, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2050
leaq 0xc3461(%rip), %rsi     # 0x1f16b7
movq %rbx, %rdi
callq 0x2210
movq %rax, %r12
pushq $0x30
popq %rsi
movq %r15, %rdi
callq 0x2120
movq %rax, (%r14)
movq %rax, %rdi
movq %r12, %rsi
callq 0x12dcd2
pushq $0x38
popq %rsi
movq %r15, %rdi
callq 0x2120
movq %rax, (%r13)
movq %rax, %rdi
movq %r12, %rsi
callq 0x12dec4
pushq $0x48
popq %rsi
movq %r15, %rdi
callq 0x2120
movq %rax, (%rbp)
movq %rax, %rdi
movq %r12, %rsi
callq 0x12dd61
pushq $0x8
popq %rsi
movq 0x8(%rsp), %rdi
movq %r15, %rdx
movq %r12, %rcx
callq 0x22f0
pushq $0x4
popq %r14
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x22f0
movq (%r13), %rax
movq 0x18(%rax), %rax
movl 0x14(%rax), %edi
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
andq %rbp, %rdi
movq %r15, %rsi
callq 0x2120
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
movq (%r13), %rcx
movq 0x18(%rcx), %rcx
movl 0x14(%rcx), %edx
andq %rbp, %rdx
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rcx
callq 0x22f0
movq 0x20(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x22f0
movl $0x110, %esi            # imm = 0x110
movq %r15, %rdi
callq 0x2120
movq 0x28(%rsp), %rcx
movq %rax, (%rcx)
movq %rax, %rdi
movq %r12, %rsi
callq 0x12e035
movq %r15, %rdi
pushq $0x30
popq %rsi
callq 0x2120
movq 0x30(%rsp), %rcx
movq %rax, (%rcx)
movq %rax, %rdi
movq %r12, %rsi
callq 0x12dcd2
leaq 0x125ec1(%rip), %rdi    # 0x254230
movq %r12, %rsi
callq 0x12dc35
movq %r12, %rdi
callq 0x2190
movq %rbx, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2220