#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int strlen(char const *);
void test_print_header_terminal(FILE *output, const char *suite_name) {
  size_t width;
  fprintf(output, "-- %s ", suite_name);
  width = 78;
  if (strlen(suite_name) < 74) {
    size_t rest;
    rest = width - 3 - strlen(suite_name) - 1;
    for (size_t i = 0; i < rest; i++)
      fputc('-', output);
  }
  fputc('\n', output);
}


x86 assembly (clang, -O0):
<test_print_header_terminal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rsi
call   1050 <fprintf@plt>
movq   $0x4e,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4a,%eax
jge    11d1 <test_print_header_terminal+0xa1>
mov    -0x18(%rbp),%rax
sub    $0x3,%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    11cc <test_print_header_terminal+0x9c>
mov    -0x8(%rbp),%rsi
mov    $0x2d,%edi
call   1040 <fputc@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    119f <test_print_header_terminal+0x6f>
jmp    11d1 <test_print_header_terminal+0xa1>
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1040 <fputc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_print_header_terminal>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xebe(%rip),%rsi
mov    %r14,%rdx
call   1050 <fprintf@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
cmp    $0x49,%eax
jg     1193 <test_print_header_terminal+0x63>
mov    %r14,%rdi
call   1030 <strlen@plt>
cmp    $0x4a,%eax
je     1193 <test_print_header_terminal+0x63>
cltq
mov    $0x4a,%ecx
sub    %rax,%rcx
cmp    $0x2,%rcx
mov    $0x1,%ebx
cmovae %rcx,%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x2d,%edi
mov    %r15,%rsi
call   1040 <fputc@plt>
add    $0xffffffffffffffff,%rbx
jne    1180 <test_print_header_terminal+0x50>
mov    $0xa,%edi
mov    %r15,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fputc@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"-- %s \00"
define void @test_print_header_terminal(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i32* %0, i32** %3
store i8* %1, i8** %4
%8 = load i32*, i32** %3
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %9)
store i64 78, i64* %5
%11 = load i8*, i8** %4
%12 = call i32 @strlen(i8* %11)
%13 = icmp slt i32 %12, 74
br i1 %13, label %14, label %33
14: ; preds = %2
%15 = load i64, i64* %5
%16 = sub i64 %15, 3
%17 = load i8*, i8** %4
%18 = call i32 @strlen(i8* %17)
%19 = sext i32 %18 to i64
%20 = sub i64 %16, %19
%21 = sub i64 %20, 1
store i64 %21, i64* %6
store i64 0, i64* %7
br label %22
22: ; preds = %29, %14
%23 = load i64, i64* %7
%24 = load i64, i64* %6
%25 = icmp ult i64 %23, %24
br i1 %25, label %26, label %32
26: ; preds = %22
%27 = load i32*, i32** %3
%28 = call i32 @fputc(i8 signext 45, i32* %27)
br label %29
29: ; preds = %26
%30 = load i64, i64* %7
%31 = add i64 %30, 1
store i64 %31, i64* %7
br label %22
32: ; preds = %22
br label %33
33: ; preds = %32, %2
%34 = load i32*, i32** %3
%35 = call i32 @fputc(i8 signext 10, i32* %34)
ret void
}

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