#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*/ printw(char *);
void print_horizontal_line(int size) {
  int i;
  for (i = 0; i <= size; i++) {
    printw("+");
    if (i != size)
      printw("-----");
  }
  printw("\n");
}


x86 assembly (clang, -O0):
<print_horizontal_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1165 <print_horizontal_line+0x55>
lea    0xecb(%rip),%rdi
call   1030 <printw@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1152 <print_horizontal_line+0x42>
lea    0xeb5(%rip),%rdi
call   1030 <printw@plt>
jmp    1157 <print_horizontal_line+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_horizontal_line+0x12>
lea    0xe9c(%rip),%rdi
call   1030 <printw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_horizontal_line>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
js     114c <print_horizontal_line+0x3c>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xedb(%rip),%r14
lea    0xed6(%rip),%r15
jmp    1135 <print_horizontal_line+0x25>
xchg   %ax,%ax
add    $0xffffffff,%ebx
je     114c <print_horizontal_line+0x3c>
mov    %r14,%rdi
call   1030 <printw@plt>
cmp    $0x1,%ebx
je     1130 <print_horizontal_line+0x20>
mov    %r15,%rdi
call   1030 <printw@plt>
jmp    1130 <print_horizontal_line+0x20>
lea    0xeb5(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printw@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"+\00"
@.str.1 = [6 x i8] c"-----\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @print_horizontal_line(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp sle i32 %5, %6
br i1 %7, label %8, label %19
8: ; preds = %4
%9 = call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 @printw(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
br label %16
16: ; preds = %15
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
%20 = call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"+\00"
@.str.1 = [6 x i8] c"-----\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @print_horizontal_line(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %9
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %4, %0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @printw(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %3, %7
%10 = add nuw i32 %4, 1
%11 = icmp eq i32 %4, %0
br i1 %11, label %12, label %3
12: ; preds = %9, %1
%13 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}