#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_str_still_alive_after_sweep();
int /*<<< orphan*/ test_alloc_strs_set_null_gc();
int /*<<< orphan*/ test_alloc_vector_gc_twice();
int /*<<< orphan*/ test_alloc_vector_sweep_nothing();
int /*<<< orphan*/ test_empty();
int /*<<< orphan*/ test_local_roots_in_called_func();
int main(int argc, char *argv[]) {
  printf("TESTING %s\n", "test_empty");
  test_empty();
  ;
  printf("TESTING %s\n", "test_alloc_str_still_alive_after_sweep");
  test_alloc_str_still_alive_after_sweep();
  ;
  printf("TESTING %s\n", "test_alloc_strs_set_null_gc");
  test_alloc_strs_set_null_gc();
  ;
  printf("TESTING %s\n", "test_alloc_vector_sweep_nothing");
  test_alloc_vector_sweep_nothing();
  ;
  printf("TESTING %s\n", "test_alloc_vector_gc_twice");
  test_alloc_vector_gc_twice();
  ;
  printf("TESTING %s\n", "test_local_roots_in_called_func");
  test_local_roots_in_called_func();
  ;
  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    0xe73(%rip),%rdi
lea    0xe78(%rip),%rsi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <test_empty@plt>
lea    0xe59(%rip),%rdi
lea    0xe69(%rip),%rsi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <test_alloc_str_still_alive_after_sweep@plt>
lea    0xe3f(%rip),%rdi
lea    0xe76(%rip),%rsi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <test_alloc_strs_set_null_gc@plt>
lea    0xe25(%rip),%rdi
lea    0xe78(%rip),%rsi
call   1040 <printf@plt>
mov    $0x0,%al
call   1090 <test_alloc_vector_sweep_nothing@plt>
lea    0xe0b(%rip),%rdi
lea    0xe7e(%rip),%rsi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test_alloc_vector_gc_twice@plt>
lea    0xdf1(%rip),%rdi
lea    0xe7f(%rip),%rsi
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <test_local_roots_in_called_func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xe88(%rip),%rbx
lea    0xe8d(%rip),%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <test_empty@plt>
lea    0xe82(%rip),%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <test_alloc_str_still_alive_after_sweep@plt>
lea    0xe93(%rip),%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <test_alloc_strs_set_null_gc@plt>
lea    0xe99(%rip),%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1090 <test_alloc_vector_sweep_nothing@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <test_alloc_vector_gc_twice@plt>
lea    0xea8(%rip),%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1080 <test_local_roots_in_called_func@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_still_alive_after_sweep\00"
@.str.3 = [28 x i8] c"test_alloc_strs_set_null_gc\00"
@.str.4 = [32 x i8] c"test_alloc_vector_sweep_nothing\00"
@.str.5 = [27 x i8] c"test_alloc_vector_gc_twice\00"
@.str.6 = [32 x i8] c"test_local_roots_in_called_func\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_still_alive_after_sweep()
%10 = 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.3, i64 0, i64 0))
%11 = call i32 (...) @test_alloc_strs_set_null_gc()
%12 = 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.4, i64 0, i64 0))
%13 = call i32 (...) @test_alloc_vector_sweep_nothing()
%14 = 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.5, i64 0, i64 0))
%15 = call i32 (...) @test_alloc_vector_gc_twice()
%16 = 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.6, i64 0, i64 0))
%17 = call i32 (...) @test_local_roots_in_called_func()
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_still_alive_after_sweep\00"
@.str.3 = [28 x i8] c"test_alloc_strs_set_null_gc\00"
@.str.4 = [32 x i8] c"test_alloc_vector_sweep_nothing\00"
@.str.5 = [27 x i8] c"test_alloc_vector_gc_twice\00"
@.str.6 = [32 x i8] c"test_local_roots_in_called_func\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_still_alive_after_sweep()
%7 = 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.3, i64 0, i64 0))
%8 = tail call i32 (...) @test_alloc_strs_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 ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 (...) @test_alloc_vector_sweep_nothing()
%11 = 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.5, i64 0, i64 0))
%12 = tail call i32 (...) @test_alloc_vector_gc_twice()
%13 = 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.6, i64 0, i64 0))
%14 = tail call i32 (...) @test_local_roots_in_called_func()
ret i32 0
}