#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 */
struct quorum_op_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct quorum_op_t *);
void qtable_free_quorum_op_t(struct quorum_op_t **ret, int n) {
  if (ret) {
    int i;
    for (i = 0; i < n; i++) {
      if (ret[i]) {
        free(ret[i]);
      }
    }
  }
}


x86 assembly (clang, -O0):
<qtable_free_quorum_op_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1179 <qtable_free_quorum_op_t+0x69>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1174 <qtable_free_quorum_op_t+0x64>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1161 <qtable_free_quorum_op_t+0x51>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    1166 <qtable_free_quorum_op_t+0x56>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1131 <qtable_free_quorum_op_t+0x21>
jmp    1179 <qtable_free_quorum_op_t+0x69>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qtable_free_quorum_op_t>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1149 <qtable_free_quorum_op_t+0x39>
test   %esi,%esi
jle    1149 <qtable_free_quorum_op_t+0x39>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
jmp    1139 <qtable_free_quorum_op_t+0x29>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%r15
je     1149 <qtable_free_quorum_op_t+0x39>
mov    (%r14,%rbx,8),%rdi
test   %rdi,%rdi
je     1130 <qtable_free_quorum_op_t+0x20>
call   1030 <free@plt>
jmp    1130 <qtable_free_quorum_op_t+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

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