#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 TexFontNumber(char *);
int /*<<< orphan*/ changeTexMode(int);
int /*<<< orphan*/ fprintRTF(char *, ...);
char getRawTexChar();
int getTexMode();
int /*<<< orphan*/ isalpha(int);
int /*<<< orphan*/ putRtfCharEscaped(char);
void CmdVerb(int code) {
  char cThis;
  char markingchar = '#';
  int num;
  if (getTexMode() == 6)
    changeTexMode(2);
  num = TexFontNumber("Typewriter");
  fprintRTF("{\\b0\\i0\\scaps0\\f%d ", num);
  if (code == 2 || code == 1) {
    while ((cThis = getRawTexChar())) {
      if ((cThis != ' ') && (cThis != '*') && !isalpha((int)cThis)) {
        markingchar = cThis;
        break;
      }
    }
  }
  while ((cThis = getRawTexChar()) && cThis != markingchar)
    putRtfCharEscaped(cThis);
  fprintRTF("}");
}


x86 assembly (clang, -O0):
<CmdVerb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x23,-0x6(%rbp)
mov    $0x0,%al
call   1050 <getTexMode@plt>
cmp    $0x6,%eax
jne    1199 <CmdVerb+0x29>
mov    $0x2,%edi
call   1030 <changeTexMode@plt>
lea    0xe60(%rip),%rdi
call   1040 <TexFontNumber@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1090 <fprintRTF@plt>
cmpl   $0x2,-0x4(%rbp)
je     11cd <CmdVerb+0x5d>
cmpl   $0x1,-0x4(%rbp)
jne    1225 <CmdVerb+0xb5>
jmp    11d2 <CmdVerb+0x62>
mov    $0x0,%al
call   1070 <getRawTexChar@plt>
mov    %al,-0x5(%rbp)
cmp    $0x0,%al
je     1220 <CmdVerb+0xb0>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     121b <CmdVerb+0xab>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     121b <CmdVerb+0xab>
movsbl -0x5(%rbp),%edi
call   1080 <isalpha@plt>
cmp    $0x0,%eax
jne    121b <CmdVerb+0xab>
mov    -0x5(%rbp),%al
mov    %al,-0x6(%rbp)
jmp    1220 <CmdVerb+0xb0>
jmp    11d2 <CmdVerb+0x62>
jmp    1225 <CmdVerb+0xb5>
jmp    122a <CmdVerb+0xba>
mov    $0x0,%al
call   1070 <getRawTexChar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1255 <CmdVerb+0xe5>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1265 <CmdVerb+0xf5>
jmp    1273 <CmdVerb+0x103>
movsbl -0x5(%rbp),%edi
call   1060 <putRtfCharEscaped@plt>
jmp    122a <CmdVerb+0xba>
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1090 <fprintRTF@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdVerb>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <getTexMode@plt>
cmp    $0x6,%eax
jne    1189 <CmdVerb+0x19>
mov    $0x2,%edi
call   1030 <changeTexMode@plt>
lea    0xe70(%rip),%rdi
call   1040 <TexFontNumber@plt>
lea    0xe6f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <fprintRTF@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     11d3 <CmdVerb+0x63>
nopl   (%rax)
xor    %eax,%eax
call   1070 <getRawTexChar@plt>
cmp    $0x20,%al
je     11b0 <CmdVerb+0x40>
cmp    $0x2a,%al
je     11b0 <CmdVerb+0x40>
test   %al,%al
je     11da <CmdVerb+0x6a>
movsbl %al,%ebx
mov    %ebx,%edi
call   1080 <isalpha@plt>
test   %eax,%eax
jne    11b0 <CmdVerb+0x40>
jmp    11e0 <CmdVerb+0x70>
mov    $0x23,%ebx
jmp    11e0 <CmdVerb+0x70>
mov    $0x23,%ebx
nop
xor    %eax,%eax
call   1070 <getRawTexChar@plt>
test   %al,%al
je     11fc <CmdVerb+0x8c>
movsbl %al,%ecx
cmp    %ecx,%ebx
je     11fc <CmdVerb+0x8c>
movsbl %al,%edi
call   1060 <putRtfCharEscaped@plt>
jmp    11e0 <CmdVerb+0x70>
lea    0xe1c(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1090 <fprintRTF@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Typewriter\00"
@.str.1 = [20 x i8] c"{\\b0\\i0\\scaps0\\f%d \00"
@.str.2 = [2 x i8] c"}\00"
define void @CmdVerb(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %2
store i8 35, i8* %4
%6 = call i32 (...) @getTexMode()
%7 = icmp eq i32 %6, 6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @changeTexMode(i32 2)
br label %10
10: ; preds = %8, %1
%11 = call i32 @TexFontNumber(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 2
br i1 %15, label %19, label %16
16: ; preds = %10
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %40
19: ; preds = %16, %10
br label %20
20: ; preds = %38, %19
%21 = call signext i8 (...) @getRawTexChar()
store i8 %21, i8* %3
%22 = icmp ne i8 %21, 0
br i1 %22, label %23, label %39
23: ; preds = %20
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 32
br i1 %26, label %27, label %38
27: ; preds = %23
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 42
br i1 %30, label %31, label %38
31: ; preds = %27
%32 = load i8, i8* %3
%33 = sext i8 %32 to i32
%34 = call i32 @isalpha(i32 %33)
%35 = icmp ne i32 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %31
%37 = load i8, i8* %3
store i8 %37, i8* %4
br label %39
38: ; preds = %31, %27, %23
br label %20
39: ; preds = %36, %20
br label %40
40: ; preds = %39, %16
br label %41
41: ; preds = %53, %40
%42 = call signext i8 (...) @getRawTexChar()
store i8 %42, i8* %3
%43 = sext i8 %42 to i32
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %51
45: ; preds = %41
%46 = load i8, i8* %3
%47 = sext i8 %46 to i32
%48 = load i8, i8* %4
%49 = sext i8 %48 to i32
%50 = icmp ne i32 %47, %49
br label %51
51: ; preds = %45, %41
%52 = phi i1 [ false, %41 ], [ %50, %45 ]
br i1 %52, label %53, label %56
53: ; preds = %51
%54 = load i8, i8* %3
%55 = call i32 @putRtfCharEscaped(i8 signext %54)
br label %41
56: ; preds = %51
%57 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Typewriter\00"
@.str.1 = [20 x i8] c"{\\b0\\i0\\scaps0\\f%d \00"
@.str.2 = [2 x i8] c"}\00"
define void @CmdVerb(i32 %0) {
%2 = tail call i32 (...) @getTexMode()
%3 = icmp eq i32 %2, 6
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @changeTexMode(i32 2)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @TexFontNumber(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = add i32 %0, -1
%10 = icmp ult i32 %9, 2
br i1 %10, label %11, label %18
11: ; preds = %6, %13
%12 = tail call signext i8 (...) @getRawTexChar()
switch i8 %12, label %14 [
i8 0, label %18
i8 42, label %13
i8 32, label %13
]
13: ; preds = %11, %11, %14
br label %11
14: ; preds = %11
%15 = sext i8 %12 to i32
%16 = tail call i32 @isalpha(i32 %15)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %13
18: ; preds = %14, %11, %6
%19 = phi i32 [ 35, %6 ], [ %15, %14 ], [ 35, %11 ]
%20 = tail call signext i8 (...) @getRawTexChar()
%21 = sext i8 %20 to i32
%22 = icmp ne i8 %20, 0
%23 = icmp ne i32 %19, %21
%24 = and i1 %22, %23
br i1 %24, label %25, label %33
25: ; preds = %18, %25
%26 = phi i8 [ %28, %25 ], [ %20, %18 ]
%27 = tail call i32 @putRtfCharEscaped(i8 signext %26)
%28 = tail call signext i8 (...) @getRawTexChar()
%29 = sext i8 %28 to i32
%30 = icmp ne i8 %28, 0
%31 = icmp ne i32 %19, %29
%32 = and i1 %30, %31
br i1 %32, label %25, label %33
33: ; preds = %25, %18
%34 = tail call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}