#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*/ multiply(long long **, long long **);
void power(long long int F[2][2], long long int n) {
  if (n == 0 || n == 1)
    return;
  long long int M[2][2] = {{1, 1}, {1, 0}};
  power(F, n / 2);
  F[0][0] %= 1000000007;
  F[0][1] %= 1000000007;
  F[1][0] %= 1000000007;
  F[1][1] %= 1000000007;
  multiply(F, F);
  if (n % 2 != 0)
    multiply(F, M);
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <power+0x26>
cmpq   $0x1,-0x10(%rbp)
jne    114b <power+0x2b>
jmp    1239 <power+0x119>
mov    0xeae(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea5(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rsi
call   1030 <power@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    (%rax),%rax
mov    $0x3b9aca07,%ecx
cqto
idiv   %rcx
mov    -0x50(%rbp),%rax
mov    %rdx,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    0x8(%rax),%rax
mov    $0x3b9aca07,%ecx
cqto
idiv   %rcx
mov    -0x48(%rbp),%rax
mov    %rdx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    0x10(%rax),%rax
mov    $0x3b9aca07,%ecx
cqto
idiv   %rcx
mov    -0x40(%rbp),%rax
mov    %rdx,0x10(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    0x18(%rax),%rax
mov    $0x3b9aca07,%ecx
cqto
idiv   %rcx
mov    -0x38(%rbp),%rax
mov    %rdx,0x18(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <multiply@plt>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     1239 <power+0x119>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <multiply@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
cmp    $0x2,%rsi
jb     122c <power+0x10c>
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,(%rsp)
shr    $0x3f,%rsi
add    %r14,%rsi
sar    %rsi
call   1030 <power@plt>
mov    (%rbx),%rsi
mov    0x8(%rbx),%rcx
movabs $0x89705f3112a28fe5,%rdi
5f 70 89
mov    %rsi,%rax
imul   %rdi
add    %rsi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1d,%rdx
add    %rax,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%rsi
mov    %rsi,(%rbx)
mov    %rcx,%rax
imul   %rdi
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1d,%rdx
add    %rax,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,0x8(%rbx)
mov    0x10(%rbx),%rcx
mov    %rcx,%rax
imul   %rdi
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1d,%rdx
add    %rax,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,0x10(%rbx)
mov    0x18(%rbx),%rcx
mov    %rcx,%rax
imul   %rdi
add    %rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1d,%rdx
add    %rax,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,0x18(%rbx)
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1040 <multiply@plt>
test   $0x1,%r14b
je     1225 <power+0x105>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <multiply@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.power.M = [2 x [2 x i64]] [[2 x i64] [i64 1, i64 1], [2 x i64] [i64 1, i64 0]]
define void @power([2 x i64]* %0, i64 %1) {
%3 = alloca [2 x i64]*
%4 = alloca i64
%5 = alloca [2 x [2 x i64]]
store [2 x i64]* %0, [2 x i64]** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i64, i64* %4
%10 = icmp eq i64 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %8, %2
br label %51
12: ; preds = %8
%13 = bitcast [2 x [2 x i64]]* %5 to i8*
%14 = load [2 x i64]*, [2 x i64]** %3
%15 = load i64, i64* %4
%16 = sdiv i64 %15, 2
%17 = load [2 x i64]*, [2 x i64]** %3
%18 = getelementptr inbounds [2 x i64], [2 x i64]* %17, i64 0
%19 = getelementptr inbounds [2 x i64], [2 x i64]* %18, i64 0, i64 0
%20 = load i64, i64* %19
%21 = srem i64 %20, 1000000007
store i64 %21, i64* %19
%22 = load [2 x i64]*, [2 x i64]** %3
%23 = getelementptr inbounds [2 x i64], [2 x i64]* %22, i64 0
%24 = getelementptr inbounds [2 x i64], [2 x i64]* %23, i64 0, i64 1
%25 = load i64, i64* %24
%26 = srem i64 %25, 1000000007
store i64 %26, i64* %24
%27 = load [2 x i64]*, [2 x i64]** %3
%28 = getelementptr inbounds [2 x i64], [2 x i64]* %27, i64 1
%29 = getelementptr inbounds [2 x i64], [2 x i64]* %28, i64 0, i64 0
%30 = load i64, i64* %29
%31 = srem i64 %30, 1000000007
store i64 %31, i64* %29
%32 = load [2 x i64]*, [2 x i64]** %3
%33 = getelementptr inbounds [2 x i64], [2 x i64]* %32, i64 1
%34 = getelementptr inbounds [2 x i64], [2 x i64]* %33, i64 0, i64 1
%35 = load i64, i64* %34
%36 = srem i64 %35, 1000000007
store i64 %36, i64* %34
%37 = load [2 x i64]*, [2 x i64]** %3
%38 = bitcast [2 x i64]* %37 to i64**
%39 = load [2 x i64]*, [2 x i64]** %3
%40 = bitcast [2 x i64]* %39 to i64**
%41 = call i32 @multiply(i64** %38, i64** %40)
%42 = load i64, i64* %4
%43 = srem i64 %42, 2
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %51
45: ; preds = %12
%46 = load [2 x i64]*, [2 x i64]** %3
%47 = bitcast [2 x i64]* %46 to i64**
%48 = getelementptr inbounds [2 x [2 x i64]], [2 x [2 x i64]]* %5, i64 0, i64 0
%49 = bitcast [2 x i64]* %48 to i64**
%50 = call i32 @multiply(i64** %47, i64** %49)
br label %51
51: ; preds = %11, %45, %12
ret void
}

LLVM IR (-O2):
@__const.power.M = [2 x [2 x i64]] [[2 x i64] [i64 1, i64 1], [2 x i64] [i64 1, i64 0]]
define void @power([2 x i64]* %0, i64 %1) {
%3 = alloca [2 x [2 x i64]]
%4 = icmp ult i64 %1, 2
br i1 %4, label %28, label %5
5: ; preds = %2
%6 = bitcast [2 x [2 x i64]]* %3 to i8*
%7 = sdiv i64 %1, 2
tail call void @power([2 x i64]* %0, i64 %7)
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %0, i64 0, i64 0
%9 = load i64, i64* %8
%10 = srem i64 %9, 1000000007
store i64 %10, i64* %8
%11 = getelementptr inbounds [2 x i64], [2 x i64]* %0, i64 0, i64 1
%12 = load i64, i64* %11
%13 = srem i64 %12, 1000000007
store i64 %13, i64* %11
%14 = getelementptr inbounds [2 x i64], [2 x i64]* %0, i64 1, i64 0
%15 = load i64, i64* %14
%16 = srem i64 %15, 1000000007
store i64 %16, i64* %14
%17 = getelementptr inbounds [2 x i64], [2 x i64]* %0, i64 1, i64 1
%18 = load i64, i64* %17
%19 = srem i64 %18, 1000000007
store i64 %19, i64* %17
%20 = bitcast [2 x i64]* %0 to i64**
%21 = tail call i32 @multiply(i64** %20, i64** %20)
%22 = and i64 %1, 1
%23 = icmp eq i64 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %5
%25 = bitcast [2 x [2 x i64]]* %3 to i64**
%26 = call i32 @multiply(i64** %20, i64** %25)
br label %27
27: ; preds = %24, %5
br label %28
28: ; preds = %2, %27
ret void
}