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

/* Variables and functions */
int /*<<< orphan*/ diset_delete(struct diset *);
int diset_find(struct diset *, int);
int diset_members(struct diset *, int);
int /*<<< orphan*/ diset_merge(struct diset *, int, int);
struct diset *diset_new(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  struct diset *d = diset_new(10);
  printf("%d\n", diset_find(d, 1));
  diset_merge(d, 1, 4);
  printf("%d\n", diset_find(d, 4));
  printf("%d\n", diset_find(d, 1));
  printf("%d\n", diset_members(d, 4));
  diset_delete(d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
call   1060 <diset_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1080 <diset_find@plt>
mov    %eax,%esi
lea    0xe6c(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1040 <diset_merge@plt>
mov    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   1080 <diset_find@plt>
mov    %eax,%esi
lea    0xe3d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1080 <diset_find@plt>
mov    %eax,%esi
lea    0xe21(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   1070 <diset_members@plt>
mov    %eax,%esi
lea    0xe05(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <diset_delete@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xa,%edi
call   1060 <diset_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
call   1080 <diset_find@plt>
lea    0xe7b(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1040 <diset_merge@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1080 <diset_find@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1080 <diset_find@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1070 <diset_members@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <diset_delete@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.diset = type { i32 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca %struct.diset*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call %struct.diset* @diset_new(i32 10)
store %struct.diset* %6, %struct.diset** %5
%7 = load %struct.diset*, %struct.diset** %5
%8 = call i32 @diset_find(%struct.diset* %7, i32 1)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load %struct.diset*, %struct.diset** %5
%11 = call i32 @diset_merge(%struct.diset* %10, i32 1, i32 4)
%12 = load %struct.diset*, %struct.diset** %5
%13 = call i32 @diset_find(%struct.diset* %12, i32 4)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load %struct.diset*, %struct.diset** %5
%16 = call i32 @diset_find(%struct.diset* %15, i32 1)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load %struct.diset*, %struct.diset** %5
%19 = call i32 @diset_members(%struct.diset* %18, i32 4)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load %struct.diset*, %struct.diset** %5
%22 = call i32 @diset_delete(%struct.diset* %21)
ret i32 0
}

LLVM IR (-O2):
%struct.diset = type { i32 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.diset* @diset_new(i32 10)
%4 = tail call i32 @diset_find(%struct.diset* %3, i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @diset_merge(%struct.diset* %3, i32 1, i32 4)
%7 = tail call i32 @diset_find(%struct.diset* %3, i32 4)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @diset_find(%struct.diset* %3, i32 1)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = tail call i32 @diset_members(%struct.diset* %3, i32 4)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = tail call i32 @diset_delete(%struct.diset* %3)
ret i32 0
}