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

/* Variables and functions */
struct dll *create();
int /*<<< orphan*/ insertHead(struct dll *, struct node *);
struct node *node_malloc(int);
int main(void) {
  struct dll *dll = create();
  struct node *n1 = node_malloc(1);
  struct node *n2 = node_malloc(2);
  struct node *n3 = node_malloc(3);
  struct node *n4 = node_malloc(4);
  struct node *n5 = node_malloc(5);
  insertHead(dll, n1);
  insertHead(dll, n2);
  insertHead(dll, n3);
  insertHead(dll, n4);
  insertHead(dll, n5);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <create@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <node_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x2,%edi
call   1030 <node_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x3,%edi
call   1030 <node_malloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x4,%edi
call   1030 <node_malloc@plt>
mov    %rax,-0x30(%rbp)
mov    $0x5,%edi
call   1030 <node_malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <insertHead@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <insertHead@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <insertHead@plt>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1050 <insertHead@plt>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1050 <insertHead@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <create@plt>
mov    %rax,%rbx
mov    $0x1,%edi
call   1030 <node_malloc@plt>
mov    %rax,%r14
mov    $0x2,%edi
call   1030 <node_malloc@plt>
mov    %rax,%r15
mov    $0x3,%edi
call   1030 <node_malloc@plt>
mov    %rax,%r12
mov    $0x4,%edi
call   1030 <node_malloc@plt>
mov    %rax,%r13
mov    $0x5,%edi
call   1030 <node_malloc@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <insertHead@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <insertHead@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <insertHead@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <insertHead@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <insertHead@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.dll = type { i32 }
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.dll*
%3 = alloca %struct.node*
%4 = alloca %struct.node*
%5 = alloca %struct.node*
%6 = alloca %struct.node*
%7 = alloca %struct.node*
store i32 0, i32* %1
%8 = call %struct.dll* (...) @create()
store %struct.dll* %8, %struct.dll** %2
%9 = call %struct.node* @node_malloc(i32 1)
store %struct.node* %9, %struct.node** %3
%10 = call %struct.node* @node_malloc(i32 2)
store %struct.node* %10, %struct.node** %4
%11 = call %struct.node* @node_malloc(i32 3)
store %struct.node* %11, %struct.node** %5
%12 = call %struct.node* @node_malloc(i32 4)
store %struct.node* %12, %struct.node** %6
%13 = call %struct.node* @node_malloc(i32 5)
store %struct.node* %13, %struct.node** %7
%14 = load %struct.dll*, %struct.dll** %2
%15 = load %struct.node*, %struct.node** %3
%16 = call i32 @insertHead(%struct.dll* %14, %struct.node* %15)
%17 = load %struct.dll*, %struct.dll** %2
%18 = load %struct.node*, %struct.node** %4
%19 = call i32 @insertHead(%struct.dll* %17, %struct.node* %18)
%20 = load %struct.dll*, %struct.dll** %2
%21 = load %struct.node*, %struct.node** %5
%22 = call i32 @insertHead(%struct.dll* %20, %struct.node* %21)
%23 = load %struct.dll*, %struct.dll** %2
%24 = load %struct.node*, %struct.node** %6
%25 = call i32 @insertHead(%struct.dll* %23, %struct.node* %24)
%26 = load %struct.dll*, %struct.dll** %2
%27 = load %struct.node*, %struct.node** %7
%28 = call i32 @insertHead(%struct.dll* %26, %struct.node* %27)
ret i32 0
}

LLVM IR (-O2):
%struct.dll = type { i32 }
%struct.node = type { i32 }
define i32 @main() {
%1 = tail call %struct.dll* (...) @create()
%2 = tail call %struct.node* @node_malloc(i32 1)
%3 = tail call %struct.node* @node_malloc(i32 2)
%4 = tail call %struct.node* @node_malloc(i32 3)
%5 = tail call %struct.node* @node_malloc(i32 4)
%6 = tail call %struct.node* @node_malloc(i32 5)
%7 = tail call i32 @insertHead(%struct.dll* %1, %struct.node* %2)
%8 = tail call i32 @insertHead(%struct.dll* %1, %struct.node* %3)
%9 = tail call i32 @insertHead(%struct.dll* %1, %struct.node* %4)
%10 = tail call i32 @insertHead(%struct.dll* %1, %struct.node* %5)
%11 = tail call i32 @insertHead(%struct.dll* %1, %struct.node* %6)
ret i32 0
}