#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*/ printf(char *, ...);
void printfStr(char *outStr, int length, int numTimes) {
  int i;
  int j;
  for (i = 0; i < numTimes; i++) {
    for (j = 0; j < length; j++) {
      printf("%c", *(outStr + j));
    }
    printf("\n");
  }
  printf("\n\n");
}


x86 assembly (clang, -O0):
<printfStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    118c <printfStr+0x7c>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1170 <printfStr+0x60>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113c <printfStr+0x2c>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <printfStr+0x19>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printfStr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1176 <printfStr+0x56>
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%r13
mov    %esi,%ebp
xor    %r12d,%r12d
jmp    1153 <printfStr+0x33>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
cmp    %r14d,%r12d
je     1176 <printfStr+0x56>
test   %r15d,%r15d
jle    1140 <printfStr+0x20>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl 0x0(%r13,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1160 <printfStr+0x40>
jmp    1140 <printfStr+0x20>
lea    0xe83(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [3 x i8] c"\0A\0A\00"
define void @printfStr(i8* %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 = %31, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %34
13: ; preds = %9
store i32 0, i32* %8
br label %14
14: ; preds = %26, %13
%15 = load i32, i32* %8
%16 = load i32, i32* %5
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %29
18: ; preds = %14
%19 = load i8*, i8** %4
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %18
%27 = load i32, i32* %8
%28 = add nsw i32 %27, 1
store i32 %28, i32* %8
br label %14
29: ; preds = %14
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %29
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
br label %9
34: ; preds = %9
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [2 x i8] c"\0A\00"
define void @printfStr(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %22
5: ; preds = %3
%6 = icmp sgt i32 %1, 0
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %5, %18
%9 = phi i32 [ 0, %5 ], [ %20, %18 ]
br i1 %6, label %10, label %18
10: ; preds = %8, %10
%11 = phi i64 [ %16, %10 ], [ 0, %8 ]
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = tail call i32 @putchar(i32 %14)
%16 = add nuw nsw i64 %11, 1
%17 = icmp eq i64 %16, %7
br i1 %17, label %18, label %10
18: ; preds = %10, %8
%19 = tail call i32 @putchar(i32 10)
%20 = add nuw nsw i32 %9, 1
%21 = icmp eq i32 %20, %2
br i1 %21, label %22, label %8
22: ; preds = %18, %3
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}