#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 printFArray(float *arr, int size, char *title) {
  if (size > 0) {
    printf("\n%s\n[", title);
    for (int i = 0; i < size - 1; i++)
      printf("%4.0f, ", arr[i]);
    printf("%4.0f]\n", arr[size - 1]);
  } else
    printf("\n[]\n");
}


x86 assembly (clang, -O0):
<printFArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    11ad <printFArray+0x9d>
mov    -0x18(%rbp),%rsi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1184 <printFArray+0x74>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe97(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1146 <printFArray+0x36>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe6d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11bb <printFArray+0xab>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printFArray>:
test   %esi,%esi
jle    11a0 <printFArray+0x80>
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r12
lea    0xec7(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x1(%r14),%r15d
cmp    $0x1,%r14d
je     117d <printFArray+0x5d>
mov    %r15d,%ebp
xor    %ebx,%ebx
lea    0xead(%rip),%r14
nopl   0x0(%rax)
movss  (%r12,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1160 <printFArray+0x40>
movslq %r15d,%rax
movss  (%r12,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe7d(%rip),%rdi
mov    $0x1,%al
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
lea    0xe6f(%rip),%rdi
jmp    1030 <puts@plt>

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

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