#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 fnMyStrCmp(char *, char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char acStr1[50], acStr2[50];
  bool notIdentical;
  printf("\nEnter string1\n");
  gets(acStr1);
  printf("\nEnter string2\n");
  gets(acStr2);
  notIdentical = fnMyStrCmp(acStr1, acStr2);
  if (notIdentical)
    printf("\nThe strings are not identical\n");
  else
    printf("\nThe strings are identical\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1040 <gets@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    -0x80(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x40(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1050 <fnMyStrCmp@plt>
mov    %eax,-0x84(%rbp)
cmpl   $0x0,-0x84(%rbp)
je     119d <main+0x6d>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
jmp    11a9 <main+0x79>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0x40(%rsp),%r14
mov    %r14,%rdi
call   1040 <gets@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <fnMyStrCmp@plt>
test   %eax,%eax
lea    0xea3(%rip),%rax
lea    0xeb7(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"\0AEnter string1\0A\00"
@.str.1 = [16 x i8] c"\0AEnter string2\0A\00"
@.str.2 = [32 x i8] c"\0AThe strings are not identical\0A\00"
@.str.3 = [28 x i8] c"\0AThe strings are identical\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca [50 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%7 = call i32 @gets(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%10 = call i32 @gets(i8* %9)
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%13 = call i32 @fnMyStrCmp(i8* %11, i8* %12)
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %20
18: ; preds = %0
%19 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %18, %16
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"\0AEnter string1\00"
@str.4 = [15 x i8] c"\0AEnter string2\00"
@str.5 = [27 x i8] c"\0AThe strings are identical\00"
@str.6 = [31 x i8] c"\0AThe strings are not identical\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%6 = call i32 @gets(i8* %3)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
%8 = call i32 @gets(i8* %4)
%9 = call i32 @fnMyStrCmp(i8* %3, i8* %4)
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @str.6, i64 0, i64 0)
%12 = call i32 @puts(i8* dereferenceable(1) %11)
ret i32 0
}