; LLVM IR from steps3d/graphics-book :: Code/Libs/SOIL (SOIL)

; 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.2 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 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: nounwind uwtable
declare dso_local ptr @SOIL_load_image(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

declare ptr @stbi_failure_reason() #2

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

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

; 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
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) #1 {
  %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) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  %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.2, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %214

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.3, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %214

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 %214

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

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

81:                                               ; preds = %75
  %82 = load i32, ptr %17, align 4, !tbaa !9
  %83 = icmp sle i32 %82, 4
  br i1 %83, label %84, label %86

84:                                               ; preds = %81
  %85 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %85, ptr %23, align 4, !tbaa !9
  br label %86

86:                                               ; preds = %84, %81, %75
  %87 = load ptr, ptr %20, align 8, !tbaa !5
  %88 = icmp eq ptr null, %87
  br i1 %88, label %89, label %91

89:                                               ; preds = %86
  %90 = call ptr @stbi_failure_reason()
  store ptr %90, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %214

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

100:                                              ; preds = %91, %64
  %101 = load i32, ptr %24, align 4, !tbaa !9
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %128

103:                                              ; preds = %100
  %104 = load ptr, ptr %13, align 8, !tbaa !5
  %105 = load i32, ptr %17, align 4, !tbaa !9
  %106 = call ptr @SOIL_load_image(ptr noundef %104, ptr noundef %21, ptr noundef %22, ptr noundef %23, i32 noundef %105)
  store ptr %106, ptr %20, align 8, !tbaa !5
  %107 = load i32, ptr %17, align 4, !tbaa !9
  %108 = icmp sge i32 %107, 1
  br i1 %108, label %109, label %114

109:                                              ; preds = %103
  %110 = load i32, ptr %17, align 4, !tbaa !9
  %111 = icmp sle i32 %110, 4
  br i1 %111, label %112, label %114

112:                                              ; preds = %109
  %113 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %113, ptr %23, align 4, !tbaa !9
  br label %114

114:                                              ; preds = %112, %109, %103
  %115 = load ptr, ptr %20, align 8, !tbaa !5
  %116 = icmp eq ptr null, %115
  br i1 %116, label %117, label %119

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

119:                                              ; preds = %114
  %120 = load ptr, ptr %20, align 8, !tbaa !5
  %121 = load i32, ptr %21, align 4, !tbaa !9
  %122 = load i32, ptr %22, align 4, !tbaa !9
  %123 = load i32, ptr %23, align 4, !tbaa !9
  %124 = load i32, ptr %24, align 4, !tbaa !9
  %125 = load i32, ptr %19, align 4, !tbaa !9
  %126 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef %120, i32 noundef %121, i32 noundef %122, i32 noundef %123, i32 noundef %124, i32 noundef %125, i32 noundef 34067, i32 noundef 34071, i32 noundef 34076)
  store i32 %126, ptr %24, align 4, !tbaa !9
  %127 = load ptr, ptr %20, align 8, !tbaa !5
  call void @SOIL_free_image_data(ptr noundef %127)
  br label %128

128:                                              ; preds = %119, %100
  %129 = load i32, ptr %24, align 4, !tbaa !9
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %156

131:                                              ; preds = %128
  %132 = load ptr, ptr %14, align 8, !tbaa !5
  %133 = load i32, ptr %17, align 4, !tbaa !9
  %134 = call ptr @SOIL_load_image(ptr noundef %132, ptr noundef %21, ptr noundef %22, ptr noundef %23, i32 noundef %133)
  store ptr %134, ptr %20, align 8, !tbaa !5
  %135 = load i32, ptr %17, align 4, !tbaa !9
  %136 = icmp sge i32 %135, 1
  br i1 %136, label %137, label %142

137:                                              ; preds = %131
  %138 = load i32, ptr %17, align 4, !tbaa !9
  %139 = icmp sle i32 %138, 4
  br i1 %139, label %140, label %142

140:                                              ; preds = %137
  %141 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %141, ptr %23, align 4, !tbaa !9
  br label %142

142:                                              ; preds = %140, %137, %131
  %143 = load ptr, ptr %20, align 8, !tbaa !5
  %144 = icmp eq ptr null, %143
  br i1 %144, label %145, label %147

145:                                              ; preds = %142
  %146 = call ptr @stbi_failure_reason()
  store ptr %146, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %214

147:                                              ; preds = %142
  %148 = load ptr, ptr %20, align 8, !tbaa !5
  %149 = load i32, ptr %21, align 4, !tbaa !9
  %150 = load i32, ptr %22, align 4, !tbaa !9
  %151 = load i32, ptr %23, align 4, !tbaa !9
  %152 = load i32, ptr %24, align 4, !tbaa !9
  %153 = load i32, ptr %19, align 4, !tbaa !9
  %154 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef %148, i32 noundef %149, i32 noundef %150, i32 noundef %151, i32 noundef %152, i32 noundef %153, i32 noundef 34067, i32 noundef 34072, i32 noundef 34076)
  store i32 %154, ptr %24, align 4, !tbaa !9
  %155 = load ptr, ptr %20, align 8, !tbaa !5
  call void @SOIL_free_image_data(ptr noundef %155)
  br label %156

