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

/* Variables and functions */
struct node *LinkedList_Create(int);
int /*<<< orphan*/ LinkedList_Destroy(struct node *);
scalar_t__ isIntersect(struct node *, struct node *);
int /*<<< orphan*/ puts(char *);
int main(void) {
  struct node *list1 = LinkedList_Create(8);
  struct node *list2 = LinkedList_Create(8);
  if (isIntersect(list1, list2)) {
    puts("2 linked listed intersect");
  } else {
    puts("no intersection");
  }
  LinkedList_Destroy(list2);
  LinkedList_Destroy(list1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1050 <LinkedList_Create@plt>
mov    %rax,-0x10(%rbp)
mov    $0x8,%edi
call   1050 <LinkedList_Create@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <isIntersect@plt>
cmp    $0x0,%rax
je     1193 <main+0x53>
lea    0xe77(%rip),%rdi
call   1030 <puts@plt>
jmp    119f <main+0x5f>
lea    0xe80(%rip),%rdi
call   1030 <puts@plt>
mov    -0x18(%rbp),%rdi
call   1060 <LinkedList_Destroy@plt>
mov    -0x10(%rbp),%rdi
call   1060 <LinkedList_Destroy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x8,%edi
call   1050 <LinkedList_Create@plt>
mov    %rax,%r14
mov    $0x8,%edi
call   1050 <LinkedList_Create@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <isIntersect@plt>
test   %rax,%rax
lea    0xea7(%rip),%rax
lea    0xe86(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <LinkedList_Destroy@plt>
mov    %r14,%rdi
call   1060 <LinkedList_Destroy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [26 x i8] c"2 linked listed intersect\00"
@.str.1 = [16 x i8] c"no intersection\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
%3 = alloca %struct.node*
store i32 0, i32* %1
%4 = call %struct.node* @LinkedList_Create(i32 8)
store %struct.node* %4, %struct.node** %2
%5 = call %struct.node* @LinkedList_Create(i32 8)
store %struct.node* %5, %struct.node** %3
%6 = load %struct.node*, %struct.node** %2
%7 = load %struct.node*, %struct.node** %3
%8 = call i64 @isIntersect(%struct.node* %6, %struct.node* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = load %struct.node*, %struct.node** %3
%16 = call i32 @LinkedList_Destroy(%struct.node* %15)
%17 = load %struct.node*, %struct.node** %2
%18 = call i32 @LinkedList_Destroy(%struct.node* %17)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [26 x i8] c"2 linked listed intersect\00"
@.str.1 = [16 x i8] c"no intersection\00"
define i32 @main() {
%1 = tail call %struct.node* @LinkedList_Create(i32 8)
%2 = tail call %struct.node* @LinkedList_Create(i32 8)
%3 = tail call i64 @isIntersect(%struct.node* %1, %struct.node* %2)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
%7 = tail call i32 @LinkedList_Destroy(%struct.node* %2)
%8 = tail call i32 @LinkedList_Destroy(%struct.node* %1)
ret i32 0
}