#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 /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ srand(unsigned int);
int /*<<< orphan*/ stdout_password(int, int, int /*<<< orphan*/, int);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  int rnd;
  int i, j;
  printf("Simple Password Generator - %d digits / 1 part\n", 8);
  srand((unsigned)time(NULL));
  printf("0-9 \t\t\t");
  stdout_password(8, 3, 0, 9);
  putchar('\n');
  printf("0-9 + a-z + A-Z \t");
  stdout_password(8, 3, 0, 61);
  putchar('\n');
  printf("0-9 + a-z + A-Z + sign \t");
  stdout_password(8, 3, 0, 94);
  putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x8,%edi
mov    $0x3,%esi
xor    %edx,%edx
mov    $0x9,%ecx
call   1040 <stdout_password@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x8,%edi
mov    $0x3,%esi
xor    %edx,%edx
mov    $0x3d,%ecx
call   1040 <stdout_password@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x8,%edi
mov    $0x3,%esi
xor    %edx,%edx
mov    $0x5e,%ecx
call   1040 <stdout_password@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x8,%edi
mov    $0x3,%esi
xor    %edx,%edx
mov    $0x9,%ecx
call   1040 <stdout_password@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe91(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x8,%edi
mov    $0x3,%esi
xor    %edx,%edx
mov    $0x3d,%ecx
call   1040 <stdout_password@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x8,%edi
mov    $0x3,%esi
xor    %edx,%edx
mov    $0x5e,%ecx
call   1040 <stdout_password@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"Simple Password Generator - %d digits / 1 part\0A\00"
@.str.1 = [8 x i8] c"0-9 \09\09\09\00"
@.str.2 = [18 x i8] c"0-9 + a-z + A-Z \09\00"
@.str.3 = [25 x i8] c"0-9 + a-z + A-Z + sign \09\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 8)
%6 = call i64 @time(i32* null)
%7 = trunc i64 %6 to i32
%8 = call i32 @srand(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @stdout_password(i32 8, i32 3, i32 0, i32 9)
%11 = call i32 @putchar(i8 signext 10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @stdout_password(i32 8, i32 3, i32 0, i32 61)
%14 = call i32 @putchar(i8 signext 10)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @stdout_password(i32 8, i32 3, i32 0, i32 94)
%17 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"Simple Password Generator - %d digits / 1 part\0A\00"
@.str.1 = [8 x i8] c"0-9 \09\09\09\00"
@.str.2 = [18 x i8] c"0-9 + a-z + A-Z \09\00"
@.str.3 = [25 x i8] c"0-9 + a-z + A-Z + sign \09\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @stdout_password(i32 8, i32 3, i32 0, i32 9)
%7 = tail call i32 @putchar(i8 signext 10)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @stdout_password(i32 8, i32 3, i32 0, i32 61)
%10 = tail call i32 @putchar(i8 signext 10)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call i32 @stdout_password(i32 8, i32 3, i32 0, i32 94)
%13 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}