#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 isInQuote();
int /*<<< orphan*/ markquote();
void recordState(short cur) {
  extern char commentstate;
  extern char reservestate;
  reservestate = commentstate;
  if ('"' == cur) {
    markquote();
  } else if ('/' == cur) {
    if (7 == isInQuote()) {
      if (0 == commentstate) {
        commentstate = 1;
      } else if (1 == commentstate) {
        commentstate = 2;
      } else if (4 == commentstate) {
        commentstate = 0;
      }
    }
  } else if ('*' == cur) {
    if (7 == isInQuote()) {
      if (3 == commentstate) {
        commentstate = 4;
      } else if (1 == commentstate) {
        commentstate = 3;
      }
    }
  } else if ('\n' == cur) {
    if (7 == isInQuote()) {
      if (2 == commentstate) {
        commentstate = 0;
      }
    }
  }
  if (4 == commentstate && '*' != cur) {
    commentstate = 3;
  }
}


x86 assembly (clang, -O0):
<recordState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%cl
mov    0x2ea1(%rip),%rax
mov    %cl,(%rax)
movswl -0x2(%rbp),%ecx
mov    $0x22,%eax
cmp    %ecx,%eax
jne    115e <recordState+0x3e>
mov    $0x0,%al
call   1030 <markquote@plt>
jmp    12e1 <recordState+0x1c1>
movswl -0x2(%rbp),%ecx
mov    $0x2f,%eax
cmp    %ecx,%eax
jne    1203 <recordState+0xe3>
mov    $0x0,%al
call   1040 <isInQuote@plt>
mov    %eax,%ecx
mov    $0x7,%eax
cmp    %ecx,%eax
jne    11fe <recordState+0xde>
mov    0x2e5c(%rip),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    11a8 <recordState+0x88>
mov    0x2e48(%rip),%rax
movb   $0x1,(%rax)
jmp    11f9 <recordState+0xd9>
mov    0x2e39(%rip),%rax
movsbl (%rax),%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jne    11ce <recordState+0xae>
mov    0x2e22(%rip),%rax
movb   $0x2,(%rax)
jmp    11f4 <recordState+0xd4>
mov    0x2e13(%rip),%rax
movsbl (%rax),%ecx
mov    $0x4,%eax
cmp    %ecx,%eax
jne    11ef <recordState+0xcf>
mov    0x2dfc(%rip),%rax
movb   $0x0,(%rax)
jmp    11f4 <recordState+0xd4>
jmp    11f9 <recordState+0xd9>
jmp    11fe <recordState+0xde>
jmp    12dc <recordState+0x1bc>
movswl -0x2(%rbp),%ecx
mov    $0x2a,%eax
cmp    %ecx,%eax
jne    1280 <recordState+0x160>
mov    $0x0,%al
call   1040 <isInQuote@plt>
mov    %eax,%ecx
mov    $0x7,%eax
cmp    %ecx,%eax
jne    127b <recordState+0x15b>
mov    0x2db7(%rip),%rax
movsbl (%rax),%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
jne    1250 <recordState+0x130>
mov    0x2da0(%rip),%rax
movb   $0x4,(%rax)
jmp    1276 <recordState+0x156>
mov    0x2d91(%rip),%rax
movsbl (%rax),%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jne    1271 <recordState+0x151>
mov    0x2d7a(%rip),%rax
movb   $0x3,(%rax)
jmp    1276 <recordState+0x156>
jmp    127b <recordState+0x15b>
jmp    12d7 <recordState+0x1b7>
movswl -0x2(%rbp),%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
jne    12d2 <recordState+0x1b2>
mov    $0x0,%al
call   1040 <isInQuote@plt>
mov    %eax,%ecx
mov    $0x7,%eax
cmp    %ecx,%eax
jne    12cd <recordState+0x1ad>
mov    0x2d3a(%rip),%rax
movsbl (%rax),%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
jne    12c8 <recordState+0x1a8>
mov    0x2d23(%rip),%rax
movb   $0x0,(%rax)
jmp    12cd <recordState+0x1ad>
jmp    12d2 <recordState+0x1b2>
jmp    12d7 <recordState+0x1b7>
jmp    12dc <recordState+0x1bc>
jmp    12e1 <recordState+0x1c1>
mov    0x2d00(%rip),%rax
movsbl (%rax),%ecx
mov    $0x4,%eax
cmp    %ecx,%eax
jne    1313 <recordState+0x1f3>
movswl -0x2(%rbp),%ecx
mov    $0x2a,%eax
cmp    %ecx,%eax
je     1313 <recordState+0x1f3>
mov    0x2cd8(%rip),%rax
movb   $0x3,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recordState>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebb(%rip),%r14
mov    (%r14),%al
mov    0x2ea9(%rip),%rcx
mov    %al,(%rcx)
lea    -0xa(%rbx),%eax
cmp    $0x25,%ax
ja     11be <recordState+0x9e>
movzwl %ax,%eax
lea    0xeb4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1040 <isInQuote@plt>
cmp    $0x7,%eax
jne    11be <recordState+0x9e>
cmpb   $0x2,(%r14)
je     11ba <recordState+0x9a>
jmp    11be <recordState+0x9e>
xor    %eax,%eax
call   1030 <markquote@plt>
cmp    $0x2a,%bx
jne    11c4 <recordState+0xa4>
jmp    11cf <recordState+0xaf>
xor    %eax,%eax
call   1040 <isInQuote@plt>
cmp    $0x7,%eax
jne    11cf <recordState+0xaf>
mov    (%r14),%al
cmp    $0x3,%al
je     11d7 <recordState+0xb7>
cmp    $0x1,%al
jne    11cf <recordState+0xaf>
mov    $0x3,%al
jmp    11cc <recordState+0xac>
xor    %eax,%eax
call   1040 <isInQuote@plt>
cmp    $0x7,%eax
jne    11be <recordState+0x9e>
mov    (%r14),%al
cmp    $0x4,%al
je     11ba <recordState+0x9a>
cmp    $0x1,%al
je     11db <recordState+0xbb>
test   %al,%al
jne    11be <recordState+0x9e>
movb   $0x1,(%r14)
cmp    $0x2a,%bx
jne    11c4 <recordState+0xa4>
jmp    11cf <recordState+0xaf>
movb   $0x0,(%r14)
cmp    $0x2a,%bx
je     11cf <recordState+0xaf>
mov    $0x3,%al
cmpb   $0x4,(%r14)
jne    11cf <recordState+0xaf>
mov    %al,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    $0x4,%al
jmp    11cc <recordState+0xac>
movb   $0x2,(%r14)
cmp    $0x2a,%bx
jne    11c4 <recordState+0xa4>
jmp    11cf <recordState+0xaf>

