#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 */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ auth_data;
  int /*<<< orphan*/ network_id;
};
typedef TYPE_1__ IceAuthDataEntry;

/* Variables and functions */
int /*<<< orphan*/ XtFree(char *);
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ writeIceauth(int, TYPE_1__ *, int);
void FreeAuthenticationData(int count, IceAuthDataEntry *authDataEntries) {
  int i;
  int nEntries = count * 2;
  writeIceauth(nEntries, authDataEntries, 1);
  for (i = 0; i < nEntries; i++) {
    free(authDataEntries[i].network_id);
    free(authDataEntries[i].auth_data);
  }
  XtFree((char *)authDataEntries);
}


x86 assembly (clang, -O0):
<FreeAuthenticationData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1040 <writeIceauth@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    119b <FreeAuthenticationData+0x6b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    0x4(%rax,%rcx,8),%edi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%edi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1160 <FreeAuthenticationData+0x30>
mov    -0x10(%rbp),%rdi
call   1050 <XtFree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeAuthenticationData>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r15d
lea    (%r15,%r15,1),%r14d
mov    $0x1,%r12d
mov    %r14d,%edi
mov    $0x1,%edx
call   1040 <writeIceauth@plt>
test   %r15d,%r15d
jle    118a <FreeAuthenticationData+0x5a>
cmp    $0x2,%r14d
cmovge %r14d,%r12d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x4(%rbx,%rbp,8),%edi
call   1030 <free@plt>
mov    (%rbx,%rbp,8),%edi
call   1030 <free@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1170 <FreeAuthenticationData+0x40>
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <XtFree@plt>

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

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