#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*/ ConvertString(char *);
int /*<<< orphan*/ changeTexMode(int);
int /*<<< orphan*/ fprintRTF(char *, ...);
int /*<<< orphan*/ free(char *);
char *getBraceParam();
int getTexMode();
int /*<<< orphan*/ script_shift();
int /*<<< orphan*/ script_size();
void simpleRTFScript(int super) {
  char *s = NULL;
  if (getTexMode() == 6)
    changeTexMode(2);
  s = getBraceParam();
  fprintRTF("{\\%s%d\\fs%d ", super ? "up" : "dn", script_shift(),
            script_size());
  ConvertString(s);
  fprintRTF("}");
  free(s);
}


x86 assembly (clang, -O0):
<simpleRTFScript>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getTexMode@plt>
cmp    $0x6,%eax
jne    11ad <simpleRTFScript+0x2d>
mov    $0x2,%edi
call   1040 <changeTexMode@plt>
mov    $0x0,%al
call   1060 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edx
lea    0xe4e(%rip),%rax
lea    0xe44(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1080 <script_shift@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   10a0 <script_size@plt>
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1090 <fprintRTF@plt>
mov    -0x10(%rbp),%rdi
call   1070 <ConvertString@plt>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1090 <fprintRTF@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simpleRTFScript>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <getTexMode@plt>
cmp    $0x6,%eax
jne    119c <simpleRTFScript+0x1c>
mov    $0x2,%edi
call   1040 <changeTexMode@plt>
xor    %eax,%eax
call   1060 <getBraceParam@plt>
mov    %rax,%r14
test   %ebp,%ebp
lea    0xe61(%rip),%rax
lea    0xe57(%rip),%rbp
cmove  %rax,%rbp
xor    %eax,%eax
call   1080 <script_shift@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   10a0 <script_size@plt>
lea    0xe2f(%rip),%rdi
mov    %rbp,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1090 <fprintRTF@plt>
mov    %r14,%rdi
call   1070 <ConvertString@plt>
lea    0xe25(%rip),%rdi
xor    %eax,%eax
call   1090 <fprintRTF@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"{\\%s%d\\fs%d \00"
@.str.1 = [3 x i8] c"up\00"
@.str.2 = [3 x i8] c"dn\00"
@.str.3 = [2 x i8] c"}\00"
define void @simpleRTFScript(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = call i32 (...) @getTexMode()
%5 = icmp eq i32 %4, 6
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @changeTexMode(i32 2)
br label %8
8: ; preds = %6, %1
%9 = call i8* (...) @getBraceParam()
store i8* %9, i8** %3
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%14 = call i32 (...) @script_shift()
%15 = call i32 (...) @script_size()
%16 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i32 %15)
%17 = load i8*, i8** %3
%18 = call i32 @ConvertString(i8* %17)
%19 = call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%20 = load i8*, i8** %3
%21 = call i32 @free(i8* %20)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"{\\%s%d\\fs%d \00"
@.str.1 = [3 x i8] c"up\00"
@.str.2 = [3 x i8] c"dn\00"
@.str.3 = [2 x i8] c"}\00"
define void @simpleRTFScript(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 i8* (...) @getBraceParam()
%8 = icmp eq i32 %0, 0
%9 = select i1 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%10 = tail call i32 (...) @script_shift()
%11 = tail call i32 (...) @script_size()
%12 = tail call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i32 %11)
%13 = tail call i32 @ConvertString(i8* %7)
%14 = tail call i32 (i8*, ...) @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%15 = tail call i32 @free(i8* %7)
ret void
}