#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*/ msg_print(char *, double, double, double, double);
void log(double A[16]) {
  int i, j;
  double a, b, c, d;
  for (i = j = 0; j < 4; j++) {
    a = A[i++];
    b = A[i++];
    c = A[i++];
    d = A[i++];
    msg_print("%g %g %g %g", a, b, c, d);
  }
}


x86 assembly (clang, -O0):
<log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    11d2 <log+0xc2>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
lea    0xe41(%rip),%rdi
call   1030 <msg_print@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112a <log+0x1a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  0x10(%rdi),%xmm2
movsd  0x18(%rdi),%xmm3
lea    0xecf(%rip),%r14
mov    %r14,%rdi
call   1030 <msg_print@plt>
movsd  0x20(%rbx),%xmm0
movsd  0x28(%rbx),%xmm1
movsd  0x30(%rbx),%xmm2
movsd  0x38(%rbx),%xmm3
mov    %r14,%rdi
call   1030 <msg_print@plt>
movsd  0x40(%rbx),%xmm0
movsd  0x48(%rbx),%xmm1
movsd  0x50(%rbx),%xmm2
movsd  0x58(%rbx),%xmm3
mov    %r14,%rdi
call   1030 <msg_print@plt>
movsd  0x60(%rbx),%xmm0
movsd  0x68(%rbx),%xmm1
movsd  0x70(%rbx),%xmm2
movsd  0x78(%rbx),%xmm3
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <msg_print@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"%g %g %g %g\00"
define void @log(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %0, i64 3
%8 = load double, double* %7
%9 = tail call i32 @msg_print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %2, double %4, double %6, double %8)
%10 = getelementptr inbounds double, double* %0, i64 4
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %0, i64 5
%13 = load double, double* %12
%14 = getelementptr inbounds double, double* %0, i64 6
%15 = load double, double* %14
%16 = getelementptr inbounds double, double* %0, i64 7
%17 = load double, double* %16
%18 = tail call i32 @msg_print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %11, double %13, double %15, double %17)
%19 = getelementptr inbounds double, double* %0, i64 8
%20 = load double, double* %19
%21 = getelementptr inbounds double, double* %0, i64 9
%22 = load double, double* %21
%23 = getelementptr inbounds double, double* %0, i64 10
%24 = load double, double* %23
%25 = getelementptr inbounds double, double* %0, i64 11
%26 = load double, double* %25
%27 = tail call i32 @msg_print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %20, double %22, double %24, double %26)
%28 = getelementptr inbounds double, double* %0, i64 12
%29 = load double, double* %28
%30 = getelementptr inbounds double, double* %0, i64 13
%31 = load double, double* %30
%32 = getelementptr inbounds double, double* %0, i64 14
%33 = load double, double* %32
%34 = getelementptr inbounds double, double* %0, i64 15
%35 = load double, double* %34
%36 = tail call i32 @msg_print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %29, double %31, double %33, double %35)
ret void
}