#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 printHead(char *message, int nx) {
  int i = 0;
  int len = strlen(message) + 4;
  int indent = (nx - len) / 2;
  printf("\n\033[34m\\");
  for (i = 0; i < indent; i++)
    printf("*");
  printf(" %s ", message);
  for (i = indent + len; i < nx; i++)
    printf("*");
  printf("/\033[0m\n");
}


x86 assembly (clang, -O0):
<printHead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1193 <printHead+0x73>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116b <printHead+0x4b>
mov    -0x8(%rbp),%rsi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d6 <printHead+0xb6>
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ae <printHead+0x8e>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHead>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r12d
mov    %rdi,%r14
call   1050 <strlen@plt>
mov    %eax,%r15d
add    $0x4,%r15d
mov    %r12d,%ebp
sub    %r15d,%ebp
mov    %ebp,%ebx
shr    $0x1f,%ebx
add    %ebp,%ebx
sar    %ebx
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x2,%ebp
jl     118f <printHead+0x4f>
mov    %ebx,%ebp
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1180 <printHead+0x40>
lea    0xe72(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
add    %r15d,%ebx
cmp    %r12d,%ebx
jge    11c2 <printHead+0x82>
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    %r12d,%ebx
jl     11b0 <printHead+0x70>
lea    0xe44(%rip),%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\0A\1B[34m\\\00"
@.str.1 = [2 x i8] c"*\00"
@.str.2 = [5 x i8] c" %s \00"
@.str.3 = [7 x i8] c"/\1B[0m\0A\00"
define void @printHead(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %9, 4
store i32 %10, i32* %6
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = sub nsw i32 %11, %12
%14 = sdiv i32 %13, 2
store i32 %14, i32* %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %16
16: ; preds = %22, %2
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %16
25: ; preds = %16
%26 = load i8*, i8** %3
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = load i32, i32* %7
%29 = load i32, i32* %6
%30 = add nsw i32 %28, %29
store i32 %30, i32* %5
br label %31
31: ; preds = %37, %25
%32 = load i32, i32* %5
%33 = load i32, i32* %4
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %40
35: ; preds = %31
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %37
37: ; preds = %35
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
store i32 %39, i32* %5
br label %31
40: ; preds = %31
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0A\1B[34m\\\00"
@.str.2 = [5 x i8] c" %s \00"
@str = [6 x i8] c"/\1B[0m\00"
define void @printHead(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 4
%5 = sub nsw i32 %1, %4
%6 = sdiv i32 %5, 2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = icmp sgt i32 %5, 1
br i1 %8, label %9, label %14
9: ; preds = %2, %9
%10 = phi i32 [ %12, %9 ], [ 0, %2 ]
%11 = tail call i32 @putchar(i32 42)
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %12, %6
br i1 %13, label %14, label %9
14: ; preds = %9, %2
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%16 = add nsw i32 %6, %4
%17 = icmp slt i32 %16, %1
br i1 %17, label %18, label %23
18: ; preds = %14, %18
%19 = phi i32 [ %21, %18 ], [ %16, %14 ]
%20 = tail call i32 @putchar(i32 42)
%21 = add nsw i32 %19, 1
%22 = icmp slt i32 %21, %1
br i1 %22, label %18, label %23
23: ; preds = %18, %14
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}