void log_welcome(int loglevel) {
  do {
    dss_log_set_params(
        2,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/ratschlab/dss/refs/heads/master/daemon.c",
        109, __func__);
    dss_log("***** welcome to dss ******\n");
  } while (0);
  do {
    dss_log_set_params(
        1,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/ratschlab/dss/refs/heads/master/daemon.c",
        110, __func__);
    dss_log("using loglevel %d\n", loglevel);
  } while (0);
}


x86 assembly (clang, -O0):
<log_welcome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
lea    0xec9(%rip),%rsi
mov    $0x6d,%edx
lea    0xf40(%rip),%rcx
mov    $0x0,%al
call   1040 <dss_log_set_params@plt>
lea    0xf3e(%rip),%rdi
mov    $0x0,%al
call   1030 <dss_log@plt>
jmp    115d <log_welcome+0x3d>
mov    $0x1,%edi
lea    0xe97(%rip),%rsi
mov    $0x6e,%edx
lea    0xf0e(%rip),%rcx
mov    $0x0,%al
call   1040 <dss_log_set_params@plt>
mov    -0x4(%rbp),%esi
lea    0xf26(%rip),%rdi
mov    $0x0,%al
call   1030 <dss_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_welcome>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
lea    0xed2(%rip),%r14
lea    0xf4e(%rip),%r15
mov    $0x2,%edi
mov    %r14,%rsi
mov    $0x6d,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   1040 <dss_log_set_params@plt>
lea    0xf3c(%rip),%rdi
xor    %eax,%eax
call   1030 <dss_log@plt>
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0x6e,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   1040 <dss_log_set_params@plt>
lea    0xf34(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <dss_log@plt>

LLVM IR (-O0):
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ratschlab/dss/refs/heads/master/daemon.c\00"
@__func__.log_welcome = [12 x i8] c"log_welcome\00"
@.str.1 = [29 x i8] c"***** welcome to dss ******\0A\00"
@.str.2 = [19 x i8] c"using loglevel %d\0A\00"
define void @log_welcome(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
%4 = call i32 (i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @dss_log_set_params to i32 (i32, i8*, i32, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 109, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.log_welcome, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @dss_log to i32 (i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = call i32 (i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @dss_log_set_params to i32 (i32, i8*, i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.log_welcome, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dss_log to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ratschlab/dss/refs/heads/master/daemon.c\00"
@__func__.log_welcome = [12 x i8] c"log_welcome\00"
@.str.1 = [29 x i8] c"***** welcome to dss ******\0A\00"
@.str.2 = [19 x i8] c"using loglevel %d\0A\00"
define void @log_welcome(i32 %0) {
%2 = tail call i32 (i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @dss_log_set_params to i32 (i32, i8*, i32, i8*, ...)*)(i32 2, i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 109, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.log_welcome, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @dss_log to i32 (i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @dss_log_set_params to i32 (i32, i8*, i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.log_welcome, i64 0, i64 0))
%5 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @dss_log to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %0)
ret void
}