#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 */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t cashaddr_polymod_step(uint64_t pre) {
  uint8_t b = pre >> 35;
  return ((pre & 0x7FFFFFFFFULL) << 5) ^ (-((b >> 0) & 1) & 0x98f2bc8e61ULL) ^
         (-((b >> 1) & 1) & 0x79b76d99e2ULL) ^
         (-((b >> 2) & 1) & 0xf33e5fb3c4ULL) ^
         (-((b >> 3) & 1) & 0xae2eabe2a8ULL) ^
         (-((b >> 4) & 1) & 0x1e4f43e470ULL);
}


x86 assembly (clang, -O0):
<cashaddr_polymod_step>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x23,%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x7ffffffff,%rcx
and    %rcx,%rax
shl    $0x5,%rax
mov    -0x8(%rbp),%edx
sar    $0x0,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x98f2bc8e61,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x8(%rbp),%edx
sar    $0x1,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x79b76d99e2,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x8(%rbp),%edx
sar    $0x2,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0xf33e5fb3c4,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x8(%rbp),%edx
sar    $0x3,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0xae2eabe2a8,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x8(%rbp),%edx
sar    $0x4,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x1e4f43e470,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cashaddr_polymod_step>:
ret

LLVM IR (-O0):
define i32 @cashaddr_polymod_step(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 35
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = and i64 %7, 34359738367
%9 = shl i64 %8, 5
%10 = load i32, i32* %3
%11 = ashr i32 %10, 0
%12 = and i32 %11, 1
%13 = sub nsw i32 0, %12
%14 = sext i32 %13 to i64
%15 = and i64 %14, 656907472481
%16 = xor i64 %9, %15
%17 = load i32, i32* %3
%18 = ashr i32 %17, 1
%19 = and i32 %18, 1
%20 = sub nsw i32 0, %19
%21 = sext i32 %20 to i64
%22 = and i64 %21, 522768456162
%23 = xor i64 %16, %22
%24 = load i32, i32* %3
%25 = ashr i32 %24, 2
%26 = and i32 %25, 1
%27 = sub nsw i32 0, %26
%28 = sext i32 %27 to i64
%29 = and i64 %28, 1044723512260
%30 = xor i64 %23, %29
%31 = load i32, i32* %3
%32 = ashr i32 %31, 3
%33 = and i32 %32, 1
%34 = sub nsw i32 0, %33
%35 = sext i32 %34 to i64
%36 = and i64 %35, 748107326120
%37 = xor i64 %30, %36
%38 = load i32, i32* %3
%39 = ashr i32 %38, 4
%40 = and i32 %39, 1
%41 = sub nsw i32 0, %40
%42 = sext i32 %41 to i64
%43 = and i64 %42, 130178868336
%44 = xor i64 %37, %43
%45 = trunc i64 %44 to i32
ret i32 %45
}

LLVM IR (-O2):
define i32 @cashaddr_polymod_step(i32 %0) {
ret i32 poison
}