#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 fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ skipLine(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int skiptoNextObject(FILE *fp) {
  int c;
  while (1) {
    c = fgetc(fp);
    if (c == EOF)
      return 1;
    if (c == '#')
      skipLine(fp);
    if (c == ')')
      break;
  }
  while (1) {
    c = fgetc(fp);
    if (c == EOF)
      return 1;
    if (c == '#')
      skipLine(fp);
    if (c == '(')
      break;
  }
  ungetc(c, fp);
  return 0;
}


x86 assembly (clang, -O0):
<skiptoNextObject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e96(%rip),%rcx
cmp    (%rcx),%eax
jne    1166 <skiptoNextObject+0x36>
movl   $0x1,-0x4(%rbp)
jmp    11f6 <skiptoNextObject+0xc6>
cmpl   $0x23,-0x14(%rbp)
jne    1179 <skiptoNextObject+0x49>
mov    -0x10(%rbp),%rdi
call   1030 <skipLine@plt>
cmpl   $0x29,-0x14(%rbp)
jne    1188 <skiptoNextObject+0x58>
jmp    118d <skiptoNextObject+0x5d>
jmp    113c <skiptoNextObject+0xc>
jmp    1192 <skiptoNextObject+0x62>
mov    -0x10(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e40(%rip),%rcx
cmp    (%rcx),%eax
jne    11bc <skiptoNextObject+0x8c>
movl   $0x1,-0x4(%rbp)
jmp    11f6 <skiptoNextObject+0xc6>
cmpl   $0x23,-0x14(%rbp)
jne    11cf <skiptoNextObject+0x9f>
mov    -0x10(%rbp),%rdi
call   1030 <skipLine@plt>
cmpl   $0x28,-0x14(%rbp)
jne    11de <skiptoNextObject+0xae>
jmp    11e3 <skiptoNextObject+0xb3>
jmp    1192 <skiptoNextObject+0x62>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <ungetc@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skiptoNextObject>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1040 <fgetc@plt>
mov    0x2ea5(%rip),%rbp
mov    $0x1,%r14d
jmp    1160 <skiptoNextObject+0x30>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <skipLine@plt>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
cmp    0x0(%rbp),%eax
je     11af <skiptoNextObject+0x7f>
cmp    $0x23,%eax
je     1150 <skiptoNextObject+0x20>
cmp    $0x29,%eax
jne    1158 <skiptoNextObject+0x28>
jmp    1188 <skiptoNextObject+0x58>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <skipLine@plt>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
cmp    0x0(%rbp),%eax
je     11af <skiptoNextObject+0x7f>
cmp    $0x23,%eax
je     1180 <skiptoNextObject+0x50>
cmp    $0x28,%eax
jne    1188 <skiptoNextObject+0x58>
mov    $0x28,%edi
mov    %rbx,%rsi
call   1050 <ungetc@plt>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @skiptoNextObject(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
br label %5
5: ; preds = %1, %22
%6 = load i32*, i32** %3
%7 = call i32 @fgetc(i32* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %5
store i32 1, i32* %2
br label %46
12: ; preds = %5
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 35
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32*, i32** %3
%17 = call i32 @skipLine(i32* %16)
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 41
br i1 %20, label %21, label %22
21: ; preds = %18
br label %23
22: ; preds = %18
br label %5
23: ; preds = %21
br label %24
24: ; preds = %23, %41
%25 = load i32*, i32** %3
%26 = call i32 @fgetc(i32* %25)
store i32 %26, i32* %4
%27 = load i32, i32* %4
%28 = load i32, i32* @EOF
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %31
30: ; preds = %24
store i32 1, i32* %2
br label %46
31: ; preds = %24
%32 = load i32, i32* %4
%33 = icmp eq i32 %32, 35
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load i32*, i32** %3
%36 = call i32 @skipLine(i32* %35)
br label %37
37: ; preds = %34, %31
%38 = load i32, i32* %4
%39 = icmp eq i32 %38, 40
br i1 %39, label %40, label %41
40: ; preds = %37
br label %42
41: ; preds = %37
br label %24
42: ; preds = %40
%43 = load i32, i32* %4
%44 = load i32*, i32** %3
%45 = call i32 @ungetc(i32 %43, i32* %44)
store i32 0, i32* %2
br label %46
46: ; preds = %42, %30, %11
%47 = load i32, i32* %2
ret i32 %47
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @skiptoNextObject(i32* %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %27, label %5
5: ; preds = %1, %7
%6 = phi i32 [ %8, %7 ], [ %2, %1 ]
switch i32 %6, label %7 [
i32 35, label %15
i32 41, label %11
]
7: ; preds = %5, %15
%8 = tail call i32 @fgetc(i32* %0)
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %27, label %5
11: ; preds = %5
%12 = tail call i32 @fgetc(i32* %0)
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %12, %13
br i1 %14, label %27, label %17
15: ; preds = %5
%16 = tail call i32 @skipLine(i32* %0)
br label %7
17: ; preds = %11, %19
%18 = phi i32 [ %20, %19 ], [ %12, %11 ]
switch i32 %18, label %19 [
i32 35, label %23
i32 40, label %25
]
19: ; preds = %17, %23
%20 = tail call i32 @fgetc(i32* %0)
%21 = load i32, i32* @EOF
%22 = icmp eq i32 %20, %21
br i1 %22, label %27, label %17
23: ; preds = %17
%24 = tail call i32 @skipLine(i32* %0)
br label %19
25: ; preds = %17
%26 = tail call i32 @ungetc(i32 40, i32* %0)
br label %27
27: ; preds = %7, %19, %1, %11, %25
%28 = phi i32 [ 0, %25 ], [ 1, %11 ], [ 1, %1 ], [ 1, %19 ], [ 1, %7 ]
ret i32 %28
}