#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*/ sniffer_trace(char *);
int addr_cmp(char *snd_addr, char *rcv_addr, int size) {
  if (1) {
    sniffer_trace("ENTERING: addr_cmp");
  }
  int i = 0;
  for (i = 0; i < size; i++) {
    if (snd_addr[i] != rcv_addr[i]) {
      if (1) {
        sniffer_trace("LEAVING: addr_cmp");
      }
      return 0;
    }
  }
  if (1) {
    sniffer_trace("LEAVING: addr_cmp");
  }
  return 1;
}


x86 assembly (clang, -O0):
<addr_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <sniffer_trace@plt>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1194 <addr_cmp+0x84>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1181 <addr_cmp+0x71>
lea    0xea3(%rip),%rdi
call   1030 <sniffer_trace@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <addr_cmp+0x97>
jmp    1186 <addr_cmp+0x76>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    113d <addr_cmp+0x2d>
lea    0xe78(%rip),%rdi
call   1030 <sniffer_trace@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr_cmp>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xed9(%rip),%rdi
call   1030 <sniffer_trace@plt>
mov    $0x1,%r14d
test   %r15d,%r15d
jle    1158 <addr_cmp+0x48>
mov    %r15d,%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
movzbl 0x0(%rbp,%rcx,1),%edx
cmp    (%rbx,%rcx,1),%dl
jne    1155 <addr_cmp+0x45>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1140 <addr_cmp+0x30>
jmp    1158 <addr_cmp+0x48>
xor    %r14d,%r14d
lea    0xeb4(%rip),%rdi
call   1030 <sniffer_trace@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"ENTERING: addr_cmp\00"
@.str.1 = [18 x i8] c"LEAVING: addr_cmp\00"
define i32 @addr_cmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @sniffer_trace(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %18
6: ; preds = %3
%7 = zext i32 %2 to i64
br label %10
8: ; preds = %10
%9 = icmp eq i64 %17, %7
br i1 %9, label %18, label %10
10: ; preds = %6, %8
%11 = phi i64 [ 0, %6 ], [ %17, %8 ]
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = getelementptr inbounds i8, i8* %1, i64 %11
%15 = load i8, i8* %14
%16 = icmp eq i8 %13, %15
%17 = add nuw nsw i64 %11, 1
br i1 %16, label %8, label %18
18: ; preds = %8, %10, %3
%19 = phi i32 [ 1, %3 ], [ 0, %10 ], [ 1, %8 ]
%20 = tail call i32 @sniffer_trace(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 %19
}