#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 dump_scaling_array(int len, long double *mtx) {
  int i;
  printf("scaling array dump\n");
  for (i = 0; i < len; i++) {
    printf("%d: %Lf ", i, *mtx);
    mtx++;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<dump_scaling_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1176 <dump_scaling_array+0x66>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <dump_scaling_array+0x24>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_scaling_array>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%r15d
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
test   %r15d,%r15d
jle    117d <dump_scaling_array+0x4d>
lea    0xea8(%rip),%r14
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
fldt   (%rbx)
fstpt  (%rsp)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x10,%rbx
add    $0x1,%ebp
cmp    %ebp,%r15d
jne    1160 <dump_scaling_array+0x30>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"scaling array dump\0A\00"
@.str.1 = [9 x i8] c"%d: %Lf \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @dump_scaling_array(i32 %0, x86_fp80* %1) {
%3 = alloca i32
%4 = alloca x86_fp80*
%5 = alloca i32
store i32 %0, i32* %3
store x86_fp80* %1, x86_fp80** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i32, i32* %5
%13 = load x86_fp80*, x86_fp80** %4
%14 = load x86_fp80, x86_fp80* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %12, x86_fp80 %14)
%16 = load x86_fp80*, x86_fp80** %4
%17 = getelementptr inbounds x86_fp80, x86_fp80* %16, i32 1
store x86_fp80* %17, x86_fp80** %4
br label %18
18: ; preds = %11
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %7
21: ; preds = %7
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d: %Lf \00"
@str = [19 x i8] c"scaling array dump\00"
define void @dump_scaling_array(i32 %0, x86_fp80* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %13
5: ; preds = %2, %5
%6 = phi i32 [ %11, %5 ], [ 0, %2 ]
%7 = phi x86_fp80* [ %10, %5 ], [ %1, %2 ]
%8 = load x86_fp80, x86_fp80* %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %6, x86_fp80 %8)
%10 = getelementptr inbounds x86_fp80, x86_fp80* %7, i64 1
%11 = add nuw nsw i32 %6, 1
%12 = icmp eq i32 %11, %0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}