#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 wchar_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int wcslen(int *);
void mostra_telefon(wchar_t *cadena) {
  int longitud, i;
  if ((1))
    printf("entro a mostra_telefon");
  longitud = wcslen(cadena);
  for (i = 0; i < longitud; i++)
    printf("%c", cadena[i]);
}


x86 assembly (clang, -O0):
<mostra_telefon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <wcslen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1180 <mostra_telefon+0x60>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114d <mostra_telefon+0x2d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostra_telefon>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1050 <wcslen@plt>
test   %eax,%eax
jle    1172 <mostra_telefon+0x42>
mov    %eax,%r15d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1160 <mostra_telefon+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [23 x i8] c"entro a mostra_telefon\00"
@.str.1 = [3 x i8] c"%c\00"
define void @mostra_telefon(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = call i32 @wcslen(i32* %6)
store i32 %7, i32* %3
store i32 0, i32* %4
br label %8
8: ; preds = %19, %1
%9 = load i32, i32* %4
%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** %2
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %12
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"entro a mostra_telefon\00"
define void @mostra_telefon(i32* nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @wcslen(i32* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = zext i32 %3 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %1
ret void
}