void fs_logger_change_owner(void) {
  if (chown("/run/firejail/mnt/fslogger", 0, 0) == -1)
    do {
      char msgout[500];
      snprintf(msgout, 500, "Error %s: %s:%d %s", "chown",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/pmillerchip/firejail/refs/"
               "heads/master/src/firejail/fs_logger.c",
               117, __FUNCTION__);
      perror(msgout);
      exit(1);
    } while (0);
}


x86 assembly (clang, -O0):
<fs_logger_change_owner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
lea    0xeae(%rip),%rdi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1040 <chown@plt>
cmp    $0xffffffff,%eax
jne    11bc <fs_logger_change_owner+0x7c>
jmp    116b <fs_logger_change_owner+0x2b>
lea    -0x200(%rbp),%rdi
mov    $0x1f4,%esi
lea    0xe9d(%rip),%rdx
lea    0xea9(%rip),%rcx
lea    0xea8(%rip),%r8
mov    $0x75,%r9d
lea    0xf35(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <snprintf@plt>
lea    -0x200(%rbp),%rdi
mov    $0x0,%al
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_logger_change_owner>:
push   %rbx
sub    $0x210,%rsp
lea    0xeb1(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <chown@plt>
cmp    $0xffffffff,%eax
je     1168 <fs_logger_change_owner+0x28>
add    $0x210,%rsp
pop    %rbx
ret
lea    0xf5f(%rip),%rax
mov    %rax,(%rsp)
lea    0xea1(%rip),%rdx
lea    0xead(%rip),%rcx
lea    0xeac(%rip),%r8
lea    0x10(%rsp),%rbx
mov    $0x1f4,%esi
mov    %rbx,%rdi
mov    $0x75,%r9d
xor    %eax,%eax
call   1030 <snprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"/run/firejail/mnt/fslogger\00"
@.str.1 = [19 x i8] c"Error %s: %s:%d %s\00"
@.str.2 = [6 x i8] c"chown\00"
@.str.3 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/pmillerchip/firejail/refs/heads/master/src/firejail/fs_logger.c\00"
@__FUNCTION__.fs_logger_change_owner = [23 x i8] c"fs_logger_change_owner\00"
define void @fs_logger_change_owner() {
%1 = alloca [500 x i8]
%2 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @chown to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %11
4: ; preds = %0
br label %5
5: ; preds = %4
%6 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %6, i64 500, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.3, i64 0, i64 0), i32 117, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__FUNCTION__.fs_logger_change_owner, i64 0, i64 0))
%8 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %8)
unreachable
10: ; No predecessors!
br label %11
11: ; preds = %10, %0
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"/run/firejail/mnt/fslogger\00"
@.str.1 = [19 x i8] c"Error %s: %s:%d %s\00"
@.str.2 = [6 x i8] c"chown\00"
@.str.3 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/pmillerchip/firejail/refs/heads/master/src/firejail/fs_logger.c\00"
@__FUNCTION__.fs_logger_change_owner = [23 x i8] c"fs_logger_change_owner\00"
define void @fs_logger_change_owner() {
%1 = alloca [500 x i8]
%2 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @chown to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %5, i64 500, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.3, i64 0, i64 0), i32 117, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__FUNCTION__.fs_logger_change_owner, i64 0, i64 0))
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %5)
unreachable
8: ; preds = %0
ret void
}