; 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.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = 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 ptr @SOIL_load_image(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #0

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

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

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

28:                                               ; preds = %9
  %29 = load ptr, ptr %12, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %43, label %31

31:                                               ; preds = %28
  %32 = load ptr, ptr %13, align 8, !tbaa !5
  %33 = icmp eq ptr %32, null
  br i1 %33, label %43, label %34

34:                                               ; preds = %31
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  %36 = icmp eq ptr %35, null
  br i1 %36, label %43, label %37

37:                                               ; preds = %34
  %38 = load ptr, ptr %15, align 8, !tbaa !5
  %39 = icmp eq ptr %38, null
  br i1 %39, label %43, label %40

40:                                               ; preds = %37
  %41 = load ptr, ptr %16, align 8, !tbaa !5
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %44

43:                                               ; preds = %40, %37, %34, %31, %28, %9
  store ptr @.str.14, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %202

44:                                               ; preds = %40
  %45 = call i32 @query_cubemap_capability()
  %46 = icmp ne i32 %45, 1
  br i1 %46, label %47, label %48

47:                                               ; preds = %44
  store ptr @.str.15, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %202

48:                                               ; preds = %44
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = load i32, ptr %17, align 4, !tbaa !9
  %51 = call ptr @SOIL_load_image(ptr noundef %49, ptr noundef %21, ptr noundef %22, ptr noundef %23, i32 noundef %50)
  store ptr %51, ptr %20, align 8, !tbaa !5
  %52 = load i32, ptr %17, align 4, !tbaa !9
  %53 = icmp sge i32 %52, 1
  br i1 %53, label %54, label %59

54:                                               ; preds = %48
  %55 = load i32, ptr %17, align 4, !tbaa !9
  %56 = icmp sle i32 %55, 4
  br i1 %56, label %57, label %59

57:                                               ; preds = %54
  %58 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %58, ptr %23, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %57, %54, %48
  %60 = load ptr, ptr %20, align 8, !tbaa !5
  %61 = icmp eq ptr null, %60
  br i1 %61, label %62, label %64

62:                                               ; preds = %59
  %63 = call ptr @stbi_failure_reason()
  store ptr %63, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %202

64:                                               ; preds = %59
  %65 = load ptr, ptr %20, align 8, !tbaa !5
  %66 = load i32, ptr %23, align 4, !tbaa !9
  %67 = load i32, ptr %18, align 4, !tbaa !9
  %68 = load i32, ptr %19, align 4, !tbaa !9
  %69 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef %65, ptr noundef %21, ptr noundef %22, i32 noundef %66, i32 noundef %67, i32 noundef %68, i32 noundef 34067, i32 noundef 34069, i32 noundef 34076)
  store i32 %69, ptr %24, align 4, !tbaa !9
  %70 = load ptr, ptr %20, align 8, !tbaa !5
  call void @SOIL_free_image_data(ptr noundef %70)
  %71 = load i32, ptr %24, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %96

73:                                               ; preds = %64
  %74 = load ptr, ptr %12, align 8, !tbaa !5
  %75 = load i32, ptr %17, align 4, !tbaa !9
  %76 = call ptr @SOIL_load_image(ptr noundef %74, ptr noundef %21, ptr noundef %22, ptr noundef %23, i32 noundef %75)
  store ptr %76, ptr %20, align 8, !tbaa !5
  %77 = load i32, ptr %17, align 4, !tbaa !9
  %78 = icmp sge i32 %77, 1
  br i1 %78, label %79, label %84

79:                                               ; preds = %73
  %80 = load i32, ptr %17, align 4, !tbaa !9
  %81 = icmp sle i32 %80, 4
  br i1 %81, label %82, label %84

82:                                               ; preds = %79
  %83 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %83, ptr %23, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %82, %79, %73
  %85 = load ptr, ptr %20, align 8, !tbaa !5
  %86 = icmp eq ptr null, %85
  br i1 %86, label %87, label %89

87:                                               ; preds = %84
  %88 = call ptr @stbi_failure_reason()
  store ptr %88, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %202

