#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 *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x, y;
  printf("%d\n", &x == &y);
  int *p = malloc(sizeof(int)), *q = malloc(sizeof(int));
  printf("%d\n", p == q);
  struct S {
    int a;
    int b;
  } s, *r = &s;
  printf("%d\n", &s.a + 1 == &(r->b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x4(%rbp),%rax
lea    -0x8(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rax
add    $0x4,%rax
mov    -0x28(%rbp),%rcx
add    $0x4,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
xor    %esi,%esi
cmp    %rax,%rbx
sete   %sil
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.S = type { i32, i32 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca %struct.S
%6 = alloca %struct.S*
%7 = icmp eq i32* %1, %2
%8 = zext i1 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32* @malloc(i32 4)
store i32* %10, i32** %3
%11 = call i32* @malloc(i32 4)
store i32* %11, i32** %4
%12 = load i32*, i32** %3
%13 = load i32*, i32** %4
%14 = icmp eq i32* %12, %13
%15 = zext i1 %14 to i32
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
store %struct.S* %5, %struct.S** %6
%17 = getelementptr inbounds %struct.S, %struct.S* %5, i32 0, i32 0
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load %struct.S*, %struct.S** %6
%20 = getelementptr inbounds %struct.S, %struct.S* %19, i32 0, i32 1
%21 = icmp eq i32* %18, %20
%22 = zext i1 %21 to i32
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %22)
ret i32 0
}

LLVM IR (-O2):
%struct.S = type { i32, i32 }
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32* @malloc(i32 4)
%3 = tail call i32* @malloc(i32 4)
%4 = icmp eq i32* %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}