// File: /workspace/github_c_makefile_star2_O0/00pauln00[P]yapio/yapio.c
// Function: yapio_test_context_setup_distributed_sequential
static int
yapio_test_context_setup_distributed_sequential(yapio_test_ctx_t *ytc)
{
    if (ytc->ytc_io_pattern != YAPIO_IOP_SEQUENTIAL)
        return -EINVAL;

    const yapio_test_group_t *ytg = ytc->ytc_group;
    const size_t nblks_per_rank = ytg->ytg_num_blks_per_rank;

    int recv_rank = yapio_relative_rank_get(ytg, -1);
    int dest_rank = yapio_relative_rank_get(ytg, 1);

    yapio_blk_md_t *md_send =
        yapio_test_context_alloc(ytc, YAPIO_TEST_CTX_MDH_OUT, nblks_per_rank);

    yapio_blk_md_t *md_recv =
        yapio_test_context_alloc(ytc, YAPIO_TEST_CTX_MDH_IN, nblks_per_rank);

    yapio_test_context_sequential_setup_for_rank(ytc, dest_rank);

    int send_recv_cnt = sizeof(yapio_blk_md_t) * nblks_per_rank;
    int send_recv_tag = YAPIO_IOP_SEQUENTIAL;
    MPI_Status status; //unused

    log_msg(YAPIO_LL_TRACE, "dest_rank=%d recv_rank=%d", dest_rank, recv_rank);

    MPI_OP_START;
    int rc = MPI_Sendrecv((void *)md_send, send_recv_cnt, MPI_BYTE, dest_rank,
                          send_recv_tag, (void *)md_recv, send_recv_cnt,
                          MPI_BYTE, recv_rank, send_recv_tag,
                          yapioMyTestGroup->ytg_comm, &status);
    MPI_OP_END;

    if (rc != MPI_SUCCESS)
        log_msg(YAPIO_LL_ERROR, "MPI_Sendrecv: %d", rc);

    return rc;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rdi, 0x90(%rsp)
movq 0x90(%rsp), %rax
cmpl $0x0, 0xc(%rax)
je 0x8a51
movl $0xffffffea, 0x9c(%rsp) # imm = 0xFFFFFFEA
jmp 0x8c54
movq 0x90(%rsp), %rax
movq 0xa0(%rax), %rax
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
movq 0xb020(%rax), %rax
movq %rax, 0x80(%rsp)
movq 0x88(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x61d0
movl %eax, 0x7c(%rsp)
movq 0x88(%rsp), %rdi
movl $0x1, %esi
callq 0x61d0
movl %eax, 0x78(%rsp)
movq 0x90(%rsp), %rdi
movq 0x80(%rsp), %rdx
movl $0x1, %esi
callq 0x9430
movq %rax, 0x70(%rsp)
movq 0x90(%rsp), %rdi
movq 0x80(%rsp), %rdx
xorl %esi, %esi
callq 0x9430
movq %rax, 0x68(%rsp)
movq 0x90(%rsp), %rdi
movl 0x78(%rsp), %esi
callq 0x9540
movq 0x80(%rsp), %rax
shlq $0x4, %rax
movl %eax, 0x64(%rsp)
movl $0x0, 0x60(%rsp)
movl $0x4, %eax
cmpl 0x66f6(%rip), %eax      # 0xf210
jg 0x8b70
movq 0x64bd(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movl $0x4, %edi
callq 0x4890
movq 0x38(%rsp), %rdi
movq %rax, %rdx
movl 0x674c(%rip), %r8d      # 0xf290
movl 0x78(%rsp), %r10d
movl 0x7c(%rsp), %eax
leaq 0x3b7f(%rip), %rsi      # 0xc6d3
leaq 0x3ba1(%rip), %rcx      # 0xc6fc
movl $0x805, %r9d            # imm = 0x805
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x2370
leaq 0xe10f81(%rip), %rdi    # 0xe19af8
callq 0x2350
movq 0x70(%rsp), %rdi
movl 0x64(%rsp), %esi
movl 0x78(%rsp), %ecx
movl 0x60(%rsp), %r8d
movq 0x68(%rsp), %r9
movl 0x64(%rsp), %ebp
movl 0x7c(%rsp), %ebx
movl 0x60(%rsp), %r11d
movq 0x66a9(%rip), %rax      # 0xf250
movq (%rax), %r10
movq 0x643f(%rip), %r14      # 0xeff0
leaq 0x48(%rsp), %rax
movq %r14, %rdx
movl %ebp, (%rsp)
movq %r14, 0x8(%rsp)
movl %ebx, 0x10(%rsp)
movl %r11d, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
callq 0x2210
movl %eax, 0x44(%rsp)
leaq 0xe10f14(%rip), %rdi    # 0xe19af8
callq 0x2390
cmpl $0x0, 0x44(%rsp)
je 0x8c49
movl $0x1, %eax
cmpl 0x6615(%rip), %eax      # 0xf210
jg 0x8c47
movq 0x63dc(%rip), %rax      # 0xefe0
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movl $0x1, %edi
callq 0x4890
movq 0x30(%rsp), %rdi
movq %rax, %rdx
movl 0x666b(%rip), %r8d      # 0xf290
movl 0x44(%rsp), %eax
leaq 0x3afc(%rip), %rsi      # 0xc72c
leaq 0x3ac5(%rip), %rcx      # 0xc6fc
movl $0x80f, %r9d            # imm = 0x80F
movl %eax, (%rsp)
movb $0x0, %al
callq 0x2370
jmp 0x8c49
movl 0x44(%rsp), %eax
movl %eax, 0x9c(%rsp)
movl 0x9c(%rsp), %eax
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopw (%rax,%rax)