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

/* Variables and functions */
int check_path_against_extension_list(char const *, char const **, int);
int is_path_image_file(const char *path) {
  const char *list_ext[] = {"jpg", "jpeg", "png", "tga",  "targa", "bmp",
                            "psd", "gif",  "tif", "tiff", "fts"};
  return check_path_against_extension_list(path, list_ext,
                                           sizeof(list_ext) / sizeof(char *));
}


x86 assembly (clang, -O0):
<is_path_image_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x60(%rbp),%rdi
lea    0x2c89(%rip),%rsi
mov    $0x58,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0xb,%edx
call   1040 <check_path_against_extension_list@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_path_image_file>:
sub    $0x58,%rsp
mov    0x2cf5(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2cbd(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2ca1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2c85(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2c69(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0xb,%edx
call   1030 <check_path_against_extension_list@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"jpg\00"
@.str.1 = [5 x i8] c"jpeg\00"
@.str.2 = [4 x i8] c"png\00"
@.str.3 = [4 x i8] c"tga\00"
@.str.4 = [6 x i8] c"targa\00"
@.str.5 = [4 x i8] c"bmp\00"
@.str.6 = [4 x i8] c"psd\00"
@.str.7 = [4 x i8] c"gif\00"
@.str.8 = [4 x i8] c"tif\00"
@.str.9 = [5 x i8] c"tiff\00"
@.str.10 = [4 x i8] c"fts\00"
@__const.is_path_image_file.list_ext = [11 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0)]
define i32 @is_path_image_file(i8* %0) {
%2 = alloca i8*
%3 = alloca [11 x i8*]
store i8* %0, i8** %2
%4 = bitcast [11 x i8*]* %3 to i8*
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [11 x i8*], [11 x i8*]* %3, i64 0, i64 0
%7 = call i32 @check_path_against_extension_list(i8* %5, i8** %6, i32 11)
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"jpg\00"
@.str.1 = [5 x i8] c"jpeg\00"
@.str.2 = [4 x i8] c"png\00"
@.str.3 = [4 x i8] c"tga\00"
@.str.4 = [6 x i8] c"targa\00"
@.str.5 = [4 x i8] c"bmp\00"
@.str.6 = [4 x i8] c"psd\00"
@.str.7 = [4 x i8] c"gif\00"
@.str.8 = [4 x i8] c"tif\00"
@.str.9 = [5 x i8] c"tiff\00"
@.str.10 = [4 x i8] c"fts\00"
@__const.is_path_image_file.list_ext = [11 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0)]
define i32 @is_path_image_file(i8* %0) {
%2 = alloca [11 x i8*]
%3 = bitcast [11 x i8*]* %2 to i8*
%4 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 0
%5 = call i32 @check_path_against_extension_list(i8* %0, i8** %4, i32 11)
ret i32 %5
}