// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_faidx.c
// Function: file_compare
int file_compare(const char *file1, const char *file2) {
    FILE *f1 = NULL;
    FILE *f2 = NULL;
    unsigned int lno = 1;
    size_t got1, got2, i;
    char buf1[1024], buf2[1024];
    int ret = -1;

    f1 = fopen(file1, "rb");
    if (!f1) {
        perror(file1);
        goto out;
    }
    f2 = fopen(file2, "rb");
    if (!f2) {
        perror(file2);
        goto out;
    }

    do {
        got1 = fread(buf1, 1, sizeof(buf1), f1);
        got2 = fread(buf2, 1, sizeof(buf2), f2);

        for (i = 0; i < got1 && i < got2 && buf1[i] == buf2[i]; i++)
            lno += (buf1[i] == '\n');
        if (i < got1 || i < got2) {
            fprintf(stderr, "%s and %s differ at line %u\n",
                    file1, file2, lno);
            goto out;
        }
    } while (got1 > 0 && got2 > 0);

    if (ferror(f1)) {
        perror(file1);
        goto out;
    }
    if (ferror(f2)) {
        perror(file2);
        goto out;
    }

    if (got1 > 0 || got2 > 0) {
        fprintf(stderr, "EOF on %s at line %u\n",
                got1 ? file2 : file1, lno);
        goto out;
    }

    ret = 0;
 out:
    if (f1) fclose(f1);
    if (f2) fclose(f2);
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x818, %rsp            # imm = 0x818
movq %rsi, %r15
movq %rdi, %r12
leaq 0x8c1a2(%rip), %rsi     # 0x9204c
callq 0x45c0
movq %rax, %rbx
testq %rax, %rax
je 0x5ff0
leaq 0x8c18a(%rip), %rsi     # 0x9204c
movq %r15, %rdi
callq 0x45c0
testq %rax, %rax
je 0x5ff5
movq %rax, %r14
movq %r12, 0x8(%rsp)
movq %r15, (%rsp)
movl $0x1, %ebp
leaq 0x10(%rsp), %r12
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
leaq 0x410(%rsp), %rdi
movq %rbx, %rcx
callq 0x47a0
movq %rax, %r13
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
movq %r12, %rdi
movq %r14, %rcx
callq 0x47a0
movq %rax, %r15
testq %r13, %r13
setne %cl
testq %rax, %rax
setne %dl
movl %ecx, %eax
andb %dl, %al
cmpb $0x1, %al
jne 0x5f91
leaq -0x1(%r15), %rsi
leaq -0x1(%r13), %rax
cmpq %rax, %rsi
cmovbq %rsi, %rax
movb 0x410(%rsp), %sil
cmpb 0x10(%rsp), %sil
jne 0x5f91
negq %rax
movl $0x1, %ecx
movl %ebp, %edi
movq %rcx, %rdx
addq %rax, %rcx
xorl %ebp, %ebp
cmpb $0xa, %sil
sete %bpl
addl %edi, %ebp
cmpq $0x1, %rcx
je 0x5f85
movb 0x410(%rsp,%rdx), %sil
leaq 0x1(%rdx), %rcx
cmpb 0x10(%rsp,%rdx), %sil
je 0x5f58
cmpq %r13, %rdx
setb %cl
cmpq %r15, %rdx
setb %dl
testb %cl, %cl
jne 0x6008
testb %dl, %dl
jne 0x6008
testq %r13, %r13
je 0x5fa7
testq %r15, %r15
jne 0x5ee9
movq %rbx, %rdi
callq 0x4970
testl %eax, %eax
jne 0x602e
movq %r14, %rdi
callq 0x4970
testl %eax, %eax
jne 0x6035
xorl %r12d, %r12d
orq %r13, %r15
je 0x6044
movq 0xad00a(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
testq %r13, %r13
movq (%rsp), %rdx
cmoveq 0x8(%rsp), %rdx
leaq 0x8c087(%rip), %rsi     # 0x9206c
movl %ebp, %ecx
xorl %eax, %eax
callq 0x4710
jmp 0x603e
movq %r12, %rdi
jmp 0x5ff8
movq %r15, %rdi
callq 0x43e0
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %r14d, %r14d
jmp 0x6044
movq 0xacfc9(%rip), %rax     # 0xb2fd8
movq (%rax), %rdi
leaq 0x8c036(%rip), %rsi     # 0x9204f
movq 0x8(%rsp), %rdx
movq (%rsp), %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x4710
jmp 0x603e
movq 0x8(%rsp), %rdi
jmp 0x6039
movq (%rsp), %rdi
callq 0x43e0
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testq %rbx, %rbx
je 0x6051
movq %rbx, %rdi
callq 0x44c0
testq %r14, %r14
je 0x605e
movq %r14, %rdi
callq 0x44c0
movl %r12d, %eax
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq