#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 */
int /*<<< orphan*/ gets(char *);
int pow(float, double);
int /*<<< orphan*/ printf(char *, ...);
int sqrt(int);
int /*<<< orphan*/ sscanf(char *, char *, float *);
int main(int argc, char *argv[]) {
  int i;
  float omega;
  float n0;
  float N;
  float dz;
  float z;
  float zmax;
  float f;
  float sum;
  float tau;
  char line[1000];
  printf("Enter z_max  ");
  gets(line);
  sscanf(line, "%f", &zmax);
  printf("You have entered z_max = %f\n", zmax);
  printf("Enter Omega_0:  ");
  gets(line);
  sscanf(line, "%f", &omega);
  printf("Enter n_0 in units of 1/Mpc^3:  ");
  gets(line);
  sscanf(line, "%f", &n0);
  dz = zmax / 10000;
  printf("dz = %f\n", dz);
  z = dz / 2;
  sum = 0.0;
  for (i = 0; i < 10000; i++) {
    z += dz;
    f = (omega * z + (omega - 2) * (sqrt(1 + omega * z) - 1)) *
        (omega * z + (omega - 2) * (sqrt(1 + omega * z) - 1)) /
        ((1 + z) * (1 + z) * (1 + z) * sqrt(1 + omega * z));
    sum += f * dz;
  }
  N = 16 * 3.141592653589793 * n0 * pow((3.0e10 / 3.1e24 / 3.23e-18), 3.0) *
      sum / pow(omega, 4.0);
  tau = 10e-10 * 3.141592653589793 * n0 *
        pow((3.0e10 / 3.1e24 / 3.23e-18), 3.0) * sum / pow(omega, 4.0);
  printf("N = %g, tau=%g\n", N, tau);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x470,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x420(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x420(%rbp),%rdi
lea    0xead(%rip),%rsi
lea    -0x2c(%rbp),%rdx
call   1050 <sscanf@plt>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe97(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x420(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x420(%rbp),%rdi
lea    0xe65(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <sscanf@plt>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x420(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x420(%rbp),%rdi
lea    0xe34(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <sscanf@plt>
movss  -0x2c(%rbp),%xmm0
movss  0xde4(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe57(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
movss  0xdb3(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2710,-0x14(%rbp)
jge    1444 <main+0x2f4>
movss  -0x24(%rbp),%xmm0
addss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x440(%rbp)
ff
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x43c(%rbp)
ff
movss  -0x18(%rbp),%xmm0
movss  0xd58(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x444(%rbp)
ff
movss  -0x18(%rbp),%xmm0
movss  -0x28(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xd42(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1070 <sqrt@plt>
movss  -0x444(%rbp),%xmm1
ff
movss  -0x440(%rbp),%xmm0
ff
movss  -0x43c(%rbp),%xmm2
ff
sub    $0x1,%eax
cvtsi2ss %eax,%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x42c(%rbp)
ff
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x434(%rbp)
ff
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x430(%rbp)
ff
movss  -0x18(%rbp),%xmm0
movss  0xccf(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x438(%rbp)
ff
movss  -0x18(%rbp),%xmm0
movss  -0x28(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xcb9(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1070 <sqrt@plt>
movss  -0x438(%rbp),%xmm2
ff
movss  -0x434(%rbp),%xmm1
ff
movss  -0x430(%rbp),%xmm3
ff
movss  -0x42c(%rbp),%xmm0
ff
sub    $0x1,%eax
cvtsi2ss %eax,%xmm4
mulss  %xmm4,%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x424(%rbp)
ff
movss  0xc65(%rip),%xmm0
addss  -0x28(%rbp),%xmm0
movss  0xc58(%rip),%xmm1
addss  -0x28(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xc47(%rip),%xmm1
addss  -0x28(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x428(%rbp)
ff
movss  -0x18(%rbp),%xmm0
movss  -0x28(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xc20(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1070 <sqrt@plt>
movss  -0x428(%rbp),%xmm1
movss  -0x424(%rbp),%xmm0
ff
cvtsi2ss %eax,%xmm2
mulss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movss  -0x34(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1265 <main+0x115>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xbd3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x468(%rbp)
ff
movss  0xb9f(%rip),%xmm0
movsd  0xba7(%rip),%xmm1
call   1060 <pow@plt>
movsd  -0x468(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movss  -0x34(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x460(%rbp)
ff
movss  -0x18(%rbp),%xmm0
movsd  0xb68(%rip),%xmm1
call   1060 <pow@plt>
movsd  -0x460(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xb49(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x458(%rbp)
ff
movss  0xb1d(%rip),%xmm0
movsd  0xb25(%rip),%xmm1
call   1060 <pow@plt>
movsd  -0x458(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movss  -0x34(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x450(%rbp)
ff
movss  -0x18(%rbp),%xmm0
movsd  0xae6(%rip),%xmm1
call   1060 <pow@plt>
movsd  -0x450(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x38(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xb38(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x470,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x440,%rsp
lea    0xeee(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0xee1(%rip),%r14
lea    0x18(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <sscanf@plt>
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <sscanf@plt>
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0x1c(%rsp),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <sscanf@plt>
movss  0x18(%rsp),%xmm0
divss  0xe01(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xea0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xde5(%rip),%xmm0
mulss  0xc(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
mov    $0x2710,%ebp
nopl   0x0(%rax,%rax,1)
movaps 0x20(%rsp),%xmm1
addss  0xc(%rsp),%xmm1
movaps %xmm1,0x20(%rsp)
movss  0x8(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
mulss  %xmm1,%xmm0
movss  0xda1(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1070 <sqrt@plt>
mov    %eax,%ebx
movss  0x8(%rsp),%xmm0
movaps 0x30(%rsp),%xmm1
unpcklps %xmm0,%xmm1
movaps %xmm1,0x30(%rsp)
addps  0xd80(%rip),%xmm1
movaps %xmm1,0x40(%rsp)
mulss  0x20(%rsp),%xmm0
addss  0xd65(%rip),%xmm0
cvttss2si %xmm0,%edi
call   1070 <sqrt@plt>
movd   %ebx,%xmm0
movd   %eax,%xmm1
punpckldq %xmm1,%xmm0
paddd  0xd60(%rip),%xmm0
cvtdq2ps %xmm0,%xmm0
mulps  0x40(%rsp),%xmm0
movaps 0x20(%rsp),%xmm2
movaps %xmm2,%xmm1
shufps $0x0,%xmm2,%xmm1
mulps  0x30(%rsp),%xmm1
addps  %xmm0,%xmm1
movaps %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm0
mulss  %xmm1,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm2,%xmm1
movaps %xmm2,%xmm0
movss  0xd0e(%rip),%xmm2
addss  %xmm2,%xmm0
movaps %xmm0,%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm0,%xmm3
movaps %xmm3,0x40(%rsp)
movss  0x8(%rsp),%xmm0
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
cvttss2si %xmm0,%edi
call   1070 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x40(%rsp),%xmm0
movaps 0x30(%rsp),%xmm1
divss  %xmm0,%xmm1
mulss  0xc(%rsp),%xmm1
movss  0x10(%rsp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0x10(%rsp)
add    $0xffffffff,%ebp
jne    1240 <main+0xf0>
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xcc4(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
movss  0xc92(%rip),%xmm0
movsd  0xcb6(%rip),%xmm1
call   1060 <pow@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0x20(%rsp),%xmm1
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x30(%rsp)
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
movss  0x8(%rsp),%xmm0
movsd  0xc84(%rip),%xmm1
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x20(%rsp),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0x20(%rsp)
movss  0x1c(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xc57(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movss  0xc0d(%rip),%xmm0
movsd  0xc31(%rip),%xmm1
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
mulsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
movss  0x8(%rsp),%xmm0
movsd  0xc0d(%rip),%xmm1
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x30(%rsp),%xmm1
divsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
lea    0xc57(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x440,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Enter z_max \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [29 x i8] c"You have entered z_max = %f\0A\00"
@.str.3 = [17 x i8] c"Enter Omega_0: \00"
@.str.4 = [33 x i8] c"Enter n_0 in units of 1/Mpc^3: \00"
@.str.5 = [9 x i8] c"dz = %f\0A\00"
@.str.6 = [16 x i8] c"N = %g, tau=%g\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 float
%16 = alloca [1000 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%18 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%19 = call i32 @gets(i8* %18)
%20 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%21 = call i32 @sscanf(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %12)
%22 = load float, float* %12
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), double %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%26 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%27 = call i32 @gets(i8* %26)
%28 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%29 = call i32 @sscanf(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %7)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%31 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%32 = call i32 @gets(i8* %31)
%33 = getelementptr inbounds [1000 x i8], [1000 x i8]* %16, i64 0, i64 0
%34 = call i32 @sscanf(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %8)
%35 = load float, float* %12
%36 = fdiv float %35, 1.000000e+04
store float %36, float* %10
%37 = load float, float* %10
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), double %38)
%40 = load float, float* %10
%41 = fdiv float %40, 2.000000e+00
store float %41, float* %11
store float 0.000000e+00, float* %14
store i32 0, i32* %6
br label %42
42: ; preds = %96, %2
%43 = load i32, i32* %6
%44 = icmp slt i32 %43, 10000
br i1 %44, label %45, label %99
45: ; preds = %42
%46 = load float, float* %10
%47 = load float, float* %11
%48 = fadd float %47, %46
store float %48, float* %11
%49 = load float, float* %7
%50 = load float, float* %11
%51 = load float, float* %7
%52 = fsub float %51, 2.000000e+00
%53 = load float, float* %7
%54 = load float, float* %11
%55 = call float @llvm.fmuladd.f32(float %53, float %54, float 1.000000e+00)
%56 = fptosi float %55 to i32
%57 = call i32 @sqrt(i32 %56)
%58 = sub nsw i32 %57, 1
%59 = sitofp i32 %58 to float
%60 = fmul float %52, %59
%61 = call float @llvm.fmuladd.f32(float %49, float %50, float %60)
%62 = load float, float* %7
%63 = load float, float* %11
%64 = load float, float* %7
%65 = fsub float %64, 2.000000e+00
%66 = load float, float* %7
%67 = load float, float* %11
%68 = call float @llvm.fmuladd.f32(float %66, float %67, float 1.000000e+00)
%69 = fptosi float %68 to i32
%70 = call i32 @sqrt(i32 %69)
%71 = sub nsw i32 %70, 1
%72 = sitofp i32 %71 to float
%73 = fmul float %65, %72
%74 = call float @llvm.fmuladd.f32(float %62, float %63, float %73)
%75 = fmul float %61, %74
%76 = load float, float* %11
%77 = fadd float 1.000000e+00, %76
%78 = load float, float* %11
%79 = fadd float 1.000000e+00, %78
%80 = fmul float %77, %79
%81 = load float, float* %11
%82 = fadd float 1.000000e+00, %81
%83 = fmul float %80, %82
%84 = load float, float* %7
%85 = load float, float* %11
%86 = call float @llvm.fmuladd.f32(float %84, float %85, float 1.000000e+00)
%87 = fptosi float %86 to i32
%88 = call i32 @sqrt(i32 %87)
%89 = sitofp i32 %88 to float
%90 = fmul float %83, %89
%91 = fdiv float %75, %90
store float %91, float* %13
%92 = load float, float* %13
%93 = load float, float* %10
%94 = load float, float* %14
%95 = call float @llvm.fmuladd.f32(float %92, float %93, float %94)
store float %95, float* %14
br label %96
96: ; preds = %45
%97 = load i32, i32* %6
%98 = add nsw i32 %97, 1
store i32 %98, i32* %6
br label %42
99: ; preds = %42
%100 = load float, float* %8
%101 = fpext float %100 to double
%102 = fmul double 0x404921FB54442D18, %101
%103 = call i32 @pow(float 0x40A76835C0000000, double 3.000000e+00)
%104 = sitofp i32 %103 to double
%105 = fmul double %102, %104
%106 = load float, float* %14
%107 = fpext float %106 to double
%108 = fmul double %105, %107
%109 = load float, float* %7
%110 = call i32 @pow(float %109, double 4.000000e+00)
%111 = sitofp i32 %110 to double
%112 = fdiv double %108, %111
%113 = fptrunc double %112 to float
store float %113, float* %9
%114 = load float, float* %8
%115 = fpext float %114 to double
%116 = fmul double 0x3E2AFC6F70213BE5, %115
%117 = call i32 @pow(float 0x40A76835C0000000, double 3.000000e+00)
%118 = sitofp i32 %117 to double
%119 = fmul double %116, %118
%120 = load float, float* %14
%121 = fpext float %120 to double
%122 = fmul double %119, %121
%123 = load float, float* %7
%124 = call i32 @pow(float %123, double 4.000000e+00)
%125 = sitofp i32 %124 to double
%126 = fdiv double %122, %125
%127 = fptrunc double %126 to float
store float %127, float* %15
%128 = load float, float* %9
%129 = fpext float %128 to double
%130 = load float, float* %15
%131 = fpext float %130 to double
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), double %129, double %131)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Enter z_max \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [29 x i8] c"You have entered z_max = %f\0A\00"
@.str.3 = [17 x i8] c"Enter Omega_0: \00"
@.str.4 = [33 x i8] c"Enter n_0 in units of 1/Mpc^3: \00"
@.str.5 = [9 x i8] c"dz = %f\0A\00"
@.str.6 = [16 x i8] c"N = %g, tau=%g\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca [1000 x i8]
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = bitcast float* %5 to i8*
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @gets(i8* %10)
%13 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%14 = load float, float* %5
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), double %15)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @gets(i8* %10)
%19 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%21 = call i32 @gets(i8* %10)
%22 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%23 = load float, float* %5
%24 = fdiv float %23, 1.000000e+04
%25 = fpext float %24 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), double %25)
%27 = fmul float %24, 5.000000e-01
br label %28
28: ; preds = %2, %28
%29 = phi i32 [ 0, %2 ], [ %66, %28 ]
%30 = phi float [ 0.000000e+00, %2 ], [ %65, %28 ]
%31 = phi float [ %27, %2 ], [ %32, %28 ]
%32 = fadd float %24, %31
%33 = load float, float* %3
%34 = call float @llvm.fmuladd.f32(float %33, float %32, float 1.000000e+00)
%35 = fptosi float %34 to i32
%36 = call i32 @sqrt(i32 %35)
%37 = load float, float* %3
%38 = insertelement <2 x float> poison, float %33, i64 0
%39 = insertelement <2 x float> %38, float %37, i64 1
%40 = fadd <2 x float> %39, <float -2.000000e+00, float -2.000000e+00>
%41 = call float @llvm.fmuladd.f32(float %37, float %32, float 1.000000e+00)
%42 = fptosi float %41 to i32
%43 = call i32 @sqrt(i32 %42)
%44 = insertelement <2 x i32> poison, i32 %36, i64 0
%45 = insertelement <2 x i32> %44, i32 %43, i64 1
%46 = add nsw <2 x i32> %45, <i32 -1, i32 -1>
%47 = sitofp <2 x i32> %46 to <2 x float>
%48 = fmul <2 x float> %40, %47
%49 = insertelement <2 x float> poison, float %32, i64 0
%50 = shufflevector <2 x float> %49, <2 x float> poison, <2 x i32> zeroinitializer
%51 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %39, <2 x float> %50, <2 x float> %48)
%52 = shufflevector <2 x float> %51, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%53 = fmul <2 x float> %51, %52
%54 = extractelement <2 x float> %53, i64 0
%55 = fadd float %32, 1.000000e+00
%56 = fmul float %55, %55
%57 = fmul float %55, %56
%58 = load float, float* %3
%59 = call float @llvm.fmuladd.f32(float %58, float %32, float 1.000000e+00)
%60 = fptosi float %59 to i32
%61 = call i32 @sqrt(i32 %60)
%62 = sitofp i32 %61 to float
%63 = fmul float %57, %62
%64 = fdiv float %54, %63
%65 = call float @llvm.fmuladd.f32(float %64, float %24, float %30)
%66 = add nuw nsw i32 %29, 1
%67 = icmp eq i32 %66, 10000
br i1 %67, label %68, label %28
68: ; preds = %28
%69 = load float, float* %4
%70 = fpext float %69 to double
%71 = fmul double %70, 0x404921FB54442D18
%72 = call i32 @pow(float 0x40A76835C0000000, double 3.000000e+00)
%73 = sitofp i32 %72 to double
%74 = fmul double %71, %73
%75 = fpext float %65 to double
%76 = fmul double %74, %75
%77 = load float, float* %3
%78 = call i32 @pow(float %77, double 4.000000e+00)
%79 = sitofp i32 %78 to double
%80 = fdiv double %76, %79
%81 = fptrunc double %80 to float
%82 = load float, float* %4
%83 = fpext float %82 to double
%84 = fmul double %83, 0x3E2AFC6F70213BE5
%85 = call i32 @pow(float 0x40A76835C0000000, double 3.000000e+00)
%86 = sitofp i32 %85 to double
%87 = fmul double %84, %86
%88 = fmul double %87, %75
%89 = load float, float* %3
%90 = call i32 @pow(float %89, double 4.000000e+00)
%91 = sitofp i32 %90 to double
%92 = fdiv double %88, %91
%93 = fptrunc double %92 to float
%94 = fpext float %81 to double
%95 = fpext float %93 to double
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), double %94, double %95)
ret i32 0
}