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

/* Variables and functions */
int /*<<< orphan*/ *EVP_get_cipherbyname(char const *);
int /*<<< orphan*/ test1(int /*<<< orphan*/ const *, unsigned char const *, int,
                         unsigned char const *, int, unsigned char const *, int,
                         unsigned char const *, int, int, int);
int test_cipher(const char *cipher, const unsigned char *key, int kn,
                const unsigned char *iv, int in, const unsigned char *plaintext,
                int pn, const unsigned char *ciphertext, int cn, int encdec,
                int multiplier) {
  const EVP_CIPHER *c;
  c = EVP_get_cipherbyname(cipher);
  if (!c)
    return 0;
  test1(c, key, kn, iv, in, plaintext, pn, ciphertext, cn, encdec, multiplier);
  return 1;
}


x86 assembly (clang, -O0):
<test_cipher>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8d,-0x3c(%rbp)
mov    %r9,-0x48(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <EVP_get_cipherbyname@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1176 <test_cipher+0x56>
movl   $0x0,-0x14(%rbp)
jmp    11c3 <test_cipher+0xa3>
mov    -0x50(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
mov    -0x38(%rbp),%rcx
mov    -0x3c(%rbp),%r8d
mov    -0x48(%rbp),%r9
mov    0x10(%rbp),%r14d
mov    0x18(%rbp),%rbx
mov    0x20(%rbp),%r11d
mov    0x28(%rbp),%r10d
mov    0x30(%rbp),%eax
mov    %r14d,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1030 <test1@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cipher>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8d,%r15d
mov    %rcx,%r12
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <EVP_get_cipherbyname@plt>
test   %rax,%rax
je     1186 <test_cipher+0x66>
mov    0x60(%rsp),%r10d
mov    0x58(%rsp),%r11d
mov    0x50(%rsp),%r13d
sub    $0x8,%rsp
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r12,%rcx
mov    %r15d,%r8d
mov    %r14,%r9
push   %r10
push   %r11
push   %r13
push   0x68(%rsp)
mov    0x68(%rsp),%eax
push   %rax
call   1030 <test1@plt>
add    $0x30,%rsp
mov    $0x1,%eax
jmp    1188 <test_cipher+0x68>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @test_cipher(i8* %0, i8* %1, i32 %2, i8* %3, i32 %4, i8* %5, i32 %6, i8* %7, i32 %8, i32 %9, i32 %10) {
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i32
%20 = alloca i8*
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32*
store i8* %0, i8** %13
store i8* %1, i8** %14
store i32 %2, i32* %15
store i8* %3, i8** %16
store i32 %4, i32* %17
store i8* %5, i8** %18
store i32 %6, i32* %19
store i8* %7, i8** %20
store i32 %8, i32* %21
store i32 %9, i32* %22
store i32 %10, i32* %23
%25 = load i8*, i8** %13
%26 = call i32* @EVP_get_cipherbyname(i8* %25)
store i32* %26, i32** %24
%27 = load i32*, i32** %24
%28 = icmp ne i32* %27, null
br i1 %28, label %30, label %29
29: ; preds = %11
store i32 0, i32* %12
br label %43
30: ; preds = %11
%31 = load i32*, i32** %24
%32 = load i8*, i8** %14
%33 = load i32, i32* %15
%34 = load i8*, i8** %16
%35 = load i32, i32* %17
%36 = load i8*, i8** %18
%37 = load i32, i32* %19
%38 = load i8*, i8** %20
%39 = load i32, i32* %21
%40 = load i32, i32* %22
%41 = load i32, i32* %23
%42 = call i32 @test1(i32* %31, i8* %32, i32 %33, i8* %34, i32 %35, i8* %36, i32 %37, i8* %38, i32 %39, i32 %40, i32 %41)
store i32 1, i32* %12
br label %43
43: ; preds = %30, %29
%44 = load i32, i32* %12
ret i32 %44
}

LLVM IR (-O2):
define i32 @test_cipher(i8* %0, i8* %1, i32 %2, i8* %3, i32 %4, i8* %5, i32 %6, i8* %7, i32 %8, i32 %9, i32 %10) {
%12 = tail call i32* @EVP_get_cipherbyname(i8* %0)
%13 = icmp eq i32* %12, null
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 @test1(i32* %12, i8* %1, i32 %2, i8* %3, i32 %4, i8* %5, i32 %6, i8* %7, i32 %8, i32 %9, i32 %10)
br label %16
16: ; preds = %11, %14
%17 = phi i32 [ 1, %14 ], [ 0, %11 ]
ret i32 %17
}