void test_mkpath() {
  __assert_str(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/pnx/archived/refs/heads/next/test/t_path.c",
      42, __FUNCTION__, mkpath("%s/%s", "/mnt/", "file"), "/mnt//file");
  __assert_str(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/pnx/archived/refs/heads/next/test/t_path.c",
      43, __FUNCTION__, mkpath("%s/%s%i", "/dev", "tty", 2), "/dev/tty2");
}


x86 assembly (clang, -O0):
<test_mkpath>:
push   %rbp
mov    %rsp,%rbp
lea    0xf66(%rip),%rdi
lea    0xf65(%rip),%rsi
lea    0xf6a(%rip),%rdx
mov    $0x0,%al
call   1030 <mkpath@plt>
mov    %eax,%ecx
lea    0xeb7(%rip),%rdi
mov    $0x2a,%esi
lea    0xf30(%rip),%rdx
lea    0xf41(%rip),%r8
mov    $0x0,%al
call   1040 <__assert_str@plt>
lea    0xf3e(%rip),%rdi
lea    0xf3f(%rip),%rsi
lea    0xf3d(%rip),%rdx
mov    $0x2,%ecx
mov    $0x0,%al
call   1030 <mkpath@plt>
mov    %eax,%ecx
lea    0xe73(%rip),%rdi
mov    $0x2b,%esi
lea    0xeec(%rip),%rdx
lea    0xf19(%rip),%r8
mov    $0x0,%al
call   1040 <__assert_str@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mkpath>:
push   %r14
push   %rbx
push   %rax
lea    0xf66(%rip),%rdi
lea    0xf65(%rip),%rsi
lea    0xf6a(%rip),%rdx
xor    %eax,%eax
call   1030 <mkpath@plt>
lea    0xeb9(%rip),%rbx
lea    0xf37(%rip),%r14
lea    0xf48(%rip),%r8
mov    %rbx,%rdi
mov    $0x2a,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <__assert_str@plt>
lea    0xf38(%rip),%rdi
lea    0xf39(%rip),%rsi
lea    0xf37(%rip),%rdx
mov    $0x2,%ecx
xor    %eax,%eax
call   1030 <mkpath@plt>
lea    0xf28(%rip),%r8
mov    %rbx,%rdi
mov    $0x2b,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <__assert_str@plt>

LLVM IR (-O0):
@.str = [133 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/pnx/archived/refs/heads/next/test/t_path.c\00"
@__FUNCTION__.test_mkpath = [12 x i8] c"test_mkpath\00"
@.str.1 = [6 x i8] c"%s/%s\00"
@.str.2 = [6 x i8] c"/mnt/\00"
@.str.3 = [5 x i8] c"file\00"
@.str.4 = [11 x i8] c"/mnt//file\00"
@.str.5 = [8 x i8] c"%s/%s%i\00"
@.str.6 = [5 x i8] c"/dev\00"
@.str.7 = [4 x i8] c"tty\00"
@.str.8 = [10 x i8] c"/dev/tty2\00"
define void @test_mkpath() {
%1 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @mkpath to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 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 ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%2 = call i32 (i8*, i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert_str to i32 (i8*, i32, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.test_mkpath, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%3 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @mkpath to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 2)
%4 = call i32 (i8*, i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert_str to i32 (i8*, i32, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.test_mkpath, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [133 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/pnx/archived/refs/heads/next/test/t_path.c\00"
@__FUNCTION__.test_mkpath = [12 x i8] c"test_mkpath\00"
@.str.1 = [6 x i8] c"%s/%s\00"
@.str.2 = [6 x i8] c"/mnt/\00"
@.str.3 = [5 x i8] c"file\00"
@.str.4 = [11 x i8] c"/mnt//file\00"
@.str.5 = [8 x i8] c"%s/%s%i\00"
@.str.6 = [5 x i8] c"/dev\00"
@.str.7 = [4 x i8] c"tty\00"
@.str.8 = [10 x i8] c"/dev/tty2\00"
define void @test_mkpath() {
%1 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @mkpath to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 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 ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%2 = tail call i32 (i8*, i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert_str to i32 (i8*, i32, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.test_mkpath, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%3 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @mkpath to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 2)
%4 = tail call i32 (i8*, i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @__assert_str to i32 (i8*, i32, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i32 43, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.test_mkpath, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
ret void
}