#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 /*<<< orphan*/ time_t;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ checkIntInput(int *, int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  int nums, min, max, randNum;
  time_t t;
  srand((unsigned)time(&t));
  printf("Enter numbers, min and max: ");
  checkIntInput(&nums, &min, &max);
  int i;
  for (i = 0; i < nums; i++) {
    randNum = (rand() % (max + 1 - min) + min);
    printf("%d\n", randNum);
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <checkIntInput@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d9 <main+0x89>
mov    $0x0,%al
call   1070 <rand@plt>
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%edx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1195 <main+0x45>
mov    0x2e00(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0x14(%rsp),%rdi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    0xe92(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <checkIntInput@plt>
cmpl   $0x0,0x8(%rsp)
jle    11cc <main+0x7c>
lea    0xe86(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <rand@plt>
mov    0xc(%rsp),%ecx
mov    0x10(%rsp),%esi
sub    %esi,%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
add    %edx,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jl     11a0 <main+0x50>
mov    0x2e0d(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Enter numbers, min and max: \00"
@.str.1 = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i64 @time(i32* %6)
%9 = trunc i64 %8 to i32
%10 = call i32 @srand(i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @checkIntInput(i32* %2, i32* %3, i32* %4)
store i32 0, i32* %7
br label %13
13: ; preds = %28, %0
%14 = load i32, i32* %7
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %31
17: ; preds = %13
%18 = call i32 (...) @rand()
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
%21 = load i32, i32* %3
%22 = sub nsw i32 %20, %21
%23 = srem i32 %18, %22
%24 = load i32, i32* %3
%25 = add nsw i32 %23, %24
store i32 %25, i32* %5
%26 = load i32, i32* %5
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %17
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %13
31: ; preds = %13
%32 = load i32, i32* @EXIT_SUCCESS
ret i32 %32
}

LLVM IR (-O2):
@.str = [29 x i8] c"Enter numbers, min and max: \00"
@.str.1 = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i64 @time(i32* %4)
%10 = trunc i64 %9 to i32
%11 = call i32 @srand(i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @checkIntInput(i32* %1, i32* %2, i32* %3)
%14 = load i32, i32* %1
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %29
16: ; preds = %0, %16
%17 = phi i32 [ %26, %16 ], [ 0, %0 ]
%18 = call i32 (...) @rand()
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
%21 = load i32, i32* %2
%22 = sub i32 %20, %21
%23 = srem i32 %18, %22
%24 = add nsw i32 %23, %21
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = add nuw nsw i32 %17, 1
%27 = load i32, i32* %1
%28 = icmp slt i32 %26, %27
br i1 %28, label %16, label %29
29: ; preds = %16, %0
%30 = load i32, i32* @EXIT_SUCCESS
ret i32 %30
}