// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/libmisc.c
// Function: findmincounts
int* findmincounts(char** names, int count)
{
 /*!Last Changed 25.01.2005*/
 int i, j, length, *result = safecalloc(count, sizeof(int), "findmincounts", 1);
 double** data, min;
 FILE* infile;
 length = file_length(names[0]);
 data = (double**) safemalloc_2d(sizeof(double*), sizeof(double), count, length, "findmincounts", 5);
 for (i = 0; i < count; i++)
  {
   infile = fopen(names[i], "r");
   if (!infile)
    {
     printf(m1274, names[i]);
     return NULL;
    }
   for (j = 0; j < length; j++)
     fscanf(infile, "%lf", &(data[i][j]));
   fclose(infile);
  }
 for (j = 0; j < length; j++)
  {
   min = data[0][j];
   for (i = 1; i < count; i++)
     if (data[i][j] < min)
       min = data[i][j];
   for (i = 0; i < count; i++)
     if (data[i][j] == min)
       (result[i])++;
  }
 free_2d((void**)data, count);
 return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movslq -0x14(%rbp), %rdi
movl $0x4, %esi
leaq 0x92dc3(%rip), %rdx     # 0xe65a2
movl $0x1, %ecx
callq 0x52f40
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x50f90
movl %eax, -0x20(%rbp)
movl -0x14(%rbp), %edx
movl -0x20(%rbp), %ecx
movl $0x8, %esi
leaq 0x92d94(%rip), %r8      # 0xe65a2
movl $0x5, %r9d
movq %rsi, %rdi
callq 0x53120
movq %rax, -0x30(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x538d7
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x94960(%rip), %rsi     # 0xe81a6
callq 0x40c0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x5387d
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x8f621(%rip), %rdi     # 0xe2e8a
movb $0x0, %al
callq 0x4030
movq $0x0, -0x8(%rbp)
jmp 0x539c4
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x538c0
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movslq -0x1c(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
leaq 0x92f1a(%rip), %rsi     # 0xe67c8
movb $0x0, %al
callq 0x4070
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x53884
movq -0x40(%rbp), %rdi
callq 0x4250
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x53827
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x539b0
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x38(%rbp)
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x53955
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0x38(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x53948
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x38(%rbp)
jmp 0x5394a
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x53906
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x539a0
movq -0x30(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x1c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd -0x38(%rbp), %xmm0
jne 0x53993
jp 0x53993
movq -0x28(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x53995
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x5395c
jmp 0x539a2
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x538de
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x52e20
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop