#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 */
char sub_mult(char *, int **, int, int, int);
int find(char *arr, int **matrix, int size, int stride) {
  int i, k;
  for (i = 0; i < size; i++) {
    if (sub_mult(arr, matrix, 0, i, stride) == 'i') {
      for (k = size - 1; k >= i + 2; k--) {
        if (sub_mult(arr, matrix, k, size - 1, stride) == 'k') {
          if (sub_mult(arr, matrix, i + 1, k - 1, stride) == 'j') {
            return 1;
          }
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1200 <find+0xf0>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%r8d
xor    %edx,%edx
call   1030 <sub_mult@plt>
movsbl %al,%eax
cmp    $0x69,%eax
jne    11ed <find+0xdd>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x24(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jl     11e8 <find+0xd8>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%edx
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x20(%rbp),%r8d
call   1030 <sub_mult@plt>
movsbl %al,%eax
cmp    $0x6b,%eax
jne    11d5 <find+0xc5>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x24(%rbp),%edx
add    $0x1,%edx
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x20(%rbp),%r8d
call   1030 <sub_mult@plt>
movsbl %al,%eax
cmp    $0x6a,%eax
jne    11d0 <find+0xc0>
movl   $0x1,-0x4(%rbp)
jmp    1207 <find+0xf7>
jmp    11d5 <find+0xc5>
jmp    11da <find+0xca>
mov    -0x28(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x28(%rbp)
jmp    1164 <find+0x54>
jmp    11ed <find+0xdd>
jmp    11f2 <find+0xe2>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112d <find+0x1d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %edx,%edx
jle    11da <find+0xca>
mov    %ecx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    -0x1(%rdx),%eax
mov    %eax,0x14(%rsp)
xor    %ecx,%ecx
mov    %rdx,(%rsp)
jmp    1154 <find+0x44>
xchg   %ax,%ax
mov    0x8(%rsp),%rcx
add    $0x1,%ecx
mov    (%rsp),%rdx
cmp    %edx,%ecx
je     11da <find+0xca>
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
mov    %rcx,0x8(%rsp)
mov    %r15d,%r8d
call   1030 <sub_mult@plt>
cmp    $0x69,%al
jne    1140 <find+0x30>
mov    0x8(%rsp),%rax
lea    0x2(%rax),%r13d
cmp    (%rsp),%r13d
jge    1140 <find+0x30>
mov    0x8(%rsp),%rax
add    $0x1,%eax
mov    %eax,0x10(%rsp)
mov    (%rsp),%r12
jmp    1198 <find+0x88>
xchg   %ax,%ax
mov    %r14d,%r12d
cmp    %r13d,%r14d
jle    1140 <find+0x30>
lea    -0x1(%r12),%r14d
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
mov    0x14(%rsp),%ecx
mov    %r15d,%r8d
call   1030 <sub_mult@plt>
cmp    $0x6b,%al
jne    1190 <find+0x80>
add    $0xfffffffe,%r12d
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    0x10(%rsp),%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
call   1030 <sub_mult@plt>
cmp    $0x6a,%al
jne    1190 <find+0x80>
mov    $0x1,%eax
jmp    11dc <find+0xcc>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @find(i8* %0, i32** %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %6
store i32** %1, i32*** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 0, i32* %10
br label %12
12: ; preds = %61, %4
%13 = load i32, i32* %10
%14 = load i32, i32* %8
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %64
16: ; preds = %12
%17 = load i8*, i8** %6
%18 = load i32**, i32*** %7
%19 = load i32, i32* %10
%20 = load i32, i32* %9
%21 = call signext i8 @sub_mult(i8* %17, i32** %18, i32 0, i32 %19, i32 %20)
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 105
br i1 %23, label %24, label %60
24: ; preds = %16
%25 = load i32, i32* %8
%26 = sub nsw i32 %25, 1
store i32 %26, i32* %11
br label %27
27: ; preds = %56, %24
%28 = load i32, i32* %11
%29 = load i32, i32* %10
%30 = add nsw i32 %29, 2
%31 = icmp sge i32 %28, %30
br i1 %31, label %32, label %59
32: ; preds = %27
%33 = load i8*, i8** %6
%34 = load i32**, i32*** %7
%35 = load i32, i32* %11
%36 = load i32, i32* %8
%37 = sub nsw i32 %36, 1
%38 = load i32, i32* %9
%39 = call signext i8 @sub_mult(i8* %33, i32** %34, i32 %35, i32 %37, i32 %38)
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 107
br i1 %41, label %42, label %55
42: ; preds = %32
%43 = load i8*, i8** %6
%44 = load i32**, i32*** %7
%45 = load i32, i32* %10
%46 = add nsw i32 %45, 1
%47 = load i32, i32* %11
%48 = sub nsw i32 %47, 1
%49 = load i32, i32* %9
%50 = call signext i8 @sub_mult(i8* %43, i32** %44, i32 %46, i32 %48, i32 %49)
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 106
br i1 %52, label %53, label %54
53: ; preds = %42
store i32 1, i32* %5
br label %65
54: ; preds = %42
br label %55
55: ; preds = %54, %32
br label %56
56: ; preds = %55
%57 = load i32, i32* %11
%58 = add nsw i32 %57, -1
store i32 %58, i32* %11
br label %27
59: ; preds = %27
br label %60
60: ; preds = %59, %16
br label %61
61: ; preds = %60
%62 = load i32, i32* %10
%63 = add nsw i32 %62, 1
store i32 %63, i32* %10
br label %12
64: ; preds = %12
store i32 0, i32* %5
br label %65
65: ; preds = %64, %53
%66 = load i32, i32* %5
ret i32 %66
}

LLVM IR (-O2):
define i32 @find(i8* %0, i32** %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %30
6: ; preds = %4
%7 = add nsw i32 %2, -1
br label %8
8: ; preds = %6, %27
%9 = phi i32 [ 0, %6 ], [ %28, %27 ]
%10 = tail call signext i8 @sub_mult(i8* %0, i32** %1, i32 0, i32 %9, i32 %3)
%11 = icmp eq i8 %10, 105
br i1 %11, label %12, label %27
12: ; preds = %8
%13 = add nuw nsw i32 %9, 2
%14 = icmp slt i32 %13, %2
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = add nuw nsw i32 %9, 1
br label %17
17: ; preds = %15, %25
%18 = phi i32 [ %7, %15 ], [ %21, %25 ]
%19 = tail call signext i8 @sub_mult(i8* %0, i32** %1, i32 %18, i32 %7, i32 %3)
%20 = icmp eq i8 %19, 107
%21 = add nsw i32 %18, -1
br i1 %20, label %22, label %25
22: ; preds = %17
%23 = tail call signext i8 @sub_mult(i8* %0, i32** %1, i32 %16, i32 %21, i32 %3)
%24 = icmp eq i8 %23, 106
br i1 %24, label %30, label %25
25: ; preds = %17, %22
%26 = icmp sgt i32 %18, %13
br i1 %26, label %17, label %27
27: ; preds = %25, %12, %8
%28 = add nuw nsw i32 %9, 1
%29 = icmp eq i32 %28, %2
br i1 %29, label %30, label %8
30: ; preds = %27, %22, %4
%31 = phi i32 [ 0, %4 ], [ 1, %22 ], [ 0, %27 ]
ret i32 %31
}