#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 /*<<< orphan*/ E_P24(unsigned char *, unsigned char *, unsigned char *);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ memset(unsigned char *, int, int);
void NTLMSSPOWFencrypt(unsigned char passwd[8], unsigned char *ntlmchalresp,
                       unsigned char p24[24]) {
  unsigned char p21[21];
  memset(p21, '\0', 21);
  memcpy(p21, passwd, 8);
  memset(p21 + 8, 0xbd, 8);
  E_P24(p21, ntlmchalresp, p24);
}


x86 assembly (clang, -O0):
<NTLMSSPOWFencrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x15,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0x8,%rdi
mov    $0xbd,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <E_P24@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NTLMSSPOWFencrypt>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsp,%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x15,%edx
call   1040 <memset@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1050 <memcpy@plt>
lea    0x8(%rsp),%rdi
mov    $0xbd,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <E_P24@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @NTLMSSPOWFencrypt(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [21 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [21 x i8], [21 x i8]* %7, i64 0, i64 0
%9 = call i32 @memset(i8* %8, i32 0, i32 21)
%10 = getelementptr inbounds [21 x i8], [21 x i8]* %7, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i32 @memcpy(i8* %10, i8* %11, i32 8)
%13 = getelementptr inbounds [21 x i8], [21 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds i8, i8* %13, i64 8
%15 = call i32 @memset(i8* %14, i32 189, i32 8)
%16 = getelementptr inbounds [21 x i8], [21 x i8]* %7, i64 0, i64 0
%17 = load i8*, i8** %5
%18 = load i8*, i8** %6
%19 = call i32 @E_P24(i8* %16, i8* %17, i8* %18)
ret void
}

LLVM IR (-O2):
define void @NTLMSSPOWFencrypt(i8* %0, i8* %1, i8* %2) {
%4 = alloca [21 x i8]
%5 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%6 = call i32 @memset(i8* %5, i32 0, i32 21)
%7 = call i32 @memcpy(i8* %5, i8* %0, i32 8)
%8 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 8
%9 = call i32 @memset(i8* %8, i32 189, i32 8)
%10 = call i32 @E_P24(i8* %5, i8* %1, i8* %2)
ret void
}