#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*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ one_orbit(int, int *, int, int, int *, int *);
int /*<<< orphan*/ stabilizer(int *, int, int *, int, int, int *, int *);
long long int order_of_group(int *base, int bl, int *GS, int m, int n) {
  if (m == 0)
    return (1);
  else {
    int *stab = (int *)malloc(m * n * sizeof(int)), sl;
    int *orbit = (int *)malloc(n * sizeof(int)), ol;
    one_orbit(base[0], GS, m, n, orbit, &ol);
    stabilizer(base, 1, GS, m, n, stab, &sl);
    long long int ret = ol * order_of_group(base + 1, bl - 1, stab, sl, n);
    free(stab);
    free(orbit);
    return ret;
  }
}


x86 assembly (clang, -O0):
<order_of_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    1181 <order_of_group+0x31>
movq   $0x1,-0x8(%rbp)
jmp    123d <order_of_group+0xed>
mov    -0x24(%rbp),%eax
imul   -0x28(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
movslq -0x28(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x40(%rbp),%r8
lea    -0x44(%rbp),%r9
call   1050 <one_orbit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    -0x30(%rbp),%r9
mov    $0x1,%esi
lea    -0x34(%rbp),%rax
mov    %rax,(%rsp)
call   1070 <stabilizer@plt>
movslq -0x44(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
mov    -0x30(%rbp),%rdx
mov    -0x34(%rbp),%ecx
mov    -0x28(%rbp),%r8d
call   1030 <order_of_group@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <free@plt>
mov    -0x40(%rbp),%rdi
call   1040 <free@plt>
mov    -0x50(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<order_of_group>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %ecx,%ecx
je     120d <order_of_group+0xbd>
mov    %r8d,%r13d
mov    %ecx,%ebx
mov    %rdx,%r12
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %ecx,%edi
imul   %r8d,%edi
shl    $0x2,%edi
call   1060 <malloc@plt>
mov    %rax,%r15
lea    0x0(,%r13,4),%edi
call   1060 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    0x0(%rbp),%edi
lea    0x8(%rsp),%r9
mov    %r12,%rsi
mov    %ebx,%edx
mov    %r13d,%ecx
mov    %rax,%r8
call   1050 <one_orbit@plt>
lea    0xc(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %r12,%rdx
mov    %ebx,%ecx
mov    %r13d,%r8d
mov    %r15,%r9
call   1070 <stabilizer@plt>
movslq 0x8(%rsp),%r12
add    $0x4,%rbp
add    $0xffffffff,%r14d
mov    0xc(%rsp),%ecx
mov    %rbp,%rdi
mov    %r14d,%esi
mov    %r15,%rdx
mov    %r13d,%r8d
call   1030 <order_of_group@plt>
mov    %rax,%rbx
imul   %r12,%rbx
mov    %r15,%rdi
call   1040 <free@plt>
mov    0x10(%rsp),%rdi
call   1040 <free@plt>
jmp    1212 <order_of_group+0xc2>
mov    $0x1,%ebx
mov    %rbx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @order_of_group(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32
%16 = alloca i64
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%17 = load i32, i32* %10
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %5
store i64 1, i64* %6
br label %65
20: ; preds = %5
%21 = load i32, i32* %10
%22 = load i32, i32* %11
%23 = mul nsw i32 %21, %22
%24 = sext i32 %23 to i64
%25 = mul i64 %24, 4
%26 = trunc i64 %25 to i32
%27 = call i64 @malloc(i32 %26)
%28 = inttoptr i64 %27 to i32*
store i32* %28, i32** %12
%29 = load i32, i32* %11
%30 = sext i32 %29 to i64
%31 = mul i64 %30, 4
%32 = trunc i64 %31 to i32
%33 = call i64 @malloc(i32 %32)
%34 = inttoptr i64 %33 to i32*
store i32* %34, i32** %14
%35 = load i32*, i32** %7
%36 = getelementptr inbounds i32, i32* %35, i64 0
%37 = load i32, i32* %36
%38 = load i32*, i32** %9
%39 = load i32, i32* %10
%40 = load i32, i32* %11
%41 = load i32*, i32** %14
%42 = call i32 @one_orbit(i32 %37, i32* %38, i32 %39, i32 %40, i32* %41, i32* %15)
%43 = load i32*, i32** %7
%44 = load i32*, i32** %9
%45 = load i32, i32* %10
%46 = load i32, i32* %11
%47 = load i32*, i32** %12
%48 = call i32 @stabilizer(i32* %43, i32 1, i32* %44, i32 %45, i32 %46, i32* %47, i32* %13)
%49 = load i32, i32* %15
%50 = sext i32 %49 to i64
%51 = load i32*, i32** %7
%52 = getelementptr inbounds i32, i32* %51, i64 1
%53 = load i32, i32* %8
%54 = sub nsw i32 %53, 1
%55 = load i32*, i32** %12
%56 = load i32, i32* %13
%57 = load i32, i32* %11
%58 = call i64 @order_of_group(i32* %52, i32 %54, i32* %55, i32 %56, i32 %57)
%59 = mul nsw i64 %50, %58
store i64 %59, i64* %16
%60 = load i32*, i32** %12
%61 = call i32 @free(i32* %60)
%62 = load i32*, i32** %14
%63 = call i32 @free(i32* %62)
%64 = load i64, i64* %16
store i64 %64, i64* %6
br label %65
65: ; preds = %20, %19
%66 = load i64, i64* %6
ret i64 %66
}

LLVM IR (-O2):
define i64 @order_of_group(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = icmp eq i32 %3, 0
br i1 %8, label %31, label %9
9: ; preds = %5
%10 = shl i32 %3, 2
%11 = mul i32 %10, %4
%12 = tail call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i32*
%14 = bitcast i32* %6 to i8*
%15 = shl i32 %4, 2
%16 = tail call i64 @malloc(i32 %15)
%17 = inttoptr i64 %16 to i32*
%18 = bitcast i32* %7 to i8*
%19 = load i32, i32* %0
%20 = call i32 @one_orbit(i32 %19, i32* %2, i32 %3, i32 %4, i32* %17, i32* %7)
%21 = call i32 @stabilizer(i32* %0, i32 1, i32* %2, i32 %3, i32 %4, i32* %13, i32* %6)
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %0, i64 1
%25 = add nsw i32 %1, -1
%26 = load i32, i32* %6
%27 = call i64 @order_of_group(i32* %24, i32 %25, i32* %13, i32 %26, i32 %4)
%28 = mul nsw i64 %27, %23
%29 = call i32 @free(i32* %13)
%30 = call i32 @free(i32* %17)
br label %31
31: ; preds = %5, %9
%32 = phi i64 [ %28, %9 ], [ 1, %5 ]
ret i64 %32
}