; LLVM IR from facebookresearch/habitat-sim :: src/deps/basis-universal/encoder (basisu_uastc_enc)

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

%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon = type { i32, i32, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr }
%"struct.basisu::uastc_rdo_params" = type { i32, float, float, float, i8, float, float, i32 }

@.str.3 = external hidden unnamed_addr constant [116 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [47 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjPNS_8job_poolEj = external hidden unnamed_addr constant [134 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [107 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #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: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjPNS_8job_poolEj(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(32) %3, i32 noundef %4, ptr noundef %5, i32 noundef %6) #2 personality ptr @__gxx_personality_v0 {
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %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 %"class.std::mutex", align 8
  %21 = alloca i8, align 1
  %22 = alloca i8, align 1
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca %"class.std::function", align 8
  %27 = alloca %class.anon, align 8
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  store i32 %0, ptr %8, align 4, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !9
  store ptr %3, ptr %11, align 8, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !9
  store i32 %6, ptr %14, align 4, !tbaa !5
  %30 = load ptr, ptr %11, align 8, !tbaa !9
  %31 = getelementptr inbounds %"struct.basisu::uastc_rdo_params", ptr %30, i32 0, i32 2
  %32 = load float, ptr %31, align 4, !tbaa !11
  %33 = fcmp ogt float %32, 1.000000e+00
  br i1 %33, label %34, label %35

34:                                               ; preds = %7
  br label %37

35:                                               ; preds = %7
  call void @__assert_fail(ptr noundef @.str.35, ptr noundef @.str.3, i32 noundef 4123, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjPNS_8job_poolEj) #6
  unreachable

36:                                               ; No predecessors!
  br label %37

37:                                               ; preds = %36, %34
  %38 = load ptr, ptr %11, align 8, !tbaa !9
  %39 = getelementptr inbounds %"struct.basisu::uastc_rdo_params", ptr %38, i32 0, i32 0
  %40 = load i32, ptr %39, align 4, !tbaa !15
  %41 = icmp ugt i32 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %37
  br label %45

43:                                               ; preds = %37
  call void @__assert_fail(ptr noundef @.str.36, ptr noundef @.str.3, i32 noundef 4124, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjPNS_8job_poolEj) #6
  unreachable

44:                                               ; No predecessors!
  br label %45

45:                                               ; preds = %44, %42
  %46 = load ptr, ptr %11, align 8, !tbaa !9
  %47 = getelementptr inbounds %"struct.basisu::uastc_rdo_params", ptr %46, i32 0, i32 1
  %48 = load float, ptr %47, align 4, !tbaa !16
  %49 = fcmp ogt float %48, 0.000000e+00
  br i1 %49, label %50, label %51

50:                                               ; preds = %45
  br label %53

51:                                               ; preds = %45
  call void @__assert_fail(ptr noundef @.str.37, ptr noundef @.str.3, i32 noundef 4125, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjPNS_8job_poolEj) #6
  unreachable

52:                                               ; No predecessors!
  br label %53

53:                                               ; preds = %52, %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %54 = load i32, ptr %14, align 4, !tbaa !5
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %60

56:                                               ; preds = %53
  %57 = load i32, ptr %8, align 4, !tbaa !5
  %58 = load i32, ptr %14, align 4, !tbaa !5
  %59 = udiv i32 %57, %58
  br label %61

60:                                               ; preds = %53
  br label %61

61:                                               ; preds = %60, %56
  %62 = phi i32 [ %59, %56 ], [ 0, %60 ]
  store i32 %62, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %20) #7
  call void @_ZNSt5mutexC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %20) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #7
  store i8 0, ptr %21, align 1, !tbaa !17
  %63 = load ptr, ptr %13, align 8, !tbaa !9
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %71

65:                                               ; preds = %61
  %66 = load i32, ptr %14, align 4, !tbaa !5
  %67 = icmp ule i32 %66, 1
  br i1 %67, label %71, label %68

68:                                               ; preds = %65
  %69 = load i32, ptr %19, align 4, !tbaa !5
  %70 = icmp ule i32 %69, 8
  br i1 %70, label %71, label %79

71:                                               ; preds = %68, %65, %61
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = load ptr, ptr %9, align 8, !tbaa !9
  %74 = load ptr, ptr %10, align 8, !tbaa !9
  %75 = load ptr, ptr %11, align 8, !tbaa !9
  %76 = load i32, ptr %12, align 4, !tbaa !5
  %77 = call noundef zeroext i1 @_ZN6basisuL16uastc_rdo_blocksEjjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjRjS9_S9_S9_(i32 noundef 0, i32 noundef %72, ptr noundef %73, ptr noundef %74, ptr noundef nonnull align 4 dereferenceable(32) %75, i32 noundef %76, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %78 = zext i1 %77 to i8
  store i8 %78, ptr %21, align 1, !tbaa !17
  br label %125

79:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #7
  store i8 1, ptr %22, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %112, %79
  %81 = load i32, ptr %23, align 4, !tbaa !5
  %82 = load i32, ptr %8, align 4, !tbaa !5
  %83 = icmp ult i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %120

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %86 = load i32, ptr %23, align 4, !tbaa !5
  store i32 %86, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = load i32, ptr %23, align 4, !tbaa !5
  %89 = load i32, ptr %19, align 4, !tbaa !5
  %90 = add i32 %88, %89
  %91 = call noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef %87, i32 noundef %90)
  store i32 %91, ptr %25, align 4, !tbaa !5
  %92 = load ptr, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 88, ptr %27) #7
  %93 = getelementptr inbounds %class.anon, ptr %27, i32 0, i32 0
  %94 = load i32, ptr %24, align 4, !tbaa !5
  store i32 %94, ptr %93, align 8, !tbaa !18
  %95 = getelementptr inbounds %class.anon, ptr %27, i32 0, i32 1
  %96 = load i32, ptr %25, align 4, !tbaa !5
  store i32 %96, ptr %95, align 4, !tbaa !20
  %97 = getelementptr inbounds %class.anon, ptr %27, i32 0, i32 2
  %98 = load ptr, ptr %9, align 8, !tbaa !9
  store ptr %98, ptr %97, align 8, !tbaa !21
  %99 = getelementptr inbounds %class.anon, ptr %27, i32 0, i32 3
  %100 = load ptr, ptr %10, align 8, !tbaa !9
  store ptr %100, ptr %99, align 8, !tbaa !22
  %101 = getelementptr inbounds %class.anon, ptr %27, i32 0, i32 4
  %102 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr %102, ptr %101, align 8, !tbaa !9
  %103 = getelementptr inbounds %class.anon, ptr %27, i32 0, i32 5
  %104 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %104, ptr %103, align 8, !tbaa !23
  %105 = getelementptr inbounds %class.anon, ptr %27, i32 0, i32 6
  store ptr %15, ptr %105, align 8, !tbaa !9
  %106 = getelementptr inbounds %class.anon, ptr %27, i32 0, i32 7
  store ptr %16, ptr %106, align 8, !tbaa !9
  %107 = getelementptr inbounds %class.anon, ptr %27, i32 0, i32 8
  store ptr %17, ptr %107, align 8, !tbaa !9
  %108 = getelementptr inbounds %class.anon, ptr %27, i32 0, i32 9
  store ptr %18, ptr %108, align 8, !tbaa !9
  %109 = getelementptr inbounds %class.anon, ptr %27, i32 0, i32 10
  store ptr %22, ptr %109, align 8, !tbaa !9
  %110 = getelementptr inbounds %class.anon, ptr %27, i32 0, i32 11
  store ptr %20, ptr %110, align 8, !tbaa !9
  call void @"_ZNSt8functionIFvvEEC2IZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS3_10color_rgbaERKNS3_16uastc_rdo_paramsEjPNS3_8job_poolEjE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %26, ptr noundef nonnull align 8 dereferenceable(88) %27)
  invoke void @_ZN6basisu8job_pool7add_jobEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(189) %92, ptr noundef nonnull align 8 dereferenceable(32) %26)
          to label %111 unwind label %116

