#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*/ dhp_4096;
typedef int /*<<< orphan*/ dhg_4096;
typedef int /*<<< orphan*/ DH;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ *BN_bin2bn(unsigned char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ BN_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ DH_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *DH_new();
int /*<<< orphan*/ DH_set0_pqg(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *);
DH *get_dh4096() {
  static unsigned char dhp_4096[] = {
      0xD2, 0xB2, 0x5E, 0x24, 0x83, 0x8E, 0x04, 0x17, 0x39, 0xAB, 0x99, 0x5A,
      0xAB, 0x0C, 0x15, 0x3C, 0x95, 0xE0, 0xE4, 0x48, 0x3F, 0xE4, 0x22, 0x48,
      0xCA, 0x19, 0xCA, 0xD0, 0x9E, 0xA7, 0x09, 0xD0, 0x97, 0x0F, 0x31, 0x49,
      0xD3, 0xC7, 0x6C, 0x58, 0xA6, 0x37, 0x13, 0x63, 0x0E, 0x5F, 0xE5, 0xDE,
      0x16, 0x8E, 0xB6, 0xEE, 0x1B, 0x12, 0xB3, 0x25, 0x90, 0x2D, 0x51, 0xBF,
      0xEE, 0x91, 0x69, 0x93, 0x7E, 0x83, 0xF1, 0x02, 0xD0, 0xDC, 0xD9, 0x2C,
      0xFC, 0xF6, 0x3E, 0x34, 0xB3, 0x45, 0x29, 0xB8, 0x4F, 0x73, 0x68, 0xE9,
      0x39, 0x6E, 0xFC, 0xC1, 0x5A, 0x16, 0xB8, 0xC4, 0x30, 0x0A, 0x29, 0x05,
      0x31, 0x6F, 0x93, 0x09, 0x31, 0x67, 0x98, 0xA0, 0x12, 0x97, 0x5D, 0x8A,
      0x13, 0xFF, 0x7D, 0x4A, 0x51, 0xA3, 0x82, 0x88, 0xFA, 0x6A, 0xEF, 0x08,
      0x7A, 0xB8, 0xA0, 0x67, 0x5B, 0xB8, 0x0F, 0x2D, 0x4A, 0x84, 0x0E, 0x85,
      0x94, 0xB7, 0x90, 0x0D, 0x61, 0x65, 0x89, 0x80, 0xF6, 0xF7, 0xF2, 0x28,
      0xF3, 0x69, 0x8C, 0x4C, 0xCD, 0x4F, 0x16, 0xD4, 0x7B, 0x23, 0x1A, 0xBF,
      0x5A, 0xFC, 0x36, 0xD3, 0x39, 0x14, 0xA2, 0x17, 0xFA, 0x65, 0x79, 0xFC,
      0x8D, 0xD0, 0x67, 0x6A, 0x36, 0x72, 0x30, 0x47, 0x2F, 0x23, 0xB0, 0x2F,
      0xEA, 0x1F, 0x60, 0xBD, 0x20, 0xA1, 0x38, 0x6C, 0xE7, 0x6B, 0xF1, 0x14,
      0x2E, 0x41, 0x39, 0xEB, 0x87, 0x91, 0xE2, 0x88, 0x17, 0x88, 0x55, 0x07,
      0x1C, 0x2D, 0xA7, 0xBB, 0x5E, 0x97, 0x0A, 0x10, 0x4A, 0x17, 0xD6, 0x60,
      0x27, 0xCB, 0xC4, 0xF9, 0x07, 0xAD, 0xA2, 0x58, 0x0F, 0xBE, 0xE3, 0x0A,
      0xC8, 0xCA, 0xEB, 0x5D, 0x2E, 0xD7, 0x02, 0xE1, 0x2F, 0xFC, 0x7C, 0xD1,
      0x4F, 0xB0, 0x65, 0xF0, 0x6A, 0xED, 0xDE, 0xEE, 0xD1, 0x45, 0x69, 0x89,
      0xB6, 0x70, 0x7D, 0x32, 0x73, 0x62, 0x46, 0xE4, 0x91, 0x0D, 0x59, 0xFD,
      0xB1, 0x38, 0x83, 0x69, 0xA8, 0xAF, 0xCF, 0x24, 0x10, 0xD2, 0x11, 0x6B,
      0xC3, 0x42, 0xF0, 0xF8, 0xB6, 0xC2, 0xB9, 0xF0, 0xB1, 0x0D, 0x1C, 0x5D,
      0xA5, 0x22, 0x40, 0xA0, 0xCB, 0x3A, 0x26, 0xD7, 0xD3, 0x48, 0xB1, 0xA4,
      0x18, 0x96, 0xED, 0xF0, 0xEB, 0x39, 0x41, 0x5D, 0x1C, 0xEE, 0xC4, 0xCA,
      0x23, 0x57, 0x91, 0xBE, 0x1E, 0x5E, 0x78, 0xE7, 0xE4, 0x1B, 0x75, 0xB5,
      0x7C, 0x28, 0x41, 0x2D, 0xAE, 0x9F, 0xE7, 0xD3, 0xFD, 0xE6, 0x8D, 0xE7,
      0x75, 0x7F, 0x8C, 0xFE, 0x6F, 0x8F, 0xEF, 0x29, 0xB9, 0x51, 0xAB, 0xCB,
      0x37, 0x12, 0x10, 0xD6, 0x60, 0xE8, 0xD1, 0xB2, 0x9C, 0x3E, 0xA9, 0xF5,
      0x6A, 0x4E, 0x43, 0x12, 0x46, 0x3E, 0x23, 0x43, 0x26, 0x2C, 0x9D, 0xEB,
      0x73, 0x7A, 0x0C, 0xD1, 0x40, 0x58, 0x5F, 0xE5, 0x2C, 0xE5, 0x0E, 0xFF,
      0xA8, 0x61, 0xBD, 0x88, 0x87, 0x29, 0x13, 0x75, 0x31, 0xAA, 0x78, 0x8D,
      0xAD, 0x59, 0x8C, 0x9D, 0x8C, 0xB1, 0x14, 0xC5, 0xC5, 0x60, 0x80, 0xB7,
      0x4C, 0xAE, 0x82, 0xA5, 0xC4, 0x5A, 0xEE, 0x76, 0x4D, 0x7C, 0xF0, 0x1B,
      0x97, 0x70, 0x53, 0xCE, 0x4E, 0x38, 0x46, 0x15, 0xAF, 0x0D, 0x09, 0xD0,
      0xCB, 0x48, 0x26, 0xA8, 0x88, 0xA4, 0x78, 0x31, 0xCC, 0x24, 0x57, 0x68,
      0x52, 0x52, 0x27, 0x4F, 0x75, 0xA0, 0x59, 0xD3, 0x8F, 0x34, 0x02, 0xB5,
      0xD5, 0x9C, 0xF7, 0x6B, 0xD7, 0xC2, 0x43, 0x67, 0x6D, 0x01, 0xFD, 0xA2,
      0xB6, 0xD9, 0x32, 0xD5, 0xB9, 0x4A, 0x1B, 0xB8, 0xC8, 0x44, 0x81, 0x37,
      0x30, 0xDB, 0xB5, 0xDC, 0x2C, 0x3A, 0x5C, 0xCE, 0xF5, 0x5A, 0xAB, 0x00,
      0xE9, 0xD3, 0x8C, 0x4A, 0x7C, 0x49, 0x36, 0x84, 0xBF, 0xD0, 0xE0, 0x45,
      0x2C, 0x74, 0xC9, 0x6D, 0x09, 0xDE, 0xA1, 0x33,
  };
  static unsigned char dhg_4096[] = {
      0x02,
  };
  DH *dh;
  BIGNUM *dhp_bn, *dhg_bn;
  if ((dh = DH_new()) == NULL)
    return (NULL);
  dhp_bn = BN_bin2bn(dhp_4096, sizeof(dhp_4096), NULL);
  dhg_bn = BN_bin2bn(dhg_4096, sizeof(dhg_4096), NULL);
  if (!DH_set0_pqg(dh, dhp_bn, NULL, dhg_bn)) {
    DH_free(dh);
    BN_free(dhp_bn);
    BN_free(dhg_bn);
    return (NULL);
  }
  return (dh);
}


x86 assembly (clang, -O0):
<get_dh4096>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <DH_new@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    117a <get_dh4096+0x2a>
movq   $0x0,-0x8(%rbp)
jmp    11fa <get_dh4096+0xaa>
lea    0x2ecf(%rip),%rdi
mov    $0x200,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    %rax,-0x18(%rbp)
lea    0x30b6(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edx
call   1030 <DH_set0_pqg@plt>
cmp    $0x0,%eax
jne    11f2 <get_dh4096+0xa2>
mov    -0x10(%rbp),%rdi
call   1070 <DH_free@plt>
mov    -0x18(%rbp),%rdi
call   1060 <BN_free@plt>
mov    -0x20(%rbp),%rdi
call   1060 <BN_free@plt>
movq   $0x0,-0x8(%rbp)
jmp    11fa <get_dh4096+0xaa>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dh4096>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <DH_new@plt>
test   %rax,%rax
je     11bc <get_dh4096+0x6c>
mov    %rax,%rbx
lea    0x2ee5(%rip),%rdi
mov    $0x200,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %rax,%r14
lea    0x30cf(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
mov    %rax,%rcx
call   1030 <DH_set0_pqg@plt>
test   %eax,%eax
jne    11be <get_dh4096+0x6e>
mov    %rbx,%rdi
call   1070 <DH_free@plt>
mov    %r14,%rdi
call   1060 <BN_free@plt>
mov    %r15,%rdi
call   1060 <BN_free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@get_dh4096.dhp_4096 = internal global [512 x i8] c"\D2\B2^$\83\8E\04\179\AB\99Z\AB\0C\15<\95\E0\E4H?\E4\22H\CA\19\CA\D0\9E\A7\09\D0\97\0F1I\D3\C7lX\A67\13c\0E_\E5\DE\16\8E\B6\EE\1B\12\B3%\90-Q\BF\EE\91i\93~\83\F1\02\D0\DC\D9,\FC\F6>4\B3E)\B8Osh\E99n\FC\C1Z\16\B8\C40\0A)\051o\93\091g\98\A0\12\97]\8A\13\FF}JQ\A3\82\88\FAj\EF\08z\B8\A0g[\B8\0F-J\84\0E\85\94\B7\90\0Dae\89\80\F6\F7\F2(\F3i\8CL\CDO\16\D4{#\1A\BFZ\FC6\D39\14\A2\17\FAey\FC\8D\D0gj6r0G/#\B0/\EA\1F`\BD \A18l\E7k\F1\14.A9\EB\87\91\E2\88\17\88U\07\1C-\A7\BB^\97\0A\10J\17\D6`'\CB\C4\F9\07\AD\A2X\0F\BE\E3\0A\C8\CA\EB].\D7\02\E1/\FC|\D1O\B0e\F0j\ED\DE\EE\D1Ei\89\B6p}2sbF\E4\91\0DY\FD\B18\83i\A8\AF\CF$\10\D2\11k\C3B\F0\F8\B6\C2\B9\F0\B1\0D\1C]\A5\22@\A0\CB:&\D7\D3H\B1\A4\18\96\ED\F0\EB9A]\1C\EE\C4\CA#W\91\BE\1E^x\E7\E4\1Bu\B5|(A-\AE\9F\E7\D3\FD\E6\8D\E7u\7F\8C\FEo\8F\EF)\B9Q\AB\CB7\12\10\D6`\E8\D1\B2\9C>\A9\F5jNC\12F>#C&,\9D\EBsz\0C\D1@X_\E5,\E5\0E\FF\A8a\BD\88\87)\13u1\AAx\8D\ADY\8C\9D\8C\B1\14\C5\C5`\80\B7L\AE\82\A5\C4Z\EEvM|\F0\1B\97pS\CEN8F\15\AF\0D\09\D0\CBH&\A8\88\A4x1\CC$WhRR'Ou\A0Y\D3\8F4\02\B5\D5\9C\F7k\D7\C2Cgm\01\FD\A2\B6\D92\D5\B9J\1B\B8\C8D\8170\DB\B5\DC,:\\\CE\F5Z\AB\00\E9\D3\8CJ|I6\84\BF\D0\E0E,t\C9m\09\DE\A13"
@get_dh4096.dhg_4096 = internal global [1 x i8] c"\02"
define i32* @get_dh4096() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = call i32* (...) @DH_new()
store i32* %5, i32** %2
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %0
store i32* null, i32** %1
br label %25
8: ; preds = %0
%9 = call i32* @BN_bin2bn(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @get_dh4096.dhp_4096, i64 0, i64 0), i32 512, i32* null)
store i32* %9, i32** %3
%10 = call i32* @BN_bin2bn(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @get_dh4096.dhg_4096, i64 0, i64 0), i32 1, i32* null)
store i32* %10, i32** %4
%11 = load i32*, i32** %2
%12 = load i32*, i32** %3
%13 = load i32*, i32** %4
%14 = call i32 @DH_set0_pqg(i32* %11, i32* %12, i32* null, i32* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %23, label %16
16: ; preds = %8
%17 = load i32*, i32** %2
%18 = call i32 @DH_free(i32* %17)
%19 = load i32*, i32** %3
%20 = call i32 @BN_free(i32* %19)
%21 = load i32*, i32** %4
%22 = call i32 @BN_free(i32* %21)
store i32* null, i32** %1
br label %25
23: ; preds = %8
%24 = load i32*, i32** %2
store i32* %24, i32** %1
br label %25
25: ; preds = %23, %16, %7
%26 = load i32*, i32** %1
ret i32* %26
}

LLVM IR (-O2):
@get_dh4096.dhp_4096 = internal global [512 x i8] c"\D2\B2^$\83\8E\04\179\AB\99Z\AB\0C\15<\95\E0\E4H?\E4\22H\CA\19\CA\D0\9E\A7\09\D0\97\0F1I\D3\C7lX\A67\13c\0E_\E5\DE\16\8E\B6\EE\1B\12\B3%\90-Q\BF\EE\91i\93~\83\F1\02\D0\DC\D9,\FC\F6>4\B3E)\B8Osh\E99n\FC\C1Z\16\B8\C40\0A)\051o\93\091g\98\A0\12\97]\8A\13\FF}JQ\A3\82\88\FAj\EF\08z\B8\A0g[\B8\0F-J\84\0E\85\94\B7\90\0Dae\89\80\F6\F7\F2(\F3i\8CL\CDO\16\D4{#\1A\BFZ\FC6\D39\14\A2\17\FAey\FC\8D\D0gj6r0G/#\B0/\EA\1F`\BD \A18l\E7k\F1\14.A9\EB\87\91\E2\88\17\88U\07\1C-\A7\BB^\97\0A\10J\17\D6`'\CB\C4\F9\07\AD\A2X\0F\BE\E3\0A\C8\CA\EB].\D7\02\E1/\FC|\D1O\B0e\F0j\ED\DE\EE\D1Ei\89\B6p}2sbF\E4\91\0DY\FD\B18\83i\A8\AF\CF$\10\D2\11k\C3B\F0\F8\B6\C2\B9\F0\B1\0D\1C]\A5\22@\A0\CB:&\D7\D3H\B1\A4\18\96\ED\F0\EB9A]\1C\EE\C4\CA#W\91\BE\1E^x\E7\E4\1Bu\B5|(A-\AE\9F\E7\D3\FD\E6\8D\E7u\7F\8C\FEo\8F\EF)\B9Q\AB\CB7\12\10\D6`\E8\D1\B2\9C>\A9\F5jNC\12F>#C&,\9D\EBsz\0C\D1@X_\E5,\E5\0E\FF\A8a\BD\88\87)\13u1\AAx\8D\ADY\8C\9D\8C\B1\14\C5\C5`\80\B7L\AE\82\A5\C4Z\EEvM|\F0\1B\97pS\CEN8F\15\AF\0D\09\D0\CBH&\A8\88\A4x1\CC$WhRR'Ou\A0Y\D3\8F4\02\B5\D5\9C\F7k\D7\C2Cgm\01\FD\A2\B6\D92\D5\B9J\1B\B8\C8D\8170\DB\B5\DC,:\\\CE\F5Z\AB\00\E9\D3\8CJ|I6\84\BF\D0\E0E,t\C9m\09\DE\A13"
@get_dh4096.dhg_4096 = internal global [1 x i8] c"\02"
define i32* @get_dh4096() {
%1 = tail call i32* (...) @DH_new()
%2 = icmp eq i32* %1, null
br i1 %2, label %12, label %3
3: ; preds = %0
%4 = tail call i32* @BN_bin2bn(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @get_dh4096.dhp_4096, i64 0, i64 0), i32 512, i32* null)
%5 = tail call i32* @BN_bin2bn(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @get_dh4096.dhg_4096, i64 0, i64 0), i32 1, i32* null)
%6 = tail call i32 @DH_set0_pqg(i32* %1, i32* %4, i32* null, i32* %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = tail call i32 @DH_free(i32* %1)
%10 = tail call i32 @BN_free(i32* %4)
%11 = tail call i32 @BN_free(i32* %5)
br label %12
12: ; preds = %3, %0, %8
%13 = phi i32* [ null, %8 ], [ null, %0 ], [ %1, %3 ]
ret i32* %13
}