#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 */
struct ListNode *getIntersectionNode(struct ListNode *, struct ListNode *);
struct ListNode *newNode(int, struct ListNode *);
int /*<<< orphan*/ printf(char *);
int main() {
  struct ListNode *in = newNode(8, newNode(4, newNode(5, NULL)));
  struct ListNode *l1 = newNode(4, newNode(1, in));
  struct ListNode *l2 = newNode(5, newNode(0, newNode(1, in)));
  struct ListNode *out = getIntersectionNode(l1, l2);
  if (in == out) {
    printf("yes\n");
  }
  in = NULL;
  l1 = newNode(2, newNode(6, newNode(4, NULL)));
  l2 = newNode(1, newNode(5, NULL));
  out = getIntersectionNode(l1, l2);
  if (in == out) {
    printf("yes\n");
  }
  in = NULL;
  l1 = newNode(2, newNode(6, newNode(4, NULL)));
  l2 = NULL;
  out = getIntersectionNode(l1, l2);
  if (in == out) {
    printf("yes\n");
  }
  in = newNode(2, newNode(4, NULL));
  l1 = newNode(0, newNode(9, newNode(1, in)));
  l2 = newNode(3, in);
  out = getIntersectionNode(l1, l2);
  if (in == out) {
    printf("yes\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x4,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x8,%edi
call   1050 <newNode@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x4,%edi
call   1050 <newNode@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
xor    %edi,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x5,%edi
call   1050 <newNode@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <getIntersectionNode@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    11de <main+0xae>
lea    0xe27(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x10(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x6,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x2,%edi
call   1050 <newNode@plt>
mov    %rax,-0x18(%rbp)
mov    $0x5,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x1,%edi
call   1050 <newNode@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <getIntersectionNode@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    125c <main+0x12c>
lea    0xda9(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x10(%rbp)
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x6,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x2,%edi
call   1050 <newNode@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <getIntersectionNode@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    12c3 <main+0x193>
lea    0xd42(%rip),%rdi
call   1030 <printf@plt>
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x2,%edi
call   1050 <newNode@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
mov    $0x9,%edi
call   1050 <newNode@plt>
mov    %rax,%rsi
xor    %edi,%edi
call   1050 <newNode@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x3,%edi
call   1050 <newNode@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <getIntersectionNode@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1348 <main+0x218>
lea    0xcbd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x5,%edi
xor    %esi,%esi
call   1050 <newNode@plt>
mov    $0x4,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    $0x8,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    %rax,%rbx
mov    $0x1,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    $0x4,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    %rax,%r14
mov    $0x1,%edi
mov    %rbx,%rsi
call   1050 <newNode@plt>
xor    %edi,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    $0x5,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <getIntersectionNode@plt>
cmp    %rax,%rbx
jne    11ba <main+0x8a>
lea    0xe4b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1050 <newNode@plt>
mov    $0x6,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    $0x2,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    %rax,%rbx
mov    $0x5,%edi
xor    %esi,%esi
call   1050 <newNode@plt>
mov    $0x1,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <getIntersectionNode@plt>
test   %rax,%rax
jne    1218 <main+0xe8>
lea    0xded(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1050 <newNode@plt>
mov    $0x6,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    $0x2,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    %rax,%rdi
xor    %esi,%esi
call   1040 <getIntersectionNode@plt>
test   %rax,%rax
jne    1259 <main+0x129>
lea    0xdac(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1050 <newNode@plt>
mov    $0x2,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    %rax,%rbx
mov    $0x1,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    $0x9,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
xor    %edi,%edi
mov    %rax,%rsi
call   1050 <newNode@plt>
mov    %rax,%r14
mov    $0x3,%edi
mov    %rbx,%rsi
call   1050 <newNode@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <getIntersectionNode@plt>
cmp    %rax,%rbx
jne    12c5 <main+0x195>
lea    0xd40(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ListNode = type { i32 }
@.str = [5 x i8] c"yes\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.ListNode*
%3 = alloca %struct.ListNode*
%4 = alloca %struct.ListNode*
%5 = alloca %struct.ListNode*
store i32 0, i32* %1
%6 = call %struct.ListNode* @newNode(i32 5, %struct.ListNode* null)
%7 = call %struct.ListNode* @newNode(i32 4, %struct.ListNode* %6)
%8 = call %struct.ListNode* @newNode(i32 8, %struct.ListNode* %7)
store %struct.ListNode* %8, %struct.ListNode** %2
%9 = load %struct.ListNode*, %struct.ListNode** %2
%10 = call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %9)
%11 = call %struct.ListNode* @newNode(i32 4, %struct.ListNode* %10)
store %struct.ListNode* %11, %struct.ListNode** %3
%12 = load %struct.ListNode*, %struct.ListNode** %2
%13 = call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %12)
%14 = call %struct.ListNode* @newNode(i32 0, %struct.ListNode* %13)
%15 = call %struct.ListNode* @newNode(i32 5, %struct.ListNode* %14)
store %struct.ListNode* %15, %struct.ListNode** %4
%16 = load %struct.ListNode*, %struct.ListNode** %3
%17 = load %struct.ListNode*, %struct.ListNode** %4
%18 = call %struct.ListNode* @getIntersectionNode(%struct.ListNode* %16, %struct.ListNode* %17)
store %struct.ListNode* %18, %struct.ListNode** %5
%19 = load %struct.ListNode*, %struct.ListNode** %2
%20 = load %struct.ListNode*, %struct.ListNode** %5
%21 = icmp eq %struct.ListNode* %19, %20
br i1 %21, label %22, label %24
22: ; preds = %0
%23 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %24
24: ; preds = %22, %0
store %struct.ListNode* null, %struct.ListNode** %2
%25 = call %struct.ListNode* @newNode(i32 4, %struct.ListNode* null)
%26 = call %struct.ListNode* @newNode(i32 6, %struct.ListNode* %25)
%27 = call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %26)
store %struct.ListNode* %27, %struct.ListNode** %3
%28 = call %struct.ListNode* @newNode(i32 5, %struct.ListNode* null)
%29 = call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %28)
store %struct.ListNode* %29, %struct.ListNode** %4
%30 = load %struct.ListNode*, %struct.ListNode** %3
%31 = load %struct.ListNode*, %struct.ListNode** %4
%32 = call %struct.ListNode* @getIntersectionNode(%struct.ListNode* %30, %struct.ListNode* %31)
store %struct.ListNode* %32, %struct.ListNode** %5
%33 = load %struct.ListNode*, %struct.ListNode** %2
%34 = load %struct.ListNode*, %struct.ListNode** %5
%35 = icmp eq %struct.ListNode* %33, %34
br i1 %35, label %36, label %38
36: ; preds = %24
%37 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %38
38: ; preds = %36, %24
store %struct.ListNode* null, %struct.ListNode** %2
%39 = call %struct.ListNode* @newNode(i32 4, %struct.ListNode* null)
%40 = call %struct.ListNode* @newNode(i32 6, %struct.ListNode* %39)
%41 = call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %40)
store %struct.ListNode* %41, %struct.ListNode** %3
store %struct.ListNode* null, %struct.ListNode** %4
%42 = load %struct.ListNode*, %struct.ListNode** %3
%43 = load %struct.ListNode*, %struct.ListNode** %4
%44 = call %struct.ListNode* @getIntersectionNode(%struct.ListNode* %42, %struct.ListNode* %43)
store %struct.ListNode* %44, %struct.ListNode** %5
%45 = load %struct.ListNode*, %struct.ListNode** %2
%46 = load %struct.ListNode*, %struct.ListNode** %5
%47 = icmp eq %struct.ListNode* %45, %46
br i1 %47, label %48, label %50
48: ; preds = %38
%49 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %50
50: ; preds = %48, %38
%51 = call %struct.ListNode* @newNode(i32 4, %struct.ListNode* null)
%52 = call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %51)
store %struct.ListNode* %52, %struct.ListNode** %2
%53 = load %struct.ListNode*, %struct.ListNode** %2
%54 = call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %53)
%55 = call %struct.ListNode* @newNode(i32 9, %struct.ListNode* %54)
%56 = call %struct.ListNode* @newNode(i32 0, %struct.ListNode* %55)
store %struct.ListNode* %56, %struct.ListNode** %3
%57 = load %struct.ListNode*, %struct.ListNode** %2
%58 = call %struct.ListNode* @newNode(i32 3, %struct.ListNode* %57)
store %struct.ListNode* %58, %struct.ListNode** %4
%59 = load %struct.ListNode*, %struct.ListNode** %3
%60 = load %struct.ListNode*, %struct.ListNode** %4
%61 = call %struct.ListNode* @getIntersectionNode(%struct.ListNode* %59, %struct.ListNode* %60)
store %struct.ListNode* %61, %struct.ListNode** %5
%62 = load %struct.ListNode*, %struct.ListNode** %2
%63 = load %struct.ListNode*, %struct.ListNode** %5
%64 = icmp eq %struct.ListNode* %62, %63
br i1 %64, label %65, label %67
65: ; preds = %50
%66 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %67
67: ; preds = %65, %50
%68 = load i32, i32* %1
ret i32 %68
}

LLVM IR (-O2):
%struct.ListNode = type { i32 }
@str.3 = [4 x i8] c"yes\00"
define i32 @main() {
%1 = tail call %struct.ListNode* @newNode(i32 5, %struct.ListNode* null)
%2 = tail call %struct.ListNode* @newNode(i32 4, %struct.ListNode* %1)
%3 = tail call %struct.ListNode* @newNode(i32 8, %struct.ListNode* %2)
%4 = tail call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %3)
%5 = tail call %struct.ListNode* @newNode(i32 4, %struct.ListNode* %4)
%6 = tail call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %3)
%7 = tail call %struct.ListNode* @newNode(i32 0, %struct.ListNode* %6)
%8 = tail call %struct.ListNode* @newNode(i32 5, %struct.ListNode* %7)
%9 = tail call %struct.ListNode* @getIntersectionNode(%struct.ListNode* %5, %struct.ListNode* %8)
%10 = icmp eq %struct.ListNode* %3, %9
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
br label %13
13: ; preds = %11, %0
%14 = tail call %struct.ListNode* @newNode(i32 4, %struct.ListNode* null)
%15 = tail call %struct.ListNode* @newNode(i32 6, %struct.ListNode* %14)
%16 = tail call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %15)
%17 = tail call %struct.ListNode* @newNode(i32 5, %struct.ListNode* null)
%18 = tail call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %17)
%19 = tail call %struct.ListNode* @getIntersectionNode(%struct.ListNode* %16, %struct.ListNode* %18)
%20 = icmp eq %struct.ListNode* %19, null
br i1 %20, label %21, label %23
21: ; preds = %13
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
br label %23
23: ; preds = %21, %13
%24 = tail call %struct.ListNode* @newNode(i32 4, %struct.ListNode* null)
%25 = tail call %struct.ListNode* @newNode(i32 6, %struct.ListNode* %24)
%26 = tail call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %25)
%27 = tail call %struct.ListNode* @getIntersectionNode(%struct.ListNode* %26, %struct.ListNode* null)
%28 = icmp eq %struct.ListNode* %27, null
br i1 %28, label %29, label %31
29: ; preds = %23
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
br label %31
31: ; preds = %29, %23
%32 = tail call %struct.ListNode* @newNode(i32 4, %struct.ListNode* null)
%33 = tail call %struct.ListNode* @newNode(i32 2, %struct.ListNode* %32)
%34 = tail call %struct.ListNode* @newNode(i32 1, %struct.ListNode* %33)
%35 = tail call %struct.ListNode* @newNode(i32 9, %struct.ListNode* %34)
%36 = tail call %struct.ListNode* @newNode(i32 0, %struct.ListNode* %35)
%37 = tail call %struct.ListNode* @newNode(i32 3, %struct.ListNode* %33)
%38 = tail call %struct.ListNode* @getIntersectionNode(%struct.ListNode* %36, %struct.ListNode* %37)
%39 = icmp eq %struct.ListNode* %33, %38
br i1 %39, label %40, label %42
40: ; preds = %31
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
br label %42
42: ; preds = %40, %31
ret i32 0
}