#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 uint8_t;

/* Variables and functions */
int get_bump(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void draw_horiz_bar(void) {
  uint8_t i;
  for (i = 0; i <= get_bump(3); ++i)
    putchar(' ');
  putchar('+');
  for (i = 0; i < 3; ++i)
    printf("-+");
  putchar('\n');
}


x86 assembly (clang, -O0):
<draw_horiz_bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x3,%edi
call   1050 <get_bump@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
jg     1174 <draw_horiz_bar+0x44>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <draw_horiz_bar+0xf>
mov    $0x2b,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    11a9 <draw_horiz_bar+0x79>
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <draw_horiz_bar+0x55>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_horiz_bar>:
push   %rbx
mov    $0x3,%edi
call   1050 <get_bump@plt>
test   %eax,%eax
js     116b <draw_horiz_bar+0x3b>
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x3,%edi
call   1050 <get_bump@plt>
add    $0x1,%ebx
cmp    %eax,%ebx
jl     1150 <draw_horiz_bar+0x20>
mov    $0x2b,%edi
call   1030 <putchar@plt>
lea    0xe84(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

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