#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*/ init_globals();
int /*<<< orphan*/ test_grow_bufsiz();
int /*<<< orphan*/ test_grow_one();
int /*<<< orphan*/ test_grow_one_grow_bufsiz_noop();
int /*<<< orphan*/ test_grow_one_grow_bufsiz_one();
int /*<<< orphan*/ test_grow_one_grow_one_noop();
int /*<<< orphan*/ test_grow_zero();
int /*<<< orphan*/ test_init_destroy();
int /*<<< orphan*/ test_overwrite_empty();
int /*<<< orphan*/ test_overwrite_inplace();
int /*<<< orphan*/ test_overwrite_large_offset_appends();
int /*<<< orphan*/ test_overwrite_overflow();
int /*<<< orphan*/ test_overwrite_overflow_grows();
int /*<<< orphan*/ test_overwritechar_empty_buffer();
int /*<<< orphan*/ test_overwritechar_inplace();
int /*<<< orphan*/ test_overwritechar_large_offset_appends();
int /*<<< orphan*/ test_write();
int /*<<< orphan*/ test_write_embedded_zero();
int /*<<< orphan*/ test_write_empty();
int /*<<< orphan*/ test_write_write_smallsiz();
int /*<<< orphan*/ test_write_writechar_smallsiz();
int /*<<< orphan*/ test_writechar();
int /*<<< orphan*/ test_writechar_zero();
void test_savebuffer() {
  init_globals();
  test_init_destroy();
  test_grow_zero();
  test_grow_bufsiz();
  test_grow_one();
  test_grow_one_grow_one_noop();
  test_grow_one_grow_bufsiz_noop();
  test_grow_one_grow_bufsiz_one();
  test_write_empty();
  test_write();
  test_write_embedded_zero();
  test_write_write_smallsiz();
  test_writechar();
  test_writechar_zero();
  test_write_writechar_smallsiz();
  test_overwrite_empty();
  test_overwrite_inplace();
  test_overwrite_overflow();
  test_overwrite_overflow_grows();
  test_overwrite_large_offset_appends();
  test_overwritechar_empty_buffer();
  test_overwritechar_inplace();
  test_overwritechar_large_offset_appends();
}


x86 assembly (clang, -O0):
<test_savebuffer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1090 <init_globals@plt>
mov    $0x0,%al
call   10e0 <test_init_destroy@plt>
mov    $0x0,%al
call   10b0 <test_grow_zero@plt>
mov    $0x0,%al
call   1030 <test_grow_bufsiz@plt>
mov    $0x0,%al
call   1130 <test_grow_one@plt>
mov    $0x0,%al
call   1100 <test_grow_one_grow_one_noop@plt>
mov    $0x0,%al
call   1040 <test_grow_one_grow_bufsiz_noop@plt>
mov    $0x0,%al
call   10c0 <test_grow_one_grow_bufsiz_one@plt>
mov    $0x0,%al
call   10d0 <test_write_empty@plt>
mov    $0x0,%al
call   1050 <test_write@plt>
mov    $0x0,%al
call   1070 <test_write_embedded_zero@plt>
mov    $0x0,%al
call   1140 <test_write_write_smallsiz@plt>
mov    $0x0,%al
call   1170 <test_writechar@plt>
mov    $0x0,%al
call   10f0 <test_writechar_zero@plt>
mov    $0x0,%al
call   1080 <test_write_writechar_smallsiz@plt>
mov    $0x0,%al
call   1120 <test_overwrite_empty@plt>
mov    $0x0,%al
call   1060 <test_overwrite_inplace@plt>
mov    $0x0,%al
call   1190 <test_overwrite_overflow@plt>
mov    $0x0,%al
call   10a0 <test_overwrite_overflow_grows@plt>
mov    $0x0,%al
call   1160 <test_overwrite_large_offset_appends@plt>
mov    $0x0,%al
call   1110 <test_overwritechar_empty_buffer@plt>
mov    $0x0,%al
call   1180 <test_overwritechar_inplace@plt>
mov    $0x0,%al
call   1150 <test_overwritechar_large_offset_appends@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_savebuffer>:
push   %rax
xor    %eax,%eax
call   1090 <init_globals@plt>
xor    %eax,%eax
call   10e0 <test_init_destroy@plt>
xor    %eax,%eax
call   10b0 <test_grow_zero@plt>
xor    %eax,%eax
call   1030 <test_grow_bufsiz@plt>
xor    %eax,%eax
call   1130 <test_grow_one@plt>
xor    %eax,%eax
call   1100 <test_grow_one_grow_one_noop@plt>
xor    %eax,%eax
call   1040 <test_grow_one_grow_bufsiz_noop@plt>
xor    %eax,%eax
call   10c0 <test_grow_one_grow_bufsiz_one@plt>
xor    %eax,%eax
call   10d0 <test_write_empty@plt>
xor    %eax,%eax
call   1050 <test_write@plt>
xor    %eax,%eax
call   1070 <test_write_embedded_zero@plt>
xor    %eax,%eax
call   1140 <test_write_write_smallsiz@plt>
xor    %eax,%eax
call   1170 <test_writechar@plt>
xor    %eax,%eax
call   10f0 <test_writechar_zero@plt>
xor    %eax,%eax
call   1080 <test_write_writechar_smallsiz@plt>
xor    %eax,%eax
call   1120 <test_overwrite_empty@plt>
xor    %eax,%eax
call   1060 <test_overwrite_inplace@plt>
xor    %eax,%eax
call   1190 <test_overwrite_overflow@plt>
xor    %eax,%eax
call   10a0 <test_overwrite_overflow_grows@plt>
xor    %eax,%eax
call   1160 <test_overwrite_large_offset_appends@plt>
xor    %eax,%eax
call   1110 <test_overwritechar_empty_buffer@plt>
xor    %eax,%eax
call   1180 <test_overwritechar_inplace@plt>
xor    %eax,%eax
pop    %rcx
jmp    1150 <test_overwritechar_large_offset_appends@plt>