89:                                               ; preds = %84
  %90 = load ptr, ptr %20, align 8, !tbaa !5
  %91 = load i32, ptr %23, align 4, !tbaa !9
  %92 = load i32, ptr %24, align 4, !tbaa !9
  %93 = load i32, ptr %19, align 4, !tbaa !9
  %94 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef %90, ptr noundef %21, ptr noundef %22, i32 noundef %91, i32 noundef %92, i32 noundef %93, i32 noundef 34067, i32 noundef 34070, i32 noundef 34076)
  store i32 %94, ptr %24, align 4, !tbaa !9
  %95 = load ptr, ptr %20, align 8, !tbaa !5
  call void @SOIL_free_image_data(ptr noundef %95)
  br label %96

96:                                               ; preds = %89, %64
  %97 = load i32, ptr %24, align 4, !tbaa !9
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %122

99:                                               ; preds = %96
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = load i32, ptr %17, align 4, !tbaa !9
  %102 = call ptr @SOIL_load_image(ptr noundef %100, ptr noundef %21, ptr noundef %22, ptr noundef %23, i32 noundef %101)
  store ptr %102, ptr %20, align 8, !tbaa !5
  %103 = load i32, ptr %17, align 4, !tbaa !9
  %104 = icmp sge i32 %103, 1
  br i1 %104, label %105, label %110

105:                                              ; preds = %99
  %106 = load i32, ptr %17, align 4, !tbaa !9
  %107 = icmp sle i32 %106, 4
  br i1 %107, label %108, label %110

108:                                              ; preds = %105
  %109 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %109, ptr %23, align 4, !tbaa !9
  br label %110

110:                                              ; preds = %108, %105, %99
  %111 = load ptr, ptr %20, align 8, !tbaa !5
  %112 = icmp eq ptr null, %111
  br i1 %112, label %113, label %115

113:                                              ; preds = %110
  %114 = call ptr @stbi_failure_reason()
  store ptr %114, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %202

115:                                              ; preds = %110
  %116 = load ptr, ptr %20, align 8, !tbaa !5
  %117 = load i32, ptr %23, align 4, !tbaa !9
  %118 = load i32, ptr %24, align 4, !tbaa !9
  %119 = load i32, ptr %19, align 4, !tbaa !9
  %120 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef %116, ptr noundef %21, ptr noundef %22, i32 noundef %117, i32 noundef %118, i32 noundef %119, i32 noundef 34067, i32 noundef 34071, i32 noundef 34076)
  store i32 %120, ptr %24, align 4, !tbaa !9
  %121 = load ptr, ptr %20, align 8, !tbaa !5
  call void @SOIL_free_image_data(ptr noundef %121)
  br label %122

122:                                              ; preds = %115, %96
  %123 = load i32, ptr %24, align 4, !tbaa !9
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %148

125:                                              ; preds = %122
  %126 = load ptr, ptr %14, align 8, !tbaa !5
  %127 = load i32, ptr %17, align 4, !tbaa !9
  %128 = call ptr @SOIL_load_image(ptr noundef %126, ptr noundef %21, ptr noundef %22, ptr noundef %23, i32 noundef %127)
  store ptr %128, ptr %20, align 8, !tbaa !5
  %129 = load i32, ptr %17, align 4, !tbaa !9
  %130 = icmp sge i32 %129, 1
  br i1 %130, label %131, label %136

131:                                              ; preds = %125
  %132 = load i32, ptr %17, align 4, !tbaa !9
  %133 = icmp sle i32 %132, 4
  br i1 %133, label %134, label %136

134:                                              ; preds = %131
  %135 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %135, ptr %23, align 4, !tbaa !9
  br label %136

136:                                              ; preds = %134, %131, %125
  %137 = load ptr, ptr %20, align 8, !tbaa !5
  %138 = icmp eq ptr null, %137
  br i1 %138, label %139, label %141

139:                                              ; preds = %136
  %140 = call ptr @stbi_failure_reason()
  store ptr %140, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %202

141:                                              ; preds = %136
  %142 = load ptr, ptr %20, align 8, !tbaa !5
  %143 = load i32, ptr %23, align 4, !tbaa !9
  %144 = load i32, ptr %24, align 4, !tbaa !9
  %145 = load i32, ptr %19, align 4, !tbaa !9
  %146 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef %142, ptr noundef %21, ptr noundef %22, i32 noundef %143, i32 noundef %144, i32 noundef %145, i32 noundef 34067, i32 noundef 34072, i32 noundef 34076)
  store i32 %146, ptr %24, align 4, !tbaa !9
  %147 = load ptr, ptr %20, align 8, !tbaa !5
  call void @SOIL_free_image_data(ptr noundef %147)
  br label %148

