#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 *, int, char *);
scalar_t__ strcmp(char *, char *);
void checkNeighbors(char **neighbors, char **expectedNeighbors) {
  int i;
  for (i = 0; i < 8; i++)
    if (strcmp(neighbors[i], expectedNeighbors[i]) != 0)
      printf("Error: Expected hash = %s at index %i. (%s)\n",
             expectedNeighbors[i], i, neighbors[i]);
}


x86 assembly (clang, -O0):
<checkNeighbors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    11a2 <checkNeighbors+0x82>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     118f <checkNeighbors+0x6f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
jmp    1194 <checkNeighbors+0x74>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <checkNeighbors+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkNeighbors>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    (%rsi),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     114e <checkNeighbors+0x2e>
mov    (%r14),%rsi
mov    (%rbx),%rcx
lea    0xeb9(%rip),%rdi
xor    %edx,%edx
call   1030 <printf@plt>
mov    0x8(%rbx),%rdi
mov    0x8(%r14),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1179 <checkNeighbors+0x59>
mov    0x8(%r14),%rsi
mov    0x8(%rbx),%rcx
lea    0xe91(%rip),%rdi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    0x10(%rbx),%rdi
mov    0x10(%r14),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11a4 <checkNeighbors+0x84>
mov    0x10(%r14),%rsi
mov    0x10(%rbx),%rcx
lea    0xe66(%rip),%rdi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    0x18(%rbx),%rdi
mov    0x18(%r14),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11cf <checkNeighbors+0xaf>
mov    0x18(%r14),%rsi
mov    0x18(%rbx),%rcx
lea    0xe3b(%rip),%rdi
mov    $0x3,%edx
call   1030 <printf@plt>
mov    0x20(%rbx),%rdi
mov    0x20(%r14),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11fa <checkNeighbors+0xda>
mov    0x20(%r14),%rsi
mov    0x20(%rbx),%rcx
lea    0xe10(%rip),%rdi
mov    $0x4,%edx
call   1030 <printf@plt>
mov    0x28(%rbx),%rdi
mov    0x28(%r14),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1225 <checkNeighbors+0x105>
mov    0x28(%r14),%rsi
mov    0x28(%rbx),%rcx
lea    0xde5(%rip),%rdi
mov    $0x5,%edx
call   1030 <printf@plt>
mov    0x30(%rbx),%rdi
mov    0x30(%r14),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1250 <checkNeighbors+0x130>
mov    0x30(%r14),%rsi
mov    0x30(%rbx),%rcx
lea    0xdba(%rip),%rdi
mov    $0x6,%edx
call   1030 <printf@plt>
mov    0x38(%rbx),%rdi
mov    0x38(%r14),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1282 <checkNeighbors+0x162>
mov    0x38(%r14),%rsi
mov    0x38(%rbx),%rcx
lea    0xd8f(%rip),%rdi
mov    $0x7,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Error: Expected hash = %s at index %i. (%s)\0A\00"
define void @checkNeighbors(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i32
store i8** %0, i8*** %3
store i8** %1, i8*** %4
store i32 0, i32* %5
br label %6
6: ; preds = %36, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %39
9: ; preds = %6
%10 = load i8**, i8*** %3
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %10, i64 %12
%14 = load i8*, i8** %13
%15 = load i8**, i8*** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = call i64 @strcmp(i8* %14, i8* %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %35
22: ; preds = %9
%23 = load i8**, i8*** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%28 = load i32, i32* %5
%29 = load i8**, i8*** %3
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %27, i32 %28, i8* %33)
br label %35
35: ; preds = %22, %9
br label %36
36: ; preds = %35
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %6
39: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"Error: Expected hash = %s at index %i. (%s)\0A\00"
define void @checkNeighbors(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i64 @strcmp(i8* %3, i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i8*, i8** %1
%9 = load i8*, i8** %0
%10 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %8, i32 0, i8* %9)
br label %11
11: ; preds = %2, %7
%12 = getelementptr inbounds i8*, i8** %0, i64 1
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i64 @strcmp(i8* %13, i8* %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %11
%19 = load i8*, i8** %14
%20 = load i8*, i8** %12
%21 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %19, i32 1, i8* %20)
br label %22
22: ; preds = %18, %11
%23 = getelementptr inbounds i8*, i8** %0, i64 2
%24 = load i8*, i8** %23
%25 = getelementptr inbounds i8*, i8** %1, i64 2
%26 = load i8*, i8** %25
%27 = tail call i64 @strcmp(i8* %24, i8* %26)
%28 = icmp eq i64 %27, 0
br i1 %28, label %33, label %29
29: ; preds = %22
%30 = load i8*, i8** %25
%31 = load i8*, i8** %23
%32 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %30, i32 2, i8* %31)
br label %33
33: ; preds = %29, %22
%34 = getelementptr inbounds i8*, i8** %0, i64 3
%35 = load i8*, i8** %34
%36 = getelementptr inbounds i8*, i8** %1, i64 3
%37 = load i8*, i8** %36
%38 = tail call i64 @strcmp(i8* %35, i8* %37)
%39 = icmp eq i64 %38, 0
br i1 %39, label %44, label %40
40: ; preds = %33
%41 = load i8*, i8** %36
%42 = load i8*, i8** %34
%43 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %41, i32 3, i8* %42)
br label %44
44: ; preds = %40, %33
%45 = getelementptr inbounds i8*, i8** %0, i64 4
%46 = load i8*, i8** %45
%47 = getelementptr inbounds i8*, i8** %1, i64 4
%48 = load i8*, i8** %47
%49 = tail call i64 @strcmp(i8* %46, i8* %48)
%50 = icmp eq i64 %49, 0
br i1 %50, label %55, label %51
51: ; preds = %44
%52 = load i8*, i8** %47
%53 = load i8*, i8** %45
%54 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %52, i32 4, i8* %53)
br label %55
55: ; preds = %51, %44
%56 = getelementptr inbounds i8*, i8** %0, i64 5
%57 = load i8*, i8** %56
%58 = getelementptr inbounds i8*, i8** %1, i64 5
%59 = load i8*, i8** %58
%60 = tail call i64 @strcmp(i8* %57, i8* %59)
%61 = icmp eq i64 %60, 0
br i1 %61, label %66, label %62
62: ; preds = %55
%63 = load i8*, i8** %58
%64 = load i8*, i8** %56
%65 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %63, i32 5, i8* %64)
br label %66
66: ; preds = %62, %55
%67 = getelementptr inbounds i8*, i8** %0, i64 6
%68 = load i8*, i8** %67
%69 = getelementptr inbounds i8*, i8** %1, i64 6
%70 = load i8*, i8** %69
%71 = tail call i64 @strcmp(i8* %68, i8* %70)
%72 = icmp eq i64 %71, 0
br i1 %72, label %77, label %73
73: ; preds = %66
%74 = load i8*, i8** %69
%75 = load i8*, i8** %67
%76 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %74, i32 6, i8* %75)
br label %77
77: ; preds = %73, %66
%78 = getelementptr inbounds i8*, i8** %0, i64 7
%79 = load i8*, i8** %78
%80 = getelementptr inbounds i8*, i8** %1, i64 7
%81 = load i8*, i8** %80
%82 = tail call i64 @strcmp(i8* %79, i8* %81)
%83 = icmp eq i64 %82, 0
br i1 %83, label %88, label %84
84: ; preds = %77
%85 = load i8*, i8** %80
%86 = load i8*, i8** %78
%87 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %85, i32 7, i8* %86)
br label %88
88: ; preds = %84, %77
ret void
}