#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 */
double RAND_MAX;
double rand();
char _CRYPT_SALT() {
  char c;
  int rn = (int)(64.0 * rand() / (RAND_MAX + 1.0));
  if (rn < 26)
    c = (char)'a' + rn;
  else if (rn < 52)
    c = (char)'A' - 26 + rn;
  else if (rn < 62)
    c = (char)'0' - 52 + rn;
  else if (rn == 62)
    c = (char)'/';
  else
    c = (char)'.';
  return (c);
}


x86 assembly (clang, -O0):
<_CRYPT_SALT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  0xede(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeca(%rip),%xmm1
mov    0x2eab(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1a,-0x8(%rbp)
jge    1164 <_CRYPT_SALT+0x54>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    11bc <_CRYPT_SALT+0xac>
cmpl   $0x34,-0x8(%rbp)
jge    117c <_CRYPT_SALT+0x6c>
mov    -0x8(%rbp),%eax
add    $0x27,%eax
mov    %al,-0x1(%rbp)
jmp    11b7 <_CRYPT_SALT+0xa7>
cmpl   $0x3e,-0x8(%rbp)
jge    1196 <_CRYPT_SALT+0x86>
mov    -0x8(%rbp),%eax
add    $0xfffffffc,%eax
mov    %al,-0x1(%rbp)
jmp    11b2 <_CRYPT_SALT+0xa2>
cmpl   $0x3e,-0x8(%rbp)
jne    11a9 <_CRYPT_SALT+0x99>
movb   $0x2f,-0x1(%rbp)
jmp    11ad <_CRYPT_SALT+0x9d>
movb   $0x2e,-0x1(%rbp)
jmp    11b2 <_CRYPT_SALT+0xa2>
jmp    11b7 <_CRYPT_SALT+0xa7>
jmp    11bc <_CRYPT_SALT+0xac>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_CRYPT_SALT>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mulsd  0xee0(%rip),%xmm0
mov    0x2ec1(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cmp    $0x19,%eax
jg     1144 <_CRYPT_SALT+0x34>
add    $0x61,%al
pop    %rcx
ret
cmp    $0x33,%eax
ja     114d <_CRYPT_SALT+0x3d>
add    $0x27,%al
pop    %rcx
ret
cmp    $0x3d,%eax
ja     1156 <_CRYPT_SALT+0x46>
add    $0xfc,%al
pop    %rcx
ret
cmp    $0x3e,%eax
sete   %al
or     $0x2e,%al
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define signext i8 @_CRYPT_SALT() {
%1 = alloca i8
%2 = alloca i32
%3 = call double (...) @rand()
%4 = fmul double 6.400000e+01, %3
%5 = load double, double* @RAND_MAX
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %4, %6
%8 = fptosi double %7 to i32
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 26
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = load i32, i32* %2
%13 = add nsw i32 97, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %1
br label %37
15: ; preds = %0
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 52
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %2
%20 = add nsw i32 39, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %1
br label %36
22: ; preds = %15
%23 = load i32, i32* %2
%24 = icmp slt i32 %23, 62
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = load i32, i32* %2
%27 = add nsw i32 -4, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %1
br label %35
29: ; preds = %22
%30 = load i32, i32* %2
%31 = icmp eq i32 %30, 62
br i1 %31, label %32, label %33
32: ; preds = %29
store i8 47, i8* %1
br label %34
33: ; preds = %29
store i8 46, i8* %1
br label %34
34: ; preds = %33, %32
br label %35
35: ; preds = %34, %25
br label %36
36: ; preds = %35, %18
br label %37
37: ; preds = %36, %11
%38 = load i8, i8* %1
ret i8 %38
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define signext i8 @_CRYPT_SALT() {
%1 = tail call double (...) @rand()
%2 = fmul double %1, 6.400000e+01
%3 = load double, double* @RAND_MAX
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double %2, %4
%6 = fptosi double %5 to i32
%7 = icmp slt i32 %6, 26
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = trunc i32 %6 to i8
%10 = add i8 %9, 97
br label %24
11: ; preds = %0
%12 = icmp ult i32 %6, 52
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = trunc i32 %6 to i8
%15 = add nuw nsw i8 %14, 39
br label %24
16: ; preds = %11
%17 = icmp ult i32 %6, 62
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = trunc i32 %6 to i8
%20 = add nsw i8 %19, -4
br label %24
21: ; preds = %16
%22 = icmp eq i32 %6, 62
%23 = select i1 %22, i8 47, i8 46
br label %24
24: ; preds = %21, %13, %18, %8
%25 = phi i8 [ %10, %8 ], [ %15, %13 ], [ %20, %18 ], [ %23, %21 ]
ret i8 %25
}