#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*/ backwardtraverse(struct node **);
int /*<<< orphan*/ delete (int, struct node **);
int /*<<< orphan*/ forwardtraverse(struct node **);
int /*<<< orphan*/ insert(int, struct node **);
int main(void) {
  struct node *head = NULL;
  insert(1, &head);
  insert(2, &head);
  insert(3, &head);
  insert(4, &head);
  insert(5, &head);
  insert(6, &head);
  insert(7, &head);
  forwardtraverse(&head);
  backwardtraverse(&head);
  delete (99, &head);
  forwardtraverse(&head);
  backwardtraverse(&head);
  delete (1, &head);
  forwardtraverse(&head);
  backwardtraverse(&head);
  delete (4, &head);
  forwardtraverse(&head);
  backwardtraverse(&head);
  delete (7, &head);
  forwardtraverse(&head);
  backwardtraverse(&head);
  delete (2, &head);
  forwardtraverse(&head);
  backwardtraverse(&head);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x1,%edi
lea    -0x10(%rbp),%rsi
call   1040 <insert@plt>
mov    $0x2,%edi
lea    -0x10(%rbp),%rsi
call   1040 <insert@plt>
mov    $0x3,%edi
lea    -0x10(%rbp),%rsi
call   1040 <insert@plt>
mov    $0x4,%edi
lea    -0x10(%rbp),%rsi
call   1040 <insert@plt>
mov    $0x5,%edi
lea    -0x10(%rbp),%rsi
call   1040 <insert@plt>
mov    $0x6,%edi
lea    -0x10(%rbp),%rsi
call   1040 <insert@plt>
mov    $0x7,%edi
lea    -0x10(%rbp),%rsi
call   1040 <insert@plt>
lea    -0x10(%rbp),%rdi
call   1050 <forwardtraverse@plt>
lea    -0x10(%rbp),%rdi
call   1030 <backwardtraverse@plt>
mov    $0x63,%edi
lea    -0x10(%rbp),%rsi
call   1060 <delete@plt>
lea    -0x10(%rbp),%rdi
call   1050 <forwardtraverse@plt>
lea    -0x10(%rbp),%rdi
call   1030 <backwardtraverse@plt>
mov    $0x1,%edi
lea    -0x10(%rbp),%rsi
call   1060 <delete@plt>
lea    -0x10(%rbp),%rdi
call   1050 <forwardtraverse@plt>
lea    -0x10(%rbp),%rdi
call   1030 <backwardtraverse@plt>
mov    $0x4,%edi
lea    -0x10(%rbp),%rsi
call   1060 <delete@plt>
lea    -0x10(%rbp),%rdi
call   1050 <forwardtraverse@plt>
lea    -0x10(%rbp),%rdi
call   1030 <backwardtraverse@plt>
mov    $0x7,%edi
lea    -0x10(%rbp),%rsi
call   1060 <delete@plt>
lea    -0x10(%rbp),%rdi
call   1050 <forwardtraverse@plt>
lea    -0x10(%rbp),%rdi
call   1030 <backwardtraverse@plt>
mov    $0x2,%edi
lea    -0x10(%rbp),%rsi
call   1060 <delete@plt>
lea    -0x10(%rbp),%rdi
call   1050 <forwardtraverse@plt>
lea    -0x10(%rbp),%rdi
call   1030 <backwardtraverse@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    $0x1,%edi
mov    %rbx,%rsi
call   1040 <insert@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1040 <insert@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
call   1040 <insert@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
call   1040 <insert@plt>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1040 <insert@plt>
mov    $0x6,%edi
mov    %rbx,%rsi
call   1040 <insert@plt>
mov    $0x7,%edi
mov    %rbx,%rsi
call   1040 <insert@plt>
mov    %rbx,%rdi
call   1050 <forwardtraverse@plt>
mov    %rbx,%rdi
call   1030 <backwardtraverse@plt>
mov    $0x63,%edi
mov    %rbx,%rsi
call   1060 <delete@plt>
mov    %rbx,%rdi
call   1050 <forwardtraverse@plt>
mov    %rbx,%rdi
call   1030 <backwardtraverse@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1060 <delete@plt>
mov    %rbx,%rdi
call   1050 <forwardtraverse@plt>
mov    %rbx,%rdi
call   1030 <backwardtraverse@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
call   1060 <delete@plt>
mov    %rbx,%rdi
call   1050 <forwardtraverse@plt>
mov    %rbx,%rdi
call   1030 <backwardtraverse@plt>
mov    $0x7,%edi
mov    %rbx,%rsi
call   1060 <delete@plt>
mov    %rbx,%rdi
call   1050 <forwardtraverse@plt>
mov    %rbx,%rdi
call   1030 <backwardtraverse@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1060 <delete@plt>
mov    %rbx,%rdi
call   1050 <forwardtraverse@plt>
mov    %rbx,%rdi
call   1030 <backwardtraverse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
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 @insert(i32 1, %struct.node** %2)
%4 = call i32 @insert(i32 2, %struct.node** %2)
%5 = call i32 @insert(i32 3, %struct.node** %2)
%6 = call i32 @insert(i32 4, %struct.node** %2)
%7 = call i32 @insert(i32 5, %struct.node** %2)
%8 = call i32 @insert(i32 6, %struct.node** %2)
%9 = call i32 @insert(i32 7, %struct.node** %2)
%10 = call i32 @forwardtraverse(%struct.node** %2)
%11 = call i32 @backwardtraverse(%struct.node** %2)
%12 = call i32 @delete(i32 99, %struct.node** %2)
%13 = call i32 @forwardtraverse(%struct.node** %2)
%14 = call i32 @backwardtraverse(%struct.node** %2)
%15 = call i32 @delete(i32 1, %struct.node** %2)
%16 = call i32 @forwardtraverse(%struct.node** %2)
%17 = call i32 @backwardtraverse(%struct.node** %2)
%18 = call i32 @delete(i32 4, %struct.node** %2)
%19 = call i32 @forwardtraverse(%struct.node** %2)
%20 = call i32 @backwardtraverse(%struct.node** %2)
%21 = call i32 @delete(i32 7, %struct.node** %2)
%22 = call i32 @forwardtraverse(%struct.node** %2)
%23 = call i32 @backwardtraverse(%struct.node** %2)
%24 = call i32 @delete(i32 2, %struct.node** %2)
%25 = call i32 @forwardtraverse(%struct.node** %2)
%26 = call i32 @backwardtraverse(%struct.node** %2)
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 @insert(i32 1, %struct.node** %1)
%4 = call i32 @insert(i32 2, %struct.node** %1)
%5 = call i32 @insert(i32 3, %struct.node** %1)
%6 = call i32 @insert(i32 4, %struct.node** %1)
%7 = call i32 @insert(i32 5, %struct.node** %1)
%8 = call i32 @insert(i32 6, %struct.node** %1)
%9 = call i32 @insert(i32 7, %struct.node** %1)
%10 = call i32 @forwardtraverse(%struct.node** %1)
%11 = call i32 @backwardtraverse(%struct.node** %1)
%12 = call i32 @delete(i32 99, %struct.node** %1)
%13 = call i32 @forwardtraverse(%struct.node** %1)
%14 = call i32 @backwardtraverse(%struct.node** %1)
%15 = call i32 @delete(i32 1, %struct.node** %1)
%16 = call i32 @forwardtraverse(%struct.node** %1)
%17 = call i32 @backwardtraverse(%struct.node** %1)
%18 = call i32 @delete(i32 4, %struct.node** %1)
%19 = call i32 @forwardtraverse(%struct.node** %1)
%20 = call i32 @backwardtraverse(%struct.node** %1)
%21 = call i32 @delete(i32 7, %struct.node** %1)
%22 = call i32 @forwardtraverse(%struct.node** %1)
%23 = call i32 @backwardtraverse(%struct.node** %1)
%24 = call i32 @delete(i32 2, %struct.node** %1)
%25 = call i32 @forwardtraverse(%struct.node** %1)
%26 = call i32 @backwardtraverse(%struct.node** %1)
ret i32 0
}