#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 */

/* Variables and functions */
float atof(char *);
float cos(float);
int /*<<< orphan*/ dump_mock_file(char *, float *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
float *load_mock_file(char *, int *);
float sin(float);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  int n_points;
  float *r, *phi, *theta;
  float *x, *y, *z;
  float *mass_in;
  float *mass_out;
  int i;
  int j;
  float min_theta, max_theta, min_phi, max_phi, min_r, max_r;
  int n_in;
  if (argc != 15) {
    fprintf(
        stderr, "USAGE: %s\n",
        "./s2c file_r file_phi file_theta file_mass_in file_x file_y file_z "
        "file_mass_out min_theta max_theta min_phi max_phi min_r max_r");
    exit(1);
  }
  r = load_mock_file(argv[1], &n_points);
  phi = load_mock_file(argv[2], &n_points);
  theta = load_mock_file(argv[3], &n_points);
  mass_in = load_mock_file(argv[4], &n_points);
  x = load_mock_file(argv[1], &n_points);
  y = load_mock_file(argv[2], &n_points);
  z = load_mock_file(argv[3], &n_points);
  mass_out = load_mock_file(argv[4], &n_points);
  min_theta = atof(argv[9]);
  max_theta = atof(argv[10]);
  min_phi = atof(argv[11]);
  max_phi = atof(argv[12]);
  min_r = atof(argv[13]);
  max_r = atof(argv[14]);
  min_phi = min_phi * 3.1415926535897932384626433832 / 180.0;
  max_phi = max_phi * 3.1415926535897932384626433832 / 180.0;
  min_theta = min_theta * 3.1415926535897932384626433832 / 180.0;
  max_theta = max_theta * 3.1415926535897932384626433832 / 180.0;
  j = 0;
  n_in = 0;
  for (i = 0; i < n_points; i++) {
    if (r[i] < 0.0) {
      r[i] = -r[i];
    }
    if ((r[i] > min_r && r[i] < max_r) &&
        (theta[i] < max_theta && theta[i] > min_theta) &&
        (phi[i] > min_phi && phi[i] < max_phi)) {
      x[j] = r[i] * sin(theta[i]) * cos(phi[i]);
      y[j] = r[i] * sin(theta[i]) * sin(phi[i]);
      z[j] = r[i] * cos(theta[i]);
      mass_out[j] = mass_in[i];
      j++;
      n_in++;
    }
  }
  fprintf(stdout, "There are %d points selected out of %d\n", n_in, n_points);
  dump_mock_file(argv[5], x, n_in);
  dump_mock_file(argv[6], y, n_in);
  dump_mock_file(argv[7], z, n_in);
  dump_mock_file(argv[8], mass_out, n_in);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xf,-0x8(%rbp)
je     11bb <main+0x4b>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
lea    0xe6d(%rip),%rsi
lea    0xe71(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <load_mock_file@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <load_mock_file@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <load_mock_file@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <load_mock_file@plt>
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <load_mock_file@plt>
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <load_mock_file@plt>
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <load_mock_file@plt>
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <load_mock_file@plt>
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
mov    0x48(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x64(%rbp)
mov    -0x10(%rbp),%rax
mov    0x50(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    0x58(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x6c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x60(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    0x68(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x74(%rbp)
mov    -0x10(%rbp),%rax
mov    0x70(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x78(%rbp)
movss  -0x6c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd28(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd14(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcfe(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcea(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x70(%rbp)
movss  -0x64(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcd4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcc0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x64(%rbp)
movss  -0x68(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcaa(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc96(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x68(%rbp)
movl   $0x0,-0x60(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    15c7 <main+0x457>
mov    -0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    13dd <main+0x26d>
mov    -0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
ucomiss -0x74(%rbp),%xmm0
jbe    15b4 <main+0x444>
mov    -0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
movss  -0x78(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    15b4 <main+0x444>
mov    -0x30(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
movss  -0x68(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    15b4 <main+0x444>
mov    -0x30(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
ucomiss -0x64(%rbp),%xmm0
jbe    15b4 <main+0x444>
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
ucomiss -0x6c(%rbp),%xmm0
jbe    15b4 <main+0x444>
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
movss  -0x70(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    15b4 <main+0x444>
mov    -0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x90(%rbp)
ff
mov    -0x30(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1070 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x90(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
movss  %xmm0,-0x8c(%rbp)
ff
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1080 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x8c(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x60(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x88(%rbp)
ff
mov    -0x30(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1070 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x88(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1070 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x84(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movslq -0x60(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x80(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1080 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x80(%rbp),%xmm0
mulss  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
movslq -0x60(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x50(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x60(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    15b9 <main+0x449>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    138c <main+0x21c>
mov    0x2a0a(%rip),%rax
mov    (%rax),%edi
mov    -0x7c(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xabf(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x7c(%rbp),%edx
call   1060 <dump_mock_file@plt>
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x7c(%rbp),%edx
call   1060 <dump_mock_file@plt>
mov    -0x10(%rbp),%rax
mov    0x38(%rax),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x7c(%rbp),%edx
call   1060 <dump_mock_file@plt>
mov    -0x10(%rbp),%rax
mov    0x40(%rax),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x7c(%rbp),%edx
call   1060 <dump_mock_file@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
cmp    $0xf,%edi
jne    14ef <main+0x37f>
mov    %rsi,%rbp
mov    0x8(%rsi),%rdi
lea    0x24(%rsp),%r14
mov    %r14,%rsi
call   1040 <load_mock_file@plt>
mov    %rax,%rbx
mov    0x10(%rbp),%rdi
mov    %r14,%rsi
call   1040 <load_mock_file@plt>
mov    %rax,0x50(%rsp)
mov    0x18(%rbp),%rdi
mov    %r14,%rsi
call   1040 <load_mock_file@plt>
mov    %rax,%r12
mov    0x20(%rbp),%rdi
mov    %r14,%rsi
call   1040 <load_mock_file@plt>
mov    %rax,0x60(%rsp)
mov    0x8(%rbp),%rdi
mov    %r14,%rsi
call   1040 <load_mock_file@plt>
mov    %rax,0x48(%rsp)
mov    0x10(%rbp),%rdi
mov    %r14,%rsi
call   1040 <load_mock_file@plt>
mov    %rax,0x40(%rsp)
mov    0x18(%rbp),%rdi
mov    %r14,%rsi
call   1040 <load_mock_file@plt>
mov    %rax,0x38(%rsp)
mov    0x20(%rbp),%rdi
mov    %r14,%rsi
call   1040 <load_mock_file@plt>
mov    %rax,0x30(%rsp)
mov    0x48(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,0x10(%rsp)
mov    0x50(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,0x4(%rsp)
mov    0x58(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,0x8(%rsp)
mov    0x60(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,0xc(%rsp)
mov    0x68(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,0x20(%rsp)
mov    %rbp,0x58(%rsp)
mov    0x70(%rbp),%rdi
call   1030 <atof@plt>
mov    0x24(%rsp),%ecx
test   %ecx,%ecx
jle    1478 <main+0x308>
movaps %xmm0,%xmm3
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd73(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd6f(%rip),%xmm2
divsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm8
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm9
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm10
xor    %ebp,%ebp
xorps  %xmm4,%xmm4
movaps 0xd18(%rip),%xmm6
xor    %r14d,%r14d
xor    %r15d,%r15d
movss  0x20(%rsp),%xmm2
movss  %xmm3,0x2c(%rsp)
movss  %xmm8,0x8(%rsp)
movss  %xmm9,0x28(%rsp)
movss  %xmm10,0x4(%rsp)
mov    0x50(%rsp),%r13
jmp    1340 <main+0x1d0>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbp
movslq %ecx,%rax
cmp    %rax,%rbp
jge    147b <main+0x30b>
movss  (%rbx,%rbp,4),%xmm7
ucomiss %xmm7,%xmm4
jbe    1352 <main+0x1e2>
xorps  %xmm6,%xmm7
movss  %xmm7,(%rbx,%rbp,4)
ucomiss %xmm2,%xmm7
jbe    1330 <main+0x1c0>
ucomiss %xmm7,%xmm3
jbe    1330 <main+0x1c0>
movss  (%r12,%rbp,4),%xmm0
ucomiss %xmm0,%xmm10
jbe    1330 <main+0x1c0>
ucomiss %xmm9,%xmm0
jbe    1330 <main+0x1c0>
mov    0x50(%rsp),%rax
movss  (%rax,%rbp,4),%xmm1
ucomiss %xmm8,%xmm1
jbe    1330 <main+0x1c0>
movss  0xc(%rsp),%xmm5
ucomiss %xmm1,%xmm5
jbe    1330 <main+0x1c0>
movaps %xmm7,0x10(%rsp)
call   1070 <sin@plt>
movaps 0x10(%rsp),%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,0x10(%rsp)
movss  0x0(%r13,%rbp,4),%xmm0
call   1080 <cos@plt>
mulss  0x10(%rsp),%xmm0
movslq %r15d,%r15
mov    0x48(%rsp),%rax
movss  %xmm0,(%rax,%r15,4)
movss  (%rbx,%rbp,4),%xmm0
movss  %xmm0,0x10(%rsp)
movss  (%r12,%rbp,4),%xmm0
call   1070 <sin@plt>
mulss  0x10(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
movss  0x0(%r13,%rbp,4),%xmm0
call   1070 <sin@plt>
mulss  0x10(%rsp),%xmm0
mov    0x40(%rsp),%rax
movss  %xmm0,(%rax,%r15,4)
movss  (%rbx,%rbp,4),%xmm0
movss  %xmm0,0x10(%rsp)
movss  (%r12,%rbp,4),%xmm0
call   1080 <cos@plt>
movaps 0xbf3(%rip),%xmm6
xorps  %xmm4,%xmm4
movss  0x4(%rsp),%xmm10
movss  0x28(%rsp),%xmm9
movss  0x8(%rsp),%xmm8
movss  0x2c(%rsp),%xmm3
movss  0x20(%rsp),%xmm2
mulss  0x10(%rsp),%xmm0
mov    0x38(%rsp),%rax
movss  %xmm0,(%rax,%r15,4)
mov    0x60(%rsp),%rax
movss  (%rax,%rbp,4),%xmm0
mov    0x30(%rsp),%rax
movss  %xmm0,(%rax,%r15,4)
add    $0x1,%r15d
add    $0x1,%r14d
mov    0x24(%rsp),%ecx
jmp    1330 <main+0x1c0>
xor    %r14d,%r14d
mov    0x2b56(%rip),%rax
mov    (%rax),%edi
lea    0xc21(%rip),%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    0x58(%rsp),%rbx
mov    0x28(%rbx),%rdi
mov    0x48(%rsp),%rsi
mov    %r14d,%edx
call   1060 <dump_mock_file@plt>
mov    0x30(%rbx),%rdi
mov    0x40(%rsp),%rsi
mov    %r14d,%edx
call   1060 <dump_mock_file@plt>
mov    0x38(%rbx),%rdi
mov    0x38(%rsp),%rsi
mov    %r14d,%edx
call   1060 <dump_mock_file@plt>
mov    0x40(%rbx),%rdi
mov    0x30(%rsp),%rsi
mov    %r14d,%edx
call   1060 <dump_mock_file@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2aea(%rip),%rax
mov    (%rax),%edi
lea    0xb21(%rip),%rsi
lea    0xb25(%rip),%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"USAGE: %s\0A\00"
@.str.1 = [129 x i8] c"./s2c file_r file_phi file_theta file_mass_in file_x file_y file_z file_mass_out min_theta max_theta min_phi max_phi min_r max_r\00"
@stdout = global i32 0
@.str.2 = [40 x i8] c"There are %d points selected out of %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
%13 = alloca float*
%14 = alloca float*
%15 = alloca i32
%16 = alloca i32
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca float
%22 = alloca float
%23 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%24 = load i32, i32* %4
%25 = icmp ne i32 %24, 15
br i1 %25, label %26, label %30
26: ; preds = %2
%27 = load i32, i32* @stderr
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str.1, i64 0, i64 0))
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %2
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call float* @load_mock_file(i8* %33, i32* %6)
store float* %34, float** %7
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = call float* @load_mock_file(i8* %37, i32* %6)
store float* %38, float** %8
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 3
%41 = load i8*, i8** %40
%42 = call float* @load_mock_file(i8* %41, i32* %6)
store float* %42, float** %9
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 4
%45 = load i8*, i8** %44
%46 = call float* @load_mock_file(i8* %45, i32* %6)
store float* %46, float** %13
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 1
%49 = load i8*, i8** %48
%50 = call float* @load_mock_file(i8* %49, i32* %6)
store float* %50, float** %10
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 2
%53 = load i8*, i8** %52
%54 = call float* @load_mock_file(i8* %53, i32* %6)
store float* %54, float** %11
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 3
%57 = load i8*, i8** %56
%58 = call float* @load_mock_file(i8* %57, i32* %6)
store float* %58, float** %12
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 4
%61 = load i8*, i8** %60
%62 = call float* @load_mock_file(i8* %61, i32* %6)
store float* %62, float** %14
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 9
%65 = load i8*, i8** %64
%66 = call float @atof(i8* %65)
store float %66, float* %17
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 10
%69 = load i8*, i8** %68
%70 = call float @atof(i8* %69)
store float %70, float* %18
%71 = load i8**, i8*** %5
%72 = getelementptr inbounds i8*, i8** %71, i64 11
%73 = load i8*, i8** %72
%74 = call float @atof(i8* %73)
store float %74, float* %19
%75 = load i8**, i8*** %5
%76 = getelementptr inbounds i8*, i8** %75, i64 12
%77 = load i8*, i8** %76
%78 = call float @atof(i8* %77)
store float %78, float* %20
%79 = load i8**, i8*** %5
%80 = getelementptr inbounds i8*, i8** %79, i64 13
%81 = load i8*, i8** %80
%82 = call float @atof(i8* %81)
store float %82, float* %21
%83 = load i8**, i8*** %5
%84 = getelementptr inbounds i8*, i8** %83, i64 14
%85 = load i8*, i8** %84
%86 = call float @atof(i8* %85)
store float %86, float* %22
%87 = load float, float* %19
%88 = fpext float %87 to double
%89 = fmul double %88, 0x400921FB54442D18
%90 = fdiv double %89, 1.800000e+02
%91 = fptrunc double %90 to float
store float %91, float* %19
%92 = load float, float* %20
%93 = fpext float %92 to double
%94 = fmul double %93, 0x400921FB54442D18
%95 = fdiv double %94, 1.800000e+02
%96 = fptrunc double %95 to float
store float %96, float* %20
%97 = load float, float* %17
%98 = fpext float %97 to double
%99 = fmul double %98, 0x400921FB54442D18
%100 = fdiv double %99, 1.800000e+02
%101 = fptrunc double %100 to float
store float %101, float* %17
%102 = load float, float* %18
%103 = fpext float %102 to double
%104 = fmul double %103, 0x400921FB54442D18
%105 = fdiv double %104, 1.800000e+02
%106 = fptrunc double %105 to float
store float %106, float* %18
store i32 0, i32* %16
store i32 0, i32* %23
store i32 0, i32* %15
br label %107
107: ; preds = %255, %30
%108 = load i32, i32* %15
%109 = load i32, i32* %6
%110 = icmp slt i32 %108, %109
br i1 %110, label %111, label %258
111: ; preds = %107
%112 = load float*, float** %7
%113 = load i32, i32* %15
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds float, float* %112, i64 %114
%116 = load float, float* %115
%117 = fpext float %116 to double
%118 = fcmp olt double %117, 0.000000e+00
br i1 %118, label %119, label %130
119: ; preds = %111
%120 = load float*, float** %7
%121 = load i32, i32* %15
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds float, float* %120, i64 %122
%124 = load float, float* %123
%125 = fneg float %124
%126 = load float*, float** %7
%127 = load i32, i32* %15
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds float, float* %126, i64 %128
store float %125, float* %129
br label %130
130: ; preds = %119, %111
%131 = load float*, float** %7
%132 = load i32, i32* %15
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds float, float* %131, i64 %133
%135 = load float, float* %134
%136 = load float, float* %21
%137 = fcmp ogt float %135, %136
br i1 %137, label %138, label %254
138: ; preds = %130
%139 = load float*, float** %7
%140 = load i32, i32* %15
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds float, float* %139, i64 %141
%143 = load float, float* %142
%144 = load float, float* %22
%145 = fcmp olt float %143, %144
br i1 %145, label %146, label %254
146: ; preds = %138
%147 = load float*, float** %9
%148 = load i32, i32* %15
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds float, float* %147, i64 %149
%151 = load float, float* %150
%152 = load float, float* %18
%153 = fcmp olt float %151, %152
br i1 %153, label %154, label %254
154: ; preds = %146
%155 = load float*, float** %9
%156 = load i32, i32* %15
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds float, float* %155, i64 %157
%159 = load float, float* %158
%160 = load float, float* %17
%161 = fcmp ogt float %159, %160
br i1 %161, label %162, label %254
162: ; preds = %154
%163 = load float*, float** %8
%164 = load i32, i32* %15
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds float, float* %163, i64 %165
%167 = load float, float* %166
%168 = load float, float* %19
%169 = fcmp ogt float %167, %168
br i1 %169, label %170, label %254
170: ; preds = %162
%171 = load float*, float** %8
%172 = load i32, i32* %15
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds float, float* %171, i64 %173
%175 = load float, float* %174
%176 = load float, float* %20
%177 = fcmp olt float %175, %176
br i1 %177, label %178, label %254
178: ; preds = %170
%179 = load float*, float** %7
%180 = load i32, i32* %15
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds float, float* %179, i64 %181
%183 = load float, float* %182
%184 = load float*, float** %9
%185 = load i32, i32* %15
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds float, float* %184, i64 %186
%188 = load float, float* %187
%189 = call float @sin(float %188)
%190 = fmul float %183, %189
%191 = load float*, float** %8
%192 = load i32, i32* %15
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds float, float* %191, i64 %193
%195 = load float, float* %194
%196 = call float @cos(float %195)
%197 = fmul float %190, %196
%198 = load float*, float** %10
%199 = load i32, i32* %16
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds float, float* %198, i64 %200
store float %197, float* %201
%202 = load float*, float** %7
%203 = load i32, i32* %15
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds float, float* %202, i64 %204
%206 = load float, float* %205
%207 = load float*, float** %9
%208 = load i32, i32* %15
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds float, float* %207, i64 %209
%211 = load float, float* %210
%212 = call float @sin(float %211)
%213 = fmul float %206, %212
%214 = load float*, float** %8
%215 = load i32, i32* %15
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds float, float* %214, i64 %216
%218 = load float, float* %217
%219 = call float @sin(float %218)
%220 = fmul float %213, %219
%221 = load float*, float** %11
%222 = load i32, i32* %16
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds float, float* %221, i64 %223
store float %220, float* %224
%225 = load float*, float** %7
%226 = load i32, i32* %15
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds float, float* %225, i64 %227
%229 = load float, float* %228
%230 = load float*, float** %9
%231 = load i32, i32* %15
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds float, float* %230, i64 %232
%234 = load float, float* %233
%235 = call float @cos(float %234)
%236 = fmul float %229, %235
%237 = load float*, float** %12
%238 = load i32, i32* %16
%239 = sext i32 %238 to i64
%240 = getelementptr inbounds float, float* %237, i64 %239
store float %236, float* %240
%241 = load float*, float** %13
%242 = load i32, i32* %15
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds float, float* %241, i64 %243
%245 = load float, float* %244
%246 = load float*, float** %14
%247 = load i32, i32* %16
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds float, float* %246, i64 %248
store float %245, float* %249
%250 = load i32, i32* %16
%251 = add nsw i32 %250, 1
store i32 %251, i32* %16
%252 = load i32, i32* %23
%253 = add nsw i32 %252, 1
store i32 %253, i32* %23
br label %254
254: ; preds = %178, %170, %162, %154, %146, %138, %130
br label %255
255: ; preds = %254
%256 = load i32, i32* %15
%257 = add nsw i32 %256, 1
store i32 %257, i32* %15
br label %107
258: ; preds = %107
%259 = load i32, i32* @stdout
%260 = load i32, i32* %23
%261 = load i32, i32* %6
%262 = call i32 (i32, i8*, ...) @fprintf(i32 %259, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %260, i32 %261)
%263 = load i8**, i8*** %5
%264 = getelementptr inbounds i8*, i8** %263, i64 5
%265 = load i8*, i8** %264
%266 = load float*, float** %10
%267 = load i32, i32* %23
%268 = call i32 @dump_mock_file(i8* %265, float* %266, i32 %267)
%269 = load i8**, i8*** %5
%270 = getelementptr inbounds i8*, i8** %269, i64 6
%271 = load i8*, i8** %270
%272 = load float*, float** %11
%273 = load i32, i32* %23
%274 = call i32 @dump_mock_file(i8* %271, float* %272, i32 %273)
%275 = load i8**, i8*** %5
%276 = getelementptr inbounds i8*, i8** %275, i64 7
%277 = load i8*, i8** %276
%278 = load float*, float** %12
%279 = load i32, i32* %23
%280 = call i32 @dump_mock_file(i8* %277, float* %278, i32 %279)
%281 = load i8**, i8*** %5
%282 = getelementptr inbounds i8*, i8** %281, i64 8
%283 = load i8*, i8** %282
%284 = load float*, float** %14
%285 = load i32, i32* %23
%286 = call i32 @dump_mock_file(i8* %283, float* %284, i32 %285)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"USAGE: %s\0A\00"
@.str.1 = [129 x i8] c"./s2c file_r file_phi file_theta file_mass_in file_x file_y file_z file_mass_out min_theta max_theta min_phi max_phi min_r max_r\00"
@stdout = global i32 0
@.str.2 = [40 x i8] c"There are %d points selected out of %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i32 %0, 15
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = call float* @load_mock_file(i8* %12, i32* %3)
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = call float* @load_mock_file(i8* %15, i32* %3)
%17 = getelementptr inbounds i8*, i8** %1, i64 3
%18 = load i8*, i8** %17
%19 = call float* @load_mock_file(i8* %18, i32* %3)
%20 = getelementptr inbounds i8*, i8** %1, i64 4
%21 = load i8*, i8** %20
%22 = call float* @load_mock_file(i8* %21, i32* %3)
%23 = load i8*, i8** %11
%24 = call float* @load_mock_file(i8* %23, i32* %3)
%25 = load i8*, i8** %14
%26 = call float* @load_mock_file(i8* %25, i32* %3)
%27 = load i8*, i8** %17
%28 = call float* @load_mock_file(i8* %27, i32* %3)
%29 = load i8*, i8** %20
%30 = call float* @load_mock_file(i8* %29, i32* %3)
%31 = getelementptr inbounds i8*, i8** %1, i64 9
%32 = load i8*, i8** %31
%33 = call float @atof(i8* %32)
%34 = getelementptr inbounds i8*, i8** %1, i64 10
%35 = load i8*, i8** %34
%36 = call float @atof(i8* %35)
%37 = getelementptr inbounds i8*, i8** %1, i64 11
%38 = load i8*, i8** %37
%39 = call float @atof(i8* %38)
%40 = getelementptr inbounds i8*, i8** %1, i64 12
%41 = load i8*, i8** %40
%42 = call float @atof(i8* %41)
%43 = getelementptr inbounds i8*, i8** %1, i64 13
%44 = load i8*, i8** %43
%45 = call float @atof(i8* %44)
%46 = getelementptr inbounds i8*, i8** %1, i64 14
%47 = load i8*, i8** %46
%48 = call float @atof(i8* %47)
%49 = fpext float %39 to double
%50 = fmul double %49, 0x400921FB54442D18
%51 = fdiv double %50, 1.800000e+02
%52 = fptrunc double %51 to float
%53 = fpext float %42 to double
%54 = fmul double %53, 0x400921FB54442D18
%55 = fdiv double %54, 1.800000e+02
%56 = fptrunc double %55 to float
%57 = fpext float %33 to double
%58 = fmul double %57, 0x400921FB54442D18
%59 = fdiv double %58, 1.800000e+02
%60 = fptrunc double %59 to float
%61 = fpext float %36 to double
%62 = fmul double %61, 0x400921FB54442D18
%63 = fdiv double %62, 1.800000e+02
%64 = fptrunc double %63 to float
%65 = load i32, i32* %3
%66 = icmp sgt i32 %65, 0
br i1 %66, label %67, label %128
67: ; preds = %10, %121
%68 = phi i32 [ %122, %121 ], [ %65, %10 ]
%69 = phi i64 [ %125, %121 ], [ 0, %10 ]
%70 = phi i32 [ %124, %121 ], [ 0, %10 ]
%71 = phi i32 [ %123, %121 ], [ 0, %10 ]
%72 = getelementptr inbounds float, float* %13, i64 %69
%73 = load float, float* %72
%74 = fcmp olt float %73, 0.000000e+00
br i1 %74, label %75, label %77
75: ; preds = %67
%76 = fneg float %73
store float %76, float* %72
br label %77
77: ; preds = %75, %67
%78 = phi float [ %76, %75 ], [ %73, %67 ]
%79 = fcmp ogt float %78, %45
%80 = fcmp olt float %78, %48
%81 = select i1 %79, i1 %80, i1 false
br i1 %81, label %82, label %121
82: ; preds = %77
%83 = getelementptr inbounds float, float* %19, i64 %69
%84 = load float, float* %83
%85 = fcmp olt float %84, %64
%86 = fcmp ogt float %84, %60
%87 = select i1 %85, i1 %86, i1 false
br i1 %87, label %88, label %121
88: ; preds = %82
%89 = getelementptr inbounds float, float* %16, i64 %69
%90 = load float, float* %89
%91 = fcmp ogt float %90, %52
%92 = fcmp olt float %90, %56
%93 = select i1 %91, i1 %92, i1 false
br i1 %93, label %94, label %121
94: ; preds = %88
%95 = call float @sin(float %84)
%96 = fmul float %78, %95
%97 = load float, float* %89
%98 = call float @cos(float %97)
%99 = fmul float %96, %98
%100 = sext i32 %71 to i64
%101 = getelementptr inbounds float, float* %24, i64 %100
store float %99, float* %101
%102 = load float, float* %72
%103 = load float, float* %83
%104 = call float @sin(float %103)
%105 = fmul float %102, %104
%106 = load float, float* %89
%107 = call float @sin(float %106)
%108 = fmul float %105, %107
%109 = getelementptr inbounds float, float* %26, i64 %100
store float %108, float* %109
%110 = load float, float* %72
%111 = load float, float* %83
%112 = call float @cos(float %111)
%113 = fmul float %110, %112
%114 = getelementptr inbounds float, float* %28, i64 %100
store float %113, float* %114
%115 = getelementptr inbounds float, float* %22, i64 %69
%116 = load float, float* %115
%117 = getelementptr inbounds float, float* %30, i64 %100
store float %116, float* %117
%118 = add nsw i32 %71, 1
%119 = add nsw i32 %70, 1
%120 = load i32, i32* %3
br label %121
121: ; preds = %77, %82, %88, %94
%122 = phi i32 [ %120, %94 ], [ %68, %88 ], [ %68, %82 ], [ %68, %77 ]
%123 = phi i32 [ %118, %94 ], [ %71, %88 ], [ %71, %82 ], [ %71, %77 ]
%124 = phi i32 [ %119, %94 ], [ %70, %88 ], [ %70, %82 ], [ %70, %77 ]
%125 = add nuw nsw i64 %69, 1
%126 = sext i32 %122 to i64
%127 = icmp slt i64 %125, %126
br i1 %127, label %67, label %128
128: ; preds = %121, %10
%129 = phi i32 [ 0, %10 ], [ %124, %121 ]
%130 = phi i32 [ %65, %10 ], [ %122, %121 ]
%131 = load i32, i32* @stdout
%132 = call i32 (i32, i8*, ...) @fprintf(i32 %131, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 %129, i32 %130)
%133 = getelementptr inbounds i8*, i8** %1, i64 5
%134 = load i8*, i8** %133
%135 = call i32 @dump_mock_file(i8* %134, float* %24, i32 %129)
%136 = getelementptr inbounds i8*, i8** %1, i64 6
%137 = load i8*, i8** %136
%138 = call i32 @dump_mock_file(i8* %137, float* %26, i32 %129)
%139 = getelementptr inbounds i8*, i8** %1, i64 7
%140 = load i8*, i8** %139
%141 = call i32 @dump_mock_file(i8* %140, float* %28, i32 %129)
%142 = getelementptr inbounds i8*, i8** %1, i64 8
%143 = load i8*, i8** %142
%144 = call i32 @dump_mock_file(i8* %143, float* %30, i32 %129)
ret i32 0
}