// File: /workspace/github_c_makefile_star2_O2/00pauln00[P]yapio/yapio.c
// Function: yapio_test_context_sequential_setup_for_rank
static void
yapio_test_context_sequential_setup_for_rank(yapio_test_ctx_t *ytc, int rank)
{
    int num_ops = 0;

    /* The local mode test case does not require the 'MDH_OUT' buffers at all.
     */
    enum yapio_test_ctx_mdh_in_out in_out = ytc->ytc_remote_locality ?
        YAPIO_TEST_CTX_MDH_OUT : YAPIO_TEST_CTX_MDH_IN;

    yapio_blk_md_t *md =
        yapio_test_ctx_to_md_array(ytc, in_out, &num_ops);

    if (!md)
        log_msg(YAPIO_LL_FATAL, "ytc_ops_md[%d] is NULL", rank);

    int skips_left = ytc->ytc_sparse_io;
    int i;
    for (i = 0; i < num_ops; i++)
    {
        size_t src_idx = ytc->ytc_backwards ? num_ops - i - 1 : i;

        bool skip_io = skip_io_or_not(num_ops - i, skips_left);

        /* update writer in case of write (which isn't skipped) */
        if (!ytc->ytc_read && !skip_io)
        {
            log_msg(YAPIO_LL_DEBUG, "update writer rank for op #%d\n", i);
            yapio_source_md_update_writer_rank(src_idx, rank);
        }

        md[i] = yapioSourceBlkMd[src_idx];

        if (skip_io)
        {
            log_msg(YAPIO_LL_DEBUG, "skip IO # %d\n", i);
            md[i].ybm_skip_io = 1;
            skips_left--;
        }

        unsigned long x = md[i].ybm_blk_number;
        log_msg(YAPIO_LL_TRACE, "writer_rank=%d md->ybm_blk_number=%zd",
                md[i].ybm_writer_rank, x);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, 0x14(%rsp)
movq %rdi, %rcx
movzbl (%rdi), %eax
andl $0x4, %eax
movl 0x70(%rdi,%rax,4), %edi
movq %rcx, 0x18(%rsp)
movq 0x68(%rcx,%rax,4), %r13
testq %r13, %r13
jne 0x6f6d
cmpl $0x0, 0x52b1(%rip)      # 0xc218
jns 0x70fc
movq 0x18(%rsp), %rax
movl 0xa8(%rax), %ebp
testl %edi, %edi
movl $0x0, %eax
cmovgl %edi, %eax
movq %rax, 0x20(%rsp)
addq $0x8, %r13
xorl %ebx, %ebx
cmpq %rbx, 0x20(%rsp)
je 0x70ed
leal -0x1(%rdi), %r14d
movq 0x18(%rsp), %rax
testb $0x2, (%rax)
movl %ebx, %eax
cmovnel %r14d, %eax
movslq %eax, %r15
movl %ebp, %esi
callq 0x713e
movl %eax, %r12d
testb %al, %al
jne 0x6fdf
movq 0x18(%rsp), %rax
movb (%rax), %al
andb $0x8, %al
jne 0x6fdf
cmpl $0x3, 0x524b(%rip)      # 0xc218
jge 0x70b2
movq %r15, %rdi
movl 0x14(%rsp), %esi
callq 0x7181
movq 0x527a(%rip), %rax      # 0xc260
shlq $0x4, %r15
movups (%rax,%r15), %xmm0
movups %xmm0, -0x8(%r13)
movl 0x521e(%rip), %eax      # 0xc218
testb %r12b, %r12b
je 0x700b
cmpl $0x3, %eax
jge 0x7071
orb $-0x80, 0x7(%r13)
decl %ebp
cmpl $0x4, %eax
jge 0x701f
incq %rbx
addq $0x10, %r13
movl %r14d, %edi
jmp 0x6f8d
movq (%r13), %rax
movabsq $0x3fffffffffffffff, %rcx # imm = 0x3FFFFFFFFFFFFFFF
andq %rcx, %rax
movq 0x4fa9(%rip), %rcx      # 0xbfe0
movq (%rcx), %rdi
movl 0x5227(%rip), %r8d      # 0xc268
movl -0x8(%r13), %ecx
movq %rax, 0x8(%rsp)
movl %ecx, (%rsp)
leaq 0x25aa(%rip), %rsi      # 0x95fe
leaq 0x114e(%rip), %rdx      # 0x81a9
leaq 0x2524(%rip), %rcx      # 0x9586
movl $0x781, %r9d            # imm = 0x781
xorl %eax, %eax
callq 0x2380
jmp 0x7010
movq 0x4f68(%rip), %rax      # 0xbfe0
movq (%rax), %rdi
movl 0x51e6(%rip), %r8d      # 0xc268
movl %ebx, (%rsp)
leaq 0x2555(%rip), %rsi      # 0x95e1
leaq 0x111c(%rip), %rdx      # 0x81af
leaq 0x24ec(%rip), %rcx      # 0x9586
movl $0x77a, %r9d            # imm = 0x77A
xorl %eax, %eax
callq 0x2380
movl 0x516b(%rip), %eax      # 0xc218
jmp 0x7004
movq 0x4f27(%rip), %rax      # 0xbfe0
movq (%rax), %rdi
movl 0x51a5(%rip), %r8d      # 0xc268
movl %ebx, (%rsp)
leaq 0x24e6(%rip), %rsi      # 0x95b3
leaq 0x10db(%rip), %rdx      # 0x81af
leaq 0x24ab(%rip), %rcx      # 0x9586
movl $0x772, %r9d            # imm = 0x772
xorl %eax, %eax
callq 0x2380
jmp 0x6fd3
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4edd(%rip), %rax      # 0xbfe0
movq (%rax), %rdi
movl 0x515b(%rip), %r8d      # 0xc268
movl 0x14(%rsp), %eax
movl %eax, (%rsp)
leaq 0x2445(%rip), %rsi      # 0x9560
leaq 0x1076(%rip), %rdx      # 0x8198
leaq 0x245d(%rip), %rcx      # 0x9586
movl $0x765, %r9d            # imm = 0x765
xorl %eax, %eax
callq 0x2380
pushq $0x1
popq %rdi
callq 0x5874