// File: /workspace/github_cpp_makefile_star2_O3/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, %r14
movq %rdi, %rbx
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 %r14, %rcx
callq 0x22f0
testl %eax, %eax
je 0xc3848
movq 0x40(%rsp), %r12
cmpq (%rbx), %r12
jne 0xc3848
testq %r12, %r12
je 0xc3857
movl $0x1, %ecx
leaq 0x8(%rsp), %r13
xorl %eax, %eax
movq %r12, 0x38(%rsp)
movl %ecx, 0xc(%rsp)
leaq (%rax,%rax,4), %rbp
shlq $0x3, %rbp
addq 0x10(%rbx), %rbp
movl $0x4, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %r14, %rcx
callq 0x22f0
testl %eax, %eax
je 0xc384e
movl (%rbp), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
cmpl %eax, 0x8(%rsp)
jne 0xc384e
movl $0x4, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %r14, %rcx
callq 0x22f0
testl %eax, %eax
je 0xc384e
movl (%rbp), %eax
shrl $0x1f, %eax
cmpl %eax, 0x8(%rsp)
jne 0xc384e
movl $0x4, %esi
movl $0x1, %edx
leaq 0x14(%rsp), %rdi
movq %r14, %rcx
callq 0x22f0
testl %eax, %eax
je 0xc384e
movl 0x14(%rsp), %eax
cmpl 0x4(%rbp), %eax
jne 0xc384e
movl $0x4, %esi
movl $0x1, %edx
leaq 0x18(%rsp), %rdi
movq %r14, %rcx
callq 0x22f0
testl %eax, %eax
je 0xc384e
movl 0x18(%rsp), %eax
cmpl 0x8(%rbp), %eax
jne 0xc384e
movl $0x4, %esi
movl $0x1, %edx
leaq 0x20(%rsp), %rdi
movq %r14, %rcx
callq 0x22f0
testl %eax, %eax
je 0xc384e
movq %r13, %r15
movl 0x20(%rsp), %r13d
cmpl 0x10(%rbp), %r13d
jne 0xc384e
movl %r13d, 0x8(%rsp)
movq 0x28(%rsp), %r12
cmpl %r13d, 0x1c(%rsp)
jae 0xc37fe
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)
movl $0x8, %esi
movq %r12, %rdi
movq %r13, %rdx
movq %r14, %rcx
callq 0x22f0
testl %eax, %eax
je 0xc384e
movq 0x18(%rbp), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x21a0
testl %eax, %eax
movl 0xc(%rsp), %ecx
jne 0xc384e
movl %ecx, %eax
incl %ecx
movq 0x38(%rsp), %r12
cmpq %rax, %r12
movq %r15, %r13
ja 0xc36b6
movl $0x1, %ebx
jmp 0xc3850
xorl %edi, %edi
xorl %ebx, %ebx
jmp 0xc385e
xorl %ebx, %ebx
movq 0x28(%rsp), %rdi
jmp 0xc385e
movl $0x1, %ebx
xorl %edi, %edi
callq 0x2220
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq