#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 HarbolUniList {
  int dummy;
};
struct HarbolBiList {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ harbol_unilist_from_bilist(struct HarbolUniList *const,
                                              struct HarbolBiList const *const);
struct HarbolUniList *harbol_unilist_new();
struct HarbolUniList *
harbol_unilist_new_from_bilist(const struct HarbolBiList *const bilist) {
  if (!bilist)
    return NULL;
  struct HarbolUniList *const unilist = harbol_unilist_new();
  harbol_unilist_from_bilist(unilist, bilist);
  return unilist;
}


x86 assembly (clang, -O0):
<harbol_unilist_new_from_bilist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <harbol_unilist_new_from_bilist+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1164 <harbol_unilist_new_from_bilist+0x44>
mov    $0x0,%al
call   1030 <harbol_unilist_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <harbol_unilist_from_bilist@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<harbol_unilist_new_from_bilist>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1143 <harbol_unilist_new_from_bilist+0x23>
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <harbol_unilist_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <harbol_unilist_from_bilist@plt>
jmp    1145 <harbol_unilist_new_from_bilist+0x25>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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