#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*/ Usage();
void checkarglimit(int msg_type, int argc) {
  if (msg_type == 1 && argc != 3) {
    Usage();
  } else if (msg_type == 2 && (argc > 4 || argc < 3)) {
    Usage();
  } else if (msg_type == 3 && argc != 3) {
    Usage();
  } else if (msg_type == 4 && (argc > 2 || argc < 1)) {
    Usage();
  }
}


x86 assembly (clang, -O0):
<checkarglimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    113e <checkarglimit+0x2e>
cmpl   $0x3,-0x8(%rbp)
je     113e <checkarglimit+0x2e>
mov    $0x0,%al
call   1030 <Usage@plt>
jmp    11bc <checkarglimit+0xac>
cmpl   $0x2,-0x4(%rbp)
jne    1168 <checkarglimit+0x58>
cmpl   $0x4,-0x8(%rbp)
jg     115c <checkarglimit+0x4c>
cmpl   $0x3,-0x8(%rbp)
jge    1168 <checkarglimit+0x58>
mov    $0x0,%al
call   1030 <Usage@plt>
jmp    11b7 <checkarglimit+0xa7>
cmpl   $0x3,-0x4(%rbp)
jne    1188 <checkarglimit+0x78>
cmpl   $0x3,-0x8(%rbp)
je     1188 <checkarglimit+0x78>
mov    $0x0,%al
call   1030 <Usage@plt>
jmp    11b2 <checkarglimit+0xa2>
cmpl   $0x4,-0x4(%rbp)
jne    11ad <checkarglimit+0x9d>
cmpl   $0x2,-0x8(%rbp)
jg     11a6 <checkarglimit+0x96>
cmpl   $0x1,-0x8(%rbp)
jge    11ad <checkarglimit+0x9d>
mov    $0x0,%al
call   1030 <Usage@plt>
jmp    11b2 <checkarglimit+0xa2>
jmp    11b7 <checkarglimit+0xa7>
jmp    11bc <checkarglimit+0xac>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkarglimit>:
cmp    $0x1,%edi
jne    111a <checkarglimit+0xa>
cmp    $0x3,%esi
jne    114c <checkarglimit+0x3c>
cmp    $0x3,%esi
setne  %r8b
cmp    $0x2,%edi
sete   %dl
lea    -0x5(%rsi),%ecx
cmp    $0xfffffffe,%ecx
setb   %al
cmp    $0x3,%edi
sete   %cl
test   %al,%dl
jne    114c <checkarglimit+0x3c>
and    %r8b,%cl
jne    114c <checkarglimit+0x3c>
cmp    $0x4,%edi
jne    1153 <checkarglimit+0x43>
add    $0xfffffffd,%esi
cmp    $0xfffffffd,%esi
ja     1153 <checkarglimit+0x43>
xor    %eax,%eax
jmp    1030 <Usage@plt>
ret

LLVM IR (-O0):
define void @checkarglimit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (...) @Usage()
br label %45
12: ; preds = %7, %2
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %23
15: ; preds = %12
%16 = load i32, i32* %4
%17 = icmp sgt i32 %16, 4
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 3
br i1 %20, label %21, label %23
21: ; preds = %18, %15
%22 = call i32 (...) @Usage()
br label %44
23: ; preds = %18, %12
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 3
br i1 %25, label %26, label %31
26: ; preds = %23
%27 = load i32, i32* %4
%28 = icmp ne i32 %27, 3
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 (...) @Usage()
br label %43
31: ; preds = %26, %23
%32 = load i32, i32* %3
%33 = icmp eq i32 %32, 4
br i1 %33, label %34, label %42
34: ; preds = %31
%35 = load i32, i32* %4
%36 = icmp sgt i32 %35, 2
br i1 %36, label %40, label %37
37: ; preds = %34
%38 = load i32, i32* %4
%39 = icmp slt i32 %38, 1
br i1 %39, label %40, label %42
40: ; preds = %37, %34
%41 = call i32 (...) @Usage()
br label %42
42: ; preds = %40, %37, %31
br label %43
43: ; preds = %42, %29
br label %44
44: ; preds = %43, %21
br label %45
45: ; preds = %44, %10
ret void
}

LLVM IR (-O2):
define void @checkarglimit(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
%4 = icmp ne i32 %1, 3
%5 = and i1 %3, %4
br i1 %5, label %19, label %6
6: ; preds = %2
%7 = icmp eq i32 %0, 2
%8 = add i32 %1, -5
%9 = icmp ult i32 %8, -2
%10 = and i1 %7, %9
%11 = icmp eq i32 %0, 3
%12 = and i1 %11, %4
%13 = or i1 %10, %12
br i1 %13, label %19, label %14
14: ; preds = %6
%15 = icmp eq i32 %0, 4
%16 = add i32 %1, -3
%17 = icmp ult i32 %16, -2
%18 = and i1 %15, %17
br i1 %18, label %19, label %21
19: ; preds = %14, %6, %2
%20 = tail call i32 (...) @Usage()
br label %21
21: ; preds = %19, %14
ret void
}