#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*/ EXIT_FAILURE;
int atoi(char *);
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 *, ...);
int /*<<< orphan*/ fwrite(double *, int, int, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ read_mu_sigma(int, int, int /*<<< orphan*/ *, double **,
                                 double **);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
char *strtok(char *, char *);
int main(int argc, char *argv[]) {
  if (argc != 4) {
    fprintf(stderr, "Usage: $ %s (UBM file) (GMM list) (outfile)\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  FILE *fp_ubm, *fp_list, *fp_gmm, *fp_w;
  int i, k, l;
  char inbuf[10000];
  int dim, mixture;
  memset(inbuf, 0, 10000);
  if ((fp_list = fopen(argv[2], "r")) == NULL) {
    fprintf(stderr, "File open error!\n");
    exit(EXIT_FAILURE);
  }
  fgets(inbuf, 10000, fp_list);
  if ((fp_gmm = fopen(strtok(inbuf, "\n"), "r")) == NULL) {
    fprintf(stderr, "File open error!\n");
    exit(EXIT_FAILURE);
  }
  for (i = 0; i < 3; i++)
    fgets(inbuf, 10000, fp_gmm);
  strtok(inbuf, " ");
  dim = atoi(strtok(NULL, " "));
  for (i = 0; i < 5; i++)
    fgets(inbuf, 10000, fp_gmm);
  strtok(inbuf, " \n");
  mixture = atoi(strtok(NULL, " \n"));
  rewind(fp_list);
  double **mu_ubm, **sigma_ubm, **mu_gmm, **sigma_gmm;
  mu_ubm = (double **)malloc(sizeof(double *) * mixture);
  sigma_ubm = (double **)malloc(sizeof(double *) * mixture);
  mu_ubm[0] = (double *)malloc(sizeof(double) * mixture * dim);
  sigma_ubm[0] = (double *)malloc(sizeof(double) * mixture * dim);
  mu_gmm = (double **)malloc(sizeof(double *) * mixture);
  sigma_gmm = (double **)malloc(sizeof(double *) * mixture);
  mu_gmm[0] = (double *)malloc(sizeof(double) * mixture * dim);
  sigma_gmm[0] = (double *)malloc(sizeof(double) * mixture * dim);
  for (k = 1; k < mixture; k++) {
    mu_ubm[k] = mu_ubm[0] + k * dim;
    sigma_ubm[k] = sigma_ubm[0] + k * dim;
    mu_gmm[k] = mu_gmm[0] + k * dim;
    sigma_gmm[k] = sigma_gmm[0] + k * dim;
  }
  if (mu_gmm == NULL || sigma_gmm == NULL || mu_gmm[0] == NULL ||
      sigma_gmm[0] == NULL) {
    fprintf(stderr, "Error: Memory allocation for mu / sigma failed\n");
    exit(EXIT_FAILURE);
  }
  if ((fp_ubm = fopen(argv[1], "r")) == NULL) {
    fprintf(stderr, "%s: File open error!\n", argv[1]);
    exit(EXIT_FAILURE);
  }
  if ((fp_w = fopen(argv[3], "wb")) == NULL) {
    fprintf(stderr, "%s: File open error!\n", argv[3]);
    exit(EXIT_FAILURE);
  }
  read_mu_sigma(dim, mixture, fp_ubm, mu_ubm, sigma_ubm);
  fclose(fp_ubm);
  while (fgets(inbuf, 10000, fp_list) != NULL) {
    fp_gmm = fopen(strtok(inbuf, "\n"), "r");
    read_mu_sigma(dim, mixture, fp_gmm, mu_gmm, sigma_gmm);
    fclose(fp_gmm);
    for (k = 0; k < mixture; k++) {
      for (l = 0; l < dim; l++)
        mu_gmm[k][l] -= mu_ubm[k][l];
      fwrite(mu_gmm[k], sizeof(double), dim, fp_w);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2780,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     120f <main+0x4f>
mov    0x2df6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe06(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2dd0(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
lea    -0x2750(%rbp),%rdi
xor    %esi,%esi
mov    $0x2710,%edx
call   1060 <memset@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdfc(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1269 <main+0xa9>
mov    0x2d95(%rip),%rax
mov    (%rax),%edi
lea    0xe14(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2d76(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
lea    -0x2750(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x2710,%esi
call   1070 <fgets@plt>
lea    -0x2750(%rbp),%rdi
lea    0xda6(%rip),%rsi
call   10b0 <strtok@plt>
mov    %rax,%rdi
lea    0xd92(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    12d3 <main+0x113>
mov    0x2d2b(%rip),%rax
mov    (%rax),%edi
lea    0xdaa(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2d0c(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    1307 <main+0x147>
lea    -0x2750(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0x2710,%esi
call   1070 <fgets@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12da <main+0x11a>
lea    -0x2750(%rbp),%rdi
lea    0xd1a(%rip),%rsi
call   10b0 <strtok@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xd0a(%rip),%rsi
call   10b0 <strtok@plt>
mov    %rax,%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x2754(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x5,-0x34(%rbp)
jge    136c <main+0x1ac>
lea    -0x2750(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0x2710,%esi
call   1070 <fgets@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    133f <main+0x17f>
lea    -0x2750(%rbp),%rdi
lea    0xcb7(%rip),%rsi
call   10b0 <strtok@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xca7(%rip),%rsi
call   10b0 <strtok@plt>
mov    %rax,%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x2758(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <rewind@plt>
movslq -0x2758(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x2760(%rbp)
movslq -0x2758(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x2768(%rbp)
movslq -0x2758(%rbp),%rax
shl    $0x3,%rax
movslq -0x2754(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%rcx
mov    -0x2760(%rbp),%rax
mov    %rcx,(%rax)
movslq -0x2758(%rbp),%rax
shl    $0x3,%rax
movslq -0x2754(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%rcx
mov    -0x2768(%rbp),%rax
mov    %rcx,(%rax)
movslq -0x2758(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x2770(%rbp)
movslq -0x2758(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x2778(%rbp)
movslq -0x2758(%rbp),%rax
shl    $0x3,%rax
movslq -0x2754(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%rcx
mov    -0x2770(%rbp),%rax
mov    %rcx,(%rax)
movslq -0x2758(%rbp),%rax
shl    $0x3,%rax
movslq -0x2754(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%rcx
mov    -0x2778(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x2758(%rbp),%eax
jge    1586 <main+0x3c6>
mov    -0x2760(%rbp),%rax
mov    (%rax),%rdx
mov    -0x38(%rbp),%eax
imul   -0x2754(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x2760(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x2768(%rbp),%rax
mov    (%rax),%rdx
mov    -0x38(%rbp),%eax
imul   -0x2754(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x2768(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x2770(%rbp),%rax
mov    (%rax),%rdx
mov    -0x38(%rbp),%eax
imul   -0x2754(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x2770(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x2778(%rbp),%rax
mov    (%rax),%rdx
mov    -0x38(%rbp),%eax
imul   -0x2754(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x2778(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    14b9 <main+0x2f9>
cmpq   $0x0,-0x2770(%rbp)
je     15c4 <main+0x404>
cmpq   $0x0,-0x2778(%rbp)
je     15c4 <main+0x404>
mov    -0x2770(%rbp),%rax
cmpq   $0x0,(%rax)
je     15c4 <main+0x404>
mov    -0x2778(%rbp),%rax
cmpq   $0x0,(%rax)
jne    15e9 <main+0x429>
mov    0x2a15(%rip),%rax
mov    (%rax),%edi
lea    0xa60(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x29f6(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xa35(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1638 <main+0x478>
mov    0x29ce(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xa41(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x29a7(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xa33(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    1687 <main+0x4c7>
mov    0x297f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
lea    0x9f2(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2958(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
mov    -0x2754(%rbp),%edi
mov    -0x2758(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x2760(%rbp),%rcx
mov    -0x2768(%rbp),%r8
call   1030 <read_mu_sigma@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
lea    -0x2750(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x2710,%esi
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     17cd <main+0x60d>
lea    -0x2750(%rbp),%rdi
lea    0x952(%rip),%rsi
call   10b0 <strtok@plt>
mov    %rax,%rdi
lea    0x93e(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x2754(%rbp),%edi
mov    -0x2758(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    -0x2770(%rbp),%rcx
mov    -0x2778(%rbp),%r8
call   1030 <read_mu_sigma@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x2758(%rbp),%eax
jge    17c8 <main+0x608>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x2754(%rbp),%eax
jge    1797 <main+0x5d7>
mov    -0x2760(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x2770(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1741 <main+0x581>
mov    -0x2770(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x2754(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    $0x8,%esi
call   10e0 <fwrite@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    172b <main+0x56b>
jmp    16b3 <main+0x4f3>
xor    %eax,%eax
add    $0x2780,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2768,%rsp
mov    %rsi,%rbx
cmp    $0x4,%edi
jne    1756 <main+0x596>
lea    0x50(%rsp),%rdi
xor    %esi,%esi
mov    $0x2710,%edx
call   1060 <memset@plt>
mov    %rbx,0x8(%rsp)
mov    0x10(%rbx),%rdi
lea    0xe2f(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1744 <main+0x584>
mov    %rax,%r15
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2710,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
lea    0xe07(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <strtok@plt>
lea    0xdf3(%rip),%rsi
mov    %rax,%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1744 <main+0x584>
mov    %rax,%rbx
lea    0x50(%rsp),%r14
mov    %r14,%rdi
mov    $0x2710,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
mov    %r14,%rdi
mov    $0x2710,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
mov    %r14,%rdi
mov    $0x2710,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
lea    0xda5(%rip),%rbp
mov    %r14,%rdi
mov    %rbp,%rsi
call   10b0 <strtok@plt>
xor    %edi,%edi
mov    %rbp,%rsi
call   10b0 <strtok@plt>
mov    %rax,%rdi
call   10c0 <atoi@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    $0x2710,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
mov    %r14,%rdi
mov    $0x2710,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
mov    %r14,%rdi
mov    $0x2710,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
mov    %r14,%rdi
mov    $0x2710,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
mov    %r14,%rdi
mov    $0x2710,%esi
mov    %rbx,%rdx
call   1070 <fgets@plt>
lea    0xd31(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   10b0 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   10b0 <strtok@plt>
mov    %rax,%rdi
call   10c0 <atoi@plt>
mov    %eax,%ebx
mov    %r15,0x18(%rsp)
mov    %r15,%rdi
call   1050 <rewind@plt>
lea    0x0(,%rbx,8),%r15d
mov    %r15d,%edi
call   1090 <malloc@plt>
mov    %rax,%r13
mov    %r15d,%edi
call   1090 <malloc@plt>
mov    %rax,%r12
mov    %r15d,%r14d
imul   %ebp,%r14d
mov    %r14d,%edi
call   1090 <malloc@plt>
mov    %rax,0x0(%r13)
mov    %r14d,%edi
call   1090 <malloc@plt>
mov    %rax,(%r12)
mov    %r15d,%edi
call   1090 <malloc@plt>
mov    %r15d,%edi
mov    %rax,%r15
call   1090 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    %r14d,%edi
call   1090 <malloc@plt>
mov    %rax,(%r15)
mov    %r14d,%edi
mov    0x20(%rsp),%r14
call   1090 <malloc@plt>
mov    %rax,(%r14)
mov    %ebx,%ecx
mov    %rcx,0x28(%rsp)
mov    %rbx,0x10(%rsp)
cmp    $0x1,%ebx
jle    140b <main+0x24b>
movslq %ebp,%rcx
shl    $0x3,%rcx
mov    0x28(%rsp),%rax
lea    -0x8(,%rax,8),%rdx
ff
xor    %esi,%esi
mov    %rcx,%rdi
cs nopw 0x0(%rax,%rax,1)
mov    0x0(%r13),%rax
add    %rdi,%rax
mov    %rax,0x8(%r13,%rsi,1)
mov    (%r12),%rax
add    %rdi,%rax
mov    %rax,0x8(%r12,%rsi,1)
mov    (%r15),%rax
add    %rdi,%rax
mov    %rax,0x8(%r15,%rsi,1)
mov    (%r14),%rax
lea    (%rax,%rdi,1),%rbx
mov    %rbx,0x8(%r14,%rsi,1)
add    %rcx,%rdi
add    $0x8,%rsi
cmp    %rsi,%rdx
jne    13d0 <main+0x210>
cmpq   $0x0,(%r15)
je     176b <main+0x5ab>
test   %rax,%rax
je     176b <main+0x5ab>
mov    0x8(%rsp),%rbx
mov    0x8(%rbx),%rdi
lea    0xbff(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,(%rsp)
test   %rax,%rax
je     1784 <main+0x5c4>
mov    %r15,%r14
mov    0x18(%rbx),%rdi
lea    0xc2c(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,0x48(%rsp)
test   %rax,%rax
je     1793 <main+0x5d3>
mov    %ebp,%edi
mov    0x10(%rsp),%rsi
mov    (%rsp),%rbx
mov    %rbx,%rdx
mov    %r13,%rcx
mov    %r12,%r8
call   1030 <read_mu_sigma@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0x50(%rsp),%rdi
mov    $0x2710,%esi
mov    0x18(%rsp),%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1730 <main+0x570>
mov    %ebp,%r12d
mov    %r12d,%eax
and    $0xfffffffc,%eax
mov    %rax,0x8(%rsp)
add    $0xfffffffffffffffc,%rax
mov    %rax,(%rsp)
mov    %rax,%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
mov    %rcx,%rax
mov    %rcx,0x40(%rsp)
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0x38(%rsp)
mov    %r12d,%r15d
and    $0x3,%r15d
lea    0x50(%rsp),%rbx
mov    %r13,0x30(%rsp)
jmp    1510 <main+0x350>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2710,%esi
mov    0x18(%rsp),%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1730 <main+0x570>
mov    %rbx,%rdi
lea    0xb18(%rip),%rsi
call   10b0 <strtok@plt>
mov    %rax,%rdi
lea    0xb04(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    0x10(%rsp),%r13
mov    %r13d,%esi
mov    %rax,%rdx
mov    %r14,%rcx
mov    0x20(%rsp),%r8
call   1030 <read_mu_sigma@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
test   %r13d,%r13d
mov    0x30(%rsp),%r13
jle    14f0 <main+0x330>
xor    %ebx,%ebx
jmp    1594 <main+0x3d4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
mov    $0x8,%esi
mov    %ebp,%edx
mov    0x48(%rsp),%rcx
call   10e0 <fwrite@plt>
add    $0x1,%rbx
cmp    0x28(%rsp),%rbx
je     14f0 <main+0x330>
test   %ebp,%ebp
jle    1570 <main+0x3b0>
mov    0x0(%r13,%rbx,8),%rax
mov    (%r14,%rbx,8),%rdi
cmp    $0x4,%ebp
jb     15c0 <main+0x400>
lea    (%rax,%r12,8),%rcx
cmp    %rcx,%rdi
jae    1663 <main+0x4a3>
lea    (%rdi,%r12,8),%rcx
cmp    %rcx,%rax
jae    1663 <main+0x4a3>
xor    %ecx,%ecx
mov    %rcx,%rdx
not    %rdx
add    %r12,%rdx
test   %r15,%r15
je     15f9 <main+0x439>
mov    %r15,%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%rdi,%rcx,8),%xmm0
subsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rdi,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    15e0 <main+0x420>
cmp    $0x3,%rdx
jb     1574 <main+0x3b4>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%rdi,%rcx,8),%xmm0
subsd  (%rax,%rcx,8),%xmm0
movsd  0x8(%rdi,%rcx,8),%xmm1
movsd  %xmm0,(%rdi,%rcx,8)
subsd  0x8(%rax,%rcx,8),%xmm1
movsd  %xmm1,0x8(%rdi,%rcx,8)
movsd  0x10(%rdi,%rcx,8),%xmm0
subsd  0x10(%rax,%rcx,8),%xmm0
movsd  %xmm0,0x10(%rdi,%rcx,8)
movsd  0x18(%rdi,%rcx,8),%xmm0
subsd  0x18(%rax,%rcx,8),%xmm0
movsd  %xmm0,0x18(%rdi,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%r12
jne    1610 <main+0x450>
jmp    1574 <main+0x3b4>
cmpq   $0x0,(%rsp)
je     1725 <main+0x565>
mov    0x38(%rsp),%rdx
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movupd (%rax,%rcx,8),%xmm0
movupd 0x10(%rax,%rcx,8),%xmm1
movupd (%rdi,%rcx,8),%xmm2
subpd  %xmm0,%xmm2
movupd 0x10(%rdi,%rcx,8),%xmm0
subpd  %xmm1,%xmm0
movupd 0x20(%rdi,%rcx,8),%xmm1
movupd 0x30(%rdi,%rcx,8),%xmm3
movupd %xmm2,(%rdi,%rcx,8)
movupd %xmm0,0x10(%rdi,%rcx,8)
movupd 0x20(%rax,%rcx,8),%xmm0
subpd  %xmm0,%xmm1
movupd 0x30(%rax,%rcx,8),%xmm0
subpd  %xmm0,%xmm3
movupd %xmm1,0x20(%rdi,%rcx,8)
movupd %xmm3,0x30(%rdi,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rdx
jne    1680 <main+0x4c0>
testb  $0x1,0x40(%rsp)
je     170f <main+0x54f>
movupd (%rax,%rcx,8),%xmm0
movupd 0x10(%rax,%rcx,8),%xmm1
movupd (%rdi,%rcx,8),%xmm2
subpd  %xmm0,%xmm2
movupd 0x10(%rdi,%rcx,8),%xmm0
subpd  %xmm1,%xmm0
movupd %xmm2,(%rdi,%rcx,8)
movupd %xmm0,0x10(%rdi,%rcx,8)
mov    0x8(%rsp),%rdx
mov    %rdx,%rcx
cmp    %r12,%rdx
je     1574 <main+0x3b4>
jmp    15c2 <main+0x402>
xor    %ecx,%ecx
testb  $0x1,0x40(%rsp)
jne    16e6 <main+0x526>
jmp    170f <main+0x54f>
xor    %eax,%eax
add    $0x2768,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2895(%rip),%rax
mov    (%rax),%edi
lea    0x914(%rip),%rsi
jmp    177b <main+0x5bb>
mov    0x2883(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0x897(%rip),%rsi
jmp    17a7 <main+0x5e7>
mov    0x286e(%rip),%rax
mov    (%rax),%edi
lea    0x8b9(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    17ae <main+0x5ee>
mov    0x2855(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbx),%rdx
jmp    17a0 <main+0x5e0>
mov    0x2846(%rip),%rax
mov    (%rax),%edi
mov    0x18(%rbx),%rdx
lea    0x8bd(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x2823(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: $ %s (UBM file) (GMM list) (outfile)\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [18 x i8] c"File open error!\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [2 x i8] c" \00"
@.str.5 = [3 x i8] c" \0A\00"
@.str.6 = [48 x i8] c"Error: Memory allocation for mu / sigma failed\0A\00"
@.str.7 = [22 x i8] c"%s: File open error!\0A\00"
@.str.8 = [3 x i8] c"wb\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 i32*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [10000 x i8]
%14 = alloca i32
%15 = alloca i32
%16 = alloca double**
%17 = alloca double**
%18 = alloca double**
%19 = alloca double**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 4
br i1 %21, label %22, label %30
22: ; preds = %2
%23 = load i32, i32* @stderr
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %26)
%28 = load i32, i32* @EXIT_FAILURE
%29 = call i32 @exit(i32 %28)
unreachable
30: ; preds = %2
%31 = getelementptr inbounds [10000 x i8], [10000 x i8]* %13, i64 0, i64 0
%32 = call i32 @memset(i8* %31, i32 0, i32 10000)
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = call i32* @fopen(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %36, i32** %7
%37 = icmp eq i32* %36, null
br i1 %37, label %38, label %43
38: ; preds = %30
%39 = load i32, i32* @stderr
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%41 = load i32, i32* @EXIT_FAILURE
%42 = call i32 @exit(i32 %41)
unreachable
43: ; preds = %30
%44 = getelementptr inbounds [10000 x i8], [10000 x i8]* %13, i64 0, i64 0
%45 = load i32*, i32** %7
%46 = call i32* @fgets(i8* %44, i32 10000, i32* %45)
%47 = getelementptr inbounds [10000 x i8], [10000 x i8]* %13, i64 0, i64 0
%48 = call i8* @strtok(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%49 = call i32* @fopen(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %49, i32** %8
%50 = icmp eq i32* %49, null
br i1 %50, label %51, label %56
51: ; preds = %43
%52 = load i32, i32* @stderr
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%54 = load i32, i32* @EXIT_FAILURE
%55 = call i32 @exit(i32 %54)
unreachable
56: ; preds = %43
store i32 0, i32* %10
br label %57
57: ; preds = %64, %56
%58 = load i32, i32* %10
%59 = icmp slt i32 %58, 3
br i1 %59, label %60, label %67
60: ; preds = %57
%61 = getelementptr inbounds [10000 x i8], [10000 x i8]* %13, i64 0, i64 0
%62 = load i32*, i32** %8
%63 = call i32* @fgets(i8* %61, i32 10000, i32* %62)
br label %64
64: ; preds = %60
%65 = load i32, i32* %10
%66 = add nsw i32 %65, 1
store i32 %66, i32* %10
br label %57
67: ; preds = %57
%68 = getelementptr inbounds [10000 x i8], [10000 x i8]* %13, i64 0, i64 0
%69 = call i8* @strtok(i8* %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%70 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%71 = call i32 @atoi(i8* %70)
store i32 %71, i32* %14
store i32 0, i32* %10
br label %72
72: ; preds = %79, %67
%73 = load i32, i32* %10
%74 = icmp slt i32 %73, 5
br i1 %74, label %75, label %82
75: ; preds = %72
%76 = getelementptr inbounds [10000 x i8], [10000 x i8]* %13, i64 0, i64 0
%77 = load i32*, i32** %8
%78 = call i32* @fgets(i8* %76, i32 10000, i32* %77)
br label %79
79: ; preds = %75
%80 = load i32, i32* %10
%81 = add nsw i32 %80, 1
store i32 %81, i32* %10
br label %72
82: ; preds = %72
%83 = getelementptr inbounds [10000 x i8], [10000 x i8]* %13, i64 0, i64 0
%84 = call i8* @strtok(i8* %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%85 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%86 = call i32 @atoi(i8* %85)
store i32 %86, i32* %15
%87 = load i32*, i32** %7
%88 = call i32 @rewind(i32* %87)
%89 = load i32, i32* %15
%90 = sext i32 %89 to i64
%91 = mul i64 8, %90
%92 = trunc i64 %91 to i32
%93 = call i64 @malloc(i32 %92)
%94 = inttoptr i64 %93 to double**
store double** %94, double*** %16
%95 = load i32, i32* %15
%96 = sext i32 %95 to i64
%97 = mul i64 8, %96
%98 = trunc i64 %97 to i32
%99 = call i64 @malloc(i32 %98)
%100 = inttoptr i64 %99 to double**
store double** %100, double*** %17
%101 = load i32, i32* %15
%102 = sext i32 %101 to i64
%103 = mul i64 8, %102
%104 = load i32, i32* %14
%105 = sext i32 %104 to i64
%106 = mul i64 %103, %105
%107 = trunc i64 %106 to i32
%108 = call i64 @malloc(i32 %107)
%109 = inttoptr i64 %108 to double*
%110 = load double**, double*** %16
%111 = getelementptr inbounds double*, double** %110, i64 0
store double* %109, double** %111
%112 = load i32, i32* %15
%113 = sext i32 %112 to i64
%114 = mul i64 8, %113
%115 = load i32, i32* %14
%116 = sext i32 %115 to i64
%117 = mul i64 %114, %116
%118 = trunc i64 %117 to i32
%119 = call i64 @malloc(i32 %118)
%120 = inttoptr i64 %119 to double*
%121 = load double**, double*** %17
%122 = getelementptr inbounds double*, double** %121, i64 0
store double* %120, double** %122
%123 = load i32, i32* %15
%124 = sext i32 %123 to i64
%125 = mul i64 8, %124
%126 = trunc i64 %125 to i32
%127 = call i64 @malloc(i32 %126)
%128 = inttoptr i64 %127 to double**
store double** %128, double*** %18
%129 = load i32, i32* %15
%130 = sext i32 %129 to i64
%131 = mul i64 8, %130
%132 = trunc i64 %131 to i32
%133 = call i64 @malloc(i32 %132)
%134 = inttoptr i64 %133 to double**
store double** %134, double*** %19
%135 = load i32, i32* %15
%136 = sext i32 %135 to i64
%137 = mul i64 8, %136
%138 = load i32, i32* %14
%139 = sext i32 %138 to i64
%140 = mul i64 %137, %139
%141 = trunc i64 %140 to i32
%142 = call i64 @malloc(i32 %141)
%143 = inttoptr i64 %142 to double*
%144 = load double**, double*** %18
%145 = getelementptr inbounds double*, double** %144, i64 0
store double* %143, double** %145
%146 = load i32, i32* %15
%147 = sext i32 %146 to i64
%148 = mul i64 8, %147
%149 = load i32, i32* %14
%150 = sext i32 %149 to i64
%151 = mul i64 %148, %150
%152 = trunc i64 %151 to i32
%153 = call i64 @malloc(i32 %152)
%154 = inttoptr i64 %153 to double*
%155 = load double**, double*** %19
%156 = getelementptr inbounds double*, double** %155, i64 0
store double* %154, double** %156
store i32 1, i32* %11
br label %157
157: ; preds = %210, %82
%158 = load i32, i32* %11
%159 = load i32, i32* %15
%160 = icmp slt i32 %158, %159
br i1 %160, label %161, label %213
161: ; preds = %157
%162 = load double**, double*** %16
%163 = getelementptr inbounds double*, double** %162, i64 0
%164 = load double*, double** %163
%165 = load i32, i32* %11
%166 = load i32, i32* %14
%167 = mul nsw i32 %165, %166
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds double, double* %164, i64 %168
%170 = load double**, double*** %16
%171 = load i32, i32* %11
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds double*, double** %170, i64 %172
store double* %169, double** %173
%174 = load double**, double*** %17
%175 = getelementptr inbounds double*, double** %174, i64 0
%176 = load double*, double** %175
%177 = load i32, i32* %11
%178 = load i32, i32* %14
%179 = mul nsw i32 %177, %178
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds double, double* %176, i64 %180
%182 = load double**, double*** %17
%183 = load i32, i32* %11
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double*, double** %182, i64 %184
store double* %181, double** %185
%186 = load double**, double*** %18
%187 = getelementptr inbounds double*, double** %186, i64 0
%188 = load double*, double** %187
%189 = load i32, i32* %11
%190 = load i32, i32* %14
%191 = mul nsw i32 %189, %190
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds double, double* %188, i64 %192
%194 = load double**, double*** %18
%195 = load i32, i32* %11
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds double*, double** %194, i64 %196
store double* %193, double** %197
%198 = load double**, double*** %19
%199 = getelementptr inbounds double*, double** %198, i64 0
%200 = load double*, double** %199
%201 = load i32, i32* %11
%202 = load i32, i32* %14
%203 = mul nsw i32 %201, %202
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds double, double* %200, i64 %204
%206 = load double**, double*** %19
%207 = load i32, i32* %11
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds double*, double** %206, i64 %208
store double* %205, double** %209
br label %210
210: ; preds = %161
%211 = load i32, i32* %11
%212 = add nsw i32 %211, 1
store i32 %212, i32* %11
br label %157
213: ; preds = %157
%214 = load double**, double*** %18
%215 = icmp eq double** %214, null
br i1 %215, label %229, label %216
216: ; preds = %213
%217 = load double**, double*** %19
%218 = icmp eq double** %217, null
br i1 %218, label %229, label %219
219: ; preds = %216
%220 = load double**, double*** %18
%221 = getelementptr inbounds double*, double** %220, i64 0
%222 = load double*, double** %221
%223 = icmp eq double* %222, null
br i1 %223, label %229, label %224
224: ; preds = %219
%225 = load double**, double*** %19
%226 = getelementptr inbounds double*, double** %225, i64 0
%227 = load double*, double** %226
%228 = icmp eq double* %227, null
br i1 %228, label %229, label %234
229: ; preds = %224, %219, %216, %213
%230 = load i32, i32* @stderr
%231 = call i32 (i32, i8*, ...) @fprintf(i32 %230, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0))
%232 = load i32, i32* @EXIT_FAILURE
%233 = call i32 @exit(i32 %232)
unreachable
234: ; preds = %224
%235 = load i8**, i8*** %5
%236 = getelementptr inbounds i8*, i8** %235, i64 1
%237 = load i8*, i8** %236
%238 = call i32* @fopen(i8* %237, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %238, i32** %6
%239 = icmp eq i32* %238, null
br i1 %239, label %240, label %248
240: ; preds = %234
%241 = load i32, i32* @stderr
%242 = load i8**, i8*** %5
%243 = getelementptr inbounds i8*, i8** %242, i64 1
%244 = load i8*, i8** %243
%245 = call i32 (i32, i8*, ...) @fprintf(i32 %241, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %244)
%246 = load i32, i32* @EXIT_FAILURE
%247 = call i32 @exit(i32 %246)
unreachable
248: ; preds = %234
%249 = load i8**, i8*** %5
%250 = getelementptr inbounds i8*, i8** %249, i64 3
%251 = load i8*, i8** %250
%252 = call i32* @fopen(i8* %251, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
store i32* %252, i32** %9
%253 = icmp eq i32* %252, null
br i1 %253, label %254, label %262
254: ; preds = %248
%255 = load i32, i32* @stderr
%256 = load i8**, i8*** %5
%257 = getelementptr inbounds i8*, i8** %256, i64 3
%258 = load i8*, i8** %257
%259 = call i32 (i32, i8*, ...) @fprintf(i32 %255, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %258)
%260 = load i32, i32* @EXIT_FAILURE
%261 = call i32 @exit(i32 %260)
unreachable
262: ; preds = %248
%263 = load i32, i32* %14
%264 = load i32, i32* %15
%265 = load i32*, i32** %6
%266 = load double**, double*** %16
%267 = load double**, double*** %17
%268 = call i32 @read_mu_sigma(i32 %263, i32 %264, i32* %265, double** %266, double** %267)
%269 = load i32*, i32** %6
%270 = call i32 @fclose(i32* %269)
br label %271
271: ; preds = %332, %262
%272 = getelementptr inbounds [10000 x i8], [10000 x i8]* %13, i64 0, i64 0
%273 = load i32*, i32** %7
%274 = call i32* @fgets(i8* %272, i32 10000, i32* %273)
%275 = icmp ne i32* %274, null
br i1 %275, label %276, label %333
276: ; preds = %271
%277 = getelementptr inbounds [10000 x i8], [10000 x i8]* %13, i64 0, i64 0
%278 = call i8* @strtok(i8* %277, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%279 = call i32* @fopen(i8* %278, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %279, i32** %8
%280 = load i32, i32* %14
%281 = load i32, i32* %15
%282 = load i32*, i32** %8
%283 = load double**, double*** %18
%284 = load double**, double*** %19
%285 = call i32 @read_mu_sigma(i32 %280, i32 %281, i32* %282, double** %283, double** %284)
%286 = load i32*, i32** %8
%287 = call i32 @fclose(i32* %286)
store i32 0, i32* %11
br label %288
288: ; preds = %329, %276
%289 = load i32, i32* %11
%290 = load i32, i32* %15
%291 = icmp slt i32 %289, %290
br i1 %291, label %292, label %332
292: ; preds = %288
store i32 0, i32* %12
br label %293
293: ; preds = %317, %292
%294 = load i32, i32* %12
%295 = load i32, i32* %14
%296 = icmp slt i32 %294, %295
br i1 %296, label %297, label %320
297: ; preds = %293
%298 = load double**, double*** %16
%299 = load i32, i32* %11
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds double*, double** %298, i64 %300
%302 = load double*, double** %301
%303 = load i32, i32* %12
%304 = sext i32 %303 to i64
%305 = getelementptr inbounds double, double* %302, i64 %304
%306 = load double, double* %305
%307 = load double**, double*** %18
%308 = load i32, i32* %11
%309 = sext i32 %308 to i64
%310 = getelementptr inbounds double*, double** %307, i64 %309
%311 = load double*, double** %310
%312 = load i32, i32* %12
%313 = sext i32 %312 to i64
%314 = getelementptr inbounds double, double* %311, i64 %313
%315 = load double, double* %314
%316 = fsub double %315, %306
store double %316, double* %314
br label %317
317: ; preds = %297
%318 = load i32, i32* %12
%319 = add nsw i32 %318, 1
store i32 %319, i32* %12
br label %293
320: ; preds = %293
%321 = load double**, double*** %18
%322 = load i32, i32* %11
%323 = sext i32 %322 to i64
%324 = getelementptr inbounds double*, double** %321, i64 %323
%325 = load double*, double** %324
%326 = load i32, i32* %14
%327 = load i32*, i32** %9
%328 = call i32 @fwrite(double* %325, i32 8, i32 %326, i32* %327)
br label %329
329: ; preds = %320
%330 = load i32, i32* %11
%331 = add nsw i32 %330, 1
store i32 %331, i32* %11
br label %288
332: ; preds = %288
br label %271
333: ; preds = %271
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: $ %s (UBM file) (GMM list) (outfile)\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [18 x i8] c"File open error!\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [2 x i8] c" \00"
@.str.5 = [3 x i8] c" \0A\00"
@.str.6 = [48 x i8] c"Error: Memory allocation for mu / sigma failed\0A\00"
@.str.7 = [22 x i8] c"%s: File open error!\0A\00"
@.str.8 = [3 x i8] c"wb\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10000 x i8]
%4 = icmp eq i32 %0, 4
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %1
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds [10000 x i8], [10000 x i8]* %3, i64 0, i64 0
%13 = call i32 @memset(i8* %12, i32 0, i32 10000)
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = call i32* @fopen(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %23
18: ; preds = %11
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
23: ; preds = %11
%24 = call i32* @fgets(i8* %12, i32 10000, i32* %16)
%25 = call i8* @strtok(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i32* %26, null
br i1 %27, label %63, label %28
28: ; preds = %23
%29 = call i32* @fgets(i8* %12, i32 10000, i32* %26)
%30 = call i32* @fgets(i8* %12, i32 10000, i32* %26)
%31 = call i32* @fgets(i8* %12, i32 10000, i32* %26)
%32 = call i8* @strtok(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%33 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%34 = call i32 @atoi(i8* %33)
%35 = call i32* @fgets(i8* %12, i32 10000, i32* %26)
%36 = call i32* @fgets(i8* %12, i32 10000, i32* %26)
%37 = call i32* @fgets(i8* %12, i32 10000, i32* %26)
%38 = call i32* @fgets(i8* %12, i32 10000, i32* %26)
%39 = call i32* @fgets(i8* %12, i32 10000, i32* %26)
%40 = call i8* @strtok(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%41 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%42 = call i32 @atoi(i8* %41)
%43 = call i32 @rewind(i32* %16)
%44 = shl i32 %42, 3
%45 = call i64 @malloc(i32 %44)
%46 = inttoptr i64 %45 to double**
%47 = call i64 @malloc(i32 %44)
%48 = inttoptr i64 %47 to double**
%49 = mul i32 %44, %34
%50 = call i64 @malloc(i32 %49)
%51 = inttoptr i64 %50 to double*
store double* %51, double** %46
%52 = call i64 @malloc(i32 %49)
%53 = inttoptr i64 %52 to double*
store double* %53, double** %48
%54 = call i64 @malloc(i32 %44)
%55 = inttoptr i64 %54 to double**
%56 = call i64 @malloc(i32 %44)
%57 = inttoptr i64 %56 to double**
%58 = call i64 @malloc(i32 %49)
%59 = inttoptr i64 %58 to double*
store double* %59, double** %55
%60 = call i64 @malloc(i32 %49)
%61 = inttoptr i64 %60 to double*
store double* %61, double** %57
%62 = icmp sgt i32 %42, 1
br i1 %62, label %68, label %88
63: ; preds = %23
%64 = load i32, i32* @stderr
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%66 = load i32, i32* @EXIT_FAILURE
%67 = call i32 @exit(i32 %66)
unreachable
68: ; preds = %28
%69 = sext i32 %34 to i64
%70 = zext i32 %42 to i64
br label %71
71: ; preds = %68, %71
%72 = phi i64 [ 1, %68 ], [ %86, %71 ]
%73 = load double*, double** %46
%74 = mul nsw i64 %72, %69
%75 = getelementptr inbounds double, double* %73, i64 %74
%76 = getelementptr inbounds double*, double** %46, i64 %72
store double* %75, double** %76
%77 = load double*, double** %48
%78 = getelementptr inbounds double, double* %77, i64 %74
%79 = getelementptr inbounds double*, double** %48, i64 %72
store double* %78, double** %79
%80 = load double*, double** %55
%81 = getelementptr inbounds double, double* %80, i64 %74
%82 = getelementptr inbounds double*, double** %55, i64 %72
store double* %81, double** %82
%83 = load double*, double** %57
%84 = getelementptr inbounds double, double* %83, i64 %74
%85 = getelementptr inbounds double*, double** %57, i64 %72
store double* %84, double** %85
%86 = add nuw nsw i64 %72, 1
%87 = icmp eq i64 %86, %70
br i1 %87, label %88, label %71
88: ; preds = %71, %28
%89 = phi double* [ %61, %28 ], [ %83, %71 ]
%90 = load double*, double** %55
%91 = icmp eq double* %90, null
%92 = icmp eq double* %89, null
%93 = select i1 %91, i1 true, i1 %92
br i1 %93, label %94, label %99
94: ; preds = %88
%95 = load i32, i32* @stderr
%96 = call i32 (i32, i8*, ...) @fprintf(i32 %95, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0))
%97 = load i32, i32* @EXIT_FAILURE
%98 = call i32 @exit(i32 %97)
unreachable
99: ; preds = %88
%100 = getelementptr inbounds i8*, i8** %1, i64 1
%101 = load i8*, i8** %100
%102 = call i32* @fopen(i8* %101, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%103 = icmp eq i32* %102, null
br i1 %103, label %104, label %110
104: ; preds = %99
%105 = load i32, i32* @stderr
%106 = load i8*, i8** %100
%107 = call i32 (i32, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %106)
%108 = load i32, i32* @EXIT_FAILURE
%109 = call i32 @exit(i32 %108)
unreachable
110: ; preds = %99
%111 = getelementptr inbounds i8*, i8** %1, i64 3
%112 = load i8*, i8** %111
%113 = call i32* @fopen(i8* %112, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%114 = icmp eq i32* %113, null
br i1 %114, label %115, label %121
115: ; preds = %110
%116 = load i32, i32* @stderr
%117 = load i8*, i8** %111
%118 = call i32 (i32, i8*, ...) @fprintf(i32 %116, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %117)
%119 = load i32, i32* @EXIT_FAILURE
%120 = call i32 @exit(i32 %119)
unreachable
121: ; preds = %110
%122 = call i32 @read_mu_sigma(i32 %34, i32 %42, i32* %102, double** %46, double** %48)
%123 = call i32 @fclose(i32* %102)
%124 = call i32* @fgets(i8* %12, i32 10000, i32* %16)
%125 = icmp eq i32* %124, null
br i1 %125, label %278, label %126
126: ; preds = %121
%127 = icmp sgt i32 %42, 0
%128 = icmp sgt i32 %34, 0
%129 = zext i32 %42 to i64
%130 = zext i32 %34 to i64
%131 = and i64 %130, 4294967292
%132 = add nsw i64 %131, -4
%133 = lshr exact i64 %132, 2
%134 = add nuw nsw i64 %133, 1
%135 = icmp ult i32 %34, 4
%136 = and i64 %130, 4294967292
%137 = and i64 %134, 1
%138 = icmp eq i64 %132, 0
%139 = and i64 %134, 9223372036854775806
%140 = icmp eq i64 %137, 0
%141 = icmp eq i64 %136, %130
%142 = and i64 %130, 3
%143 = icmp eq i64 %142, 0
br label %147
144: ; preds = %273, %147
%145 = call i32* @fgets(i8* %12, i32 10000, i32* %16)
%146 = icmp eq i32* %145, null
br i1 %146, label %278, label %147
147: ; preds = %126, %144
%148 = call i8* @strtok(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%149 = call i32* @fopen(i8* %148, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%150 = call i32 @read_mu_sigma(i32 %34, i32 %42, i32* %149, double** %55, double** %57)
%151 = call i32 @fclose(i32* %149)
br i1 %127, label %152, label %144
152: ; preds = %147, %273
%153 = phi i64 [ %276, %273 ], [ 0, %147 ]
br i1 %128, label %157, label %154
154: ; preds = %152
%155 = getelementptr inbounds double*, double** %55, i64 %153
%156 = load double*, double** %155
br label %273
157: ; preds = %152
%158 = getelementptr inbounds double*, double** %46, i64 %153
%159 = load double*, double** %158
%160 = getelementptr inbounds double*, double** %55, i64 %153
%161 = load double*, double** %160
br i1 %135, label %228, label %162
162: ; preds = %157
%163 = getelementptr double, double* %161, i64 %130
%164 = getelementptr double, double* %159, i64 %130
%165 = icmp ult double* %161, %164
%166 = icmp ult double* %159, %163
%167 = and i1 %165, %166
br i1 %167, label %228, label %168
168: ; preds = %162
br i1 %138, label %208, label %169
169: ; preds = %168, %169
%170 = phi i64 [ %205, %169 ], [ 0, %168 ]
%171 = phi i64 [ %206, %169 ], [ 0, %168 ]
%172 = getelementptr inbounds double, double* %159, i64 %170
%173 = bitcast double* %172 to <2 x double>*
%174 = load <2 x double>, <2 x double>* %173
%175 = getelementptr inbounds double, double* %172, i64 2
%176 = bitcast double* %175 to <2 x double>*
%177 = load <2 x double>, <2 x double>* %176
%178 = getelementptr inbounds double, double* %161, i64 %170
%179 = bitcast double* %178 to <2 x double>*
%180 = load <2 x double>, <2 x double>* %179
%181 = getelementptr inbounds double, double* %178, i64 2
%182 = bitcast double* %181 to <2 x double>*
%183 = load <2 x double>, <2 x double>* %182
%184 = fsub <2 x double> %180, %174
%185 = fsub <2 x double> %183, %177
%186 = bitcast double* %178 to <2 x double>*
store <2 x double> %184, <2 x double>* %186
%187 = bitcast double* %181 to <2 x double>*
store <2 x double> %185, <2 x double>* %187
%188 = or i64 %170, 4
%189 = getelementptr inbounds double, double* %159, i64 %188
%190 = bitcast double* %189 to <2 x double>*
%191 = load <2 x double>, <2 x double>* %190
%192 = getelementptr inbounds double, double* %189, i64 2
%193 = bitcast double* %192 to <2 x double>*
%194 = load <2 x double>, <2 x double>* %193
%195 = getelementptr inbounds double, double* %161, i64 %188
%196 = bitcast double* %195 to <2 x double>*
%197 = load <2 x double>, <2 x double>* %196
%198 = getelementptr inbounds double, double* %195, i64 2
%199 = bitcast double* %198 to <2 x double>*
%200 = load <2 x double>, <2 x double>* %199
%201 = fsub <2 x double> %197, %191
%202 = fsub <2 x double> %200, %194
%203 = bitcast double* %195 to <2 x double>*
store <2 x double> %201, <2 x double>* %203
%204 = bitcast double* %198 to <2 x double>*
store <2 x double> %202, <2 x double>* %204
%205 = add nuw i64 %170, 8
%206 = add i64 %171, 2
%207 = icmp eq i64 %206, %139
br i1 %207, label %208, label %169
208: ; preds = %169, %168
%209 = phi i64 [ 0, %168 ], [ %205, %169 ]
br i1 %140, label %227, label %210
210: ; preds = %208
%211 = getelementptr inbounds double, double* %159, i64 %209
%212 = bitcast double* %211 to <2 x double>*
%213 = load <2 x double>, <2 x double>* %212
%214 = getelementptr inbounds double, double* %211, i64 2
%215 = bitcast double* %214 to <2 x double>*
%216 = load <2 x double>, <2 x double>* %215
%217 = getelementptr inbounds double, double* %161, i64 %209
%218 = bitcast double* %217 to <2 x double>*
%219 = load <2 x double>, <2 x double>* %218
%220 = getelementptr inbounds double, double* %217, i64 2
%221 = bitcast double* %220 to <2 x double>*
%222 = load <2 x double>, <2 x double>* %221
%223 = fsub <2 x double> %219, %213
%224 = fsub <2 x double> %222, %216
%225 = bitcast double* %217 to <2 x double>*
store <2 x double> %223, <2 x double>* %225
%226 = bitcast double* %220 to <2 x double>*
store <2 x double> %224, <2 x double>* %226
br label %227
227: ; preds = %208, %210
br i1 %141, label %273, label %228
228: ; preds = %162, %157, %227
%229 = phi i64 [ 0, %162 ], [ 0, %157 ], [ %136, %227 ]
%230 = xor i64 %229, -1
%231 = add nsw i64 %230, %130
br i1 %143, label %243, label %232
232: ; preds = %228, %232
%233 = phi i64 [ %240, %232 ], [ %229, %228 ]
%234 = phi i64 [ %241, %232 ], [ 0, %228 ]
%235 = getelementptr inbounds double, double* %159, i64 %233
%236 = load double, double* %235
%237 = getelementptr inbounds double, double* %161, i64 %233
%238 = load double, double* %237
%239 = fsub double %238, %236
store double %239, double* %237
%240 = add nuw nsw i64 %233, 1
%241 = add i64 %234, 1
%242 = icmp eq i64 %241, %142
br i1 %242, label %243, label %232
243: ; preds = %232, %228
%244 = phi i64 [ %229, %228 ], [ %240, %232 ]
%245 = icmp ult i64 %231, 3
br i1 %245, label %273, label %246
246: ; preds = %243, %246
%247 = phi i64 [ %271, %246 ], [ %244, %243 ]
%248 = getelementptr inbounds double, double* %159, i64 %247
%249 = load double, double* %248
%250 = getelementptr inbounds double, double* %161, i64 %247
%251 = load double, double* %250
%252 = fsub double %251, %249
store double %252, double* %250
%253 = add nuw nsw i64 %247, 1
%254 = getelementptr inbounds double, double* %159, i64 %253
%255 = load double, double* %254
%256 = getelementptr inbounds double, double* %161, i64 %253
%257 = load double, double* %256
%258 = fsub double %257, %255
store double %258, double* %256
%259 = add nuw nsw i64 %247, 2
%260 = getelementptr inbounds double, double* %159, i64 %259
%261 = load double, double* %260
%262 = getelementptr inbounds double, double* %161, i64 %259
%263 = load double, double* %262
%264 = fsub double %263, %261
store double %264, double* %262
%265 = add nuw nsw i64 %247, 3
%266 = getelementptr inbounds double, double* %159, i64 %265
%267 = load double, double* %266
%268 = getelementptr inbounds double, double* %161, i64 %265
%269 = load double, double* %268
%270 = fsub double %269, %267
store double %270, double* %268
%271 = add nuw nsw i64 %247, 4
%272 = icmp eq i64 %271, %130
br i1 %272, label %273, label %246
273: ; preds = %243, %246, %227, %154
%274 = phi double* [ %156, %154 ], [ %161, %227 ], [ %161, %246 ], [ %161, %243 ]
%275 = call i32 @fwrite(double* %274, i32 8, i32 %34, i32* %113)
%276 = add nuw nsw i64 %153, 1
%277 = icmp eq i64 %276, %129
br i1 %277, label %144, label %152
278: ; preds = %144, %121
ret i32 0
}