#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 */
typedef int uintmax_t;
typedef scalar_t__ intmax_t;

/* Variables and functions */
int INTMAX_MAX;
int abs(int);
scalar_t__ atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  intmax_t i, choice, whole, fraction, num_rand;
  char buf[1024], sign[2];
  if (argc != 2) {
    printf("Please input the number of lines to be generated.\n");
    return -1;
  }
  num_rand = atoi(argv[1]);
  srand(time(NULL));
  for (i = 0; i < num_rand; i++) {
    whole = (((uintmax_t)rand() << 32) | (uintmax_t)rand()) %
            ((INTMAX_MAX >> 1) / 100);
    fraction = abs(rand()) % 100;
    if (rand() % 2 == 0)
      sprintf(sign, "");
    else
      sprintf(sign, "-");
    choice = rand() % 21;
    if (choice == 0) {
      printf("%s0.%ju\n", sign, fraction);
    } else if (0 < choice && choice < 11) {
      sprintf(buf, "%ju", whole);
      printf("%s%.*s.%ju\n", sign, rand() % 17 + 1, buf, fraction);
    } else {
      sprintf(buf, "%ju", whole);
      printf("%s%.*s\n", sign, rand() % 17 + 1, buf);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11ad <main+0x3d>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13c4 <main+0x254>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x38(%rbp),%rax
jge    13bd <main+0x24d>
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x44c(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    %eax,%ecx
mov    -0x44c(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x448(%rbp)
mov    0x2dd2(%rip),%rax
mov    (%rax),%eax
sar    $0x1,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x448(%rbp),%eax
cltd
idiv   %ecx
movslq %edx,%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    %eax,%edi
call   1030 <abs@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1284 <main+0x114>
lea    -0x442(%rbp),%rdi
lea    0xdba(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
jmp    1299 <main+0x129>
lea    -0x442(%rbp),%rdi
lea    0xda1(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
mov    $0x0,%al
call   1090 <rand@plt>
mov    $0x15,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12d8 <main+0x168>
lea    -0x442(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    0xd69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13a7 <main+0x237>
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jge    134d <main+0x1dd>
cmpq   $0xb,-0x20(%rbp)
jge    134d <main+0x1dd>
lea    -0x440(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xd3d(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
lea    -0x442(%rbp),%rax
mov    %rax,-0x458(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    -0x458(%rbp),%rsi
mov    $0x11,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
lea    -0x440(%rbp),%rcx
mov    -0x30(%rbp),%r8
lea    0xd01(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13a2 <main+0x232>
lea    -0x440(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xcdf(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
lea    -0x442(%rbp),%rax
mov    %rax,-0x460(%rbp)
mov    $0x0,%al
call   1090 <rand@plt>
mov    -0x460(%rbp),%rsi
mov    $0x11,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
lea    -0x440(%rbp),%rcx
lea    0xcb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13a7 <main+0x237>
jmp    13ac <main+0x23c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11d6 <main+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
cmp    $0x2,%edi
jne    12e9 <main+0x179>
mov    0x8(%rsi),%rdi
call   1070 <atoi@plt>
mov    %rax,%rbx
xor    %ebp,%ebp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
test   %rbx,%rbx
jle    12fe <main+0x18e>
lea    0xe(%rsp),%r15
lea    0xe4e(%rip),%r12
lea    0x10(%rsp),%r13
jmp    11ee <main+0x7e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xe29(%rip),%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbx
je     12fc <main+0x18c>
xor    %eax,%eax
call   1090 <rand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
mov    %eax,%ebp
neg    %ebp
cmovs  %eax,%ebp
imul   $0x51eb851f,%rbp,%rax
shr    $0x25,%rax
imul   $0x64,%eax,%eax
sub    %eax,%ebp
xor    %eax,%eax
call   1090 <rand@plt>
test   $0x1,%al
jne    1230 <main+0xc0>
movb   $0x0,0xe(%rsp)
jmp    1237 <main+0xc7>
nopl   0x0(%rax)
movw   $0x2d,0xe(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
movslq %eax,%r14
imul   $0x30c30c31,%r14,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,4),%eax
sub    %eax,%r14d
je     11d0 <main+0x60>
add    $0xffffffff,%r14d
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <sprintf@plt>
xor    %eax,%eax
call   1090 <rand@plt>
cltq
imul   $0x78787879,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
add    %ecx,%edx
neg    %edx
add    %eax,%edx
add    $0x1,%edx
cmp    $0x9,%r14d
ja     12d0 <main+0x160>
lea    0xd60(%rip),%rdi
mov    %r15,%rsi
mov    %r13,%rcx
mov    %rbp,%r8
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11e4 <main+0x74>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xd42(%rip),%rdi
mov    %r15,%rsi
mov    %r13,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11e4 <main+0x74>
lea    0xd31(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebp
jmp    12fe <main+0x18e>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Please input the number of lines to be generated.\0A\00"
@INTMAX_MAX = global i32 0
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"-\00"
@.str.3 = [9 x i8] c"%s0.%ju\0A\00"
@.str.4 = [4 x i8] c"%ju\00"
@.str.5 = [12 x i8] c"%s%.*s.%ju\0A\00"
@.str.6 = [8 x i8] c"%s%.*s\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
%10 = alloca i64
%11 = alloca [1024 x i8]
%12 = alloca [2 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %94
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i64 @atoi(i8* %20)
store i64 %21, i64* %10
%22 = call i32 @time(i32* null)
%23 = call i32 @srand(i32 %22)
store i64 0, i64* %6
br label %24
24: ; preds = %90, %17
%25 = load i64, i64* %6
%26 = load i64, i64* %10
%27 = icmp slt i64 %25, %26
br i1 %27, label %28, label %93
28: ; preds = %24
%29 = call i32 (...) @rand()
%30 = shl i32 %29, 32
%31 = call i32 (...) @rand()
%32 = or i32 %30, %31
%33 = load i32, i32* @INTMAX_MAX
%34 = ashr i32 %33, 1
%35 = sdiv i32 %34, 100
%36 = srem i32 %32, %35
%37 = sext i32 %36 to i64
store i64 %37, i64* %8
%38 = call i32 (...) @rand()
%39 = call i32 @abs(i32 %38)
%40 = srem i32 %39, 100
%41 = sext i32 %40 to i64
store i64 %41, i64* %9
%42 = call i32 (...) @rand()
%43 = srem i32 %42, 2
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %28
%46 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%47 = call i32 (i8*, i8*, ...) @sprintf(i8* %46, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %51
48: ; preds = %28
%49 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%50 = call i32 (i8*, i8*, ...) @sprintf(i8* %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %51
51: ; preds = %48, %45
%52 = call i32 (...) @rand()
%53 = srem i32 %52, 21
%54 = sext i32 %53 to i64
store i64 %54, i64* %7
%55 = load i64, i64* %7
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %61
57: ; preds = %51
%58 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%59 = load i64, i64* %9
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %58, i64 %59)
br label %89
61: ; preds = %51
%62 = load i64, i64* %7
%63 = icmp slt i64 0, %62
br i1 %63, label %64, label %78
64: ; preds = %61
%65 = load i64, i64* %7
%66 = icmp slt i64 %65, 11
br i1 %66, label %67, label %78
67: ; preds = %64
%68 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%69 = load i64, i64* %8
%70 = call i32 (i8*, i8*, ...) @sprintf(i8* %68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64 %69)
%71 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%72 = call i32 (...) @rand()
%73 = srem i32 %72, 17
%74 = add nsw i32 %73, 1
%75 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%76 = load i64, i64* %9
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %71, i32 %74, i8* %75, i64 %76)
br label %88
78: ; preds = %64, %61
%79 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%80 = load i64, i64* %8
%81 = call i32 (i8*, i8*, ...) @sprintf(i8* %79, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64 %80)
%82 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 0
%83 = call i32 (...) @rand()
%84 = srem i32 %83, 17
%85 = add nsw i32 %84, 1
%86 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %82, i32 %85, i8* %86)
br label %88
88: ; preds = %78, %67
br label %89
89: ; preds = %88, %57
br label %90
90: ; preds = %89
%91 = load i64, i64* %6
%92 = add nsw i64 %91, 1
store i64 %92, i64* %6
br label %24
93: ; preds = %24
store i32 0, i32* %3
br label %94
94: ; preds = %93, %15
%95 = load i32, i32* %3
ret i32 %95
}

LLVM IR (-O2):
@INTMAX_MAX = global i32 0
@.str.3 = [9 x i8] c"%s0.%ju\0A\00"
@.str.4 = [4 x i8] c"%ju\00"
@.str.5 = [12 x i8] c"%s%.*s.%ju\0A\00"
@.str.6 = [8 x i8] c"%s%.*s\0A\00"
@str = [50 x i8] c"Please input the number of lines to be generated.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca i16
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = bitcast i16* %4 to i8*
%7 = icmp eq i32 %0, 2
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
br label %50
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i64 @atoi(i8* %12)
%14 = tail call i32 @time(i32* null)
%15 = tail call i32 @srand(i32 %14)
%16 = icmp sgt i64 %13, 0
br i1 %16, label %17, label %50
17: ; preds = %10, %47
%18 = phi i64 [ %48, %47 ], [ 0, %10 ]
%19 = call i32 (...) @rand()
%20 = call i32 (...) @rand()
%21 = call i32 (...) @rand()
%22 = call i32 @llvm.abs.i32(i32 %21, i1 true)
%23 = urem i32 %22, 100
%24 = zext i32 %23 to i64
%25 = call i32 (...) @rand()
%26 = and i32 %25, 1
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %17
store i8 0, i8* %6
br label %30
29: ; preds = %17
store i16 45, i16* %4
br label %30
30: ; preds = %29, %28
%31 = call i32 (...) @rand()
%32 = srem i32 %31, 21
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i16* %4, i64 %24)
br label %47
36: ; preds = %30
%37 = add nsw i32 %32, -1
%38 = icmp ult i32 %37, 10
%39 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64 poison)
%40 = call i32 (...) @rand()
%41 = srem i32 %40, 17
%42 = add nsw i32 %41, 1
br i1 %38, label %43, label %45
43: ; preds = %36
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i16* %4, i32 %42, i8* %5, i64 %24)
br label %47
45: ; preds = %36
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i16* %4, i32 %42, i8* %5)
br label %47
47: ; preds = %34, %45, %43
%48 = add nuw nsw i64 %18, 1
%49 = icmp eq i64 %48, %13
br i1 %49, label %50, label %17
50: ; preds = %47, %10, %8
%51 = phi i32 [ -1, %8 ], [ 0, %10 ], [ 0, %47 ]
ret i32 %51
}