// File: /workspace/github_c_makefile_star2_O0/00pauln00[P]yapio/yapio.c
// Function: yapio_setup_test_file
static void
yapio_setup_test_file(yapio_test_group_t *ytg)
{
    yapio_verify_test_directory();

    int path_len = snprintf(yapioTestFileName, PATH_MAX, "%s/%s%s",
                            yapioTestRootDir, ytg->ytg_prefix,
                            YAPIO_MKSTEMP_TEMPLATE);

    /* check if output got truncated */
    if (path_len == -1)
        log_msg(YAPIO_LL_FATAL, "File name got truncated: %s",
                strerror(errno));

    if (path_len > PATH_MAX)
        log_msg(YAPIO_LL_FATAL, "%s", strerror(ENAMETOOLONG));

    if (!ytg->ytg_restart_from_previous_job)
    {
        if (yapio_leader_rank())
        {
            yapioFileDesc = mkstemp(yapioTestFileName);
            if (yapioFileDesc < 0)
                log_msg(YAPIO_LL_FATAL, "%s", strerror(errno));

            if (yapioModeCurrent == YAPIO_IO_MODE_MMAP &&
                !ytg->ytg_file_per_process)
            {
                size_t len = (ytg->ytg_num_blks_per_rank *
                              ytg->ytg_blk_sz *
                              ytg->ytg_num_ranks);

                if (ftruncate(yapioFileDesc, len))
                {
                    log_msg(YAPIO_LL_FATAL, "ftruncate(): %s",
                            strerror(errno));
                }
            }

            /* File will be reopened below by all ranks.
             */
            close(yapioFileDesc);

            strncpy(ytg->ytg_suffix,
                    &yapioTestFileName[path_len - YAPIO_MKSTEMP_TEMPLATE_LEN],
                    YAPIO_MKSTEMP_TEMPLATE_LEN);

            log_msg(YAPIO_LL_DEBUG, "%s", yapioTestFileName);
        }
        /* Broadcast only the section of the filename which was modified by
         * mkstemp().
         */
        MPI_OP_START;
        MPI_Bcast(ytg->ytg_suffix, YAPIO_MKSTEMP_TEMPLATE_LEN, MPI_CHAR, 0,
                  ytg->ytg_comm);
        MPI_OP_END;
    }


    strncpy(&yapioTestFileName[path_len - YAPIO_MKSTEMP_TEMPLATE_LEN],
            ytg->ytg_suffix, YAPIO_MKSTEMP_TEMPLATE_LEN + 1);

    if (ytg->ytg_file_per_process)
    {
        /* Remove the mkstemp file.
         */
        if (yapio_leader_rank())
            unlink(yapioTestFileName);

        yapioFileDescFpp = YAPIO_CALLOC(yapioNumRanks, sizeof(int));
        if (!yapioFileDescFpp)
            log_msg(YAPIO_LL_FATAL, "%s", strerror(errno));

        int i;
        for (i = 0; i < yapioNumRanks; i++)
            yapioFileDescFpp[i] = -1;

        const int flags = ytg->ytg_restart_from_previous_job ?
            O_RDWR : (O_CREAT | O_EXCL | O_RDWR);

        int rc = yapio_open_fpp_file(yapio_relative_rank_get(ytg, 0), flags);
        if (rc)
            log_msg(YAPIO_LL_FATAL, "yapio_open_fpp_file: %s", strerror(-rc));

        yapio_make_filename(yapioTestFileNameFpp,
                            yapio_relative_rank_get(ytg, 0));

        log_msg(YAPIO_LL_DEBUG, "yapioTestFileNameFpp=%s",
                yapioTestFileNameFpp);
    }
    else
    {
        /* Re-make the filename so that mode specific prefixes may be applied.
         */
        char tmp_filename[PATH_MAX + 1];

        yapio_make_filename(tmp_filename, -1);

        strncpy(yapioTestFileName, tmp_filename, PATH_MAX + 1);

//        snprintf(file_name, PATH_MAX, "%s%s.%d",
//                 yapioTestFileNamePrefix, yapioTestFileName, rank) :

        log_msg(YAPIO_LL_DEBUG, "yapioTestFileName=%s tf=%s tf=%s",
                yapioTestFileName, yapioTestFileNamePrefix, yapioTestFileName);

        yapioFileDesc = YAPIO_SYS_CALL(open)(yapioTestFileName, O_RDWR, 0644);
        if (yapioFileDesc < 0)
            log_msg(YAPIO_LL_FATAL, "%s", strerror(errno));
    }
}

