#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_complex(double *, double *);
int /*<<< orphan*/ store_standard_gamma(int, double *, double *);
int store_standard_gammas(int n) {
  double re_gamma[n];
  double im_gamma[n];
  int i;
  for (i = 0; i < n; i++)
    random_complex(&re_gamma[i], &im_gamma[i]);
  store_standard_gamma(n, re_gamma, im_gamma);
}


x86 assembly (clang, -O0):
<store_standard_gammas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%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    11b6 <store_standard_gammas+0x96>
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdi
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
call   1040 <random_complex@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1179 <store_standard_gammas+0x59>
mov    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%rsi
mov    -0x8(%rbp),%edi
call   1030 <store_standard_gamma@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_standard_gammas>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,%r14d
mov    %rsp,%r15
lea    0xf(,%r14,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    %rsp,%r12
sub    %rax,%r12
mov    %r12,%rsp
mov    %edi,-0x2c(%rbp)
test   %edi,%edi
jle    1179 <store_standard_gammas+0x59>
mov    %r15,%r13
mov    %r12,%rbx
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %rbx,%rsi
call   1040 <random_complex@plt>
add    $0x8,%rbx
add    $0x8,%r13
add    $0xffffffffffffffff,%r14
jne    1160 <store_standard_gammas+0x40>
mov    -0x2c(%rbp),%edi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <store_standard_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_standard_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 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %4
%11 = alloca double, i64 %9
store i64 %9, i64* %5
%12 = load i32, i32* %3
%13 = zext i32 %12 to i64
%14 = alloca double, i64 %13
store i64 %13, i64* %6
store i32 0, i32* %7
br label %15
15: ; preds = %27, %1
%16 = load i32, i32* %7
%17 = load i32, i32* %3
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %30
19: ; preds = %15
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %11, i64 %21
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %14, i64 %24
%26 = call i32 @random_complex(double* %22, double* %25)
br label %27
27: ; preds = %19
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %15
30: ; preds = %15
%31 = load i32, i32* %3
%32 = call i32 @store_standard_gamma(i32 %31, double* %11, double* %14)
%33 = load i8*, i8** %4
%34 = load i32, i32* %2
ret i32 %34
}

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