#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 *createList(int *, int);
int /*<<< orphan*/ freeList(struct ListNode *);
int /*<<< orphan*/ oddEvenList(struct ListNode *);
int /*<<< orphan*/ printList(struct ListNode *);
int main(void) {
  int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  struct ListNode *head = createList(arr, 3);
  printList(head);
  oddEvenList(head);
  printList(head);
  freeList(head);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe96(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x3,%esi
call   1050 <createList@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
call   1070 <printList@plt>
mov    -0x38(%rbp),%rdi
call   1060 <oddEvenList@plt>
mov    -0x38(%rbp),%rdi
call   1070 <printList@plt>
mov    -0x38(%rbp),%rdi
call   1030 <freeList@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xed4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe9c(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
call   1040 <createList@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <printList@plt>
mov    %rbx,%rdi
call   1050 <oddEvenList@plt>
mov    %rbx,%rdi
call   1060 <printList@plt>
mov    %rbx,%rdi
call   1030 <freeList@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.ListNode = type { i32 }
@__const.main.arr = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call %struct.ListNode* @createList(i32* %3, i32 3)
%5 = call i32 @printList(%struct.ListNode* %4)
%6 = call i32 @oddEvenList(%struct.ListNode* %4)
%7 = call i32 @printList(%struct.ListNode* %4)
%8 = call i32 @freeList(%struct.ListNode* %4)
ret i32 0
}