#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*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ ehelp(char *);
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *generapass(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ strncmp(char *, char *, int);
unsigned long long strtoull(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  unsigned long long passcnt = 0, npass;
  char pass[10 + 1] = "xxxxxxxxxx";
  if (argc != 2)
    ehelp(*argv);
  if (!strncmp(argv[1], "-h", 2) || !strncmp(argv[1], "--help", 6) ||
      !strncmp(argv[1], "-?", 2))
    ehelp(*argv);
  npass = strtoull(argv[1], NULL, 0);
  if (errno) {
    perror("Errore nella conversione del numero di password da stringa a "
           "ulong, strtoull()");
    exit(EXIT_FAILURE);
  }
  srand(time(NULL));
  for (; passcnt < npass; passcnt++)
    printf("%s\n", generapass(pass));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    0xe4b(%rip),%rax
mov    %rax,-0x2b(%rbp)
mov    0xe48(%rip),%ax
mov    %ax,-0x23(%rbp)
mov    0xe40(%rip),%al
mov    %al,-0x21(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11e3 <main+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1080 <ehelp@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe19(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     1249 <main+0xb9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdfa(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     1249 <main+0xb9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xddf(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1255 <main+0xc5>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1080 <ehelp@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1060 <strtoull@plt>
mov    %rax,-0x20(%rbp)
mov    0x2d6d(%rip),%rax
cmpq   $0x0,(%rax)
je     1297 <main+0x107>
lea    0xd94(%rip),%rdi
call   1090 <perror@plt>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    12de <main+0x14e>
lea    -0x2b(%rbp),%rdi
call   10b0 <generapass@plt>
mov    %rax,%rsi
lea    0xd9f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    12a7 <main+0x117>
mov    0x2ceb(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movabs $0x7878787878787878,%rax
78 78 78
mov    %rax,(%rsp)
movl   $0x787878,0x7(%rsp)
cmp    $0x2,%edi
je     11bf <main+0x2f>
mov    (%rbx),%rdi
call   1080 <ehelp@plt>
mov    0x8(%rbx),%rdi
lea    0xe41(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     120a <main+0x7a>
mov    0x8(%rbx),%rdi
lea    0xe2b(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     120a <main+0x7a>
mov    0x8(%rbx),%rdi
lea    0xe19(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1212 <main+0x82>
mov    (%rbx),%rdi
call   1080 <ehelp@plt>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1060 <strtoull@plt>
mov    %rax,%rbx
mov    0x2db7(%rip),%rax
cmpq   $0x0,(%rax)
jne    127c <main+0xec>
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
test   %rbx,%rbx
je     1269 <main+0xd9>
mov    %rsp,%r14
lea    0xe1b(%rip),%r15
nopl   0x0(%rax)
mov    %r14,%rdi
call   10b0 <generapass@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbx
jne    1250 <main+0xc0>
mov    0x2d60(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xd95(%rip),%rdi
call   1090 <perror@plt>
mov    0x2d49(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@__const.main.pass = [11 x i8] c"xxxxxxxxxx\00"
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
@.str.2 = [3 x i8] c"-?\00"
@errno = global i64 0
@.str.3 = [79 x i8] c"Errore nella conversione del numero di password da stringa a ulong, strtoull()\00"
@EXIT_FAILURE = global i32 0
@.str.4 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca [11 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
%9 = bitcast [11 x i8]* %8 to i8*
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 2
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = load i8*, i8** %13
%15 = call i32 @ehelp(i8* %14)
br label %16
16: ; preds = %12, %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @strncmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %34
22: ; preds = %16
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @strncmp(i8* %25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %22
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 @strncmp(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%33 = icmp ne i32 %32, 0
br i1 %33, label %38, label %34
34: ; preds = %28, %22, %16
%35 = load i8**, i8*** %5
%36 = load i8*, i8** %35
%37 = call i32 @ehelp(i8* %36)
br label %38
38: ; preds = %34, %28
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = call i64 @strtoull(i8* %41, i32* null, i32 0)
store i64 %42, i64* %7
%43 = load i64, i64* @errno
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %38
%46 = call i32 @perror(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0))
%47 = load i32, i32* @EXIT_FAILURE
%48 = call i32 @exit(i32 %47)
unreachable
49: ; preds = %38
%50 = call i32 @time(i32* null)
%51 = call i32 @srand(i32 %50)
br label %52
52: ; preds = %60, %49
%53 = load i64, i64* %6
%54 = load i64, i64* %7
%55 = icmp ult i64 %53, %54
br i1 %55, label %56, label %63
56: ; preds = %52
%57 = getelementptr inbounds [11 x i8], [11 x i8]* %8, i64 0, i64 0
%58 = call i8* @generapass(i8* %57)
%59 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %58)
br label %60
60: ; preds = %56
%61 = load i64, i64* %6
%62 = add i64 %61, 1
store i64 %62, i64* %6
br label %52
63: ; preds = %52
%64 = load i32, i32* @EXIT_SUCCESS
ret i32 %64
}

LLVM IR (-O2):
@__const.main.pass = [11 x i8] c"xxxxxxxxxx\00"
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
@.str.2 = [3 x i8] c"-?\00"
@errno = global i64 0
@.str.3 = [79 x i8] c"Errore nella conversione del numero di password da stringa a ulong, strtoull()\00"
@EXIT_FAILURE = global i32 0
@.str.4 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [11 x i8]
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 2
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 @ehelp(i8* %7)
br label %9
9: ; preds = %6, %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%13 = icmp eq i32 %12, 0
br i1 %13, label %22, label %14
14: ; preds = %9
%15 = load i8*, i8** %10
%16 = tail call i32 @strncmp(i8* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
%17 = icmp eq i32 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8*, i8** %10
%20 = tail call i32 @strncmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %18, %14, %9
%23 = load i8*, i8** %1
%24 = tail call i32 @ehelp(i8* %23)
br label %25
25: ; preds = %22, %18
%26 = load i8*, i8** %10
%27 = tail call i64 @strtoull(i8* nocapture %26, i32* null, i32 0)
%28 = load i64, i64* @errno
%29 = icmp eq i64 %28, 0
br i1 %29, label %34, label %30
30: ; preds = %25
%31 = tail call i32 @perror(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.3, i64 0, i64 0))
%32 = load i32, i32* @EXIT_FAILURE
%33 = tail call i32 @exit(i32 %32)
unreachable
34: ; preds = %25
%35 = tail call i32 @time(i32* null)
%36 = tail call i32 @srand(i32 %35)
%37 = icmp eq i64 %27, 0
br i1 %37, label %44, label %38
38: ; preds = %34, %38
%39 = phi i64 [ %42, %38 ], [ 0, %34 ]
%40 = call i8* @generapass(i8* %4)
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %40)
%42 = add nuw i64 %39, 1
%43 = icmp eq i64 %42, %27
br i1 %43, label %44, label %38
44: ; preds = %38, %34
%45 = load i32, i32* @EXIT_SUCCESS
ret i32 %45
}