#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 /*<<< orphan*/ buff;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
scalar_t__ is_number(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int main() {
  char buff[100];
  while (1) {
    if (fgets(buff, sizeof(buff), stdin) == NULL) {
      break;
    }
    if (is_number(buff)) {
      printf("number\n");
    } else {
      printf("not a number\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
jne    1165 <main+0x35>
jmp    119a <main+0x6a>
lea    -0x70(%rbp),%rdi
call   1030 <is_number@plt>
cmp    $0x0,%rax
je     1189 <main+0x59>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
jmp    1195 <main+0x65>
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    0x2ea6(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rdi
mov    $0x64,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     119c <main+0x6c>
mov    %rsp,%rbx
lea    0xe9f(%rip),%r15
lea    0xe9e(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <is_number@plt>
test   %rax,%rax
mov    %r12,%rdi
cmove  %r15,%rdi
call   1040 <puts@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <fgets@plt>
test   %rax,%rax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [8 x i8] c"number\0A\00"
@.str.1 = [14 x i8] c"not a number\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %0, %17
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32* @fgets(i8* %4, i32 100, i32 %5)
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %9
8: ; preds = %3
br label %18
9: ; preds = %3
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = call i64 @is_number(i8* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %17
15: ; preds = %9
%16 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
br label %3
18: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@str = [13 x i8] c"not a number\00"
@str.2 = [7 x i8] c"number\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32* @fgets(i8* %2, i32 100, i32 %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %14, label %6
6: ; preds = %0, %6
%7 = call i64 @is_number(i8* %2)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
%11 = load i32, i32* @stdin
%12 = call i32* @fgets(i8* %2, i32 100, i32 %11)
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %6
14: ; preds = %6, %0
ret i32 0
}