#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ retardo(int);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncat(char *, char *, int);
int /*<<< orphan*/ system(char *);
void scroll(void) {
  char *cad =
      "este programa te permitira evaluar cualquier funcion            ";
  char *temp, *newcad;
  temp = (char *)malloc(sizeof(strlen(cad)));
  newcad = (char *)malloc(sizeof(strlen(cad)));
  strcpy(newcad, cad);
  while (1) {
    printf("%s", newcad);
    strcpy(temp, &newcad[1]);
    strncat(temp, &newcad[0], 1);
    strcpy(newcad, temp);
    retardo(500000);
    system("cls");
  }
}


x86 assembly (clang, -O0):
<scroll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xe91(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    $0x8,%edi
call   1070 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x8,%edi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
mov    %rsi,-0x20(%rbp)
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1060 <strncat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    $0x7a120,%edi
call   1080 <retardo@plt>
lea    0xe53(%rip),%rdi
call   1040 <system@plt>
jmp    119c <scroll+0x3c>

x86 assembly (clang, -O2):
<scroll>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    $0x8,%edi
call   1070 <malloc@plt>
mov    %rax,%r14
mov    $0x8,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
lea    0xe76(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%r15
add    $0x1,%r15
lea    0xea1(%rip),%r12
lea    0xe9d(%rip),%r13
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1060 <strncat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    $0x7a120,%edi
call   1080 <retardo@plt>
mov    %r13,%rdi
call   1040 <system@plt>
jmp    11b0 <scroll+0x50>

LLVM IR (-O0):
@.str = [65 x i8] c"este programa te permitira evaluar cualquier funcion \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"cls\00"
define void @scroll() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
store i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8** %1
%4 = call i64 @malloc(i32 8)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = call i64 @malloc(i32 8)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %1
%10 = call i32 @strcpy(i8* %8, i8* %9)
br label %11
11: ; preds = %0, %11
%12 = load i8*, i8** %3
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %2
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = call i32 @strcpy(i8* %14, i8* %16)
%18 = load i8*, i8** %2
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = call i32 @strncat(i8* %18, i8* %20, i32 1)
%22 = load i8*, i8** %3
%23 = load i8*, i8** %2
%24 = call i32 @strcpy(i8* %22, i8* %23)
%25 = call i32 @retardo(i32 500000)
%26 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %11
}

LLVM IR (-O2):
@.str = [65 x i8] c"este programa te permitira evaluar cualquier funcion \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"cls\00"
define void @scroll() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 @malloc(i32 8)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8, i8* %4, i64 1
br label %7
7: ; preds = %7, %0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%9 = tail call i32 @strcpy(i8* %2, i8* %6)
%10 = tail call i32 @strncat(i8* %2, i8* %4, i32 1)
%11 = tail call i32 @strcpy(i8* %4, i8* %2)
%12 = tail call i32 @retardo(i32 500000)
%13 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %7
}