#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 */

/* Variables and functions */
int input();
scalar_t__ skip_comment();
int skip_to_next_directive() {
  int state = 0;
  int c;
  c = input();
  while (c != 0) {
    if (c == ' ' || c == '\t') {
      c = input();
    } else if (c == '\n') {
      state = 0;
      c = input();
    } else if (c == '/') {
      state = 1;
      if ((c = input()) == '*') {
        if (skip_comment() == 0) {
          return 0;
        }
        c = input();
      }
    } else if (c == '\\') {
      state = 1;
      if ((c = input()) == '\r') {
        if ((c = input()) == '\n') {
          c = input();
        }
      } else if (c != 0) {
        c = input();
      }
    } else if (c != '#' || state != 0) {
      state = 1;
      c = input();
    } else {
      break;
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<skip_to_next_directive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1282 <skip_to_next_directive+0x162>
cmpl   $0x20,-0xc(%rbp)
je     1157 <skip_to_next_directive+0x37>
cmpl   $0x9,-0xc(%rbp)
jne    1166 <skip_to_next_directive+0x46>
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0xc(%rbp)
jmp    127d <skip_to_next_directive+0x15d>
cmpl   $0xa,-0xc(%rbp)
jne    1186 <skip_to_next_directive+0x66>
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0xc(%rbp)
jmp    1278 <skip_to_next_directive+0x158>
cmpl   $0x2f,-0xc(%rbp)
jne    11d6 <skip_to_next_directive+0xb6>
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x2a,%eax
jne    11d1 <skip_to_next_directive+0xb1>
mov    $0x0,%al
call   1040 <skip_comment@plt>
cmp    $0x0,%rax
jne    11c7 <skip_to_next_directive+0xa7>
movl   $0x0,-0x4(%rbp)
jmp    1288 <skip_to_next_directive+0x168>
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0xc(%rbp)
jmp    1273 <skip_to_next_directive+0x153>
cmpl   $0x5c,-0xc(%rbp)
jne    123a <skip_to_next_directive+0x11a>
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xd,%eax
jne    121c <skip_to_next_directive+0xfc>
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
jne    1217 <skip_to_next_directive+0xf7>
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0xc(%rbp)
jmp    1235 <skip_to_next_directive+0x115>
cmpl   $0x0,-0xc(%rbp)
je     1230 <skip_to_next_directive+0x110>
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0xc(%rbp)
jmp    1235 <skip_to_next_directive+0x115>
jmp    126e <skip_to_next_directive+0x14e>
cmpl   $0x23,-0xc(%rbp)
jne    124e <skip_to_next_directive+0x12e>
cmpl   $0x0,-0x8(%rbp)
je     1264 <skip_to_next_directive+0x144>
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0xc(%rbp)
jmp    1269 <skip_to_next_directive+0x149>
jmp    1282 <skip_to_next_directive+0x162>
jmp    126e <skip_to_next_directive+0x14e>
jmp    1273 <skip_to_next_directive+0x153>
jmp    1278 <skip_to_next_directive+0x158>
jmp    127d <skip_to_next_directive+0x15d>
jmp    1139 <skip_to_next_directive+0x19>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_to_next_directive>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%r14
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <input@plt>
mov    %eax,%ebx
mov    %ebp,%r15d
nopl   0x0(%rax)
cmp    $0x2f,%ebx
ja     1170 <skip_to_next_directive+0x50>
mov    %ebx,%eax
movslq (%r14,%rax,4),%rax
add    %r14,%rax
mov    %r15d,%ebp
jmp    *%rax
xor    %eax,%eax
call   1030 <input@plt>
mov    %eax,%ebx
mov    $0x1,%r15d
cmp    $0x2a,%eax
jne    1140 <skip_to_next_directive+0x20>
jmp    11b7 <skip_to_next_directive+0x97>
nopl   0x0(%rax)
cmp    $0x5c,%ebx
jne    11a2 <skip_to_next_directive+0x82>
xor    %eax,%eax
call   1030 <input@plt>
mov    %eax,%ebx
mov    $0x1,%r15d
test   %eax,%eax
je     1140 <skip_to_next_directive+0x20>
cmp    $0xd,%ebx
jne    11d0 <skip_to_next_directive+0xb0>
xor    %eax,%eax
call   1030 <input@plt>
mov    %eax,%ebx
mov    $0x1,%ebp
cmp    $0xa,%eax
jne    1140 <skip_to_next_directive+0x20>
jmp    1130 <skip_to_next_directive+0x10>
mov    $0x1,%ebp
cmp    $0x23,%ebx
jne    1130 <skip_to_next_directive+0x10>
test   %r15d,%r15d
jne    1130 <skip_to_next_directive+0x10>
jmp    11da <skip_to_next_directive+0xba>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <skip_comment@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    1130 <skip_to_next_directive+0x10>
jmp    11df <skip_to_next_directive+0xbf>
mov    $0x1,%ebp
jmp    1130 <skip_to_next_directive+0x10>
mov    $0x23,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @skip_to_next_directive() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
%4 = call i32 (...) @input()
store i32 %4, i32* %3
br label %5
5: ; preds = %66, %0
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %67
8: ; preds = %5
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 32
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 9
br i1 %13, label %14, label %16
14: ; preds = %11, %8
%15 = call i32 (...) @input()
store i32 %15, i32* %3
br label %66
16: ; preds = %11
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 10
br i1 %18, label %19, label %21
19: ; preds = %16
store i32 0, i32* %2
%20 = call i32 (...) @input()
store i32 %20, i32* %3
br label %65
21: ; preds = %16
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 47
br i1 %23, label %24, label %34
24: ; preds = %21
store i32 1, i32* %2
%25 = call i32 (...) @input()
store i32 %25, i32* %3
%26 = icmp eq i32 %25, 42
br i1 %26, label %27, label %33
27: ; preds = %24
%28 = call i64 (...) @skip_comment()
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %27
store i32 0, i32* %1
br label %69
31: ; preds = %27
%32 = call i32 (...) @input()
store i32 %32, i32* %3
br label %33
33: ; preds = %31, %24
br label %64
34: ; preds = %21
%35 = load i32, i32* %3
%36 = icmp eq i32 %35, 92
br i1 %36, label %37, label %53
37: ; preds = %34
store i32 1, i32* %2
%38 = call i32 (...) @input()
store i32 %38, i32* %3
%39 = icmp eq i32 %38, 13
br i1 %39, label %40, label %46
40: ; preds = %37
%41 = call i32 (...) @input()
store i32 %41, i32* %3
%42 = icmp eq i32 %41, 10
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = call i32 (...) @input()
store i32 %44, i32* %3
br label %45
45: ; preds = %43, %40
br label %52
46: ; preds = %37
%47 = load i32, i32* %3
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = call i32 (...) @input()
store i32 %50, i32* %3
br label %51
51: ; preds = %49, %46
br label %52
52: ; preds = %51, %45
br label %63
53: ; preds = %34
%54 = load i32, i32* %3
%55 = icmp ne i32 %54, 35
br i1 %55, label %59, label %56
56: ; preds = %53
%57 = load i32, i32* %2
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %56, %53
store i32 1, i32* %2
%60 = call i32 (...) @input()
store i32 %60, i32* %3
br label %62
61: ; preds = %56
br label %67
62: ; preds = %59
br label %63
63: ; preds = %62, %52
br label %64
64: ; preds = %63, %33
br label %65
65: ; preds = %64, %19
br label %66
66: ; preds = %65, %14
br label %5
67: ; preds = %61, %5
%68 = load i32, i32* %3
store i32 %68, i32* %1
br label %69
69: ; preds = %67, %30
%70 = load i32, i32* %1
ret i32 %70
}

LLVM IR (-O2):
define i32 @skip_to_next_directive() {
br label %1
1: ; preds = %25, %0
%2 = phi i32 [ 0, %0 ], [ %26, %25 ]
%3 = tail call i32 (...) @input()
br label %4
4: ; preds = %16, %1
%5 = phi i32 [ %2, %1 ], [ 1, %16 ]
%6 = phi i32 [ %3, %1 ], [ %17, %16 ]
switch i32 %6, label %21 [
i32 0, label %27
i32 32, label %25
i32 9, label %25
i32 10, label %7
i32 47, label %8
i32 92, label %14
]
7: ; preds = %4
br label %25
8: ; preds = %4
%9 = tail call i32 (...) @input()
%10 = icmp eq i32 %9, 42
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = tail call i64 (...) @skip_comment()
%13 = icmp eq i64 %12, 0
br i1 %13, label %27, label %25
14: ; preds = %4
%15 = tail call i32 (...) @input()
switch i32 %15, label %25 [
i32 13, label %18
i32 0, label %16
]
16: ; preds = %14, %18, %8
%17 = phi i32 [ %9, %8 ], [ %19, %18 ], [ %15, %14 ]
br label %4
18: ; preds = %14
%19 = tail call i32 (...) @input()
%20 = icmp eq i32 %19, 10
br i1 %20, label %25, label %16
21: ; preds = %4
%22 = icmp ne i32 %6, 35
%23 = icmp ne i32 %5, 0
%24 = select i1 %22, i1 true, i1 %23
br i1 %24, label %25, label %27
25: ; preds = %4, %4, %18, %14, %21, %11, %7
%26 = phi i32 [ 0, %7 ], [ 1, %11 ], [ 1, %21 ], [ 1, %14 ], [ 1, %18 ], [ %5, %4 ], [ %5, %4 ]
br label %1
27: ; preds = %21, %11, %4
%28 = phi i32 [ %6, %4 ], [ 35, %21 ], [ 0, %11 ]
ret i32 %28
}