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

/* Variables and functions */
int /*<<< orphan*/ const *SSLv2_client_method();
int /*<<< orphan*/ const *SSLv3_client_method();
int /*<<< orphan*/ const *TLSv1_client_method();
const char *printableSslMethod(const SSL_METHOD *sslMethod) {
  if (sslMethod == SSLv2_client_method())
    return "SSLv2";
  if (sslMethod == SSLv3_client_method())
    return "SSLv3";
  if (sslMethod == TLSv1_client_method())
    return "TLSv1.0";
  return "unknown SSL_METHOD";
}


x86 assembly (clang, -O0):
<printableSslMethod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <SSLv2_client_method@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jne    116b <printableSslMethod+0x3b>
lea    0xe9e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11d4 <printableSslMethod+0xa4>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <SSLv3_client_method@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jne    119a <printableSslMethod+0x6a>
lea    0xe75(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11d4 <printableSslMethod+0xa4>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <TLSv1_client_method@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jne    11c9 <printableSslMethod+0x99>
lea    0xe4c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11d4 <printableSslMethod+0xa4>
lea    0xe44(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printableSslMethod>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <SSLv2_client_method@plt>
cmp    %rbx,%rax
je     116a <printableSslMethod+0x3a>
xor    %eax,%eax
call   1040 <SSLv3_client_method@plt>
cmp    %rbx,%rax
je     1173 <printableSslMethod+0x43>
xor    %eax,%eax
call   1050 <TLSv1_client_method@plt>
cmp    %rbx,%rax
lea    0xeaf(%rip),%rcx
lea    0xeb0(%rip),%rax
cmove  %rcx,%rax
pop    %rbx
ret
lea    0xe8f(%rip),%rax
pop    %rbx
ret
lea    0xe8c(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"SSLv2\00"
@.str.1 = [6 x i8] c"SSLv3\00"
@.str.2 = [8 x i8] c"TLSv1.0\00"
@.str.3 = [19 x i8] c"unknown SSL_METHOD\00"
define i8* @printableSslMethod(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i32* (...) @SSLv2_client_method()
%6 = icmp eq i32* %4, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
br label %19
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32* (...) @SSLv3_client_method()
%11 = icmp eq i32* %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %19
13: ; preds = %8
%14 = load i32*, i32** %3
%15 = call i32* (...) @TLSv1_client_method()
%16 = icmp eq i32* %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %19
18: ; preds = %13
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"SSLv2\00"
@.str.1 = [6 x i8] c"SSLv3\00"
@.str.2 = [8 x i8] c"TLSv1.0\00"
@.str.3 = [19 x i8] c"unknown SSL_METHOD\00"
define i8* @printableSslMethod(i32* readnone %0) {
%2 = tail call i32* (...) @SSLv2_client_method()
%3 = icmp eq i32* %2, %0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32* (...) @SSLv3_client_method()
%6 = icmp eq i32* %5, %0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i32* (...) @TLSv1_client_method()
%9 = icmp eq i32* %8, %0
%10 = select i1 %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0)
br label %11
11: ; preds = %7, %4, %1
%12 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %4 ], [ %10, %7 ]
ret i8* %12
}