#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;

/* Variables and functions */
int /*<<< orphan*/ NID_md5;
int /*<<< orphan*/ NID_sha1;
int ssl3_handshake_mac(int /*<<< orphan*/ *, int /*<<< orphan*/, char const *,
                       int, unsigned char *);
int ssl3_final_finish_mac(SSL *s, const char *sender, int len,
                          unsigned char *p) {
  int ret;
  ret = ssl3_handshake_mac(s, NID_md5, sender, len, p);
  p += ret;
  ret += ssl3_handshake_mac(s, NID_sha1, sender, len, p);
  return (ret);
}


x86 assembly (clang, -O0):
<ssl3_final_finish_mac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <ssl3_handshake_mac@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e75(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <ssl3_handshake_mac@plt>
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl3_final_finish_mac>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%rbx
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%r12
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    %rbx,%r8
call   1030 <ssl3_handshake_mac@plt>
movslq %eax,%rbp
add    %rbp,%rbx
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
mov    %r12,%rdi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    %rbx,%r8
call   1030 <ssl3_handshake_mac@plt>
add    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@NID_md5 = global i32 0
@NID_sha1 = global i32 0
define i32 @ssl3_final_finish_mac(i32* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i32*, i32** %5
%11 = load i32, i32* @NID_md5
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = call i32 @ssl3_handshake_mac(i32* %10, i32 %11, i8* %12, i32 %13, i8* %14)
store i32 %15, i32* %9
%16 = load i32, i32* %9
%17 = load i8*, i8** %8
%18 = sext i32 %16 to i64
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8* %19, i8** %8
%20 = load i32*, i32** %5
%21 = load i32, i32* @NID_sha1
%22 = load i8*, i8** %6
%23 = load i32, i32* %7
%24 = load i8*, i8** %8
%25 = call i32 @ssl3_handshake_mac(i32* %20, i32 %21, i8* %22, i32 %23, i8* %24)
%26 = load i32, i32* %9
%27 = add nsw i32 %26, %25
store i32 %27, i32* %9
%28 = load i32, i32* %9
ret i32 %28
}

LLVM IR (-O2):
@NID_md5 = global i32 0
@NID_sha1 = global i32 0
define i32 @ssl3_final_finish_mac(i32* %0, i8* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @NID_md5
%6 = tail call i32 @ssl3_handshake_mac(i32* %0, i32 %5, i8* %1, i32 %2, i8* %3)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
%9 = load i32, i32* @NID_sha1
%10 = tail call i32 @ssl3_handshake_mac(i32* %0, i32 %9, i8* %1, i32 %2, i8* %8)
%11 = add nsw i32 %10, %6
ret i32 %11
}