// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0x40(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x22f0
xorl %r13d, %r13d
testl %eax, %eax
je 0xc2920
movq 0x40(%rsp), %r12
cmpq (%r14), %r12
jne 0xc2920
testq %r12, %r12
je 0xc291a
movl $0x1, %ebp
xorl %eax, %eax
movq %r12, 0x38(%rsp)
leaq (%rax,%rax,4), %r15
shlq $0x3, %r15
addq 0x10(%r14), %r15
movl $0x4, %esi
movl $0x1, %edx
leaq 0xc(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rcx
callq 0x22f0
testl %eax, %eax
je 0xc2915
movl (%r15), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
cmpl %eax, 0xc(%rsp)
jne 0xc2915
movl $0x4, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x22f0
testl %eax, %eax
je 0xc2915
movl (%r15), %eax
shrl $0x1f, %eax
cmpl %eax, 0xc(%rsp)
jne 0xc2915
movl $0x4, %esi
movl $0x1, %edx
leaq 0x14(%rsp), %rdi
movq %rbx, %rcx
callq 0x22f0
testl %eax, %eax
je 0xc2915
movl 0x14(%rsp), %eax
cmpl 0x4(%r15), %eax
jne 0xc2915
movl $0x4, %esi
movl $0x1, %edx
leaq 0x18(%rsp), %rdi
movq %rbx, %rcx
callq 0x22f0
testl %eax, %eax
je 0xc2915
movl 0x18(%rsp), %eax
cmpl 0x8(%r15), %eax
jne 0xc2915
movl $0x4, %esi
movl $0x1, %edx
leaq 0x20(%rsp), %rdi
movq %rbx, %rcx
callq 0x22f0
testl %eax, %eax
je 0xc2915
movl 0x20(%rsp), %r13d
cmpl 0x10(%r15), %r13d
jne 0xc2915
movl %r13d, 0xc(%rsp)
movl $0x0, 0x20(%rsp)
cmpl %r13d, 0x1c(%rsp)
jae 0xc28c7
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)
movq 0x28(%rsp), %rdi
shlq $0x3, %rsi
callq 0x2370
movq %rax, 0x28(%rsp)
movl %r13d, 0x20(%rsp)
movq 0x28(%rsp), %r12
movl $0x8, %esi
movq %r12, %rdi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x22f0
testl %eax, %eax
je 0xc2915
movq 0x18(%r15), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x21a0
testl %eax, %eax
jne 0xc2915
movl %ebp, %eax
incl %ebp
movl $0x1, %r13d
movq 0x38(%rsp), %r12
cmpq %rax, %r12
ja 0xc277d
jmp 0xc2920
xorl %r13d, %r13d
jmp 0xc2920
movl $0x1, %r13d
movq 0x28(%rsp), %rdi
callq 0x2220
movl %r13d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq