#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ponerCaracterEnVentana(char, char *, int /*<<< orphan*/ *);
void ponerReferenciaEnVentana(int posicion, int longitud, char *ventana,
                              FILE *archivo) {
  int i;
  for (i = 0; i < longitud; i++) {
    ponerCaracterEnVentana(ventana[posicion], ventana, archivo);
  }
}


x86 assembly (clang, -O0):
<ponerReferenciaEnVentana>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <ponerReferenciaEnVentana+0x52>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movsbl %al,%edi
call   1030 <ponerCaracterEnVentana@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112d <ponerReferenciaEnVentana+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ponerReferenciaEnVentana>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <ponerReferenciaEnVentana+0x35>
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%ebp
movslq %edi,%r15
cs nopw 0x0(%rax,%rax,1)
movsbl (%rbx,%r15,1),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <ponerCaracterEnVentana@plt>
add    $0xffffffff,%ebp
jne    1130 <ponerReferenciaEnVentana+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @ponerReferenciaEnVentana(i32 %0, i32 %1, i8* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32* %3, i32** %8
store i32 0, i32* %9
br label %10
10: ; preds = %23, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %26
14: ; preds = %10
%15 = load i8*, i8** %7
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = load i8*, i8** %7
%21 = load i32*, i32** %8
%22 = call i32 @ponerCaracterEnVentana(i8 signext %19, i8* %20, i32* %21)
br label %23
23: ; preds = %14
%24 = load i32, i32* %9
%25 = add nsw i32 %24, 1
store i32 %25, i32* %9
br label %10
26: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @ponerReferenciaEnVentana(i32 %0, i32 %1, i8* %2, i32* %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = sext i32 %0 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
br label %9
9: ; preds = %6, %9
%10 = phi i32 [ 0, %6 ], [ %13, %9 ]
%11 = load i8, i8* %8
%12 = tail call i32 @ponerCaracterEnVentana(i8 signext %11, i8* %2, i32* %3)
%13 = add nuw nsw i32 %10, 1
%14 = icmp eq i32 %13, %1
br i1 %14, label %15, label %9
15: ; preds = %9, %4
ret void
}