#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*/ printf(char *, int, ...);
int rand();
int /*<<< orphan*/ srand(int);
int main() {
  int i;
  float rr, ss;
  printf("un valor aleatorio de 0 a 100 es %d\n", rand() % 100);
  srand(10);
  for (i = 0; i < 5; i++) {
    printf("%i valor aleatorio de 0 de 5 es %d\n", i + 1, rand() % 10);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <srand@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11b0 <main+0x80>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    -0x14(%rbp),%esi
mov    $0xa,%ecx
cltd
idiv   %ecx
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116f <main+0x3f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <rand@plt>
movslq %eax,%rsi
imul   $0x51eb851f,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%esi
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
movslq %eax,%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edx
lea    0xe8d(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
movslq %eax,%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
movslq %eax,%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
movslq %eax,%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edx
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
movslq %eax,%rdx
imul   $0x66666667,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%edx
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"un valor aleatorio de 0 a 100 es %d\0A\00"
@.str.1 = [36 x i8] c"%i valor aleatorio de 0 de 5 es %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 100
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @srand(i32 10)
store i32 0, i32* %2
br label %9
9: ; preds = %18, %0
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 5
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
%15 = call i32 (...) @rand()
%16 = srem i32 %15, 10
%17 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %16)
br label %18
18: ; preds = %12
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %9
21: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"un valor aleatorio de 0 a 100 es %d\0A\00"
@.str.1 = [36 x i8] c"%i valor aleatorio de 0 de 5 es %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 100
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @srand(i32 10)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 10
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %6)
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 10
%10 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 %9)
%11 = tail call i32 (...) @rand()
%12 = srem i32 %11, 10
%13 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 %12)
%14 = tail call i32 (...) @rand()
%15 = srem i32 %14, 10
%16 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 %15)
%17 = tail call i32 (...) @rand()
%18 = srem i32 %17, 10
%19 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 %18)
ret i32 0
}