#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 */
int calc_parity(int);
uint8_t enc_secded_72_64(const uint8_t bytes[8]) {
  uint64_t word = ((uint64_t)bytes[0] << 0) | ((uint64_t)bytes[1] << 8) |
                  ((uint64_t)bytes[2] << 16) | ((uint64_t)bytes[3] << 24) |
                  ((uint64_t)bytes[4] << 32) | ((uint64_t)bytes[5] << 40) |
                  ((uint64_t)bytes[6] << 48) | ((uint64_t)bytes[7] << 56);
  return (calc_parity(word & 0xb9000000001fffff) << 0) |
         (calc_parity(word & 0x5e00000fffe0003f) << 1) |
         (calc_parity(word & 0x67003ff003e007c1) << 2) |
         (calc_parity(word & 0xcd0fc0f03c207842) << 3) |
         (calc_parity(word & 0xb671c711c4438884) << 4) |
         (calc_parity(word & 0xb5b65926488c9108) << 5) |
         (calc_parity(word & 0xcbdaaa4a91152210) << 6) |
         (calc_parity(word & 0x7aed348d221a4420) << 7);
}


x86 assembly (clang, -O0):
<enc_secded_72_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x0,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x14(%rcx),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x1c(%rcx),%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
movabs $0xb9000000001fffff,%rcx
and    %rcx,%rax
mov    %eax,%edi
call   1030 <calc_parity@plt>
shl    $0x0,%eax
mov    %eax,-0x28(%rbp)
movslq -0xc(%rbp),%rax
movabs $0x5e00000fffe0003f,%rcx
and    %rcx,%rax
mov    %eax,%edi
call   1030 <calc_parity@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
shl    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x24(%rbp)
movslq -0xc(%rbp),%rax
movabs $0x67003ff003e007c1,%rcx
and    %rcx,%rax
mov    %eax,%edi
call   1030 <calc_parity@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x20(%rbp)
movslq -0xc(%rbp),%rax
movabs $0xcd0fc0f03c207842,%rcx
c0 0f cd
and    %rcx,%rax
mov    %eax,%edi
call   1030 <calc_parity@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
shl    $0x3,%ecx
or     %ecx,%eax
mov    %eax,-0x1c(%rbp)
movslq -0xc(%rbp),%rax
movabs $0xb671c711c4438884,%rcx
c7 71 b6
and    %rcx,%rax
mov    %eax,%edi
call   1030 <calc_parity@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
movabs $0xb5b65926488c9108,%rcx
59 b6 b5
and    %rcx,%rax
mov    %eax,%edi
call   1030 <calc_parity@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
shl    $0x5,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
movslq -0xc(%rbp),%rax
movabs $0xcbdaaa4a91152210,%rcx
aa da cb
and    %rcx,%rax
mov    %eax,%edi
call   1030 <calc_parity@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
shl    $0x6,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
movslq -0xc(%rbp),%rax
movabs $0x7aed348d221a4420,%rcx
34 ed 7a
and    %rcx,%rax
mov    %eax,%edi
call   1030 <calc_parity@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
shl    $0x7,%ecx
or     %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enc_secded_72_64>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
call   1030 <calc_parity@plt>
mov    %eax,%ebx
call   1030 <calc_parity@plt>
mov    %eax,%ebp
add    %eax,%ebp
or     %ebx,%ebp
call   1030 <calc_parity@plt>
mov    %eax,%r14d
shl    $0x2,%r14d
call   1030 <calc_parity@plt>
mov    %eax,%r15d
shl    $0x3,%r15d
or     %r14d,%r15d
or     %ebp,%r15d
call   1030 <calc_parity@plt>
mov    %eax,%r14d
shl    $0x4,%r14d
call   1030 <calc_parity@plt>
mov    %eax,%ebp
shl    $0x5,%ebp
or     %r14d,%ebp
call   1030 <calc_parity@plt>
mov    %eax,%ebx
shl    $0x6,%ebx
or     %ebp,%ebx
or     %r15d,%ebx
call   1030 <calc_parity@plt>
shl    $0x7,%eax
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @enc_secded_72_64(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = shl i32 %6, 0
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %7, %11
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = shl i32 %15, 16
%17 = or i32 %12, %16
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 3
%20 = load i32, i32* %19
%21 = shl i32 %20, 24
%22 = or i32 %17, %21
%23 = load i32*, i32** %2
%24 = getelementptr inbounds i32, i32* %23, i64 4
%25 = load i32, i32* %24
%26 = shl i32 %25, 32
%27 = or i32 %22, %26
%28 = load i32*, i32** %2
%29 = getelementptr inbounds i32, i32* %28, i64 5
%30 = load i32, i32* %29
%31 = shl i32 %30, 40
%32 = or i32 %27, %31
%33 = load i32*, i32** %2
%34 = getelementptr inbounds i32, i32* %33, i64 6
%35 = load i32, i32* %34
%36 = shl i32 %35, 48
%37 = or i32 %32, %36
%38 = load i32*, i32** %2
%39 = getelementptr inbounds i32, i32* %38, i64 7
%40 = load i32, i32* %39
%41 = shl i32 %40, 56
%42 = or i32 %37, %41
store i32 %42, i32* %3
%43 = load i32, i32* %3
%44 = sext i32 %43 to i64
%45 = and i64 %44, -5116089176690786305
%46 = trunc i64 %45 to i32
%47 = call i32 @calc_parity(i32 %46)
%48 = shl i32 %47, 0
%49 = load i32, i32* %3
%50 = sext i32 %49 to i64
%51 = and i64 %50, 6773413908282605631
%52 = trunc i64 %51 to i32
%53 = call i32 @calc_parity(i32 %52)
%54 = shl i32 %53, 1
%55 = or i32 %48, %54
%56 = load i32, i32* %3
%57 = sext i32 %56 to i64
%58 = and i64 %57, 7422002485996292033
%59 = trunc i64 %58 to i32
%60 = call i32 @calc_parity(i32 %59)
%61 = shl i32 %60, 2
%62 = or i32 %55, %61
%63 = load i32, i32* %3
%64 = sext i32 %63 to i64
%65 = and i64 %64, -3670503033250219966
%66 = trunc i64 %65 to i32
%67 = call i32 @calc_parity(i32 %66)
%68 = shl i32 %67, 3
%69 = or i32 %62, %68
%70 = load i32, i32* %3
%71 = sext i32 %70 to i64
%72 = and i64 %71, -5300236407317231484
%73 = trunc i64 %72 to i32
%74 = call i32 @calc_parity(i32 %73)
%75 = shl i32 %74, 4
%76 = or i32 %69, %75
%77 = load i32, i32* %3
%78 = sext i32 %77 to i64
%79 = and i64 %78, -5352993086122454776
%80 = trunc i64 %79 to i32
%81 = call i32 @calc_parity(i32 %80)
%82 = shl i32 %81, 5
%83 = or i32 %76, %82
%84 = load i32, i32* %3
%85 = sext i32 %84 to i64
%86 = and i64 %85, -3757503701848874480
%87 = trunc i64 %86 to i32
%88 = call i32 @calc_parity(i32 %87)
%89 = shl i32 %88, 6
%90 = or i32 %83, %89
%91 = load i32, i32* %3
%92 = sext i32 %91 to i64
%93 = and i64 %92, 8857793822874813472
%94 = trunc i64 %93 to i32
%95 = call i32 @calc_parity(i32 %94)
%96 = shl i32 %95, 7
%97 = or i32 %90, %96
ret i32 %97
}

LLVM IR (-O2):
define i32 @enc_secded_72_64(i32* nocapture readnone %0) {
%2 = tail call i32 @calc_parity(i32 poison)
%3 = tail call i32 @calc_parity(i32 poison)
%4 = shl i32 %3, 1
%5 = or i32 %4, %2
%6 = tail call i32 @calc_parity(i32 poison)
%7 = shl i32 %6, 2
%8 = or i32 %5, %7
%9 = tail call i32 @calc_parity(i32 poison)
%10 = shl i32 %9, 3
%11 = or i32 %8, %10
%12 = tail call i32 @calc_parity(i32 poison)
%13 = shl i32 %12, 4
%14 = or i32 %11, %13
%15 = tail call i32 @calc_parity(i32 poison)
%16 = shl i32 %15, 5
%17 = or i32 %14, %16
%18 = tail call i32 @calc_parity(i32 poison)
%19 = shl i32 %18, 6
%20 = or i32 %17, %19
%21 = tail call i32 @calc_parity(i32 poison)
%22 = shl i32 %21, 7
%23 = or i32 %20, %22
ret i32 %23
}