#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 */

/* Variables and functions */
int /*<<< orphan*/ delete (int);
int /*<<< orphan*/ insert(int, int);
int /*<<< orphan*/ list();
int main() {
  for (int i = 1; i <= 10; i++)
    insert(i, i < 6);
  list();
  for (int i = 1; i <= 4; i++)
    delete (i < 3);
  list();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1172 <main+0x42>
mov    -0x8(%rbp),%edi
cmpl   $0x6,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%esi
call   1040 <insert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
mov    $0x0,%al
call   1030 <list@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jg     11a9 <main+0x79>
cmpl   $0x3,-0xc(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <delete@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1180 <main+0x50>
mov    $0x0,%al
call   1030 <list@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <insert@plt>
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <insert@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1040 <insert@plt>
mov    $0x4,%edi
mov    $0x1,%esi
call   1040 <insert@plt>
mov    $0x5,%edi
mov    $0x1,%esi
call   1040 <insert@plt>
mov    $0x6,%edi
xor    %esi,%esi
call   1040 <insert@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1040 <insert@plt>
mov    $0x8,%edi
xor    %esi,%esi
call   1040 <insert@plt>
mov    $0x9,%edi
xor    %esi,%esi
call   1040 <insert@plt>
mov    $0xa,%edi
xor    %esi,%esi
call   1040 <insert@plt>
xor    %eax,%eax
call   1030 <list@plt>
mov    $0x1,%edi
call   1050 <delete@plt>
mov    $0x1,%edi
call   1050 <delete@plt>
xor    %edi,%edi
call   1050 <delete@plt>
xor    %edi,%edi
call   1050 <delete@plt>
xor    %eax,%eax
call   1030 <list@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 10
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 6
%11 = zext i1 %10 to i32
%12 = call i32 @insert(i32 %8, i32 %11)
br label %13
13: ; preds = %7
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = call i32 (...) @list()
store i32 1, i32* %3
br label %18
18: ; preds = %26, %16
%19 = load i32, i32* %3
%20 = icmp sle i32 %19, 4
br i1 %20, label %21, label %29
21: ; preds = %18
%22 = load i32, i32* %3
%23 = icmp slt i32 %22, 3
%24 = zext i1 %23 to i32
%25 = call i32 @delete(i32 %24)
br label %26
26: ; preds = %21
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %18
29: ; preds = %18
%30 = call i32 (...) @list()
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @insert(i32 1, i32 1)
%2 = tail call i32 @insert(i32 2, i32 1)
%3 = tail call i32 @insert(i32 3, i32 1)
%4 = tail call i32 @insert(i32 4, i32 1)
%5 = tail call i32 @insert(i32 5, i32 1)
%6 = tail call i32 @insert(i32 6, i32 0)
%7 = tail call i32 @insert(i32 7, i32 0)
%8 = tail call i32 @insert(i32 8, i32 0)
%9 = tail call i32 @insert(i32 9, i32 0)
%10 = tail call i32 @insert(i32 10, i32 0)
%11 = tail call i32 (...) @list()
%12 = tail call i32 @delete(i32 1)
%13 = tail call i32 @delete(i32 1)
%14 = tail call i32 @delete(i32 0)
%15 = tail call i32 @delete(i32 0)
%16 = tail call i32 (...) @list()
ret i32 0
}