#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*/ __CPROVER_assume(int);
int /*<<< orphan*/ assert(int);
int main() {
  {
    unsigned i, j, k, l;
    j = k;
    i = j / 2;
    l = j >> 1;
    assert(i == l);
    j = k;
    i = j % 2;
    l = j & 1;
    assert(i == l);
  }
  {
    signed int i, j, k, l;
    __CPROVER_assume(!(k & 1));
    j = k;
    i = j / 2;
    l = j >> 1;
    assert(i == l);
    j = k;
    i = j % 2;
    l = j & 1;
    assert(i == l);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CPROVER_assume@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x18(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <assert@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
mov    $0x1,%edi
call   1030 <__CPROVER_assume@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = load i32, i32* %3
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = udiv i32 %10, 2
store i32 %11, i32* %1
%12 = load i32, i32* %2
%13 = lshr i32 %12, 1
store i32 %13, i32* %4
%14 = load i32, i32* %1
%15 = load i32, i32* %4
%16 = icmp eq i32 %14, %15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i32, i32* %3
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = urem i32 %20, 2
store i32 %21, i32* %1
%22 = load i32, i32* %2
%23 = and i32 %22, 1
store i32 %23, i32* %4
%24 = load i32, i32* %1
%25 = load i32, i32* %4
%26 = icmp eq i32 %24, %25
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = load i32, i32* %7
%30 = and i32 %29, 1
%31 = icmp ne i32 %30, 0
%32 = xor i1 %31, true
%33 = zext i1 %32 to i32
%34 = call i32 @__CPROVER_assume(i32 %33)
%35 = load i32, i32* %7
store i32 %35, i32* %6
%36 = load i32, i32* %6
%37 = sdiv i32 %36, 2
store i32 %37, i32* %5
%38 = load i32, i32* %6
%39 = ashr i32 %38, 1
store i32 %39, i32* %8
%40 = load i32, i32* %5
%41 = load i32, i32* %8
%42 = icmp eq i32 %40, %41
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
%45 = load i32, i32* %7
store i32 %45, i32* %6
%46 = load i32, i32* %6
%47 = srem i32 %46, 2
store i32 %47, i32* %5
%48 = load i32, i32* %6
%49 = and i32 %48, 1
store i32 %49, i32* %8
%50 = load i32, i32* %5
%51 = load i32, i32* %8
%52 = icmp eq i32 %50, %51
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @__CPROVER_assume(i32 1)
%4 = tail call i32 @assert(i32 1)
%5 = tail call i32 @assert(i32 1)
ret i32 0
}