#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 atan(double);
int log(int);
int pow(double, int);
double psim200(double L) {
  if (L < 0) {
    double x200 = pow((1 - 16 * 200 / L), 0.25);
    return (2 * log((1 + x200) / 2) + log((1 + pow(x200, 2)) / 2) -
            2 * atan(x200 + 0.5 * 3.1415927));
  } else {
    return (-5 * 2 / L);
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11f1 <psim200+0xc1>
movsd  0xecd(%rip),%xmm1
divsd  -0x10(%rbp),%xmm1
movsd  0xeb8(%rip),%xmm0
subsd  %xmm1,%xmm0
xor    %edi,%edi
call   1050 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe9c(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe87(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <log@plt>
shl    $0x1,%eax
mov    %eax,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
movsd  0xe39(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1030 <atan@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
shl    $0x1,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1203 <psim200+0xd3>
movsd  0xe07(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %r14
push   %rbx
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    11d4 <psim200+0xa4>
movsd  0xebe(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xeba(%rip),%xmm1
movapd %xmm1,%xmm0
xor    %edi,%edi
call   1050 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe9b(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  0xe97(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1040 <log@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,%ecx
add    $0x1,%ecx
shr    $0x1f,%ecx
lea    (%rax,%rcx,1),%edi
add    $0x1,%edi
sar    %edi
call   1040 <log@plt>
mov    %eax,%r14d
movsd  (%rsp),%xmm0
addsd  0xe60(%rip),%xmm0
call   1030 <atan@plt>
sub    %eax,%ebx
lea    (%r14,%rbx,2),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
jmp    11e0 <psim200+0xb0>
movsd  0xe24(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @psim200(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %31
7: ; preds = %1
%8 = load double, double* %3
%9 = fdiv double 3.200000e+03, %8
%10 = fsub double 1.000000e+00, %9
%11 = call i32 @pow(double %10, i32 0)
%12 = sitofp i32 %11 to double
store double %12, double* %4
%13 = load double, double* %4
%14 = fadd double 1.000000e+00, %13
%15 = fdiv double %14, 2.000000e+00
%16 = fptosi double %15 to i32
%17 = call i32 @log(i32 %16)
%18 = mul nsw i32 2, %17
%19 = load double, double* %4
%20 = call i32 @pow(double %19, i32 2)
%21 = add nsw i32 1, %20
%22 = sdiv i32 %21, 2
%23 = call i32 @log(i32 %22)
%24 = add nsw i32 %18, %23
%25 = load double, double* %4
%26 = fadd double %25, 0x3FF921FB5A7ED197
%27 = call i32 @atan(double %26)
%28 = mul nsw i32 2, %27
%29 = sub nsw i32 %24, %28
%30 = sitofp i32 %29 to double
store double %30, double* %2
br label %34
31: ; preds = %1
%32 = load double, double* %3
%33 = fdiv double -1.000000e+01, %32
store double %33, double* %2
br label %34
34: ; preds = %31, %7
%35 = load double, double* %2
ret double %35
}

LLVM IR (-O2):
define double @psim200(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %22
3: ; preds = %1
%4 = fdiv double 3.200000e+03, %0
%5 = fsub double 1.000000e+00, %4
%6 = tail call i32 @pow(double %5, i32 0)
%7 = sitofp i32 %6 to double
%8 = fadd double %7, 1.000000e+00
%9 = fmul double %8, 5.000000e-01
%10 = fptosi double %9 to i32
%11 = tail call i32 @log(i32 %10)
%12 = tail call i32 @pow(double %7, i32 2)
%13 = add nsw i32 %12, 1
%14 = sdiv i32 %13, 2
%15 = tail call i32 @log(i32 %14)
%16 = fadd double %7, 0x3FF921FB5A7ED197
%17 = tail call i32 @atan(double %16)
%18 = sub i32 %11, %17
%19 = shl i32 %18, 1
%20 = add i32 %19, %15
%21 = sitofp i32 %20 to double
br label %24
22: ; preds = %1
%23 = fdiv double -1.000000e+01, %0
br label %24
24: ; preds = %22, %3
%25 = phi double [ %21, %3 ], [ %23, %22 ]
ret double %25
}