#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*/ printf(char *);
int /*<<< orphan*/ test_vector_clear();
int /*<<< orphan*/ test_vector_copy();
int /*<<< orphan*/ test_vector_create();
int /*<<< orphan*/ test_vector_erase();
int /*<<< orphan*/ test_vector_find_index();
int /*<<< orphan*/ test_vector_insert();
int /*<<< orphan*/ test_vector_move();
int /*<<< orphan*/ test_vector_push_back();
int /*<<< orphan*/ test_vector_push_vector();
int /*<<< orphan*/ test_vector_resize();
int /*<<< orphan*/ test_vector_set();
int /*<<< orphan*/ test_vector_write_to_file();
unsigned int test_vector(void) {
  printf("\nTesting vector...\n");
  if (!test_vector_create())
    return 0;
  ;
  if (!test_vector_resize())
    return 0;
  ;
  if (!test_vector_push_back())
    return 0;
  ;
  if (!test_vector_set())
    return 0;
  ;
  if (!test_vector_insert())
    return 0;
  ;
  if (!test_vector_find_index())
    return 0;
  ;
  if (!test_vector_push_vector())
    return 0;
  ;
  if (!test_vector_clear())
    return 0;
  ;
  if (!test_vector_copy())
    return 0;
  ;
  if (!test_vector_move())
    return 0;
  ;
  if (!test_vector_erase())
    return 0;
  ;
  if (!test_vector_write_to_file())
    return 0;
  ;
  printf("All vector tests passed!\n");
  return 1;
}


