; LLVM IR from TheNachoBIT/GeoFenix-Engine :: Libraries/SOIL2/include (SOIL2)

; 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"

@result_string_pointer = external dso_local global ptr, align 8
@.str.15 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_failure_reason() #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @SOIL_free_image_data(ptr noundef) #0

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @query_cubemap_capability() #0

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

; Function Attrs: nounwind uwtable
define dso_local i32 @SOIL_load_OGL_single_cubemap_from_memory(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) #0 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  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 i32 %3, ptr %11, align 4, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !9
  store i32 %5, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #2
  store i32 0, ptr %19, align 4, !tbaa !9
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %24

23:                                               ; preds = %6
  store ptr @.str.20, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %7, align 4
  store i32 1, ptr %20, align 4
  br label %160

24:                                               ; preds = %6
  %25 = load i32, ptr %13, align 4, !tbaa !9
  %26 = and i32 %25, 64
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %39

28:                                               ; preds = %24
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = load i32, ptr %12, align 4, !tbaa !9
  %32 = load i32, ptr %13, align 4, !tbaa !9
  %33 = call i32 @SOIL_direct_load_DDS_from_memory(ptr noundef %29, i32 noundef %30, i32 noundef %31, i32 noundef %32, i32 noundef 1)
  store i32 %33, ptr %19, align 4, !tbaa !9
  %34 = load i32, ptr %19, align 4, !tbaa !9
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %38

36:                                               ; preds = %28
  %37 = load i32, ptr %19, align 4, !tbaa !9
  store i32 %37, ptr %7, align 4
  store i32 1, ptr %20, align 4
  br label %160

38:                                               ; preds = %28
  br label %39

39:                                               ; preds = %38, %24
  %40 = load i32, ptr %13, align 4, !tbaa !9
  %41 = and i32 %40, 1024
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %54

43:                                               ; preds = %39
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = load i32, ptr %9, align 4, !tbaa !9
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = load i32, ptr %13, align 4, !tbaa !9
  %48 = call i32 @SOIL_direct_load_PVR_from_memory(ptr noundef %44, i32 noundef %45, i32 noundef %46, i32 noundef %47, i32 noundef 1)
  store i32 %48, ptr %19, align 4, !tbaa !9
  %49 = load i32, ptr %19, align 4, !tbaa !9
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %53

51:                                               ; preds = %43
  %52 = load i32, ptr %19, align 4, !tbaa !9
  store i32 %52, ptr %7, align 4
  store i32 1, ptr %20, align 4
  br label %160

53:                                               ; preds = %43
  br label %54

54:                                               ; preds = %53, %39
  %55 = load i32, ptr %13, align 4, !tbaa !9
  %56 = and i32 %55, 2048
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %54
  store i32 0, ptr %7, align 4
  store i32 1, ptr %20, align 4
  br label %160

59:                                               ; preds = %54
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %113, %59
  %61 = load i32, ptr %18, align 4, !tbaa !9
  %62 = icmp slt i32 %61, 6
  br i1 %62, label %63, label %116

63:                                               ; preds = %60
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = load i32, ptr %18, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i8, ptr %64, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !11
  %69 = sext i8 %68 to i32
  %70 = icmp ne i32 %69, 78
  br i1 %70, label %71, label %112

71:                                               ; preds = %63
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  %73 = load i32, ptr %18, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %72, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !11
  %77 = sext i8 %76 to i32
  %78 = icmp ne i32 %77, 83
  br i1 %78, label %79, label %112

79:                                               ; preds = %71
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = load i32, ptr %18, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i8, ptr %80, i64 %82
  %84 = load i8, ptr %83, align 1, !tbaa !11
  %85 = sext i8 %84 to i32
  %86 = icmp ne i32 %85, 87
  br i1 %86, label %87, label %112

87:                                               ; preds = %79
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = load i32, ptr %18, align 4, !tbaa !9
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i8, ptr %88, i64 %90
  %92 = load i8, ptr %91, align 1, !tbaa !11
  %93 = sext i8 %92 to i32
  %94 = icmp ne i32 %93, 69
  br i1 %94, label %95, label %112

