#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 *);
int /*<<< orphan*/ printf(char *, char const *, double);
int main() {
  const char *pNum[] = {"-10",  "0",   "10",     "a12", "13a",
                        "  11", "1.0", "  0.22", NULL};
  int i = 0;
  for (i = 0; pNum[i] != NULL; i++) {
    printf("[%s] \t= [%f]\n", pNum[i], atof(pNum[i]));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0x2c86(%rip),%rsi
mov    $0x48,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x54(%rbp)
movslq -0x54(%rbp),%rax
cmpq   $0x0,-0x50(%rbp,%rax,8)
je     11ab <main+0x7b>
movslq -0x54(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%rax
mov    %rax,-0x60(%rbp)
movslq -0x54(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%rdi
call   1030 <atof@plt>
mov    -0x60(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1162 <main+0x32>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
mov    %rbx,%rdi
call   1030 <atof@plt>
lea    0xee2(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xec7(%rip),%rbx
mov    %rbx,%rdi
call   1030 <atof@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xe9b(%rip),%rbx
mov    %rbx,%rdi
call   1030 <atof@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xe84(%rip),%rbx
mov    %rbx,%rdi
call   1030 <atof@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xe6e(%rip),%rbx
mov    %rbx,%rdi
call   1030 <atof@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xe58(%rip),%rbx
mov    %rbx,%rdi
call   1030 <atof@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xe43(%rip),%rbx
mov    %rbx,%rdi
call   1030 <atof@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xe2d(%rip),%rbx
mov    %rbx,%rdi
call   1030 <atof@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"-10\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [3 x i8] c"10\00"
@.str.3 = [4 x i8] c"a12\00"
@.str.4 = [4 x i8] c"13a\00"
@.str.5 = [5 x i8] c" 11\00"
@.str.6 = [4 x i8] c"1.0\00"
@.str.7 = [7 x i8] c" 0.22\00"
@__const.main.pNum = [9 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i32 0, i32 0), i8* null]
@.str.8 = [14 x i8] c"[%s] \09= [%f]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8*]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [9 x i8*]* %2 to i8*
store i32 0, i32* %3
store i32 0, i32* %3
br label %5
5: ; preds = %22, %0
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %25
11: ; preds = %5
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 %13
%15 = load i8*, i8** %14
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 %17
%19 = load i8*, i8** %18
%20 = call double @atof(i8* %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %15, double %20)
br label %22
22: ; preds = %11
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %5
25: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"-10\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [3 x i8] c"10\00"
@.str.3 = [4 x i8] c"a12\00"
@.str.4 = [4 x i8] c"13a\00"
@.str.5 = [5 x i8] c" 11\00"
@.str.6 = [4 x i8] c"1.0\00"
@.str.7 = [7 x i8] c" 0.22\00"
@.str.8 = [14 x i8] c"[%s] \09= [%f]\0A\00"
define i32 @main() {
%1 = tail call double @atof(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @atof(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call double @atof(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), double %5)
%7 = tail call double @atof(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %7)
%9 = tail call double @atof(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), double %9)
%11 = tail call double @atof(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%12 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), double %11)
%13 = tail call double @atof(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%14 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), double %13)
%15 = tail call double @atof(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%16 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), double %15)
ret i32 0
}