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

/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ isdigit(char);
int /*<<< orphan*/ isspace(char);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdin;
int skipWord(FILE *stream) {
  char c = 'a';
  if (stream == stdin)
    fprintf(stderr, "This is not a number!\n");
  while (!isdigit(c) && !isspace(c) && !(c == 46) && !(c == 45)) {
    if (fscanf(stream, "%c", &c) != 1) {
      perror("num-utils-ng");
      return EXIT_FAILURE;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<skipWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movb   $0x61,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%rax
jne    1189 <skipWord+0x39>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
lea    0xe7c(%rip),%rsi
call   1060 <fprintf@plt>
jmp    118e <skipWord+0x3e>
movsbl -0x11(%rbp),%edi
call   1030 <isdigit@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
jne    11e1 <skipWord+0x91>
movsbl -0x11(%rbp),%edi
call   1050 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
jne    11e1 <skipWord+0x91>
movsbl -0x11(%rbp),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x12(%rbp)
je     11e1 <skipWord+0x91>
movsbl -0x11(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
xor    $0xff,%al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    11f1 <skipWord+0xa1>
jmp    1230 <skipWord+0xe0>
mov    -0x10(%rbp),%rdi
lea    0xe1b(%rip),%rsi
lea    -0x11(%rbp),%rdx
call   1040 <fscanf@plt>
cmp    $0x1,%eax
je     122b <skipWord+0xdb>
lea    0xe05(%rip),%rdi
call   1070 <perror@plt>
mov    0x2daf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1237 <skipWord+0xe7>
jmp    118e <skipWord+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipWord>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movb   $0x61,0x7(%rsp)
mov    0x2e82(%rip),%rax
cmp    %rdi,(%rax)
jne    1180 <skipWord+0x30>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
lea    0xe85(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x61,%edi
call   1030 <isdigit@plt>
xor    %r14d,%r14d
test   %eax,%eax
jne    11da <skipWord+0x8a>
lea    0xe7f(%rip),%r15
lea    0x7(%rsp),%rbp
nopl   (%rax)
movsbl 0x7(%rsp),%edi
call   1050 <isspace@plt>
test   %eax,%eax
jne    11da <skipWord+0x8a>
movzbl 0x7(%rsp),%eax
add    $0xd3,%al
cmp    $0x2,%al
jb     11da <skipWord+0x8a>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   1040 <fscanf@plt>
cmp    $0x1,%eax
jne    11e8 <skipWord+0x98>
movsbl 0x7(%rsp),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     11a0 <skipWord+0x50>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe2b(%rip),%rdi
call   1070 <perror@plt>
mov    0x2dd5(%rip),%rax
mov    (%rax),%r14d
jmp    11da <skipWord+0x8a>

LLVM IR (-O0):
@stdin = global i32* null
@stderr = global i32 0
@.str = [23 x i8] c"This is not a number!\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [13 x i8] c"num-utils-ng\00"
@EXIT_FAILURE = global i32 0
define i32 @skipWord(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 97, i8* %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** @stdin
%7 = icmp eq i32* %5, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %1
br label %12
12: ; preds = %38, %11
%13 = load i8, i8* %4
%14 = call i32 @isdigit(i8 signext %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %29, label %16
16: ; preds = %12
%17 = load i8, i8* %4
%18 = call i32 @isspace(i8 signext %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %29, label %20
20: ; preds = %16
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 46
br i1 %23, label %29, label %24
24: ; preds = %20
%25 = load i8, i8* %4
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 45
%28 = xor i1 %27, true
br label %29
29: ; preds = %24, %20, %16, %12
%30 = phi i1 [ false, %20 ], [ false, %16 ], [ false, %12 ], [ %28, %24 ]
br i1 %30, label %31, label %39
31: ; preds = %29
%32 = load i32*, i32** %3
%33 = call i32 @fscanf(i32* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%34 = icmp ne i32 %33, 1
br i1 %34, label %35, label %38
35: ; preds = %31
%36 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%37 = load i32, i32* @EXIT_FAILURE
store i32 %37, i32* %2
br label %40
38: ; preds = %31
br label %12
39: ; preds = %29
store i32 0, i32* %2
br label %40
40: ; preds = %39, %35
%41 = load i32, i32* %2
ret i32 %41
}

LLVM IR (-O2):
@stdin = global i32* null
@stderr = global i32 0
@.str = [23 x i8] c"This is not a number!\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [13 x i8] c"num-utils-ng\00"
@EXIT_FAILURE = global i32 0
define i32 @skipWord(i32* nocapture %0) {
%2 = alloca i8
store i8 97, i8* %2
%3 = load i32*, i32** @stdin
%4 = icmp eq i32* %3, %0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
%9 = call i32 @isdigit(i8 signext 97)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %30
11: ; preds = %8, %23
%12 = load i8, i8* %2
%13 = call i32 @isspace(i8 signext %12)
%14 = freeze i32 %13
%15 = icmp ne i32 %14, 0
%16 = load i8, i8* %2
%17 = add i8 %16, -45
%18 = icmp ult i8 %17, 2
%19 = select i1 %15, i1 true, i1 %18
br i1 %19, label %30, label %20
20: ; preds = %11
%21 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %27
23: ; preds = %20
%24 = load i8, i8* %2
%25 = call i32 @isdigit(i8 signext %24)
%26 = icmp eq i32 %25, 0
br i1 %26, label %11, label %30
27: ; preds = %20
%28 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%29 = load i32, i32* @EXIT_FAILURE
br label %30
30: ; preds = %23, %11, %8, %27
%31 = phi i32 [ %29, %27 ], [ 0, %8 ], [ 0, %11 ], [ 0, %23 ]
ret i32 %31
}