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

/* Variables and functions */
int /*<<< orphan*/ insertNode(struct node **, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ printlist(struct node *);
int /*<<< orphan*/ recursivereverse(struct node **);
int main() {
  struct node *head = NULL;
  insertNode(&head, 2);
  insertNode(&head, 4);
  insertNode(&head, 6);
  insertNode(&head, 8);
  insertNode(&head, 10);
  printlist(head);
  recursivereverse(&head);
  printf("\n");
  printlist(head);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1030 <insertNode@plt>
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1030 <insertNode@plt>
lea    -0x10(%rbp),%rdi
mov    $0x6,%esi
call   1030 <insertNode@plt>
lea    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1030 <insertNode@plt>
lea    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <insertNode@plt>
mov    -0x10(%rbp),%rdi
call   1060 <printlist@plt>
lea    -0x10(%rbp),%rdi
call   1050 <recursivereverse@plt>
lea    0xe4a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <printlist@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <insertNode@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <insertNode@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1040 <insertNode@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <insertNode@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <insertNode@plt>
mov    0x8(%rsp),%rdi
call   1060 <printlist@plt>
mov    %rbx,%rdi
call   1050 <recursivereverse@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%rdi
call   1060 <printlist@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
store i32 0, i32* %1
store %struct.node* null, %struct.node** %2
%3 = call i32 @insertNode(%struct.node** %2, i32 2)
%4 = call i32 @insertNode(%struct.node** %2, i32 4)
%5 = call i32 @insertNode(%struct.node** %2, i32 6)
%6 = call i32 @insertNode(%struct.node** %2, i32 8)
%7 = call i32 @insertNode(%struct.node** %2, i32 10)
%8 = load %struct.node*, %struct.node** %2
%9 = call i32 @printlist(%struct.node* %8)
%10 = call i32 @recursivereverse(%struct.node** %2)
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = load %struct.node*, %struct.node** %2
%13 = call i32 @printlist(%struct.node* %12)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca %struct.node*
%2 = bitcast %struct.node** %1 to i8*
store %struct.node* null, %struct.node** %1
%3 = call i32 @insertNode(%struct.node** %1, i32 2)
%4 = call i32 @insertNode(%struct.node** %1, i32 4)
%5 = call i32 @insertNode(%struct.node** %1, i32 6)
%6 = call i32 @insertNode(%struct.node** %1, i32 8)
%7 = call i32 @insertNode(%struct.node** %1, i32 10)
%8 = load %struct.node*, %struct.node** %1
%9 = call i32 @printlist(%struct.node* %8)
%10 = call i32 @recursivereverse(%struct.node** %1)
%11 = call i32 @putchar(i32 10)
%12 = load %struct.node*, %struct.node** %1
%13 = call i32 @printlist(%struct.node* %12)
ret i32 0
}