#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*/ printf(char *, ...);
int random();
int /*<<< orphan*/ srandom(int);
void main(int argc, char **argv) {
  int i, j, n;
  char *pass[8], r;
  n = atoi(argv[1]);
  srandom(101173);
  for (i = 0; i < n; i++) {
    for (j = 0; j < 8; j++) {
      r = random() % 122;
      while (r < 48)
        r += random() % (122 - r);
      printf("%c", r);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x18b35,%edi
call   1030 <srandom@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    120d <main+0xcd>
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    11f1 <main+0xb1>
mov    $0x0,%al
call   1050 <random@plt>
mov    $0x7a,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x61(%rbp)
movsbl -0x61(%rbp),%eax
cmp    $0x30,%eax
jge    11d1 <main+0x91>
mov    $0x0,%al
call   1050 <random@plt>
movsbl -0x61(%rbp),%edx
mov    $0x7a,%ecx
sub    %edx,%ecx
cltd
idiv   %ecx
movsbl -0x61(%rbp),%eax
add    %edx,%eax
mov    %al,-0x61(%rbp)
jmp    11a1 <main+0x61>
movsbl -0x61(%rbp),%esi
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1183 <main+0x43>
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1170 <main+0x30>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%r14d
mov    $0x18b35,%edi
call   1040 <srandom@plt>
test   %r14d,%r14d
jle    11f3 <main+0xb3>
xor    %r15d,%r15d
jmp    1183 <main+0x43>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
cmp    %r14d,%r15d
je     11f3 <main+0xb3>
xor    %ebp,%ebp
jmp    119f <main+0x5f>
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x8,%ebp
je     1170 <main+0x30>
xor    %eax,%eax
call   1050 <random@plt>
movslq %eax,%rbx
imul   $0x4325c53f,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x7a,%eax,%eax
sub    %eax,%ebx
cmp    $0x2f,%ebx
jg     1190 <main+0x50>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <random@plt>
mov    $0x7a,%ecx
sub    %ebx,%ecx
cltd
idiv   %ecx
add    %ebx,%edx
movsbl %dl,%ebx
shl    $0x18,%edx
cmp    $0x30000000,%edx
jl     11d0 <main+0x90>
jmp    1190 <main+0x50>
add    $0x8,%rsp
pop    %rbx
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 void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [8 x i8*]
%9 = alloca i8
store i32 %0, i32* %3
store i8** %1, i8*** %4
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %7
%14 = call i32 @srandom(i32 101173)
store i32 0, i32* %5
br label %15
15: ; preds = %50, %2
%16 = load i32, i32* %5
%17 = load i32, i32* %7
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %53
19: ; preds = %15
store i32 0, i32* %6
br label %20
20: ; preds = %45, %19
%21 = load i32, i32* %6
%22 = icmp slt i32 %21, 8
br i1 %22, label %23, label %48
23: ; preds = %20
%24 = call i32 (...) @random()
%25 = srem i32 %24, 122
%26 = trunc i32 %25 to i8
store i8 %26, i8* %9
br label %27
27: ; preds = %31, %23
%28 = load i8, i8* %9
%29 = sext i8 %28 to i32
%30 = icmp slt i32 %29, 48
br i1 %30, label %31, label %41
31: ; preds = %27
%32 = call i32 (...) @random()
%33 = load i8, i8* %9
%34 = sext i8 %33 to i32
%35 = sub nsw i32 122, %34
%36 = srem i32 %32, %35
%37 = load i8, i8* %9
%38 = sext i8 %37 to i32
%39 = add nsw i32 %38, %36
%40 = trunc i32 %39 to i8
store i8 %40, i8* %9
br label %27
41: ; preds = %27
%42 = load i8, i8* %9
%43 = sext i8 %42 to i32
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %41
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
br label %20
48: ; preds = %20
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %50
50: ; preds = %48
%51 = load i32, i32* %5
%52 = add nsw i32 %51, 1
store i32 %52, i32* %5
br label %15
53: ; preds = %15
ret void
}

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