111:                                              ; preds = %85
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %19, align 4, !tbaa !5
  %114 = load i32, ptr %23, align 4, !tbaa !5
  %115 = add i32 %114, %113
  store i32 %115, ptr %23, align 4, !tbaa !5
  br label %80, !llvm.loop !24

116:                                              ; preds = %85
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %28, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %29, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %156

120:                                              ; preds = %84
  %121 = load ptr, ptr %13, align 8, !tbaa !9
  call void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189) %121)
  %122 = load i8, ptr %22, align 1, !tbaa !17, !range !26, !noundef !27
  %123 = trunc i8 %122 to i1
  %124 = zext i1 %123 to i8
  store i8 %124, ptr %21, align 1, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #7
  br label %125

125:                                              ; preds = %120, %71
  %126 = load i32, ptr %16, align 4, !tbaa !5
  %127 = uitofp i32 %126 to float
  %128 = fmul float %127, 1.000000e+02
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = uitofp i32 %129 to float
  %131 = fdiv float %128, %130
  %132 = fpext float %131 to double
  %133 = load i32, ptr %15, align 4, !tbaa !5
  %134 = uitofp i32 %133 to float
  %135 = fmul float %134, 1.000000e+02
  %136 = load i32, ptr %8, align 4, !tbaa !5
  %137 = uitofp i32 %136 to float
  %138 = fdiv float %135, %137
  %139 = fpext float %138 to double
  %140 = load i32, ptr %17, align 4, !tbaa !5
  %141 = uitofp i32 %140 to float
  %142 = fmul float %141, 1.000000e+02
  %143 = load i32, ptr %8, align 4, !tbaa !5
  %144 = uitofp i32 %143 to float
  %145 = fdiv float %142, %144
  %146 = fpext float %145 to double
  %147 = load i32, ptr %18, align 4, !tbaa !5
  %148 = uitofp i32 %147 to float
  %149 = fmul float %148, 1.000000e+02
  %150 = load i32, ptr %8, align 4, !tbaa !5
  %151 = uitofp i32 %150 to float
  %152 = fdiv float %149, %151
  %153 = fpext float %152 to double
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.38, double noundef %132, double noundef %139, double noundef %146, double noundef %153)
  %154 = load i8, ptr %21, align 1, !tbaa !17, !range !26, !noundef !27
  %155 = trunc i8 %154 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  ret i1 %155

