#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 EOF;
int fgetc(int /*<<< orphan*/ *);
scalar_t__ iscntrl(int);
scalar_t__ isspace(int);
int /*<<< orphan*/ printf(char *);
char ungetc(int, int /*<<< orphan*/ *);
void skip_whitespaces(FILE *inputfile) {
  int whitespace;
  char ctmp;
  do {
    whitespace = fgetc(inputfile);
    if (whitespace == EOF)
      printf("\nWarning::Unespected End of File encountered\n");
  } while (isspace(whitespace) || iscntrl(whitespace));
  ctmp = ungetc(whitespace, inputfile);
}


x86 assembly (clang, -O0):
<skip_whitespaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e76(%rip),%rcx
cmp    (%rcx),%eax
jne    1186 <skip_whitespaces+0x36>
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
jmp    118b <skip_whitespaces+0x3b>
mov    -0xc(%rbp),%edi
call   1060 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0xe(%rbp)
jne    11b7 <skip_whitespaces+0x67>
mov    -0xc(%rbp),%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
test   $0x1,%al
jne    115c <skip_whitespaces+0xc>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1070 <ungetc@plt>
mov    %al,-0xd(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespaces>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e87(%rip),%r15
lea    0xe98(%rip),%r14
jmp    117c <skip_whitespaces+0x2c>
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1060 <isspace@plt>
test   %rax,%rax
je     11a0 <skip_whitespaces+0x50>
mov    %rbx,%rdi
call   1050 <fgetc@plt>
mov    %eax,%ebp
cmp    (%r15),%eax
jne    1170 <skip_whitespaces+0x20>
mov    %r14,%rdi
call   1030 <puts@plt>
jmp    1170 <skip_whitespaces+0x20>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
call   1040 <iscntrl@plt>
test   %rax,%rax
jne    117c <skip_whitespaces+0x2c>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <ungetc@plt>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [46 x i8] c"\0AWarning::Unespected End of File encountered\0A\00"
define void @skip_whitespaces(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i8
store i32* %0, i32** %2
br label %5
5: ; preds = %22, %1
%6 = load i32*, i32** %2
%7 = call i32 @fgetc(i32* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %5
br label %14
14: ; preds = %13
%15 = load i32, i32* %3
%16 = call i64 @isspace(i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i32, i32* %3
%20 = call i64 @iscntrl(i32 %19)
%21 = icmp ne i64 %20, 0
br label %22
22: ; preds = %18, %14
%23 = phi i1 [ true, %14 ], [ %21, %18 ]
br i1 %23, label %5, label %24
24: ; preds = %22
%25 = load i32, i32* %3
%26 = load i32*, i32** %2
%27 = call signext i8 @ungetc(i32 %25, i32* %26)
store i8 %27, i8* %4
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
@str = [45 x i8] c"\0AWarning::Unespected End of File encountered\00"
define void @skip_whitespaces(i32* nocapture %0) {
br label %2
2: ; preds = %14, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = tail call i64 @isspace(i32 %3)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = tail call i64 @iscntrl(i32 %3)
%13 = icmp eq i64 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %11, %8
br label %2
15: ; preds = %11
%16 = tail call signext i8 @ungetc(i32 %3, i32* %0)
ret void
}