#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 int8_t;

/* Variables and functions */
int des_weak_p(const uint8_t *key) {
  static const unsigned char asso_values[0x81] = {
      16, 9,  26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 6,  2,
      26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
      26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
      26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
      26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
      26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
      26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 3,  1,  26, 26, 26, 26, 26,
      26, 26, 26, 26, 26, 26, 26, 26, 0,  0};
  static const int8_t weak_key_hash[26][4] = {
      {0x7f, 0x7f, 0x7f, 0x7f}, {0x7f, 0x70, 0x7f, 0x78},
      {0x7f, 0x0f, 0x7f, 0x07}, {0x70, 0x7f, 0x78, 0x7f},
      {0x70, 0x70, 0x78, 0x78}, {0x70, 0x0f, 0x78, 0x07},
      {0x0f, 0x7f, 0x07, 0x7f}, {0x0f, 0x70, 0x07, 0x78},
      {0x0f, 0x0f, 0x07, 0x07}, {0x7f, 0x00, 0x7f, 0x00},
      {-1, -1, -1, -1},         {-1, -1, -1, -1},
      {0x70, 0x00, 0x78, 0x00}, {-1, -1, -1, -1},
      {-1, -1, -1, -1},         {0x0f, 0x00, 0x07, 0x00},
      {0x00, 0x7f, 0x00, 0x7f}, {0x00, 0x70, 0x00, 0x78},
      {0x00, 0x0f, 0x00, 0x07}, {-1, -1, -1, -1},
      {-1, -1, -1, -1},         {-1, -1, -1, -1},
      {-1, -1, -1, -1},         {-1, -1, -1, -1},
      {-1, -1, -1, -1},         {0x00, 0x00, 0x00, 0x00}};
  int8_t k0 = key[0] >> 1;
  int8_t k1 = key[1] >> 1;
  unsigned hash = asso_values[k1 + 1] + asso_values[k0];
  const int8_t *candidate = weak_key_hash[hash];
  if (hash > 25)
    return 0;
  if (k0 != candidate[0] || k1 != candidate[1])
    return 0;
  if ((key[2] >> 1) != k0 || (key[3] >> 1) != k1)
    return 0;
  k0 = key[4] >> 1;
  k1 = key[5] >> 1;
  if (k0 != candidate[2] || k1 != candidate[3])
    return 0;
  if ((key[6] >> 1) != k0 || (key[7] >> 1) != k1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<des_weak_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
sar    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0xecf(%rip),%rax
movzbl (%rax,%rcx,1),%eax
movslq -0x14(%rbp),%rdx
lea    0xec0(%rip),%rcx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
lea    0xf3b(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x19,-0x1c(%rbp)
jbe    1176 <des_weak_p+0x76>
movl   $0x0,-0x4(%rbp)
jmp    1252 <des_weak_p+0x152>
mov    -0x14(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jne    1195 <des_weak_p+0x95>
mov    -0x18(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    0x4(%rcx),%eax
je     11a1 <des_weak_p+0xa1>
movl   $0x0,-0x4(%rbp)
jmp    1252 <des_weak_p+0x152>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
sar    $0x1,%eax
cmp    -0x14(%rbp),%eax
jne    11c7 <des_weak_p+0xc7>
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%eax
sar    $0x1,%eax
cmp    -0x18(%rbp),%eax
je     11d3 <des_weak_p+0xd3>
movl   $0x0,-0x4(%rbp)
jmp    1252 <des_weak_p+0x152>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%eax
sar    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%eax
sar    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    0x8(%rcx),%eax
jne    120d <des_weak_p+0x10d>
mov    -0x18(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    0xc(%rcx),%eax
je     1219 <des_weak_p+0x119>
movl   $0x0,-0x4(%rbp)
jmp    1252 <des_weak_p+0x152>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%eax
sar    $0x1,%eax
cmp    -0x14(%rbp),%eax
jne    123f <des_weak_p+0x13f>
mov    -0x10(%rbp),%rax
mov    0x1c(%rax),%eax
sar    $0x1,%eax
cmp    -0x18(%rbp),%eax
je     124b <des_weak_p+0x14b>
movl   $0x0,-0x4(%rbp)
jmp    1252 <des_weak_p+0x152>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<des_weak_p>:
mov    (%rdi),%esi
mov    0x4(%rdi),%r9d
sar    %esi
sar    %r9d
movslq %r9d,%rax
lea    0xeeb(%rip),%r8
movzbl 0x1(%rax,%r8,1),%eax
movslq %esi,%rcx
movzbl (%rcx,%r8,1),%ecx
add    %rax,%rcx
xor    %eax,%eax
cmp    $0x19,%ecx
ja     1185 <des_weak_p+0x85>
shl    $0x4,%rcx
lea    0xf58(%rip),%r8
cmp    (%rcx,%r8,1),%esi
jne    1185 <des_weak_p+0x85>
cmp    0x4(%rcx,%r8,1),%r9d
jne    1185 <des_weak_p+0x85>
mov    0x8(%rdi),%edx
sar    %edx
cmp    %esi,%edx
jne    1185 <des_weak_p+0x85>
mov    0xc(%rdi),%edx
sar    %edx
cmp    %r9d,%edx
jne    1185 <des_weak_p+0x85>
mov    0x10(%rdi),%esi
sar    %esi
cmp    0x8(%rcx,%r8,1),%esi
jne    1185 <des_weak_p+0x85>
mov    0x14(%rdi),%edx
sar    %edx
cmp    0xc(%rcx,%r8,1),%edx
jne    1185 <des_weak_p+0x85>
mov    0x18(%rdi),%ecx
sar    %ecx
cmp    %esi,%ecx
jne    1185 <des_weak_p+0x85>
mov    0x1c(%rdi),%ecx
sar    %ecx
xor    %eax,%eax
cmp    %edx,%ecx
sete   %al
ret

LLVM IR (-O0):
@des_weak_p.asso_values = internal constant [129 x i8] c"\10\09\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\06\02\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\03\01\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\00\00"
@des_weak_p.weak_key_hash = internal constant [26 x [4 x i32]] [[4 x i32] [i32 127, i32 127, i32 127, i32 127], [4 x i32] [i32 127, i32 112, i32 127, i32 120], [4 x i32] [i32 127, i32 15, i32 127, i32 7], [4 x i32] [i32 112, i32 127, i32 120, i32 127], [4 x i32] [i32 112, i32 112, i32 120, i32 120], [4 x i32] [i32 112, i32 15, i32 120, i32 7], [4 x i32] [i32 15, i32 127, i32 7, i32 127], [4 x i32] [i32 15, i32 112, i32 7, i32 120], [4 x i32] [i32 15, i32 15, i32 7, i32 7], [4 x i32] [i32 127, i32 0, i32 127, i32 0], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 112, i32 0, i32 120, i32 0], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 15, i32 0, i32 7, i32 0], [4 x i32] [i32 0, i32 127, i32 0, i32 127], [4 x i32] [i32 0, i32 112, i32 0, i32 120], [4 x i32] [i32 0, i32 15, i32 0, i32 7], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] zeroinitializer]
define i32 @des_weak_p(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %3
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = ashr i32 %10, 1
store i32 %11, i32* %4
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = ashr i32 %14, 1
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [129 x i8], [129 x i8]* @des_weak_p.asso_values, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [129 x i8], [129 x i8]* @des_weak_p.asso_values, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = add nsw i32 %21, %26
store i32 %27, i32* %6
%28 = load i32, i32* %6
%29 = zext i32 %28 to i64
%30 = getelementptr inbounds [26 x [4 x i32]], [26 x [4 x i32]]* @des_weak_p.weak_key_hash, i64 0, i64 %29
%31 = getelementptr inbounds [4 x i32], [4 x i32]* %30, i64 0, i64 0
store i32* %31, i32** %7
%32 = load i32, i32* %6
%33 = icmp ugt i32 %32, 25
br i1 %33, label %34, label %35
34: ; preds = %1
store i32 0, i32* %2
br label %100
35: ; preds = %1
%36 = load i32, i32* %4
%37 = load i32*, i32** %7
%38 = getelementptr inbounds i32, i32* %37, i64 0
%39 = load i32, i32* %38
%40 = icmp ne i32 %36, %39
br i1 %40, label %47, label %41
41: ; preds = %35
%42 = load i32, i32* %5
%43 = load i32*, i32** %7
%44 = getelementptr inbounds i32, i32* %43, i64 1
%45 = load i32, i32* %44
%46 = icmp ne i32 %42, %45
br i1 %46, label %47, label %48
47: ; preds = %41, %35
store i32 0, i32* %2
br label %100
48: ; preds = %41
%49 = load i32*, i32** %3
%50 = getelementptr inbounds i32, i32* %49, i64 2
%51 = load i32, i32* %50
%52 = ashr i32 %51, 1
%53 = load i32, i32* %4
%54 = icmp ne i32 %52, %53
br i1 %54, label %62, label %55
55: ; preds = %48
%56 = load i32*, i32** %3
%57 = getelementptr inbounds i32, i32* %56, i64 3
%58 = load i32, i32* %57
%59 = ashr i32 %58, 1
%60 = load i32, i32* %5
%61 = icmp ne i32 %59, %60
br i1 %61, label %62, label %63
62: ; preds = %55, %48
store i32 0, i32* %2
br label %100
63: ; preds = %55
%64 = load i32*, i32** %3
%65 = getelementptr inbounds i32, i32* %64, i64 4
%66 = load i32, i32* %65
%67 = ashr i32 %66, 1
store i32 %67, i32* %4
%68 = load i32*, i32** %3
%69 = getelementptr inbounds i32, i32* %68, i64 5
%70 = load i32, i32* %69
%71 = ashr i32 %70, 1
store i32 %71, i32* %5
%72 = load i32, i32* %4
%73 = load i32*, i32** %7
%74 = getelementptr inbounds i32, i32* %73, i64 2
%75 = load i32, i32* %74
%76 = icmp ne i32 %72, %75
br i1 %76, label %83, label %77
77: ; preds = %63
%78 = load i32, i32* %5
%79 = load i32*, i32** %7
%80 = getelementptr inbounds i32, i32* %79, i64 3
%81 = load i32, i32* %80
%82 = icmp ne i32 %78, %81
br i1 %82, label %83, label %84
83: ; preds = %77, %63
store i32 0, i32* %2
br label %100
84: ; preds = %77
%85 = load i32*, i32** %3
%86 = getelementptr inbounds i32, i32* %85, i64 6
%87 = load i32, i32* %86
%88 = ashr i32 %87, 1
%89 = load i32, i32* %4
%90 = icmp ne i32 %88, %89
br i1 %90, label %98, label %91
91: ; preds = %84
%92 = load i32*, i32** %3
%93 = getelementptr inbounds i32, i32* %92, i64 7
%94 = load i32, i32* %93
%95 = ashr i32 %94, 1
%96 = load i32, i32* %5
%97 = icmp ne i32 %95, %96
br i1 %97, label %98, label %99
98: ; preds = %91, %84
store i32 0, i32* %2
br label %100
99: ; preds = %91
store i32 1, i32* %2
br label %100
100: ; preds = %99, %98, %83, %62, %47, %34
%101 = load i32, i32* %2
ret i32 %101
}

LLVM IR (-O2):
@des_weak_p.asso_values = internal unnamed_addr constant [129 x i8] c"\10\09\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\06\02\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\03\01\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\1A\00\00"
@des_weak_p.weak_key_hash = internal unnamed_addr constant [26 x [4 x i32]] [[4 x i32] [i32 127, i32 127, i32 127, i32 127], [4 x i32] [i32 127, i32 112, i32 127, i32 120], [4 x i32] [i32 127, i32 15, i32 127, i32 7], [4 x i32] [i32 112, i32 127, i32 120, i32 127], [4 x i32] [i32 112, i32 112, i32 120, i32 120], [4 x i32] [i32 112, i32 15, i32 120, i32 7], [4 x i32] [i32 15, i32 127, i32 7, i32 127], [4 x i32] [i32 15, i32 112, i32 7, i32 120], [4 x i32] [i32 15, i32 15, i32 7, i32 7], [4 x i32] [i32 127, i32 0, i32 127, i32 0], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 112, i32 0, i32 120, i32 0], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 15, i32 0, i32 7, i32 0], [4 x i32] [i32 0, i32 127, i32 0, i32 127], [4 x i32] [i32 0, i32 112, i32 0, i32 120], [4 x i32] [i32 0, i32 15, i32 0, i32 7], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] zeroinitializer]
define i32 @des_weak_p(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = ashr i32 %2, 1
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = ashr i32 %5, 1
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [129 x i8], [129 x i8]* @des_weak_p.asso_values, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = sext i32 %3 to i64
%13 = getelementptr inbounds [129 x i8], [129 x i8]* @des_weak_p.asso_values, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = add nuw nsw i32 %15, %11
%17 = zext i32 %16 to i64
%18 = icmp ugt i32 %16, 25
br i1 %18, label %62, label %19
19: ; preds = %1
%20 = getelementptr inbounds [26 x [4 x i32]], [26 x [4 x i32]]* @des_weak_p.weak_key_hash, i64 0, i64 %17, i64 0
%21 = load i32, i32* %20
%22 = icmp eq i32 %3, %21
br i1 %22, label %23, label %62
23: ; preds = %19
%24 = getelementptr inbounds [26 x [4 x i32]], [26 x [4 x i32]]* @des_weak_p.weak_key_hash, i64 0, i64 %17, i64 1
%25 = load i32, i32* %24
%26 = icmp eq i32 %6, %25
br i1 %26, label %27, label %62
27: ; preds = %23
%28 = getelementptr inbounds i32, i32* %0, i64 2
%29 = load i32, i32* %28
%30 = ashr i32 %29, 1
%31 = icmp eq i32 %30, %3
br i1 %31, label %32, label %62
32: ; preds = %27
%33 = getelementptr inbounds i32, i32* %0, i64 3
%34 = load i32, i32* %33
%35 = ashr i32 %34, 1
%36 = icmp eq i32 %35, %6
br i1 %36, label %37, label %62
37: ; preds = %32
%38 = getelementptr inbounds i32, i32* %0, i64 4
%39 = load i32, i32* %38
%40 = ashr i32 %39, 1
%41 = getelementptr inbounds i32, i32* %0, i64 5
%42 = load i32, i32* %41
%43 = ashr i32 %42, 1
%44 = getelementptr inbounds [26 x [4 x i32]], [26 x [4 x i32]]* @des_weak_p.weak_key_hash, i64 0, i64 %17, i64 2
%45 = load i32, i32* %44
%46 = icmp eq i32 %40, %45
br i1 %46, label %47, label %62
47: ; preds = %37
%48 = getelementptr inbounds [26 x [4 x i32]], [26 x [4 x i32]]* @des_weak_p.weak_key_hash, i64 0, i64 %17, i64 3
%49 = load i32, i32* %48
%50 = icmp eq i32 %43, %49
br i1 %50, label %51, label %62
51: ; preds = %47
%52 = getelementptr inbounds i32, i32* %0, i64 6
%53 = load i32, i32* %52
%54 = ashr i32 %53, 1
%55 = icmp eq i32 %54, %40
br i1 %55, label %56, label %62
56: ; preds = %51
%57 = getelementptr inbounds i32, i32* %0, i64 7
%58 = load i32, i32* %57
%59 = ashr i32 %58, 1
%60 = icmp eq i32 %59, %43
%61 = zext i1 %60 to i32
br label %62
62: ; preds = %56, %51, %37, %47, %27, %32, %19, %23, %1
%63 = phi i32 [ 0, %1 ], [ 0, %23 ], [ 0, %19 ], [ 0, %32 ], [ 0, %27 ], [ 0, %47 ], [ 0, %37 ], [ 0, %51 ], [ %61, %56 ]
ret i32 %63
}