#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*/ panic(char *, int);
int INTERFACE(int ipd_port) {
  if (ipd_port < 32)
    return ipd_port >> 4;
  else if (ipd_port < 36)
    return 2;
  else if (ipd_port < 40)
    return 3;
  else if (ipd_port == 40)
    return 4;
  else
    panic("Illegal ipd_port %d passed to INTERFACE\n", ipd_port);
}


x86 assembly (clang, -O0):
<INTERFACE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    1133 <INTERFACE+0x23>
mov    -0x8(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    1193 <INTERFACE+0x83>
cmpl   $0x24,-0x8(%rbp)
jge    1149 <INTERFACE+0x39>
movl   $0x2,-0x4(%rbp)
jmp    1193 <INTERFACE+0x83>
cmpl   $0x28,-0x8(%rbp)
jge    115f <INTERFACE+0x4f>
movl   $0x3,-0x4(%rbp)
jmp    1193 <INTERFACE+0x83>
cmpl   $0x28,-0x8(%rbp)
jne    1175 <INTERFACE+0x65>
movl   $0x4,-0x4(%rbp)
jmp    1193 <INTERFACE+0x83>
mov    -0x8(%rbp),%esi
lea    0xe81(%rip),%rdi
call   1030 <panic@plt>
jmp    1189 <INTERFACE+0x79>
jmp    118e <INTERFACE+0x7e>
jmp    1193 <INTERFACE+0x83>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INTERFACE>:
mov    %edi,%esi
cmp    $0x1f,%edi
jg     111d <INTERFACE+0xd>
sar    $0x4,%esi
mov    %esi,%eax
ret
mov    $0x2,%eax
cmp    $0x24,%esi
jb     1149 <INTERFACE+0x39>
mov    $0x3,%eax
cmp    $0x28,%esi
jb     1149 <INTERFACE+0x39>
mov    $0x4,%eax
je     1149 <INTERFACE+0x39>
push   %rax
lea    0xec0(%rip),%rdi
call   1030 <panic@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Illegal ipd_port %d passed to INTERFACE\0A\00"
define i32 @INTERFACE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 32
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = ashr i32 %7, 4
store i32 %8, i32* %2
br label %27
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 36
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 2, i32* %2
br label %27
13: ; preds = %9
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 40
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 3, i32* %2
br label %27
17: ; preds = %13
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 40
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 4, i32* %2
br label %27
21: ; preds = %17
%22 = load i32, i32* %3
%23 = call i32 @panic(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %21
br label %25
25: ; preds = %24
br label %26
26: ; preds = %25
br label %27
27: ; preds = %6, %12, %16, %20, %26
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
@.str = [41 x i8] c"Illegal ipd_port %d passed to INTERFACE\0A\00"
define i32 @INTERFACE(i32 %0) {
%2 = icmp slt i32 %0, 32
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = ashr i32 %0, 4
br label %13
5: ; preds = %1
%6 = icmp ult i32 %0, 36
br i1 %6, label %13, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 40
br i1 %8, label %13, label %9
9: ; preds = %7
%10 = icmp eq i32 %0, 40
br i1 %10, label %13, label %11
11: ; preds = %9
%12 = tail call i32 @panic(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %13
13: ; preds = %9, %7, %5, %3, %11
%14 = phi i32 [ %4, %3 ], [ undef, %11 ], [ 2, %5 ], [ 3, %7 ], [ 4, %9 ]
ret i32 %14
}