#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 pgrandom(int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ seedrandom();
int main(void) {
  seedrandom();
  for (int i = 1; i < 15; ++i) {
    printf("Random number %2d: %d\n", i, pgrandom(100) + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <seedrandom@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jge    1189 <main+0x59>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x64,%edi
call   1050 <pgrandom@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
add    $0x1,%edx
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <seedrandom@plt>
mov    $0x64,%edi
call   1050 <pgrandom@plt>
lea    0x1(%rax),%edx
lea    0xeb4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <pgrandom@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <pgrandom@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <pgrandom@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <pgrandom@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <pgrandom@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <pgrandom@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <pgrandom@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <pgrandom@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <pgrandom@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <pgrandom@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <pgrandom@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <pgrandom@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1050 <pgrandom@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    $0xe,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Random number %2d: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @seedrandom()
store i32 1, i32* %2
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 15
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @pgrandom(i32 100)
%10 = add nsw i32 %9, 1
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
br label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Random number %2d: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @seedrandom()
%2 = tail call i32 @pgrandom(i32 100)
%3 = add nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 1, i32 %3)
%5 = tail call i32 @pgrandom(i32 100)
%6 = add nsw i32 %5, 1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 2, i32 %6)
%8 = tail call i32 @pgrandom(i32 100)
%9 = add nsw i32 %8, 1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 3, i32 %9)
%11 = tail call i32 @pgrandom(i32 100)
%12 = add nsw i32 %11, 1
%13 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 4, i32 %12)
%14 = tail call i32 @pgrandom(i32 100)
%15 = add nsw i32 %14, 1
%16 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 5, i32 %15)
%17 = tail call i32 @pgrandom(i32 100)
%18 = add nsw i32 %17, 1
%19 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 6, i32 %18)
%20 = tail call i32 @pgrandom(i32 100)
%21 = add nsw i32 %20, 1
%22 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 7, i32 %21)
%23 = tail call i32 @pgrandom(i32 100)
%24 = add nsw i32 %23, 1
%25 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 8, i32 %24)
%26 = tail call i32 @pgrandom(i32 100)
%27 = add nsw i32 %26, 1
%28 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 9, i32 %27)
%29 = tail call i32 @pgrandom(i32 100)
%30 = add nsw i32 %29, 1
%31 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 10, i32 %30)
%32 = tail call i32 @pgrandom(i32 100)
%33 = add nsw i32 %32, 1
%34 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 11, i32 %33)
%35 = tail call i32 @pgrandom(i32 100)
%36 = add nsw i32 %35, 1
%37 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 12, i32 %36)
%38 = tail call i32 @pgrandom(i32 100)
%39 = add nsw i32 %38, 1
%40 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 13, i32 %39)
%41 = tail call i32 @pgrandom(i32 100)
%42 = add nsw i32 %41, 1
%43 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 14, i32 %42)
ret i32 0
}