#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 libusb20_backend {
  int dummy;
};

/* Variables and functions */
struct libusb20_backend *libusb20_be_alloc_linux();
struct libusb20_backend *libusb20_be_alloc_ugen20();
struct libusb20_backend *libusb20_be_alloc_default(void) {
  struct libusb20_backend *pbe;
  pbe = libusb20_be_alloc_linux();
  if (pbe) {
    return (pbe);
  }
  pbe = libusb20_be_alloc_ugen20();
  if (pbe) {
    return (pbe);
  }
  return (NULL);
}


x86 assembly (clang, -O0):
<libusb20_be_alloc_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <libusb20_be_alloc_linux@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114b <libusb20_be_alloc_default+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <libusb20_be_alloc_default+0x56>
mov    $0x0,%al
call   1040 <libusb20_be_alloc_ugen20@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116e <libusb20_be_alloc_default+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <libusb20_be_alloc_default+0x56>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libusb20_be_alloc_default>:
push   %rax
xor    %eax,%eax
call   1030 <libusb20_be_alloc_linux@plt>
test   %rax,%rax
je     112f <libusb20_be_alloc_default+0xf>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <libusb20_be_alloc_ugen20@plt>

LLVM IR (-O0):
%struct.libusb20_backend = type { i32 }
define %struct.libusb20_backend* @libusb20_be_alloc_default() {
%1 = alloca %struct.libusb20_backend*
%2 = alloca %struct.libusb20_backend*
%3 = call %struct.libusb20_backend* (...) @libusb20_be_alloc_linux()
store %struct.libusb20_backend* %3, %struct.libusb20_backend** %2
%4 = load %struct.libusb20_backend*, %struct.libusb20_backend** %2
%5 = icmp ne %struct.libusb20_backend* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load %struct.libusb20_backend*, %struct.libusb20_backend** %2
store %struct.libusb20_backend* %7, %struct.libusb20_backend** %1
br label %15
8: ; preds = %0
%9 = call %struct.libusb20_backend* (...) @libusb20_be_alloc_ugen20()
store %struct.libusb20_backend* %9, %struct.libusb20_backend** %2
%10 = load %struct.libusb20_backend*, %struct.libusb20_backend** %2
%11 = icmp ne %struct.libusb20_backend* %10, null
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = load %struct.libusb20_backend*, %struct.libusb20_backend** %2
store %struct.libusb20_backend* %13, %struct.libusb20_backend** %1
br label %15
14: ; preds = %8
store %struct.libusb20_backend* null, %struct.libusb20_backend** %1
br label %15
15: ; preds = %14, %12, %6
%16 = load %struct.libusb20_backend*, %struct.libusb20_backend** %1
ret %struct.libusb20_backend* %16
}

LLVM IR (-O2):
%struct.libusb20_backend = type { i32 }
define %struct.libusb20_backend* @libusb20_be_alloc_default() {
%1 = tail call %struct.libusb20_backend* (...) @libusb20_be_alloc_linux()
%2 = icmp eq %struct.libusb20_backend* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call %struct.libusb20_backend* (...) @libusb20_be_alloc_ugen20()
br label %5
5: ; preds = %3, %0
%6 = phi %struct.libusb20_backend* [ %1, %0 ], [ %4, %3 ]
ret %struct.libusb20_backend* %6
}