#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*/ complement(int *, int, int *, int, int, int *, int *);
int /*<<< orphan*/ copy_list(int *, int *, int);
int /*<<< orphan*/ coset_rep(int *, int, int *, int, int *, int *, int *, int,
                             int *);
int /*<<< orphan*/ double_coset_rep(int *, int, int *, int, int *, int, int *,
                                    int, int *, int, int *, int *, int, int *,
                                    int, int *);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ inverse(int *, int *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ nonstable_points(int *, int, int *, int, int, int *, int *);
int onpoints(int, int *, int);
int /*<<< orphan*/ schreier_sims(int *, int, int *, int, int, int *, int *,
                                 int **, int *, int *);
int /*<<< orphan*/ stabilizer(int *, int, int *, int, int, int *, int *);
void canonical_perm_ext(int *PERM, int n, int SGSQ, int *base, int bl, int *GS,
                        int m, int *frees, int fl, int *vds, int vdsl,
                        int *dummies, int dl, int *mQ, int *vrs, int vrsl,
                        int *repes, int rl, int *CPERM) {
  int i;
  int *freeps = (int *)malloc(fl * sizeof(int));
  int *PERM1 = (int *)malloc(n * sizeof(int));
  int *PERM2 = (int *)malloc(n * sizeof(int));
  int *newbase = (int *)malloc(n * sizeof(int)), newbl;
  int **newGS = NULL;
  int *pointer;
  int newm;
  int *tmpbase = (int *)malloc(n * sizeof(int)), tmpbl;
  int num = 0;
  pointer = (int *)malloc(m * n * sizeof(int));
  newGS = &pointer;
  if (!SGSQ) {
    nonstable_points(base, bl, GS, m, n, tmpbase, &tmpbl);
    schreier_sims(tmpbase, tmpbl, GS, m, n, newbase, &newbl, newGS, &newm,
                  &num);
  } else {
    copy_list(base, newbase, bl);
    newbl = bl;
    copy_list(GS, *newGS, m * n);
    newm = m;
  }
  inverse(PERM, PERM1, n);
  for (i = 0; i < fl; i++) {
    freeps[i] = onpoints(frees[i], PERM1, n);
  }
  coset_rep(PERM, n, newbase, newbl, *newGS, &newm, freeps, fl, PERM1);
  if (dl + rl == 0) {
    copy_list(PERM1, CPERM, n);
  } else {
    complement(newbase, newbl, freeps, fl, 1, tmpbase, &tmpbl);
    copy_list(tmpbase, newbase, tmpbl);
    newbl = tmpbl;
    stabilizer(freeps, fl, *newGS, newm, n, *newGS, &newm);
    double_coset_rep(PERM1, n, newbase, newbl, *newGS, newm, vds, vdsl, dummies,
                     dl, mQ, vrs, vrsl, repes, rl, PERM2);
    copy_list(PERM2, CPERM, n);
  }
  free(freeps);
  free(PERM1);
  free(PERM2);
  free(newbase);
  free(tmpbase);
  free(*newGS);
}


x86 assembly (clang, -O0):
<canonical_perm_ext>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
mov    0x70(%rbp),%rax
mov    0x68(%rbp),%eax
mov    0x60(%rbp),%rax
mov    0x58(%rbp),%eax
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x30(%rbp)
mov    %esi,-0x34(%rbp)
mov    %edx,-0x38(%rbp)
mov    %rcx,-0x40(%rbp)
mov    %r8d,-0x44(%rbp)
mov    %r9,-0x50(%rbp)
movslq 0x20(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x60(%rbp)
movslq -0x34(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x68(%rbp)
movslq -0x34(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x70(%rbp)
movslq -0x34(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x78(%rbp)
movq   $0x0,-0x88(%rbp)
movslq -0x34(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0xa0(%rbp)
movl   $0x0,-0xa8(%rbp)
mov    0x10(%rbp),%eax
imul   -0x34(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x90(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0x88(%rbp)
cmpl   $0x0,-0x38(%rbp)
jne    132d <canonical_perm_ext+0x17d>
mov    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
mov    -0x50(%rbp),%rdx
mov    0x10(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0xa0(%rbp),%r9
lea    -0xa4(%rbp),%rax
mov    %rax,(%rsp)
call   1090 <nonstable_points@plt>
mov    -0xa0(%rbp),%rdi
mov    -0xa4(%rbp),%esi
mov    -0x50(%rbp),%rdx
mov    0x10(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0x78(%rbp),%r9
mov    -0x88(%rbp),%r11
lea    -0x7c(%rbp),%rbx
lea    -0x94(%rbp),%r10
lea    -0xa8(%rbp),%rax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1060 <schreier_sims@plt>
jmp    1366 <canonical_perm_ext+0x1b6>
mov    -0x40(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    -0x44(%rbp),%edx
call   10c0 <copy_list@plt>
mov    -0x44(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x88(%rbp),%rax
mov    (%rax),%rsi
mov    0x10(%rbp),%edx
imul   -0x34(%rbp),%edx
call   10c0 <copy_list@plt>
mov    0x10(%rbp),%eax
mov    %eax,-0x94(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x34(%rbp),%edx
call   10a0 <inverse@plt>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    0x20(%rbp),%eax
jge    13bb <canonical_perm_ext+0x20b>
mov    0x18(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x68(%rbp),%rsi
mov    -0x34(%rbp),%edx
call   10d0 <onpoints@plt>
mov    %eax,%edx
mov    -0x60(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    137d <canonical_perm_ext+0x1cd>
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x78(%rbp),%rdx
mov    -0x7c(%rbp),%ecx
mov    -0x88(%rbp),%rax
mov    (%rax),%r8
mov    -0x60(%rbp),%r11
mov    0x20(%rbp),%r10d
mov    -0x68(%rbp),%rax
lea    -0x94(%rbp),%r9
mov    %r11,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1070 <coset_rep@plt>
mov    0x40(%rbp),%eax
add    0x68(%rbp),%eax
cmp    $0x0,%eax
jne    141d <canonical_perm_ext+0x26d>
mov    -0x68(%rbp),%rdi
mov    0x70(%rbp),%rsi
mov    -0x34(%rbp),%edx
call   10c0 <copy_list@plt>
jmp    154d <canonical_perm_ext+0x39d>
mov    -0x78(%rbp),%rdi
mov    -0x7c(%rbp),%esi
mov    -0x60(%rbp),%rdx
mov    0x20(%rbp),%ecx
mov    -0xa0(%rbp),%r9
mov    $0x1,%r8d
lea    -0xa4(%rbp),%rax
mov    %rax,(%rsp)
call   1050 <complement@plt>
mov    -0xa0(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    -0xa4(%rbp),%edx
call   10c0 <copy_list@plt>
mov    -0xa4(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x60(%rbp),%rdi
mov    0x20(%rbp),%esi
mov    -0x88(%rbp),%rax
mov    (%rax),%rdx
mov    -0x94(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0x88(%rbp),%rax
mov    (%rax),%r9
lea    -0x94(%rbp),%rax
mov    %rax,(%rsp)
call   10b0 <stabilizer@plt>
mov    -0x68(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x78(%rbp),%rdx
mov    -0x7c(%rbp),%ecx
mov    -0x88(%rbp),%rax
mov    (%rax),%r8
mov    -0x94(%rbp),%r9d
mov    0x28(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    0x30(%rbp),%eax
mov    %eax,-0xb4(%rbp)
mov    0x38(%rbp),%r13
mov    0x40(%rbp),%r12d
mov    0x48(%rbp),%r15
mov    0x50(%rbp),%r14
mov    0x58(%rbp),%ebx
mov    0x60(%rbp),%r11
mov    0x68(%rbp),%r10d
mov    -0x70(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0xc0(%rbp),%rax
mov    %rax,(%rsp)
mov    -0xb4(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0xb0(%rbp),%rax
mov    %r13,0x10(%rsp)
mov    %r12d,0x18(%rsp)
mov    %r15,0x20(%rsp)
mov    %r14,0x28(%rsp)
mov    %ebx,0x30(%rsp)
mov    %r11,0x38(%rsp)
mov    %r10d,0x40(%rsp)
mov    %rax,0x48(%rsp)
call   1030 <double_coset_rep@plt>
mov    -0x70(%rbp),%rdi
mov    0x70(%rbp),%rsi
mov    -0x34(%rbp),%edx
call   10c0 <copy_list@plt>
mov    -0x60(%rbp),%rdi
call   1040 <free@plt>
mov    -0x68(%rbp),%rdi
call   1040 <free@plt>
mov    -0x70(%rbp),%rdi
call   1040 <free@plt>
mov    -0x78(%rbp),%rdi
call   1040 <free@plt>
mov    -0xa0(%rbp),%rdi
call   1040 <free@plt>
mov    -0x88(%rbp),%rax
mov    (%rax),%rdi
call   1040 <free@plt>
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<canonical_perm_ext>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9,0x40(%rsp)
mov    %r8d,0x1c(%rsp)
mov    %rcx,0x38(%rsp)
mov    %edx,0x20(%rsp)
mov    %esi,%ebx
mov    %rdi,0x48(%rsp)
mov    0xa0(%rsp),%eax
mov    0x90(%rsp),%r13d
lea    0x0(,%rax,4),%edi
call   1080 <malloc@plt>
mov    %rax,%r14
lea    0x0(,%rbx,4),%ebp
mov    %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
mov    %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,0x50(%rsp)
mov    %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,0x28(%rsp)
mov    %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,%rbp
movl   $0x0,0x34(%rsp)
imul   %ebx,%r13d
lea    0x0(,%r13,4),%edi
call   1080 <malloc@plt>
mov    %rax,0x10(%rsp)
cmpl   $0x0,0x20(%rsp)
mov    %rbp,0x20(%rsp)
je     128c <canonical_perm_ext+0xdc>
mov    %rax,%r12
mov    0x38(%rsp),%rdi
mov    0x28(%rsp),%rsi
mov    0x1c(%rsp),%ebp
mov    %ebp,%edx
call   10c0 <copy_list@plt>
mov    %ebp,0x8(%rsp)
mov    0x40(%rsp),%rdi
mov    %r12,%rsi
mov    %r13d,%edx
call   10c0 <copy_list@plt>
mov    0x90(%rsp),%eax
mov    %eax,0x4(%rsp)
jmp    12f9 <canonical_perm_ext+0x149>
sub    $0x8,%rsp
lea    0x14(%rsp),%rax
mov    0x40(%rsp),%rdi
mov    0x24(%rsp),%esi
mov    0x48(%rsp),%r12
mov    %r12,%rdx
mov    0x98(%rsp),%r13d
mov    %r13d,%ecx
mov    %ebx,%r8d
mov    %rbp,%r9
push   %rax
call   1090 <nonstable_points@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%esi
lea    0x34(%rsp),%rax
lea    0x4(%rsp),%r11
lea    0x10(%rsp),%r10
mov    %rbp,%rdi
mov    %r12,%rdx
mov    %r13d,%ecx
mov    %ebx,%r8d
mov    0x28(%rsp),%r9
push   %rax
push   %r11
push   %r10
lea    0x20(%rsp),%rax
push   %rax
call   1060 <schreier_sims@plt>
add    $0x20,%rsp
mov    0x48(%rsp),%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   10a0 <inverse@plt>
mov    0xa0(%rsp),%eax
test   %eax,%eax
jle    134c <canonical_perm_ext+0x19c>
mov    0x98(%rsp),%rbp
mov    0xa0(%rsp),%eax
mov    %eax,%r12d
xor    %r13d,%r13d
nopl   0x0(%rax,%rax,1)
mov    0x0(%rbp,%r13,4),%edi
mov    %r15,%rsi
mov    %ebx,%edx
call   10d0 <onpoints@plt>
mov    %eax,(%r14,%r13,4)
add    $0x1,%r13
cmp    %r13,%r12
jne    1330 <canonical_perm_ext+0x180>
mov    0x8(%rsp),%ecx
mov    0x10(%rsp),%r8
sub    $0x8,%rsp
lea    0xc(%rsp),%r9
mov    0x50(%rsp),%rdi
mov    %ebx,%esi
mov    0x30(%rsp),%rbp
mov    %rbp,%rdx
push   %r15
mov    0xb0(%rsp),%r12d
push   %r12
push   %r14
call   1070 <coset_rep@plt>
add    $0x20,%rsp
mov    0xe8(%rsp),%edx
mov    %rdx,%rax
mov    %r15,%rdi
mov    0xc0(%rsp),%ecx
add    %ecx,%eax
mov    0x50(%rsp),%r13
je     147d <canonical_perm_ext+0x2cd>
mov    0x8(%rsp),%esi
sub    $0x8,%rsp
lea    0x14(%rsp),%rax
mov    %rbp,%rdi
mov    %r14,%rdx
mov    %r12d,%ecx
mov    $0x1,%r8d
mov    0x28(%rsp),%r12
mov    %r12,%r9
push   %rax
call   1050 <complement@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%edx
mov    %r12,%rdi
mov    %rbp,%rsi
call   10c0 <copy_list@plt>
mov    0xc(%rsp),%eax
mov    %eax,0x8(%rsp)
mov    0x10(%rsp),%rdx
mov    0x4(%rsp),%ecx
sub    $0x8,%rsp
mov    %r14,%rdi
mov    0xa8(%rsp),%esi
mov    %ebx,%r8d
mov    %rdx,%r9
lea    0xc(%rsp),%rax
push   %rax
call   10b0 <stabilizer@plt>
add    $0x10,%rsp
mov    0x8(%rsp),%ecx
mov    0x10(%rsp),%r8
mov    0x4(%rsp),%r9d
mov    %r15,%rdi
mov    %ebx,%esi
mov    %rbp,%rdx
push   %r13
mov    0xf0(%rsp),%eax
push   %rax
push   0xf0(%rsp)
mov    0xf0(%rsp),%eax
push   %rax
push   0xf0(%rsp)
push   0xf0(%rsp)
mov    0xf0(%rsp),%eax
push   %rax
push   0xf0(%rsp)
mov    0xf0(%rsp),%eax
push   %rax
push   0xf0(%rsp)
call   1030 <double_coset_rep@plt>
add    $0x50,%rsp
mov    %r13,%rdi
mov    0xf0(%rsp),%rsi
mov    %ebx,%edx
call   10c0 <copy_list@plt>
mov    %r14,%rdi
call   1040 <free@plt>
mov    %r15,%rdi
call   1040 <free@plt>
mov    %r13,%rdi
call   1040 <free@plt>
mov    %rbp,%rdi
call   1040 <free@plt>
mov    0x20(%rsp),%rdi
call   1040 <free@plt>
mov    0x10(%rsp),%rdi
call   1040 <free@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @canonical_perm_ext(i32* %0, i32 %1, i32 %2, i32* %3, i32 %4, i32* %5, i32 %6, i32* %7, i32 %8, i32* %9, i32 %10, i32* %11, i32 %12, i32* %13, i32* %14, i32 %15, i32* %16, i32 %17, i32* %18) {
%20 = alloca i32*
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32*
%24 = alloca i32
%25 = alloca i32*
%26 = alloca i32
%27 = alloca i32*
%28 = alloca i32
%29 = alloca i32*
%30 = alloca i32
%31 = alloca i32*
%32 = alloca i32
%33 = alloca i32*
%34 = alloca i32*
%35 = alloca i32
%36 = alloca i32*
%37 = alloca i32
%38 = alloca i32*
%39 = alloca i32
%40 = alloca i32*
%41 = alloca i32*
%42 = alloca i32*
%43 = alloca i32*
%44 = alloca i32
%45 = alloca i32**
%46 = alloca i32*
%47 = alloca i32
%48 = alloca i32*
%49 = alloca i32
%50 = alloca i32
store i32* %0, i32** %20
store i32 %1, i32* %21
store i32 %2, i32* %22
store i32* %3, i32** %23
store i32 %4, i32* %24
store i32* %5, i32** %25
store i32 %6, i32* %26
store i32* %7, i32** %27
store i32 %8, i32* %28
store i32* %9, i32** %29
store i32 %10, i32* %30
store i32* %11, i32** %31
store i32 %12, i32* %32
store i32* %13, i32** %33
store i32* %14, i32** %34
store i32 %15, i32* %35
store i32* %16, i32** %36
store i32 %17, i32* %37
store i32* %18, i32** %38
%51 = load i32, i32* %28
%52 = sext i32 %51 to i64
%53 = mul i64 %52, 4
%54 = trunc i64 %53 to i32
%55 = call i64 @malloc(i32 %54)
%56 = inttoptr i64 %55 to i32*
store i32* %56, i32** %40
%57 = load i32, i32* %21
%58 = sext i32 %57 to i64
%59 = mul i64 %58, 4
%60 = trunc i64 %59 to i32
%61 = call i64 @malloc(i32 %60)
%62 = inttoptr i64 %61 to i32*
store i32* %62, i32** %41
%63 = load i32, i32* %21
%64 = sext i32 %63 to i64
%65 = mul i64 %64, 4
%66 = trunc i64 %65 to i32
%67 = call i64 @malloc(i32 %66)
%68 = inttoptr i64 %67 to i32*
store i32* %68, i32** %42
%69 = load i32, i32* %21
%70 = sext i32 %69 to i64
%71 = mul i64 %70, 4
%72 = trunc i64 %71 to i32
%73 = call i64 @malloc(i32 %72)
%74 = inttoptr i64 %73 to i32*
store i32* %74, i32** %43
store i32** null, i32*** %45
%75 = load i32, i32* %21
%76 = sext i32 %75 to i64
%77 = mul i64 %76, 4
%78 = trunc i64 %77 to i32
%79 = call i64 @malloc(i32 %78)
%80 = inttoptr i64 %79 to i32*
store i32* %80, i32** %48
store i32 0, i32* %50
%81 = load i32, i32* %26
%82 = load i32, i32* %21
%83 = mul nsw i32 %81, %82
%84 = sext i32 %83 to i64
%85 = mul i64 %84, 4
%86 = trunc i64 %85 to i32
%87 = call i64 @malloc(i32 %86)
%88 = inttoptr i64 %87 to i32*
store i32* %88, i32** %46
store i32** %46, i32*** %45
%89 = load i32, i32* %22
%90 = icmp ne i32 %89, 0
br i1 %90, label %107, label %91
91: ; preds = %19
%92 = load i32*, i32** %23
%93 = load i32, i32* %24
%94 = load i32*, i32** %25
%95 = load i32, i32* %26
%96 = load i32, i32* %21
%97 = load i32*, i32** %48
%98 = call i32 @nonstable_points(i32* %92, i32 %93, i32* %94, i32 %95, i32 %96, i32* %97, i32* %49)
%99 = load i32*, i32** %48
%100 = load i32, i32* %49
%101 = load i32*, i32** %25
%102 = load i32, i32* %26
%103 = load i32, i32* %21
%104 = load i32*, i32** %43
%105 = load i32**, i32*** %45
%106 = call i32 @schreier_sims(i32* %99, i32 %100, i32* %101, i32 %102, i32 %103, i32* %104, i32* %44, i32** %105, i32* %47, i32* %50)
br label %121
107: ; preds = %19
%108 = load i32*, i32** %23
%109 = load i32*, i32** %43
%110 = load i32, i32* %24
%111 = call i32 @copy_list(i32* %108, i32* %109, i32 %110)
%112 = load i32, i32* %24
store i32 %112, i32* %44
%113 = load i32*, i32** %25
%114 = load i32**, i32*** %45
%115 = load i32*, i32** %114
%116 = load i32, i32* %26
%117 = load i32, i32* %21
%118 = mul nsw i32 %116, %117
%119 = call i32 @copy_list(i32* %113, i32* %115, i32 %118)
%120 = load i32, i32* %26
store i32 %120, i32* %47
br label %121
121: ; preds = %107, %91
%122 = load i32*, i32** %20
%123 = load i32*, i32** %41
%124 = load i32, i32* %21
%125 = call i32 @inverse(i32* %122, i32* %123, i32 %124)
store i32 0, i32* %39
br label %126
126: ; preds = %143, %121
%127 = load i32, i32* %39
%128 = load i32, i32* %28
%129 = icmp slt i32 %127, %128
br i1 %129, label %130, label %146
130: ; preds = %126
%131 = load i32*, i32** %27
%132 = load i32, i32* %39
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i32, i32* %131, i64 %133
%135 = load i32, i32* %134
%136 = load i32*, i32** %41
%137 = load i32, i32* %21
%138 = call i32 @onpoints(i32 %135, i32* %136, i32 %137)
%139 = load i32*, i32** %40
%140 = load i32, i32* %39
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i32, i32* %139, i64 %141
store i32 %138, i32* %142
br label %143
143: ; preds = %130
%144 = load i32, i32* %39
%145 = add nsw i32 %144, 1
store i32 %145, i32* %39
br label %126
146: ; preds = %126
%147 = load i32*, i32** %20
%148 = load i32, i32* %21
%149 = load i32*, i32** %43
%150 = load i32, i32* %44
%151 = load i32**, i32*** %45
%152 = load i32*, i32** %151
%153 = load i32*, i32** %40
%154 = load i32, i32* %28
%155 = load i32*, i32** %41
%156 = call i32 @coset_rep(i32* %147, i32 %148, i32* %149, i32 %150, i32* %152, i32* %47, i32* %153, i32 %154, i32* %155)
%157 = load i32, i32* %32
%158 = load i32, i32* %37
%159 = add nsw i32 %157, %158
%160 = icmp eq i32 %159, 0
br i1 %160, label %161, label %166
161: ; preds = %146
%162 = load i32*, i32** %41
%163 = load i32*, i32** %38
%164 = load i32, i32* %21
%165 = call i32 @copy_list(i32* %162, i32* %163, i32 %164)
br label %209
166: ; preds = %146
%167 = load i32*, i32** %43
%168 = load i32, i32* %44
%169 = load i32*, i32** %40
%170 = load i32, i32* %28
%171 = load i32*, i32** %48
%172 = call i32 @complement(i32* %167, i32 %168, i32* %169, i32 %170, i32 1, i32* %171, i32* %49)
%173 = load i32*, i32** %48
%174 = load i32*, i32** %43
%175 = load i32, i32* %49
%176 = call i32 @copy_list(i32* %173, i32* %174, i32 %175)
%177 = load i32, i32* %49
store i32 %177, i32* %44
%178 = load i32*, i32** %40
%179 = load i32, i32* %28
%180 = load i32**, i32*** %45
%181 = load i32*, i32** %180
%182 = load i32, i32* %47
%183 = load i32, i32* %21
%184 = load i32**, i32*** %45
%185 = load i32*, i32** %184
%186 = call i32 @stabilizer(i32* %178, i32 %179, i32* %181, i32 %182, i32 %183, i32* %185, i32* %47)
%187 = load i32*, i32** %41
%188 = load i32, i32* %21
%189 = load i32*, i32** %43
%190 = load i32, i32* %44
%191 = load i32**, i32*** %45
%192 = load i32*, i32** %191
%193 = load i32, i32* %47
%194 = load i32*, i32** %29
%195 = load i32, i32* %30
%196 = load i32*, i32** %31
%197 = load i32, i32* %32
%198 = load i32*, i32** %33
%199 = load i32*, i32** %34
%200 = load i32, i32* %35
%201 = load i32*, i32** %36
%202 = load i32, i32* %37
%203 = load i32*, i32** %42
%204 = call i32 @double_coset_rep(i32* %187, i32 %188, i32* %189, i32 %190, i32* %192, i32 %193, i32* %194, i32 %195, i32* %196, i32 %197, i32* %198, i32* %199, i32 %200, i32* %201, i32 %202, i32* %203)
%205 = load i32*, i32** %42
%206 = load i32*, i32** %38
%207 = load i32, i32* %21
%208 = call i32 @copy_list(i32* %205, i32* %206, i32 %207)
br label %209
209: ; preds = %166, %161
%210 = load i32*, i32** %40
%211 = call i32 @free(i32* %210)
%212 = load i32*, i32** %41
%213 = call i32 @free(i32* %212)
%214 = load i32*, i32** %42
%215 = call i32 @free(i32* %214)
%216 = load i32*, i32** %43
%217 = call i32 @free(i32* %216)
%218 = load i32*, i32** %48
%219 = call i32 @free(i32* %218)
%220 = load i32**, i32*** %45
%221 = load i32*, i32** %220
%222 = call i32 @free(i32* %221)
ret void
}

LLVM IR (-O2):
define void @canonical_perm_ext(i32* %0, i32 %1, i32 %2, i32* %3, i32 %4, i32* %5, i32 %6, i32* nocapture %7, i32 %8, i32* %9, i32 %10, i32* %11, i32 %12, i32* %13, i32* %14, i32 %15, i32* %16, i32 %17, i32* %18) {
%20 = alloca i32
%21 = alloca i32*
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = shl i32 %8, 2
%26 = tail call i64 @malloc(i32 %25)
%27 = inttoptr i64 %26 to i32*
%28 = shl i32 %1, 2
%29 = tail call i64 @malloc(i32 %28)
%30 = inttoptr i64 %29 to i32*
%31 = tail call i64 @malloc(i32 %28)
%32 = inttoptr i64 %31 to i32*
%33 = tail call i64 @malloc(i32 %28)
%34 = inttoptr i64 %33 to i32*
%35 = bitcast i32* %20 to i8*
%36 = bitcast i32** %21 to i8*
%37 = bitcast i32* %22 to i8*
%38 = tail call i64 @malloc(i32 %28)
%39 = inttoptr i64 %38 to i32*
%40 = bitcast i32* %23 to i8*
%41 = bitcast i32* %24 to i8*
store i32 0, i32* %24
%42 = mul nsw i32 %6, %1
%43 = shl i32 %42, 2
%44 = tail call i64 @malloc(i32 %43)
%45 = inttoptr i64 %44 to i32*
store i32* %45, i32** %21
%46 = icmp eq i32 %2, 0
br i1 %46, label %47, label %51
47: ; preds = %19
%48 = call i32 @nonstable_points(i32* %3, i32 %4, i32* %5, i32 %6, i32 %1, i32* %39, i32* %23)
%49 = load i32, i32* %23
%50 = call i32 @schreier_sims(i32* %39, i32 %49, i32* %5, i32 %6, i32 %1, i32* %34, i32* %20, i32** %21, i32* %22, i32* %24)
br label %54
51: ; preds = %19
%52 = tail call i32 @copy_list(i32* %3, i32* %34, i32 %4)
store i32 %4, i32* %20
%53 = tail call i32 @copy_list(i32* %5, i32* %45, i32 %42)
store i32 %6, i32* %22
br label %54
54: ; preds = %51, %47
%55 = call i32 @inverse(i32* %0, i32* %30, i32 %1)
%56 = icmp sgt i32 %8, 0
br i1 %56, label %57, label %67
57: ; preds = %54
%58 = zext i32 %8 to i64
br label %59
59: ; preds = %57, %59
%60 = phi i64 [ 0, %57 ], [ %65, %59 ]
%61 = getelementptr inbounds i32, i32* %7, i64 %60
%62 = load i32, i32* %61
%63 = call i32 @onpoints(i32 %62, i32* %30, i32 %1)
%64 = getelementptr inbounds i32, i32* %27, i64 %60
store i32 %63, i32* %64
%65 = add nuw nsw i64 %60, 1
%66 = icmp eq i64 %65, %58
br i1 %66, label %67, label %59
67: ; preds = %59, %54
%68 = load i32, i32* %20
%69 = load i32*, i32** %21
%70 = call i32 @coset_rep(i32* %0, i32 %1, i32* %34, i32 %68, i32* %69, i32* %22, i32* %27, i32 %8, i32* %30)
%71 = sub i32 0, %17
%72 = icmp eq i32 %71, %12
br i1 %72, label %86, label %73
73: ; preds = %67
%74 = load i32, i32* %20
%75 = call i32 @complement(i32* %34, i32 %74, i32* %27, i32 %8, i32 1, i32* %39, i32* %23)
%76 = load i32, i32* %23
%77 = call i32 @copy_list(i32* %39, i32* %34, i32 %76)
%78 = load i32, i32* %23
store i32 %78, i32* %20
%79 = load i32*, i32** %21
%80 = load i32, i32* %22
%81 = call i32 @stabilizer(i32* %27, i32 %8, i32* %79, i32 %80, i32 %1, i32* %79, i32* %22)
%82 = load i32, i32* %20
%83 = load i32*, i32** %21
%84 = load i32, i32* %22
%85 = call i32 @double_coset_rep(i32* %30, i32 %1, i32* %34, i32 %82, i32* %83, i32 %84, i32* %9, i32 %10, i32* %11, i32 %12, i32* %13, i32* %14, i32 %15, i32* %16, i32 %17, i32* %32)
br label %86
86: ; preds = %67, %73
%87 = phi i32* [ %32, %73 ], [ %30, %67 ]
%88 = call i32 @copy_list(i32* %87, i32* %18, i32 %1)
%89 = call i32 @free(i32* %27)
%90 = call i32 @free(i32* %30)
%91 = call i32 @free(i32* %32)
%92 = call i32 @free(i32* %34)
%93 = call i32 @free(i32* %39)
%94 = load i32*, i32** %21
%95 = call i32 @free(i32* %94)
ret void
}