156:                                              ; preds = %147, %128
  %157 = load i32, ptr %24, align 4, !tbaa !9
  %158 = icmp ne i32 %157, 0
  br i1 %158, label %159, label %184

159:                                              ; preds = %156
  %160 = load ptr, ptr %15, align 8, !tbaa !5
  %161 = load i32, ptr %17, align 4, !tbaa !9
  %162 = call ptr @SOIL_load_image(ptr noundef %160, ptr noundef %21, ptr noundef %22, ptr noundef %23, i32 noundef %161)
  store ptr %162, ptr %20, align 8, !tbaa !5
  %163 = load i32, ptr %17, align 4, !tbaa !9
  %164 = icmp sge i32 %163, 1
  br i1 %164, label %165, label %170

165:                                              ; preds = %159
  %166 = load i32, ptr %17, align 4, !tbaa !9
  %167 = icmp sle i32 %166, 4
  br i1 %167, label %168, label %170

168:                                              ; preds = %165
  %169 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %169, ptr %23, align 4, !tbaa !9
  br label %170

170:                                              ; preds = %168, %165, %159
  %171 = load ptr, ptr %20, align 8, !tbaa !5
  %172 = icmp eq ptr null, %171
  br i1 %172, label %173, label %175

173:                                              ; preds = %170
  %174 = call ptr @stbi_failure_reason()
  store ptr %174, ptr @result_string_pointer, align 8, !tbaa !5
  store i32 0, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %214

175:                                              ; preds = %170
  %176 = load ptr, ptr %20, align 8, !tbaa !5
  %177 = load i32, ptr %21, align 4, !tbaa !9
  %178 = load i32, ptr %22, align 4, !tbaa !9
  %179 = load i32, ptr %23, align 4, !tbaa !9
  %180 = load i32, ptr %24, align 4, !tbaa !9
  %181 = load i32, ptr %19, align 4, !tbaa !9
  %182 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef %176, i32 noundef %177, i32 noundef %178, i32 noundef %179, i32 noundef %180, i32 noundef %181, i32 noundef 34067, i32 noundef 34073, i32 noundef 34076)
  store i32 %182, ptr %24, align 4, !tbaa !9
  %183 = load ptr, ptr %20, align 8, !tbaa !5
  call void @SOIL_free_image_data(ptr noundef %183)
  br label %184

184:                                              ; preds = %175, %156
  %185 = load i32, ptr %24, align 4, !tbaa !9
  %186 = icmp ne i32 %185, 0
  br i1 %186, label %187, label %212

187:                                              ; preds = %184
  %188 = load ptr, ptr %16, align 8, !tbaa !5
  %189 = load i32, ptr %17, align 4, !tbaa !9
  %190 = call ptr @SOIL_load_image(ptr noundef %188, ptr noundef %21, ptr noundef %22, ptr noundef %23, i32 noundef %189)
  store ptr %190, ptr %20, align 8, !tbaa !5
  %191 = load i32, ptr %17, align 4, !tbaa !9
  %192 = icmp sge i32 %191, 1
  br i1 %192, label %193, label %198

193:                                              ; preds = %187
  %194 = load i32, ptr %17, align 4, !tbaa !9
  %195 = icmp sle i32 %194, 4
  br i1 %195, label %196, label %198

196:                                              ; preds = %193
  %197 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %197, ptr %23, align 4, !tbaa !9
  br label %198

198:                                              ; preds = %196, %193, %187
  %199 = load ptr, ptr %20, align 8, !tbaa !5
  %200 = icmp eq ptr null, %199
  br i1 %200, label %201, label %203

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

203:                                              ; preds = %198
  %204 = load ptr, ptr %20, align 8, !tbaa !5
  %205 = load i32, ptr %21, align 4, !tbaa !9
  %206 = load i32, ptr %22, align 4, !tbaa !9
  %207 = load i32, ptr %23, align 4, !tbaa !9
  %208 = load i32, ptr %24, align 4, !tbaa !9
  %209 = load i32, ptr %19, align 4, !tbaa !9
  %210 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef %204, i32 noundef %205, i32 noundef %206, i32 noundef %207, i32 noundef %208, i32 noundef %209, i32 noundef 34067, i32 noundef 34074, i32 noundef 34076)
  store i32 %210, ptr %24, align 4, !tbaa !9
  %211 = load ptr, ptr %20, align 8, !tbaa !5
  call void @SOIL_free_image_data(ptr noundef %211)
  br label %212

212:                                              ; preds = %203, %184
  %213 = load i32, ptr %24, align 4, !tbaa !9
  store i32 %213, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %214

214:                                              ; preds = %212, %201, %173, %145, %117, %89, %62, %47, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  %215 = load i32, ptr %10, align 4
  ret i32 %215
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @query_cubemap_capability() #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 = { "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 #3 = { 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.2 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1

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

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

