#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void dump_float_buffer_heads(float *buffer) {
  for (int i = 0; i < 2048; i += 1024) {
    fprintf(stderr, "Buffer data head #%d\n", i);
    fprintf(stderr,
            "  [%d] %+7.4f %+7.4f %+7.4f %+7.4f %+7.4f %+7.4f %+7.4f %+7.4f\n",
            i, buffer[i], buffer[i + 1], buffer[i + 2], buffer[i + 3],
            buffer[i + 4], buffer[i + 5], buffer[i + 6], buffer[i + 7]);
    fprintf(stderr, "\n");
  }
}


x86 assembly (clang, -O0):
<dump_float_buffer_heads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x800,-0xc(%rbp)
jge    1236 <dump_float_buffer_heads+0x126>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xebd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%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
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm4
cvtss2sd %xmm4,%xmm4
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm5
cvtss2sd %xmm5,%xmm5
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm6
cvtss2sd %xmm6,%xmm6
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x7,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm7
cvtss2sd %xmm7,%xmm7
lea    0xe0e(%rip),%rsi
mov    $0x8,%al
call   1030 <fprintf@plt>
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
lea    0xdf5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
add    $0x400,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <dump_float_buffer_heads+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_float_buffer_heads>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%r13
mov    0x0(%r13),%edi
lea    0xed2(%rip),%r14
mov    %r14,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%r13),%edi
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
movss  0x10(%rbx),%xmm4
cvtss2sd %xmm4,%xmm4
movss  0x14(%rbx),%xmm5
cvtss2sd %xmm5,%xmm5
movss  0x18(%rbx),%xmm6
cvtss2sd %xmm6,%xmm6
movss  0x1c(%rbx),%xmm7
cvtss2sd %xmm7,%xmm7
lea    0xe8a(%rip),%r15
mov    %r15,%rsi
xor    %edx,%edx
mov    $0x8,%al
call   1030 <fprintf@plt>
mov    0x0(%r13),%edi
lea    0xe71(%rip),%r12
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%r13),%edi
mov    %r14,%rsi
mov    $0x400,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%r13),%edi
movss  0x1000(%rbx),%xmm0
movss  0x1004(%rbx),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movss  0x1008(%rbx),%xmm2
cvtss2sd %xmm2,%xmm2
movss  0x100c(%rbx),%xmm3
cvtss2sd %xmm3,%xmm3
movss  0x1010(%rbx),%xmm4
cvtss2sd %xmm4,%xmm4
movss  0x1014(%rbx),%xmm5
cvtss2sd %xmm5,%xmm5
movss  0x1018(%rbx),%xmm6
cvtss2sd %xmm6,%xmm6
movss  0x101c(%rbx),%xmm7
cvtss2sd %xmm7,%xmm7
mov    %r15,%rsi
mov    $0x400,%edx
mov    $0x8,%al
call   1030 <fprintf@plt>
mov    0x0(%r13),%edi
mov    %r12,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Buffer data head #%d\0A\00"
@.str.1 = [64 x i8] c" [%d] %+7.4f %+7.4f %+7.4f %+7.4f %+7.4f %+7.4f %+7.4f %+7.4f\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @dump_float_buffer_heads(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
br label %4
4: ; preds = %71, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2048
br i1 %6, label %7, label %74
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = load i32, i32* %3
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @stderr
%12 = load i32, i32* %3
%13 = load float*, float** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %13, i64 %15
%17 = load float, float* %16
%18 = fpext float %17 to double
%19 = load float*, float** %2
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds float, float* %19, i64 %22
%24 = load float, float* %23
%25 = fpext float %24 to double
%26 = load float*, float** %2
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds float, float* %26, i64 %29
%31 = load float, float* %30
%32 = fpext float %31 to double
%33 = load float*, float** %2
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float, float* %33, i64 %36
%38 = load float, float* %37
%39 = fpext float %38 to double
%40 = load float*, float** %2
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 4
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds float, float* %40, i64 %43
%45 = load float, float* %44
%46 = fpext float %45 to double
%47 = load float*, float** %2
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 5
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds float, float* %47, i64 %50
%52 = load float, float* %51
%53 = fpext float %52 to double
%54 = load float*, float** %2
%55 = load i32, i32* %3
%56 = add nsw i32 %55, 6
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds float, float* %54, i64 %57
%59 = load float, float* %58
%60 = fpext float %59 to double
%61 = load float*, float** %2
%62 = load i32, i32* %3
%63 = add nsw i32 %62, 7
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds float, float* %61, i64 %64
%66 = load float, float* %65
%67 = fpext float %66 to double
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i32 %12, double %18, double %25, double %32, double %39, double %46, double %53, double %60, double %67)
%69 = load i32, i32* @stderr
%70 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %71
71: ; preds = %7
%72 = load i32, i32* %3
%73 = add nsw i32 %72, 1024
store i32 %73, i32* %3
br label %4
74: ; preds = %4
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Buffer data head #%d\0A\00"
@.str.1 = [64 x i8] c" [%d] %+7.4f %+7.4f %+7.4f %+7.4f %+7.4f %+7.4f %+7.4f %+7.4f\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @dump_float_buffer_heads(float* nocapture %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = load i32, i32* @stderr
%5 = load float, float* %0
%6 = fpext float %5 to double
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = getelementptr inbounds float, float* %0, i64 2
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = getelementptr inbounds float, float* %0, i64 3
%14 = load float, float* %13
%15 = fpext float %14 to double
%16 = getelementptr inbounds float, float* %0, i64 4
%17 = load float, float* %16
%18 = fpext float %17 to double
%19 = getelementptr inbounds float, float* %0, i64 5
%20 = load float, float* %19
%21 = fpext float %20 to double
%22 = getelementptr inbounds float, float* %0, i64 6
%23 = load float, float* %22
%24 = fpext float %23 to double
%25 = getelementptr inbounds float, float* %0, i64 7
%26 = load float, float* %25
%27 = fpext float %26 to double
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i32 0, double %6, double %9, double %12, double %15, double %18, double %21, double %24, double %27)
%29 = load i32, i32* @stderr
%30 = tail call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%31 = load i32, i32* @stderr
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1024)
%33 = load i32, i32* @stderr
%34 = getelementptr inbounds float, float* %0, i64 1024
%35 = load float, float* %34
%36 = fpext float %35 to double
%37 = getelementptr inbounds float, float* %0, i64 1025
%38 = load float, float* %37
%39 = fpext float %38 to double
%40 = getelementptr inbounds float, float* %0, i64 1026
%41 = load float, float* %40
%42 = fpext float %41 to double
%43 = getelementptr inbounds float, float* %0, i64 1027
%44 = load float, float* %43
%45 = fpext float %44 to double
%46 = getelementptr inbounds float, float* %0, i64 1028
%47 = load float, float* %46
%48 = fpext float %47 to double
%49 = getelementptr inbounds float, float* %0, i64 1029
%50 = load float, float* %49
%51 = fpext float %50 to double
%52 = getelementptr inbounds float, float* %0, i64 1030
%53 = load float, float* %52
%54 = fpext float %53 to double
%55 = getelementptr inbounds float, float* %0, i64 1031
%56 = load float, float* %55
%57 = fpext float %56 to double
%58 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i32 1024, double %36, double %39, double %42, double %45, double %48, double %51, double %54, double %57)
%59 = load i32, i32* @stderr
%60 = tail call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}