#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 erand48(unsigned short *);
int /*<<< orphan*/ exit(int);
double floor(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, int *);
unsigned short time(int /*<<< orphan*/);
void main(int argc, char *argv[]) {
  int nsites, d, i;
  unsigned short X[3];
  if (!argv[1] || !argv[2])
    exit(3);
  sscanf(argv[1], "%d", &nsites);
  sscanf(argv[2], "%d", &d);
  X[1] = time(0);
  while (nsites > 0) {
    for (i = 0; i < d; i++)
      printf("%6.0f ", floor(1e6 * erand48(X)));
    printf("\n");
    nsites--;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     118d <main+0x2d>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    1197 <main+0x37>
mov    $0x3,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe62(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe4a(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <sscanf@plt>
xor    %edi,%edi
call   1040 <time@plt>
mov    %ax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1249 <main+0xe9>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    122d <main+0xcd>
lea    -0x22(%rbp),%rdi
call   1060 <erand48@plt>
cvtsi2sd %eax,%xmm1
movsd  0xdfc(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1080 <floor@plt>
lea    0xdf3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11e3 <main+0x83>
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    11d2 <main+0x72>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     124e <main+0xde>
mov    %rsi,%rbx
cmpq   $0x0,0x10(%rsi)
je     124e <main+0xde>
lea    0xe6e(%rip),%r14
mov    %rsp,%rdx
mov    %r14,%rsi
call   1060 <sscanf@plt>
mov    0x10(%rbx),%rdi
lea    0x4(%rsp),%rdx
mov    %r14,%rsi
call   1060 <sscanf@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %ax,0xc(%rsp)
cmpl   $0x0,(%rsp)
jle    1245 <main+0xd5>
lea    0xa(%rsp),%r14
lea    0xe37(%rip),%rbx
jmp    11f8 <main+0x88>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,(%rsp)
cmp    $0x1,%eax
jle    1245 <main+0xd5>
cmpl   $0x0,0x4(%rsp)
jle    11e0 <main+0x70>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1070 <erand48@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xdd9(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1090 <floor@plt>
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1210 <main+0xa0>
jmp    11e0 <main+0x70>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0x3,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%6.0f \00"
@.str.2 = [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 [3 x i16]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i8**, i8*** %4
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = icmp ne i8* %16, null
br i1 %17, label %20, label %18
18: ; preds = %13, %2
%19 = call i32 @exit(i32 3)
unreachable
20: ; preds = %13
%21 = load i8**, i8*** %4
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%25 = load i8**, i8*** %4
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i32 @sscanf(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%29 = call zeroext i16 @time(i32 0)
%30 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 1
store i16 %29, i16* %30
br label %31
31: ; preds = %50, %20
%32 = load i32, i32* %5
%33 = icmp sgt i32 %32, 0
br i1 %33, label %34, label %54
34: ; preds = %31
store i32 0, i32* %7
br label %35
35: ; preds = %47, %34
%36 = load i32, i32* %7
%37 = load i32, i32* %6
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %50
39: ; preds = %35
%40 = getelementptr inbounds [3 x i16], [3 x i16]* %8, i64 0, i64 0
%41 = call i32 @erand48(i16* %40)
%42 = sitofp i32 %41 to double
%43 = fmul double 1.000000e+06, %42
%44 = fptosi double %43 to i32
%45 = call double @floor(i32 %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %45)
br label %47
47: ; preds = %39
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 1
store i32 %49, i32* %7
br label %35
50: ; preds = %35
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%52 = load i32, i32* %5
%53 = add nsw i32 %52, -1
store i32 %53, i32* %5
br label %31
54: ; preds = %31
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%6.0f \00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [3 x i16]
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast [3 x i16]* %5 to i8*
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %12, %2
%17 = tail call i32 @exit(i32 3)
unreachable
18: ; preds = %12
%19 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%20 = load i8*, i8** %13
%21 = call i32 @sscanf(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%22 = call zeroext i16 @time(i32 0)
%23 = getelementptr inbounds [3 x i16], [3 x i16]* %5, i64 0, i64 1
store i16 %22, i16* %23
%24 = load i32, i32* %3
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %47
26: ; preds = %18
%27 = getelementptr inbounds [3 x i16], [3 x i16]* %5, i64 0, i64 0
br label %28
28: ; preds = %26, %42
%29 = load i32, i32* %4
%30 = icmp sgt i32 %29, 0
br i1 %30, label %31, label %42
31: ; preds = %28, %31
%32 = phi i32 [ %39, %31 ], [ 0, %28 ]
%33 = call i32 @erand48(i16* %27)
%34 = sitofp i32 %33 to double
%35 = fmul double %34, 1.000000e+06
%36 = fptosi double %35 to i32
%37 = call double @floor(i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %37)
%39 = add nuw nsw i32 %32, 1
%40 = load i32, i32* %4
%41 = icmp slt i32 %39, %40
br i1 %41, label %31, label %42
42: ; preds = %31, %28
%43 = call i32 @putchar(i32 10)
%44 = load i32, i32* %3
%45 = add nsw i32 %44, -1
store i32 %45, i32* %3
%46 = icmp sgt i32 %44, 1
br i1 %46, label %28, label %47
47: ; preds = %42, %18
ret void
}