// File: chhylp123[P]hifiasm/Assembly.cpp
// Function: debug_affine_gap_alignment(overlap_region_alloc*, UC_Read*, UC_Read*)
void debug_affine_gap_alignment(overlap_region_alloc *overlap_list, UC_Read* g_read, UC_Read* overlap_read)
{
    uint64_t i;
    kvec_t(uint8_t) x_num;
    kvec_t(uint8_t) y_num;
    kv_init(x_num);
    kv_init(y_num);
    for (i = 0; i < overlap_list->length; i++)
    {
        if (overlap_list->list[i].is_match == 1 && overlap_list->list[i].shared_seed == 1)
        {

            kv_resize(uint8_t, x_num, (uint64_t)(Get_READ_LENGTH(R_INF, overlap_list->list[i].x_id)));
            kv_resize(uint8_t, y_num, (uint64_t)(Get_READ_LENGTH(R_INF, overlap_list->list[i].y_id)));

            get_affine_gap_score(&(overlap_list->list[i]), g_read, overlap_read, x_num.a, y_num.a,
            overlap_list->list[i].x_pos_e + 1 - overlap_list->list[i].x_pos_s, 
            overlap_list->list[i].y_pos_e + 1 - overlap_list->list[i].y_pos_s);
        }
    }

    kv_destroy(x_num);
    kv_destroy(y_num);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x198b4
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x20(%rbp), %rcx
addq %rcx, %rax
movzbl 0x2c(%rax), %eax
cmpl $0x1, %eax
jne 0x198a1
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x20(%rbp), %rcx
addq %rcx, %rax
cmpl $0x1, 0x24(%rax)
jne 0x198a1
jmp 0x1967b
movq -0x30(%rbp), %rax
movq 0x3abc62(%rip), %rcx    # 0x3c52e8
movq -0x8(%rbp), %rdx
movq (%rdx), %rdx
imulq $0xa8, -0x20(%rbp), %rsi
addq %rsi, %rdx
movl (%rdx), %edx
cmpq (%rcx,%rdx,8), %rax
jae 0x19743
movq 0x3abc3d(%rip), %rax    # 0x3c52e8
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x20(%rbp), %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
shrq %rax
orq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
shrq $0x2, %rax
orq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
shrq $0x4, %rax
orq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
shrq $0x8, %rax
orq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
shrq $0x10, %rax
orq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, -0x28(%rbp)
jmp 0x19745
jmp 0x19747
movq -0x48(%rbp), %rax
movq 0x3abb96(%rip), %rcx    # 0x3c52e8
movq -0x8(%rbp), %rdx
movq (%rdx), %rdx
imulq $0xa8, -0x20(%rbp), %rsi
addq %rsi, %rdx
movl 0x10(%rdx), %edx
cmpq (%rcx,%rdx,8), %rax
jae 0x19811
movq 0x3abb70(%rip), %rax    # 0x3c52e8
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
imulq $0xa8, -0x20(%rbp), %rdx
addq %rdx, %rcx
movl 0x10(%rcx), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq $0x2, %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq $0x4, %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq $0x8, %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
shrq $0x10, %rax
orq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
shlq $0x0, %rsi
callq 0x2360
movq %rax, -0x40(%rbp)
jmp 0x19813
movq -0x8(%rbp), %rax
movq (%rax), %rdi
imulq $0xa8, -0x20(%rbp), %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x20(%rbp), %r9
addq %r9, %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movq -0x8(%rbp), %r9
movq (%r9), %r9
imulq $0xa8, -0x20(%rbp), %r10
addq %r10, %r9
subl 0x4(%r9), %eax
movl %eax, %eax
movl %eax, %r9d
movq -0x8(%rbp), %rax
movq (%rax), %rax
imulq $0xa8, -0x20(%rbp), %r10
addq %r10, %rax
movl 0x18(%rax), %eax
addl $0x1, %eax
movq -0x8(%rbp), %r10
movq (%r10), %r10
imulq $0xa8, -0x20(%rbp), %r11
addq %r11, %r10
subl 0x14(%r10), %eax
movl %eax, %eax
movq %rax, (%rsp)
callq 0x4cfc0
jmp 0x198a3
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x1962c
movq -0x28(%rbp), %rdi
callq 0x2210
movq -0x40(%rbp), %rdi
callq 0x2210
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)