#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 /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ get_all_macs(char **);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int, char *);
int strlen(char *);
int main(int argc, char *argv[]) {
  char **result = (char **)malloc(1024);
  get_all_macs(result);
  int i;
  for (i = 0; i < (sizeof(result) / sizeof(result[i])); i++) {
    if (strlen(result[i]) < 14) {
      continue;
    }
    printf("eth%d\'s MAC is %s\n", i, result[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <get_all_macs@plt>
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x1,%rax
jae    11ca <main+0x8a>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
cmp    $0xe,%eax
jge    11a1 <main+0x61>
jmp    11bc <main+0x7c>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe49(%rip),%rdi
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1174 <main+0x34>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x400,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <get_all_macs@plt>
mov    (%rbx),%rdi
call   1040 <strlen@plt>
cmp    $0xe,%eax
jl     1174 <main+0x34>
mov    (%rbx),%rdx
lea    0xe93(%rip),%rdi
xor    %esi,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"eth%d's MAC is %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i64 @malloc(i32 1024)
%9 = inttoptr i64 %8 to i8**
store i8** %9, i8*** %6
%10 = load i8**, i8*** %6
%11 = call i32 @get_all_macs(i8** %10)
store i32 0, i32* %7
br label %12
12: ; preds = %33, %2
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = icmp ult i64 %14, 1
br i1 %15, label %16, label %36
16: ; preds = %12
%17 = load i8**, i8*** %6
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8*, i8** %17, i64 %19
%21 = load i8*, i8** %20
%22 = call i32 @strlen(i8* %21)
%23 = icmp slt i32 %22, 14
br i1 %23, label %24, label %25
24: ; preds = %16
br label %33
25: ; preds = %16
%26 = load i32, i32* %7
%27 = load i8**, i8*** %6
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %26, i8* %31)
br label %33
33: ; preds = %25, %24
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %12
36: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"eth%d's MAC is %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 1024)
%4 = inttoptr i64 %3 to i8**
%5 = tail call i32 @get_all_macs(i8** %4)
%6 = load i8*, i8** %4
%7 = tail call i32 @strlen(i8* %6)
%8 = icmp slt i32 %7, 14
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0, i8* %10)
br label %12
12: ; preds = %9, %2
ret i32 0
}