95:                                               ; preds = %87
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = load i32, ptr %18, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds i8, ptr %96, i64 %98
  %100 = load i8, ptr %99, align 1, !tbaa !11
  %101 = sext i8 %100 to i32
  %102 = icmp ne i32 %101, 85
  br i1 %102, label %103, label %112

103:                                              ; preds = %95
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = load i32, ptr %18, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds i8, ptr %104, i64 %106
  %108 = load i8, ptr %107, align 1, !tbaa !11
  %109 = sext i8 %108 to i32
  %110 = icmp ne i32 %109, 68
  br i1 %110, label %111, label %112

111:                                              ; preds = %103
  store ptr @.str.18, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %7, align 4
  store i32 1, ptr %20, align 4
  br label %160

112:                                              ; preds = %103, %95, %87, %79, %71, %63
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %18, align 4, !tbaa !9
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %18, align 4, !tbaa !9
  br label %60, !llvm.loop !12

116:                                              ; preds = %60
  %117 = call i32 @query_cubemap_capability()
  %118 = icmp ne i32 %117, 1
  br i1 %118, label %119, label %120

119:                                              ; preds = %116
  store ptr @.str.15, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %7, align 4
  store i32 1, ptr %20, align 4
  br label %160

120:                                              ; preds = %116
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = load i32, ptr %9, align 4, !tbaa !9
  %123 = load i32, ptr %11, align 4, !tbaa !9
  %124 = call ptr @SOIL_load_image_from_memory(ptr noundef %121, i32 noundef %122, ptr noundef %15, ptr noundef %16, ptr noundef %17, i32 noundef %123)
  store ptr %124, ptr %14, align 8, !tbaa !5
  %125 = load i32, ptr %11, align 4, !tbaa !9
  %126 = icmp sge i32 %125, 1
  br i1 %126, label %127, label %132

127:                                              ; preds = %120
  %128 = load i32, ptr %11, align 4, !tbaa !9
  %129 = icmp sle i32 %128, 4
  br i1 %129, label %130, label %132

130:                                              ; preds = %127
  %131 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %131, ptr %17, align 4, !tbaa !9
  br label %132

132:                                              ; preds = %130, %127, %120
  %133 = load ptr, ptr %14, align 8, !tbaa !5
  %134 = icmp eq ptr null, %133
  br i1 %134, label %135, label %137

135:                                              ; preds = %132
  %136 = call ptr @stbi_failure_reason()
  store ptr %136, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %7, align 4
  store i32 1, ptr %20, align 4
  br label %160

137:                                              ; preds = %132
  %138 = load i32, ptr %15, align 4, !tbaa !9
  %139 = load i32, ptr %16, align 4, !tbaa !9
  %140 = mul nsw i32 6, %139
  %141 = icmp ne i32 %138, %140
  br i1 %141, label %142, label %149

142:                                              ; preds = %137
  %143 = load i32, ptr %15, align 4, !tbaa !9
  %144 = mul nsw i32 6, %143
  %145 = load i32, ptr %16, align 4, !tbaa !9
  %146 = icmp ne i32 %144, %145
  br i1 %146, label %147, label %149

147:                                              ; preds = %142
  %148 = load ptr, ptr %14, align 8, !tbaa !5
  call void @SOIL_free_image_data(ptr noundef %148)
  store ptr @.str.19, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %7, align 4
  store i32 1, ptr %20, align 4
  br label %160

149:                                              ; preds = %142, %137
  %150 = load ptr, ptr %14, align 8, !tbaa !5
  %151 = load i32, ptr %15, align 4, !tbaa !9
  %152 = load i32, ptr %16, align 4, !tbaa !9
  %153 = load i32, ptr %17, align 4, !tbaa !9
  %154 = load ptr, ptr %10, align 8, !tbaa !5
  %155 = load i32, ptr %12, align 4, !tbaa !9
  %156 = load i32, ptr %13, align 4, !tbaa !9
  %157 = call i32 @SOIL_create_OGL_single_cubemap(ptr noundef %150, i32 noundef %151, i32 noundef %152, i32 noundef %153, ptr noundef %154, i32 noundef %155, i32 noundef %156)
  store i32 %157, ptr %19, align 4, !tbaa !9
  %158 = load ptr, ptr %14, align 8, !tbaa !5
  call void @SOIL_free_image_data(ptr noundef %158)
  %159 = load i32, ptr %19, align 4, !tbaa !9
  store i32 %159, ptr %7, align 4
  store i32 1, ptr %20, align 4
  br label %160

