void test_path_unary_extension(void) {
  int root_len;
  const char *ext;
  char *const name = strdup("/home/user.name/file.ext");
  split_ext(name, &root_len, &ext);
  do {
    seatest_assert_string_equal("ext", ext, __FUNCTION__, 65);
  } while (0);
  do {
    seatest_assert_int_equal((20), root_len, __FUNCTION__, 65);
  } while (0);
  free(name);
  ;
}


x86 assembly (clang, -O0):
<test_path_unary_extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xea1(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1060 <split_ext@plt>
mov    -0x10(%rbp),%rsi
lea    0xe8f(%rip),%rdi
lea    0xe8c(%rip),%rdx
mov    $0x41,%ecx
mov    $0x0,%al
call   1040 <seatest_assert_string_equal@plt>
jmp    119e <test_path_unary_extension+0x4e>
mov    -0x4(%rbp),%esi
mov    $0x14,%edi
lea    0xe6c(%rip),%rdx
mov    $0x41,%ecx
mov    $0x0,%al
call   1050 <seatest_assert_int_equal@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_path_unary_extension>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xea2(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,%rbx
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <split_ext@plt>
mov    0x10(%rsp),%rsi
lea    0xe8f(%rip),%rdi
lea    0xe8c(%rip),%r14
mov    %r14,%rdx
mov    $0x41,%ecx
xor    %eax,%eax
call   1040 <seatest_assert_string_equal@plt>
mov    0xc(%rsp),%esi
mov    $0x14,%edi
mov    %r14,%rdx
mov    $0x41,%ecx
xor    %eax,%eax
call   1050 <seatest_assert_int_equal@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"/home/user.name/file.ext\00"
@.str.1 = [4 x i8] c"ext\00"
@__FUNCTION__.test_path_unary_extension = [26 x i8] c"test_path_unary_extension\00"
define void @test_path_unary_extension() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = call i8* @strdup(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @split_ext to i32 (i8*, i32*, i8**, ...)*)(i8* %5, i32* %1, i8** %2)
br label %7
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @__FUNCTION__.test_path_unary_extension, i64 0, i64 0), i32 65)
br label %10
10: ; preds = %7
br label %11
11: ; preds = %10
%12 = load i32, i32* %1
%13 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 20, i32 %12, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @__FUNCTION__.test_path_unary_extension, i64 0, i64 0), i32 65)
br label %14
14: ; preds = %11
%15 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"/home/user.name/file.ext\00"
@.str.1 = [4 x i8] c"ext\00"
@__FUNCTION__.test_path_unary_extension = [26 x i8] c"test_path_unary_extension\00"
define void @test_path_unary_extension() {
%1 = alloca i32
%2 = alloca i8*
%3 = bitcast i32* %1 to i8*
%4 = bitcast i8** %2 to i8*
%5 = tail call dereferenceable_or_null(25) i8* @strdup(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @split_ext to i32 (i8*, i32*, i8**, ...)*)(i8* %5, i32* %1, i8** %2)
%7 = load i8*, i8** %2
%8 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @__FUNCTION__.test_path_unary_extension, i64 0, i64 0), i32 65)
%9 = load i32, i32* %1
%10 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 20, i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @__FUNCTION__.test_path_unary_extension, i64 0, i64 0), i32 65)
ret void
}