#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 /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
scalar_t__ isspace(char);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
int mint_skip_space(FILE *file) {
  char c;
  do {
    c = fgetc(file);
    if (c == '#') {
      do
        c = fgetc(file);
      while (c != '\n' && !feof(file));
    }
  } while (isspace(c) && !feof(file));
  ungetc(c, file);
  return c;
}


x86 assembly (clang, -O0):
<mint_skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x23,%eax
jne    11ac <mint_skip_space+0x6c>
jmp    116a <mint_skip_space+0x2a>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xa(%rbp)
je     119c <mint_skip_space+0x5c>
mov    -0x8(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    116a <mint_skip_space+0x2a>
jmp    11ac <mint_skip_space+0x6c>
jmp    11b1 <mint_skip_space+0x71>
movsbl -0x9(%rbp),%edi
call   1040 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xb(%rbp)
je     11e0 <mint_skip_space+0xa0>
mov    -0x8(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
test   $0x1,%al
jne    114c <mint_skip_space+0xc>
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1060 <ungetc@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mint_skip_space>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebx
cmp    $0x23,%al
jne    1182 <mint_skip_space+0x42>
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%al
je     1180 <mint_skip_space+0x40>
mov    %eax,%ebx
mov    %r14,%rdi
call   1050 <feof@plt>
test   %eax,%eax
je     1160 <mint_skip_space+0x20>
jmp    1182 <mint_skip_space+0x42>
nopl   0x0(%rax)
mov    $0xa,%bl
movsbl %bl,%ebx
mov    %ebx,%edi
call   1040 <isspace@plt>
test   %rax,%rax
je     119d <mint_skip_space+0x5d>
mov    %r14,%rdi
call   1050 <feof@plt>
test   %eax,%eax
je     1150 <mint_skip_space+0x10>
mov    %ebx,%edi
mov    %r14,%rsi
call   1060 <ungetc@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @mint_skip_space(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
br label %4
4: ; preds = %36, %1
%5 = load i32*, i32** %2
%6 = call signext i8 @fgetc(i32* %5)
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 35
br i1 %9, label %10, label %26
10: ; preds = %4
br label %11
11: ; preds = %23, %10
%12 = load i32*, i32** %2
%13 = call signext i8 @fgetc(i32* %12)
store i8 %13, i8* %3
br label %14
14: ; preds = %11
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 10
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i32*, i32** %2
%20 = call i32 @feof(i32* %19)
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
br label %23
23: ; preds = %18, %14
%24 = phi i1 [ false, %14 ], [ %22, %18 ]
br i1 %24, label %11, label %25
25: ; preds = %23
br label %26
26: ; preds = %25, %4
br label %27
27: ; preds = %26
%28 = load i8, i8* %3
%29 = call i64 @isspace(i8 signext %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %36
31: ; preds = %27
%32 = load i32*, i32** %2
%33 = call i32 @feof(i32* %32)
%34 = icmp ne i32 %33, 0
%35 = xor i1 %34, true
br label %36
36: ; preds = %31, %27
%37 = phi i1 [ false, %27 ], [ %35, %31 ]
br i1 %37, label %4, label %38
38: ; preds = %36
%39 = load i8, i8* %3
%40 = load i32*, i32** %2
%41 = call i32 @ungetc(i8 signext %39, i32* %40)
%42 = load i8, i8* %3
%43 = sext i8 %42 to i32
ret i32 %43
}

LLVM IR (-O2):
define i32 @mint_skip_space(i32* nocapture %0) {
br label %2
2: ; preds = %15, %1
%3 = tail call signext i8 @fgetc(i32* %0)
%4 = icmp eq i8 %3, 35
br i1 %4, label %5, label %11
5: ; preds = %2, %8
%6 = tail call signext i8 @fgetc(i32* %0)
%7 = icmp eq i8 %6, 10
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = tail call i32 @feof(i32* %0)
%10 = icmp eq i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %8, %2
%12 = phi i8 [ %3, %2 ], [ 10, %5 ], [ %6, %8 ]
%13 = tail call i64 @isspace(i8 signext %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %11
%16 = tail call i32 @feof(i32* %0)
%17 = icmp eq i32 %16, 0
br i1 %17, label %2, label %18
18: ; preds = %11, %15
%19 = tail call i32 @ungetc(i8 signext %12, i32* %0)
%20 = sext i8 %12 to i32
ret i32 %20
}