#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*/ iso_lib_version(int *, int *, int *);
int iso_lib_is_compatible(int major, int minor, int micro) {
  int cmajor, cminor, cmicro;
  iso_lib_version(&cmajor, &cminor, &cmicro);
  return cmajor > major ||
         (cmajor == major &&
          (cminor > minor || (cminor == minor && cmicro >= micro)));
}


x86 assembly (clang, -O0):
<iso_lib_is_compatible>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <iso_lib_version@plt>
mov    -0x10(%rbp),%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0x19(%rbp)
jg     1194 <iso_lib_is_compatible+0x84>
mov    -0x10(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x1a(%rbp)
jne    118e <iso_lib_is_compatible+0x7e>
mov    -0x14(%rbp),%ecx
mov    $0x1,%al
cmp    -0x8(%rbp),%ecx
mov    %al,-0x1b(%rbp)
jg     1188 <iso_lib_is_compatible+0x78>
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x1c(%rbp)
jne    1182 <iso_lib_is_compatible+0x72>
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
setge  %al
mov    %al,-0x1c(%rbp)
mov    -0x1c(%rbp),%al
mov    %al,-0x1b(%rbp)
mov    -0x1b(%rbp),%al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_lib_is_compatible>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1030 <iso_lib_version@plt>
mov    0xc(%rsp),%ecx
mov    $0x1,%eax
cmp    %ebx,%ecx
jg     1161 <iso_lib_is_compatible+0x51>
xor    %eax,%eax
cmp    %ebx,%ecx
jne    1161 <iso_lib_is_compatible+0x51>
mov    $0x1,%eax
cmp    %ebp,0x8(%rsp)
jg     1161 <iso_lib_is_compatible+0x51>
sete   %al
cmp    %r14d,0x4(%rsp)
setge  %cl
and    %al,%cl
movzbl %cl,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @iso_lib_is_compatible(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = call i32 @iso_lib_version(i32* %7, i32* %8, i32* %9)
%11 = load i32, i32* %7
%12 = load i32, i32* %4
%13 = icmp sgt i32 %11, %12
br i1 %13, label %36, label %14
14: ; preds = %3
%15 = load i32, i32* %7
%16 = load i32, i32* %4
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %34
18: ; preds = %14
%19 = load i32, i32* %8
%20 = load i32, i32* %5
%21 = icmp sgt i32 %19, %20
br i1 %21, label %32, label %22
22: ; preds = %18
%23 = load i32, i32* %8
%24 = load i32, i32* %5
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i32, i32* %9
%28 = load i32, i32* %6
%29 = icmp sge i32 %27, %28
br label %30
30: ; preds = %26, %22
%31 = phi i1 [ false, %22 ], [ %29, %26 ]
br label %32
32: ; preds = %30, %18
%33 = phi i1 [ true, %18 ], [ %31, %30 ]
br label %34
34: ; preds = %32, %14
%35 = phi i1 [ false, %14 ], [ %33, %32 ]
br label %36
36: ; preds = %34, %3
%37 = phi i1 [ true, %3 ], [ %35, %34 ]
%38 = zext i1 %37 to i32
ret i32 %38
}

LLVM IR (-O2):
define i32 @iso_lib_is_compatible(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = bitcast i32* %6 to i8*
%10 = call i32 @iso_lib_version(i32* %4, i32* %5, i32* %6)
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, %0
br i1 %12, label %24, label %13
13: ; preds = %3
%14 = icmp eq i32 %11, %0
br i1 %14, label %15, label %24
15: ; preds = %13
%16 = load i32, i32* %5
%17 = icmp sgt i32 %16, %1
br i1 %17, label %24, label %18
18: ; preds = %15
%19 = icmp eq i32 %16, %1
%20 = load i32, i32* %6
%21 = icmp sge i32 %20, %2
%22 = select i1 %19, i1 %21, i1 false
%23 = zext i1 %22 to i32
br label %24
24: ; preds = %13, %18, %15, %3
%25 = phi i32 [ 1, %3 ], [ 0, %13 ], [ 1, %15 ], [ %23, %18 ]
ret i32 %25
}