#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 */
double acos(double);
double cos(double);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, double);
int /*<<< orphan*/ libtetrabz_mp_libtetrabz_dos_(int *, double *, int *, int *,
                                                 double *, int *, double *,
                                                 int *, double *);
int /*<<< orphan*/ libtetrabz_mp_libtetrabz_fermieng_(int *, double *, int *,
                                                      int *, double *, int *,
                                                      double *, double *,
                                                      double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int ltetra, nb, ng, nge[3], ngw[3], ii, i0, i1, i2, ik, ne, ie, nke, nkw;
  double bvec[9], ef, nelec, kvec[3], pi, sumdos;
  double *eig, *wght, *e0, *wght_dos;
  FILE *fp;
  printf("Which tetrahedron method ?(1 = Linear, 2 = Optimized): ");
  scanf("%d", &ltetra);
  printf("\n k-point mesh ?: ");
  scanf("%d", &ng);
  pi = acos(-1.0);
  nb = 1;
  for (ii = 0; ii < 3; ii++)
    nge[ii] = ng;
  for (ii = 0; ii < 3; ii++)
    ngw[ii] = ng;
  nelec = 0.5;
  bvec[0] = 1.0;
  bvec[1] = 0.0;
  bvec[2] = 0.0;
  bvec[3] = 0.0;
  bvec[4] = 1.0;
  bvec[5] = 0.0;
  bvec[6] = 0.0;
  bvec[7] = 0.0;
  bvec[8] = 1.0;
  nke = nge[0] * nge[1] * nge[2];
  nkw = ngw[0] * ngw[1] * ngw[2];
  eig = (double *)malloc(nb * nke * sizeof(double));
  wght = (double *)malloc(nb * nkw * sizeof(double));
  ik = 0;
  for (i2 = 0; i2 < nge[2]; i2++) {
    for (i1 = 0; i1 < nge[1]; i1++) {
      for (i0 = 0; i0 < nge[0]; i0++) {
        kvec[0] = 2.0 * pi * (double)(i0 - nge[0] / 2) / (double)nge[0];
        kvec[1] = 2.0 * pi * (double)(i1 - nge[1] / 2) / (double)nge[1];
        kvec[2] = 2.0 * pi * (double)(i2 - nge[2] / 2) / (double)nge[2];
        eig[nb * ik] = -cos(kvec[0]) - cos(kvec[1]) - cos(kvec[2]);
        ik += 1;
      }
    }
  }
  libtetrabz_mp_libtetrabz_fermieng_(&ltetra, bvec, &nb, nge, eig, ngw, wght,
                                     &ef, &nelec);
  printf("  E_F = %25.15e\n", ef);
  ne = 100;
  wght_dos = (double *)malloc(ne * nb * nkw * sizeof(double));
  e0 = (double *)malloc(ne * sizeof(double));
  for (ie = 0; ie < ne; ie++) {
    e0[ie] = 6.0 / (double)(ne - 1) * (double)ie - 3.0;
  }
  libtetrabz_mp_libtetrabz_dos_(&ltetra, bvec, &nb, nge, eig, ngw, wght_dos,
                                &ne, e0);
  fp = fopen("dos.dat", "w");
  for (ie = 0; ie < ne; ie++) {
    sumdos = 0.0;
    for (ik = 0; ik < nb * nkw; ik++)
      sumdos += wght_dos[ie + ik * ne];
    fprintf(fp, "%25.15e  %25.15e\n", e0[ie], sumdos);
  }
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe9a(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   10a0 <scanf@plt>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe7c(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   10a0 <scanf@plt>
movsd  0xe03(%rip),%xmm0
call   1060 <acos@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
movl   $0x1,-0x18(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0x3,-0x38(%rbp)
jge    123b <main+0x9b>
mov    -0x1c(%rbp),%ecx
movslq -0x38(%rbp),%rax
mov    %ecx,-0x28(%rbp,%rax,4)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1218 <main+0x78>
movl   $0x0,-0x38(%rbp)
cmpl   $0x3,-0x38(%rbp)
jge    1265 <main+0xc5>
mov    -0x1c(%rbp),%ecx
movslq -0x38(%rbp),%rax
mov    %ecx,-0x34(%rbp,%rax,4)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1242 <main+0xa2>
movsd  0xda3(%rip),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xd8b(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xd5a(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xd35(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%eax
imul   -0x24(%rbp),%eax
imul   -0x20(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x30(%rbp),%eax
imul   -0x2c(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x18(%rbp),%eax
imul   -0x54(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0xe8(%rbp)
mov    -0x18(%rbp),%eax
imul   -0x58(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0xf0(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    14fe <main+0x35e>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    14eb <main+0x34b>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    14d8 <main+0x338>
movsd  0xcb6(%rip),%xmm0
mulsd  -0xd8(%rbp),%xmm0
ff
mov    -0x3c(%rbp),%eax
mov    %eax,-0x124(%rbp)
mov    -0x28(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x124(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  0xc6f(%rip),%xmm0
mulsd  -0xd8(%rbp),%xmm0
ff
mov    -0x40(%rbp),%eax
mov    %eax,-0x120(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x120(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  0xc28(%rip),%xmm0
mulsd  -0xd8(%rbp),%xmm0
ff
mov    -0x44(%rbp),%eax
mov    %eax,-0x11c(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x11c(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
call   10b0 <cos@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
call   10b0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x118(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
call   10b0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x110(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
mov    -0xe8(%rbp),%rax
mov    -0x18(%rbp),%ecx
imul   -0x48(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    135e <main+0x1be>
jmp    14dd <main+0x33d>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    134b <main+0x1ab>
jmp    14f0 <main+0x350>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1338 <main+0x198>
lea    -0xa0(%rbp),%rsi
lea    -0x28(%rbp),%rcx
mov    -0xe8(%rbp),%r8
lea    -0x34(%rbp),%r9
mov    -0xf0(%rbp),%r11
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rdx
lea    -0xa8(%rbp),%r10
lea    -0xb0(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1090 <libtetrabz_mp_libtetrabz_fermieng_@plt>
movsd  -0xa8(%rbp),%xmm0
ff
lea    0xb2b(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movl   $0x64,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
imul   -0x18(%rbp),%eax
imul   -0x58(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x100(%rbp)
movslq -0x4c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0xf8(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    15f2 <main+0x452>
mov    -0x4c(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xa65(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsi2sdl -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xa48(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0xf8(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    159d <main+0x3fd>
lea    -0xa0(%rbp),%rsi
lea    -0x28(%rbp),%rcx
mov    -0xe8(%rbp),%r8
lea    -0x34(%rbp),%r9
mov    -0x100(%rbp),%r11
mov    -0xf8(%rbp),%rax
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rdx
lea    -0x4c(%rbp),%r10
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <libtetrabz_mp_libtetrabz_dos_@plt>
lea    0xa53(%rip),%rdi
lea    0xa54(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x108(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    16f8 <main+0x558>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   -0x58(%rbp),%ecx
cmp    %ecx,%eax
jge    16bf <main+0x51f>
mov    -0x100(%rbp),%rax
mov    -0x50(%rbp),%ecx
mov    -0x48(%rbp),%edx
imul   -0x4c(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1674 <main+0x4d4>
mov    -0x108(%rbp),%rdi
mov    -0xf8(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0xe0(%rbp),%xmm1
ff
lea    0x9b4(%rip),%rsi
call   1070 <fprintf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1656 <main+0x4b6>
mov    -0x108(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
lea    0xec8(%rip),%rdi
xor    %r15d,%r15d
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeef(%rip),%rbx
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1090 <scanf@plt>
lea    0xede(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1090 <scanf@plt>
movl   $0x1,0x8(%rsp)
mov    0x30(%rsp),%ebp
mov    %ebp,0x10(%rsp)
mov    %ebp,0x14(%rsp)
mov    %ebp,0x18(%rsp)
mov    %ebp,0x34(%rsp)
mov    %ebp,0x38(%rsp)
mov    %ebp,0x3c(%rsp)
movabs $0x3fe0000000000000,%rax
mov    %rax,0x60(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x70(%rsp)
xorpd  %xmm0,%xmm0
movupd %xmm0,0x78(%rsp)
movq   $0x0,0x88(%rsp)
mov    %rax,0x90(%rsp)
movupd %xmm0,0x98(%rsp)
movq   $0x0,0xa8(%rsp)
mov    %rax,0xb0(%rsp)
mov    %ebp,%eax
imul   %eax,%eax
imul   %ebp,%eax
mov    %rax,0x40(%rsp)
lea    0x0(,%rax,8),%r14d
mov    %r14d,%edi
call   1070 <malloc@plt>
mov    %rax,%r12
mov    %r14d,%edi
call   1070 <malloc@plt>
mov    %rax,0x48(%rsp)
test   %ebp,%ebp
jle    13d9 <main+0x249>
movsd  0xd65(%rip),%xmm2
mov    %ebp,%eax
mov    %ebp,%ecx
xor    %ebx,%ebx
jmp    12c1 <main+0x131>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x18(%rsp),%ebp
add    $0x1,%r15d
cmp    %ebp,%r15d
jge    13d9 <main+0x249>
test   %eax,%eax
jle    12b4 <main+0x124>
xor    %ebp,%ebp
jmp    12d7 <main+0x147>
nopl   0x0(%rax)
add    $0x1,%ebp
cmp    %eax,%ebp
jge    12b0 <main+0x120>
test   %ecx,%ecx
jle    12d0 <main+0x140>
xor    %r14d,%r14d
xchg   %ax,%ax
lea    (%rbx,%r14,1),%r13d
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
mov    %r14d,%esi
sub    %edx,%esi
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
mulsd  %xmm2,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
mov    %ebp,%edx
sub    %ecx,%edx
xorps  %xmm3,%xmm3
cvtsi2sd %edx,%xmm3
divsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm3
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm3
movsd  %xmm3,0x58(%rsp)
mov    0x18(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
mov    %r15d,%edx
sub    %ecx,%edx
xorps  %xmm3,%xmm3
cvtsi2sd %edx,%xmm3
mulsd  %xmm2,%xmm3
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm3
movsd  %xmm3,0x50(%rsp)
call   10a0 <cos@plt>
xorpd  0xca4(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
movsd  0x58(%rsp),%xmm0
call   10a0 <cos@plt>
movapd 0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,0x20(%rsp)
movsd  0x50(%rsp),%xmm0
call   10a0 <cos@plt>
movsd  0xc60(%rip),%xmm2
movapd 0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movslq 0x8(%rsp),%rax
movslq %r13d,%rcx
imul   %rax,%rcx
movsd  %xmm1,(%r12,%rcx,8)
add    $0x1,%r14d
mov    0x10(%rsp),%ecx
mov    0x14(%rsp),%eax
cmp    %ecx,%r14d
jl     12e0 <main+0x150>
add    %r14d,%ebx
jmp    12d0 <main+0x140>
sub    $0x8,%rsp
lea    0x68(%rsp),%rax
lea    0x70(%rsp),%rbp
lea    0x24(%rsp),%rdi
lea    0x78(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x3c(%rsp),%r9
mov    %r12,%r8
push   %rax
push   %rbp
push   0x60(%rsp)
call   1080 <libtetrabz_mp_libtetrabz_fermieng_@plt>
add    $0x20,%rsp
movsd  0x68(%rsp),%xmm0
lea    0xc9f(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movl   $0x64,0xc(%rsp)
mov    0x8(%rsp),%eax
imul   0x40(%rsp),%eax
imul   $0x320,%eax,%edi
call   1070 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    $0x320,%edi
call   1070 <malloc@plt>
mov    %rax,%r15
movdqa 0xbc4(%rip),%xmm0
mov    $0x2,%eax
movapd 0xbc7(%rip),%xmm1
movapd 0xbcf(%rip),%xmm2
movdqa 0xbd7(%rip),%xmm3
movdqa 0xbdf(%rip),%xmm4
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cvtdq2pd %xmm0,%xmm5
mulpd  %xmm1,%xmm5
addpd  %xmm2,%xmm5
movupd %xmm5,-0x10(%r15,%rax,8)
movdqa %xmm0,%xmm5
paddd  %xmm3,%xmm5
cvtdq2pd %xmm5,%xmm5
mulpd  %xmm1,%xmm5
addpd  %xmm2,%xmm5
movupd %xmm5,(%r15,%rax,8)
paddd  %xmm4,%xmm0
add    $0x4,%rax
cmp    $0x66,%rax
jne    1490 <main+0x300>
sub    $0x8,%rsp
lea    0x14(%rsp),%rax
lea    0x24(%rsp),%rdi
lea    0x78(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x3c(%rsp),%r9
mov    %r12,%r8
push   %r15
push   %rax
push   0x38(%rsp)
call   1040 <libtetrabz_mp_libtetrabz_dos_@plt>
add    $0x20,%rsp
lea    0xbc8(%rip),%rdi
lea    0xbc9(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r13
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1612 <main+0x482>
xor    %r12d,%r12d
mov    0x20(%rsp),%r14
jmp    155f <main+0x3cf>
nopl   0x0(%rax)
xorpd  %xmm1,%xmm1
movq   (%r15,%r12,8),%xmm0
mov    %r13,%rdi
lea    0xb95(%rip),%rsi
call   1060 <fprintf@plt>
add    $0x1,%r12
movslq 0xc(%rsp),%rax
add    $0x8,%r14
cmp    %rax,%r12
jge    1612 <main+0x482>
mov    0x8(%rsp),%ecx
imul   0x40(%rsp),%ecx
test   %ecx,%ecx
jle    1530 <main+0x3a0>
movslq %eax,%r8
mov    %ecx,%r9d
lea    -0x1(%r9),%rax
mov    %r9d,%ecx
and    $0x3,%ecx
cmp    $0x3,%rax
jae    1590 <main+0x400>
xorpd  %xmm1,%xmm1
xor    %esi,%esi
jmp    15e2 <main+0x452>
nopw   0x0(%rax,%rax,1)
and    $0xfffffffc,%r9d
mov    %r8,%rdi
shl    $0x4,%rdi
add    %r14,%rdi
mov    %r8,%rax
shl    $0x5,%rax
lea    (%r14,%r8,8),%rbp
lea    (%r8,%r8,2),%rdx
lea    (%r14,%rdx,8),%rbx
xorpd  %xmm1,%xmm1
xor    %edx,%edx
xor    %esi,%esi
nopl   0x0(%rax)
addsd  (%r14,%rdx,1),%xmm1
addsd  0x0(%rbp,%rdx,1),%xmm1
addsd  (%rdi,%rdx,1),%xmm1
addsd  (%rbx,%rdx,1),%xmm1
add    $0x4,%rsi
add    %rax,%rdx
cmp    %rsi,%r9
jne    15c0 <main+0x430>
test   %rcx,%rcx
je     1534 <main+0x3a4>
imul   %r8,%rsi
add    %r12,%rsi
mov    0x20(%rsp),%rax
lea    (%rax,%rsi,8),%rax
shl    $0x3,%r8
nop
addsd  (%rax),%xmm1
add    %r8,%rax
add    $0xffffffffffffffff,%rcx
jne    1600 <main+0x470>
jmp    1534 <main+0x3a4>
mov    %r13,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [56 x i8] c"Which tetrahedron method ?(1 = Linear, 2 = Optimized): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"\0A k-point mesh ?: \00"
@.str.3 = [17 x i8] c" E_F = %25.15e\0A\00"
@.str.4 = [8 x i8] c"dos.dat\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [18 x i8] c"%25.15e %25.15e\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 i32
%9 = alloca [3 x i32]
%10 = alloca [3 x 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 i32
%20 = alloca [9 x double]
%21 = alloca double
%22 = alloca double
%23 = alloca [3 x double]
%24 = alloca double
%25 = alloca double
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
%29 = alloca double*
%30 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%35 = call double @acos(double -1.000000e+00)
store double %35, double* %24
store i32 1, i32* %7
store i32 0, i32* %11
br label %36
36: ; preds = %44, %2
%37 = load i32, i32* %11
%38 = icmp slt i32 %37, 3
br i1 %38, label %39, label %47
39: ; preds = %36
%40 = load i32, i32* %8
%41 = load i32, i32* %11
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 %42
store i32 %40, i32* %43
br label %44
44: ; preds = %39
%45 = load i32, i32* %11
%46 = add nsw i32 %45, 1
store i32 %46, i32* %11
br label %36
47: ; preds = %36
store i32 0, i32* %11
br label %48
48: ; preds = %56, %47
%49 = load i32, i32* %11
%50 = icmp slt i32 %49, 3
br i1 %50, label %51, label %59
51: ; preds = %48
%52 = load i32, i32* %8
%53 = load i32, i32* %11
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 %54
store i32 %52, i32* %55
br label %56
56: ; preds = %51
%57 = load i32, i32* %11
%58 = add nsw i32 %57, 1
store i32 %58, i32* %11
br label %48
59: ; preds = %48
store double 5.000000e-01, double* %22
%60 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 0
store double 1.000000e+00, double* %60
%61 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 1
store double 0.000000e+00, double* %61
%62 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 2
store double 0.000000e+00, double* %62
%63 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 3
store double 0.000000e+00, double* %63
%64 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 4
store double 1.000000e+00, double* %64
%65 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 5
store double 0.000000e+00, double* %65
%66 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 6
store double 0.000000e+00, double* %66
%67 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 7
store double 0.000000e+00, double* %67
%68 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 8
store double 1.000000e+00, double* %68
%69 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%70 = load i32, i32* %69
%71 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 1
%72 = load i32, i32* %71
%73 = mul nsw i32 %70, %72
%74 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 2
%75 = load i32, i32* %74
%76 = mul nsw i32 %73, %75
store i32 %76, i32* %18
%77 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%78 = load i32, i32* %77
%79 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 1
%80 = load i32, i32* %79
%81 = mul nsw i32 %78, %80
%82 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 2
%83 = load i32, i32* %82
%84 = mul nsw i32 %81, %83
store i32 %84, i32* %19
%85 = load i32, i32* %7
%86 = load i32, i32* %18
%87 = mul nsw i32 %85, %86
%88 = sext i32 %87 to i64
%89 = mul i64 %88, 8
%90 = trunc i64 %89 to i32
%91 = call i64 @malloc(i32 %90)
%92 = inttoptr i64 %91 to double*
store double* %92, double** %26
%93 = load i32, i32* %7
%94 = load i32, i32* %19
%95 = mul nsw i32 %93, %94
%96 = sext i32 %95 to i64
%97 = mul i64 %96, 8
%98 = trunc i64 %97 to i32
%99 = call i64 @malloc(i32 %98)
%100 = inttoptr i64 %99 to double*
store double* %100, double** %27
store i32 0, i32* %15
store i32 0, i32* %14
br label %101
101: ; preds = %189, %59
%102 = load i32, i32* %14
%103 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 2
%104 = load i32, i32* %103
%105 = icmp slt i32 %102, %104
br i1 %105, label %106, label %192
106: ; preds = %101
store i32 0, i32* %13
br label %107
107: ; preds = %185, %106
%108 = load i32, i32* %13
%109 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 1
%110 = load i32, i32* %109
%111 = icmp slt i32 %108, %110
br i1 %111, label %112, label %188
112: ; preds = %107
store i32 0, i32* %12
br label %113
113: ; preds = %181, %112
%114 = load i32, i32* %12
%115 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%116 = load i32, i32* %115
%117 = icmp slt i32 %114, %116
br i1 %117, label %118, label %184
118: ; preds = %113
%119 = load double, double* %24
%120 = fmul double 2.000000e+00, %119
%121 = load i32, i32* %12
%122 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%123 = load i32, i32* %122
%124 = sdiv i32 %123, 2
%125 = sub nsw i32 %121, %124
%126 = sitofp i32 %125 to double
%127 = fmul double %120, %126
%128 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%129 = load i32, i32* %128
%130 = sitofp i32 %129 to double
%131 = fdiv double %127, %130
%132 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 0, i64 0
store double %131, double* %132
%133 = load double, double* %24
%134 = fmul double 2.000000e+00, %133
%135 = load i32, i32* %13
%136 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 1
%137 = load i32, i32* %136
%138 = sdiv i32 %137, 2
%139 = sub nsw i32 %135, %138
%140 = sitofp i32 %139 to double
%141 = fmul double %134, %140
%142 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 1
%143 = load i32, i32* %142
%144 = sitofp i32 %143 to double
%145 = fdiv double %141, %144
%146 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 0, i64 1
store double %145, double* %146
%147 = load double, double* %24
%148 = fmul double 2.000000e+00, %147
%149 = load i32, i32* %14
%150 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 2
%151 = load i32, i32* %150
%152 = sdiv i32 %151, 2
%153 = sub nsw i32 %149, %152
%154 = sitofp i32 %153 to double
%155 = fmul double %148, %154
%156 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 2
%157 = load i32, i32* %156
%158 = sitofp i32 %157 to double
%159 = fdiv double %155, %158
%160 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 0, i64 2
store double %159, double* %160
%161 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 0, i64 0
%162 = load double, double* %161
%163 = call double @cos(double %162)
%164 = fneg double %163
%165 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 0, i64 1
%166 = load double, double* %165
%167 = call double @cos(double %166)
%168 = fsub double %164, %167
%169 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 0, i64 2
%170 = load double, double* %169
%171 = call double @cos(double %170)
%172 = fsub double %168, %171
%173 = load double*, double** %26
%174 = load i32, i32* %7
%175 = load i32, i32* %15
%176 = mul nsw i32 %174, %175
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds double, double* %173, i64 %177
store double %172, double* %178
%179 = load i32, i32* %15
%180 = add nsw i32 %179, 1
store i32 %180, i32* %15
br label %181
181: ; preds = %118
%182 = load i32, i32* %12
%183 = add nsw i32 %182, 1
store i32 %183, i32* %12
br label %113
184: ; preds = %113
br label %185
185: ; preds = %184
%186 = load i32, i32* %13
%187 = add nsw i32 %186, 1
store i32 %187, i32* %13
br label %107
188: ; preds = %107
br label %189
189: ; preds = %188
%190 = load i32, i32* %14
%191 = add nsw i32 %190, 1
store i32 %191, i32* %14
br label %101
192: ; preds = %101
%193 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 0
%194 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%195 = load double*, double** %26
%196 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%197 = load double*, double** %27
%198 = call i32 @libtetrabz_mp_libtetrabz_fermieng_(i32* %6, double* %193, i32* %7, i32* %194, double* %195, i32* %196, double* %197, double* %21, double* %22)
%199 = load double, double* %21
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double %199)
store i32 100, i32* %16
%201 = load i32, i32* %16
%202 = load i32, i32* %7
%203 = mul nsw i32 %201, %202
%204 = load i32, i32* %19
%205 = mul nsw i32 %203, %204
%206 = sext i32 %205 to i64
%207 = mul i64 %206, 8
%208 = trunc i64 %207 to i32
%209 = call i64 @malloc(i32 %208)
%210 = inttoptr i64 %209 to double*
store double* %210, double** %29
%211 = load i32, i32* %16
%212 = sext i32 %211 to i64
%213 = mul i64 %212, 8
%214 = trunc i64 %213 to i32
%215 = call i64 @malloc(i32 %214)
%216 = inttoptr i64 %215 to double*
store double* %216, double** %28
store i32 0, i32* %17
br label %217
217: ; preds = %233, %192
%218 = load i32, i32* %17
%219 = load i32, i32* %16
%220 = icmp slt i32 %218, %219
br i1 %220, label %221, label %236
221: ; preds = %217
%222 = load i32, i32* %16
%223 = sub nsw i32 %222, 1
%224 = sitofp i32 %223 to double
%225 = fdiv double 6.000000e+00, %224
%226 = load i32, i32* %17
%227 = sitofp i32 %226 to double
%228 = call double @llvm.fmuladd.f64(double %225, double %227, double -3.000000e+00)
%229 = load double*, double** %28
%230 = load i32, i32* %17
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds double, double* %229, i64 %231
store double %228, double* %232
br label %233
233: ; preds = %221
%234 = load i32, i32* %17
%235 = add nsw i32 %234, 1
store i32 %235, i32* %17
br label %217
236: ; preds = %217
%237 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 0
%238 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%239 = load double*, double** %26
%240 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%241 = load double*, double** %29
%242 = load double*, double** %28
%243 = call i32 @libtetrabz_mp_libtetrabz_dos_(i32* %6, double* %237, i32* %7, i32* %238, double* %239, i32* %240, double* %241, i32* %16, double* %242)
%244 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %244, i32** %30
store i32 0, i32* %17
br label %245
245: ; preds = %280, %236
%246 = load i32, i32* %17
%247 = load i32, i32* %16
%248 = icmp slt i32 %246, %247
br i1 %248, label %249, label %283
249: ; preds = %245
store double 0.000000e+00, double* %25
store i32 0, i32* %15
br label %250
250: ; preds = %268, %249
%251 = load i32, i32* %15
%252 = load i32, i32* %7
%253 = load i32, i32* %19
%254 = mul nsw i32 %252, %253
%255 = icmp slt i32 %251, %254
br i1 %255, label %256, label %271
256: ; preds = %250
%257 = load double*, double** %29
%258 = load i32, i32* %17
%259 = load i32, i32* %15
%260 = load i32, i32* %16
%261 = mul nsw i32 %259, %260
%262 = add nsw i32 %258, %261
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds double, double* %257, i64 %263
%265 = load double, double* %264
%266 = load double, double* %25
%267 = fadd double %266, %265
store double %267, double* %25
br label %268
268: ; preds = %256
%269 = load i32, i32* %15
%270 = add nsw i32 %269, 1
store i32 %270, i32* %15
br label %250
271: ; preds = %250
%272 = load i32*, i32** %30
%273 = load double*, double** %28
%274 = load i32, i32* %17
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds double, double* %273, i64 %275
%277 = load double, double* %276
%278 = load double, double* %25
%279 = call i32 @fprintf(i32* %272, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), double %277, double %278)
br label %280
280: ; preds = %271
%281 = load i32, i32* %17
%282 = add nsw i32 %281, 1
store i32 %282, i32* %17
br label %245
283: ; preds = %245
%284 = load i32*, i32** %30
%285 = call i32 @fclose(i32* %284)
%286 = load i32, i32* %3
ret i32 %286
}

LLVM IR (-O2):
@.str = [56 x i8] c"Which tetrahedron method ?(1 = Linear, 2 = Optimized): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"\0A k-point mesh ?: \00"
@.str.3 = [17 x i8] c" E_F = %25.15e\0A\00"
@.str.4 = [8 x i8] c"dos.dat\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [18 x i8] c"%25.15e %25.15e\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [3 x i32]
%7 = alloca [3 x i32]
%8 = alloca i32
%9 = alloca [9 x double]
%10 = alloca double
%11 = alloca double
%12 = bitcast i32* %3 to i8*
%13 = bitcast i32* %4 to i8*
%14 = bitcast i32* %5 to i8*
%15 = bitcast [3 x i32]* %6 to i8*
%16 = bitcast [3 x i32]* %7 to i8*
%17 = bitcast i32* %8 to i8*
%18 = bitcast [9 x double]* %9 to i8*
%19 = bitcast double* %10 to i8*
%20 = bitcast double* %11 to i8*
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
store i32 1, i32* %4
%25 = load i32, i32* %5
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32 %25, i32* %26
%27 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
store i32 %25, i32* %27
%28 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
store i32 %25, i32* %28
%29 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
store i32 %25, i32* %29
%30 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 1
store i32 %25, i32* %30
%31 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 2
store i32 %25, i32* %31
store double 5.000000e-01, double* %11
%32 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 0
store double 1.000000e+00, double* %32
%33 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 1
%34 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 4
%35 = bitcast double* %33 to i8*
store double 1.000000e+00, double* %34
%36 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 5
%37 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 8
%38 = bitcast double* %36 to i8*
store double 1.000000e+00, double* %37
%39 = mul nsw i32 %25, %25
%40 = mul nsw i32 %39, %25
%41 = shl i32 %25, 3
%42 = mul i32 %41, %25
%43 = mul i32 %42, %25
%44 = call i64 @malloc(i32 %43)
%45 = inttoptr i64 %44 to double*
%46 = shl i32 %40, 3
%47 = call i64 @malloc(i32 %46)
%48 = inttoptr i64 %47 to double*
%49 = icmp sgt i32 %25, 0
br i1 %49, label %50, label %120
50: ; preds = %2, %112
%51 = phi i32 [ %113, %112 ], [ %25, %2 ]
%52 = phi i32 [ %114, %112 ], [ %25, %2 ]
%53 = phi i32 [ %115, %112 ], [ %25, %2 ]
%54 = phi i32 [ %116, %112 ], [ %25, %2 ]
%55 = phi i32 [ %118, %112 ], [ 0, %2 ]
%56 = phi i32 [ %117, %112 ], [ 0, %2 ]
%57 = icmp sgt i32 %54, 0
br i1 %57, label %58, label %112
58: ; preds = %50, %104
%59 = phi i32 [ %105, %104 ], [ %52, %50 ]
%60 = phi i32 [ %105, %104 ], [ %54, %50 ]
%61 = phi i32 [ %106, %104 ], [ %53, %50 ]
%62 = phi i32 [ %108, %104 ], [ 0, %50 ]
%63 = phi i32 [ %107, %104 ], [ %56, %50 ]
%64 = icmp sgt i32 %61, 0
br i1 %64, label %65, label %104
65: ; preds = %58, %65
%66 = phi i32 [ %103, %65 ], [ %60, %58 ]
%67 = phi i32 [ %101, %65 ], [ %61, %58 ]
%68 = phi i32 [ %100, %65 ], [ 0, %58 ]
%69 = phi i32 [ %99, %65 ], [ %63, %58 ]
%70 = sdiv i32 %67, -2
%71 = add i32 %70, %68
%72 = sitofp i32 %71 to double
%73 = fmul double %72, 0x401921FB54442D18
%74 = sitofp i32 %67 to double
%75 = fdiv double %73, %74
%76 = sdiv i32 %66, -2
%77 = add i32 %76, %62
%78 = sitofp i32 %77 to double
%79 = fmul double %78, 0x401921FB54442D18
%80 = sitofp i32 %66 to double
%81 = fdiv double %79, %80
%82 = load i32, i32* %28
%83 = sdiv i32 %82, -2
%84 = add i32 %83, %55
%85 = sitofp i32 %84 to double
%86 = fmul double %85, 0x401921FB54442D18
%87 = sitofp i32 %82 to double
%88 = fdiv double %86, %87
%89 = call double @cos(double %75)
%90 = fneg double %89
%91 = call double @cos(double %81)
%92 = fsub double %90, %91
%93 = call double @cos(double %88)
%94 = fsub double %92, %93
%95 = load i32, i32* %4
%96 = mul nsw i32 %95, %69
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds double, double* %45, i64 %97
store double %94, double* %98
%99 = add nsw i32 %69, 1
%100 = add nuw nsw i32 %68, 1
%101 = load i32, i32* %26
%102 = icmp slt i32 %100, %101
%103 = load i32, i32* %27
br i1 %102, label %65, label %104
104: ; preds = %65, %58
%105 = phi i32 [ %59, %58 ], [ %103, %65 ]
%106 = phi i32 [ %61, %58 ], [ %101, %65 ]
%107 = phi i32 [ %63, %58 ], [ %99, %65 ]
%108 = add nuw nsw i32 %62, 1
%109 = icmp slt i32 %108, %105
br i1 %109, label %58, label %110
110: ; preds = %104
%111 = load i32, i32* %28
br label %112
112: ; preds = %110, %50
%113 = phi i32 [ %51, %50 ], [ %111, %110 ]
%114 = phi i32 [ %52, %50 ], [ %105, %110 ]
%115 = phi i32 [ %53, %50 ], [ %106, %110 ]
%116 = phi i32 [ %54, %50 ], [ %105, %110 ]
%117 = phi i32 [ %56, %50 ], [ %107, %110 ]
%118 = add nuw nsw i32 %55, 1
%119 = icmp slt i32 %118, %113
br i1 %119, label %50, label %120
120: ; preds = %112, %2
%121 = call i32 @libtetrabz_mp_libtetrabz_fermieng_(i32* %3, double* %32, i32* %4, i32* %26, double* %45, i32* %29, double* %48, double* %10, double* %11)
%122 = load double, double* %10
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double %122)
store i32 100, i32* %8
%124 = load i32, i32* %4
%125 = mul i32 %40, 800
%126 = mul i32 %125, %124
%127 = call i64 @malloc(i32 %126)
%128 = inttoptr i64 %127 to double*
%129 = call i64 @malloc(i32 800)
%130 = inttoptr i64 %129 to double*
br label %131
131: ; preds = %131, %120
%132 = phi i64 [ 0, %120 ], [ %144, %131 ]
%133 = phi <2 x i32> [ <i32 0, i32 1>, %120 ], [ %145, %131 ]
%134 = sitofp <2 x i32> %133 to <2 x double>
%135 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %134, <2 x double> <double 0x3FAF07C1F07C1F08, double 0x3FAF07C1F07C1F08>, <2 x double> <double -3.000000e+00, double -3.000000e+00>)
%136 = getelementptr inbounds double, double* %130, i64 %132
%137 = bitcast double* %136 to <2 x double>*
store <2 x double> %135, <2 x double>* %137
%138 = or i64 %132, 2
%139 = add <2 x i32> %133, <i32 2, i32 2>
%140 = sitofp <2 x i32> %139 to <2 x double>
%141 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %140, <2 x double> <double 0x3FAF07C1F07C1F08, double 0x3FAF07C1F07C1F08>, <2 x double> <double -3.000000e+00, double -3.000000e+00>)
%142 = getelementptr inbounds double, double* %130, i64 %138
%143 = bitcast double* %142 to <2 x double>*
store <2 x double> %141, <2 x double>* %143
%144 = add nuw nsw i64 %132, 4
%145 = add <2 x i32> %133, <i32 4, i32 4>
%146 = icmp eq i64 %144, 100
br i1 %146, label %147, label %131
147: ; preds = %131
%148 = call i32 @libtetrabz_mp_libtetrabz_dos_(i32* %3, double* %32, i32* %4, i32* %26, double* %45, i32* %29, double* %128, i32* %8, double* %130)
%149 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%150 = load i32, i32* %8
%151 = icmp sgt i32 %150, 0
br i1 %151, label %152, label %222
152: ; preds = %147, %213
%153 = phi i64 [ %218, %213 ], [ 0, %147 ]
%154 = phi i32 [ %219, %213 ], [ %150, %147 ]
%155 = load i32, i32* %4
%156 = mul i32 %155, %40
%157 = icmp sgt i32 %156, 0
br i1 %157, label %158, label %213
158: ; preds = %152
%159 = sext i32 %154 to i64
%160 = zext i32 %156 to i64
%161 = add nsw i64 %160, -1
%162 = and i64 %160, 3
%163 = icmp ult i64 %161, 3
br i1 %163, label %196, label %164
164: ; preds = %158
%165 = and i64 %160, 4294967292
br label %166
166: ; preds = %166, %164
%167 = phi i64 [ 0, %164 ], [ %193, %166 ]
%168 = phi double [ 0.000000e+00, %164 ], [ %192, %166 ]
%169 = phi i64 [ 0, %164 ], [ %194, %166 ]
%170 = mul nsw i64 %167, %159
%171 = add nsw i64 %170, %153
%172 = getelementptr inbounds double, double* %128, i64 %171
%173 = load double, double* %172
%174 = fadd double %168, %173
%175 = or i64 %167, 1
%176 = mul nsw i64 %175, %159
%177 = add nsw i64 %176, %153
%178 = getelementptr inbounds double, double* %128, i64 %177
%179 = load double, double* %178
%180 = fadd double %174, %179
%181 = or i64 %167, 2
%182 = mul nsw i64 %181, %159
%183 = add nsw i64 %182, %153
%184 = getelementptr inbounds double, double* %128, i64 %183
%185 = load double, double* %184
%186 = fadd double %180, %185
%187 = or i64 %167, 3
%188 = mul nsw i64 %187, %159
%189 = add nsw i64 %188, %153
%190 = getelementptr inbounds double, double* %128, i64 %189
%191 = load double, double* %190
%192 = fadd double %186, %191
%193 = add nuw nsw i64 %167, 4
%194 = add i64 %169, 4
%195 = icmp eq i64 %194, %165
br i1 %195, label %196, label %166
196: ; preds = %166, %158
%197 = phi double [ undef, %158 ], [ %192, %166 ]
%198 = phi i64 [ 0, %158 ], [ %193, %166 ]
%199 = phi double [ 0.000000e+00, %158 ], [ %192, %166 ]
%200 = icmp eq i64 %162, 0
br i1 %200, label %213, label %201
201: ; preds = %196, %201
%202 = phi i64 [ %210, %201 ], [ %198, %196 ]
%203 = phi double [ %209, %201 ], [ %199, %196 ]
%204 = phi i64 [ %211, %201 ], [ 0, %196 ]
%205 = mul nsw i64 %202, %159
%206 = add nsw i64 %205, %153
%207 = getelementptr inbounds double, double* %128, i64 %206
%208 = load double, double* %207
%209 = fadd double %203, %208
%210 = add nuw nsw i64 %202, 1
%211 = add i64 %204, 1
%212 = icmp eq i64 %211, %162
br i1 %212, label %213, label %201
213: ; preds = %196, %201, %152
%214 = phi double [ 0.000000e+00, %152 ], [ %197, %196 ], [ %209, %201 ]
%215 = getelementptr inbounds double, double* %130, i64 %153
%216 = load double, double* %215
%217 = call i32 @fprintf(i32* %149, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), double %216, double %214)
%218 = add nuw nsw i64 %153, 1
%219 = load i32, i32* %8
%220 = sext i32 %219 to i64
%221 = icmp slt i64 %218, %220
br i1 %221, label %152, label %222
222: ; preds = %213, %147
%223 = call i32 @fclose(i32* %149)
ret i32 0
}