#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 findFirstCharInd(char *, int, char);
int isSubsequence(char strOne[], char strTwo[]) {
  int indOne, indTwo;
  for (indOne = 0, indTwo = -1; strOne[indOne] != '\0'; indOne++) {
    indTwo = findFirstCharInd(strTwo, indTwo + 1, strOne[indOne]);
    if (indTwo < 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isSubsequence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0xffffffff,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     118a <isSubsequence+0x7a>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
call   1030 <findFirstCharInd@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1177 <isSubsequence+0x67>
movl   $0x0,-0x4(%rbp)
jmp    1191 <isSubsequence+0x81>
jmp    117c <isSubsequence+0x6c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <isSubsequence+0x1e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSubsequence>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%cl
mov    $0x1,%r14d
test   %cl,%cl
je     1155 <isSubsequence+0x45>
mov    %rsi,%rbx
mov    %rdi,%rbp
add    $0x1,%rbp
mov    $0xffffffff,%eax
nop
add    $0x1,%eax
movsbl %cl,%edx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <findFirstCharInd@plt>
test   %eax,%eax
js     1152 <isSubsequence+0x42>
movzbl 0x0(%rbp),%ecx
add    $0x1,%rbp
test   %cl,%cl
jne    1130 <isSubsequence+0x20>
jmp    1155 <isSubsequence+0x45>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isSubsequence(i8* nocapture %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %0, i64 %16
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %16, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = phi i32 [ %14, %5 ], [ -1, %2 ]
%13 = add nsw i32 %12, 1
%14 = tail call i32 @findFirstCharInd(i8* %1, i32 %13, i8 signext %11)
%15 = icmp slt i32 %14, 0
%16 = add nuw i64 %10, 1
br i1 %15, label %17, label %5
17: ; preds = %9, %5, %2
%18 = phi i32 [ 1, %2 ], [ 1, %5 ], [ 0, %9 ]
ret i32 %18
}