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

/* Variables and functions */
int /*<<< orphan*/ deleteDuplicates(struct ListNode *);
int /*<<< orphan*/ mk_list(struct ListNode **, int *, int);
int /*<<< orphan*/ print(struct ListNode *);
int main(int argc, char **argv) {
  struct ListNode *head = NULL;
  int a[] = {1, 1, 1, 2, 2, 3, 3, 4};
  mk_list(&head, a, 8);
  print(head);
  deleteDuplicates(head);
  print(head);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    0xeab(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xea5(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea2(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x40(%rbp),%rsi
lea    -0x18(%rbp),%rdi
mov    $0x8,%edx
call   1050 <mk_list@plt>
mov    -0x18(%rbp),%rdi
call   1040 <print@plt>
mov    -0x18(%rbp),%rdi
call   1030 <deleteDuplicates@plt>
mov    -0x18(%rbp),%rdi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movq   $0x0,0x8(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x8,%edx
call   1050 <mk_list@plt>
mov    0x8(%rsp),%rdi
call   1040 <print@plt>
mov    0x8(%rsp),%rdi
call   1030 <deleteDuplicates@plt>
mov    0x8(%rsp),%rdi
call   1040 <print@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
%struct.ListNode = type { i32 }
@__const.main.a = [8 x i32] [i32 1, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3, i32 4]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.ListNode*
%7 = alloca [8 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.ListNode* null, %struct.ListNode** %6
%8 = bitcast [8 x i32]* %7 to i8*
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %7, i64 0, i64 0
%10 = call i32 @mk_list(%struct.ListNode** %6, i32* %9, i32 8)
%11 = load %struct.ListNode*, %struct.ListNode** %6
%12 = call i32 @print(%struct.ListNode* %11)
%13 = load %struct.ListNode*, %struct.ListNode** %6
%14 = call i32 @deleteDuplicates(%struct.ListNode* %13)
%15 = load %struct.ListNode*, %struct.ListNode** %6
%16 = call i32 @print(%struct.ListNode* %15)
ret i32 0
}

LLVM IR (-O2):
%struct.ListNode = type { i32 }
@__const.main.a = [8 x i32] [i32 1, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3, i32 4]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.ListNode*
%4 = alloca [8 x i32]
%5 = bitcast %struct.ListNode** %3 to i8*
store %struct.ListNode* null, %struct.ListNode** %3
%6 = bitcast [8 x i32]* %4 to i8*
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 0
%8 = call i32 @mk_list(%struct.ListNode** %3, i32* %7, i32 8)
%9 = load %struct.ListNode*, %struct.ListNode** %3
%10 = call i32 @print(%struct.ListNode* %9)
%11 = load %struct.ListNode*, %struct.ListNode** %3
%12 = call i32 @deleteDuplicates(%struct.ListNode* %11)
%13 = load %struct.ListNode*, %struct.ListNode** %3
%14 = call i32 @print(%struct.ListNode* %13)
ret i32 0
}