// File: /workspace/github_c_makefile_star2_O2/00pauln00[P]yapio/yapio.c
// Function: yapio_open_fpp_file
static int
yapio_open_fpp_file(int rank, int oflags)
{
    if (rank >= yapioNumRanks)
        return -EINVAL;

    char file_per_process_name[PATH_MAX + 1];

    int rc = yapio_make_filename(file_per_process_name, rank);
    if (rc)
        return rc;

    if (yapioFileDescFpp[rank] < 0)
    {
        yapioFileDescFpp[rank] =
            YAPIO_SYS_CALL(open)(file_per_process_name, oflags, 0644);

        if (yapioFileDescFpp[rank] < 0)
        {
            rc = -errno;
            log_msg(YAPIO_LL_ERROR, "open `%s': %s",
                    file_per_process_name, strerror(errno));
        }
        else
        {
            log_msg(YAPIO_LL_DEBUG, "%s", file_per_process_name);

            if (yapioModeCurrent == YAPIO_IO_MODE_MMAP)
            {
                size_t len = (yapioMyTestGroup->ytg_num_blks_per_rank *
                              yapioMyTestGroup->ytg_blk_sz);

                if (ftruncate(yapioFileDescFpp[rank], len))
                {
                    log_msg(YAPIO_LL_FATAL, "ftruncate(): %s",
                            strerror(errno));
                }
            }
        }
    }

    return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1018, %rsp           # imm = 0x1018
cmpl %edi, 0x205f78(%rip)    # 0x20c270
jle 0x63f9
movl %esi, %ebp
movl %edi, %r14d
leaq 0x10(%rsp), %rdi
movl %r14d, %esi
callq 0x64a4
movl %eax, %ebx
testl %eax, %eax
jne 0x63fc
movq 0xe107cf(%rip), %rax    # 0xe16af0
movslq %r14d, %r15
xorl %ebx, %ebx
cmpl $0x0, (%rax,%r15,4)
jns 0x63fc
movq 0x5ed8(%rip), %rax      # 0xc210
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl %ebp, %esi
movl $0x1a4, %edx            # imm = 0x1A4
callq *(%rax)
movq 0xe107a0(%rip), %rcx    # 0xe16af0
movl %eax, (%rcx,%r15,4)
testl %eax, %eax
js 0x640c
cmpl $0x3, 0x5eb5(%rip)      # 0xc218
jge 0x6468
cmpl $0x3, 0x205f28(%rip)    # 0x20c298
jne 0x63fc
movq 0x5ed3(%rip), %rax      # 0xc250
movq 0xb028(%rax), %rsi
imulq 0xb020(%rax), %rsi
movq 0xe1075d(%rip), %rax    # 0xe16af0
movl (%rax,%r15,4), %edi
callq 0x2340
testl %eax, %eax
je 0x63fc
cmpl $0x0, 0x5e71(%rip)      # 0xc218
js 0x63fc
movq 0x5c30(%rip), %rax      # 0xbfe0
movq (%rax), %rbx
movl 0x5eaf(%rip), %ebp      # 0xc268
callq 0x2240
movl (%rax), %edi
callq 0x21f0
movq %rax, (%rsp)
leaq 0x2c41(%rip), %rsi      # 0x9011
leaq 0x1dc1(%rip), %rdx      # 0x8198
leaq 0x2d3e(%rip), %rcx      # 0x911c
movq %rbx, %rdi
movl %ebp, %r8d
movl $0x4b9, %r9d            # imm = 0x4B9
xorl %eax, %eax
callq 0x2380
pushq $0x1
popq %rdi
callq 0x5874
pushq $-0x16
popq %rbx
movl %ebx, %eax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x2240
movl (%rax), %edi
movl %edi, %ebx
negl %ebx
cmpl $0x0, 0x5dfa(%rip)      # 0xc218
jle 0x63fc
movq 0x5bb9(%rip), %rax      # 0xbfe0
movq (%rax), %r15
movl 0x5e38(%rip), %ebp      # 0xc268
callq 0x21f0
movq %rax, 0x8(%rsp)
movq %r14, (%rsp)
leaq 0x2cba(%rip), %rsi      # 0x90ff
leaq 0x1d52(%rip), %rdx      # 0x819e
leaq 0x2cc9(%rip), %rcx      # 0x911c
movq %r15, %rdi
movl %ebp, %r8d
movl $0x4ab, %r9d            # imm = 0x4AB
xorl %eax, %eax
callq 0x2380
jmp 0x63fc
movq 0x5b71(%rip), %rax      # 0xbfe0
movq (%rax), %rdi
movl 0x5def(%rip), %r8d      # 0xc268
movq %r14, (%rsp)
leaq 0x2622(%rip), %rsi      # 0x8aa6
leaq 0x1d24(%rip), %rdx      # 0x81af
leaq 0x2c8a(%rip), %rcx      # 0x911c
movl $0x4af, %r9d            # imm = 0x4AF
xorl %eax, %eax
callq 0x2380
jmp 0x6369