#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*/ print_clean(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ print_clean_quote(int /*<<< orphan*/ *, char *);
int transition(int /*<<< orphan*/ *, int, int);
int process_line(FILE *out, int state, char *p, char *buf) {
  if (*p == '@') {
    if (p[1] == 't')
      state = transition(out, state, 1);
    else if (p[1] == 'T')
      state = transition(out, state, 2);
    else if (p[1] == 'q' || p[1] == 'o')
      state = transition(out, state, 3);
    else if (p[1] == 'c')
      state = transition(out, state, 0);
  } else if (state == 0) {
    print_clean(out, buf);
  } else if (state == 1) {
    print_clean(out, p);
  } else if (state == 2) {
    print_clean_quote(out, p);
  }
  return state;
}


x86 assembly (clang, -O0):
<process_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jne    121c <process_line+0xec>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x74,%eax
jne    1181 <process_line+0x51>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1040 <transition@plt>
mov    %eax,-0xc(%rbp)
jmp    1217 <process_line+0xe7>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x54,%eax
jne    11ab <process_line+0x7b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x2,%edx
call   1040 <transition@plt>
mov    %eax,-0xc(%rbp)
jmp    1212 <process_line+0xe2>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x71,%eax
je     11cd <process_line+0x9d>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6f,%eax
jne    11e6 <process_line+0xb6>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x3,%edx
call   1040 <transition@plt>
mov    %eax,-0xc(%rbp)
jmp    120d <process_line+0xdd>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x63,%eax
jne    1208 <process_line+0xd8>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <transition@plt>
mov    %eax,-0xc(%rbp)
jmp    120d <process_line+0xdd>
jmp    1212 <process_line+0xe2>
jmp    1217 <process_line+0xe7>
jmp    127a <process_line+0x14a>
cmpl   $0x0,-0xc(%rbp)
jne    1238 <process_line+0x108>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <print_clean@plt>
jmp    1275 <process_line+0x145>
cmpl   $0x1,-0xc(%rbp)
jne    1254 <process_line+0x124>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <print_clean@plt>
jmp    1270 <process_line+0x140>
cmpl   $0x2,-0xc(%rbp)
jne    126b <process_line+0x13b>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <print_clean_quote@plt>
jmp    1270 <process_line+0x140>
jmp    1275 <process_line+0x145>
jmp    127a <process_line+0x14a>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_line>:
push   %rax
cmpb   $0x40,(%rdx)
jne    115d <process_line+0x2d>
mov    0x1(%rdx),%al
add    $0xac,%al
cmp    $0x20,%al
ja     1193 <process_line+0x63>
movzbl %al,%eax
lea    0xeb7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x3,%edx
pop    %rax
jmp    1040 <transition@plt>
cmp    $0x2,%esi
je     1177 <process_line+0x47>
cmp    $0x1,%esi
je     1186 <process_line+0x56>
test   %esi,%esi
jne    1193 <process_line+0x63>
mov    %rcx,%rsi
call   1050 <print_clean@plt>
xor    %esi,%esi
jmp    1193 <process_line+0x63>
mov    %rdx,%rsi
call   1030 <print_clean_quote@plt>
mov    $0x2,%esi
jmp    1193 <process_line+0x63>
mov    %rdx,%rsi
call   1050 <print_clean@plt>
mov    $0x1,%esi
mov    %esi,%eax
pop    %rcx
ret
mov    $0x2,%edx
pop    %rax
jmp    1040 <transition@plt>
xor    %edx,%edx
pop    %rax
jmp    1040 <transition@plt>
mov    $0x1,%edx
pop    %rax
jmp    1040 <transition@plt>

