#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*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int main() {
  char a[100], b[100];
  printf("Enter the first string\n");
  gets(a);
  printf("Enter the second string\n");
  gets(b);
  if (strcmp(a, b) == 0)
    printf("Entered strings are equal.\n");
  else
    printf("Entered strings are not equal.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1050 <gets@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    119a <main+0x6a>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    11a6 <main+0x76>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
lea    0x70(%rsp),%r14
mov    %r14,%rdi
call   1050 <gets@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xecf(%rip),%rax
lea    0xea9(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter the first string\0A\00"
@.str.1 = [25 x i8] c"Enter the second string\0A\00"
@.str.2 = [28 x i8] c"Entered strings are equal.\0A\00"
@.str.3 = [32 x i8] c"Entered strings are not equal.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = call i32 @gets(i8* %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = call i64 @strcmp(i8* %10, i8* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %18
16: ; preds = %0
%17 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Enter the first string\00"
@str.4 = [24 x i8] c"Enter the second string\00"
@str.5 = [31 x i8] c"Entered strings are not equal.\00"
@str.6 = [27 x i8] c"Entered strings are equal.\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%6 = call i32 @gets(i8* %3)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.4, i64 0, i64 0))
%8 = call i32 @gets(i8* %4)
%9 = call i64 @strcmp(i8* %3, i8* %4)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @str.5, i64 0, i64 0)
%12 = call i32 @puts(i8* dereferenceable(1) %11)
ret i32 0
}