#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*/ diagnostics(int, char *);
int /*<<< orphan*/ fprintRTF(char *);
int /*<<< orphan*/ free(char *);
char *getBraceParam();
int getTexMode();
void CmdUnderline(int code) {
  char *s;
  diagnostics(5, "Entering CmdUnderline");
  if (getTexMode() == 6)
    changeTexMode(2);
  fprintRTF("{\\ul ");
  s = getBraceParam();
  ConvertString(s);
  free(s);
  fprintRTF("}");
  diagnostics(5, "Exiting CmdUnderline");
}


x86 assembly (clang, -O0):
<CmdUnderline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x5,%edi
lea    0xe79(%rip),%rsi
call   1080 <diagnostics@plt>
mov    $0x0,%al
call   1050 <getTexMode@plt>
cmp    $0x6,%eax
jne    11a6 <CmdUnderline+0x36>
mov    $0x2,%edi
call   1040 <changeTexMode@plt>
lea    0xe69(%rip),%rdi
call   1090 <fprintRTF@plt>
mov    $0x0,%al
call   1060 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <ConvertString@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0xe46(%rip),%rdi
call   1090 <fprintRTF@plt>
mov    $0x5,%edi
lea    0xe37(%rip),%rsi
call   1080 <diagnostics@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdUnderline>:
push   %rbx
lea    0xe88(%rip),%rsi
mov    $0x5,%edi
call   1080 <diagnostics@plt>
xor    %eax,%eax
call   1050 <getTexMode@plt>
cmp    $0x6,%eax
jne    1198 <CmdUnderline+0x28>
mov    $0x2,%edi
call   1040 <changeTexMode@plt>
lea    0xe77(%rip),%rdi
call   1090 <fprintRTF@plt>
xor    %eax,%eax
call   1060 <getBraceParam@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <ConvertString@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe57(%rip),%rdi
call   1090 <fprintRTF@plt>
lea    0xe4d(%rip),%rsi
mov    $0x5,%edi
pop    %rbx
jmp    1080 <diagnostics@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Entering CmdUnderline\00"
@.str.1 = [6 x i8] c"{\\ul \00"
@.str.2 = [2 x i8] c"}\00"
@.str.3 = [21 x i8] c"Exiting CmdUnderline\00"
define void @CmdUnderline(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i32 @diagnostics(i32 5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @getTexMode()
%6 = icmp eq i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @changeTexMode(i32 2)
br label %9
9: ; preds = %7, %1
%10 = call i32 @fprintRTF(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = call i8* (...) @getBraceParam()
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = call i32 @ConvertString(i8* %12)
%14 = load i8*, i8** %3
%15 = call i32 @free(i8* %14)
%16 = call i32 @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @diagnostics(i32 5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Entering CmdUnderline\00"
@.str.1 = [6 x i8] c"{\\ul \00"
@.str.2 = [2 x i8] c"}\00"
@.str.3 = [21 x i8] c"Exiting CmdUnderline\00"
define void @CmdUnderline(i32 %0) {
%2 = tail call i32 @diagnostics(i32 5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @getTexMode()
%4 = icmp eq i32 %3, 6
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @changeTexMode(i32 2)
br label %7
7: ; preds = %5, %1
%8 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i8* (...) @getBraceParam()
%10 = tail call i32 @ConvertString(i8* %9)
%11 = tail call i32 @free(i8* %9)
%12 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 @diagnostics(i32 5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
ret void
}