#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 atoi(char *);
int /*<<< orphan*/ clock();
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int c, l;
  int passwords = 1;
  int plength = 8;
  srand(clock());
  switch (argc) {
  case 3:
    passwords = atoi(argv[2]);
  case 2:
    plength = atoi(argv[1]);
  }
  for (l = 1; l <= passwords; l++) {
    for (c = 1; c <= plength; c++)
      printf("%c", (rand() % (126 - 32)) + 33);
    printf("\n");
  }
  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)
movl   $0x1,-0x1c(%rbp)
movl   $0x8,-0x20(%rbp)
xor    %eax,%eax
call   1030 <clock@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x2,%eax
je     11b7 <main+0x67>
jmp    1196 <main+0x46>
mov    -0x24(%rbp),%eax
sub    $0x3,%eax
jne    11c7 <main+0x77>
jmp    11a7 <main+0x57>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x20(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1239 <main+0xe9>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     121d <main+0xcd>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x5e,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x21,%esi
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e1 <main+0x91>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11ce <main+0x7e>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%r15d
xor    %eax,%eax
call   1040 <clock@plt>
mov    %eax,%edi
call   1050 <srand@plt>
cmp    $0x3,%r15d
je     1192 <main+0x42>
mov    $0x1,%r12d
mov    $0x8,%r13d
cmp    $0x2,%r15d
jne    11af <main+0x5f>
mov    0x8(%r14),%rdi
call   1060 <atoi@plt>
jmp    11ac <main+0x5c>
mov    0x10(%r14),%rdi
call   1060 <atoi@plt>
mov    %eax,%r12d
mov    0x8(%r14),%rdi
call   1060 <atoi@plt>
test   %r12d,%r12d
jle    1217 <main+0xc7>
mov    %eax,%r13d
mov    $0x1,%ebx
jmp    11d4 <main+0x84>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%eax
cmp    %r12d,%ebx
mov    %eax,%ebx
je     1217 <main+0xc7>
test   %r13d,%r13d
jle    11c0 <main+0x70>
mov    %r13d,%ebp
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0xffffffffae4c415d,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
imul   $0x5e,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x21,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11e0 <main+0x90>
jmp    11c0 <main+0x70>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %8
store i32 8, i32* %9
%10 = call i32 (...) @clock()
%11 = call i32 @srand(i32 %10)
%12 = load i32, i32* %4
switch i32 %12, label %23 [
i32 3, label %13
i32 2, label %18
]
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %8
br label %18
18: ; preds = %2, %13
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %9
br label %23
23: ; preds = %18, %2
store i32 1, i32* %7
br label %24
24: ; preds = %43, %23
%25 = load i32, i32* %7
%26 = load i32, i32* %8
%27 = icmp sle i32 %25, %26
br i1 %27, label %28, label %46
28: ; preds = %24
store i32 1, i32* %6
br label %29
29: ; preds = %38, %28
%30 = load i32, i32* %6
%31 = load i32, i32* %9
%32 = icmp sle i32 %30, %31
br i1 %32, label %33, label %41
33: ; preds = %29
%34 = call i32 (...) @rand()
%35 = srem i32 %34, 94
%36 = add nsw i32 %35, 33
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %33
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %29
41: ; preds = %29
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %43
43: ; preds = %41
%44 = load i32, i32* %7
%45 = add nsw i32 %44, 1
store i32 %45, i32* %7
br label %24
46: ; preds = %24
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @clock()
%4 = tail call i32 @srand(i32 %3)
switch i32 %0, label %17 [
i32 3, label %9
i32 2, label %5
]
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
br label %17
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call i32 @atoi(i8* %14)
%16 = icmp slt i32 %12, 1
br i1 %16, label %35, label %17
17: ; preds = %2, %5, %9
%18 = phi i32 [ %15, %9 ], [ %8, %5 ], [ 8, %2 ]
%19 = phi i32 [ %12, %9 ], [ 1, %5 ], [ 1, %2 ]
%20 = icmp slt i32 %18, 1
br label %21
21: ; preds = %17, %31
%22 = phi i32 [ 1, %17 ], [ %33, %31 ]
br i1 %20, label %31, label %23
23: ; preds = %21, %23
%24 = phi i32 [ %29, %23 ], [ 1, %21 ]
%25 = tail call i32 (...) @rand()
%26 = srem i32 %25, 94
%27 = add nsw i32 %26, 33
%28 = tail call i32 @putchar(i32 %27)
%29 = add nuw i32 %24, 1
%30 = icmp eq i32 %24, %18
br i1 %30, label %31, label %23
31: ; preds = %23, %21
%32 = tail call i32 @putchar(i32 10)
%33 = add nuw i32 %22, 1
%34 = icmp eq i32 %22, %19
br i1 %34, label %35, label %21
35: ; preds = %31, %9
ret i32 0
}