#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 display(char cr, int lines, int width) {
  int row, col;
  for (row = 1; row <= lines; row++) {
    for (col = 1; col <= width; col++)
      putchar(cr);
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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
jg     1179 <display+0x69>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1161 <display+0x51>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <display+0x2e>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <display+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
jle    115e <display+0x4e>
mov    %edx,%r15d
mov    %esi,%r14d
mov    $0x1,%r12d
movsbl %dil,%ebp
jmp    1147 <display+0x37>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r12),%eax
cmp    %r14d,%r12d
mov    %eax,%r12d
je     115e <display+0x4e>
test   %r15d,%r15d
jle    1130 <display+0x20>
mov    %r15d,%ebx
nop
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1150 <display+0x40>
jmp    1130 <display+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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