void CmdHAlign(int code) {
  char *contents, *HA_template, *align;
  char **lines;
  int nlines, ncols, tcols, trepeat, i, line;
  CmdEndParagraph(0);
  contents = getBraceParam();
  HA_ExtractTemplateAndLines(contents, &HA_template, &lines, &nlines);
  free(contents);
  ncols = HA_CountColumnsInHAlign(lines, nlines);
  HA_CountColumnsInTemplate(HA_template, &tcols, &trepeat);
  align = HA_AlignFromTemplate(HA_template, ncols, tcols, trepeat);
  HA_CleanTemplate(HA_template);
  for (line = 0; line < nlines; line++) {
    char *s = lines[line];
    fprintRTF("{\\trowd");
    for (i = 1; i <= ncols; i++)
      fprintRTF("\\cellx%d", getLength("textwidth") * (i) / (ncols));
    fprintRTF("\n");
    setTexMode(2);
    for (i = 1; i <= ncols; i++) {
      char *cell, *cell_template, *cell_text;
      cell = HA_GetCellN(s, i);
      cell_template = HA_GetCellTemplateN(HA_template, i, tcols, trepeat);
      cell_text = HA_ExpandCellWithTemplate(cell_template, cell);
      diagnostics(5, "line=%d, col=%d, align=%c, cell is '%s'", line + 1, i,
                  align[i], cell_text);
      free(cell);
      free(cell_template);
      BeginCellRTF(align[i]);
      ConvertString(cell_text);
      EndCellRTF();
      free(cell_text);
    }
    fprintRTF("\\row}\n");
    free(lines[line]);
  }
  setTexMode(6);
  free(align);
  free(lines);
  free(HA_template);
}


