#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(char *);
float computeEui(int, int, int, int, double *, double *, double *);
double *createMatrix(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, float);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ get_walltime(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int strtod(char *, int /*<<< orphan*/ *);
char *strtok(char *, char *);
int main(int argc, char *argv[]) {
  int numProcessors, rank;
  double startTime, endTime;
  int i, u, f, y, r;
  int megaSize = 99072112 * 3;
  int n = 0;
  int m = 0;
  int factorCount = 32;
  double llamda = 0.005;
  double gamma = 0.00125;
  double errorLimit = 0.001;
  float e = 0;
  float totalError = 0;
  double *megaMatrix = createMatrix(megaSize);
  FILE *input;
  if (argv[2] == NULL || argv[1] == NULL) {
    printf("not enough arguments");
    exit(0);
  }
  input = fopen(argv[1], "r");
  if (!input) {
    fclose(input);
    return 0;
  }
  FILE *output;
  output = fopen(argv[2], "w");
  if (!output) {
    fclose(input);
    fclose(output);
    return 0;
  }
  int maxLineLength = 30;
  char *line = (char *)malloc(maxLineLength);
  assert(line);
  int count = 0;
  while (fgets(line, maxLineLength, input) != NULL) {
    char *user = strtok(line, " ");
    char *movie = strtok(NULL, " ");
    char *rating = strtok(NULL, " ");
    int userNum = strtod(user, NULL);
    int movieNum = strtod(movie, NULL);
    int ratingNum = strtod(rating, NULL);
    if (userNum > n && movieNum > m) {
      n = userNum;
      m = movieNum;
    } else if (movieNum > m) {
      m = movieNum;
    } else if (userNum > n) {
      n = userNum;
    }
    megaMatrix[count] = userNum;
    megaMatrix[count + 1] = movieNum;
    megaMatrix[count + 2] = ratingNum;
    count += 3;
  }
  free(line);
  double *q = createMatrix(m * factorCount);
  for (y = 0; y < m * factorCount; y++) {
    q[y] = 1;
  }
  double *p = createMatrix(n * factorCount);
  for (y = 0; y < n * factorCount; y++) {
    p[y] = 1;
  }
  float oldError = 0;
  get_walltime(&startTime);
  while (oldError - totalError > errorLimit || !oldError ||
         oldError - totalError < 0) {
    oldError = totalError;
    totalError = 0;
#pragma omp parallel for schedule(guided, 1)
    for (y = 0; y < megaSize; y += 3) {
      u = megaMatrix[y];
      i = megaMatrix[y + 1];
      r = megaMatrix[y + 2];
      e = computeEui(u, i, r, factorCount, q, p, megaMatrix);
      double qNorm = 0;
      double pNorm = 0;
      for (f = 0; f < factorCount; f++) {
        double qi = q[i * factorCount + f];
        double pu = p[u * factorCount + f];
        qNorm += qi * qi;
        pNorm += pu * pu;
        q[i * factorCount + f] += gamma * (e * pu - (llamda * qi));
        p[u * factorCount + f] += gamma * (e * qi - (llamda * pu));
      }
      e = e * e;
      double noise = llamda * (qNorm + pNorm);
      totalError += (e + noise);
    }
  }
  get_walltime(&endTime);
  fprintf(output, "user: 427501 movie:  8 rating: %f\n", e);
  fprintf(output, "user: 260749 movie: 18 rating: %f\n", e);
  fprintf(output, "user: 311872 movie: 28 rating: %f\n", e);
  fprintf(output, "user:  73318 movie: 30 rating: %f\n", e);
  fprintf(output, "user: 182071 movie: 30 rating: %f\n", e);
  double timeElapsed = endTime - startTime;
  printf("elapsed time: %f", timeElapsed);
  printf("\n");
  printf("\n");
  fclose(input);
  fclose(output);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x11b72950,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x20,-0x4c(%rbp)
movsd  0xdf3(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xdde(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xdc9(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x6c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x70(%rbp)
mov    -0x40(%rbp),%edi
call   10d0 <createMatrix@plt>
mov    %rax,-0x78(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     1276 <main+0x96>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    128b <main+0xab>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd9b(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x80(%rbp)
cmpq   $0x0,-0x80(%rbp)
jne    12c3 <main+0xe3>
mov    -0x80(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
jmp    196c <main+0x78c>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd65(%rip),%rsi
call   10e0 <fopen@plt>
mov    %rax,-0x88(%rbp)
cmpq   $0x0,-0x88(%rbp)
jne    130d <main+0x12d>
mov    -0x80(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x88(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
jmp    196c <main+0x78c>
movl   $0x1e,-0x8c(%rbp)
mov    -0x8c(%rbp),%edi
call   10c0 <malloc@plt>
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rdi
call   10a0 <assert@plt>
movl   $0x0,-0x9c(%rbp)
mov    -0x98(%rbp),%rdi
mov    -0x8c(%rbp),%esi
mov    -0x80(%rbp),%rdx
call   1090 <fgets@plt>
cmp    $0x0,%rax
je     14c3 <main+0x2e3>
mov    -0x98(%rbp),%rdi
lea    0xccc(%rip),%rsi
call   10f0 <strtok@plt>
mov    %rax,-0xa8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xcb5(%rip),%rsi
call   10f0 <strtok@plt>
mov    %rax,-0xb0(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xc9e(%rip),%rsi
call   10f0 <strtok@plt>
mov    %rax,-0xb8(%rbp)
mov    -0xa8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <strtod@plt>
mov    %eax,-0xbc(%rbp)
mov    -0xb0(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <strtod@plt>
mov    %eax,-0xc0(%rbp)
mov    -0xb8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <strtod@plt>
mov    %eax,-0xc4(%rbp)
mov    -0xbc(%rbp),%eax
cmp    -0x44(%rbp),%eax
jle    141e <main+0x23e>
mov    -0xc0(%rbp),%eax
cmp    -0x48(%rbp),%eax
jle    141e <main+0x23e>
mov    -0xbc(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0xc0(%rbp),%eax
mov    %eax,-0x48(%rbp)
jmp    145d <main+0x27d>
mov    -0xc0(%rbp),%eax
cmp    -0x48(%rbp),%eax
jle    143b <main+0x25b>
mov    -0xc0(%rbp),%eax
mov    %eax,-0x48(%rbp)
jmp    1458 <main+0x278>
mov    -0xbc(%rbp),%eax
cmp    -0x44(%rbp),%eax
jle    1453 <main+0x273>
mov    -0xbc(%rbp),%eax
mov    %eax,-0x44(%rbp)
jmp    1458 <main+0x278>
jmp    145d <main+0x27d>
cvtsi2sdl -0xbc(%rbp),%xmm0
ff
mov    -0x78(%rbp),%rax
movslq -0x9c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
cvtsi2sdl -0xc0(%rbp),%xmm0
ff
mov    -0x78(%rbp),%rax
mov    -0x9c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
cvtsi2sdl -0xc4(%rbp),%xmm0
ff
mov    -0x78(%rbp),%rax
mov    -0x9c(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x9c(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x9c(%rbp)
jmp    133f <main+0x15f>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%edi
imul   -0x4c(%rbp),%edi
call   10d0 <createMatrix@plt>
mov    %rax,-0xd0(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x48(%rbp),%ecx
imul   -0x4c(%rbp),%ecx
cmp    %ecx,%eax
jge    1521 <main+0x341>
mov    -0xd0(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  0xb0a(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    14e9 <main+0x309>
mov    -0x44(%rbp),%edi
imul   -0x4c(%rbp),%edi
call   10d0 <createMatrix@plt>
mov    %rax,-0xd8(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x44(%rbp),%ecx
imul   -0x4c(%rbp),%ecx
cmp    %ecx,%eax
jge    1573 <main+0x393>
mov    -0xd8(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  0xab8(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    153b <main+0x35b>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xdc(%rbp)
ff
lea    -0x20(%rbp),%rdi
call   1070 <get_walltime@plt>
movss  -0xdc(%rbp),%xmm0
ff
subss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
ucomisd -0x68(%rbp),%xmm0
mov    %al,-0x111(%rbp)
ja     15ee <main+0x40e>
movss  -0xdc(%rbp),%xmm0
ff
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x111(%rbp)
jne    15d2 <main+0x3f2>
jp     15d2 <main+0x3f2>
jmp    15ee <main+0x40e>
movss  -0xdc(%rbp),%xmm1
ff
subss  -0x70(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm1,%xmm0
seta   %al
mov    %al,-0x111(%rbp)
mov    -0x111(%rbp),%al
test   $0x1,%al
jne    1601 <main+0x421>
jmp    1892 <main+0x6b2>
movss  -0x70(%rbp),%xmm0
movss  %xmm0,-0xdc(%rbp)
ff
xorps  %xmm0,%xmm0
movss  %xmm0,-0x70(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    188d <main+0x6ad>
mov    -0x78(%rbp),%rax
movslq -0x38(%rbp),%rcx
cvttsd2si (%rax,%rcx,8),%eax
mov    %eax,-0x30(%rbp)
mov    -0x78(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cvttsd2si (%rax,%rcx,8),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x78(%rbp),%rax
mov    -0x38(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
cvttsd2si (%rax,%rcx,8),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x4c(%rbp),%ecx
mov    -0xd0(%rbp),%r8
mov    -0xd8(%rbp),%r9
mov    -0x78(%rbp),%rax
mov    %rax,(%rsp)
call   1080 <computeEui@plt>
movss  %xmm0,-0x6c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    1828 <main+0x648>
mov    -0xd0(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x4c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
mov    -0xd8(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x4c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
movsd  -0xf8(%rbp),%xmm2
ff
movsd  -0xe8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x100(%rbp),%xmm0
ff
movsd  -0x100(%rbp),%xmm2
ff
movsd  -0xf0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movss  -0x6c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  -0x100(%rbp),%xmm3
ff
movsd  -0x58(%rbp),%xmm1
mulsd  -0xf8(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mov    -0xd0(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x4c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x60(%rbp),%xmm0
movss  -0x6c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  -0xf8(%rbp),%xmm3
ff
movsd  -0x58(%rbp),%xmm1
mulsd  -0x100(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
mov    -0xd8(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x4c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    16ac <main+0x4cc>
movss  -0x6c(%rbp),%xmm0
mulss  -0x6c(%rbp),%xmm0
movss  %xmm0,-0x6c(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0xe8(%rbp),%xmm1
ff
addsd  -0xf0(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movss  -0x6c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
addsd  -0x108(%rbp),%xmm1
ff
movss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x70(%rbp)
mov    -0x38(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x38(%rbp)
jmp    161d <main+0x43d>
jmp    1587 <main+0x3a7>
lea    -0x28(%rbp),%rdi
call   1070 <get_walltime@plt>
mov    -0x88(%rbp),%rdi
movss  -0x6c(%rbp),%xmm0
lea    0x78d(%rip),%rsi
call   10b0 <fprintf@plt>
mov    -0x88(%rbp),%rdi
movss  -0x6c(%rbp),%xmm0
lea    0x798(%rip),%rsi
call   10b0 <fprintf@plt>
mov    -0x88(%rbp),%rdi
movss  -0x6c(%rbp),%xmm0
lea    0x7a3(%rip),%rsi
call   10b0 <fprintf@plt>
mov    -0x88(%rbp),%rdi
movss  -0x6c(%rbp),%xmm0
lea    0x7ae(%rip),%rsi
call   10b0 <fprintf@plt>
mov    -0x88(%rbp),%rdi
movss  -0x6c(%rbp),%xmm0
lea    0x7b9(%rip),%rsi
call   10b0 <fprintf@plt>
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x110(%rbp),%xmm0
ff
lea    0x7b6(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0x7a6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x798(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x80(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x88(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
mov    $0x11b72950,%edi
call   10e0 <createMatrix@plt>
cmpq   $0x0,0x10(%rbx)
je     17a8 <main+0x5b8>
mov    0x8(%rbx),%rdi
test   %rdi,%rdi
je     17a8 <main+0x5b8>
mov    %rax,%r13
lea    0xe1c(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     1370 <main+0x180>
mov    %rax,%r14
mov    0x10(%rbx),%rdi
lea    0xe02(%rip),%rsi
call   10f0 <fopen@plt>
test   %rax,%rax
je     1377 <main+0x187>
mov    %rax,0x20(%rsp)
mov    $0x1e,%edi
call   10d0 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
call   10b0 <assert@plt>
mov    %r12,%rdi
mov    $0x1e,%esi
mov    %r14,%rdx
call   10a0 <fgets@plt>
test   %rax,%rax
mov    %r14,0x18(%rsp)
je     1386 <main+0x196>
lea    0x10(%r13),%r15
xor    %ecx,%ecx
xor    %ebx,%ebx
mov    %r12,0x10(%rsp)
nopl   0x0(%rax)
mov    %rcx,0x8(%rsp)
mov    %r12,%rdi
lea    0xd9e(%rip),%rbp
mov    %rbp,%rsi
call   1100 <strtok@plt>
mov    %rax,%r12
xor    %edi,%edi
mov    %rbp,%rsi
call   1100 <strtok@plt>
mov    %rax,%r14
xor    %edi,%edi
mov    %rbp,%rsi
call   1100 <strtok@plt>
mov    %rax,%rbp
mov    %r12,%rdi
xor    %esi,%esi
call   1050 <strtod@plt>
mov    %eax,%r12d
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <strtod@plt>
mov    %eax,%r14d
mov    %rbp,%rdi
xor    %esi,%esi
call   1050 <strtod@plt>
mov    0x8(%rsp),%rdx
cmp    %edx,%r12d
setg   %cl
mov    %edx,%ebp
cmovg  %r12d,%ebp
cmp    %ebx,%r14d
cmovg  %edx,%ebp
cmovg  %r14d,%ebx
setg   %dl
test   %dl,%cl
cmovne %r14d,%ebx
cmovne %r12d,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
mov    0x10(%rsp),%r12
movsd  %xmm0,-0x10(%r15)
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
movsd  %xmm0,-0x8(%r15)
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r15)
mov    %r12,%rdi
mov    $0x1e,%esi
mov    0x18(%rsp),%rdx
call   10a0 <fgets@plt>
add    $0x18,%r15
mov    %ebp,%ecx
test   %rax,%rax
jne    12a0 <main+0xb0>
jmp    138a <main+0x19a>
xor    %edi,%edi
jmp    1792 <main+0x5a2>
mov    %r14,%rdi
call   1060 <fclose@plt>
xor    %edi,%edi
jmp    1792 <main+0x5a2>
xor    %ebx,%ebx
xor    %ebp,%ebp
mov    %r12,%rdi
call   1030 <free@plt>
mov    %ebx,%r14d
shl    $0x5,%r14d
mov    %r14d,%edi
call   10e0 <createMatrix@plt>
mov    %rax,%r12
test   %ebx,%ebx
jle    147d <main+0x28d>
cmp    $0x2,%r14d
mov    $0x1,%eax
cmovge %r14d,%eax
cmp    $0x4,%eax
jae    13c5 <main+0x1d5>
xor    %ecx,%ecx
jmp    1466 <main+0x276>
mov    %eax,%ecx
and    $0x7fffffe0,%ecx
lea    -0x4(%rcx),%rdx
shr    $0x2,%rdx
lea    0xf0(%r12),%rsi
add    $0x1,%rdx
movapd 0xc17(%rip),%xmm0
nopl   0x0(%rax)
movupd %xmm0,-0xf0(%rsi)
ff
movupd %xmm0,-0xe0(%rsi)
ff
movupd %xmm0,-0xd0(%rsi)
ff
movupd %xmm0,-0xc0(%rsi)
ff
movupd %xmm0,-0xb0(%rsi)
ff
movupd %xmm0,-0xa0(%rsi)
ff
movupd %xmm0,-0x90(%rsi)
ff
movupd %xmm0,-0x80(%rsi)
movupd %xmm0,-0x70(%rsi)
movupd %xmm0,-0x60(%rsi)
movupd %xmm0,-0x50(%rsi)
movupd %xmm0,-0x40(%rsi)
movupd %xmm0,-0x30(%rsi)
movupd %xmm0,-0x20(%rsi)
movupd %xmm0,-0x10(%rsi)
movupd %xmm0,(%rsi)
add    $0x100,%rsi
add    $0xfffffffffffffff8,%rdx
jne    13f0 <main+0x200>
cmp    %rax,%rcx
je     147d <main+0x28d>
movabs $0x3ff0000000000000,%rdx
mov    %rdx,(%r12,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1470 <main+0x280>
mov    %ebp,%ebx
shl    $0x5,%ebx
mov    %ebx,%edi
call   10e0 <createMatrix@plt>
mov    %rax,%r14
test   %ebp,%ebp
jle    155d <main+0x36d>
cmp    $0x2,%ebx
mov    $0x1,%eax
cmovge %ebx,%eax
cmp    $0x4,%eax
jae    14ab <main+0x2bb>
xor    %ecx,%ecx
jmp    1546 <main+0x356>
mov    %eax,%ecx
and    $0x7fffffe0,%ecx
lea    -0x4(%rcx),%rdx
shr    $0x2,%rdx
lea    0xf0(%r14),%rsi
add    $0x1,%rdx
movapd 0xb32(%rip),%xmm0
xchg   %ax,%ax
movupd %xmm0,-0xf0(%rsi)
ff
movupd %xmm0,-0xe0(%rsi)
ff
movupd %xmm0,-0xd0(%rsi)
ff
movupd %xmm0,-0xc0(%rsi)
ff
movupd %xmm0,-0xb0(%rsi)
ff
movupd %xmm0,-0xa0(%rsi)
ff
movupd %xmm0,-0x90(%rsi)
ff
movupd %xmm0,-0x80(%rsi)
movupd %xmm0,-0x70(%rsi)
movupd %xmm0,-0x60(%rsi)
movupd %xmm0,-0x50(%rsi)
movupd %xmm0,-0x40(%rsi)
movupd %xmm0,-0x30(%rsi)
movupd %xmm0,-0x20(%rsi)
movupd %xmm0,-0x10(%rsi)
movupd %xmm0,(%rsi)
add    $0x100,%rsi
add    $0xfffffffffffffff8,%rdx
jne    14d0 <main+0x2e0>
cmp    %rax,%rcx
je     155d <main+0x36d>
movabs $0x3ff0000000000000,%rdx
mov    %rdx,(%r14,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1550 <main+0x360>
lea    0x30(%rsp),%rdi
call   1080 <get_walltime@plt>
xorps  %xmm3,%xmm3
nopw   0x0(%rax,%rax,1)
movss  %xmm3,0x10(%rsp)
xor    %r15d,%r15d
xorps  %xmm3,%xmm3
nopl   0x0(%rax)
movss  %xmm3,0x8(%rsp)
cvttsd2si 0x0(%r13,%r15,8),%ebp
cvttsd2si 0x8(%r13,%r15,8),%ebx
cvttsd2si 0x10(%r13,%r15,8),%edx
mov    %r13,(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x20,%ecx
mov    %r12,%r8
mov    %r14,%r9
call   1090 <computeEui@plt>
movsd  0xa5c(%rip),%xmm8
movsd  0xa4c(%rip),%xmm7
shl    $0x5,%ebx
shl    $0x5,%ebp
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movslq %ebx,%rcx
movslq %ebp,%rax
lea    (%r14,%rax,8),%rax
lea    (%r12,%rcx,8),%rcx
xorpd  %xmm6,%xmm6
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rcx,%rdx,8),%xmm2
movsd  (%rax,%rdx,8),%xmm3
movapd %xmm2,%xmm4
mulsd  %xmm7,%xmm4
movaps %xmm1,%xmm5
mulsd  %xmm3,%xmm5
addsd  %xmm4,%xmm5
movapd %xmm3,%xmm4
unpcklpd %xmm2,%xmm4
mulpd  %xmm4,%xmm4
mulsd  %xmm8,%xmm5
addsd  %xmm2,%xmm5
movsd  %xmm5,(%rcx,%rdx,8)
mulsd  %xmm7,%xmm3
mulsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm8,%xmm2
addsd  (%rax,%rdx,8),%xmm2
addpd  %xmm4,%xmm6
movsd  %xmm2,(%rax,%rdx,8)
add    $0x1,%rdx
cmp    $0x20,%rdx
jne    15f0 <main+0x400>
mulss  %xmm0,%xmm0
movapd %xmm6,%xmm1
unpckhpd %xmm6,%xmm1
addsd  %xmm6,%xmm1
mulsd  0x9b8(%rip),%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
addsd  %xmm1,%xmm2
movss  0x8(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm2,%xmm1
xorps  %xmm3,%xmm3
cvtsd2ss %xmm1,%xmm3
lea    0x3(%r15),%rax
cmp    $0x11b7294d,%r15
mov    %rax,%r15
jb     1580 <main+0x390>
movss  0x10(%rsp),%xmm4
movaps %xmm4,%xmm2
subss  %xmm3,%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
ucomisd 0x970(%rip),%xmm1
ja     1570 <main+0x380>
ucomiss 0x96b(%rip),%xmm4
jne    16cd <main+0x4dd>
jnp    1570 <main+0x380>
xorps  %xmm1,%xmm1
ucomiss %xmm2,%xmm1
ja     1570 <main+0x380>
lea    0x28(%rsp),%rdi
movss  %xmm0,0x8(%rsp)
call   1080 <get_walltime@plt>
lea    0x95f(%rip),%rsi
mov    0x20(%rsp),%rbx
mov    %rbx,%rdi
movss  0x8(%rsp),%xmm0
call   10c0 <fprintf@plt>
lea    0x968(%rip),%rsi
mov    %rbx,%rdi
movss  0x8(%rsp),%xmm0
call   10c0 <fprintf@plt>
lea    0x976(%rip),%rsi
mov    %rbx,%rdi
movss  0x8(%rsp),%xmm0
call   10c0 <fprintf@plt>
lea    0x984(%rip),%rsi
mov    %rbx,%rdi
movss  0x8(%rsp),%xmm0
call   10c0 <fprintf@plt>
lea    0x992(%rip),%rsi
mov    %rbx,%rdi
movss  0x8(%rsp),%xmm0
call   10c0 <fprintf@plt>
movsd  0x28(%rsp),%xmm0
subsd  0x30(%rsp),%xmm0
lea    0x994(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x18(%rsp),%rdi
call   1060 <fclose@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x885(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %edi,%edi
call   1110 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"not enough arguments\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [35 x i8] c"user: 427501 movie: 8 rating: %f\0A\00"
@.str.5 = [35 x i8] c"user: 260749 movie: 18 rating: %f\0A\00"
@.str.6 = [35 x i8] c"user: 311872 movie: 28 rating: %f\0A\00"
@.str.7 = [35 x i8] c"user: 73318 movie: 30 rating: %f\0A\00"
@.str.8 = [35 x i8] c"user: 182071 movie: 30 rating: %f\0A\00"
@.str.9 = [17 x i8] c"elapsed time: %f\00"
@.str.10 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca float
%23 = alloca float
%24 = alloca double*
%25 = alloca i32*
%26 = alloca i32*
%27 = alloca i32
%28 = alloca i8*
%29 = alloca i32
%30 = alloca i8*
%31 = alloca i8*
%32 = alloca i8*
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca double*
%37 = alloca double*
%38 = alloca float
%39 = alloca double
%40 = alloca double
%41 = alloca double
%42 = alloca double
%43 = alloca double
%44 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 297216336, i32* %15
store i32 0, i32* %16
store i32 0, i32* %17
store i32 32, i32* %18
store double 5.000000e-03, double* %19
store double 1.250000e-03, double* %20
store double 1.000000e-03, double* %21
store float 0.000000e+00, float* %22
store float 0.000000e+00, float* %23
%45 = load i32, i32* %15
%46 = call double* @createMatrix(i32 %45)
store double* %46, double** %24
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 2
%49 = load i8*, i8** %48
%50 = icmp eq i8* %49, null
br i1 %50, label %56, label %51
51: ; preds = %2
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 1
%54 = load i8*, i8** %53
%55 = icmp eq i8* %54, null
br i1 %55, label %56, label %59
56: ; preds = %51, %2
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%58 = call i32 @exit(i32 0)
unreachable
59: ; preds = %51
%60 = load i8**, i8*** %5
%61 = getelementptr inbounds i8*, i8** %60, i64 1
%62 = load i8*, i8** %61
%63 = call i32* @fopen(i8* %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %63, i32** %25
%64 = load i32*, i32** %25
%65 = icmp ne i32* %64, null
br i1 %65, label %69, label %66
66: ; preds = %59
%67 = load i32*, i32** %25
%68 = call i32 @fclose(i32* %67)
store i32 0, i32* %3
br label %366
69: ; preds = %59
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 2
%72 = load i8*, i8** %71
%73 = call i32* @fopen(i8* %72, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %73, i32** %26
%74 = load i32*, i32** %26
%75 = icmp ne i32* %74, null
br i1 %75, label %81, label %76
76: ; preds = %69
%77 = load i32*, i32** %25
%78 = call i32 @fclose(i32* %77)
%79 = load i32*, i32** %26
%80 = call i32 @fclose(i32* %79)
store i32 0, i32* %3
br label %366
81: ; preds = %69
store i32 30, i32* %27
%82 = load i32, i32* %27
%83 = call i64 @malloc(i32 %82)
%84 = inttoptr i64 %83 to i8*
store i8* %84, i8** %28
%85 = load i8*, i8** %28
%86 = call i32 @assert(i8* %85)
store i32 0, i32* %29
br label %87
87: ; preds = %128, %81
%88 = load i8*, i8** %28
%89 = load i32, i32* %27
%90 = load i32*, i32** %25
%91 = call i32* @fgets(i8* %88, i32 %89, i32* %90)
%92 = icmp ne i32* %91, null
br i1 %92, label %93, label %151
93: ; preds = %87
%94 = load i8*, i8** %28
%95 = call i8* @strtok(i8* %94, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %95, i8** %30
%96 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %96, i8** %31
%97 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %97, i8** %32
%98 = load i8*, i8** %30
%99 = call i32 @strtod(i8* %98, i32* null)
store i32 %99, i32* %33
%100 = load i8*, i8** %31
%101 = call i32 @strtod(i8* %100, i32* null)
store i32 %101, i32* %34
%102 = load i8*, i8** %32
%103 = call i32 @strtod(i8* %102, i32* null)
store i32 %103, i32* %35
%104 = load i32, i32* %33
%105 = load i32, i32* %16
%106 = icmp sgt i32 %104, %105
br i1 %106, label %107, label %114
107: ; preds = %93
%108 = load i32, i32* %34
%109 = load i32, i32* %17
%110 = icmp sgt i32 %108, %109
br i1 %110, label %111, label %114
111: ; preds = %107
%112 = load i32, i32* %33
store i32 %112, i32* %16
%113 = load i32, i32* %34
store i32 %113, i32* %17
br label %128
114: ; preds = %107, %93
%115 = load i32, i32* %34
%116 = load i32, i32* %17
%117 = icmp sgt i32 %115, %116
br i1 %117, label %118, label %120
118: ; preds = %114
%119 = load i32, i32* %34
store i32 %119, i32* %17
br label %127
120: ; preds = %114
%121 = load i32, i32* %33
%122 = load i32, i32* %16
%123 = icmp sgt i32 %121, %122
br i1 %123, label %124, label %126
124: ; preds = %120
%125 = load i32, i32* %33
store i32 %125, i32* %16
br label %126
126: ; preds = %124, %120
br label %127
127: ; preds = %126, %118
br label %128
128: ; preds = %127, %111
%129 = load i32, i32* %33
%130 = sitofp i32 %129 to double
%131 = load double*, double** %24
%132 = load i32, i32* %29
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds double, double* %131, i64 %133
store double %130, double* %134
%135 = load i32, i32* %34
%136 = sitofp i32 %135 to double
%137 = load double*, double** %24
%138 = load i32, i32* %29
%139 = add nsw i32 %138, 1
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds double, double* %137, i64 %140
store double %136, double* %141
%142 = load i32, i32* %35
%143 = sitofp i32 %142 to double
%144 = load double*, double** %24
%145 = load i32, i32* %29
%146 = add nsw i32 %145, 2
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds double, double* %144, i64 %147
store double %143, double* %148
%149 = load i32, i32* %29
%150 = add nsw i32 %149, 3
store i32 %150, i32* %29
br label %87
151: ; preds = %87
%152 = load i8*, i8** %28
%153 = call i32 @free(i8* %152)
%154 = load i32, i32* %17
%155 = load i32, i32* %18
%156 = mul nsw i32 %154, %155
%157 = call double* @createMatrix(i32 %156)
store double* %157, double** %36
store i32 0, i32* %13
br label %158
158: ; preds = %169, %151
%159 = load i32, i32* %13
%160 = load i32, i32* %17
%161 = load i32, i32* %18
%162 = mul nsw i32 %160, %161
%163 = icmp slt i32 %159, %162
br i1 %163, label %164, label %172
164: ; preds = %158
%165 = load double*, double** %36
%166 = load i32, i32* %13
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds double, double* %165, i64 %167
store double 1.000000e+00, double* %168
br label %169
169: ; preds = %164
%170 = load i32, i32* %13
%171 = add nsw i32 %170, 1
store i32 %171, i32* %13
br label %158
172: ; preds = %158
%173 = load i32, i32* %16
%174 = load i32, i32* %18
%175 = mul nsw i32 %173, %174
%176 = call double* @createMatrix(i32 %175)
store double* %176, double** %37
store i32 0, i32* %13
br label %177
177: ; preds = %188, %172
%178 = load i32, i32* %13
%179 = load i32, i32* %16
%180 = load i32, i32* %18
%181 = mul nsw i32 %179, %180
%182 = icmp slt i32 %178, %181
br i1 %182, label %183, label %191
183: ; preds = %177
%184 = load double*, double** %37
%185 = load i32, i32* %13
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double, double* %184, i64 %186
store double 1.000000e+00, double* %187
br label %188
188: ; preds = %183
%189 = load i32, i32* %13
%190 = add nsw i32 %189, 1
store i32 %190, i32* %13
br label %177
191: ; preds = %177
store float 0.000000e+00, float* %38
%192 = call i32 @get_walltime(double* %8)
br label %193
193: ; preds = %337, %191
%194 = load float, float* %38
%195 = load float, float* %23
%196 = fsub float %194, %195
%197 = fpext float %196 to double
%198 = load double, double* %21
%199 = fcmp ogt double %197, %198
br i1 %199, label %208, label %200
200: ; preds = %193
%201 = load float, float* %38
%202 = fcmp une float %201, 0.000000e+00
br i1 %202, label %203, label %208
203: ; preds = %200
%204 = load float, float* %38
%205 = load float, float* %23
%206 = fsub float %204, %205
%207 = fcmp olt float %206, 0.000000e+00
br label %208
208: ; preds = %203, %200, %193
%209 = phi i1 [ true, %200 ], [ true, %193 ], [ %207, %203 ]
br i1 %209, label %210, label %338
210: ; preds = %208
%211 = load float, float* %23
store float %211, float* %38
store float 0.000000e+00, float* %23
store i32 0, i32* %13
br label %212
212: ; preds = %334, %210
%213 = load i32, i32* %13
%214 = load i32, i32* %15
%215 = icmp slt i32 %213, %214
br i1 %215, label %216, label %337
216: ; preds = %212
%217 = load double*, double** %24
%218 = load i32, i32* %13
%219 = sext i32 %218 to i64
%220 = getelementptr inbounds double, double* %217, i64 %219
%221 = load double, double* %220
%222 = fptosi double %221 to i32
store i32 %222, i32* %11
%223 = load double*, double** %24
%224 = load i32, i32* %13
%225 = add nsw i32 %224, 1
%226 = sext i32 %225 to i64
%227 = getelementptr inbounds double, double* %223, i64 %226
%228 = load double, double* %227
%229 = fptosi double %228 to i32
store i32 %229, i32* %10
%230 = load double*, double** %24
%231 = load i32, i32* %13
%232 = add nsw i32 %231, 2
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds double, double* %230, i64 %233
%235 = load double, double* %234
%236 = fptosi double %235 to i32
store i32 %236, i32* %14
%237 = load i32, i32* %11
%238 = load i32, i32* %10
%239 = load i32, i32* %14
%240 = load i32, i32* %18
%241 = load double*, double** %36
%242 = load double*, double** %37
%243 = load double*, double** %24
%244 = call float @computeEui(i32 %237, i32 %238, i32 %239, i32 %240, double* %241, double* %242, double* %243)
store float %244, float* %22
store double 0.000000e+00, double* %39
store double 0.000000e+00, double* %40
store i32 0, i32* %12
br label %245
245: ; preds = %314, %216
%246 = load i32, i32* %12
%247 = load i32, i32* %18
%248 = icmp slt i32 %246, %247
br i1 %248, label %249, label %317
249: ; preds = %245
%250 = load double*, double** %36
%251 = load i32, i32* %10
%252 = load i32, i32* %18
%253 = mul nsw i32 %251, %252
%254 = load i32, i32* %12
%255 = add nsw i32 %253, %254
%256 = sext i32 %255 to i64
%257 = getelementptr inbounds double, double* %250, i64 %256
%258 = load double, double* %257
store double %258, double* %41
%259 = load double*, double** %37
%260 = load i32, i32* %11
%261 = load i32, i32* %18
%262 = mul nsw i32 %260, %261
%263 = load i32, i32* %12
%264 = add nsw i32 %262, %263
%265 = sext i32 %264 to i64
%266 = getelementptr inbounds double, double* %259, i64 %265
%267 = load double, double* %266
store double %267, double* %42
%268 = load double, double* %41
%269 = load double, double* %41
%270 = load double, double* %39
%271 = call double @llvm.fmuladd.f64(double %268, double %269, double %270)
store double %271, double* %39
%272 = load double, double* %42
%273 = load double, double* %42
%274 = load double, double* %40
%275 = call double @llvm.fmuladd.f64(double %272, double %273, double %274)
store double %275, double* %40
%276 = load double, double* %20
%277 = load float, float* %22
%278 = fpext float %277 to double
%279 = load double, double* %42
%280 = load double, double* %19
%281 = load double, double* %41
%282 = fmul double %280, %281
%283 = fneg double %282
%284 = call double @llvm.fmuladd.f64(double %278, double %279, double %283)
%285 = load double*, double** %36
%286 = load i32, i32* %10
%287 = load i32, i32* %18
%288 = mul nsw i32 %286, %287
%289 = load i32, i32* %12
%290 = add nsw i32 %288, %289
%291 = sext i32 %290 to i64
%292 = getelementptr inbounds double, double* %285, i64 %291
%293 = load double, double* %292
%294 = call double @llvm.fmuladd.f64(double %276, double %284, double %293)
store double %294, double* %292
%295 = load double, double* %20
%296 = load float, float* %22
%297 = fpext float %296 to double
%298 = load double, double* %41
%299 = load double, double* %19
%300 = load double, double* %42
%301 = fmul double %299, %300
%302 = fneg double %301
%303 = call double @llvm.fmuladd.f64(double %297, double %298, double %302)
%304 = load double*, double** %37
%305 = load i32, i32* %11
%306 = load i32, i32* %18
%307 = mul nsw i32 %305, %306
%308 = load i32, i32* %12
%309 = add nsw i32 %307, %308
%310 = sext i32 %309 to i64
%311 = getelementptr inbounds double, double* %304, i64 %310
%312 = load double, double* %311
%313 = call double @llvm.fmuladd.f64(double %295, double %303, double %312)
store double %313, double* %311
br label %314
314: ; preds = %249
%315 = load i32, i32* %12
%316 = add nsw i32 %315, 1
store i32 %316, i32* %12
br label %245
317: ; preds = %245
%318 = load float, float* %22
%319 = load float, float* %22
%320 = fmul float %318, %319
store float %320, float* %22
%321 = load double, double* %19
%322 = load double, double* %39
%323 = load double, double* %40
%324 = fadd double %322, %323
%325 = fmul double %321, %324
store double %325, double* %43
%326 = load float, float* %22
%327 = fpext float %326 to double
%328 = load double, double* %43
%329 = fadd double %327, %328
%330 = load float, float* %23
%331 = fpext float %330 to double
%332 = fadd double %331, %329
%333 = fptrunc double %332 to float
store float %333, float* %23
br label %334
334: ; preds = %317
%335 = load i32, i32* %13
%336 = add nsw i32 %335, 3
store i32 %336, i32* %13
br label %212
337: ; preds = %212
br label %193
338: ; preds = %208
%339 = call i32 @get_walltime(double* %9)
%340 = load i32*, i32** %26
%341 = load float, float* %22
%342 = call i32 @fprintf(i32* %340, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), float %341)
%343 = load i32*, i32** %26
%344 = load float, float* %22
%345 = call i32 @fprintf(i32* %343, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), float %344)
%346 = load i32*, i32** %26
%347 = load float, float* %22
%348 = call i32 @fprintf(i32* %346, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), float %347)
%349 = load i32*, i32** %26
%350 = load float, float* %22
%351 = call i32 @fprintf(i32* %349, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), float %350)
%352 = load i32*, i32** %26
%353 = load float, float* %22
%354 = call i32 @fprintf(i32* %352, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), float %353)
%355 = load double, double* %9
%356 = load double, double* %8
%357 = fsub double %355, %356
store double %357, double* %44
%358 = load double, double* %44
%359 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), double %358)
%360 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%361 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%362 = load i32*, i32** %25
%363 = call i32 @fclose(i32* %362)
%364 = load i32*, i32** %26
%365 = call i32 @fclose(i32* %364)
br label %366
366: ; preds = %338, %76, %66
%367 = load i32, i32* %3
ret i32 %367
}

LLVM IR (-O2):
@.str = [21 x i8] c"not enough arguments\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [35 x i8] c"user: 427501 movie: 8 rating: %f\0A\00"
@.str.5 = [35 x i8] c"user: 260749 movie: 18 rating: %f\0A\00"
@.str.6 = [35 x i8] c"user: 311872 movie: 28 rating: %f\0A\00"
@.str.7 = [35 x i8] c"user: 73318 movie: 30 rating: %f\0A\00"
@.str.8 = [35 x i8] c"user: 182071 movie: 30 rating: %f\0A\00"
@.str.9 = [17 x i8] c"elapsed time: %f\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = tail call double* @createMatrix(i32 297216336)
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %11, %2
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%17 = tail call i32 @exit(i32 0)
unreachable
18: ; preds = %11
%19 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = tail call i32 @fclose(i32* null)
br label %283
23: ; preds = %18
%24 = load i8*, i8** %8
%25 = tail call i32* @fopen(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i32* %25, null
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = tail call i32 @fclose(i32* %19)
%29 = tail call i32 @fclose(i32* null)
br label %283
30: ; preds = %23
%31 = tail call i64 @malloc(i32 30)
%32 = inttoptr i64 %31 to i8*
%33 = tail call i32 @assert(i8* %32)
%34 = tail call i32* @fgets(i8* %32, i32 30, i32* %19)
%35 = icmp eq i32* %34, null
br i1 %35, label %65, label %36
36: ; preds = %30, %36
%37 = phi i64 [ %62, %36 ], [ 0, %30 ]
%38 = phi i32 [ %53, %36 ], [ 0, %30 ]
%39 = phi i32 [ %52, %36 ], [ 0, %30 ]
%40 = tail call i8* @strtok(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%41 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%42 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%43 = tail call i32 @strtod(i8* nocapture %40, i32* null)
%44 = tail call i32 @strtod(i8* nocapture %41, i32* null)
%45 = tail call i32 @strtod(i8* nocapture %42, i32* null)
%46 = icmp sgt i32 %43, %38
%47 = icmp sgt i32 %44, %39
%48 = select i1 %46, i1 %47, i1 false
%49 = select i1 %46, i32 %43, i32 %38
%50 = select i1 %47, i32 %38, i32 %49
%51 = select i1 %48, i1 true, i1 %47
%52 = select i1 %51, i32 %44, i32 %39
%53 = select i1 %48, i32 %43, i32 %50
%54 = sitofp i32 %43 to double
%55 = getelementptr inbounds double, double* %7, i64 %37
store double %54, double* %55
%56 = sitofp i32 %44 to double
%57 = add nuw nsw i64 %37, 1
%58 = getelementptr inbounds double, double* %7, i64 %57
store double %56, double* %58
%59 = sitofp i32 %45 to double
%60 = add nuw nsw i64 %37, 2
%61 = getelementptr inbounds double, double* %7, i64 %60
store double %59, double* %61
%62 = add nuw i64 %37, 3
%63 = tail call i32* @fgets(i8* %32, i32 30, i32* %19)
%64 = icmp eq i32* %63, null
br i1 %64, label %65, label %36
65: ; preds = %36, %30
%66 = phi i32 [ 0, %30 ], [ %52, %36 ]
%67 = phi i32 [ 0, %30 ], [ %53, %36 ]
%68 = tail call i32 @free(i8* %32)
%69 = shl nsw i32 %66, 5
%70 = tail call double* @createMatrix(i32 %69)
%71 = icmp sgt i32 %66, 0
br i1 %71, label %72, label %135
72: ; preds = %65
%73 = call i32 @llvm.smax.i32(i32 %69, i32 1)
%74 = zext i32 %73 to i64
%75 = icmp ult i32 %73, 4
br i1 %75, label %128, label %76
76: ; preds = %72
%77 = and i64 %74, 2147483616
%78 = add nsw i64 %77, -4
%79 = lshr exact i64 %78, 2
br label %80
80: ; preds = %80, %76
%81 = phi i64 [ 0, %76 ], [ %122, %80 ]
%82 = phi i64 [ 0, %76 ], [ %123, %80 ]
%83 = getelementptr inbounds double, double* %70, i64 %81
%84 = bitcast double* %83 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %84
%85 = getelementptr inbounds double, double* %83, i64 2
%86 = bitcast double* %85 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %86
%87 = or i64 %81, 4
%88 = getelementptr inbounds double, double* %70, i64 %87
%89 = bitcast double* %88 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %89
%90 = getelementptr inbounds double, double* %88, i64 2
%91 = bitcast double* %90 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %91
%92 = or i64 %81, 8
%93 = getelementptr inbounds double, double* %70, i64 %92
%94 = bitcast double* %93 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %94
%95 = getelementptr inbounds double, double* %93, i64 2
%96 = bitcast double* %95 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %96
%97 = or i64 %81, 12
%98 = getelementptr inbounds double, double* %70, i64 %97
%99 = bitcast double* %98 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %99
%100 = getelementptr inbounds double, double* %98, i64 2
%101 = bitcast double* %100 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %101
%102 = or i64 %81, 16
%103 = getelementptr inbounds double, double* %70, i64 %102
%104 = bitcast double* %103 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %104
%105 = getelementptr inbounds double, double* %103, i64 2
%106 = bitcast double* %105 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %106
%107 = or i64 %81, 20
%108 = getelementptr inbounds double, double* %70, i64 %107
%109 = bitcast double* %108 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %109
%110 = getelementptr inbounds double, double* %108, i64 2
%111 = bitcast double* %110 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %111
%112 = or i64 %81, 24
%113 = getelementptr inbounds double, double* %70, i64 %112
%114 = bitcast double* %113 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %114
%115 = getelementptr inbounds double, double* %113, i64 2
%116 = bitcast double* %115 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %116
%117 = or i64 %81, 28
%118 = getelementptr inbounds double, double* %70, i64 %117
%119 = bitcast double* %118 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %119
%120 = getelementptr inbounds double, double* %118, i64 2
%121 = bitcast double* %120 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %121
%122 = add nuw i64 %81, 32
%123 = add i64 %82, 8
%124 = or i64 %82, 7
%125 = icmp eq i64 %124, %79
br i1 %125, label %126, label %80
126: ; preds = %80
%127 = icmp eq i64 %77, %74
br i1 %127, label %135, label %128
128: ; preds = %72, %126
%129 = phi i64 [ 0, %72 ], [ %77, %126 ]
br label %130
130: ; preds = %128, %130
%131 = phi i64 [ %133, %130 ], [ %129, %128 ]
%132 = getelementptr inbounds double, double* %70, i64 %131
store double 1.000000e+00, double* %132
%133 = add nuw nsw i64 %131, 1
%134 = icmp eq i64 %133, %74
br i1 %134, label %135, label %130
135: ; preds = %130, %126, %65
%136 = shl nsw i32 %67, 5
%137 = tail call double* @createMatrix(i32 %136)
%138 = icmp sgt i32 %67, 0
br i1 %138, label %139, label %202
139: ; preds = %135
%140 = call i32 @llvm.smax.i32(i32 %136, i32 1)
%141 = zext i32 %140 to i64
%142 = icmp ult i32 %140, 4
br i1 %142, label %195, label %143
143: ; preds = %139
%144 = and i64 %141, 2147483616
%145 = add nsw i64 %144, -4
%146 = lshr exact i64 %145, 2
br label %147
147: ; preds = %147, %143
%148 = phi i64 [ 0, %143 ], [ %189, %147 ]
%149 = phi i64 [ 0, %143 ], [ %190, %147 ]
%150 = getelementptr inbounds double, double* %137, i64 %148
%151 = bitcast double* %150 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %151
%152 = getelementptr inbounds double, double* %150, i64 2
%153 = bitcast double* %152 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %153
%154 = or i64 %148, 4
%155 = getelementptr inbounds double, double* %137, i64 %154
%156 = bitcast double* %155 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %156
%157 = getelementptr inbounds double, double* %155, i64 2
%158 = bitcast double* %157 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %158
%159 = or i64 %148, 8
%160 = getelementptr inbounds double, double* %137, i64 %159
%161 = bitcast double* %160 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %161
%162 = getelementptr inbounds double, double* %160, i64 2
%163 = bitcast double* %162 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %163
%164 = or i64 %148, 12
%165 = getelementptr inbounds double, double* %137, i64 %164
%166 = bitcast double* %165 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %166
%167 = getelementptr inbounds double, double* %165, i64 2
%168 = bitcast double* %167 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %168
%169 = or i64 %148, 16
%170 = getelementptr inbounds double, double* %137, i64 %169
%171 = bitcast double* %170 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %171
%172 = getelementptr inbounds double, double* %170, i64 2
%173 = bitcast double* %172 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %173
%174 = or i64 %148, 20
%175 = getelementptr inbounds double, double* %137, i64 %174
%176 = bitcast double* %175 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %176
%177 = getelementptr inbounds double, double* %175, i64 2
%178 = bitcast double* %177 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %178
%179 = or i64 %148, 24
%180 = getelementptr inbounds double, double* %137, i64 %179
%181 = bitcast double* %180 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %181
%182 = getelementptr inbounds double, double* %180, i64 2
%183 = bitcast double* %182 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %183
%184 = or i64 %148, 28
%185 = getelementptr inbounds double, double* %137, i64 %184
%186 = bitcast double* %185 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %186
%187 = getelementptr inbounds double, double* %185, i64 2
%188 = bitcast double* %187 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, <2 x double>* %188
%189 = add nuw i64 %148, 32
%190 = add i64 %149, 8
%191 = or i64 %149, 7
%192 = icmp eq i64 %191, %146
br i1 %192, label %193, label %147
193: ; preds = %147
%194 = icmp eq i64 %144, %141
br i1 %194, label %202, label %195
195: ; preds = %139, %193
%196 = phi i64 [ 0, %139 ], [ %144, %193 ]
br label %197
197: ; preds = %195, %197
%198 = phi i64 [ %200, %197 ], [ %196, %195 ]
%199 = getelementptr inbounds double, double* %137, i64 %198
store double 1.000000e+00, double* %199
%200 = add nuw nsw i64 %198, 1
%201 = icmp eq i64 %200, %141
br i1 %201, label %202, label %197
202: ; preds = %197, %193, %135
%203 = call i32 @get_walltime(double* %3)
br label %212
204: ; preds = %255
%205 = fsub float %213, %265
%206 = fpext float %205 to double
%207 = fcmp ogt double %206, 1.000000e-03
%208 = fcmp oeq float %213, 0.000000e+00
%209 = select i1 %207, i1 true, i1 %208
%210 = fcmp olt float %205, 0.000000e+00
%211 = select i1 %209, i1 true, i1 %210
br i1 %211, label %212, label %268
212: ; preds = %202, %204
%213 = phi float [ 0.000000e+00, %202 ], [ %265, %204 ]
br label %214
214: ; preds = %212, %255
%215 = phi i64 [ 0, %212 ], [ %266, %255 ]
%216 = phi float [ 0.000000e+00, %212 ], [ %265, %255 ]
%217 = getelementptr inbounds double, double* %7, i64 %215
%218 = load double, double* %217
%219 = fptosi double %218 to i32
%220 = add nuw nsw i64 %215, 1
%221 = getelementptr inbounds double, double* %7, i64 %220
%222 = load double, double* %221
%223 = fptosi double %222 to i32
%224 = add nuw nsw i64 %215, 2
%225 = getelementptr inbounds double, double* %7, i64 %224
%226 = load double, double* %225
%227 = fptosi double %226 to i32
%228 = call float @computeEui(i32 %219, i32 %223, i32 %227, i32 32, double* %70, double* %137, double* %7)
%229 = shl nsw i32 %223, 5
%230 = shl nsw i32 %219, 5
%231 = fpext float %228 to double
%232 = sext i32 %229 to i64
%233 = sext i32 %230 to i64
br label %234
234: ; preds = %214, %234
%235 = phi i64 [ 0, %214 ], [ %253, %234 ]
%236 = phi <2 x double> [ zeroinitializer, %214 ], [ %245, %234 ]
%237 = add nuw nsw i64 %235, %232
%238 = getelementptr inbounds double, double* %70, i64 %237
%239 = load double, double* %238
%240 = add nuw nsw i64 %235, %233
%241 = getelementptr inbounds double, double* %137, i64 %240
%242 = load double, double* %241
%243 = insertelement <2 x double> poison, double %242, i64 0
%244 = insertelement <2 x double> %243, double %239, i64 1
%245 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %244, <2 x double> %244, <2 x double> %236)
%246 = fmul double %239, -5.000000e-03
%247 = call double @llvm.fmuladd.f64(double %231, double %242, double %246)
%248 = call double @llvm.fmuladd.f64(double %247, double 1.250000e-03, double %239)
store double %248, double* %238
%249 = fmul double %242, -5.000000e-03
%250 = call double @llvm.fmuladd.f64(double %231, double %239, double %249)
%251 = load double, double* %241
%252 = call double @llvm.fmuladd.f64(double %250, double 1.250000e-03, double %251)
store double %252, double* %241
%253 = add nuw nsw i64 %235, 1
%254 = icmp eq i64 %253, 32
br i1 %254, label %255, label %234
255: ; preds = %234
%256 = fmul float %228, %228
%257 = shufflevector <2 x double> %245, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%258 = fadd <2 x double> %257, %245
%259 = extractelement <2 x double> %258, i64 0
%260 = fmul double %259, 5.000000e-03
%261 = fpext float %256 to double
%262 = fadd double %260, %261
%263 = fpext float %216 to double
%264 = fadd double %262, %263
%265 = fptrunc double %264 to float
%266 = add nuw nsw i64 %215, 3
%267 = icmp ult i64 %215, 297216333
br i1 %267, label %214, label %204
268: ; preds = %204
%269 = call i32 @get_walltime(double* %4)
%270 = call i32 @fprintf(i32* %25, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), float %256)
%271 = call i32 @fprintf(i32* %25, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), float %256)
%272 = call i32 @fprintf(i32* %25, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), float %256)
%273 = call i32 @fprintf(i32* %25, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), float %256)
%274 = call i32 @fprintf(i32* %25, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0), float %256)
%275 = load double, double* %4
%276 = load double, double* %3
%277 = fsub double %275, %276
%278 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), double %277)
%279 = call i32 @putchar(i32 10)
%280 = call i32 @putchar(i32 10)
%281 = call i32 @fclose(i32* %19)
%282 = call i32 @fclose(i32* %25)
br label %283
283: ; preds = %27, %268, %21
ret i32 0
}