void CmdBox(int code) {
  char BoxName[7][10] = {"hbox",   "vbox",    "mbox",    "fbox",
                         "parbox", "makebox", "framebox"};
  int mode = getTexMode();
  diagnostics(4, "Entering CmdBox() [%s]", BoxName[code - 1]);
  if (code == 1 || code == 3)
    changeTexMode(3);
  if (code == 5) {
    char *position, *width;
    position = getBracketParam();
    width = getBraceParam();
    if (position)
      free(position);
    free(width);
  }
  if (code == 6 || code == 7) {
    char *position, *width;
    position = getBracketParam();
    width = getBracketParam();
    if (position)
      free(position);
    if (width)
      free(width);
  }
  diagnostics(4, "Entering Convert() from CmdBox");
  Convert();
  diagnostics(4, "Exiting Convert() from CmdBox");
  if (code == 2) {
    CmdEndParagraph(0);
    CmdIndent(2);
  } else {
    changeTexMode(mode);
  }
  diagnostics(4, "Exited CmdBox() [%s]", BoxName[code - 1]);
}


x86 assembly (clang, -O0):
<CmdBox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xe47(%rip),%rsi
mov    $0x46,%edx
call   10a0 <memcpy@plt>
mov    $0x0,%al
call   1070 <getTexMode@plt>
mov    %eax,-0x54(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltq
lea    -0x50(%rbp),%rdx
imul   $0xa,%rax,%rax
add    %rax,%rdx
mov    $0x4,%edi
lea    0xe5a(%rip),%rsi
mov    $0x0,%al
call   1090 <diagnostics@plt>
cmpl   $0x1,-0x4(%rbp)
je     1207 <CmdBox+0x67>
cmpl   $0x3,-0x4(%rbp)
jne    1213 <CmdBox+0x73>
mov    $0x3,%edi
mov    $0x0,%al
call   1040 <changeTexMode@plt>
cmpl   $0x5,-0x4(%rbp)
jne    1254 <CmdBox+0xb4>
mov    $0x0,%al
call   10b0 <getBracketParam@plt>
cltq
mov    %rax,-0x60(%rbp)
mov    $0x0,%al
call   1080 <getBraceParam@plt>
cltq
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x60(%rbp)
je     124b <CmdBox+0xab>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x6,-0x4(%rbp)
je     1268 <CmdBox+0xc8>
cmpl   $0x7,-0x4(%rbp)
jne    12af <CmdBox+0x10f>
mov    $0x0,%al
call   10b0 <getBracketParam@plt>
cltq
mov    %rax,-0x70(%rbp)
mov    $0x0,%al
call   10b0 <getBracketParam@plt>
cltq
mov    %rax,-0x78(%rbp)
cmpq   $0x0,-0x70(%rbp)
je     1296 <CmdBox+0xf6>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x78(%rbp)
je     12aa <CmdBox+0x10a>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
jmp    12af <CmdBox+0x10f>
mov    $0x4,%edi
lea    0xda2(%rip),%rsi
mov    $0x0,%al
call   1090 <diagnostics@plt>
mov    $0x0,%al
call   1060 <Convert@plt>
mov    $0x4,%edi
lea    0xda7(%rip),%rsi
mov    $0x0,%al
call   1090 <diagnostics@plt>
cmpl   $0x2,-0x4(%rbp)
jne    1300 <CmdBox+0x160>
xor    %edi,%edi
mov    $0x0,%al
call   10c0 <CmdEndParagraph@plt>
mov    $0x2,%edi
mov    $0x0,%al
call   1050 <CmdIndent@plt>
jmp    130a <CmdBox+0x16a>
mov    -0x54(%rbp),%edi
mov    $0x0,%al
call   1040 <changeTexMode@plt>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltq
lea    -0x50(%rbp),%rdx
imul   $0xa,%rax,%rax
add    %rax,%rdx
mov    $0x4,%edi
lea    0xd71(%rip),%rsi
mov    $0x0,%al
call   1090 <diagnostics@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdBox>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %edi,%ebx
mov    0xe97(%rip),%rax
mov    %rax,0x3e(%rsp)
movaps 0xe7d(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe61(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe45(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe29(%rip),%xmm0
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1070 <getTexMode@plt>
mov    %eax,%r15d
lea    -0x1(%rbx),%eax
cltq
lea    (%rax,%rax,4),%rax
lea    (%rsp,%rax,2),%r14
lea    0xe4d(%rip),%rsi
mov    $0x4,%edi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <diagnostics@plt>
mov    %ebx,%eax
and    $0xfffffffd,%eax
cmp    $0x1,%eax
jne    1220 <CmdBox+0x90>
mov    $0x3,%edi
xor    %eax,%eax
call   1040 <changeTexMode@plt>
jmp    1248 <CmdBox+0xb8>
cmp    $0x5,%ebx
jne    1248 <CmdBox+0xb8>
xor    %eax,%eax
call   10a0 <getBracketParam@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1080 <getBraceParam@plt>
mov    %eax,%r13d
test   %r12d,%r12d
je     1276 <CmdBox+0xe6>
movslq %r12d,%rdi
call   1030 <free@plt>
jmp    1276 <CmdBox+0xe6>
mov    %ebx,%eax
and    $0xfffffffe,%eax
cmp    $0x6,%eax
jne    127e <CmdBox+0xee>
xor    %eax,%eax
call   10a0 <getBracketParam@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   10a0 <getBracketParam@plt>
mov    %eax,%r13d
test   %ebp,%ebp
je     1271 <CmdBox+0xe1>
movslq %ebp,%rdi
call   1030 <free@plt>
test   %r13d,%r13d
je     127e <CmdBox+0xee>
movslq %r13d,%rdi
call   1030 <free@plt>
lea    0xdd8(%rip),%rsi
mov    $0x4,%edi
xor    %eax,%eax
call   1090 <diagnostics@plt>
xor    %eax,%eax
call   1060 <Convert@plt>
lea    0xddd(%rip),%rsi
mov    $0x4,%edi
xor    %eax,%eax
call   1090 <diagnostics@plt>
cmp    $0x2,%ebx
jne    12c7 <CmdBox+0x137>
xor    %edi,%edi
xor    %eax,%eax
call   10b0 <CmdEndParagraph@plt>
mov    $0x2,%edi
xor    %eax,%eax
call   1050 <CmdIndent@plt>
jmp    12d1 <CmdBox+0x141>
mov    %r15d,%edi
xor    %eax,%eax
call   1040 <changeTexMode@plt>
lea    0xdc2(%rip),%rsi
mov    $0x4,%edi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <diagnostics@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.CmdBox.BoxName = [7 x [10 x i8]] [[10 x i8] c"hbox\00\00\00\00\00\00", [10 x i8] c"vbox\00\00\00\00\00\00", [10 x i8] c"mbox\00\00\00\00\00\00", [10 x i8] c"fbox\00\00\00\00\00\00", [10 x i8] c"parbox\00\00\00\00", [10 x i8] c"makebox\00\00\00", [10 x i8] c"framebox\00\00"]
@.str = [23 x i8] c"Entering CmdBox() [%s]\00"
@.str.1 = [31 x i8] c"Entering Convert() from CmdBox\00"
@.str.2 = [30 x i8] c"Exiting Convert() from CmdBox\00"
@.str.3 = [21 x i8] c"Exited CmdBox() [%s]\00"
define void @CmdBox(i32 %0) {
%2 = alloca i32
%3 = alloca [7 x [10 x i8]]
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %2
%9 = bitcast [7 x [10 x i8]]* %3 to i8*
%10 = call i32 (...) @getTexMode()
store i32 %10, i32* %4
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [7 x [10 x i8]], [7 x [10 x i8]]* %3, i64 0, i64 %13
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 0
%16 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @diagnostics to i32 (i32, i8*, i8*, ...)*)(i32 4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 1
br i1 %18, label %22, label %19
19: ; preds = %1
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 3
br i1 %21, label %22, label %24
22: ; preds = %19, %1
%23 = call i32 (i32, ...) bitcast (i32 (...)* @changeTexMode to i32 (i32, ...)*)(i32 3)
br label %24
24: ; preds = %22, %19
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 5
br i1 %26, label %27, label %40
27: ; preds = %24
%28 = call i32 (...) @getBracketParam()
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i8*
store i8* %30, i8** %5
%31 = call i32 (...) @getBraceParam()
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i8*
store i8* %33, i8** %6
%34 = load i8*, i8** %5
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %38
36: ; preds = %27
%37 = load i8*, i8** %5
br label %38
38: ; preds = %36, %27
%39 = load i8*, i8** %6
br label %40
40: ; preds = %38, %24
%41 = load i32, i32* %2
%42 = icmp eq i32 %41, 6
br i1 %42, label %46, label %43
43: ; preds = %40
%44 = load i32, i32* %2
%45 = icmp eq i32 %44, 7
br i1 %45, label %46, label %63
46: ; preds = %43, %40
%47 = call i32 (...) @getBracketParam()
%48 = sext i32 %47 to i64
%49 = inttoptr i64 %48 to i8*
store i8* %49, i8** %7
%50 = call i32 (...) @getBracketParam()
%51 = sext i32 %50 to i64
%52 = inttoptr i64 %51 to i8*
store i8* %52, i8** %8
%53 = load i8*, i8** %7
%54 = icmp ne i8* %53, null
br i1 %54, label %55, label %57
55: ; preds = %46
%56 = load i8*, i8** %7
br label %57
57: ; preds = %55, %46
%58 = load i8*, i8** %8
%59 = icmp ne i8* %58, null
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = load i8*, i8** %8
br label %62
62: ; preds = %60, %57
br label %63
63: ; preds = %62, %43
%64 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @diagnostics to i32 (i32, i8*, ...)*)(i32 4, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%65 = call i32 (...) @Convert()
%66 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @diagnostics to i32 (i32, i8*, ...)*)(i32 4, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%67 = load i32, i32* %2
%68 = icmp eq i32 %67, 2
br i1 %68, label %69, label %72
69: ; preds = %63
%70 = call i32 (i32, ...) bitcast (i32 (...)* @CmdEndParagraph to i32 (i32, ...)*)(i32 0)
%71 = call i32 (i32, ...) bitcast (i32 (...)* @CmdIndent to i32 (i32, ...)*)(i32 2)
br label %75
72: ; preds = %63
%73 = load i32, i32* %4
%74 = call i32 (i32, ...) bitcast (i32 (...)* @changeTexMode to i32 (i32, ...)*)(i32 %73)
br label %75
75: ; preds = %72, %69
%76 = load i32, i32* %2
%77 = sub nsw i32 %76, 1
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [7 x [10 x i8]], [7 x [10 x i8]]* %3, i64 0, i64 %78
%80 = getelementptr inbounds [10 x i8], [10 x i8]* %79, i64 0, i64 0
%81 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @diagnostics to i32 (i32, i8*, i8*, ...)*)(i32 4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %80)
ret void
}

LLVM IR (-O2):
@__const.CmdBox.BoxName = [7 x [10 x i8]] [[10 x i8] c"hbox\00\00\00\00\00\00", [10 x i8] c"vbox\00\00\00\00\00\00", [10 x i8] c"mbox\00\00\00\00\00\00", [10 x i8] c"fbox\00\00\00\00\00\00", [10 x i8] c"parbox\00\00\00\00", [10 x i8] c"makebox\00\00\00", [10 x i8] c"framebox\00\00"]
@.str = [23 x i8] c"Entering CmdBox() [%s]\00"
@.str.1 = [31 x i8] c"Entering Convert() from CmdBox\00"
@.str.2 = [30 x i8] c"Exiting Convert() from CmdBox\00"
@.str.3 = [21 x i8] c"Exited CmdBox() [%s]\00"
define void @CmdBox(i32 %0) {
%2 = alloca [7 x [10 x i8]]
%3 = getelementptr inbounds [7 x [10 x i8]], [7 x [10 x i8]]* %2, i64 0, i64 0, i64 0
%4 = tail call i32 (...) @getTexMode()
%5 = add nsw i32 %0, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [7 x [10 x i8]], [7 x [10 x i8]]* %2, i64 0, i64 %6, i64 0
%8 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @diagnostics to i32 (i32, i8*, i8*, ...)*)(i32 4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = and i32 %0, -3
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 (i32, ...) bitcast (i32 (...)* @changeTexMode to i32 (i32, ...)*)(i32 3)
br label %22
13: ; preds = %1
%14 = icmp eq i32 %0, 5
br i1 %14, label %15, label %22
15: ; preds = %13
%16 = call i32 (...) @getBracketParam()
%17 = call i32 (...) @getBraceParam()
%18 = icmp eq i32 %16, 0
br i1 %18, label %34, label %19
19: ; preds = %15
%20 = sext i32 %16 to i64
%21 = inttoptr i64 %20 to i8*
br label %34
22: ; preds = %11, %13
%23 = and i32 %0, -2
%24 = icmp eq i32 %23, 6
br i1 %24, label %25, label %38
25: ; preds = %22
%26 = call i32 (...) @getBracketParam()
%27 = call i32 (...) @getBracketParam()
%28 = icmp eq i32 %26, 0
br i1 %28, label %32, label %29
29: ; preds = %25
%30 = sext i32 %26 to i64
%31 = inttoptr i64 %30 to i8*
br label %32
32: ; preds = %29, %25
%33 = icmp eq i32 %27, 0
br i1 %33, label %38, label %34
34: ; preds = %32, %19, %15
%35 = phi i32 [ %17, %15 ], [ %17, %19 ], [ %27, %32 ]
%36 = sext i32 %35 to i64
%37 = inttoptr i64 %36 to i8*
br label %38
38: ; preds = %34, %32, %22
%39 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @diagnostics to i32 (i32, i8*, ...)*)(i32 4, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%40 = call i32 (...) @Convert()
%41 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @diagnostics to i32 (i32, i8*, ...)*)(i32 4, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%42 = icmp eq i32 %0, 2
br i1 %42, label %43, label %46
43: ; preds = %38
%44 = call i32 (i32, ...) bitcast (i32 (...)* @CmdEndParagraph to i32 (i32, ...)*)(i32 0)
%45 = call i32 (i32, ...) bitcast (i32 (...)* @CmdIndent to i32 (i32, ...)*)(i32 2)
br label %48
46: ; preds = %38
%47 = call i32 (i32, ...) bitcast (i32 (...)* @changeTexMode to i32 (i32, ...)*)(i32 %4)
br label %48
48: ; preds = %46, %43
%49 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @diagnostics to i32 (i32, i8*, i8*, ...)*)(i32 4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %7)
ret void
}