#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*/ vrp_keep();
void f2(int c, int b) {
  int s = 0;
  if (c == 0)
    s += 1;
  else if (c < 1)
    s -= 1;
  b = (b & 1) + 1;
  b = s << b;
  if (b == -4)
    vrp_keep();
  if (b == 4)
    vrp_keep();
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113d <f2+0x2d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <f2+0x45>
cmpl   $0x1,-0x4(%rbp)
jge    1150 <f2+0x40>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <f2+0x45>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xfffffffc,-0x8(%rbp)
jne    117d <f2+0x6d>
mov    $0x0,%al
call   1030 <vrp_keep@plt>
cmpl   $0x4,-0x8(%rbp)
jne    118e <f2+0x7e>
mov    $0x0,%al
call   1030 <vrp_keep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
xor    %ecx,%ecx
test   %edi,%edi
setle  %cl
neg    %ecx
test   %edi,%edi
mov    $0x1,%eax
cmovne %ecx,%eax
and    $0x1,%sil
lea    0x1(%rsi),%ecx
shl    %cl,%eax
cmp    $0x4,%eax
je     1136 <f2+0x26>
cmp    $0xfffffffc,%eax
jne    113d <f2+0x2d>
xor    %eax,%eax
jmp    1030 <vrp_keep@plt>
ret

LLVM IR (-O0):
define void @f2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %5
br label %18
11: ; preds = %2
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 1
store i32 %16, i32* %5
br label %17
17: ; preds = %14, %11
br label %18
18: ; preds = %17, %8
%19 = load i32, i32* %4
%20 = and i32 %19, 1
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = shl i32 %22, %23
store i32 %24, i32* %4
%25 = load i32, i32* %4
%26 = icmp eq i32 %25, -4
br i1 %26, label %27, label %29
27: ; preds = %18
%28 = call i32 (...) @vrp_keep()
br label %29
29: ; preds = %27, %18
%30 = load i32, i32* %4
%31 = icmp eq i32 %30, 4
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 (...) @vrp_keep()
br label %34
34: ; preds = %32, %29
ret void
}

LLVM IR (-O2):
define void @f2(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp slt i32 %0, 1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
%7 = and i32 %1, 1
%8 = add nuw nsw i32 %7, 1
%9 = shl nsw i32 %6, %8
switch i32 %9, label %12 [
i32 -4, label %10
i32 4, label %10
]
10: ; preds = %2, %2
%11 = tail call i32 (...) @vrp_keep()
br label %12
12: ; preds = %10, %2
ret void
}