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

/* Variables and functions */
int bitops32_count(unsigned long long);
uint8_t dcf_decode_eval_frame_q(uint64_t frame) {
  uint8_t q_result = 1;
  uint32_t minutes;
  uint32_t hours;
  uint8_t parity;
  if ((((frame) >> 0) & ((1ULL << 1) - 1)) != 0) {
    q_result = 0;
  }
  if ((((frame) >> 20) & ((1ULL << 1) - 1)) == 0) {
    q_result = 0;
  }
  minutes = (((frame) >> 21) & ((1ULL << 8) - 1));
  hours = (((frame) >> 29) & ((1ULL << 7) - 1));
  parity = bitops32_count(minutes);
  if (parity & 1) {
    q_result = 0;
  }
  parity = bitops32_count(hours);
  if (parity & 1) {
    q_result = 0;
  }
  return q_result;
}


x86 assembly (clang, -O0):
<dcf_decode_eval_frame_q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x0,%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1140 <dcf_decode_eval_frame_q+0x30>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x14,%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    115d <dcf_decode_eval_frame_q+0x4d>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x15,%rax
and    $0xff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1d,%rax
and    $0x7f,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <bitops32_count@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11a1 <dcf_decode_eval_frame_q+0x91>
movl   $0x0,-0xc(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <bitops32_count@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11c3 <dcf_decode_eval_frame_q+0xb3>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcf_decode_eval_frame_q>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %ebx,%ebp
not    %ebp
and    $0x1,%ebp
xor    %r15d,%r15d
test   $0x100000,%ebx
cmove  %r15d,%ebp
mov    %ebx,%eax
shr    $0x15,%eax
movzbl %al,%edi
shr    $0x1d,%rbx
and    $0x7f,%ebx
call   1030 <bitops32_count@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <bitops32_count@plt>
or     %r14d,%eax
test   $0x1,%al
cmovne %r15d,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dcf_decode_eval_frame_q(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i64 %0, i64* %2
store i32 1, i32* %3
%7 = load i64, i64* %2
%8 = lshr i64 %7, 0
%9 = and i64 %8, 1
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %3
br label %12
12: ; preds = %11, %1
%13 = load i64, i64* %2
%14 = lshr i64 %13, 20
%15 = and i64 %14, 1
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 0, i32* %3
br label %18
18: ; preds = %17, %12
%19 = load i64, i64* %2
%20 = lshr i64 %19, 21
%21 = and i64 %20, 255
store i64 %21, i64* %4
%22 = load i64, i64* %2
%23 = lshr i64 %22, 29
%24 = and i64 %23, 127
store i64 %24, i64* %5
%25 = load i64, i64* %4
%26 = call i32 @bitops32_count(i64 %25)
store i32 %26, i32* %6
%27 = load i32, i32* %6
%28 = and i32 %27, 1
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %18
store i32 0, i32* %3
br label %31
31: ; preds = %30, %18
%32 = load i64, i64* %5
%33 = call i32 @bitops32_count(i64 %32)
store i32 %33, i32* %6
%34 = load i32, i32* %6
%35 = and i32 %34, 1
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %31
store i32 0, i32* %3
br label %38
38: ; preds = %37, %31
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
define i32 @dcf_decode_eval_frame_q(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
%5 = and i64 %0, 1048576
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 0, i32 %4
%8 = lshr i64 %0, 21
%9 = and i64 %8, 255
%10 = lshr i64 %0, 29
%11 = and i64 %10, 127
%12 = tail call i32 @bitops32_count(i64 %9)
%13 = and i32 %12, 1
%14 = icmp eq i32 %13, 0
%15 = tail call i32 @bitops32_count(i64 %11)
%16 = and i32 %15, 1
%17 = icmp eq i32 %16, 0
%18 = select i1 %17, i1 %14, i1 false
%19 = select i1 %18, i32 %7, i32 0
ret i32 %19
}