#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 */

/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
unsigned int __VERIFIER_nondet_uint();
int main() {
  unsigned int v = __VERIFIER_nondet_uint();
  unsigned int v1;
  unsigned int v2;
  char parity1;
  char parity2;
  v1 = v;
  parity1 = (char)0;
  while (v1 != 0) {
    if (parity1 == (char)0) {
      parity1 = (char)1;
    } else {
      parity1 = (char)0;
    }
    v1 = v1 & (v1 - 1U);
  }
  v2 = v;
  parity2 = (char)0;
  v2 = v2 ^ (v2 >> 1u);
  v2 = v2 ^ (v2 >> 2u);
  v2 = (v2 & 286331153U) * 286331153U;
  if (((v2 >> 28u) & 1u) == 0) {
    parity2 = (char)0;
  } else {
    parity2 = (char)1;
  }
  __VERIFIER_assert(parity1 == parity2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_uint@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movb   $0x0,-0x11(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     117a <main+0x5a>
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
jne    1163 <main+0x43>
movb   $0x1,-0x11(%rbp)
jmp    1167 <main+0x47>
movb   $0x0,-0x11(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <main+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movb   $0x0,-0x12(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
shr    $0x1,%ecx
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
shr    $0x2,%ecx
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x11111111,%eax
imul   $0x11111111,%eax,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x1c,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    11cc <main+0xac>
movb   $0x0,-0x12(%rbp)
jmp    11d0 <main+0xb0>
movb   $0x1,-0x12(%rbp)
movsbl -0x11(%rbp),%eax
movsbl -0x12(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_uint@plt>
test   %eax,%eax
je     114f <main+0x2f>
xor    %ecx,%ecx
mov    %eax,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    $0x1,%cl
lea    -0x1(%rdx),%esi
and    %edx,%esi
mov    %esi,%edx
jne    1140 <main+0x20>
movzbl %cl,%ebx
mov    %eax,%ecx
shr    %ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
xor    %ecx,%eax
and    $0x11111111,%eax
imul   $0x11111111,%eax,%eax
shr    $0x1c,%eax
and    $0x1,%eax
xor    %edi,%edi
cmp    %ebx,%eax
sete   %dil
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
store i32 0, i32* %1
%7 = call i32 (...) @__VERIFIER_nondet_uint()
store i32 %7, i32* %2
%8 = load i32, i32* %2
store i32 %8, i32* %3
store i8 0, i8* %5
br label %9
9: ; preds = %18, %0
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %9
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
store i8 1, i8* %5
br label %18
17: ; preds = %12
store i8 0, i8* %5
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %3
%20 = load i32, i32* %3
%21 = sub i32 %20, 1
%22 = and i32 %19, %21
store i32 %22, i32* %3
br label %9
23: ; preds = %9
%24 = load i32, i32* %2
store i32 %24, i32* %4
store i8 0, i8* %6
%25 = load i32, i32* %4
%26 = load i32, i32* %4
%27 = lshr i32 %26, 1
%28 = xor i32 %25, %27
store i32 %28, i32* %4
%29 = load i32, i32* %4
%30 = load i32, i32* %4
%31 = lshr i32 %30, 2
%32 = xor i32 %29, %31
store i32 %32, i32* %4
%33 = load i32, i32* %4
%34 = and i32 %33, 286331153
%35 = mul i32 %34, 286331153
store i32 %35, i32* %4
%36 = load i32, i32* %4
%37 = lshr i32 %36, 28
%38 = and i32 %37, 1
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %23
store i8 0, i8* %6
br label %42
41: ; preds = %23
store i8 1, i8* %6
br label %42
42: ; preds = %41, %40
%43 = load i8, i8* %5
%44 = sext i8 %43 to i32
%45 = load i8, i8* %6
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %44, %46
%48 = zext i1 %47 to i32
%49 = call i32 @__VERIFIER_assert(i32 %48)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_uint()
%2 = icmp eq i32 %1, 0
br i1 %2, label %12, label %3
3: ; preds = %0, %3
%4 = phi i8 [ %6, %3 ], [ 0, %0 ]
%5 = phi i32 [ %8, %3 ], [ %1, %0 ]
%6 = xor i8 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = zext i8 %6 to i32
br label %12
12: ; preds = %10, %0
%13 = phi i32 [ 0, %0 ], [ %11, %10 ]
%14 = lshr i32 %1, 1
%15 = xor i32 %14, %1
%16 = lshr i32 %15, 2
%17 = xor i32 %16, %15
%18 = and i32 %17, 286331153
%19 = mul i32 %18, 286331153
%20 = lshr i32 %19, 28
%21 = and i32 %20, 1
%22 = icmp eq i32 %21, %13
%23 = zext i1 %22 to i32
%24 = tail call i32 @__VERIFIER_assert(i32 %23)
ret i32 0
}