#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 /*<<< orphan*/ isspace(int);
int get_next_non_space_char(FILE *fp) {
  int c;
  int comment = 0;
  while ((c = getc(fp)) != EOF) {
    if (comment) {
      if (c == '\n' || c == '\r') {
        comment = 0;
      }
      continue;
    }
    if (c == '#') {
      comment = 1;
      continue;
    }
    if (!isspace(c)) {
      break;
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<get_next_non_space_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%eax
je     11a9 <get_next_non_space_char+0x89>
cmpl   $0x0,-0x10(%rbp)
je     1178 <get_next_non_space_char+0x58>
cmpl   $0xa,-0xc(%rbp)
je     116c <get_next_non_space_char+0x4c>
cmpl   $0xd,-0xc(%rbp)
jne    1173 <get_next_non_space_char+0x53>
movl   $0x0,-0x10(%rbp)
jmp    1133 <get_next_non_space_char+0x13>
cmpl   $0x23,-0xc(%rbp)
jne    118e <get_next_non_space_char+0x6e>
movl   $0x1,-0x10(%rbp)
jmp    1133 <get_next_non_space_char+0x13>
mov    -0xc(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    11a4 <get_next_non_space_char+0x84>
jmp    11a9 <get_next_non_space_char+0x89>
jmp    1133 <get_next_non_space_char+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_non_space_char>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1040 <getc@plt>
mov    %eax,%ebp
mov    0x2eb0(%rip),%r14
cmp    (%r14),%eax
jne    114a <get_next_non_space_char+0x2a>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebx,%ebx
jmp    1170 <get_next_non_space_char+0x50>
xchg   %ax,%ax
cmp    $0xd,%ebp
setne  %al
cmp    $0xa,%ebp
setne  %cl
and    %al,%cl
movzbl %cl,%ebx
mov    %r15,%rdi
call   1040 <getc@plt>
mov    %eax,%ebp
cmp    (%r14),%eax
je     113d <get_next_non_space_char+0x1d>
test   %ebx,%ebx
jne    1150 <get_next_non_space_char+0x30>
mov    $0x1,%ebx
cmp    $0x23,%ebp
je     1161 <get_next_non_space_char+0x41>
mov    %ebp,%edi
call   1030 <isspace@plt>
xor    %ebx,%ebx
test   %eax,%eax
jne    1161 <get_next_non_space_char+0x41>
jmp    113d <get_next_non_space_char+0x1d>

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

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