#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 scalar_t__ time_t;

/* Variables and functions */
scalar_t__ clock();
scalar_t__ getpid();
char i64c(unsigned long);
int /*<<< orphan*/ time(scalar_t__ *);
char *crypt_make_salt(void) {
  time_t now;
  static unsigned long x;
  static char result[3];
  time(&now);
  x += now + getpid() + clock();
  result[0] = i64c(((x >> 18) ^ (x >> 6)) & 077);
  result[1] = i64c(((x >> 12) ^ x) & 077);
  result[2] = '\0';
  return result;
}


x86 assembly (clang, -O0):
<crypt_make_salt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x8(%rbp),%rdi
call   1050 <time@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <clock@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
add    0x2ec2(%rip),%rax
mov    %rax,0x2ebb(%rip)
mov    0x2eb4(%rip),%rdi
shr    $0x12,%rdi
mov    0x2ea9(%rip),%rax
shr    $0x6,%rax
xor    %rax,%rdi
and    $0x3f,%rdi
call   1060 <i64c@plt>
mov    %al,0x2e9b(%rip)
mov    0x2e8c(%rip),%rdi
shr    $0xc,%rdi
xor    0x2e81(%rip),%rdi
and    $0x3f,%rdi
call   1060 <i64c@plt>
mov    %al,0x2e7b(%rip)
movb   $0x0,0x2e75(%rip)
lea    0x2e6c(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_make_salt>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdi
call   1050 <time@plt>
mov    0x8(%rsp),%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
add    %rax,%rbx
xor    %eax,%eax
call   1040 <clock@plt>
add    %rax,%rbx
add    0x2ed9(%rip),%rbx
mov    %rbx,0x2ed2(%rip)
mov    %ebx,%eax
shr    $0x6,%eax
shr    $0x12,%ebx
xor    %eax,%ebx
and    $0x3f,%ebx
mov    %rbx,%rdi
call   1060 <i64c@plt>
mov    %al,0x2ebf(%rip)
lea    0x2eb8(%rip),%rbx
mov    0x2eaa(%rip),%eax
mov    %eax,%edi
shr    $0xc,%edi
xor    %eax,%edi
and    $0x3f,%edi
call   1060 <i64c@plt>
mov    %al,0x2e9e(%rip)
movb   $0x0,0x2e98(%rip)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@crypt_make_salt.x = internal global i64 0
@crypt_make_salt.result = internal global [3 x i8] zeroinitializer
define i8* @crypt_make_salt() {
%1 = alloca i64
%2 = call i32 @time(i64* %1)
%3 = load i64, i64* %1
%4 = call i64 (...) @getpid()
%5 = add nsw i64 %3, %4
%6 = call i64 (...) @clock()
%7 = add nsw i64 %5, %6
%8 = load i64, i64* @crypt_make_salt.x
%9 = add i64 %8, %7
store i64 %9, i64* @crypt_make_salt.x
%10 = load i64, i64* @crypt_make_salt.x
%11 = lshr i64 %10, 18
%12 = load i64, i64* @crypt_make_salt.x
%13 = lshr i64 %12, 6
%14 = xor i64 %11, %13
%15 = and i64 %14, 63
%16 = call signext i8 @i64c(i64 %15)
store i8 %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @crypt_make_salt.result, i64 0, i64 0)
%17 = load i64, i64* @crypt_make_salt.x
%18 = lshr i64 %17, 12
%19 = load i64, i64* @crypt_make_salt.x
%20 = xor i64 %18, %19
%21 = and i64 %20, 63
%22 = call signext i8 @i64c(i64 %21)
store i8 %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @crypt_make_salt.result, i64 0, i64 1)
store i8 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @crypt_make_salt.result, i64 0, i64 2)
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @crypt_make_salt.result, i64 0, i64 0)
}

LLVM IR (-O2):
@crypt_make_salt.x = internal unnamed_addr global i64 0
@crypt_make_salt.result = internal global [3 x i8] zeroinitializer
define i8* @crypt_make_salt() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @time(i64* %1)
%4 = load i64, i64* %1
%5 = call i64 (...) @getpid()
%6 = add nsw i64 %5, %4
%7 = call i64 (...) @clock()
%8 = add nsw i64 %6, %7
%9 = load i64, i64* @crypt_make_salt.x
%10 = add i64 %8, %9
store i64 %10, i64* @crypt_make_salt.x
%11 = lshr i64 %10, 18
%12 = lshr i64 %10, 6
%13 = xor i64 %11, %12
%14 = and i64 %13, 63
%15 = call signext i8 @i64c(i64 %14)
store i8 %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @crypt_make_salt.result, i64 0, i64 0)
%16 = load i64, i64* @crypt_make_salt.x
%17 = lshr i64 %16, 12
%18 = xor i64 %17, %16
%19 = and i64 %18, 63
%20 = call signext i8 @i64c(i64 %19)
store i8 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @crypt_make_salt.result, i64 0, i64 1)
store i8 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @crypt_make_salt.result, i64 0, i64 2)
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @crypt_make_salt.result, i64 0, i64 0)
}