#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 */
#define TPACKET_V1 130
#define TPACKET_V2 129
#define TPACKET_V3 128
int __v1_tx_kernel_ready(void *);
int __v2_tx_kernel_ready(void *);
int __v3_tx_kernel_ready(void *);
int /*<<< orphan*/ assert(int);
int __tx_kernel_ready(void *base, int version) {
  switch (version) {
  case TPACKET_V1:
    return __v1_tx_kernel_ready(base);
  case TPACKET_V2:
    return __v2_tx_kernel_ready(base);
  case TPACKET_V3:
    return __v3_tx_kernel_ready(base);
  default:
    assert(!(1));
    return 0;
  }
}


x86 assembly (clang, -O0):
<__tx_kernel_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x80,%eax
je     11ad <__tx_kernel_ready+0x6d>
jmp    1165 <__tx_kernel_ready+0x25>
mov    -0x18(%rbp),%eax
sub    $0x81,%eax
je     119c <__tx_kernel_ready+0x5c>
jmp    1178 <__tx_kernel_ready+0x38>
mov    -0x18(%rbp),%eax
sub    $0x82,%eax
jne    11be <__tx_kernel_ready+0x7e>
jmp    118b <__tx_kernel_ready+0x4b>
mov    -0x10(%rbp),%rdi
call   1040 <__v1_tx_kernel_ready@plt>
mov    %eax,-0x4(%rbp)
jmp    11cc <__tx_kernel_ready+0x8c>
mov    -0x10(%rbp),%rdi
call   1030 <__v2_tx_kernel_ready@plt>
mov    %eax,-0x4(%rbp)
jmp    11cc <__tx_kernel_ready+0x8c>
mov    -0x10(%rbp),%rdi
call   1060 <__v3_tx_kernel_ready@plt>
mov    %eax,-0x4(%rbp)
jmp    11cc <__tx_kernel_ready+0x8c>
xor    %edi,%edi
call   1050 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__tx_kernel_ready>:
cmp    $0x80,%esi
je     115d <__tx_kernel_ready+0x1d>
cmp    $0x81,%esi
je     1162 <__tx_kernel_ready+0x22>
cmp    $0x82,%esi
jne    1167 <__tx_kernel_ready+0x27>
jmp    1040 <__v1_tx_kernel_ready@plt>
jmp    1060 <__v3_tx_kernel_ready@plt>
jmp    1030 <__v2_tx_kernel_ready@plt>
push   %rax
xor    %edi,%edi
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__tx_kernel_ready(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %16 [
i32 130, label %7
i32 129, label %10
i32 128, label %13
]
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @__v1_tx_kernel_ready(i8* %8)
store i32 %9, i32* %3
br label %18
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @__v2_tx_kernel_ready(i8* %11)
store i32 %12, i32* %3
br label %18
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = call i32 @__v3_tx_kernel_ready(i8* %14)
store i32 %15, i32* %3
br label %18
16: ; preds = %2
%17 = call i32 @assert(i32 0)
store i32 0, i32* %3
br label %18
18: ; preds = %16, %13, %10, %7
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @__tx_kernel_ready(i8* %0, i32 %1) {
switch i32 %1, label %9 [
i32 130, label %3
i32 129, label %5
i32 128, label %7
]
3: ; preds = %2
%4 = tail call i32 @__v1_tx_kernel_ready(i8* %0)
br label %11
5: ; preds = %2
%6 = tail call i32 @__v2_tx_kernel_ready(i8* %0)
br label %11
7: ; preds = %2
%8 = tail call i32 @__v3_tx_kernel_ready(i8* %0)
br label %11
9: ; preds = %2
%10 = tail call i32 @assert(i32 0)
br label %11
11: ; preds = %9, %7, %5, %3
%12 = phi i32 [ 0, %9 ], [ %8, %7 ], [ %6, %5 ], [ %4, %3 ]
ret i32 %12
}