#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 scalar_t__ uintmax_t;

/* Variables and functions */
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) {
  uintmax_t i, num_rand, whole, fraction, choice;
  char 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();
    fraction = ((uintmax_t)rand() << 32) | (uintmax_t)rand();
    if (rand() % 2 == 0)
      sprintf(sign, "");
    else
      sprintf(sign, "-");
    choice = rand() % 3;
    if (choice == 0)
      printf("%s%ju.%ju\n", sign, whole, fraction);
    else if (choice == 1)
      printf("%s%ju\n", sign, whole);
    else
      printf("%s0.%ju\n", sign, fraction);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     119a <main+0x3a>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12fc <main+0x19c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    12f5 <main+0x195>
mov    $0x0,%al
call   1080 <rand@plt>
cltq
shl    $0x20,%rax
mov    %rax,-0x50(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
or     %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
cltq
shl    $0x20,%rax
mov    %rax,-0x48(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%rax
movslq %ecx,%rcx
or     %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    124e <main+0xee>
lea    -0x3a(%rbp),%rdi
lea    0xdee(%rip),%rsi
call   1070 <sprintf@plt>
jmp    125e <main+0xfe>
lea    -0x3a(%rbp),%rdi
lea    0xdda(%rip),%rsi
call   1070 <sprintf@plt>
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    129e <main+0x13e>
lea    -0x3a(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12df <main+0x17f>
cmpq   $0x1,-0x38(%rbp)
jne    12c4 <main+0x164>
lea    -0x3a(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xd88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12da <main+0x17a>
lea    -0x3a(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    0xd74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12df <main+0x17f>
jmp    12e4 <main+0x184>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11c3 <main+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    1282 <main+0x122>
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    1297 <main+0x137>
lea    0x6(%rsp),%r15
jmp    11be <main+0x5e>
lea    0xe6b(%rip),%rdi
mov    %r15,%rsi
mov    %rcx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbx
je     1295 <main+0x135>
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebp
shl    $0x20,%rbp
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%r13d
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1080 <rand@plt>
test   $0x1,%al
jne    1200 <main+0xa0>
movb   $0x0,0x6(%rsp)
jmp    1207 <main+0xa7>
nopl   0x0(%rax,%rax,1)
movw   $0x2d,0x6(%rsp)
movslq %r13d,%rax
or     %rax,%rbp
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cmp    $0x1,%eax
je     1270 <main+0x110>
shl    $0x20,%r14
movslq %r12d,%rcx
or     %r14,%rcx
test   %eax,%eax
jne    11a0 <main+0x40>
lea    0xdb3(%rip),%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbx
jne    11be <main+0x5e>
jmp    1295 <main+0x135>
cs nopw 0x0(%rax,%rax,1)
lea    0xd94(%rip),%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
jmp    11ad <main+0x4d>
lea    0xd92(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebp
jmp    1297 <main+0x137>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%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"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"-\00"
@.str.3 = [11 x i8] c"%s%ju.%ju\0A\00"
@.str.4 = [7 x i8] c"%s%ju\0A\00"
@.str.5 = [9 x i8] c"%s0.%ju\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 [2 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = 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 %77
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i64 @atoi(i8* %19)
store i64 %20, i64* %7
%21 = call i32 @time(i32* null)
%22 = call i32 @srand(i32 %21)
store i64 0, i64* %6
br label %23
23: ; preds = %73, %16
%24 = load i64, i64* %6
%25 = load i64, i64* %7
%26 = icmp slt i64 %24, %25
br i1 %26, label %27, label %76
27: ; preds = %23
%28 = call i32 (...) @rand()
%29 = sext i32 %28 to i64
%30 = shl i64 %29, 32
%31 = call i32 (...) @rand()
%32 = sext i32 %31 to i64
%33 = or i64 %30, %32
store i64 %33, i64* %8
%34 = call i32 (...) @rand()
%35 = sext i32 %34 to i64
%36 = shl i64 %35, 32
%37 = call i32 (...) @rand()
%38 = sext i32 %37 to i64
%39 = or i64 %36, %38
store i64 %39, i64* %9
%40 = call i32 (...) @rand()
%41 = srem i32 %40, 2
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %27
%44 = getelementptr inbounds [2 x i8], [2 x i8]* %11, i64 0, i64 0
%45 = call i32 @sprintf(i8* %44, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %49
46: ; preds = %27
%47 = getelementptr inbounds [2 x i8], [2 x i8]* %11, i64 0, i64 0
%48 = call i32 @sprintf(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %49
49: ; preds = %46, %43
%50 = call i32 (...) @rand()
%51 = srem i32 %50, 3
%52 = sext i32 %51 to i64
store i64 %52, i64* %10
%53 = load i64, i64* %10
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %60
55: ; preds = %49
%56 = getelementptr inbounds [2 x i8], [2 x i8]* %11, i64 0, i64 0
%57 = load i64, i64* %8
%58 = load i64, i64* %9
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %56, i64 %57, i64 %58)
br label %72
60: ; preds = %49
%61 = load i64, i64* %10
%62 = icmp eq i64 %61, 1
br i1 %62, label %63, label %67
63: ; preds = %60
%64 = getelementptr inbounds [2 x i8], [2 x i8]* %11, i64 0, i64 0
%65 = load i64, i64* %8
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %64, i64 %65)
br label %71
67: ; preds = %60
%68 = getelementptr inbounds [2 x i8], [2 x i8]* %11, i64 0, i64 0
%69 = load i64, i64* %9
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* %68, i64 %69)
br label %71
71: ; preds = %67, %63
br label %72
72: ; preds = %71, %55
br label %73
73: ; preds = %72
%74 = load i64, i64* %6
%75 = add nsw i64 %74, 1
store i64 %75, i64* %6
br label %23
76: ; preds = %23
store i32 0, i32* %3
br label %77
77: ; preds = %76, %14
%78 = load i32, i32* %3
ret i32 %78
}

LLVM IR (-O2):
@.str.3 = [11 x i8] c"%s%ju.%ju\0A\00"
@.str.4 = [7 x i8] c"%s%ju\0A\00"
@.str.5 = [9 x i8] c"%s0.%ju\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 i16
%4 = bitcast i16* %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
br label %46
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i64 @atoi(i8* %10)
%12 = tail call i32 @time(i32* null)
%13 = tail call i32 @srand(i32 %12)
%14 = icmp sgt i64 %11, 0
br i1 %14, label %15, label %46
15: ; preds = %8, %43
%16 = phi i64 [ %44, %43 ], [ 0, %8 ]
%17 = call i32 (...) @rand()
%18 = zext i32 %17 to i64
%19 = shl nuw i64 %18, 32
%20 = call i32 (...) @rand()
%21 = sext i32 %20 to i64
%22 = or i64 %19, %21
%23 = call i32 (...) @rand()
%24 = zext i32 %23 to i64
%25 = shl nuw i64 %24, 32
%26 = call i32 (...) @rand()
%27 = sext i32 %26 to i64
%28 = or i64 %25, %27
%29 = call i32 (...) @rand()
%30 = and i32 %29, 1
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %15
store i8 0, i8* %4
br label %34
33: ; preds = %15
store i16 45, i16* %3
br label %34
34: ; preds = %33, %32
%35 = call i32 (...) @rand()
%36 = srem i32 %35, 3
switch i32 %36, label %41 [
i32 0, label %37
i32 1, label %39
]
37: ; preds = %34
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i16* %3, i64 %22, i64 %28)
br label %43
39: ; preds = %34
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i16* %3, i64 %22)
br label %43
41: ; preds = %34
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i16* %3, i64 %28)
br label %43
43: ; preds = %37, %41, %39
%44 = add nuw nsw i64 %16, 1
%45 = icmp eq i64 %44, %11
br i1 %45, label %46, label %15
46: ; preds = %43, %8, %6
%47 = phi i32 [ -1, %6 ], [ 0, %8 ], [ 0, %43 ]
ret i32 %47
}