void default_cpu_header(const char *cpu, int len) {
  charrep('-', len);
  printf("\n");
  if (strstr(cpu, "cluster"))
    printf("| %-*s |\n", len - 4, cpu);
  else if (strstr(cpu, "core"))
    printf("|      %-*s |\n", len - 9, cpu);
  else
    printf("|             %-*s |\n", len - 16, cpu);
  charrep('-', len);
  printf("\n");
}


x86 assembly (clang, -O0):
<default_cpu_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x2d,%edi
mov    $0x0,%al
call   1040 <charrep@plt>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     1193 <default_cpu_header+0x63>
mov    -0xc(%rbp),%esi
sub    $0x4,%esi
mov    -0x8(%rbp),%rdx
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e7 <default_cpu_header+0xb7>
mov    -0x8(%rbp),%rdi
lea    0xe74(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     11ca <default_cpu_header+0x9a>
mov    -0xc(%rbp),%esi
sub    $0x9,%esi
mov    -0x8(%rbp),%rdx
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e2 <default_cpu_header+0xb2>
mov    -0xc(%rbp),%esi
sub    $0x10,%esi
mov    -0x8(%rbp),%rdx
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e7 <default_cpu_header+0xb7>
mov    -0xc(%rbp),%esi
mov    $0x2d,%edi
mov    $0x0,%al
call   1040 <charrep@plt>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_cpu_header>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x2d,%edi
xor    %eax,%eax
call   1050 <charrep@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe9a(%rip),%rsi
mov    %r14,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     1181 <default_cpu_header+0x41>
lea    0xe8e(%rip),%rdi
mov    $0xfffffffc,%esi
jmp    11b2 <default_cpu_header+0x72>
lea    0xe8a(%rip),%rsi
mov    %r14,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
mov    $0xfffffff0,%eax
mov    $0xfffffff7,%esi
cmove  %eax,%esi
lea    0xe7f(%rip),%rax
lea    0xe69(%rip),%rdi
cmove  %rax,%rdi
add    %ebx,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2d,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <charrep@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [8 x i8] c"cluster\00"
@.str.2 = [10 x i8] c"| %-*s |\0A\00"
@.str.3 = [5 x i8] c"core\00"
@.str.4 = [15 x i8] c"| %-*s |\0A\00"
@.str.5 = [22 x i8] c"| %-*s |\0A\00"
define void @default_cpu_header(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @charrep to i32 (i32, i32, ...)*)(i32 45, i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = call i8* @strstr(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 4
%14 = load i8*, i8** %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %13, i8* %14)
br label %31
16: ; preds = %2
%17 = load i8*, i8** %3
%18 = call i8* @strstr(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = load i32, i32* %4
%22 = sub nsw i32 %21, 9
%23 = load i8*, i8** %3
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %22, i8* %23)
br label %30
25: ; preds = %16
%26 = load i32, i32* %4
%27 = sub nsw i32 %26, 16
%28 = load i8*, i8** %3
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %27, i8* %28)
br label %30
30: ; preds = %25, %20
br label %31
31: ; preds = %30, %11
%32 = load i32, i32* %4
%33 = call i32 (i32, i32, ...) bitcast (i32 (...)* @charrep to i32 (i32, i32, ...)*)(i32 45, i32 %32)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"cluster\00"
@.str.2 = [10 x i8] c"| %-*s |\0A\00"
@.str.3 = [5 x i8] c"core\00"
@.str.4 = [15 x i8] c"| %-*s |\0A\00"
@.str.5 = [22 x i8] c"| %-*s |\0A\00"
define void @default_cpu_header(i8* %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @charrep to i32 (i32, i32, ...)*)(i32 45, i32 %1)
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%9 = icmp eq i8* %8, null
%10 = select i1 %9, i32 -16, i32 -9
%11 = select i1 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0)
br label %12
12: ; preds = %7, %2
%13 = phi i32 [ -4, %2 ], [ %10, %7 ]
%14 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %2 ], [ %11, %7 ]
%15 = add nsw i32 %13, %1
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %14, i32 %15, i8* %0)
%17 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @charrep to i32 (i32, i32, ...)*)(i32 45, i32 %1)
%18 = tail call i32 @putchar(i32 10)
ret void
}