x86 assembly (clang, -O0):
<CmdHAlign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1140 <CmdEndParagraph@plt>
mov    $0x0,%al
call   1070 <getBraceParam@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
mov    $0x0,%al
call   1060 <HA_ExtractTemplateAndLines@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    $0x0,%al
call   1110 <HA_CountColumnsInHAlign@plt>
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x34(%rbp),%rsi
lea    -0x38(%rbp),%rdx
mov    $0x0,%al
call   1050 <HA_CountColumnsInTemplate@plt>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    $0x0,%al
call   10c0 <HA_AlignFromTemplate@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   10a0 <HA_CleanTemplate@plt>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    143a <CmdHAlign+0x21a>
mov    -0x28(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x48(%rbp)
lea    0xd2c(%rip),%rdi
mov    $0x0,%al
call   1130 <fprintRTF@plt>
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jg     1322 <CmdHAlign+0x102>
lea    0xd1c(%rip),%rdi
mov    $0x0,%al
call   1120 <getLength@plt>
imul   -0x3c(%rbp),%eax
cltd
idivl  -0x30(%rbp)
mov    %eax,%esi
lea    0xcfb(%rip),%rdi
mov    $0x0,%al
call   1130 <fprintRTF@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    12e2 <CmdHAlign+0xc2>
lea    0xd1f(%rip),%rdi
mov    $0x0,%al
call   1130 <fprintRTF@plt>
mov    $0x2,%edi
mov    $0x0,%al
call   10d0 <setTexMode@plt>
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jg     140d <CmdHAlign+0x1ed>
mov    -0x48(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    $0x0,%al
call   10e0 <HA_GetCellN@plt>
cltq
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    $0x0,%al
call   1030 <HA_GetCellTemplateN@plt>
cltq
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    $0x0,%al
call   10f0 <HA_ExpandCellWithTemplate@plt>
cltq
mov    %rax,-0x60(%rbp)
mov    -0x40(%rbp),%edx
add    $0x1,%edx
mov    -0x3c(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rsi
movsbl (%rax,%rsi,1),%r8d
mov    -0x60(%rbp),%r9
mov    $0x5,%edi
lea    0xc63(%rip),%rsi
mov    $0x0,%al
call   1090 <diagnostics@plt>
mov    -0x50(%rbp),%rdi
call   1040 <free@plt>
mov    -0x58(%rbp),%rdi
call   1040 <free@plt>
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
mov    $0x0,%al
call   1100 <BeginCellRTF@plt>
mov    -0x60(%rbp),%rdi
mov    $0x0,%al
call   1080 <ConvertString@plt>
mov    $0x0,%al
call   10b0 <EndCellRTF@plt>
mov    -0x60(%rbp),%rdi
call   1040 <free@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1343 <CmdHAlign+0x123>
lea    0xc2f(%rip),%rdi
mov    $0x0,%al
call   1130 <fprintRTF@plt>
mov    -0x28(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <free@plt>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    12b1 <CmdHAlign+0x91>
mov    $0x6,%edi
mov    $0x0,%al
call   10d0 <setTexMode@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
mov    -0x28(%rbp),%rdi
call   1040 <free@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdHAlign>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
xor    %edi,%edi
xor    %eax,%eax
call   1140 <CmdEndParagraph@plt>
xor    %eax,%eax
call   1070 <getBraceParam@plt>
movslq %eax,%rbx
lea    0x10(%rsp),%rsi
lea    0x20(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <HA_ExtractTemplateAndLines@plt>
mov    %rbx,%rdi
call   1040 <free@plt>
mov    0x20(%rsp),%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1110 <HA_CountColumnsInHAlign@plt>
mov    %eax,%r14d
mov    0x10(%rsp),%rdi
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
xor    %eax,%eax
call   1050 <HA_CountColumnsInTemplate@plt>
mov    0x10(%rsp),%rdi
mov    0x1c(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    %r14d,%esi
xor    %eax,%eax
call   10c0 <HA_AlignFromTemplate@plt>
cltq
mov    %rax,0x28(%rsp)
mov    0x10(%rsp),%rdi
xor    %eax,%eax
call   10a0 <HA_CleanTemplate@plt>
cmpl   $0x0,0xc(%rsp)
jle    1488 <CmdHAlign+0x268>
lea    0x1(%r14),%ebx
mov    %r14d,%r15d
neg    %r15d
lea    0xd40(%rip),%r12
lea    0xd30(%rip),%r13
xor    %ecx,%ecx
mov    %r14,0x48(%rsp)
mov    %r15,0x40(%rsp)
jmp    133f <CmdHAlign+0x11f>
cs nopw 0x0(%rax,%rax,1)
lea    0xd4c(%rip),%rdi
xor    %eax,%eax
call   1130 <fprintRTF@plt>
mov    0x20(%rsp),%rax
mov    0x30(%rsp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <free@plt>
movslq 0xc(%rsp),%rax
mov    0x38(%rsp),%rdx
mov    %rdx,%rcx
cmp    %rax,%rdx
mov    0x48(%rsp),%r14
mov    0x40(%rsp),%r15
lea    0xcdf(%rip),%r12
lea    0xccf(%rip),%r13
jge    1488 <CmdHAlign+0x268>
mov    0x20(%rsp),%rax
mov    %rcx,0x30(%rsp)
mov    (%rax,%rcx,8),%rax
mov    %rax,0x50(%rsp)
lea    0xca7(%rip),%rdi
xor    %eax,%eax
call   1130 <fprintRTF@plt>
test   %r14d,%r14d
jle    13a0 <CmdHAlign+0x180>
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
xor    %eax,%eax
call   1120 <getLength@plt>
imul   %ebp,%eax
cltd
idiv   %r14d
mov    %r13,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1130 <fprintRTF@plt>
lea    (%r15,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x1,%eax
jne    1370 <CmdHAlign+0x150>
lea    0xca1(%rip),%rdi
xor    %eax,%eax
call   1130 <fprintRTF@plt>
mov    $0x2,%edi
xor    %eax,%eax
call   10d0 <setTexMode@plt>
mov    0x30(%rsp),%rax
add    $0x1,%rax
mov    %rax,0x38(%rsp)
test   %r14d,%r14d
mov    0x28(%rsp),%rbp
jle    12f0 <CmdHAlign+0xd0>
mov    $0x1,%r15d
nopl   0x0(%rax)
mov    0x50(%rsp),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   10e0 <HA_GetCellN@plt>
movslq %eax,%r14
mov    0x10(%rsp),%rdi
mov    0x1c(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <HA_GetCellTemplateN@plt>
movslq %eax,%r13
mov    %r13,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10f0 <HA_ExpandCellWithTemplate@plt>
movslq %eax,%r12
movsbl 0x0(%rbp,%r15,1),%r8d
mov    $0x5,%edi
lea    0xbed(%rip),%rsi
mov    0x38(%rsp),%rdx
mov    %r15d,%ecx
mov    %r12,%r9
xor    %eax,%eax
call   1090 <diagnostics@plt>
mov    %r14,%rdi
call   1040 <free@plt>
mov    %r13,%rdi
call   1040 <free@plt>
movsbl 0x0(%rbp,%r15,1),%edi
xor    %eax,%eax
call   1100 <BeginCellRTF@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <ConvertString@plt>
xor    %eax,%eax
call   10b0 <EndCellRTF@plt>
mov    %r12,%rdi
call   1040 <free@plt>
add    $0x1,%r15
cmp    %r15,%rbx
jne    13e0 <CmdHAlign+0x1c0>
jmp    12f0 <CmdHAlign+0xd0>
mov    $0x6,%edi
xor    %eax,%eax
call   10d0 <setTexMode@plt>
mov    0x28(%rsp),%rdi
call   1040 <free@plt>
mov    0x20(%rsp),%rdi
call   1040 <free@plt>
mov    0x10(%rsp),%rdi
call   1040 <free@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"{\\trowd\00"
@.str.1 = [9 x i8] c"\\cellx%d\00"
@.str.2 = [10 x i8] c"textwidth\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [40 x i8] c"line=%d, col=%d, align=%c, cell is '%s'\00"
@.str.5 = [7 x i8] c"\\row}\0A\00"
define void @CmdHAlign(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
store i32 %0, i32* %2
%17 = call i32 (i32, ...) bitcast (i32 (...)* @CmdEndParagraph to i32 (i32, ...)*)(i32 0)
%18 = call i32 (...) @getBraceParam()
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i8*
store i8* %20, i8** %3
%21 = load i8*, i8** %3
%22 = call i32 (i8*, i8**, i8***, i32*, ...) bitcast (i32 (...)* @HA_ExtractTemplateAndLines to i32 (i8*, i8**, i8***, i32*, ...)*)(i8* %21, i8** %4, i8*** %6, i32* %7)
%23 = load i8*, i8** %3
%24 = load i8**, i8*** %6
%25 = load i32, i32* %7
%26 = call i32 (i8**, i32, ...) bitcast (i32 (...)* @HA_CountColumnsInHAlign to i32 (i8**, i32, ...)*)(i8** %24, i32 %25)
store i32 %26, i32* %8
%27 = load i8*, i8** %4
%28 = call i32 (i8*, i32*, i32*, ...) bitcast (i32 (...)* @HA_CountColumnsInTemplate to i32 (i8*, i32*, i32*, ...)*)(i8* %27, i32* %9, i32* %10)
%29 = load i8*, i8** %4
%30 = load i32, i32* %8
%31 = load i32, i32* %9
%32 = load i32, i32* %10
%33 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @HA_AlignFromTemplate to i32 (i8*, i32, i32, i32, ...)*)(i8* %29, i32 %30, i32 %31, i32 %32)
%34 = sext i32 %33 to i64
%35 = inttoptr i64 %34 to i8*
store i8* %35, i8** %5
%36 = load i8*, i8** %4
%37 = call i32 (i8*, ...) bitcast (i32 (...)* @HA_CleanTemplate to i32 (i8*, ...)*)(i8* %36)
store i32 0, i32* %12
br label %38
38: ; preds = %122, %1
%39 = load i32, i32* %12
%40 = load i32, i32* %7
%41 = icmp slt i32 %39, %40
br i1 %41, label %42, label %125
42: ; preds = %38
%43 = load i8**, i8*** %6
%44 = load i32, i32* %12
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8*, i8** %43, i64 %45
%47 = load i8*, i8** %46
store i8* %47, i8** %13
%48 = call i32 (i8*, ...) bitcast (i32 (...)* @fprintRTF to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %11
br label %49
49: ; preds = %60, %42
%50 = load i32, i32* %11
%51 = load i32, i32* %8
%52 = icmp sle i32 %50, %51
br i1 %52, label %53, label %63
53: ; preds = %49
%54 = call i32 (i8*, ...) bitcast (i32 (...)* @getLength to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%55 = load i32, i32* %11
%56 = mul nsw i32 %54, %55
%57 = load i32, i32* %8
%58 = sdiv i32 %56, %57
%59 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @fprintRTF to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %53
%61 = load i32, i32* %11
%62 = add nsw i32 %61, 1
store i32 %62, i32* %11
br label %49
63: ; preds = %49
%64 = call i32 (i8*, ...) bitcast (i32 (...)* @fprintRTF to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%65 = call i32 (i32, ...) bitcast (i32 (...)* @setTexMode to i32 (i32, ...)*)(i32 2)
store i32 1, i32* %11
br label %66
66: ; preds = %112, %63
%67 = load i32, i32* %11
%68 = load i32, i32* %8
%69 = icmp sle i32 %67, %68
br i1 %69, label %70, label %115
70: ; preds = %66
%71 = load i8*, i8** %13
%72 = load i32, i32* %11
%73 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @HA_GetCellN to i32 (i8*, i32, ...)*)(i8* %71, i32 %72)
%74 = sext i32 %73 to i64
%75 = inttoptr i64 %74 to i8*
store i8* %75, i8** %14
%76 = load i8*, i8** %4
%77 = load i32, i32* %11
%78 = load i32, i32* %9
%79 = load i32, i32* %10
%80 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @HA_GetCellTemplateN to i32 (i8*, i32, i32, i32, ...)*)(i8* %76, i32 %77, i32 %78, i32 %79)
%81 = sext i32 %80 to i64
%82 = inttoptr i64 %81 to i8*
store i8* %82, i8** %15
%83 = load i8*, i8** %15
%84 = load i8*, i8** %14
%85 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @HA_ExpandCellWithTemplate to i32 (i8*, i8*, ...)*)(i8* %83, i8* %84)
%86 = sext i32 %85 to i64
%87 = inttoptr i64 %86 to i8*
store i8* %87, i8** %16
%88 = load i32, i32* %12
%89 = add nsw i32 %88, 1
%90 = load i32, i32* %11
%91 = load i8*, i8** %5
%92 = load i32, i32* %11
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8, i8* %91, i64 %93
%95 = load i8, i8* %94
%96 = sext i8 %95 to i32
%97 = load i8*, i8** %16
%98 = call i32 (i32, i8*, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @diagnostics to i32 (i32, i8*, i32, i32, i32, i8*, ...)*)(i32 5, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %89, i32 %90, i32 %96, i8* %97)
%99 = load i8*, i8** %14
%100 = load i8*, i8** %15
%101 = load i8*, i8** %5
%102 = load i32, i32* %11
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8, i8* %101, i64 %103
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = call i32 (i32, ...) bitcast (i32 (...)* @BeginCellRTF to i32 (i32, ...)*)(i32 %106)
%108 = load i8*, i8** %16
%109 = call i32 (i8*, ...) bitcast (i32 (...)* @ConvertString to i32 (i8*, ...)*)(i8* %108)
%110 = call i32 (...) @EndCellRTF()
%111 = load i8*, i8** %16
br label %112
112: ; preds = %70
%113 = load i32, i32* %11
%114 = add nsw i32 %113, 1
store i32 %114, i32* %11
br label %66
115: ; preds = %66
%116 = call i32 (i8*, ...) bitcast (i32 (...)* @fprintRTF to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%117 = load i8**, i8*** %6
%118 = load i32, i32* %12
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i8*, i8** %117, i64 %119
%121 = load i8*, i8** %120
br label %122
122: ; preds = %115
%123 = load i32, i32* %12
%124 = add nsw i32 %123, 1
store i32 %124, i32* %12
br label %38
125: ; preds = %38
%126 = call i32 (i32, ...) bitcast (i32 (...)* @setTexMode to i32 (i32, ...)*)(i32 6)
%127 = load i8*, i8** %5
%128 = load i8**, i8*** %6
%129 = bitcast i8** %128 to i8*
%130 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"{\\trowd\00"
@.str.1 = [9 x i8] c"\\cellx%d\00"
@.str.2 = [10 x i8] c"textwidth\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [40 x i8] c"line=%d, col=%d, align=%c, cell is '%s'\00"
@.str.5 = [7 x i8] c"\\row}\0A\00"
define void @CmdHAlign(i32 %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i8** %2 to i8*
%8 = bitcast i8*** %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @CmdEndParagraph to i32 (i32, ...)*)(i32 0)
%13 = tail call i32 (...) @getBraceParam()
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
%16 = call i32 (i8*, i8**, i8***, i32*, ...) bitcast (i32 (...)* @HA_ExtractTemplateAndLines to i32 (i8*, i8**, i8***, i32*, ...)*)(i8* %15, i8** %2, i8*** %3, i32* %4)
%17 = load i8**, i8*** %3
%18 = load i32, i32* %4
%19 = call i32 (i8**, i32, ...) bitcast (i32 (...)* @HA_CountColumnsInHAlign to i32 (i8**, i32, ...)*)(i8** %17, i32 %18)
%20 = load i8*, i8** %2
%21 = call i32 (i8*, i32*, i32*, ...) bitcast (i32 (...)* @HA_CountColumnsInTemplate to i32 (i8*, i32*, i32*, ...)*)(i8* %20, i32* %5, i32* %6)
%22 = load i8*, i8** %2
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @HA_AlignFromTemplate to i32 (i8*, i32, i32, i32, ...)*)(i8* %22, i32 %19, i32 %23, i32 %24)
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i8*
%28 = load i8*, i8** %2
%29 = call i32 (i8*, ...) bitcast (i32 (...)* @HA_CleanTemplate to i32 (i8*, ...)*)(i8* %28)
%30 = load i32, i32* %4
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %90
32: ; preds = %1
%33 = icmp slt i32 %19, 1
%34 = add i32 %19, 1
%35 = zext i32 %34 to i64
br label %36
36: ; preds = %32, %82
%37 = phi i64 [ 0, %32 ], [ %53, %82 ]
%38 = load i8**, i8*** %3
%39 = getelementptr inbounds i8*, i8** %38, i64 %37
%40 = load i8*, i8** %39
%41 = call i32 (i8*, ...) bitcast (i32 (...)* @fprintRTF to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br i1 %33, label %50, label %42
42: ; preds = %36, %42
%43 = phi i32 [ %48, %42 ], [ 1, %36 ]
%44 = call i32 (i8*, ...) bitcast (i32 (...)* @getLength to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%45 = mul nsw i32 %44, %43
%46 = sdiv i32 %45, %19
%47 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @fprintRTF to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %46)
%48 = add nuw i32 %43, 1
%49 = icmp eq i32 %43, %19
br i1 %49, label %50, label %42
50: ; preds = %42, %36
%51 = call i32 (i8*, ...) bitcast (i32 (...)* @fprintRTF to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%52 = call i32 (i32, ...) bitcast (i32 (...)* @setTexMode to i32 (i32, ...)*)(i32 2)
%53 = add nuw nsw i64 %37, 1
br i1 %33, label %82, label %54
54: ; preds = %50
%55 = trunc i64 %53 to i32
br label %56
56: ; preds = %54, %56
%57 = phi i64 [ 1, %54 ], [ %80, %56 ]
%58 = trunc i64 %57 to i32
%59 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @HA_GetCellN to i32 (i8*, i32, ...)*)(i8* %40, i32 %58)
%60 = sext i32 %59 to i64
%61 = inttoptr i64 %60 to i8*
%62 = load i8*, i8** %2
%63 = load i32, i32* %5
%64 = load i32, i32* %6
%65 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @HA_GetCellTemplateN to i32 (i8*, i32, i32, i32, ...)*)(i8* %62, i32 %58, i32 %63, i32 %64)
%66 = sext i32 %65 to i64
%67 = inttoptr i64 %66 to i8*
%68 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @HA_ExpandCellWithTemplate to i32 (i8*, i8*, ...)*)(i8* %67, i8* %61)
%69 = sext i32 %68 to i64
%70 = inttoptr i64 %69 to i8*
%71 = getelementptr inbounds i8, i8* %27, i64 %57
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = call i32 (i32, i8*, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @diagnostics to i32 (i32, i8*, i32, i32, i32, i8*, ...)*)(i32 5, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %55, i32 %58, i32 %73, i8* %70)
%75 = load i8, i8* %71
%76 = sext i8 %75 to i32
%77 = call i32 (i32, ...) bitcast (i32 (...)* @BeginCellRTF to i32 (i32, ...)*)(i32 %76)
%78 = call i32 (i8*, ...) bitcast (i32 (...)* @ConvertString to i32 (i8*, ...)*)(i8* %70)
%79 = call i32 (...) @EndCellRTF()
%80 = add nuw nsw i64 %57, 1
%81 = icmp eq i64 %80, %35
br i1 %81, label %82, label %56
82: ; preds = %56, %50
%83 = call i32 (i8*, ...) bitcast (i32 (...)* @fprintRTF to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%84 = load i8**, i8*** %3
%85 = getelementptr inbounds i8*, i8** %84, i64 %37
%86 = load i8*, i8** %85
%87 = load i32, i32* %4
%88 = sext i32 %87 to i64
%89 = icmp slt i64 %53, %88
br i1 %89, label %36, label %90
90: ; preds = %82, %1
%91 = call i32 (i32, ...) bitcast (i32 (...)* @setTexMode to i32 (i32, ...)*)(i32 6)
%92 = bitcast i8*** %3 to i8**
%93 = load i8*, i8** %92
%94 = load i8*, i8** %2
ret void
}