#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 *intToNode(int);
int /*<<< orphan*/ printNode(struct ListNode *);
int main() {
  int n1 = 81;
  int n2 = 0;
  struct ListNode *l1 = intToNode(n1);
  struct ListNode *l2 = intToNode(n2);
  struct ListNode *l3 = addTwoNumbers(l1, l2);
  printNode(l1);
  printNode(l2);
  printNode(l3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x51,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <intToNode@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <intToNode@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   1050 <printNode@plt>
mov    -0x20(%rbp),%rdi
call   1050 <printNode@plt>
mov    -0x28(%rbp),%rdi
call   1050 <printNode@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x51,%edi
call   1040 <intToNode@plt>
mov    %rax,%r14
xor    %edi,%edi
call   1040 <intToNode@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <addTwoNumbers@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1050 <printNode@plt>
mov    %rbx,%rdi
call   1050 <printNode@plt>
mov    %r15,%rdi
call   1050 <printNode@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.ListNode = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.ListNode*
%5 = alloca %struct.ListNode*
%6 = alloca %struct.ListNode*
store i32 0, i32* %1
store i32 81, i32* %2
store i32 0, i32* %3
%7 = load i32, i32* %2
%8 = call %struct.ListNode* @intToNode(i32 %7)
store %struct.ListNode* %8, %struct.ListNode** %4
%9 = load i32, i32* %3
%10 = call %struct.ListNode* @intToNode(i32 %9)
store %struct.ListNode* %10, %struct.ListNode** %5
%11 = load %struct.ListNode*, %struct.ListNode** %4
%12 = load %struct.ListNode*, %struct.ListNode** %5
%13 = call %struct.ListNode* @addTwoNumbers(%struct.ListNode* %11, %struct.ListNode* %12)
store %struct.ListNode* %13, %struct.ListNode** %6
%14 = load %struct.ListNode*, %struct.ListNode** %4
%15 = call i32 @printNode(%struct.ListNode* %14)
%16 = load %struct.ListNode*, %struct.ListNode** %5
%17 = call i32 @printNode(%struct.ListNode* %16)
%18 = load %struct.ListNode*, %struct.ListNode** %6
%19 = call i32 @printNode(%struct.ListNode* %18)
ret i32 0
}

LLVM IR (-O2):
%struct.ListNode = type { i32 }
define i32 @main() {
%1 = tail call %struct.ListNode* @intToNode(i32 81)
%2 = tail call %struct.ListNode* @intToNode(i32 0)
%3 = tail call %struct.ListNode* @addTwoNumbers(%struct.ListNode* %1, %struct.ListNode* %2)
%4 = tail call i32 @printNode(%struct.ListNode* %1)
%5 = tail call i32 @printNode(%struct.ListNode* %2)
%6 = tail call i32 @printNode(%struct.ListNode* %3)
ret i32 0
}