#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 */
typedef struct hashset const hashset;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t hashset_bucket_count(struct hashset const *);
int hashset_init_copy_sized(struct hashset const *, struct hashset const *,
                            size_t);
int hashset_init_copy(struct hashset *s, const struct hashset *src) {
  size_t nbucket;
  assert(s);
  assert(src);
  assert(s != src);
  nbucket = hashset_bucket_count(src);
  return hashset_init_copy_sized(s, src, nbucket);
}


x86 assembly (clang, -O0):
<hashset_init_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1050 <hashset_bucket_count@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <hashset_init_copy_sized@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashset_init_copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <assert@plt>
mov    %ebx,%edi
call   1040 <assert@plt>
xor    %edi,%edi
cmp    %rbx,%r14
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1050 <hashset_bucket_count@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <hashset_init_copy_sized@plt>

LLVM IR (-O0):
%struct.hashset = type opaque
define i32 @hashset_init_copy(%struct.hashset* %0, %struct.hashset* %1) {
%3 = alloca %struct.hashset*
%4 = alloca %struct.hashset*
%5 = alloca i64
store %struct.hashset* %0, %struct.hashset** %3
store %struct.hashset* %1, %struct.hashset** %4
%6 = load %struct.hashset*, %struct.hashset** %3
%7 = ptrtoint %struct.hashset* %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load %struct.hashset*, %struct.hashset** %4
%10 = ptrtoint %struct.hashset* %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load %struct.hashset*, %struct.hashset** %3
%13 = load %struct.hashset*, %struct.hashset** %4
%14 = icmp ne %struct.hashset* %12, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load %struct.hashset*, %struct.hashset** %4
%18 = call i64 @hashset_bucket_count(%struct.hashset* %17)
store i64 %18, i64* %5
%19 = load %struct.hashset*, %struct.hashset** %3
%20 = load %struct.hashset*, %struct.hashset** %4
%21 = load i64, i64* %5
%22 = call i32 @hashset_init_copy_sized(%struct.hashset* %19, %struct.hashset* %20, i64 %21)
ret i32 %22
}

LLVM IR (-O2):
%struct.hashset = type opaque
define i32 @hashset_init_copy(%struct.hashset* %0, %struct.hashset* %1) {
%3 = ptrtoint %struct.hashset* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = ptrtoint %struct.hashset* %1 to i64
%7 = trunc i64 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = icmp ne %struct.hashset* %0, %1
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = tail call i64 @hashset_bucket_count(%struct.hashset* %1)
%13 = tail call i32 @hashset_init_copy_sized(%struct.hashset* %0, %struct.hashset* %1, i64 %12)
ret i32 %13
}