#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);
  multiply(F, F);
  if (n % 2 != 0)
    multiply(F, M);
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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    11c3 <power+0xa3>
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),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <multiply@plt>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     11c3 <power+0xa3>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <multiply@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
cmp    $0x2,%rsi
jb     117b <power+0x5b>
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,(%rsp)
shr    $0x3f,%rsi
add    %rbx,%rsi
sar    %rsi
call   1030 <power@plt>
mov    %r14,%rdi
mov    %r14,%rsi
call   1040 <multiply@plt>
test   $0x1,%bl
je     1174 <power+0x54>
mov    %rsp,%rsi
mov    %r14,%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 %31
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 = bitcast [2 x i64]* %17 to i64**
%19 = load [2 x i64]*, [2 x i64]** %3
%20 = bitcast [2 x i64]* %19 to i64**
%21 = call i32 @multiply(i64** %18, i64** %20)
%22 = load i64, i64* %4
%23 = srem i64 %22, 2
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %31
25: ; preds = %12
%26 = load [2 x i64]*, [2 x i64]** %3
%27 = bitcast [2 x i64]* %26 to i64**
%28 = getelementptr inbounds [2 x [2 x i64]], [2 x [2 x i64]]* %5, i64 0, i64 0
%29 = bitcast [2 x i64]* %28 to i64**
%30 = call i32 @multiply(i64** %27, i64** %29)
br label %31
31: ; preds = %11, %25, %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 %16, 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 = bitcast [2 x i64]* %0 to i64**
%9 = tail call i32 @multiply(i64** %8, i64** %8)
%10 = and i64 %1, 1
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %5
%13 = bitcast [2 x [2 x i64]]* %3 to i64**
%14 = call i32 @multiply(i64** %8, i64** %13)
br label %15
15: ; preds = %12, %5
br label %16
16: ; preds = %2, %15
ret void
}