#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 */
double atof(char const *);
double erf(double const);
double inverf(double const);
int /*<<< orphan*/ printf(char *, double const, double);
int main(const int argc, const char **argv) {
  const double y = (argc > 1 ? atof(argv[1]) : 0.6);
  const double x = inverf(y);
  printf("x: %.15f   erf( x): %.15f\n", x, erf(x));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1177 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
jmp    1189 <main+0x49>
movsd  0xe81(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1189 <main+0x49>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <inverf@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1060 <erf@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
lea    0xe43(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     1151 <main+0x11>
mov    0x8(%rsi),%rdi
call   1040 <atof@plt>
jmp    1159 <main+0x19>
movsd  0xea7(%rip),%xmm0
call   1030 <inverf@plt>
movsd  %xmm0,(%rsp)
call   1060 <erf@plt>
movaps %xmm0,%xmm1
lea    0xe96(%rip),%rdi
movsd  (%rsp),%xmm0
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"x: %.15f erf( x): %.15f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call double @atof(i8* %13)
br label %16
15: ; preds = %2
br label %16
16: ; preds = %15, %10
%17 = phi double [ %14, %10 ], [ 6.000000e-01, %15 ]
store double %17, double* %6
%18 = load double, double* %6
%19 = call double @inverf(double %18)
store double %19, double* %7
%20 = load double, double* %7
%21 = load double, double* %7
%22 = call double @erf(double %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %20, double %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"x: %.15f erf( x): %.15f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call double @atof(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi double [ %7, %4 ], [ 6.000000e-01, %2 ]
%10 = tail call double @inverf(double %9)
%11 = tail call double @erf(double %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %10, double %11)
ret i32 0
}