#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 rand();
int /*<<< orphan*/ srand(int);
char *__generateSalt() {
  char salt[6];
  char min = 0x30, max = 0x7E, r = 0;
  int i = 0;
  srand(0x46a196b1);
  for (i = 0; i < 6; i++) {
    while (1) {
      r = (char)(rand() % 0x7E);
      if (r >= 0x30) {
        break;
      }
    }
    salt[i] = r;
  }
  return salt;
}


x86 assembly (clang, -O0):
<__generateSalt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x30,-0x7(%rbp)
movb   $0x7e,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x46a196b1,%edi
call   1030 <srand@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    119f <__generateSalt+0x7f>
jmp    115b <__generateSalt+0x3b>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x7e,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x30,%eax
jl     1181 <__generateSalt+0x61>
jmp    1186 <__generateSalt+0x66>
jmp    115b <__generateSalt+0x3b>
mov    -0x9(%rbp),%cl
movslq -0x10(%rbp),%rax
mov    %cl,-0x6(%rbp,%rax,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114c <__generateSalt+0x2c>
lea    -0x6(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__generateSalt>:
push   %rax
mov    $0x46a196b1,%edi
call   1030 <srand@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0xffffffff82082083,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x7,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
cmp    $0x30,%esi
jl     1130 <__generateSalt+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0xffffffff82082083,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x7,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
cmp    $0x30,%esi
jl     1170 <__generateSalt+0x50>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0xffffffff82082083,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x7,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
cmp    $0x30,%esi
jl     11b0 <__generateSalt+0x90>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0xffffffff82082083,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x7,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
cmp    $0x30,%esi
jl     11f0 <__generateSalt+0xd0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0xffffffff82082083,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x7,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
cmp    $0x30,%esi
jl     1230 <__generateSalt+0x110>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0xffffffff82082083,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x7,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
cmp    $0x30,%esi
jl     1270 <__generateSalt+0x150>
lea    0x2(%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @__generateSalt() {
%1 = alloca [6 x i8]
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 48, i8* %2
store i8 126, i8* %3
store i8 0, i8* %4
store i32 0, i32* %5
%6 = call i32 @srand(i32 1184994993)
store i32 0, i32* %5
br label %7
7: ; preds = %25, %0
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 6
br i1 %9, label %10, label %28
10: ; preds = %7
br label %11
11: ; preds = %10, %19
%12 = call i32 (...) @rand()
%13 = srem i32 %12, 126
%14 = trunc i32 %13 to i8
store i8 %14, i8* %4
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 48
br i1 %17, label %18, label %19
18: ; preds = %11
br label %20
19: ; preds = %11
br label %11
20: ; preds = %18
%21 = load i8, i8* %4
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 %23
store i8 %21, i8* %24
br label %25
25: ; preds = %20
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %7
28: ; preds = %7
%29 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
ret i8* %29
}

LLVM IR (-O2):
define noalias i8* @__generateSalt() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @srand(i32 1184994993)
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 126
%7 = icmp sgt i32 %6, 47
br i1 %7, label %8, label %4
8: ; preds = %4, %8
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 126
%11 = icmp sgt i32 %10, 47
br i1 %11, label %12, label %8
12: ; preds = %8, %12
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 126
%15 = icmp sgt i32 %14, 47
br i1 %15, label %16, label %12
16: ; preds = %12, %16
%17 = tail call i32 (...) @rand()
%18 = srem i32 %17, 126
%19 = icmp sgt i32 %18, 47
br i1 %19, label %20, label %16
20: ; preds = %16, %20
%21 = tail call i32 (...) @rand()
%22 = srem i32 %21, 126
%23 = icmp sgt i32 %22, 47
br i1 %23, label %24, label %20
24: ; preds = %20, %24
%25 = tail call i32 (...) @rand()
%26 = srem i32 %25, 126
%27 = icmp sgt i32 %26, 47
br i1 %27, label %28, label %24
28: ; preds = %24
ret i8* %2
}