#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 */
char *BTSHASP_EmitCharString(char *, char *);
char *BTSHASP_EmitString(char *, char *);
scalar_t__ BTSHASP_OpChar(char);
char *BTSHASP_PrintName(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strlen(char *);
char *BTSHASP_PrintToken(char *t, char *s, int ty) {
  if (ty == 'I') {
    t = BTSHASP_PrintName(t, s);
    return (t);
  }
  if (ty == '|') {
    t = BTSHASP_PrintName(t, s);
    return (t);
  }
  if (ty == 'S') {
    t = BTSHASP_EmitString(t, s);
    return (t);
  }
  if (ty == 'C') {
    t = BTSHASP_EmitCharString(t, s);
    return (t);
  }
  if (ty == 'X') {
    if (BTSHASP_OpChar(*(t - 1)) || (*s == '.') || (*s == '@'))
      *t++ = ' ';
    sprintf(t, "%s", s);
    t += strlen(t);
    return (t);
  }
  if ((*s == '.') || (*s == '@'))
    *t++ = ' ';
  sprintf(t, "%s", s);
  t += strlen(t);
  return (t);
}


x86 assembly (clang, -O0):
<BTSHASP_PrintToken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x49,-0x1c(%rbp)
jne    119b <BTSHASP_PrintToken+0x3b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <BTSHASP_PrintName@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1307 <BTSHASP_PrintToken+0x1a7>
cmpl   $0x7c,-0x1c(%rbp)
jne    11c3 <BTSHASP_PrintToken+0x63>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <BTSHASP_PrintName@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1307 <BTSHASP_PrintToken+0x1a7>
cmpl   $0x53,-0x1c(%rbp)
jne    11eb <BTSHASP_PrintToken+0x8b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <BTSHASP_EmitString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1307 <BTSHASP_PrintToken+0x1a7>
cmpl   $0x43,-0x1c(%rbp)
jne    1213 <BTSHASP_PrintToken+0xb3>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <BTSHASP_EmitCharString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1307 <BTSHASP_PrintToken+0x1a7>
cmpl   $0x58,-0x1c(%rbp)
jne    12a0 <BTSHASP_PrintToken+0x140>
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%edi
call   1080 <BTSHASP_OpChar@plt>
cmp    $0x0,%rax
jne    1254 <BTSHASP_PrintToken+0xf4>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     1254 <BTSHASP_PrintToken+0xf4>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jne    1266 <BTSHASP_PrintToken+0x106>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x20,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xd8b(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1307 <BTSHASP_PrintToken+0x1a7>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     12c0 <BTSHASP_PrintToken+0x160>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jne    12d2 <BTSHASP_PrintToken+0x172>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x20,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xd1f(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BTSHASP_PrintToken>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    -0x43(%rdx),%eax
cmp    $0x15,%eax
ja     1194 <BTSHASP_PrintToken+0x34>
lea    0xe87(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <BTSHASP_EmitCharString@plt>
cmp    $0x7c,%edx
jne    11cb <BTSHASP_PrintToken+0x6b>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <BTSHASP_PrintName@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <BTSHASP_EmitString@plt>
movsbl -0x1(%rbx),%edi
call   1080 <BTSHASP_OpChar@plt>
test   %rax,%rax
jne    11d6 <BTSHASP_PrintToken+0x76>
mov    (%r14),%al
cmp    $0x40,%al
je     11d6 <BTSHASP_PrintToken+0x76>
cmp    $0x2e,%al
jne    11dd <BTSHASP_PrintToken+0x7d>
movb   $0x20,(%rbx)
add    $0x1,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
cltq
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @BTSHASP_PrintToken(i8* %0, i8* %1, i32 %2) {
switch i32 %2, label %27 [
i32 73, label %4
i32 124, label %6
i32 83, label %8
i32 67, label %10
i32 88, label %12
]
4: ; preds = %3
%5 = tail call i8* @BTSHASP_PrintName(i8* %0, i8* %1)
br label %37
6: ; preds = %3
%7 = tail call i8* @BTSHASP_PrintName(i8* %0, i8* %1)
br label %37
8: ; preds = %3
%9 = tail call i8* @BTSHASP_EmitString(i8* %0, i8* %1)
br label %37
10: ; preds = %3
%11 = tail call i8* @BTSHASP_EmitCharString(i8* %0, i8* %1)
br label %37
12: ; preds = %3
%13 = getelementptr inbounds i8, i8* %0, i64 -1
%14 = load i8, i8* %13
%15 = tail call i64 @BTSHASP_OpChar(i8 signext %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = load i8, i8* %1
switch i8 %18, label %21 [
i8 46, label %19
i8 64, label %19
]
19: ; preds = %17, %17, %12
%20 = getelementptr inbounds i8, i8* %0, i64 1
store i8 32, i8* %0
br label %21
21: ; preds = %17, %19
%22 = phi i8* [ %20, %19 ], [ %0, %17 ]
%23 = tail call i8* @strcpy(i8* dereferenceable(1) %22, i8* dereferenceable(1) %1)
%24 = tail call i32 @strlen(i8* %22)
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %22, i64 %25
br label %37
27: ; preds = %3
%28 = load i8, i8* %1
switch i8 %28, label %31 [
i8 46, label %29
i8 64, label %29
]
29: ; preds = %27, %27
%30 = getelementptr inbounds i8, i8* %0, i64 1
store i8 32, i8* %0
br label %31
31: ; preds = %27, %29
%32 = phi i8* [ %30, %29 ], [ %0, %27 ]
%33 = tail call i8* @strcpy(i8* dereferenceable(1) %32, i8* %1)
%34 = tail call i32 @strlen(i8* %32)
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %32, i64 %35
br label %37
37: ; preds = %31, %21, %10, %8, %6, %4
%38 = phi i8* [ %5, %4 ], [ %7, %6 ], [ %9, %8 ], [ %11, %10 ], [ %26, %21 ], [ %36, %31 ]
ret i8* %38
}