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


x86 assembly (clang, -O0):
<_oscomment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x21,%eax
jne    1225 <_oscomment+0xf5>
jmp    1156 <_oscomment+0x26>
mov    -0x10(%rbp),%rdi
call   1030 <_xml_fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e7f(%rip),%rcx
cmp    (%rcx),%eax
je     1219 <_oscomment+0xe9>
cmpl   $0x21,-0x14(%rbp)
jne    11ad <_oscomment+0x7d>
mov    -0x10(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x3e,%eax
jne    119c <_oscomment+0x6c>
movl   $0x1,-0x4(%rbp)
jmp    1238 <_oscomment+0x108>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <ungetc@plt>
jmp    1214 <_oscomment+0xe4>
cmpl   $0x2d,-0x14(%rbp)
jne    120a <_oscomment+0xda>
mov    -0x10(%rbp),%rdi
call   1030 <_xml_fgetc@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x2d,%eax
jne    11f9 <_oscomment+0xc9>
mov    -0x10(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x3e,%eax
jne    11ed <_oscomment+0xbd>
movl   $0x1,-0x4(%rbp)
jmp    1238 <_oscomment+0x108>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <ungetc@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <ungetc@plt>
jmp    120f <_oscomment+0xdf>
jmp    1156 <_oscomment+0x26>
jmp    1214 <_oscomment+0xe4>
jmp    1156 <_oscomment+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1238 <_oscomment+0x108>
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):
<_oscomment>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <fgetc@plt>
cmp    $0x21,%eax
jne    11ca <_oscomment+0x9a>
mov    %rbx,%rdi
call   1030 <_xml_fgetc@plt>
mov    0x2e91(%rip),%r15
mov    $0xffffffff,%r14d
jmp    1172 <_oscomment+0x42>
nop
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <ungetc@plt>
mov    %rbx,%rdi
call   1030 <_xml_fgetc@plt>
cmp    (%r15),%eax
je     11d7 <_oscomment+0xa7>
cmp    $0x2d,%eax
je     11a0 <_oscomment+0x70>
cmp    $0x21,%eax
jne    116a <_oscomment+0x3a>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
mov    %eax,%ebp
cmp    $0x3e,%eax
jne    1160 <_oscomment+0x30>
jmp    11e5 <_oscomment+0xb5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <_xml_fgetc@plt>
mov    %eax,%ebp
cmp    $0x2d,%eax
jne    1160 <_oscomment+0x30>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
cmp    $0x3e,%eax
je     11e5 <_oscomment+0xb5>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <ungetc@plt>
jmp    1160 <_oscomment+0x30>
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <ungetc@plt>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%r14d
jmp    11d7 <_oscomment+0xa7>

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

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