#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*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int GetPairType(int b) {
  int shift;
  if (b == 1) {
    shift = 0;
  } else if (b == 2) {
    shift = 1;
  } else if (b == 3) {
    shift = 2;
  } else if (b == 4 || b == 4) {
    shift = 3;
  } else {
    fprintf(stderr, "Error in GetPairType: %d!\n", b);
    return -1;
  }
  return shift;
}


x86 assembly (clang, -O0):
<GetPairType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <GetPairType+0x21>
movl   $0x0,-0xc(%rbp)
jmp    11b0 <GetPairType+0xa0>
cmpl   $0x2,-0x8(%rbp)
jne    1147 <GetPairType+0x37>
movl   $0x1,-0xc(%rbp)
jmp    11ab <GetPairType+0x9b>
cmpl   $0x3,-0x8(%rbp)
jne    115d <GetPairType+0x4d>
movl   $0x2,-0xc(%rbp)
jmp    11a6 <GetPairType+0x96>
cmpl   $0x4,-0x8(%rbp)
je     1171 <GetPairType+0x61>
cmpl   $0x4,-0x8(%rbp)
jne    117d <GetPairType+0x6d>
movl   $0x3,-0xc(%rbp)
jmp    11a1 <GetPairType+0x91>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe70(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b6 <GetPairType+0xa6>
jmp    11a6 <GetPairType+0x96>
jmp    11ab <GetPairType+0x9b>
jmp    11b0 <GetPairType+0xa0>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPairType>:
mov    %edi,%edx
lea    -0x1(%rdx),%eax
cmp    $0x4,%eax
jb     1139 <GetPairType+0x29>
push   %rax
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Error in GetPairType: %d!\0A\00"
define i32 @GetPairType(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %4
br label %30
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %4
br label %29
12: ; preds = %8
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 3
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 2, i32* %4
br label %28
16: ; preds = %12
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 4
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 4
br i1 %21, label %22, label %23
22: ; preds = %19, %16
store i32 3, i32* %4
br label %27
23: ; preds = %19
%24 = load i32, i32* @stderr
%25 = load i32, i32* %3
%26 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %25)
store i32 -1, i32* %2
br label %32
27: ; preds = %22
br label %28
28: ; preds = %27, %15
br label %29
29: ; preds = %28, %11
br label %30
30: ; preds = %29, %7
%31 = load i32, i32* %4
store i32 %31, i32* %2
br label %32
32: ; preds = %30, %23
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Error in GetPairType: %d!\0A\00"
define i32 @GetPairType(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 4
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ -1, %4 ], [ %2, %1 ]
ret i32 %8
}