#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*/ printf(char *);
int findWin(char *playground) {
  int count = 0;
  int p;
  for (p = 0; p < 3; p++) {
    if (playground[p * 3 + 0] == 'o')
      count += 1;
    if (playground[p * 3 + 1] == 'o')
      count += 1;
    if (playground[p * 3 + 2] == 'o')
      count += 1;
    if (count == 2) {
      if (playground[p * 3 + 0] == ' ')
        return p * 3 + 0;
      if (playground[p * 3 + 1] == ' ')
        return p * 3 + 1;
      if (playground[p * 3 + 2] == ' ')
        return p * 3 + 2;
    }
    count = 0;
  }
  for (p = 0; p < 3; p++) {
    if (playground[3 * 0 + p] == 'o')
      count += 1;
    if (playground[3 * 1 + p] == 'o')
      count += 1;
    if (playground[3 * 2 + p] == 'o')
      count += 1;
    if (count == 2) {
      if (playground[3 * 0 + p] == ' ')
        return 3 * 0 + p;
      if (playground[3 * 1 + p] == ' ')
        return 3 * 1 + p;
      if (playground[3 * 2 + p] == ' ')
        return 3 * 2 + p;
    }
    count = 0;
  }
  printf("check Diognal\n");
  if (playground[3 * 0 + 0] == 'o')
    count += 1;
  if (playground[3 * 1 + 1] == 'o')
    count += 1;
  if (playground[3 * 2 + 2] == 'o')
    count += 1;
  if (count == 2) {
    if (playground[3 * 0 + 0] == ' ')
      return 3 * 0 + 0;
    if (playground[3 * 1 + 1] == ' ')
      return 3 * 1 + 1;
    if (playground[3 * 2 + 2] == ' ')
      return 3 * 2 + 2;
  }
  printf("check other dia\n");
  count = 0;
  if (playground[3 * 0 + 2] == 'o')
    count += 1;
  if (playground[3 * 1 + 1] == 'o')
    count += 1;
  if (playground[3 * 2 + 0] == 'o')
    count += 1;
  if (count == 2) {
    if (playground[3 * 0 + 2] == ' ')
      return 3 * 0 + 2;
    if (playground[3 * 1 + 1] == ' ')
      return 3 * 1 + 1;
    if (playground[3 * 2 + 0] == ' ')
      return 3 * 2 + 0;
  }
  printf("whaaat\n");
  return -1;
}


