#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 EOF;
double atof(char *);
int getop(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char s[100];
  s[0] = '\0';
  int i;
  while ((i = getop(s)) != EOF) {
    if (i == '0')
      printf("Number = [%f]\n", atof(s));
    else if (i != '\n')
      printf("Input = [%c]\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x70(%rbp)
lea    -0x70(%rbp),%rdi
call   1050 <getop@plt>
mov    %eax,-0x74(%rbp)
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%eax
je     11ac <main+0x7c>
cmpl   $0x30,-0x74(%rbp)
jne    1189 <main+0x59>
lea    -0x70(%rbp),%rdi
call   1030 <atof@plt>
cvttsd2si %xmm0,%esi
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
jmp    11a7 <main+0x77>
cmpl   $0xa,-0x74(%rbp)
je     11a2 <main+0x72>
mov    -0x74(%rbp),%esi
lea    0xe72(%rip),%rdi
call   1040 <printf@plt>
jmp    11a7 <main+0x77>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
movb   $0x0,(%rsp)
mov    %rsp,%rdi
call   1050 <getop@plt>
mov    0x2e9a(%rip),%r12
cmp    (%r12),%eax
jne    1162 <main+0x32>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    %rsp,%rbx
lea    0xe94(%rip),%r14
lea    0xe9c(%rip),%r15
jmp    1198 <main+0x68>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <getop@plt>
cmp    (%r12),%eax
je     1154 <main+0x24>
cmp    $0xa,%eax
je     118a <main+0x5a>
cmp    $0x30,%eax
jne    1180 <main+0x50>
mov    %rbx,%rdi
call   1030 <atof@plt>
cvttsd2si %xmm0,%esi
mov    %r14,%rdi
jmp    1185 <main+0x55>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [15 x i8] c"Number = [%f]\0A\00"
@.str.1 = [14 x i8] c"Input = [%c]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8 0, i8* %4
br label %5
5: ; preds = %25, %0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @getop(i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %26
10: ; preds = %5
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 48
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%15 = call double @atof(i8* %14)
%16 = fptosi double %15 to i32
%17 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %25
18: ; preds = %10
%19 = load i32, i32* %3
%20 = icmp ne i32 %19, 10
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %3
%23 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %21, %18
br label %25
25: ; preds = %24, %13
br label %5
26: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [15 x i8] c"Number = [%f]\0A\00"
@.str.1 = [14 x i8] c"Input = [%c]\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
store i8 0, i8* %2
%3 = call i32 @getop(i8* %2)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %18, label %6
6: ; preds = %0, %14
%7 = phi i32 [ %15, %14 ], [ %3, %0 ]
switch i32 %7, label %12 [
i32 48, label %8
i32 10, label %14
]
8: ; preds = %6
%9 = call double @atof(i8* %2)
%10 = fptosi double %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %14
12: ; preds = %6
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %14
14: ; preds = %6, %12, %8
%15 = call i32 @getop(i8* %2)
%16 = load i32, i32* @EOF
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %6
18: ; preds = %14, %0
ret i32 0
}