#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*/ skipEndOfLine(int /*<<< orphan*/ *, int);
int drainWhitespace(FILE *f, int c) {
  if (c == 0)
    c = getc(f);
  while (c == '#' || c == ' ' || c == '\t') {
    if (c <= 0)
      return 0;
    if (c == '#') {
      skipEndOfLine(f, c);
      return '\n';
    }
    c = getc(f);
  }
  return c;
}


x86 assembly (clang, -O0):
<drainWhitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1145 <drainWhitespace+0x25>
mov    -0x10(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0x14(%rbp)
jmp    114a <drainWhitespace+0x2a>
mov    $0x1,%al
cmpl   $0x23,-0x14(%rbp)
mov    %al,-0x15(%rbp)
je     1172 <drainWhitespace+0x52>
mov    $0x1,%al
cmpl   $0x20,-0x14(%rbp)
mov    %al,-0x15(%rbp)
je     1172 <drainWhitespace+0x52>
cmpl   $0x9,-0x14(%rbp)
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1182 <drainWhitespace+0x62>
jmp    11cb <drainWhitespace+0xab>
cmpl   $0x0,-0x14(%rbp)
jg     1198 <drainWhitespace+0x78>
movl   $0x0,-0x4(%rbp)
jmp    11d1 <drainWhitespace+0xb1>
cmpl   $0x23,-0x14(%rbp)
jne    11ba <drainWhitespace+0x9a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <skipEndOfLine@plt>
movl   $0xa,-0x4(%rbp)
jmp    11d1 <drainWhitespace+0xb1>
mov    -0x10(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0x14(%rbp)
jmp    114a <drainWhitespace+0x2a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drainWhitespace>:
push   %rbx
mov    %esi,%eax
mov    %rdi,%rbx
test   %esi,%esi
je     1134 <drainWhitespace+0x14>
cmp    $0x9,%eax
je     1134 <drainWhitespace+0x14>
cmp    $0x20,%eax
jne    1143 <drainWhitespace+0x23>
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    $0x9,%eax
jne    112f <drainWhitespace+0xf>
jmp    1134 <drainWhitespace+0x14>
cmp    $0x23,%eax
jne    115a <drainWhitespace+0x3a>
mov    %rbx,%rdi
mov    $0x23,%esi
call   1030 <skipEndOfLine@plt>
mov    $0xa,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @drainWhitespace(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2, %6, %6
%5 = tail call i32 @getc(i32* %0)
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ %1, %2 ], [ %5, %4 ]
switch i32 %7, label %10 [
i32 35, label %8
i32 9, label %4
i32 32, label %4
]
8: ; preds = %6
%9 = tail call i32 @skipEndOfLine(i32* %0, i32 35)
br label %10
10: ; preds = %6, %8
%11 = phi i32 [ 10, %8 ], [ %7, %6 ]
ret i32 %11
}