#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 /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
void aleatorio() {
  int n, n2, n3;
  srand(time(0));
  n = rand() % 10 + 1;
  n2 = rand() % 20 + 10;
  n3 = rand() % 100 + 1;
  printf("Un numero entre 1 y 10: %d\n", n);
  printf("Un numero entre 10 y 29: %d\n", n2);
  printf("Un numero entre 1 y 100: %d\n", n3);
}


x86 assembly (clang, -O0):
<aleatorio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
add    $0xa,%edx
mov    %edx,-0x8(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aleatorio>:
push   %rbp
push   %r14
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r14d
add    $0x1,%r14d
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0xa,%ebp
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebx
add    $0x1,%ebx
lea    0xe28(%rip),%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
lea    0xe35(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
lea    0xe44(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Un numero entre 1 y 10: %d\0A\00"
@.str.1 = [29 x i8] c"Un numero entre 10 y 29: %d\0A\00"
@.str.2 = [29 x i8] c"Un numero entre 1 y 100: %d\0A\00"
define void @aleatorio() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @time(i32 0)
%5 = call i32 @srand(i32 %4)
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 10
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = call i32 (...) @rand()
%10 = srem i32 %9, 20
%11 = add nsw i32 %10, 10
store i32 %11, i32* %2
%12 = call i32 (...) @rand()
%13 = srem i32 %12, 100
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %1
%16 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %2
%18 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Un numero entre 1 y 10: %d\0A\00"
@.str.1 = [29 x i8] c"Un numero entre 10 y 29: %d\0A\00"
@.str.2 = [29 x i8] c"Un numero entre 1 y 100: %d\0A\00"
define void @aleatorio() {
%1 = tail call i32 @time(i32 0)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 10
%5 = add nsw i32 %4, 1
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 20
%8 = add nsw i32 %7, 10
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 100
%11 = add nsw i32 %10, 1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret void
}