#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 */
unsigned int atoi(char *);
int atol(char *);
int /*<<< orphan*/ help();
int /*<<< orphan*/ printf(char *, char);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  unsigned int len;
  char n;
  srand(time(NULL));
  if (argc != 2) {
    help();
    return (1);
  }
  if (atol(argv[1]) < 1 || atol(argv[1]) > 65535) {
    help();
    return (1);
  }
  len = atoi(argv[1]);
  while (len > 0) {
    n = (rand() % 43) + 48;
    if (n >= 58 && n <= 64)
      continue;
    printf("%c", n);
    len--;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
cmpl   $0x2,-0x8(%rbp)
je     11b3 <main+0x43>
mov    $0x0,%al
call   1070 <help@plt>
movl   $0x1,-0x4(%rbp)
jmp    1269 <main+0xf9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atol@plt>
cmp    $0x1,%eax
jl     11e1 <main+0x71>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atol@plt>
cmp    $0xffff,%eax
jle    11f4 <main+0x84>
mov    $0x0,%al
call   1070 <help@plt>
movl   $0x1,-0x4(%rbp)
jmp    1269 <main+0xf9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jbe    1262 <main+0xf2>
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0x2b,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
cmp    $0x3a,%eax
jl     1244 <main+0xd4>
movsbl -0x15(%rbp),%eax
cmp    $0x40,%eax
jg     1244 <main+0xd4>
jmp    1204 <main+0x94>
lea    0xdb5(%rip),%rdi
movsbl -0x15(%rbp),%esi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1204 <main+0x94>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
cmp    $0x2,%ebp
jne    11a4 <main+0x34>
mov    0x8(%rbx),%rbx
mov    %rbx,%rdi
call   1060 <atol@plt>
add    $0xffff0000,%eax
cmp    $0xffff0001,%eax
jae    11b2 <main+0x42>
xor    %eax,%eax
call   1070 <help@plt>
mov    $0x1,%eax
jmp    120e <main+0x9e>
mov    %rbx,%rdi
call   1080 <atoi@plt>
test   %eax,%eax
je     120c <main+0x9c>
mov    %eax,%ebx
lea    0xe39(%rip),%r14
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1090 <rand@plt>
cltq
imul   $0x2fa0be83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
imul   $0x2b,%ecx,%ecx
sub    %ecx,%eax
lea    -0xa(%rax),%ecx
cmp    $0x7,%cl
jb     11d0 <main+0x60>
add    $0x30,%al
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    11d0 <main+0x60>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @time(i32* null)
%9 = call i32 @srand(i32 %8)
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @help()
store i32 1, i32* %3
br label %55
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @atol(i8* %17)
%19 = icmp slt i32 %18, 1
br i1 %19, label %26, label %20
20: ; preds = %14
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @atol(i8* %23)
%25 = icmp sgt i32 %24, 65535
br i1 %25, label %26, label %28
26: ; preds = %20, %14
%27 = call i32 (...) @help()
store i32 1, i32* %3
br label %55
28: ; preds = %20
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 @atoi(i8* %31)
store i32 %32, i32* %6
br label %33
33: ; preds = %49, %48, %28
%34 = load i32, i32* %6
%35 = icmp ugt i32 %34, 0
br i1 %35, label %36, label %54
36: ; preds = %33
%37 = call i32 (...) @rand()
%38 = srem i32 %37, 43
%39 = add nsw i32 %38, 48
%40 = trunc i32 %39 to i8
store i8 %40, i8* %7
%41 = load i8, i8* %7
%42 = sext i8 %41 to i32
%43 = icmp sge i32 %42, 58
br i1 %43, label %44, label %49
44: ; preds = %36
%45 = load i8, i8* %7
%46 = sext i8 %45 to i32
%47 = icmp sle i32 %46, 64
br i1 %47, label %48, label %49
48: ; preds = %44
br label %33
49: ; preds = %44, %36
%50 = load i8, i8* %7
%51 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %50)
%52 = load i32, i32* %6
%53 = add i32 %52, -1
store i32 %53, i32* %6
br label %33
54: ; preds = %33
store i32 0, i32* %3
br label %55
55: ; preds = %54, %26, %12
%56 = load i32, i32* %3
ret i32 %56
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %29
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atol(i8* %8)
%10 = add i32 %9, -65536
%11 = icmp ult i32 %10, -65535
br i1 %11, label %29, label %12
12: ; preds = %6
%13 = tail call i32 @atoi(i8* %8)
%14 = icmp eq i32 %13, 0
br i1 %14, label %31, label %15
15: ; preds = %12, %23
%16 = phi i32 [ %27, %23 ], [ %13, %12 ]
br label %17
17: ; preds = %15, %17
%18 = tail call i32 (...) @rand()
%19 = srem i32 %18, 43
%20 = trunc i32 %19 to i8
%21 = add nsw i8 %20, -10
%22 = icmp ult i8 %21, 7
br i1 %22, label %17, label %23
23: ; preds = %17
%24 = trunc i32 %19 to i8
%25 = add nsw i8 %24, 48
%26 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %25)
%27 = add i32 %16, -1
%28 = icmp eq i32 %27, 0
br i1 %28, label %31, label %15
29: ; preds = %6, %2
%30 = tail call i32 (...) @help()
br label %31
31: ; preds = %23, %29, %12
%32 = phi i32 [ 0, %12 ], [ 1, %29 ], [ 0, %23 ]
ret i32 %32
}