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

/* Variables and functions */
int /*<<< orphan*/ RSA_PKCS1_PADDING;
int /*<<< orphan*/ RSA_private_decrypt(int, char *, char *,
                                       int /*<<< orphan*/ *,
                                       int /*<<< orphan*/);
void decrypt_msg(char *buffer, RSA *keypair) {
  char dec[256];
  for (int i = 0; i < 256; ++i)
    dec[i] = buffer[i];
  RSA_private_decrypt(256, buffer, dec, keypair, RSA_PKCS1_PADDING);
}


x86 assembly (clang, -O0):
<decrypt_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x114(%rbp)
cmpl   $0x100,-0x114(%rbp)
jge    116d <decrypt_msg+0x5d>
mov    -0x8(%rbp),%rax
movslq -0x114(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x114(%rbp),%rax
mov    %cl,-0x110(%rbp,%rax,1)
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    112d <decrypt_msg+0x1d>
mov    -0x8(%rbp),%rsi
lea    -0x110(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    0x2e55(%rip),%rax
mov    (%rax),%r8d
mov    $0x100,%edi
call   1030 <RSA_private_decrypt@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt_msg>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    $0x100,%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <memcpy@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%r8d
mov    $0x100,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <RSA_private_decrypt@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@RSA_PKCS1_PADDING = global i32 0
define void @decrypt_msg(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca [256 x i8]
%6 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 256
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %17
store i8 %15, i8* %18
br label %19
19: ; preds = %10
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
%23 = load i8*, i8** %3
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%25 = load i32*, i32** %4
%26 = load i32, i32* @RSA_PKCS1_PADDING
%27 = call i32 @RSA_private_decrypt(i32 256, i8* %23, i8* %24, i32* %25, i32 %26)
ret void
}

LLVM IR (-O2):
@RSA_PKCS1_PADDING = global i32 0
define void @decrypt_msg(i8* %0, i32* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* @RSA_PKCS1_PADDING
%7 = call i32 @RSA_private_decrypt(i32 256, i8* %0, i8* %5, i32* %1, i32 %6)
ret void
}