void convertir_peones_reinas(char *ptablero) {
  register int i = 0;
  for (i = 0; i < 8; i++) {
    if (ptablero[i] == 'P')
      ptablero[i] = 'Y';
    if (ptablero[56 + i] == 'p')
      ptablero[56 + i] = 'y';
  }
}


x86 assembly (clang, -O0):
<convertir_peones_reinas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    117f <convertir_peones_reinas+0x7f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x50,%eax
jne    1141 <convertir_peones_reinas+0x41>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x59,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x38,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x70,%eax
jne    116c <convertir_peones_reinas+0x6c>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x38,%ecx
movslq %ecx,%rcx
movb   $0x79,(%rax,%rcx,1)
jmp    1171 <convertir_peones_reinas+0x71>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <convertir_peones_reinas+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertir_peones_reinas>:
cmpb   $0x50,(%rdi)
je     11a0 <convertir_peones_reinas+0xa0>
cmpb   $0x70,0x38(%rdi)
je     11ad <convertir_peones_reinas+0xad>
cmpb   $0x50,0x1(%rdi)
je     11bb <convertir_peones_reinas+0xbb>
cmpb   $0x70,0x39(%rdi)
je     11c9 <convertir_peones_reinas+0xc9>
cmpb   $0x50,0x2(%rdi)
je     11d7 <convertir_peones_reinas+0xd7>
cmpb   $0x70,0x3a(%rdi)
je     11e5 <convertir_peones_reinas+0xe5>
cmpb   $0x50,0x3(%rdi)
je     11f3 <convertir_peones_reinas+0xf3>
cmpb   $0x70,0x3b(%rdi)
je     1201 <convertir_peones_reinas+0x101>
cmpb   $0x50,0x4(%rdi)
je     120f <convertir_peones_reinas+0x10f>
cmpb   $0x70,0x3c(%rdi)
je     121d <convertir_peones_reinas+0x11d>
cmpb   $0x50,0x5(%rdi)
je     122b <convertir_peones_reinas+0x12b>
cmpb   $0x70,0x3d(%rdi)
je     1239 <convertir_peones_reinas+0x139>
cmpb   $0x50,0x6(%rdi)
je     1247 <convertir_peones_reinas+0x147>
cmpb   $0x70,0x3e(%rdi)
je     1255 <convertir_peones_reinas+0x155>
cmpb   $0x50,0x7(%rdi)
je     1263 <convertir_peones_reinas+0x163>
cmpb   $0x70,0x3f(%rdi)
je     1271 <convertir_peones_reinas+0x171>
ret
movb   $0x59,(%rdi)
cmpb   $0x70,0x38(%rdi)
jne    1113 <convertir_peones_reinas+0x13>
movb   $0x79,0x38(%rdi)
cmpb   $0x50,0x1(%rdi)
jne    111d <convertir_peones_reinas+0x1d>
movb   $0x59,0x1(%rdi)
cmpb   $0x70,0x39(%rdi)
jne    1127 <convertir_peones_reinas+0x27>
movb   $0x79,0x39(%rdi)
cmpb   $0x50,0x2(%rdi)
jne    1131 <convertir_peones_reinas+0x31>
movb   $0x59,0x2(%rdi)
cmpb   $0x70,0x3a(%rdi)
jne    113b <convertir_peones_reinas+0x3b>
movb   $0x79,0x3a(%rdi)
cmpb   $0x50,0x3(%rdi)
jne    1145 <convertir_peones_reinas+0x45>
movb   $0x59,0x3(%rdi)
cmpb   $0x70,0x3b(%rdi)
jne    114f <convertir_peones_reinas+0x4f>
movb   $0x79,0x3b(%rdi)
cmpb   $0x50,0x4(%rdi)
jne    1159 <convertir_peones_reinas+0x59>
movb   $0x59,0x4(%rdi)
cmpb   $0x70,0x3c(%rdi)
jne    1163 <convertir_peones_reinas+0x63>
movb   $0x79,0x3c(%rdi)
cmpb   $0x50,0x5(%rdi)
jne    116d <convertir_peones_reinas+0x6d>
movb   $0x59,0x5(%rdi)
cmpb   $0x70,0x3d(%rdi)
jne    1177 <convertir_peones_reinas+0x77>
movb   $0x79,0x3d(%rdi)
cmpb   $0x50,0x6(%rdi)
jne    1181 <convertir_peones_reinas+0x81>
movb   $0x59,0x6(%rdi)
cmpb   $0x70,0x3e(%rdi)
jne    118b <convertir_peones_reinas+0x8b>
movb   $0x79,0x3e(%rdi)
cmpb   $0x50,0x7(%rdi)
jne    1195 <convertir_peones_reinas+0x95>
movb   $0x59,0x7(%rdi)
cmpb   $0x70,0x3f(%rdi)
jne    119f <convertir_peones_reinas+0x9f>
movb   $0x79,0x3f(%rdi)
ret

