#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*/ assert(int *);
int /*<<< orphan*/ printf(char *, int);
void imprimeCm(int *Cm, int destino) {
  assert(Cm);
  if (Cm[destino] == destino) {
    printf("%d", destino);
    return;
  }
  imprimeCm(Cm, Cm[destino]);
  printf(" -> %d", destino);
  return;
}


x86 assembly (clang, -O0):
<imprimeCm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0xc(%rbp),%eax
jne    1170 <imprimeCm+0x40>
mov    -0xc(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
jmp    1193 <imprimeCm+0x63>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <imprimeCm@plt>
mov    -0xc(%rbp),%esi
lea    0xe72(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimeCm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <assert@plt>
movslq %ebp,%rax
mov    (%rbx,%rax,4),%esi
cmp    %eax,%esi
jne    1150 <imprimeCm+0x20>
lea    0xeb6(%rip),%rdi
jmp    115f <imprimeCm+0x2f>
mov    %rbx,%rdi
call   1030 <imprimeCm@plt>
lea    0xea1(%rip),%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c" -> %d\00"
define void @imprimeCm(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i32 @assert(i32* %5)
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = load i32, i32* %4
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i32, i32* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %26
17: ; preds = %2
%18 = load i32*, i32** %3
%19 = load i32*, i32** %3
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = load i32, i32* %4
%25 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %17, %14
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c" -> %d\00"
define void @imprimeCm(i32* %0, i32 %1) {
%3 = tail call i32 @assert(i32* %0)
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, %1
br i1 %7, label %8, label %11
8: ; preds = %2, %11
%9 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %11 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %2 ]
%10 = tail call i32 @printf(i8* %9, i32 %1)
ret void
11: ; preds = %2
tail call void @imprimeCm(i32* %0, i32 %6)
br label %8
}