156:                                              ; preds = %116
  %157 = load ptr, ptr %28, align 8
  %158 = load i32, ptr %29, align 4
  %159 = insertvalue { ptr, i32 } poison, ptr %157, 0
  %160 = insertvalue { ptr, i32 } %159, i32 %158, 1
  resume { ptr, i32 } %160
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5mutexC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN6basisuL16uastc_rdo_blocksEjjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjRjS9_S9_S9_(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(32), i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef, i32 noundef) #4

declare void @_ZN6basisu8job_pool7add_jobEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(189), ptr noundef nonnull align 8 dereferenceable(32)) #5

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS3_10color_rgbaERKNS3_16uastc_rdo_paramsEjPNS3_8job_poolEjE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

declare void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189)) #5

declare void @_ZN6basisu12debug_printfEPKcz(ptr noundef, ...) #5

attributes #0 = { noreturn nounwind "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 = { mustprogress 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 #3 = { mustprogress 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 #4 = { inlinehint mustprogress 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 #5 = { "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 #6 = { noreturn nounwind }
attributes #7 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 8}
!12 = !{!"_ZTSN6basisu16uastc_rdo_paramsE", !6, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !14, i64 16, !13, i64 20, !13, i64 24, !6, i64 28}
!13 = !{!"float", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!12, !6, i64 0}
!16 = !{!12, !13, i64 4}
!17 = !{!14, !14, i64 0}
!18 = !{!19, !6, i64 0}
!19 = !{!"_ZTSZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjPNS_8job_poolEjE3$_0", !6, i64 0, !6, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80}
!20 = !{!19, !6, i64 4}
!21 = !{!19, !10, i64 8}
!22 = !{!19, !10, i64 16}
!23 = !{!19, !6, i64 32}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{i8 0, i8 2}
!27 = !{}


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

%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon = type { i32, i32, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr }

@.str.3 = external hidden unnamed_addr constant [116 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [47 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjPNS_8job_poolEj = external hidden unnamed_addr constant [134 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [107 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) 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: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjPNS_8job_poolEj(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(32) %3, i32 noundef %4, ptr noundef %5, i32 noundef %6) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::mutex", align 8
  %13 = alloca i8, align 1
  %14 = alloca %"class.std::function", align 8
  %15 = alloca %class.anon, align 8
  %16 = getelementptr inbounds i8, ptr %3, i64 8
  %17 = load float, ptr %16, align 4, !tbaa !5
  %18 = fcmp ogt float %17, 1.000000e+00
  br i1 %18, label %20, label %19

19:                                               ; preds = %7
  tail call void @__assert_fail(ptr noundef nonnull @.str.35, ptr noundef nonnull @.str.3, i32 noundef 4123, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjPNS_8job_poolEj) #6
  unreachable

20:                                               ; preds = %7
  %21 = load i32, ptr %3, align 4, !tbaa !12
  %.not = icmp eq i32 %21, 0
  br i1 %.not, label %22, label %23

22:                                               ; preds = %20
  tail call void @__assert_fail(ptr noundef nonnull @.str.36, ptr noundef nonnull @.str.3, i32 noundef 4124, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjPNS_8job_poolEj) #6
  unreachable

23:                                               ; preds = %20
  %24 = getelementptr inbounds i8, ptr %3, i64 4
  %25 = load float, ptr %24, align 4, !tbaa !13
  %26 = fcmp ogt float %25, 0.000000e+00
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  tail call void @__assert_fail(ptr noundef nonnull @.str.37, ptr noundef nonnull @.str.3, i32 noundef 4125, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjPNS_8job_poolEj) #6
  unreachable

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  store i32 0, ptr %8, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  store i32 0, ptr %9, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  store i32 0, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  store i32 0, ptr %11, align 4, !tbaa !14
  %.not44 = icmp eq i32 %6, 0
  br i1 %.not44, label %31, label %29

29:                                               ; preds = %28
  %30 = udiv i32 %0, %6
  br label %31

31:                                               ; preds = %28, %29
  %32 = phi i32 [ %30, %29 ], [ 0, %28 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %12) #7
  call void @_ZNSt5mutexC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %12) #7
  %33 = icmp eq ptr %5, null
  %34 = icmp ult i32 %6, 2
  %or.cond = or i1 %33, %34
  %35 = icmp ult i32 %32, 9
  %or.cond3 = or i1 %or.cond, %35
  br i1 %or.cond3, label %36, label %38

36:                                               ; preds = %31
  %37 = call noundef zeroext i1 @_ZN6basisuL16uastc_rdo_blocksEjjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjRjS9_S9_S9_(i32 noundef 0, i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(32) %3, i32 noundef %4, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %11)
  br label %59

38:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #7
  store i8 1, ptr %13, align 1, !tbaa !15
  %.not46 = icmp eq i32 %0, 0
  br i1 %.not46, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %38
  %39 = getelementptr inbounds i8, ptr %15, i64 4
  %40 = getelementptr inbounds i8, ptr %15, i64 8
  %41 = getelementptr inbounds i8, ptr %15, i64 16
  %42 = getelementptr inbounds i8, ptr %15, i64 24
  %43 = getelementptr inbounds i8, ptr %15, i64 32
  %44 = getelementptr inbounds i8, ptr %15, i64 40
  %45 = getelementptr inbounds i8, ptr %15, i64 48
  %46 = getelementptr inbounds i8, ptr %15, i64 56
  %47 = getelementptr inbounds i8, ptr %15, i64 64
  %48 = getelementptr inbounds i8, ptr %15, i64 72
  %49 = getelementptr inbounds i8, ptr %15, i64 80
  br label %52

._crit_edge:                                      ; preds = %55, %38
  call void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189) %5)
  %50 = load i8, ptr %13, align 1, !tbaa !15, !range !16, !noundef !17
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #7
  %51 = trunc nuw i8 %50 to i1
  br label %59