LLVM IR (-O0):
define void @test_savebuffer() {
%1 = call i32 (...) @init_globals()
%2 = call i32 (...) @test_init_destroy()
%3 = call i32 (...) @test_grow_zero()
%4 = call i32 (...) @test_grow_bufsiz()
%5 = call i32 (...) @test_grow_one()
%6 = call i32 (...) @test_grow_one_grow_one_noop()
%7 = call i32 (...) @test_grow_one_grow_bufsiz_noop()
%8 = call i32 (...) @test_grow_one_grow_bufsiz_one()
%9 = call i32 (...) @test_write_empty()
%10 = call i32 (...) @test_write()
%11 = call i32 (...) @test_write_embedded_zero()
%12 = call i32 (...) @test_write_write_smallsiz()
%13 = call i32 (...) @test_writechar()
%14 = call i32 (...) @test_writechar_zero()
%15 = call i32 (...) @test_write_writechar_smallsiz()
%16 = call i32 (...) @test_overwrite_empty()
%17 = call i32 (...) @test_overwrite_inplace()
%18 = call i32 (...) @test_overwrite_overflow()
%19 = call i32 (...) @test_overwrite_overflow_grows()
%20 = call i32 (...) @test_overwrite_large_offset_appends()
%21 = call i32 (...) @test_overwritechar_empty_buffer()
%22 = call i32 (...) @test_overwritechar_inplace()
%23 = call i32 (...) @test_overwritechar_large_offset_appends()
ret void
}

LLVM IR (-O2):
define void @test_savebuffer() {
%1 = tail call i32 (...) @init_globals()
%2 = tail call i32 (...) @test_init_destroy()
%3 = tail call i32 (...) @test_grow_zero()
%4 = tail call i32 (...) @test_grow_bufsiz()
%5 = tail call i32 (...) @test_grow_one()
%6 = tail call i32 (...) @test_grow_one_grow_one_noop()
%7 = tail call i32 (...) @test_grow_one_grow_bufsiz_noop()
%8 = tail call i32 (...) @test_grow_one_grow_bufsiz_one()
%9 = tail call i32 (...) @test_write_empty()
%10 = tail call i32 (...) @test_write()
%11 = tail call i32 (...) @test_write_embedded_zero()
%12 = tail call i32 (...) @test_write_write_smallsiz()
%13 = tail call i32 (...) @test_writechar()
%14 = tail call i32 (...) @test_writechar_zero()
%15 = tail call i32 (...) @test_write_writechar_smallsiz()
%16 = tail call i32 (...) @test_overwrite_empty()
%17 = tail call i32 (...) @test_overwrite_inplace()
%18 = tail call i32 (...) @test_overwrite_overflow()
%19 = tail call i32 (...) @test_overwrite_overflow_grows()
%20 = tail call i32 (...) @test_overwrite_large_offset_appends()
%21 = tail call i32 (...) @test_overwritechar_empty_buffer()
%22 = tail call i32 (...) @test_overwritechar_inplace()
%23 = tail call i32 (...) @test_overwritechar_large_offset_appends()
ret void
}