#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*/ assert(int);
scalar_t__ pointer_hash(int *);
void test_pointer_hash(void) {
  int array[200];
  int i, j;
  for (i = 0; i < 200; ++i) {
    array[i] = 0;
  }
  for (i = 0; i < 200; ++i) {
    for (j = i + 1; j < 200; ++j) {
      assert(pointer_hash(&array[i]) != pointer_hash(&array[j]));
    }
  }
}


x86 assembly (clang, -O0):
<test_pointer_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x330,%rsp
movl   $0x0,-0x324(%rbp)
cmpl   $0xc8,-0x324(%rbp)
jge    116b <test_pointer_hash+0x4b>
movslq -0x324(%rbp),%rax
movl   $0x0,-0x320(%rbp,%rax,4)
mov    -0x324(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x324(%rbp)
jmp    1135 <test_pointer_hash+0x15>
movl   $0x0,-0x324(%rbp)
cmpl   $0xc8,-0x324(%rbp)
jge    1226 <test_pointer_hash+0x106>
mov    -0x324(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x328(%rbp)
cmpl   $0xc8,-0x328(%rbp)
jge    120d <test_pointer_hash+0xed>
movslq -0x324(%rbp),%rax
lea    -0x320(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <pointer_hash@plt>
mov    %rax,-0x330(%rbp)
movslq -0x328(%rbp),%rax
lea    -0x320(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <pointer_hash@plt>
mov    %rax,%rcx
mov    -0x330(%rbp),%rax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x328(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x328(%rbp)
jmp    1194 <test_pointer_hash+0x74>
jmp    1212 <test_pointer_hash+0xf2>
mov    -0x324(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x324(%rbp)
jmp    1175 <test_pointer_hash+0x55>
add    $0x330,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pointer_hash>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x338,%rsp
lea    0x10(%rsp),%rdi
xor    %ebx,%ebx
mov    $0x320,%edx
xor    %esi,%esi
call   1040 <memset@plt>
lea    0x14(%rsp),%r13
mov    $0xc7,%r12d
jmp    1186 <test_pointer_hash+0x56>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x4,%r13
add    $0xffffffffffffffff,%r12
mov    0x8(%rsp),%rbx
cmp    $0xc8,%rbx
je     11dd <test_pointer_hash+0xad>
lea    0x1(%rbx),%rcx
mov    %rcx,0x8(%rsp)
cmp    $0xc6,%rbx
ja     1170 <test_pointer_hash+0x40>
mov    %rbx,%rax
lea    (%rsp,%rbx,4),%r14
add    $0x10,%r14
mov    %r12,%rbp
mov    %r13,%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <pointer_hash@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1030 <pointer_hash@plt>
xor    %edi,%edi
cmp    %rax,%r15
setne  %dil
call   1050 <assert@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%rbp
jne    11b0 <test_pointer_hash+0x80>
jmp    1170 <test_pointer_hash+0x40>
add    $0x338,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @test_pointer_hash() {
%1 = alloca [200 x i32]
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 200
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 %9
store i32 0, i32* %10
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
store i32 0, i32* %2
br label %15
15: ; preds = %40, %14
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 200
br i1 %17, label %18, label %43
18: ; preds = %15
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %21
21: ; preds = %36, %18
%22 = load i32, i32* %3
%23 = icmp slt i32 %22, 200
br i1 %23, label %24, label %39
24: ; preds = %21
%25 = load i32, i32* %2
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 %26
%28 = call i64 @pointer_hash(i32* %27)
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 %30
%32 = call i64 @pointer_hash(i32* %31)
%33 = icmp ne i64 %28, %32
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
br label %36
36: ; preds = %24
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %21
39: ; preds = %21
br label %40
40: ; preds = %39
%41 = load i32, i32* %2
%42 = add nsw i32 %41, 1
store i32 %42, i32* %2
br label %15
43: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @test_pointer_hash() {
%1 = alloca [200 x i32]
%2 = bitcast [200 x i32]* %1 to i8*
br label %6
3: ; preds = %13, %6
%4 = add nuw nsw i64 %8, 1
%5 = icmp eq i64 %9, 200
br i1 %5, label %23, label %6
6: ; preds = %0, %3
%7 = phi i64 [ 0, %0 ], [ %9, %3 ]
%8 = phi i64 [ 1, %0 ], [ %4, %3 ]
%9 = add nuw nsw i64 %7, 1
%10 = icmp ult i64 %7, 199
br i1 %10, label %11, label %3
11: ; preds = %6
%12 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 %7
br label %13
13: ; preds = %11, %13
%14 = phi i64 [ %8, %11 ], [ %21, %13 ]
%15 = call i64 @pointer_hash(i32* %12)
%16 = getelementptr inbounds [200 x i32], [200 x i32]* %1, i64 0, i64 %14
%17 = call i64 @pointer_hash(i32* %16)
%18 = icmp ne i64 %15, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = add nuw nsw i64 %14, 1
%22 = icmp eq i64 %21, 200
br i1 %22, label %3, label %13
23: ; preds = %3
ret void
}