#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ copy(int, int *, int *);
int /*<<< orphan*/ f2m_Add(int, int *, int *, int *);
scalar_t__ f2m_is_equal(int, int *, int *);
scalar_t__ getDegree(int, int *);
int /*<<< orphan*/ shiftRight(int, int *);
void f2m_calculateInverse(uint32_t t, uint32_t *A, uint32_t *F, uint32_t *I) {
  uint32_t i, u[t], v[t], g1[t], g2[t], one[t], zero[t];
  for (i = 0; i < t; i++) {
    u[i] = A[i];
    v[i] = F[i];
    g1[i] = 0x0;
    g2[i] = 0x0;
    zero[i] = 0x0;
    one[i] = 0x0;
  }
  if (f2m_is_equal(t, A, zero)) {
    copy(t, zero, I);
    return;
  }
  g1[0] = 0x1;
  one[0] = 0x1;
  while (!f2m_is_equal(t, u, one) && !f2m_is_equal(t, v, one)) {
    while (!f2m_is_equal(t, u, zero) && (u[0] & 1) == 0) {
      shiftRight(t, u);
      if ((g1[0] & 1) == 0) {
        shiftRight(t, g1);
      } else {
        f2m_Add(t, g1, F, g1);
        shiftRight(t, g1);
      }
    }
    while (!f2m_is_equal(t, v, zero) && (v[0] & 1) == 0) {
      shiftRight(t, v);
      if ((g2[0] & 1) == 0) {
        shiftRight(t, g2);
      } else {
        f2m_Add(t, g2, F, g2);
        shiftRight(t, g2);
      }
    }
    if (getDegree(t, u) > getDegree(t, v)) {
      f2m_Add(t, u, v, u);
      f2m_Add(t, g1, g2, g1);
    } else {
      f2m_Add(t, v, u, v);
      f2m_Add(t, g2, g1, g2);
    }
  }
  if (f2m_is_equal(t, u, one)) {
    copy(t, g1, I);
  } else {
    copy(t, g2, I);
  }
}


