#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*/ printf(char *, ...);
int strlen(char *);
void printTitle(char *title) {
  printf("   |                                                                 "
         "       |\n"
         "   "
         "====================================================================="
         "=====\n"
         "   | :::: %s ",
         title);
  for (int i = 0; i < 64 - strlen(title); i++)
    printf(":");
  printf(" |\n"
         "   "
         "====================================================================="
         "=====\n"
         "   |                                                                 "
         "       |\n");
}


x86 assembly (clang, -O0):
<printTitle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%eax
mov    $0x40,%ecx
sub    %edx,%ecx
cmp    %ecx,%eax
jge    1184 <printTitle+0x64>
lea    0xf3b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <printTitle+0x25>
lea    0xf21(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTitle>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeb3(%rip),%rdi
xor    %ebp,%ebp
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmp    $0x3f,%eax
jg     1190 <printTitle+0x50>
cs nopw 0x0(%rax,%rax,1)
mov    $0x3a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    $0x40,%ecx
sub    %eax,%ecx
cmp    %ecx,%ebp
jl     1170 <printTitle+0x30>
lea    0xf13(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [170 x i8] c" | |\0A ==========================================================================\0A | :::: %s \00"
@.str.1 = [2 x i8] c":\00"
@.str.2 = [160 x i8] c" |\0A ==========================================================================\0A | |\0A\00"
define void @printTitle(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i8* %4)
store i32 0, i32* %3
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %3
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
%10 = sub nsw i32 64, %9
%11 = icmp slt i32 %7, %10
br i1 %11, label %12, label %17
12: ; preds = %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %6
17: ; preds = %6
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [170 x i8] c" | |\0A ==========================================================================\0A | :::: %s \00"
@str = [159 x i8] c" |\0A ==========================================================================\0A | |\00"
define void @printTitle(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp slt i32 %3, 64
br i1 %4, label %7, label %5
5: ; preds = %7, %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([159 x i8], [159 x i8]* @str, i64 0, i64 0))
ret void
7: ; preds = %1, %7
%8 = phi i32 [ %10, %7 ], [ 0, %1 ]
%9 = tail call i32 @putchar(i32 58)
%10 = add nuw nsw i32 %8, 1
%11 = tail call i32 @strlen(i8* %0)
%12 = sub nsw i32 64, %11
%13 = icmp slt i32 %10, %12
br i1 %13, label %7, label %5
}