LLVM IR (-O0):
@commentstate = external global i8
@reservestate = external global i8
define void @recordState(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i8, i8* @commentstate
store i8 %3, i8* @reservestate
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
%6 = icmp eq i32 34, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @markquote()
br label %72
9: ; preds = %1
%10 = load i16, i16* %2
%11 = sext i16 %10 to i32
%12 = icmp eq i32 47, %11
br i1 %12, label %13, label %35
13: ; preds = %9
%14 = call i32 (...) @isInQuote()
%15 = icmp eq i32 7, %14
br i1 %15, label %16, label %34
16: ; preds = %13
%17 = load i8, i8* @commentstate
%18 = sext i8 %17 to i32
%19 = icmp eq i32 0, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i8 1, i8* @commentstate
br label %33
21: ; preds = %16
%22 = load i8, i8* @commentstate
%23 = sext i8 %22 to i32
%24 = icmp eq i32 1, %23
br i1 %24, label %25, label %26
25: ; preds = %21
store i8 2, i8* @commentstate
br label %32
26: ; preds = %21
%27 = load i8, i8* @commentstate
%28 = sext i8 %27 to i32
%29 = icmp eq i32 4, %28
br i1 %29, label %30, label %31
30: ; preds = %26
store i8 0, i8* @commentstate
br label %31
31: ; preds = %30, %26
br label %32
32: ; preds = %31, %25
br label %33
33: ; preds = %32, %20
br label %34
34: ; preds = %33, %13
br label %71
35: ; preds = %9
%36 = load i16, i16* %2
%37 = sext i16 %36 to i32
%38 = icmp eq i32 42, %37
br i1 %38, label %39, label %55
39: ; preds = %35
%40 = call i32 (...) @isInQuote()
%41 = icmp eq i32 7, %40
br i1 %41, label %42, label %54
42: ; preds = %39
%43 = load i8, i8* @commentstate
%44 = sext i8 %43 to i32
%45 = icmp eq i32 3, %44
br i1 %45, label %46, label %47
46: ; preds = %42
store i8 4, i8* @commentstate
br label %53
47: ; preds = %42
%48 = load i8, i8* @commentstate
%49 = sext i8 %48 to i32
%50 = icmp eq i32 1, %49
br i1 %50, label %51, label %52
51: ; preds = %47
store i8 3, i8* @commentstate
br label %52
52: ; preds = %51, %47
br label %53
53: ; preds = %52, %46
br label %54
54: ; preds = %53, %39
br label %70
55: ; preds = %35
%56 = load i16, i16* %2
%57 = sext i16 %56 to i32
%58 = icmp eq i32 10, %57
br i1 %58, label %59, label %69
59: ; preds = %55
%60 = call i32 (...) @isInQuote()
%61 = icmp eq i32 7, %60
br i1 %61, label %62, label %68
62: ; preds = %59
%63 = load i8, i8* @commentstate
%64 = sext i8 %63 to i32
%65 = icmp eq i32 2, %64
br i1 %65, label %66, label %67
66: ; preds = %62
store i8 0, i8* @commentstate
br label %67
67: ; preds = %66, %62
br label %68
68: ; preds = %67, %59
br label %69
69: ; preds = %68, %55
br label %70
70: ; preds = %69, %54
br label %71
71: ; preds = %70, %34
br label %72
72: ; preds = %71, %7
%73 = load i8, i8* @commentstate
%74 = sext i8 %73 to i32
%75 = icmp eq i32 4, %74
br i1 %75, label %76, label %81
76: ; preds = %72
%77 = load i16, i16* %2
%78 = sext i16 %77 to i32
%79 = icmp ne i32 42, %78
br i1 %79, label %80, label %81
80: ; preds = %76
store i8 3, i8* @commentstate
br label %81
81: ; preds = %80, %76, %72
ret void
}

