#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*/ pokech(int, int, char const, int);
void pokevstr(int row, int column, const char *str, int color) {
  const char *p = str;
  int i = 0;
  while (*p) {
    pokech(row + i, column, *p, color);
    i++;
    p++;
  }
}


x86 assembly (clang, -O0):
<pokevstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1175 <pokevstr+0x65>
mov    -0x4(%rbp),%edi
add    -0x24(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    -0x14(%rbp),%ecx
movsbl %al,%edx
call   1030 <pokech@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1134 <pokevstr+0x24>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pokevstr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    (%rdx),%al
test   %al,%al
je     114e <pokevstr+0x3e>
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %edi,%ebp
add    $0x1,%rbx
nopl   0x0(%rax)
movsbl %al,%edx
mov    %ebp,%edi
mov    %r15d,%esi
mov    %r14d,%ecx
call   1030 <pokech@plt>
movzbl (%rbx),%eax
add    $0x1,%ebp
add    $0x1,%rbx
test   %al,%al
jne    1130 <pokevstr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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