#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 dlist_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destroy_seq(int **, int);
int dlist_append(struct dlist_node **, int *, int);
int dlist_length(struct dlist_node *);
int dlist_remove_tail(struct dlist_node **);
int **new_sequence(int /*<<< orphan*/, int);
int /*<<< orphan*/ print_list(struct dlist_node *);
int /*<<< orphan*/ printf(char *, ...);
void test_remove_tail(void) {
  int **seq = new_sequence(0, 10);
  int i = 0;
  struct dlist_node *head = NULL;
  for (i = 0; i < 10; i++) {
    if (-1 == dlist_append(&head, seq[i], sizeof(int)))
      printf("[!] failed to insert %d\n", *seq[i]);
  }
  print_list(head);
  printf("[+] destroying the list with remove_tail\n");
  for (i = 0; i < 10; i++) {
    if (-1 == dlist_remove_tail(&head))
      printf("[!] failed to remove head!\n");
  }
  if (0 != (i = dlist_length(head)))
    printf("[!] invalid list length %d (should be 0)\n", i);
  destroy_seq(seq, 10);
  printf("[+] remove_tail complete\n");
}


x86 assembly (clang, -O0):
<test_remove_tail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
mov    $0xa,%esi
call   1080 <new_sequence@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1200 <test_remove_tail+0x90>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    -0x18(%rbp),%rdi
mov    $0x4,%edx
call   1090 <dlist_append@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    11ed <test_remove_tail+0x7d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%esi
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11f2 <test_remove_tail+0x82>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    119e <test_remove_tail+0x2e>
mov    -0x18(%rbp),%rdi
call   1030 <print_list@plt>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1261 <test_remove_tail+0xf1>
lea    -0x18(%rbp),%rdi
call   1050 <dlist_remove_tail@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    124e <test_remove_tail+0xde>
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1253 <test_remove_tail+0xe3>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    121e <test_remove_tail+0xae>
mov    -0x18(%rbp),%rdi
call   1070 <dlist_length@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
je     128a <test_remove_tail+0x11a>
mov    -0xc(%rbp),%esi
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1060 <destroy_seq@plt>
lea    0xdea(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_remove_tail>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0xa,%esi
call   1090 <new_sequence@plt>
mov    %rax,%rbx
movq   $0x0,0x8(%rsp)
mov    (%rax),%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   10a0 <dlist_append@plt>
cmp    $0xffffffff,%eax
jne    11c7 <test_remove_tail+0x47>
mov    (%rbx),%rax
mov    (%rax),%esi
lea    0xe40(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   10a0 <dlist_append@plt>
cmp    $0xffffffff,%eax
jne    11f3 <test_remove_tail+0x73>
mov    0x8(%rbx),%rax
mov    (%rax),%esi
lea    0xe14(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rbx),%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   10a0 <dlist_append@plt>
cmp    $0xffffffff,%eax
jne    121f <test_remove_tail+0x9f>
mov    0x10(%rbx),%rax
mov    (%rax),%esi
lea    0xde8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rbx),%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   10a0 <dlist_append@plt>
cmp    $0xffffffff,%eax
jne    124b <test_remove_tail+0xcb>
mov    0x18(%rbx),%rax
mov    (%rax),%esi
lea    0xdbc(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x20(%rbx),%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   10a0 <dlist_append@plt>
cmp    $0xffffffff,%eax
jne    1277 <test_remove_tail+0xf7>
mov    0x20(%rbx),%rax
mov    (%rax),%esi
lea    0xd90(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x28(%rbx),%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   10a0 <dlist_append@plt>
cmp    $0xffffffff,%eax
jne    12a3 <test_remove_tail+0x123>
mov    0x28(%rbx),%rax
mov    (%rax),%esi
lea    0xd64(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x30(%rbx),%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   10a0 <dlist_append@plt>
cmp    $0xffffffff,%eax
jne    12cf <test_remove_tail+0x14f>
mov    0x30(%rbx),%rax
mov    (%rax),%esi
lea    0xd38(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x38(%rbx),%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   10a0 <dlist_append@plt>
cmp    $0xffffffff,%eax
jne    12fb <test_remove_tail+0x17b>
mov    0x38(%rbx),%rax
mov    (%rax),%esi
lea    0xd0c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x40(%rbx),%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   10a0 <dlist_append@plt>
cmp    $0xffffffff,%eax
jne    1327 <test_remove_tail+0x1a7>
mov    0x40(%rbx),%rax
mov    (%rax),%esi
lea    0xce0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x48(%rbx),%rsi
lea    0x8(%rsp),%rdi
mov    $0x4,%edx
call   10a0 <dlist_append@plt>
cmp    $0xffffffff,%eax
jne    1353 <test_remove_tail+0x1d3>
mov    0x48(%rbx),%rax
mov    (%rax),%esi
lea    0xcb4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%rdi
call   1040 <print_list@plt>
lea    0xcdf(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
call   1060 <dlist_remove_tail@plt>
cmp    $0xffffffff,%eax
jne    1384 <test_remove_tail+0x204>
lea    0xd06(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
call   1060 <dlist_remove_tail@plt>
cmp    $0xffffffff,%eax
jne    139f <test_remove_tail+0x21f>
lea    0xceb(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
call   1060 <dlist_remove_tail@plt>
cmp    $0xffffffff,%eax
jne    13ba <test_remove_tail+0x23a>
lea    0xcd0(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
call   1060 <dlist_remove_tail@plt>
cmp    $0xffffffff,%eax
jne    13d5 <test_remove_tail+0x255>
lea    0xcb5(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
call   1060 <dlist_remove_tail@plt>
cmp    $0xffffffff,%eax
jne    13f0 <test_remove_tail+0x270>
lea    0xc9a(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
call   1060 <dlist_remove_tail@plt>
cmp    $0xffffffff,%eax
jne    140b <test_remove_tail+0x28b>
lea    0xc7f(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
call   1060 <dlist_remove_tail@plt>
cmp    $0xffffffff,%eax
jne    1426 <test_remove_tail+0x2a6>
lea    0xc64(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
call   1060 <dlist_remove_tail@plt>
cmp    $0xffffffff,%eax
jne    1441 <test_remove_tail+0x2c1>
lea    0xc49(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
call   1060 <dlist_remove_tail@plt>
cmp    $0xffffffff,%eax
jne    145c <test_remove_tail+0x2dc>
lea    0xc2e(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
call   1060 <dlist_remove_tail@plt>
cmp    $0xffffffff,%eax
jne    1477 <test_remove_tail+0x2f7>
lea    0xc13(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%rdi
call   1080 <dlist_length@plt>
test   %eax,%eax
je     1495 <test_remove_tail+0x315>
lea    0xb8d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <destroy_seq@plt>
lea    0xbc3(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.dlist_node = type { i32 }
@.str = [25 x i8] c"[!] failed to insert %d\0A\00"
@.str.1 = [42 x i8] c"[+] destroying the list with remove_tail\0A\00"
@.str.2 = [28 x i8] c"[!] failed to remove head!\0A\00"
@.str.3 = [42 x i8] c"[!] invalid list length %d (should be 0)\0A\00"
@.str.4 = [26 x i8] c"[+] remove_tail complete\0A\00"
define void @test_remove_tail() {
%1 = alloca i32**
%2 = alloca i32
%3 = alloca %struct.dlist_node*
%4 = call i32** @new_sequence(i32 0, i32 10)
store i32** %4, i32*** %1
store i32 0, i32* %2
store %struct.dlist_node* null, %struct.dlist_node** %3
store i32 0, i32* %2
br label %5
5: ; preds = %25, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %28
8: ; preds = %5
%9 = load i32**, i32*** %1
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32*, i32** %9, i64 %11
%13 = load i32*, i32** %12
%14 = call i32 @dlist_append(%struct.dlist_node** %3, i32* %13, i32 4)
%15 = icmp eq i32 -1, %14
br i1 %15, label %16, label %24
16: ; preds = %8
%17 = load i32**, i32*** %1
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32*, i32** %17, i64 %19
%21 = load i32*, i32** %20
%22 = load i32, i32* %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %16, %8
br label %25
25: ; preds = %24
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %5
28: ; preds = %5
%29 = load %struct.dlist_node*, %struct.dlist_node** %3
%30 = call i32 @print_list(%struct.dlist_node* %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %32
32: ; preds = %41, %28
%33 = load i32, i32* %2
%34 = icmp slt i32 %33, 10
br i1 %34, label %35, label %44
35: ; preds = %32
%36 = call i32 @dlist_remove_tail(%struct.dlist_node** %3)
%37 = icmp eq i32 -1, %36
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %38, %35
br label %41
41: ; preds = %40
%42 = load i32, i32* %2
%43 = add nsw i32 %42, 1
store i32 %43, i32* %2
br label %32
44: ; preds = %32
%45 = load %struct.dlist_node*, %struct.dlist_node** %3
%46 = call i32 @dlist_length(%struct.dlist_node* %45)
store i32 %46, i32* %2
%47 = icmp ne i32 0, %46
br i1 %47, label %48, label %51
48: ; preds = %44
%49 = load i32, i32* %2
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %48, %44
%52 = load i32**, i32*** %1
%53 = call i32 @destroy_seq(i32** %52, i32 10)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.dlist_node = type { i32 }
@.str = [25 x i8] c"[!] failed to insert %d\0A\00"
@.str.3 = [42 x i8] c"[!] invalid list length %d (should be 0)\0A\00"
@str = [41 x i8] c"[+] destroying the list with remove_tail\00"
@str.5 = [25 x i8] c"[+] remove_tail complete\00"
@str.6 = [27 x i8] c"[!] failed to remove head!\00"
define void @test_remove_tail() {
%1 = alloca %struct.dlist_node*
%2 = tail call i32** @new_sequence(i32 0, i32 10)
%3 = bitcast %struct.dlist_node** %1 to i8*
store %struct.dlist_node* null, %struct.dlist_node** %1
%4 = load i32*, i32** %2
%5 = call i32 @dlist_append(%struct.dlist_node** %1, i32* %4, i32 4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %0, %7
%12 = getelementptr inbounds i32*, i32** %2, i64 1
%13 = load i32*, i32** %12
%14 = call i32 @dlist_append(%struct.dlist_node** %1, i32* %13, i32 4)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = load i32*, i32** %12
%18 = load i32, i32* %17
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %16, %11
%21 = getelementptr inbounds i32*, i32** %2, i64 2
%22 = load i32*, i32** %21
%23 = call i32 @dlist_append(%struct.dlist_node** %1, i32* %22, i32 4)
%24 = icmp eq i32 %23, -1
br i1 %24, label %25, label %29
25: ; preds = %20
%26 = load i32*, i32** %21
%27 = load i32, i32* %26
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %25, %20
%30 = getelementptr inbounds i32*, i32** %2, i64 3
%31 = load i32*, i32** %30
%32 = call i32 @dlist_append(%struct.dlist_node** %1, i32* %31, i32 4)
%33 = icmp eq i32 %32, -1
br i1 %33, label %34, label %38
34: ; preds = %29
%35 = load i32*, i32** %30
%36 = load i32, i32* %35
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %34, %29
%39 = getelementptr inbounds i32*, i32** %2, i64 4
%40 = load i32*, i32** %39
%41 = call i32 @dlist_append(%struct.dlist_node** %1, i32* %40, i32 4)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %47
43: ; preds = %38
%44 = load i32*, i32** %39
%45 = load i32, i32* %44
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %45)
br label %47
47: ; preds = %43, %38
%48 = getelementptr inbounds i32*, i32** %2, i64 5
%49 = load i32*, i32** %48
%50 = call i32 @dlist_append(%struct.dlist_node** %1, i32* %49, i32 4)
%51 = icmp eq i32 %50, -1
br i1 %51, label %52, label %56
52: ; preds = %47
%53 = load i32*, i32** %48
%54 = load i32, i32* %53
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %54)
br label %56
56: ; preds = %52, %47
%57 = getelementptr inbounds i32*, i32** %2, i64 6
%58 = load i32*, i32** %57
%59 = call i32 @dlist_append(%struct.dlist_node** %1, i32* %58, i32 4)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %65
61: ; preds = %56
%62 = load i32*, i32** %57
%63 = load i32, i32* %62
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %63)
br label %65
65: ; preds = %61, %56
%66 = getelementptr inbounds i32*, i32** %2, i64 7
%67 = load i32*, i32** %66
%68 = call i32 @dlist_append(%struct.dlist_node** %1, i32* %67, i32 4)
%69 = icmp eq i32 %68, -1
br i1 %69, label %70, label %74
70: ; preds = %65
%71 = load i32*, i32** %66
%72 = load i32, i32* %71
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %72)
br label %74
74: ; preds = %70, %65
%75 = getelementptr inbounds i32*, i32** %2, i64 8
%76 = load i32*, i32** %75
%77 = call i32 @dlist_append(%struct.dlist_node** %1, i32* %76, i32 4)
%78 = icmp eq i32 %77, -1
br i1 %78, label %79, label %83
79: ; preds = %74
%80 = load i32*, i32** %75
%81 = load i32, i32* %80
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %81)
br label %83
83: ; preds = %79, %74
%84 = getelementptr inbounds i32*, i32** %2, i64 9
%85 = load i32*, i32** %84
%86 = call i32 @dlist_append(%struct.dlist_node** %1, i32* %85, i32 4)
%87 = icmp eq i32 %86, -1
br i1 %87, label %88, label %92
88: ; preds = %83
%89 = load i32*, i32** %84
%90 = load i32, i32* %89
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %90)
br label %92
92: ; preds = %88, %83
%93 = load %struct.dlist_node*, %struct.dlist_node** %1
%94 = call i32 @print_list(%struct.dlist_node* %93)
%95 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%96 = call i32 @dlist_remove_tail(%struct.dlist_node** %1)
%97 = icmp eq i32 %96, -1
br i1 %97, label %98, label %100
98: ; preds = %92
%99 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
br label %100
100: ; preds = %92, %98
%101 = call i32 @dlist_remove_tail(%struct.dlist_node** %1)
%102 = icmp eq i32 %101, -1
br i1 %102, label %103, label %105
103: ; preds = %100
%104 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
br label %105
105: ; preds = %103, %100
%106 = call i32 @dlist_remove_tail(%struct.dlist_node** %1)
%107 = icmp eq i32 %106, -1
br i1 %107, label %108, label %110
108: ; preds = %105
%109 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
br label %110
110: ; preds = %108, %105
%111 = call i32 @dlist_remove_tail(%struct.dlist_node** %1)
%112 = icmp eq i32 %111, -1
br i1 %112, label %113, label %115
113: ; preds = %110
%114 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
br label %115
115: ; preds = %113, %110
%116 = call i32 @dlist_remove_tail(%struct.dlist_node** %1)
%117 = icmp eq i32 %116, -1
br i1 %117, label %118, label %120
118: ; preds = %115
%119 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
br label %120
120: ; preds = %118, %115
%121 = call i32 @dlist_remove_tail(%struct.dlist_node** %1)
%122 = icmp eq i32 %121, -1
br i1 %122, label %123, label %125
123: ; preds = %120
%124 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
br label %125
125: ; preds = %123, %120
%126 = call i32 @dlist_remove_tail(%struct.dlist_node** %1)
%127 = icmp eq i32 %126, -1
br i1 %127, label %128, label %130
128: ; preds = %125
%129 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
br label %130
130: ; preds = %128, %125
%131 = call i32 @dlist_remove_tail(%struct.dlist_node** %1)
%132 = icmp eq i32 %131, -1
br i1 %132, label %133, label %135
133: ; preds = %130
%134 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
br label %135
135: ; preds = %133, %130
%136 = call i32 @dlist_remove_tail(%struct.dlist_node** %1)
%137 = icmp eq i32 %136, -1
br i1 %137, label %138, label %140
138: ; preds = %135
%139 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
br label %140
140: ; preds = %138, %135
%141 = call i32 @dlist_remove_tail(%struct.dlist_node** %1)
%142 = icmp eq i32 %141, -1
br i1 %142, label %143, label %145
143: ; preds = %140
%144 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
br label %145
145: ; preds = %143, %140
%146 = load %struct.dlist_node*, %struct.dlist_node** %1
%147 = call i32 @dlist_length(%struct.dlist_node* %146)
%148 = icmp eq i32 %147, 0
br i1 %148, label %151, label %149
149: ; preds = %145
%150 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 %147)
br label %151
151: ; preds = %149, %145
%152 = call i32 @destroy_seq(i32** %2, i32 10)
%153 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.5, i64 0, i64 0))
ret void
}