#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*/ insertHead(struct node **, struct node **, int);
int main(void) {
  struct node *head = NULL;
  struct node *tail = NULL;
  insertHead(&head, &tail, 1);
  insertHead(&head, &tail, 2);
  insertHead(&head, &tail, 3);
  insertHead(&head, &tail, 4);
  insertHead(&head, &tail, 5);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <insertHead@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x2,%edx
call   1030 <insertHead@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x3,%edx
call   1030 <insertHead@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <insertHead@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x5,%edx
call   1030 <insertHead@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <insertHead@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <insertHead@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   1030 <insertHead@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <insertHead@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
call   1030 <insertHead@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
%3 = alloca %struct.node*
store i32 0, i32* %1
store %struct.node* null, %struct.node** %2
store %struct.node* null, %struct.node** %3
%4 = call i32 @insertHead(%struct.node** %2, %struct.node** %3, i32 1)
%5 = call i32 @insertHead(%struct.node** %2, %struct.node** %3, i32 2)
%6 = call i32 @insertHead(%struct.node** %2, %struct.node** %3, i32 3)
%7 = call i32 @insertHead(%struct.node** %2, %struct.node** %3, i32 4)
%8 = call i32 @insertHead(%struct.node** %2, %struct.node** %3, i32 5)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca %struct.node*
%2 = alloca %struct.node*
%3 = bitcast %struct.node** %1 to i8*
store %struct.node* null, %struct.node** %1
%4 = bitcast %struct.node** %2 to i8*
store %struct.node* null, %struct.node** %2
%5 = call i32 @insertHead(%struct.node** %1, %struct.node** %2, i32 1)
%6 = call i32 @insertHead(%struct.node** %1, %struct.node** %2, i32 2)
%7 = call i32 @insertHead(%struct.node** %1, %struct.node** %2, i32 3)
%8 = call i32 @insertHead(%struct.node** %1, %struct.node** %2, i32 4)
%9 = call i32 @insertHead(%struct.node** %1, %struct.node** %2, i32 5)
ret i32 0
}