148:                                              ; preds = %141, %122
  %149 = load i32, ptr %24, align 4, !tbaa !9
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %174

151:                                              ; preds = %148
  %152 = load ptr, ptr %15, align 8, !tbaa !5
  %153 = load i32, ptr %17, align 4, !tbaa !9
  %154 = call ptr @SOIL_load_image(ptr noundef %152, ptr noundef %21, ptr noundef %22, ptr noundef %23, i32 noundef %153)
  store ptr %154, ptr %20, align 8, !tbaa !5
  %155 = load i32, ptr %17, align 4, !tbaa !9
  %156 = icmp sge i32 %155, 1
  br i1 %156, label %157, label %162

157:                                              ; preds = %151
  %158 = load i32, ptr %17, align 4, !tbaa !9
  %159 = icmp sle i32 %158, 4
  br i1 %159, label %160, label %162

160:                                              ; preds = %157
  %161 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %161, ptr %23, align 4, !tbaa !9
  br label %162

162:                                              ; preds = %160, %157, %151
  %163 = load ptr, ptr %20, align 8, !tbaa !5
  %164 = icmp eq ptr null, %163
  br i1 %164, label %165, label %167

165:                                              ; preds = %162
  %166 = call ptr @stbi_failure_reason()
  store ptr %166, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %202

167:                                              ; preds = %162
  %168 = load ptr, ptr %20, align 8, !tbaa !5
  %169 = load i32, ptr %23, align 4, !tbaa !9
  %170 = load i32, ptr %24, align 4, !tbaa !9
  %171 = load i32, ptr %19, align 4, !tbaa !9
  %172 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef %168, ptr noundef %21, ptr noundef %22, i32 noundef %169, i32 noundef %170, i32 noundef %171, i32 noundef 34067, i32 noundef 34073, i32 noundef 34076)
  store i32 %172, ptr %24, align 4, !tbaa !9
  %173 = load ptr, ptr %20, align 8, !tbaa !5
  call void @SOIL_free_image_data(ptr noundef %173)
  br label %174

174:                                              ; preds = %167, %148
  %175 = load i32, ptr %24, align 4, !tbaa !9
  %176 = icmp ne i32 %175, 0
  br i1 %176, label %177, label %200

177:                                              ; preds = %174
  %178 = load ptr, ptr %16, align 8, !tbaa !5
  %179 = load i32, ptr %17, align 4, !tbaa !9
  %180 = call ptr @SOIL_load_image(ptr noundef %178, ptr noundef %21, ptr noundef %22, ptr noundef %23, i32 noundef %179)
  store ptr %180, ptr %20, align 8, !tbaa !5
  %181 = load i32, ptr %17, align 4, !tbaa !9
  %182 = icmp sge i32 %181, 1
  br i1 %182, label %183, label %188

183:                                              ; preds = %177
  %184 = load i32, ptr %17, align 4, !tbaa !9
  %185 = icmp sle i32 %184, 4
  br i1 %185, label %186, label %188

186:                                              ; preds = %183
  %187 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %187, ptr %23, align 4, !tbaa !9
  br label %188

188:                                              ; preds = %186, %183, %177
  %189 = load ptr, ptr %20, align 8, !tbaa !5
  %190 = icmp eq ptr null, %189
  br i1 %190, label %191, label %193

191:                                              ; preds = %188
  %192 = call ptr @stbi_failure_reason()
  store ptr %192, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %202

193:                                              ; preds = %188
  %194 = load ptr, ptr %20, align 8, !tbaa !5
  %195 = load i32, ptr %23, align 4, !tbaa !9
  %196 = load i32, ptr %24, align 4, !tbaa !9
  %197 = load i32, ptr %19, align 4, !tbaa !9
  %198 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef %194, ptr noundef %21, ptr noundef %22, i32 noundef %195, i32 noundef %196, i32 noundef %197, i32 noundef 34067, i32 noundef 34074, i32 noundef 34076)
  store i32 %198, ptr %24, align 4, !tbaa !9
  %199 = load ptr, ptr %20, align 8, !tbaa !5
  call void @SOIL_free_image_data(ptr noundef %199)
  br label %200

200:                                              ; preds = %193, %174
  %201 = load i32, ptr %24, align 4, !tbaa !9
  store i32 %201, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %202

