#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 EXIT_SUCCESS;
double _atof(char *);
int /*<<< orphan*/ printf(char *, char *, double);
int main() {
  char *spi = "-3.1415926";
  char *sv = "3.0E8";
  double pi = _atof(spi);
  double v = _atof(sv);
  printf("%s : %f\n", spi, pi);
  printf("%s : %f\n", sv, v);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <_atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <_atof@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
movsd  -0x20(%rbp),%xmm0
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
movsd  -0x28(%rbp),%xmm0
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r15
mov    %r15,%rdi
call   1040 <_atof@plt>
movsd  %xmm0,0x8(%rsp)
lea    0xec6(%rip),%r14
mov    %r14,%rdi
call   1040 <_atof@plt>
movsd  %xmm0,(%rsp)
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
movsd  (%rsp),%xmm0
call   1030 <printf@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"-3.1415926\00"
@.str.1 = [6 x i8] c"3.0E8\00"
@.str.2 = [9 x i8] c"%s : %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %3
%6 = load i8*, i8** %2
%7 = call double @_atof(i8* %6)
store double %7, double* %4
%8 = load i8*, i8** %3
%9 = call double @_atof(i8* %8)
store double %9, double* %5
%10 = load i8*, i8** %2
%11 = load double, double* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %10, double %11)
%13 = load i8*, i8** %3
%14 = load double, double* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %13, double %14)
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}

LLVM IR (-O2):
@.str = [11 x i8] c"-3.1415926\00"
@.str.1 = [6 x i8] c"3.0E8\00"
@.str.2 = [9 x i8] c"%s : %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call double @_atof(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call double @_atof(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %2)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}