#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 tdPrint(const float *f) {
  int i;
  printf("{\n");
  for (i = 0; i < 16; i += 4) {
    printf("  %f, %f, %f, %f\n", f[0 + i], f[1 + i], f[2 + i], f[3 + i]);
  }
  printf("}\n");
}


x86 assembly (clang, -O0):
<tdPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    11af <tdPrint+0x9f>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm2
cvtss2sd %xmm2,%xmm2
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xe69(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <tdPrint+0x21>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tdPrint>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
movss  (%rbx),%xmm0
movss  0x4(%rbx),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movss  0x8(%rbx),%xmm2
cvtss2sd %xmm2,%xmm2
movss  0xc(%rbx),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xea3(%rip),%r14
mov    %r14,%rdi
mov    $0x4,%al
call   1040 <printf@plt>
movss  0x10(%rbx),%xmm0
movss  0x14(%rbx),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movss  0x18(%rbx),%xmm2
cvtss2sd %xmm2,%xmm2
movss  0x1c(%rbx),%xmm3
cvtss2sd %xmm3,%xmm3
mov    %r14,%rdi
mov    $0x4,%al
call   1040 <printf@plt>
movss  0x20(%rbx),%xmm0
movss  0x24(%rbx),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movss  0x28(%rbx),%xmm2
cvtss2sd %xmm2,%xmm2
movss  0x2c(%rbx),%xmm3
cvtss2sd %xmm3,%xmm3
mov    %r14,%rdi
mov    $0x4,%al
call   1040 <printf@plt>
movss  0x30(%rbx),%xmm0
movss  0x34(%rbx),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movss  0x38(%rbx),%xmm2
cvtss2sd %xmm2,%xmm2
movss  0x3c(%rbx),%xmm3
cvtss2sd %xmm3,%xmm3
mov    %r14,%rdi
mov    $0x4,%al
call   1040 <printf@plt>
lea    0xe1c(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str.1 = [18 x i8] c" %f, %f, %f, %f\0A\00"
@str = [2 x i8] c"{\00"
@str.3 = [2 x i8] c"}\00"
define void @tdPrint(float* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%3 = load float, float* %0
%4 = fpext float %3 to double
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fpext float %6 to double
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = getelementptr inbounds float, float* %0, i64 3
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %4, double %7, double %10, double %13)
%15 = getelementptr inbounds float, float* %0, i64 4
%16 = load float, float* %15
%17 = fpext float %16 to double
%18 = getelementptr inbounds float, float* %0, i64 5
%19 = load float, float* %18
%20 = fpext float %19 to double
%21 = getelementptr inbounds float, float* %0, i64 6
%22 = load float, float* %21
%23 = fpext float %22 to double
%24 = getelementptr inbounds float, float* %0, i64 7
%25 = load float, float* %24
%26 = fpext float %25 to double
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %17, double %20, double %23, double %26)
%28 = getelementptr inbounds float, float* %0, i64 8
%29 = load float, float* %28
%30 = fpext float %29 to double
%31 = getelementptr inbounds float, float* %0, i64 9
%32 = load float, float* %31
%33 = fpext float %32 to double
%34 = getelementptr inbounds float, float* %0, i64 10
%35 = load float, float* %34
%36 = fpext float %35 to double
%37 = getelementptr inbounds float, float* %0, i64 11
%38 = load float, float* %37
%39 = fpext float %38 to double
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %30, double %33, double %36, double %39)
%41 = getelementptr inbounds float, float* %0, i64 12
%42 = load float, float* %41
%43 = fpext float %42 to double
%44 = getelementptr inbounds float, float* %0, i64 13
%45 = load float, float* %44
%46 = fpext float %45 to double
%47 = getelementptr inbounds float, float* %0, i64 14
%48 = load float, float* %47
%49 = fpext float %48 to double
%50 = getelementptr inbounds float, float* %0, i64 15
%51 = load float, float* %50
%52 = fpext float %51 to double
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %43, double %46, double %49, double %52)
%54 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
ret void
}