#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 */
typedef struct TYPE_6__ TYPE_1__;

/* Type definitions */
struct TYPE_6__ {
  struct TYPE_6__ *b64_bn;
  int /*<<< orphan*/ bn;
};
typedef TYPE_1__ SRP_gN_cache;

/* Variables and functions */
int /*<<< orphan*/ BN_bin2bn(unsigned char *, int, int /*<<< orphan*/ *);
TYPE_1__ *BUF_strdup(char const *);
int /*<<< orphan*/ free(TYPE_1__ *);
TYPE_1__ *malloc(int);
int t_fromb64(unsigned char *, char const *);
SRP_gN_cache *SRP_gN_new_init(const char *ch) {
  unsigned char tmp[2500];
  int len;
  SRP_gN_cache *newgN = malloc(sizeof(SRP_gN_cache));
  if (newgN == NULL)
    return NULL;
  if ((newgN->b64_bn = BUF_strdup(ch)) == NULL)
    goto err;
  len = t_fromb64(tmp, ch);
  if ((newgN->bn = BN_bin2bn(tmp, len, NULL)))
    return newgN;
  free(newgN->b64_bn);
err:
  free(newgN);
  return NULL;
}


x86 assembly (clang, -O0):
<SRP_gN_new_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9f0,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x10,%edi
call   1050 <malloc@plt>
mov    %rax,-0x9f0(%rbp)
cmpq   $0x0,-0x9f0(%rbp)
jne    118b <SRP_gN_new_init+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    121f <SRP_gN_new_init+0xcf>
mov    -0x10(%rbp),%rdi
call   1060 <BUF_strdup@plt>
mov    -0x9f0(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    11ad <SRP_gN_new_init+0x5d>
jmp    120b <SRP_gN_new_init+0xbb>
lea    -0x9e0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1070 <t_fromb64@plt>
mov    %eax,-0x9e4(%rbp)
lea    -0x9e0(%rbp),%rdi
mov    -0x9e4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    -0x9f0(%rbp),%rcx
mov    %eax,0x8(%rcx)
cmp    $0x0,%eax
je     11fc <SRP_gN_new_init+0xac>
mov    -0x9f0(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    121f <SRP_gN_new_init+0xcf>
mov    -0x9f0(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x9f0(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x9f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SRP_gN_new_init>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x9c8,%rsp
mov    %rdi,%r15
mov    $0x10,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     11b7 <SRP_gN_new_init+0x67>
mov    %rax,%rbx
mov    %r15,%rdi
call   1060 <BUF_strdup@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     11af <SRP_gN_new_init+0x5f>
mov    %rax,%r14
mov    %rsp,%r12
mov    %r12,%rdi
mov    %r15,%rsi
call   1070 <t_fromb64@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %eax,0x8(%rbx)
test   %eax,%eax
jne    11b9 <SRP_gN_new_init+0x69>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x9c8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TYPE_6__ = type { %struct.TYPE_6__*, i32 }
define %struct.TYPE_6__* @SRP_gN_new_init(i8* %0) {
%2 = alloca %struct.TYPE_6__*
%3 = alloca i8*
%4 = alloca [2500 x i8]
%5 = alloca i32
%6 = alloca %struct.TYPE_6__*
store i8* %0, i8** %3
%7 = call %struct.TYPE_6__* @malloc(i32 16)
store %struct.TYPE_6__* %7, %struct.TYPE_6__** %6
%8 = load %struct.TYPE_6__*, %struct.TYPE_6__** %6
%9 = icmp eq %struct.TYPE_6__* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store %struct.TYPE_6__* null, %struct.TYPE_6__** %2
br label %38
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call %struct.TYPE_6__* @BUF_strdup(i8* %12)
%14 = load %struct.TYPE_6__*, %struct.TYPE_6__** %6
%15 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %14, i32 0, i32 0
store %struct.TYPE_6__* %13, %struct.TYPE_6__** %15
%16 = icmp eq %struct.TYPE_6__* %13, null
br i1 %16, label %17, label %18
17: ; preds = %11
br label %35
18: ; preds = %11
%19 = getelementptr inbounds [2500 x i8], [2500 x i8]* %4, i64 0, i64 0
%20 = load i8*, i8** %3
%21 = call i32 @t_fromb64(i8* %19, i8* %20)
store i32 %21, i32* %5
%22 = getelementptr inbounds [2500 x i8], [2500 x i8]* %4, i64 0, i64 0
%23 = load i32, i32* %5
%24 = call i32 @BN_bin2bn(i8* %22, i32 %23, i32* null)
%25 = load %struct.TYPE_6__*, %struct.TYPE_6__** %6
%26 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %25, i32 0, i32 1
store i32 %24, i32* %26
%27 = icmp ne i32 %24, 0
br i1 %27, label %28, label %30
28: ; preds = %18
%29 = load %struct.TYPE_6__*, %struct.TYPE_6__** %6
store %struct.TYPE_6__* %29, %struct.TYPE_6__** %2
br label %38
30: ; preds = %18
%31 = load %struct.TYPE_6__*, %struct.TYPE_6__** %6
%32 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %31, i32 0, i32 0
%33 = load %struct.TYPE_6__*, %struct.TYPE_6__** %32
%34 = call i32 @free(%struct.TYPE_6__* %33)
br label %35
35: ; preds = %30, %17
%36 = load %struct.TYPE_6__*, %struct.TYPE_6__** %6
%37 = call i32 @free(%struct.TYPE_6__* %36)
store %struct.TYPE_6__* null, %struct.TYPE_6__** %2
br label %38
38: ; preds = %35, %28, %10
%39 = load %struct.TYPE_6__*, %struct.TYPE_6__** %2
ret %struct.TYPE_6__* %39
}

LLVM IR (-O2):
%struct.TYPE_6__ = type { %struct.TYPE_6__*, i32 }
define noalias %struct.TYPE_6__* @SRP_gN_new_init(i8* %0) {
%2 = alloca [2500 x i8]
%3 = getelementptr inbounds [2500 x i8], [2500 x i8]* %2, i64 0, i64 0
%4 = tail call %struct.TYPE_6__* @malloc(i32 16)
%5 = icmp eq %struct.TYPE_6__* %4, null
br i1 %5, label %19, label %6
6: ; preds = %1
%7 = tail call %struct.TYPE_6__* @BUF_strdup(i8* %0)
%8 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %4, i64 0, i32 0
store %struct.TYPE_6__* %7, %struct.TYPE_6__** %8
%9 = icmp eq %struct.TYPE_6__* %7, null
br i1 %9, label %17, label %10
10: ; preds = %6
%11 = call i32 @t_fromb64(i8* %3, i8* %0)
%12 = call i32 @BN_bin2bn(i8* %3, i32 %11, i32* null)
%13 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %4, i64 0, i32 1
store i32 %12, i32* %13
%14 = icmp eq i32 %12, 0
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = call i32 @free(%struct.TYPE_6__* %7)
br label %17
17: ; preds = %6, %15
%18 = call i32 @free(%struct.TYPE_6__* %4)
br label %19
19: ; preds = %10, %1, %17
%20 = phi %struct.TYPE_6__* [ null, %17 ], [ null, %1 ], [ %4, %10 ]
ret %struct.TYPE_6__* %20
}