// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x1078, %rsp           # imm = 0x1078
movl %edi, 0x1070(%rsp)
movl %esi, 0x106c(%rsp)
movl 0x1070(%rsp), %eax
cmpl 0x20891e(%rip), %eax    # 0x20f2a0
jl 0x6994
movl $0xffffffea, 0x1074(%rsp) # imm = 0xFFFFFFEA
jmp 0x6bea
leaq 0x60(%rsp), %rdi
movl 0x1070(%rsp), %esi
callq 0x6c00
movl %eax, 0x5c(%rsp)
cmpl $0x0, 0x5c(%rsp)
je 0x69c0
movl 0x5c(%rsp), %eax
movl %eax, 0x1074(%rsp)
jmp 0x6bea
movq 0xe13159(%rip), %rax    # 0xe19b20
movslq 0x1070(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jge 0x6bdf
movq 0x8828(%rip), %rax      # 0xf208
movq (%rax), %rax
leaq 0x60(%rsp), %rdi
movl 0x106c(%rsp), %esi
movl $0x1a4, %edx            # imm = 0x1A4
callq *%rax
movl %eax, %edx
movq 0xe13121(%rip), %rax    # 0xe19b20
movslq 0x1070(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movq 0xe1310f(%rip), %rax    # 0xe19b20
movslq 0x1070(%rsp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jge 0x6abb
callq 0x2230
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, 0x5c(%rsp)
movl $0x1, %eax
cmpl 0x87d2(%rip), %eax      # 0xf210
jg 0x6ab6
movq 0x8599(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movl $0x1, %edi
callq 0x4890
movq %rax, 0x38(%rsp)
movl 0x882c(%rip), %eax      # 0xf290
movl %eax, 0x44(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0x48(%rsp)
callq 0x2230
movl (%rax), %edi
callq 0x21e0
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rdx
movl 0x44(%rsp), %r8d
movq 0x48(%rsp), %r10
leaq 0x586b(%rip), %rsi      # 0xc304
leaq 0x5881(%rip), %rcx      # 0xc321
movl $0x4ab, %r9d            # imm = 0x4AB
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x2370
jmp 0x6bdd
movl $0x3, %eax
cmpl 0x874a(%rip), %eax      # 0xf210
jg 0x6b14
movq 0x8511(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movl $0x3, %edi
callq 0x4890
movq 0x28(%rsp), %rdi
movq %rax, %rdx
movl 0x87a0(%rip), %r8d      # 0xf290
leaq 0x60(%rsp), %rax
leaq 0x51af(%rip), %rsi      # 0xbcab
leaq 0x581e(%rip), %rcx      # 0xc321
movl $0x4af, %r9d            # imm = 0x4AF
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2370
cmpl $0x3, 0x2087ad(%rip)    # 0x20f2c8
jne 0x6bdb
movq 0x8728(%rip), %rax      # 0xf250
movq 0xb020(%rax), %rax
movq 0x871a(%rip), %rcx      # 0xf250
imulq 0xb028(%rcx), %rax
movq %rax, 0x50(%rsp)
movq 0xe12fd6(%rip), %rax    # 0xe19b20
movslq 0x1070(%rsp), %rcx
movl (%rax,%rcx,4), %edi
movq 0x50(%rsp), %rsi
callq 0x2330
cmpl $0x0, %eax
je 0x6bd9
xorl %eax, %eax
cmpl 0x86a4(%rip), %eax      # 0xf210
jg 0x6bd7
movq 0x846b(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0x10(%rsp)
xorl %edi, %edi
callq 0x4890
movq %rax, 0x18(%rsp)
movl 0x8701(%rip), %eax      # 0xf290
movl %eax, 0x24(%rsp)
callq 0x2230
movl (%rax), %edi
callq 0x21e0
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
movl 0x24(%rsp), %r8d
leaq 0x5661(%rip), %rsi      # 0xc216
leaq 0x5765(%rip), %rcx      # 0xc321
movl $0x4b9, %r9d            # imm = 0x4B9
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2370
movl $0x1, %edi
callq 0x40f0
jmp 0x6bd9
jmp 0x6bdb
jmp 0x6bdd
jmp 0x6bdf
movl 0x5c(%rsp), %eax
movl %eax, 0x1074(%rsp)
movl 0x1074(%rsp), %eax
addq $0x1078, %rsp           # imm = 0x1078
retq
nopl (%rax)