#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*/ InsertRtfHyperlink(char *, char *, char *, char *);
int /*<<< orphan*/ fprintRTF(char *);
char *getBraceParam();
char *getBraceRawParam();
char *getBracketParam();
int /*<<< orphan*/ my_strcpy(char *, char *);
int /*<<< orphan*/ putHtmlRTF(char *);
int /*<<< orphan*/ putRtfStrEscaped(char *);
int /*<<< orphan*/ safe_free(char *);
char *strdup_together(char *, char *);
char *strdup_together3(char *, char *, char *);
char *strstr(char *, char *);
void CmdHtml(int code) {
  static char *baseurl = NULL;
  static char *urlstyle = NULL;
  char *text = NULL;
  char *url = NULL;
  char *s = NULL;
  switch (code) {
  case 8:
    text = getBraceParam();
    url = getBraceParam();
    while ((s = strstr(text, "\\~{}")) != NULL) {
      *s = '~';
      my_strcpy(s + 1, s + 4);
    }
    while ((s = strstr(url, "\\~{}")) != NULL) {
      *s = '~';
      my_strcpy(s + 1, s + 4);
    }
    InsertRtfHyperlink(text, url, NULL, NULL);
    break;
  case 9:
    text = getBraceParam();
    url = getBraceParam();
    ConvertString(text);
    break;
  case 2:
    url = getBracketParam();
    if (!url) {
      char *a, *b, *category, *name;
      a = getBraceParam();
      category = getBraceParam();
      name = getBraceParam();
      b = strdup_together3(a, "#", category);
      url = strdup_together3(b, ".", name);
      safe_free(b);
      safe_free(name);
      safe_free(category);
      safe_free(a);
    }
    text = getBraceParam();
    InsertRtfHyperlink(text, url, baseurl, urlstyle);
    break;
  case 12:
    url = getBraceParam();
    text = getBraceParam();
    InsertRtfHyperlink(text, url, baseurl, urlstyle);
    break;
  case 18:
    url = getBraceRawParam();
    text = strdup_together(baseurl, url);
    fprintRTF("{");
    putHtmlRTF(urlstyle);
    fprintRTF("\\field{\\*\\fldinst{ HYPERLINK \"");
    putRtfStrEscaped(text);
    fprintRTF("\" }{{}}}{\\fldrslt{");
    putRtfStrEscaped(text);
    fprintRTF("}}}");
    break;
  case 13:
  case 14:
    url = getBraceRawParam();
    text = strdup_together(baseurl, url);
    fprintRTF("{");
    putHtmlRTF(urlstyle);
    putRtfStrEscaped(text);
    fprintRTF("}");
    break;
  case 15:
    if (baseurl)
      safe_free(baseurl);
    baseurl = getBraceRawParam();
    break;
  case 16:
    if (urlstyle)
      safe_free(urlstyle);
    urlstyle = getBraceParam();
    break;
  }
  if (text)
    safe_free(text);
  if (url)
    safe_free(url);
}