// Assembly:
subq $0x1118, %rsp           # imm = 0x1118
movq %rdi, 0x1110(%rsp)
callq 0x67a0
movq 0x20c3f5(%rip), %rcx    # 0x20f2c0
movq 0x1110(%rsp), %r8
addq $0xb03f, %r8            # imm = 0xB03F
leaq 0xe15c0f(%rip), %rdi    # 0xe18af0
movl $0x1000, %esi           # imm = 0x1000
leaq 0x92d9(%rip), %rdx      # 0xc1c6
leaq 0x92da(%rip), %r9       # 0xc1ce
movb $0x0, %al
callq 0x2070
movl %eax, 0x110c(%rsp)
cmpl $-0x1, 0x110c(%rsp)
jne 0x2f97
xorl %eax, %eax
cmpl 0xc2f8(%rip), %eax      # 0xf210
jg 0x2f95
movq 0xc0bf(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0xc8(%rsp)
xorl %edi, %edi
callq 0x4890
movq %rax, 0xd0(%rsp)
movl 0xc34f(%rip), %eax      # 0xf290
movl %eax, 0xdc(%rsp)
callq 0x2230
movl (%rax), %edi
callq 0x21e0
movq 0xc8(%rsp), %rdi
movq 0xd0(%rsp), %rdx
movl 0xdc(%rsp), %r8d
leaq 0x9262(%rip), %rsi      # 0xc1d5
leaq 0x9286(%rip), %rcx      # 0xc200
movl $0x4d3, %r9d            # imm = 0x4D3
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2370
movl $0x1, %edi
callq 0x40f0
jmp 0x2f97
cmpl $0x1000, 0x110c(%rsp) # imm = 0x1000
jle 0x302d
xorl %eax, %eax
cmpl 0xc260(%rip), %eax      # 0xf210
jg 0x302b
movq 0xc027(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0xb0(%rsp)
xorl %edi, %edi
callq 0x4890
movq %rax, 0xb8(%rsp)
movl 0xc2b7(%rip), %eax      # 0xf290
movl %eax, 0xc4(%rsp)
movl $0x24, %edi
callq 0x21e0
movq 0xb0(%rsp), %rdi
movq 0xb8(%rsp), %rdx
movl 0xc4(%rsp), %r8d
leaq 0x8ca2(%rip), %rsi      # 0xbcab
leaq 0x91f0(%rip), %rcx      # 0xc200
movl $0x4d6, %r9d            # imm = 0x4D6
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2370
movl $0x1, %edi
callq 0x40f0
jmp 0x302d
movq 0x1110(%rsp), %rax
testb $0x1, 0xb033(%rax)
jne 0x32d3
callq 0x5910
testb $0x1, %al
jne 0x3050
jmp 0x328e
leaq 0xe15a99(%rip), %rdi    # 0xe18af0
callq 0x2260
movl %eax, 0xe16a92(%rip)    # 0xe19af4
cmpl $0x0, 0xe16a8b(%rip)    # 0xe19af4
jge 0x30f6
xorl %eax, %eax
cmpl 0xc199(%rip), %eax      # 0xf210
jg 0x30f4
movq 0xbf60(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0x98(%rsp)
xorl %edi, %edi
callq 0x4890
movq %rax, 0xa0(%rsp)
movl 0xc1f0(%rip), %eax      # 0xf290
movl %eax, 0xac(%rsp)
callq 0x2230
movl (%rax), %edi
callq 0x21e0
movq 0x98(%rsp), %rdi
movq 0xa0(%rsp), %rdx
movl 0xac(%rsp), %r8d
leaq 0x8bd9(%rip), %rsi      # 0xbcab
leaq 0x9127(%rip), %rcx      # 0xc200
movl $0x4de, %r9d            # imm = 0x4DE
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2370
movl $0x1, %edi
callq 0x40f0
jmp 0x30f6
cmpl $0x3, 0x20c1cb(%rip)    # 0x20f2c8
jne 0x31f7
movq 0x1110(%rsp), %rax
testb $0x1, 0xb030(%rax)
jne 0x31f7
movq 0x1110(%rsp), %rax
movq 0xb020(%rax), %rax
movq 0x1110(%rsp), %rcx
imulq 0xb028(%rcx), %rax
movq 0x1110(%rsp), %rcx
movslq 0xb01c(%rcx), %rcx
imulq %rcx, %rax
movq %rax, 0x1100(%rsp)
movl 0xe1699c(%rip), %edi    # 0xe19af4
movq 0x1100(%rsp), %rsi
callq 0x2330
cmpl $0x0, %eax
je 0x31f5
xorl %eax, %eax
cmpl 0xc09a(%rip), %eax      # 0xf210
jg 0x31f3
movq 0xbe61(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0x80(%rsp)
xorl %edi, %edi
callq 0x4890
movq %rax, 0x88(%rsp)
movl 0xc0f1(%rip), %eax      # 0xf290
movl %eax, 0x94(%rsp)
callq 0x2230
movl (%rax), %edi
callq 0x21e0
movq 0x80(%rsp), %rdi
movq 0x88(%rsp), %rdx
movl 0x94(%rsp), %r8d
leaq 0x9045(%rip), %rsi      # 0xc216
leaq 0x9028(%rip), %rcx      # 0xc200
movl $0x4ea, %r9d            # imm = 0x4EA
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2370
movl $0x1, %edi
callq 0x40f0
jmp 0x31f5
jmp 0x31f7
movl 0xe168f7(%rip), %edi    # 0xe19af4
callq 0x2080
movq 0x1110(%rsp), %rdi
addq $0xb038, %rdi           # imm = 0xB038
movl 0x110c(%rsp), %eax
subl $0x6, %eax
cltq
leaq 0xe158cc(%rip), %rsi    # 0xe18af0
addq %rax, %rsi
movl $0x6, %edx
callq 0x2310
movl $0x3, %eax
cmpl 0xbfd4(%rip), %eax      # 0xf210
jg 0x328c
movq 0xbd9b(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0x78(%rsp)
movl $0x3, %edi
callq 0x4890
movq 0x78(%rsp), %rdi
movq %rax, %rdx
movl 0xc02a(%rip), %r8d      # 0xf290
leaq 0x8a3e(%rip), %rsi      # 0xbcab
leaq 0x8f8c(%rip), %rcx      # 0xc200
movl $0x4f6, %r9d            # imm = 0x4F6
leaq 0xe1586f(%rip), %rax    # 0xe18af0
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2370
jmp 0x328e
leaq 0xe16863(%rip), %rdi    # 0xe19af8
callq 0x2350
movq 0x1110(%rsp), %rdi
addq $0xb038, %rdi           # imm = 0xB038
movq 0x1110(%rsp), %rax
movq (%rax), %r8
movl $0x6, %esi
movq 0xbcd0(%rip), %rdx      # 0xef90
xorl %ecx, %ecx
callq 0x2270
leaq 0xe1682a(%rip), %rdi    # 0xe19af8
callq 0x2390
movl 0x110c(%rsp), %eax
subl $0x6, %eax
cltq
leaq 0xe1580a(%rip), %rdi    # 0xe18af0
addq %rax, %rdi
movq 0x1110(%rsp), %rsi
addq $0xb038, %rsi           # imm = 0xB038
movl $0x7, %edx
callq 0x2310
movq 0x1110(%rsp), %rax
testb $0x1, 0xb030(%rax)
je 0x35db
callq 0x5910
testb $0x1, %al
jne 0x3322
jmp 0x332e
leaq 0xe157c7(%rip), %rdi    # 0xe18af0
callq 0x2120
movslq 0x20bf6b(%rip), %rdi    # 0x20f2a0
movl $0x4, %esi
callq 0x22c0
movq %rax, 0x10f8(%rsp)
movl $0x3, %eax
cmpl 0xbebe(%rip), %eax      # 0xf210
jg 0x33b3
movq 0xbc85(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0x70(%rsp)
movl $0x3, %edi
callq 0x4890
movq 0x70(%rsp), %rdi
movq %rax, %rdx
movl 0xbf14(%rip), %r8d      # 0xf290
movq 0x10f8(%rsp), %r10
movslq 0x20bf15(%rip), %rax    # 0x20f2a0
shlq $0x2, %rax
leaq 0x8ab9(%rip), %rsi      # 0xbe4f
leaq 0x8e63(%rip), %rcx      # 0xc200
movl $0x50c, %r9d            # imm = 0x50C
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x2370
movq 0x10f8(%rsp), %rax
movq %rax, 0x10f0(%rsp)
movq 0x10f0(%rsp), %rax
movq %rax, 0xe1674e(%rip)    # 0xe19b20
cmpq $0x0, 0xe16746(%rip)    # 0xe19b20
jne 0x3451
xorl %eax, %eax
cmpl 0xbe2c(%rip), %eax      # 0xf210
jg 0x344f
movq 0xbbf3(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0x58(%rsp)
xorl %edi, %edi
callq 0x4890
movq %rax, 0x60(%rsp)
movl 0xbe89(%rip), %eax      # 0xf290
movl %eax, 0x6c(%rsp)
callq 0x2230
movl (%rax), %edi
callq 0x21e0
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rdx
movl 0x6c(%rsp), %r8d
leaq 0x887e(%rip), %rsi      # 0xbcab
leaq 0x8dcc(%rip), %rcx      # 0xc200
movl $0x50e, %r9d            # imm = 0x50E
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2370
movl $0x1, %edi
callq 0x40f0
jmp 0x3451
movl $0x0, 0x10ec(%rsp)
movl 0x10ec(%rsp), %eax
cmpl 0x20be37(%rip), %eax    # 0x20f2a0
jge 0x3494
movq 0xe166ae(%rip), %rax    # 0xe19b20
movslq 0x10ec(%rsp), %rcx
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movl 0x10ec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10ec(%rsp)
jmp 0x345c
movq 0x1110(%rsp), %rax
movb 0xb033(%rax), %dl
movl $0xc2, %eax
movl $0x2, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, 0x10e8(%rsp)
movq 0x1110(%rsp), %rdi
xorl %esi, %esi
callq 0x61d0
movl %eax, %edi
movl 0x10e8(%rsp), %esi
callq 0x6960
movl %eax, 0x10e4(%rsp)
cmpl $0x0, 0x10e4(%rsp)
je 0x355e
xorl %eax, %eax
cmpl 0xbd21(%rip), %eax      # 0xf210
jg 0x355c
movq 0xbae8(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0x40(%rsp)
xorl %edi, %edi
callq 0x4890
movq %rax, 0x48(%rsp)
movl 0xbd7e(%rip), %eax      # 0xf290
movl %eax, 0x54(%rsp)
xorl %edi, %edi
subl 0x10e4(%rsp), %edi
callq 0x21e0
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rdx
movl 0x54(%rsp), %r8d
leaq 0x8cfb(%rip), %rsi      # 0xc235
leaq 0x8cbf(%rip), %rcx      # 0xc200
movl $0x519, %r9d            # imm = 0x519
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2370
movl $0x1, %edi
callq 0x40f0
jmp 0x355e
movq 0x1110(%rsp), %rdi
xorl %esi, %esi
callq 0x61d0
movl %eax, %esi
leaq 0xe165ba(%rip), %rdi    # 0xe19b30
callq 0x6c00
movl $0x3, %eax
cmpl 0xbc8a(%rip), %eax      # 0xf210
jg 0x35d6
movq 0xba51(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movl $0x3, %edi
callq 0x4890
movq 0x38(%rsp), %rdi
movq %rax, %rdx
movl 0xbce0(%rip), %r8d      # 0xf290
leaq 0x8ca5(%rip), %rsi      # 0xc25c
leaq 0x8c42(%rip), %rcx      # 0xc200
movl $0x51f, %r9d            # imm = 0x51F
leaq 0xe16565(%rip), %rax    # 0xe19b30
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2370
jmp 0x3712
leaq 0xe0(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x6c00
leaq 0xe0(%rsp), %rsi
leaq 0xe154f4(%rip), %rdi    # 0xe18af0
movl $0x1001, %edx           # imm = 0x1001
callq 0x2310
movl $0x3, %eax
cmpl 0xbbff(%rip), %eax      # 0xf210
jg 0x3672
movq 0xb9c6(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movl $0x3, %edi
callq 0x4890
movq 0x30(%rsp), %rdi
movq %rax, %rdx
movl 0xbc55(%rip), %r8d      # 0xf290
movq 0xbbee(%rip), %r10      # 0xf230
leaq 0x8c3a(%rip), %rsi      # 0xc283
leaq 0x8bb0(%rip), %rcx      # 0xc200
movl $0x52f, %r9d            # imm = 0x52F
leaq 0xe15493(%rip), %rax    # 0xe18af0
movq %rax, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x2370
movq 0xbb8f(%rip), %rax      # 0xf208
leaq 0xe15470(%rip), %rdi    # 0xe18af0
movl $0x2, %esi
movl $0x1a4, %edx            # imm = 0x1A4
callq *(%rax)
movl %eax, 0xe16462(%rip)    # 0xe19af4
cmpl $0x0, 0xe1645b(%rip)    # 0xe19af4
jge 0x3710
xorl %eax, %eax
cmpl 0xbb6d(%rip), %eax      # 0xf210
jg 0x370e
movq 0xb934(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0x18(%rsp)
xorl %edi, %edi
callq 0x4890
movq %rax, 0x20(%rsp)
movl 0xbbca(%rip), %eax      # 0xf290
movl %eax, 0x2c(%rsp)
callq 0x2230
movl (%rax), %edi
callq 0x21e0
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rdx
movl 0x2c(%rsp), %r8d
leaq 0x85bf(%rip), %rsi      # 0xbcab
leaq 0x8b0d(%rip), %rcx      # 0xc200
movl $0x533, %r9d            # imm = 0x533
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2370
movl $0x1, %edi
callq 0x40f0
jmp 0x3710
jmp 0x3712
addq $0x1118, %rsp           # imm = 0x1118
retq
nopw (%rax,%rax)