#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 LEN(char *);
int /*<<< orphan*/ dibujar(char, int, int);
void dibujarString(char *string, int x, int y) {
  int i;
  for (i = 0; i < LEN(string); i++)
    dibujar(string[i], x, y + i);
}


x86 assembly (clang, -O0):
<dibujarString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <LEN@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    117f <dibujarString+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
add    -0x14(%rbp),%edx
movsbl %al,%edi
call   1030 <dibujar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <dibujarString+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dibujarString>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbx
call   1040 <LEN@plt>
test   %eax,%eax
jle    1163 <dibujarString+0x43>
mov    %r14d,%r14d
xor    %ebp,%ebp
xchg   %ax,%ax
movsbl (%rbx,%rbp,1),%edi
lea    (%r14,%rbp,1),%edx
mov    %r15d,%esi
call   1030 <dibujar@plt>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1040 <LEN@plt>
cltq
cmp    %rax,%rbp
jl     1140 <dibujarString+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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