#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 */

/* Variables and functions */
void *create_cons(int, void *);
void *create_nil();
int /*<<< orphan*/ list_object_contains(void *, int);
int /*<<< orphan*/ list_object_intersects(void *, void *);
int main() {
  void *l = create_nil();
  l = create_cons(3, l);
  l = create_cons(2, l);
  l = create_cons(1, l);
  list_object_contains(l, 2);
  list_object_intersects(l, l);
  void *l2 = create_nil();
  l2 = create_cons(2, l2);
  l2 = create_cons(4, l2);
  list_object_intersects(l, l2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <create_nil@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x3,%edi
call   1060 <create_cons@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x2,%edi
call   1060 <create_cons@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1060 <create_cons@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1030 <list_object_contains@plt>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <list_object_intersects@plt>
mov    $0x0,%al
call   1050 <create_nil@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0x2,%edi
call   1060 <create_cons@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0x4,%edi
call   1060 <create_cons@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <list_object_intersects@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <create_nil@plt>
mov    $0x3,%edi
mov    %rax,%rsi
call   1060 <create_cons@plt>
mov    $0x2,%edi
mov    %rax,%rsi
call   1060 <create_cons@plt>
mov    $0x1,%edi
mov    %rax,%rsi
call   1060 <create_cons@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2,%esi
call   1030 <list_object_contains@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1040 <list_object_intersects@plt>
xor    %eax,%eax
call   1050 <create_nil@plt>
mov    $0x2,%edi
mov    %rax,%rsi
call   1060 <create_cons@plt>
mov    $0x4,%edi
mov    %rax,%rsi
call   1060 <create_cons@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <list_object_intersects@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* (...) @create_nil()
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @create_cons(i32 3, i8* %5)
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i8* @create_cons(i32 2, i8* %7)
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = call i8* @create_cons(i32 1, i8* %9)
store i8* %10, i8** %2
%11 = load i8*, i8** %2
%12 = call i32 @list_object_contains(i8* %11, i32 2)
%13 = load i8*, i8** %2
%14 = load i8*, i8** %2
%15 = call i32 @list_object_intersects(i8* %13, i8* %14)
%16 = call i8* (...) @create_nil()
store i8* %16, i8** %3
%17 = load i8*, i8** %3
%18 = call i8* @create_cons(i32 2, i8* %17)
store i8* %18, i8** %3
%19 = load i8*, i8** %3
%20 = call i8* @create_cons(i32 4, i8* %19)
store i8* %20, i8** %3
%21 = load i8*, i8** %2
%22 = load i8*, i8** %3
%23 = call i32 @list_object_intersects(i8* %21, i8* %22)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* (...) @create_nil()
%2 = tail call i8* @create_cons(i32 3, i8* %1)
%3 = tail call i8* @create_cons(i32 2, i8* %2)
%4 = tail call i8* @create_cons(i32 1, i8* %3)
%5 = tail call i32 @list_object_contains(i8* %4, i32 2)
%6 = tail call i32 @list_object_intersects(i8* %4, i8* %4)
%7 = tail call i8* (...) @create_nil()
%8 = tail call i8* @create_cons(i32 2, i8* %7)
%9 = tail call i8* @create_cons(i32 4, i8* %8)
%10 = tail call i32 @list_object_intersects(i8* %4, i8* %9)
ret i32 0
}