#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*/ tolower(char);
void GR_to_Greek(char *w, char *ww) {
  *ww++ = '\\';
  *ww++ = *w;
  while (*++w != '\0')
    *ww++ = tolower(*w);
  *ww = '\0';
}


x86 assembly (clang, -O0):
<GR_to_Greek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x5c,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1189 <GR_to_Greek+0x79>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1149 <GR_to_Greek+0x39>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GR_to_Greek>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
movb   $0x5c,(%rsi)
mov    (%rdi),%al
mov    %al,0x1(%rsi)
add    $0x2,%r14
mov    0x1(%rdi),%al
test   %al,%al
je     115a <GR_to_Greek+0x4a>
mov    %rdi,%rbx
add    $0x2,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,(%r14)
add    $0x1,%r14
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <GR_to_Greek+0x30>
movb   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @GR_to_Greek(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
store i8 92, i8* %1
%4 = load i8, i8* %0
%5 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %4, i8* %3
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %2, %9
%10 = phi i8 [ %17, %9 ], [ %7, %2 ]
%11 = phi i8* [ %16, %9 ], [ %6, %2 ]
%12 = phi i8* [ %15, %9 ], [ %5, %2 ]
%13 = tail call i32 @tolower(i8 signext %10)
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %14, i8* %12
%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, %2
%20 = phi i8* [ %5, %2 ], [ %15, %9 ]
store i8 0, i8* %20
ret void
}