#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*/ log_print_error(char *, int, char *, float, float);
int /*<<< orphan*/ log_print_info(char *, ...);
int /*<<< orphan*/ log_print_warning(char *, int, char *, float, float);
int main(void) {
  int x = 10, y = 20;
  float a = 1.5f, b = -2.01f;
  log_print_info("Testing logger\n\n");
  log_print_info("Output separate strings: %s %s\n", "pass", "[PASS]");
  log_print_info("Output two integers: x = %d y = %d\n", x, y);
  log_print_warning("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/EliasVansteenkiste/"
                    "ConnectionRouter/refs/heads/master/liblog/src/main.c",
                    13, "Test warning on floating point arguments %g %g\n", a,
                    b);
  log_print_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/EliasVansteenkiste/"
                  "ConnectionRouter/refs/heads/master/liblog/src/main.c",
                  14, "Test error on two variables %g %g \n\n", a - x, b + y);
  log_print_info("Test complete\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movss  0xeaf(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe9e(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1050 <log_print_info@plt>
lea    0xe9d(%rip),%rdi
lea    0xeb6(%rip),%rsi
lea    0xeb4(%rip),%rdx
mov    $0x0,%al
call   1050 <log_print_info@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1050 <log_print_info@plt>
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
lea    0xeb3(%rip),%rdi
mov    $0xd,%esi
lea    0xf49(%rip),%rdx
call   1040 <log_print_warning@plt>
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm2
addss  %xmm2,%xmm1
lea    0xe7f(%rip),%rdi
mov    $0xe,%esi
lea    0xf45(%rip),%rdx
call   1030 <log_print_error@plt>
lea    0xf5e(%rip),%rdi
mov    $0x0,%al
call   1050 <log_print_info@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1050 <log_print_info@plt>
lea    0xedb(%rip),%rdi
lea    0xef4(%rip),%rsi
lea    0xef2(%rip),%rdx
xor    %eax,%eax
call   1050 <log_print_info@plt>
lea    0xeeb(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
xor    %eax,%eax
call   1050 <log_print_info@plt>
lea    0xef7(%rip),%rbx
lea    0xf92(%rip),%rdx
movss  0xe77(%rip),%xmm0
movss  0xe73(%rip),%xmm1
mov    %rbx,%rdi
mov    $0xd,%esi
call   1040 <log_print_warning@plt>
lea    0xf9e(%rip),%rdx
movss  0xe5b(%rip),%xmm0
movss  0xe57(%rip),%xmm1
mov    %rbx,%rdi
mov    $0xe,%esi
call   1030 <log_print_error@plt>
lea    0xf9f(%rip),%rdi
xor    %eax,%eax
call   1050 <log_print_info@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Testing logger\0A\0A\00"
@.str.1 = [32 x i8] c"Output separate strings: %s %s\0A\00"
@.str.2 = [5 x i8] c"pass\00"
@.str.3 = [7 x i8] c"[PASS]\00"
@.str.4 = [36 x i8] c"Output two integers: x = %d y = %d\0A\00"
@.str.5 = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/EliasVansteenkiste/ConnectionRouter/refs/heads/master/liblog/src/main.c\00"
@.str.6 = [48 x i8] c"Test warning on floating point arguments %g %g\0A\00"
@.str.7 = [37 x i8] c"Test error on two variables %g %g \0A\0A\00"
@.str.8 = [15 x i8] c"Test complete\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
store float 1.500000e+00, float* %4
store float 0xC000147AE0000000, float* %5
%6 = call i32 (i8*, ...) @log_print_info(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @log_print_info(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @log_print_info(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %8, i32 %9)
%11 = load float, float* %4
%12 = load float, float* %5
%13 = call i32 @log_print_warning(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.5, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0), float %11, float %12)
%14 = load float, float* %4
%15 = load i32, i32* %2
%16 = sitofp i32 %15 to float
%17 = fsub float %14, %16
%18 = load float, float* %5
%19 = load i32, i32* %3
%20 = sitofp i32 %19 to float
%21 = fadd float %18, %20
%22 = call i32 @log_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.5, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), float %17, float %21)
%23 = call i32 (i8*, ...) @log_print_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Testing logger\0A\0A\00"
@.str.1 = [32 x i8] c"Output separate strings: %s %s\0A\00"
@.str.2 = [5 x i8] c"pass\00"
@.str.3 = [7 x i8] c"[PASS]\00"
@.str.4 = [36 x i8] c"Output two integers: x = %d y = %d\0A\00"
@.str.5 = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/EliasVansteenkiste/ConnectionRouter/refs/heads/master/liblog/src/main.c\00"
@.str.6 = [48 x i8] c"Test warning on floating point arguments %g %g\0A\00"
@.str.7 = [37 x i8] c"Test error on two variables %g %g \0A\0A\00"
@.str.8 = [15 x i8] c"Test complete\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @log_print_info(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @log_print_info(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @log_print_info(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 10, i32 20)
%4 = tail call i32 @log_print_warning(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.5, i64 0, i64 0), i32 13, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0), float 1.500000e+00, float 0xC000147AE0000000)
%5 = tail call i32 @log_print_error(i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str.5, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), float -8.500000e+00, float 0x4031FD70A0000000)
%6 = tail call i32 (i8*, ...) @log_print_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}