#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 */
scalar_t__ tolower(char const);
int subseqMatch(const char *subseq, const char *str) {
  if (subseq[0] == '\0')
    return 1;
  else if (str[0] == '\0')
    return 0;
  else if (tolower(subseq[0]) == tolower(str[0]))
    return subseqMatch(subseq + 1, str + 1) || subseqMatch(subseq, str + 1);
  else
    return subseqMatch(subseq, str + 1);
}


x86 assembly (clang, -O0):
<subseqMatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114c <subseqMatch+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    11f7 <subseqMatch+0xd7>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1168 <subseqMatch+0x48>
movl   $0x0,-0x4(%rbp)
jmp    11f7 <subseqMatch+0xd7>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <tolower@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1040 <tolower@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jne    11e3 <subseqMatch+0xc3>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1030 <subseqMatch@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
jne    11d3 <subseqMatch+0xb3>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1030 <subseqMatch@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11f7 <subseqMatch+0xd7>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1030 <subseqMatch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subseqMatch>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%r14d
test   %al,%al
je     1196 <subseqMatch+0x76>
mov    %rsi,%rbx
mov    %rdi,%r15
add    $0x1,%rbx
nopl   (%rax)
cmpb   $0x0,-0x1(%rbx)
je     116d <subseqMatch+0x4d>
movsbl %al,%edi
call   1040 <tolower@plt>
mov    %rax,%rbp
movsbl -0x1(%rbx),%edi
call   1040 <tolower@plt>
cmp    %rax,%rbp
je     1172 <subseqMatch+0x52>
movzbl (%r15),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <subseqMatch+0x20>
jmp    1196 <subseqMatch+0x76>
xor    %r14d,%r14d
jmp    1196 <subseqMatch+0x76>
lea    0x1(%r15),%rdi
mov    %rbx,%rsi
call   1030 <subseqMatch@plt>
test   %eax,%eax
jne    1196 <subseqMatch+0x76>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <subseqMatch@plt>
xor    %r14d,%r14d
test   %eax,%eax
setne  %r14b
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @subseqMatch(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %50
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 0, i32* %3
br label %50
19: ; preds = %12
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = call i64 @tolower(i8 signext %22)
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = load i8, i8* %25
%27 = call i64 @tolower(i8 signext %26)
%28 = icmp eq i64 %23, %27
br i1 %28, label %29, label %45
29: ; preds = %19
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = load i8*, i8** %5
%33 = getelementptr inbounds i8, i8* %32, i64 1
%34 = call i32 @subseqMatch(i8* %31, i8* %33)
%35 = icmp ne i32 %34, 0
br i1 %35, label %42, label %36
36: ; preds = %29
%37 = load i8*, i8** %4
%38 = load i8*, i8** %5
%39 = getelementptr inbounds i8, i8* %38, i64 1
%40 = call i32 @subseqMatch(i8* %37, i8* %39)
%41 = icmp ne i32 %40, 0
br label %42
42: ; preds = %36, %29
%43 = phi i1 [ true, %29 ], [ %41, %36 ]
%44 = zext i1 %43 to i32
store i32 %44, i32* %3
br label %50
45: ; preds = %19
%46 = load i8*, i8** %4
%47 = load i8*, i8** %5
%48 = getelementptr inbounds i8, i8* %47, i64 1
%49 = call i32 @subseqMatch(i8* %46, i8* %48)
store i32 %49, i32* %3
br label %50
50: ; preds = %45, %42, %18, %11
%51 = load i32, i32* %3
ret i32 %51
}

LLVM IR (-O2):
define i32 @subseqMatch(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %20, label %5
5: ; preds = %2, %26
%6 = phi i8 [ %28, %26 ], [ %3, %2 ]
%7 = phi i8* [ %27, %26 ], [ %1, %2 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %20, label %10
10: ; preds = %5
%11 = tail call i64 @tolower(i8 signext %6)
%12 = load i8, i8* %7
%13 = tail call i64 @tolower(i8 signext %12)
%14 = icmp eq i64 %11, %13
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = getelementptr inbounds i8, i8* %0, i64 1
%17 = getelementptr inbounds i8, i8* %7, i64 1
%18 = tail call i32 @subseqMatch(i8* %16, i8* %17)
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %5, %26, %2, %15, %22
%21 = phi i32 [ %25, %22 ], [ 1, %15 ], [ 1, %2 ], [ 0, %5 ], [ 1, %26 ]
ret i32 %21
22: ; preds = %15
%23 = tail call i32 @subseqMatch(i8* %0, i8* %17)
%24 = icmp ne i32 %23, 0
%25 = zext i1 %24 to i32
br label %20
26: ; preds = %10
%27 = getelementptr inbounds i8, i8* %7, i64 1
%28 = load i8, i8* %0
%29 = icmp eq i8 %28, 0
br i1 %29, label %20, label %5
}