#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 */
char fgetc(int /*<<< orphan*/ *);
scalar_t__ isspace(int);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void skipspace(FILE *f) {
  int c;
  for (;;) {
    c = fgetc(f);
    while (isspace(c))
      c = fgetc(f);
    if (c == '#')
      while (fgetc(f) != '\n')
        ;
    else
      break;
  }
  ungetc(c, f);
}


x86 assembly (clang, -O0):
<skipspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movsbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     1171 <skipspace+0x41>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movsbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    114b <skipspace+0x1b>
cmpl   $0x23,-0xc(%rbp)
jne    119f <skipspace+0x6f>
jmp    1180 <skipspace+0x50>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     119a <skipspace+0x6a>
jmp    1180 <skipspace+0x50>
jmp    11a4 <skipspace+0x74>
jmp    11a9 <skipspace+0x79>
jmp    113c <skipspace+0xc>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1050 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspace>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebx
movsbl %al,%ebp
mov    %ebp,%edi
call   1040 <isspace@plt>
test   %rax,%rax
jne    1140 <skipspace+0x10>
cmp    $0x23,%bl
jne    116e <skipspace+0x3e>
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%al
jne    1160 <skipspace+0x30>
jmp    1140 <skipspace+0x10>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <ungetc@plt>

LLVM IR (-O0):
define void @skipspace(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %28, %1
%5 = load i32*, i32** %2
%6 = call signext i8 @fgetc(i32* %5)
%7 = sext i8 %6 to i32
store i32 %7, i32* %3
br label %8
8: ; preds = %12, %4
%9 = load i32, i32* %3
%10 = call i64 @isspace(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32*, i32** %2
%14 = call signext i8 @fgetc(i32* %13)
%15 = sext i8 %14 to i32
store i32 %15, i32* %3
br label %8
16: ; preds = %8
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 35
br i1 %18, label %19, label %27
19: ; preds = %16
br label %20
20: ; preds = %25, %19
%21 = load i32*, i32** %2
%22 = call signext i8 @fgetc(i32* %21)
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 10
br i1 %24, label %25, label %26
25: ; preds = %20
br label %20
26: ; preds = %20
br label %28
27: ; preds = %16
br label %29
28: ; preds = %26
br label %4
29: ; preds = %27
%30 = load i32, i32* %3
%31 = load i32*, i32** %2
%32 = call i32 @ungetc(i32 %30, i32* %31)
ret void
}

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