#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
double Sersic(double, double, double);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, double, double,
                           double, double, double);
int sersic_b(int);
int main(void) {
  FILE *out;
  double r, p1 = 5;
  double p2_05, p2_1, p2_25, p2_4, p2_6;
  double co_05, co_1, co_25, co_4, co_6;
  double s0_05, s0_1, s0_25, s0_4, s0_6;
  out = fopen("SersicComp.txt", "w");
  p2_05 = 1.0f / 0.5f;
  co_05 = -1 * sersic_b(0.5f);
  p2_1 = 1;
  co_1 = -1 * sersic_b(1);
  p2_25 = 1 / 2.5f;
  co_25 = -1 * sersic_b(2.5);
  p2_4 = 1.0f / 4.0f;
  co_4 = -1 * sersic_b(4);
  p2_6 = 1.0f / 6.0f;
  co_6 = -1 * sersic_b(6);
  s0_05 = Sersic(0, 0.5, co_05);
  s0_1 = Sersic(0, 1, co_1);
  s0_25 = Sersic(0, 2.5, co_25);
  s0_4 = Sersic(0, 4, co_4);
  s0_6 = Sersic(0, 6, co_6);
  for (r = 0.0f; r < 25.2; r += 0.1)
    fprintf(
        out, "%-15.1f %-15.8f %-15.8f %-15.8f %-15.8f %-15.8f\n", r,
        Sersic(r / p1, p2_05, co_05) / s0_05, Sersic(r / p1, p2_1, co_1) / s0_1,
        Sersic(r / p1, p2_25, co_25) / s0_25, Sersic(r / p1, p2_4, co_4) / s0_4,
        Sersic(r / p1, p2_6, co_6) / s0_6);
  fclose(out);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xede(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xeea(%rip),%rdi
lea    0xef2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
movsd  0xeb2(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
xor    %edi,%edi
call   1070 <sersic_b@plt>
imul   $0xffffffff,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe67(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    $0x1,%edi
call   1070 <sersic_b@plt>
imul   $0xffffffff,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe61(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    $0x2,%edi
call   1070 <sersic_b@plt>
imul   $0xffffffff,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe33(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    $0x4,%edi
call   1070 <sersic_b@plt>
imul   $0xffffffff,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe05(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    $0x6,%edi
call   1070 <sersic_b@plt>
imul   $0xffffffff,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm2
xorps  %xmm0,%xmm0
movsd  0xdcf(%rip),%xmm1
call   1040 <Sersic@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm2
xorps  %xmm0,%xmm0
movsd  0xdad(%rip),%xmm1
call   1040 <Sersic@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x60(%rbp),%xmm2
xorps  %xmm0,%xmm0
movsd  0xd8b(%rip),%xmm1
call   1040 <Sersic@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x68(%rbp),%xmm2
xorps  %xmm0,%xmm0
movsd  0xd66(%rip),%xmm1
call   1040 <Sersic@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x70(%rbp),%xmm2
xorps  %xmm0,%xmm0
movsd  0xd41(%rip),%xmm1
call   1040 <Sersic@plt>
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xd74(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1413 <main+0x2c3>
mov    -0x10(%rbp),%rax
mov    %rax,-0xc8(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
call   1040 <Sersic@plt>
divsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
call   1040 <Sersic@plt>
divsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
call   1040 <Sersic@plt>
divsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
call   1040 <Sersic@plt>
divsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
call   1040 <Sersic@plt>
mov    -0xc8(%rbp),%rdi
movsd  -0xc0(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm2
ff
movsd  -0xb0(%rbp),%xmm3
ff
movsd  -0xa8(%rbp),%xmm4
ff
movaps %xmm0,%xmm5
movsd  -0xa0(%rbp),%xmm0
ff
divsd  -0x98(%rbp),%xmm5
ff
lea    0xc7a(%rip),%rsi
call   1050 <fprintf@plt>
movsd  0xc54(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    12d4 <main+0x184>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
lea    0xeff(%rip),%rdi
lea    0xf07(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
xor    %edi,%edi
call   1070 <sersic_b@plt>
neg    %eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x38(%rsp)
mov    $0x1,%edi
call   1070 <sersic_b@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x30(%rsp)
mov    $0x2,%edi
call   1070 <sersic_b@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x28(%rsp)
mov    $0x4,%edi
call   1070 <sersic_b@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x20(%rsp)
mov    $0x6,%edi
call   1070 <sersic_b@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x18(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xe07(%rip),%xmm1
xorpd  %xmm0,%xmm0
movsd  0x38(%rsp),%xmm2
call   1040 <Sersic@plt>
movsd  %xmm0,0x60(%rsp)
movsd  0xdf2(%rip),%xmm1
xorpd  %xmm0,%xmm0
movsd  0x30(%rsp),%xmm2
call   1040 <Sersic@plt>
movsd  %xmm0,0x58(%rsp)
movsd  0xddd(%rip),%xmm1
xorpd  %xmm0,%xmm0
movsd  0x28(%rsp),%xmm2
call   1040 <Sersic@plt>
movsd  %xmm0,0x50(%rsp)
movsd  0xdc8(%rip),%xmm1
xorpd  %xmm0,%xmm0
movsd  0x20(%rsp),%xmm2
call   1040 <Sersic@plt>
movsd  %xmm0,0x48(%rsp)
movsd  0xdb3(%rip),%xmm1
xorpd  %xmm0,%xmm0
movsd  0x18(%rsp),%xmm2
call   1040 <Sersic@plt>
movsd  %xmm0,0x40(%rsp)
lea    0xde8(%rip),%r14
nopl   0x0(%rax)
movsd  0x8(%rsp),%xmm0
divsd  0xd8a(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xd84(%rip),%xmm1
movsd  0x38(%rsp),%xmm2
call   1040 <Sersic@plt>
divsd  0x60(%rsp),%xmm0
movsd  %xmm0,0x80(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0xd34(%rip),%xmm1
movsd  0x30(%rsp),%xmm2
call   1040 <Sersic@plt>
divsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x78(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0xd3f(%rip),%xmm1
movsd  0x28(%rsp),%xmm2
call   1040 <Sersic@plt>
divsd  0x50(%rsp),%xmm0
movsd  %xmm0,0x70(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0xd22(%rip),%xmm1
movsd  0x20(%rsp),%xmm2
call   1040 <Sersic@plt>
divsd  0x48(%rsp),%xmm0
movsd  %xmm0,0x68(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0xd05(%rip),%xmm1
movsd  0x18(%rsp),%xmm2
call   1040 <Sersic@plt>
movapd %xmm0,%xmm5
divsd  0x40(%rsp),%xmm5
mov    %rbx,%rdi
mov    %r14,%rsi
movsd  0x8(%rsp),%xmm0
movsd  0x80(%rsp),%xmm1
movsd  0x78(%rsp),%xmm2
movsd  0x70(%rsp),%xmm3
movsd  0x68(%rsp),%xmm4
call   1050 <fprintf@plt>
movsd  0x8(%rsp),%xmm1
addsd  0xcbe(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xcb8(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     1290 <main+0x140>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"SersicComp.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [49 x i8] c"%-15.1f %-15.8f %-15.8f %-15.8f %-15.8f %-15.8f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
store i32 0, i32* %1
store double 5.000000e+00, double* %4
%20 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %20, i32** %2
store double 2.000000e+00, double* %5
%21 = call i32 @sersic_b(i32 0)
%22 = mul nsw i32 -1, %21
%23 = sitofp i32 %22 to double
store double %23, double* %10
store double 1.000000e+00, double* %6
%24 = call i32 @sersic_b(i32 1)
%25 = mul nsw i32 -1, %24
%26 = sitofp i32 %25 to double
store double %26, double* %11
store double 0x3FD99999A0000000, double* %7
%27 = call i32 @sersic_b(i32 2)
%28 = mul nsw i32 -1, %27
%29 = sitofp i32 %28 to double
store double %29, double* %12
store double 2.500000e-01, double* %8
%30 = call i32 @sersic_b(i32 4)
%31 = mul nsw i32 -1, %30
%32 = sitofp i32 %31 to double
store double %32, double* %13
store double 0x3FC5555560000000, double* %9
%33 = call i32 @sersic_b(i32 6)
%34 = mul nsw i32 -1, %33
%35 = sitofp i32 %34 to double
store double %35, double* %14
%36 = load double, double* %10
%37 = call double @Sersic(double 0.000000e+00, double 5.000000e-01, double %36)
store double %37, double* %15
%38 = load double, double* %11
%39 = call double @Sersic(double 0.000000e+00, double 1.000000e+00, double %38)
store double %39, double* %16
%40 = load double, double* %12
%41 = call double @Sersic(double 0.000000e+00, double 2.500000e+00, double %40)
store double %41, double* %17
%42 = load double, double* %13
%43 = call double @Sersic(double 0.000000e+00, double 4.000000e+00, double %42)
store double %43, double* %18
%44 = load double, double* %14
%45 = call double @Sersic(double 0.000000e+00, double 6.000000e+00, double %44)
store double %45, double* %19
store double 0.000000e+00, double* %3
br label %46
46: ; preds = %93, %0
%47 = load double, double* %3
%48 = fcmp olt double %47, 2.520000e+01
br i1 %48, label %49, label %96
49: ; preds = %46
%50 = load i32*, i32** %2
%51 = load double, double* %3
%52 = load double, double* %3
%53 = load double, double* %4
%54 = fdiv double %52, %53
%55 = load double, double* %5
%56 = load double, double* %10
%57 = call double @Sersic(double %54, double %55, double %56)
%58 = load double, double* %15
%59 = fdiv double %57, %58
%60 = load double, double* %3
%61 = load double, double* %4
%62 = fdiv double %60, %61
%63 = load double, double* %6
%64 = load double, double* %11
%65 = call double @Sersic(double %62, double %63, double %64)
%66 = load double, double* %16
%67 = fdiv double %65, %66
%68 = load double, double* %3
%69 = load double, double* %4
%70 = fdiv double %68, %69
%71 = load double, double* %7
%72 = load double, double* %12
%73 = call double @Sersic(double %70, double %71, double %72)
%74 = load double, double* %17
%75 = fdiv double %73, %74
%76 = load double, double* %3
%77 = load double, double* %4
%78 = fdiv double %76, %77
%79 = load double, double* %8
%80 = load double, double* %13
%81 = call double @Sersic(double %78, double %79, double %80)
%82 = load double, double* %18
%83 = fdiv double %81, %82
%84 = load double, double* %3
%85 = load double, double* %4
%86 = fdiv double %84, %85
%87 = load double, double* %9
%88 = load double, double* %14
%89 = call double @Sersic(double %86, double %87, double %88)
%90 = load double, double* %19
%91 = fdiv double %89, %90
%92 = call i32 @fprintf(i32* %50, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), double %51, double %59, double %67, double %75, double %83, double %91)
br label %93
93: ; preds = %49
%94 = load double, double* %3
%95 = fadd double %94, 1.000000e-01
store double %95, double* %3
br label %46
96: ; preds = %46
%97 = load i32*, i32** %2
%98 = call i32 @fclose(i32* %97)
%99 = load i32, i32* %1
ret i32 %99
}

LLVM IR (-O2):
@.str = [15 x i8] c"SersicComp.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [49 x i8] c"%-15.1f %-15.8f %-15.8f %-15.8f %-15.8f %-15.8f\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @sersic_b(i32 0)
%3 = sub nsw i32 0, %2
%4 = sitofp i32 %3 to double
%5 = tail call i32 @sersic_b(i32 1)
%6 = sub nsw i32 0, %5
%7 = sitofp i32 %6 to double
%8 = tail call i32 @sersic_b(i32 2)
%9 = sub nsw i32 0, %8
%10 = sitofp i32 %9 to double
%11 = tail call i32 @sersic_b(i32 4)
%12 = sub nsw i32 0, %11
%13 = sitofp i32 %12 to double
%14 = tail call i32 @sersic_b(i32 6)
%15 = sub nsw i32 0, %14
%16 = sitofp i32 %15 to double
%17 = tail call double @Sersic(double 0.000000e+00, double 5.000000e-01, double %4)
%18 = tail call double @Sersic(double 0.000000e+00, double 1.000000e+00, double %7)
%19 = tail call double @Sersic(double 0.000000e+00, double 2.500000e+00, double %10)
%20 = tail call double @Sersic(double 0.000000e+00, double 4.000000e+00, double %13)
%21 = tail call double @Sersic(double 0.000000e+00, double 6.000000e+00, double %16)
br label %22
22: ; preds = %0, %22
%23 = phi double [ 0.000000e+00, %0 ], [ %36, %22 ]
%24 = fdiv double %23, 5.000000e+00
%25 = tail call double @Sersic(double %24, double 2.000000e+00, double %4)
%26 = fdiv double %25, %17
%27 = tail call double @Sersic(double %24, double 1.000000e+00, double %7)
%28 = fdiv double %27, %18
%29 = tail call double @Sersic(double %24, double 0x3FD99999A0000000, double %10)
%30 = fdiv double %29, %19
%31 = tail call double @Sersic(double %24, double 2.500000e-01, double %13)
%32 = fdiv double %31, %20
%33 = tail call double @Sersic(double %24, double 0x3FC5555560000000, double %16)
%34 = fdiv double %33, %21
%35 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), double %23, double %26, double %28, double %30, double %32, double %34)
%36 = fadd double %23, 1.000000e-01
%37 = fcmp olt double %36, 2.520000e+01
br i1 %37, label %22, label %38
38: ; preds = %22
%39 = tail call i32 @fclose(i32* %1)
ret i32 0
}