#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 func(char ch, int col, int row) {
  for (int i = 0; i < row; i++) {
    for (int j = 0; j < col; j++)
      putchar(ch);
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1179 <func+0x69>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1161 <func+0x51>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <func+0x2e>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <func+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edx,%edx
jle    115e <func+0x4e>
mov    %edx,%r14d
mov    %esi,%r15d
xor    %r12d,%r12d
movsbl %dil,%ebx
jmp    1143 <func+0x33>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
cmp    %r14d,%r12d
je     115e <func+0x4e>
mov    %r15d,%ebp
test   %r15d,%r15d
jle    1130 <func+0x20>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1150 <func+0x40>
jmp    1130 <func+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @func(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 0, i32* %7
br label %9
9: ; preds = %26, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %29
13: ; preds = %9
store i32 0, i32* %8
br label %14
14: ; preds = %21, %13
%15 = load i32, i32* %8
%16 = load i32, i32* %5
%17 = icmp slt 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 @func(i8 signext %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = icmp sgt i32 %1, 0
br label %7
7: ; preds = %5, %10
%8 = phi i32 [ 0, %5 ], [ %12, %10 ]
br i1 %6, label %14, label %10
9: ; preds = %10, %3
ret void
10: ; preds = %14, %7
%11 = tail call i32 @putchar(i8 signext 10)
%12 = add nuw nsw i32 %8, 1
%13 = icmp eq i32 %12, %2
br i1 %13, label %9, label %7
14: ; preds = %7, %14
%15 = phi i32 [ %17, %14 ], [ 0, %7 ]
%16 = tail call i32 @putchar(i8 signext %0)
%17 = add nuw nsw i32 %15, 1
%18 = icmp eq i32 %17, %1
br i1 %18, label %10, label %14
}