#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 getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void eatWhitespace(FILE *f) {
  int ch;
  ch = getc(f);
  while (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\f' || ch == '\r') {
    ch = getc(f);
  }
  ungetc(ch, f);
}


x86 assembly (clang, -O0):
<eatWhitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     117e <eatWhitespace+0x5e>
mov    $0x1,%al
cmpl   $0x9,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     117e <eatWhitespace+0x5e>
mov    $0x1,%al
cmpl   $0xa,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     117e <eatWhitespace+0x5e>
mov    $0x1,%al
cmpl   $0xc,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     117e <eatWhitespace+0x5e>
cmpl   $0xd,-0xc(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    118e <eatWhitespace+0x6e>
jmp    119f <eatWhitespace+0x7f>
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
jmp    1138 <eatWhitespace+0x18>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eatWhitespace>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movabs $0x100003600,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    $0x20,%eax
ja     1155 <eatWhitespace+0x35>
mov    %eax,%ecx
bt     %rcx,%r14
jb     1140 <eatWhitespace+0x20>
mov    %eax,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ungetc@plt>

LLVM IR (-O0):
define void @eatWhitespace(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %23, %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 32
br i1 %8, label %21, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 9
br i1 %11, label %21, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 10
br i1 %14, label %21, label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 12
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 13
br label %21
21: ; preds = %18, %15, %12, %9, %6
%22 = phi i1 [ true, %15 ], [ true, %12 ], [ true, %9 ], [ true, %6 ], [ %20, %18 ]
br i1 %22, label %23, label %26
23: ; preds = %21
%24 = load i32*, i32** %2
%25 = call i32 @getc(i32* %24)
store i32 %25, i32* %3
br label %6
26: ; preds = %21
%27 = load i32, i32* %3
%28 = load i32*, i32** %2
%29 = call i32 @ungetc(i32 %27, i32* %28)
ret void
}

LLVM IR (-O2):
define void @eatWhitespace(i32* nocapture %0) {
br label %2
2: ; preds = %4, %1
%3 = tail call i32 @getc(i32* %0)
switch i32 %3, label %5 [
i32 32, label %4
i32 13, label %4
i32 12, label %4
i32 10, label %4
i32 9, label %4
]
4: ; preds = %2, %2, %2, %2, %2
br label %2
5: ; preds = %2
%6 = tail call i32 @ungetc(i32 %3, i32* %0)
ret void
}