#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 const *);
void out_hand0(FILE *pf, int n, const char *str_prefix, const char *str) {
  int i;
  if (n > 0) {
    fprintf(pf, str_prefix);
    for (i = 0; i < n; i++) {
      fprintf(pf, str);
    }
    fprintf(pf, "\n");
  }
}


x86 assembly (clang, -O0):
<out_hand0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    117c <out_hand0+0x6c>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116c <out_hand0+0x5c>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1145 <out_hand0+0x35>
mov    -0x8(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_hand0>:
test   %esi,%esi
jle    1161 <out_hand0+0x41>
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rsi
call   1040 <fprintf@plt>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fprintf@plt>
add    $0xffffffff,%ebp
jne    1140 <out_hand0+0x20>
mov    $0xa,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fputc@plt>
ret

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

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