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

/* Variables and functions */
int /*<<< orphan*/ ssl_print_hexbuf(int /*<<< orphan*/ *, int, char *, int,
                                    unsigned char const **, size_t *);
int /*<<< orphan*/ ssl_print_version(int /*<<< orphan*/ *, int, char *,
                                     unsigned char const **, size_t *);
int dtls_print_hello_vfyrequest(BIO *bio, int indent, const unsigned char *msg,
                                size_t msglen) {
  if (!ssl_print_version(bio, indent, "server_version", &msg, &msglen))
    return 0;
  if (!ssl_print_hexbuf(bio, indent, "cookie", 1, &msg, &msglen))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<dtls_print_hello_vfyrequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    0xebb(%rip),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1030 <ssl_print_version@plt>
cmp    $0x0,%eax
jne    1167 <dtls_print_hello_vfyrequest+0x47>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <dtls_print_hello_vfyrequest+0x83>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    0xe9a(%rip),%rdx
mov    $0x1,%ecx
lea    -0x20(%rbp),%r8
lea    -0x28(%rbp),%r9
call   1040 <ssl_print_hexbuf@plt>
cmp    $0x0,%eax
jne    119c <dtls_print_hello_vfyrequest+0x7c>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <dtls_print_hello_vfyrequest+0x83>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtls_print_hello_vfyrequest>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,0x10(%rsp)
mov    %rcx,0x8(%rsp)
lea    0xec4(%rip),%rdx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1030 <ssl_print_version@plt>
test   %eax,%eax
je     117a <dtls_print_hello_vfyrequest+0x5a>
lea    0xeb9(%rip),%rdx
lea    0x10(%rsp),%r8
lea    0x8(%rsp),%r9
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%ecx
call   1040 <ssl_print_hexbuf@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
jmp    117c <dtls_print_hello_vfyrequest+0x5c>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"server_version\00"
@.str.1 = [7 x i8] c"cookie\00"
define i32 @dtls_print_hello_vfyrequest(i32* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
store i32* %0, i32** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i64 %3, i64* %9
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = call i32 @ssl_print_version(i32* %10, i32 %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %8, i64* %9)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %4
store i32 0, i32* %5
br label %22
15: ; preds = %4
%16 = load i32*, i32** %6
%17 = load i32, i32* %7
%18 = call i32 @ssl_print_hexbuf(i32* %16, i32 %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 1, i8** %8, i64* %9)
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %15
store i32 0, i32* %5
br label %22
21: ; preds = %15
store i32 1, i32* %5
br label %22
22: ; preds = %21, %20, %14
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
@.str = [15 x i8] c"server_version\00"
@.str.1 = [7 x i8] c"cookie\00"
define i32 @dtls_print_hello_vfyrequest(i32* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
store i8* %2, i8** %5
store i64 %3, i64* %6
%7 = call i32 @ssl_print_version(i32* %0, i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %5, i64* %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = call i32 @ssl_print_hexbuf(i32* %0, i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 1, i8** %5, i64* %6)
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %4
%14 = phi i32 [ 0, %4 ], [ %12, %9 ]
ret i32 %14
}