x86 assembly (clang, -O0):
<test_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <test_vector_create@plt>
cmp    $0x0,%eax
jne    1200 <test_vector+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1347 <test_vector+0x177>
mov    $0x0,%al
call   1090 <test_vector_resize@plt>
cmp    $0x0,%eax
jne    121c <test_vector+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1347 <test_vector+0x177>
mov    $0x0,%al
call   10d0 <test_vector_push_back@plt>
cmp    $0x0,%eax
jne    1238 <test_vector+0x68>
movl   $0x0,-0x4(%rbp)
jmp    1347 <test_vector+0x177>
mov    $0x0,%al
call   1080 <test_vector_set@plt>
cmp    $0x0,%eax
jne    1254 <test_vector+0x84>
movl   $0x0,-0x4(%rbp)
jmp    1347 <test_vector+0x177>
mov    $0x0,%al
call   1050 <test_vector_insert@plt>
cmp    $0x0,%eax
jne    1270 <test_vector+0xa0>
movl   $0x0,-0x4(%rbp)
jmp    1347 <test_vector+0x177>
mov    $0x0,%al
call   1070 <test_vector_find_index@plt>
cmp    $0x0,%eax
jne    128c <test_vector+0xbc>
movl   $0x0,-0x4(%rbp)
jmp    1347 <test_vector+0x177>
mov    $0x0,%al
call   10e0 <test_vector_push_vector@plt>
cmp    $0x0,%eax
jne    12a8 <test_vector+0xd8>
movl   $0x0,-0x4(%rbp)
jmp    1347 <test_vector+0x177>
mov    $0x0,%al
call   10c0 <test_vector_clear@plt>
cmp    $0x0,%eax
jne    12c4 <test_vector+0xf4>
movl   $0x0,-0x4(%rbp)
jmp    1347 <test_vector+0x177>
mov    $0x0,%al
call   10b0 <test_vector_copy@plt>
cmp    $0x0,%eax
jne    12e0 <test_vector+0x110>
movl   $0x0,-0x4(%rbp)
jmp    1347 <test_vector+0x177>
mov    $0x0,%al
call   10f0 <test_vector_move@plt>
cmp    $0x0,%eax
jne    12fc <test_vector+0x12c>
movl   $0x0,-0x4(%rbp)
jmp    1347 <test_vector+0x177>
mov    $0x0,%al
call   1060 <test_vector_erase@plt>
cmp    $0x0,%eax
jne    1318 <test_vector+0x148>
movl   $0x0,-0x4(%rbp)
jmp    1347 <test_vector+0x177>
mov    $0x0,%al
call   10a0 <test_vector_write_to_file@plt>
cmp    $0x0,%eax
jne    1334 <test_vector+0x164>
movl   $0x0,-0x4(%rbp)
jmp    1347 <test_vector+0x177>
lea    0xcd9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vector>:
push   %rbx
lea    0xe28(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <test_vector_create@plt>
test   %eax,%eax
je     1296 <test_vector+0xc6>
xor    %ebx,%ebx
xor    %eax,%eax
call   1090 <test_vector_resize@plt>
test   %eax,%eax
je     1296 <test_vector+0xc6>
xor    %ebx,%ebx
xor    %eax,%eax
call   10d0 <test_vector_push_back@plt>
test   %eax,%eax
je     1296 <test_vector+0xc6>
xor    %ebx,%ebx
xor    %eax,%eax
call   1080 <test_vector_set@plt>
test   %eax,%eax
je     1296 <test_vector+0xc6>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <test_vector_insert@plt>
test   %eax,%eax
je     1296 <test_vector+0xc6>
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <test_vector_find_index@plt>
test   %eax,%eax
je     1296 <test_vector+0xc6>
xor    %ebx,%ebx
xor    %eax,%eax
call   10e0 <test_vector_push_vector@plt>
test   %eax,%eax
je     1296 <test_vector+0xc6>
xor    %ebx,%ebx
xor    %eax,%eax
call   10c0 <test_vector_clear@plt>
test   %eax,%eax
je     1296 <test_vector+0xc6>
xor    %ebx,%ebx
xor    %eax,%eax
call   10b0 <test_vector_copy@plt>
test   %eax,%eax
je     1296 <test_vector+0xc6>
xor    %ebx,%ebx
xor    %eax,%eax
call   10f0 <test_vector_move@plt>
test   %eax,%eax
je     1296 <test_vector+0xc6>
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <test_vector_erase@plt>
test   %eax,%eax
je     1296 <test_vector+0xc6>
xor    %ebx,%ebx
xor    %eax,%eax
call   10a0 <test_vector_write_to_file@plt>
test   %eax,%eax
je     1296 <test_vector+0xc6>
lea    0xd87(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0ATesting vector...\0A\00"
@.str.1 = [26 x i8] c"All vector tests passed!\0A\00"
define i32 @test_vector() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @test_vector_create()
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %0
store i32 0, i32* %1
br label %52
6: ; preds = %0
%7 = call i32 (...) @test_vector_resize()
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %6
store i32 0, i32* %1
br label %52
10: ; preds = %6
%11 = call i32 (...) @test_vector_push_back()
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %10
store i32 0, i32* %1
br label %52
14: ; preds = %10
%15 = call i32 (...) @test_vector_set()
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %14
store i32 0, i32* %1
br label %52
18: ; preds = %14
%19 = call i32 (...) @test_vector_insert()
%20 = icmp ne i32 %19, 0
br i1 %20, label %22, label %21
21: ; preds = %18
store i32 0, i32* %1
br label %52
22: ; preds = %18
%23 = call i32 (...) @test_vector_find_index()
%24 = icmp ne i32 %23, 0
br i1 %24, label %26, label %25
25: ; preds = %22
store i32 0, i32* %1
br label %52
26: ; preds = %22
%27 = call i32 (...) @test_vector_push_vector()
%28 = icmp ne i32 %27, 0
br i1 %28, label %30, label %29
29: ; preds = %26
store i32 0, i32* %1
br label %52
30: ; preds = %26
%31 = call i32 (...) @test_vector_clear()
%32 = icmp ne i32 %31, 0
br i1 %32, label %34, label %33
33: ; preds = %30
store i32 0, i32* %1
br label %52
34: ; preds = %30
%35 = call i32 (...) @test_vector_copy()
%36 = icmp ne i32 %35, 0
br i1 %36, label %38, label %37
37: ; preds = %34
store i32 0, i32* %1
br label %52
38: ; preds = %34
%39 = call i32 (...) @test_vector_move()
%40 = icmp ne i32 %39, 0
br i1 %40, label %42, label %41
41: ; preds = %38
store i32 0, i32* %1
br label %52
42: ; preds = %38
%43 = call i32 (...) @test_vector_erase()
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
45: ; preds = %42
store i32 0, i32* %1
br label %52
46: ; preds = %42
%47 = call i32 (...) @test_vector_write_to_file()
%48 = icmp ne i32 %47, 0
br i1 %48, label %50, label %49
49: ; preds = %46
store i32 0, i32* %1
br label %52
50: ; preds = %46
%51 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %52
52: ; preds = %50, %49, %45, %41, %37, %33, %29, %25, %21, %17, %13, %9, %5
%53 = load i32, i32* %1
ret i32 %53
}

LLVM IR (-O2):
@str = [19 x i8] c"\0ATesting vector...\00"
@str.2 = [25 x i8] c"All vector tests passed!\00"
define i32 @test_vector() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test_vector_create()
%3 = icmp eq i32 %2, 0
br i1 %3, label %39, label %4
4: ; preds = %0
%5 = tail call i32 (...) @test_vector_resize()
%6 = icmp eq i32 %5, 0
br i1 %6, label %39, label %7
7: ; preds = %4
%8 = tail call i32 (...) @test_vector_push_back()
%9 = icmp eq i32 %8, 0
br i1 %9, label %39, label %10
10: ; preds = %7
%11 = tail call i32 (...) @test_vector_set()
%12 = icmp eq i32 %11, 0
br i1 %12, label %39, label %13
13: ; preds = %10
%14 = tail call i32 (...) @test_vector_insert()
%15 = icmp eq i32 %14, 0
br i1 %15, label %39, label %16
16: ; preds = %13
%17 = tail call i32 (...) @test_vector_find_index()
%18 = icmp eq i32 %17, 0
br i1 %18, label %39, label %19
19: ; preds = %16
%20 = tail call i32 (...) @test_vector_push_vector()
%21 = icmp eq i32 %20, 0
br i1 %21, label %39, label %22
22: ; preds = %19
%23 = tail call i32 (...) @test_vector_clear()
%24 = icmp eq i32 %23, 0
br i1 %24, label %39, label %25
25: ; preds = %22
%26 = tail call i32 (...) @test_vector_copy()
%27 = icmp eq i32 %26, 0
br i1 %27, label %39, label %28
28: ; preds = %25
%29 = tail call i32 (...) @test_vector_move()
%30 = icmp eq i32 %29, 0
br i1 %30, label %39, label %31
31: ; preds = %28
%32 = tail call i32 (...) @test_vector_erase()
%33 = icmp eq i32 %32, 0
br i1 %33, label %39, label %34
34: ; preds = %31
%35 = tail call i32 (...) @test_vector_write_to_file()
%36 = icmp eq i32 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %34
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0))
br label %39
39: ; preds = %34, %31, %28, %25, %22, %19, %16, %13, %10, %7, %4, %0, %37
%40 = phi i32 [ 1, %37 ], [ 0, %0 ], [ 0, %4 ], [ 0, %7 ], [ 0, %10 ], [ 0, %13 ], [ 0, %16 ], [ 0, %19 ], [ 0, %22 ], [ 0, %25 ], [ 0, %28 ], [ 0, %31 ], [ 0, %34 ]
ret i32 %40
}