#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 printArrayFloat(int size, float array[size]) {
  for (size_t i = 0; i < size; i++) {
    printf("%.1f\t", array[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArrayFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
jae    1168 <printArrayFloat+0x58>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <printArrayFloat+0x17>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArrayFloat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
je     115d <printArrayFloat+0x3d>
mov    %rsi,%r15
movslq %edi,%r12
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movss  (%r15,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArrayFloat+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.1f\09\00"
define void @printArrayFloat(i32 %0, float* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ %14, %8 ], [ 0, %4 ]
%10 = getelementptr inbounds float, float* %1, i64 %9
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %12)
%14 = add nuw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %8
}