// File: poseidon1214[P]logistic-regression-ftrl-mpi/src/predict.h
// Function: Predict::mpi_auc(int, int, double&)
int mpi_auc(int nprocs, int rank, double& auc){
        MPI_Status status;
        if(rank != MASTER_ID){
            MPI_Send(g_nclk, MAX_ARRAY_SIZE, MPI_FLOAT, MASTER_ID, MPI_NON_CLK_TAG, MPI_COMM_WORLD);
            MPI_Send(g_clk, MAX_ARRAY_SIZE, MPI_FLOAT, MASTER_ID, MPI_CLK_TAG, MPI_COMM_WORLD);
        }
        else if(rank == MASTER_ID){
            for(int i = 0; i < MAX_ARRAY_SIZE; i++){
                g_all_non_clk[i] = g_nclk[i];
                g_all_clk[i] = g_clk[i];
            }
            for(int i = 1; i < nprocs; i++){
                MPI_Recv(g_nclk, MAX_ARRAY_SIZE, MPI_FLOAT, i, MPI_NON_CLK_TAG, MPI_COMM_WORLD, &status);
                MPI_Recv(g_clk, MAX_ARRAY_SIZE, MPI_FLOAT, i, MPI_CLK_TAG, MPI_COMM_WORLD, &status);
                for(int i = 0; i < MAX_ARRAY_SIZE; i++){
                    g_all_non_clk[i] += g_nclk[i];
                    g_all_clk[i] += g_clk[i];
                }
            }
            auc_cal(g_all_non_clk, g_all_clk, auc);
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x11b65
movq -0x48(%rbp), %rax
movq 0x38(%rax), %rdi
movl 0x20(%rax), %esi
movq 0x9492(%rip), %rdx      # 0x1afb8
xorl %ecx, %ecx
movl $0x63, %r8d
movq 0x9473(%rip), %r9       # 0x1afa8
callq 0x81e0
movq -0x48(%rbp), %rax
movq 0x40(%rax), %rdi
movl 0x20(%rax), %esi
movq 0x946c(%rip), %rdx      # 0x1afb8
xorl %ecx, %ecx
movl $0xc7, %r8d
movq 0x944d(%rip), %r9       # 0x1afa8
callq 0x81e0
jmp 0x11cbd
cmpl $0x0, -0x10(%rbp)
jne 0x11cbb
movl $0x0, -0x34(%rbp)
movq -0x48(%rbp), %rcx
movl -0x34(%rbp), %eax
cmpl 0x20(%rcx), %eax
jge 0x11bc5
movq -0x48(%rbp), %rax
movq 0x38(%rax), %rcx
movslq -0x34(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movq 0x28(%rax), %rcx
movslq -0x34(%rbp), %rdx
movss %xmm0, (%rcx,%rdx,4)
movq 0x40(%rax), %rcx
movslq -0x34(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x11b76
movl $0x1, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x11ca6
movq -0x48(%rbp), %rax
movq 0x38(%rax), %rdi
movl 0x20(%rax), %esi
movl -0x38(%rbp), %ecx
movq 0x93cb(%rip), %rdx      # 0x1afb8
movl $0x63, %r8d
movq 0x93ae(%rip), %r9       # 0x1afa8
leaq -0x30(%rbp), %rax
movq %rax, (%rsp)
callq 0x84e0
movq -0x48(%rbp), %rax
movq 0x40(%rax), %rdi
movl 0x20(%rax), %esi
movl -0x38(%rbp), %ecx
movq 0x939c(%rip), %rdx      # 0x1afb8
movl $0xc7, %r8d
movq 0x937f(%rip), %r9       # 0x1afa8
leaq -0x30(%rbp), %rax
movq %rax, (%rsp)
callq 0x84e0
movl $0x0, -0x3c(%rbp)
movq -0x48(%rbp), %rcx
movl -0x3c(%rbp), %eax
cmpl 0x20(%rcx), %eax
jge 0x11c96
movq -0x48(%rbp), %rax
movq 0x38(%rax), %rcx
movslq -0x3c(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movq 0x28(%rax), %rcx
movslq -0x3c(%rbp), %rdx
addss (%rcx,%rdx,4), %xmm0
movss %xmm0, (%rcx,%rdx,4)
movq 0x40(%rax), %rcx
movslq -0x3c(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
movq 0x30(%rax), %rax
movslq -0x3c(%rbp), %rcx
addss (%rax,%rcx,4), %xmm0
movss %xmm0, (%rax,%rcx,4)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x11c3d
jmp 0x11c98
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x11bcc
movq -0x48(%rbp), %rdi
movq 0x28(%rdi), %rsi
movq 0x30(%rdi), %rdx
movq -0x18(%rbp), %rcx
callq 0x12410
jmp 0x11cbd
ud2
nop