#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 shashset const shashset;
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ shashset_bucket_count(struct shashset const *);
int /*<<< orphan*/ shashset_init_copy_sized(struct shashset const *,
                                            struct shashset const *,
                                            int /*<<< orphan*/);
void shashset_init_copy(struct shashset *s, const struct shashset *src) {
  assert(s);
  assert(src);
  assert(s != src);
  ssize_t num_buckets = shashset_bucket_count(src);
  shashset_init_copy_sized(s, src, num_buckets);
}


x86 assembly (clang, -O0):
<shashset_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   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1050 <shashset_bucket_count@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <shashset_init_copy_sized@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

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