#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 /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_addmul(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int /*<<< orphan*/ mpz_clears(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/ *);
int /*<<< orphan*/ mpz_inits(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/ *);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set(int /*<<< orphan*/, int /*<<< orphan*/);
void multiply(mpz_t F[2][2], mpz_t M[2][2]) {
  mpz_t x, y, z, w;
  mpz_inits(x, y, z, w, NULL);
  mpz_mul(x, F[0][0], M[0][0]);
  mpz_addmul(x, F[0][1], M[1][0]);
  mpz_mul(y, F[0][0], M[0][1]);
  mpz_addmul(y, F[0][1], M[1][1]);
  mpz_mul(z, F[1][0], M[0][0]);
  mpz_addmul(z, F[1][1], M[1][0]);
  mpz_mul(w, F[1][0], M[0][1]);
  mpz_addmul(w, F[1][1], M[1][1]);
  mpz_set(F[0][0], x);
  mpz_set(F[0][1], y);
  mpz_set(F[1][0], z);
  mpz_set(F[1][1], w);
  mpz_clears(x, y, z, w, NULL);
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1060 <mpz_inits@plt>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
call   1050 <mpz_mul@plt>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%edx
call   1070 <mpz_addmul@plt>
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
call   1050 <mpz_mul@plt>
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%edx
call   1070 <mpz_addmul@plt>
mov    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
call   1050 <mpz_mul@plt>
mov    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%edx
call   1070 <mpz_addmul@plt>
mov    -0x20(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
call   1050 <mpz_mul@plt>
mov    -0x20(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%esi
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%edx
call   1070 <mpz_addmul@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%esi
call   1030 <mpz_set@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
mov    -0x18(%rbp),%esi
call   1030 <mpz_set@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edi
mov    -0x1c(%rbp),%esi
call   1030 <mpz_set@plt>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%edi
mov    -0x20(%rbp),%esi
call   1030 <mpz_set@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1040 <mpz_clears@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %r8d,%r8d
call   1060 <mpz_inits@plt>
mov    (%rbx),%esi
mov    (%r14),%edx
call   1050 <mpz_mul@plt>
mov    0x4(%rbx),%esi
mov    0x8(%r14),%edx
call   1070 <mpz_addmul@plt>
mov    (%rbx),%esi
mov    0x4(%r14),%edx
call   1050 <mpz_mul@plt>
mov    0x4(%rbx),%esi
mov    0xc(%r14),%edx
call   1070 <mpz_addmul@plt>
mov    0x8(%rbx),%esi
mov    (%r14),%edx
call   1050 <mpz_mul@plt>
mov    0xc(%rbx),%esi
mov    0x8(%r14),%edx
call   1070 <mpz_addmul@plt>
mov    0x8(%rbx),%esi
mov    0x4(%r14),%edx
call   1050 <mpz_mul@plt>
mov    0xc(%rbx),%esi
mov    0xc(%r14),%edx
call   1070 <mpz_addmul@plt>
mov    (%rbx),%edi
call   1030 <mpz_set@plt>
mov    0x4(%rbx),%edi
call   1030 <mpz_set@plt>
mov    0x8(%rbx),%edi
call   1030 <mpz_set@plt>
mov    0xc(%rbx),%edi
call   1030 <mpz_set@plt>
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <mpz_clears@plt>

LLVM IR (-O0):
define void @multiply([2 x i32]* %0, [2 x i32]* %1) {
%3 = alloca [2 x i32]*
%4 = alloca [2 x i32]*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store [2 x i32]* %0, [2 x i32]** %3
store [2 x i32]* %1, [2 x i32]** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @mpz_inits(i32 %9, i32 %10, i32 %11, i32 %12, i32* null)
%14 = load i32, i32* %5
%15 = load [2 x i32]*, [2 x i32]** %3
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %15, i64 0
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 0
%18 = load i32, i32* %17
%19 = load [2 x i32]*, [2 x i32]** %4
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %19, i64 0
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %20, i64 0, i64 0
%22 = load i32, i32* %21
%23 = call i32 @mpz_mul(i32 %14, i32 %18, i32 %22)
%24 = load i32, i32* %5
%25 = load [2 x i32]*, [2 x i32]** %3
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %25, i64 0
%27 = getelementptr inbounds [2 x i32], [2 x i32]* %26, i64 0, i64 1
%28 = load i32, i32* %27
%29 = load [2 x i32]*, [2 x i32]** %4
%30 = getelementptr inbounds [2 x i32], [2 x i32]* %29, i64 1
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %30, i64 0, i64 0
%32 = load i32, i32* %31
%33 = call i32 @mpz_addmul(i32 %24, i32 %28, i32 %32)
%34 = load i32, i32* %6
%35 = load [2 x i32]*, [2 x i32]** %3
%36 = getelementptr inbounds [2 x i32], [2 x i32]* %35, i64 0
%37 = getelementptr inbounds [2 x i32], [2 x i32]* %36, i64 0, i64 0
%38 = load i32, i32* %37
%39 = load [2 x i32]*, [2 x i32]** %4
%40 = getelementptr inbounds [2 x i32], [2 x i32]* %39, i64 0
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %40, i64 0, i64 1
%42 = load i32, i32* %41
%43 = call i32 @mpz_mul(i32 %34, i32 %38, i32 %42)
%44 = load i32, i32* %6
%45 = load [2 x i32]*, [2 x i32]** %3
%46 = getelementptr inbounds [2 x i32], [2 x i32]* %45, i64 0
%47 = getelementptr inbounds [2 x i32], [2 x i32]* %46, i64 0, i64 1
%48 = load i32, i32* %47
%49 = load [2 x i32]*, [2 x i32]** %4
%50 = getelementptr inbounds [2 x i32], [2 x i32]* %49, i64 1
%51 = getelementptr inbounds [2 x i32], [2 x i32]* %50, i64 0, i64 1
%52 = load i32, i32* %51
%53 = call i32 @mpz_addmul(i32 %44, i32 %48, i32 %52)
%54 = load i32, i32* %7
%55 = load [2 x i32]*, [2 x i32]** %3
%56 = getelementptr inbounds [2 x i32], [2 x i32]* %55, i64 1
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %56, i64 0, i64 0
%58 = load i32, i32* %57
%59 = load [2 x i32]*, [2 x i32]** %4
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %59, i64 0
%61 = getelementptr inbounds [2 x i32], [2 x i32]* %60, i64 0, i64 0
%62 = load i32, i32* %61
%63 = call i32 @mpz_mul(i32 %54, i32 %58, i32 %62)
%64 = load i32, i32* %7
%65 = load [2 x i32]*, [2 x i32]** %3
%66 = getelementptr inbounds [2 x i32], [2 x i32]* %65, i64 1
%67 = getelementptr inbounds [2 x i32], [2 x i32]* %66, i64 0, i64 1
%68 = load i32, i32* %67
%69 = load [2 x i32]*, [2 x i32]** %4
%70 = getelementptr inbounds [2 x i32], [2 x i32]* %69, i64 1
%71 = getelementptr inbounds [2 x i32], [2 x i32]* %70, i64 0, i64 0
%72 = load i32, i32* %71
%73 = call i32 @mpz_addmul(i32 %64, i32 %68, i32 %72)
%74 = load i32, i32* %8
%75 = load [2 x i32]*, [2 x i32]** %3
%76 = getelementptr inbounds [2 x i32], [2 x i32]* %75, i64 1
%77 = getelementptr inbounds [2 x i32], [2 x i32]* %76, i64 0, i64 0
%78 = load i32, i32* %77
%79 = load [2 x i32]*, [2 x i32]** %4
%80 = getelementptr inbounds [2 x i32], [2 x i32]* %79, i64 0
%81 = getelementptr inbounds [2 x i32], [2 x i32]* %80, i64 0, i64 1
%82 = load i32, i32* %81
%83 = call i32 @mpz_mul(i32 %74, i32 %78, i32 %82)
%84 = load i32, i32* %8
%85 = load [2 x i32]*, [2 x i32]** %3
%86 = getelementptr inbounds [2 x i32], [2 x i32]* %85, i64 1
%87 = getelementptr inbounds [2 x i32], [2 x i32]* %86, i64 0, i64 1
%88 = load i32, i32* %87
%89 = load [2 x i32]*, [2 x i32]** %4
%90 = getelementptr inbounds [2 x i32], [2 x i32]* %89, i64 1
%91 = getelementptr inbounds [2 x i32], [2 x i32]* %90, i64 0, i64 1
%92 = load i32, i32* %91
%93 = call i32 @mpz_addmul(i32 %84, i32 %88, i32 %92)
%94 = load [2 x i32]*, [2 x i32]** %3
%95 = getelementptr inbounds [2 x i32], [2 x i32]* %94, i64 0
%96 = getelementptr inbounds [2 x i32], [2 x i32]* %95, i64 0, i64 0
%97 = load i32, i32* %96
%98 = load i32, i32* %5
%99 = call i32 @mpz_set(i32 %97, i32 %98)
%100 = load [2 x i32]*, [2 x i32]** %3
%101 = getelementptr inbounds [2 x i32], [2 x i32]* %100, i64 0
%102 = getelementptr inbounds [2 x i32], [2 x i32]* %101, i64 0, i64 1
%103 = load i32, i32* %102
%104 = load i32, i32* %6
%105 = call i32 @mpz_set(i32 %103, i32 %104)
%106 = load [2 x i32]*, [2 x i32]** %3
%107 = getelementptr inbounds [2 x i32], [2 x i32]* %106, i64 1
%108 = getelementptr inbounds [2 x i32], [2 x i32]* %107, i64 0, i64 0
%109 = load i32, i32* %108
%110 = load i32, i32* %7
%111 = call i32 @mpz_set(i32 %109, i32 %110)
%112 = load [2 x i32]*, [2 x i32]** %3
%113 = getelementptr inbounds [2 x i32], [2 x i32]* %112, i64 1
%114 = getelementptr inbounds [2 x i32], [2 x i32]* %113, i64 0, i64 1
%115 = load i32, i32* %114
%116 = load i32, i32* %8
%117 = call i32 @mpz_set(i32 %115, i32 %116)
%118 = load i32, i32* %5
%119 = load i32, i32* %6
%120 = load i32, i32* %7
%121 = load i32, i32* %8
%122 = call i32 @mpz_clears(i32 %118, i32 %119, i32 %120, i32 %121, i32* null)
ret void
}

LLVM IR (-O2):
define void @multiply([2 x i32]* nocapture %0, [2 x i32]* nocapture %1) {
%3 = tail call i32 @mpz_inits(i32 undef, i32 undef, i32 undef, i32 undef, i32* null)
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 0, i64 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%7 = load i32, i32* %6
%8 = tail call i32 @mpz_mul(i32 undef, i32 %5, i32 %7)
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 0, i64 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 1, i64 0
%12 = load i32, i32* %11
%13 = tail call i32 @mpz_addmul(i32 undef, i32 %10, i32 %12)
%14 = load i32, i32* %4
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%16 = load i32, i32* %15
%17 = tail call i32 @mpz_mul(i32 undef, i32 %14, i32 %16)
%18 = load i32, i32* %9
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 1, i64 1
%20 = load i32, i32* %19
%21 = tail call i32 @mpz_addmul(i32 undef, i32 %18, i32 %20)
%22 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 1, i64 0
%23 = load i32, i32* %22
%24 = load i32, i32* %6
%25 = tail call i32 @mpz_mul(i32 undef, i32 %23, i32 %24)
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 1, i64 1
%27 = load i32, i32* %26
%28 = load i32, i32* %11
%29 = tail call i32 @mpz_addmul(i32 undef, i32 %27, i32 %28)
%30 = load i32, i32* %22
%31 = load i32, i32* %15
%32 = tail call i32 @mpz_mul(i32 undef, i32 %30, i32 %31)
%33 = load i32, i32* %26
%34 = load i32, i32* %19
%35 = tail call i32 @mpz_addmul(i32 undef, i32 %33, i32 %34)
%36 = load i32, i32* %4
%37 = tail call i32 @mpz_set(i32 %36, i32 undef)
%38 = load i32, i32* %9
%39 = tail call i32 @mpz_set(i32 %38, i32 undef)
%40 = load i32, i32* %22
%41 = tail call i32 @mpz_set(i32 %40, i32 undef)
%42 = load i32, i32* %26
%43 = tail call i32 @mpz_set(i32 %42, i32 undef)
%44 = tail call i32 @mpz_clears(i32 undef, i32 undef, i32 undef, i32 undef, i32* null)
ret void
}