#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 */
struct beeversion {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct beeversion *);
int compare_beepackage_names(struct beeversion *, struct beeversion *);
int compare_beeversions(struct beeversion *, struct beeversion *);
int compare_beepackages(struct beeversion *v1, struct beeversion *v2) {
  int ret;
  assert(v1);
  assert(v2);
  ret = compare_beepackage_names(v1, v2);
  if (!ret)
    ret = compare_beeversions(v1, v2);
  return (ret);
}


x86 assembly (clang, -O0):
<compare_beepackages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <compare_beepackage_names@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    117c <compare_beepackages+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <compare_beeversions@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_beepackages>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <assert@plt>
mov    %r14,%rdi
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <compare_beepackage_names@plt>
test   %eax,%eax
je     115e <compare_beepackages+0x2e>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <compare_beeversions@plt>

LLVM IR (-O0):
%struct.beeversion = type { i32 }
define i32 @compare_beepackages(%struct.beeversion* %0, %struct.beeversion* %1) {
%3 = alloca %struct.beeversion*
%4 = alloca %struct.beeversion*
%5 = alloca i32
store %struct.beeversion* %0, %struct.beeversion** %3
store %struct.beeversion* %1, %struct.beeversion** %4
%6 = load %struct.beeversion*, %struct.beeversion** %3
%7 = call i32 @assert(%struct.beeversion* %6)
%8 = load %struct.beeversion*, %struct.beeversion** %4
%9 = call i32 @assert(%struct.beeversion* %8)
%10 = load %struct.beeversion*, %struct.beeversion** %3
%11 = load %struct.beeversion*, %struct.beeversion** %4
%12 = call i32 @compare_beepackage_names(%struct.beeversion* %10, %struct.beeversion* %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %2
%16 = load %struct.beeversion*, %struct.beeversion** %3
%17 = load %struct.beeversion*, %struct.beeversion** %4
%18 = call i32 @compare_beeversions(%struct.beeversion* %16, %struct.beeversion* %17)
store i32 %18, i32* %5
br label %19
19: ; preds = %15, %2
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
%struct.beeversion = type { i32 }
define i32 @compare_beepackages(%struct.beeversion* %0, %struct.beeversion* %1) {
%3 = tail call i32 @assert(%struct.beeversion* %0)
%4 = tail call i32 @assert(%struct.beeversion* %1)
%5 = tail call i32 @compare_beepackage_names(%struct.beeversion* %0, %struct.beeversion* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @compare_beeversions(%struct.beeversion* %0, %struct.beeversion* %1)
br label %9
9: ; preds = %7, %2
%10 = phi i32 [ %5, %2 ], [ %8, %7 ]
ret i32 %10
}