#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 *, char *, char *);
int /*<<< orphan*/ putchar(char);
void main() {
  "test" == "test1" ? putchar('1') : putchar('0');
  char *p0 = "test";
  char *p1 = "test1";
  p0 == p1 ? putchar('1') : putchar('0');
  p0 == "test" ? putchar('1') : putchar('0');
  printf("%p, %p\n", p0, "test");
  char str0[] = "test";
  char str1[] = "test";
  printf("%p, %p\n", str0, str1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed6(%rip),%rcx
lea    0xeca(%rip),%rax
sub    %rcx,%rax
jne    1153 <main+0x33>
jmp    1144 <main+0x24>
mov    $0x31,%edi
call   1030 <putchar@plt>
jmp    115d <main+0x3d>
mov    $0x30,%edi
call   1030 <putchar@plt>
lea    0xe9c(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xe96(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1190 <main+0x70>
mov    $0x31,%edi
call   1030 <putchar@plt>
jmp    119a <main+0x7a>
mov    $0x30,%edi
call   1030 <putchar@plt>
lea    0xe5f(%rip),%rax
cmp    %rax,-0x8(%rbp)
jne    11ba <main+0x9a>
mov    $0x31,%edi
call   1030 <putchar@plt>
jmp    11c4 <main+0xa4>
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rsi
lea    0xe3c(%rip),%rdi
lea    0xe2a(%rip),%rdx
call   1040 <printf@plt>
mov    0xe1f(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xe1a(%rip),%al
mov    %al,-0x11(%rbp)
mov    0xe0d(%rip),%eax
mov    %eax,-0x1a(%rbp)
mov    0xe08(%rip),%al
mov    %al,-0x16(%rbp)
lea    -0x15(%rbp),%rsi
lea    -0x1a(%rbp),%rdx
lea    0xdfd(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
lea    0xed3(%rip),%rax
lea    0xeda(%rip),%rbx
xor    %ebp,%ebp
cmp    %rax,%rbx
sete   %bpl
or     $0x30,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    $0x31,%edi
call   1030 <putchar@plt>
lea    0xea7(%rip),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1040 <printf@plt>
movb   $0x0,0x14(%rsp)
movl   $0x74736574,0x10(%rsp)
74
movb   $0x0,0xc(%rsp)
movl   $0x74736574,0x8(%rsp)
74
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rbp,%rdi
call   1040 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
@.str.1 = [6 x i8] c"test1\00"
@.str.2 = [8 x i8] c"%p, %p\0A\00"
@__const.main.str0 = [5 x i8] c"test\00"
@__const.main.str1 = [5 x i8] c"test\00"
define void @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca [5 x i8]
%4 = alloca [5 x i8]
br i1 icmp eq (i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)), label %5, label %7
5: ; preds = %0
%6 = call i32 @putchar(i8 signext 49)
br label %9
7: ; preds = %0
%8 = call i32 @putchar(i8 signext 48)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
%11 = load i8*, i8** %1
%12 = load i8*, i8** %2
%13 = icmp eq i8* %11, %12
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 @putchar(i8 signext 49)
br label %18
16: ; preds = %9
%17 = call i32 @putchar(i8 signext 48)
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
%20 = load i8*, i8** %1
%21 = icmp eq i8* %20, getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @putchar(i8 signext 49)
br label %26
24: ; preds = %18
%25 = call i32 @putchar(i8 signext 48)
br label %26
26: ; preds = %24, %22
%27 = phi i32 [ %23, %22 ], [ %25, %24 ]
%28 = load i8*, i8** %1
%29 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%30 = bitcast [5 x i8]* %3 to i8*
%31 = bitcast [5 x i8]* %4 to i8*
%32 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%33 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%34 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %32, i8* %33)
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"test1\00"
@.str.2 = [8 x i8] c"%p, %p\0A\00"
@__const.main.str1 = [5 x i8] c"test\00"
define void @main() {
%1 = alloca [5 x i8]
%2 = alloca [5 x i8]
%3 = tail call i32 @putchar(i8 signext select (i1 icmp eq (i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__const.main.str1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)), i8 49, i8 48))
%4 = tail call i32 @putchar(i8 signext select (i1 icmp eq (i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__const.main.str1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)), i8 49, i8 48))
%5 = tail call i32 @putchar(i8 signext 49)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__const.main.str1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__const.main.str1, i64 0, i64 0))
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %7, i8* %8)
ret void
}