#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*/ bitcount(int);
int /*<<< orphan*/ csprng(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char lrand(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stderr;
size_t strtoull(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  size_t min, max, howmany, length;
  howmany = 1;
  switch (argc) {
  case 1:
    min = 8;
    max = 16;
    break;
  case 2:
    min = max = strtoull(argv[1], NULL, 10);
    break;
  case 3:
    min = strtoull(argv[1], NULL, 10);
    max = strtoull(argv[2], NULL, 10);
    break;
  case 4:
    min = strtoull(argv[1], NULL, 10);
    max = strtoull(argv[2], NULL, 10);
    howmany = strtoull(argv[3], NULL, 10);
    break;
  default:
    fprintf(stderr, "Usage:\n\trpg [min-length] max-length [how-many]\n");
    exit(1);
    break;
  }
  if (min > max)
    do
      (min) ^= (max), (max) ^= (min), (min) ^= (max);
    while (0);
  while (howmany--) {
    length = lrand(csprng(bitcount(max - min)), min, max);
    while (length--)
      putchar(lrand(csprng(bitcount(0x7e - 0x21)), 0x21, 0x7e));
    putchar('\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x28(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x38(%rbp)
sub    $0x3,%eax
ja     127b <main+0x10b>
mov    -0x38(%rbp),%rax
lea    0xe52(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movq   $0x8,-0x18(%rbp)
movq   $0x10,-0x20(%rbp)
jmp    129a <main+0x12a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1070 <strtoull@plt>
mov    %rax,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
jmp    129a <main+0x12a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1070 <strtoull@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1070 <strtoull@plt>
mov    %rax,-0x20(%rbp)
jmp    129a <main+0x12a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1070 <strtoull@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1070 <strtoull@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1070 <strtoull@plt>
mov    %rax,-0x28(%rbp)
jmp    129a <main+0x12a>
mov    0x2d5e(%rip),%rax
mov    (%rax),%edi
lea    0xd85(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    12d6 <main+0x166>
jmp    12ad <main+0x13d>
mov    -0x20(%rbp),%rax
xor    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xor    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
xor    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    12d6 <main+0x166>
jmp    12db <main+0x16b>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x28(%rbp)
cmp    $0x0,%rax
je     137c <main+0x20c>
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %eax,%edi
call   1060 <bitcount@plt>
mov    %eax,%edi
call   1040 <csprng@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rax
mov    %eax,%esi
mov    -0x20(%rbp),%rax
mov    %eax,%edx
call   1050 <lrand@plt>
movsbq %al,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x30(%rbp)
cmp    $0x0,%rax
je     136d <main+0x1fd>
mov    $0x5d,%edi
call   1060 <bitcount@plt>
mov    %eax,%edi
call   1040 <csprng@plt>
mov    %eax,%edi
mov    $0x21,%esi
mov    $0x7e,%edx
call   1050 <lrand@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1325 <main+0x1b5>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    12db <main+0x16b>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
add    $0xffffffff,%edi
cmp    $0x3,%edi
ja     12cd <main+0x15d>
mov    %rsi,%rbx
mov    $0x10,%r14d
mov    $0x8,%ebp
lea    0xe67(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    0x8(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <strtoull@plt>
mov    %rax,%rbp
jmp    11da <main+0x6a>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <strtoull@plt>
mov    %rax,%rbp
mov    0x10(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <strtoull@plt>
mov    %rax,%r14
cmp    %r14,%rbp
mov    %rbp,%r15
cmova  %r14,%r15
cmova  %rbp,%r14
mov    $0x1,%ebx
mov    %r14d,%r12d
sub    %r15d,%r12d
jmp    1213 <main+0xa3>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %rbx,%rbx
je     12c2 <main+0x152>
add    $0xffffffffffffffff,%rbx
mov    %r12d,%edi
call   1060 <bitcount@plt>
mov    %eax,%edi
call   1040 <csprng@plt>
mov    %eax,%edi
mov    %r15d,%esi
mov    %r14d,%edx
call   1050 <lrand@plt>
test   %al,%al
je     1200 <main+0x90>
movsbq %al,%rbp
nopl   0x0(%rax,%rax,1)
mov    $0x5d,%edi
call   1060 <bitcount@plt>
mov    %eax,%edi
call   1040 <csprng@plt>
mov    %eax,%edi
mov    $0x21,%esi
mov    $0x7e,%edx
call   1050 <lrand@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbp
jne    1240 <main+0xd0>
jmp    1200 <main+0x90>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <strtoull@plt>
mov    %rax,%rbp
mov    0x10(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <strtoull@plt>
mov    %rax,%r14
mov    0x18(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <strtoull@plt>
mov    %rax,%rbx
cmp    %r14,%rbp
mov    %rbp,%r15
cmova  %r14,%r15
cmova  %rbp,%r14
test   %rax,%rax
jne    11f0 <main+0x80>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2d0c(%rip),%rax
mov    (%rax),%edi
lea    0xd33(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Usage:\0A\09rpg [min-length] max-length [how-many]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 1, i64* %8
%10 = load i32, i32* %4
switch i32 %10, label %39 [
i32 1, label %11
i32 2, label %12
i32 3, label %17
i32 4, label %26
]
11: ; preds = %2
store i64 8, i64* %6
store i64 16, i64* %7
br label %43
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i64 @strtoull(i8* %15, i32* null, i32 10)
store i64 %16, i64* %7
store i64 %16, i64* %6
br label %43
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @strtoull(i8* %20, i32* null, i32 10)
store i64 %21, i64* %6
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = call i64 @strtoull(i8* %24, i32* null, i32 10)
store i64 %25, i64* %7
br label %43
26: ; preds = %2
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i64 @strtoull(i8* %29, i32* null, i32 10)
store i64 %30, i64* %6
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
%34 = call i64 @strtoull(i8* %33, i32* null, i32 10)
store i64 %34, i64* %7
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 3
%37 = load i8*, i8** %36
%38 = call i64 @strtoull(i8* %37, i32* null, i32 10)
store i64 %38, i64* %8
br label %43
39: ; preds = %2
%40 = load i32, i32* @stderr
%41 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%42 = call i32 @exit(i32 1)
unreachable
43: ; preds = %26, %17, %12, %11
%44 = load i64, i64* %6
%45 = load i64, i64* %7
%46 = icmp ugt i64 %44, %45
br i1 %46, label %47, label %59
47: ; preds = %43
br label %48
48: ; preds = %47
%49 = load i64, i64* %7
%50 = load i64, i64* %6
%51 = xor i64 %50, %49
store i64 %51, i64* %6
%52 = load i64, i64* %6
%53 = load i64, i64* %7
%54 = xor i64 %53, %52
store i64 %54, i64* %7
%55 = load i64, i64* %7
%56 = load i64, i64* %6
%57 = xor i64 %56, %55
store i64 %57, i64* %6
br label %58
58: ; preds = %48
br label %59
59: ; preds = %58, %43
br label %60
60: ; preds = %86, %59
%61 = load i64, i64* %8
%62 = add i64 %61, -1
store i64 %62, i64* %8
%63 = icmp ne i64 %61, 0
br i1 %63, label %64, label %88
64: ; preds = %60
%65 = load i64, i64* %7
%66 = load i64, i64* %6
%67 = sub i64 %65, %66
%68 = trunc i64 %67 to i32
%69 = call i32 @bitcount(i32 %68)
%70 = call i32 @csprng(i32 %69)
%71 = load i64, i64* %6
%72 = trunc i64 %71 to i32
%73 = load i64, i64* %7
%74 = trunc i64 %73 to i32
%75 = call signext i8 @lrand(i32 %70, i32 %72, i32 %74)
%76 = sext i8 %75 to i64
store i64 %76, i64* %9
br label %77
77: ; preds = %81, %64
%78 = load i64, i64* %9
%79 = add i64 %78, -1
store i64 %79, i64* %9
%80 = icmp ne i64 %78, 0
br i1 %80, label %81, label %86
81: ; preds = %77
%82 = call i32 @bitcount(i32 93)
%83 = call i32 @csprng(i32 %82)
%84 = call signext i8 @lrand(i32 %83, i32 33, i32 126)
%85 = call i32 @putchar(i8 signext %84)
br label %77
86: ; preds = %77
%87 = call i32 @putchar(i8 signext 10)
br label %60
88: ; preds = %60
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Usage:\0A\09rpg [min-length] max-length [how-many]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %14 [
i32 1, label %18
i32 2, label %3
i32 3, label %7
i32 4, label %24
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i64 @strtoull(i8* nocapture %5, i32* null, i32 10)
br label %18
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @strtoull(i8* nocapture %9, i32* null, i32 10)
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i64 @strtoull(i8* nocapture %12, i32* null, i32 10)
br label %18
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%17 = tail call i32 @exit(i32 1)
unreachable
18: ; preds = %7, %3, %2
%19 = phi i64 [ 8, %2 ], [ %6, %3 ], [ %10, %7 ]
%20 = phi i64 [ 16, %2 ], [ %6, %3 ], [ %13, %7 ]
%21 = icmp ugt i64 %19, %20
%22 = select i1 %21, i64 %20, i64 %19
%23 = select i1 %21, i64 %19, i64 %20
br label %38
24: ; preds = %2
%25 = getelementptr inbounds i8*, i8** %1, i64 1
%26 = load i8*, i8** %25
%27 = tail call i64 @strtoull(i8* nocapture %26, i32* null, i32 10)
%28 = getelementptr inbounds i8*, i8** %1, i64 2
%29 = load i8*, i8** %28
%30 = tail call i64 @strtoull(i8* nocapture %29, i32* null, i32 10)
%31 = getelementptr inbounds i8*, i8** %1, i64 3
%32 = load i8*, i8** %31
%33 = tail call i64 @strtoull(i8* nocapture %32, i32* null, i32 10)
%34 = icmp ugt i64 %27, %30
%35 = select i1 %34, i64 %30, i64 %27
%36 = select i1 %34, i64 %27, i64 %30
%37 = icmp eq i64 %33, 0
br i1 %37, label %66, label %38
38: ; preds = %18, %24
%39 = phi i64 [ %23, %18 ], [ %36, %24 ]
%40 = phi i64 [ %22, %18 ], [ %35, %24 ]
%41 = phi i64 [ 1, %18 ], [ %33, %24 ]
%42 = sub i64 %39, %40
%43 = trunc i64 %42 to i32
%44 = trunc i64 %40 to i32
%45 = trunc i64 %39 to i32
br label %46
46: ; preds = %38, %63
%47 = phi i64 [ %41, %38 ], [ %48, %63 ]
%48 = add i64 %47, -1
%49 = tail call i32 @bitcount(i32 %43)
%50 = tail call i32 @csprng(i32 %49)
%51 = tail call signext i8 @lrand(i32 %50, i32 %44, i32 %45)
%52 = icmp eq i8 %51, 0
br i1 %52, label %63, label %53
53: ; preds = %46
%54 = sext i8 %51 to i64
br label %55
55: ; preds = %53, %55
%56 = phi i64 [ %57, %55 ], [ %54, %53 ]
%57 = add i64 %56, -1
%58 = tail call i32 @bitcount(i32 93)
%59 = tail call i32 @csprng(i32 %58)
%60 = tail call signext i8 @lrand(i32 %59, i32 33, i32 126)
%61 = tail call i32 @putchar(i8 signext %60)
%62 = icmp eq i64 %57, 0
br i1 %62, label %63, label %55
63: ; preds = %55, %46
%64 = tail call i32 @putchar(i8 signext 10)
%65 = icmp eq i64 %48, 0
br i1 %65, label %66, label %46
66: ; preds = %63, %24
ret i32 0
}