#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 print_double_array(double array_d[]) {
  int index;
  printf("array_d :\n");
  printf("=========\n\n");
  for (index = 0; index < 9; index++) {
    printf("%f  ", array_d[index]);
    if ((index % 8) == 0)
      printf("\n");
  }
  printf("\n\n");
}


x86 assembly (clang, -O0):
<print_double_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1199 <print_double_array+0x89>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1186 <print_double_array+0x76>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118b <print_double_array+0x7b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <print_double_array+0x2f>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_double_array>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xec7(%rip),%rdi
call   1040 <puts@plt>
lea    0xec5(%rip),%rdi
call   1040 <puts@plt>
movsd  (%rbx),%xmm0
lea    0xea6(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsd  0x8(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x10(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x18(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x20(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x28(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x30(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x38(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x40(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe21(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <puts@plt>

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

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