int key_load_file(int fd, const char *filename, struct sshbuf *blob) {
  int r;
  if ((r = sshkey_load_file(fd, blob)) != 0) {
    fatal_on_fatal_errors(r, __func__, -22);
    ssh_error("%s: %s", __func__, ssh_err(r));
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<key_load_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1050 <sshkey_load_file@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     11b0 <key_load_file+0x70>
mov    -0x1c(%rbp),%edi
lea    0xe89(%rip),%rsi
mov    $0xffffffea,%edx
mov    $0x0,%al
call   1060 <fatal_on_fatal_errors@plt>
mov    -0x1c(%rbp),%edi
mov    $0x0,%al
call   1040 <ssh_err@plt>
mov    %eax,%edx
lea    0xe78(%rip),%rdi
lea    0xe63(%rip),%rsi
mov    $0x0,%al
call   1030 <ssh_error@plt>
movl   $0x0,-0x4(%rbp)
jmp    11b7 <key_load_file+0x77>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_load_file>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
mov    %rdx,%rsi
xor    %eax,%eax
call   1050 <sshkey_load_file@plt>
test   %eax,%eax
je     118c <key_load_file+0x4c>
mov    %eax,%ebp
lea    0xea3(%rip),%r14
mov    %eax,%edi
mov    %r14,%rsi
mov    $0xffffffea,%edx
xor    %eax,%eax
call   1060 <fatal_on_fatal_errors@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1040 <ssh_err@plt>
lea    0xe90(%rip),%rdi
mov    %r14,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <ssh_error@plt>
jmp    1191 <key_load_file+0x51>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.sshbuf = type opaque
@__func__.key_load_file = [14 x i8] c"key_load_file\00"
@.str = [7 x i8] c"%s: %s\00"
define i32 @key_load_file(i32 %0, i8* %1, %struct.sshbuf* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.sshbuf*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store %struct.sshbuf* %2, %struct.sshbuf** %7
%9 = load i32, i32* %5
%10 = load %struct.sshbuf*, %struct.sshbuf** %7
%11 = call i32 (i32, %struct.sshbuf*, ...) bitcast (i32 (...)* @sshkey_load_file to i32 (i32, %struct.sshbuf*, ...)*)(i32 %9, %struct.sshbuf* %10)
store i32 %11, i32* %8
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %3
%14 = load i32, i32* %8
%15 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @fatal_on_fatal_errors to i32 (i32, i8*, i32, ...)*)(i32 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.key_load_file, i64 0, i64 0), i32 -22)
%16 = load i32, i32* %8
%17 = call i32 (i32, ...) bitcast (i32 (...)* @ssh_err to i32 (i32, ...)*)(i32 %16)
%18 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @ssh_error to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.key_load_file, i64 0, i64 0), i32 %17)
store i32 0, i32* %4
br label %20
19: ; preds = %3
store i32 1, i32* %4
br label %20
20: ; preds = %19, %13
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
%struct.sshbuf = type opaque
@__func__.key_load_file = [14 x i8] c"key_load_file\00"
@.str = [7 x i8] c"%s: %s\00"
define i32 @key_load_file(i32 %0, i8* nocapture readnone %1, %struct.sshbuf* %2) {
%4 = tail call i32 (i32, %struct.sshbuf*, ...) bitcast (i32 (...)* @sshkey_load_file to i32 (i32, %struct.sshbuf*, ...)*)(i32 %0, %struct.sshbuf* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @fatal_on_fatal_errors to i32 (i32, i8*, i32, ...)*)(i32 %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.key_load_file, i64 0, i64 0), i32 -22)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @ssh_err to i32 (i32, ...)*)(i32 %4)
%9 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @ssh_error to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.key_load_file, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %3, %6
%11 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %11
}