#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*/ putchar(char);
void chline(char ch, int i, int j) {
  for (int k = 1; k < i; k++)
    putchar(' ');
  while (i++ <= j)
    putchar(ch);
}


x86 assembly (clang, -O0):
<chline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114f <chline+0x3f>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <chline+0x1b>
jmp    1154 <chline+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    -0xc(%rbp),%eax
jg     1176 <chline+0x66>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
jmp    1154 <chline+0x44>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chline>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r15d
mov    %edi,%r14d
cmp    $0x2,%esi
jl     113f <chline+0x2f>
lea    -0x1(%r15),%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1130 <chline+0x20>
cmp    %ebx,%r15d
jg     115c <chline+0x4c>
sub    %r15d,%ebx
add    $0x1,%ebx
movsbl %r14b,%ebp
xchg   %ax,%ax
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1150 <chline+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @chline(i8 signext %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 1
br i1 %4, label %7, label %5
5: ; preds = %7, %3
%6 = icmp sgt i32 %1, %2
br i1 %6, label %17, label %12
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ 1, %3 ]
%9 = tail call i32 @putchar(i8 signext 32)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %5, label %7
12: ; preds = %5, %12
%13 = phi i32 [ %14, %12 ], [ %1, %5 ]
%14 = add i32 %13, 1
%15 = tail call i32 @putchar(i8 signext %0)
%16 = icmp eq i32 %13, %2
br i1 %16, label %17, label %12
17: ; preds = %12, %5
ret void
}