#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 *);
int atoi(char *);
long atol(char *);
int /*<<< orphan*/ printf(char *, char *, long);
main(void) {
  char *s = NULL;
  double x = 0;
  int i = 0;
  long l = 0;
  s = "  -3208.15E-13";
  x = atof(s);
  printf("atof: cadena ASCII: %-17s double: %e\n", s, x);
  s = "8.7195642337X120";
  x = atof(s);
  printf("atof: cadena ASCII: %-17s double: %e\n", s, x);
  s = "  -8995 libros";
  i = atoi(s);
  printf("atoi: cadena ASCII: %-17s int  : %d\n", s, i);
  s = "89954 pesetas";
  l = atol(s);
  printf("atol: cadena ASCII: %-17s long : %ld\n", s, l);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xe92(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
cvttsd2si -0x10(%rbp),%rdx
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe98(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
cvttsd2si -0x10(%rbp),%rdx
lea    0xe4f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe7a(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rdx
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe83(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <atol@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rbx
mov    %rbx,%rdi
call   1030 <atof@plt>
cvttsd2si %xmm0,%rdx
lea    0xeb0(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
call   1030 <atof@plt>
cvttsd2si %xmm0,%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rbx
mov    %rbx,%rdi
call   1060 <atoi@plt>
movslq %eax,%rdx
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
call   1050 <atol@plt>
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c" -3208.15E-13\00"
@.str.1 = [38 x i8] c"atof: cadena ASCII: %-17s double: %e\0A\00"
@.str.2 = [17 x i8] c"8.7195642337X120\00"
@.str.3 = [15 x i8] c" -8995 libros\00"
@.str.4 = [37 x i8] c"atoi: cadena ASCII: %-17s int : %d\0A\00"
@.str.5 = [14 x i8] c"89954 pesetas\00"
@.str.6 = [38 x i8] c"atol: cadena ASCII: %-17s long : %ld\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca double
%3 = alloca i32
%4 = alloca i64
store i8* null, i8** %1
store double 0.000000e+00, double* %2
store i32 0, i32* %3
store i64 0, i64* %4
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %1
%5 = load i8*, i8** %1
%6 = call double @atof(i8* %5)
store double %6, double* %2
%7 = load i8*, i8** %1
%8 = load double, double* %2
%9 = fptosi double %8 to i64
%10 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %7, i64 %9)
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8** %1
%11 = load i8*, i8** %1
%12 = call double @atof(i8* %11)
store double %12, double* %2
%13 = load i8*, i8** %1
%14 = load double, double* %2
%15 = fptosi double %14 to i64
%16 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %13, i64 %15)
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8** %1
%17 = load i8*, i8** %1
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %3
%19 = load i8*, i8** %1
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %19, i64 %21)
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8** %1
%23 = load i8*, i8** %1
%24 = call i64 @atol(i8* %23)
store i64 %24, i64* %4
%25 = load i8*, i8** %1
%26 = load i64, i64* %4
%27 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), i8* %25, i64 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c" -3208.15E-13\00"
@.str.1 = [38 x i8] c"atof: cadena ASCII: %-17s double: %e\0A\00"
@.str.2 = [17 x i8] c"8.7195642337X120\00"
@.str.3 = [15 x i8] c" -8995 libros\00"
@.str.4 = [37 x i8] c"atoi: cadena ASCII: %-17s int : %d\0A\00"
@.str.5 = [14 x i8] c"89954 pesetas\00"
@.str.6 = [38 x i8] c"atol: cadena ASCII: %-17s long : %ld\0A\00"
define i32 @main() {
%1 = tail call double @atof(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = fptosi double %1 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = tail call double @atof(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%5 = fptosi double %4 to i64
%6 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i64 %5)
%7 = tail call i32 @atoi(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%8 = sext i32 %7 to i64
%9 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i64 %8)
%10 = tail call i64 @atol(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i64 %10)
ret i32 0
}