202:                                              ; preds = %200, %191, %165, %139, %113, %87, %62, %47, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #2
  %203 = load i32, ptr %10, align 4
  ret i32 %203
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @query_cubemap_capability() #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 = { 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}


; 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.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = 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 ptr @SOIL_load_image(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @SOIL_load_OGL_cubemap(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8) local_unnamed_addr #0 {
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #2
  %13 = insertelement <4 x ptr> poison, ptr %0, i64 0
  %14 = insertelement <4 x ptr> %13, ptr %1, i64 1
  %15 = insertelement <4 x ptr> %14, ptr %2, i64 2
  %16 = insertelement <4 x ptr> %15, ptr %3, i64 3
  %17 = icmp eq <4 x ptr> %16, zeroinitializer
  %18 = icmp eq ptr %4, null
  %19 = icmp eq ptr %5, null
  %20 = bitcast <4 x i1> %17 to i4
  %21 = icmp ne i4 %20, 0
  %op.rdx = or i1 %21, %18
  %op.rdx126 = or i1 %op.rdx, %19
  br i1 %op.rdx126, label %22, label %23

22:                                               ; preds = %9
  store ptr @.str.14, ptr @result_string_pointer, align 8, !tbaa !5
  br label %.thread123

23:                                               ; preds = %9
  %24 = tail call i32 @query_cubemap_capability()
  %.not = icmp eq i32 %24, 1
  br i1 %.not, label %26, label %25

25:                                               ; preds = %23
  store ptr @.str.15, ptr @result_string_pointer, align 8, !tbaa !5
  br label %.thread123

26:                                               ; preds = %23
  %27 = call ptr @SOIL_load_image(ptr noundef nonnull %0, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12, i32 noundef %6)
  %28 = add i32 %6, -1
  %or.cond11 = icmp ult i32 %28, 4
  br i1 %or.cond11, label %29, label %30

29:                                               ; preds = %26
  store i32 %6, ptr %12, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %29, %26
  %31 = icmp eq ptr %27, null
  br i1 %31, label %32, label %34

32:                                               ; preds = %30
  %33 = call ptr @stbi_failure_reason()
  store ptr %33, ptr @result_string_pointer, align 8, !tbaa !5
  br label %.thread123

34:                                               ; preds = %30
  %35 = load i32, ptr %12, align 4, !tbaa !9
  %36 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef nonnull %27, ptr noundef nonnull %10, ptr noundef nonnull %11, i32 noundef %35, i32 noundef %7, i32 noundef %8, i32 noundef 34067, i32 noundef 34069, i32 noundef 34076)
  call void @SOIL_free_image_data(ptr noundef nonnull %27)
  %.not108 = icmp eq i32 %36, 0
  br i1 %.not108, label %.thread123, label %37

37:                                               ; preds = %34
  %38 = call ptr @SOIL_load_image(ptr noundef nonnull %1, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12, i32 noundef %6)
  br i1 %or.cond11, label %39, label %40

39:                                               ; preds = %37
  store i32 %6, ptr %12, align 4, !tbaa !9
  br label %40

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

42:                                               ; preds = %40
  %43 = call ptr @stbi_failure_reason()
  store ptr %43, ptr @result_string_pointer, align 8, !tbaa !5
  br label %.thread123

44:                                               ; preds = %40
  %45 = load i32, ptr %12, align 4, !tbaa !9
  %46 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef nonnull %38, ptr noundef nonnull %10, ptr noundef nonnull %11, i32 noundef %45, i32 noundef %36, i32 noundef %8, i32 noundef 34067, i32 noundef 34070, i32 noundef 34076)
  call void @SOIL_free_image_data(ptr noundef nonnull %38)
  %.not109 = icmp eq i32 %46, 0
  br i1 %.not109, label %.thread123, label %47

47:                                               ; preds = %44
  %48 = call ptr @SOIL_load_image(ptr noundef nonnull %2, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12, i32 noundef %6)
  br i1 %or.cond11, label %49, label %50

49:                                               ; preds = %47
  store i32 %6, ptr %12, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %49, %47
  %51 = icmp eq ptr %48, null
  br i1 %51, label %52, label %54

52:                                               ; preds = %50
  %53 = call ptr @stbi_failure_reason()
  store ptr %53, ptr @result_string_pointer, align 8, !tbaa !5
  br label %.thread123

