int Divide_Remainder(int a) {
  if (a > 1) {
    if (a % 2 != 0) {
      return (Divide_Remainder(a / 2) * Divide_Remainder((a / 2) + 1)) % 264;
    } else {
      return (Divide_Remainder(a / 2) * Divide_Remainder(a / 2)) % 264;
    }
  }
  return 9 % 264;
}


x86 assembly (clang, -O0):
<Divide_Remainder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11ba <Divide_Remainder+0xaa>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     117b <Divide_Remainder+0x6b>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <Divide_Remainder@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
add    $0x1,%edi
call   1030 <Divide_Remainder@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    $0x108,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    11c1 <Divide_Remainder+0xb1>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <Divide_Remainder@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <Divide_Remainder@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    $0x108,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    11c1 <Divide_Remainder+0xb1>
movl   $0x9,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Divide_Remainder>:
push   %rbp
push   %r14
push   %rbx
mov    $0x9,%ebx
cmp    $0x2,%edi
jl     1172 <Divide_Remainder+0x62>
mov    %edi,%ebp
mov    %ebp,%r14d
shr    %ebp
mov    %ebp,%edi
call   1030 <Divide_Remainder@plt>
mov    %eax,%ebx
test   $0x1,%r14b
jne    1144 <Divide_Remainder+0x34>
imul   %ebx,%ebx
imul   $0x3e0f83e1,%rbx,%rax
shr    $0x26,%rax
jmp    1168 <Divide_Remainder+0x58>
add    $0x1,%ebp
mov    %ebp,%edi
call   1030 <Divide_Remainder@plt>
imul   %ebx,%eax
movslq %eax,%rbx
imul   $0x3e0f83e1,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
mov    %eax,%ecx
shl    $0x8,%ecx
lea    (%rcx,%rax,8),%eax
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Divide_Remainder(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %29
6: ; preds = %1
%7 = load i32, i32* %3
%8 = srem i32 %7, 2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sdiv i32 %11, 2
%13 = call i32 @Divide_Remainder(i32 %12)
%14 = load i32, i32* %3
%15 = sdiv i32 %14, 2
%16 = add nsw i32 %15, 1
%17 = call i32 @Divide_Remainder(i32 %16)
%18 = mul nsw i32 %13, %17
%19 = srem i32 %18, 264
store i32 %19, i32* %2
br label %30
20: ; preds = %6
%21 = load i32, i32* %3
%22 = sdiv i32 %21, 2
%23 = call i32 @Divide_Remainder(i32 %22)
%24 = load i32, i32* %3
%25 = sdiv i32 %24, 2
%26 = call i32 @Divide_Remainder(i32 %25)
%27 = mul nsw i32 %23, %26
%28 = srem i32 %27, 264
store i32 %28, i32* %2
br label %30
29: ; preds = %1
store i32 9, i32* %2
br label %30
30: ; preds = %29, %20, %10
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @Divide_Remainder(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
%6 = lshr i32 %0, 1
%7 = tail call i32 @Divide_Remainder(i32 %6)
br i1 %5, label %15, label %10
8: ; preds = %1, %15, %10
%9 = phi i32 [ %14, %10 ], [ %17, %15 ], [ 9, %1 ]
ret i32 %9
10: ; preds = %3
%11 = add nuw nsw i32 %6, 1
%12 = tail call i32 @Divide_Remainder(i32 %11)
%13 = mul nsw i32 %12, %7
%14 = srem i32 %13, 264
br label %8
15: ; preds = %3
%16 = mul nsw i32 %7, %7
%17 = urem i32 %16, 264
br label %8
}