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

/* Variables and functions */
struct LinkedListNode *even_odd(struct LinkedListNode *,
                                struct LinkedListNode *);
int /*<<< orphan*/ printList(struct LinkedListNode *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ push(struct LinkedListNode **, int);
int main(void) {
  struct LinkedListNode *head1 = NULL;
  struct LinkedListNode *head2 = NULL;
  struct LinkedListNode *result_head = NULL;
  push(&head1, 4);
  push(&head1, 3);
  push(&head1, 2);
  push(&head1, 1);
  push(&head2, 9);
  push(&head2, 8);
  push(&head2, 7);
  push(&head2, 6);
  push(&head2, 5);
  printf("\nGiven linked list 1\n");
  printList(head1);
  printf("\nGiven linked list 2\n");
  printList(head2);
  result_head = even_odd(head1, head2);
  printf("\nresult linked list \n");
  printList(result_head);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1050 <push@plt>
lea    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1050 <push@plt>
lea    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1050 <push@plt>
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1050 <push@plt>
lea    -0x18(%rbp),%rdi
mov    $0x9,%esi
call   1050 <push@plt>
lea    -0x18(%rbp),%rdi
mov    $0x8,%esi
call   1050 <push@plt>
lea    -0x18(%rbp),%rdi
mov    $0x7,%esi
call   1050 <push@plt>
lea    -0x18(%rbp),%rdi
mov    $0x6,%esi
call   1050 <push@plt>
lea    -0x18(%rbp),%rdi
mov    $0x5,%esi
call   1050 <push@plt>
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <printList@plt>
lea    0xe15(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1060 <printList@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <even_odd@plt>
mov    %rax,-0x20(%rbp)
lea    0xe05(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1060 <printList@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <push@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1050 <push@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <push@plt>
lea    0xe26(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%rdi
call   1060 <printList@plt>
lea    0xe25(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%rdi
call   1060 <printList@plt>
mov    0x8(%rsp),%rdi
mov    (%rsp),%rsi
call   1040 <even_odd@plt>
mov    %rax,%rbx
lea    0xe14(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <printList@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.LinkedListNode = type { i32 }
@.str = [22 x i8] c"\0AGiven linked list 1\0A\00"
@.str.1 = [22 x i8] c"\0AGiven linked list 2\0A\00"
@.str.2 = [22 x i8] c"\0Aresult linked list \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.LinkedListNode*
%3 = alloca %struct.LinkedListNode*
%4 = alloca %struct.LinkedListNode*
store i32 0, i32* %1
store %struct.LinkedListNode* null, %struct.LinkedListNode** %2
store %struct.LinkedListNode* null, %struct.LinkedListNode** %3
store %struct.LinkedListNode* null, %struct.LinkedListNode** %4
%5 = call i32 @push(%struct.LinkedListNode** %2, i32 4)
%6 = call i32 @push(%struct.LinkedListNode** %2, i32 3)
%7 = call i32 @push(%struct.LinkedListNode** %2, i32 2)
%8 = call i32 @push(%struct.LinkedListNode** %2, i32 1)
%9 = call i32 @push(%struct.LinkedListNode** %3, i32 9)
%10 = call i32 @push(%struct.LinkedListNode** %3, i32 8)
%11 = call i32 @push(%struct.LinkedListNode** %3, i32 7)
%12 = call i32 @push(%struct.LinkedListNode** %3, i32 6)
%13 = call i32 @push(%struct.LinkedListNode** %3, i32 5)
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%15 = load %struct.LinkedListNode*, %struct.LinkedListNode** %2
%16 = call i32 @printList(%struct.LinkedListNode* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%18 = load %struct.LinkedListNode*, %struct.LinkedListNode** %3
%19 = call i32 @printList(%struct.LinkedListNode* %18)
%20 = load %struct.LinkedListNode*, %struct.LinkedListNode** %2
%21 = load %struct.LinkedListNode*, %struct.LinkedListNode** %3
%22 = call %struct.LinkedListNode* @even_odd(%struct.LinkedListNode* %20, %struct.LinkedListNode* %21)
store %struct.LinkedListNode* %22, %struct.LinkedListNode** %4
%23 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%24 = load %struct.LinkedListNode*, %struct.LinkedListNode** %4
%25 = call i32 @printList(%struct.LinkedListNode* %24)
ret i32 0
}

LLVM IR (-O2):
%struct.LinkedListNode = type { i32 }
@str = [21 x i8] c"\0AGiven linked list 1\00"
@str.3 = [21 x i8] c"\0AGiven linked list 2\00"
@str.4 = [21 x i8] c"\0Aresult linked list \00"
define i32 @main() {
%1 = alloca %struct.LinkedListNode*
%2 = alloca %struct.LinkedListNode*
%3 = bitcast %struct.LinkedListNode** %1 to i8*
store %struct.LinkedListNode* null, %struct.LinkedListNode** %1
%4 = bitcast %struct.LinkedListNode** %2 to i8*
store %struct.LinkedListNode* null, %struct.LinkedListNode** %2
%5 = call i32 @push(%struct.LinkedListNode** %1, i32 4)
%6 = call i32 @push(%struct.LinkedListNode** %1, i32 3)
%7 = call i32 @push(%struct.LinkedListNode** %1, i32 2)
%8 = call i32 @push(%struct.LinkedListNode** %1, i32 1)
%9 = call i32 @push(%struct.LinkedListNode** %2, i32 9)
%10 = call i32 @push(%struct.LinkedListNode** %2, i32 8)
%11 = call i32 @push(%struct.LinkedListNode** %2, i32 7)
%12 = call i32 @push(%struct.LinkedListNode** %2, i32 6)
%13 = call i32 @push(%struct.LinkedListNode** %2, i32 5)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%15 = load %struct.LinkedListNode*, %struct.LinkedListNode** %1
%16 = call i32 @printList(%struct.LinkedListNode* %15)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.3, i64 0, i64 0))
%18 = load %struct.LinkedListNode*, %struct.LinkedListNode** %2
%19 = call i32 @printList(%struct.LinkedListNode* %18)
%20 = load %struct.LinkedListNode*, %struct.LinkedListNode** %1
%21 = load %struct.LinkedListNode*, %struct.LinkedListNode** %2
%22 = call %struct.LinkedListNode* @even_odd(%struct.LinkedListNode* %20, %struct.LinkedListNode* %21)
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0))
%24 = call i32 @printList(%struct.LinkedListNode* %22)
ret i32 0
}