#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 _ada_use_c2phc(int, int *, int *, double *);
int store_standard_gamma(int n, double *re_gamma, double *im_gamma) {
  int fail, i;
  int *b;
  double r[2];
  for (i = 0; i < n; i++) {
    r[0] = re_gamma[i];
    r[1] = im_gamma[i];
    fail = _ada_use_c2phc(44, &i, b, r);
  }
  return fail;
}


x86 assembly (clang, -O0):
<store_standard_gamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1181 <store_standard_gamma+0x71>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%rdx
lea    -0x40(%rbp),%rcx
mov    $0x2c,%edi
lea    -0x20(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112a <store_standard_gamma+0x1a>
mov    -0x1c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_standard_gamma>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
movl   $0x0,0xc(%rsp)
test   %edi,%edi
jle    117b <store_standard_gamma+0x6b>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %ecx,%ecx
lea    0xc(%rsp),%r15
lea    0x10(%rsp),%r12
nopl   0x0(%rax)
movslq %ecx,%rax
movsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%r14,%rax,8),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    $0x2c,%edi
mov    %r15,%rsi
mov    %r12,%rcx
call   1030 <_ada_use_c2phc@plt>
mov    0xc(%rsp),%ecx
add    $0x1,%ecx
mov    %ecx,0xc(%rsp)
cmp    %ebp,%ecx
jl     1140 <store_standard_gamma+0x30>
jmp    117b <store_standard_gamma+0x6b>
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @store_standard_gamma(i32 %0, double* nocapture %1, double* nocapture %2) {
%4 = alloca i32
%5 = alloca [2 x double]
%6 = bitcast i32* %4 to i8*
%7 = bitcast [2 x double]* %5 to i8*
store i32 0, i32* %4
%8 = icmp sgt i32 %0, 0
br i1 %8, label %9, label %23
9: ; preds = %3
%10 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%11 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 1
br label %12
12: ; preds = %9, %12
%13 = phi i32 [ 0, %9 ], [ %21, %12 ]
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %1, i64 %14
%16 = load double, double* %15
store double %16, double* %10
%17 = getelementptr inbounds double, double* %2, i64 %14
%18 = load double, double* %17
store double %18, double* %11
%19 = call i32 @_ada_use_c2phc(i32 44, i32* %4, i32* undef, double* %10)
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
%22 = icmp slt i32 %21, %0
br i1 %22, label %12, label %23
23: ; preds = %12, %3
%24 = phi i32 [ undef, %3 ], [ %19, %12 ]
ret i32 %24
}