160:                                              ; preds = %149, %147, %135, %119, %111, %58, %51, %36, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #2
  %161 = load i32, ptr %7, align 4
  ret i32 %161
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"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"

@result_string_pointer = external dso_local local_unnamed_addr global ptr, align 8
@.str.15 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @stbi_failure_reason() local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @SOIL_free_image_data(ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @SOIL_load_image_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 @query_cubemap_capability() local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local i32 @SOIL_load_OGL_single_cubemap_from_memory(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #0 {
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #2
  %10 = icmp eq ptr %0, null
  br i1 %10, label %11, label %12

11:                                               ; preds = %6
  store ptr @.str.20, ptr @result_string_pointer, align 8, !tbaa !5
  br label %54

12:                                               ; preds = %6
  %13 = and i32 %5, 64
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %16, label %14

14:                                               ; preds = %12
  %15 = tail call i32 @SOIL_direct_load_DDS_from_memory(ptr noundef nonnull %0, i32 noundef %1, i32 noundef %4, i32 noundef %5, i32 noundef 1)
  %.not53 = icmp eq i32 %15, 0
  br i1 %.not53, label %16, label %54

16:                                               ; preds = %14, %12
  %17 = and i32 %5, 1024
  %.not54 = icmp eq i32 %17, 0
  br i1 %.not54, label %20, label %18

18:                                               ; preds = %16
  %19 = tail call i32 @SOIL_direct_load_PVR_from_memory(ptr noundef nonnull %0, i32 noundef %1, i32 noundef %4, i32 noundef %5, i32 noundef 1)
  %.not55 = icmp eq i32 %19, 0
  br i1 %.not55, label %20, label %54

20:                                               ; preds = %18, %16
  %21 = and i32 %5, 2048
  %.not56 = icmp eq i32 %21, 0
  br i1 %.not56, label %.preheader.preheader, label %54

.preheader.preheader:                             ; preds = %20
  %22 = load i8, ptr %2, align 1, !tbaa !9
  switch i8 %22, label %23 [
    i8 78, label %.preheader.1
    i8 83, label %.preheader.1
    i8 87, label %.preheader.1
    i8 69, label %.preheader.1
    i8 85, label %.preheader.1
    i8 68, label %.preheader.1
  ]

23:                                               ; preds = %.preheader.5, %.preheader.4, %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  store ptr @.str.18, ptr @result_string_pointer, align 8, !tbaa !5
  br label %54

.preheader.1:                                     ; preds = %.preheader.preheader, %.preheader.preheader, %.preheader.preheader, %.preheader.preheader, %.preheader.preheader, %.preheader.preheader
  %24 = getelementptr inbounds i8, ptr %2, i64 1
  %25 = load i8, ptr %24, align 1, !tbaa !9
  switch i8 %25, label %23 [
    i8 78, label %.preheader.2
    i8 83, label %.preheader.2
    i8 87, label %.preheader.2
    i8 69, label %.preheader.2
    i8 85, label %.preheader.2
    i8 68, label %.preheader.2
  ]

.preheader.2:                                     ; preds = %.preheader.1, %.preheader.1, %.preheader.1, %.preheader.1, %.preheader.1, %.preheader.1
  %26 = getelementptr inbounds i8, ptr %2, i64 2
  %27 = load i8, ptr %26, align 1, !tbaa !9
  switch i8 %27, label %23 [
    i8 78, label %.preheader.3
    i8 83, label %.preheader.3
    i8 87, label %.preheader.3
    i8 69, label %.preheader.3
    i8 85, label %.preheader.3
    i8 68, label %.preheader.3
  ]

.preheader.3:                                     ; preds = %.preheader.2, %.preheader.2, %.preheader.2, %.preheader.2, %.preheader.2, %.preheader.2
  %28 = getelementptr inbounds i8, ptr %2, i64 3
  %29 = load i8, ptr %28, align 1, !tbaa !9
  switch i8 %29, label %23 [
    i8 78, label %.preheader.4
    i8 83, label %.preheader.4
    i8 87, label %.preheader.4
    i8 69, label %.preheader.4
    i8 85, label %.preheader.4
    i8 68, label %.preheader.4
  ]

.preheader.4:                                     ; preds = %.preheader.3, %.preheader.3, %.preheader.3, %.preheader.3, %.preheader.3, %.preheader.3
  %30 = getelementptr inbounds i8, ptr %2, i64 4
  %31 = load i8, ptr %30, align 1, !tbaa !9
  switch i8 %31, label %23 [
    i8 78, label %.preheader.5
    i8 83, label %.preheader.5
    i8 87, label %.preheader.5
    i8 69, label %.preheader.5
    i8 85, label %.preheader.5
    i8 68, label %.preheader.5
  ]

.preheader.5:                                     ; preds = %.preheader.4, %.preheader.4, %.preheader.4, %.preheader.4, %.preheader.4, %.preheader.4
  %32 = getelementptr inbounds i8, ptr %2, i64 5
  %33 = load i8, ptr %32, align 1, !tbaa !9
  switch i8 %33, label %23 [
    i8 78, label %34
    i8 83, label %34
    i8 87, label %34
    i8 69, label %34
    i8 85, label %34
    i8 68, label %34
  ]

34:                                               ; preds = %.preheader.5, %.preheader.5, %.preheader.5, %.preheader.5, %.preheader.5, %.preheader.5
  %35 = tail call i32 @query_cubemap_capability()
  %.not57 = icmp eq i32 %35, 1
  br i1 %.not57, label %37, label %36

36:                                               ; preds = %34
  store ptr @.str.15, ptr @result_string_pointer, align 8, !tbaa !5
  br label %54

37:                                               ; preds = %34
  %38 = call ptr @SOIL_load_image_from_memory(ptr noundef nonnull %0, i32 noundef %1, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, i32 noundef %3)
  %39 = add i32 %3, -1
  %or.cond = icmp ult i32 %39, 4
  br i1 %or.cond, label %40, label %41

40:                                               ; preds = %37
  store i32 %3, ptr %9, align 4, !tbaa !10
  br label %41

41:                                               ; preds = %40, %37
  %42 = icmp eq ptr %38, null
  br i1 %42, label %43, label %45

43:                                               ; preds = %41
  %44 = call ptr @stbi_failure_reason()
  store ptr %44, ptr @result_string_pointer, align 8, !tbaa !5
  br label %54

45:                                               ; preds = %41
  %46 = load i32, ptr %7, align 4, !tbaa !10
  %47 = load i32, ptr %8, align 4, !tbaa !10
  %48 = mul nsw i32 %47, 6
  %.not58 = icmp eq i32 %46, %48
  %49 = mul nsw i32 %46, 6
  %.not59 = icmp eq i32 %49, %47
  %or.cond66 = select i1 %.not58, i1 true, i1 %.not59
  br i1 %or.cond66, label %51, label %50

50:                                               ; preds = %45
  call void @SOIL_free_image_data(ptr noundef nonnull %38)
  store ptr @.str.19, ptr @result_string_pointer, align 8, !tbaa !5
  br label %54

51:                                               ; preds = %45
  %52 = load i32, ptr %9, align 4, !tbaa !10
  %53 = call i32 @SOIL_create_OGL_single_cubemap(ptr noundef nonnull %38, i32 noundef %46, i32 noundef %47, i32 noundef %52, ptr noundef nonnull %2, i32 noundef %4, i32 noundef %5)
  call void @SOIL_free_image_data(ptr noundef nonnull %38)
  br label %54

54:                                               ; preds = %20, %18, %14, %51, %50, %43, %36, %23, %11
  %.045 = phi i32 [ 0, %11 ], [ 0, %23 ], [ 0, %36 ], [ 0, %43 ], [ 0, %50 ], [ %53, %51 ], [ %15, %14 ], [ %19, %18 ], [ 0, %20 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #2
  ret i32 %.045
}

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass,TailCallElimPass