declare ptr @stbi_failure_reason() local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 #1 {
  %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) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #3
  %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.2, 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.3, 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() #3
  store ptr %33, ptr @result_string_pointer, align 8, !tbaa !5
  br label %.thread123

34:                                               ; preds = %30
  %35 = load i32, ptr %10, align 4, !tbaa !9
  %36 = load i32, ptr %11, align 4, !tbaa !9
  %37 = load i32, ptr %12, align 4, !tbaa !9
  %38 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef nonnull %27, i32 noundef %35, i32 noundef %36, i32 noundef %37, 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 %38, 0
  br i1 %.not108, label %.thread123, label %39

39:                                               ; preds = %34
  %40 = 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 %41, label %42

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

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

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

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

51:                                               ; preds = %46
  %52 = 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 %53, label %54

53:                                               ; preds = %51
  store i32 %6, ptr %12, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %53, %51
  %55 = icmp eq ptr %52, null
  br i1 %55, label %56, label %58

56:                                               ; preds = %54
  %57 = call ptr @stbi_failure_reason() #3
  store ptr %57, ptr @result_string_pointer, align 8, !tbaa !5
  br label %.thread123

58:                                               ; preds = %54
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = load i32, ptr %11, align 4, !tbaa !9
  %61 = load i32, ptr %12, align 4, !tbaa !9
  %62 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef nonnull %52, i32 noundef %59, i32 noundef %60, i32 noundef %61, i32 noundef %50, i32 noundef %8, i32 noundef 34067, i32 noundef 34071, i32 noundef 34076)
  call void @SOIL_free_image_data(ptr noundef nonnull %52)
  %.not110 = icmp eq i32 %62, 0
  br i1 %.not110, label %.thread123, label %63

63:                                               ; preds = %58
  %64 = 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 %65, label %66

65:                                               ; preds = %63
  store i32 %6, ptr %12, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %65, %63
  %67 = icmp eq ptr %64, null
  br i1 %67, label %68, label %70

68:                                               ; preds = %66
  %69 = call ptr @stbi_failure_reason() #3
  store ptr %69, ptr @result_string_pointer, align 8, !tbaa !5
  br label %.thread123

70:                                               ; preds = %66
  %71 = load i32, ptr %10, align 4, !tbaa !9
  %72 = load i32, ptr %11, align 4, !tbaa !9
  %73 = load i32, ptr %12, align 4, !tbaa !9
  %74 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef nonnull %64, i32 noundef %71, i32 noundef %72, i32 noundef %73, i32 noundef %62, i32 noundef %8, i32 noundef 34067, i32 noundef 34072, i32 noundef 34076)
  call void @SOIL_free_image_data(ptr noundef nonnull %64)
  %.not111 = icmp eq i32 %74, 0
  br i1 %.not111, label %.thread123, label %75

75:                                               ; preds = %70
  %76 = 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 %77, label %78

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

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

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

82:                                               ; preds = %78
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = load i32, ptr %11, align 4, !tbaa !9
  %85 = load i32, ptr %12, align 4, !tbaa !9
  %86 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef nonnull %76, i32 noundef %83, i32 noundef %84, i32 noundef %85, i32 noundef %74, i32 noundef %8, i32 noundef 34067, i32 noundef 34073, i32 noundef 34076)
  call void @SOIL_free_image_data(ptr noundef nonnull %76)
  %.not112 = icmp eq i32 %86, 0
  br i1 %.not112, label %.thread123, label %87

87:                                               ; preds = %82
  %88 = 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 %89, label %90

89:                                               ; preds = %87
  store i32 %6, ptr %12, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %89, %87
  %91 = icmp eq ptr %88, null
  br i1 %91, label %92, label %94

92:                                               ; preds = %90
  %93 = call ptr @stbi_failure_reason() #3
  store ptr %93, ptr @result_string_pointer, align 8, !tbaa !5
  br label %.thread123

94:                                               ; preds = %90
  %95 = load i32, ptr %10, align 4, !tbaa !9
  %96 = load i32, ptr %11, align 4, !tbaa !9
  %97 = load i32, ptr %12, align 4, !tbaa !9
  %98 = call i32 @SOIL_internal_create_OGL_texture(ptr noundef nonnull %88, i32 noundef %95, i32 noundef %96, i32 noundef %97, i32 noundef %86, i32 noundef %8, i32 noundef 34067, i32 noundef 34074, i32 noundef 34076)
  call void @SOIL_free_image_data(ptr noundef nonnull %88)
  br label %.thread123

.thread123:                                       ; preds = %34, %46, %58, %70, %82, %94, %92, %80, %68, %56, %44, %32, %25, %22
  %.093 = phi i32 [ 0, %22 ], [ 0, %25 ], [ 0, %32 ], [ 0, %44 ], [ 0, %56 ], [ 0, %68 ], [ 0, %80 ], [ 0, %92 ], [ %98, %94 ], [ 0, %82 ], [ 0, %70 ], [ 0, %58 ], [ 0, %46 ], [ 0, %34 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #3
  ret i32 %.093
}

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

attributes #0 = { mustprogress 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 = { "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 #3 = { 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