void test_no_extension(void) {
  char buf[] = "file";
  do {
    seatest_assert_string_equal("", cut_extension(buf), __FUNCTION__, 9);
  } while (0);
  do {
    seatest_assert_string_equal("file", buf, __FUNCTION__, 10);
  } while (0);
}


x86 assembly (clang, -O0):
<test_no_extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
mov    $0x0,%al
call   1040 <cut_extension@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
lea    0xeb0(%rip),%rdx
mov    $0x9,%ecx
mov    $0x0,%al
call   1030 <seatest_assert_string_equal@plt>
jmp    1166 <test_no_extension+0x46>
lea    -0x5(%rbp),%rsi
lea    0xe8f(%rip),%rdi
lea    0xe8d(%rip),%rdx
mov    $0xa,%ecx
mov    $0x0,%al
call   1030 <seatest_assert_string_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_no_extension>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x656c6966,0x8(%rsp)
65
lea    0xed5(%rip),%r14
lea    0x8(%rsp),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <cut_extension@plt>
lea    0xec3(%rip),%rdi
lea    0xea6(%rip),%rbx
mov    %eax,%esi
mov    %rbx,%rdx
mov    $0x9,%ecx
xor    %eax,%eax
call   1030 <seatest_assert_string_equal@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    $0xa,%ecx
xor    %eax,%eax
call   1030 <seatest_assert_string_equal@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.test_no_extension.buf = [5 x i8] c"file\00"
@.str = [1 x i8] zeroinitializer
@__FUNCTION__.test_no_extension = [18 x i8] c"test_no_extension\00"
@.str.1 = [5 x i8] c"file\00"
define void @test_no_extension() {
%1 = alloca [5 x i8]
%2 = bitcast [5 x i8]* %1 to i8*
br label %3
3: ; preds = %0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @cut_extension to i32 (i8*, ...)*)(i8* %4)
%6 = call i32 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i32, i8*, i32, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.test_no_extension, i64 0, i64 0), i32 9)
br label %7
7: ; preds = %3
br label %8
8: ; preds = %7
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%10 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.test_no_extension, i64 0, i64 0), i32 10)
br label %11
11: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@__FUNCTION__.test_no_extension = [18 x i8] c"test_no_extension\00"
@.str.1 = [5 x i8] c"file\00"
define void @test_no_extension() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @cut_extension to i32 (i8*, ...)*)(i8* %2)
%4 = call i32 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i32, i8*, i32, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.test_no_extension, i64 0, i64 0), i32 9)
%5 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.test_no_extension, i64 0, i64 0), i32 10)
ret void
}