#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 key2(RSA *key, unsigned char *c) {
  static unsigned char n[] =
      "\x00\xA3\x07\x9A\x90\xDF\x0D\xFD\x72\xAC\x09\x0C\xCC\x2A\x78\xB8"
      "\x74\x13\x13\x3E\x40\x75\x9C\x98\xFA\xF8\x20\x4F\x35\x8A\x0B\x26"
      "\x3C\x67\x70\xE7\x83\xA9\x3B\x69\x71\xB7\x37\x79\xD2\x71\x7B\xE8"
      "\x34\x77\xCF";
  static unsigned char e[] = "\x3";
  static unsigned char d[] =
      "\x6C\xAF\xBC\x60\x94\xB3\xFE\x4C\x72\xB0\xB3\x32\xC6\xFB\x25\xA2"
      "\xB7\x62\x29\x80\x4E\x68\x65\xFC\xA4\x5A\x74\xDF\x0F\x8F\xB8\x41"
      "\x3B\x52\xC0\xD0\xE5\x3D\x9B\x59\x0F\xF1\x9B\xE7\x9F\x49\xDD\x21"
      "\xE5\xEB";
  static unsigned char p[] =
      "\x00\xCF\x20\x35\x02\x8B\x9D\x86\x98\x40\xB4\x16\x66\xB4\x2E\x92"
      "\xEA\x0D\xA3\xB4\x32\x04\xB5\xCF\xCE\x91";
  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\x5F";
  static unsigned char dmp1[] =
      "\x00\x8A\x15\x78\xAC\x5D\x13\xAF\x10\x2B\x22\xB9\x99\xCD\x74\x61"
      "\xF1\x5E\x6D\x22\xCC\x03\x23\xDF\xDF\x0B";
  static unsigned char dmq1[] =
      "\x00\x86\x55\x21\x4A\xC5\x4D\x8D\x4E\xCD\x61\x77\xF1\xC7\x36\x90"
      "\xCE\x2A\x48\x2C\x8B\x05\x99\xCB\xE0\x3F";
  static unsigned char iqmp[] =
      "\x00\x83\xEF\xEF\xB8\xA9\xA4\x0D\x1D\xB6\xED\x98\xAD\x84\xED\x13"
      "\x35\xDC\xC1\x08\xF3\x22\xD0\x57\xCF\x8D";
  static unsigned char ctext_ex[] =
      "\x14\xbd\xdd\x28\xc9\x83\x35\x19\x23\x80\xe8\xe5\x49\xb1\x58\x2a"
      "\x8b\x40\xb4\x48\x6d\x03\xa6\xa5\x31\x1f\x1f\xd5\xf0\xa1\x80\xe4"
      "\x17\x53\x03\x29\xa9\x34\x90\x74\xb1\x52\x13\x54\x29\x08\x24\x52"
      "\x62\x51";
  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):
<key2>:
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    $0x33,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,-0x38(%rbp)
lea    0x2efd(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,-0x34(%rbp)
lea    0x2ef1(%rip),%rdi
mov    $0x32,%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    0x2f03(%rip),%rdi
mov    $0x1a,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,-0x24(%rbp)
lea    0x2f0b(%rip),%rdi
mov    $0x1a,%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    0x2f00(%rip),%rdi
mov    $0x1a,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,-0x18(%rbp)
lea    0x2f08(%rip),%rdi
mov    $0x1a,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,-0x14(%rbp)
lea    0x2f10(%rip),%rdi
mov    $0x1a,%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    0x2f06(%rip),%rsi
mov    $0x32,%edx
call   1050 <memcpy@plt>
mov    $0x32,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x2eec(%rip),%rdi
mov    $0x33,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,%ebp
lea    0x2f0b(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,%ebx
lea    0x2f02(%rip),%rdi
mov    $0x32,%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    0x2f21(%rip),%rdi
mov    $0x1a,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,%ebx
lea    0x2f2c(%rip),%rdi
mov    $0x1a,%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    0x2f2d(%rip),%rdi
mov    $0x1a,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,%ebx
lea    0x2f38(%rip),%rdi
mov    $0x1a,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,%ebp
lea    0x2f43(%rip),%rdi
mov    $0x1a,%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    0x2f42(%rip),%rsi
mov    %r14,%rdi
mov    $0x32,%edx
call   1050 <memcpy@plt>
mov    $0x32,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@key2.n = internal global [52 x i8] c"\00\A3\07\9A\90\DF\0D\FDr\AC\09\0C\CC*x\B8t\13\13>@u\9C\98\FA\F8 O5\8A\0B&<gp\E7\83\A9;iq\B77y\D2q{\E84w\CF\00"
@key2.e = internal global [2 x i8] c"\03\00"
@key2.d = internal global [51 x i8] c"l\AF\BC`\94\B3\FELr\B0\B32\C6\FB%\A2\B7b)\80Nhe\FC\A4Zt\DF\0F\8F\B8A;R\C0\D0\E5=\9BY\0F\F1\9B\E7\9FI\DD!\E5\EB\00"
@key2.p = internal global [27 x i8] c"\00\CF 5\02\8B\9D\86\98@\B4\16f\B4.\92\EA\0D\A3\B42\04\B5\CF\CE\91\00"
@key2.q = internal global [27 x i8] c"\00\C9\7F\B1\F0'\F4S\F64\123\EA\AA\D1\D95?lB\D0\88f\B1\D0_\00"
@key2.dmp1 = internal global [27 x i8] c"\00\8A\15x\AC]\13\AF\10+\22\B9\99\CDta\F1^m\22\CC\03#\DF\DF\0B\00"
@key2.dmq1 = internal global [27 x i8] c"\00\86U!J\C5M\8DN\CDaw\F1\C76\90\CE*H,\8B\05\99\CB\E0?\00"
@key2.iqmp = internal global [27 x i8] c"\00\83\EF\EF\B8\A9\A4\0D\1D\B6\ED\98\AD\84\ED\135\DC\C1\08\F3\22\D0W\CF\8D\00"
@key2.ctext_ex = internal global [51 x i8] c"\14\BD\DD(\C9\835\19#\80\E8\E5I\B1X*\8B@\B4Hm\03\A6\A51\1F\1F\D5\F0\A1\80\E4\17S\03)\A94\90t\B1R\13T)\08$RbQ\00"
define i32 @key2(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 ([52 x i8], [52 x i8]* @key2.n, i64 0, i64 0), i32 51, i32* null)
%7 = call i32 @BN_bin2bn(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @key2.e, i64 0, i64 0), i32 1, i32* null)
%8 = call i32 @BN_bin2bn(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @key2.d, i64 0, i64 0), i32 50, 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 ([27 x i8], [27 x i8]* @key2.p, i64 0, i64 0), i32 26, i32* null)
%12 = call i32 @BN_bin2bn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @key2.q, i64 0, i64 0), i32 26, 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 ([27 x i8], [27 x i8]* @key2.dmp1, i64 0, i64 0), i32 26, i32* null)
%16 = call i32 @BN_bin2bn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @key2.dmq1, i64 0, i64 0), i32 26, i32* null)
%17 = call i32 @BN_bin2bn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @key2.iqmp, i64 0, i64 0), i32 26, 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 ([51 x i8], [51 x i8]* @key2.ctext_ex, i64 0, i64 0), i32 50)
ret i32 50
}

