#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 main() {
  char str1[] = "hello, world";
  char str2[] = "hello, world";
  const char *str3 = "hello, world";
  const char *str4 = "hello, world";
  char *str5 = "hello, world";
  if (str1 == str2) {
    printf("str1 and str2 are same.\n");
  } else {
    printf("str1 and str2 are not same.\n");
  }
  if (str3 == str4) {
    printf("str3 and str4 are same.\n");
  } else {
    printf("str3 and str4 are not same.\n");
  }
  str5[0] = 'H';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xed3(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x1e(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xeb6(%rip),%al
mov    %al,-0x12(%rbp)
lea    0xea0(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe95(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe8a(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    11a5 <main+0x95>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
jmp    11b1 <main+0xa1>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
movb   $0x48,(%rax)
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str1 = [13 x i8] c"hello, world\00"
@__const.main.str2 = [13 x i8] c"hello, world\00"
@.str = [13 x i8] c"hello, world\00"
@.str.1 = [29 x i8] c"str1 and str2 are not same.\0A\00"
@.str.2 = [25 x i8] c"str3 and str4 are same.\0A\00"
@.str.3 = [29 x i8] c"str3 and str4 are not same.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
%3 = alloca [13 x i8]
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i32 0, i32* %1
%7 = bitcast [13 x i8]* %2 to i8*
%8 = bitcast [13 x i8]* %3 to i8*
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %4
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %17
15: ; preds = %0
%16 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
%18 = load i8*, i8** %6
%19 = getelementptr inbounds i8, i8* %18, i64 0
store i8 72, i8* %19
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"str1 and str2 are not same.\00"
@str.4 = [24 x i8] c"str3 and str4 are same.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}