#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 sweep_quaddobl_complex_run(int gchoice, double *regamma, double *imgamma) {
  int fail;
  int pg[2];
  int *b;
  double c[8];
  pg[0] = 2;
  pg[1] = gchoice;
  if (gchoice == 2) {
    c[0] = regamma[0];
    c[1] = regamma[1];
    c[2] = regamma[2];
    c[3] = regamma[3];
    c[0] = imgamma[0];
    c[1] = imgamma[1];
    c[2] = imgamma[2];
    c[3] = imgamma[3];
  }
  fail = _ada_use_c2phc(620, pg, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_quaddobl_complex_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x2,-0x24(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    11a8 <sweep_quaddobl_complex_run+0x98>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
lea    -0x24(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    -0x70(%rbp),%rcx
mov    $0x26c,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_quaddobl_complex_run>:
sub    $0x58,%rsp
movl   $0x2,0x8(%rsp)
mov    %edi,0xc(%rsp)
cmp    $0x2,%edi
jne    1136 <sweep_quaddobl_complex_run+0x26>
movups (%rdx),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0x10(%rdx),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rcx
mov    $0x26c,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_quaddobl_complex_run(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca [2 x i32]
%9 = alloca i32*
%10 = alloca [8 x double]
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
store i32 2, i32* %11
%12 = load i32, i32* %4
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
store i32 %12, i32* %13
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %49
16: ; preds = %3
%17 = load double*, double** %5
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = load double, double* %18
%20 = getelementptr inbounds [8 x double], [8 x double]* %10, i64 0, i64 0
store double %19, double* %20
%21 = load double*, double** %5
%22 = getelementptr inbounds double, double* %21, i64 1
%23 = load double, double* %22
%24 = getelementptr inbounds [8 x double], [8 x double]* %10, i64 0, i64 1
store double %23, double* %24
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = getelementptr inbounds [8 x double], [8 x double]* %10, i64 0, i64 2
store double %27, double* %28
%29 = load double*, double** %5
%30 = getelementptr inbounds double, double* %29, i64 3
%31 = load double, double* %30
%32 = getelementptr inbounds [8 x double], [8 x double]* %10, i64 0, i64 3
store double %31, double* %32
%33 = load double*, double** %6
%34 = getelementptr inbounds double, double* %33, i64 0
%35 = load double, double* %34
%36 = getelementptr inbounds [8 x double], [8 x double]* %10, i64 0, i64 0
store double %35, double* %36
%37 = load double*, double** %6
%38 = getelementptr inbounds double, double* %37, i64 1
%39 = load double, double* %38
%40 = getelementptr inbounds [8 x double], [8 x double]* %10, i64 0, i64 1
store double %39, double* %40
%41 = load double*, double** %6
%42 = getelementptr inbounds double, double* %41, i64 2
%43 = load double, double* %42
%44 = getelementptr inbounds [8 x double], [8 x double]* %10, i64 0, i64 2
store double %43, double* %44
%45 = load double*, double** %6
%46 = getelementptr inbounds double, double* %45, i64 3
%47 = load double, double* %46
%48 = getelementptr inbounds [8 x double], [8 x double]* %10, i64 0, i64 3
store double %47, double* %48
br label %49
49: ; preds = %16, %3
%50 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%51 = load i32*, i32** %9
%52 = getelementptr inbounds [8 x double], [8 x double]* %10, i64 0, i64 0
%53 = call i32 @_ada_use_c2phc(i32 620, i32* %50, i32* %51, double* %52)
store i32 %53, i32* %7
%54 = load i32, i32* %7
ret i32 %54
}

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