LLVM IR (-O0):
define i32 @process_line(i32* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %7
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 64
br i1 %12, label %13, label %63
13: ; preds = %4
%14 = load i8*, i8** %7
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 116
br i1 %18, label %19, label %23
19: ; preds = %13
%20 = load i32*, i32** %5
%21 = load i32, i32* %6
%22 = call i32 @transition(i32* %20, i32 %21, i32 1)
store i32 %22, i32* %6
br label %62
23: ; preds = %13
%24 = load i8*, i8** %7
%25 = getelementptr inbounds i8, i8* %24, i64 1
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 84
br i1 %28, label %29, label %33
29: ; preds = %23
%30 = load i32*, i32** %5
%31 = load i32, i32* %6
%32 = call i32 @transition(i32* %30, i32 %31, i32 2)
store i32 %32, i32* %6
br label %61
33: ; preds = %23
%34 = load i8*, i8** %7
%35 = getelementptr inbounds i8, i8* %34, i64 1
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 113
br i1 %38, label %45, label %39
39: ; preds = %33
%40 = load i8*, i8** %7
%41 = getelementptr inbounds i8, i8* %40, i64 1
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 111
br i1 %44, label %45, label %49
45: ; preds = %39, %33
%46 = load i32*, i32** %5
%47 = load i32, i32* %6
%48 = call i32 @transition(i32* %46, i32 %47, i32 3)
store i32 %48, i32* %6
br label %60
49: ; preds = %39
%50 = load i8*, i8** %7
%51 = getelementptr inbounds i8, i8* %50, i64 1
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 99
br i1 %54, label %55, label %59
55: ; preds = %49
%56 = load i32*, i32** %5
%57 = load i32, i32* %6
%58 = call i32 @transition(i32* %56, i32 %57, i32 0)
store i32 %58, i32* %6
br label %59
59: ; preds = %55, %49
br label %60
60: ; preds = %59, %45
br label %61
61: ; preds = %60, %29
br label %62
62: ; preds = %61, %19
br label %87
63: ; preds = %4
%64 = load i32, i32* %6
%65 = icmp eq i32 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %63
%67 = load i32*, i32** %5
%68 = load i8*, i8** %8
%69 = call i32 @print_clean(i32* %67, i8* %68)
br label %86
70: ; preds = %63
%71 = load i32, i32* %6
%72 = icmp eq i32 %71, 1
br i1 %72, label %73, label %77
73: ; preds = %70
%74 = load i32*, i32** %5
%75 = load i8*, i8** %7
%76 = call i32 @print_clean(i32* %74, i8* %75)
br label %85
77: ; preds = %70
%78 = load i32, i32* %6
%79 = icmp eq i32 %78, 2
br i1 %79, label %80, label %84
80: ; preds = %77
%81 = load i32*, i32** %5
%82 = load i8*, i8** %7
%83 = call i32 @print_clean_quote(i32* %81, i8* %82)
br label %84
84: ; preds = %80, %77
br label %85
85: ; preds = %84, %73
br label %86
86: ; preds = %85, %66
br label %87
87: ; preds = %86, %62
%88 = load i32, i32* %6
ret i32 %88
}

LLVM IR (-O2):
define i32 @process_line(i32* %0, i32 %1, i8* %2, i8* %3) {
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 64
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %2, i64 1
%9 = load i8, i8* %8
switch i8 %9, label %25 [
i8 116, label %10
i8 84, label %12
i8 113, label %14
i8 111, label %14
i8 99, label %16
]
10: ; preds = %7
%11 = tail call i32 @transition(i32* %0, i32 %1, i32 1)
br label %25
12: ; preds = %7
%13 = tail call i32 @transition(i32* %0, i32 %1, i32 2)
br label %25
14: ; preds = %7, %7
%15 = tail call i32 @transition(i32* %0, i32 %1, i32 3)
br label %25
16: ; preds = %7
%17 = tail call i32 @transition(i32* %0, i32 %1, i32 0)
br label %25
18: ; preds = %4
switch i32 %1, label %25 [
i32 0, label %19
i32 1, label %21
i32 2, label %23
]
19: ; preds = %18
%20 = tail call i32 @print_clean(i32* %0, i8* %3)
br label %25
21: ; preds = %18
%22 = tail call i32 @print_clean(i32* %0, i8* %2)
br label %25
23: ; preds = %18
%24 = tail call i32 @print_clean_quote(i32* %0, i8* %2)
br label %25
25: ; preds = %18, %7, %19, %23, %21, %10, %14, %16, %12
%26 = phi i32 [ %11, %10 ], [ %13, %12 ], [ %15, %14 ], [ %17, %16 ], [ 0, %19 ], [ 1, %21 ], [ 2, %23 ], [ %1, %7 ], [ %1, %18 ]
ret i32 %26
}