#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;
typedef int /*<<< orphan*/ EVP_MD_CTX;

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


x86 assembly (clang, -O0):
<ssl3_final_finish_mac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x30(%rbp),%r8
call   1030 <ssl3_handshake_mac@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x30(%rbp),%r8
call   1030 <ssl3_handshake_mac@plt>
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl3_final_finish_mac>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%rbx
mov    %r8d,%r14d
mov    %rcx,%r12
mov    %rdx,%r15
mov    %rdi,%rbp
mov    %rcx,%rdx
mov    %r8d,%ecx
mov    %r9,%r8
call   1030 <ssl3_handshake_mac@plt>
movslq %eax,%r13
add    %r13,%rbx
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r14d,%ecx
mov    %rbx,%r8
call   1030 <ssl3_handshake_mac@plt>
add    %r13d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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