#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 /*<<< orphan*/ CmdEndParagraph(int /*<<< orphan*/);
int /*<<< orphan*/ CmdIndent(int);
int /*<<< orphan*/ CmdVspace(int);
int /*<<< orphan*/ ConvertAllttString(char *);
int /*<<< orphan*/ ConvertString(char *);
int /*<<< orphan*/ PopEnvironment();
int /*<<< orphan*/ PushEnvironment(int);
int /*<<< orphan*/ UpdateLineNumber(char *);
int /*<<< orphan*/ diagnostics(int, char *);
int /*<<< orphan*/ free(char *);
char *getTexUntil(char *, int);
char *my_strdup(char *);
int /*<<< orphan*/ putRtfStrEscaped(char *);
int /*<<< orphan*/ show_string(int, char *, char *);
int /*<<< orphan*/ skipWhiteSpace();
int /*<<< orphan*/ startParagraph(char *, int);
void CmdVerbatim(int code) {
  char *verbatim_text, *endtag = NULL;
  int true_code = code & ~0x4000;
  if (code & 0x4000) {
    diagnostics(4, "Entering CmdVerbatim");
    if (true_code != 4) {
      PushEnvironment(22);
      CmdEndParagraph(0);
      CmdIndent(1);
      startParagraph("verbatim", 2);
    }
    switch (true_code) {
    case 1:
      endtag = my_strdup("\\end{verbatim}");
      break;
    case 2:
      endtag = my_strdup("\\end{Verbatim}");
      break;
    case 3:
      endtag = my_strdup("\\end{alltt}");
      break;
    case 4:
      endtag = my_strdup("\\end{comment}");
      break;
    }
    verbatim_text = getTexUntil(endtag, 1);
    UpdateLineNumber(verbatim_text);
    if (true_code == 3)
      ConvertAllttString(verbatim_text);
    else if (true_code == 1 || true_code == 2) {
      show_string(5, verbatim_text, "verbatim");
      putRtfStrEscaped(verbatim_text);
    }
    free(verbatim_text);
    ConvertString(endtag);
    free(endtag);
  } else {
    diagnostics(4, "Exiting CmdVerbatim");
    if (true_code != 4) {
      PopEnvironment();
      CmdEndParagraph(0);
      CmdVspace(1);
      skipWhiteSpace();
    }
  }
}


