#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 CurrentFontSize();
int /*<<< orphan*/ fprintRTF(char *);
int /*<<< orphan*/ free(char *);
char *getBraceParam();
char *getBracketParam();
int getStringDimension(char *);
void CmdRule(int code) {
  char *raise, *width, *height;
  int dim, n, i;
  raise = getBracketParam();
  width = getBraceParam();
  height = getBraceParam();
  dim = getStringDimension(width);
  n = dim / CurrentFontSize() / 5;
  for (i = 0; i < n; i++)
    fprintRTF("_");
  if (raise)
    free(raise);
  free(width);
  free(height);
}


x86 assembly (clang, -O0):
<CmdRule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <getBracketParam@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getBraceParam@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getBraceParam@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <getStringDimension@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    $0x0,%al
call   1050 <CurrentFontSize@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
cltd
idiv   %ecx
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    11e5 <CmdRule+0x85>
lea    0xe2e(%rip),%rdi
call   1070 <fprintRTF@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11bf <CmdRule+0x5f>
cmpq   $0x0,-0x10(%rbp)
je     11f9 <CmdRule+0x99>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdRule>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
xor    %eax,%eax
call   1060 <getBracketParam@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <getBraceParam@plt>
mov    %rax,%r12
xor    %eax,%eax
call   1040 <getBraceParam@plt>
mov    %rax,%r15
mov    %r12,%rdi
call   1080 <getStringDimension@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <CurrentFontSize@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
cmp    $0x5,%eax
jl     11dd <CmdRule+0x7d>
cltq
imul   $0x66666667,%rax,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x21,%rbx
add    %eax,%ebx
lea    0xe3f(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1070 <fprintRTF@plt>
add    $0xffffffff,%ebx
jne    11d0 <CmdRule+0x70>
test   %r14,%r14
je     11ea <CmdRule+0x8a>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"_\00"
define void @CmdRule(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %2
%9 = call i8* (...) @getBracketParam()
store i8* %9, i8** %3
%10 = call i8* (...) @getBraceParam()
store i8* %10, i8** %4
%11 = call i8* (...) @getBraceParam()
store i8* %11, i8** %5
%12 = load i8*, i8** %4
%13 = call i32 @getStringDimension(i8* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i32 (...) @CurrentFontSize()
%16 = sdiv i32 %14, %15
%17 = sdiv i32 %16, 5
store i32 %17, i32* %7
store i32 0, i32* %8
br label %18
18: ; preds = %24, %1
%19 = load i32, i32* %8
%20 = load i32, i32* %7
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = call i32 @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %24
24: ; preds = %22
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %18
27: ; preds = %18
%28 = load i8*, i8** %3
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = load i8*, i8** %3
%32 = call i32 @free(i8* %31)
br label %33
33: ; preds = %30, %27
%34 = load i8*, i8** %4
%35 = call i32 @free(i8* %34)
%36 = load i8*, i8** %5
%37 = call i32 @free(i8* %36)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"_\00"
define void @CmdRule(i32 %0) {
%2 = tail call i8* (...) @getBracketParam()
%3 = tail call i8* (...) @getBraceParam()
%4 = tail call i8* (...) @getBraceParam()
%5 = tail call i32 @getStringDimension(i8* %3)
%6 = tail call i32 (...) @CurrentFontSize()
%7 = sdiv i32 %5, %6
%8 = sdiv i32 %7, 5
%9 = icmp sgt i32 %7, 4
br i1 %9, label %10, label %15
10: ; preds = %1, %10
%11 = phi i32 [ %13, %10 ], [ 0, %1 ]
%12 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = add nuw nsw i32 %11, 1
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %10
15: ; preds = %10, %1
%16 = icmp eq i8* %2, null
br i1 %16, label %19, label %17
17: ; preds = %15
%18 = tail call i32 @free(i8* %2)
br label %19
19: ; preds = %17, %15
%20 = tail call i32 @free(i8* %3)
%21 = tail call i32 @free(i8* %4)
ret void
}