#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*/ gets(char *);
int /*<<< orphan*/ memset(int *, char, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int main(void) {
  char str[1000001], *ptr;
  int ascii[127];
  while (1) {
    gets(str);
    if (!strncmp(str, "STOP!!", 6))
      break;
    memset(&ascii[33], '\0', sizeof(int) * (127 - 33));
    for (ptr = str; *ptr; ptr++)
      ascii[*ptr]++;
    *(ptr - 1) = '\0';
    gets(str);
    if (*ptr != '\0' || *(ptr - 1) == '\0')
      puts("no");
    else {
      for (ptr = str; *ptr; ptr++)
        if (--ascii[*ptr] < 0)
          break;
      puts(*ptr ? "no" : "yes");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf4460,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xf4250(%rbp),%rdi
call   1060 <gets@plt>
lea    -0xf4250(%rbp),%rdi
lea    0xe94(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1184 <main+0x44>
jmp    12cb <main+0x18b>
lea    -0xf4460(%rbp),%rdi
add    $0x84,%rdi
xor    %esi,%esi
mov    $0x178,%edx
call   1050 <memset@plt>
lea    -0xf4250(%rbp),%rax
mov    %rax,-0xf4258(%rbp)
mov    -0xf4258(%rbp),%rax
cmpb   $0x0,(%rax)
je     11ef <main+0xaf>
mov    -0xf4258(%rbp),%rax
movsbq (%rax),%rax
mov    -0xf4460(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0xf4460(%rbp,%rax,4)
mov    -0xf4258(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xf4258(%rbp)
jmp    11ac <main+0x6c>
mov    -0xf4258(%rbp),%rax
movb   $0x0,-0x1(%rax)
lea    -0xf4250(%rbp),%rdi
call   1060 <gets@plt>
mov    -0xf4258(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    122d <main+0xed>
mov    -0xf4258(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x0,%eax
jne    123e <main+0xfe>
lea    0xdd3(%rip),%rdi
call   1040 <puts@plt>
jmp    12c6 <main+0x186>
lea    -0xf4250(%rbp),%rax
mov    %rax,-0xf4258(%rbp)
mov    -0xf4258(%rbp),%rax
cmpb   $0x0,(%rax)
je     12a2 <main+0x162>
mov    -0xf4258(%rbp),%rax
movsbq (%rax),%rcx
mov    -0xf4460(%rbp,%rcx,4),%eax
add    $0xffffffff,%eax
mov    %eax,-0xf4460(%rbp,%rcx,4)
cmp    $0x0,%eax
jge    1286 <main+0x146>
jmp    12a2 <main+0x162>
jmp    128b <main+0x14b>
mov    -0xf4258(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xf4258(%rbp)
jmp    124c <main+0x10c>
mov    -0xf4258(%rbp),%rax
movsbl (%rax),%ecx
lea    0xd57(%rip),%rdi
lea    0xd4d(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
call   1040 <puts@plt>
jmp    1152 <main+0x12>
xor    %eax,%eax
add    $0xf4460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf4448,%rsp
lea    0x200(%rsp),%r12
mov    %r12,%rdi
call   1060 <gets@plt>
lea    0xe98(%rip),%rsi
mov    %r12,%rdi
mov    $0x6,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1268 <main+0x128>
lea    0x84(%rsp),%r14
lea    0xe7b(%rip),%r13
lea    0xe77(%rip),%rbp
lea    0xe66(%rip),%r15
jmp    11c5 <main+0x85>
mov    %r13,%rdi
nop
call   1040 <puts@plt>
mov    %r12,%rdi
call   1060 <gets@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1268 <main+0x128>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x178,%edx
call   1050 <memset@plt>
mov    0x200(%rsp),%al
mov    %r12,%rbx
test   %al,%al
je     1204 <main+0xc4>
mov    %r12,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbq %al,%rax
addl   $0x1,(%rsp,%rax,4)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    11f0 <main+0xb0>
movb   $0x0,-0x1(%rbx)
mov    %r12,%rdi
call   1060 <gets@plt>
cmpb   $0x0,(%rbx)
mov    %r13,%rdi
jne    11a0 <main+0x60>
cmpb   $0x0,-0x1(%rbx)
mov    %r13,%rdi
je     11a0 <main+0x60>
mov    0x200(%rsp),%cl
mov    %rbp,%rdi
test   %cl,%cl
je     11a0 <main+0x60>
lea    0x201(%rsp),%rax
nop
movsbq %cl,%rcx
mov    (%rsp,%rcx,4),%edx
lea    -0x1(%rdx),%esi
mov    %esi,(%rsp,%rcx,4)
test   %edx,%edx
jle    119c <main+0x5c>
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1240 <main+0x100>
mov    %rbp,%rdi
jmp    11a0 <main+0x60>
xor    %eax,%eax
add    $0xf4448,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"STOP!!\00"
@.str.1 = [3 x i8] c"no\00"
@.str.2 = [4 x i8] c"yes\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000001 x i8]
%3 = alloca i8*
%4 = alloca [127 x i32]
store i32 0, i32* %1
br label %5
5: ; preds = %0, %74
%6 = getelementptr inbounds [1000001 x i8], [1000001 x i8]* %2, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = getelementptr inbounds [1000001 x i8], [1000001 x i8]* %2, i64 0, i64 0
%9 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %5
br label %75
12: ; preds = %5
%13 = getelementptr inbounds [127 x i32], [127 x i32]* %4, i64 0, i64 33
%14 = call i32 @memset(i32* %13, i8 signext 0, i32 376)
%15 = getelementptr inbounds [1000001 x i8], [1000001 x i8]* %2, i64 0, i64 0
store i8* %15, i8** %3
br label %16
16: ; preds = %27, %12
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = icmp ne i8 %18, 0
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i64
%24 = getelementptr inbounds [127 x i32], [127 x i32]* %4, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = add nsw i32 %25, 1
store i32 %26, i32* %24
br label %27
27: ; preds = %20
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %3
br label %16
30: ; preds = %16
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i64 -1
store i8 0, i8* %32
%33 = getelementptr inbounds [1000001 x i8], [1000001 x i8]* %2, i64 0, i64 0
%34 = call i32 @gets(i8* %33)
%35 = load i8*, i8** %3
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp ne i32 %37, 0
br i1 %38, label %45, label %39
39: ; preds = %30
%40 = load i8*, i8** %3
%41 = getelementptr inbounds i8, i8* %40, i64 -1
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %39, %30
%46 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %74
47: ; preds = %39
%48 = getelementptr inbounds [1000001 x i8], [1000001 x i8]* %2, i64 0, i64 0
store i8* %48, i8** %3
br label %49
49: ; preds = %63, %47
%50 = load i8*, i8** %3
%51 = load i8, i8* %50
%52 = icmp ne i8 %51, 0
br i1 %52, label %53, label %66
53: ; preds = %49
%54 = load i8*, i8** %3
%55 = load i8, i8* %54
%56 = sext i8 %55 to i64
%57 = getelementptr inbounds [127 x i32], [127 x i32]* %4, i64 0, i64 %56
%58 = load i32, i32* %57
%59 = add nsw i32 %58, -1
store i32 %59, i32* %57
%60 = icmp slt i32 %59, 0
br i1 %60, label %61, label %62
61: ; preds = %53
br label %66
62: ; preds = %53
br label %63
63: ; preds = %62
%64 = load i8*, i8** %3
%65 = getelementptr inbounds i8, i8* %64, i32 1
store i8* %65, i8** %3
br label %49
66: ; preds = %61, %49
%67 = load i8*, i8** %3
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp ne i32 %69, 0
%71 = zext i1 %70 to i64
%72 = select i1 %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%73 = call i32 @puts(i8* %72)
br label %74
74: ; preds = %66, %45
br label %5
75: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"STOP!!\00"
@.str.1 = [3 x i8] c"no\00"
@.str.2 = [4 x i8] c"yes\00"
define i32 @main() {
%1 = alloca [1000001 x i8]
%2 = alloca [127 x i32]
%3 = getelementptr inbounds [1000001 x i8], [1000001 x i8]* %1, i64 0, i64 0
%4 = bitcast [127 x i32]* %2 to i8*
%5 = call i32 @gets(i8* %3)
%6 = call i32 @strncmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%7 = icmp eq i32 %6, 0
br i1 %7, label %54, label %8
8: ; preds = %0
%9 = getelementptr inbounds [127 x i32], [127 x i32]* %2, i64 0, i64 33
br label %10
10: ; preds = %8, %48
%11 = call i32 @memset(i32* %9, i8 signext 0, i32 376)
%12 = load i8, i8* %3
%13 = icmp eq i8 %12, 0
br i1 %13, label %24, label %14
14: ; preds = %10, %14
%15 = phi i8 [ %22, %14 ], [ %12, %10 ]
%16 = phi i8* [ %21, %14 ], [ %3, %10 ]
%17 = sext i8 %15 to i64
%18 = getelementptr inbounds [127 x i32], [127 x i32]* %2, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
store i32 %20, i32* %18
%21 = getelementptr inbounds i8, i8* %16, i64 1
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 0
br i1 %23, label %24, label %14
24: ; preds = %14, %10
%25 = phi i8* [ %3, %10 ], [ %21, %14 ]
%26 = getelementptr inbounds i8, i8* %25, i64 -1
store i8 0, i8* %26
%27 = call i32 @gets(i8* %3)
%28 = load i8, i8* %25
%29 = icmp eq i8 %28, 0
br i1 %29, label %30, label %48
30: ; preds = %24
%31 = load i8, i8* %26
%32 = icmp eq i8 %31, 0
br i1 %32, label %48, label %33
33: ; preds = %30
%34 = load i8, i8* %3
%35 = icmp eq i8 %34, 0
br i1 %35, label %48, label %39
36: ; preds = %39
%37 = load i8, i8* %47
%38 = icmp eq i8 %37, 0
br i1 %38, label %48, label %39
39: ; preds = %33, %36
%40 = phi i8 [ %37, %36 ], [ %34, %33 ]
%41 = phi i8* [ %47, %36 ], [ %3, %33 ]
%42 = sext i8 %40 to i64
%43 = getelementptr inbounds [127 x i32], [127 x i32]* %2, i64 0, i64 %42
%44 = load i32, i32* %43
%45 = add nsw i32 %44, -1
store i32 %45, i32* %43
%46 = icmp slt i32 %44, 1
%47 = getelementptr inbounds i8, i8* %41, i64 1
br i1 %46, label %48, label %36
48: ; preds = %39, %36, %33, %24, %30
%49 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %30 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %24 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %33 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %39 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %36 ]
%50 = call i32 @puts(i8* dereferenceable(1) %49)
%51 = call i32 @gets(i8* %3)
%52 = call i32 @strncmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %10
54: ; preds = %48, %0
ret i32 0
}