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

/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_filenames(char **filenames, int no_of_filenames) {
  int i;
  if (no_of_filenames > 0) {
    for (i = 0; i < 20; i++) {
      free(filenames[i]);
      filenames[i] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<free_filenames>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    116e <free_filenames+0x5e>
movl   $0x0,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jge    1169 <free_filenames+0x59>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <free_filenames+0x20>
jmp    116e <free_filenames+0x5e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_filenames>:
test   %esi,%esi
jle    1287 <free_filenames+0x177>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
mov    0x8(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x8(%rbx)
mov    0x10(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x10(%rbx)
mov    0x18(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x18(%rbx)
mov    0x20(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x20(%rbx)
mov    0x28(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x28(%rbx)
mov    0x30(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x30(%rbx)
mov    0x38(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x38(%rbx)
mov    0x40(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x40(%rbx)
mov    0x48(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x48(%rbx)
mov    0x50(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x50(%rbx)
mov    0x58(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x58(%rbx)
mov    0x60(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x60(%rbx)
mov    0x68(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x68(%rbx)
mov    0x70(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x70(%rbx)
mov    0x78(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x78(%rbx)
mov    0x80(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x80(%rbx)
mov    0x88(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x88(%rbx)
mov    0x90(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x90(%rbx)
mov    0x98(%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,0x98(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @free_filenames(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %64
4: ; preds = %2
%5 = load i8*, i8** %0
%6 = tail call i32 @free(i8* %5)
store i8* null, i8** %0
%7 = getelementptr inbounds i8*, i8** %0, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @free(i8* %8)
store i8* null, i8** %7
%10 = getelementptr inbounds i8*, i8** %0, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @free(i8* %11)
store i8* null, i8** %10
%13 = getelementptr inbounds i8*, i8** %0, i64 3
%14 = load i8*, i8** %13
%15 = tail call i32 @free(i8* %14)
store i8* null, i8** %13
%16 = getelementptr inbounds i8*, i8** %0, i64 4
%17 = load i8*, i8** %16
%18 = tail call i32 @free(i8* %17)
store i8* null, i8** %16
%19 = getelementptr inbounds i8*, i8** %0, i64 5
%20 = load i8*, i8** %19
%21 = tail call i32 @free(i8* %20)
store i8* null, i8** %19
%22 = getelementptr inbounds i8*, i8** %0, i64 6
%23 = load i8*, i8** %22
%24 = tail call i32 @free(i8* %23)
store i8* null, i8** %22
%25 = getelementptr inbounds i8*, i8** %0, i64 7
%26 = load i8*, i8** %25
%27 = tail call i32 @free(i8* %26)
store i8* null, i8** %25
%28 = getelementptr inbounds i8*, i8** %0, i64 8
%29 = load i8*, i8** %28
%30 = tail call i32 @free(i8* %29)
store i8* null, i8** %28
%31 = getelementptr inbounds i8*, i8** %0, i64 9
%32 = load i8*, i8** %31
%33 = tail call i32 @free(i8* %32)
store i8* null, i8** %31
%34 = getelementptr inbounds i8*, i8** %0, i64 10
%35 = load i8*, i8** %34
%36 = tail call i32 @free(i8* %35)
store i8* null, i8** %34
%37 = getelementptr inbounds i8*, i8** %0, i64 11
%38 = load i8*, i8** %37
%39 = tail call i32 @free(i8* %38)
store i8* null, i8** %37
%40 = getelementptr inbounds i8*, i8** %0, i64 12
%41 = load i8*, i8** %40
%42 = tail call i32 @free(i8* %41)
store i8* null, i8** %40
%43 = getelementptr inbounds i8*, i8** %0, i64 13
%44 = load i8*, i8** %43
%45 = tail call i32 @free(i8* %44)
store i8* null, i8** %43
%46 = getelementptr inbounds i8*, i8** %0, i64 14
%47 = load i8*, i8** %46
%48 = tail call i32 @free(i8* %47)
store i8* null, i8** %46
%49 = getelementptr inbounds i8*, i8** %0, i64 15
%50 = load i8*, i8** %49
%51 = tail call i32 @free(i8* %50)
store i8* null, i8** %49
%52 = getelementptr inbounds i8*, i8** %0, i64 16
%53 = load i8*, i8** %52
%54 = tail call i32 @free(i8* %53)
store i8* null, i8** %52
%55 = getelementptr inbounds i8*, i8** %0, i64 17
%56 = load i8*, i8** %55
%57 = tail call i32 @free(i8* %56)
store i8* null, i8** %55
%58 = getelementptr inbounds i8*, i8** %0, i64 18
%59 = load i8*, i8** %58
%60 = tail call i32 @free(i8* %59)
store i8* null, i8** %58
%61 = getelementptr inbounds i8*, i8** %0, i64 19
%62 = load i8*, i8** %61
%63 = tail call i32 @free(i8* %62)
store i8* null, i8** %61
br label %64
64: ; preds = %4, %2
ret void
}