#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*/ xochar(int /*<<< orphan*/, unsigned char, char);
int xostring(unsigned char x, unsigned char y, char *str) {
  register char i;
  for (i = 0; str[i] != 0; i++) {
    xochar(x++, y, str[i]);
  }
  return 1;
}


x86 assembly (clang, -O0):
<xostring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbq -0x11(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1175 <xostring+0x65>
mov    -0x1(%rbp),%al
mov    %al,%cl
add    $0x1,%cl
mov    %cl,-0x1(%rbp)
movzbl %al,%edi
mov    -0x2(%rbp),%dl
mov    -0x10(%rbp),%rax
movsbq -0x11(%rbp),%rcx
movzbl %dl,%esi
movsbl (%rax,%rcx,1),%edx
call   1030 <xochar@plt>
mov    -0x11(%rbp),%al
add    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    112c <xostring+0x1c>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xostring>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    (%rdx),%al
test   %al,%al
je     1154 <xostring+0x44>
mov    %rdx,%r15
mov    %edi,%r14d
mov    $0x1,%bl
movzbl %sil,%ebp
nopl   0x0(%rax)
lea    (%r14,%rbx,1),%ecx
add    $0xff,%cl
movzbl %cl,%edi
movsbl %al,%edx
mov    %ebp,%esi
call   1030 <xochar@plt>
movsbq %bl,%rbx
movzbl (%r15,%rbx,1),%eax
add    $0x1,%bl
test   %al,%al
jne    1130 <xostring+0x20>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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