#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_buffer_append();
int /*<<< orphan*/ test_buffer_append__grow();
int /*<<< orphan*/ test_buffer_append_n();
int /*<<< orphan*/ test_buffer_clear();
int /*<<< orphan*/ test_buffer_compact();
int /*<<< orphan*/ test_buffer_equals();
int /*<<< orphan*/ test_buffer_fill();
int /*<<< orphan*/ test_buffer_formatting();
int /*<<< orphan*/ test_buffer_indexof();
int /*<<< orphan*/ test_buffer_new();
int /*<<< orphan*/ test_buffer_new_with_size();
int /*<<< orphan*/ test_buffer_prepend();
int /*<<< orphan*/ test_buffer_slice();
int /*<<< orphan*/ test_buffer_slice__end();
int /*<<< orphan*/ test_buffer_slice__end_overflow();
int /*<<< orphan*/ test_buffer_slice__range_error();
int /*<<< orphan*/ test_buffer_trim();
int main() {
  test_buffer_new();
  test_buffer_new_with_size();
  test_buffer_append();
  test_buffer_append__grow();
  test_buffer_append_n();
  test_buffer_prepend();
  test_buffer_slice();
  test_buffer_slice__range_error();
  test_buffer_slice__end();
  test_buffer_slice__end_overflow();
  test_buffer_equals();
  test_buffer_formatting();
  test_buffer_indexof();
  test_buffer_fill();
  test_buffer_clear();
  test_buffer_trim();
  test_buffer_compact();
  printf("\n  \e[32m\u2713 \e[90mok\e[0m\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test_buffer_new@plt>
mov    $0x0,%al
call   1140 <test_buffer_new_with_size@plt>
mov    $0x0,%al
call   10c0 <test_buffer_append@plt>
mov    $0x0,%al
call   1110 <test_buffer_append__grow@plt>
mov    $0x0,%al
call   1070 <test_buffer_append_n@plt>
mov    $0x0,%al
call   1050 <test_buffer_prepend@plt>
mov    $0x0,%al
call   10d0 <test_buffer_slice@plt>
mov    $0x0,%al
call   10e0 <test_buffer_slice__range_error@plt>
mov    $0x0,%al
call   10a0 <test_buffer_slice__end@plt>
mov    $0x0,%al
call   1090 <test_buffer_slice__end_overflow@plt>
mov    $0x0,%al
call   10f0 <test_buffer_equals@plt>
mov    $0x0,%al
call   1120 <test_buffer_formatting@plt>
mov    $0x0,%al
call   1040 <test_buffer_indexof@plt>
mov    $0x0,%al
call   1030 <test_buffer_fill@plt>
mov    $0x0,%al
call   10b0 <test_buffer_clear@plt>
mov    $0x0,%al
call   1100 <test_buffer_trim@plt>
mov    $0x0,%al
call   1130 <test_buffer_compact@plt>
lea    0xd53(%rip),%rdi
call   1080 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_buffer_new@plt>
xor    %eax,%eax
call   1140 <test_buffer_new_with_size@plt>
xor    %eax,%eax
call   10c0 <test_buffer_append@plt>
xor    %eax,%eax
call   1110 <test_buffer_append__grow@plt>
xor    %eax,%eax
call   1080 <test_buffer_append_n@plt>
xor    %eax,%eax
call   1060 <test_buffer_prepend@plt>
xor    %eax,%eax
call   10d0 <test_buffer_slice@plt>
xor    %eax,%eax
call   10e0 <test_buffer_slice__range_error@plt>
xor    %eax,%eax
call   10a0 <test_buffer_slice__end@plt>
xor    %eax,%eax
call   1090 <test_buffer_slice__end_overflow@plt>
xor    %eax,%eax
call   10f0 <test_buffer_equals@plt>
xor    %eax,%eax
call   1120 <test_buffer_formatting@plt>
xor    %eax,%eax
call   1050 <test_buffer_indexof@plt>
xor    %eax,%eax
call   1030 <test_buffer_fill@plt>
xor    %eax,%eax
call   10b0 <test_buffer_clear@plt>
xor    %eax,%eax
call   1100 <test_buffer_trim@plt>
xor    %eax,%eax
call   1130 <test_buffer_compact@plt>
lea    0xd61(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0A \1B[32m\E2\9C\93 \1B[90mok\1B[0m\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_buffer_new()
%3 = call i32 (...) @test_buffer_new_with_size()
%4 = call i32 (...) @test_buffer_append()
%5 = call i32 (...) @test_buffer_append__grow()
%6 = call i32 (...) @test_buffer_append_n()
%7 = call i32 (...) @test_buffer_prepend()
%8 = call i32 (...) @test_buffer_slice()
%9 = call i32 (...) @test_buffer_slice__range_error()
%10 = call i32 (...) @test_buffer_slice__end()
%11 = call i32 (...) @test_buffer_slice__end_overflow()
%12 = call i32 (...) @test_buffer_equals()
%13 = call i32 (...) @test_buffer_formatting()
%14 = call i32 (...) @test_buffer_indexof()
%15 = call i32 (...) @test_buffer_fill()
%16 = call i32 (...) @test_buffer_clear()
%17 = call i32 (...) @test_buffer_trim()
%18 = call i32 (...) @test_buffer_compact()
%19 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"\0A \1B[32m\E2\9C\93 \1B[90mok\1B[0m\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @test_buffer_new()
%2 = tail call i32 (...) @test_buffer_new_with_size()
%3 = tail call i32 (...) @test_buffer_append()
%4 = tail call i32 (...) @test_buffer_append__grow()
%5 = tail call i32 (...) @test_buffer_append_n()
%6 = tail call i32 (...) @test_buffer_prepend()
%7 = tail call i32 (...) @test_buffer_slice()
%8 = tail call i32 (...) @test_buffer_slice__range_error()
%9 = tail call i32 (...) @test_buffer_slice__end()
%10 = tail call i32 (...) @test_buffer_slice__end_overflow()
%11 = tail call i32 (...) @test_buffer_equals()
%12 = tail call i32 (...) @test_buffer_formatting()
%13 = tail call i32 (...) @test_buffer_indexof()
%14 = tail call i32 (...) @test_buffer_fill()
%15 = tail call i32 (...) @test_buffer_clear()
%16 = tail call i32 (...) @test_buffer_trim()
%17 = tail call i32 (...) @test_buffer_compact()
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}