#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*/ random_1(int, int, int);
void random_2(void) {
  int i;
  for (i = 1; i < 20; i++) {
    random_1(5, i, 500);
  }
  for (i = 20; i >= 1; i--) {
    random_1(5, i, 500);
  }
}


x86 assembly (clang, -O0):
<random_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jge    1149 <random_2+0x39>
mov    -0x4(%rbp),%esi
mov    $0x5,%edi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <random_2+0xf>
movl   $0x14,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     117a <random_2+0x6a>
mov    -0x4(%rbp),%esi
mov    $0x5,%edi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <random_2+0x40>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_2>:
push   %rax
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x2,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x3,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x4,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x5,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x6,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x7,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x8,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x9,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0xa,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0xb,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0xc,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0xd,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0xe,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0xf,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x10,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x11,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x12,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x13,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x14,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x13,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x12,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x11,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x10,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0xf,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0xe,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0xd,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0xc,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0xb,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0xa,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x9,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x8,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x7,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x6,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x5,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x4,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x3,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x2,%esi
mov    $0x1f4,%edx
call   1030 <random_1@plt>
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x1f4,%edx
pop    %rax
jmp    1030 <random_1@plt>

LLVM IR (-O0):
define void @random_2() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 20
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @random_1(i32 5, i32 %6, i32 500)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
store i32 20, i32* %1
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %1
%14 = icmp sge i32 %13, 1
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %1
%17 = call i32 @random_1(i32 5, i32 %16, i32 500)
br label %18
18: ; preds = %15
%19 = load i32, i32* %1
%20 = add nsw i32 %19, -1
store i32 %20, i32* %1
br label %12
21: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @random_2() {
%1 = tail call i32 @random_1(i32 5, i32 1, i32 500)
%2 = tail call i32 @random_1(i32 5, i32 2, i32 500)
%3 = tail call i32 @random_1(i32 5, i32 3, i32 500)
%4 = tail call i32 @random_1(i32 5, i32 4, i32 500)
%5 = tail call i32 @random_1(i32 5, i32 5, i32 500)
%6 = tail call i32 @random_1(i32 5, i32 6, i32 500)
%7 = tail call i32 @random_1(i32 5, i32 7, i32 500)
%8 = tail call i32 @random_1(i32 5, i32 8, i32 500)
%9 = tail call i32 @random_1(i32 5, i32 9, i32 500)
%10 = tail call i32 @random_1(i32 5, i32 10, i32 500)
%11 = tail call i32 @random_1(i32 5, i32 11, i32 500)
%12 = tail call i32 @random_1(i32 5, i32 12, i32 500)
%13 = tail call i32 @random_1(i32 5, i32 13, i32 500)
%14 = tail call i32 @random_1(i32 5, i32 14, i32 500)
%15 = tail call i32 @random_1(i32 5, i32 15, i32 500)
%16 = tail call i32 @random_1(i32 5, i32 16, i32 500)
%17 = tail call i32 @random_1(i32 5, i32 17, i32 500)
%18 = tail call i32 @random_1(i32 5, i32 18, i32 500)
%19 = tail call i32 @random_1(i32 5, i32 19, i32 500)
%20 = tail call i32 @random_1(i32 5, i32 20, i32 500)
%21 = tail call i32 @random_1(i32 5, i32 19, i32 500)
%22 = tail call i32 @random_1(i32 5, i32 18, i32 500)
%23 = tail call i32 @random_1(i32 5, i32 17, i32 500)
%24 = tail call i32 @random_1(i32 5, i32 16, i32 500)
%25 = tail call i32 @random_1(i32 5, i32 15, i32 500)
%26 = tail call i32 @random_1(i32 5, i32 14, i32 500)
%27 = tail call i32 @random_1(i32 5, i32 13, i32 500)
%28 = tail call i32 @random_1(i32 5, i32 12, i32 500)
%29 = tail call i32 @random_1(i32 5, i32 11, i32 500)
%30 = tail call i32 @random_1(i32 5, i32 10, i32 500)
%31 = tail call i32 @random_1(i32 5, i32 9, i32 500)
%32 = tail call i32 @random_1(i32 5, i32 8, i32 500)
%33 = tail call i32 @random_1(i32 5, i32 7, i32 500)
%34 = tail call i32 @random_1(i32 5, i32 6, i32 500)
%35 = tail call i32 @random_1(i32 5, i32 5, i32 500)
%36 = tail call i32 @random_1(i32 5, i32 4, i32 500)
%37 = tail call i32 @random_1(i32 5, i32 3, i32 500)
%38 = tail call i32 @random_1(i32 5, i32 2, i32 500)
%39 = tail call i32 @random_1(i32 5, i32 1, i32 500)
ret void
}