#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 c_less_n(char *, char, int, int);
int check_substr(char *, char *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  char s1[100], s2[100], ch;
  int n, i, j;
  scanf("%s ", s1);
  scanf("%c", &ch);
  scanf("%d", &n);
  scanf("%s", s2);
  i = check_substr(s1, s2, 100, 100);
  j = c_less_n(s1, ch, 100, n);
  printf("%d %d ", i, j);
  if ((i == 1 && j == 0) || (i == 0 && j == 1))
    printf("YES");
  else
    printf("NO");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe99(%rip),%rdi
lea    -0xe1(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe87(%rip),%rdi
lea    -0xe8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0xe0(%rbp),%rsi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
mov    $0x64,%ecx
mov    %ecx,%edx
call   1050 <check_substr@plt>
mov    %eax,-0xec(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0xe1(%rbp),%al
mov    -0xe8(%rbp),%ecx
mov    $0x64,%edx
movsbl %al,%esi
call   1040 <c_less_n@plt>
mov    %eax,-0xf0(%rbp)
mov    -0xec(%rbp),%esi
mov    -0xf0(%rbp),%edx
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0xec(%rbp)
jne    1217 <main+0xd7>
cmpl   $0x0,-0xf0(%rbp)
je     1231 <main+0xf1>
cmpl   $0x0,-0xec(%rbp)
jne    1244 <main+0x104>
cmpl   $0x1,-0xf0(%rbp)
jne    1244 <main+0x104>
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1252 <main+0x112>
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0xf0,%rsp
lea    0xeae(%rip),%rdi
lea    0x80(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe99(%rip),%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe89(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe79(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x64,%edx
mov    $0x64,%ecx
call   1050 <check_substr@plt>
mov    %eax,%ebx
movsbl 0xb(%rsp),%esi
mov    0xc(%rsp),%ecx
mov    %r14,%rdi
mov    $0x64,%edx
call   1040 <c_less_n@plt>
mov    %eax,%ebp
lea    0xe37(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
xor    $0x1,%eax
mov    %ebp,%ecx
xor    $0x1,%ecx
lea    0xe22(%rip),%rdx
lea    0xe1f(%rip),%rdi
or     %ebx,%ecx
cmove  %rdx,%rdi
or     %ebp,%eax
cmove  %rdx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [7 x i8] c"%d %d \00"
@.str.5 = [4 x i8] c"YES\00"
@.str.6 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%16 = call i32 @check_substr(i8* %14, i8* %15, i32 100, i32 100)
store i32 %16, i32* %6
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%18 = load i8, i8* %4
%19 = load i32, i32* %5
%20 = call i32 @c_less_n(i8* %17, i8 signext %18, i32 100, i32 %19)
store i32 %20, i32* %7
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %21, i32 %22)
%24 = load i32, i32* %6
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %29
26: ; preds = %0
%27 = load i32, i32* %7
%28 = icmp eq i32 %27, 0
br i1 %28, label %35, label %29
29: ; preds = %26, %0
%30 = load i32, i32* %6
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %29
%33 = load i32, i32* %7
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %37
35: ; preds = %32, %26
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %39
37: ; preds = %32, %29
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %39
39: ; preds = %37, %35
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [7 x i8] c"%d %d \00"
@.str.5 = [4 x i8] c"YES\00"
@.str.6 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca i8
%4 = alloca i32
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = bitcast i32* %4 to i8*
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%12 = call i32 @check_substr(i8* %5, i8* %6, i32 100, i32 100)
%13 = load i8, i8* %3
%14 = load i32, i32* %4
%15 = call i32 @c_less_n(i8* %5, i8 signext %13, i32 100, i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %12, i32 %15)
%17 = icmp eq i32 %12, 1
%18 = icmp eq i32 %15, 0
%19 = and i1 %17, %18
%20 = icmp eq i32 %12, 0
%21 = icmp eq i32 %15, 1
%22 = and i1 %20, %21
%23 = or i1 %19, %22
%24 = select i1 %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %24)
ret i32 0
}