#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 generate_random(int, int);
int /*<<< orphan*/ initial();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  int n, a, b;
  if (argc != 4) {
    usage();
    return -1;
  }
  sscanf(argv[1], "%d", &n);
  sscanf(argv[2], "%d", &a);
  sscanf(argv[3], "%d", &b);
  initial();
  while (n--) {
    printf("%d\n", generate_random(a, b));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1183 <main+0x33>
mov    $0x0,%al
call   1060 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    120b <main+0xbb>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6e(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe56(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe3e(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <sscanf@plt>
mov    $0x0,%al
call   1030 <initial@plt>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1204 <main+0xb4>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   1070 <generate_random@plt>
mov    %eax,%esi
lea    0xe09(%rip),%rdi
call   1040 <printf@plt>
jmp    11d2 <main+0x82>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
cmp    $0x4,%edi
jne    11d0 <main+0x80>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe97(%rip),%rbp
lea    0xc(%rsp),%rdx
mov    %rbp,%rsi
call   1050 <sscanf@plt>
mov    0x10(%rbx),%rdi
lea    0x14(%rsp),%rdx
mov    %rbp,%rsi
call   1050 <sscanf@plt>
mov    0x18(%rbx),%rdi
lea    0x10(%rsp),%rdx
mov    %rbp,%rsi
call   1050 <sscanf@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <initial@plt>
subl   $0x1,0xc(%rsp)
jb     11dc <main+0x8c>
lea    0xe54(%rip),%rbx
nop
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
call   1070 <generate_random@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
subl   $0x1,0xc(%rsp)
jae    11b0 <main+0x60>
jmp    11dc <main+0x8c>
xor    %eax,%eax
call   1060 <usage@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 4
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @usage()
store i32 -1, i32* %3
br label %37
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @sscanf(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i32 @sscanf(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 3
%24 = load i8*, i8** %23
%25 = call i32 @sscanf(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%26 = call i32 (...) @initial()
br label %27
27: ; preds = %31, %13
%28 = load i32, i32* %6
%29 = add nsw i32 %28, -1
store i32 %29, i32* %6
%30 = icmp ne i32 %28, 0
br i1 %30, label %31, label %36
31: ; preds = %27
%32 = load i32, i32* %7
%33 = load i32, i32* %8
%34 = call i32 @generate_random(i32 %32, i32 %33)
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %34)
br label %27
36: ; preds = %27
store i32 0, i32* %3
br label %37
37: ; preds = %36, %11
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = icmp eq i32 %0, 4
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = tail call i32 (...) @usage()
br label %34
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @sscanf(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @sscanf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%19 = getelementptr inbounds i8*, i8** %1, i64 3
%20 = load i8*, i8** %19
%21 = call i32 @sscanf(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%22 = call i32 (...) @initial()
%23 = load i32, i32* %3
%24 = add nsw i32 %23, -1
store i32 %24, i32* %3
%25 = icmp eq i32 %23, 0
br i1 %25, label %34, label %26
26: ; preds = %12, %26
%27 = load i32, i32* %4
%28 = load i32, i32* %5
%29 = call i32 @generate_random(i32 %27, i32 %28)
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %3
%32 = add nsw i32 %31, -1
store i32 %32, i32* %3
%33 = icmp eq i32 %31, 0
br i1 %33, label %34, label %26
34: ; preds = %26, %12, %10
%35 = phi i32 [ -1, %10 ], [ 0, %12 ], [ 0, %26 ]
ret i32 %35
}