#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*/ any(char *, char *, int, int);
int getchar();
int getlinee(char *, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int first, s1_char, s2_char, c;
  char s1[1000];
  char s2[1000];
  first = 0;
  while (1) {
    if (first != 0) {
      printf("Do you want to continue?(Y\\N)");
      if (((c = getchar()) == 'y') || (c == 'Y')) {
        getchar();
        printf("Please enter the first sentence\n");
        s1_char = getlinee(s1, 1000);
        printf("Please enter the second sentence\n");
        s2_char = getlinee(s2, 1000);
        any(s1, s2, s1_char, s2_char);
      } else if ((c == 'n') || (c == 'N')) {
        printf("Have a nice day!!");
        break;
      } else
        printf("I don't understand that command\n");
    } else {
      printf("Please enter the first sentence\n");
      s1_char = getlinee(s1, 1000);
      printf("Please enter the second sentence\n");
      getlinee(s2, 1000);
      any(s1, s2, s1_char, s2_char);
      first = 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     122c <main+0xec>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x79,%eax
je     118c <main+0x4c>
cmpl   $0x59,-0x14(%rbp)
jne    11f1 <main+0xb1>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
lea    -0x400(%rbp),%rdi
mov    $0x3e8,%esi
call   1060 <getlinee@plt>
mov    %eax,-0xc(%rbp)
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
lea    -0x7f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1060 <getlinee@plt>
mov    %eax,-0x10(%rbp)
lea    -0x400(%rbp),%rdi
lea    -0x7f0(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1050 <any@plt>
jmp    1227 <main+0xe7>
cmpl   $0x6e,-0x14(%rbp)
je     1205 <main+0xc5>
cmpl   $0x4e,-0x14(%rbp)
jne    1216 <main+0xd6>
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
jmp    128e <main+0x14e>
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
jmp    1227 <main+0xe7>
jmp    1289 <main+0x149>
lea    0xdeb(%rip),%rdi
call   1030 <printf@plt>
lea    -0x400(%rbp),%rdi
mov    $0x3e8,%esi
call   1060 <getlinee@plt>
mov    %eax,-0xc(%rbp)
lea    0xdec(%rip),%rdi
call   1030 <printf@plt>
lea    -0x7f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1060 <getlinee@plt>
lea    -0x400(%rbp),%rdi
lea    -0x7f0(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1050 <any@plt>
movl   $0x1,-0x8(%rbp)
jmp    1159 <main+0x19>
xor    %eax,%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x7d8,%rsp
mov    $0x1,%r12b
lea    0xe95(%rip),%rbx
lea    0xebe(%rip),%rbp
test   $0x1,%r12b
je     11d0 <main+0x80>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%r12
mov    %r12,%rdi
mov    $0x3e8,%esi
call   1070 <getlinee@plt>
mov    %eax,%r15d
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0x3f0(%rsp),%r13
mov    %r13,%rdi
mov    $0x3e8,%esi
call   1070 <getlinee@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1060 <any@plt>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
and    $0xffffffdf,%eax
cmp    $0x4e,%eax
je     1269 <main+0x119>
cmp    $0x59,%eax
je     1200 <main+0xb0>
mov    %rbp,%rdi
call   1030 <puts@plt>
jmp    11d0 <main+0x80>
nopw   0x0(%rax,%rax,1)
xor    %r12d,%r12d
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xe3f(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1070 <getlinee@plt>
mov    %eax,%r15d
lea    0xe43(%rip),%rdi
call   1030 <puts@plt>
lea    0x3f0(%rsp),%r13
mov    %r13,%rdi
mov    $0x3e8,%esi
call   1070 <getlinee@plt>
mov    %eax,%r14d
mov    %rsp,%rdi
mov    %r13,%rsi
mov    %r15d,%edx
mov    %eax,%ecx
call   1060 <any@plt>
test   $0x1,%r12b
jne    1178 <main+0x28>
jmp    11d0 <main+0x80>
lea    0xdae(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x7d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Do you want to continue?(Y\\N)\00"
@.str.1 = [33 x i8] c"Please enter the first sentence\0A\00"
@.str.2 = [34 x i8] c"Please enter the second sentence\0A\00"
@.str.3 = [18 x i8] c"Have a nice day!!\00"
@.str.4 = [33 x i8] c"I don't understand that command\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [1000 x i8]
%7 = alloca [1000 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
br label %8
8: ; preds = %0, %55
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %43
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @getchar()
store i32 %13, i32* %5
%14 = icmp eq i32 %13, 121
br i1 %14, label %18, label %15
15: ; preds = %11
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 89
br i1 %17, label %18, label %31
18: ; preds = %15, %11
%19 = call i32 (...) @getchar()
%20 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%21 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%22 = call i32 @getlinee(i8* %21, i32 1000)
store i32 %22, i32* %3
%23 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%24 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%25 = call i32 @getlinee(i8* %24, i32 1000)
store i32 %25, i32* %4
%26 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%27 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = call i32 @any(i8* %26, i8* %27, i32 %28, i32 %29)
br label %42
31: ; preds = %15
%32 = load i32, i32* %5
%33 = icmp eq i32 %32, 110
br i1 %33, label %37, label %34
34: ; preds = %31
%35 = load i32, i32* %5
%36 = icmp eq i32 %35, 78
br i1 %36, label %37, label %39
37: ; preds = %34, %31
%38 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %56
39: ; preds = %34
%40 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
br label %41
41: ; preds = %39
br label %42
42: ; preds = %41, %18
br label %55
43: ; preds = %8
%44 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%45 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%46 = call i32 @getlinee(i8* %45, i32 1000)
store i32 %46, i32* %3
%47 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%48 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%49 = call i32 @getlinee(i8* %48, i32 1000)
%50 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%51 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%52 = load i32, i32* %3
%53 = load i32, i32* %4
%54 = call i32 @any(i8* %50, i8* %51, i32 %52, i32 %53)
store i32 1, i32* %2
br label %55
55: ; preds = %43, %42
br label %8
56: ; preds = %37
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Do you want to continue?(Y\\N)\00"
@.str.3 = [18 x i8] c"Have a nice day!!\00"
@str.6 = [32 x i8] c"I don't understand that command\00"
@str.7 = [32 x i8] c"Please enter the first sentence\00"
@str.8 = [33 x i8] c"Please enter the second sentence\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
br label %5
5: ; preds = %12, %0
%6 = phi i32 [ %17, %12 ], [ undef, %0 ]
%7 = phi i1 [ false, %12 ], [ true, %0 ]
br i1 %7, label %23, label %8
8: ; preds = %21, %23, %5
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @getchar()
%11 = and i32 %10, -33
switch i32 %11, label %21 [
i32 89, label %12
i32 78, label %19
]
12: ; preds = %8
%13 = call i32 (...) @getchar()
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.7, i64 0, i64 0))
%15 = call i32 @getlinee(i8* %3, i32 1000)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.8, i64 0, i64 0))
%17 = call i32 @getlinee(i8* %4, i32 1000)
%18 = call i32 @any(i8* %3, i8* %4, i32 %15, i32 %17)
br label %5
19: ; preds = %8
%20 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
21: ; preds = %8
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.6, i64 0, i64 0))
br label %8
23: ; preds = %5
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.7, i64 0, i64 0))
%25 = call i32 @getlinee(i8* %3, i32 1000)
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.8, i64 0, i64 0))
%27 = call i32 @getlinee(i8* %4, i32 1000)
%28 = call i32 @any(i8* %3, i8* %4, i32 %25, i32 %6)
br label %8
}