#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 fskip_comments(FILE *f, int comment_start) {
  int c;
  for (;;) {
    do
      c = getc(f);
    while (isspace(c));
    if (c != comment_start)
      break;
    do {
      if ((c = getc(f)) == EOF)
        return;
    } while (c != '\n');
  };
  ungetc(c, f);
}


x86 assembly (clang, -O0):
<fskip_comments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
jmp    1144 <fskip_comments+0x14>
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
jne    1144 <fskip_comments+0x14>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1173 <fskip_comments+0x43>
jmp    11ac <fskip_comments+0x7c>
jmp    1178 <fskip_comments+0x48>
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0x10(%rbp)
mov    0x2e5d(%rip),%rcx
cmp    (%rcx),%eax
jne    1198 <fskip_comments+0x68>
jmp    11b8 <fskip_comments+0x88>
jmp    119d <fskip_comments+0x6d>
cmpl   $0xa,-0x10(%rbp)
jne    1178 <fskip_comments+0x48>
jmp    113f <fskip_comments+0xf>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fskip_comments>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
mov    0x2ea4(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1050 <getc@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1150 <fskip_comments+0x20>
cmp    %r14d,%ebp
jne    118f <fskip_comments+0x5f>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <getc@plt>
cmp    (%r15),%eax
je     1184 <fskip_comments+0x54>
cmp    $0xa,%eax
jne    1170 <fskip_comments+0x40>
jmp    1150 <fskip_comments+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <ungetc@plt>

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

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