#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strcmpi(char *, char *);
int main(void) {
  char stringOne[21], stringTwo[21], stringThree[21];
  printf("Please enter a string that is less than 20 characters: ");
  scanf("%s", stringOne);
  printf("Please enter another string that is less than 20 characters: ");
  scanf("%s", stringTwo);
  printf("Please enter another string that is less than 20 characters: ");
  scanf("%s", stringThree);
  if ((strcmpi(stringOne, stringTwo) != 0) ||
      (strcmpi(stringOne, stringThree) != 0) ||
      (strcmpi(stringTwo, stringThree) != 0)) {
    printf("One, Two, or All of the string(s) you entered are not equal!\n");
    return 1;
  }
  printf("All three strings you entered are equal!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xee2(%rip),%rdi
call   1050 <scanf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1050 <scanf@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <strcmpi@plt>
cmp    $0x0,%rax
jne    11d8 <main+0xa8>
lea    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <strcmpi@plt>
cmp    $0x0,%rax
jne    11d8 <main+0xa8>
lea    -0x40(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <strcmpi@plt>
cmp    $0x0,%rax
je     11f0 <main+0xc0>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1203 <main+0xd3>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x58,%rsp
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
lea    0xedb(%rip),%rbx
lea    0x40(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
lea    0xec7(%rip),%rbp
mov    %rbp,%rdi
call   1040 <printf@plt>
lea    0x20(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    %rbp,%rdi
call   1040 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <strcmpi@plt>
mov    $0x1,%ebp
lea    0xeed(%rip),%rbx
test   %rax,%rax
jne    11f5 <main+0xb5>
lea    0x40(%rsp),%rdi
mov    %rsp,%rsi
call   1050 <strcmpi@plt>
test   %rax,%rax
jne    11f5 <main+0xb5>
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
call   1050 <strcmpi@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
lea    0xe8f(%rip),%rax
lea    0xeb2(%rip),%rbx
cmove  %rax,%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %ebp,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [56 x i8] c"Please enter a string that is less than 20 characters: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [62 x i8] c"Please enter another string that is less than 20 characters: \00"
@.str.3 = [62 x i8] c"One, Two, or All of the string(s) you entered are not equal!\0A\00"
@.str.4 = [43 x i8] c"All three strings you entered are equal!!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [21 x i8]
%3 = alloca [21 x i8]
%4 = alloca [21 x i8]
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%9 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%12 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%15 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%16 = call i64 @strcmpi(i8* %14, i8* %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %28, label %18
18: ; preds = %0
%19 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%20 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%21 = call i64 @strcmpi(i8* %19, i8* %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %28, label %23
23: ; preds = %18
%24 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%25 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%26 = call i64 @strcmpi(i8* %24, i8* %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %23, %18, %0
%29 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %1
br label %32
30: ; preds = %23
%31 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %1
br label %32
32: ; preds = %30, %28
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [56 x i8] c"Please enter a string that is less than 20 characters: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [62 x i8] c"Please enter another string that is less than 20 characters: \00"
@str = [42 x i8] c"All three strings you entered are equal!!\00"
@str.5 = [61 x i8] c"One, Two, or All of the string(s) you entered are not equal!\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = alloca [21 x i8]
%3 = alloca [21 x i8]
%4 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%13 = call i64 @strcmpi(i8* %4, i8* %5)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %24
15: ; preds = %0
%16 = call i64 @strcmpi(i8* %4, i8* %6)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = call i64 @strcmpi(i8* %5, i8* %6)
%20 = icmp eq i64 %19, 0
%21 = select i1 %20, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @str.5, i64 0, i64 0)
%22 = xor i1 %20, true
%23 = zext i1 %22 to i32
br label %24
24: ; preds = %18, %0, %15
%25 = phi i8* [ getelementptr inbounds ([61 x i8], [61 x i8]* @str.5, i64 0, i64 0), %15 ], [ getelementptr inbounds ([61 x i8], [61 x i8]* @str.5, i64 0, i64 0), %0 ], [ %21, %18 ]
%26 = phi i32 [ 1, %15 ], [ 1, %0 ], [ %23, %18 ]
%27 = call i32 @puts(i8* dereferenceable(1) %25)
ret i32 %26
}