#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 */
typedef int uint8_t;

/* Variables and functions */
int is_mac_broadcast(const uint8_t *mac) {
  int i;
  for (i = 0; i < 6; i++) {
    if (mac[i] != 0xFF) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_mac_broadcast>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    114d <is_mac_broadcast+0x4d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0xff,(%rax,%rcx,4)
je     113a <is_mac_broadcast+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1154 <is_mac_broadcast+0x54>
jmp    113f <is_mac_broadcast+0x3f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <is_mac_broadcast+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_mac_broadcast>:
xor    %eax,%eax
cmpl   $0xff,(%rdi)
jne    113a <is_mac_broadcast+0x3a>
cmpl   $0xff,0x4(%rdi)
jne    113a <is_mac_broadcast+0x3a>
cmpl   $0xff,0x8(%rdi)
jne    113a <is_mac_broadcast+0x3a>
cmpl   $0xff,0xc(%rdi)
jne    113a <is_mac_broadcast+0x3a>
cmpl   $0xff,0x10(%rdi)
jne    113a <is_mac_broadcast+0x3a>
xor    %eax,%eax
cmpl   $0xff,0x14(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_mac_broadcast(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 0, i32* %4
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 6
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = icmp ne i32 %13, 255
br i1 %14, label %15, label %16
15: ; preds = %8
store i32 0, i32* %2
br label %21
16: ; preds = %8
br label %17
17: ; preds = %16
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
store i32 1, i32* %2
br label %21
21: ; preds = %20, %15
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_mac_broadcast(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 255
br i1 %3, label %4, label %25
4: ; preds = %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 255
br i1 %7, label %8, label %25
8: ; preds = %4
%9 = getelementptr inbounds i32, i32* %0, i64 2
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 255
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = getelementptr inbounds i32, i32* %0, i64 3
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 255
br i1 %15, label %16, label %25
16: ; preds = %12
%17 = getelementptr inbounds i32, i32* %0, i64 4
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 255
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = getelementptr inbounds i32, i32* %0, i64 5
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 255
%24 = zext i1 %23 to i32
br label %25
25: ; preds = %20, %16, %12, %8, %4, %1
%26 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 0, %8 ], [ 0, %12 ], [ 0, %16 ], [ %24, %20 ]
ret i32 %26
}