#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 */
unsigned int *_ufc_doit(unsigned int, unsigned int, unsigned int, unsigned int,
                        unsigned int);
int /*<<< orphan*/ clearmem(char *, int);
char *output_conversion(unsigned int, unsigned int, char const *);
int /*<<< orphan*/ setup_salt(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
int /*<<< orphan*/ ufc_mk_keytab(char *);
char *ufc_crypt(const char *key, const char *salt) {
  unsigned *s;
  char ktab[9];
  setup_salt(salt);
  clearmem(ktab, sizeof ktab);
  strncpy(ktab, key, 8);
  ufc_mk_keytab(ktab);
  s = _ufc_doit((unsigned)0, (unsigned)0, (unsigned)0, (unsigned)0,
                (unsigned)25);
  return output_conversion(s[0], s[1], salt);
}


x86 assembly (clang, -O0):
<ufc_crypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <setup_salt@plt>
lea    -0x21(%rbp),%rdi
mov    $0x9,%esi
call   1080 <clearmem@plt>
lea    -0x21(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1040 <strncpy@plt>
lea    -0x21(%rbp),%rdi
call   1070 <ufc_mk_keytab@plt>
xor    %ecx,%ecx
mov    $0x19,%r8d
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1060 <_ufc_doit@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <output_conversion@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ufc_crypt>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1050 <setup_salt@plt>
lea    0x7(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1080 <clearmem@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x8,%edx
call   1040 <strncpy@plt>
mov    %rbx,%rdi
call   1070 <ufc_mk_keytab@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x19,%r8d
call   1060 <_ufc_doit@plt>
mov    (%rax),%edi
mov    0x4(%rax),%esi
mov    %r14,%rdx
call   1030 <output_conversion@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @ufc_crypt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca [9 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @setup_salt(i8* %7)
%9 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%10 = call i32 @clearmem(i8* %9, i32 9)
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%12 = load i8*, i8** %3
%13 = call i32 @strncpy(i8* %11, i8* %12, i32 8)
%14 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%15 = call i32 @ufc_mk_keytab(i8* %14)
%16 = call i32* @_ufc_doit(i32 0, i32 0, i32 0, i32 0, i32 25)
store i32* %16, i32** %5
%17 = load i32*, i32** %5
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = load i32*, i32** %5
%21 = getelementptr inbounds i32, i32* %20, i64 1
%22 = load i32, i32* %21
%23 = load i8*, i8** %4
%24 = call i8* @output_conversion(i32 %19, i32 %22, i8* %23)
ret i8* %24
}

LLVM IR (-O2):
define i8* @ufc_crypt(i8* %0, i8* %1) {
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @setup_salt(i8* %1)
%6 = call i32 @clearmem(i8* %4, i32 9)
%7 = call i32 @strncpy(i8* %4, i8* %0, i32 8)
%8 = call i32 @ufc_mk_keytab(i8* %4)
%9 = call i32* @_ufc_doit(i32 0, i32 0, i32 0, i32 0, i32 25)
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %9, i64 1
%12 = load i32, i32* %11
%13 = call i8* @output_conversion(i32 %10, i32 %12, i8* %1)
ret i8* %13
}