#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void fprintfStr(FILE *file, char *outStr, int length, int numTimes) {
  int i;
  int j;
  for (i = 0; i < numTimes; i++) {
    for (j = 0; j < length; j++) {
      fprintf(file, "%c", *(outStr + j));
    }
    fprintf(file, "\n");
  }
}


x86 assembly (clang, -O0):
<fprintfStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1198 <fprintfStr+0x88>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1178 <fprintfStr+0x68>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xe9d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1140 <fprintfStr+0x30>
mov    -0x8(%rbp),%rdi
lea    0xe80(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112d <fprintfStr+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprintfStr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,0x4(%rsp)
test   %ecx,%ecx
jle    1178 <fprintfStr+0x68>
mov    %ecx,%r15d
mov    %rsi,%r12
mov    %rdi,%rbx
mov    0x4(%rsp),%ebp
xor    %r13d,%r13d
jmp    1156 <fprintfStr+0x46>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0x1,%r13d
cmp    %r15d,%r13d
je     1178 <fprintfStr+0x68>
cmpl   $0x0,0x4(%rsp)
jle    1140 <fprintfStr+0x30>
xor    %r14d,%r14d
movsbl (%r12,%r14,1),%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0x1,%r14
cmp    %r14,%rbp
jne    1160 <fprintfStr+0x50>
jmp    1140 <fprintfStr+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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