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

/* Variables and functions */
int /*<<< orphan*/ EVP_md5();
int /*<<< orphan*/ HMAC(int /*<<< orphan*/, int /*<<< orphan*/ *, int,
                        int /*<<< orphan*/ const *, int, int /*<<< orphan*/ *,
                        int /*<<< orphan*/ *);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ ntlmv2_create_hash(int /*<<< orphan*/ const *, char const *,
                                      char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void lmv2_create_session_key(const uint8_t ntlm[16], const char *username,
                             const char *domain,
                             const uint8_t lmv2_response[16],
                             uint8_t result[16]) {
  uint8_t v2hash[16];
  ntlmv2_create_hash(ntlm, username, domain, v2hash);
  HMAC(EVP_md5(), v2hash, 16, lmv2_response, 16, result, NULL);
  {
    fprintf(
        stderr, "Unrecoverable error in %s(%d): %s\n\n",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/iagox86/nbtool/refs/heads/master/crypto.c",
        252, "This function doesn't work.");
    abort();
  };
}


x86 assembly (clang, -O0):
<lmv2_create_session_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x70(%rbp),%rcx
call   1070 <ntlmv2_create_hash@plt>
mov    $0x0,%al
call   1040 <EVP_md5@plt>
mov    %eax,%edi
lea    -0x70(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r9
mov    $0x10,%r8d
xor    %eax,%eax
mov    %r8d,%edx
movq   $0x0,(%rsp)
call   1060 <HMAC@plt>
mov    0x2e28(%rip),%rax
mov    (%rax),%edi
lea    0xe3f(%rip),%rsi
lea    0xe5c(%rip),%rdx
mov    $0xfc,%ecx
lea    0xed4(%rip),%r8
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<lmv2_create_session_key>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %r8,%r14
mov    %rcx,%rbx
lea    0x10(%rsp),%r15
mov    %r15,%rcx
call   1070 <ntlmv2_create_hash@plt>
xor    %eax,%eax
call   1040 <EVP_md5@plt>
movq   $0x0,(%rsp)
mov    %eax,%edi
mov    %r15,%rsi
mov    $0x10,%edx
mov    %rbx,%rcx
mov    $0x10,%r8d
mov    %r14,%r9
call   1060 <HMAC@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
lea    0xe5a(%rip),%rsi
lea    0xe77(%rip),%rdx
lea    0xef4(%rip),%r8
mov    $0xfc,%ecx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Unrecoverable error in %s(%d): %s\0A\0A\00"
@.str.1 = [132 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/iagox86/nbtool/refs/heads/master/crypto.c\00"
@.str.2 = [28 x i8] c"This function doesn't work.\00"
define void @lmv2_create_session_key(i32* %0, i8* %1, i8* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca [16 x i32]
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%12 = load i32*, i32** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 0
%16 = call i32 @ntlmv2_create_hash(i32* %12, i8* %13, i8* %14, i32* %15)
%17 = call i32 (...) @EVP_md5()
%18 = getelementptr inbounds [16 x i32], [16 x i32]* %11, i64 0, i64 0
%19 = load i32*, i32** %9
%20 = load i32*, i32** %10
%21 = call i32 @HMAC(i32 %17, i32* %18, i32 16, i32* %19, i32 16, i32* %20, i32* null)
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str.1, i64 0, i64 0), i32 252, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Unrecoverable error in %s(%d): %s\0A\0A\00"
@.str.1 = [132 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/iagox86/nbtool/refs/heads/master/crypto.c\00"
@.str.2 = [28 x i8] c"This function doesn't work.\00"
define void @lmv2_create_session_key(i32* %0, i8* %1, i8* %2, i32* %3, i32* %4) {
%6 = alloca [16 x i32]
%7 = bitcast [16 x i32]* %6 to i8*
%8 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 0
%9 = call i32 @ntlmv2_create_hash(i32* %0, i8* %1, i8* %2, i32* %8)
%10 = call i32 (...) @EVP_md5()
%11 = call i32 @HMAC(i32 %10, i32* %8, i32 16, i32* %3, i32 16, i32* %4, i32* null)
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str.1, i64 0, i64 0), i32 252, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (...) @abort()
unreachable
}