#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 /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int strlen(char *);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
int pdb_parse_comment(FILE *fptr, int *line, char byte) {
  if (byte == '#') {
    while (!feof(fptr)) {
      byte = fgetc(fptr);
      if (byte == '\n') {
        (*line)++;
        return 1;
      }
    }
  } else if (byte == "/*"[0]) {
    if (strlen("/*") == 2) {
      {
        *&byte = fgetc(fptr);
        ungetc(*&byte, fptr);
      };
      if (byte != "/*"[1])
        return 0;
    }
    while (!feof(fptr)) {
      byte = fgetc(fptr);
      if (byte == '\n')
        (*line)++;
      else if (byte == "*/"[0]) {
        if (strlen("*/") == 2) {
          {
            *&byte = fgetc(fptr);
            ungetc(*&byte, fptr);
          };
          if (byte != "*/"[1])
            continue;
        }
        fgetc(fptr);
        return 1;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<pdb_parse_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x23,%eax
jne    11bf <pdb_parse_comment+0x7f>
jmp    1167 <pdb_parse_comment+0x27>
mov    -0x10(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1185 <pdb_parse_comment+0x45>
jmp    11ba <pdb_parse_comment+0x7a>
mov    -0x10(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0xa,%eax
jne    11b5 <pdb_parse_comment+0x75>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1302 <pdb_parse_comment+0x1c2>
jmp    1167 <pdb_parse_comment+0x27>
jmp    12fb <pdb_parse_comment+0x1bb>
movsbl -0x19(%rbp),%eax
movsbl 0xe36(%rip),%ecx
cmp    %ecx,%eax
jne    12f6 <pdb_parse_comment+0x1b6>
lea    0xe27(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    1226 <pdb_parse_comment+0xe6>
mov    -0x10(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1060 <ungetc@plt>
movsbl -0x19(%rbp),%eax
movsbl 0xdf4(%rip),%ecx
cmp    %ecx,%eax
je     1221 <pdb_parse_comment+0xe1>
movl   $0x0,-0x4(%rbp)
jmp    1302 <pdb_parse_comment+0x1c2>
jmp    1226 <pdb_parse_comment+0xe6>
jmp    122b <pdb_parse_comment+0xeb>
mov    -0x10(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1249 <pdb_parse_comment+0x109>
jmp    12f1 <pdb_parse_comment+0x1b1>
mov    -0x10(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0xa,%eax
jne    1272 <pdb_parse_comment+0x132>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    12ec <pdb_parse_comment+0x1ac>
movsbl -0x19(%rbp),%eax
movsbl 0xd86(%rip),%ecx
cmp    %ecx,%eax
jne    12e7 <pdb_parse_comment+0x1a7>
lea    0xd77(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    12d2 <pdb_parse_comment+0x192>
mov    -0x10(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1060 <ungetc@plt>
movsbl -0x19(%rbp),%eax
movsbl 0xd44(%rip),%ecx
cmp    %ecx,%eax
je     12cd <pdb_parse_comment+0x18d>
jmp    122b <pdb_parse_comment+0xeb>
jmp    12d2 <pdb_parse_comment+0x192>
mov    -0x10(%rbp),%rdi
call   1040 <fgetc@plt>
movl   $0x1,-0x4(%rbp)
jmp    1302 <pdb_parse_comment+0x1c2>
jmp    12ec <pdb_parse_comment+0x1ac>
jmp    122b <pdb_parse_comment+0xeb>
jmp    12f6 <pdb_parse_comment+0x1b6>
jmp    12fb <pdb_parse_comment+0x1bb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdb_parse_comment>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %r12d,%r12d
cmp    $0x2f,%dl
je     1185 <pdb_parse_comment+0x45>
cmp    $0x23,%dl
jne    1236 <pdb_parse_comment+0xf6>
nop
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %eax,%eax
jne    1236 <pdb_parse_comment+0xf6>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
cmp    $0xa,%al
jne    1160 <pdb_parse_comment+0x20>
addl   $0x1,(%r14)
jmp    1230 <pdb_parse_comment+0xf0>
lea    0xe74(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    11b5 <pdb_parse_comment+0x75>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
movsbl %al,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <ungetc@plt>
cmp    $0x2a,%bpl
jne    1236 <pdb_parse_comment+0xf6>
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %eax,%eax
jne    1236 <pdb_parse_comment+0xf6>
lea    0xe3b(%rip),%r15
jmp    11dc <pdb_parse_comment+0x9c>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %eax,%eax
jne    1236 <pdb_parse_comment+0xf6>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
cmp    $0x2a,%al
je     1200 <pdb_parse_comment+0xc0>
cmp    $0xa,%al
jne    11d0 <pdb_parse_comment+0x90>
addl   $0x1,(%r14)
jmp    11d0 <pdb_parse_comment+0x90>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    1228 <pdb_parse_comment+0xe8>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
movsbl %al,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <ungetc@plt>
cmp    $0x2f,%bpl
jne    11d0 <pdb_parse_comment+0x90>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
mov    $0x1,%r12d
mov    %r12d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"/*\00"
@.str.1 = [3 x i8] c"*/\00"
define i32 @pdb_parse_comment(i32* %0, i32* %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8 %2, i8* %7
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 35
br i1 %10, label %11, label %29
11: ; preds = %3
br label %12
12: ; preds = %27, %11
%13 = load i32*, i32** %5
%14 = call i32 @feof(i32* %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %17, label %28
17: ; preds = %12
%18 = load i32*, i32** %5
%19 = call signext i8 @fgetc(i32* %18)
store i8 %19, i8* %7
%20 = load i8, i8* %7
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 10
br i1 %22, label %23, label %27
23: ; preds = %17
%24 = load i32*, i32** %6
%25 = load i32, i32* %24
%26 = add nsw i32 %25, 1
store i32 %26, i32* %24
store i32 1, i32* %4
br label %97
27: ; preds = %17
br label %12
28: ; preds = %12
br label %96
29: ; preds = %3
%30 = load i8, i8* %7
%31 = sext i8 %30 to i32
%32 = load i8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %31, %33
br i1 %34, label %35, label %95
35: ; preds = %29
%36 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%37 = icmp eq i32 %36, 2
br i1 %37, label %38, label %51
38: ; preds = %35
%39 = load i32*, i32** %5
%40 = call signext i8 @fgetc(i32* %39)
store i8 %40, i8* %7
%41 = load i8, i8* %7
%42 = load i32*, i32** %5
%43 = call i32 @ungetc(i8 signext %41, i32* %42)
%44 = load i8, i8* %7
%45 = sext i8 %44 to i32
%46 = load i8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 1)
%47 = sext i8 %46 to i32
%48 = icmp ne i32 %45, %47
br i1 %48, label %49, label %50
49: ; preds = %38
store i32 0, i32* %4
br label %97
50: ; preds = %38
br label %51
51: ; preds = %50, %35
br label %52
52: ; preds = %93, %87, %51
%53 = load i32*, i32** %5
%54 = call i32 @feof(i32* %53)
%55 = icmp ne i32 %54, 0
%56 = xor i1 %55, true
br i1 %56, label %57, label %94
57: ; preds = %52
%58 = load i32*, i32** %5
%59 = call signext i8 @fgetc(i32* %58)
store i8 %59, i8* %7
%60 = load i8, i8* %7
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 10
br i1 %62, label %63, label %67
63: ; preds = %57
%64 = load i32*, i32** %6
%65 = load i32, i32* %64
%66 = add nsw i32 %65, 1
store i32 %66, i32* %64
br label %93
67: ; preds = %57
%68 = load i8, i8* %7
%69 = sext i8 %68 to i32
%70 = load i8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %69, %71
br i1 %72, label %73, label %92
73: ; preds = %67
%74 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%75 = icmp eq i32 %74, 2
br i1 %75, label %76, label %89
76: ; preds = %73
%77 = load i32*, i32** %5
%78 = call signext i8 @fgetc(i32* %77)
store i8 %78, i8* %7
%79 = load i8, i8* %7
%80 = load i32*, i32** %5
%81 = call i32 @ungetc(i8 signext %79, i32* %80)
%82 = load i8, i8* %7
%83 = sext i8 %82 to i32
%84 = load i8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 1)
%85 = sext i8 %84 to i32
%86 = icmp ne i32 %83, %85
br i1 %86, label %87, label %88
87: ; preds = %76
br label %52
88: ; preds = %76
br label %89
89: ; preds = %88, %73
%90 = load i32*, i32** %5
%91 = call signext i8 @fgetc(i32* %90)
store i32 1, i32* %4
br label %97
92: ; preds = %67
br label %93
93: ; preds = %92, %63
br label %52
94: ; preds = %52
br label %95
95: ; preds = %94, %29
br label %96
96: ; preds = %95, %28
store i32 0, i32* %4
br label %97
97: ; preds = %96, %89, %49, %23
%98 = load i32, i32* %4
ret i32 %98
}

LLVM IR (-O2):
@.str = [3 x i8] c"/*\00"
@.str.1 = [3 x i8] c"*/\00"
define i32 @pdb_parse_comment(i32* nocapture %0, i32* nocapture %1, i8 signext %2) {
switch i8 %2, label %40 [
i8 35, label %4
i8 47, label %13
]
4: ; preds = %3, %7
%5 = tail call i32 @feof(i32* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %40
7: ; preds = %4
%8 = tail call signext i8 @fgetc(i32* %0)
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %4
10: ; preds = %7
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %40
13: ; preds = %3
%14 = tail call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = tail call signext i8 @fgetc(i32* %0)
%18 = tail call i32 @ungetc(i8 signext %17, i32* %0)
%19 = icmp eq i8 %17, 42
br i1 %19, label %20, label %40
20: ; preds = %16, %13
%21 = tail call i32 @feof(i32* %0)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %40
23: ; preds = %20, %37
%24 = tail call signext i8 @fgetc(i32* %0)
switch i8 %24, label %37 [
i8 10, label %25
i8 42, label %28
]
25: ; preds = %23
%26 = load i32, i32* %1
%27 = add nsw i32 %26, 1
store i32 %27, i32* %1
br label %37
28: ; preds = %23
%29 = tail call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp eq i32 %29, 2
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = tail call signext i8 @fgetc(i32* %0)
%33 = tail call i32 @ungetc(i8 signext %32, i32* %0)
%34 = icmp eq i8 %32, 47
br i1 %34, label %35, label %37
35: ; preds = %31, %28
%36 = tail call signext i8 @fgetc(i32* %0)
br label %40
37: ; preds = %25, %23, %31
%38 = tail call i32 @feof(i32* %0)
%39 = icmp eq i32 %38, 0
br i1 %39, label %23, label %40
40: ; preds = %37, %4, %20, %3, %16, %35, %10
%41 = phi i32 [ 1, %10 ], [ 1, %35 ], [ 0, %16 ], [ 0, %3 ], [ 0, %20 ], [ 0, %4 ], [ 0, %37 ]
ret i32 %41
}