int try_create_trash_dir(const char trash_dir[]) {
  {
    log_prefix("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/cosminadrianpopescu/vifm/"
               "refs/heads/master/src/trash.c",
               __FUNCTION__, 200);
    log_msg("Entered into this function");
  };
  if (is_dir_writable(trash_dir)) {
    return 0;
  }
  return make_path(trash_dir, 0777);
}


x86 assembly (clang, -O0):
<try_create_trash_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xead(%rip),%rdi
lea    0xf37(%rip),%rsi
mov    $0xc8,%edx
mov    $0x0,%al
call   1030 <log_prefix@plt>
lea    0xf39(%rip),%rdi
mov    $0x0,%al
call   1040 <log_msg@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1060 <is_dir_writable@plt>
cmp    $0x0,%eax
je     1194 <try_create_trash_dir+0x54>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <try_create_trash_dir+0x67>
mov    -0x10(%rbp),%rdi
mov    $0x1ff,%esi
mov    $0x0,%al
call   1050 <make_path@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_create_trash_dir>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
lea    0xf3f(%rip),%rsi
mov    $0xc8,%edx
xor    %eax,%eax
call   1030 <log_prefix@plt>
lea    0xf41(%rip),%rdi
xor    %eax,%eax
call   1040 <log_msg@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <is_dir_writable@plt>
test   %eax,%eax
je     117e <try_create_trash_dir+0x3e>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x1ff,%esi
xor    %eax,%eax
pop    %rbx
jmp    1050 <make_path@plt>

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cosminadrianpopescu/vifm/refs/heads/master/src/trash.c\00"
@__FUNCTION__.try_create_trash_dir = [21 x i8] c"try_create_trash_dir\00"
@.str.1 = [27 x i8] c"Entered into this function\00"
define i32 @try_create_trash_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @log_prefix to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.try_create_trash_dir, i64 0, i64 0), i32 200)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @log_msg to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @is_dir_writable to i32 (i8*, ...)*)(i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @make_path to i32 (i8*, i32, ...)*)(i8* %11, i32 511)
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cosminadrianpopescu/vifm/refs/heads/master/src/trash.c\00"
@__FUNCTION__.try_create_trash_dir = [21 x i8] c"try_create_trash_dir\00"
@.str.1 = [27 x i8] c"Entered into this function\00"
define i32 @try_create_trash_dir(i8* %0) {
%2 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @log_prefix to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__FUNCTION__.try_create_trash_dir, i64 0, i64 0), i32 200)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @log_msg to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @is_dir_writable to i32 (i8*, ...)*)(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @make_path to i32 (i8*, i32, ...)*)(i8* %0, i32 511)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %7, %6 ], [ 0, %1 ]
ret i32 %9
}