#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*/ tls1_handshake_hash_update(int /*<<< orphan*/ *,
                                              unsigned char const *, size_t);
int /*<<< orphan*/ tls1_transcript_append(int /*<<< orphan*/ *,
                                          unsigned char const *, size_t);
int tls1_transcript_record(SSL *s, const unsigned char *buf, size_t len) {
  if (!tls1_handshake_hash_update(s, buf, len))
    return 0;
  if (!tls1_transcript_append(s, buf, len))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<tls1_transcript_record>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <tls1_handshake_hash_update@plt>
cmp    $0x0,%eax
jne    115a <tls1_transcript_record+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1187 <tls1_transcript_record+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <tls1_transcript_append@plt>
cmp    $0x0,%eax
jne    1180 <tls1_transcript_record+0x60>
movl   $0x0,-0x4(%rbp)
jmp    1187 <tls1_transcript_record+0x67>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tls1_transcript_record>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <tls1_handshake_hash_update@plt>
test   %eax,%eax
je     1150 <tls1_transcript_record+0x30>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <tls1_transcript_append@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
jmp    1152 <tls1_transcript_record+0x32>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @tls1_transcript_record(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i64
store i32* %0, i32** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i32*, i32** %5
%9 = load i8*, i8** %6
%10 = load i64, i64* %7
%11 = call i32 @tls1_handshake_hash_update(i32* %8, i8* %9, i64 %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %3
store i32 0, i32* %4
br label %22
14: ; preds = %3
%15 = load i32*, i32** %5
%16 = load i8*, i8** %6
%17 = load i64, i64* %7
%18 = call i32 @tls1_transcript_append(i32* %15, i8* %16, i64 %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %14
store i32 0, i32* %4
br label %22
21: ; preds = %14
store i32 1, i32* %4
br label %22
22: ; preds = %21, %20, %13
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @tls1_transcript_record(i32* %0, i8* %1, i64 %2) {
%4 = tail call i32 @tls1_handshake_hash_update(i32* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @tls1_transcript_append(i32* %0, i8* %1, i64 %2)
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 0, %3 ], [ %9, %6 ]
ret i32 %11
}