#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_weights(long double *weights, int nr_seqs) {
  int i;
  printf("weight dump:\n");
  for (i = 0; i < nr_seqs; i++) {
    printf("%Lf\n", *(weights + i));
  }
}


x86 assembly (clang, -O0):
<dump_weights>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1170 <dump_weights+0x60>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x4,%rcx
fldt   (%rax,%rcx,1)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <dump_weights+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_weights>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebp
mov    %rdi,%r15
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
test   %ebp,%ebp
jle    116a <dump_weights+0x4a>
mov    %ebp,%ebp
shl    $0x4,%rbp
lea    0xeb4(%rip),%r14
xor    %ebx,%ebx
xchg   %ax,%ax
fldt   (%r15,%rbx,1)
fstpt  (%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x10,%rbx
cmp    %rbx,%rbp
jne    1150 <dump_weights+0x30>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"weight dump:\0A\00"
@.str.1 = [5 x i8] c"%Lf\0A\00"
define void @dump_weights(x86_fp80* %0, i32 %1) {
%3 = alloca x86_fp80*
%4 = alloca i32
%5 = alloca i32
store x86_fp80* %0, x86_fp80** %3
store i32 %1, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 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* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load x86_fp80*, x86_fp80** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds x86_fp80, x86_fp80* %12, i64 %14
%16 = load x86_fp80, x86_fp80* %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), x86_fp80 %16)
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
ret void
}

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