52:                                               ; preds = %.lr.ph, %55
  %.03945 = phi i32 [ 0, %.lr.ph ], [ %53, %55 ]
  %53 = add i32 %.03945, %32
  %54 = call noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef %0, i32 noundef %53)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %14) #7
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %15) #7
  store i32 %.03945, ptr %15, align 8, !tbaa !18
  store i32 %54, ptr %39, align 4, !tbaa !21
  store ptr %1, ptr %40, align 8, !tbaa !22
  store ptr %2, ptr %41, align 8, !tbaa !23
  store ptr %3, ptr %42, align 8, !tbaa !24
  store i32 %4, ptr %43, align 8, !tbaa !25
  store ptr %8, ptr %44, align 8, !tbaa !24
  store ptr %9, ptr %45, align 8, !tbaa !24
  store ptr %10, ptr %46, align 8, !tbaa !24
  store ptr %11, ptr %47, align 8, !tbaa !24
  store ptr %13, ptr %48, align 8, !tbaa !24
  store ptr %12, ptr %49, align 8, !tbaa !24
  call void @"_ZNSt8functionIFvvEEC2IZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS3_10color_rgbaERKNS3_16uastc_rdo_paramsEjPNS3_8job_poolEjE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(88) %15)
  invoke void @_ZN6basisu8job_pool7add_jobEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(189) %5, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %55 unwind label %57

55:                                               ; preds = %52
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #7
  %56 = icmp ult i32 %53, %0
  br i1 %56, label %52, label %._crit_edge, !llvm.loop !26

57:                                               ; preds = %52
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  resume { ptr, i32 } %58

59:                                               ; preds = %._crit_edge, %36
  %.0 = phi i1 [ %37, %36 ], [ %51, %._crit_edge ]
  %60 = load i32, ptr %9, align 4, !tbaa !14
  %61 = uitofp i32 %60 to float
  %62 = fmul float %61, 1.000000e+02
  %63 = uitofp i32 %0 to float
  %64 = fdiv float %62, %63
  %65 = fpext float %64 to double
  %66 = load i32, ptr %8, align 4, !tbaa !14
  %67 = uitofp i32 %66 to float
  %68 = fmul float %67, 1.000000e+02
  %69 = fdiv float %68, %63
  %70 = fpext float %69 to double
  %71 = load i32, ptr %10, align 4, !tbaa !14
  %72 = uitofp i32 %71 to float
  %73 = fmul float %72, 1.000000e+02
  %74 = fdiv float %73, %63
  %75 = fpext float %74 to double
  %76 = load i32, ptr %11, align 4, !tbaa !14
  %77 = uitofp i32 %76 to float
  %78 = fmul float %77, 1.000000e+02
  %79 = fdiv float %78, %63
  %80 = fpext float %79 to double
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.38, double noundef %65, double noundef %70, double noundef %75, double noundef %80)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  ret i1 %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5mutexC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN6basisuL16uastc_rdo_blocksEjjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjRjS9_S9_S9_(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(32), i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef, i32 noundef) local_unnamed_addr #4

declare void @_ZN6basisu8job_pool7add_jobEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(189), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS3_10color_rgbaERKNS3_16uastc_rdo_paramsEjPNS3_8job_poolEjE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(88)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

declare void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189)) local_unnamed_addr #5

declare void @_ZN6basisu12debug_printfEPKcz(ptr noundef, ...) local_unnamed_addr #5

attributes #0 = { noreturn nounwind "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 = { mustprogress 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 #3 = { mustprogress 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 #4 = { inlinehint mustprogress 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 #5 = { "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 #6 = { noreturn nounwind }
attributes #7 = { 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, !10, i64 8}
!6 = !{!"_ZTSN6basisu16uastc_rdo_paramsE", !7, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !11, i64 16, !10, i64 20, !10, i64 24, !7, i64 28}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!6, !7, i64 0}
!13 = !{!6, !10, i64 4}
!14 = !{!7, !7, i64 0}
!15 = !{!11, !11, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!19, !7, i64 0}
!19 = !{!"_ZTSZN6basisu9uastc_rdoEjPN6basist11uastc_blockEPKNS_10color_rgbaERKNS_16uastc_rdo_paramsEjPNS_8job_poolEjE3$_0", !7, i64 0, !7, i64 4, !20, i64 8, !20, i64 16, !20, i64 24, !7, i64 32, !20, i64 40, !20, i64 48, !20, i64 56, !20, i64 64, !20, i64 72, !20, i64 80}
!20 = !{!"any pointer", !8, i64 0}
!21 = !{!19, !7, i64 4}
!22 = !{!19, !20, i64 8}
!23 = !{!19, !20, i64 16}
!24 = !{!20, !20, i64 0}
!25 = !{!19, !7, i64 32}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass