#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 */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ cblas_sgemm(int, int, int, int, int, int, float, float *,
                               int, float *, int, float, float *, int);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, int, int, int, double, double, double);
int main(int argc, char *argv[]) {
  struct timeval tv;
  double start, end, timec;
  int lda, ldb;
  int m = 128;
  int n = 64;
  int k = 16;
  int order = 102;
  int transa = 111;
  int transb = 111;
  if (transa == 111)
    lda = m;
  else
    lda = k;
  if (transb == 111)
    ldb = k;
  else
    ldb = n;
  int ldc = m;
  unsigned long i, j;
  float alpha = 2.0;
  float beta = 2.0;
  void *a1, *b1, *c1, *c2;
  float *a, *b, *cg, *cc;
  a1 = malloc((size_t)32768 * 8192 * 4);
  b1 = malloc((size_t)32768 * 8192 * 4);
  c1 = malloc((size_t)32768 * 32768 * 4);
  c2 = malloc((size_t)32768 * 32768 * 4);
  a = (float *)a1;
  b = (float *)b1;
  cg = (float *)c1;
  cc = (float *)c2;
  for (i = 0; i < m; i++) {
    for (j = 0; j < k; j++) {
      *a = (float)(i * 10 + k + 1) * 0.01;
      a++;
    }
  }
  for (i = 0; i < k; i++) {
    for (j = 0; j < n; j++) {
      *b = (float)(i * k + 1) + i;
      b++;
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      *cc = (float)(i * 10 + k + 3);
      *cg = (float)0.0;
      cc++;
      cg++;
    }
  }
  a = (float *)a1;
  b = (float *)b1;
  cg = (float *)c1;
  cc = (float *)c2;
  gettimeofday(&tv, NULL);
  start = (double)tv.tv_sec + (double)tv.tv_usec * 1.e-6;
  cblas_sgemm(order, transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, cc,
              ldc);
  gettimeofday(&tv, NULL);
  end = (double)tv.tv_sec + (double)tv.tv_usec * 1.e-6;
  timec = end - start;
  double fp = (2.0 * (double)m * n * k) * (double)1.0e-9;
  double gflops = fp / timec;
  printf("GPU: %dx%dx%d size\t%10.8f sec\t%10.6f GFlop\t%10.8f GFlops\n", m, n,
         k, timec, fp, gflops);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x128,%rsp
movl   $0x0,-0x1c(%rbp)
mov    %edi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movl   $0x80,-0x5c(%rbp)
movl   $0x40,-0x60(%rbp)
movl   $0x10,-0x64(%rbp)
movl   $0x66,-0x68(%rbp)
movl   $0x6f,-0x6c(%rbp)
movl   $0x6f,-0x70(%rbp)
cmpl   $0x6f,-0x6c(%rbp)
jne    119d <main+0x5d>
mov    -0x5c(%rbp),%eax
mov    %eax,-0x54(%rbp)
jmp    11a3 <main+0x63>
mov    -0x64(%rbp),%eax
mov    %eax,-0x54(%rbp)
cmpl   $0x6f,-0x70(%rbp)
jne    11b8 <main+0x78>
mov    -0x64(%rbp),%eax
mov    %eax,-0x58(%rbp)
jmp    11be <main+0x7e>
mov    -0x60(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x74(%rbp)
movss  0xe34(%rip),%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
movss  0xe24(%rip),%xmm0
movss  %xmm0,-0x90(%rbp)
ff
mov    $0x40000000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x98(%rbp)
mov    $0x40000000,%edi
call   1050 <malloc@plt>
mov    %rax,-0xa0(%rbp)
movabs $0x100000000,%rdi
call   1050 <malloc@plt>
mov    %rax,-0xa8(%rbp)
movabs $0x100000000,%rdi
call   1050 <malloc@plt>
mov    %rax,-0xb0(%rbp)
mov    -0x98(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0xa8(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0xb0(%rbp),%rax
mov    %rax,-0xd0(%rbp)
movq   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%rax
movslq -0x5c(%rbp),%rcx
cmp    %rcx,%rax
jae    135e <main+0x21e>
movq   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%rax
movslq -0x64(%rbp),%rcx
cmp    %rcx,%rax
jae    1348 <main+0x208>
mov    -0x80(%rbp),%rax
lea    (%rax,%rax,4),%rcx
movslq -0x64(%rbp),%rax
lea    0x1(%rax,%rcx,2),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0xe8(%rbp)
ff
test   %rax,%rax
movss  %xmm0,-0xe4(%rbp)
ff
js     12f8 <main+0x1b8>
movss  -0xe8(%rbp),%xmm0
ff
movss  %xmm0,-0xe4(%rbp)
ff
movss  -0xe4(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movsd  0xd14(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0xb8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0xb8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0xb8(%rbp)
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
jmp    128e <main+0x14e>
jmp    134d <main+0x20d>
mov    -0x80(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x80(%rbp)
jmp    1272 <main+0x132>
movq   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%rax
movslq -0x64(%rbp),%rcx
cmp    %rcx,%rax
jae    14ac <main+0x36c>
movq   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%rax
movslq -0x60(%rbp),%rcx
cmp    %rcx,%rax
jae    1496 <main+0x356>
mov    -0x80(%rbp),%rax
mov    %rax,-0xf8(%rbp)
movslq -0x64(%rbp),%rcx
imul   %rcx,%rax
add    $0x1,%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0xf0(%rbp)
ff
test   %rax,%rax
movss  %xmm0,-0xec(%rbp)
ff
js     13f2 <main+0x2b2>
movss  -0xf0(%rbp),%xmm0
ff
movss  %xmm0,-0xec(%rbp)
ff
mov    -0xf8(%rbp),%rax
movss  -0xec(%rbp),%xmm0
movss  %xmm0,-0x104(%rbp)
ff
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x100(%rbp)
ff
test   %rax,%rax
movss  %xmm0,-0xfc(%rbp)
ff
js     144e <main+0x30e>
movss  -0x100(%rbp),%xmm0
ff
movss  %xmm0,-0xfc(%rbp)
ff
movss  -0x104(%rbp),%xmm0
ff
movss  -0xfc(%rbp),%xmm1
ff
addss  %xmm1,%xmm0
mov    -0xc0(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0xc0(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0xc0(%rbp)
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
jmp    1382 <main+0x242>
jmp    149b <main+0x35b>
mov    -0x80(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x80(%rbp)
jmp    1366 <main+0x226>
movq   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%rax
movslq -0x60(%rbp),%rcx
cmp    %rcx,%rax
jae    15ac <main+0x46c>
movq   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%rax
movslq -0x5c(%rbp),%rcx
cmp    %rcx,%rax
jae    1596 <main+0x456>
mov    -0x80(%rbp),%rax
lea    (%rax,%rax,4),%rcx
movslq -0x64(%rbp),%rax
lea    0x3(%rax,%rcx,2),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x10c(%rbp)
ff
test   %rax,%rax
movss  %xmm0,-0x108(%rbp)
ff
js     153a <main+0x3fa>
movss  -0x10c(%rbp),%xmm0
ff
movss  %xmm0,-0x108(%rbp)
ff
movss  -0x108(%rbp),%xmm0
ff
mov    -0xd0(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0xc8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0xd0(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0xd0(%rbp)
mov    -0xc8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0xc8(%rbp)
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
jmp    14d0 <main+0x390>
jmp    159b <main+0x45b>
mov    -0x80(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x80(%rbp)
jmp    14b4 <main+0x374>
mov    -0x98(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0xa8(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0xb0(%rbp),%rax
mov    %rax,-0xd0(%rbp)
lea    -0x38(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
cvtsi2sdq -0x30(%rbp),%xmm1
cvtsi2sdq -0x38(%rbp),%xmm0
movsd  0xa13(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x68(%rbp),%edi
mov    -0x6c(%rbp),%esi
mov    -0x70(%rbp),%edx
mov    -0x5c(%rbp),%ecx
mov    -0x60(%rbp),%r8d
mov    -0x64(%rbp),%r9d
movss  -0x8c(%rbp),%xmm0
ff
mov    -0xb8(%rbp),%r15
mov    -0x54(%rbp),%r14d
mov    -0xc0(%rbp),%rbx
mov    -0x58(%rbp),%r11d
movss  -0x90(%rbp),%xmm1
ff
mov    -0xd0(%rbp),%r10
mov    -0x74(%rbp),%eax
mov    %r15,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11d,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1060 <cblas_sgemm@plt>
lea    -0x38(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
cvtsi2sdq -0x30(%rbp),%xmm1
cvtsi2sdq -0x38(%rbp),%xmm0
movsd  0x980(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
cvtsi2sdl -0x5c(%rbp),%xmm1
movsd  0x94f(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x60(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x64(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x929(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
mov    -0x5c(%rbp),%esi
mov    -0x60(%rbp),%edx
mov    -0x64(%rbp),%ecx
movsd  -0x50(%rbp),%xmm0
movsd  -0xd8(%rbp),%xmm1
ff
movsd  -0xe0(%rbp),%xmm2
ff
lea    0x903(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x128,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    $0x40000000,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    $0x40000000,%edi
call   1060 <malloc@plt>
mov    %rax,%r15
movabs $0x100000000,%rbx
mov    %rbx,%rdi
call   1060 <malloc@plt>
mov    %rax,%r12
mov    %rbx,%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    $0x1b,%eax
movsd  0xe5b(%rip),%xmm0
mov    %r14,%rcx
jmp    11e8 <main+0x98>
nopw   0x0(%rax,%rax,1)
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
shufps $0x0,%xmm1,%xmm1
movups %xmm1,0x40(%rcx)
movups %xmm1,0x50(%rcx)
movups %xmm1,0x60(%rcx)
movups %xmm1,0x70(%rcx)
add    $0x14,%rax
sub    $0xffffffffffffff80,%rcx
cmp    $0x51b,%rax
je     125f <main+0x10f>
mov    %rax,%rdx
add    $0xfffffffffffffff6,%rdx
js     1200 <main+0xb0>
xorps  %xmm1,%xmm1
cvtsi2ss %rdx,%xmm1
jmp    1218 <main+0xc8>
nopl   0x0(%rax,%rax,1)
mov    %rdx,%rsi
shr    %rsi
and    $0x1,%edx
or     %rsi,%rdx
xorps  %xmm1,%xmm1
cvtsi2ss %rdx,%xmm1
addss  %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
shufps $0x0,%xmm1,%xmm1
movups %xmm1,(%rcx)
movups %xmm1,0x10(%rcx)
movups %xmm1,0x20(%rcx)
movups %xmm1,0x30(%rcx)
test   %rax,%rax
jns    11b0 <main+0x60>
mov    %rax,%rdx
shr    %rdx
mov    %eax,%esi
and    $0x1,%esi
or     %rdx,%rsi
xorps  %xmm1,%xmm1
cvtsi2ss %rsi,%xmm1
addss  %xmm1,%xmm1
jmp    11b8 <main+0x68>
mov    $0x1,%eax
xor    %ecx,%ecx
mov    %r15,%rdx
jmp    12ec <main+0x19c>
xchg   %ax,%ax
xorps  %xmm1,%xmm1
cvtsi2ss %rcx,%xmm1
addss  %xmm0,%xmm1
shufps $0x0,%xmm1,%xmm1
movups %xmm1,(%rdx)
movups %xmm1,0x10(%rdx)
movups %xmm1,0x20(%rdx)
movups %xmm1,0x30(%rdx)
movups %xmm1,0x40(%rdx)
movups %xmm1,0x50(%rdx)
movups %xmm1,0x60(%rdx)
movups %xmm1,0x70(%rdx)
movups %xmm1,0x80(%rdx)
movups %xmm1,0x90(%rdx)
movups %xmm1,0xa0(%rdx)
movups %xmm1,0xb0(%rdx)
movups %xmm1,0xc0(%rdx)
movups %xmm1,0xd0(%rdx)
movups %xmm1,0xe0(%rdx)
movups %xmm1,0xf0(%rdx)
add    $0x1,%rcx
add    $0x10,%rax
add    $0x100,%rdx
cmp    $0x10,%rcx
je     1352 <main+0x202>
test   %rax,%rax
js     1310 <main+0x1c0>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
test   %rcx,%rcx
jns    1270 <main+0x120>
jmp    1333 <main+0x1e3>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rsi
shr    %rsi
mov    %eax,%edi
and    $0x1,%edi
or     %rsi,%rdi
xorps  %xmm0,%xmm0
cvtsi2ss %rdi,%xmm0
addss  %xmm0,%xmm0
test   %rcx,%rcx
jns    1270 <main+0x120>
mov    %rcx,%rsi
shr    %rsi
mov    %ecx,%edi
and    $0x1,%edi
or     %rsi,%rdi
xorps  %xmm1,%xmm1
cvtsi2ss %rdi,%xmm1
addss  %xmm1,%xmm1
jmp    1278 <main+0x128>
mov    $0x13,%r13d
xor    %ebp,%ebp
jmp    147b <main+0x32b>
nop
xorps  %xmm0,%xmm0
cvtsi2ss %r13,%xmm0
movaps %xmm0,(%rsp)
mov    $0x200,%edx
xor    %esi,%esi
call   1050 <memset@plt>
movaps (%rsp),%xmm0
shufps $0x0,%xmm0,%xmm0
movups %xmm0,(%rbx,%rbp,1)
movups %xmm0,0x10(%rbx,%rbp,1)
movups %xmm0,0x20(%rbx,%rbp,1)
movups %xmm0,0x30(%rbx,%rbp,1)
movups %xmm0,0x40(%rbx,%rbp,1)
movups %xmm0,0x50(%rbx,%rbp,1)
movups %xmm0,0x60(%rbx,%rbp,1)
movups %xmm0,0x70(%rbx,%rbp,1)
movups %xmm0,0x80(%rbx,%rbp,1)
movups %xmm0,0x90(%rbx,%rbp,1)
movups %xmm0,0xa0(%rbx,%rbp,1)
movups %xmm0,0xb0(%rbx,%rbp,1)
movups %xmm0,0xc0(%rbx,%rbp,1)
movups %xmm0,0xd0(%rbx,%rbp,1)
movups %xmm0,0xe0(%rbx,%rbp,1)
movups %xmm0,0xf0(%rbx,%rbp,1)
movups %xmm0,0x100(%rbx,%rbp,1)
movups %xmm0,0x110(%rbx,%rbp,1)
movups %xmm0,0x120(%rbx,%rbp,1)
movups %xmm0,0x130(%rbx,%rbp,1)
movups %xmm0,0x140(%rbx,%rbp,1)
movups %xmm0,0x150(%rbx,%rbp,1)
movups %xmm0,0x160(%rbx,%rbp,1)
movups %xmm0,0x170(%rbx,%rbp,1)
movups %xmm0,0x180(%rbx,%rbp,1)
movups %xmm0,0x190(%rbx,%rbp,1)
movups %xmm0,0x1a0(%rbx,%rbp,1)
movups %xmm0,0x1b0(%rbx,%rbp,1)
movups %xmm0,0x1c0(%rbx,%rbp,1)
movups %xmm0,0x1d0(%rbx,%rbp,1)
movups %xmm0,0x1e0(%rbx,%rbp,1)
movups %xmm0,0x1f0(%rbx,%rbp,1)
add    $0x200,%rbp
add    $0xa,%r13
cmp    $0x8000,%rbp
je     14a8 <main+0x358>
lea    (%r12,%rbp,1),%rdi
test   %r13,%r13
jns    1360 <main+0x210>
mov    %r13,%rax
shr    %rax
mov    %r13d,%ecx
and    $0x1,%ecx
or     %rax,%rcx
xorps  %xmm0,%xmm0
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
jmp    1368 <main+0x218>
lea    0x18(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x20(%rsp),%xmm0
cvtsi2sdq 0x18(%rsp),%xmm1
mulsd  0xb38(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movss  0xb37(%rip),%xmm0
mov    $0x66,%edi
mov    $0x6f,%esi
mov    $0x6f,%edx
mov    $0x80,%ecx
mov    $0x40,%r8d
mov    $0x10,%r9d
movaps %xmm0,%xmm1
push   $0x80
push   %rbx
push   $0x10
push   %r15
push   $0x80
push   %r14
call   1070 <cblas_sgemm@plt>
add    $0x30,%rsp
mov    %r12,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
xorps  %xmm1,%xmm1
cvtsi2sdq 0x20(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdq 0x18(%rsp),%xmm0
mulsd  0xac4(%rip),%xmm0
addsd  %xmm1,%xmm0
subsd  (%rsp),%xmm0
movsd  0xabb(%rip),%xmm1
movapd %xmm1,%xmm2
divsd  %xmm0,%xmm2
lea    0xab8(%rip),%rdi
mov    $0x80,%esi
mov    $0x40,%edx
mov    $0x10,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [58 x i8] c"GPU: %dx%dx%d size\09%10.8f sec\09%10.6f GFlop\09%10.8f GFlops\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timeval
%7 = alloca double
%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 i64
%20 = alloca i64
%21 = alloca float
%22 = alloca float
%23 = alloca i8*
%24 = alloca i8*
%25 = alloca i8*
%26 = alloca i8*
%27 = alloca float*
%28 = alloca float*
%29 = alloca float*
%30 = alloca float*
%31 = alloca double
%32 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 128, i32* %12
store i32 64, i32* %13
store i32 16, i32* %14
store i32 102, i32* %15
store i32 111, i32* %16
store i32 111, i32* %17
%33 = load i32, i32* %16
%34 = icmp eq i32 %33, 111
br i1 %34, label %35, label %37
35: ; preds = %2
%36 = load i32, i32* %12
store i32 %36, i32* %10
br label %39
37: ; preds = %2
%38 = load i32, i32* %14
store i32 %38, i32* %10
br label %39
39: ; preds = %37, %35
%40 = load i32, i32* %17
%41 = icmp eq i32 %40, 111
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = load i32, i32* %14
store i32 %43, i32* %11
br label %46
44: ; preds = %39
%45 = load i32, i32* %13
store i32 %45, i32* %11
br label %46
46: ; preds = %44, %42
%47 = load i32, i32* %12
store i32 %47, i32* %18
store float 2.000000e+00, float* %21
store float 2.000000e+00, float* %22
%48 = call i8* @malloc(i64 1073741824)
store i8* %48, i8** %23
%49 = call i8* @malloc(i64 1073741824)
store i8* %49, i8** %24
%50 = call i8* @malloc(i64 4294967296)
store i8* %50, i8** %25
%51 = call i8* @malloc(i64 4294967296)
store i8* %51, i8** %26
%52 = load i8*, i8** %23
%53 = bitcast i8* %52 to float*
store float* %53, float** %27
%54 = load i8*, i8** %24
%55 = bitcast i8* %54 to float*
store float* %55, float** %28
%56 = load i8*, i8** %25
%57 = bitcast i8* %56 to float*
store float* %57, float** %29
%58 = load i8*, i8** %26
%59 = bitcast i8* %58 to float*
store float* %59, float** %30
store i64 0, i64* %19
br label %60
60: ; preds = %89, %46
%61 = load i64, i64* %19
%62 = load i32, i32* %12
%63 = sext i32 %62 to i64
%64 = icmp ult i64 %61, %63
br i1 %64, label %65, label %92
65: ; preds = %60
store i64 0, i64* %20
br label %66
66: ; preds = %85, %65
%67 = load i64, i64* %20
%68 = load i32, i32* %14
%69 = sext i32 %68 to i64
%70 = icmp ult i64 %67, %69
br i1 %70, label %71, label %88
71: ; preds = %66
%72 = load i64, i64* %19
%73 = mul i64 %72, 10
%74 = load i32, i32* %14
%75 = sext i32 %74 to i64
%76 = add i64 %73, %75
%77 = add i64 %76, 1
%78 = uitofp i64 %77 to float
%79 = fpext float %78 to double
%80 = fmul double %79, 1.000000e-02
%81 = fptrunc double %80 to float
%82 = load float*, float** %27
store float %81, float* %82
%83 = load float*, float** %27
%84 = getelementptr inbounds float, float* %83, i32 1
store float* %84, float** %27
br label %85
85: ; preds = %71
%86 = load i64, i64* %20
%87 = add i64 %86, 1
store i64 %87, i64* %20
br label %66
88: ; preds = %66
br label %89
89: ; preds = %88
%90 = load i64, i64* %19
%91 = add i64 %90, 1
store i64 %91, i64* %19
br label %60
92: ; preds = %60
store i64 0, i64* %19
br label %93
93: ; preds = %121, %92
%94 = load i64, i64* %19
%95 = load i32, i32* %14
%96 = sext i32 %95 to i64
%97 = icmp ult i64 %94, %96
br i1 %97, label %98, label %124
98: ; preds = %93
store i64 0, i64* %20
br label %99
99: ; preds = %117, %98
%100 = load i64, i64* %20
%101 = load i32, i32* %13
%102 = sext i32 %101 to i64
%103 = icmp ult i64 %100, %102
br i1 %103, label %104, label %120
104: ; preds = %99
%105 = load i64, i64* %19
%106 = load i32, i32* %14
%107 = sext i32 %106 to i64
%108 = mul i64 %105, %107
%109 = add i64 %108, 1
%110 = uitofp i64 %109 to float
%111 = load i64, i64* %19
%112 = uitofp i64 %111 to float
%113 = fadd float %110, %112
%114 = load float*, float** %28
store float %113, float* %114
%115 = load float*, float** %28
%116 = getelementptr inbounds float, float* %115, i32 1
store float* %116, float** %28
br label %117
117: ; preds = %104
%118 = load i64, i64* %20
%119 = add i64 %118, 1
store i64 %119, i64* %20
br label %99
120: ; preds = %99
br label %121
121: ; preds = %120
%122 = load i64, i64* %19
%123 = add i64 %122, 1
store i64 %123, i64* %19
br label %93
124: ; preds = %93
store i64 0, i64* %19
br label %125
125: ; preds = %154, %124
%126 = load i64, i64* %19
%127 = load i32, i32* %13
%128 = sext i32 %127 to i64
%129 = icmp ult i64 %126, %128
br i1 %129, label %130, label %157
130: ; preds = %125
store i64 0, i64* %20
br label %131
131: ; preds = %150, %130
%132 = load i64, i64* %20
%133 = load i32, i32* %12
%134 = sext i32 %133 to i64
%135 = icmp ult i64 %132, %134
br i1 %135, label %136, label %153
136: ; preds = %131
%137 = load i64, i64* %19
%138 = mul i64 %137, 10
%139 = load i32, i32* %14
%140 = sext i32 %139 to i64
%141 = add i64 %138, %140
%142 = add i64 %141, 3
%143 = uitofp i64 %142 to float
%144 = load float*, float** %30
store float %143, float* %144
%145 = load float*, float** %29
store float 0.000000e+00, float* %145
%146 = load float*, float** %30
%147 = getelementptr inbounds float, float* %146, i32 1
store float* %147, float** %30
%148 = load float*, float** %29
%149 = getelementptr inbounds float, float* %148, i32 1
store float* %149, float** %29
br label %150
150: ; preds = %136
%151 = load i64, i64* %20
%152 = add i64 %151, 1
store i64 %152, i64* %20
br label %131
153: ; preds = %131
br label %154
154: ; preds = %153
%155 = load i64, i64* %19
%156 = add i64 %155, 1
store i64 %156, i64* %19
br label %125
157: ; preds = %125
%158 = load i8*, i8** %23
%159 = bitcast i8* %158 to float*
store float* %159, float** %27
%160 = load i8*, i8** %24
%161 = bitcast i8* %160 to float*
store float* %161, float** %28
%162 = load i8*, i8** %25
%163 = bitcast i8* %162 to float*
store float* %163, float** %29
%164 = load i8*, i8** %26
%165 = bitcast i8* %164 to float*
store float* %165, float** %30
%166 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%167 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%168 = load i64, i64* %167
%169 = sitofp i64 %168 to double
%170 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%171 = load i64, i64* %170
%172 = sitofp i64 %171 to double
%173 = call double @llvm.fmuladd.f64(double %172, double 0x3EB0C6F7A0B5ED8D, double %169)
store double %173, double* %7
%174 = load i32, i32* %15
%175 = load i32, i32* %16
%176 = load i32, i32* %17
%177 = load i32, i32* %12
%178 = load i32, i32* %13
%179 = load i32, i32* %14
%180 = load float, float* %21
%181 = load float*, float** %27
%182 = load i32, i32* %10
%183 = load float*, float** %28
%184 = load i32, i32* %11
%185 = load float, float* %22
%186 = load float*, float** %30
%187 = load i32, i32* %18
%188 = call i32 @cblas_sgemm(i32 %174, i32 %175, i32 %176, i32 %177, i32 %178, i32 %179, float %180, float* %181, i32 %182, float* %183, i32 %184, float %185, float* %186, i32 %187)
%189 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%190 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%191 = load i64, i64* %190
%192 = sitofp i64 %191 to double
%193 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%194 = load i64, i64* %193
%195 = sitofp i64 %194 to double
%196 = call double @llvm.fmuladd.f64(double %195, double 0x3EB0C6F7A0B5ED8D, double %192)
store double %196, double* %8
%197 = load double, double* %8
%198 = load double, double* %7
%199 = fsub double %197, %198
store double %199, double* %9
%200 = load i32, i32* %12
%201 = sitofp i32 %200 to double
%202 = fmul double 2.000000e+00, %201
%203 = load i32, i32* %13
%204 = sitofp i32 %203 to double
%205 = fmul double %202, %204
%206 = load i32, i32* %14
%207 = sitofp i32 %206 to double
%208 = fmul double %205, %207
%209 = fmul double %208, 1.000000e-09
store double %209, double* %31
%210 = load double, double* %31
%211 = load double, double* %9
%212 = fdiv double %210, %211
store double %212, double* %32
%213 = load i32, i32* %12
%214 = load i32, i32* %13
%215 = load i32, i32* %14
%216 = load double, double* %9
%217 = load double, double* %31
%218 = load double, double* %32
%219 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 %213, i32 %214, i32 %215, double %216, double %217, double %218)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [58 x i8] c"GPU: %dx%dx%d size\09%10.8f sec\09%10.6f GFlop\09%10.8f GFlops\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = tail call dereferenceable_or_null(1073741824) i8* @malloc(i64 1073741824)
%6 = tail call dereferenceable_or_null(1073741824) i8* @malloc(i64 1073741824)
%7 = tail call dereferenceable_or_null(4294967296) i8* @malloc(i64 4294967296)
%8 = tail call dereferenceable_or_null(4294967296) i8* @malloc(i64 4294967296)
%9 = bitcast i8* %5 to float*
%10 = bitcast i8* %7 to float*
br label %11
11: ; preds = %11, %2
%12 = phi float* [ %9, %2 ], [ %46, %11 ]
%13 = phi i64 [ 0, %2 ], [ %47, %11 ]
%14 = mul nuw nsw i64 %13, 10
%15 = add nuw nsw i64 %14, 17
%16 = uitofp i64 %15 to float
%17 = fpext float %16 to double
%18 = fmul double %17, 1.000000e-02
%19 = fptrunc double %18 to float
%20 = insertelement <4 x float> poison, float %19, i64 0
%21 = shufflevector <4 x float> %20, <4 x float> poison, <4 x i32> zeroinitializer
%22 = bitcast float* %12 to <4 x float>*
store <4 x float> %21, <4 x float>* %22
%23 = getelementptr inbounds float, float* %12, i64 4
%24 = bitcast float* %23 to <4 x float>*
store <4 x float> %21, <4 x float>* %24
%25 = getelementptr inbounds float, float* %12, i64 8
%26 = bitcast float* %25 to <4 x float>*
store <4 x float> %21, <4 x float>* %26
%27 = getelementptr inbounds float, float* %12, i64 12
%28 = bitcast float* %27 to <4 x float>*
store <4 x float> %21, <4 x float>* %28
%29 = getelementptr inbounds float, float* %12, i64 16
%30 = or i64 %13, 1
%31 = mul nuw nsw i64 %30, 10
%32 = add nuw nsw i64 %31, 17
%33 = uitofp i64 %32 to float
%34 = fpext float %33 to double
%35 = fmul double %34, 1.000000e-02
%36 = fptrunc double %35 to float
%37 = insertelement <4 x float> poison, float %36, i64 0
%38 = shufflevector <4 x float> %37, <4 x float> poison, <4 x i32> zeroinitializer
%39 = bitcast float* %29 to <4 x float>*
store <4 x float> %38, <4 x float>* %39
%40 = getelementptr inbounds float, float* %12, i64 20
%41 = bitcast float* %40 to <4 x float>*
store <4 x float> %38, <4 x float>* %41
%42 = getelementptr inbounds float, float* %12, i64 24
%43 = bitcast float* %42 to <4 x float>*
store <4 x float> %38, <4 x float>* %43
%44 = getelementptr inbounds float, float* %12, i64 28
%45 = bitcast float* %44 to <4 x float>*
store <4 x float> %38, <4 x float>* %45
%46 = getelementptr inbounds float, float* %12, i64 32
%47 = add nuw nsw i64 %13, 2
%48 = icmp eq i64 %47, 128
br i1 %48, label %49, label %11
49: ; preds = %11
%50 = bitcast i8* %6 to float*
br label %51
51: ; preds = %49, %51
%52 = phi float* [ %92, %51 ], [ %50, %49 ]
%53 = phi i64 [ %93, %51 ], [ 0, %49 ]
%54 = shl i64 %53, 4
%55 = or i64 %54, 1
%56 = uitofp i64 %55 to float
%57 = uitofp i64 %53 to float
%58 = fadd float %57, %56
%59 = insertelement <4 x float> poison, float %58, i64 0
%60 = shufflevector <4 x float> %59, <4 x float> poison, <4 x i32> zeroinitializer
%61 = bitcast float* %52 to <4 x float>*
store <4 x float> %60, <4 x float>* %61
%62 = getelementptr inbounds float, float* %52, i64 4
%63 = bitcast float* %62 to <4 x float>*
store <4 x float> %60, <4 x float>* %63
%64 = getelementptr inbounds float, float* %52, i64 8
%65 = bitcast float* %64 to <4 x float>*
store <4 x float> %60, <4 x float>* %65
%66 = getelementptr inbounds float, float* %52, i64 12
%67 = bitcast float* %66 to <4 x float>*
store <4 x float> %60, <4 x float>* %67
%68 = getelementptr inbounds float, float* %52, i64 16
%69 = bitcast float* %68 to <4 x float>*
store <4 x float> %60, <4 x float>* %69
%70 = getelementptr inbounds float, float* %52, i64 20
%71 = bitcast float* %70 to <4 x float>*
store <4 x float> %60, <4 x float>* %71
%72 = getelementptr inbounds float, float* %52, i64 24
%73 = bitcast float* %72 to <4 x float>*
store <4 x float> %60, <4 x float>* %73
%74 = getelementptr inbounds float, float* %52, i64 28
%75 = bitcast float* %74 to <4 x float>*
store <4 x float> %60, <4 x float>* %75
%76 = getelementptr inbounds float, float* %52, i64 32
%77 = bitcast float* %76 to <4 x float>*
store <4 x float> %60, <4 x float>* %77
%78 = getelementptr inbounds float, float* %52, i64 36
%79 = bitcast float* %78 to <4 x float>*
store <4 x float> %60, <4 x float>* %79
%80 = getelementptr inbounds float, float* %52, i64 40
%81 = bitcast float* %80 to <4 x float>*
store <4 x float> %60, <4 x float>* %81
%82 = getelementptr inbounds float, float* %52, i64 44
%83 = bitcast float* %82 to <4 x float>*
store <4 x float> %60, <4 x float>* %83
%84 = getelementptr inbounds float, float* %52, i64 48
%85 = bitcast float* %84 to <4 x float>*
store <4 x float> %60, <4 x float>* %85
%86 = getelementptr inbounds float, float* %52, i64 52
%87 = bitcast float* %86 to <4 x float>*
store <4 x float> %60, <4 x float>* %87
%88 = getelementptr inbounds float, float* %52, i64 56
%89 = bitcast float* %88 to <4 x float>*
store <4 x float> %60, <4 x float>* %89
%90 = getelementptr inbounds float, float* %52, i64 60
%91 = bitcast float* %90 to <4 x float>*
store <4 x float> %60, <4 x float>* %91
%92 = getelementptr inbounds float, float* %52, i64 64
%93 = add nuw nsw i64 %53, 1
%94 = icmp eq i64 %93, 16
br i1 %94, label %95, label %51
95: ; preds = %51
%96 = bitcast i8* %8 to float*
br label %97
97: ; preds = %95, %97
%98 = phi float* [ %109, %97 ], [ %96, %95 ]
%99 = phi float* [ %173, %97 ], [ %10, %95 ]
%100 = phi i64 [ %174, %97 ], [ 0, %95 ]
%101 = bitcast float* %99 to i8*
%102 = mul nuw nsw i64 %100, 10
%103 = add nuw nsw i64 %102, 19
%104 = uitofp i64 %103 to float
%105 = insertelement <4 x float> poison, float %104, i64 0
%106 = shufflevector <4 x float> %105, <4 x float> poison, <4 x i32> zeroinitializer
%107 = insertelement <4 x float> poison, float %104, i64 0
%108 = shufflevector <4 x float> %107, <4 x float> poison, <4 x i32> zeroinitializer
%109 = getelementptr float, float* %98, i64 128
%110 = bitcast float* %98 to <4 x float>*
store <4 x float> %106, <4 x float>* %110
%111 = getelementptr float, float* %98, i64 4
%112 = bitcast float* %111 to <4 x float>*
store <4 x float> %108, <4 x float>* %112
%113 = getelementptr float, float* %98, i64 8
%114 = bitcast float* %113 to <4 x float>*
store <4 x float> %106, <4 x float>* %114
%115 = getelementptr float, float* %98, i64 12
%116 = bitcast float* %115 to <4 x float>*
store <4 x float> %108, <4 x float>* %116
%117 = getelementptr float, float* %98, i64 16
%118 = bitcast float* %117 to <4 x float>*
store <4 x float> %106, <4 x float>* %118
%119 = getelementptr float, float* %98, i64 20
%120 = bitcast float* %119 to <4 x float>*
store <4 x float> %108, <4 x float>* %120
%121 = getelementptr float, float* %98, i64 24
%122 = bitcast float* %121 to <4 x float>*
store <4 x float> %106, <4 x float>* %122
%123 = getelementptr float, float* %98, i64 28
%124 = bitcast float* %123 to <4 x float>*
store <4 x float> %108, <4 x float>* %124
%125 = getelementptr float, float* %98, i64 32
%126 = bitcast float* %125 to <4 x float>*
store <4 x float> %106, <4 x float>* %126
%127 = getelementptr float, float* %98, i64 36
%128 = bitcast float* %127 to <4 x float>*
store <4 x float> %108, <4 x float>* %128
%129 = getelementptr float, float* %98, i64 40
%130 = bitcast float* %129 to <4 x float>*
store <4 x float> %106, <4 x float>* %130
%131 = getelementptr float, float* %98, i64 44
%132 = bitcast float* %131 to <4 x float>*
store <4 x float> %108, <4 x float>* %132
%133 = getelementptr float, float* %98, i64 48
%134 = bitcast float* %133 to <4 x float>*
store <4 x float> %106, <4 x float>* %134
%135 = getelementptr float, float* %98, i64 52
%136 = bitcast float* %135 to <4 x float>*
store <4 x float> %108, <4 x float>* %136
%137 = getelementptr float, float* %98, i64 56
%138 = bitcast float* %137 to <4 x float>*
store <4 x float> %106, <4 x float>* %138
%139 = getelementptr float, float* %98, i64 60
%140 = bitcast float* %139 to <4 x float>*
store <4 x float> %108, <4 x float>* %140
%141 = getelementptr float, float* %98, i64 64
%142 = bitcast float* %141 to <4 x float>*
store <4 x float> %106, <4 x float>* %142
%143 = getelementptr float, float* %98, i64 68
%144 = bitcast float* %143 to <4 x float>*
store <4 x float> %108, <4 x float>* %144
%145 = getelementptr float, float* %98, i64 72
%146 = bitcast float* %145 to <4 x float>*
store <4 x float> %106, <4 x float>* %146
%147 = getelementptr float, float* %98, i64 76
%148 = bitcast float* %147 to <4 x float>*
store <4 x float> %108, <4 x float>* %148
%149 = getelementptr float, float* %98, i64 80
%150 = bitcast float* %149 to <4 x float>*
store <4 x float> %106, <4 x float>* %150
%151 = getelementptr float, float* %98, i64 84
%152 = bitcast float* %151 to <4 x float>*
store <4 x float> %108, <4 x float>* %152
%153 = getelementptr float, float* %98, i64 88
%154 = bitcast float* %153 to <4 x float>*
store <4 x float> %106, <4 x float>* %154
%155 = getelementptr float, float* %98, i64 92
%156 = bitcast float* %155 to <4 x float>*
store <4 x float> %108, <4 x float>* %156
%157 = getelementptr float, float* %98, i64 96
%158 = bitcast float* %157 to <4 x float>*
store <4 x float> %106, <4 x float>* %158
%159 = getelementptr float, float* %98, i64 100
%160 = bitcast float* %159 to <4 x float>*
store <4 x float> %108, <4 x float>* %160
%161 = getelementptr float, float* %98, i64 104
%162 = bitcast float* %161 to <4 x float>*
store <4 x float> %106, <4 x float>* %162
%163 = getelementptr float, float* %98, i64 108
%164 = bitcast float* %163 to <4 x float>*
store <4 x float> %108, <4 x float>* %164
%165 = getelementptr float, float* %98, i64 112
%166 = bitcast float* %165 to <4 x float>*
store <4 x float> %106, <4 x float>* %166
%167 = getelementptr float, float* %98, i64 116
%168 = bitcast float* %167 to <4 x float>*
store <4 x float> %108, <4 x float>* %168
%169 = getelementptr float, float* %98, i64 120
%170 = bitcast float* %169 to <4 x float>*
store <4 x float> %106, <4 x float>* %170
%171 = getelementptr float, float* %98, i64 124
%172 = bitcast float* %171 to <4 x float>*
store <4 x float> %108, <4 x float>* %172
%173 = getelementptr float, float* %99, i64 128
%174 = add nuw nsw i64 %100, 1
%175 = icmp eq i64 %174, 64
br i1 %175, label %176, label %97
176: ; preds = %97
%177 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%178 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%179 = load i64, i64* %178
%180 = sitofp i64 %179 to double
%181 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%182 = load i64, i64* %181
%183 = sitofp i64 %182 to double
%184 = tail call double @llvm.fmuladd.f64(double %183, double 0x3EB0C6F7A0B5ED8D, double %180)
%185 = tail call i32 @cblas_sgemm(i32 102, i32 111, i32 111, i32 128, i32 64, i32 16, float 2.000000e+00, float* %9, i32 128, float* %50, i32 16, float 2.000000e+00, float* %96, i32 128)
%186 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%187 = load i64, i64* %178
%188 = sitofp i64 %187 to double
%189 = load i64, i64* %181
%190 = sitofp i64 %189 to double
%191 = tail call double @llvm.fmuladd.f64(double %190, double 0x3EB0C6F7A0B5ED8D, double %188)
%192 = fsub double %191, %184
%193 = fdiv double 2.621440e-04, %192
%194 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 128, i32 64, i32 16, double %192, double 2.621440e-04, double %193)
ret i32 0
}