#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 /*<<< orphan*/ chk_request_limit();
int /*<<< orphan*/ chk_request_npc_contract();
long get_request_n();
int /*<<< orphan*/ make_request_randm();
long roll_dice(int, int);
void make_request_all(void) {
  long request_n, request_max_n;
  long i;
  request_n = get_request_n();
  request_max_n = roll_dice(32, 1);
  for (i = request_n; i < request_max_n; i++)
    make_request_randm();
  chk_request_limit();
  chk_request_npc_contract();
}


x86 assembly (clang, -O0):
<make_request_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1060 <get_request_n@plt>
mov    %rax,-0x8(%rbp)
mov    $0x20,%edi
mov    $0x1,%esi
call   1070 <roll_dice@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    11a4 <make_request_all+0x54>
mov    $0x0,%al
call   1040 <make_request_randm@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    117e <make_request_all+0x2e>
mov    $0x0,%al
call   1050 <chk_request_limit@plt>
mov    $0x0,%al
call   1030 <chk_request_npc_contract@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_request_all>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <get_request_n@plt>
mov    %rax,%r14
mov    $0x20,%edi
mov    $0x1,%esi
call   1070 <roll_dice@plt>
cmp    %rax,%r14
jge    118d <make_request_all+0x3d>
mov    %rax,%rbx
sub    %r14,%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <make_request_randm@plt>
add    $0xffffffffffffffff,%rbx
jne    1180 <make_request_all+0x30>
xor    %eax,%eax
call   1050 <chk_request_limit@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <chk_request_npc_contract@plt>

LLVM IR (-O0):
define void @make_request_all() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = call i64 (...) @get_request_n()
store i64 %4, i64* %1
%5 = call i64 @roll_dice(i32 32, i32 1)
store i64 %5, i64* %2
%6 = load i64, i64* %1
store i64 %6, i64* %3
br label %7
7: ; preds = %13, %0
%8 = load i64, i64* %3
%9 = load i64, i64* %2
%10 = icmp slt i64 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = call i32 (...) @make_request_randm()
br label %13
13: ; preds = %11
%14 = load i64, i64* %3
%15 = add nsw i64 %14, 1
store i64 %15, i64* %3
br label %7
16: ; preds = %7
%17 = call i32 (...) @chk_request_limit()
%18 = call i32 (...) @chk_request_npc_contract()
ret void
}

LLVM IR (-O2):
define void @make_request_all() {
%1 = tail call i64 (...) @get_request_n()
%2 = tail call i64 @roll_dice(i32 32, i32 1)
%3 = icmp slt i64 %1, %2
br i1 %3, label %4, label %9
4: ; preds = %0, %4
%5 = phi i64 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 (...) @make_request_randm()
%7 = add i64 %5, 1
%8 = icmp eq i64 %7, %2
br i1 %8, label %9, label %4
9: ; preds = %4, %0
%10 = tail call i32 (...) @chk_request_limit()
%11 = tail call i32 (...) @chk_request_npc_contract()
ret void
}