#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 *addTwoNumbers(struct ListNode *, struct ListNode *);
struct ListNode *createNumbers(int);
int /*<<< orphan*/ deleteList(struct ListNode *);
int /*<<< orphan*/ printList(struct ListNode *);
int main(int argc, char **argv) {
  struct ListNode *numA = createNumbers(342);
  struct ListNode *numB = createNumbers(465);
  struct ListNode *sum = addTwoNumbers(numA, numB);
  printList(numA);
  printList(numB);
  printList(sum);
  deleteList(numA);
  deleteList(numB);
  deleteList(sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x156,%edi
call   1050 <createNumbers@plt>
mov    %rax,-0x18(%rbp)
mov    $0x1d1,%edi
call   1050 <createNumbers@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <addTwoNumbers@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <printList@plt>
mov    -0x20(%rbp),%rdi
call   1060 <printList@plt>
mov    -0x28(%rbp),%rdi
call   1060 <printList@plt>
mov    -0x18(%rbp),%rdi
call   1040 <deleteList@plt>
mov    -0x20(%rbp),%rdi
call   1040 <deleteList@plt>
mov    -0x28(%rbp),%rdi
call   1040 <deleteList@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x156,%edi
call   1050 <createNumbers@plt>
mov    %rax,%r14
mov    $0x1d1,%edi
call   1050 <createNumbers@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <addTwoNumbers@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1060 <printList@plt>
mov    %rbx,%rdi
call   1060 <printList@plt>
mov    %r15,%rdi
call   1060 <printList@plt>
mov    %r14,%rdi
call   1040 <deleteList@plt>
mov    %rbx,%rdi
call   1040 <deleteList@plt>
mov    %r15,%rdi
call   1040 <deleteList@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.ListNode = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.ListNode*
%7 = alloca %struct.ListNode*
%8 = alloca %struct.ListNode*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call %struct.ListNode* @createNumbers(i32 342)
store %struct.ListNode* %9, %struct.ListNode** %6
%10 = call %struct.ListNode* @createNumbers(i32 465)
store %struct.ListNode* %10, %struct.ListNode** %7
%11 = load %struct.ListNode*, %struct.ListNode** %6
%12 = load %struct.ListNode*, %struct.ListNode** %7
%13 = call %struct.ListNode* @addTwoNumbers(%struct.ListNode* %11, %struct.ListNode* %12)
store %struct.ListNode* %13, %struct.ListNode** %8
%14 = load %struct.ListNode*, %struct.ListNode** %6
%15 = call i32 @printList(%struct.ListNode* %14)
%16 = load %struct.ListNode*, %struct.ListNode** %7
%17 = call i32 @printList(%struct.ListNode* %16)
%18 = load %struct.ListNode*, %struct.ListNode** %8
%19 = call i32 @printList(%struct.ListNode* %18)
%20 = load %struct.ListNode*, %struct.ListNode** %6
%21 = call i32 @deleteList(%struct.ListNode* %20)
%22 = load %struct.ListNode*, %struct.ListNode** %7
%23 = call i32 @deleteList(%struct.ListNode* %22)
%24 = load %struct.ListNode*, %struct.ListNode** %8
%25 = call i32 @deleteList(%struct.ListNode* %24)
ret i32 0
}

LLVM IR (-O2):
%struct.ListNode = type { i32 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.ListNode* @createNumbers(i32 342)
%4 = tail call %struct.ListNode* @createNumbers(i32 465)
%5 = tail call %struct.ListNode* @addTwoNumbers(%struct.ListNode* %3, %struct.ListNode* %4)
%6 = tail call i32 @printList(%struct.ListNode* %3)
%7 = tail call i32 @printList(%struct.ListNode* %4)
%8 = tail call i32 @printList(%struct.ListNode* %5)
%9 = tail call i32 @deleteList(%struct.ListNode* %3)
%10 = tail call i32 @deleteList(%struct.ListNode* %4)
%11 = tail call i32 @deleteList(%struct.ListNode* %5)
ret i32 0
}