LLVM IR (-O2):
@commentstate = external global i8
@reservestate = external global i8
define void @recordState(i16 signext %0) {
%2 = load i8, i8* @commentstate
store i8 %2, i8* @reservestate
switch i16 %0, label %26 [
i16 34, label %3
i16 47, label %5
i16 42, label %13
i16 10, label %19
]
3: ; preds = %1
%4 = tail call i32 (...) @markquote()
br label %26
5: ; preds = %1
%6 = tail call i32 (...) @isInQuote()
%7 = icmp eq i32 %6, 7
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = load i8, i8* @commentstate
switch i8 %9, label %26 [
i8 0, label %10
i8 1, label %11
i8 4, label %12
]
10: ; preds = %8
store i8 1, i8* @commentstate
br label %26
11: ; preds = %8
store i8 2, i8* @commentstate
br label %26
12: ; preds = %8
store i8 0, i8* @commentstate
br label %26
13: ; preds = %1
%14 = tail call i32 (...) @isInQuote()
%15 = icmp eq i32 %14, 7
br i1 %15, label %16, label %33
16: ; preds = %13
%17 = load i8, i8* @commentstate
switch i8 %17, label %33 [
i8 3, label %31
i8 1, label %18
]
18: ; preds = %16
br label %31
19: ; preds = %1
%20 = tail call i32 (...) @isInQuote()
%21 = icmp eq i32 %20, 7
%22 = load i8, i8* @commentstate
%23 = icmp eq i8 %22, 2
%24 = select i1 %21, i1 %23, i1 false
br i1 %24, label %25, label %26
25: ; preds = %19
store i8 0, i8* @commentstate
br label %26
26: ; preds = %1, %8, %10, %12, %11, %5, %25, %19, %3
%27 = load i8, i8* @commentstate
%28 = icmp eq i8 %27, 4
%29 = icmp ne i16 %0, 42
%30 = and i1 %29, %28
br i1 %30, label %31, label %33
31: ; preds = %26, %16, %18
%32 = phi i8 [ 3, %18 ], [ 4, %16 ], [ 3, %26 ]
store i8 %32, i8* @commentstate
br label %33
33: ; preds = %31, %13, %16, %26
ret void
}