#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 */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
float atof(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ stdin;
int main(void) {
  char *line = NULL;
  size_t len = 0;
  ssize_t read;
  float num = 0.0;
  while ((read = getline(&line, &len, stdin)) != -1) {
    if ((num = atof(line)))
      break;
  }
  printf("%f\n", num);
  free(line);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <getline@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     11c8 <main+0x78>
mov    -0x10(%rbp),%rdi
call   1040 <atof@plt>
movss  %xmm0,-0x20(%rbp)
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11be <main+0x6e>
jp     11be <main+0x6e>
jmp    11c3 <main+0x73>
jmp    11c8 <main+0x78>
jmp    1177 <main+0x27>
movss  -0x20(%rbp),%xmm0
lea    0xe2c(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    0x2def(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x18(%rsp)
mov    0x2e76(%rip),%r15
mov    (%r15),%edx
lea    0x10(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1060 <getline@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
cmp    $0xffffffff,%eax
je     11ce <main+0x7e>
lea    0x10(%rsp),%r14
lea    0x18(%rsp),%rbx
nopl   0x0(%rax)
mov    0x10(%rsp),%rdi
call   1040 <atof@plt>
movss  %xmm0,0xc(%rsp)
ucomiss 0xe49(%rip),%xmm0
jne    11ce <main+0x7e>
jp     11ce <main+0x7e>
mov    (%r15),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <getline@plt>
cmp    $0xffffffff,%eax
jne    11a0 <main+0x50>
lea    0xe2f(%rip),%rdi
movss  0xc(%rsp),%xmm0
call   1050 <printf@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %1
store i8* null, i8** %2
store i64 0, i64* %3
store float 0.000000e+00, float* %5
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* @stdin
%8 = call i32 @getline(i8** %2, i64* %3, i32 %7)
store i32 %8, i32* %4
%9 = icmp ne i32 %8, -1
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = call float @atof(i8* %11)
store float %12, float* %5
%13 = fcmp une float %12, 0.000000e+00
br i1 %13, label %14, label %15
14: ; preds = %10
br label %16
15: ; preds = %10
br label %6
16: ; preds = %14, %6
%17 = load float, float* %5
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %17)
%19 = load i8*, i8** %2
%20 = call i32 @free(i8* %19)
%21 = load i32, i32* @EXIT_SUCCESS
%22 = call i32 @exit(i32 %21)
unreachable
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i8*
%2 = alloca i64
%3 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = load i32, i32* @stdin
%6 = call i32 @getline(i8** %1, i64* %2, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %16, label %12
8: ; preds = %12
%9 = load i32, i32* @stdin
%10 = call i32 @getline(i8** %1, i64* %2, i32 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %16, label %12
12: ; preds = %0, %8
%13 = load i8*, i8** %1
%14 = call float @atof(i8* %13)
%15 = fcmp une float %14, 0.000000e+00
br i1 %15, label %16, label %8
16: ; preds = %8, %12, %0
%17 = phi float [ 0.000000e+00, %0 ], [ %14, %12 ], [ %14, %8 ]
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %17)
%19 = load i8*, i8** %1
%20 = call i32 @free(i8* %19)
%21 = load i32, i32* @EXIT_SUCCESS
%22 = call i32 @exit(i32 %21)
unreachable
}