#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*/ q;
typedef int /*<<< orphan*/ p;
typedef int /*<<< orphan*/ n;
typedef int /*<<< orphan*/ iqmp;
typedef int /*<<< orphan*/ e;
typedef int /*<<< orphan*/ dmq1;
typedef int /*<<< orphan*/ dmp1;
typedef int /*<<< orphan*/ d;
typedef int /*<<< orphan*/ ctext_ex;
typedef int /*<<< orphan*/ RSA;

/* Variables and functions */
int /*<<< orphan*/ BN_bin2bn(unsigned char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ RSA_set0_crt_params(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ RSA_set0_factors(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
int /*<<< orphan*/ RSA_set0_key(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
int key1(RSA *key, unsigned char *c) {
  static unsigned char n[] =
      "\x00\xAA\x36\xAB\xCE\x88\xAC\xFD\xFF\x55\x52\x3C\x7F\xC4\x52\x3F"
      "\x90\xEF\xA0\x0D\xF3\x77\x4A\x25\x9F\x2E\x62\xB4\xC5\xD9\x9C\xB5"
      "\xAD\xB3\x00\xA0\x28\x5E\x53\x01\x93\x0E\x0C\x70\xFB\x68\x76\x93"
      "\x9C\xE6\x16\xCE\x62\x4A\x11\xE0\x08\x6D\x34\x1E\xBC\xAC\xA0\xA1"
      "\xF5";
  static unsigned char e[] = "\x11";
  static unsigned char d[] =
      "\x0A\x03\x37\x48\x62\x64\x87\x69\x5F\x5F\x30\xBC\x38\xB9\x8B\x44"
      "\xC2\xCD\x2D\xFF\x43\x40\x98\xCD\x20\xD8\xA1\x38\xD0\x90\xBF\x64"
      "\x79\x7C\x3F\xA7\xA2\xCD\xCB\x3C\xD1\xE0\xBD\xBA\x26\x54\xB4\xF9"
      "\xDF\x8E\x8A\xE5\x9D\x73\x3D\x9F\x33\xB3\x01\x62\x4A\xFD\x1D\x51";
  static unsigned char p[] =
      "\x00\xD8\x40\xB4\x16\x66\xB4\x2E\x92\xEA\x0D\xA3\xB4\x32\x04\xB5"
      "\xCF\xCE\x33\x52\x52\x4D\x04\x16\xA5\xA4\x41\xE7\x00\xAF\x46\x12"
      "\x0D";
  static unsigned char q[] =
      "\x00\xC9\x7F\xB1\xF0\x27\xF4\x53\xF6\x34\x12\x33\xEA\xAA\xD1\xD9"
      "\x35\x3F\x6C\x42\xD0\x88\x66\xB1\xD0\x5A\x0F\x20\x35\x02\x8B\x9D"
      "\x89";
  static unsigned char dmp1[] =
      "\x59\x0B\x95\x72\xA2\xC2\xA9\xC4\x06\x05\x9D\xC2\xAB\x2F\x1D\xAF"
      "\xEB\x7E\x8B\x4F\x10\xA7\x54\x9E\x8E\xED\xF5\xB4\xFC\xE0\x9E\x05";
  static unsigned char dmq1[] =
      "\x00\x8E\x3C\x05\x21\xFE\x15\xE0\xEA\x06\xA3\x6F\xF0\xF1\x0C\x99"
      "\x52\xC3\x5B\x7A\x75\x14\xFD\x32\x38\xB8\x0A\xAD\x52\x98\x62\x8D"
      "\x51";
  static unsigned char iqmp[] =
      "\x36\x3F\xF7\x18\x9D\xA8\xE9\x0B\x1D\x34\x1F\x71\xD0\x9B\x76\xA8"
      "\xA9\x43\xE1\x1D\x10\xB2\x4D\x24\x9F\x2D\xEA\xFE\xF8\x0C\x18\x26";
  static unsigned char ctext_ex[] =
      "\x1b\x8f\x05\xf9\xca\x1a\x79\x52\x6e\x53\xf3\xcc\x51\x4f\xdb\x89"
      "\x2b\xfb\x91\x93\x23\x1e\x78\xb9\x92\xe6\x8d\x50\xa4\x80\xcb\x52"
      "\x33\x89\x5c\x74\x95\x8d\x5d\x02\xab\x8c\x0f\xd0\x40\xeb\x58\x44"
      "\xb0\x05\xc3\x9e\xd8\x27\x4a\x9d\xbf\xa8\x06\x71\x40\x94\x39\xd2";
  RSA_set0_key(key, BN_bin2bn(n, sizeof(n) - 1, NULL),
               BN_bin2bn(e, sizeof(e) - 1, NULL),
               BN_bin2bn(d, sizeof(d) - 1, NULL));
  RSA_set0_factors(key, BN_bin2bn(p, sizeof(p) - 1, NULL),
                   BN_bin2bn(q, sizeof(q) - 1, NULL));
  RSA_set0_crt_params(key, BN_bin2bn(dmp1, sizeof(dmp1) - 1, NULL),
                      BN_bin2bn(dmq1, sizeof(dmq1) - 1, NULL),
                      BN_bin2bn(iqmp, sizeof(iqmp) - 1, NULL));
  memcpy(c, ctext_ex, sizeof(ctext_ex) - 1);
  return sizeof(ctext_ex) - 1;
  ;
}


x86 assembly (clang, -O0):
<key1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    0x2ee1(%rip),%rdi
mov    $0x41,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,-0x38(%rbp)
lea    0x2f0b(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,-0x34(%rbp)
lea    0x2f01(%rip),%rdi
mov    $0x40,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    %eax,%ecx
call   1070 <RSA_set0_key@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    0x2f23(%rip),%rdi
mov    $0x21,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,-0x24(%rbp)
lea    0x2f3b(%rip),%rdi
mov    $0x21,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    %eax,%edx
call   1060 <RSA_set0_factors@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0x2f40(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,-0x18(%rbp)
lea    0x2f58(%rip),%rdi
mov    $0x21,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,-0x14(%rbp)
lea    0x2f70(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
call   1030 <RSA_set0_crt_params@plt>
mov    -0x10(%rbp),%rdi
lea    0x2f76(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
mov    $0x40,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key1>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x2eec(%rip),%rdi
mov    $0x41,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,%ebp
lea    0x2f19(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,%ebx
lea    0x2f12(%rip),%rdi
mov    $0x40,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
call   1070 <RSA_set0_key@plt>
lea    0x2f41(%rip),%rdi
mov    $0x21,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,%ebx
lea    0x2f5c(%rip),%rdi
mov    $0x21,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1060 <RSA_set0_factors@plt>
lea    0x2f6d(%rip),%rdi
mov    $0x20,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,%ebx
lea    0x2f88(%rip),%rdi
mov    $0x21,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,%ebp
lea    0x2fa3(%rip),%rdi
mov    $0x20,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <RSA_set0_crt_params@plt>
lea    0x2fb2(%rip),%rsi
mov    %r14,%rdi
mov    $0x40,%edx
call   1050 <memcpy@plt>
mov    $0x40,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@key1.n = internal global [66 x i8] c"\00\AA6\AB\CE\88\AC\FD\FFUR<\7F\C4R?\90\EF\A0\0D\F3wJ%\9F.b\B4\C5\D9\9C\B5\AD\B3\00\A0(^S\01\93\0E\0Cp\FBhv\93\9C\E6\16\CEbJ\11\E0\08m4\1E\BC\AC\A0\A1\F5\00"
@key1.e = internal global [2 x i8] c"\11\00"
@key1.d = internal global [65 x i8] c"\0A\037Hbd\87i__0\BC8\B9\8BD\C2\CD-\FFC@\98\CD \D8\A18\D0\90\BFdy|?\A7\A2\CD\CB<\D1\E0\BD\BA&T\B4\F9\DF\8E\8A\E5\9Ds=\9F3\B3\01bJ\FD\1DQ\00"
@key1.p = internal global [34 x i8] c"\00\D8@\B4\16f\B4.\92\EA\0D\A3\B42\04\B5\CF\CE3RRM\04\16\A5\A4A\E7\00\AFF\12\0D\00"
@key1.q = internal global [34 x i8] c"\00\C9\7F\B1\F0'\F4S\F64\123\EA\AA\D1\D95?lB\D0\88f\B1\D0Z\0F 5\02\8B\9D\89\00"
@key1.dmp1 = internal global [33 x i8] c"Y\0B\95r\A2\C2\A9\C4\06\05\9D\C2\AB/\1D\AF\EB~\8BO\10\A7T\9E\8E\ED\F5\B4\FC\E0\9E\05\00"
@key1.dmq1 = internal global [34 x i8] c"\00\8E<\05!\FE\15\E0\EA\06\A3o\F0\F1\0C\99R\C3[zu\14\FD28\B8\0A\ADR\98b\8DQ\00"
@key1.iqmp = internal global [33 x i8] c"6?\F7\18\9D\A8\E9\0B\1D4\1Fq\D0\9Bv\A8\A9C\E1\1D\10\B2M$\9F-\EA\FE\F8\0C\18&\00"
@key1.ctext_ex = internal global [65 x i8] c"\1B\8F\05\F9\CA\1AyRnS\F3\CCQO\DB\89+\FB\91\93#\1Ex\B9\92\E6\8DP\A4\80\CBR3\89\\t\95\8D]\02\AB\8C\0F\D0@\EBXD\B0\05\C3\9E\D8'J\9D\BF\A8\06q@\949\D2\00"
define i32 @key1(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = call i32 @BN_bin2bn(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @key1.n, i64 0, i64 0), i32 65, i32* null)
%7 = call i32 @BN_bin2bn(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @key1.e, i64 0, i64 0), i32 1, i32* null)
%8 = call i32 @BN_bin2bn(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @key1.d, i64 0, i64 0), i32 64, i32* null)
%9 = call i32 @RSA_set0_key(i32* %5, i32 %6, i32 %7, i32 %8)
%10 = load i32*, i32** %3
%11 = call i32 @BN_bin2bn(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @key1.p, i64 0, i64 0), i32 33, i32* null)
%12 = call i32 @BN_bin2bn(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @key1.q, i64 0, i64 0), i32 33, i32* null)
%13 = call i32 @RSA_set0_factors(i32* %10, i32 %11, i32 %12)
%14 = load i32*, i32** %3
%15 = call i32 @BN_bin2bn(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @key1.dmp1, i64 0, i64 0), i32 32, i32* null)
%16 = call i32 @BN_bin2bn(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @key1.dmq1, i64 0, i64 0), i32 33, i32* null)
%17 = call i32 @BN_bin2bn(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @key1.iqmp, i64 0, i64 0), i32 32, i32* null)
%18 = call i32 @RSA_set0_crt_params(i32* %14, i32 %15, i32 %16, i32 %17)
%19 = load i8*, i8** %4
%20 = call i32 @memcpy(i8* %19, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @key1.ctext_ex, i64 0, i64 0), i32 64)
ret i32 64
}

