char *mybasename(const char *in, const char *who) {
  char *tmp = dupstr_(
      (in), (who),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/goblinhack/fatdisk/refs/heads/master/file.c",
      __FUNCTION__, 607);
  char *tmp2 = dupstr_(
      (basename(tmp)), (who),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/goblinhack/fatdisk/refs/heads/master/file.c",
      __FUNCTION__, 608);
  myfree_(
      (tmp),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/goblinhack/fatdisk/refs/heads/master/file.c",
      __FUNCTION__, 609);
  return (tmp2);
}


x86 assembly (clang, -O0):
<mybasename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdx
lea    0xf30(%rip),%rcx
mov    $0x25f,%r8d
mov    $0x0,%al
call   1050 <dupstr_@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <basename@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
lea    0xe7f(%rip),%rdx
lea    0xefe(%rip),%rcx
mov    $0x260,%r8d
mov    $0x0,%al
call   1050 <dupstr_@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe5a(%rip),%rsi
lea    0xed9(%rip),%rdx
mov    $0x261,%ecx
mov    $0x0,%al
call   1030 <myfree_@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mybasename>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
lea    0xebe(%rip),%r15
lea    0xf3d(%rip),%r14
mov    %r15,%rdx
mov    %r14,%rcx
mov    $0x25f,%r8d
xor    %eax,%eax
call   1050 <dupstr_@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <basename@plt>
mov    %eax,%edi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    $0x260,%r8d
xor    %eax,%eax
call   1050 <dupstr_@plt>
movslq %eax,%r12
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x261,%ecx
xor    %eax,%eax
call   1030 <myfree_@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/goblinhack/fatdisk/refs/heads/master/file.c\00"
@__FUNCTION__.mybasename = [11 x i8] c"mybasename\00"
define i8* @mybasename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @dupstr_ to i32 (i8*, i8*, i8*, i8*, i32, ...)*)(i8* %7, i8* %8, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.mybasename, i64 0, i64 0), i32 607)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @basename to i32 (i8*, ...)*)(i8* %12)
%14 = load i8*, i8** %4
%15 = call i32 (i32, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @dupstr_ to i32 (i32, i8*, i8*, i8*, i32, ...)*)(i32 %13, i8* %14, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.mybasename, i64 0, i64 0), i32 608)
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %6
%18 = load i8*, i8** %5
%19 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @myfree_ to i32 (i8*, i8*, i8*, i32, ...)*)(i8* %18, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.mybasename, i64 0, i64 0), i32 609)
%20 = load i8*, i8** %6
ret i8* %20
}

LLVM IR (-O2):
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/goblinhack/fatdisk/refs/heads/master/file.c\00"
@__FUNCTION__.mybasename = [11 x i8] c"mybasename\00"
define i8* @mybasename(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @dupstr_ to i32 (i8*, i8*, i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.mybasename, i64 0, i64 0), i32 607)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @basename to i32 (i8*, ...)*)(i8* %5)
%7 = tail call i32 (i32, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @dupstr_ to i32 (i32, i8*, i8*, i8*, i32, ...)*)(i32 %6, i8* %1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.mybasename, i64 0, i64 0), i32 608)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @myfree_ to i32 (i8*, i8*, i8*, i32, ...)*)(i8* %5, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.mybasename, i64 0, i64 0), i32 609)
ret i8* %9
}