void test_no_init(void) {
  int i;
  char tmp[32] = "abcd";
  for (i = 0; i < 10; i++) {
    log_print(3, "tag",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/gozfree/liblog/refs/heads/master/"
              "test_liblog.c",
              19, __func__, "test rsyslog\n");
    ;
    log_print(4, "tag",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/gozfree/liblog/refs/heads/master/"
              "test_liblog.c",
              20, __func__, "debug msg %d, %s\n", i, tmp);
    ;
    log_print(7, "tag",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/gozfree/liblog/refs/heads/master/"
              "test_liblog.c",
              21, __func__, "debug msg %d, %s\n", i, tmp);
    ;
    log_print(6, "tag",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/gozfree/liblog/refs/heads/master/"
              "test_liblog.c",
              22, __func__, "debug msg %d, %s\n", i, tmp);
    ;
    log_print(8, "tag",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/gozfree/liblog/refs/heads/master/"
              "test_liblog.c",
              23, __func__, "debug msg %d, %s\n", i, tmp);
    ;
  }
  log_deinit();
}


x86 assembly (clang, -O0):
<test_no_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1298 <test_no_init+0x178>
mov    $0x3,%edi
lea    0xeaf(%rip),%rsi
lea    0xeac(%rip),%rdx
mov    $0x13,%ecx
lea    0xf29(%rip),%r8
lea    0xf2f(%rip),%r9
mov    $0x0,%al
call   1030 <log_print@plt>
mov    -0x4(%rbp),%r10d
lea    -0x30(%rbp),%rax
mov    $0x4,%edi
lea    0xe7a(%rip),%rsi
lea    0xe77(%rip),%rdx
mov    $0x14,%ecx
lea    0xef4(%rip),%r8
lea    0xf08(%rip),%r9
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1030 <log_print@plt>
mov    -0x4(%rbp),%r10d
lea    -0x30(%rbp),%rax
mov    $0x7,%edi
lea    0xe3c(%rip),%rsi
lea    0xe39(%rip),%rdx
mov    $0x15,%ecx
lea    0xeb6(%rip),%r8
lea    0xeca(%rip),%r9
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1030 <log_print@plt>
mov    -0x4(%rbp),%r10d
lea    -0x30(%rbp),%rax
mov    $0x6,%edi
lea    0xdfe(%rip),%rsi
lea    0xdfb(%rip),%rdx
mov    $0x16,%ecx
lea    0xe78(%rip),%r8
lea    0xe8c(%rip),%r9
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1030 <log_print@plt>
mov    -0x4(%rbp),%r10d
lea    -0x30(%rbp),%rax
mov    $0x8,%edi
lea    0xdc0(%rip),%rsi
lea    0xdbd(%rip),%rdx
mov    $0x17,%ecx
lea    0xe3a(%rip),%r8
lea    0xe4e(%rip),%r9
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1030 <log_print@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115b <test_no_init+0x3b>
mov    $0x0,%al
call   1040 <log_deinit@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_no_init>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xed4(%rip),%r14
lea    0xed1(%rip),%r15
lea    0xf53(%rip),%rbx
mov    %rsp,%rbp
lea    0xf64(%rip),%r13
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
mov    $0x3,%edi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x13,%ecx
mov    %rbx,%r8
lea    0xf30(%rip),%r9
xor    %eax,%eax
call   1030 <log_print@plt>
mov    $0x4,%edi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x14,%ecx
mov    %rbx,%r8
mov    %r13,%r9
xor    %eax,%eax
push   %rbp
push   %r12
call   1030 <log_print@plt>
add    $0x10,%rsp
mov    $0x7,%edi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x15,%ecx
mov    %rbx,%r8
mov    %r13,%r9
xor    %eax,%eax
push   %rbp
push   %r12
call   1030 <log_print@plt>
add    $0x10,%rsp
mov    $0x6,%edi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x16,%ecx
mov    %rbx,%r8
mov    %r13,%r9
xor    %eax,%eax
push   %rbp
push   %r12
call   1030 <log_print@plt>
add    $0x10,%rsp
mov    $0x8,%edi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x17,%ecx
mov    %rbx,%r8
mov    %r13,%r9
xor    %eax,%eax
push   %rbp
push   %r12
call   1030 <log_print@plt>
add    $0x10,%rsp
add    $0x1,%r12d
cmp    $0xa,%r12d
jne    1170 <test_no_init+0x50>
xor    %eax,%eax
call   1040 <log_deinit@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.test_no_init.tmp = [32 x i8] c"abcd\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"tag\00"
@.str.1 = [137 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gozfree/liblog/refs/heads/master/test_liblog.c\00"
@__func__.test_no_init = [13 x i8] c"test_no_init\00"
@.str.2 = [14 x i8] c"test rsyslog\0A\00"
@.str.3 = [18 x i8] c"debug msg %d, %s\0A\00"
define void @test_no_init() {
%1 = alloca i32
%2 = alloca [32 x i8]
%3 = bitcast [32 x i8]* %2 to i8*
store i32 0, i32* %1
br label %4
4: ; preds = %21, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %24
7: ; preds = %4
%8 = call i32 (i32, i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @log_print to i32 (i32, i8*, i8*, i32, i8*, i8*, ...)*)(i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.1, i64 0, i64 0), i32 19, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.test_no_init, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32, i32* %1
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%11 = call i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @log_print to i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...)*)(i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.1, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.test_no_init, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %9, i8* %10)
%12 = load i32, i32* %1
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%14 = call i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @log_print to i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...)*)(i32 7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.1, i64 0, i64 0), i32 21, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.test_no_init, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %12, i8* %13)
%15 = load i32, i32* %1
%16 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%17 = call i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @log_print to i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.1, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.test_no_init, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %15, i8* %16)
%18 = load i32, i32* %1
%19 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%20 = call i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @log_print to i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...)*)(i32 8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.1, i64 0, i64 0), i32 23, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.test_no_init, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %18, i8* %19)
br label %21
21: ; preds = %7
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 1
store i32 %23, i32* %1
br label %4
24: ; preds = %4
%25 = call i32 (...) @log_deinit()
ret void
}

LLVM IR (-O2):
@__const.test_no_init.tmp = [32 x i8] c"abcd\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"tag\00"
@.str.1 = [137 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gozfree/liblog/refs/heads/master/test_liblog.c\00"
@__func__.test_no_init = [13 x i8] c"test_no_init\00"
@.str.2 = [14 x i8] c"test rsyslog\0A\00"
@.str.3 = [18 x i8] c"debug msg %d, %s\0A\00"
define void @test_no_init() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %10, %3 ]
%5 = call i32 (i32, i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @log_print to i32 (i32, i8*, i8*, i32, i8*, i8*, ...)*)(i32 3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.1, i64 0, i64 0), i32 19, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.test_no_init, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @log_print to i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...)*)(i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.1, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.test_no_init, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %4, i8* %2)
%7 = call i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @log_print to i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...)*)(i32 7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.1, i64 0, i64 0), i32 21, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.test_no_init, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %4, i8* %2)
%8 = call i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @log_print to i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.1, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.test_no_init, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %4, i8* %2)
%9 = call i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @log_print to i32 (i32, i8*, i8*, i32, i8*, i8*, i32, i8*, ...)*)(i32 8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str.1, i64 0, i64 0), i32 23, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.test_no_init, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %4, i8* %2)
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %3
12: ; preds = %3
%13 = call i32 (...) @log_deinit()
ret void
}