LLVM IR (-O2):
@key1.n = internal global [66 x i8] c"\00\AA6\AB\CE\88\AC\FD\FFUR<\7F\C4R?\90\EF\A0\0D\F3wJ%\9F.b\B4\C5\D9\9C\B5\AD\B3\00\A0(^S\01\93\0E\0Cp\FBhv\93\9C\E6\16\CEbJ\11\E0\08m4\1E\BC\AC\A0\A1\F5\00"
@key1.e = internal global [2 x i8] c"\11\00"
@key1.d = internal global [65 x i8] c"\0A\037Hbd\87i__0\BC8\B9\8BD\C2\CD-\FFC@\98\CD \D8\A18\D0\90\BFdy|?\A7\A2\CD\CB<\D1\E0\BD\BA&T\B4\F9\DF\8E\8A\E5\9Ds=\9F3\B3\01bJ\FD\1DQ\00"
@key1.p = internal global [34 x i8] c"\00\D8@\B4\16f\B4.\92\EA\0D\A3\B42\04\B5\CF\CE3RRM\04\16\A5\A4A\E7\00\AFF\12\0D\00"
@key1.q = internal global [34 x i8] c"\00\C9\7F\B1\F0'\F4S\F64\123\EA\AA\D1\D95?lB\D0\88f\B1\D0Z\0F 5\02\8B\9D\89\00"
@key1.dmp1 = internal global [33 x i8] c"Y\0B\95r\A2\C2\A9\C4\06\05\9D\C2\AB/\1D\AF\EB~\8BO\10\A7T\9E\8E\ED\F5\B4\FC\E0\9E\05\00"
@key1.dmq1 = internal global [34 x i8] c"\00\8E<\05!\FE\15\E0\EA\06\A3o\F0\F1\0C\99R\C3[zu\14\FD28\B8\0A\ADR\98b\8DQ\00"
@key1.iqmp = internal global [33 x i8] c"6?\F7\18\9D\A8\E9\0B\1D4\1Fq\D0\9Bv\A8\A9C\E1\1D\10\B2M$\9F-\EA\FE\F8\0C\18&\00"
@key1.ctext_ex = internal global [65 x i8] c"\1B\8F\05\F9\CA\1AyRnS\F3\CCQO\DB\89+\FB\91\93#\1Ex\B9\92\E6\8DP\A4\80\CBR3\89\\t\95\8D]\02\AB\8C\0F\D0@\EBXD\B0\05\C3\9E\D8'J\9D\BF\A8\06q@\949\D2\00"
define i32 @key1(i32* %0, i8* %1) {
%3 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @key1.n, i64 0, i64 0), i32 65, i32* null)
%4 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @key1.e, i64 0, i64 0), i32 1, i32* null)
%5 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @key1.d, i64 0, i64 0), i32 64, i32* null)
%6 = tail call i32 @RSA_set0_key(i32* %0, i32 %3, i32 %4, i32 %5)
%7 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @key1.p, i64 0, i64 0), i32 33, i32* null)
%8 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @key1.q, i64 0, i64 0), i32 33, i32* null)
%9 = tail call i32 @RSA_set0_factors(i32* %0, i32 %7, i32 %8)
%10 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @key1.dmp1, i64 0, i64 0), i32 32, i32* null)
%11 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @key1.dmq1, i64 0, i64 0), i32 33, i32* null)
%12 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @key1.iqmp, i64 0, i64 0), i32 32, i32* null)
%13 = tail call i32 @RSA_set0_crt_params(i32* %0, i32 %10, i32 %11, i32 %12)
%14 = tail call i32 @memcpy(i8* %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @key1.ctext_ex, i64 0, i64 0), i32 64)
ret i32 64
}