#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*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stderr;
void termkey_check_version(int major, int minor) {
  if (major != 0) {
    fprintf(stderr,
            "libtermkey major version mismatch; %d (wants) != %d (library)\n",
            major, 0);
    exit(1);
  }
  if (minor > 16) {
    fprintf(stderr,
            "libtermkey minor version mismatch; %d (wants) > %d (library)\n",
            minor, 16);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<termkey_check_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115c <termkey_check_version+0x3c>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeb5(%rip),%rsi
xor    %ecx,%ecx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
cmpl   $0x10,-0x8(%rbp)
jle    118d <termkey_check_version+0x6d>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xec6(%rip),%rsi
mov    $0x10,%ecx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termkey_check_version>:
push   %rax
test   %edi,%edi
jne    112e <termkey_check_version+0xe>
mov    %esi,%edx
cmp    $0x11,%esi
jge    1146 <termkey_check_version+0x26>
pop    %rax
ret
mov    %edi,%eax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%edi
lea    0xec0(%rip),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
jmp    115b <termkey_check_version+0x3b>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xee9(%rip),%rsi
mov    $0x10,%ecx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [63 x i8] c"libtermkey major version mismatch; %d (wants) != %d (library)\0A\00"
@.str.1 = [62 x i8] c"libtermkey minor version mismatch; %d (wants) > %d (library)\0A\00"
define void @termkey_check_version(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 ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i32, i32* %3
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %9, i32 0)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 16
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load i32, i32* @stderr
%17 = load i32, i32* %4
%18 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 16)
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %12
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [63 x i8] c"libtermkey major version mismatch; %d (wants) != %d (library)\0A\00"
@.str.1 = [62 x i8] c"libtermkey minor version mismatch; %d (wants) > %d (library)\0A\00"
define void @termkey_check_version(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = icmp sgt i32 %1, 16
br i1 %9, label %10, label %14
10: ; preds = %8
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 16)
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %8
ret void
}