#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*/ fputs(char *, int /*<<< orphan*/ *);
void pretty_print(int n, int *R, FILE *fh) {
  size_t i;
  for (i = 0; i < n; ++i) {
    fputs(R[i] ? "T" : "F", fh);
  }
  fputs("\n", fh);
}


x86 assembly (clang, -O0):
<pretty_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
jae    1176 <pretty_print+0x66>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xeb4(%rip),%rdi
lea    0xeab(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fputs@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <pretty_print+0x1b>
mov    -0x18(%rbp),%rsi
lea    0xe83(%rip),%rdi
call   1030 <fputs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pretty_print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
test   %edi,%edi
je     1154 <pretty_print+0x44>
mov    %rsi,%r15
movslq %edi,%r12
xor    %ebx,%ebx
jmp    1141 <pretty_print+0x31>
nopl   0x0(%rax)
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
je     1154 <pretty_print+0x44>
cmpl   $0x0,(%r15,%rbx,4)
mov    $0x46,%edi
je     1130 <pretty_print+0x20>
mov    $0x54,%edi
jmp    1130 <pretty_print+0x20>
mov    $0xa,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @pretty_print(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = sext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %14, %7 ], [ 0, %5 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 70, i32 84
%13 = tail call i32 @fputc(i32 %12, i32* %2)
%14 = add nuw i64 %8, 1
%15 = icmp eq i64 %14, %6
br i1 %15, label %16, label %7
16: ; preds = %7, %3
%17 = tail call i32 @fputc(i32 10, i32* %2)
ret void
}