#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_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int dobldobl_Littlewood_Richardson_homotopies(
    int n, int k, int c, int *brackets, int verbose, int verify, int minrep,
    int tosquare, int nbchar, char *filename, int *r, double *flags) {
  int fail, i;
  int size = 4 * (c - 2) * n * n + 1;
  double rc[size];
  int dim[8];
  dim[0] = n;
  dim[1] = k;
  dim[2] = c;
  dim[3] = verbose;
  dim[4] = verify;
  dim[5] = nbchar;
  dim[6] = minrep;
  dim[7] = tosquare;
  for (i = 0; i < nbchar; i++)
    rc[i] = (double)filename[i];
  fail = _ada_use_c2phc4c(180, dim, brackets, rc, 0);
  (*r) = (int)rc[0];
  for (i = 1; i < size; i++)
    flags[i - 1] = rc[i];
  return fail;
}


x86 assembly (clang, -O0):
<dobldobl_Littlewood_Richardson_homotopies>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0xc(%rbp),%ecx
add    $0xfffffffe,%ecx
mov    -0x4(%rbp),%eax
imul   %eax,%ecx
imul   %eax,%ecx
mov    %ecx,%eax
lea    0x1(,%rax,4),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    0x20(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    0x10(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    0x18(%rbp),%eax
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    0x20(%rbp),%eax
jge    11f2 <dobldobl_Littlewood_Richardson_homotopies+0xe2>
mov    -0x68(%rbp),%rax
mov    0x28(%rbp),%rcx
movslq -0x28(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cvtsi2sd %ecx,%xmm0
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11bb <dobldobl_Littlewood_Richardson_homotopies+0xab>
mov    -0x68(%rbp),%rcx
lea    -0x60(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0xb4,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,%ecx
mov    -0x68(%rbp),%rax
mov    %ecx,-0x24(%rbp)
cvttsd2si (%rax),%ecx
mov    0x30(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    125e <dobldobl_Littlewood_Richardson_homotopies+0x14e>
mov    -0x68(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x38(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1225 <dobldobl_Littlewood_Richardson_homotopies+0x115>
mov    -0x24(%rbp),%eax
mov    -0x38(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobldobl_Littlewood_Richardson_homotopies>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0x30(%rbp),%r12
mov    0x20(%rbp),%r10d
mov    0x18(%rbp),%r11d
mov    0x10(%rbp),%r14d
lea    -0x8(,%rdx,4),%ebx
mov    %edi,%r15d
imul   %r15d,%r15d
imul   %ebx,%r15d
lea    0x1(%r15),%r13d
lea    0xf(,%r13,8),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %edi,-0x50(%rbp)
mov    %esi,-0x4c(%rbp)
mov    %edx,-0x48(%rbp)
mov    %r8d,-0x44(%rbp)
mov    %r9d,-0x40(%rbp)
mov    %r10d,-0x3c(%rbp)
mov    %r14d,-0x38(%rbp)
mov    %r11d,-0x34(%rbp)
test   %r10d,%r10d
jle    12ca <dobldobl_Littlewood_Richardson_homotopies+0x1aa>
mov    0x28(%rbp),%r11
mov    %r10d,%r9d
cmp    $0x4,%r10d
jae    11a6 <dobldobl_Littlewood_Richardson_homotopies+0x86>
xor    %esi,%esi
jmp    12b0 <dobldobl_Littlewood_Richardson_homotopies+0x190>
mov    %r9d,%esi
and    $0xfffffffc,%esi
lea    -0x4(%rsi),%rdx
mov    %rdx,%r8
shr    $0x2,%r8
add    $0x1,%r8
test   %rdx,%rdx
je     131b <dobldobl_Littlewood_Richardson_homotopies+0x1fb>
mov    %r8,%rdx
and    $0xfffffffffffffffe,%rdx
xor    %edi,%edi
nopl   (%rax)
movzwl (%r11,%rdi,1),%eax
movd   %eax,%xmm0
punpcklbw %xmm0,%xmm0
movzwl 0x2(%r11,%rdi,1),%eax
movd   %eax,%xmm1
punpcklbw %xmm1,%xmm1
pshuflw $0x60,%xmm0,%xmm0
psrad  $0x18,%xmm0
cvtdq2pd %xmm0,%xmm0
pshuflw $0x60,%xmm1,%xmm1
psrad  $0x18,%xmm1
cvtdq2pd %xmm1,%xmm1
movaps %xmm0,(%rbx,%rdi,8)
movaps %xmm1,0x10(%rbx,%rdi,8)
movzwl 0x4(%r11,%rdi,1),%eax
movd   %eax,%xmm0
punpcklbw %xmm0,%xmm0
movzwl 0x6(%r11,%rdi,1),%eax
movd   %eax,%xmm1
punpcklbw %xmm1,%xmm1
pshuflw $0x60,%xmm0,%xmm0
psrad  $0x18,%xmm0
cvtdq2pd %xmm0,%xmm0
pshuflw $0x60,%xmm1,%xmm1
psrad  $0x18,%xmm1
cvtdq2pd %xmm1,%xmm1
movapd %xmm0,0x20(%rbx,%rdi,8)
movaps %xmm1,0x30(%rbx,%rdi,8)
add    $0x8,%rdi
add    $0xfffffffffffffffe,%rdx
jne    11d0 <dobldobl_Littlewood_Richardson_homotopies+0xb0>
test   $0x1,%r8b
je     12a8 <dobldobl_Littlewood_Richardson_homotopies+0x188>
movzwl (%r11,%rdi,1),%eax
movd   %eax,%xmm0
movzwl 0x2(%r11,%rdi,1),%eax
punpcklbw %xmm0,%xmm0
pshuflw $0x60,%xmm0,%xmm0
psrad  $0x18,%xmm0
cvtdq2pd %xmm0,%xmm0
movd   %eax,%xmm1
punpcklbw %xmm1,%xmm1
pshuflw $0x60,%xmm1,%xmm1
psrad  $0x18,%xmm1
cvtdq2pd %xmm1,%xmm1
movapd %xmm0,(%rbx,%rdi,8)
movaps %xmm1,0x10(%rbx,%rdi,8)
cmp    %r9,%rsi
je     12ca <dobldobl_Littlewood_Richardson_homotopies+0x1aa>
nopl   (%rax)
movsbl (%r11,%rsi,1),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rbx,%rsi,8)
add    $0x1,%rsi
cmp    %rsi,%r9
jne    12b0 <dobldobl_Littlewood_Richardson_homotopies+0x190>
lea    -0x50(%rbp),%rsi
mov    $0xb4,%edi
mov    %rcx,%rdx
mov    %rbx,%rcx
xor    %r8d,%r8d
call   1040 <_ada_use_c2phc4c@plt>
cvttsd2si (%rbx),%ecx
mov    %eax,%r14d
mov    %ecx,(%r12)
cmp    $0x2,%r13d
jl     1309 <dobldobl_Littlewood_Richardson_homotopies+0x1e9>
mov    0x38(%rbp),%rdi
add    $0x8,%rbx
mov    %r15d,%edx
shl    $0x3,%rdx
mov    %rbx,%rsi
call   1030 <memcpy@plt>
mov    %r14d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edi,%edi
test   $0x1,%r8b
jne    1267 <dobldobl_Littlewood_Richardson_homotopies+0x147>
jmp    12a8 <dobldobl_Littlewood_Richardson_homotopies+0x188>

LLVM IR (-O0):
define i32 @dobldobl_Littlewood_Richardson_homotopies(i32 %0, i32 %1, i32 %2, i32* %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i8* %9, i32* %10, double* %11) {
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i8*
%23 = alloca i32*
%24 = alloca double*
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i8*
%29 = alloca i64
%30 = alloca [8 x i32]
store i32 %0, i32* %13
store i32 %1, i32* %14
store i32 %2, i32* %15
store i32* %3, i32** %16
store i32 %4, i32* %17
store i32 %5, i32* %18
store i32 %6, i32* %19
store i32 %7, i32* %20
store i32 %8, i32* %21
store i8* %9, i8** %22
store i32* %10, i32** %23
store double* %11, double** %24
%31 = load i32, i32* %15
%32 = sub nsw i32 %31, 2
%33 = mul nsw i32 4, %32
%34 = load i32, i32* %13
%35 = mul nsw i32 %33, %34
%36 = load i32, i32* %13
%37 = mul nsw i32 %35, %36
%38 = add nsw i32 %37, 1
store i32 %38, i32* %27
%39 = load i32, i32* %27
%40 = zext i32 %39 to i64
%41 = call i8* @llvm.stacksave()
store i8* %41, i8** %28
%42 = alloca double, i64 %40
store i64 %40, i64* %29
%43 = load i32, i32* %13
%44 = getelementptr inbounds [8 x i32], [8 x i32]* %30, i64 0, i64 0
store i32 %43, i32* %44
%45 = load i32, i32* %14
%46 = getelementptr inbounds [8 x i32], [8 x i32]* %30, i64 0, i64 1
store i32 %45, i32* %46
%47 = load i32, i32* %15
%48 = getelementptr inbounds [8 x i32], [8 x i32]* %30, i64 0, i64 2
store i32 %47, i32* %48
%49 = load i32, i32* %17
%50 = getelementptr inbounds [8 x i32], [8 x i32]* %30, i64 0, i64 3
store i32 %49, i32* %50
%51 = load i32, i32* %18
%52 = getelementptr inbounds [8 x i32], [8 x i32]* %30, i64 0, i64 4
store i32 %51, i32* %52
%53 = load i32, i32* %21
%54 = getelementptr inbounds [8 x i32], [8 x i32]* %30, i64 0, i64 5
store i32 %53, i32* %54
%55 = load i32, i32* %19
%56 = getelementptr inbounds [8 x i32], [8 x i32]* %30, i64 0, i64 6
store i32 %55, i32* %56
%57 = load i32, i32* %20
%58 = getelementptr inbounds [8 x i32], [8 x i32]* %30, i64 0, i64 7
store i32 %57, i32* %58
store i32 0, i32* %26
br label %59
59: ; preds = %73, %12
%60 = load i32, i32* %26
%61 = load i32, i32* %21
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %76
63: ; preds = %59
%64 = load i8*, i8** %22
%65 = load i32, i32* %26
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8, i8* %64, i64 %66
%68 = load i8, i8* %67
%69 = sitofp i8 %68 to double
%70 = load i32, i32* %26
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %42, i64 %71
store double %69, double* %72
br label %73
73: ; preds = %63
%74 = load i32, i32* %26
%75 = add nsw i32 %74, 1
store i32 %75, i32* %26
br label %59
76: ; preds = %59
%77 = getelementptr inbounds [8 x i32], [8 x i32]* %30, i64 0, i64 0
%78 = load i32*, i32** %16
%79 = call i32 @_ada_use_c2phc4c(i32 180, i32* %77, i32* %78, double* %42, i32 0)
store i32 %79, i32* %25
%80 = getelementptr inbounds double, double* %42, i64 0
%81 = load double, double* %80
%82 = fptosi double %81 to i32
%83 = load i32*, i32** %23
store i32 %82, i32* %83
store i32 1, i32* %26
br label %84
84: ; preds = %98, %76
%85 = load i32, i32* %26
%86 = load i32, i32* %27
%87 = icmp slt i32 %85, %86
br i1 %87, label %88, label %101
88: ; preds = %84
%89 = load i32, i32* %26
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %42, i64 %90
%92 = load double, double* %91
%93 = load double*, double** %24
%94 = load i32, i32* %26
%95 = sub nsw i32 %94, 1
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %93, i64 %96
store double %92, double* %97
br label %98
98: ; preds = %88
%99 = load i32, i32* %26
%100 = add nsw i32 %99, 1
store i32 %100, i32* %26
br label %84
101: ; preds = %84
%102 = load i32, i32* %25
%103 = load i8*, i8** %28
ret i32 %102
}

LLVM IR (-O2):
define i32 @dobldobl_Littlewood_Richardson_homotopies(i32 %0, i32 %1, i32 %2, i32* %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i8* nocapture %9, i32* nocapture writeonly %10, double* nocapture writeonly %11) {
%13 = bitcast double* %11 to i8*
%14 = alloca [8 x i32]
%15 = shl i32 %2, 2
%16 = add i32 %15, -8
%17 = mul i32 %0, %0
%18 = mul i32 %17, %16
%19 = or i32 %18, 1
%20 = zext i32 %19 to i64
%21 = alloca double, i64 %20
%22 = bitcast [8 x i32]* %14 to i8*
%23 = getelementptr inbounds [8 x i32], [8 x i32]* %14, i64 0, i64 0
store i32 %0, i32* %23
%24 = getelementptr inbounds [8 x i32], [8 x i32]* %14, i64 0, i64 1
store i32 %1, i32* %24
%25 = getelementptr inbounds [8 x i32], [8 x i32]* %14, i64 0, i64 2
store i32 %2, i32* %25
%26 = getelementptr inbounds [8 x i32], [8 x i32]* %14, i64 0, i64 3
store i32 %4, i32* %26
%27 = getelementptr inbounds [8 x i32], [8 x i32]* %14, i64 0, i64 4
store i32 %5, i32* %27
%28 = getelementptr inbounds [8 x i32], [8 x i32]* %14, i64 0, i64 5
store i32 %8, i32* %28
%29 = getelementptr inbounds [8 x i32], [8 x i32]* %14, i64 0, i64 6
store i32 %6, i32* %29
%30 = getelementptr inbounds [8 x i32], [8 x i32]* %14, i64 0, i64 7
store i32 %7, i32* %30
%31 = icmp sgt i32 %8, 0
br i1 %31, label %32, label %103
32: ; preds = %12
%33 = zext i32 %8 to i64
%34 = icmp ult i32 %8, 4
br i1 %34, label %93, label %35
35: ; preds = %32
%36 = and i64 %33, 4294967292
%37 = add nsw i64 %36, -4
%38 = lshr exact i64 %37, 2
%39 = add nuw nsw i64 %38, 1
%40 = and i64 %39, 1
%41 = icmp eq i64 %37, 0
br i1 %41, label %75, label %42
42: ; preds = %35
%43 = and i64 %39, 9223372036854775806
br label %44
44: ; preds = %44, %42
%45 = phi i64 [ 0, %42 ], [ %72, %44 ]
%46 = phi i64 [ 0, %42 ], [ %73, %44 ]
%47 = getelementptr inbounds i8, i8* %9, i64 %45
%48 = bitcast i8* %47 to <2 x i8>*
%49 = load <2 x i8>, <2 x i8>* %48
%50 = getelementptr inbounds i8, i8* %47, i64 2
%51 = bitcast i8* %50 to <2 x i8>*
%52 = load <2 x i8>, <2 x i8>* %51
%53 = sitofp <2 x i8> %49 to <2 x double>
%54 = sitofp <2 x i8> %52 to <2 x double>
%55 = getelementptr inbounds double, double* %21, i64 %45
%56 = bitcast double* %55 to <2 x double>*
store <2 x double> %53, <2 x double>* %56
%57 = getelementptr inbounds double, double* %55, i64 2
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> %54, <2 x double>* %58
%59 = or i64 %45, 4
%60 = getelementptr inbounds i8, i8* %9, i64 %59
%61 = bitcast i8* %60 to <2 x i8>*
%62 = load <2 x i8>, <2 x i8>* %61
%63 = getelementptr inbounds i8, i8* %60, i64 2
%64 = bitcast i8* %63 to <2 x i8>*
%65 = load <2 x i8>, <2 x i8>* %64
%66 = sitofp <2 x i8> %62 to <2 x double>
%67 = sitofp <2 x i8> %65 to <2 x double>
%68 = getelementptr inbounds double, double* %21, i64 %59
%69 = bitcast double* %68 to <2 x double>*
store <2 x double> %66, <2 x double>* %69
%70 = getelementptr inbounds double, double* %68, i64 2
%71 = bitcast double* %70 to <2 x double>*
store <2 x double> %67, <2 x double>* %71
%72 = add nuw i64 %45, 8
%73 = add i64 %46, 2
%74 = icmp eq i64 %73, %43
br i1 %74, label %75, label %44
75: ; preds = %44, %35
%76 = phi i64 [ 0, %35 ], [ %72, %44 ]
%77 = icmp eq i64 %40, 0
br i1 %77, label %91, label %78
78: ; preds = %75
%79 = getelementptr inbounds i8, i8* %9, i64 %76
%80 = bitcast i8* %79 to <2 x i8>*
%81 = load <2 x i8>, <2 x i8>* %80
%82 = getelementptr inbounds i8, i8* %79, i64 2
%83 = bitcast i8* %82 to <2 x i8>*
%84 = load <2 x i8>, <2 x i8>* %83
%85 = sitofp <2 x i8> %81 to <2 x double>
%86 = sitofp <2 x i8> %84 to <2 x double>
%87 = getelementptr inbounds double, double* %21, i64 %76
%88 = bitcast double* %87 to <2 x double>*
store <2 x double> %85, <2 x double>* %88
%89 = getelementptr inbounds double, double* %87, i64 2
%90 = bitcast double* %89 to <2 x double>*
store <2 x double> %86, <2 x double>* %90
br label %91
91: ; preds = %75, %78
%92 = icmp eq i64 %36, %33
br i1 %92, label %103, label %93
93: ; preds = %32, %91
%94 = phi i64 [ 0, %32 ], [ %36, %91 ]
br label %95
95: ; preds = %93, %95
%96 = phi i64 [ %101, %95 ], [ %94, %93 ]
%97 = getelementptr inbounds i8, i8* %9, i64 %96
%98 = load i8, i8* %97
%99 = sitofp i8 %98 to double
%100 = getelementptr inbounds double, double* %21, i64 %96
store double %99, double* %100
%101 = add nuw nsw i64 %96, 1
%102 = icmp eq i64 %101, %33
br i1 %102, label %103, label %95
103: ; preds = %95, %91, %12
%104 = call i32 @_ada_use_c2phc4c(i32 180, i32* %23, i32* %3, double* %21, i32 0)
%105 = load double, double* %21
%106 = fptosi double %105 to i32
store i32 %106, i32* %10
%107 = icmp sgt i32 %19, 1
br i1 %107, label %108, label %113
108: ; preds = %103
%109 = getelementptr inbounds double, double* %21, i64 1
%110 = bitcast double* %109 to i8*
%111 = zext i32 %18 to i64
%112 = shl nuw nsw i64 %111, 3
br label %113
113: ; preds = %108, %103
ret i32 %104
}