#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 *, char const *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int strlen(char const *);
void cmdf__print_title(const char *title, char ruler) {
  size_t i = 0;
  fprintf(stdout, "\n%s\n", title);
  for (i = 0; i < strlen(title) + 1; i++)
    putc(ruler, stdout);
  putc('\n', stdout);
}


x86 assembly (clang, -O0):
<cmdf__print_title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea2(%rip),%rsi
call   1050 <fprintf@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
add    $0x1,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jae    11b6 <cmdf__print_title+0x86>
mov    -0x9(%rbp),%al
mov    0x2e45(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1040 <putc@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    116b <cmdf__print_title+0x3b>
mov    0x2e23(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <putc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdf__print_title>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r15
mov    0x2e9d(%rip),%r14
mov    (%r14),%edi
lea    0xeb3(%rip),%rsi
mov    %r15,%rdx
call   1050 <fprintf@plt>
mov    %r15,%rdi
call   1030 <strlen@plt>
cmp    $0xffffffff,%eax
je     1190 <cmdf__print_title+0x60>
xor    %ebx,%ebx
movsbl %bpl,%ebp
nopl   0x0(%rax,%rax,1)
mov    (%r14),%esi
mov    %ebp,%edi
call   1040 <putc@plt>
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
cmp    %rax,%rbx
jb     1170 <cmdf__print_title+0x40>
mov    (%r14),%esi
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"\0A%s\0A\00"
define void @cmdf__print_title(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i64
store i8* %0, i8** %3
store i8 %1, i8* %4
store i64 0, i64* %5
%6 = load i32, i32* @stdout
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %7)
store i64 0, i64* %5
br label %9
9: ; preds = %20, %2
%10 = load i64, i64* %5
%11 = load i8*, i8** %3
%12 = call i32 @strlen(i8* %11)
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = icmp ult i64 %10, %14
br i1 %15, label %16, label %23
16: ; preds = %9
%17 = load i8, i8* %4
%18 = load i32, i32* @stdout
%19 = call i32 @putc(i8 signext %17, i32 %18)
br label %20
20: ; preds = %16
%21 = load i64, i64* %5
%22 = add i64 %21, 1
store i64 %22, i64* %5
br label %9
23: ; preds = %9
%24 = load i32, i32* @stdout
%25 = call i32 @putc(i8 signext 10, i32 %24)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"\0A%s\0A\00"
define void @cmdf__print_title(i8* %0, i8 signext %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @strlen(i8* %0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %16, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %11, %7 ], [ 0, %2 ]
%9 = load i32, i32* @stdout
%10 = tail call i32 @putc(i8 signext %1, i32 %9)
%11 = add nuw i64 %8, 1
%12 = tail call i32 @strlen(i8* %0)
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = icmp ult i64 %11, %14
br i1 %15, label %7, label %16
16: ; preds = %7, %2
%17 = load i32, i32* @stdout
%18 = tail call i32 @putc(i8 signext 10, i32 %17)
ret void
}