#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*/ ChineseChar(unsigned int, unsigned int, int, unsigned int,
                               unsigned int, char);
void ChineseString(unsigned int x, unsigned int y, int size,
                   unsigned int For_color, unsigned int Bk_color, char *p) {
  while (*p != '\0') {
    ChineseChar(x, y, size, For_color, Bk_color, *p - 47);
    y += 24;
    p++;
  }
}


x86 assembly (clang, -O0):
<ChineseString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1179 <ChineseString+0x69>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
sub    $0x2f,%eax
movsbl %al,%r9d
call   1030 <ChineseChar@plt>
mov    -0x8(%rbp),%eax
add    $0x18,%eax
mov    %eax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <ChineseString+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChineseString>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    (%r9),%al
test   %al,%al
je     1167 <ChineseString+0x57>
mov    %r9,%rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
mov    %edi,%r13d
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
add    $0xd1,%al
movsbl %al,%r9d
mov    %r13d,%edi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <ChineseChar@plt>
add    $0x18,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <ChineseString+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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