#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 *createList(int *, int);
int /*<<< orphan*/ printResult(struct ListNode *);
int main() {
  struct ListNode *l1 = NULL;
  struct ListNode *l2 = NULL;
  struct ListNode *result = NULL;
  int arr1[] = {9, 9};
  int arr2[] = {1};
  l1 = createList(arr1, 2);
  l2 = createList(arr2, 1);
  printResult(l1);
  printResult(l2);
  result = addTwoNumbers(l1, l2);
  printResult(result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    0xea2(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xea0(%rip),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x28(%rbp),%rdi
mov    $0x2,%esi
call   1050 <createList@plt>
mov    %rax,-0x10(%rbp)
lea    -0x2c(%rbp),%rdi
mov    $0x1,%esi
call   1050 <createList@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <printResult@plt>
mov    -0x18(%rbp),%rdi
call   1030 <printResult@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <addTwoNumbers@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <printResult@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x900000009,%rax
mov    %rax,0x10(%rsp)
movl   $0x1,0xc(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x2,%esi
call   1050 <createList@plt>
mov    %rax,%r14
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
call   1050 <createList@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <printResult@plt>
mov    %rbx,%rdi
call   1030 <printResult@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <addTwoNumbers@plt>
mov    %rax,%rdi
call   1030 <printResult@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ListNode = type { i32 }
@__const.main.arr1 = [2 x i32] [i32 9, i32 9]
@__const.main.arr2 = [1 x i32] [i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.ListNode*
%3 = alloca %struct.ListNode*
%4 = alloca %struct.ListNode*
%5 = alloca [2 x i32]
%6 = alloca [1 x i32]
store i32 0, i32* %1
store %struct.ListNode* null, %struct.ListNode** %2
store %struct.ListNode* null, %struct.ListNode** %3
store %struct.ListNode* null, %struct.ListNode** %4
%7 = bitcast [2 x i32]* %5 to i8*
%8 = bitcast [1 x i32]* %6 to i8*
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%10 = call %struct.ListNode* @createList(i32* %9, i32 2)
store %struct.ListNode* %10, %struct.ListNode** %2
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %6, i64 0, i64 0
%12 = call %struct.ListNode* @createList(i32* %11, i32 1)
store %struct.ListNode* %12, %struct.ListNode** %3
%13 = load %struct.ListNode*, %struct.ListNode** %2
%14 = call i32 @printResult(%struct.ListNode* %13)
%15 = load %struct.ListNode*, %struct.ListNode** %3
%16 = call i32 @printResult(%struct.ListNode* %15)
%17 = load %struct.ListNode*, %struct.ListNode** %2
%18 = load %struct.ListNode*, %struct.ListNode** %3
%19 = call %struct.ListNode* @addTwoNumbers(%struct.ListNode* %17, %struct.ListNode* %18)
store %struct.ListNode* %19, %struct.ListNode** %4
%20 = load %struct.ListNode*, %struct.ListNode** %4
%21 = call i32 @printResult(%struct.ListNode* %20)
ret i32 0
}

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