// File: /workspace/github_c_makefile_star2_O3/baileywjohnson[P]mpi-matrix-mult/MyMPI.c
// Function: print_block_vector
void print_block_vector (
   void        *v,       /* IN - Address of vector */
   MPI_Datatype dtype,   /* IN - Vector element type */
   int          n,       /* IN - Elements in vector */
   MPI_Comm     comm)    /* IN - Communicator */
{
   int        datum_size; /* Bytes per vector element */
   int        i;
   int        prompt;     /* Dummy variable */
   MPI_Status status;     /* Result of receive */
   void       *tmp;       /* Other process's subvector */
   int        id;         /* Process rank */
   int        p;          /* Number of processes */

   MPI_Comm_size (comm, &p);
   MPI_Comm_rank (comm, &id);
   datum_size = get_size (dtype);

   if (!id) {
      print_subvector (v, dtype, BLOCK_SIZE(id,p,n));
      if (p > 1) {
         tmp = my_malloc (id,BLOCK_SIZE(p-1,p,n)*datum_size);
         for (i = 1; i < p; i++) {
            MPI_Send (&prompt, 1, MPI_INT, i, PROMPT_MSG,
               comm);
            MPI_Recv (tmp, BLOCK_SIZE(i,p,n), dtype, i,
               RESPONSE_MSG, comm, &status);
            print_subvector (tmp, dtype, BLOCK_SIZE(i,p,n));
         }
         free (tmp);
      }
      printf ("\n\n");
   } else {
      MPI_Recv (&prompt, 1, MPI_INT, 0, PROMPT_MSG, comm,
         &status);
      MPI_Send (v, BLOCK_SIZE(id,p,n), dtype, 0,
         RESPONSE_MSG, comm);
   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %rbx
movq %rdx, 0x10(%rsp)
movq %rsi, %r15
movq %rdi, %r12
leaq 0xc(%rsp), %rsi
movq %rcx, %rdi
callq 0x1100
leaq 0x1c(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1170
movq %r15, %rdi
callq 0x1b80
cmpl $0x0, (%r14)
je 0x32d8
leaq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq 0x2d29(%rip), %rdx      # 0x5fa8
leaq 0x24(%rsp), %rdi
movl $0x1, %esi
xorl %ecx, %ecx
movl $0x1, %r8d
movq %rbx, %r9
callq 0x1140
movl 0x1c(%rsp), %ecx
leal 0x1(%rcx), %eax
movq 0x10(%rsp), %r8
imull %r8d, %eax
movl 0xc(%rsp), %edi
cltd
idivl %edi
movl %eax, %esi
imull %r8d, %ecx
movl %ecx, %eax
cltd
idivl %edi
subl %eax, %esi
movq %r12, %rdi
movq %r15, %rdx
xorl %ecx, %ecx
movl $0x2, %r8d
movq %rbx, %r9
callq 0x1040
jmp 0x33ee
movl %eax, %ebp
movq 0x10(%rsp), %rax
cltd
idivl 0xc(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %eax, %edx
callq 0x2ba4
movl 0xc(%rsp), %ecx
cmpl $0x2, %ecx
jl 0x33e2
movl 0x1c(%rsp), %edi
leal -0x1(%rcx), %eax
movq 0x10(%rsp), %rsi
imull %esi, %eax
cltd
idivl %ecx
subl %eax, %esi
imull %ebp, %esi
callq 0x1bf2
movq %rax, 0x28(%rsp)
cmpl $0x2, 0xc(%rsp)
jl 0x33d8
movq 0x10(%rsp), %rax
leal (%rax,%rax), %ebp
movl $0x1, %r14d
movl %eax, %r13d
movq 0x28(%rsp), %r12
leaq 0x24(%rsp), %rdi
movl $0x1, %esi
movq 0x2c57(%rip), %rdx      # 0x5fa8
movl %r14d, %ecx
movl $0x1, %r8d
movq %rbx, %r9
callq 0x1040
leal 0x1(%r14), %eax
movl %eax, 0x20(%rsp)
movl 0xc(%rsp), %ecx
movl %ebp, %eax
cltd
idivl %ecx
movl %eax, %esi
movl %r13d, %eax
cltd
idivl %ecx
subl %eax, %esi
leaq 0x30(%rsp), %rax
movq %rax, (%rsp)
movq %r12, %rdi
movq %r15, %rdx
movl %r14d, %ecx
movl $0x2, %r8d
movq %rbx, %r9
callq 0x1140
movl 0xc(%rsp), %esi
movl %ebp, %eax
cltd
idivl %esi
movl %eax, %ecx
movl %r13d, %eax
cltd
idivl %esi
subl %eax, %ecx
movq %r12, %rdi
movq %r15, %rsi
movl %ecx, %edx
callq 0x2ba4
movq 0x10(%rsp), %rax
addl %eax, %r13d
addl %eax, %ebp
movl 0x20(%rsp), %eax
movl %eax, %r14d
cmpl 0xc(%rsp), %eax
jl 0x3340
movq 0x28(%rsp), %rdi
callq 0x10f0
leaq 0xdd5(%rip), %rdi       # 0x41be
callq 0x1060
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq