#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 EXIT_SUCCESS;
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 EXIT_SUCCESS;
}


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    123c <skipWord+0xec>
jmp    118e <skipWord+0x3e>
mov    0x2d91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipWord>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
movb   $0x61,0x7(%rsp)
mov    0x2e81(%rip),%rax
cmp    %rdi,(%rax)
jne    1181 <skipWord+0x31>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
lea    0xe84(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x61,%edi
call   1030 <isdigit@plt>
mov    0x2e36(%rip),%r12
test   %eax,%eax
jne    11ea <skipWord+0x9a>
lea    0xe7a(%rip),%r14
lea    0x7(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl 0x7(%rsp),%edi
call   1050 <isspace@plt>
test   %eax,%eax
jne    11ea <skipWord+0x9a>
movzbl 0x7(%rsp),%eax
add    $0xd3,%al
cmp    $0x2,%al
jb     11ea <skipWord+0x9a>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <fscanf@plt>
cmp    $0x1,%eax
jne    11fa <skipWord+0xaa>
movsbl 0x7(%rsp),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     11b0 <skipWord+0x60>
mov    (%r12),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xe19(%rip),%rdi
call   1070 <perror@plt>
mov    0x2dc3(%rip),%r12
jmp    11ea <skipWord+0x9a>

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
@EXIT_SUCCESS = 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 %41
38: ; preds = %31
br label %12
39: ; preds = %29
%40 = load i32, i32* @EXIT_SUCCESS
store i32 %40, i32* %2
br label %41
41: ; preds = %39, %35
%42 = load i32, i32* %2
ret i32 %42
}

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
@EXIT_SUCCESS = 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 %29
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 %29, 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 %29
27: ; preds = %20
%28 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %29
29: ; preds = %23, %11, %8, %27
%30 = phi i32* [ @EXIT_FAILURE, %27 ], [ @EXIT_SUCCESS, %8 ], [ @EXIT_SUCCESS, %11 ], [ @EXIT_SUCCESS, %23 ]
%31 = load i32, i32* %30
ret i32 %31
}