#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_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ *s;
  int /*<<< orphan*/ *v;
};
typedef TYPE_1__ SRP_user_pwd;

/* Variables and functions */
void *BN_bin2bn(unsigned char *, int, int /*<<< orphan*/ *);
int strlen(char const *);
int t_fromb64(unsigned char *, char const *);
int SRP_user_pwd_set_sv(SRP_user_pwd *vinfo, const char *s, const char *v) {
  unsigned char tmp[2500];
  int len;
  if (strlen(s) > 2500 || strlen(v) > 2500)
    return 0;
  len = t_fromb64(tmp, v);
  if (NULL == (vinfo->v = BN_bin2bn(tmp, len, NULL)))
    return 0;
  len = t_fromb64(tmp, s);
  return ((vinfo->s = BN_bin2bn(tmp, len, NULL)) != NULL);
}


x86 assembly (clang, -O0):
<SRP_user_pwd_set_sv>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa00,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x9c4,%eax
jg     116f <SRP_user_pwd_set_sv+0x3f>
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x9c4,%eax
jle    117b <SRP_user_pwd_set_sv+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    120b <SRP_user_pwd_set_sv+0xdb>
lea    -0x9f0(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <t_fromb64@plt>
mov    %eax,-0x9f4(%rbp)
lea    -0x9f0(%rbp),%rdi
mov    -0x9f4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
xor    %eax,%eax
cmp    %rcx,%rax
jne    11c9 <SRP_user_pwd_set_sv+0x99>
movl   $0x0,-0x4(%rbp)
jmp    120b <SRP_user_pwd_set_sv+0xdb>
lea    -0x9f0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <t_fromb64@plt>
mov    %eax,-0x9f4(%rbp)
lea    -0x9f0(%rbp),%rdi
mov    -0x9f4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <BN_bin2bn@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa00,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SRP_user_pwd_set_sv>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9d0,%rsp
mov    %rdx,%r12
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
xor    %ebx,%ebx
cmp    $0x9c4,%eax
jg     11b3 <SRP_user_pwd_set_sv+0x83>
mov    %r12,%rdi
call   1030 <strlen@plt>
cmp    $0x9c4,%eax
jg     11b3 <SRP_user_pwd_set_sv+0x83>
mov    %rsp,%r13
mov    %r13,%rdi
mov    %r12,%rsi
call   1050 <t_fromb64@plt>
xor    %ebx,%ebx
mov    %r13,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %rax,0x8(%r14)
test   %rax,%rax
je     11b3 <SRP_user_pwd_set_sv+0x83>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <t_fromb64@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <BN_bin2bn@plt>
mov    %rax,(%r14)
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x9d0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32*, i32* }
define i32 @SRP_user_pwd_set_sv(%struct.TYPE_3__* nocapture writeonly %0, i8* %1, i8* %2) {
%4 = alloca [2500 x i8]
%5 = getelementptr inbounds [2500 x i8], [2500 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @strlen(i8* %1)
%7 = icmp sgt i32 %6, 2500
br i1 %7, label %23, label %8
8: ; preds = %3
%9 = tail call i32 @strlen(i8* %2)
%10 = icmp sgt i32 %9, 2500
br i1 %10, label %23, label %11
11: ; preds = %8
%12 = call i32 @t_fromb64(i8* %5, i8* %2)
%13 = call i8* @BN_bin2bn(i8* %5, i32 %12, i32* null)
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%15 = bitcast i32** %14 to i8**
store i8* %13, i8** %15
%16 = icmp eq i8* %13, null
br i1 %16, label %23, label %17
17: ; preds = %11
%18 = call i32 @t_fromb64(i8* %5, i8* %1)
%19 = call i8* @BN_bin2bn(i8* %5, i32 %18, i32* null)
%20 = bitcast %struct.TYPE_3__* %0 to i8**
store i8* %19, i8** %20
%21 = icmp ne i8* %19, null
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %11, %3, %8, %17
%24 = phi i32 [ %22, %17 ], [ 0, %8 ], [ 0, %3 ], [ 0, %11 ]
ret i32 %24
}