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

/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_terminal_input_info(char **index_file_name,
                              wchar_t ***texts_or_querys) {
  int i;
  if (*index_file_name != NULL)
    free(*index_file_name);
  if (*texts_or_querys != NULL) {
    i = 0;
    while ((*texts_or_querys)[i] != NULL) {
      free((*texts_or_querys)[i]);
      i++;
    }
    free(*texts_or_querys);
  }
}


x86 assembly (clang, -O0):
<free_terminal_input_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     113a <free_terminal_input_info+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1193 <free_terminal_input_info+0x83>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1187 <free_terminal_input_info+0x77>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114f <free_terminal_input_info+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_terminal_input_info>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1124 <free_terminal_input_info+0x14>
call   1030 <free@plt>
mov    (%r14),%rax
test   %rax,%rax
je     1164 <free_terminal_input_info+0x54>
mov    (%rax),%rdi
test   %rdi,%rdi
je     1155 <free_terminal_input_info+0x45>
mov    $0x8,%ebx
nopl   0x0(%rax)
call   1030 <free@plt>
mov    (%r14),%rax
mov    (%rax,%rbx,1),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1140 <free_terminal_input_info+0x30>
mov    %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @free_terminal_input_info(i8** nocapture %0, i32******* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free(i8* %3)
br label %7
7: ; preds = %5, %2
%8 = load i32******, i32******* %1
%9 = icmp eq i32****** %8, null
br i1 %9, label %27, label %10
10: ; preds = %7
%11 = load i32*****, i32****** %8
%12 = icmp eq i32***** %11, null
br i1 %12, label %23, label %13
13: ; preds = %10, %13
%14 = phi i64 [ %18, %13 ], [ 0, %10 ]
%15 = phi i32***** [ %21, %13 ], [ %11, %10 ]
%16 = bitcast i32***** %15 to i8*
%17 = tail call i32 @free(i8* %16)
%18 = add nuw nsw i64 %14, 1
%19 = load i32******, i32******* %1
%20 = getelementptr inbounds i32*****, i32****** %19, i64 %18
%21 = load i32*****, i32****** %20
%22 = icmp eq i32***** %21, null
br i1 %22, label %23, label %13
23: ; preds = %13, %10
%24 = phi i32****** [ %8, %10 ], [ %19, %13 ]
%25 = bitcast i32****** %24 to i8*
%26 = tail call i32 @free(i8* %25)
br label %27
27: ; preds = %23, %7
ret void
}