void test_dirname() {
  int i;
  const char *path = "/one/two/three/four/";
  char data[13][2][64] = {
      {"", "."},
      {"/", "/"},
      {"///", "/"},
      {".", "."},
      {"..", "."},
      {"../", "."},
      {"../../rel", "../.."},
      {"./rel", "."},
      {"x", "."},
      {"justsomestring", "."},
      {"/usr/src/", "/usr"},
      {"/usr/src///", "/usr"},
      {"/usr/src/linux-2.6.30-r5/drivers", "/usr/src/linux-2.6.30-r5"}};
  for (i = 0; i < 12; i++)
    __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",
        119, __FUNCTION__, dirname_s(data[i][0], 0), data[i][1]);
  path = dirname_s(path, 1);
  __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",
      122, __FUNCTION__, dirname_s(path, 1), "/one/two/");
}


x86 assembly (clang, -O0):
<test_dirname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x690,%rsp
lea    0xebe(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x690(%rbp),%rdi
lea    0xf6c(%rip),%rsi
mov    $0x680,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0xc,-0x4(%rbp)
jge    11ca <test_dirname+0x9a>
movslq -0x4(%rbp),%rax
lea    -0x690(%rbp),%rdi
shl    $0x7,%rax
add    %rax,%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <dirname_s@plt>
mov    %eax,%ecx
movslq -0x4(%rbp),%rax
lea    -0x690(%rbp),%r8
shl    $0x7,%rax
add    %rax,%r8
add    $0x40,%r8
lea    0xe6c(%rip),%rdi
mov    $0x77,%esi
lea    0xee5(%rip),%rdx
mov    $0x0,%al
call   1050 <__assert_str@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <test_dirname+0x35>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <dirname_s@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <dirname_s@plt>
mov    %eax,%ecx
lea    0xe1c(%rip),%rdi
mov    $0x7a,%esi
lea    0xe95(%rip),%rdx
lea    0xe9b(%rip),%r8
mov    $0x0,%al
call   1050 <__assert_str@plt>
add    $0x690,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_dirname>:
push   %r14
push   %rbx
sub    $0x688,%rsp
lea    0xf7f(%rip),%rsi
mov    %rsp,%rbx
mov    $0x680,%edx
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <dirname_s@plt>
lea    0x40(%rsp),%r8
lea    0xeac(%rip),%rbx
lea    0xf2a(%rip),%r14
mov    %rbx,%rdi
mov    $0x77,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <__assert_str@plt>
lea    0x80(%rsp),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <dirname_s@plt>
lea    0xc0(%rsp),%r8
mov    %rbx,%rdi
mov    $0x77,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <__assert_str@plt>
lea    0x100(%rsp),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <dirname_s@plt>
lea    0x140(%rsp),%r8
mov    %rbx,%rdi
mov    $0x77,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <__assert_str@plt>
lea    0x180(%rsp),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <dirname_s@plt>
lea    0x1c0(%rsp),%r8
mov    %rbx,%rdi
mov    $0x77,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <__assert_str@plt>
lea    0x200(%rsp),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <dirname_s@plt>
lea    0x240(%rsp),%r8
mov    %rbx,%rdi
mov    $0x77,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <__assert_str@plt>
lea    0x280(%rsp),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <dirname_s@plt>
lea    0x2c0(%rsp),%r8
mov    %rbx,%rdi
mov    $0x77,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <__assert_str@plt>
lea    0x300(%rsp),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <dirname_s@plt>
lea    0x340(%rsp),%r8
mov    %rbx,%rdi
mov    $0x77,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <__assert_str@plt>
lea    0x380(%rsp),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <dirname_s@plt>
lea    0x3c0(%rsp),%r8
mov    %rbx,%rdi
mov    $0x77,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <__assert_str@plt>
lea    0x400(%rsp),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <dirname_s@plt>
lea    0x440(%rsp),%r8
mov    %rbx,%rdi
mov    $0x77,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <__assert_str@plt>
lea    0x480(%rsp),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <dirname_s@plt>
lea    0x4c0(%rsp),%r8
mov    %rbx,%rdi
mov    $0x77,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <__assert_str@plt>
lea    0x500(%rsp),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <dirname_s@plt>
lea    0x540(%rsp),%r8
mov    %rbx,%rdi
mov    $0x77,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <__assert_str@plt>
lea    0x580(%rsp),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <dirname_s@plt>
lea    0x5c0(%rsp),%r8
mov    %rbx,%rdi
mov    $0x77,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <__assert_str@plt>
lea    0xc86(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <dirname_s@plt>
movslq %eax,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <dirname_s@plt>
lea    0xd0b(%rip),%r8
mov    %rbx,%rdi
mov    $0x7a,%esi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <__assert_str@plt>
add    $0x688,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"/one/two/three/four/\00"
@__const.test_dirname.data = [13 x [2 x [64 x i8]]] [[2 x [64 x i8]] [[64 x i8] zeroinitializer, [64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"/\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"/\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"///\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"/\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"..\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"../\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"../../rel\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"../..\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"./rel\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"x\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"justsomestring\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"/usr/src/\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"/usr\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"/usr/src///\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"/usr\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"/usr/src/linux-2.6.30-r5/drivers\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"/usr/src/linux-2.6.30-r5\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]]
@.str.1 = [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_dirname = [13 x i8] c"test_dirname\00"
@.str.2 = [10 x i8] c"/one/two/\00"
define void @test_dirname() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [13 x [2 x [64 x i8]]]
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = bitcast [13 x [2 x [64 x i8]]]* %3 to i8*
store i32 0, i32* %1
br label %5
5: ; preds = %21, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 12
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %3, i64 0, i64 %10
%12 = getelementptr inbounds [2 x [64 x i8]], [2 x [64 x i8]]* %11, i64 0, i64 0
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %12, i64 0, i64 0
%14 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %13, i32 0)
%15 = load i32, i32* %1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %3, i64 0, i64 %16
%18 = getelementptr inbounds [2 x [64 x i8]], [2 x [64 x i8]]* %17, i64 0, i64 1
%19 = getelementptr inbounds [64 x i8], [64 x i8]* %18, i64 0, i64 0
%20 = 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.1, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %14, i8* %19)
br label %21
21: ; preds = %8
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 1
store i32 %23, i32* %1
br label %5
24: ; preds = %5
%25 = load i8*, i8** %2
%26 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %25, i32 1)
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i8*
store i8* %28, i8** %2
%29 = load i8*, i8** %2
%30 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %29, i32 1)
%31 = 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.1, i64 0, i64 0), i32 122, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %30, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"/one/two/three/four/\00"
@__const.test_dirname.data = [13 x [2 x [64 x i8]]] [[2 x [64 x i8]] [[64 x i8] zeroinitializer, [64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"/\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"/\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"///\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"/\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"..\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"../\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"../../rel\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"../..\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"./rel\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"x\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"justsomestring\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c".\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"/usr/src/\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"/usr\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"/usr/src///\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"/usr\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"], [2 x [64 x i8]] [[64 x i8] c"/usr/src/linux-2.6.30-r5/drivers\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [64 x i8] c"/usr/src/linux-2.6.30-r5\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]]
@.str.1 = [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_dirname = [13 x i8] c"test_dirname\00"
@.str.2 = [10 x i8] c"/one/two/\00"
define void @test_dirname() {
%1 = alloca [13 x [2 x [64 x i8]]]
%2 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 0, i64 0, i64 0
%3 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %2, i32 0)
%4 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 0, i64 1, i64 0
%5 = 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.1, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %3, i8* %4)
%6 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 1, i64 0, i64 0
%7 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %6, i32 0)
%8 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 1, i64 1, i64 0
%9 = 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.1, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %7, i8* %8)
%10 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 2, i64 0, i64 0
%11 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %10, i32 0)
%12 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 2, i64 1, i64 0
%13 = 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.1, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %11, i8* %12)
%14 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 3, i64 0, i64 0
%15 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %14, i32 0)
%16 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 3, i64 1, i64 0
%17 = 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.1, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %15, i8* %16)
%18 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 4, i64 0, i64 0
%19 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %18, i32 0)
%20 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 4, i64 1, i64 0
%21 = 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.1, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %19, i8* %20)
%22 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 5, i64 0, i64 0
%23 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %22, i32 0)
%24 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 5, i64 1, i64 0
%25 = 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.1, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %23, i8* %24)
%26 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 6, i64 0, i64 0
%27 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %26, i32 0)
%28 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 6, i64 1, i64 0
%29 = 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.1, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %27, i8* %28)
%30 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 7, i64 0, i64 0
%31 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %30, i32 0)
%32 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 7, i64 1, i64 0
%33 = 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.1, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %31, i8* %32)
%34 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 8, i64 0, i64 0
%35 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %34, i32 0)
%36 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 8, i64 1, i64 0
%37 = 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.1, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %35, i8* %36)
%38 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 9, i64 0, i64 0
%39 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %38, i32 0)
%40 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 9, i64 1, i64 0
%41 = 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.1, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %39, i8* %40)
%42 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 10, i64 0, i64 0
%43 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %42, i32 0)
%44 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 10, i64 1, i64 0
%45 = 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.1, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %43, i8* %44)
%46 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 11, i64 0, i64 0
%47 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %46, i32 0)
%48 = getelementptr inbounds [13 x [2 x [64 x i8]]], [13 x [2 x [64 x i8]]]* %1, i64 0, i64 11, i64 1, i64 0
%49 = 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.1, i64 0, i64 0), i32 119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %47, i8* %48)
%50 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 1)
%51 = sext i32 %50 to i64
%52 = inttoptr i64 %51 to i8*
%53 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dirname_s to i32 (i8*, i32, ...)*)(i8* %52, i32 1)
%54 = 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.1, i64 0, i64 0), i32 122, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_dirname, i64 0, i64 0), i32 %53, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}