x86 assembly (clang, -O0):
<f2m_calculateInverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x98(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x90(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x88(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x80(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x58(%rbp)
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12d0 <f2m_calculateInverse+0x180>
mov    -0x78(%rbp),%rax
mov    -0x70(%rbp),%rcx
mov    -0x80(%rbp),%rdx
mov    -0x88(%rbp),%rsi
mov    -0x90(%rbp),%rdi
mov    -0x98(%rbp),%r8
mov    -0x10(%rbp),%r9
movslq -0x24(%rbp),%r10
mov    (%r9,%r10,4),%r10d
movslq -0x24(%rbp),%r9
mov    %r10d,(%r8,%r9,4)
mov    -0x18(%rbp),%r8
movslq -0x24(%rbp),%r9
mov    (%r8,%r9,4),%r9d
movslq -0x24(%rbp),%r8
mov    %r9d,(%rdi,%r8,4)
movslq -0x24(%rbp),%rdi
movl   $0x0,(%rsi,%rdi,4)
movslq -0x24(%rbp),%rsi
movl   $0x0,(%rdx,%rsi,4)
movslq -0x24(%rbp),%rdx
movl   $0x0,(%rcx,%rdx,4)
movslq -0x24(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1241 <f2m_calculateInverse+0xf1>
mov    -0x70(%rbp),%rdx
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <f2m_is_equal@plt>
cmp    $0x0,%rax
je     1306 <f2m_calculateInverse+0x1b6>
mov    -0x70(%rbp),%rsi
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rdx
call   1060 <copy@plt>
movl   $0x1,-0x64(%rbp)
jmp    15ce <f2m_calculateInverse+0x47e>
mov    -0x78(%rbp),%rax
mov    -0x88(%rbp),%rcx
movl   $0x1,(%rcx)
movl   $0x1,(%rax)
mov    -0x78(%rbp),%rdx
mov    -0x98(%rbp),%rsi
mov    -0x4(%rbp),%edi
call   1030 <f2m_is_equal@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x99(%rbp)
jne    1367 <f2m_calculateInverse+0x217>
mov    -0x78(%rbp),%rdx
mov    -0x90(%rbp),%rsi
mov    -0x4(%rbp),%edi
call   1030 <f2m_is_equal@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x99(%rbp)
mov    -0x99(%rbp),%al
test   $0x1,%al
jne    137a <f2m_calculateInverse+0x22a>
jmp    1582 <f2m_calculateInverse+0x432>
jmp    137f <f2m_calculateInverse+0x22f>
mov    -0x70(%rbp),%rdx
mov    -0x98(%rbp),%rsi
mov    -0x4(%rbp),%edi
call   1030 <f2m_is_equal@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9a(%rbp)
jne    13bf <f2m_calculateInverse+0x26f>
mov    -0x98(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9a(%rbp)
mov    -0x9a(%rbp),%al
test   $0x1,%al
jne    13d2 <f2m_calculateInverse+0x282>
jmp    1434 <f2m_calculateInverse+0x2e4>
mov    -0x98(%rbp),%rsi
mov    -0x4(%rbp),%edi
call   1050 <shiftRight@plt>
mov    -0x88(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    140a <f2m_calculateInverse+0x2ba>
mov    -0x88(%rbp),%rsi
mov    -0x4(%rbp),%edi
call   1050 <shiftRight@plt>
jmp    142f <f2m_calculateInverse+0x2df>
mov    -0x88(%rbp),%rcx
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rcx,%rsi
call   1070 <f2m_Add@plt>
mov    -0x88(%rbp),%rsi
mov    -0x4(%rbp),%edi
call   1050 <shiftRight@plt>
jmp    137f <f2m_calculateInverse+0x22f>
jmp    1439 <f2m_calculateInverse+0x2e9>
mov    -0x70(%rbp),%rdx
mov    -0x90(%rbp),%rsi
mov    -0x4(%rbp),%edi
call   1030 <f2m_is_equal@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9b(%rbp)
jne    1479 <f2m_calculateInverse+0x329>
mov    -0x90(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9b(%rbp)
mov    -0x9b(%rbp),%al
test   $0x1,%al
jne    148c <f2m_calculateInverse+0x33c>
jmp    14e2 <f2m_calculateInverse+0x392>
mov    -0x90(%rbp),%rsi
mov    -0x4(%rbp),%edi
call   1050 <shiftRight@plt>
mov    -0x80(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    14be <f2m_calculateInverse+0x36e>
mov    -0x80(%rbp),%rsi
mov    -0x4(%rbp),%edi
call   1050 <shiftRight@plt>
jmp    14dd <f2m_calculateInverse+0x38d>
mov    -0x80(%rbp),%rcx
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rcx,%rsi
call   1070 <f2m_Add@plt>
mov    -0x80(%rbp),%rsi
mov    -0x4(%rbp),%edi
call   1050 <shiftRight@plt>
jmp    1439 <f2m_calculateInverse+0x2e9>
mov    -0x98(%rbp),%rsi
mov    -0x4(%rbp),%edi
call   1040 <getDegree@plt>
mov    -0x90(%rbp),%rsi
mov    %rax,-0xa8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <getDegree@plt>
mov    %rax,%rcx
mov    -0xa8(%rbp),%rax
cmp    %rcx,%rax
jle    154e <f2m_calculateInverse+0x3fe>
mov    -0x98(%rbp),%rcx
mov    -0x90(%rbp),%rdx
mov    -0x4(%rbp),%edi
mov    %rcx,%rsi
call   1070 <f2m_Add@plt>
mov    -0x80(%rbp),%rdx
mov    -0x88(%rbp),%rcx
mov    -0x4(%rbp),%edi
mov    %rcx,%rsi
call   1070 <f2m_Add@plt>
jmp    157d <f2m_calculateInverse+0x42d>
mov    -0x90(%rbp),%rcx
mov    -0x98(%rbp),%rdx
mov    -0x4(%rbp),%edi
mov    %rcx,%rsi
call   1070 <f2m_Add@plt>
mov    -0x88(%rbp),%rdx
mov    -0x80(%rbp),%rcx
mov    -0x4(%rbp),%edi
mov    %rcx,%rsi
call   1070 <f2m_Add@plt>
jmp    131d <f2m_calculateInverse+0x1cd>
mov    -0x78(%rbp),%rdx
mov    -0x98(%rbp),%rsi
mov    -0x4(%rbp),%edi
call   1030 <f2m_is_equal@plt>
cmp    $0x0,%rax
je     15b7 <f2m_calculateInverse+0x467>
mov    -0x88(%rbp),%rsi
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rdx
call   1060 <copy@plt>
jmp    15c7 <f2m_calculateInverse+0x477>
mov    -0x80(%rbp),%rsi
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rdx
call   1060 <copy@plt>
movl   $0x0,-0x64(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2m_calculateInverse>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rcx,-0x58(%rbp)
mov    %rdx,%r8
mov    %edi,%ebx
mov    %edi,%r13d
mov    %rsp,%r12
lea    0xf(,%r13,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    %rsp,%r14
sub    %rax,%r14
mov    %r14,%rsp
mov    %rsp,%rdi
sub    %rax,%rdi
mov    %rdi,%rsp
mov    %rsp,%r15
sub    %rax,%r15
mov    %r15,%rsp
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,%rsp
mov    %rsp,%rdx
sub    %rax,%rdx
mov    %rdx,%rsp
test   %ebx,%ebx
mov    %rdx,-0x30(%rbp)
mov    %r8,-0x50(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %rdi,-0x48(%rbp)
jle    124c <f2m_calculateInverse+0xdc>
shl    $0x2,%r13
mov    -0x48(%rbp),%rdi
mov    %rsi,-0x40(%rbp)
xor    %esi,%esi
mov    %r13,%rdx
call   1060 <memset@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    %r13,%rdx
call   1060 <memset@plt>
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    %r13,%rdx
call   1060 <memset@plt>
mov    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    %r13,%rdx
call   1060 <memset@plt>
mov    %r12,%rdi
mov    -0x40(%rbp),%rsi
mov    %r13,%rdx
call   1080 <memcpy@plt>
mov    %r14,%rdi
mov    -0x50(%rbp),%rsi
mov    %r13,%rdx
call   1080 <memcpy@plt>
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    %rdi,%r13
mov    %ebx,%edi
call   1030 <f2m_is_equal@plt>
test   %rax,%rax
je     1264 <f2m_calculateInverse+0xf4>
mov    -0x30(%rbp),%rsi
jmp    13ed <f2m_calculateInverse+0x27d>
movl   $0x1,0x0(%r13)
mov    -0x38(%rbp),%r13
movl   $0x1,0x0(%r13)
jmp    12a4 <f2m_calculateInverse+0x134>
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
call   1090 <f2m_Add@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
call   1090 <f2m_Add@plt>
mov    -0x38(%rbp),%r13
mov    %ebx,%edi
mov    %r12,%rsi
mov    %r13,%rdx
call   1030 <f2m_is_equal@plt>
test   %rax,%rax
jne    13d2 <f2m_calculateInverse+0x262>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r13,%rdx
call   1030 <f2m_is_equal@plt>
test   %rax,%rax
jne    13d2 <f2m_calculateInverse+0x262>
mov    %ebx,%edi
mov    %r12,%rsi
mov    -0x30(%rbp),%rdx
call   1030 <f2m_is_equal@plt>
test   %rax,%rax
mov    -0x48(%rbp),%r13
jne    134a <f2m_calculateInverse+0x1da>
jmp    130d <f2m_calculateInverse+0x19d>
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %r13,%rsi
call   1050 <shiftRight@plt>
mov    %ebx,%edi
mov    %r12,%rsi
mov    -0x30(%rbp),%rdx
call   1030 <f2m_is_equal@plt>
test   %rax,%rax
jne    134a <f2m_calculateInverse+0x1da>
testb  $0x1,(%r12)
jne    134a <f2m_calculateInverse+0x1da>
mov    %ebx,%edi
mov    %r12,%rsi
call   1050 <shiftRight@plt>
testb  $0x1,0x0(%r13)
je     12f0 <f2m_calculateInverse+0x180>
mov    %ebx,%edi
mov    %r13,%rsi
mov    -0x50(%rbp),%rdx
mov    %r13,%rcx
call   1090 <f2m_Add@plt>
jmp    12f0 <f2m_calculateInverse+0x180>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r15,%rsi
call   1050 <shiftRight@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    -0x30(%rbp),%rdx
call   1030 <f2m_is_equal@plt>
test   %rax,%rax
jne    1390 <f2m_calculateInverse+0x220>
testb  $0x1,(%r14)
jne    1390 <f2m_calculateInverse+0x220>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <shiftRight@plt>
testb  $0x1,(%r15)
je     1340 <f2m_calculateInverse+0x1d0>
mov    %ebx,%edi
mov    %r15,%rsi
mov    -0x50(%rbp),%rdx
mov    %r15,%rcx
call   1090 <f2m_Add@plt>
jmp    1340 <f2m_calculateInverse+0x1d0>
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r12,%rsi
call   1040 <getDegree@plt>
mov    %rax,-0x40(%rbp)
mov    %ebx,%edi
mov    %r14,%rsi
call   1040 <getDegree@plt>
cmp    %rax,-0x40(%rbp)
jle    1280 <f2m_calculateInverse+0x110>
mov    %ebx,%edi
mov    %r12,%rsi
mov    %r14,%rdx
mov    %r12,%rcx
call   1090 <f2m_Add@plt>
mov    %ebx,%edi
mov    %r13,%rsi
mov    %r15,%rdx
mov    %r13,%rcx
jmp    129b <f2m_calculateInverse+0x12b>
mov    %ebx,%edi
mov    %r12,%rsi
mov    %r13,%rdx
call   1030 <f2m_is_equal@plt>
test   %rax,%rax
mov    -0x48(%rbp),%rax
cmove  %r15,%rax
mov    %rax,%rsi
mov    %ebx,%edi
mov    -0x58(%rbp),%rdx
call   1070 <copy@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @f2m_calculateInverse(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%18 = load i32, i32* %5
%19 = zext i32 %18 to i64
%20 = call i8* @llvm.stacksave()
store i8* %20, i8** %10
%21 = alloca i32, i64 %19
store i64 %19, i64* %11
%22 = load i32, i32* %5
%23 = zext i32 %22 to i64
%24 = alloca i32, i64 %23
store i64 %23, i64* %12
%25 = load i32, i32* %5
%26 = zext i32 %25 to i64
%27 = alloca i32, i64 %26
store i64 %26, i64* %13
%28 = load i32, i32* %5
%29 = zext i32 %28 to i64
%30 = alloca i32, i64 %29
store i64 %29, i64* %14
%31 = load i32, i32* %5
%32 = zext i32 %31 to i64
%33 = alloca i32, i64 %32
store i64 %32, i64* %15
%34 = load i32, i32* %5
%35 = zext i32 %34 to i64
%36 = alloca i32, i64 %35
store i64 %35, i64* %16
store i32 0, i32* %9
br label %37
37: ; preds = %70, %4
%38 = load i32, i32* %9
%39 = load i32, i32* %5
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %73
41: ; preds = %37
%42 = load i32*, i32** %6
%43 = load i32, i32* %9
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %42, i64 %44
%46 = load i32, i32* %45
%47 = load i32, i32* %9
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %21, i64 %48
store i32 %46, i32* %49
%50 = load i32*, i32** %7
%51 = load i32, i32* %9
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i32, i32* %50, i64 %52
%54 = load i32, i32* %53
%55 = load i32, i32* %9
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32, i32* %24, i64 %56
store i32 %54, i32* %57
%58 = load i32, i32* %9
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i32, i32* %27, i64 %59
store i32 0, i32* %60
%61 = load i32, i32* %9
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i32, i32* %30, i64 %62
store i32 0, i32* %63
%64 = load i32, i32* %9
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i32, i32* %36, i64 %65
store i32 0, i32* %66
%67 = load i32, i32* %9
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i32, i32* %33, i64 %68
store i32 0, i32* %69
br label %70
70: ; preds = %41
%71 = load i32, i32* %9
%72 = add nsw i32 %71, 1
store i32 %72, i32* %9
br label %37
73: ; preds = %37
%74 = load i32, i32* %5
%75 = load i32*, i32** %6
%76 = call i64 @f2m_is_equal(i32 %74, i32* %75, i32* %36)
%77 = icmp ne i64 %76, 0
br i1 %77, label %78, label %82
78: ; preds = %73
%79 = load i32, i32* %5
%80 = load i32*, i32** %8
%81 = call i32 @copy(i32 %79, i32* %36, i32* %80)
store i32 1, i32* %17
br label %184
82: ; preds = %73
%83 = getelementptr inbounds i32, i32* %27, i64 0
store i32 1, i32* %83
%84 = getelementptr inbounds i32, i32* %33, i64 0
store i32 1, i32* %84
br label %85
85: ; preds = %170, %82
%86 = load i32, i32* %5
%87 = call i64 @f2m_is_equal(i32 %86, i32* %21, i32* %33)
%88 = icmp ne i64 %87, 0
br i1 %88, label %94, label %89
89: ; preds = %85
%90 = load i32, i32* %5
%91 = call i64 @f2m_is_equal(i32 %90, i32* %24, i32* %33)
%92 = icmp ne i64 %91, 0
%93 = xor i1 %92, true
br label %94
94: ; preds = %89, %85
%95 = phi i1 [ false, %85 ], [ %93, %89 ]
br i1 %95, label %96, label %171
96: ; preds = %94
br label %97
97: ; preds = %124, %96
%98 = load i32, i32* %5
%99 = call i64 @f2m_is_equal(i32 %98, i32* %21, i32* %36)
%100 = icmp ne i64 %99, 0
br i1 %100, label %106, label %101
101: ; preds = %97
%102 = getelementptr inbounds i32, i32* %21, i64 0
%103 = load i32, i32* %102
%104 = and i32 %103, 1
%105 = icmp eq i32 %104, 0
br label %106
106: ; preds = %101, %97
%107 = phi i1 [ false, %97 ], [ %105, %101 ]
br i1 %107, label %108, label %125
108: ; preds = %106
%109 = load i32, i32* %5
%110 = call i32 @shiftRight(i32 %109, i32* %21)
%111 = getelementptr inbounds i32, i32* %27, i64 0
%112 = load i32, i32* %111
%113 = and i32 %112, 1
%114 = icmp eq i32 %113, 0
br i1 %114, label %115, label %118
115: ; preds = %108
%116 = load i32, i32* %5
%117 = call i32 @shiftRight(i32 %116, i32* %27)
br label %124
118: ; preds = %108
%119 = load i32, i32* %5
%120 = load i32*, i32** %7
%121 = call i32 @f2m_Add(i32 %119, i32* %27, i32* %120, i32* %27)
%122 = load i32, i32* %5
%123 = call i32 @shiftRight(i32 %122, i32* %27)
br label %124
124: ; preds = %118, %115
br label %97
125: ; preds = %106
br label %126
126: ; preds = %153, %125
%127 = load i32, i32* %5
%128 = call i64 @f2m_is_equal(i32 %127, i32* %24, i32* %36)
%129 = icmp ne i64 %128, 0
br i1 %129, label %135, label %130
130: ; preds = %126
%131 = getelementptr inbounds i32, i32* %24, i64 0
%132 = load i32, i32* %131
%133 = and i32 %132, 1
%134 = icmp eq i32 %133, 0
br label %135
135: ; preds = %130, %126
%136 = phi i1 [ false, %126 ], [ %134, %130 ]
br i1 %136, label %137, label %154
137: ; preds = %135
%138 = load i32, i32* %5
%139 = call i32 @shiftRight(i32 %138, i32* %24)
%140 = getelementptr inbounds i32, i32* %30, i64 0
%141 = load i32, i32* %140
%142 = and i32 %141, 1
%143 = icmp eq i32 %142, 0
br i1 %143, label %144, label %147
144: ; preds = %137
%145 = load i32, i32* %5
%146 = call i32 @shiftRight(i32 %145, i32* %30)
br label %153
147: ; preds = %137
%148 = load i32, i32* %5
%149 = load i32*, i32** %7
%150 = call i32 @f2m_Add(i32 %148, i32* %30, i32* %149, i32* %30)
%151 = load i32, i32* %5
%152 = call i32 @shiftRight(i32 %151, i32* %30)
br label %153
153: ; preds = %147, %144
br label %126
154: ; preds = %135
%155 = load i32, i32* %5
%156 = call i64 @getDegree(i32 %155, i32* %21)
%157 = load i32, i32* %5
%158 = call i64 @getDegree(i32 %157, i32* %24)
%159 = icmp sgt i64 %156, %158
br i1 %159, label %160, label %165
160: ; preds = %154
%161 = load i32, i32* %5
%162 = call i32 @f2m_Add(i32 %161, i32* %21, i32* %24, i32* %21)
%163 = load i32, i32* %5
%164 = call i32 @f2m_Add(i32 %163, i32* %27, i32* %30, i32* %27)
br label %170
165: ; preds = %154
%166 = load i32, i32* %5
%167 = call i32 @f2m_Add(i32 %166, i32* %24, i32* %21, i32* %24)
%168 = load i32, i32* %5
%169 = call i32 @f2m_Add(i32 %168, i32* %30, i32* %27, i32* %30)
br label %170
170: ; preds = %165, %160
br label %85
171: ; preds = %94
%172 = load i32, i32* %5
%173 = call i64 @f2m_is_equal(i32 %172, i32* %21, i32* %33)
%174 = icmp ne i64 %173, 0
br i1 %174, label %175, label %179
175: ; preds = %171
%176 = load i32, i32* %5
%177 = load i32*, i32** %8
%178 = call i32 @copy(i32 %176, i32* %27, i32* %177)
br label %183
179: ; preds = %171
%180 = load i32, i32* %5
%181 = load i32*, i32** %8
%182 = call i32 @copy(i32 %180, i32* %30, i32* %181)
br label %183
183: ; preds = %179, %175
store i32 0, i32* %17
br label %184
184: ; preds = %183, %78
%185 = load i8*, i8** %10
%186 = load i32, i32* %17
switch i32 %186, label %188 [
i32 0, label %187
i32 1, label %187
]
187: ; preds = %184, %184
ret void
188: ; preds = %184
unreachable
}

LLVM IR (-O2):
define void @f2m_calculateInverse(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = zext i32 %0 to i64
%6 = alloca i32, i64 %5
%7 = alloca i32, i64 %5
%8 = alloca i32, i64 %5
%9 = alloca i32, i64 %5
%10 = alloca i32, i64 %5
%11 = alloca i32, i64 %5
%12 = icmp sgt i32 %0, 0
br i1 %12, label %13, label %23
13: ; preds = %4
%14 = bitcast i32* %11 to i8*
%15 = bitcast i32* %10 to i8*
%16 = bitcast i32* %9 to i8*
%17 = bitcast i32* %8 to i8*
%18 = bitcast i32* %7 to i8*
%19 = bitcast i32* %6 to i8*
%20 = bitcast i32* %2 to i8*
%21 = bitcast i32* %1 to i8*
%22 = shl nuw nsw i64 %5, 2
br label %23
23: ; preds = %13, %4
%24 = call i64 @f2m_is_equal(i32 %0, i32* %1, i32* %11)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %85
26: ; preds = %23
store i32 1, i32* %8
store i32 1, i32* %10
%27 = call i64 @f2m_is_equal(i32 %0, i32* %6, i32* %10)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %81
29: ; preds = %26, %78
%30 = call i64 @f2m_is_equal(i32 %0, i32* %7, i32* %10)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %81
32: ; preds = %29
%33 = call i64 @f2m_is_equal(i32 %0, i32* %6, i32* %11)
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %50
35: ; preds = %32, %46
%36 = load i32, i32* %6
%37 = and i32 %36, 1
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %50
39: ; preds = %35
%40 = call i32 @shiftRight(i32 %0, i32* %6)
%41 = load i32, i32* %8
%42 = and i32 %41, 1
%43 = icmp eq i32 %42, 0
br i1 %43, label %46, label %44
44: ; preds = %39
%45 = call i32 @f2m_Add(i32 %0, i32* %8, i32* %2, i32* %8)
br label %46
46: ; preds = %39, %44
%47 = call i32 @shiftRight(i32 %0, i32* %8)
%48 = call i64 @f2m_is_equal(i32 %0, i32* %6, i32* %11)
%49 = icmp eq i64 %48, 0
br i1 %49, label %35, label %50
50: ; preds = %35, %46, %32
%51 = call i64 @f2m_is_equal(i32 %0, i32* %7, i32* %11)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %68
53: ; preds = %50, %64
%54 = load i32, i32* %7
%55 = and i32 %54, 1
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %68
57: ; preds = %53
%58 = call i32 @shiftRight(i32 %0, i32* %7)
%59 = load i32, i32* %9
%60 = and i32 %59, 1
%61 = icmp eq i32 %60, 0
br i1 %61, label %64, label %62
62: ; preds = %57
%63 = call i32 @f2m_Add(i32 %0, i32* %9, i32* %2, i32* %9)
br label %64
64: ; preds = %57, %62
%65 = call i32 @shiftRight(i32 %0, i32* %9)
%66 = call i64 @f2m_is_equal(i32 %0, i32* %7, i32* %11)
%67 = icmp eq i64 %66, 0
br i1 %67, label %53, label %68
68: ; preds = %53, %64, %50
%69 = call i64 @getDegree(i32 %0, i32* %6)
%70 = call i64 @getDegree(i32 %0, i32* %7)
%71 = icmp sgt i64 %69, %70
br i1 %71, label %72, label %75
72: ; preds = %68
%73 = call i32 @f2m_Add(i32 %0, i32* %6, i32* %7, i32* %6)
%74 = call i32 @f2m_Add(i32 %0, i32* %8, i32* %9, i32* %8)
br label %78
75: ; preds = %68
%76 = call i32 @f2m_Add(i32 %0, i32* %7, i32* %6, i32* %7)
%77 = call i32 @f2m_Add(i32 %0, i32* %9, i32* %8, i32* %9)
br label %78
78: ; preds = %75, %72
%79 = call i64 @f2m_is_equal(i32 %0, i32* %6, i32* %10)
%80 = icmp eq i64 %79, 0
br i1 %80, label %29, label %81
81: ; preds = %29, %78, %26
%82 = call i64 @f2m_is_equal(i32 %0, i32* %6, i32* %10)
%83 = icmp eq i64 %82, 0
%84 = select i1 %83, i32* %9, i32* %8
br label %85
85: ; preds = %81, %23
%86 = phi i32* [ %11, %23 ], [ %84, %81 ]
%87 = call i32 @copy(i32 %0, i32* %86, i32* %3)
ret void
}