#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 /*<<< orphan*/ error0(char *);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ isspace(int);
int skip_spaces(FILE *f, char *eoferr) {
  int commentp = 0;
  while (1) {
    int c = getc(f);
    if (c == EOF) {
      if (eoferr)
        error0(eoferr);
      else
        return c;
    }
    if (commentp) {
      if (c == '\n')
        commentp = 0;
    } else if (c == ';')
      commentp = 1;
    else if (!isspace(c))
      return c;
  }
  return 0;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2e8b(%rip),%rcx
cmp    (%rcx),%eax
jne    118e <skip_spaces+0x5e>
cmpq   $0x0,-0x18(%rbp)
je     117e <skip_spaces+0x4e>
mov    -0x18(%rbp),%rdi
call   1030 <error0@plt>
jmp    1189 <skip_spaces+0x59>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11ef <skip_spaces+0xbf>
jmp    118e <skip_spaces+0x5e>
cmpl   $0x0,-0x1c(%rbp)
je     11ae <skip_spaces+0x7e>
cmpl   $0xa,-0x20(%rbp)
jne    11a9 <skip_spaces+0x79>
movl   $0x0,-0x1c(%rbp)
jmp    11ea <skip_spaces+0xba>
cmpl   $0x3b,-0x20(%rbp)
jne    11c4 <skip_spaces+0x94>
movl   $0x1,-0x1c(%rbp)
jmp    11e5 <skip_spaces+0xb5>
mov    -0x20(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%eax
jne    11e0 <skip_spaces+0xb0>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11ef <skip_spaces+0xbf>
jmp    11e5 <skip_spaces+0xb5>
jmp    11ea <skip_spaces+0xba>
jmp    1147 <skip_spaces+0x17>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r12
xor    %ebx,%ebx
mov    0x2ea1(%rip),%r15
jmp    115c <skip_spaces+0x2c>
nopl   0x0(%rax)
test   %ebx,%ebx
je     1180 <skip_spaces+0x50>
xor    %ebx,%ebx
cmp    $0xa,%ebp
setne  %bl
mov    %r12,%rdi
call   1050 <getc@plt>
mov    %eax,%ebp
cmp    (%r15),%eax
jne    1150 <skip_spaces+0x20>
test   %r14,%r14
je     119a <skip_spaces+0x6a>
mov    %r14,%rdi
call   1030 <error0@plt>
jmp    1150 <skip_spaces+0x20>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%ebx
cmp    $0x3b,%ebp
je     115c <skip_spaces+0x2c>
mov    %ebp,%edi
call   1040 <isspace@plt>
mov    $0x0,%ebx
test   %eax,%eax
jne    115c <skip_spaces+0x2c>
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @skip_spaces(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %8
8: ; preds = %2, %43
%9 = load i32*, i32** %4
%10 = call i32 @getc(i32* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %23
14: ; preds = %8
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i8*, i8** %5
%19 = call i32 @error0(i8* %18)
br label %22
20: ; preds = %14
%21 = load i32, i32* %7
store i32 %21, i32* %3
br label %44
22: ; preds = %17
br label %23
23: ; preds = %22, %8
%24 = load i32, i32* %6
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %31
26: ; preds = %23
%27 = load i32, i32* %7
%28 = icmp eq i32 %27, 10
br i1 %28, label %29, label %30
29: ; preds = %26
store i32 0, i32* %6
br label %30
30: ; preds = %29, %26
br label %43
31: ; preds = %23
%32 = load i32, i32* %7
%33 = icmp eq i32 %32, 59
br i1 %33, label %34, label %35
34: ; preds = %31
store i32 1, i32* %6
br label %42
35: ; preds = %31
%36 = load i32, i32* %7
%37 = call i32 @isspace(i32 %36)
%38 = icmp ne i32 %37, 0
br i1 %38, label %41, label %39
39: ; preds = %35
%40 = load i32, i32* %7
store i32 %40, i32* %3
br label %44
41: ; preds = %35
br label %42
42: ; preds = %41, %34
br label %43
43: ; preds = %42, %30
br label %8
44: ; preds = %39, %20
%45 = load i32, i32* %3
ret i32 %45
}

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