; LLVM IR from paroj/gltut :: glsdk/glimg/source (stb_image)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.stbi_loader = type { ptr, ptr, ptr, ptr }

@loaders = external dso_local global [32 x ptr], align 16
@max_loaders = external hidden global i32, align 4
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @e(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @hdr_to_ldr(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @stbi_load_from_memory(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5) #1 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store i32 %5, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #2
  %17 = load ptr, ptr %8, align 8, !tbaa !5
  %18 = load i32, ptr %9, align 4, !tbaa !9
  %19 = call i32 @stbi_jpeg_test_memory(ptr noundef %17, i32 noundef %18)
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %29

21:                                               ; preds = %6
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = load i32, ptr %9, align 4, !tbaa !9
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  %25 = load ptr, ptr %11, align 8, !tbaa !5
  %26 = load ptr, ptr %12, align 8, !tbaa !5
  %27 = load i32, ptr %13, align 4, !tbaa !9
  %28 = call ptr @stbi_jpeg_load_from_memory(ptr noundef %22, i32 noundef %23, ptr noundef %24, ptr noundef %25, ptr noundef %26, i32 noundef %27)
  store ptr %28, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %174

29:                                               ; preds = %6
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = call i32 @stbi_png_test_memory(ptr noundef %30, i32 noundef %31)
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %42

34:                                               ; preds = %29
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = load i32, ptr %9, align 4, !tbaa !9
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = load i32, ptr %13, align 4, !tbaa !9
  %41 = call ptr @stbi_png_load_from_memory(ptr noundef %35, i32 noundef %36, ptr noundef %37, ptr noundef %38, ptr noundef %39, i32 noundef %40)
  store ptr %41, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %174

42:                                               ; preds = %29
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = call i32 @stbi_bmp_test_memory(ptr noundef %43, i32 noundef %44)
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %55

47:                                               ; preds = %42
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = load i32, ptr %9, align 4, !tbaa !9
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = load i32, ptr %13, align 4, !tbaa !9
  %54 = call ptr @stbi_bmp_load_from_memory(ptr noundef %48, i32 noundef %49, ptr noundef %50, ptr noundef %51, ptr noundef %52, i32 noundef %53)
  store ptr %54, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %174

55:                                               ; preds = %42
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = load i32, ptr %9, align 4, !tbaa !9
  %58 = call i32 @stbi_gif_test_memory(ptr noundef %56, i32 noundef %57)
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %68

60:                                               ; preds = %55
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = load ptr, ptr %11, align 8, !tbaa !5
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = load i32, ptr %13, align 4, !tbaa !9
  %67 = call ptr @stbi_gif_load_from_memory(ptr noundef %61, i32 noundef %62, ptr noundef %63, ptr noundef %64, ptr noundef %65, i32 noundef %66)
  store ptr %67, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %174

68:                                               ; preds = %55
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = load i32, ptr %9, align 4, !tbaa !9
  %71 = call i32 @stbi_psd_test_memory(ptr noundef %69, i32 noundef %70)
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %81

73:                                               ; preds = %68
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = load i32, ptr %9, align 4, !tbaa !9
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = load i32, ptr %13, align 4, !tbaa !9
  %80 = call ptr @stbi_psd_load_from_memory(ptr noundef %74, i32 noundef %75, ptr noundef %76, ptr noundef %77, ptr noundef %78, i32 noundef %79)
  store ptr %80, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %174

81:                                               ; preds = %68
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = load i32, ptr %9, align 4, !tbaa !9
  %84 = call i32 @stbi_pic_test_memory(ptr noundef %82, i32 noundef %83)
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %94

86:                                               ; preds = %81
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = call ptr @stbi_pic_load_from_memory(ptr noundef %87, i32 noundef %88, ptr noundef %89, ptr noundef %90, ptr noundef %91, i32 noundef %92)
  store ptr %93, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %174

94:                                               ; preds = %81
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = load i32, ptr %9, align 4, !tbaa !9
  %97 = call i32 @stbi_hdr_test_memory(ptr noundef %95, i32 noundef %96)
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %122

99:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #2
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = load i32, ptr %9, align 4, !tbaa !9
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = load ptr, ptr %12, align 8, !tbaa !5
  %105 = load i32, ptr %13, align 4, !tbaa !9
  %106 = call ptr @stbi_hdr_load_from_memory(ptr noundef %100, i32 noundef %101, ptr noundef %102, ptr noundef %103, ptr noundef %104, i32 noundef %105)
  store ptr %106, ptr %16, align 8, !tbaa !5
  %107 = load ptr, ptr %16, align 8, !tbaa !5
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = load i32, ptr %110, align 4, !tbaa !9
  %112 = load i32, ptr %13, align 4, !tbaa !9
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %116

114:                                              ; preds = %99
  %115 = load i32, ptr %13, align 4, !tbaa !9
  br label %119

116:                                              ; preds = %99
  %117 = load ptr, ptr %12, align 8, !tbaa !5
  %118 = load i32, ptr %117, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %116, %114
  %120 = phi i32 [ %115, %114 ], [ %118, %116 ]
  %121 = call ptr @hdr_to_ldr(ptr noundef %107, i32 noundef %109, i32 noundef %111, i32 noundef %120)
  store ptr %121, ptr %7, align 8
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #2
  br label %174

122:                                              ; preds = %94
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %123

123:                                              ; preds = %153, %122
  %124 = load i32, ptr %14, align 4, !tbaa !9
  %125 = load i32, ptr @max_loaders, align 4, !tbaa !9
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %127, label %156

127:                                              ; preds = %123
  %128 = load i32, ptr %14, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [32 x ptr], ptr @loaders, i64 0, i64 %129
  %131 = load ptr, ptr %130, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.stbi_loader, ptr %131, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !11
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = load i32, ptr %9, align 4, !tbaa !9
  %136 = call i32 %133(ptr noundef %134, i32 noundef %135)
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %152

138:                                              ; preds = %127
  %139 = load i32, ptr %14, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [32 x ptr], ptr @loaders, i64 0, i64 %140
  %142 = load ptr, ptr %141, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.stbi_loader, ptr %142, i32 0, i32 1
  %144 = load ptr, ptr %143, align 8, !tbaa !13
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = load i32, ptr %9, align 4, !tbaa !9
  %147 = load ptr, ptr %10, align 8, !tbaa !5
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  %149 = load ptr, ptr %12, align 8, !tbaa !5
  %150 = load i32, ptr %13, align 4, !tbaa !9
  %151 = call ptr %144(ptr noundef %145, i32 noundef %146, ptr noundef %147, ptr noundef %148, ptr noundef %149, i32 noundef %150)
  store ptr %151, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %174

152:                                              ; preds = %127
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %14, align 4, !tbaa !9
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %14, align 4, !tbaa !9
  br label %123, !llvm.loop !14

156:                                              ; preds = %123
  %157 = load ptr, ptr %8, align 8, !tbaa !5
  %158 = load i32, ptr %9, align 4, !tbaa !9
  %159 = call i32 @stbi_tga_test_memory(ptr noundef %157, i32 noundef %158)
  %160 = icmp ne i32 %159, 0
  br i1 %160, label %161, label %169

161:                                              ; preds = %156
  %162 = load ptr, ptr %8, align 8, !tbaa !5
  %163 = load i32, ptr %9, align 4, !tbaa !9
  %164 = load ptr, ptr %10, align 8, !tbaa !5
  %165 = load ptr, ptr %11, align 8, !tbaa !5
  %166 = load ptr, ptr %12, align 8, !tbaa !5
  %167 = load i32, ptr %13, align 4, !tbaa !9
  %168 = call ptr @stbi_tga_load_from_memory(ptr noundef %162, i32 noundef %163, ptr noundef %164, ptr noundef %165, ptr noundef %166, i32 noundef %167)
  store ptr %168, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %174

169:                                              ; preds = %156
  %170 = call i32 @e(ptr noundef @.str.2)
  %171 = icmp ne i32 %170, 0
  %172 = zext i1 %171 to i64
  %173 = select i1 %171, ptr null, ptr null
  store ptr %173, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %174

174:                                              ; preds = %169, %161, %138, %119, %86, %73, %60, %47, %34, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #2
  %175 = load ptr, ptr %7, align 8
  ret ptr %175
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_jpeg_test_memory(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_jpeg_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_png_test_memory(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_png_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_bmp_test_memory(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_bmp_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_gif_test_memory(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_gif_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_psd_test_memory(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_psd_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_pic_test_memory(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_pic_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_hdr_test_memory(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_hdr_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_tga_test_memory(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_tga_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!13 = !{!12, !6, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@loaders = external dso_local local_unnamed_addr global [32 x ptr], align 16
@max_loaders = external hidden local_unnamed_addr global i32, align 4
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nounwind uwtable
declare hidden i32 @e(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden ptr @hdr_to_ldr(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local ptr @stbi_load_from_memory(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5) local_unnamed_addr #0 {
  %7 = tail call i32 @stbi_jpeg_test_memory(ptr noundef %0, i32 noundef %1)
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %10, label %8

8:                                                ; preds = %6
  %9 = tail call ptr @stbi_jpeg_load_from_memory(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5)
  br label %62

10:                                               ; preds = %6
  %11 = tail call i32 @stbi_png_test_memory(ptr noundef %0, i32 noundef %1)
  %.not84 = icmp eq i32 %11, 0
  br i1 %.not84, label %14, label %12

12:                                               ; preds = %10
  %13 = tail call ptr @stbi_png_load_from_memory(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5)
  br label %62

14:                                               ; preds = %10
  %15 = tail call i32 @stbi_bmp_test_memory(ptr noundef %0, i32 noundef %1)
  %.not85 = icmp eq i32 %15, 0
  br i1 %.not85, label %18, label %16

16:                                               ; preds = %14
  %17 = tail call ptr @stbi_bmp_load_from_memory(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5)
  br label %62

18:                                               ; preds = %14
  %19 = tail call i32 @stbi_gif_test_memory(ptr noundef %0, i32 noundef %1)
  %.not86 = icmp eq i32 %19, 0
  br i1 %.not86, label %22, label %20

20:                                               ; preds = %18
  %21 = tail call ptr @stbi_gif_load_from_memory(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5)
  br label %62

22:                                               ; preds = %18
  %23 = tail call i32 @stbi_psd_test_memory(ptr noundef %0, i32 noundef %1)
  %.not87 = icmp eq i32 %23, 0
  br i1 %.not87, label %26, label %24

24:                                               ; preds = %22
  %25 = tail call ptr @stbi_psd_load_from_memory(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5)
  br label %62

26:                                               ; preds = %22
  %27 = tail call i32 @stbi_pic_test_memory(ptr noundef %0, i32 noundef %1)
  %.not88 = icmp eq i32 %27, 0
  br i1 %.not88, label %30, label %28

28:                                               ; preds = %26
  %29 = tail call ptr @stbi_pic_load_from_memory(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5)
  br label %62

30:                                               ; preds = %26
  %31 = tail call i32 @stbi_hdr_test_memory(ptr noundef %0, i32 noundef %1)
  %.not89 = icmp eq i32 %31, 0
  br i1 %.not89, label %.preheader, label %34

.preheader:                                       ; preds = %30
  %32 = load i32, ptr @max_loaders, align 4, !tbaa !5
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph, label %._crit_edge

34:                                               ; preds = %30
  %35 = tail call ptr @stbi_hdr_load_from_memory(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5)
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %.not92 = icmp eq i32 %5, 0
  br i1 %.not92, label %38, label %40

38:                                               ; preds = %34
  %39 = load i32, ptr %4, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %34, %38
  %41 = phi i32 [ %39, %38 ], [ %5, %34 ]
  %42 = tail call ptr @hdr_to_ldr(ptr noundef %35, i32 noundef %36, i32 noundef %37, i32 noundef %41)
  br label %62

43:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %44 = load i32, ptr @max_loaders, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = icmp slt i64 %indvars.iv.next, %45
  br i1 %46, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader, %43
  %indvars.iv = phi i64 [ %indvars.iv.next, %43 ], [ 0, %.preheader ]
  %47 = getelementptr inbounds [32 x ptr], ptr @loaders, i64 0, i64 %indvars.iv
  %48 = load ptr, ptr %47, align 8, !tbaa !11
  %49 = load ptr, ptr %48, align 8, !tbaa !13
  %50 = tail call i32 %49(ptr noundef %0, i32 noundef %1) #1
  %.not91 = icmp eq i32 %50, 0
  br i1 %.not91, label %43, label %51

51:                                               ; preds = %.lr.ph
  %52 = getelementptr inbounds [32 x ptr], ptr @loaders, i64 0, i64 %indvars.iv
  %53 = load ptr, ptr %52, align 8, !tbaa !11
  %54 = getelementptr inbounds i8, ptr %53, i64 8
  %55 = load ptr, ptr %54, align 8, !tbaa !15
  %56 = tail call ptr %55(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5) #1
  br label %62

._crit_edge:                                      ; preds = %43, %.preheader
  %57 = tail call i32 @stbi_tga_test_memory(ptr noundef %0, i32 noundef %1)
  %.not90 = icmp eq i32 %57, 0
  br i1 %.not90, label %60, label %58

58:                                               ; preds = %._crit_edge
  %59 = tail call ptr @stbi_tga_load_from_memory(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5)
  br label %62

60:                                               ; preds = %._crit_edge
  %61 = tail call i32 @e(ptr noundef nonnull @.str.2)
  br label %62

62:                                               ; preds = %60, %58, %51, %40, %28, %24, %20, %16, %12, %8
  %.0 = phi ptr [ %9, %8 ], [ %13, %12 ], [ %17, %16 ], [ %21, %20 ], [ %25, %24 ], [ %29, %28 ], [ %42, %40 ], [ %56, %51 ], [ %59, %58 ], [ null, %60 ]
  ret ptr %.0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_jpeg_test_memory(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_jpeg_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_png_test_memory(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_png_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_bmp_test_memory(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_bmp_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_gif_test_memory(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_gif_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_psd_test_memory(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_psd_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_pic_test_memory(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_pic_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_hdr_test_memory(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_hdr_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @stbi_tga_test_memory(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_tga_load_from_memory(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!15 = !{!14, !12, i64 8}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass