#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*/ random_dobldobl_complex(double *, double *);
int /*<<< orphan*/ store_dobldobl_gamma(int, double *, double *);
int store_dobldobl_gammas(int n) {
  double re_gamma[2 * n];
  double im_gamma[2 * n];
  int i;
  for (i = 0; i < n; i++)
    random_dobldobl_complex(&re_gamma[2 * i], &im_gamma[2 * i]);
  store_dobldobl_gamma(n, re_gamma, im_gamma);
}


x86 assembly (clang, -O0):
<store_dobldobl_gammas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rdx
shl    $0x3,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    %eax,%eax
mov    %rax,%rdx
shl    $0x3,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b8 <store_dobldobl_gammas+0x98>
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdi
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
call   1040 <random_dobldobl_complex@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1173 <store_dobldobl_gammas+0x53>
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rsi
mov    -0x8(%rbp),%edi
call   1030 <store_dobldobl_gamma@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_dobldobl_gammas>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    (%rdi,%rdi,1),%eax
mov    %rsp,%r15
shl    $0x3,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    %rsp,%r12
sub    %rax,%r12
mov    %r12,%rsp
mov    %rdi,-0x30(%rbp)
test   %edi,%edi
jle    1179 <store_dobldobl_gammas+0x59>
mov    -0x30(%rbp),%r14d
mov    %r15,%r13
mov    %r12,%rbx
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %rbx,%rsi
call   1040 <random_dobldobl_complex@plt>
add    $0x10,%rbx
add    $0x10,%r13
add    $0xffffffffffffffff,%r14
jne    1160 <store_dobldobl_gammas+0x40>
mov    -0x30(%rbp),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <store_dobldobl_gamma@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @store_dobldobl_gammas(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %3
%8 = load i32, i32* %3
%9 = mul nsw i32 2, %8
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %4
%12 = alloca double, i64 %10
store i64 %10, i64* %5
%13 = load i32, i32* %3
%14 = mul nsw i32 2, %13
%15 = zext i32 %14 to i64
%16 = alloca double, i64 %15
store i64 %15, i64* %6
store i32 0, i32* %7
br label %17
17: ; preds = %31, %1
%18 = load i32, i32* %7
%19 = load i32, i32* %3
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %34
21: ; preds = %17
%22 = load i32, i32* %7
%23 = mul nsw i32 2, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %12, i64 %24
%26 = load i32, i32* %7
%27 = mul nsw i32 2, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %16, i64 %28
%30 = call i32 @random_dobldobl_complex(double* %25, double* %29)
br label %31
31: ; preds = %21
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
br label %17
34: ; preds = %17
%35 = load i32, i32* %3
%36 = call i32 @store_dobldobl_gamma(i32 %35, double* %12, double* %16)
%37 = load i8*, i8** %4
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
define i32 @store_dobldobl_gammas(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = zext i32 %2 to i64
%4 = alloca double, i64 %3
%5 = alloca double, i64 %3
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = zext i32 %0 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %15, %9 ]
%11 = shl nuw nsw i64 %10, 1
%12 = getelementptr inbounds double, double* %4, i64 %11
%13 = getelementptr inbounds double, double* %5, i64 %11
%14 = call i32 @random_dobldobl_complex(double* %12, double* %13)
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %8
br i1 %16, label %17, label %9
17: ; preds = %9, %1
%18 = call i32 @store_dobldobl_gamma(i32 %0, double* %4, double* %5)
ret i32 undef
}