x86 assembly (clang, -O0):
<CmdHtml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x10,%eax
ja     14f6 <CmdHtml+0x326>
mov    -0x48(%rbp),%rax
lea    0xded(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1060 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <getBraceParam@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe07(%rip),%rsi
call   10f0 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1271 <CmdHtml+0xa1>
mov    -0x20(%rbp),%rax
movb   $0x7e,(%rax)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
mov    -0x20(%rbp),%rsi
add    $0x4,%rsi
call   1030 <my_strcpy@plt>
jmp    1232 <CmdHtml+0x62>
jmp    1276 <CmdHtml+0xa6>
mov    -0x18(%rbp),%rdi
lea    0xdc3(%rip),%rsi
call   10f0 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     12b5 <CmdHtml+0xe5>
mov    -0x20(%rbp),%rax
movb   $0x7e,(%rax)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
mov    -0x20(%rbp),%rsi
add    $0x4,%rsi
call   1030 <my_strcpy@plt>
jmp    1276 <CmdHtml+0xa6>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1050 <InsertRtfHyperlink@plt>
jmp    14f6 <CmdHtml+0x326>
mov    $0x0,%al
call   1060 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <getBraceParam@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <ConvertString@plt>
jmp    14f6 <CmdHtml+0x326>
mov    $0x0,%al
call   10b0 <getBracketParam@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    137d <CmdHtml+0x1ad>
mov    $0x0,%al
call   1060 <getBraceParam@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1060 <getBraceParam@plt>
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1060 <getBraceParam@plt>
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x38(%rbp),%rdx
lea    0xd11(%rip),%rsi
call   1070 <strdup_together3@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xcfb(%rip),%rsi
call   1070 <strdup_together3@plt>
mov    %rax,-0x18(%rbp)
mov    -0x30(%rbp),%rdi
call   10c0 <safe_free@plt>
mov    -0x40(%rbp),%rdi
call   10c0 <safe_free@plt>
mov    -0x38(%rbp),%rdi
call   10c0 <safe_free@plt>
mov    -0x28(%rbp),%rdi
call   10c0 <safe_free@plt>
mov    $0x0,%al
call   1060 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2cf9(%rip),%rdx
mov    0x2cfa(%rip),%rcx
call   1050 <InsertRtfHyperlink@plt>
jmp    14f6 <CmdHtml+0x326>
mov    $0x0,%al
call   1060 <getBraceParam@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2cc3(%rip),%rdx
mov    0x2cc4(%rip),%rcx
call   1050 <InsertRtfHyperlink@plt>
jmp    14f6 <CmdHtml+0x326>
mov    $0x0,%al
call   1080 <getBraceRawParam@plt>
mov    %rax,-0x18(%rbp)
mov    0x2ca0(%rip),%rdi
mov    -0x18(%rbp),%rsi
call   10e0 <strdup_together@plt>
mov    %rax,-0x10(%rbp)
lea    0xc79(%rip),%rdi
call   10d0 <fprintRTF@plt>
mov    0x2c88(%rip),%rdi
call   1040 <putHtmlRTF@plt>
lea    0xc31(%rip),%rdi
call   10d0 <fprintRTF@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <putRtfStrEscaped@plt>
lea    0xc3b(%rip),%rdi
call   10d0 <fprintRTF@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <putRtfStrEscaped@plt>
lea    0xc39(%rip),%rdi
call   10d0 <fprintRTF@plt>
jmp    14f6 <CmdHtml+0x326>
mov    $0x0,%al
call   1080 <getBraceRawParam@plt>
mov    %rax,-0x18(%rbp)
mov    0x2c2e(%rip),%rdi
mov    -0x18(%rbp),%rsi
call   10e0 <strdup_together@plt>
mov    %rax,-0x10(%rbp)
lea    0xc07(%rip),%rdi
call   10d0 <fprintRTF@plt>
mov    0x2c16(%rip),%rdi
call   1040 <putHtmlRTF@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <putRtfStrEscaped@plt>
lea    0xbb0(%rip),%rdi
call   10d0 <fprintRTF@plt>
jmp    14f6 <CmdHtml+0x326>
cmpq   $0x0,0x2be7(%rip)
je     14bb <CmdHtml+0x2eb>
mov    0x2bda(%rip),%rdi
call   10c0 <safe_free@plt>
mov    $0x0,%al
call   1080 <getBraceRawParam@plt>
mov    %rax,0x2bc7(%rip)
jmp    14f6 <CmdHtml+0x326>
cmpq   $0x0,0x2bc2(%rip)
je     14e8 <CmdHtml+0x318>
mov    0x2bb5(%rip),%rdi
call   10c0 <safe_free@plt>
mov    $0x0,%al
call   1060 <getBraceParam@plt>
mov    %rax,0x2ba2(%rip)
cmpq   $0x0,-0x10(%rbp)
je     150a <CmdHtml+0x33a>
mov    -0x10(%rbp),%rdi
call   10c0 <safe_free@plt>
cmpq   $0x0,-0x18(%rbp)
je     151e <CmdHtml+0x34e>
mov    -0x18(%rbp),%rdi
call   10c0 <safe_free@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdHtml>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
add    $0xfffffffe,%edi
cmp    $0x10,%edi
ja     1497 <CmdHtml+0x2c7>
lea    0xe14(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %eax,%eax
call   1080 <getBraceRawParam@plt>
mov    %rax,%r14
mov    0x2e8a(%rip),%rdi
mov    %rax,%rsi
call   10e0 <strdup_together@plt>
mov    %rax,%r15
lea    0xe65(%rip),%rdi
call   10d0 <fprintRTF@plt>
mov    0x2e74(%rip),%rdi
call   1040 <putHtmlRTF@plt>
mov    %r15,%rdi
call   10a0 <putRtfStrEscaped@plt>
lea    0xe0f(%rip),%rdi
jmp    146f <CmdHtml+0x29f>
xor    %eax,%eax
call   10b0 <getBracketParam@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1393 <CmdHtml+0x1c3>
xor    %eax,%eax
call   1060 <getBraceParam@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1060 <getBraceParam@plt>
mov    %rax,%r12
xor    %eax,%eax
call   1060 <getBraceParam@plt>
mov    %rax,%r13
lea    0xdd4(%rip),%rsi
mov    %r15,%rdi
mov    %r12,%rdx
call   1070 <strdup_together3@plt>
mov    %rax,%rbx
lea    0xdc1(%rip),%rsi
mov    %rax,%rdi
mov    %r13,%rdx
call   1070 <strdup_together3@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   10c0 <safe_free@plt>
mov    %r13,%rdi
call   10c0 <safe_free@plt>
mov    %r12,%rdi
call   10c0 <safe_free@plt>
mov    %r15,%rdi
call   10c0 <safe_free@plt>
jmp    1393 <CmdHtml+0x1c3>
xor    %eax,%eax
call   1060 <getBraceParam@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1060 <getBraceParam@plt>
mov    %rax,%r14
lea    0xd6c(%rip),%rsi
mov    %r15,%rdi
call   10f0 <strstr@plt>
test   %rax,%rax
je     1313 <CmdHtml+0x143>
lea    0xd58(%rip),%rbx
nopl   0x0(%rax)
movb   $0x7e,(%rax)
lea    0x1(%rax),%rdi
add    $0x4,%rax
mov    %rax,%rsi
call   1030 <my_strcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
jne    12f0 <CmdHtml+0x120>
lea    0xd2a(%rip),%rsi
mov    %r14,%rdi
call   10f0 <strstr@plt>
test   %rax,%rax
je     1353 <CmdHtml+0x183>
lea    0xd16(%rip),%rbx
xchg   %ax,%ax
movb   $0x7e,(%rax)
lea    0x1(%rax),%rdi
add    $0x4,%rax
mov    %rax,%rsi
call   1030 <my_strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
jne    1330 <CmdHtml+0x160>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    13b1 <CmdHtml+0x1e1>
xor    %eax,%eax
call   1060 <getBraceParam@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1060 <getBraceParam@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1090 <ConvertString@plt>
test   %r15,%r15
jne    1479 <CmdHtml+0x2a9>
jmp    1481 <CmdHtml+0x2b1>
xor    %eax,%eax
call   1060 <getBraceParam@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1060 <getBraceParam@plt>
mov    %rax,%r15
mov    0x2cec(%rip),%rdx
mov    0x2ced(%rip),%rcx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <InsertRtfHyperlink@plt>
test   %r15,%r15
jne    1479 <CmdHtml+0x2a9>
jmp    1481 <CmdHtml+0x2b1>
mov    0x2cc5(%rip),%rdi
test   %rdi,%rdi
je     13d5 <CmdHtml+0x205>
call   10c0 <safe_free@plt>
xor    %eax,%eax
call   1080 <getBraceRawParam@plt>
mov    %rax,0x2cad(%rip)
jmp    1497 <CmdHtml+0x2c7>
mov    0x2ca9(%rip),%rdi
test   %rdi,%rdi
je     13f9 <CmdHtml+0x229>
call   10c0 <safe_free@plt>
xor    %eax,%eax
call   1060 <getBraceParam@plt>
mov    %rax,0x2c91(%rip)
jmp    1497 <CmdHtml+0x2c7>
xor    %eax,%eax
call   1080 <getBraceRawParam@plt>
mov    %rax,%r14
mov    0x2c73(%rip),%rdi
mov    %rax,%rsi
call   10e0 <strdup_together@plt>
mov    %rax,%r15
lea    0xc4e(%rip),%rdi
call   10d0 <fprintRTF@plt>
mov    0x2c5d(%rip),%rdi
call   1040 <putHtmlRTF@plt>
lea    0xc06(%rip),%rdi
call   10d0 <fprintRTF@plt>
mov    %r15,%rdi
call   10a0 <putRtfStrEscaped@plt>
lea    0xc11(%rip),%rdi
call   10d0 <fprintRTF@plt>
mov    %r15,%rdi
call   10a0 <putRtfStrEscaped@plt>
lea    0xc10(%rip),%rdi
call   10d0 <fprintRTF@plt>
test   %r15,%r15
je     1481 <CmdHtml+0x2b1>
mov    %r15,%rdi
call   10c0 <safe_free@plt>
test   %r14,%r14
je     1497 <CmdHtml+0x2c7>
mov    %r14,%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    10c0 <safe_free@plt>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@CmdHtml.baseurl = internal global i8* null
@CmdHtml.urlstyle = internal global i8* null
@.str = [5 x i8] c"\\~{}\00"
@.str.1 = [2 x i8] c"#\00"
@.str.2 = [2 x i8] c".\00"
@.str.3 = [2 x i8] c"{\00"
@.str.4 = [31 x i8] c"\\field{\\*\\fldinst{ HYPERLINK \22\00"
@.str.5 = [19 x i8] c"\22 }{{}}}{\\fldrslt{\00"
@.str.6 = [4 x i8] c"}}}\00"
@.str.7 = [2 x i8] c"}\00"
define void @CmdHtml(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
store i8* null, i8** %4
store i8* null, i8** %5
%10 = load i32, i32* %2
switch i32 %10, label %125 [
i32 8, label %11
i32 9, label %41
i32 2, label %46
i32 12, label %75
i32 18, label %83
i32 13, label %98
i32 14, label %98
i32 15, label %109
i32 16, label %117
]
11: ; preds = %1
%12 = call i8* (...) @getBraceParam()
store i8* %12, i8** %3
%13 = call i8* (...) @getBraceParam()
store i8* %13, i8** %4
br label %14
14: ; preds = %18, %11
%15 = load i8*, i8** %3
%16 = call i8* @strstr(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %16, i8** %5
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %25
18: ; preds = %14
%19 = load i8*, i8** %5
store i8 126, i8* %19
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 4
%24 = call i32 @my_strcpy(i8* %21, i8* %23)
br label %14
25: ; preds = %14
br label %26
26: ; preds = %30, %25
%27 = load i8*, i8** %4
%28 = call i8* @strstr(i8* %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %28, i8** %5
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %37
30: ; preds = %26
%31 = load i8*, i8** %5
store i8 126, i8* %31
%32 = load i8*, i8** %5
%33 = getelementptr inbounds i8, i8* %32, i64 1
%34 = load i8*, i8** %5
%35 = getelementptr inbounds i8, i8* %34, i64 4
%36 = call i32 @my_strcpy(i8* %33, i8* %35)
br label %26
37: ; preds = %26
%38 = load i8*, i8** %3
%39 = load i8*, i8** %4
%40 = call i32 @InsertRtfHyperlink(i8* %38, i8* %39, i8* null, i8* null)
br label %125
41: ; preds = %1
%42 = call i8* (...) @getBraceParam()
store i8* %42, i8** %3
%43 = call i8* (...) @getBraceParam()
store i8* %43, i8** %4
%44 = load i8*, i8** %3
%45 = call i32 @ConvertString(i8* %44)
br label %125
46: ; preds = %1
%47 = call i8* (...) @getBracketParam()
store i8* %47, i8** %4
%48 = load i8*, i8** %4
%49 = icmp ne i8* %48, null
br i1 %49, label %68, label %50
50: ; preds = %46
%51 = call i8* (...) @getBraceParam()
store i8* %51, i8** %6
%52 = call i8* (...) @getBraceParam()
store i8* %52, i8** %8
%53 = call i8* (...) @getBraceParam()
store i8* %53, i8** %9
%54 = load i8*, i8** %6
%55 = load i8*, i8** %8
%56 = call i8* @strdup_together3(i8* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %55)
store i8* %56, i8** %7
%57 = load i8*, i8** %7
%58 = load i8*, i8** %9
%59 = call i8* @strdup_together3(i8* %57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* %58)
store i8* %59, i8** %4
%60 = load i8*, i8** %7
%61 = call i32 @safe_free(i8* %60)
%62 = load i8*, i8** %9
%63 = call i32 @safe_free(i8* %62)
%64 = load i8*, i8** %8
%65 = call i32 @safe_free(i8* %64)
%66 = load i8*, i8** %6
%67 = call i32 @safe_free(i8* %66)
br label %68
68: ; preds = %50, %46
%69 = call i8* (...) @getBraceParam()
store i8* %69, i8** %3
%70 = load i8*, i8** %3
%71 = load i8*, i8** %4
%72 = load i8*, i8** @CmdHtml.baseurl
%73 = load i8*, i8** @CmdHtml.urlstyle
%74 = call i32 @InsertRtfHyperlink(i8* %70, i8* %71, i8* %72, i8* %73)
br label %125
75: ; preds = %1
%76 = call i8* (...) @getBraceParam()
store i8* %76, i8** %4
%77 = call i8* (...) @getBraceParam()
store i8* %77, i8** %3
%78 = load i8*, i8** %3
%79 = load i8*, i8** %4
%80 = load i8*, i8** @CmdHtml.baseurl
%81 = load i8*, i8** @CmdHtml.urlstyle
%82 = call i32 @InsertRtfHyperlink(i8* %78, i8* %79, i8* %80, i8* %81)
br label %125
83: ; preds = %1
%84 = call i8* (...) @getBraceRawParam()
store i8* %84, i8** %4
%85 = load i8*, i8** @CmdHtml.baseurl
%86 = load i8*, i8** %4
%87 = call i8* @strdup_together(i8* %85, i8* %86)
store i8* %87, i8** %3
%88 = call i32 @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%89 = load i8*, i8** @CmdHtml.urlstyle
%90 = call i32 @putHtmlRTF(i8* %89)
%91 = call i32 @fprintRTF(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%92 = load i8*, i8** %3
%93 = call i32 @putRtfStrEscaped(i8* %92)
%94 = call i32 @fprintRTF(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%95 = load i8*, i8** %3
%96 = call i32 @putRtfStrEscaped(i8* %95)
%97 = call i32 @fprintRTF(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %125
98: ; preds = %1, %1
%99 = call i8* (...) @getBraceRawParam()
store i8* %99, i8** %4
%100 = load i8*, i8** @CmdHtml.baseurl
%101 = load i8*, i8** %4
%102 = call i8* @strdup_together(i8* %100, i8* %101)
store i8* %102, i8** %3
%103 = call i32 @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%104 = load i8*, i8** @CmdHtml.urlstyle
%105 = call i32 @putHtmlRTF(i8* %104)
%106 = load i8*, i8** %3
%107 = call i32 @putRtfStrEscaped(i8* %106)
%108 = call i32 @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %125
109: ; preds = %1
%110 = load i8*, i8** @CmdHtml.baseurl
%111 = icmp ne i8* %110, null
br i1 %111, label %112, label %115
112: ; preds = %109
%113 = load i8*, i8** @CmdHtml.baseurl
%114 = call i32 @safe_free(i8* %113)
br label %115
115: ; preds = %112, %109
%116 = call i8* (...) @getBraceRawParam()
store i8* %116, i8** @CmdHtml.baseurl
br label %125
117: ; preds = %1
%118 = load i8*, i8** @CmdHtml.urlstyle
%119 = icmp ne i8* %118, null
br i1 %119, label %120, label %123
120: ; preds = %117
%121 = load i8*, i8** @CmdHtml.urlstyle
%122 = call i32 @safe_free(i8* %121)
br label %123
123: ; preds = %120, %117
%124 = call i8* (...) @getBraceParam()
store i8* %124, i8** @CmdHtml.urlstyle
br label %125
125: ; preds = %1, %123, %115, %98, %83, %75, %68, %41, %37
%126 = load i8*, i8** %3
%127 = icmp ne i8* %126, null
br i1 %127, label %128, label %131
128: ; preds = %125
%129 = load i8*, i8** %3
%130 = call i32 @safe_free(i8* %129)
br label %131
131: ; preds = %128, %125
%132 = load i8*, i8** %4
%133 = icmp ne i8* %132, null
br i1 %133, label %134, label %137
134: ; preds = %131
%135 = load i8*, i8** %4
%136 = call i32 @safe_free(i8* %135)
br label %137
137: ; preds = %134, %131
ret void
}

LLVM IR (-O2):
@CmdHtml.baseurl = internal unnamed_addr global i8* null
@CmdHtml.urlstyle = internal unnamed_addr global i8* null
@.str = [5 x i8] c"\\~{}\00"
@.str.1 = [2 x i8] c"#\00"
@.str.2 = [2 x i8] c".\00"
@.str.3 = [2 x i8] c"{\00"
@.str.4 = [31 x i8] c"\\field{\\*\\fldinst{ HYPERLINK \22\00"
@.str.5 = [19 x i8] c"\22 }{{}}}{\\fldrslt{\00"
@.str.6 = [4 x i8] c"}}}\00"
@.str.7 = [2 x i8] c"}\00"
define void @CmdHtml(i32 %0) {
switch i32 %0, label %100 [
i32 8, label %2
i32 9, label %26
i32 2, label %30
i32 12, label %49
i32 18, label %55
i32 13, label %67
i32 14, label %67
i32 15, label %76
i32 16, label %83
]
2: ; preds = %1
%3 = tail call i8* (...) @getBraceParam()
%4 = tail call i8* (...) @getBraceParam()
%5 = tail call i8* @strstr(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %10, %2
%8 = tail call i8* @strstr(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %24, label %17
10: ; preds = %2, %10
%11 = phi i8* [ %15, %10 ], [ %5, %2 ]
store i8 126, i8* %11
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = getelementptr inbounds i8, i8* %11, i64 4
%14 = tail call i32 @my_strcpy(i8* %12, i8* %13)
%15 = tail call i8* @strstr(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i8* %15, null
br i1 %16, label %7, label %10
17: ; preds = %7, %17
%18 = phi i8* [ %22, %17 ], [ %8, %7 ]
store i8 126, i8* %18
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = getelementptr inbounds i8, i8* %18, i64 4
%21 = tail call i32 @my_strcpy(i8* %19, i8* %20)
%22 = tail call i8* @strstr(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %17
24: ; preds = %17, %7
%25 = tail call i32 @InsertRtfHyperlink(i8* %3, i8* %4, i8* null, i8* null)
br label %90
26: ; preds = %1
%27 = tail call i8* (...) @getBraceParam()
%28 = tail call i8* (...) @getBraceParam()
%29 = tail call i32 @ConvertString(i8* %27)
br label %90
30: ; preds = %1
%31 = tail call i8* (...) @getBracketParam()
%32 = icmp eq i8* %31, null
br i1 %32, label %33, label %43
33: ; preds = %30
%34 = tail call i8* (...) @getBraceParam()
%35 = tail call i8* (...) @getBraceParam()
%36 = tail call i8* (...) @getBraceParam()
%37 = tail call i8* @strdup_together3(i8* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %35)
%38 = tail call i8* @strdup_together3(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* %36)
%39 = tail call i32 @safe_free(i8* %37)
%40 = tail call i32 @safe_free(i8* %36)
%41 = tail call i32 @safe_free(i8* %35)
%42 = tail call i32 @safe_free(i8* %34)
br label %43
43: ; preds = %33, %30
%44 = phi i8* [ %31, %30 ], [ %38, %33 ]
%45 = tail call i8* (...) @getBraceParam()
%46 = load i8*, i8** @CmdHtml.baseurl
%47 = load i8*, i8** @CmdHtml.urlstyle
%48 = tail call i32 @InsertRtfHyperlink(i8* %45, i8* %44, i8* %46, i8* %47)
br label %90
49: ; preds = %1
%50 = tail call i8* (...) @getBraceParam()
%51 = tail call i8* (...) @getBraceParam()
%52 = load i8*, i8** @CmdHtml.baseurl
%53 = load i8*, i8** @CmdHtml.urlstyle
%54 = tail call i32 @InsertRtfHyperlink(i8* %51, i8* %50, i8* %52, i8* %53)
br label %90
55: ; preds = %1
%56 = tail call i8* (...) @getBraceRawParam()
%57 = load i8*, i8** @CmdHtml.baseurl
%58 = tail call i8* @strdup_together(i8* %57, i8* %56)
%59 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%60 = load i8*, i8** @CmdHtml.urlstyle
%61 = tail call i32 @putHtmlRTF(i8* %60)
%62 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%63 = tail call i32 @putRtfStrEscaped(i8* %58)
%64 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%65 = tail call i32 @putRtfStrEscaped(i8* %58)
%66 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %90
67: ; preds = %1, %1
%68 = tail call i8* (...) @getBraceRawParam()
%69 = load i8*, i8** @CmdHtml.baseurl
%70 = tail call i8* @strdup_together(i8* %69, i8* %68)
%71 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%72 = load i8*, i8** @CmdHtml.urlstyle
%73 = tail call i32 @putHtmlRTF(i8* %72)
%74 = tail call i32 @putRtfStrEscaped(i8* %70)
%75 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %90
76: ; preds = %1
%77 = load i8*, i8** @CmdHtml.baseurl
%78 = icmp eq i8* %77, null
br i1 %78, label %81, label %79
79: ; preds = %76
%80 = tail call i32 @safe_free(i8* %77)
br label %81
81: ; preds = %79, %76
%82 = tail call i8* (...) @getBraceRawParam()
store i8* %82, i8** @CmdHtml.baseurl
br label %100
83: ; preds = %1
%84 = load i8*, i8** @CmdHtml.urlstyle
%85 = icmp eq i8* %84, null
br i1 %85, label %88, label %86
86: ; preds = %83
%87 = tail call i32 @safe_free(i8* %84)
br label %88
88: ; preds = %86, %83
%89 = tail call i8* (...) @getBraceParam()
store i8* %89, i8** @CmdHtml.urlstyle
br label %100
90: ; preds = %67, %55, %49, %43, %26, %24
%91 = phi i8* [ %68, %67 ], [ %56, %55 ], [ %50, %49 ], [ %44, %43 ], [ %28, %26 ], [ %4, %24 ]
%92 = phi i8* [ %70, %67 ], [ %58, %55 ], [ %51, %49 ], [ %45, %43 ], [ %27, %26 ], [ %3, %24 ]
%93 = icmp eq i8* %92, null
br i1 %93, label %96, label %94
94: ; preds = %90
%95 = tail call i32 @safe_free(i8* %92)
br label %96
96: ; preds = %94, %90
%97 = icmp eq i8* %91, null
br i1 %97, label %100, label %98
98: ; preds = %96
%99 = tail call i32 @safe_free(i8* %91)
br label %100
100: ; preds = %1, %88, %81, %98, %96
ret void
}