#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*/ ****u_int8_t;
typedef int /*<<< orphan*/ *****u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ ******);
void cert_free_subjects(int n, u_int8_t **id, u_int32_t *len) {
  int i;
  for (i = 0; i < n; i++)
    free(id[i]);
  free(id);
  free(len);
}


x86 assembly (clang, -O0):
<cert_free_subjects>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1155 <cert_free_subjects+0x45>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <cert_free_subjects+0x1a>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cert_free_subjects>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
test   %edi,%edi
jle    1142 <cert_free_subjects+0x32>
mov    %edi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <cert_free_subjects+0x20>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

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