#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*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void rib_util_printseparator(bool isBold, size_t len) {
  putc('\n', stdout);
  for (size_t i = 0; i < len + 1; i++)
    putc(isBold ? '=' : '-', stdout);
  putc('\n', stdout);
}


x86 assembly (clang, -O0):
<rib_util_printseparator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jae    1184 <rib_util_printseparator+0x74>
mov    -0x4(%rbp),%edx
mov    $0x2d,%eax
mov    $0x3d,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    0x2e77(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1030 <putc@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113a <rib_util_printseparator+0x2a>
mov    0x2e55(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rib_util_printseparator>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2ec0(%rip),%r14
mov    (%r14),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
cmp    $0xffffffffffffffff,%rbx
je     1160 <rib_util_printseparator+0x50>
test   %ebp,%ebp
setne  %al
shl    $0x4,%al
or     $0x2d,%al
add    $0x1,%rbx
movzbl %al,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14),%esi
mov    %ebp,%edi
call   1030 <putc@plt>
add    $0xffffffffffffffff,%rbx
jne    1150 <rib_util_printseparator+0x40>
mov    (%r14),%esi
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @rib_util_printseparator(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* @stdout
%7 = call i32 @putc(i8 signext 10, i32 %6)
store i64 0, i64* %5
br label %8
8: ; preds = %21, %2
%9 = load i64, i64* %5
%10 = load i64, i64* %4
%11 = add i64 %10, 1
%12 = icmp ult i64 %9, %11
br i1 %12, label %13, label %24
13: ; preds = %8
%14 = load i32, i32* %3
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 61, i32 45
%18 = trunc i32 %17 to i8
%19 = load i32, i32* @stdout
%20 = call i32 @putc(i8 signext %18, i32 %19)
br label %21
21: ; preds = %13
%22 = load i64, i64* %5
%23 = add i64 %22, 1
store i64 %23, i64* %5
br label %8
24: ; preds = %8
%25 = load i32, i32* @stdout
%26 = call i32 @putc(i8 signext 10, i32 %25)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @rib_util_printseparator(i32 %0, i64 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @putc(i8 signext 10, i32 %3)
%5 = icmp eq i64 %1, -1
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = icmp eq i32 %0, 0
%8 = select i1 %7, i8 45, i8 61
br label %12
9: ; preds = %12, %2
%10 = load i32, i32* @stdout
%11 = tail call i32 @putc(i8 signext 10, i32 %10)
ret void
12: ; preds = %6, %12
%13 = phi i64 [ 0, %6 ], [ %16, %12 ]
%14 = load i32, i32* @stdout
%15 = tail call i32 @putc(i8 signext %8, i32 %14)
%16 = add nuw i64 %13, 1
%17 = icmp eq i64 %13, %1
br i1 %17, label %9, label %12
}