#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);
int main() {
  char str1[] = "abc";
  char str2[] = "abc";
  const char str3[] = "abc";
  const char str4[] = "abc";
  const char *str5 = "abc";
  const char *str6 = "abc";
  char *str7 = "abc";
  char *str8 = "abc";
  printf("(str1 == str2) = %d\n", (str1 == str2));
  printf("(str3 == str4) = %d\n", (str3 == str4));
  printf("(str5 == str6) = %d\n", (str5 == str6));
  printf("(str6 == str7) = %d\n", (str6 == str7));
  printf("(str7 == str8) = %d\n", (str7 == str8));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xed2(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec0(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    0xeb6(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xeab(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xea0(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe95(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x8(%rbp),%rax
lea    -0xc(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rax
lea    -0x14(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
cmp    -0x38(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe5c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str1 = [4 x i8] c"abc\00"
@__const.main.str2 = [4 x i8] c"abc\00"
@__const.main.str3 = [4 x i8] c"abc\00"
@__const.main.str4 = [4 x i8] c"abc\00"
@.str = [4 x i8] c"abc\00"
@.str.1 = [21 x i8] c"(str1 == str2) = %d\0A\00"
@.str.2 = [21 x i8] c"(str3 == str4) = %d\0A\00"
@.str.3 = [21 x i8] c"(str5 == str6) = %d\0A\00"
@.str.4 = [21 x i8] c"(str6 == str7) = %d\0A\00"
@.str.5 = [21 x i8] c"(str7 == str8) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca [4 x i8]
%4 = alloca [4 x i8]
%5 = alloca [4 x i8]
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32 0, i32* %1
%10 = bitcast [4 x i8]* %2 to i8*
%11 = bitcast [4 x i8]* %3 to i8*
%12 = bitcast [4 x i8]* %4 to i8*
%13 = bitcast [4 x i8]* %5 to i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %9
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%16 = icmp eq i8* %14, %15
%17 = zext i1 %16 to i32
%18 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%21 = icmp eq i8* %19, %20
%22 = zext i1 %21 to i32
%23 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = load i8*, i8** %6
%25 = load i8*, i8** %7
%26 = icmp eq i8* %24, %25
%27 = zext i1 %26 to i32
%28 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %27)
%29 = load i8*, i8** %7
%30 = load i8*, i8** %8
%31 = icmp eq i8* %29, %30
%32 = zext i1 %31 to i32
%33 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %32)
%34 = load i8*, i8** %8
%35 = load i8*, i8** %9
%36 = icmp eq i8* %34, %35
%37 = zext i1 %36 to i32
%38 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %37)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"(str1 == str2) = %d\0A\00"
@.str.2 = [21 x i8] c"(str3 == str4) = %d\0A\00"
@.str.3 = [21 x i8] c"(str5 == str6) = %d\0A\00"
@.str.4 = [21 x i8] c"(str6 == str7) = %d\0A\00"
@.str.5 = [21 x i8] c"(str7 == str8) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 1)
ret i32 0
}