#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*/ decode(unsigned int);
int /*<<< orphan*/ decode_live(unsigned int);
unsigned int strtoul(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  unsigned int cpu, mode = 0;
  if (argc < 2)
    cpu = 0;
  else {
    cpu = strtoul(argv[1], NULL, 0);
    if (cpu >= 32)
      mode = 1;
  }
  if (mode)
    decode(cpu);
  else
    decode_live(cpu);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1163 <main+0x33>
movl   $0x0,-0x14(%rbp)
jmp    118f <main+0x5f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jb     118a <main+0x5a>
movl   $0x1,-0x18(%rbp)
jmp    118f <main+0x5f>
cmpl   $0x0,-0x18(%rbp)
je     11a6 <main+0x76>
mov    -0x14(%rbp),%edi
call   1030 <decode@plt>
jmp    11ae <main+0x7e>
mov    -0x14(%rbp),%edi
call   1050 <decode_live@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
xor    %edi,%edi
cmp    $0x2,%eax
jl     114e <main+0x1e>
mov    0x8(%rsi),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %eax,%edi
cmp    $0x20,%eax
jae    1155 <main+0x25>
call   1050 <decode_live@plt>
jmp    115a <main+0x2a>
call   1030 <decode@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %6
br label %20
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @strtoul(i8* %14, i32* null, i32 0)
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = icmp uge i32 %16, 32
br i1 %17, label %18, label %19
18: ; preds = %11
store i32 1, i32* %7
br label %19
19: ; preds = %18, %11
br label %20
20: ; preds = %19, %10
%21 = load i32, i32* %7
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %6
%25 = call i32 @decode(i32 %24)
br label %29
26: ; preds = %20
%27 = load i32, i32* %6
%28 = call i32 @decode_live(i32 %27)
br label %29
29: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strtoul(i8* nocapture %6, i32* null, i32 0)
%8 = icmp ult i32 %7, 32
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 @decode(i32 %7)
br label %14
11: ; preds = %2, %4
%12 = phi i32 [ %7, %4 ], [ 0, %2 ]
%13 = tail call i32 @decode_live(i32 %12)
br label %14
14: ; preds = %11, %9
ret i32 0
}