#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 myatof(char *);
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  printf("String \"20\" converted to a double is: %.16g\n", myatof("20"));
  printf("String \"+20\" converted to a double is: %.16g\n", myatof("+20"));
  printf("String \"20.76\" converted to a double is: %.16g\n", myatof("20.76"));
  printf("String \"0\" converted to a double is: %.16g\n", myatof("0"));
  printf("String \"0.12875\" converted to a double is: %.16g\n",
         myatof("0.12875"));
  printf("String \".6666785\" converted to a double is: %.16g\n",
         myatof(".6666785"));
  printf("String \"-1234\" converted to a double is: %.16g\n", myatof("-1234"));
  printf("String \"-1234.323\" converted to a double is: %.16g\n",
         myatof("-1234.323"));
  printf("String \"-43e-2\" converted to a double is: %.16g\n",
         myatof("43e-2"));
  printf("String \"-.1282e4\" converted to a double is: %.16g\n",
         myatof("-.1282e4"));
  printf("String \"+67.345e+2\" converted to a double is: %.16g\n",
         myatof("+67.345e+2"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf26(%rip),%rdi
call   1040 <myatof@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
call   1040 <myatof@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xf29(%rip),%rdi
call   1040 <myatof@plt>
lea    0xeed(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
call   1040 <myatof@plt>
lea    0xf0b(%rip),%rdi
call   1030 <printf@plt>
lea    0xf5d(%rip),%rdi
call   1040 <myatof@plt>
lea    0xf1f(%rip),%rdi
call   1030 <printf@plt>
lea    0xf80(%rip),%rdi
call   1040 <myatof@plt>
lea    0xf41(%rip),%rdi
call   1030 <printf@plt>
lea    0xfa1(%rip),%rdi
call   1040 <myatof@plt>
lea    0xf65(%rip),%rdi
call   1030 <printf@plt>
lea    0xfc3(%rip),%rdi
call   1040 <myatof@plt>
lea    0xf83(%rip),%rdi
call   1030 <printf@plt>
lea    0xfe6(%rip),%rdi
call   1040 <myatof@plt>
lea    0xfa9(%rip),%rdi
call   1030 <printf@plt>
lea    0x1007(%rip),%rdi
call   1040 <myatof@plt>
lea    0xfc8(%rip),%rdi
call   1030 <printf@plt>
lea    0x102d(%rip),%rdi
call   1040 <myatof@plt>
lea    0xfec(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf34(%rip),%rdi
call   1040 <myatof@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
call   1040 <myatof@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf37(%rip),%rdi
call   1040 <myatof@plt>
lea    0xefb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
call   1040 <myatof@plt>
lea    0xf19(%rip),%rdi
call   1030 <printf@plt>
lea    0xf6b(%rip),%rdi
call   1040 <myatof@plt>
lea    0xf2d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf8e(%rip),%rdi
call   1040 <myatof@plt>
lea    0xf4f(%rip),%rdi
call   1030 <printf@plt>
lea    0xfaf(%rip),%rdi
call   1040 <myatof@plt>
lea    0xf73(%rip),%rdi
call   1030 <printf@plt>
lea    0xfd1(%rip),%rdi
call   1040 <myatof@plt>
lea    0xf91(%rip),%rdi
call   1030 <printf@plt>
lea    0xff4(%rip),%rdi
call   1040 <myatof@plt>
lea    0xfb7(%rip),%rdi
call   1030 <printf@plt>
lea    0x1015(%rip),%rdi
call   1040 <myatof@plt>
lea    0xfd6(%rip),%rdi
call   1030 <printf@plt>
lea    0x103b(%rip),%rdi
call   1040 <myatof@plt>
lea    0xffa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"String \2220\22 converted to a double is: %.16g\0A\00"
@.str.1 = [3 x i8] c"20\00"
@.str.2 = [46 x i8] c"String \22+20\22 converted to a double is: %.16g\0A\00"
@.str.3 = [4 x i8] c"+20\00"
@.str.4 = [48 x i8] c"String \2220.76\22 converted to a double is: %.16g\0A\00"
@.str.5 = [6 x i8] c"20.76\00"
@.str.6 = [44 x i8] c"String \220\22 converted to a double is: %.16g\0A\00"
@.str.7 = [2 x i8] c"0\00"
@.str.8 = [50 x i8] c"String \220.12875\22 converted to a double is: %.16g\0A\00"
@.str.9 = [8 x i8] c"0.12875\00"
@.str.10 = [51 x i8] c"String \22.6666785\22 converted to a double is: %.16g\0A\00"
@.str.11 = [9 x i8] c".6666785\00"
@.str.12 = [48 x i8] c"String \22-1234\22 converted to a double is: %.16g\0A\00"
@.str.13 = [6 x i8] c"-1234\00"
@.str.14 = [52 x i8] c"String \22-1234.323\22 converted to a double is: %.16g\0A\00"
@.str.15 = [10 x i8] c"-1234.323\00"
@.str.16 = [49 x i8] c"String \22-43e-2\22 converted to a double is: %.16g\0A\00"
@.str.17 = [6 x i8] c"43e-2\00"
@.str.18 = [51 x i8] c"String \22-.1282e4\22 converted to a double is: %.16g\0A\00"
@.str.19 = [9 x i8] c"-.1282e4\00"
@.str.20 = [53 x i8] c"String \22+67.345e+2\22 converted to a double is: %.16g\0A\00"
@.str.21 = [11 x i8] c"+67.345e+2\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @myatof(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @myatof(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), double %4)
%6 = call double @myatof(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), double %6)
%8 = call double @myatof(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), double %8)
%10 = call double @myatof(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0), double %10)
%12 = call double @myatof(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.10, i64 0, i64 0), double %12)
%14 = call double @myatof(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.12, i64 0, i64 0), double %14)
%16 = call double @myatof(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.14, i64 0, i64 0), double %16)
%18 = call double @myatof(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.16, i64 0, i64 0), double %18)
%20 = call double @myatof(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.18, i64 0, i64 0), double %20)
%22 = call double @myatof(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.20, i64 0, i64 0), double %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"String \2220\22 converted to a double is: %.16g\0A\00"
@.str.1 = [3 x i8] c"20\00"
@.str.2 = [46 x i8] c"String \22+20\22 converted to a double is: %.16g\0A\00"
@.str.3 = [4 x i8] c"+20\00"
@.str.4 = [48 x i8] c"String \2220.76\22 converted to a double is: %.16g\0A\00"
@.str.5 = [6 x i8] c"20.76\00"
@.str.6 = [44 x i8] c"String \220\22 converted to a double is: %.16g\0A\00"
@.str.7 = [2 x i8] c"0\00"
@.str.8 = [50 x i8] c"String \220.12875\22 converted to a double is: %.16g\0A\00"
@.str.9 = [8 x i8] c"0.12875\00"
@.str.10 = [51 x i8] c"String \22.6666785\22 converted to a double is: %.16g\0A\00"
@.str.11 = [9 x i8] c".6666785\00"
@.str.12 = [48 x i8] c"String \22-1234\22 converted to a double is: %.16g\0A\00"
@.str.13 = [6 x i8] c"-1234\00"
@.str.14 = [52 x i8] c"String \22-1234.323\22 converted to a double is: %.16g\0A\00"
@.str.15 = [10 x i8] c"-1234.323\00"
@.str.16 = [49 x i8] c"String \22-43e-2\22 converted to a double is: %.16g\0A\00"
@.str.17 = [6 x i8] c"43e-2\00"
@.str.18 = [51 x i8] c"String \22-.1282e4\22 converted to a double is: %.16g\0A\00"
@.str.19 = [9 x i8] c"-.1282e4\00"
@.str.20 = [53 x i8] c"String \22+67.345e+2\22 converted to a double is: %.16g\0A\00"
@.str.21 = [11 x i8] c"+67.345e+2\00"
define i32 @main() {
%1 = tail call double @myatof(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @myatof(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0), double %3)
%5 = tail call double @myatof(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), double %5)
%7 = tail call double @myatof(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%8 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), double %7)
%9 = tail call double @myatof(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%10 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0), double %9)
%11 = tail call double @myatof(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%12 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.10, i64 0, i64 0), double %11)
%13 = tail call double @myatof(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%14 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.12, i64 0, i64 0), double %13)
%15 = tail call double @myatof(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
%16 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.14, i64 0, i64 0), double %15)
%17 = tail call double @myatof(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0))
%18 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.16, i64 0, i64 0), double %17)
%19 = tail call double @myatof(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0))
%20 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.18, i64 0, i64 0), double %19)
%21 = tail call double @myatof(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.21, i64 0, i64 0))
%22 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.20, i64 0, i64 0), double %21)
ret i32 0
}