#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 getc(int /*<<< orphan*/ *);
scalar_t__ isspace(int);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void skip_whitespace(FILE *in) {
  int c;
  while ((c = getc(in)) != EOF) {
    if (isspace(c)) {
      continue;
    } else if (c == ';') {
      while (((c = getc(in)) != EOF) && (c != '\n'))
        ;
      continue;
    }
    ungetc(c, in);
    break;
  }
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%eax
je     11d4 <skip_whitespace+0xa4>
mov    -0xc(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     116e <skip_whitespace+0x3e>
jmp    113c <skip_whitespace+0xc>
cmpl   $0x3b,-0xc(%rbp)
jne    11c3 <skip_whitespace+0x93>
jmp    117d <skip_whitespace+0x4d>
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
mov    0x2e54(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0xd(%rbp)
je     11a9 <skip_whitespace+0x79>
cmpl   $0xa,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    11b9 <skip_whitespace+0x89>
jmp    11be <skip_whitespace+0x8e>
jmp    117d <skip_whitespace+0x4d>
jmp    113c <skip_whitespace+0xc>
jmp    11c8 <skip_whitespace+0x98>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1050 <getc@plt>
mov    0x2ea5(%rip),%r14
cmp    (%r14),%eax
jne    114d <skip_whitespace+0x1d>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %eax,%ebp
jmp    116f <skip_whitespace+0x3f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <getc@plt>
mov    %eax,%ebp
cmp    (%r14),%eax
je     1148 <skip_whitespace+0x18>
mov    %ebp,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1160 <skip_whitespace+0x30>
cmp    $0x3b,%ebp
jne    1194 <skip_whitespace+0x64>
mov    %rbx,%rdi
call   1050 <getc@plt>
cmp    $0xa,%eax
je     1160 <skip_whitespace+0x30>
cmp    (%r14),%eax
jne    1180 <skip_whitespace+0x50>
jmp    1160 <skip_whitespace+0x30>
mov    %ebp,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ungetc@plt>

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

LLVM IR (-O2):
@EOF = global i32 0
define void @skip_whitespace(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %23, label %5
5: ; preds = %1, %9
%6 = phi i32 [ %10, %9 ], [ %2, %1 ]
%7 = tail call i64 @isspace(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %15, %5
%10 = tail call i32 @getc(i32* %0)
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %23, label %5
13: ; preds = %5
%14 = icmp eq i32 %6, 59
br i1 %14, label %15, label %21
15: ; preds = %13, %15
%16 = tail call i32 @getc(i32* %0)
%17 = load i32, i32* @EOF
%18 = icmp ne i32 %16, %17
%19 = icmp ne i32 %16, 10
%20 = and i1 %19, %18
br i1 %20, label %15, label %9
21: ; preds = %13
%22 = tail call i32 @ungetc(i32 %6, i32* %0)
br label %23
23: ; preds = %9, %1, %21
ret void
}