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

/* Variables and functions */
int /*<<< orphan*/ MD4_Final(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ MD4_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ MD4_Update(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ stderr;
int strlen(char const *);
char *unicode_alloc(char const *);
void ntlm_create_hash(const char *password, uint8_t result[16]) {
  char *unicode = unicode_alloc(password);
  MD4_CTX ntlm;
  if (!unicode) {
    {
      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",
          121, "Out of memory.");
      abort();
    };
  };
  MD4_Init(&ntlm);
  MD4_Update(&ntlm, unicode, strlen(password) * 2);
  MD4_Final(result, &ntlm);
}


x86 assembly (clang, -O0):
<ntlm_create_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <unicode_alloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11c7 <ntlm_create_hash+0x57>
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
lea    0xe58(%rip),%rsi
lea    0xe75(%rip),%rdx
mov    $0x79,%ecx
lea    0xeed(%rip),%r8
call   1090 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
lea    -0x1c(%rbp),%rdi
call   1070 <MD4_Init@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
shl    $0x1,%edx
lea    -0x1c(%rbp),%rdi
call   1060 <MD4_Update@plt>
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1080 <MD4_Final@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntlm_create_hash>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <unicode_alloc@plt>
test   %rax,%rax
je     11c5 <ntlm_create_hash+0x55>
mov    %rax,%r15
lea    0x4(%rsp),%r12
mov    %r12,%rdi
call   1070 <MD4_Init@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    (%rax,%rax,1),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <MD4_Update@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1080 <MD4_Final@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    0x2e14(%rip),%rax
mov    (%rax),%edi
lea    0xe2b(%rip),%rsi
lea    0xe48(%rip),%rdx
lea    0xec5(%rip),%r8
mov    $0x79,%ecx
call   1090 <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 = [15 x i8] c"Out of memory.\00"
define void @ntlm_create_hash(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%7 = load i8*, i8** %3
%8 = call i8* @unicode_alloc(i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%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 121, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %2
%16 = call i32 @MD4_Init(i32* %6)
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = call i32 @strlen(i8* %18)
%20 = mul nsw i32 %19, 2
%21 = call i32 @MD4_Update(i32* %6, i8* %17, i32 %20)
%22 = load i32*, i32** %4
%23 = call i32 @MD4_Final(i32* %22, i32* %6)
ret void
}

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 = [15 x i8] c"Out of memory.\00"
define void @ntlm_create_hash(i8* %0, i32* %1) {
%3 = alloca i32
%4 = tail call i8* @unicode_alloc(i8* %0)
%5 = bitcast i32* %3 to i8*
%6 = icmp eq i8* %4, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, 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 121, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %2
%12 = call i32 @MD4_Init(i32* %3)
%13 = call i32 @strlen(i8* %0)
%14 = shl nsw i32 %13, 1
%15 = call i32 @MD4_Update(i32* %3, i8* %4, i32 %14)
%16 = call i32 @MD4_Final(i32* %1, i32* %3)
ret void
}