54:                                               ; preds = %50
  %55 = load i32, ptr %12, align 4, !tbaa !9
  %56 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef nonnull %48, ptr noundef nonnull %10, ptr noundef nonnull %11, i32 noundef %55, i32 noundef %46, i32 noundef %8, i32 noundef 34067, i32 noundef 34071, i32 noundef 34076)
  call void @SOIL_free_image_data(ptr noundef nonnull %48)
  %.not110 = icmp eq i32 %56, 0
  br i1 %.not110, label %.thread123, label %57

57:                                               ; preds = %54
  %58 = call ptr @SOIL_load_image(ptr noundef nonnull %3, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12, i32 noundef %6)
  br i1 %or.cond11, label %59, label %60

59:                                               ; preds = %57
  store i32 %6, ptr %12, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %59, %57
  %61 = icmp eq ptr %58, null
  br i1 %61, label %62, label %64

62:                                               ; preds = %60
  %63 = call ptr @stbi_failure_reason()
  store ptr %63, ptr @result_string_pointer, align 8, !tbaa !5
  br label %.thread123

64:                                               ; preds = %60
  %65 = load i32, ptr %12, align 4, !tbaa !9
  %66 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef nonnull %58, ptr noundef nonnull %10, ptr noundef nonnull %11, i32 noundef %65, i32 noundef %56, i32 noundef %8, i32 noundef 34067, i32 noundef 34072, i32 noundef 34076)
  call void @SOIL_free_image_data(ptr noundef nonnull %58)
  %.not111 = icmp eq i32 %66, 0
  br i1 %.not111, label %.thread123, label %67

67:                                               ; preds = %64
  %68 = call ptr @SOIL_load_image(ptr noundef nonnull %4, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12, i32 noundef %6)
  br i1 %or.cond11, label %69, label %70

69:                                               ; preds = %67
  store i32 %6, ptr %12, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %69, %67
  %71 = icmp eq ptr %68, null
  br i1 %71, label %72, label %74

72:                                               ; preds = %70
  %73 = call ptr @stbi_failure_reason()
  store ptr %73, ptr @result_string_pointer, align 8, !tbaa !5
  br label %.thread123

74:                                               ; preds = %70
  %75 = load i32, ptr %12, align 4, !tbaa !9
  %76 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef nonnull %68, ptr noundef nonnull %10, ptr noundef nonnull %11, i32 noundef %75, i32 noundef %66, i32 noundef %8, i32 noundef 34067, i32 noundef 34073, i32 noundef 34076)
  call void @SOIL_free_image_data(ptr noundef nonnull %68)
  %.not112 = icmp eq i32 %76, 0
  br i1 %.not112, label %.thread123, label %77

77:                                               ; preds = %74
  %78 = call ptr @SOIL_load_image(ptr noundef nonnull %5, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12, i32 noundef %6)
  br i1 %or.cond11, label %79, label %80

79:                                               ; preds = %77
  store i32 %6, ptr %12, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %79, %77
  %81 = icmp eq ptr %78, null
  br i1 %81, label %82, label %84

82:                                               ; preds = %80
  %83 = call ptr @stbi_failure_reason()
  store ptr %83, ptr @result_string_pointer, align 8, !tbaa !5
  br label %.thread123

84:                                               ; preds = %80
  %85 = load i32, ptr %12, align 4, !tbaa !9
  %86 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef nonnull %78, ptr noundef nonnull %10, ptr noundef nonnull %11, i32 noundef %85, i32 noundef %76, i32 noundef %8, i32 noundef 34067, i32 noundef 34074, i32 noundef 34076)
  call void @SOIL_free_image_data(ptr noundef nonnull %78)
  br label %.thread123

.thread123:                                       ; preds = %34, %44, %54, %64, %74, %84, %82, %72, %62, %52, %42, %32, %25, %22
  %.093 = phi i32 [ 0, %22 ], [ 0, %25 ], [ 0, %32 ], [ 0, %42 ], [ 0, %52 ], [ 0, %62 ], [ 0, %72 ], [ 0, %82 ], [ %86, %84 ], [ 0, %74 ], [ 0, %64 ], [ 0, %54 ], [ 0, %44 ], [ 0, %34 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #2
  ret i32 %.093
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @query_cubemap_capability() 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 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass