#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 HarbolVector {
  int dummy;
};
struct HarbolHashmap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ harbol_hashmap_from_vector(struct HarbolHashmap *,
                                              struct HarbolVector const *const);
struct HarbolHashmap *harbol_hashmap_new();
struct HarbolHashmap *
harbol_hashmap_new_from_vector(const struct HarbolVector *const v) {
  if (!v)
    return NULL;
  struct HarbolHashmap *map = harbol_hashmap_new();
  harbol_hashmap_from_vector(map, v);
  return map;
}


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

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

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

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