#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
double sersic_b(double n) {
  if (n <= 0.35f) {
    printf("\n\n   ##ERROR in mock.c's sersic_b()\n");
    printf("\t Sersic n (=%f) must be smaller than 0.35\n\n", n);
    exit(EXIT_FAILURE);
  }
  return 2 * n - (1 / 3) + (4 / (405 * n)) + (46 / (25515 * n * n)) +
         (131 / (1146175 * n * n * n) -
          (2194697 / (30690717750 * n * n * n * n)));
}


x86 assembly (clang, -O0):
<sersic_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     116f <sersic_b+0x4f>
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xf13(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
movsd  -0x8(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xec0(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
movsd  0xeab(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  0xe93(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
mulsd  -0x8(%rbp),%xmm2
movsd  0xe79(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  0xe61(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
mulsd  -0x8(%rbp),%xmm2
mulsd  -0x8(%rbp),%xmm2
movsd  0xe42(%rip),%xmm1
divsd  %xmm2,%xmm1
movsd  0xe2e(%rip),%xmm3
mulsd  -0x8(%rbp),%xmm3
mulsd  -0x8(%rbp),%xmm3
mulsd  -0x8(%rbp),%xmm3
mulsd  -0x8(%rbp),%xmm3
movsd  0xe0a(%rip),%xmm2
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sersic_b>:
sub    $0x18,%rsp
movsd  0xec4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    11cb <sersic_b+0x9b>
movapd %xmm0,%xmm4
addsd  %xmm0,%xmm4
movsd  0xeb2(%rip),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
movapd 0xeb6(%rip),%xmm3
unpcklpd %xmm1,%xmm3
mulpd  %xmm2,%xmm3
movapd 0xeb6(%rip),%xmm1
divpd  %xmm3,%xmm1
addsd  %xmm1,%xmm4
unpckhpd %xmm1,%xmm1
addsd  %xmm4,%xmm1
mulsd  0xe7e(%rip),%xmm0
movapd 0xea6(%rip),%xmm3
unpcklpd %xmm0,%xmm3
mulpd  %xmm2,%xmm3
mulpd  %xmm2,%xmm3
mulpd  %xmm2,%xmm3
movapd 0xe9e(%rip),%xmm0
divpd  %xmm3,%xmm0
movapd %xmm0,%xmm2
unpckhpd %xmm0,%xmm2
subsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret
lea    0xebb(%rip),%rdi
movapd %xmm0,(%rsp)
call   1030 <puts@plt>
lea    0xe7d(%rip),%rdi
movaps (%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x2deb(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"\0A\0A ##ERROR in mock.c's sersic_b()\0A\00"
@.str.1 = [45 x i8] c"\09 Sersic n (=%f) must be smaller than 0.35\0A\0A\00"
@EXIT_FAILURE = global i32 0
define double @sersic_b(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ole double %3, 0x3FD6666660000000
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%7 = load double, double* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), double %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = load double, double* %2
%13 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %12, double -0.000000e+00)
%14 = load double, double* %2
%15 = fmul double 4.050000e+02, %14
%16 = fdiv double 4.000000e+00, %15
%17 = fadd double %13, %16
%18 = load double, double* %2
%19 = fmul double 2.551500e+04, %18
%20 = load double, double* %2
%21 = fmul double %19, %20
%22 = fdiv double 4.600000e+01, %21
%23 = fadd double %17, %22
%24 = load double, double* %2
%25 = fmul double 0x41317D3F00000000, %24
%26 = load double, double* %2
%27 = fmul double %25, %26
%28 = load double, double* %2
%29 = fmul double %27, %28
%30 = fdiv double 1.310000e+02, %29
%31 = load double, double* %2
%32 = fmul double 0x421C953CC0D80000, %31
%33 = load double, double* %2
%34 = fmul double %32, %33
%35 = load double, double* %2
%36 = fmul double %34, %35
%37 = load double, double* %2
%38 = fmul double %36, %37
%39 = fdiv double 0x4140BE8480000000, %38
%40 = fsub double %30, %39
%41 = fadd double %23, %40
ret double %41
}

LLVM IR (-O2):
@.str.1 = [45 x i8] c"\09 Sersic n (=%f) must be smaller than 0.35\0A\0A\00"
@EXIT_FAILURE = global i32 0
@str = [36 x i8] c"\0A\0A ##ERROR in mock.c's sersic_b()\00"
define double @sersic_b(double %0) {
%2 = fcmp ugt double %0, 0x3FD6666660000000
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), double %0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
%9 = fmul double %0, 2.000000e+00
%10 = fmul double %0, 2.551500e+04
%11 = insertelement <2 x double> poison, double %0, i64 0
%12 = shufflevector <2 x double> %11, <2 x double> poison, <2 x i32> zeroinitializer
%13 = insertelement <2 x double> <double 4.050000e+02, double poison>, double %10, i64 1
%14 = fmul <2 x double> %12, %13
%15 = fdiv <2 x double> <double 4.000000e+00, double 4.600000e+01>, %14
%16 = extractelement <2 x double> %15, i64 0
%17 = fadd double %9, %16
%18 = extractelement <2 x double> %15, i64 1
%19 = fadd double %17, %18
%20 = fmul double %0, 0x421C953CC0D80000
%21 = insertelement <2 x double> <double 0x41317D3F00000000, double poison>, double %20, i64 1
%22 = fmul <2 x double> %12, %21
%23 = fmul <2 x double> %22, %12
%24 = fmul <2 x double> %23, %12
%25 = fdiv <2 x double> <double 1.310000e+02, double 0x4140BE8480000000>, %24
%26 = shufflevector <2 x double> %25, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%27 = fsub <2 x double> %25, %26
%28 = extractelement <2 x double> %27, i64 0
%29 = fadd double %19, %28
ret double %29
}