#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*/ inicializarSemilla();
int /*<<< orphan*/ printf(char *, int);
int tirar(int);
int tirarVarios(int cantidad, int caras) {
  inicializarSemilla();
  int resultado = 0;
  int ii;
  for (ii = 0; ii < cantidad; ii++) {
    resultado = resultado + tirar(caras);
    printf("%i\n", resultado);
  }
  return resultado;
}


x86 assembly (clang, -O0):
<tirarVarios>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <inicializarSemilla@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1194 <tirarVarios+0x64>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <tirar@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1153 <tirarVarios+0x23>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tirarVarios>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <inicializarSemilla@plt>
test   %ebp,%ebp
jle    1179 <tirarVarios+0x49>
xor    %ebx,%ebx
lea    0xeae(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14d,%edi
call   1050 <tirar@plt>
add    %eax,%ebx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1160 <tirarVarios+0x30>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @tirarVarios(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i32 (...) @inicializarSemilla()
store i32 0, i32* %5
store i32 0, i32* %6
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @tirar(i32 %14)
%16 = add nsw i32 %13, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %8
22: ; preds = %8
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @tirarVarios(i32 %0, i32 %1) {
%3 = tail call i32 (...) @inicializarSemilla()
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %13
5: ; preds = %2, %5
%6 = phi i32 [ %11, %5 ], [ 0, %2 ]
%7 = phi i32 [ %9, %5 ], [ 0, %2 ]
%8 = tail call i32 @tirar(i32 %1)
%9 = add nsw i32 %8, %7
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i32 %6, 1
%12 = icmp eq i32 %11, %0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i32 [ 0, %2 ], [ %9, %5 ]
ret i32 %14
}