#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*/ strncmp(char *, char *, int);
void ConvIcsSanToComp(char *move) {
  if (!strncmp("O-O-O", move, 5))
    move[0] = move[2] = move[4] = 'o';
  if (!strncmp("O-O", move, 3))
    move[0] = move[2] = 'o';
}


x86 assembly (clang, -O0):
<ConvIcsSanToComp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1151 <ConvIcsSanToComp+0x41>
mov    -0x8(%rbp),%rax
movb   $0x6f,0x4(%rax)
mov    -0x8(%rbp),%rax
movb   $0x6f,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0x6f,(%rax)
mov    -0x8(%rbp),%rsi
lea    0xea6(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    117e <ConvIcsSanToComp+0x6e>
mov    -0x8(%rbp),%rax
movb   $0x6f,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0x6f,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvIcsSanToComp>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1137 <ConvIcsSanToComp+0x27>
movb   $0x6f,0x4(%rbx)
movb   $0x6f,0x2(%rbx)
movb   $0x6f,(%rbx)
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1151 <ConvIcsSanToComp+0x41>
pop    %rbx
ret
movb   $0x6f,0x2(%rbx)
movb   $0x6f,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"O-O-O\00"
@.str.1 = [4 x i8] c"O-O\00"
define void @ConvIcsSanToComp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i32 5)
%5 = icmp ne i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 4
store i8 111, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8 111, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 111, i8* %12
br label %13
13: ; preds = %6, %1
%14 = load i8*, i8** %2
%15 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %14, i32 3)
%16 = icmp ne i32 %15, 0
br i1 %16, label %22, label %17
17: ; preds = %13
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 2
store i8 111, i8* %19
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 0
store i8 111, i8* %21
br label %22
22: ; preds = %17, %13
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"O-O-O\00"
@.str.1 = [4 x i8] c"O-O\00"
define void @ConvIcsSanToComp(i8* %0) {
%2 = tail call i32 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i32 5)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 4
store i8 111, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 2
store i8 111, i8* %6
store i8 111, i8* %0
br label %7
7: ; preds = %4, %1
%8 = tail call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 3)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %0, i64 2
store i8 111, i8* %11
store i8 111, i8* %0
br label %12
12: ; preds = %10, %7
ret void
}