char *FileConcat(char *dir, char *file) {
  char *full;
  full = (char *)sre_malloc(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/vinuesa/get_phylomarkers/refs/heads/master/"
      "bin/clustal-omega-1.2.4/src/squid/file.c",
      167, (sizeof(char) * (strlen(dir) + strlen(file) + 2)));
  if (*file == '/')
    strcpy(full, file);
  else
    sprintf(full, "%s%c%s", dir, '/', file);
  return full;
}


x86 assembly (clang, -O0):
<FileConcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdx
add    %rax,%rdx
add    $0x2,%rdx
shl    $0x0,%rdx
lea    0xe84(%rip),%rdi
mov    $0xa7,%esi
mov    $0x0,%al
call   1060 <sre_malloc@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    11b0 <FileConcat+0x70>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    11cf <FileConcat+0x8f>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%r8
lea    0xeeb(%rip),%rsi
mov    $0x2f,%ecx
mov    $0x0,%al
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileConcat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%rdx
add    $0x2,%rdx
lea    0xe93(%rip),%rdi
mov    $0xa7,%esi
xor    %eax,%eax
call   1060 <sre_malloc@plt>
movslq %eax,%r15
cmpb   $0x2f,(%r12)
jne    1190 <FileConcat+0x50>
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
jmp    11ac <FileConcat+0x6c>
lea    0xf17(%rip),%rsi
mov    %r15,%rdi
mov    %r14,%rdx
mov    $0x2f,%ecx
mov    %r12,%r8
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [174 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vinuesa/get_phylomarkers/refs/heads/master/bin/clustal-omega-1.2.4/src/squid/file.c\00"
@.str.1 = [7 x i8] c"%s%c%s\00"
define i8* @FileConcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add i64 %7, %9
%11 = add i64 %10, 2
%12 = mul i64 1, %11
%13 = call i32 (i8*, i32, i64, ...) bitcast (i32 (...)* @sre_malloc to i32 (i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([174 x i8], [174 x i8]* @.str, i64 0, i64 0), i32 167, i64 %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %5
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 47
br i1 %19, label %20, label %24
20: ; preds = %2
%21 = load i8*, i8** %5
%22 = load i8*, i8** %4
%23 = call i8* @strcpy(i8* %21, i8* %22)
br label %29
24: ; preds = %2
%25 = load i8*, i8** %5
%26 = load i8*, i8** %3
%27 = load i8*, i8** %4
%28 = call i32 (i8*, i8*, ...) @sprintf(i8* %25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %26, i32 47, i8* %27)
br label %29
29: ; preds = %24, %20
%30 = load i8*, i8** %5
ret i8* %30
}

LLVM IR (-O2):
@.str = [174 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vinuesa/get_phylomarkers/refs/heads/master/bin/clustal-omega-1.2.4/src/squid/file.c\00"
@.str.1 = [7 x i8] c"%s%c%s\00"
define i8* @FileConcat(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 2
%6 = add i64 %5, %4
%7 = tail call i32 (i8*, i32, i64, ...) bitcast (i32 (...)* @sre_malloc to i32 (i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([174 x i8], [174 x i8]* @.str, i64 0, i64 0), i32 167, i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = load i8, i8* %1
%11 = icmp eq i8 %10, 47
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = tail call i8* @strcpy(i8* dereferenceable(1) %9, i8* %1)
br label %16
14: ; preds = %2
%15 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %9, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 47, i8* %1)
br label %16
16: ; preds = %14, %12
ret i8* %9
}