#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*/ addstr(char *);
int /*<<< orphan*/ color_set(int, int /*<<< orphan*/);
int /*<<< orphan*/ move(int, int);
int myran(int /*<<< orphan*/, int);
int /*<<< orphan*/ refresh();
int strlen(char *);
int /*<<< orphan*/ usleep(int);
int linep(int x, int y, char *str) {
  char c[2];
  int i = 0, cl;
  c[1] = 0;
  while (i < strlen(str)) {
    c[0] = str[i];
    move(x, y + i);
    cl = myran(0, 8);
    color_set(cl, 0);
    addstr(c);
    refresh();
    usleep(100000);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<linep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movb   $0x0,-0x11(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
jge    1206 <linep+0x96>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x12(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    -0x18(%rbp),%esi
call   1090 <move@plt>
xor    %edi,%edi
mov    $0x8,%esi
call   1040 <myran@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
xor    %esi,%esi
call   1070 <color_set@plt>
lea    -0x12(%rbp),%rdi
call   1060 <addstr@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x186a0,%edi
call   1080 <usleep@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    118d <linep+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linep>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%r15d
movb   $0x0,0xf(%rsp)
mov    %rdx,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    11f5 <linep+0x85>
mov    %r14d,%r12d
lea    0xe(%rsp),%r14
xor    %ebp,%ebp
movzbl (%rbx,%rbp,1),%eax
mov    %al,0xe(%rsp)
lea    (%r12,%rbp,1),%esi
mov    %r15d,%edi
call   1090 <move@plt>
xor    %edi,%edi
mov    $0x8,%esi
call   1040 <myran@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1070 <color_set@plt>
mov    %r14,%rdi
call   1060 <addstr@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
mov    $0x186a0,%edi
call   1080 <usleep@plt>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     11a0 <linep+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @linep(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [2 x i8]
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i32 0, i32* %8
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
store i8 0, i8* %10
br label %11
11: ; preds = %16, %3
%12 = load i32, i32* %8
%13 = load i8*, i8** %6
%14 = call i32 @strlen(i8* %13)
%15 = icmp slt i32 %12, %14
br i1 %15, label %16, label %37
16: ; preds = %11
%17 = load i8*, i8** %6
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
store i8 %21, i8* %22
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = load i32, i32* %8
%26 = add nsw i32 %24, %25
%27 = call i32 @move(i32 %23, i32 %26)
%28 = call i32 @myran(i32 0, i32 8)
store i32 %28, i32* %9
%29 = load i32, i32* %9
%30 = call i32 @color_set(i32 %29, i32 0)
%31 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%32 = call i32 @addstr(i8* %31)
%33 = call i32 (...) @refresh()
%34 = call i32 @usleep(i32 100000)
%35 = load i32, i32* %8
%36 = add nsw i32 %35, 1
store i32 %36, i32* %8
br label %11
37: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @linep(i32 %0, i32 %1, i8* %2) {
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 0, i8* %6
%7 = call i32 @strlen(i8* %2)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %25
9: ; preds = %3, %9
%10 = phi i64 [ %21, %9 ], [ 0, %3 ]
%11 = getelementptr inbounds i8, i8* %2, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %5
%13 = trunc i64 %10 to i32
%14 = add i32 %13, %1
%15 = call i32 @move(i32 %0, i32 %14)
%16 = call i32 @myran(i32 0, i32 8)
%17 = call i32 @color_set(i32 %16, i32 0)
%18 = call i32 @addstr(i8* %5)
%19 = call i32 (...) @refresh()
%20 = call i32 @usleep(i32 100000)
%21 = add nuw nsw i64 %10, 1
%22 = call i32 @strlen(i8* %2)
%23 = sext i32 %22 to i64
%24 = icmp slt i64 %21, %23
br i1 %24, label %9, label %25
25: ; preds = %9, %3
ret i32 0
}