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

/* Variables and functions */
int MD5_DIGEST_LENGTH;
char *saslc__crypto_hash_to_hex(unsigned char *);
int saslc__crypto_hmac_md5_hash(unsigned char const *, size_t,
                                unsigned char const *, size_t, unsigned char *);
char *saslc__crypto_hmac_md5_hex(const unsigned char *key, size_t keylen,
                                 const unsigned char *in, size_t inlen) {
  unsigned char digest[MD5_DIGEST_LENGTH];
  if (saslc__crypto_hmac_md5_hash(key, keylen, in, inlen, digest) == -1)
    return NULL;
  return saslc__crypto_hash_to_hex(digest);
}


x86 assembly (clang, -O0):
<saslc__crypto_hmac_md5_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%r8
sub    %rcx,%r8
mov    %r8,-0x48(%rbp)
mov    %r8,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <saslc__crypto_hmac_md5_hash@plt>
cmp    $0xffffffff,%eax
jne    1196 <saslc__crypto_hmac_md5_hex+0x76>
movq   $0x0,-0x8(%rbp)
movl   $0x1,-0x3c(%rbp)
jmp    11aa <saslc__crypto_hmac_md5_hex+0x8a>
mov    -0x48(%rbp),%rdi
call   1030 <saslc__crypto_hash_to_hex@plt>
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saslc__crypto_hmac_md5_hex>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%r8
call   1040 <saslc__crypto_hmac_md5_hash@plt>
cmp    $0xffffffff,%eax
je     1157 <saslc__crypto_hmac_md5_hex+0x37>
mov    %rbx,%rdi
call   1030 <saslc__crypto_hash_to_hex@plt>
jmp    1159 <saslc__crypto_hmac_md5_hex+0x39>
xor    %eax,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@MD5_DIGEST_LENGTH = global i32 0
define i8* @saslc__crypto_hmac_md5_hex(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i64 %3, i64* %9
%13 = load i32, i32* @MD5_DIGEST_LENGTH
%14 = zext i32 %13 to i64
%15 = call i8* @llvm.stacksave()
store i8* %15, i8** %10
%16 = alloca i8, i64 %14
store i64 %14, i64* %11
%17 = load i8*, i8** %6
%18 = load i64, i64* %7
%19 = load i8*, i8** %8
%20 = load i64, i64* %9
%21 = call i32 @saslc__crypto_hmac_md5_hash(i8* %17, i64 %18, i8* %19, i64 %20, i8* %16)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %24
23: ; preds = %4
store i8* null, i8** %5
store i32 1, i32* %12
br label %26
24: ; preds = %4
%25 = call i8* @saslc__crypto_hash_to_hex(i8* %16)
store i8* %25, i8** %5
store i32 1, i32* %12
br label %26
26: ; preds = %24, %23
%27 = load i8*, i8** %10
%28 = load i8*, i8** %5
ret i8* %28
}

LLVM IR (-O2):
@MD5_DIGEST_LENGTH = global i32 0
define i8* @saslc__crypto_hmac_md5_hex(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = load i32, i32* @MD5_DIGEST_LENGTH
%6 = zext i32 %5 to i64
%7 = alloca i8, i64 %6
%8 = call i32 @saslc__crypto_hmac_md5_hash(i8* %0, i64 %1, i8* %2, i64 %3, i8* %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = call i8* @saslc__crypto_hash_to_hex(i8* %7)
br label %12
12: ; preds = %4, %10
%13 = phi i8* [ %11, %10 ], [ null, %4 ]
ret i8* %13
}