#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_2048;
typedef int /*<<< orphan*/ dhg_2048;
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_dh2048() {
  static unsigned char dhp_2048[] = {
      0xC8, 0xF1, 0xD4, 0x48, 0xB6, 0x11, 0x5B, 0x2B, 0x9E, 0x3D, 0xE4, 0x49,
      0x0A, 0xC4, 0x8A, 0x0B, 0xFF, 0xAC, 0x09, 0x4F, 0x88, 0x91, 0x08, 0xB8,
      0x7D, 0x71, 0xB7, 0x7D, 0x87, 0x44, 0x09, 0x70, 0x15, 0xFF, 0x0C, 0xAF,
      0x9D, 0xCD, 0xC0, 0x19, 0x67, 0xC2, 0x4D, 0xF3, 0x8E, 0x95, 0x4E, 0x60,
      0xA3, 0x99, 0xC2, 0x94, 0x39, 0x0A, 0xAE, 0x7D, 0x71, 0x88, 0x87, 0xBE,
      0x53, 0x39, 0x86, 0x5B, 0xEE, 0xA4, 0xC1, 0xA4, 0x9B, 0x33, 0x19, 0xCD,
      0x64, 0xFB, 0x30, 0xA1, 0x87, 0xA7, 0x07, 0x2D, 0x34, 0x82, 0xD8, 0xE6,
      0xF1, 0xBB, 0x9F, 0x3D, 0xA7, 0x45, 0x97, 0x42, 0xAE, 0x1A, 0x46, 0x55,
      0xA6, 0x67, 0x18, 0x70, 0x60, 0x5B, 0xCA, 0x0D, 0x21, 0xF0, 0xEB, 0xF3,
      0xF5, 0x68, 0xED, 0x61, 0xC0, 0x51, 0x4E, 0x28, 0x24, 0x9E, 0x77, 0x23,
      0x7C, 0xD1, 0xE5, 0x5A, 0x0A, 0xEF, 0xC7, 0xCC, 0x0E, 0x86, 0xA8, 0xBC,
      0x92, 0x9F, 0x8C, 0xA5, 0xE8, 0xBD, 0x75, 0xB7, 0x7F, 0x75, 0x81, 0x56,
      0xD2, 0xF9, 0x68, 0xA9, 0x98, 0x98, 0x3D, 0xA8, 0xBC, 0xBC, 0xD4, 0x81,
      0xD9, 0xBE, 0x0F, 0x09, 0x25, 0x47, 0x43, 0xB8, 0xEB, 0x5C, 0xE4, 0xA0,
      0x10, 0x57, 0xEF, 0xD8, 0xDB, 0x6A, 0x01, 0xD0, 0x2A, 0x7D, 0xCC, 0x27,
      0x8A, 0x81, 0x1C, 0xEA, 0xDF, 0x21, 0xBF, 0xA1, 0xF0, 0xBF, 0xC1, 0xA1,
      0x12, 0xFF, 0xB2, 0xAD, 0x4F, 0x41, 0xF5, 0x82, 0x9D, 0xC0, 0xEE, 0x2D,
      0x1C, 0x56, 0x2E, 0x90, 0x33, 0x70, 0x1A, 0xFE, 0x6D, 0xBC, 0xA4, 0x8D,
      0x89, 0x1A, 0x18, 0xAB, 0xA9, 0xAB, 0xBD, 0x1D, 0xA6, 0x57, 0xD7, 0x77,
      0x59, 0xD6, 0x7C, 0xC7, 0xEB, 0x34, 0x2F, 0xD8, 0x53, 0x30, 0x1A, 0x2E,
      0x7C, 0x83, 0xB9, 0x40, 0x7A, 0x2E, 0xA4, 0x1D, 0x85, 0x68, 0x69, 0x66,
      0xF8, 0xAA, 0x70, 0x6B,
  };
  static unsigned char dhg_2048[] = {
      0x02,
  };
  DH *dh;
  BIGNUM *dhp_bn, *dhg_bn;
  if ((dh = DH_new()) == NULL)
    return (NULL);
  dhp_bn = BN_bin2bn(dhp_2048, sizeof(dhp_2048), NULL);
  dhg_bn = BN_bin2bn(dhg_2048, sizeof(dhg_2048), 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_dh2048>:
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_dh2048+0x2a>
movq   $0x0,-0x8(%rbp)
jmp    11fa <get_dh2048+0xaa>
lea    0x2ecf(%rip),%rdi
mov    $0x100,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    %rax,-0x18(%rbp)
lea    0x2fb6(%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_dh2048+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_dh2048+0xaa>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dh2048>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <DH_new@plt>
test   %rax,%rax
je     11bc <get_dh2048+0x6c>
mov    %rax,%rbx
lea    0x2ee5(%rip),%rdi
mov    $0x100,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %rax,%r14
lea    0x2fcf(%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_dh2048+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_dh2048.dhp_2048 = internal global [256 x i8] c"\C8\F1\D4H\B6\11[+\9E=\E4I\0A\C4\8A\0B\FF\AC\09O\88\91\08\B8}q\B7}\87D\09p\15\FF\0C\AF\9D\CD\C0\19g\C2M\F3\8E\95N`\A3\99\C2\949\0A\AE}q\88\87\BES9\86[\EE\A4\C1\A4\9B3\19\CDd\FB0\A1\87\A7\07-4\82\D8\E6\F1\BB\9F=\A7E\97B\AE\1AFU\A6g\18p`[\CA\0D!\F0\EB\F3\F5h\EDa\C0QN($\9Ew#|\D1\E5Z\0A\EF\C7\CC\0E\86\A8\BC\92\9F\8C\A5\E8\BDu\B7\7Fu\81V\D2\F9h\A9\98\98=\A8\BC\BC\D4\81\D9\BE\0F\09%GC\B8\EB\\\E4\A0\10W\EF\D8\DBj\01\D0*}\CC'\8A\81\1C\EA\DF!\BF\A1\F0\BF\C1\A1\12\FF\B2\ADOA\F5\82\9D\C0\EE-\1CV.\903p\1A\FEm\BC\A4\8D\89\1A\18\AB\A9\AB\BD\1D\A6W\D7wY\D6|\C7\EB4/\D8S0\1A.|\83\B9@z.\A4\1D\85hif\F8\AApk"
@get_dh2048.dhg_2048 = internal global [1 x i8] c"\02"
define i32* @get_dh2048() {
%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 ([256 x i8], [256 x i8]* @get_dh2048.dhp_2048, i64 0, i64 0), i32 256, i32* null)
store i32* %9, i32** %3
%10 = call i32* @BN_bin2bn(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @get_dh2048.dhg_2048, 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_dh2048.dhp_2048 = internal global [256 x i8] c"\C8\F1\D4H\B6\11[+\9E=\E4I\0A\C4\8A\0B\FF\AC\09O\88\91\08\B8}q\B7}\87D\09p\15\FF\0C\AF\9D\CD\C0\19g\C2M\F3\8E\95N`\A3\99\C2\949\0A\AE}q\88\87\BES9\86[\EE\A4\C1\A4\9B3\19\CDd\FB0\A1\87\A7\07-4\82\D8\E6\F1\BB\9F=\A7E\97B\AE\1AFU\A6g\18p`[\CA\0D!\F0\EB\F3\F5h\EDa\C0QN($\9Ew#|\D1\E5Z\0A\EF\C7\CC\0E\86\A8\BC\92\9F\8C\A5\E8\BDu\B7\7Fu\81V\D2\F9h\A9\98\98=\A8\BC\BC\D4\81\D9\BE\0F\09%GC\B8\EB\\\E4\A0\10W\EF\D8\DBj\01\D0*}\CC'\8A\81\1C\EA\DF!\BF\A1\F0\BF\C1\A1\12\FF\B2\ADOA\F5\82\9D\C0\EE-\1CV.\903p\1A\FEm\BC\A4\8D\89\1A\18\AB\A9\AB\BD\1D\A6W\D7wY\D6|\C7\EB4/\D8S0\1A.|\83\B9@z.\A4\1D\85hif\F8\AApk"
@get_dh2048.dhg_2048 = internal global [1 x i8] c"\02"
define i32* @get_dh2048() {
%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 ([256 x i8], [256 x i8]* @get_dh2048.dhp_2048, i64 0, i64 0), i32 256, i32* null)
%5 = tail call i32* @BN_bin2bn(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @get_dh2048.dhg_2048, 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
}