#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 Powerty(int, int);
int Remainder(int, int);
int MoveHash(int InputHash, int HashLength, char PrevChar, char NextChar) {
  int HashValue = PrevChar - 32;
  HashValue = HashValue * Powerty(95, HashLength - 1);
  HashValue = HashValue % 22605091;
  HashValue = InputHash - HashValue;
  HashValue = Remainder(HashValue, 22605091);
  HashValue = HashValue * 95;
  HashValue = HashValue + NextChar - 32;
  return HashValue % 22605091;
}


x86 assembly (clang, -O0):
<MoveHash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movsbl -0x9(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    $0x5f,%edi
call   1040 <Powerty@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x158ed23,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x158ed23,%esi
call   1030 <Remainder@plt>
mov    %eax,-0x10(%rbp)
imul   $0x5f,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movsbl -0xa(%rbp),%ecx
add    %ecx,%eax
sub    $0x20,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x158ed23,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MoveHash>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %edi,%r14d
add    $0xffffffe0,%ebp
add    $0xffffffff,%esi
mov    $0x5f,%edi
call   1040 <Powerty@plt>
imul   %ebp,%eax
cltq
imul   $0xffffffffbe000005,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x18,%ecx
add    %edx,%ecx
imul   $0x158ed23,%ecx,%edi
sub    %eax,%edi
add    %r14d,%edi
mov    $0x158ed23,%esi
call   1030 <Remainder@plt>
imul   $0x5f,%eax,%eax
lea    (%rbx,%rax,1),%ecx
add    %ebx,%eax
add    $0xffffffe0,%eax
cltq
imul   $0xffffffffbe000005,%rax,%rdx
shr    $0x20,%rdx
add    %edx,%ecx
add    $0xffffffe0,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x18,%ecx
add    %edx,%ecx
imul   $0x158ed23,%ecx,%ecx
sub    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @MoveHash(i32 %0, i32 %1, i8 signext %2, i8 signext %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%10 = load i8, i8* %7
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 32
store i32 %12, i32* %9
%13 = load i32, i32* %9
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 1
%16 = call i32 @Powerty(i32 95, i32 %15)
%17 = mul nsw i32 %13, %16
store i32 %17, i32* %9
%18 = load i32, i32* %9
%19 = srem i32 %18, 22605091
store i32 %19, i32* %9
%20 = load i32, i32* %5
%21 = load i32, i32* %9
%22 = sub nsw i32 %20, %21
store i32 %22, i32* %9
%23 = load i32, i32* %9
%24 = call i32 @Remainder(i32 %23, i32 22605091)
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = mul nsw i32 %25, 95
store i32 %26, i32* %9
%27 = load i32, i32* %9
%28 = load i8, i8* %8
%29 = sext i8 %28 to i32
%30 = add nsw i32 %27, %29
%31 = sub nsw i32 %30, 32
store i32 %31, i32* %9
%32 = load i32, i32* %9
%33 = srem i32 %32, 22605091
ret i32 %33
}

LLVM IR (-O2):
define i32 @MoveHash(i32 %0, i32 %1, i8 signext %2, i8 signext %3) {
%5 = sext i8 %2 to i32
%6 = add nsw i32 %5, -32
%7 = add nsw i32 %1, -1
%8 = tail call i32 @Powerty(i32 95, i32 %7)
%9 = mul nsw i32 %8, %6
%10 = srem i32 %9, 22605091
%11 = sub nsw i32 %0, %10
%12 = tail call i32 @Remainder(i32 %11, i32 22605091)
%13 = mul nsw i32 %12, 95
%14 = sext i8 %3 to i32
%15 = add nsw i32 %14, -32
%16 = add i32 %15, %13
%17 = srem i32 %16, 22605091
ret i32 %17
}