#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 */
scalar_t__ ends_with(char *, char *);
int /*<<< orphan*/ free_string_array(char **, int);
char **list_color_scheme_files(int *);
int cs_have_no_extensions(void) {
  int len;
  char **list = list_color_scheme_files(&len);
  int i;
  for (i = 0; i < len; ++i) {
    if (ends_with(list[i], ".vifm")) {
      break;
    }
  }
  free_string_array(list, len);
  return (len > 0 && i >= len);
}


x86 assembly (clang, -O0):
<cs_have_no_extensions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rdi
call   1050 <list_color_scheme_files@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1192 <cs_have_no_extensions+0x62>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe95(%rip),%rsi
call   1040 <ends_with@plt>
cmp    $0x0,%rax
je     117f <cs_have_no_extensions+0x4f>
jmp    1192 <cs_have_no_extensions+0x62>
jmp    1184 <cs_have_no_extensions+0x54>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <cs_have_no_extensions+0x1c>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <free_string_array@plt>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x15(%rbp)
jle    11b9 <cs_have_no_extensions+0x89>
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
setge  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs_have_no_extensions>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
call   1050 <list_color_scheme_files@plt>
mov    %rax,%r15
mov    0xc(%rsp),%esi
xor    %ebx,%ebx
test   %esi,%esi
jle    1185 <cs_have_no_extensions+0x55>
lea    0xea9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
mov    %r14,%rsi
call   1040 <ends_with@plt>
test   %rax,%rax
jne    1181 <cs_have_no_extensions+0x51>
add    $0x1,%rbx
movslq 0xc(%rsp),%rsi
cmp    %rsi,%rbx
jl     1160 <cs_have_no_extensions+0x30>
jmp    1185 <cs_have_no_extensions+0x55>
mov    0xc(%rsp),%esi
mov    %r15,%rdi
call   1030 <free_string_array@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
setg   %cl
cmp    %eax,%ebx
setge  %al
and    %cl,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c".vifm\00"
define i32 @cs_have_no_extensions() {
%1 = alloca i32
%2 = alloca i8**
%3 = alloca i32
%4 = call i8** @list_color_scheme_files(i32* %1)
store i8** %4, i8*** %2
store i32 0, i32* %3
br label %5
5: ; preds = %19, %0
%6 = load i32, i32* %3
%7 = load i32, i32* %1
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %22
9: ; preds = %5
%10 = load i8**, i8*** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %10, i64 %12
%14 = load i8*, i8** %13
%15 = call i64 @ends_with(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %9
br label %22
18: ; preds = %9
br label %19
19: ; preds = %18
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %5
22: ; preds = %17, %5
%23 = load i8**, i8*** %2
%24 = load i32, i32* %1
%25 = call i32 @free_string_array(i8** %23, i32 %24)
%26 = load i32, i32* %1
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %22
%29 = load i32, i32* %3
%30 = load i32, i32* %1
%31 = icmp sge i32 %29, %30
br label %32
32: ; preds = %28, %22
%33 = phi i1 [ false, %22 ], [ %31, %28 ]
%34 = zext i1 %33 to i32
ret i32 %34
}

LLVM IR (-O2):
@.str = [6 x i8] c".vifm\00"
define i32 @cs_have_no_extensions() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i8** @list_color_scheme_files(i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %23
6: ; preds = %0, %14
%7 = phi i64 [ %15, %14 ], [ 0, %0 ]
%8 = getelementptr inbounds i8*, i8** %3, i64 %7
%9 = load i8*, i8** %8
%10 = call i64 @ends_with(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %6
%13 = load i32, i32* %1
br label %19
14: ; preds = %6
%15 = add nuw nsw i64 %7, 1
%16 = load i32, i32* %1
%17 = sext i32 %16 to i64
%18 = icmp slt i64 %15, %17
br i1 %18, label %6, label %19
19: ; preds = %14, %12
%20 = phi i32 [ %13, %12 ], [ %16, %14 ]
%21 = phi i64 [ %7, %12 ], [ %15, %14 ]
%22 = trunc i64 %21 to i32
br label %23
23: ; preds = %19, %0
%24 = phi i32 [ %4, %0 ], [ %20, %19 ]
%25 = phi i32 [ 0, %0 ], [ %22, %19 ]
%26 = call i32 @free_string_array(i8** %3, i32 %24)
%27 = load i32, i32* %1
%28 = icmp sgt i32 %27, 0
%29 = icmp sge i32 %25, %27
%30 = select i1 %28, i1 %29, i1 false
%31 = zext i1 %30 to i32
ret i32 %31
}