void print_double_array(array_d) double array_d[];
{
  int index;
  printf("array_d :\n");
  printf("=========\n\n");
  for (index = 0; index < 100; 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   $0x64,-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   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xec6(%rip),%rdi
call   1040 <puts@plt>
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
lea    0xea7(%rip),%r14
jmp    116a <print_double_array+0x3a>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    $0x64,%rbx
je     118b <print_double_array+0x5b>
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
test   $0x7,%bl
jne    1160 <print_double_array+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1160 <print_double_array+0x30>
lea    0xe86(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
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, 100
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))
br label %4
4: ; preds = %1, %13
%5 = phi i64 [ 0, %1 ], [ %14, %13 ]
%6 = getelementptr inbounds double, double* %0, i64 %5
%7 = load double, double* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %7)
%9 = and i64 %5, 7
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = tail call i32 @putchar(i32 10)
br label %13
13: ; preds = %4, %11
%14 = add nuw nsw i64 %5, 1
%15 = icmp eq i64 %14, 100
br i1 %15, label %16, label %4
16: ; preds = %13
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0))
ret void
}