#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*/ add(struct node **, int);
int /*<<< orphan*/ init(struct node **);
int /*<<< orphan*/ print(struct node *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  struct node *head, *top;
  init(&head);
  add(&head, 2);
  if (head == NULL) {
    printf("null head\n");
  }
  add(&head, 3);
  add(&head, 4);
  print(head);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
call   1060 <init@plt>
lea    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1030 <add@plt>
cmpq   $0x0,-0x10(%rbp)
jne    117d <main+0x3d>
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1030 <add@plt>
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1030 <add@plt>
mov    -0x10(%rbp),%rdi
call   1050 <print@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <init@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <add@plt>
cmpq   $0x0,0x8(%rsp)
jne    1173 <main+0x33>
lea    0xe92(%rip),%rdi
call   1040 <puts@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <add@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <add@plt>
mov    0x8(%rsp),%rdi
call   1050 <print@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [11 x i8] c"null head\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node*
%3 = alloca %struct.node*
store i32 0, i32* %1
%4 = call i32 @init(%struct.node** %2)
%5 = call i32 @add(%struct.node** %2, i32 2)
%6 = load %struct.node*, %struct.node** %2
%7 = icmp eq %struct.node* %6, null
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = call i32 @add(%struct.node** %2, i32 3)
%12 = call i32 @add(%struct.node** %2, i32 4)
%13 = load %struct.node*, %struct.node** %2
%14 = call i32 @print(%struct.node* %13)
ret i32 1
}

LLVM IR (-O2):
%struct.node = type { i32 }
@str = [10 x i8] c"null head\00"
define i32 @main() {
%1 = alloca %struct.node*
%2 = bitcast %struct.node** %1 to i8*
%3 = call i32 @init(%struct.node** %1)
%4 = call i32 @add(%struct.node** %1, i32 2)
%5 = load %struct.node*, %struct.node** %1
%6 = icmp eq %struct.node* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = call i32 @add(%struct.node** %1, i32 3)
%11 = call i32 @add(%struct.node** %1, i32 4)
%12 = load %struct.node*, %struct.node** %1
%13 = call i32 @print(%struct.node* %12)
ret i32 1
}