#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 scalar_t__ uint32_t;
typedef int /*<<< orphan*/ ****_eth_if;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ ******);
void _eth_ifs_free(struct _eth_if **eifs, uint32_t eif_count) {
  uint32_t i = 0;
  if ((eif_count == 0) || (eifs == NULL))
    return;
  for (; i < eif_count; ++i)
    free(eifs[i]);
  free(eifs);
}


x86 assembly (clang, -O0):
<_eth_ifs_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113e <_eth_ifs_free+0x2e>
cmpq   $0x0,-0x8(%rbp)
jne    1143 <_eth_ifs_free+0x33>
jmp    1181 <_eth_ifs_free+0x71>
jmp    1148 <_eth_ifs_free+0x38>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1178 <_eth_ifs_free+0x68>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <_eth_ifs_free+0x38>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_eth_ifs_free>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     114f <_eth_ifs_free+0x3f>
mov    %rsi,%r14
test   %rsi,%rsi
je     114f <_eth_ifs_free+0x3f>
mov    %rdi,%r15
jle    1142 <_eth_ifs_free+0x32>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <_eth_ifs_free+0x20>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct._eth_if = type opaque
define void @_eth_ifs_free(%struct._eth_if** %0, i64 %1) {
%3 = alloca %struct._eth_if**
%4 = alloca i64
%5 = alloca i64
store %struct._eth_if** %0, %struct._eth_if*** %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load %struct._eth_if**, %struct._eth_if*** %3
%10 = icmp eq %struct._eth_if** %9, null
br i1 %10, label %11, label %12
11: ; preds = %8, %2
br label %31
12: ; preds = %8
br label %13
13: ; preds = %24, %12
%14 = load i64, i64* %5
%15 = load i64, i64* %4
%16 = icmp slt i64 %14, %15
br i1 %16, label %17, label %27
17: ; preds = %13
%18 = load %struct._eth_if**, %struct._eth_if*** %3
%19 = load i64, i64* %5
%20 = getelementptr inbounds %struct._eth_if*, %struct._eth_if** %18, i64 %19
%21 = load %struct._eth_if*, %struct._eth_if** %20
%22 = bitcast %struct._eth_if* %21 to i32******
%23 = call i32 @free(i32****** %22)
br label %24
24: ; preds = %17
%25 = load i64, i64* %5
%26 = add nsw i64 %25, 1
store i64 %26, i64* %5
br label %13
27: ; preds = %13
%28 = load %struct._eth_if**, %struct._eth_if*** %3
%29 = bitcast %struct._eth_if** %28 to i32******
%30 = call i32 @free(i32****** %29)
br label %31
31: ; preds = %27, %11
ret void
}

LLVM IR (-O2):
%struct._eth_if = type opaque
define void @_eth_ifs_free(%struct._eth_if** %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = icmp eq %struct._eth_if** %0, null
%5 = or i1 %4, %3
br i1 %5, label %19, label %6
6: ; preds = %2
%7 = icmp sgt i64 %1, 0
br i1 %7, label %8, label %16
8: ; preds = %6, %8
%9 = phi i64 [ %14, %8 ], [ 0, %6 ]
%10 = getelementptr inbounds %struct._eth_if*, %struct._eth_if** %0, i64 %9
%11 = bitcast %struct._eth_if** %10 to i32*******
%12 = load i32******, i32******* %11
%13 = tail call i32 @free(i32****** %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %1
br i1 %15, label %16, label %8
16: ; preds = %8, %6
%17 = bitcast %struct._eth_if** %0 to i32******
%18 = tail call i32 @free(i32****** %17)
br label %19
19: ; preds = %2, %16
ret void
}