void *dln_load(file) const char *file;
{
  const char *error = 0;
  char *buf;
  do {
    int len = init_funcname_len(&buf, file);
    char *tmp = (char *)alloca(sizeof(char) * (len + 1));
    if (!tmp) {
      free(*&buf);
      rb_memerror();
    }
    strcpy(tmp, *&buf);
    free(*&buf);
    *&buf = tmp;
  } while (0);
  rb_notimplement();
failed:
  rb_loaderror("%s - %s", error, file);
  return 0;
}


x86 assembly (clang, -O0):
<dln_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
lea    -0x18(%rbp),%rdi
call   1080 <init_funcname_len@plt>
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rcx
add    $0x10,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rax
sub    %rcx,%rax
mov    %rax,%rsp
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    11ba <dln_load+0x5a>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
mov    $0x0,%al
call   1070 <rb_memerror@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcpy@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rb_notimplement@plt>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1060 <rb_loaderror@plt>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dln_load>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    -0x20(%rbp),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <init_funcname_len@plt>
cltq
add    $0x10,%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
mov    -0x20(%rbp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcpy@plt>
mov    %r15,%rdi
call   1040 <free@plt>
mov    %rbx,-0x20(%rbp)
xor    %eax,%eax
call   1030 <rb_notimplement@plt>
lea    0xe59(%rip),%rdi
xor    %esi,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1060 <rb_loaderror@plt>
xor    %eax,%eax
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s - %s\00"
define i8* @dln_load(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
br label %7
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 (i8**, i8*, ...) bitcast (i32 (...)* @init_funcname_len to i32 (i8**, i8*, ...)*)(i8** %4, i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = mul i64 1, %12
%14 = alloca i8, i64 %13
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = icmp ne i8* %15, null
br i1 %16, label %20, label %17
17: ; preds = %7
%18 = load i8*, i8** %4
%19 = call i32 (...) @rb_memerror()
br label %20
20: ; preds = %17, %7
%21 = load i8*, i8** %6
%22 = load i8*, i8** %4
%23 = call i8* @strcpy(i8* %21, i8* %22)
%24 = load i8*, i8** %4
%25 = load i8*, i8** %6
store i8* %25, i8** %4
br label %26
26: ; preds = %20
%27 = call i32 (...) @rb_notimplement()
br label %28
28: ; preds = %26
%29 = load i8*, i8** %3
%30 = load i8*, i8** %2
%31 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @rb_loaderror to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %29, i8* %30)
ret i8* null
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s - %s\00"
define i8* @dln_load(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 (i8**, i8*, ...) bitcast (i32 (...)* @init_funcname_len to i32 (i8**, i8*, ...)*)(i8** %2, i8* %0)
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = alloca i8, i64 %6
%8 = load i8*, i8** %2
%9 = call i8* @strcpy(i8* %7, i8* dereferenceable(1) %8)
store i8* %7, i8** %2
%10 = call i32 (...) @rb_notimplement()
%11 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @rb_loaderror to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* null, i8* %0)
ret i8* null
}