#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 */
float RAND_MAX;
void **arghandler(int, char const **);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, const char *argv[]) {
  srand(time(NULL));
  void **args;
  args = arghandler(argc, argv);
  int i;
  int min, max;
  long int numb;
  numb = *(long int *)args[0];
  max = *(int *)args[1];
  min = *(int *)args[2];
  for (i = 0; i < numb; i++)
    printf("%i\n", min + (int)((max - min) * ((float)rand() / RAND_MAX)));
  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)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <arghandler@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    121b <main+0xcb>
mov    -0x20(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x24(%rbp),%eax
sub    -0x20(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x38(%rbp)
mov    $0x0,%al
call   1070 <rand@plt>
movss  -0x38(%rbp),%xmm0
mov    -0x34(%rbp),%esi
cvtsi2ss %rax,%xmm1
mov    0x2df5(%rip),%rax
divss  (%rax),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
add    %eax,%esi
lea    0xdf8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b5 <main+0x65>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <arghandler@plt>
mov    (%rax),%rcx
mov    (%rcx),%rbp
test   %rbp,%rbp
jle    11de <main+0x8e>
mov    0x10(%rax),%rcx
mov    (%rcx),%ebx
mov    0x8(%rax),%rax
mov    (%rax),%eax
sub    %ebx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x4(%rsp)
mov    0x2e4a(%rip),%r15
lea    0xe5b(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1070 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
divss  (%r15),%xmm0
mulss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%esi
add    %ebx,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbp
jne    11b0 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
@RAND_MAX = global float 0.000000e+00
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 @time(i32* null)
%12 = call i32 @srand(i32 %11)
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i8** @arghandler(i32 %13, i8** %14)
store i8** %15, i8*** %6
%16 = load i8**, i8*** %6
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = bitcast i8* %18 to i64*
%20 = load i64, i64* %19
store i64 %20, i64* %10
%21 = load i8**, i8*** %6
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = bitcast i8* %23 to i32*
%25 = load i32, i32* %24
store i32 %25, i32* %9
%26 = load i8**, i8*** %6
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
%29 = bitcast i8* %28 to i32*
%30 = load i32, i32* %29
store i32 %30, i32* %8
store i32 0, i32* %7
br label %31
31: ; preds = %50, %2
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = load i64, i64* %10
%35 = icmp slt i64 %33, %34
br i1 %35, label %36, label %53
36: ; preds = %31
%37 = load i32, i32* %8
%38 = load i32, i32* %9
%39 = load i32, i32* %8
%40 = sub nsw i32 %38, %39
%41 = sitofp i32 %40 to float
%42 = call i64 (...) @rand()
%43 = sitofp i64 %42 to float
%44 = load float, float* @RAND_MAX
%45 = fdiv float %43, %44
%46 = fmul float %41, %45
%47 = fptosi float %46 to i32
%48 = add nsw i32 %37, %47
%49 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %48)
br label %50
50: ; preds = %36
%51 = load i32, i32* %7
%52 = add nsw i32 %51, 1
store i32 %52, i32* %7
br label %31
53: ; preds = %31
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
@RAND_MAX = global float 0.000000e+00
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = tail call i8** @arghandler(i32 %0, i8** %1)
%6 = bitcast i8** %5 to i64**
%7 = load i64*, i64** %6
%8 = load i64, i64* %7
%9 = getelementptr inbounds i8*, i8** %5, i64 2
%10 = bitcast i8** %9 to i32**
%11 = load i32*, i32** %10
%12 = load i32, i32* %11
%13 = icmp sgt i64 %8, 0
br i1 %13, label %14, label %33
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %5, i64 1
%16 = bitcast i8** %15 to i32**
%17 = load i32*, i32** %16
%18 = load i32, i32* %17
%19 = sub nsw i32 %18, %12
%20 = sitofp i32 %19 to float
br label %21
21: ; preds = %14, %21
%22 = phi i64 [ 0, %14 ], [ %31, %21 ]
%23 = tail call i64 (...) @rand()
%24 = sitofp i64 %23 to float
%25 = load float, float* @RAND_MAX
%26 = fdiv float %24, %25
%27 = fmul float %26, %20
%28 = fptosi float %27 to i32
%29 = add nsw i32 %12, %28
%30 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = add nuw nsw i64 %22, 1
%32 = icmp eq i64 %31, %8
br i1 %32, label %33, label %21
33: ; preds = %21, %2
ret i32 0
}