#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*/ pem_password_cb;
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ FILE;
typedef int /*<<< orphan*/ EVP_CIPHER;
typedef int /*<<< orphan*/ EC_KEY;

/* Variables and functions */
int PEM_ASN1_write(int /*<<< orphan*/ *, int /*<<< orphan*/,
                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ const *, unsigned char *, int,
                   int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ PEM_STRING_ECPRIVATEKEY;
scalar_t__ i2d_ECPrivateKey;
int PEM_write_ECPrivateKey(FILE *fp, EC_KEY *x, const EVP_CIPHER *enc,
                           unsigned char *kstr, int klen, pem_password_cb *cb,
                           void *u) {
  return PEM_ASN1_write((i2d_of_void *)i2d_ECPrivateKey,
                        PEM_STRING_ECPRIVATEKEY, fp, x, enc, kstr, klen, cb, u);
}


x86 assembly (clang, -O0):
<PEM_write_ECPrivateKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%rdi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%r11d
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%rax
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <PEM_ASN1_write@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_ECPrivateKey>:
push   %rax
mov    %r9,%rax
mov    %r8d,%r10d
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb6(%rip),%rsi
mov    (%rsi),%rdi
mov    0x2eb4(%rip),%rsi
mov    (%rsi),%esi
sub    $0x8,%rsp
push   0x18(%rsp)
push   %rax
push   %r10
call   1030 <PEM_ASN1_write@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
@i2d_ECPrivateKey = global i64 0
@PEM_STRING_ECPRIVATEKEY = global i32 0
define i32 @PEM_write_ECPrivateKey(i32* %0, i32* %1, i32* %2, i8* %3, i32 %4, i32* %5, i8* %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i8*
store i32* %0, i32** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i32* %5, i32** %13
store i8* %6, i8** %14
%15 = load i64, i64* @i2d_ECPrivateKey
%16 = inttoptr i64 %15 to i32*
%17 = load i32, i32* @PEM_STRING_ECPRIVATEKEY
%18 = load i32*, i32** %8
%19 = load i32*, i32** %9
%20 = load i32*, i32** %10
%21 = load i8*, i8** %11
%22 = load i32, i32* %12
%23 = load i32*, i32** %13
%24 = load i8*, i8** %14
%25 = call i32 @PEM_ASN1_write(i32* %16, i32 %17, i32* %18, i32* %19, i32* %20, i8* %21, i32 %22, i32* %23, i8* %24)
ret i32 %25
}

LLVM IR (-O2):
@i2d_ECPrivateKey = global i64 0
@PEM_STRING_ECPRIVATEKEY = global i32 0
define i32 @PEM_write_ECPrivateKey(i32* %0, i32* %1, i32* %2, i8* %3, i32 %4, i32* %5, i8* %6) {
%8 = load i64, i64* @i2d_ECPrivateKey
%9 = inttoptr i64 %8 to i32*
%10 = load i32, i32* @PEM_STRING_ECPRIVATEKEY
%11 = tail call i32 @PEM_ASN1_write(i32* %9, i32 %10, i32* %0, i32* %1, i32* %2, i8* %3, i32 %4, i32* %5, i8* %6)
ret i32 %11
}