#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_close_file();
int /*<<< orphan*/ log_print(int, char *, int, char *);
int /*<<< orphan*/ log_set_file(char *);
int /*<<< orphan*/ log_set_level(int);
int main() {
  log_set_file("/tmp/a.log");
  log_print(0,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            7, "line1\n");
  log_print(1,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            8, "line2\n");
  log_print(2,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            9, "line3\n");
  log_print(3,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            10, "line4\n");
  log_print(4,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            11, "line5\n");
  log_print(0,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            14, "line1\n");
  log_print(1,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            15, "line2\n");
  log_print(2,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            16, "line3\n");
  log_print(3,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            17, "line4\n");
  log_print(4,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            18, "line5\n");
  log_set_level(2);
  log_print(0,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            22, "line1\n");
  log_print(1,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            23, "line2\n");
  log_print(2,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            24, "line3\n");
  log_print(3,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            25, "line4\n");
  log_print(4,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c",
            26, "line5\n");
  log_close_file();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <log_set_file@plt>
xor    %edi,%edi
lea    0xea7(%rip),%rsi
mov    $0x7,%edx
lea    0xf19(%rip),%rcx
call   1040 <log_print@plt>
mov    $0x1,%edi
lea    0xe8a(%rip),%rsi
mov    $0x8,%edx
lea    0xf03(%rip),%rcx
call   1040 <log_print@plt>
mov    $0x2,%edi
lea    0xe6d(%rip),%rsi
mov    $0x9,%edx
lea    0xeed(%rip),%rcx
call   1040 <log_print@plt>
mov    $0x3,%edi
lea    0xe50(%rip),%rsi
mov    $0xa,%edx
lea    0xed7(%rip),%rcx
call   1040 <log_print@plt>
mov    $0x4,%edi
lea    0xe33(%rip),%rsi
mov    $0xb,%edx
lea    0xec1(%rip),%rcx
call   1040 <log_print@plt>
xor    %edi,%edi
lea    0xe19(%rip),%rsi
mov    $0xe,%edx
lea    0xe8b(%rip),%rcx
call   1040 <log_print@plt>
mov    $0x1,%edi
lea    0xdfc(%rip),%rsi
mov    $0xf,%edx
lea    0xe75(%rip),%rcx
call   1040 <log_print@plt>
mov    $0x2,%edi
lea    0xddf(%rip),%rsi
mov    $0x10,%edx
lea    0xe5f(%rip),%rcx
call   1040 <log_print@plt>
mov    $0x3,%edi
lea    0xdc2(%rip),%rsi
mov    $0x11,%edx
lea    0xe49(%rip),%rcx
call   1040 <log_print@plt>
mov    $0x4,%edi
lea    0xda5(%rip),%rsi
mov    $0x12,%edx
lea    0xe33(%rip),%rcx
call   1040 <log_print@plt>
mov    $0x2,%edi
call   1030 <log_set_level@plt>
xor    %edi,%edi
lea    0xd81(%rip),%rsi
mov    $0x16,%edx
lea    0xdf3(%rip),%rcx
call   1040 <log_print@plt>
mov    $0x1,%edi
lea    0xd64(%rip),%rsi
mov    $0x17,%edx
lea    0xddd(%rip),%rcx
call   1040 <log_print@plt>
mov    $0x2,%edi
lea    0xd47(%rip),%rsi
mov    $0x18,%edx
lea    0xdc7(%rip),%rcx
call   1040 <log_print@plt>
mov    $0x3,%edi
lea    0xd2a(%rip),%rsi
mov    $0x19,%edx
lea    0xdb1(%rip),%rcx
call   1040 <log_print@plt>
mov    $0x4,%edi
lea    0xd0d(%rip),%rsi
mov    $0x1a,%edx
lea    0xd9b(%rip),%rcx
call   1040 <log_print@plt>
mov    $0x0,%al
call   1060 <log_close_file@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeae(%rip),%rdi
call   1050 <log_set_file@plt>
lea    0xead(%rip),%rbx
lea    0xf24(%rip),%r14
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x7,%edx
mov    %r14,%rcx
call   1040 <log_print@plt>
lea    0xf12(%rip),%r15
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x8,%edx
mov    %r15,%rcx
call   1040 <log_print@plt>
lea    0xefd(%rip),%r12
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x9,%edx
mov    %r12,%rcx
call   1040 <log_print@plt>
lea    0xee8(%rip),%r13
mov    $0x3,%edi
mov    %rbx,%rsi
mov    $0xa,%edx
mov    %r13,%rcx
call   1040 <log_print@plt>
lea    0xed3(%rip),%rbp
mov    $0x4,%edi
mov    %rbx,%rsi
mov    $0xb,%edx
mov    %rbp,%rcx
call   1040 <log_print@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0xe,%edx
mov    %r14,%rcx
call   1040 <log_print@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0xf,%edx
mov    %r15,%rcx
call   1040 <log_print@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x10,%edx
mov    %r12,%rcx
call   1040 <log_print@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
mov    $0x11,%edx
mov    %r13,%rcx
call   1040 <log_print@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
mov    $0x12,%edx
mov    %rbp,%rcx
call   1040 <log_print@plt>
mov    $0x2,%edi
call   1030 <log_set_level@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x16,%edx
mov    %r14,%rcx
call   1040 <log_print@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x17,%edx
mov    %r15,%rcx
call   1040 <log_print@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    $0x18,%edx
mov    %r12,%rcx
call   1040 <log_print@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
mov    $0x19,%edx
mov    %r13,%rcx
call   1040 <log_print@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
mov    $0x1a,%edx
mov    %rbp,%rcx
call   1040 <log_print@plt>
xor    %eax,%eax
call   1060 <log_close_file@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/tmp/a.log\00"
@.str.1 = [126 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c\00"
@.str.2 = [7 x i8] c"line1\0A\00"
@.str.3 = [7 x i8] c"line2\0A\00"
@.str.4 = [7 x i8] c"line3\0A\00"
@.str.5 = [7 x i8] c"line4\0A\00"
@.str.6 = [7 x i8] c"line5\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @log_set_file(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @log_print(i32 0, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @log_print(i32 1, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @log_print(i32 2, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @log_print(i32 3, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @log_print(i32 4, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @log_print(i32 0, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @log_print(i32 1, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @log_print(i32 2, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @log_print(i32 3, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 @log_print(i32 4, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 @log_set_level(i32 2)
%14 = call i32 @log_print(i32 0, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @log_print(i32 1, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 23, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @log_print(i32 2, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 24, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @log_print(i32 3, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 @log_print(i32 4, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%19 = call i32 (...) @log_close_file()
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"/tmp/a.log\00"
@.str.1 = [126 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kaija/clog/refs/heads/master/test.c\00"
@.str.2 = [7 x i8] c"line1\0A\00"
@.str.3 = [7 x i8] c"line2\0A\00"
@.str.4 = [7 x i8] c"line3\0A\00"
@.str.5 = [7 x i8] c"line4\0A\00"
@.str.6 = [7 x i8] c"line5\0A\00"
define i32 @main() {
%1 = tail call i32 @log_set_file(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @log_print(i32 0, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @log_print(i32 1, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @log_print(i32 2, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%5 = tail call i32 @log_print(i32 3, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%6 = tail call i32 @log_print(i32 4, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%7 = tail call i32 @log_print(i32 0, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @log_print(i32 1, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 @log_print(i32 2, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @log_print(i32 3, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 @log_print(i32 4, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%12 = tail call i32 @log_set_level(i32 2)
%13 = tail call i32 @log_print(i32 0, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%14 = tail call i32 @log_print(i32 1, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 23, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%15 = tail call i32 @log_print(i32 2, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 24, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%16 = tail call i32 @log_print(i32 3, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%17 = tail call i32 @log_print(i32 4, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.1, i64 0, i64 0), i32 26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%18 = tail call i32 (...) @log_close_file()
ret i32 0
}