// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../tools/arrays.c
// Function: array_integrate
int array_integrate(
		   double * array,
		   int n_columns,
		   int n_lines,
		   int index_x,   /** from 0 to (n_columns-1) */
		   int index_y,
		   int index_int_y_dx,
		   ErrorMsg errmsg) {

  int i;
  double sum;

  if ((index_int_y_dx == index_x) || (index_int_y_dx == index_y)) {
    class_sprintf(errmsg,"%s(L:%d) : Output column %d must differ from input columns %d and %d",__func__,__LINE__,index_int_y_dx,index_x,index_y);
    return _FAILURE_;
  }

  sum=0.;
  *(array+0*n_columns+index_int_y_dx)=sum;

  for (i=1; i<n_lines; i++) {

    sum += 0.5 * (*(array+i*n_columns+index_y) + *(array+(i-1)*n_columns+index_y))
               * (*(array+i*n_columns+index_x) - *(array+(i-1)*n_columns+index_x));

    *(array+i*n_columns+index_int_y_dx)=sum;
  }


  return _SUCCESS_;
}

// Assembly:
subq $0x48, %rsp
movq 0x50(%rsp), %rax
movq %rdi, 0x38(%rsp)
movl %esi, 0x34(%rsp)
movl %edx, 0x30(%rsp)
movl %ecx, 0x2c(%rsp)
movl %r8d, 0x28(%rsp)
movl %r9d, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x2c(%rsp), %eax
je 0x2317c
movl 0x24(%rsp), %eax
cmpl 0x28(%rsp), %eax
jne 0x23207
jmp 0x2317e
movl 0x24(%rsp), %r9d
movl 0x2c(%rsp), %r10d
movl 0x28(%rsp), %eax
xorl %ecx, %ecx
movl %ecx, %esi
leaq 0x1b0bd4(%rip), %rdx    # 0x1d3d6b
leaq 0x1b0ef9(%rip), %rcx    # 0x1d4097
movl $0x62f, %r8d            # imm = 0x62F
movq %rsi, %rdi
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x8540
movl %eax, 0x14(%rsp)
movq 0x50(%rsp), %rdi
movl 0x14(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movl 0x24(%rsp), %r9d
movl 0x2c(%rsp), %r10d
movl 0x28(%rsp), %eax
leaq 0x1b0b8d(%rip), %rdx    # 0x1d3d6b
leaq 0x1b0eb2(%rip), %rcx    # 0x1d4097
movl $0x62f, %r8d            # imm = 0x62F
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x8540
movl $0x1, 0x44(%rsp)
jmp 0x23338
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
movq 0x38(%rsp), %rax
imull $0x0, 0x34(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x24(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl $0x1, 0x20(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x30(%rsp), %eax
jge 0x23330
movq 0x38(%rsp), %rax
movl 0x20(%rsp), %ecx
imull 0x34(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x28(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq 0x38(%rsp), %rax
movl 0x20(%rsp), %ecx
subl $0x1, %ecx
imull 0x34(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x28(%rsp), %rcx
addsd (%rax,%rcx,8), %xmm1
movsd 0x1af9ef(%rip), %xmm0   # 0x1d2c88
mulsd %xmm1, %xmm0
movq 0x38(%rsp), %rax
movl 0x20(%rsp), %ecx
imull 0x34(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x2c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm2
movq 0x38(%rsp), %rax
movl 0x20(%rsp), %ecx
subl $0x1, %ecx
imull 0x34(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x2c(%rsp), %rcx
subsd (%rax,%rcx,8), %xmm2
movsd 0x18(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
movq 0x38(%rsp), %rax
movl 0x20(%rsp), %ecx
imull 0x34(%rsp), %ecx
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movslq 0x24(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x2323c
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)