#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*/ WriteBinFile(int, int, int, double *, char *);
int atoi(char *);
int /*<<< orphan*/ div_mesh(double *, int, int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ *open_file(char *, int, char *);
int /*<<< orphan*/ output(double *, int, int, int, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read_subsample(double *, int, int, int,
                                  int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  FILE *density;
  FILE *vx;
  FILE *vy;
  FILE *vz;
  FILE *energy;
  char name[512];
  int n;
  int nx;
  int ny;
  int nz;
  int stride;
  int dim;
  int i, j, k;
  double *Vx, *Vy, *Vz;
  double *Density;
  double *Energy;
  if (argc == 1) {
    printf("usage: ./div <n> <ny> <nz> <new nx dim> \n");
    exit(1);
  }
  printf("%d\n", argc);
  n = atoi(argv[1]);
  ny = atoi(argv[2]);
  nz = atoi(argv[3]);
  nx = atoi(argv[4]);
  printf("Your mesh will has a final size:\n nx = %d, ny = %d, nz = %d\n", nx,
         ny, nz);
  stride = nx * ny;
  Vx = (double *)malloc(sizeof(double) * nx * ny * nz);
  Vy = (double *)malloc(sizeof(double) * nx * ny * nz);
  Vz = (double *)malloc(sizeof(double) * nx * ny * nz);
  Density = (double *)malloc(sizeof(double) * nx * ny * nz);
  Energy = (double *)malloc(sizeof(double) * nx * ny * nz);
  for (k = 0; k < nz; k++) {
    for (j = 0; j < ny; j++) {
      for (i = 0; i < nx; i++) {
        Vx[i + j * nx + k * stride] = Vy[i + j * nx + k * stride] =
            Vz[i + j * nx + k * stride] = Density[i + j * nx + k * stride] =
                Energy[i + j * nx + k * stride] = 0;
      }
    }
  }
  density = open_file("Density", n, "r");
  vx = open_file("Vx", n, "r");
  vy = open_file("Vy", n, "r");
  vz = open_file("Vz", n, "r");
  energy = open_file("Energy", n, "r");
  printf("Comenzando la lectura...\n");
  read_subsample(Density, nx, ny, nz, density);
  printf("Lectura del archivo %s%.06d.dat OK\n", "Density", n);
  read_subsample(Vx, nx, ny, nz, vx);
  printf("Lectura del archivo %s%.06d.dat OK\n", "Vx", n);
  read_subsample(Vy, nx, ny, nz, vy);
  printf("Lectura del archivo %s%.06d.dat OK\n", "Vy", n);
  read_subsample(Vz, nx, ny, nz, vz);
  printf("Lectura del archivo %s%.06d.dat OK\n", "Vz", n);
  read_subsample(Energy, nx, ny, nz, energy);
  printf("Lectura del archivo %s%.06d.dat OK\n", "Energy", n);
  fclose(density);
  fclose(vx);
  fclose(vy);
  fclose(vz);
  fclose(energy);
  div_mesh(Density, nx, ny, nz);
  div_mesh(Vx, nx, ny, nz);
  div_mesh(Vy, nx, ny, nz);
  div_mesh(Vz, nx, ny, nz);
  div_mesh(Energy, nx, ny, nz);
  output(Density, nx, ny, nz, "Density");
  output(Vx, nx, ny, nz, "Vx");
  output(Vy, nx, ny, nz, "Vy");
  output(Vz, nx, ny, nz, "Vz");
  output(Energy, nx, ny, nz, "Energy");
  WriteBinFile(nx, ny, nz, Density, "Density");
  WriteBinFile(nx, ny, nz, Vx, "Vx");
  WriteBinFile(nx, ny, nz, Vy, "Vy");
  WriteBinFile(nx, ny, nz, Vz, "Vz");
  WriteBinFile(nx, ny, nz, Energy, "Energy");
  free(Vx);
  free(Vy);
  free(Vz);
  free(Energy);
  free(Density);
  printf("Final mesh size: nx=%d, ny=%d, nz=%d\n", nx, ny, nz);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x290,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11eb <main+0x3b>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x8(%rbp),%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x244(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x24c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x250(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x248(%rbp)
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x248(%rbp),%eax
imul   -0x24c(%rbp),%eax
mov    %eax,-0x254(%rbp)
movslq -0x248(%rbp),%rax
shl    $0x3,%rax
movslq -0x24c(%rbp),%rcx
imul   %rcx,%rax
movslq -0x250(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x270(%rbp)
movslq -0x248(%rbp),%rax
shl    $0x3,%rax
movslq -0x24c(%rbp),%rcx
imul   %rcx,%rax
movslq -0x250(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x278(%rbp)
movslq -0x248(%rbp),%rax
shl    $0x3,%rax
movslq -0x24c(%rbp),%rcx
imul   %rcx,%rax
movslq -0x250(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x280(%rbp)
movslq -0x248(%rbp),%rax
shl    $0x3,%rax
movslq -0x24c(%rbp),%rcx
imul   %rcx,%rax
movslq -0x250(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x288(%rbp)
movslq -0x248(%rbp),%rax
shl    $0x3,%rax
movslq -0x24c(%rbp),%rcx
imul   %rcx,%rax
movslq -0x250(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x290(%rbp)
movl   $0x0,-0x264(%rbp)
mov    -0x264(%rbp),%eax
cmp    -0x250(%rbp),%eax
jge    150e <main+0x35e>
movl   $0x0,-0x260(%rbp)
mov    -0x260(%rbp),%eax
cmp    -0x24c(%rbp),%eax
jge    14f5 <main+0x345>
movl   $0x0,-0x25c(%rbp)
mov    -0x25c(%rbp),%eax
cmp    -0x248(%rbp),%eax
jge    14dc <main+0x32c>
mov    -0x290(%rbp),%rax
mov    -0x25c(%rbp),%ecx
mov    -0x260(%rbp),%edx
imul   -0x248(%rbp),%edx
add    %edx,%ecx
mov    -0x264(%rbp),%edx
imul   -0x254(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x288(%rbp),%rax
mov    -0x25c(%rbp),%ecx
mov    -0x260(%rbp),%edx
imul   -0x248(%rbp),%edx
add    %edx,%ecx
mov    -0x264(%rbp),%edx
imul   -0x254(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x280(%rbp),%rax
mov    -0x25c(%rbp),%ecx
mov    -0x260(%rbp),%edx
imul   -0x248(%rbp),%edx
add    %edx,%ecx
mov    -0x264(%rbp),%edx
imul   -0x254(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x278(%rbp),%rax
mov    -0x25c(%rbp),%ecx
mov    -0x260(%rbp),%edx
imul   -0x248(%rbp),%edx
add    %edx,%ecx
mov    -0x264(%rbp),%edx
imul   -0x254(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x270(%rbp),%rax
mov    -0x25c(%rbp),%ecx
mov    -0x260(%rbp),%edx
imul   -0x248(%rbp),%edx
add    %edx,%ecx
mov    -0x264(%rbp),%edx
imul   -0x254(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x25c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x25c(%rbp)
jmp    13a8 <main+0x1f8>
jmp    14e1 <main+0x331>
mov    -0x260(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x260(%rbp)
jmp    138c <main+0x1dc>
jmp    14fa <main+0x34a>
mov    -0x264(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x264(%rbp)
jmp    1370 <main+0x1c0>
mov    -0x244(%rbp),%esi
lea    0xb4c(%rip),%rdi
lea    0xb4d(%rip),%rdx
call   1070 <open_file@plt>
mov    %rax,-0x18(%rbp)
mov    -0x244(%rbp),%esi
lea    0xb39(%rip),%rdi
lea    0xb30(%rip),%rdx
call   1070 <open_file@plt>
mov    %rax,-0x20(%rbp)
mov    -0x244(%rbp),%esi
lea    0xb1f(%rip),%rdi
lea    0xb13(%rip),%rdx
call   1070 <open_file@plt>
mov    %rax,-0x28(%rbp)
mov    -0x244(%rbp),%esi
lea    0xb05(%rip),%rdi
lea    0xaf6(%rip),%rdx
call   1070 <open_file@plt>
mov    %rax,-0x30(%rbp)
mov    -0x244(%rbp),%esi
lea    0xaeb(%rip),%rdi
lea    0xad9(%rip),%rdx
call   1070 <open_file@plt>
mov    %rax,-0x38(%rbp)
lea    0xadb(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x288(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
mov    -0x18(%rbp),%r8
call   1040 <read_subsample@plt>
mov    -0x244(%rbp),%edx
lea    0xabf(%rip),%rdi
lea    0xa84(%rip),%rsi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x270(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1040 <read_subsample@plt>
mov    -0x244(%rbp),%edx
lea    0xa82(%rip),%rdi
lea    0xa51(%rip),%rsi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x278(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
mov    -0x28(%rbp),%r8
call   1040 <read_subsample@plt>
mov    -0x244(%rbp),%edx
lea    0xa45(%rip),%rdi
lea    0xa17(%rip),%rsi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x280(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
mov    -0x30(%rbp),%r8
call   1040 <read_subsample@plt>
mov    -0x244(%rbp),%edx
lea    0xa08(%rip),%rdi
lea    0x9dd(%rip),%rsi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x290(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
mov    -0x38(%rbp),%r8
call   1040 <read_subsample@plt>
mov    -0x244(%rbp),%edx
lea    0x9cb(%rip),%rdi
lea    0x9a3(%rip),%rsi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x30(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1060 <fclose@plt>
mov    -0x288(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
call   10d0 <div_mesh@plt>
mov    -0x270(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
call   10d0 <div_mesh@plt>
mov    -0x278(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
call   10d0 <div_mesh@plt>
mov    -0x280(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
call   10d0 <div_mesh@plt>
mov    -0x290(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
call   10d0 <div_mesh@plt>
mov    -0x288(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
lea    0x8a6(%rip),%r8
call   1050 <output@plt>
mov    -0x270(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
lea    0x88b(%rip),%r8
call   1050 <output@plt>
mov    -0x278(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
lea    0x869(%rip),%r8
call   1050 <output@plt>
mov    -0x280(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
lea    0x847(%rip),%r8
call   1050 <output@plt>
mov    -0x290(%rbp),%rdi
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
lea    0x825(%rip),%r8
call   1050 <output@plt>
mov    -0x248(%rbp),%edi
mov    -0x24c(%rbp),%esi
mov    -0x250(%rbp),%edx
mov    -0x288(%rbp),%rcx
lea    0x7ed(%rip),%r8
call   1090 <WriteBinFile@plt>
mov    -0x248(%rbp),%edi
mov    -0x24c(%rbp),%esi
mov    -0x250(%rbp),%edx
mov    -0x270(%rbp),%rcx
lea    0x7d2(%rip),%r8
call   1090 <WriteBinFile@plt>
mov    -0x248(%rbp),%edi
mov    -0x24c(%rbp),%esi
mov    -0x250(%rbp),%edx
mov    -0x278(%rbp),%rcx
lea    0x7b0(%rip),%r8
call   1090 <WriteBinFile@plt>
mov    -0x248(%rbp),%edi
mov    -0x24c(%rbp),%esi
mov    -0x250(%rbp),%edx
mov    -0x280(%rbp),%rcx
lea    0x78e(%rip),%r8
call   1090 <WriteBinFile@plt>
mov    -0x248(%rbp),%edi
mov    -0x24c(%rbp),%esi
mov    -0x250(%rbp),%edx
mov    -0x290(%rbp),%rcx
lea    0x76c(%rip),%r8
call   1090 <WriteBinFile@plt>
mov    -0x270(%rbp),%rdi
call   1030 <free@plt>
mov    -0x278(%rbp),%rdi
call   1030 <free@plt>
mov    -0x280(%rbp),%rdi
call   1030 <free@plt>
mov    -0x290(%rbp),%rdi
call   1030 <free@plt>
mov    -0x288(%rbp),%rdi
call   1030 <free@plt>
mov    -0x248(%rbp),%esi
mov    -0x24c(%rbp),%edx
mov    -0x250(%rbp),%ecx
lea    0x757(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x1,%eax
add    $0x290,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
cmp    $0x1,%edi
je     1733 <main+0x573>
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xe56(%rip),%rdi
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x8(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,0x8(%rsp)
mov    0x10(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,%r15d
mov    0x18(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,%ebp
mov    %eax,0x4(%rsp)
mov    0x20(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,%ebx
lea    0xdd5(%rip),%rdi
mov    %eax,%esi
mov    %r15d,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r15d,(%rsp)
imul   %ebp,%r15d
imul   %ebx,%r15d
shl    $0x3,%r15d
mov    %r15d,%edi
call   10b0 <malloc@plt>
mov    %rax,%r13
mov    %r15d,%edi
call   10b0 <malloc@plt>
mov    %rax,%rbp
mov    %r15d,%edi
call   10b0 <malloc@plt>
mov    %rax,%r14
mov    %r15d,%edi
call   10b0 <malloc@plt>
mov    %rax,%r12
mov    %r15d,%edi
call   10b0 <malloc@plt>
mov    %rax,%r15
cmpl   $0x0,0x4(%rsp)
jle    13d1 <main+0x211>
mov    %ebx,%r11d
mov    %r11d,%ecx
and    $0xfffffffe,%ecx
mov    (%rsp),%eax
imul   %ebx,%eax
mov    %eax,0x20(%rsp)
movl   $0x1,0x10(%rsp)
jmp    12d3 <main+0x113>
nopl   0x0(%rax,%rax,1)
mov    0x18(%rsp),%rax
add    $0x1,%eax
mov    0x10(%rsp),%edx
add    0x20(%rsp),%edx
mov    %edx,0x10(%rsp)
mov    %rax,0x18(%rsp)
cmp    0x4(%rsp),%eax
je     13d1 <main+0x211>
cmpl   $0x0,(%rsp)
jle    12b0 <main+0xf0>
mov    0x18(%rsp),%r10
imul   (%rsp),%r10d
xor    %edx,%edx
mov    0x10(%rsp),%esi
jmp    12fa <main+0x13a>
nopl   0x0(%rax,%rax,1)
add    $0x1,%edx
add    %ebx,%esi
cmp    (%rsp),%edx
je     12b0 <main+0xf0>
test   %ebx,%ebx
jle    12f0 <main+0x130>
mov    %ebx,%r9d
cmp    $0x1,%ebx
jne    1310 <main+0x150>
xor    %edi,%edi
jmp    1389 <main+0x1c9>
nopw   0x0(%rax,%rax,1)
mov    %esi,%eax
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x1(%rax),%r8d
movslq %r8d,%rbx
movq   $0x0,(%r15,%rbx,8)
movq   $0x0,(%r12,%rbx,8)
movq   $0x0,(%r14,%rbx,8)
movq   $0x0,0x0(%rbp,%rbx,8)
movq   $0x0,0x0(%r13,%rbx,8)
cltq
movq   $0x0,(%r15,%rax,8)
movq   $0x0,(%r12,%rax,8)
movq   $0x0,(%r14,%rax,8)
movq   $0x0,0x0(%rbp,%rax,8)
movq   $0x0,0x0(%r13,%rax,8)
add    $0x2,%rdi
add    $0x2,%eax
cmp    %rdi,%rcx
jne    1320 <main+0x160>
test   $0x1,%r11b
mov    %r9d,%ebx
je     12f0 <main+0x130>
lea    (%rdx,%r10,1),%eax
imul   %ebx,%eax
add    %eax,%edi
movslq %edi,%rax
movq   $0x0,(%r15,%rax,8)
movq   $0x0,(%r12,%rax,8)
movq   $0x0,(%r14,%rax,8)
movq   $0x0,0x0(%rbp,%rax,8)
movq   $0x0,0x0(%r13,%rax,8)
jmp    12f0 <main+0x130>
mov    %ebx,0xc(%rsp)
lea    0xc61(%rip),%rdi
lea    0xc62(%rip),%rdx
mov    0x8(%rsp),%esi
call   1080 <open_file@plt>
mov    %rax,0x18(%rsp)
lea    0xc4f(%rip),%rdi
mov    0x8(%rsp),%esi
lea    0xc42(%rip),%rdx
call   1080 <open_file@plt>
mov    %rax,0x10(%rsp)
lea    0xc36(%rip),%rdi
mov    0x8(%rsp),%esi
lea    0xc26(%rip),%rdx
call   1080 <open_file@plt>
mov    %rax,0x20(%rsp)
lea    0xc1d(%rip),%rdi
mov    0x8(%rsp),%esi
lea    0xc0a(%rip),%rdx
call   1080 <open_file@plt>
mov    %rax,0x28(%rsp)
lea    0xc04(%rip),%rdi
mov    0x8(%rsp),%esi
lea    0xbee(%rip),%rdx
call   1080 <open_file@plt>
mov    %rax,0x30(%rsp)
lea    0xc39(%rip),%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    (%rsp),%ebx
mov    %ebx,%edx
mov    0x4(%rsp),%ecx
mov    0x18(%rsp),%r8
call   1040 <read_subsample@plt>
lea    0xbcb(%rip),%rdi
lea    0xbaa(%rip),%rsi
mov    0x8(%rsp),%edx
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r13,%rdi
mov    0xc(%rsp),%esi
mov    %ebx,%edx
mov    0x4(%rsp),%ebx
mov    %ebx,%ecx
mov    0x10(%rsp),%r8
call   1040 <read_subsample@plt>
lea    0xb99(%rip),%rdi
lea    0xb82(%rip),%rsi
mov    0x8(%rsp),%edx
xor    %eax,%eax
call   1090 <printf@plt>
mov    %rbp,%rdi
mov    0xc(%rsp),%esi
mov    (%rsp),%edx
mov    %ebx,%ecx
mov    0x20(%rsp),%r8
call   1040 <read_subsample@plt>
lea    0xb6a(%rip),%rdi
lea    0xb56(%rip),%rsi
mov    0x8(%rsp),%edx
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r14,%rdi
mov    0xc(%rsp),%esi
mov    (%rsp),%ebx
mov    %ebx,%edx
mov    0x4(%rsp),%ecx
mov    0x28(%rsp),%r8
call   1040 <read_subsample@plt>
lea    0xb37(%rip),%rdi
lea    0xb26(%rip),%rsi
mov    0x8(%rsp),%edx
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r15,%rdi
mov    0xc(%rsp),%esi
mov    %ebx,%edx
mov    0x4(%rsp),%ecx
mov    0x30(%rsp),%rbx
mov    %rbx,%r8
call   1040 <read_subsample@plt>
lea    0xb04(%rip),%rdi
lea    0xaf6(%rip),%rsi
mov    0x8(%rsp),%edx
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x18(%rsp),%rdi
call   1070 <fclose@plt>
mov    0x10(%rsp),%rdi
call   1070 <fclose@plt>
mov    0x20(%rsp),%rdi
call   1070 <fclose@plt>
mov    0x28(%rsp),%rdi
call   1070 <fclose@plt>
mov    %rbx,%rdi
call   1070 <fclose@plt>
mov    %r12,%rdi
mov    0xc(%rsp),%ebx
mov    %ebx,%esi
mov    (%rsp),%edx
mov    0x4(%rsp),%ecx
call   10e0 <div_mesh@plt>
mov    %r13,%rdi
mov    %ebx,%esi
mov    (%rsp),%edx
mov    0x4(%rsp),%ecx
call   10e0 <div_mesh@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    (%rsp),%edx
mov    0x4(%rsp),%ecx
call   10e0 <div_mesh@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    (%rsp),%edx
mov    0x4(%rsp),%ecx
call   10e0 <div_mesh@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    (%rsp),%edx
mov    0x4(%rsp),%ecx
call   10e0 <div_mesh@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    (%rsp),%edx
mov    0x4(%rsp),%ecx
lea    0xa3c(%rip),%r8
call   1060 <output@plt>
mov    %r13,%rdi
mov    %ebx,%esi
mov    (%rsp),%edx
mov    0x4(%rsp),%ecx
lea    0xa2e(%rip),%r8
call   1060 <output@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    (%rsp),%edx
mov    0x4(%rsp),%ecx
lea    0xa19(%rip),%r8
call   1060 <output@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    (%rsp),%edx
mov    0x4(%rsp),%ecx
lea    0xa04(%rip),%r8
call   1060 <output@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    (%rsp),%edx
mov    0x4(%rsp),%ecx
lea    0x9ef(%rip),%r8
call   1060 <output@plt>
mov    %ebx,%edi
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    %r12,%rcx
lea    0x9c4(%rip),%r8
call   10a0 <WriteBinFile@plt>
mov    %ebx,%edi
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    %r13,%rcx
lea    0x9b6(%rip),%r8
call   10a0 <WriteBinFile@plt>
mov    %ebx,%edi
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    %rbp,%rcx
lea    0x9a1(%rip),%r8
call   10a0 <WriteBinFile@plt>
mov    %ebx,%edi
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    %r14,%rcx
lea    0x98c(%rip),%r8
call   10a0 <WriteBinFile@plt>
mov    %ebx,%edi
mov    (%rsp),%esi
mov    0x4(%rsp),%ebx
mov    %ebx,%edx
mov    %r15,%rcx
lea    0x975(%rip),%r8
call   10a0 <WriteBinFile@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
lea    0x96c(%rip),%rdi
mov    0xc(%rsp),%esi
mov    (%rsp),%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x1,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x980(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [61 x i8] c"Your mesh will has a final size:\0A nx = %d, ny = %d, nz = %d\0A\00"
@.str.3 = [8 x i8] c"Density\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [3 x i8] c"Vx\00"
@.str.6 = [3 x i8] c"Vy\00"
@.str.7 = [3 x i8] c"Vz\00"
@.str.8 = [7 x i8] c"Energy\00"
@.str.10 = [36 x i8] c"Lectura del archivo %s%.06d.dat OK\0A\00"
@.str.11 = [38 x i8] c"Final mesh size: nx=%d, ny=%d, nz=%d\0A\00"
@str = [25 x i8] c"Comenzando la lectura...\00"
@str.12 = [41 x i8] c"usage: ./div <n> <ny> <nz> <new nx dim> \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.12, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 4
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i32 %20, i32 %14, i32 %17)
%22 = shl i32 %14, 3
%23 = mul i32 %22, %17
%24 = mul i32 %23, %20
%25 = tail call i64 @malloc(i32 %24)
%26 = inttoptr i64 %25 to double*
%27 = tail call i64 @malloc(i32 %24)
%28 = inttoptr i64 %27 to double*
%29 = tail call i64 @malloc(i32 %24)
%30 = inttoptr i64 %29 to double*
%31 = tail call i64 @malloc(i32 %24)
%32 = inttoptr i64 %31 to double*
%33 = tail call i64 @malloc(i32 %24)
%34 = inttoptr i64 %33 to double*
%35 = icmp sgt i32 %17, 0
br i1 %35, label %36, label %93
36: ; preds = %7
%37 = icmp sgt i32 %14, 0
%38 = icmp sgt i32 %20, 0
%39 = zext i32 %20 to i64
%40 = and i64 %39, 1
%41 = icmp eq i32 %20, 1
%42 = and i64 %39, 4294967294
%43 = icmp eq i64 %40, 0
br label %44
44: ; preds = %36, %90
%45 = phi i32 [ 0, %36 ], [ %91, %90 ]
br i1 %37, label %46, label %90
46: ; preds = %44
%47 = mul i32 %45, %14
br label %48
48: ; preds = %46, %87
%49 = phi i32 [ 0, %46 ], [ %88, %87 ]
br i1 %38, label %50, label %87
50: ; preds = %48
%51 = add i32 %49, %47
%52 = mul i32 %51, %20
br i1 %41, label %76, label %53
53: ; preds = %50, %53
%54 = phi i64 [ %73, %53 ], [ 0, %50 ]
%55 = phi i64 [ %74, %53 ], [ 0, %50 ]
%56 = trunc i64 %54 to i32
%57 = add i32 %52, %56
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %34, i64 %58
store double 0.000000e+00, double* %59
%60 = getelementptr inbounds double, double* %32, i64 %58
store double 0.000000e+00, double* %60
%61 = getelementptr inbounds double, double* %30, i64 %58
store double 0.000000e+00, double* %61
%62 = getelementptr inbounds double, double* %28, i64 %58
store double 0.000000e+00, double* %62
%63 = getelementptr inbounds double, double* %26, i64 %58
store double 0.000000e+00, double* %63
%64 = trunc i64 %54 to i32
%65 = or i32 %64, 1
%66 = add i32 %52, %65
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %34, i64 %67
store double 0.000000e+00, double* %68
%69 = getelementptr inbounds double, double* %32, i64 %67
store double 0.000000e+00, double* %69
%70 = getelementptr inbounds double, double* %30, i64 %67
store double 0.000000e+00, double* %70
%71 = getelementptr inbounds double, double* %28, i64 %67
store double 0.000000e+00, double* %71
%72 = getelementptr inbounds double, double* %26, i64 %67
store double 0.000000e+00, double* %72
%73 = add nuw nsw i64 %54, 2
%74 = add i64 %55, 2
%75 = icmp eq i64 %74, %42
br i1 %75, label %76, label %53
76: ; preds = %53, %50
%77 = phi i64 [ 0, %50 ], [ %73, %53 ]
br i1 %43, label %87, label %78
78: ; preds = %76
%79 = trunc i64 %77 to i32
%80 = add i32 %52, %79
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %34, i64 %81
store double 0.000000e+00, double* %82
%83 = getelementptr inbounds double, double* %32, i64 %81
store double 0.000000e+00, double* %83
%84 = getelementptr inbounds double, double* %30, i64 %81
store double 0.000000e+00, double* %84
%85 = getelementptr inbounds double, double* %28, i64 %81
store double 0.000000e+00, double* %85
%86 = getelementptr inbounds double, double* %26, i64 %81
store double 0.000000e+00, double* %86
br label %87
87: ; preds = %78, %76, %48
%88 = add nuw nsw i32 %49, 1
%89 = icmp eq i32 %88, %14
br i1 %89, label %90, label %48
90: ; preds = %87, %44
%91 = add nuw nsw i32 %45, 1
%92 = icmp eq i32 %91, %17
br i1 %92, label %93, label %44
93: ; preds = %90, %7
%94 = tail call i32* @open_file(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%95 = tail call i32* @open_file(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%96 = tail call i32* @open_file(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%97 = tail call i32* @open_file(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%98 = tail call i32* @open_file(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%99 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%100 = tail call i32 @read_subsample(double* %32, i32 %20, i32 %14, i32 %17, i32* %94)
%101 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%102 = tail call i32 @read_subsample(double* %26, i32 %20, i32 %14, i32 %17, i32* %95)
%103 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%104 = tail call i32 @read_subsample(double* %28, i32 %20, i32 %14, i32 %17, i32* %96)
%105 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %11)
%106 = tail call i32 @read_subsample(double* %30, i32 %20, i32 %14, i32 %17, i32* %97)
%107 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32 %11)
%108 = tail call i32 @read_subsample(double* %34, i32 %20, i32 %14, i32 %17, i32* %98)
%109 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %11)
%110 = tail call i32 @fclose(i32* %94)
%111 = tail call i32 @fclose(i32* %95)
%112 = tail call i32 @fclose(i32* %96)
%113 = tail call i32 @fclose(i32* %97)
%114 = tail call i32 @fclose(i32* %98)
%115 = tail call i32 @div_mesh(double* %32, i32 %20, i32 %14, i32 %17)
%116 = tail call i32 @div_mesh(double* %26, i32 %20, i32 %14, i32 %17)
%117 = tail call i32 @div_mesh(double* %28, i32 %20, i32 %14, i32 %17)
%118 = tail call i32 @div_mesh(double* %30, i32 %20, i32 %14, i32 %17)
%119 = tail call i32 @div_mesh(double* %34, i32 %20, i32 %14, i32 %17)
%120 = tail call i32 @output(double* %32, i32 %20, i32 %14, i32 %17, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%121 = tail call i32 @output(double* %26, i32 %20, i32 %14, i32 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%122 = tail call i32 @output(double* %28, i32 %20, i32 %14, i32 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%123 = tail call i32 @output(double* %30, i32 %20, i32 %14, i32 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%124 = tail call i32 @output(double* %34, i32 %20, i32 %14, i32 %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%125 = tail call i32 @WriteBinFile(i32 %20, i32 %14, i32 %17, double* %32, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%126 = tail call i32 @WriteBinFile(i32 %20, i32 %14, i32 %17, double* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%127 = tail call i32 @WriteBinFile(i32 %20, i32 %14, i32 %17, double* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%128 = tail call i32 @WriteBinFile(i32 %20, i32 %14, i32 %17, double* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%129 = tail call i32 @WriteBinFile(i32 %20, i32 %14, i32 %17, double* %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%130 = tail call i32 @free(double* %26)
%131 = tail call i32 @free(double* %28)
%132 = tail call i32 @free(double* %30)
%133 = tail call i32 @free(double* %34)
%134 = tail call i32 @free(double* %32)
%135 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0), i32 %20, i32 %14, i32 %17)
ret i32 1
}