x86 assembly (clang, -O0):
<findWin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    1242 <findWin+0x132>
mov    -0x10(%rbp),%rax
imul   $0x3,-0x18(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6f,%eax
jne    1158 <findWin+0x48>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x3,-0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6f,%eax
jne    117c <findWin+0x6c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x3,-0x18(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6f,%eax
jne    11a0 <findWin+0x90>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jne    122d <findWin+0x11d>
mov    -0x10(%rbp),%rax
imul   $0x3,-0x18(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    11d4 <findWin+0xc4>
imul   $0x3,-0x18(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x4(%rbp)
jmp    14f0 <findWin+0x3e0>
mov    -0x10(%rbp),%rax
imul   $0x3,-0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    11fe <findWin+0xee>
imul   $0x3,-0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    14f0 <findWin+0x3e0>
mov    -0x10(%rbp),%rax
imul   $0x3,-0x18(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1228 <findWin+0x118>
imul   $0x3,-0x18(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    14f0 <findWin+0x3e0>
jmp    122d <findWin+0x11d>
movl   $0x0,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <findWin+0x1a>
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    1358 <findWin+0x248>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6f,%eax
jne    1276 <findWin+0x166>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6f,%eax
jne    1299 <findWin+0x189>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6f,%eax
jne    12bc <findWin+0x1ac>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jne    1343 <findWin+0x233>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    12ee <findWin+0x1de>
mov    -0x18(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x4(%rbp)
jmp    14f0 <findWin+0x3e0>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1316 <findWin+0x206>
mov    -0x18(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    14f0 <findWin+0x3e0>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x6,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    133e <findWin+0x22e>
mov    -0x18(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x4(%rbp)
jmp    14f0 <findWin+0x3e0>
jmp    1343 <findWin+0x233>
movl   $0x0,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1249 <findWin+0x139>
lea    0xca1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6f,%eax
jne    137d <findWin+0x26d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x6f,%eax
jne    1397 <findWin+0x287>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x8(%rax),%eax
cmp    $0x6f,%eax
jne    13b1 <findWin+0x2a1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jne    1416 <findWin+0x306>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    13d7 <findWin+0x2c7>
movl   $0x0,-0x4(%rbp)
jmp    14f0 <findWin+0x3e0>
mov    -0x10(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x20,%eax
jne    13f4 <findWin+0x2e4>
movl   $0x4,-0x4(%rbp)
jmp    14f0 <findWin+0x3e0>
mov    -0x10(%rbp),%rax
movsbl 0x8(%rax),%eax
cmp    $0x20,%eax
jne    1411 <findWin+0x301>
movl   $0x8,-0x4(%rbp)
jmp    14f0 <findWin+0x3e0>
jmp    1416 <findWin+0x306>
lea    0xbf2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x6f,%eax
jne    1443 <findWin+0x333>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x6f,%eax
jne    145d <findWin+0x34d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x6(%rax),%eax
cmp    $0x6f,%eax
jne    1477 <findWin+0x367>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jne    14dd <findWin+0x3cd>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x20,%eax
jne    149e <findWin+0x38e>
movl   $0x2,-0x4(%rbp)
jmp    14f0 <findWin+0x3e0>
mov    -0x10(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x20,%eax
jne    14bb <findWin+0x3ab>
movl   $0x4,-0x4(%rbp)
jmp    14f0 <findWin+0x3e0>
mov    -0x10(%rbp),%rax
movsbl 0x6(%rax),%eax
cmp    $0x20,%eax
jne    14d8 <findWin+0x3c8>
movl   $0x6,-0x4(%rbp)
jmp    14f0 <findWin+0x3e0>
jmp    14dd <findWin+0x3cd>
lea    0xb3c(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findWin>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%r10b
mov    0x1(%rdi),%r9b
xor    %edi,%edi
cmp    $0x6f,%r10b
sete   %dil
lea    0x1(%rdi),%ebp
cmp    $0x6f,%r9b
mov    %edi,%eax
cmove  %ebp,%eax
mov    0x2(%rbx),%r14b
xor    %r8d,%r8d
cmp    $0x6f,%r14b
sete   %r8b
add    %r8d,%eax
cmp    $0x2,%eax
jne    117c <findWin+0x6c>
xor    %eax,%eax
cmp    $0x20,%r10b
je     13d3 <findWin+0x2c3>
mov    $0x1,%eax
cmp    $0x20,%r9b
je     13d3 <findWin+0x2c3>
mov    $0x2,%eax
cmp    $0x20,%r14b
je     13d3 <findWin+0x2c3>
mov    0x3(%rbx),%r12b
mov    0x4(%rbx),%cl
xor    %eax,%eax
cmp    $0x6f,%r12b
sete   %al
lea    0x1(%rax),%esi
mov    %cl,0x6(%rsp)
cmp    $0x6f,%cl
cmovne %eax,%esi
mov    0x5(%rbx),%dl
xor    %eax,%eax
cmp    $0x6f,%dl
sete   %al
add    %esi,%eax
cmp    $0x2,%eax
jne    11d8 <findWin+0xc8>
mov    $0x3,%eax
cmp    $0x20,%r12b
je     13d3 <findWin+0x2c3>
mov    $0x4,%eax
cmpb   $0x20,0x6(%rsp)
je     13d3 <findWin+0x2c3>
mov    $0x5,%eax
cmp    $0x20,%dl
je     13d3 <findWin+0x2c3>
mov    0x6(%rbx),%r13b
mov    0x7(%rbx),%cl
xor    %r11d,%r11d
cmp    $0x6f,%r13b
sete   %r11b
lea    0x1(%r11),%eax
mov    %cl,0x5(%rsp)
cmp    $0x6f,%cl
cmovne %r11d,%eax
mov    0x8(%rbx),%r15b
xor    %esi,%esi
mov    %r15b,0x7(%rsp)
cmp    $0x6f,%r15b
mov    %edx,%r15d
sete   %sil
add    %esi,%eax
cmp    $0x2,%eax
jne    1245 <findWin+0x135>
mov    $0x6,%eax
cmp    $0x20,%r13b
je     13d3 <findWin+0x2c3>
mov    $0x7,%eax
cmpb   $0x20,0x5(%rsp)
je     13d3 <findWin+0x2c3>
mov    $0x8,%eax
cmpb   $0x20,0x7(%rsp)
je     13d3 <findWin+0x2c3>
cmp    $0x6f,%r12b
cmove  %ebp,%edi
add    %r11d,%edi
cmp    $0x2,%edi
jne    127e <findWin+0x16e>
xor    %eax,%eax
cmp    $0x20,%r10b
je     13d3 <findWin+0x2c3>
mov    $0x3,%eax
cmp    $0x20,%r12b
je     13d3 <findWin+0x2c3>
mov    $0x6,%eax
cmp    $0x20,%r13b
je     13d3 <findWin+0x2c3>
xor    %eax,%eax
cmpb   $0x6f,0x5(%rsp)
sete   %al
xor    %ecx,%ecx
cmp    $0x6f,%r9b
sete   %cl
lea    0x1(%rcx),%edi
cmpb   $0x6f,0x6(%rsp)
cmovne %ecx,%edi
add    %edi,%eax
cmp    $0x2,%eax
jne    12d2 <findWin+0x1c2>
mov    $0x1,%eax
cmp    $0x20,%r9b
je     13d3 <findWin+0x2c3>
mov    $0x4,%eax
cmpb   $0x20,0x6(%rsp)
je     13d3 <findWin+0x2c3>
mov    $0x7,%eax
cmpb   $0x20,0x5(%rsp)
je     13d3 <findWin+0x2c3>
xor    %eax,%eax
cmp    $0x6f,%r14b
sete   %al
add    $0x1,%eax
cmp    $0x6f,%r15b
cmove  %eax,%r8d
add    %esi,%r8d
cmp    $0x2,%r8d
jne    131d <findWin+0x20d>
mov    $0x2,%eax
cmp    $0x20,%r14b
je     13d3 <findWin+0x2c3>
mov    $0x5,%eax
cmp    $0x20,%r15b
je     13d3 <findWin+0x2c3>
mov    $0x8,%eax
cmpb   $0x20,0x7(%rsp)
je     13d3 <findWin+0x2c3>
lea    0xcdc(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%dl
mov    0x4(%rbx),%sil
xor    %eax,%eax
cmp    $0x6f,%dl
sete   %al
lea    0x1(%rax),%edi
cmp    $0x6f,%sil
cmovne %eax,%edi
mov    0x8(%rbx),%cl
xor    %eax,%eax
cmp    $0x6f,%cl
sete   %al
add    %edi,%eax
cmp    $0x2,%eax
jne    136f <findWin+0x25f>
xor    %eax,%eax
cmp    $0x20,%dl
je     13d3 <findWin+0x2c3>
mov    $0x4,%eax
cmp    $0x20,%sil
je     13d3 <findWin+0x2c3>
mov    $0x8,%eax
cmp    $0x20,%cl
je     13d3 <findWin+0x2c3>
lea    0xc98(%rip),%rdi
call   1030 <puts@plt>
mov    0x2(%rbx),%dl
mov    0x4(%rbx),%cl
xor    %eax,%eax
cmp    $0x6f,%dl
sete   %al
lea    0x1(%rax),%esi
cmp    $0x6f,%cl
cmovne %eax,%esi
mov    0x6(%rbx),%bl
xor    %eax,%eax
cmp    $0x6f,%bl
sete   %al
add    %esi,%eax
cmp    $0x2,%eax
jne    13c2 <findWin+0x2b2>
mov    $0x2,%eax
cmp    $0x20,%dl
je     13d3 <findWin+0x2c3>
mov    $0x4,%eax
cmp    $0x20,%cl
je     13d3 <findWin+0x2c3>
mov    $0x6,%eax
cmp    $0x20,%bl
je     13d3 <findWin+0x2c3>
lea    0xc55(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"check Diognal\0A\00"
@.str.1 = [17 x i8] c"check other dia\0A\00"
@.str.2 = [8 x i8] c"whaaat\0A\00"
define i32 @findWin(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %95, %1
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %98
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = load i32, i32* %5
%12 = mul nsw i32 %11, 3
%13 = add nsw i32 %12, 0
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %10, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 111
br i1 %18, label %19, label %22
19: ; preds = %9
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %22
22: ; preds = %19, %9
%23 = load i8*, i8** %3
%24 = load i32, i32* %5
%25 = mul nsw i32 %24, 3
%26 = add nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %23, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 111
br i1 %31, label %32, label %35
32: ; preds = %22
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 1
store i32 %34, i32* %4
br label %35
35: ; preds = %32, %22
%36 = load i8*, i8** %3
%37 = load i32, i32* %5
%38 = mul nsw i32 %37, 3
%39 = add nsw i32 %38, 2
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %36, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 111
br i1 %44, label %45, label %48
45: ; preds = %35
%46 = load i32, i32* %4
%47 = add nsw i32 %46, 1
store i32 %47, i32* %4
br label %48
48: ; preds = %45, %35
%49 = load i32, i32* %4
%50 = icmp eq i32 %49, 2
br i1 %50, label %51, label %94
51: ; preds = %48
%52 = load i8*, i8** %3
%53 = load i32, i32* %5
%54 = mul nsw i32 %53, 3
%55 = add nsw i32 %54, 0
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %52, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 32
br i1 %60, label %61, label %65
61: ; preds = %51
%62 = load i32, i32* %5
%63 = mul nsw i32 %62, 3
%64 = add nsw i32 %63, 0
store i32 %64, i32* %2
br label %290
65: ; preds = %51
%66 = load i8*, i8** %3
%67 = load i32, i32* %5
%68 = mul nsw i32 %67, 3
%69 = add nsw i32 %68, 1
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %66, i64 %70
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = icmp eq i32 %73, 32
br i1 %74, label %75, label %79
75: ; preds = %65
%76 = load i32, i32* %5
%77 = mul nsw i32 %76, 3
%78 = add nsw i32 %77, 1
store i32 %78, i32* %2
br label %290
79: ; preds = %65
%80 = load i8*, i8** %3
%81 = load i32, i32* %5
%82 = mul nsw i32 %81, 3
%83 = add nsw i32 %82, 2
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %80, i64 %84
%86 = load i8, i8* %85
%87 = sext i8 %86 to i32
%88 = icmp eq i32 %87, 32
br i1 %88, label %89, label %93
89: ; preds = %79
%90 = load i32, i32* %5
%91 = mul nsw i32 %90, 3
%92 = add nsw i32 %91, 2
store i32 %92, i32* %2
br label %290
93: ; preds = %79
br label %94
94: ; preds = %93, %48
store i32 0, i32* %4
br label %95
95: ; preds = %94
%96 = load i32, i32* %5
%97 = add nsw i32 %96, 1
store i32 %97, i32* %5
br label %6
98: ; preds = %6
store i32 0, i32* %5
br label %99
99: ; preds = %179, %98
%100 = load i32, i32* %5
%101 = icmp slt i32 %100, 3
br i1 %101, label %102, label %182
102: ; preds = %99
%103 = load i8*, i8** %3
%104 = load i32, i32* %5
%105 = add nsw i32 0, %104
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8, i8* %103, i64 %106
%108 = load i8, i8* %107
%109 = sext i8 %108 to i32
%110 = icmp eq i32 %109, 111
br i1 %110, label %111, label %114
111: ; preds = %102
%112 = load i32, i32* %4
%113 = add nsw i32 %112, 1
store i32 %113, i32* %4
br label %114
114: ; preds = %111, %102
%115 = load i8*, i8** %3
%116 = load i32, i32* %5
%117 = add nsw i32 3, %116
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8, i8* %115, i64 %118
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = icmp eq i32 %121, 111
br i1 %122, label %123, label %126
123: ; preds = %114
%124 = load i32, i32* %4
%125 = add nsw i32 %124, 1
store i32 %125, i32* %4
br label %126
126: ; preds = %123, %114
%127 = load i8*, i8** %3
%128 = load i32, i32* %5
%129 = add nsw i32 6, %128
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i8, i8* %127, i64 %130
%132 = load i8, i8* %131
%133 = sext i8 %132 to i32
%134 = icmp eq i32 %133, 111
br i1 %134, label %135, label %138
135: ; preds = %126
%136 = load i32, i32* %4
%137 = add nsw i32 %136, 1
store i32 %137, i32* %4
br label %138
138: ; preds = %135, %126
%139 = load i32, i32* %4
%140 = icmp eq i32 %139, 2
br i1 %140, label %141, label %178
141: ; preds = %138
%142 = load i8*, i8** %3
%143 = load i32, i32* %5
%144 = add nsw i32 0, %143
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds i8, i8* %142, i64 %145
%147 = load i8, i8* %146
%148 = sext i8 %147 to i32
%149 = icmp eq i32 %148, 32
br i1 %149, label %150, label %153
150: ; preds = %141
%151 = load i32, i32* %5
%152 = add nsw i32 0, %151
store i32 %152, i32* %2
br label %290
153: ; preds = %141
%154 = load i8*, i8** %3
%155 = load i32, i32* %5
%156 = add nsw i32 3, %155
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds i8, i8* %154, i64 %157
%159 = load i8, i8* %158
%160 = sext i8 %159 to i32
%161 = icmp eq i32 %160, 32
br i1 %161, label %162, label %165
162: ; preds = %153
%163 = load i32, i32* %5
%164 = add nsw i32 3, %163
store i32 %164, i32* %2
br label %290
165: ; preds = %153
%166 = load i8*, i8** %3
%167 = load i32, i32* %5
%168 = add nsw i32 6, %167
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds i8, i8* %166, i64 %169
%171 = load i8, i8* %170
%172 = sext i8 %171 to i32
%173 = icmp eq i32 %172, 32
br i1 %173, label %174, label %177
174: ; preds = %165
%175 = load i32, i32* %5
%176 = add nsw i32 6, %175
store i32 %176, i32* %2
br label %290
177: ; preds = %165
br label %178
178: ; preds = %177, %138
store i32 0, i32* %4
br label %179
179: ; preds = %178
%180 = load i32, i32* %5
%181 = add nsw i32 %180, 1
store i32 %181, i32* %5
br label %99
182: ; preds = %99
%183 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%184 = load i8*, i8** %3
%185 = getelementptr inbounds i8, i8* %184, i64 0
%186 = load i8, i8* %185
%187 = sext i8 %186 to i32
%188 = icmp eq i32 %187, 111
br i1 %188, label %189, label %192
189: ; preds = %182
%190 = load i32, i32* %4
%191 = add nsw i32 %190, 1
store i32 %191, i32* %4
br label %192
192: ; preds = %189, %182
%193 = load i8*, i8** %3
%194 = getelementptr inbounds i8, i8* %193, i64 4
%195 = load i8, i8* %194
%196 = sext i8 %195 to i32
%197 = icmp eq i32 %196, 111
br i1 %197, label %198, label %201
198: ; preds = %192
%199 = load i32, i32* %4
%200 = add nsw i32 %199, 1
store i32 %200, i32* %4
br label %201
201: ; preds = %198, %192
%202 = load i8*, i8** %3
%203 = getelementptr inbounds i8, i8* %202, i64 8
%204 = load i8, i8* %203
%205 = sext i8 %204 to i32
%206 = icmp eq i32 %205, 111
br i1 %206, label %207, label %210
207: ; preds = %201
%208 = load i32, i32* %4
%209 = add nsw i32 %208, 1
store i32 %209, i32* %4
br label %210
210: ; preds = %207, %201
%211 = load i32, i32* %4
%212 = icmp eq i32 %211, 2
br i1 %212, label %213, label %235
213: ; preds = %210
%214 = load i8*, i8** %3
%215 = getelementptr inbounds i8, i8* %214, i64 0
%216 = load i8, i8* %215
%217 = sext i8 %216 to i32
%218 = icmp eq i32 %217, 32
br i1 %218, label %219, label %220
219: ; preds = %213
store i32 0, i32* %2
br label %290
220: ; preds = %213
%221 = load i8*, i8** %3
%222 = getelementptr inbounds i8, i8* %221, i64 4
%223 = load i8, i8* %222
%224 = sext i8 %223 to i32
%225 = icmp eq i32 %224, 32
br i1 %225, label %226, label %227
226: ; preds = %220
store i32 4, i32* %2
br label %290
227: ; preds = %220
%228 = load i8*, i8** %3
%229 = getelementptr inbounds i8, i8* %228, i64 8
%230 = load i8, i8* %229
%231 = sext i8 %230 to i32
%232 = icmp eq i32 %231, 32
br i1 %232, label %233, label %234
233: ; preds = %227
store i32 8, i32* %2
br label %290
234: ; preds = %227
br label %235
235: ; preds = %234, %210
%236 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %4
%237 = load i8*, i8** %3
%238 = getelementptr inbounds i8, i8* %237, i64 2
%239 = load i8, i8* %238
%240 = sext i8 %239 to i32
%241 = icmp eq i32 %240, 111
br i1 %241, label %242, label %245
242: ; preds = %235
%243 = load i32, i32* %4
%244 = add nsw i32 %243, 1
store i32 %244, i32* %4
br label %245
245: ; preds = %242, %235
%246 = load i8*, i8** %3
%247 = getelementptr inbounds i8, i8* %246, i64 4
%248 = load i8, i8* %247
%249 = sext i8 %248 to i32
%250 = icmp eq i32 %249, 111
br i1 %250, label %251, label %254
251: ; preds = %245
%252 = load i32, i32* %4
%253 = add nsw i32 %252, 1
store i32 %253, i32* %4
br label %254
254: ; preds = %251, %245
%255 = load i8*, i8** %3
%256 = getelementptr inbounds i8, i8* %255, i64 6
%257 = load i8, i8* %256
%258 = sext i8 %257 to i32
%259 = icmp eq i32 %258, 111
br i1 %259, label %260, label %263
260: ; preds = %254
%261 = load i32, i32* %4
%262 = add nsw i32 %261, 1
store i32 %262, i32* %4
br label %263
263: ; preds = %260, %254
%264 = load i32, i32* %4
%265 = icmp eq i32 %264, 2
br i1 %265, label %266, label %288
266: ; preds = %263
%267 = load i8*, i8** %3
%268 = getelementptr inbounds i8, i8* %267, i64 2
%269 = load i8, i8* %268
%270 = sext i8 %269 to i32
%271 = icmp eq i32 %270, 32
br i1 %271, label %272, label %273
272: ; preds = %266
store i32 2, i32* %2
br label %290
273: ; preds = %266
%274 = load i8*, i8** %3
%275 = getelementptr inbounds i8, i8* %274, i64 4
%276 = load i8, i8* %275
%277 = sext i8 %276 to i32
%278 = icmp eq i32 %277, 32
br i1 %278, label %279, label %280
279: ; preds = %273
store i32 4, i32* %2
br label %290
280: ; preds = %273
%281 = load i8*, i8** %3
%282 = getelementptr inbounds i8, i8* %281, i64 6
%283 = load i8, i8* %282
%284 = sext i8 %283 to i32
%285 = icmp eq i32 %284, 32
br i1 %285, label %286, label %287
286: ; preds = %280
store i32 6, i32* %2
br label %290
287: ; preds = %280
br label %288
288: ; preds = %287, %263
%289 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %2
br label %290
290: ; preds = %288, %286, %279, %272, %233, %226, %219, %174, %162, %150, %89, %75, %61
%291 = load i32, i32* %2
ret i32 %291
}

LLVM IR (-O2):
@str = [14 x i8] c"check Diognal\00"
@str.3 = [16 x i8] c"check other dia\00"
@str.4 = [7 x i8] c"whaaat\00"
define i32 @findWin(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 111
%4 = zext i1 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 111
%8 = select i1 %3, i32 2, i32 1
%9 = select i1 %7, i32 %8, i32 %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 111
%13 = zext i1 %12 to i32
%14 = add nuw nsw i32 %9, %13
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %22
16: ; preds = %1
%17 = icmp eq i8 %2, 32
br i1 %17, label %142, label %18
18: ; preds = %16
%19 = icmp eq i8 %6, 32
br i1 %19, label %142, label %20
20: ; preds = %18
%21 = icmp eq i8 %11, 32
br i1 %21, label %142, label %22
22: ; preds = %20, %1
%23 = getelementptr inbounds i8, i8* %0, i64 3
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 111
%26 = zext i1 %25 to i32
%27 = getelementptr inbounds i8, i8* %0, i64 4
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, 111
%30 = select i1 %25, i32 2, i32 1
%31 = select i1 %29, i32 %30, i32 %26
%32 = getelementptr inbounds i8, i8* %0, i64 5
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, 111
%35 = zext i1 %34 to i32
%36 = add nuw nsw i32 %31, %35
%37 = icmp eq i32 %36, 2
br i1 %37, label %38, label %44
38: ; preds = %22
%39 = icmp eq i8 %24, 32
br i1 %39, label %142, label %40
40: ; preds = %38
%41 = icmp eq i8 %28, 32
br i1 %41, label %142, label %42
42: ; preds = %40
%43 = icmp eq i8 %33, 32
br i1 %43, label %142, label %44
44: ; preds = %42, %22
%45 = getelementptr inbounds i8, i8* %0, i64 6
%46 = load i8, i8* %45
%47 = icmp eq i8 %46, 111
%48 = zext i1 %47 to i32
%49 = getelementptr inbounds i8, i8* %0, i64 7
%50 = load i8, i8* %49
%51 = icmp eq i8 %50, 111
%52 = select i1 %47, i32 2, i32 1
%53 = select i1 %51, i32 %52, i32 %48
%54 = getelementptr inbounds i8, i8* %0, i64 8
%55 = load i8, i8* %54
%56 = icmp eq i8 %55, 111
%57 = zext i1 %56 to i32
%58 = add nuw nsw i32 %53, %57
%59 = icmp eq i32 %58, 2
br i1 %59, label %60, label %66
60: ; preds = %44
%61 = icmp eq i8 %46, 32
br i1 %61, label %142, label %62
62: ; preds = %60
%63 = icmp eq i8 %50, 32
br i1 %63, label %142, label %64
64: ; preds = %62
%65 = icmp eq i8 %55, 32
br i1 %65, label %142, label %66
66: ; preds = %64, %44
%67 = select i1 %25, i32 %8, i32 %4
%68 = add nuw nsw i32 %67, %48
%69 = icmp eq i32 %68, 2
br i1 %69, label %70, label %76
70: ; preds = %66
%71 = icmp eq i8 %2, 32
br i1 %71, label %142, label %72
72: ; preds = %70
%73 = icmp eq i8 %24, 32
br i1 %73, label %142, label %74
74: ; preds = %72
%75 = icmp eq i8 %46, 32
br i1 %75, label %142, label %76
76: ; preds = %74, %66
%77 = zext i1 %7 to i32
%78 = select i1 %7, i32 2, i32 1
%79 = select i1 %29, i32 %78, i32 %77
%80 = zext i1 %51 to i32
%81 = add nuw nsw i32 %79, %80
%82 = icmp eq i32 %81, 2
br i1 %82, label %83, label %89
83: ; preds = %76
%84 = icmp eq i8 %6, 32
br i1 %84, label %142, label %85
85: ; preds = %83
%86 = icmp eq i8 %28, 32
br i1 %86, label %142, label %87
87: ; preds = %85
%88 = icmp eq i8 %50, 32
br i1 %88, label %142, label %89
89: ; preds = %87, %76
%90 = select i1 %12, i32 2, i32 1
%91 = select i1 %34, i32 %90, i32 %13
%92 = add nuw nsw i32 %91, %57
%93 = icmp eq i32 %92, 2
br i1 %93, label %94, label %100
94: ; preds = %89
%95 = icmp eq i8 %11, 32
br i1 %95, label %142, label %96
96: ; preds = %94
%97 = icmp eq i8 %33, 32
br i1 %97, label %142, label %98
98: ; preds = %96
%99 = icmp eq i8 %55, 32
br i1 %99, label %142, label %100
100: ; preds = %98, %89
%101 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%102 = load i8, i8* %0
%103 = icmp eq i8 %102, 111
%104 = zext i1 %103 to i32
%105 = load i8, i8* %27
%106 = icmp eq i8 %105, 111
%107 = select i1 %103, i32 2, i32 1
%108 = select i1 %106, i32 %107, i32 %104
%109 = load i8, i8* %54
%110 = icmp eq i8 %109, 111
%111 = zext i1 %110 to i32
%112 = add nuw nsw i32 %108, %111
%113 = icmp eq i32 %112, 2
br i1 %113, label %114, label %120
114: ; preds = %100
%115 = icmp eq i8 %102, 32
br i1 %115, label %142, label %116
116: ; preds = %114
%117 = icmp eq i8 %105, 32
br i1 %117, label %142, label %118
118: ; preds = %116
%119 = icmp eq i8 %109, 32
br i1 %119, label %142, label %120
120: ; preds = %118, %100
%121 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.3, i64 0, i64 0))
%122 = load i8, i8* %10
%123 = icmp eq i8 %122, 111
%124 = zext i1 %123 to i32
%125 = load i8, i8* %27
%126 = icmp eq i8 %125, 111
%127 = select i1 %123, i32 2, i32 1
%128 = select i1 %126, i32 %127, i32 %124
%129 = load i8, i8* %45
%130 = icmp eq i8 %129, 111
%131 = zext i1 %130 to i32
%132 = add nuw nsw i32 %128, %131
%133 = icmp eq i32 %132, 2
br i1 %133, label %134, label %140
134: ; preds = %120
%135 = icmp eq i8 %122, 32
br i1 %135, label %142, label %136
136: ; preds = %134
%137 = icmp eq i8 %125, 32
br i1 %137, label %142, label %138
138: ; preds = %136
%139 = icmp eq i8 %129, 32
br i1 %139, label %142, label %140
140: ; preds = %138, %120
%141 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
br label %142
142: ; preds = %20, %18, %16, %38, %40, %42, %60, %62, %64, %74, %72, %70, %83, %85, %87, %94, %96, %98, %138, %136, %134, %118, %116, %114, %140
%143 = phi i32 [ -1, %140 ], [ 0, %114 ], [ 4, %116 ], [ 8, %118 ], [ 2, %134 ], [ 4, %136 ], [ 6, %138 ], [ 0, %70 ], [ 3, %72 ], [ 6, %74 ], [ 1, %83 ], [ 4, %85 ], [ 7, %87 ], [ 2, %94 ], [ 5, %96 ], [ 8, %98 ], [ 0, %16 ], [ 1, %18 ], [ 2, %20 ], [ 3, %38 ], [ 4, %40 ], [ 5, %42 ], [ 6, %60 ], [ 7, %62 ], [ 8, %64 ]
ret i32 %143
}