#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*/ exit(int);
int /*<<< orphan*/ printf(char *);
int checkArgument(int const argc, int const year, int const month) {
  int error = 0;
  switch (argc) {
  case 2:
    if (year < 1900)
      error = 1;
    break;
  case 3:
    if (year < 1900 || month < 0 || month > 12)
      error = 1;
    break;
  default:
    error = 1;
    break;
  }
  if (error) {
    printf("Argument error\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<checkArgument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x2,%eax
je     115d <checkArgument+0x3d>
jmp    114c <checkArgument+0x2c>
mov    -0x18(%rbp),%eax
sub    $0x3,%eax
je     1176 <checkArgument+0x56>
jmp    11a3 <checkArgument+0x83>
cmpl   $0x76c,-0xc(%rbp)
jge    1171 <checkArgument+0x51>
movl   $0x1,-0x14(%rbp)
jmp    11aa <checkArgument+0x8a>
cmpl   $0x76c,-0xc(%rbp)
jl     1197 <checkArgument+0x77>
cmpl   $0x0,-0x10(%rbp)
jl     1197 <checkArgument+0x77>
cmpl   $0xc,-0x10(%rbp)
jle    119e <checkArgument+0x7e>
movl   $0x1,-0x14(%rbp)
jmp    11aa <checkArgument+0x8a>
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11ca <checkArgument+0xaa>
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkArgument>:
cmp    $0x3,%edi
je     1134 <checkArgument+0x14>
cmp    $0x2,%edi
jne    1142 <checkArgument+0x22>
cmp    $0x76b,%esi
jg     1141 <checkArgument+0x21>
jmp    1142 <checkArgument+0x22>
cmp    $0x76c,%esi
jl     1142 <checkArgument+0x22>
cmp    $0xd,%edx
jae    1142 <checkArgument+0x22>
ret
push   %rax
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Argument error\0A\00"
define i32 @checkArgument(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 0, i32* %8
%9 = load i32, i32* %5
switch i32 %9, label %26 [
i32 2, label %10
i32 3, label %15
]
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 1900
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 1, i32* %8
br label %14
14: ; preds = %13, %10
br label %27
15: ; preds = %3
%16 = load i32, i32* %6
%17 = icmp slt i32 %16, 1900
br i1 %17, label %24, label %18
18: ; preds = %15
%19 = load i32, i32* %7
%20 = icmp slt i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = load i32, i32* %7
%23 = icmp sgt i32 %22, 12
br i1 %23, label %24, label %25
24: ; preds = %21, %18, %15
store i32 1, i32* %8
br label %25
25: ; preds = %24, %21
br label %27
26: ; preds = %3
store i32 1, i32* %8
br label %27
27: ; preds = %26, %25, %14
%28 = load i32, i32* %8
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%32 = call i32 @exit(i32 1)
unreachable
33: ; preds = %27
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
@str = [15 x i8] c"Argument error\00"
define i32 @checkArgument(i32 %0, i32 %1, i32 %2) {
switch i32 %0, label %10 [
i32 2, label %4
i32 3, label %6
]
4: ; preds = %3
%5 = icmp sgt i32 %1, 1899
br i1 %5, label %13, label %10
6: ; preds = %3
%7 = icmp sgt i32 %1, 1899
%8 = icmp ult i32 %2, 13
%9 = and i1 %7, %8
br i1 %9, label %13, label %10
10: ; preds = %4, %3, %6
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %4, %6
ret i32 undef
}