#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ UI_METHOD;
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ *jksengine_load_key(int /*<<< orphan*/ *, char const *,
                                       int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ stderr;
EVP_PKEY *jksengine_load_pubkey(ENGINE *e, const char *key_id,
                                UI_METHOD *ui_method, void *callback_data) {
  EVP_PKEY *pubkey = NULL;
  ;
  pubkey = jksengine_load_key(e, key_id, ui_method, callback_data);
  if (!pubkey) {
    fprintf(stderr, "ERROR: Loading key failed\n");
    ;
    return NULL;
  }
  return pubkey;
}


x86 assembly (clang, -O0):
<jksengine_load_pubkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <jksengine_load_key@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1186 <jksengine_load_pubkey+0x66>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe8c(%rip),%rsi
call   1040 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    118e <jksengine_load_pubkey+0x6e>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jksengine_load_pubkey>:
push   %rbx
call   1030 <jksengine_load_key@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <jksengine_load_pubkey+0x23>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1040 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"ERROR: Loading key failed\0A\00"
define i32* @jksengine_load_pubkey(i32* %0, i8* %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32*
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i8* %3, i8** %9
store i32* null, i32** %10
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = load i32*, i32** %8
%14 = load i8*, i8** %9
%15 = call i32* @jksengine_load_key(i32* %11, i8* %12, i32* %13, i8* %14)
store i32* %15, i32** %10
%16 = load i32*, i32** %10
%17 = icmp ne i32* %16, null
br i1 %17, label %21, label %18
18: ; preds = %4
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32* null, i32** %5
br label %23
21: ; preds = %4
%22 = load i32*, i32** %10
store i32* %22, i32** %5
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %5
ret i32* %24
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"ERROR: Loading key failed\0A\00"
define i32* @jksengine_load_pubkey(i32* %0, i8* %1, i32* %2, i8* %3) {
%5 = tail call i32* @jksengine_load_key(i32* %0, i8* %1, i32* %2, i8* %3)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %4, %7
ret i32* %5
}