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

/* Variables and functions */
int /*<<< orphan*/ addch(char);
int /*<<< orphan*/ rep(char, int);
void h_line(char v_edge, char h_edge, int lspace) {
  rep(' ', lspace);
  for (int8_t i = 0; i < 4; ++i) {
    addch(v_edge);
    rep(h_edge, 8);
  }
  addch(v_edge);
  addch('\n');
}


x86 assembly (clang, -O0):
<h_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x20,%edi
call   1030 <rep@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    117a <h_line+0x5a>
movsbl -0x1(%rbp),%edi
call   1040 <addch@plt>
mov    $0x8,%esi
movsbl -0x2(%rbp),%edi
call   1030 <rep@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114b <h_line+0x2b>
movsbl -0x1(%rbp),%edi
call   1040 <addch@plt>
mov    $0xa,%edi
call   1040 <addch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_line>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x20,%edi
mov    %edx,%esi
call   1030 <rep@plt>
mov    %ebx,%edi
call   1040 <addch@plt>
mov    %ebp,%edi
mov    $0x8,%esi
call   1030 <rep@plt>
mov    %ebx,%edi
call   1040 <addch@plt>
mov    %ebp,%edi
mov    $0x8,%esi
call   1030 <rep@plt>
mov    %ebx,%edi
call   1040 <addch@plt>
mov    %ebp,%edi
mov    $0x8,%esi
call   1030 <rep@plt>
mov    %ebx,%edi
call   1040 <addch@plt>
mov    %ebp,%edi
mov    $0x8,%esi
call   1030 <rep@plt>
mov    %ebx,%edi
call   1040 <addch@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <addch@plt>

LLVM IR (-O0):
define void @h_line(i8 signext %0, i8 signext %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @rep(i8 signext 32, i32 %8)
store i32 0, i32* %7
br label %10
10: ; preds = %18, %3
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 4
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = load i8, i8* %4
%15 = call i32 @addch(i8 signext %14)
%16 = load i8, i8* %5
%17 = call i32 @rep(i8 signext %16, i32 8)
br label %18
18: ; preds = %13
%19 = load i32, i32* %7
%20 = add nsw i32 %19, 1
store i32 %20, i32* %7
br label %10
21: ; preds = %10
%22 = load i8, i8* %4
%23 = call i32 @addch(i8 signext %22)
%24 = call i32 @addch(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @h_line(i8 signext %0, i8 signext %1, i32 %2) {
%4 = tail call i32 @rep(i8 signext 32, i32 %2)
%5 = tail call i32 @addch(i8 signext %0)
%6 = tail call i32 @rep(i8 signext %1, i32 8)
%7 = tail call i32 @addch(i8 signext %0)
%8 = tail call i32 @rep(i8 signext %1, i32 8)
%9 = tail call i32 @addch(i8 signext %0)
%10 = tail call i32 @rep(i8 signext %1, i32 8)
%11 = tail call i32 @addch(i8 signext %0)
%12 = tail call i32 @rep(i8 signext %1, i32 8)
%13 = tail call i32 @addch(i8 signext %0)
%14 = tail call i32 @addch(i8 signext 10)
ret void
}