#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 uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t hitag2_crypt(uint64_t s) {
  const uint32_t ht2_function4a = 0x2C79;
  const uint32_t ht2_function4b = 0x6671;
  const uint32_t ht2_function5c = 0x7907287B;
  uint32_t bitindex;
  bitindex = (ht2_function4a >> (((s >> 1) & 3) | ((s >> (4 - 2)) & 0xC))) & 1;
  bitindex |=
      ((ht2_function4b << 1) >>
       (((s >> 7) & 1) | ((s >> (11 - 1)) & 2) | ((s >> (13 - 2)) & 0xC))) &
      0x02;
  bitindex |= ((ht2_function4b << 2) >>
               (((s >> 16) & 1) | ((s >> (20 - 1)) & 2) |
                ((s >> (22 - 2)) & 4) | ((s >> (25 - 3)) & 8))) &
              0x04;
  bitindex |=
      ((ht2_function4b << 3) >>
       (((s >> 27) & 3) | ((s >> (30 - 2)) & 4) | ((s >> (32 - 3)) & 8))) &
      0x08;
  bitindex |=
      ((ht2_function4a << 4) >>
       (((s >> 33) & 1) | ((s >> (42 - 1)) & 6) | ((s >> (45 - 3)) & 8))) &
      0x10;
  return (ht2_function5c >> bitindex) & 1;
}


x86 assembly (clang, -O0):
<hitag2_crypt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2c79,-0x8(%rbp)
movl   $0x6671,-0xc(%rbp)
movl   $0x7907287b,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x3,%ecx
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
and    $0xc,%eax
or     %eax,%ecx
mov    $0x2c79,%eax
sar    %cl,%eax
and    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x7,%ecx
and    $0x1,%ecx
mov    -0x4(%rbp),%eax
sar    $0xa,%eax
and    $0x2,%eax
or     %eax,%ecx
mov    -0x4(%rbp),%eax
sar    $0xb,%eax
and    $0xc,%eax
or     %eax,%ecx
mov    $0xcce2,%eax
sar    %cl,%eax
and    $0x2,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0x1,%ecx
mov    -0x4(%rbp),%eax
sar    $0x13,%eax
and    $0x2,%eax
or     %eax,%ecx
mov    -0x4(%rbp),%eax
sar    $0x14,%eax
and    $0x4,%eax
or     %eax,%ecx
mov    -0x4(%rbp),%eax
sar    $0x16,%eax
and    $0x8,%eax
or     %eax,%ecx
mov    $0x199c4,%eax
sar    %cl,%eax
and    $0x4,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x1b,%ecx
and    $0x3,%ecx
mov    -0x4(%rbp),%eax
sar    $0x1c,%eax
and    $0x4,%eax
or     %eax,%ecx
mov    -0x4(%rbp),%eax
sar    $0x1d,%eax
and    $0x8,%eax
or     %eax,%ecx
mov    $0x33388,%eax
sar    %cl,%eax
and    $0x8,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x21,%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    -0x4(%rbp),%edx
mov    $0x29,%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    $0x6,%ecx
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2a,%ecx
sar    %cl,%eax
mov    -0x18(%rbp),%ecx
and    $0x8,%eax
or     %eax,%ecx
mov    $0x2c790,%eax
sar    %cl,%eax
and    $0x10,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x7907287b,%eax
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hitag2_crypt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 11385, i32* %3
store i32 26225, i32* %4
store i32 2030512251, i32* %5
%7 = load i32, i32* %2
%8 = ashr i32 %7, 1
%9 = and i32 %8, 3
%10 = load i32, i32* %2
%11 = ashr i32 %10, 2
%12 = and i32 %11, 12
%13 = or i32 %9, %12
%14 = ashr i32 11385, %13
%15 = and i32 %14, 1
store i32 %15, i32* %6
%16 = load i32, i32* %2
%17 = ashr i32 %16, 7
%18 = and i32 %17, 1
%19 = load i32, i32* %2
%20 = ashr i32 %19, 10
%21 = and i32 %20, 2
%22 = or i32 %18, %21
%23 = load i32, i32* %2
%24 = ashr i32 %23, 11
%25 = and i32 %24, 12
%26 = or i32 %22, %25
%27 = ashr i32 52450, %26
%28 = and i32 %27, 2
%29 = load i32, i32* %6
%30 = or i32 %29, %28
store i32 %30, i32* %6
%31 = load i32, i32* %2
%32 = ashr i32 %31, 16
%33 = and i32 %32, 1
%34 = load i32, i32* %2
%35 = ashr i32 %34, 19
%36 = and i32 %35, 2
%37 = or i32 %33, %36
%38 = load i32, i32* %2
%39 = ashr i32 %38, 20
%40 = and i32 %39, 4
%41 = or i32 %37, %40
%42 = load i32, i32* %2
%43 = ashr i32 %42, 22
%44 = and i32 %43, 8
%45 = or i32 %41, %44
%46 = ashr i32 104900, %45
%47 = and i32 %46, 4
%48 = load i32, i32* %6
%49 = or i32 %48, %47
store i32 %49, i32* %6
%50 = load i32, i32* %2
%51 = ashr i32 %50, 27
%52 = and i32 %51, 3
%53 = load i32, i32* %2
%54 = ashr i32 %53, 28
%55 = and i32 %54, 4
%56 = or i32 %52, %55
%57 = load i32, i32* %2
%58 = ashr i32 %57, 29
%59 = and i32 %58, 8
%60 = or i32 %56, %59
%61 = ashr i32 209800, %60
%62 = and i32 %61, 8
%63 = load i32, i32* %6
%64 = or i32 %63, %62
store i32 %64, i32* %6
%65 = load i32, i32* %2
%66 = ashr i32 %65, 33
%67 = and i32 %66, 1
%68 = load i32, i32* %2
%69 = ashr i32 %68, 41
%70 = and i32 %69, 6
%71 = or i32 %67, %70
%72 = load i32, i32* %2
%73 = ashr i32 %72, 42
%74 = and i32 %73, 8
%75 = or i32 %71, %74
%76 = ashr i32 182160, %75
%77 = and i32 %76, 16
%78 = load i32, i32* %6
%79 = or i32 %78, %77
store i32 %79, i32* %6
%80 = load i32, i32* %6
%81 = ashr i32 2030512251, %80
%82 = and i32 %81, 1
ret i32 %82
}

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