#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 */
struct node *getNode(int);
int /*<<< orphan*/ insertNode(int);
int /*<<< orphan*/ print();
int /*<<< orphan*/ removeNode(struct node *);
int main() {
  struct node *temps;
  insertNode(1);
  insertNode(2);
  insertNode(3);
  insertNode(4);
  insertNode(5);
  insertNode(6);
  insertNode(7);
  insertNode(8);
  print();
  temps = getNode(3);
  removeNode(temps);
  print();
  temps = getNode(7);
  removeNode(temps);
  print();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <insertNode@plt>
mov    $0x2,%edi
call   1040 <insertNode@plt>
mov    $0x3,%edi
call   1040 <insertNode@plt>
mov    $0x4,%edi
call   1040 <insertNode@plt>
mov    $0x5,%edi
call   1040 <insertNode@plt>
mov    $0x6,%edi
call   1040 <insertNode@plt>
mov    $0x7,%edi
call   1040 <insertNode@plt>
mov    $0x8,%edi
call   1040 <insertNode@plt>
mov    $0x0,%al
call   1050 <print@plt>
mov    $0x3,%edi
call   1060 <getNode@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <removeNode@plt>
mov    $0x0,%al
call   1050 <print@plt>
mov    $0x7,%edi
call   1060 <getNode@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <removeNode@plt>
mov    $0x0,%al
call   1050 <print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <insertNode@plt>
mov    $0x2,%edi
call   1040 <insertNode@plt>
mov    $0x3,%edi
call   1040 <insertNode@plt>
mov    $0x4,%edi
call   1040 <insertNode@plt>
mov    $0x5,%edi
call   1040 <insertNode@plt>
mov    $0x6,%edi
call   1040 <insertNode@plt>
mov    $0x7,%edi
call   1040 <insertNode@plt>
mov    $0x8,%edi
call   1040 <insertNode@plt>
xor    %eax,%eax
call   1050 <print@plt>
mov    $0x3,%edi
call   1060 <getNode@plt>
mov    %rax,%rdi
call   1030 <removeNode@plt>
xor    %eax,%eax
call   1050 <print@plt>
mov    $0x7,%edi
call   1060 <getNode@plt>
mov    %rax,%rdi
call   1030 <removeNode@plt>
xor    %eax,%eax
call   1050 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = tail call i32 @insertNode(i32 1)
%2 = tail call i32 @insertNode(i32 2)
%3 = tail call i32 @insertNode(i32 3)
%4 = tail call i32 @insertNode(i32 4)
%5 = tail call i32 @insertNode(i32 5)
%6 = tail call i32 @insertNode(i32 6)
%7 = tail call i32 @insertNode(i32 7)
%8 = tail call i32 @insertNode(i32 8)
%9 = tail call i32 (...) @print()
%10 = tail call %struct.node* @getNode(i32 3)
%11 = tail call i32 @removeNode(%struct.node* %10)
%12 = tail call i32 (...) @print()
%13 = tail call %struct.node* @getNode(i32 7)
%14 = tail call i32 @removeNode(%struct.node* %13)
%15 = tail call i32 (...) @print()
ret i32 0
}