#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ srand(unsigned int);
int main(void) {
  unsigned int seed;
  int a;
  int b;
  int k;
  int rand_int(int a, int b);
  char go_on[3] = "y";
  while (go_on[0] == 'y' || go_on[0] == 'Y') {
    printf("\nEnter a positive integer seed value:  ");
    scanf("%u", &seed);
    srand(seed);
    printf("\nEnter integer limits a and b (a<b):  ");
    scanf("%i %i", &a, &b);
    printf("\nRandom Numbers: \n\n");
    for (k = 1; k <= 10; k++)
      printf("%i ", rand_int(a, b));
    printf("\n\n");
    printf("Enter \"y\" or \"Y\" for YES if you wish to continue:  ");
    scanf("%s", go_on);
  }
  printf("\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%ax
mov    %ax,-0x17(%rbp)
mov    0xea2(%rip),%al
mov    %al,-0x15(%rbp)
movsbl -0x17(%rbp),%ecx
mov    $0x1,%al
cmp    $0x79,%ecx
mov    %al,-0x18(%rbp)
je     1182 <main+0x42>
movsbl -0x17(%rbp),%eax
cmp    $0x59,%eax
sete   %al
mov    %al,-0x18(%rbp)
mov    -0x18(%rbp),%al
test   $0x1,%al
jne    1192 <main+0x52>
jmp    1259 <main+0x119>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe84(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <srand@plt>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe86(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jg     1226 <main+0xe6>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <rand_int@plt>
mov    %eax,%esi
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11f3 <main+0xb3>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x17(%rbp),%rsi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
jmp    1163 <main+0x23>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d72(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movb   $0x0,0x12(%rsp)
movw   $0x79,0x10(%rsp)
lea    0xf15(%rip),%r15
lea    0xed3(%rip),%r12
lea    0xf18(%rip),%r13
lea    0xec9(%rip),%rbx
lea    0xef6(%rip),%rbp
lea    0x10(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xe4c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe66(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x14(%rsp),%edi
call   1060 <srand@plt>
lea    0xe4d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe66(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1080 <scanf@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1070 <rand_int@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1070 <rand_int@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1070 <rand_int@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1070 <rand_int@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1070 <rand_int@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1070 <rand_int@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1070 <rand_int@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1070 <rand_int@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1070 <rand_int@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1070 <rand_int@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
movzbl 0x10(%rsp),%eax
and    $0xdf,%al
cmp    $0x59,%al
je     11b0 <main+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2c9f(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.go_on = [3 x i8] c"y\00\00"
@.str = [40 x i8] c"\0AEnter a positive integer seed value: \00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [39 x i8] c"\0AEnter integer limits a and b (a<b): \00"
@.str.3 = [6 x i8] c"%i %i\00"
@.str.4 = [20 x i8] c"\0ARandom Numbers: \0A\0A\00"
@.str.5 = [4 x i8] c"%i \00"
@.str.6 = [3 x i8] c"\0A\0A\00"
@.str.7 = [52 x i8] c"Enter \22y\22 or \22Y\22 for YES if you wish to continue: \00"
@.str.8 = [3 x i8] c"%s\00"
@.str.9 = [2 x i8] c"\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 [3 x i8]
store i32 0, i32* %1
%7 = bitcast [3 x i8]* %6 to i8*
br label %8
8: ; preds = %39, %0
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 121
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 89
br label %18
18: ; preds = %13, %8
%19 = phi i1 [ true, %8 ], [ %17, %13 ]
br i1 %19, label %20, label %44
20: ; preds = %18
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%23 = load i32, i32* %2
%24 = call i32 @srand(i32 %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %3, i32* %4)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %5
br label %28
28: ; preds = %36, %20
%29 = load i32, i32* %5
%30 = icmp sle i32 %29, 10
br i1 %30, label %31, label %39
31: ; preds = %28
%32 = load i32, i32* %3
%33 = load i32, i32* %4
%34 = call i32 @rand_int(i32 %32, i32 %33)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %31
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %28
39: ; preds = %28
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%42 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%43 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %42)
br label %8
44: ; preds = %18
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%46 = load i32, i32* @EXIT_SUCCESS
ret i32 %46
}

LLVM IR (-O2):
@__const.main.go_on = [3 x i8] c"y\00\00"
@.str = [40 x i8] c"\0AEnter a positive integer seed value: \00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [39 x i8] c"\0AEnter integer limits a and b (a<b): \00"
@.str.3 = [6 x i8] c"%i %i\00"
@.str.5 = [4 x i8] c"%i \00"
@.str.7 = [52 x i8] c"Enter \22y\22 or \22Y\22 for YES if you wish to continue: \00"
@.str.8 = [3 x i8] c"%s\00"
@EXIT_SUCCESS = global i32 0
@str = [19 x i8] c"\0ARandom Numbers: \0A\00"
@str.10 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [3 x i8]
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
br label %9
9: ; preds = %0, %9
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = call i32 @srand(i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32* %2, i32* %3)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = call i32 @rand_int(i32 %17, i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = call i32 @rand_int(i32 %21, i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = call i32 @rand_int(i32 %25, i32 %26)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %2
%30 = load i32, i32* %3
%31 = call i32 @rand_int(i32 %29, i32 %30)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %2
%34 = load i32, i32* %3
%35 = call i32 @rand_int(i32 %33, i32 %34)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %2
%38 = load i32, i32* %3
%39 = call i32 @rand_int(i32 %37, i32 %38)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %39)
%41 = load i32, i32* %2
%42 = load i32, i32* %3
%43 = call i32 @rand_int(i32 %41, i32 %42)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %43)
%45 = load i32, i32* %2
%46 = load i32, i32* %3
%47 = call i32 @rand_int(i32 %45, i32 %46)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %47)
%49 = load i32, i32* %2
%50 = load i32, i32* %3
%51 = call i32 @rand_int(i32 %49, i32 %50)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %2
%54 = load i32, i32* %3
%55 = call i32 @rand_int(i32 %53, i32 %54)
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %55)
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.10, i64 0, i64 0))
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%59 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %8)
%60 = load i8, i8* %8
%61 = and i8 %60, -33
%62 = icmp eq i8 %61, 89
br i1 %62, label %9, label %63
63: ; preds = %9
%64 = call i32 @putchar(i32 10)
%65 = load i32, i32* @EXIT_SUCCESS
ret i32 %65
}