#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*/ CmdBox(int);
int /*<<< orphan*/ ConvertString(char *);
int /*<<< orphan*/ diagnostics(int, char *);
int /*<<< orphan*/ fprintRTF(char *, ...);
int /*<<< orphan*/ free(char *);
char *getBraceParam();
int getDimension();
int /*<<< orphan*/ maybeFieldScript(int /*<<< orphan*/);
int /*<<< orphan*/ simpleRTFScript(int /*<<< orphan*/);
int /*<<< orphan*/ strcmp(char *, char *);
void CmdSudirript(int code) {
  char *s = NULL;
  int size;
  switch (code) {
  case 0:
    diagnostics(4, "CmdSudirript() code==0, equation ");
    maybeFieldScript(0);
    break;
  case 1:
    diagnostics(4, "CmdSudirript() code==1, \\textsudirript ");
    simpleRTFScript(0);
    break;
  case 2:
    diagnostics(4, "CmdSudirript() code==2, \\lower ");
    size = getDimension();
    fprintRTF("{\\dn%d ", size);
    s = getBraceParam();
    if (strcmp(s, "\\hbox") == 0)
      CmdBox(1);
    else
      ConvertString(s);
    fprintRTF("}");
    free(s);
    break;
  }
}


x86 assembly (clang, -O0):
<CmdSudirript>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     11e8 <CmdSudirript+0x48>
jmp    11c6 <CmdSudirript+0x26>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
je     1205 <CmdSudirript+0x65>
jmp    11d7 <CmdSudirript+0x37>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     1222 <CmdSudirript+0x82>
jmp    12a1 <CmdSudirript+0x101>
mov    $0x4,%edi
lea    0xe0c(%rip),%rsi
call   1080 <diagnostics@plt>
xor    %edi,%edi
call   1030 <maybeFieldScript@plt>
jmp    12a1 <CmdSudirript+0x101>
mov    $0x4,%edi
lea    0xe11(%rip),%rsi
call   1080 <diagnostics@plt>
xor    %edi,%edi
call   1050 <simpleRTFScript@plt>
jmp    12a1 <CmdSudirript+0x101>
mov    $0x4,%edi
lea    0xe1c(%rip),%rsi
call   1080 <diagnostics@plt>
mov    $0x0,%al
call   10a0 <getDimension@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   10c0 <fprintRTF@plt>
mov    $0x0,%al
call   1060 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe0e(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%eax
jne    1281 <CmdSudirript+0xe1>
mov    $0x1,%edi
call   10b0 <CmdBox@plt>
jmp    128a <CmdSudirript+0xea>
mov    -0x10(%rbp),%rdi
call   1070 <ConvertString@plt>
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   10c0 <fprintRTF@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdSudirript>:
push   %rbx
cmp    $0x2,%edi
je     11cc <CmdSudirript+0x2c>
cmp    $0x1,%edi
je     121b <CmdSudirript+0x7b>
test   %edi,%edi
jne    1234 <CmdSudirript+0x94>
lea    0xe46(%rip),%rsi
mov    $0x4,%edi
call   1080 <diagnostics@plt>
xor    %edi,%edi
pop    %rbx
jmp    1030 <maybeFieldScript@plt>
lea    0xe77(%rip),%rsi
mov    $0x4,%edi
call   1080 <diagnostics@plt>
xor    %eax,%eax
call   10a0 <getDimension@plt>
lea    0xe7f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10c0 <fprintRTF@plt>
xor    %eax,%eax
call   1060 <getBraceParam@plt>
mov    %rax,%rbx
lea    0xe6d(%rip),%rsi
mov    %rax,%rdi
call   1090 <strcmp@plt>
test   %eax,%eax
je     1236 <CmdSudirript+0x96>
mov    %rbx,%rdi
call   1070 <ConvertString@plt>
jmp    1240 <CmdSudirript+0xa0>
lea    0xe00(%rip),%rsi
mov    $0x4,%edi
call   1080 <diagnostics@plt>
xor    %edi,%edi
pop    %rbx
jmp    1050 <simpleRTFScript@plt>
pop    %rbx
ret
mov    $0x1,%edi
call   10b0 <CmdBox@plt>
lea    0xe31(%rip),%rdi
xor    %eax,%eax
call   10c0 <fprintRTF@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"CmdSudirript() code==0, equation \00"
@.str.1 = [40 x i8] c"CmdSudirript() code==1, \\textsudirript \00"
@.str.2 = [32 x i8] c"CmdSudirript() code==2, \\lower \00"
@.str.3 = [8 x i8] c"{\\dn%d \00"
@.str.4 = [6 x i8] c"\\hbox\00"
@.str.5 = [2 x i8] c"}\00"
define void @CmdSudirript(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
store i8* null, i8** %3
%5 = load i32, i32* %2
switch i32 %5, label %30 [
i32 0, label %6
i32 1, label %9
i32 2, label %12
]
6: ; preds = %1
%7 = call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @maybeFieldScript(i32 0)
br label %30
9: ; preds = %1
%10 = call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @simpleRTFScript(i32 0)
br label %30
12: ; preds = %1
%13 = call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (...) @getDimension()
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = call i8* (...) @getBraceParam()
store i8* %17, i8** %3
%18 = load i8*, i8** %3
%19 = call i32 @strcmp(i8* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %12
%22 = call i32 @CmdBox(i32 1)
br label %26
23: ; preds = %12
%24 = load i8*, i8** %3
%25 = call i32 @ConvertString(i8* %24)
br label %26
26: ; preds = %23, %21
%27 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%28 = load i8*, i8** %3
%29 = call i32 @free(i8* %28)
br label %30
30: ; preds = %1, %26, %9, %6
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"CmdSudirript() code==0, equation \00"
@.str.1 = [40 x i8] c"CmdSudirript() code==1, \\textsudirript \00"
@.str.2 = [32 x i8] c"CmdSudirript() code==2, \\lower \00"
@.str.3 = [8 x i8] c"{\\dn%d \00"
@.str.4 = [6 x i8] c"\\hbox\00"
@.str.5 = [2 x i8] c"}\00"
define void @CmdSudirript(i32 %0) {
switch i32 %0, label %22 [
i32 0, label %2
i32 1, label %5
i32 2, label %8
]
2: ; preds = %1
%3 = tail call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @maybeFieldScript(i32 0)
br label %22
5: ; preds = %1
%6 = tail call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @simpleRTFScript(i32 0)
br label %22
8: ; preds = %1
%9 = tail call i32 @diagnostics(i32 4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 (...) @getDimension()
%11 = tail call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = tail call i8* (...) @getBraceParam()
%13 = tail call i32 @strcmp(i8* dereferenceable(1) %12, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %8
%16 = tail call i32 @CmdBox(i32 1)
br label %19
17: ; preds = %8
%18 = tail call i32 @ConvertString(i8* %12)
br label %19
19: ; preds = %17, %15
%20 = tail call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%21 = tail call i32 @free(i8* %12)
br label %22
22: ; preds = %1, %19, %5, %2
ret void
}