x86 assembly (clang, -O0):
<CmdVerbatim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffbfff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4000,%eax
cmp    $0x0,%eax
je     1378 <CmdVerbatim+0x178>
mov    $0x4,%edi
lea    0xdd5(%rip),%rsi
call   1090 <diagnostics@plt>
cmpl   $0x4,-0x1c(%rbp)
je     1276 <CmdVerbatim+0x76>
mov    $0x16,%edi
call   1040 <PushEnvironment@plt>
xor    %edi,%edi
call   1120 <CmdEndParagraph@plt>
mov    $0x1,%edi
call   1060 <CmdIndent@plt>
lea    0xdb9(%rip),%rdi
mov    $0x2,%esi
call   10a0 <startParagraph@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x3,%eax
ja     12ee <CmdVerbatim+0xee>
mov    -0x28(%rbp),%rax
lea    0xd6a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd88(%rip),%rdi
call   10d0 <my_strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    12ee <CmdVerbatim+0xee>
lea    0xd82(%rip),%rdi
call   10d0 <my_strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    12ee <CmdVerbatim+0xee>
lea    0xd7c(%rip),%rdi
call   10d0 <my_strdup@plt>
mov    %rax,-0x18(%rbp)
jmp    12ee <CmdVerbatim+0xee>
lea    0xd73(%rip),%rdi
call   10d0 <my_strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1100 <getTexUntil@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   10f0 <UpdateLineNumber@plt>
cmpl   $0x3,-0x1c(%rbp)
jne    1321 <CmdVerbatim+0x121>
mov    -0x10(%rbp),%rdi
call   1110 <ConvertAllttString@plt>
jmp    1358 <CmdVerbatim+0x158>
cmpl   $0x1,-0x1c(%rbp)
je     1335 <CmdVerbatim+0x135>
cmpl   $0x2,-0x1c(%rbp)
jne    1353 <CmdVerbatim+0x153>
mov    -0x10(%rbp),%rsi
mov    $0x5,%edi
lea    0xce0(%rip),%rdx
call   10c0 <show_string@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <putRtfStrEscaped@plt>
jmp    1358 <CmdVerbatim+0x158>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1080 <ConvertString@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    13b7 <CmdVerbatim+0x1b7>
mov    $0x4,%edi
lea    0xce2(%rip),%rsi
call   1090 <diagnostics@plt>
cmpl   $0x4,-0x1c(%rbp)
je     13b2 <CmdVerbatim+0x1b2>
mov    $0x0,%al
call   10e0 <PopEnvironment@plt>
xor    %edi,%edi
call   1120 <CmdEndParagraph@plt>
mov    $0x1,%edi
call   1050 <CmdVspace@plt>
mov    $0x0,%al
call   1070 <skipWhiteSpace@plt>
jmp    13b7 <CmdVerbatim+0x1b7>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdVerbatim>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
and    $0xffffbfff,%ebx
test   $0x4000,%edi
jne    1231 <CmdVerbatim+0x31>
lea    0xe3a(%rip),%rsi
mov    $0x4,%edi
call   1090 <diagnostics@plt>
cmp    $0x4,%ebx
jne    1250 <CmdVerbatim+0x50>
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xdc8(%rip),%rsi
mov    $0x4,%edi
call   1090 <diagnostics@plt>
cmp    $0x4,%ebx
jne    1274 <CmdVerbatim+0x74>
lea    0xdfa(%rip),%rdi
jmp    12bb <CmdVerbatim+0xbb>
xor    %eax,%eax
call   10e0 <PopEnvironment@plt>
xor    %edi,%edi
call   1120 <CmdEndParagraph@plt>
mov    $0x1,%edi
call   1050 <CmdVspace@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1070 <skipWhiteSpace@plt>
mov    $0x16,%edi
call   1040 <PushEnvironment@plt>
xor    %r14d,%r14d
xor    %edi,%edi
call   1120 <CmdEndParagraph@plt>
mov    $0x1,%edi
call   1060 <CmdIndent@plt>
lea    0xd7c(%rip),%rdi
mov    $0x2,%esi
call   10a0 <startParagraph@plt>
lea    -0x1(%rbx),%eax
cmp    $0x2,%eax
ja     12c3 <CmdVerbatim+0xc3>
cltq
lea    0xdb8(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   10d0 <my_strdup@plt>
mov    %rax,%r14
mov    %r14,%rdi
mov    $0x1,%esi
call   1100 <getTexUntil@plt>
mov    %rax,%r15
mov    %rax,%rdi
call   10f0 <UpdateLineNumber@plt>
cmp    $0x3,%ebx
jne    12ea <CmdVerbatim+0xea>
mov    %r15,%rdi
call   1110 <ConvertAllttString@plt>
jmp    130e <CmdVerbatim+0x10e>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     130e <CmdVerbatim+0x10e>
lea    0xd1c(%rip),%rdx
mov    $0x5,%edi
mov    %r15,%rsi
call   10c0 <show_string@plt>
mov    %r15,%rdi
call   10b0 <putRtfStrEscaped@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1080 <ConvertString@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Entering CmdVerbatim\00"
@.str.1 = [9 x i8] c"verbatim\00"
@.str.2 = [15 x i8] c"\\end{verbatim}\00"
@.str.3 = [15 x i8] c"\\end{Verbatim}\00"
@.str.4 = [12 x i8] c"\\end{alltt}\00"
@.str.5 = [14 x i8] c"\\end{comment}\00"
@.str.6 = [20 x i8] c"Exiting CmdVerbatim\00"
define void @CmdVerbatim(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %2
store i8* null, i8** %4
%6 = load i32, i32* %2
%7 = and i32 %6, -16385
store i32 %7, i32* %5
%8 = load i32, i32* %2
%9 = and i32 %8, 16384
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %59
11: ; preds = %1
%12 = call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 4
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = call i32 @PushEnvironment(i32 22)
%17 = call i32 @CmdEndParagraph(i32 0)
%18 = call i32 @CmdIndent(i32 1)
%19 = call i32 @startParagraph(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 2)
br label %20
20: ; preds = %15, %11
%21 = load i32, i32* %5
switch i32 %21, label %30 [
i32 1, label %22
i32 2, label %24
i32 3, label %26
i32 4, label %28
]
22: ; preds = %20
%23 = call i8* @my_strdup(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
store i8* %23, i8** %4
br label %30
24: ; preds = %20
%25 = call i8* @my_strdup(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
store i8* %25, i8** %4
br label %30
26: ; preds = %20
%27 = call i8* @my_strdup(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
store i8* %27, i8** %4
br label %30
28: ; preds = %20
%29 = call i8* @my_strdup(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
store i8* %29, i8** %4
br label %30
30: ; preds = %20, %28, %26, %24, %22
%31 = load i8*, i8** %4
%32 = call i8* @getTexUntil(i8* %31, i32 1)
store i8* %32, i8** %3
%33 = load i8*, i8** %3
%34 = call i32 @UpdateLineNumber(i8* %33)
%35 = load i32, i32* %5
%36 = icmp eq i32 %35, 3
br i1 %36, label %37, label %40
37: ; preds = %30
%38 = load i8*, i8** %3
%39 = call i32 @ConvertAllttString(i8* %38)
br label %52
40: ; preds = %30
%41 = load i32, i32* %5
%42 = icmp eq i32 %41, 1
br i1 %42, label %46, label %43
43: ; preds = %40
%44 = load i32, i32* %5
%45 = icmp eq i32 %44, 2
br i1 %45, label %46, label %51
46: ; preds = %43, %40
%47 = load i8*, i8** %3
%48 = call i32 @show_string(i32 5, i8* %47, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%49 = load i8*, i8** %3
%50 = call i32 @putRtfStrEscaped(i8* %49)
br label %51
51: ; preds = %46, %43
br label %52
52: ; preds = %51, %37
%53 = load i8*, i8** %3
%54 = call i32 @free(i8* %53)
%55 = load i8*, i8** %4
%56 = call i32 @ConvertString(i8* %55)
%57 = load i8*, i8** %4
%58 = call i32 @free(i8* %57)
br label %69
59: ; preds = %1
%60 = call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%61 = load i32, i32* %5
%62 = icmp ne i32 %61, 4
br i1 %62, label %63, label %68
63: ; preds = %59
%64 = call i32 (...) @PopEnvironment()
%65 = call i32 @CmdEndParagraph(i32 0)
%66 = call i32 @CmdVspace(i32 1)
%67 = call i32 (...) @skipWhiteSpace()
br label %68
68: ; preds = %63, %59
br label %69
69: ; preds = %68, %52
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Entering CmdVerbatim\00"
@.str.1 = [9 x i8] c"verbatim\00"
@.str.2 = [15 x i8] c"\\end{verbatim}\00"
@.str.3 = [15 x i8] c"\\end{Verbatim}\00"
@.str.4 = [12 x i8] c"\\end{alltt}\00"
@.str.5 = [14 x i8] c"\\end{comment}\00"
@.str.6 = [20 x i8] c"Exiting CmdVerbatim\00"
@reltable.CmdVerbatim = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.CmdVerbatim to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @.str.3 to i64), i64 ptrtoint ([3 x i32]* @reltable.CmdVerbatim to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.4 to i64), i64 ptrtoint ([3 x i32]* @reltable.CmdVerbatim to i64)) to i32)]
define void @CmdVerbatim(i32 %0) {
%2 = and i32 %0, -16385
%3 = and i32 %0, 16384
%4 = icmp eq i32 %3, 0
br i1 %4, label %39, label %5
5: ; preds = %1
%6 = tail call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %2, 4
br i1 %7, label %19, label %8
8: ; preds = %5
%9 = tail call i32 @PushEnvironment(i32 22)
%10 = tail call i32 @CmdEndParagraph(i32 0)
%11 = tail call i32 @CmdIndent(i32 1)
%12 = tail call i32 @startParagraph(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 2)
%13 = add i32 %2, -1
%14 = icmp ult i32 %13, 3
br i1 %14, label %15, label %22
15: ; preds = %8
%16 = sext i32 %13 to i64
%17 = shl i64 %16, 2
%18 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.CmdVerbatim to i8*), i64 %17)
br label %19
19: ; preds = %15, %5
%20 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), %5 ], [ %18, %15 ]
%21 = tail call i8* @my_strdup(i8* %20)
br label %22
22: ; preds = %8, %19
%23 = phi i8* [ null, %8 ], [ %21, %19 ]
%24 = tail call i8* @getTexUntil(i8* %23, i32 1)
%25 = tail call i32 @UpdateLineNumber(i8* %24)
%26 = icmp eq i32 %2, 3
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = tail call i32 @ConvertAllttString(i8* %24)
br label %35
29: ; preds = %22
%30 = add i32 %2, -1
%31 = icmp ult i32 %30, 2
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = tail call i32 @show_string(i32 5, i8* %24, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%34 = tail call i32 @putRtfStrEscaped(i8* %24)
br label %35
35: ; preds = %32, %29, %27
%36 = tail call i32 @free(i8* %24)
%37 = tail call i32 @ConvertString(i8* %23)
%38 = tail call i32 @free(i8* %23)
br label %47
39: ; preds = %1
%40 = tail call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%41 = icmp eq i32 %2, 4
br i1 %41, label %47, label %42
42: ; preds = %39
%43 = tail call i32 (...) @PopEnvironment()
%44 = tail call i32 @CmdEndParagraph(i32 0)
%45 = tail call i32 @CmdVspace(i32 1)
%46 = tail call i32 (...) @skipWhiteSpace()
br label %47
47: ; preds = %39, %42, %35
ret void
}