#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 printf(char *, int);
int scanf(char *, int *);
int main() {
  int n, x = 1, y = 2, z;
  if (scanf("%d", &n), n < 3)
    return 0 * printf("%d", n);
  else
    while (n-- > 2)
      z = x * y % 100, x = y, y = z;
  printf("%d", z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x3,-0x8(%rbp)
jge    1171 <main+0x51>
mov    -0x8(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
imul   $0x0,%eax,%eax
mov    %eax,-0x4(%rbp)
jmp    11c1 <main+0xa1>
jmp    1176 <main+0x56>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x2,%eax
jle    11ad <main+0x8d>
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1176 <main+0x56>
jmp    11b2 <main+0x92>
mov    -0x14(%rbp),%esi
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
cmp    $0x3,%esi
jl     1183 <main+0x63>
add    $0x1,%esi
mov    $0x1,%ecx
mov    %esi,%eax
mov    $0x2,%esi
nopw   0x0(%rax,%rax,1)
mov    %esi,%edx
imul   %esi,%ecx
movslq %ecx,%rsi
imul   $0x51eb851f,%rsi,%rcx
mov    %rcx,%rdi
shr    $0x3f,%rdi
sar    $0x25,%rcx
add    %edi,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%esi
add    $0xffffffff,%eax
mov    %edx,%ecx
cmp    $0x3,%eax
ja     1150 <main+0x30>
movl   $0x1,0x4(%rsp)
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
store i32 2, i32* %4
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = mul nsw i32 0, %11
store i32 %12, i32* %1
br label %29
13: ; preds = %0
br label %14
14: ; preds = %18, %13
%15 = load i32, i32* %2
%16 = add nsw i32 %15, -1
store i32 %16, i32* %2
%17 = icmp sgt i32 %15, 2
br i1 %17, label %18, label %25
18: ; preds = %14
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = mul nsw i32 %19, %20
%22 = srem i32 %21, 100
store i32 %22, i32* %5
%23 = load i32, i32* %4
store i32 %23, i32* %3
%24 = load i32, i32* %5
store i32 %24, i32* %4
br label %14
25: ; preds = %14
br label %26
26: ; preds = %25
%27 = load i32, i32* %5
%28 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %26, %9
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 3
br i1 %5, label %15, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %4, %0 ]
%8 = phi i32 [ %12, %6 ], [ 2, %0 ]
%9 = phi i32 [ %8, %6 ], [ 1, %0 ]
%10 = add nsw i32 %7, -1
%11 = mul nsw i32 %8, %9
%12 = srem i32 %11, 100
%13 = icmp ugt i32 %7, 3
br i1 %13, label %6, label %14
14: ; preds = %6
store i32 1, i32* %1
br label %15
15: ; preds = %0, %14
%16 = phi i32 [ %12, %14 ], [ %4, %0 ]
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
ret i32 0
}