LLVM IR (-O2):
@key2.n = internal global [52 x i8] c"\00\A3\07\9A\90\DF\0D\FDr\AC\09\0C\CC*x\B8t\13\13>@u\9C\98\FA\F8 O5\8A\0B&<gp\E7\83\A9;iq\B77y\D2q{\E84w\CF\00"
@key2.e = internal global [2 x i8] c"\03\00"
@key2.d = internal global [51 x i8] c"l\AF\BC`\94\B3\FELr\B0\B32\C6\FB%\A2\B7b)\80Nhe\FC\A4Zt\DF\0F\8F\B8A;R\C0\D0\E5=\9BY\0F\F1\9B\E7\9FI\DD!\E5\EB\00"
@key2.p = internal global [27 x i8] c"\00\CF 5\02\8B\9D\86\98@\B4\16f\B4.\92\EA\0D\A3\B42\04\B5\CF\CE\91\00"
@key2.q = internal global [27 x i8] c"\00\C9\7F\B1\F0'\F4S\F64\123\EA\AA\D1\D95?lB\D0\88f\B1\D0_\00"
@key2.dmp1 = internal global [27 x i8] c"\00\8A\15x\AC]\13\AF\10+\22\B9\99\CDta\F1^m\22\CC\03#\DF\DF\0B\00"
@key2.dmq1 = internal global [27 x i8] c"\00\86U!J\C5M\8DN\CDaw\F1\C76\90\CE*H,\8B\05\99\CB\E0?\00"
@key2.iqmp = internal global [27 x i8] c"\00\83\EF\EF\B8\A9\A4\0D\1D\B6\ED\98\AD\84\ED\135\DC\C1\08\F3\22\D0W\CF\8D\00"
@key2.ctext_ex = internal global [51 x i8] c"\14\BD\DD(\C9\835\19#\80\E8\E5I\B1X*\8B@\B4Hm\03\A6\A51\1F\1F\D5\F0\A1\80\E4\17S\03)\A94\90t\B1R\13T)\08$RbQ\00"
define i32 @key2(i32* %0, i8* %1) {
%3 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @key2.n, i64 0, i64 0), i32 51, i32* null)
%4 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @key2.e, i64 0, i64 0), i32 1, i32* null)
%5 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @key2.d, i64 0, i64 0), i32 50, 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 ([27 x i8], [27 x i8]* @key2.p, i64 0, i64 0), i32 26, i32* null)
%8 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @key2.q, i64 0, i64 0), i32 26, i32* null)
%9 = tail call i32 @RSA_set0_factors(i32* %0, i32 %7, i32 %8)
%10 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @key2.dmp1, i64 0, i64 0), i32 26, i32* null)
%11 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @key2.dmq1, i64 0, i64 0), i32 26, i32* null)
%12 = tail call i32 @BN_bin2bn(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @key2.iqmp, i64 0, i64 0), i32 26, 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 ([51 x i8], [51 x i8]* @key2.ctext_ex, i64 0, i64 0), i32 50)
ret i32 50
}