#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 ckgolinp(int);
int ckmetinp_undef(int);
int ckpswinp(int);
int cksiminp(int);
scalar_t__ mst_ckme(int);
int ckmetinp(int method, int spec) {
  int ckmetinp = 0;
  if (spec < 0 || spec > 20)
    ckmetinp |= 64;
  if (mst_ckme(method))
    ckmetinp |= ckmetinp_undef(spec);
  switch (method) {
  case -2:
    ckmetinp |= cksiminp(spec);
    break;
  case 3:
    ckmetinp |= ckpswinp(spec);
    break;
  case 1:
    ckmetinp |= ckgolinp(spec);
    break;
  default:
    ckmetinp |= ckmetinp_undef(spec);
  }
  return ckmetinp;
}


x86 assembly (clang, -O0):
<ckmetinp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1179 <ckmetinp+0x29>
cmpl   $0x14,-0x8(%rbp)
jle    1182 <ckmetinp+0x32>
mov    -0xc(%rbp),%eax
or     $0x40,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <mst_ckme@plt>
cmp    $0x0,%rax
je     11a2 <ckmetinp+0x52>
mov    -0x8(%rbp),%edi
call   1060 <ckmetinp_undef@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xfffffffe,%eax
je     11d8 <ckmetinp+0x88>
jmp    11b6 <ckmetinp+0x66>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     11fe <ckmetinp+0xae>
jmp    11c7 <ckmetinp+0x77>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     11eb <ckmetinp+0x9b>
jmp    1211 <ckmetinp+0xc1>
mov    -0x8(%rbp),%edi
call   1070 <cksiminp@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    121f <ckmetinp+0xcf>
mov    -0x8(%rbp),%edi
call   1040 <ckpswinp@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    121f <ckmetinp+0xcf>
mov    -0x8(%rbp),%edi
call   1030 <ckgolinp@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    121f <ckmetinp+0xcf>
mov    -0x8(%rbp),%edi
call   1060 <ckmetinp_undef@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckmetinp>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %ebx,%ebx
cmp    $0x15,%esi
setae  %bl
shl    $0x6,%ebx
call   1050 <mst_ckme@plt>
test   %rax,%rax
je     1178 <ckmetinp+0x28>
mov    %r14d,%edi
call   1060 <ckmetinp_undef@plt>
or     %eax,%ebx
mov    %r14d,%edi
cmp    $0x3,%ebp
je     1191 <ckmetinp+0x41>
cmp    $0x1,%ebp
je     1198 <ckmetinp+0x48>
cmp    $0xfffffffe,%ebp
jne    119f <ckmetinp+0x4f>
call   1070 <cksiminp@plt>
jmp    11a4 <ckmetinp+0x54>
call   1040 <ckpswinp@plt>
jmp    11a4 <ckmetinp+0x54>
call   1030 <ckgolinp@plt>
jmp    11a4 <ckmetinp+0x54>
call   1060 <ckmetinp_undef@plt>
or     %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ckmetinp(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* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 20
br i1 %10, label %11, label %14
11: ; preds = %8, %2
%12 = load i32, i32* %5
%13 = or i32 %12, 64
store i32 %13, i32* %5
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %3
%16 = call i64 @mst_ckme(i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i32, i32* %4
%20 = call i32 @ckmetinp_undef(i32 %19)
%21 = load i32, i32* %5
%22 = or i32 %21, %20
store i32 %22, i32* %5
br label %23
23: ; preds = %18, %14
%24 = load i32, i32* %3
switch i32 %24, label %40 [
i32 -2, label %25
i32 3, label %30
i32 1, label %35
]
25: ; preds = %23
%26 = load i32, i32* %4
%27 = call i32 @cksiminp(i32 %26)
%28 = load i32, i32* %5
%29 = or i32 %28, %27
store i32 %29, i32* %5
br label %45
30: ; preds = %23
%31 = load i32, i32* %4
%32 = call i32 @ckpswinp(i32 %31)
%33 = load i32, i32* %5
%34 = or i32 %33, %32
store i32 %34, i32* %5
br label %45
35: ; preds = %23
%36 = load i32, i32* %4
%37 = call i32 @ckgolinp(i32 %36)
%38 = load i32, i32* %5
%39 = or i32 %38, %37
store i32 %39, i32* %5
br label %45
40: ; preds = %23
%41 = load i32, i32* %4
%42 = call i32 @ckmetinp_undef(i32 %41)
%43 = load i32, i32* %5
%44 = or i32 %43, %42
store i32 %44, i32* %5
br label %45
45: ; preds = %40, %35, %30, %25
%46 = load i32, i32* %5
ret i32 %46
}

LLVM IR (-O2):
define i32 @ckmetinp(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, 20
%4 = select i1 %3, i32 64, i32 0
%5 = tail call i64 @mst_ckme(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @ckmetinp_undef(i32 %1)
%9 = or i32 %8, %4
br label %10
10: ; preds = %7, %2
%11 = phi i32 [ %9, %7 ], [ %4, %2 ]
switch i32 %0, label %18 [
i32 -2, label %12
i32 3, label %14
i32 1, label %16
]
12: ; preds = %10
%13 = tail call i32 @cksiminp(i32 %1)
br label %20
14: ; preds = %10
%15 = tail call i32 @ckpswinp(i32 %1)
br label %20
16: ; preds = %10
%17 = tail call i32 @ckgolinp(i32 %1)
br label %20
18: ; preds = %10
%19 = tail call i32 @ckmetinp_undef(i32 %1)
br label %20
20: ; preds = %18, %16, %14, %12
%21 = phi i32 [ %19, %18 ], [ %17, %16 ], [ %15, %14 ], [ %13, %12 ]
%22 = or i32 %21, %11
ret i32 %22
}