LLVM IR (-O0):
define void @convertir_peones_reinas(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %4
4: ; preds = %36, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %39
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 80
br i1 %14, label %15, label %20
15: ; preds = %7
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 89, i8* %19
br label %20
20: ; preds = %15, %7
%21 = load i8*, i8** %2
%22 = load i32, i32* %3
%23 = add nsw i32 56, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %21, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 112
br i1 %28, label %29, label %35
29: ; preds = %20
%30 = load i8*, i8** %2
%31 = load i32, i32* %3
%32 = add nsw i32 56, %31
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %30, i64 %33
store i8 121, i8* %34
br label %35
35: ; preds = %29, %20
br label %36
36: ; preds = %35
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %4
39: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @convertir_peones_reinas(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 80
br i1 %3, label %4, label %5
4: ; preds = %1
store i8 89, i8* %0
br label %5
5: ; preds = %4, %1
%6 = getelementptr inbounds i8, i8* %0, i64 56
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 112
br i1 %8, label %9, label %10
9: ; preds = %5
store i8 121, i8* %6
br label %10
10: ; preds = %5, %9
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 80
br i1 %13, label %14, label %15
14: ; preds = %10
store i8 89, i8* %11
br label %15
15: ; preds = %14, %10
%16 = getelementptr inbounds i8, i8* %0, i64 57
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 112
br i1 %18, label %19, label %20
19: ; preds = %15
store i8 121, i8* %16
br label %20
20: ; preds = %19, %15
%21 = getelementptr inbounds i8, i8* %0, i64 2
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 80
br i1 %23, label %24, label %25
24: ; preds = %20
store i8 89, i8* %21
br label %25
25: ; preds = %24, %20
%26 = getelementptr inbounds i8, i8* %0, i64 58
%27 = load i8, i8* %26
%28 = icmp eq i8 %27, 112
br i1 %28, label %29, label %30
29: ; preds = %25
store i8 121, i8* %26
br label %30
30: ; preds = %29, %25
%31 = getelementptr inbounds i8, i8* %0, i64 3
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, 80
br i1 %33, label %34, label %35
34: ; preds = %30
store i8 89, i8* %31
br label %35
35: ; preds = %34, %30
%36 = getelementptr inbounds i8, i8* %0, i64 59
%37 = load i8, i8* %36
%38 = icmp eq i8 %37, 112
br i1 %38, label %39, label %40
39: ; preds = %35
store i8 121, i8* %36
br label %40
40: ; preds = %39, %35
%41 = getelementptr inbounds i8, i8* %0, i64 4
%42 = load i8, i8* %41
%43 = icmp eq i8 %42, 80
br i1 %43, label %44, label %45
44: ; preds = %40
store i8 89, i8* %41
br label %45
45: ; preds = %44, %40
%46 = getelementptr inbounds i8, i8* %0, i64 60
%47 = load i8, i8* %46
%48 = icmp eq i8 %47, 112
br i1 %48, label %49, label %50
49: ; preds = %45
store i8 121, i8* %46
br label %50
50: ; preds = %49, %45
%51 = getelementptr inbounds i8, i8* %0, i64 5
%52 = load i8, i8* %51
%53 = icmp eq i8 %52, 80
br i1 %53, label %54, label %55
54: ; preds = %50
store i8 89, i8* %51
br label %55
55: ; preds = %54, %50
%56 = getelementptr inbounds i8, i8* %0, i64 61
%57 = load i8, i8* %56
%58 = icmp eq i8 %57, 112
br i1 %58, label %59, label %60
59: ; preds = %55
store i8 121, i8* %56
br label %60
60: ; preds = %59, %55
%61 = getelementptr inbounds i8, i8* %0, i64 6
%62 = load i8, i8* %61
%63 = icmp eq i8 %62, 80
br i1 %63, label %64, label %65
64: ; preds = %60
store i8 89, i8* %61
br label %65
65: ; preds = %64, %60
%66 = getelementptr inbounds i8, i8* %0, i64 62
%67 = load i8, i8* %66
%68 = icmp eq i8 %67, 112
br i1 %68, label %69, label %70
69: ; preds = %65
store i8 121, i8* %66
br label %70
70: ; preds = %69, %65
%71 = getelementptr inbounds i8, i8* %0, i64 7
%72 = load i8, i8* %71
%73 = icmp eq i8 %72, 80
br i1 %73, label %74, label %75
74: ; preds = %70
store i8 89, i8* %71
br label %75
75: ; preds = %74, %70
%76 = getelementptr inbounds i8, i8* %0, i64 63
%77 = load i8, i8* %76
%78 = icmp eq i8 %77, 112
br i1 %78, label %79, label %80
79: ; preds = %75
store i8 121, i8* %76
br label %80
80: ; preds = %79, %75
ret void
}