#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 */

/* Variables and functions */
int /*<<< orphan*/ RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE;
int /*<<< orphan*/ RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE;
int /*<<< orphan*/ RSAerror(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
int RSA_padding_add_none(unsigned char *to, int tlen, const unsigned char *from,
                         int flen) {
  if (flen > tlen) {
    RSAerror(RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE);
    return 0;
  }
  if (flen < tlen) {
    RSAerror(RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE);
    return 0;
  }
  memcpy(to, from, flen);
  return 1;
}


x86 assembly (clang, -O0):
<RSA_padding_add_none>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    115c <RSA_padding_add_none+0x3c>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <RSAerror@plt>
movl   $0x0,-0x4(%rbp)
jmp    1199 <RSA_padding_add_none+0x79>
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1182 <RSA_padding_add_none+0x62>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1040 <RSAerror@plt>
movl   $0x0,-0x4(%rbp)
jmp    1199 <RSA_padding_add_none+0x79>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <memcpy@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA_padding_add_none>:
push   %rax
cmp    %esi,%ecx
jle    112e <RSA_padding_add_none+0xe>
mov    0x2ebc(%rip),%rax
jmp    1137 <RSA_padding_add_none+0x17>
jge    1142 <RSA_padding_add_none+0x22>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <RSAerror@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <memcpy@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE = global i32 0
@RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE = global i32 0
define i32 @RSA_padding_add_none(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%10 = load i32, i32* %9
%11 = load i32, i32* %7
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %4
%14 = load i32, i32* @RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE
%15 = call i32 @RSAerror(i32 %14)
store i32 0, i32* %5
br label %28
16: ; preds = %4
%17 = load i32, i32* %9
%18 = load i32, i32* %7
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32, i32* @RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE
%22 = call i32 @RSAerror(i32 %21)
store i32 0, i32* %5
br label %28
23: ; preds = %16
%24 = load i8*, i8** %6
%25 = load i8*, i8** %8
%26 = load i32, i32* %9
%27 = call i32 @memcpy(i8* %24, i8* %25, i32 %26)
store i32 1, i32* %5
br label %28
28: ; preds = %23, %20, %13
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
@RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE = global i32 0
@RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE = global i32 0
define i32 @RSA_padding_add_none(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp sgt i32 %3, %1
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = load i32, i32* @RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE
%8 = tail call i32 @RSAerror(i32 %7)
br label %16
9: ; preds = %4
%10 = icmp slt i32 %3, %1
br i1 %10, label %11, label %14
11: ; preds = %9
%12 = load i32, i32* @RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE
%13 = tail call i32 @RSAerror(i32 %12)
br label %16
14: ; preds = %9
%15 = tail call i32 @memcpy(i8* %0, i8* %2, i32 %3)
br label %16
16: ; preds = %14, %11, %6
%17 = phi i32 [ 0, %6 ], [ 0, %11 ], [ 1, %14 ]
ret i32 %17
}