#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*/ ehelp(char *);
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
char *generatepass(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 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("Error in the conversion of the number of password from string to "
           "ulong, strtoull()");
    exit(1);
  }
  srand(time(NULL));
  for (unsigned long long passcnt = 0; passcnt < npass; passcnt++)
    printf("%s\n", generatepass(pass));
  return 0;
}


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)
mov    0xe53(%rip),%rax
mov    %rax,-0x23(%rbp)
mov    0xe50(%rip),%ax
mov    %ax,-0x1b(%rbp)
mov    0xe48(%rip),%al
mov    %al,-0x19(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11db <main+0x4b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <ehelp@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe21(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     1241 <main+0xb1>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe02(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     1241 <main+0xb1>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde7(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    124d <main+0xbd>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <ehelp@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1070 <strtoull@plt>
mov    %rax,-0x18(%rbp)
mov    0x2d75(%rip),%rax
cmpq   $0x0,(%rax)
je     128b <main+0xfb>
lea    0xd9c(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    12da <main+0x14a>
lea    -0x23(%rbp),%rdi
call   1040 <generatepass@plt>
mov    %rax,%rsi
lea    0xda7(%rip),%rdi
call   1050 <printf@plt>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    12a3 <main+0x113>
xor    %eax,%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   1090 <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   1090 <ehelp@plt>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <strtoull@plt>
mov    %rax,%rbx
mov    0x2db7(%rip),%rax
cmpq   $0x0,(%rax)
jne    1275 <main+0xe5>
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
test   %rbx,%rbx
je     1269 <main+0xd9>
mov    %rsp,%r14
lea    0xe1f(%rip),%r15
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <generatepass@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
add    $0xffffffffffffffff,%rbx
jne    1250 <main+0xc0>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xd9c(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10b0 <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 = [83 x i8] c"Error in the conversion of the number of password from string to ulong, strtoull()\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca [11 x i8]
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [11 x i8]* %7 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* %6
%43 = load i64, i64* @errno
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %38
%46 = call i32 @perror(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.3, i64 0, i64 0))
%47 = call i32 @exit(i32 1)
unreachable
48: ; preds = %38
%49 = call i32 @time(i32* null)
%50 = call i32 @srand(i32 %49)
store i64 0, i64* %8
br label %51
51: ; preds = %59, %48
%52 = load i64, i64* %8
%53 = load i64, i64* %6
%54 = icmp ult i64 %52, %53
br i1 %54, label %55, label %62
55: ; preds = %51
%56 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%57 = call i8* @generatepass(i8* %56)
%58 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %57)
br label %59
59: ; preds = %55
%60 = load i64, i64* %8
%61 = add i64 %60, 1
store i64 %61, i64* %8
br label %51
62: ; preds = %51
ret i32 0
}

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 = [83 x i8] c"Error in the conversion of the number of password from string to ulong, strtoull()\00"
@.str.4 = [4 x i8] c"%s\0A\00"
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 %33, label %30
30: ; preds = %25
%31 = tail call i32 @perror(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.3, i64 0, i64 0))
%32 = tail call i32 @exit(i32 1)
unreachable
33: ; preds = %25
%34 = tail call i32 @time(i32* null)
%35 = tail call i32 @srand(i32 %34)
%36 = icmp eq i64 %27, 0
br i1 %36, label %37, label %38
37: ; preds = %38, %33
ret i32 0
38: ; preds = %33, %38
%39 = phi i64 [ %42, %38 ], [ 0, %33 ]
%40 = call i8* @generatepass(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 %37, label %38
}