#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int const strlen(char const *);
void print_headline(const char *text) {
  const int total_length = 80;
  const int dbl_bar_len = total_length - strlen(text);
  const int bar_len = dbl_bar_len / 2;
  for (int i = 0; i < bar_len; i++) {
    fprintf(stderr, "=");
  }
  fprintf(stderr, " %s ", text);
  for (int i = 0; i < dbl_bar_len - bar_len; i++) {
    fprintf(stderr, "=");
  }
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<print_headline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x50,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x50,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    118e <print_headline+0x6e>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115d <print_headline+0x3d>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe60(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    11e6 <print_headline+0xc6>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
lea    0xe2f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b0 <print_headline+0x90>
mov    0x2df3(%rip),%rax
mov    (%rax),%edi
lea    0xe11(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_headline>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,(%rsp)
call   1030 <strlen@plt>
mov    %eax,%r15d
mov    $0x50,%r13d
sub    %eax,%r13d
mov    %r13d,%r12d
shr    $0x1f,%r12d
add    %r13d,%r12d
sar    %r12d
cmp    $0x4e,%eax
jg     1182 <print_headline+0x62>
cmp    $0x2,%r12d
mov    $0x1,%ebp
cmovge %r12d,%ebp
mov    0x2e7a(%rip),%r14
lea    0xe93(%rip),%rbx
nopl   (%rax)
mov    (%r14),%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1170 <print_headline+0x50>
mov    0x2e57(%rip),%r14
mov    (%r14),%edi
lea    0xe6f(%rip),%rsi
mov    (%rsp),%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
sub    %r12d,%r13d
test   %r13d,%r13d
jle    11d1 <print_headline+0xb1>
lea    (%r15,%r12,1),%ebp
add    $0xffffffb0,%ebp
lea    0xe4c(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14),%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
inc    %ebp
jne    11c0 <print_headline+0xa0>
mov    (%r14),%edi
lea    0xe2c(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fprintf@plt>

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

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