#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 */
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  TYPE_1__ *spkac;
};
struct TYPE_4__ {
  int /*<<< orphan*/ pubkey;
};
typedef TYPE_2__ NETSCAPE_SPKI;
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
int /*<<< orphan*/ *X509_PUBKEY_get(int /*<<< orphan*/);
EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x) {
  if ((x == NULL) || (x->spkac == NULL))
    return (NULL);
  return (X509_PUBKEY_get(x->spkac->pubkey));
}


x86 assembly (clang, -O0):
<NETSCAPE_SPKI_get_pubkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1135 <NETSCAPE_SPKI_get_pubkey+0x25>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1142 <NETSCAPE_SPKI_get_pubkey+0x32>
movq   $0x0,-0x8(%rbp)
jmp    1154 <NETSCAPE_SPKI_get_pubkey+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
call   1030 <X509_PUBKEY_get@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NETSCAPE_SPKI_get_pubkey>:
test   %rdi,%rdi
je     1124 <NETSCAPE_SPKI_get_pubkey+0x14>
mov    (%rdi),%rax
test   %rax,%rax
je     1124 <NETSCAPE_SPKI_get_pubkey+0x14>
mov    (%rax),%edi
jmp    1030 <X509_PUBKEY_get@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { %struct.TYPE_4__* }
%struct.TYPE_4__ = type { i32 }
define i32* @NETSCAPE_SPKI_get_pubkey(%struct.TYPE_5__* %0) {
%2 = alloca i32*
%3 = alloca %struct.TYPE_5__*
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %3
%4 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%5 = icmp eq %struct.TYPE_5__* %4, null
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%8 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %7, i32 0, i32 0
%9 = load %struct.TYPE_4__*, %struct.TYPE_4__** %8
%10 = icmp eq %struct.TYPE_4__* %9, null
br i1 %10, label %11, label %12
11: ; preds = %6, %1
store i32* null, i32** %2
br label %19
12: ; preds = %6
%13 = load %struct.TYPE_5__*, %struct.TYPE_5__** %3
%14 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %13, i32 0, i32 0
%15 = load %struct.TYPE_4__*, %struct.TYPE_4__** %14
%16 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %15, i32 0, i32 0
%17 = load i32, i32* %16
%18 = call i32* @X509_PUBKEY_get(i32 %17)
store i32* %18, i32** %2
br label %19
19: ; preds = %12, %11
%20 = load i32*, i32** %2
ret i32* %20
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { %struct.TYPE_4__* }
%struct.TYPE_4__ = type { i32 }
define i32* @NETSCAPE_SPKI_get_pubkey(%struct.TYPE_5__* %0) {
%2 = icmp eq %struct.TYPE_5__* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 0
%5 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%6 = icmp eq %struct.TYPE_4__* %5, null
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %5, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i32* @X509_PUBKEY_get(i32 %9)
br label %11
11: ; preds = %1, %3, %7
%12 = phi i32* [ %10, %7 ], [ null, %3 ], [ null, %1 ]
ret i32* %12
}