#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int member_0;
  int member_1;
  int member_2;
  int member_3;
  int member_4;
  int member_5;
  int member_6;
  int member_7;
};
typedef TYPE_1__ const_DES_cblock;

/* Variables and functions */
int /*<<< orphan*/ lm_deshash(unsigned char *, TYPE_1__ *, char *);
int /*<<< orphan*/ lm_uccpy(char *, int, char const *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void lm_hash_password(unsigned char *hash, const char *pass) {
  static const_DES_cblock iv = {0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25};
  char lmpass[14];
  lm_uccpy(lmpass, sizeof lmpass, pass);
  lm_deshash(hash, &iv, lmpass);
  lm_deshash(hash + 8, &iv, lmpass + 7);
  memset(lmpass, 0, sizeof lmpass);
}


x86 assembly (clang, -O0):
<lm_hash_password>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1e(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xe,%esi
call   1050 <lm_uccpy@plt>
mov    -0x8(%rbp),%rdi
lea    -0x1e(%rbp),%rdx
lea    0x2ed7(%rip),%rsi
call   1040 <lm_deshash@plt>
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
lea    -0x1e(%rbp),%rdx
add    $0x7,%rdx
lea    0x2ebb(%rip),%rsi
call   1040 <lm_deshash@plt>
lea    -0x1e(%rbp),%rdi
xor    %esi,%esi
mov    $0xe,%edx
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lm_hash_password>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0x2(%rsp),%r14
mov    %r14,%rdi
mov    $0xe,%esi
call   1050 <lm_uccpy@plt>
lea    0x2ee0(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <lm_deshash@plt>
add    $0x8,%rbx
lea    0x9(%rsp),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <lm_deshash@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xe,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32, i32, i32, i32, i32, i32 }
@lm_hash_password.iv = internal global %struct.TYPE_3__ { i32 75, i32 71, i32 83, i32 33, i32 64, i32 35, i32 36, i32 37 }
define void @lm_hash_password(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [14 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [14 x i8], [14 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @lm_uccpy(i8* %6, i32 14, i8* %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [14 x i8], [14 x i8]* %5, i64 0, i64 0
%11 = call i32 @lm_deshash(i8* %9, %struct.TYPE_3__* @lm_hash_password.iv, i8* %10)
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 8
%14 = getelementptr inbounds [14 x i8], [14 x i8]* %5, i64 0, i64 0
%15 = getelementptr inbounds i8, i8* %14, i64 7
%16 = call i32 @lm_deshash(i8* %13, %struct.TYPE_3__* @lm_hash_password.iv, i8* %15)
%17 = getelementptr inbounds [14 x i8], [14 x i8]* %5, i64 0, i64 0
%18 = call i32 @memset(i8* %17, i32 0, i32 14)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32, i32, i32, i32, i32, i32 }
@lm_hash_password.iv = internal global %struct.TYPE_3__ { i32 75, i32 71, i32 83, i32 33, i32 64, i32 35, i32 36, i32 37 }
define void @lm_hash_password(i8* %0, i8* %1) {
%3 = alloca [14 x i8]
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%5 = call i32 @lm_uccpy(i8* %4, i32 14, i8* %1)
%6 = call i32 @lm_deshash(i8* %0, %struct.TYPE_3__* @lm_hash_password.iv, i8* %4)
%7 = getelementptr inbounds i8, i8* %0, i64 8
%8 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 7
%9 = call i32 @lm_deshash(i8* %7, %struct.TYPE_3__* @lm_hash_password.iv, i8* %8)
%10 = call i32 @memset(i8* %4, i32 0, i32 14)
ret void
}