#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*/ print_ch(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
void print_box_letters(char box_line[7][512], int var_strlen_max[],
                       int all_bold) {
  int i, j;
  print_ch("\e(0\x78\e(B");
  for (i = 0; i < 7; i++) {
    if (all_bold || i == 0) {
      printf("\x1b[36m"
             "\x1b[1m"
             "%s"
             "\x1b[0m",
             box_line[i]);
    } else {
      if (i == 3) {
        if (strcmp(box_line[i], " online ") == 0) {
          printf("\x1b[32m"
                 "\x1b[1m"
                 "%s"
                 "\x1b[0m",
                 box_line[i]);
        } else {
          printf("\x1b[31m"
                 "\x1b[1m"
                 "%s"
                 "\x1b[0m",
                 box_line[i]);
        }
      } else {
        printf("%s", box_line[i]);
      }
    }
    for (j = 0; j < var_strlen_max[i] - strlen(box_line[i]); j++) {
      printf(" ");
    }
    print_ch("\e(0\x78\e(B");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_box_letters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xea6(%rip),%rdi
call   1060 <print_ch@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x7,-0x18(%rbp)
jge    12b2 <print_box_letters+0x172>
cmpl   $0x0,-0x14(%rbp)
jne    1184 <print_box_letters+0x44>
cmpl   $0x0,-0x18(%rbp)
jne    11a6 <print_box_letters+0x66>
mov    -0x8(%rbp),%rsi
movslq -0x18(%rbp),%rax
shl    $0x9,%rax
add    %rax,%rsi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    123b <print_box_letters+0xfb>
cmpl   $0x3,-0x18(%rbp)
jne    1219 <print_box_letters+0xd9>
mov    -0x8(%rbp),%rdi
movslq -0x18(%rbp),%rax
shl    $0x9,%rax
add    %rax,%rdi
lea    0xe52(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11f7 <print_box_letters+0xb7>
mov    -0x8(%rbp),%rsi
movslq -0x18(%rbp),%rax
shl    $0x9,%rax
add    %rax,%rsi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1214 <print_box_letters+0xd4>
mov    -0x8(%rbp),%rsi
movslq -0x18(%rbp),%rax
shl    $0x9,%rax
add    %rax,%rsi
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1236 <print_box_letters+0xf6>
mov    -0x8(%rbp),%rsi
movslq -0x18(%rbp),%rax
shl    $0x9,%rax
add    %rax,%rsi
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    123b <print_box_letters+0xfb>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x18(%rbp),%rax
shl    $0x9,%rax
add    %rax,%rdi
call   1030 <strlen@plt>
mov    -0x24(%rbp),%ecx
mov    %eax,%edx
mov    -0x20(%rbp),%eax
sub    %edx,%ecx
cmp    %ecx,%eax
jge    1298 <print_box_letters+0x158>
lea    0xd9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1242 <print_box_letters+0x102>
lea    0xd61(%rip),%rdi
call   1060 <print_ch@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1166 <print_box_letters+0x26>
lea    0xd8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_box_letters>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,0xc(%rsp)
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xe91(%rip),%rdi
call   1070 <print_ch@plt>
lea    0x600(%r14),%rbp
xor    %r15d,%r15d
mov    %rbp,0x10(%rsp)
jmp    11af <print_box_letters+0x5f>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xe69(%rip),%rdi
call   1070 <print_ch@plt>
add    $0x1,%r15
cmp    $0x7,%r15
mov    0x10(%rsp),%rbp
je     1276 <print_box_letters+0x126>
cmpl   $0x0,0xc(%rsp)
jne    11e0 <print_box_letters+0x90>
test   %r15,%r15
je     11e0 <print_box_letters+0x90>
cmp    $0x3,%r15
jne    1200 <print_box_letters+0xb0>
mov    %rbp,%rdi
lea    0xe4d(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1213 <print_box_letters+0xc3>
lea    0xe55(%rip),%rdi
jmp    121a <print_box_letters+0xca>
xchg   %ax,%ax
mov    %r15,%rsi
shl    $0x9,%rsi
add    %r14,%rsi
lea    0xe17(%rip),%rdi
jmp    121d <print_box_letters+0xcd>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rsi
shl    $0x9,%rsi
add    %r14,%rsi
lea    0xe30(%rip),%rdi
jmp    121d <print_box_letters+0xcd>
lea    0xe07(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%r13
shl    $0x9,%r13
add    %r14,%r13
mov    (%rbx,%r15,4),%ebp
mov    %r13,%rdi
call   1040 <strlen@plt>
cmp    %eax,%ebp
jle    1190 <print_box_letters+0x40>
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
mov    (%rbx,%r15,4),%ebp
mov    %r13,%rdi
call   1040 <strlen@plt>
sub    %eax,%ebp
cmp    %ebp,%r12d
jl     1250 <print_box_letters+0x100>
jmp    1190 <print_box_letters+0x40>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B(0x\1B(B\00"
@.str.1 = [16 x i8] c"\1B[36m\1B[1m%s\1B[0m\00"
@.str.2 = [9 x i8] c" online \00"
@.str.3 = [16 x i8] c"\1B[32m\1B[1m%s\1B[0m\00"
@.str.4 = [16 x i8] c"\1B[31m\1B[1m%s\1B[0m\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [2 x i8] c" \00"
@.str.7 = [2 x i8] c"\0A\00"
define void @print_box_letters([512 x i8]* %0, i32* %1, i32 %2) {
%4 = alloca [512 x i8]*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store [512 x i8]* %0, [512 x i8]** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%9 = call i32 @print_ch(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %10
10: ; preds = %83, %3
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 7
br i1 %12, label %13, label %86
13: ; preds = %10
%14 = load i32, i32* %6
%15 = icmp ne i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %7
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %16, %13
%20 = load [512 x i8]*, [512 x i8]** %4
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [512 x i8], [512 x i8]* %20, i64 %22
%24 = getelementptr inbounds [512 x i8], [512 x i8]* %23, i64 0, i64 0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %24)
br label %60
26: ; preds = %16
%27 = load i32, i32* %7
%28 = icmp eq i32 %27, 3
br i1 %28, label %29, label %52
29: ; preds = %26
%30 = load [512 x i8]*, [512 x i8]** %4
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [512 x i8], [512 x i8]* %30, i64 %32
%34 = getelementptr inbounds [512 x i8], [512 x i8]* %33, i64 0, i64 0
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %44
37: ; preds = %29
%38 = load [512 x i8]*, [512 x i8]** %4
%39 = load i32, i32* %7
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [512 x i8], [512 x i8]* %38, i64 %40
%42 = getelementptr inbounds [512 x i8], [512 x i8]* %41, i64 0, i64 0
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %42)
br label %51
44: ; preds = %29
%45 = load [512 x i8]*, [512 x i8]** %4
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [512 x i8], [512 x i8]* %45, i64 %47
%49 = getelementptr inbounds [512 x i8], [512 x i8]* %48, i64 0, i64 0
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %49)
br label %51
51: ; preds = %44, %37
br label %59
52: ; preds = %26
%53 = load [512 x i8]*, [512 x i8]** %4
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [512 x i8], [512 x i8]* %53, i64 %55
%57 = getelementptr inbounds [512 x i8], [512 x i8]* %56, i64 0, i64 0
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %57)
br label %59
59: ; preds = %52, %51
br label %60
60: ; preds = %59, %19
store i32 0, i32* %8
br label %61
61: ; preds = %78, %60
%62 = load i32, i32* %8
%63 = load i32*, i32** %5
%64 = load i32, i32* %7
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i32, i32* %63, i64 %65
%67 = load i32, i32* %66
%68 = load [512 x i8]*, [512 x i8]** %4
%69 = load i32, i32* %7
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [512 x i8], [512 x i8]* %68, i64 %70
%72 = getelementptr inbounds [512 x i8], [512 x i8]* %71, i64 0, i64 0
%73 = call i32 @strlen(i8* %72)
%74 = sub nsw i32 %67, %73
%75 = icmp slt i32 %62, %74
br i1 %75, label %76, label %81
76: ; preds = %61
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %78
78: ; preds = %76
%79 = load i32, i32* %8
%80 = add nsw i32 %79, 1
store i32 %80, i32* %8
br label %61
81: ; preds = %61
%82 = call i32 @print_ch(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %83
83: ; preds = %81
%84 = load i32, i32* %7
%85 = add nsw i32 %84, 1
store i32 %85, i32* %7
br label %10
86: ; preds = %10
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B(0x\1B(B\00"
@.str.1 = [16 x i8] c"\1B[36m\1B[1m%s\1B[0m\00"
@.str.2 = [9 x i8] c" online \00"
@.str.3 = [16 x i8] c"\1B[32m\1B[1m%s\1B[0m\00"
@.str.4 = [16 x i8] c"\1B[31m\1B[1m%s\1B[0m\00"
@.str.5 = [3 x i8] c"%s\00"
define void @print_box_letters([512 x i8]* %0, i32* nocapture %1, i32 %2) {
%4 = tail call i32 @print_ch(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %2, 0
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %0, i64 3, i64 0
br label %7
7: ; preds = %3, %40
%8 = phi i64 [ 0, %3 ], [ %42, %40 ]
%9 = icmp eq i64 %8, 0
%10 = select i1 %5, i1 true, i1 %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %0, i64 %8, i64 0
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %26
14: ; preds = %7
%15 = icmp eq i64 %8, 3
br i1 %15, label %16, label %23
16: ; preds = %14
%17 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %6)
br label %26
21: ; preds = %16
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %6)
br label %26
23: ; preds = %14
%24 = getelementptr inbounds [512 x i8], [512 x i8]* %0, i64 %8, i64 0
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %24)
br label %26
26: ; preds = %23, %21, %19, %11
%27 = getelementptr inbounds i32, i32* %1, i64 %8
%28 = getelementptr inbounds [512 x i8], [512 x i8]* %0, i64 %8, i64 0
%29 = load i32, i32* %27
%30 = tail call i32 @strlen(i8* %28)
%31 = icmp sgt i32 %29, %30
br i1 %31, label %32, label %40
32: ; preds = %26, %32
%33 = phi i32 [ %35, %32 ], [ 0, %26 ]
%34 = tail call i32 @putchar(i32 32)
%35 = add nuw nsw i32 %33, 1
%36 = load i32, i32* %27
%37 = tail call i32 @strlen(i8* %28)
%38 = sub nsw i32 %36, %37
%39 = icmp slt i32 %35, %38
br i1 %39, label %32, label %40
40: ; preds = %32, %26
%41 = tail call i32 @print_ch(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%42 = add nuw nsw i64 %8, 1
%43 = icmp eq i64 %42, 7
br i1 %43, label %44, label %7
44: ; preds = %40
%45 = tail call i32 @putchar(i32 10)
ret void
}