#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 *, char *);
int /*<<< orphan*/ test_alloc_2_str_overwrite_first_one_gc();
int /*<<< orphan*/ test_alloc_obj_kill_mgr_ptr();
int /*<<< orphan*/ test_alloc_obj_with_two_ptr_fields();
int /*<<< orphan*/ test_alloc_str_gc_compact_does_nothing();
int /*<<< orphan*/ test_alloc_str_set_null_gc();
int /*<<< orphan*/ test_alloc_user();
int /*<<< orphan*/ test_alloc_user_after_string();
int /*<<< orphan*/ test_big_loop_doesnt_run_out_of_memory();
int /*<<< orphan*/ test_empty();
int /*<<< orphan*/ test_global();
int /*<<< orphan*/ test_local_roots_in_called_func();
int /*<<< orphan*/ test_mgr_cycle();
int /*<<< orphan*/ test_mgr_cycle_kill_one_link();
int main(int argc, char *argv[]) {
  printf("TESTING %s\n", "test_empty");
  test_empty();
  ;
  printf("TESTING %s\n", "test_alloc_str_gc_compact_does_nothing");
  test_alloc_str_gc_compact_does_nothing();
  ;
  printf("TESTING %s\n", "test_alloc_str_set_null_gc");
  test_alloc_str_set_null_gc();
  ;
  printf("TESTING %s\n", "test_alloc_2_str_overwrite_first_one_gc");
  test_alloc_2_str_overwrite_first_one_gc();
  ;
  printf("TESTING %s\n", "test_alloc_user");
  test_alloc_user();
  ;
  printf("TESTING %s\n", "test_alloc_user_after_string");
  test_alloc_user_after_string();
  ;
  printf("TESTING %s\n", "test_alloc_obj_with_two_ptr_fields");
  test_alloc_obj_with_two_ptr_fields();
  ;
  printf("TESTING %s\n", "test_alloc_obj_kill_mgr_ptr");
  test_alloc_obj_kill_mgr_ptr();
  ;
  printf("TESTING %s\n", "test_mgr_cycle");
  test_mgr_cycle();
  ;
  printf("TESTING %s\n", "test_mgr_cycle_kill_one_link");
  test_mgr_cycle_kill_one_link();
  ;
  printf("TESTING %s\n", "test_global");
  test_global();
  ;
  printf("TESTING %s\n", "test_local_roots_in_called_func");
  test_local_roots_in_called_func();
  ;
  printf("TESTING %s\n", "test_big_loop_doesnt_run_out_of_memory");
  test_big_loop_doesnt_run_out_of_memory();
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe03(%rip),%rdi
lea    0xe08(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <test_empty@plt>
lea    0xde9(%rip),%rdi
lea    0xdf9(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   1100 <test_alloc_str_gc_compact_does_nothing@plt>
lea    0xdcf(%rip),%rdi
lea    0xe06(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <test_alloc_str_set_null_gc@plt>
lea    0xdb5(%rip),%rdi
lea    0xe07(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   10c0 <test_alloc_2_str_overwrite_first_one_gc@plt>
lea    0xd9b(%rip),%rdi
lea    0xe15(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   1080 <test_alloc_user@plt>
lea    0xd81(%rip),%rdi
lea    0xe0b(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   1090 <test_alloc_user_after_string@plt>
lea    0xd67(%rip),%rdi
lea    0xe0e(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   10f0 <test_alloc_obj_with_two_ptr_fields@plt>
lea    0xd4d(%rip),%rdi
lea    0xe17(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <test_alloc_obj_kill_mgr_ptr@plt>
lea    0xd33(%rip),%rdi
lea    0xe19(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   10a0 <test_mgr_cycle@plt>
lea    0xd19(%rip),%rdi
lea    0xe0e(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   10b0 <test_mgr_cycle_kill_one_link@plt>
lea    0xcff(%rip),%rdi
lea    0xe11(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <test_global@plt>
lea    0xce5(%rip),%rdi
lea    0xe03(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   10d0 <test_local_roots_in_called_func@plt>
lea    0xccb(%rip),%rdi
lea    0xe09(%rip),%rsi
call   1050 <printf@plt>
mov    $0x0,%al
call   10e0 <test_big_loop_doesnt_run_out_of_memory@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xe18(%rip),%rbx
lea    0xe1d(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <test_empty@plt>
lea    0xe12(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1100 <test_alloc_str_gc_compact_does_nothing@plt>
lea    0xe23(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <test_alloc_str_set_null_gc@plt>
lea    0xe28(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   10c0 <test_alloc_2_str_overwrite_first_one_gc@plt>
lea    0xe3a(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1080 <test_alloc_user@plt>
lea    0xe34(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1090 <test_alloc_user_after_string@plt>
lea    0xe3b(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   10f0 <test_alloc_obj_with_two_ptr_fields@plt>
lea    0xe48(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <test_alloc_obj_kill_mgr_ptr@plt>
lea    0xe4e(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   10a0 <test_mgr_cycle@plt>
lea    0xe47(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   10b0 <test_mgr_cycle_kill_one_link@plt>
lea    0xe4e(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <test_global@plt>
lea    0xe44(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   10d0 <test_local_roots_in_called_func@plt>
lea    0xe4e(%rip),%rsi
mov    %rbx,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   10e0 <test_big_loop_doesnt_run_out_of_memory@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"TESTING %s\0A\00"
@.str.1 = [11 x i8] c"test_empty\00"
@.str.2 = [39 x i8] c"test_alloc_str_gc_compact_does_nothing\00"
@.str.3 = [27 x i8] c"test_alloc_str_set_null_gc\00"
@.str.4 = [40 x i8] c"test_alloc_2_str_overwrite_first_one_gc\00"
@.str.5 = [16 x i8] c"test_alloc_user\00"
@.str.6 = [29 x i8] c"test_alloc_user_after_string\00"
@.str.7 = [35 x i8] c"test_alloc_obj_with_two_ptr_fields\00"
@.str.8 = [28 x i8] c"test_alloc_obj_kill_mgr_ptr\00"
@.str.9 = [15 x i8] c"test_mgr_cycle\00"
@.str.10 = [29 x i8] c"test_mgr_cycle_kill_one_link\00"
@.str.11 = [12 x i8] c"test_global\00"
@.str.12 = [32 x i8] c"test_local_roots_in_called_func\00"
@.str.13 = [39 x i8] c"test_big_loop_doesnt_run_out_of_memory\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @test_empty()
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (...) @test_alloc_str_gc_compact_does_nothing()
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (...) @test_alloc_str_set_null_gc()
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 (...) @test_alloc_2_str_overwrite_first_one_gc()
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 (...) @test_alloc_user()
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
%17 = call i32 (...) @test_alloc_user_after_string()
%18 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0))
%19 = call i32 (...) @test_alloc_obj_with_two_ptr_fields()
%20 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0))
%21 = call i32 (...) @test_alloc_obj_kill_mgr_ptr()
%22 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0))
%23 = call i32 (...) @test_mgr_cycle()
%24 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
%25 = call i32 (...) @test_mgr_cycle_kill_one_link()
%26 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
%27 = call i32 (...) @test_global()
%28 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0))
%29 = call i32 (...) @test_local_roots_in_called_func()
%30 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0))
%31 = call i32 (...) @test_big_loop_doesnt_run_out_of_memory()
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"TESTING %s\0A\00"
@.str.1 = [11 x i8] c"test_empty\00"
@.str.2 = [39 x i8] c"test_alloc_str_gc_compact_does_nothing\00"
@.str.3 = [27 x i8] c"test_alloc_str_set_null_gc\00"
@.str.4 = [40 x i8] c"test_alloc_2_str_overwrite_first_one_gc\00"
@.str.5 = [16 x i8] c"test_alloc_user\00"
@.str.6 = [29 x i8] c"test_alloc_user_after_string\00"
@.str.7 = [35 x i8] c"test_alloc_obj_with_two_ptr_fields\00"
@.str.8 = [28 x i8] c"test_alloc_obj_kill_mgr_ptr\00"
@.str.9 = [15 x i8] c"test_mgr_cycle\00"
@.str.10 = [29 x i8] c"test_mgr_cycle_kill_one_link\00"
@.str.11 = [12 x i8] c"test_global\00"
@.str.12 = [32 x i8] c"test_local_roots_in_called_func\00"
@.str.13 = [39 x i8] c"test_big_loop_doesnt_run_out_of_memory\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @test_empty()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (...) @test_alloc_str_gc_compact_does_nothing()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 (...) @test_alloc_str_set_null_gc()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 (...) @test_alloc_2_str_overwrite_first_one_gc()
%11 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%12 = tail call i32 (...) @test_alloc_user()
%13 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
%14 = tail call i32 (...) @test_alloc_user_after_string()
%15 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0))
%16 = tail call i32 (...) @test_alloc_obj_with_two_ptr_fields()
%17 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0))
%18 = tail call i32 (...) @test_alloc_obj_kill_mgr_ptr()
%19 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0))
%20 = tail call i32 (...) @test_mgr_cycle()
%21 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
%22 = tail call i32 (...) @test_mgr_cycle_kill_one_link()
%23 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0))
%24 = tail call i32 (...) @test_global()
%25 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0))
%26 = tail call i32 (...) @test_local_roots_in_called_func()
%27 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0))
%28 = tail call i32 (...) @test_big_loop_doesnt_run_out_of_memory()
ret i32 0
}