#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*/ assert(int);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ putchar(char);
int strlen(char const *);
void test_title(const char *title) {
  int len = strlen(title);
  int pad = (60 - len) / 2 - 1;
  int mod = (60 - len) % 2;
  int i;
  assert(pad >= 1);
  putchar('\n');
  for (i = 0; i < pad; i++)
    putchar('=');
  printf(" %s ", title);
  for (i = 0; i < pad + mod; i++)
    putchar('=');
  putchar('\n');
}


x86 assembly (clang, -O0):
<test_title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    $0x3c,%eax
sub    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    $0x3c,%eax
sub    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
cmpl   $0x1,-0x10(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11c7 <test_title+0x87>
mov    $0x3d,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11a3 <test_title+0x63>
mov    -0x8(%rbp),%rsi
lea    0xe2e(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    1207 <test_title+0xc7>
mov    $0x3d,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11de <test_title+0x9e>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_title>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%r15d
mov    $0x3c,%r12d
sub    %eax,%r12d
mov    %r12d,%eax
shr    $0x1f,%eax
add    %r12d,%eax
mov    %eax,%ebx
sar    %ebx
add    $0xffffffff,%ebx
and    $0xfffffffe,%eax
sub    %eax,%r12d
xor    %edi,%edi
cmp    $0x39,%r15d
setl   %dil
call   1060 <assert@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x38,%r15d
jg     11af <test_title+0x6f>
cmp    $0x2,%ebx
mov    $0x1,%ebp
cmovge %ebx,%ebp
nopl   0x0(%rax)
mov    $0x3d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11a0 <test_title+0x60>
lea    0xe4a(%rip),%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
add    %r12d,%ebx
test   %ebx,%ebx
jle    11df <test_title+0x9f>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x3d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11d0 <test_title+0x90>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c" %s \00"
define void @test_title(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sub nsw i32 60, %2
%4 = sdiv i32 %3, 2
%5 = add nsw i32 %4, -1
%6 = srem i32 %3, 2
%7 = icmp slt i32 %2, 57
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @putchar(i8 signext 10)
br i1 %7, label %11, label %18
11: ; preds = %1
%12 = call i32 @llvm.smax.i32(i32 %5, i32 1)
br label %13
13: ; preds = %11, %13
%14 = phi i32 [ %16, %13 ], [ 0, %11 ]
%15 = tail call i32 @putchar(i8 signext 61)
%16 = add nuw nsw i32 %14, 1
%17 = icmp eq i32 %16, %12
br i1 %17, label %18, label %13
18: ; preds = %13, %1
%19 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%20 = add i32 %5, %6
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %18, %22
%23 = phi i32 [ %25, %22 ], [ 0, %18 ]
%24 = tail call i32 @putchar(i8 signext 61)
%25 = add nuw nsw i32 %23, 1
%26 = icmp eq i32 %25, %20
br i1 %26, label %27, label %22
27: ; preds = %22, %18
%28 = tail call i32 @putchar(i8 signext 10)
ret void
}