// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/Overlaps.cpp
// Function: test_dbug(ma_ug_t*, _IO_FILE*)
uint32_t test_dbug(ma_ug_t* ug, FILE* fp)
{
    uint32_t f_flag = 0, t, i, r_flag = 0;
    size_t tt;
    ma_utg_t ua, *ub = NULL; memset(&ua, 0, sizeof(ua));
    f_flag = fread(&tt, sizeof(tt), 1, fp);
    if(f_flag == 0 || tt != ug->u.n) goto DES;
    
    for (i = 0; i < tt; i++)
    {
        ub = &(ug->u.a[i]);
        f_flag = fread(&t, sizeof(t), 1, fp);
        if(f_flag == 0 || t != ub->len) goto DES;
        f_flag = fread(&t, sizeof(t), 1, fp);
        if(f_flag == 0 || t != ub->circ) goto DES;
        f_flag = fread(&(ua.start), sizeof(ua.start), 1, fp);
        if(f_flag == 0 || ua.start != ub->start) goto DES;
        f_flag = fread(&(ua.end), sizeof(ua.end), 1, fp);
        if(f_flag == 0 || ua.end != ub->end) goto DES;
        f_flag = fread(&(ua.n), sizeof(ua.n), 1, fp);
        if(f_flag == 0 || ua.n != ub->n) goto DES;
        t = ua.n;
        ua.n = 0;
        kv_resize(uint64_t, ua, t);
        ua.n = t;
        f_flag = fread(ua.a, sizeof(uint64_t), ua.n, fp);
        if(f_flag == 0 || memcmp(ua.a, ub->a, ua.n)) goto DES;
    }
    r_flag = 1;

    DES:
    free(ua.a);
    return r_flag;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x30(%rsp)
leaq 0x40(%rsp), %rdi
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x22f0
testl %eax, %eax
je 0x873cc
movq 0x40(%rsp), %r13
cmpq (%r12), %r13
jne 0x873cc
xorl %r15d, %r15d
leaq 0x8(%rsp), %rbp
movq %r12, 0x38(%rsp)
movl %r15d, %r15d
cmpq %r15, %r13
jbe 0x873d2
imulq $0x28, %r15, %r14
addq 0x10(%r12), %r14
movq %rbp, %rdi
pushq $0x4
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x22f0
movl $0x0, 0xc(%rsp)
testl %eax, %eax
je 0x873d9
movl (%r14), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
cmpl %eax, 0x8(%rsp)
jne 0x873d9
movq %rbp, %rdi
pushq $0x4
popq %rbp
movq %rbp, %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x22f0
testl %eax, %eax
je 0x873d9
movl (%r14), %eax
shrl $0x1f, %eax
cmpl %eax, 0x8(%rsp)
jne 0x873d9
leaq 0x14(%rsp), %rdi
movq %rbp, %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x22f0
testl %eax, %eax
je 0x873d9
movl 0x14(%rsp), %eax
cmpl 0x4(%r14), %eax
jne 0x873d9
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x22f0
testl %eax, %eax
je 0x873d9
movl 0x18(%rsp), %eax
cmpl 0x8(%r14), %eax
jne 0x873d9
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x22f0
testl %eax, %eax
je 0x873d9
movq %r13, %rbp
movl 0x20(%rsp), %r13d
cmpl 0x10(%r14), %r13d
jne 0x873d9
movl %r13d, 0x8(%rsp)
movq 0x28(%rsp), %r12
cmpl %r13d, 0x1c(%rsp)
jae 0x8738e
leal -0x1(%r13), %eax
movl %eax, %ecx
shrl %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x8, %eax
orl %ecx, %eax
movl %eax, %esi
shrl $0x10, %esi
orl %eax, %esi
incl %esi
movl %esi, 0x1c(%rsp)
shlq $0x3, %rsi
movq %r12, %rdi
callq 0x2370
movq %rax, %r12
movq %rax, 0x28(%rsp)
movq %r12, %rdi
pushq $0x8
popq %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x22f0
testl %eax, %eax
je 0x873d9
movq 0x18(%r14), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x21a0
incl %r15d
testl %eax, %eax
movq 0x38(%rsp), %r12
movq %rbp, %r13
leaq 0x8(%rsp), %rbp
je 0x87248
jmp 0x873d9
xorl %edi, %edi
xorl %ebx, %ebx
jmp 0x873e2
pushq $0x1
popq %rax
movl %eax, 0xc(%rsp)
movq 0x28(%rsp), %rdi
movl 0xc(%rsp), %ebx
callq 0x2220
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq