#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*/ *);
int skipcomment(FILE *fp) {
  int ch;
  for (;;) {
    ch = getc(fp);
    if (ch != '#')
      return (ch);
    while (ch != '\n' && ch != EOF)
      ch = getc(fp);
  }
}


x86 assembly (clang, -O0):
<skipcomment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x23,-0xc(%rbp)
je     113b <skipcomment+0x2b>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1140 <skipcomment+0x30>
xor    %eax,%eax
cmpl   $0xa,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1161 <skipcomment+0x51>
mov    -0xc(%rbp),%eax
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1171 <skipcomment+0x61>
jmp    1182 <skipcomment+0x72>
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
jmp    1140 <skipcomment+0x30>
jmp    111c <skipcomment+0xc>

x86 assembly (clang, -O2):
<skipcomment>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
cmp    $0x23,%eax
jne    1164 <skipcomment+0x54>
mov    0x2ec0(%rip),%r14
jmp    113d <skipcomment+0x2d>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0x23,%eax
jne    1164 <skipcomment+0x54>
cmpl   $0x23,(%r14)
je     1130 <skipcomment+0x20>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0xa,%eax
je     1130 <skipcomment+0x20>
cmp    (%r14),%eax
jne    1150 <skipcomment+0x40>
jmp    1130 <skipcomment+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @skipcomment(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %24, %1
%5 = load i32*, i32** %2
%6 = call i32 @getc(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 35
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = load i32, i32* %3
ret i32 %10
11: ; preds = %4
br label %12
12: ; preds = %21, %11
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 10
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %3
%17 = load i32, i32* @EOF
%18 = icmp ne i32 %16, %17
br label %19
19: ; preds = %15, %12
%20 = phi i1 [ false, %12 ], [ %18, %15 ]
br i1 %20, label %21, label %24
21: ; preds = %19
%22 = load i32*, i32** %2
%23 = call i32 @getc(i32* %22)
store i32 %23, i32* %3
br label %12
24: ; preds = %19
br label %4
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @skipcomment(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = icmp eq i32 %2, 35
br i1 %3, label %7, label %10
4: ; preds = %12, %7
%5 = tail call i32 @getc(i32* %0)
%6 = icmp eq i32 %5, 35
br i1 %6, label %7, label %10
7: ; preds = %1, %4
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %8, 35
br i1 %9, label %4, label %12
10: ; preds = %4, %1
%11 = phi i32 [ %2, %1 ], [ %5, %4 ]
ret i32 %11
12: ; preds = %7, %12
%13 = tail call i32 @getc(i32* %0)
%14 = icmp ne i32 %13, 10
%15 = load i32, i32* @EOF
%16 = icmp ne i32 %13, %15
%17 = select i1 %14, i1 %16, i1 false
br i1 %17, label %12, label %4
}