; LLVM IR from eclipse-threadx/threadx :: ports_arch/ARMv7-M/threadx_modules/common/module_manager/src/txm_module_manager_3b870a54 (setup)

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

%struct.TXM_MODULE_INSTANCE_STRUCT = type { i64, ptr, i64, i64, ptr, i64, ptr, ptr, i64, ptr, i64, ptr, ptr, ptr, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, [8 x %struct.TXM_MODULE_MPU_INFO_STRUCT], i64, i64, %struct.TX_THREAD_STRUCT, %struct.TX_THREAD_STRUCT, %struct.TX_QUEUE_STRUCT, [104 x i64], i64, i64, i64, i64, i64, i32, ptr, i64, ptr, ptr }
%struct.TXM_MODULE_MPU_INFO_STRUCT = type { i64, i64 }
%struct.TX_THREAD_STRUCT = type { i64, i64, ptr, ptr, ptr, i64, i64, i64, ptr, ptr, ptr, i32, ptr, ptr, i32, i32, i32, i32, i32, ptr, ptr, i64, %struct.TX_TIMER_INTERNAL_STRUCT, ptr, ptr, ptr, ptr, i64, ptr, i32, i32, ptr, ptr, ptr, i32, i32, i32, i32, ptr, ptr, ptr, i64 }
%struct.TX_TIMER_INTERNAL_STRUCT = type { i64, i64, ptr, i64, ptr, ptr, ptr }
%struct.TX_QUEUE_STRUCT = type { i64, ptr, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr }
%struct.TXM_MODULE_PREAMBLE_STRUCT = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }

; Function Attrs: nounwind uwtable
declare dso_local i64 @_txm_module_manager_region_size_get(i64 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: nounwind uwtable
declare dso_local i64 @_txm_module_manager_calculate_srd_bits(i64 noundef, i64 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @_txm_module_manager_mm_register_setup(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  store i64 0, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 1, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %16 = and i64 ptrtoint (ptr @_txm_module_manager_user_mode_entry to i64), 4294967264
  %17 = or i64 %16, 16
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %18, i32 0, i32 25
  %20 = getelementptr inbounds [8 x %struct.TXM_MODULE_MPU_INFO_STRUCT], ptr %19, i64 0, i64 0
  %21 = getelementptr inbounds %struct.TXM_MODULE_MPU_INFO_STRUCT, ptr %20, i32 0, i32 0
  store i64 %17, ptr %21, align 8, !tbaa !13
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %22, i32 0, i32 25
  %24 = getelementptr inbounds [8 x %struct.TXM_MODULE_MPU_INFO_STRUCT], ptr %23, i64 0, i64 0
  %25 = getelementptr inbounds %struct.TXM_MODULE_MPU_INFO_STRUCT, ptr %24, i32 0, i32 1
  store i64 101122057, ptr %25, align 8, !tbaa !15
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %26, i32 0, i32 6
  %28 = load ptr, ptr %27, align 8, !tbaa !16
  %29 = ptrtoint ptr %28 to i64
  store i64 %29, ptr %3, align 8, !tbaa !9
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %30, i32 0, i32 20
  %32 = load ptr, ptr %31, align 8, !tbaa !21
  %33 = getelementptr inbounds %struct.TXM_MODULE_PREAMBLE_STRUCT, ptr %32, i32 0, i32 14
  %34 = load i64, ptr %33, align 8, !tbaa !22
  store i64 %34, ptr %4, align 8, !tbaa !9
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %35, i32 0, i32 25
  %37 = getelementptr inbounds [8 x %struct.TXM_MODULE_MPU_INFO_STRUCT], ptr %36, i64 0, i64 4
  %38 = getelementptr inbounds %struct.TXM_MODULE_MPU_INFO_STRUCT, ptr %37, i32 0, i32 0
  %39 = load i64, ptr %38, align 8, !tbaa !13
  %40 = icmp eq i64 %39, 0
  br i1 %40, label %41, label %132

41:                                               ; preds = %1
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %42

42:                                               ; preds = %128, %41
  %43 = load i32, ptr %14, align 4, !tbaa !11
  %44 = icmp ult i32 %43, 4
  br i1 %44, label %45, label %131

45:                                               ; preds = %42
  %46 = load i32, ptr %14, align 4, !tbaa !11
  switch i32 %46, label %81 [
    i32 0, label %47
    i32 2, label %51
    i32 3, label %64
  ]

47:                                               ; preds = %45
  %48 = load i64, ptr %4, align 8, !tbaa !9
  %49 = call i64 @_txm_power_of_two_block_size(i64 noundef %48)
  %50 = lshr i64 %49, 2
  store i64 %50, ptr %9, align 8, !tbaa !9
  br label %82

51:                                               ; preds = %45
  %52 = load i64, ptr %4, align 8, !tbaa !9
  %53 = load i64, ptr %9, align 8, !tbaa !9
  %54 = shl i64 %53, 1
  %55 = sub i64 %52, %54
  store i64 %55, ptr %4, align 8, !tbaa !9
  %56 = load i64, ptr %4, align 8, !tbaa !9
  %57 = call i64 @_txm_power_of_two_block_size(i64 noundef %56)
  store i64 %57, ptr %9, align 8, !tbaa !9
  %58 = load i64, ptr %9, align 8, !tbaa !9
  %59 = icmp ugt i64 %58, 32
  br i1 %59, label %60, label %63

60:                                               ; preds = %51
  %61 = load i64, ptr %9, align 8, !tbaa !9
  %62 = lshr i64 %61, 1
  store i64 %62, ptr %9, align 8, !tbaa !9
  br label %63

63:                                               ; preds = %60, %51
  br label %82

64:                                               ; preds = %45
  %65 = load i64, ptr %4, align 8, !tbaa !9
  %66 = load i64, ptr %9, align 8, !tbaa !9
  %67 = sub i64 %65, %66
  %68 = load i64, ptr %4, align 8, !tbaa !9
  %69 = icmp ugt i64 %67, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %64
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %80

71:                                               ; preds = %64
  %72 = load i64, ptr %4, align 8, !tbaa !9
  %73 = load i64, ptr %9, align 8, !tbaa !9
  %74 = sub i64 %72, %73
  store i64 %74, ptr %4, align 8, !tbaa !9
  %75 = load i64, ptr %4, align 8, !tbaa !9
  %76 = call i64 @_txm_power_of_two_block_size(i64 noundef %75)
  store i64 %76, ptr %9, align 8, !tbaa !9
  %77 = load i64, ptr %9, align 8, !tbaa !9
  %78 = load i64, ptr %4, align 8, !tbaa !9
  %79 = call i64 @_txm_module_manager_calculate_srd_bits(i64 noundef %77, i64 noundef %78)
  store i64 %79, ptr %12, align 8, !tbaa !9
  br label %80

80:                                               ; preds = %71, %70
  br label %82

81:                                               ; preds = %45
  br label %82

82:                                               ; preds = %81, %80, %63, %47
  %83 = load i64, ptr %3, align 8, !tbaa !9
  %84 = load i64, ptr %9, align 8, !tbaa !9
  %85 = sub i64 %84, 1
  %86 = xor i64 %85, -1
  %87 = and i64 %83, %86
  %88 = load i32, ptr %13, align 4, !tbaa !11
  %89 = zext i32 %88 to i64
  %90 = or i64 %87, %89
  %91 = or i64 %90, 16
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %92, i32 0, i32 25
  %94 = load i32, ptr %13, align 4, !tbaa !11
  %95 = zext i32 %94 to i64
  %96 = getelementptr inbounds [8 x %struct.TXM_MODULE_MPU_INFO_STRUCT], ptr %93, i64 0, i64 %95
  %97 = getelementptr inbounds %struct.TXM_MODULE_MPU_INFO_STRUCT, ptr %96, i32 0, i32 0
  store i64 %91, ptr %97, align 8, !tbaa !13
  %98 = load i64, ptr %9, align 8, !tbaa !9
  %99 = icmp ne i64 %98, 0
  br i1 %99, label %100, label %118

100:                                              ; preds = %82
  %101 = load i64, ptr %9, align 8, !tbaa !9
  %102 = call i64 @_txm_module_manager_region_size_get(i64 noundef %101)
  store i64 %102, ptr %11, align 8, !tbaa !9
  %103 = load i64, ptr %12, align 8, !tbaa !9
  %104 = or i64 101122048, %103
  %105 = load i64, ptr %11, align 8, !tbaa !9
  %106 = shl i64 %105, 1
  %107 = or i64 %104, %106
  %108 = or i64 %107, 1
  %109 = load ptr, ptr %2, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %109, i32 0, i32 25
  %111 = load i32, ptr %13, align 4, !tbaa !11
  %112 = zext i32 %111 to i64
  %113 = getelementptr inbounds [8 x %struct.TXM_MODULE_MPU_INFO_STRUCT], ptr %110, i64 0, i64 %112
  %114 = getelementptr inbounds %struct.TXM_MODULE_MPU_INFO_STRUCT, ptr %113, i32 0, i32 1
  store i64 %108, ptr %114, align 8, !tbaa !15
  %115 = load i64, ptr %3, align 8, !tbaa !9
  %116 = load i64, ptr %9, align 8, !tbaa !9
  %117 = add i64 %115, %116
  store i64 %117, ptr %3, align 8, !tbaa !9
  br label %125

118:                                              ; preds = %82
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %119, i32 0, i32 25
  %121 = load i32, ptr %13, align 4, !tbaa !11
  %122 = zext i32 %121 to i64
  %123 = getelementptr inbounds [8 x %struct.TXM_MODULE_MPU_INFO_STRUCT], ptr %120, i64 0, i64 %122
  %124 = getelementptr inbounds %struct.TXM_MODULE_MPU_INFO_STRUCT, ptr %123, i32 0, i32 1
  store i64 0, ptr %124, align 8, !tbaa !15
  br label %125

125:                                              ; preds = %118, %100
  %126 = load i32, ptr %13, align 4, !tbaa !11
  %127 = add i32 %126, 1
  store i32 %127, ptr %13, align 4, !tbaa !11
  br label %128

128:                                              ; preds = %125
  %129 = load i32, ptr %14, align 4, !tbaa !11
  %130 = add i32 %129, 1
  store i32 %130, ptr %14, align 4, !tbaa !11
  br label %42, !llvm.loop !24

131:                                              ; preds = %42
  br label %201

132:                                              ; preds = %1
  %133 = load i64, ptr %4, align 8, !tbaa !9
  %134 = udiv i64 %133, 3
  %135 = call i64 @_txm_power_of_two_block_size(i64 noundef %134)
  store i64 %135, ptr %9, align 8, !tbaa !9
  %136 = load i64, ptr %9, align 8, !tbaa !9
  %137 = call i64 @_txm_module_manager_region_size_get(i64 noundef %136)
  %138 = shl i64 %137, 1
  store i64 %138, ptr %11, align 8, !tbaa !9
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %139

139:                                              ; preds = %197, %132
  %140 = load i32, ptr %14, align 4, !tbaa !11
  %141 = icmp ult i32 %140, 3
  br i1 %141, label %142, label %200

142:                                              ; preds = %139
  %143 = load i64, ptr %3, align 8, !tbaa !9
  %144 = load i64, ptr %9, align 8, !tbaa !9
  %145 = sub i64 %144, 1
  %146 = xor i64 %145, -1
  %147 = and i64 %143, %146
  %148 = load i32, ptr %13, align 4, !tbaa !11
  %149 = zext i32 %148 to i64
  %150 = or i64 %147, %149
  %151 = or i64 %150, 16
  %152 = load ptr, ptr %2, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %152, i32 0, i32 25
  %154 = load i32, ptr %13, align 4, !tbaa !11
  %155 = zext i32 %154 to i64
  %156 = getelementptr inbounds [8 x %struct.TXM_MODULE_MPU_INFO_STRUCT], ptr %153, i64 0, i64 %155
  %157 = getelementptr inbounds %struct.TXM_MODULE_MPU_INFO_STRUCT, ptr %156, i32 0, i32 0
  store i64 %151, ptr %157, align 8, !tbaa !13
  %158 = load i64, ptr %4, align 8, !tbaa !9
  %159 = load i64, ptr %9, align 8, !tbaa !9
  %160 = icmp ult i64 %158, %159
  br i1 %160, label %161, label %165

161:                                              ; preds = %142
  %162 = load i64, ptr %9, align 8, !tbaa !9
  %163 = load i64, ptr %4, align 8, !tbaa !9
  %164 = call i64 @_txm_module_manager_calculate_srd_bits(i64 noundef %162, i64 noundef %163)
  store i64 %164, ptr %12, align 8, !tbaa !9
  br label %165

165:                                              ; preds = %161, %142
  %166 = load i64, ptr %11, align 8, !tbaa !9
  %167 = load i64, ptr %12, align 8, !tbaa !9
  %168 = or i64 %166, %167
  %169 = or i64 %168, 101122048
  store i64 %169, ptr %10, align 8, !tbaa !9
  %170 = load i64, ptr %4, align 8, !tbaa !9
  %171 = icmp ne i64 %170, 0
  br i1 %171, label %172, label %175

172:                                              ; preds = %165
  %173 = load i64, ptr %10, align 8, !tbaa !9
  %174 = or i64 %173, 1
  store i64 %174, ptr %10, align 8, !tbaa !9
  br label %175

175:                                              ; preds = %172, %165
  %176 = load i64, ptr %10, align 8, !tbaa !9
  %177 = load ptr, ptr %2, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %177, i32 0, i32 25
  %179 = load i32, ptr %13, align 4, !tbaa !11
  %180 = zext i32 %179 to i64
  %181 = getelementptr inbounds [8 x %struct.TXM_MODULE_MPU_INFO_STRUCT], ptr %178, i64 0, i64 %180
  %182 = getelementptr inbounds %struct.TXM_MODULE_MPU_INFO_STRUCT, ptr %181, i32 0, i32 1
  store i64 %176, ptr %182, align 8, !tbaa !15
  %183 = load i64, ptr %3, align 8, !tbaa !9
  %184 = load i64, ptr %9, align 8, !tbaa !9
  %185 = add i64 %183, %184
  store i64 %185, ptr %3, align 8, !tbaa !9
  %186 = load i64, ptr %4, align 8, !tbaa !9
  %187 = load i64, ptr %9, align 8, !tbaa !9
  %188 = icmp ugt i64 %186, %187
  br i1 %188, label %189, label %193

189:                                              ; preds = %175
  %190 = load i64, ptr %4, align 8, !tbaa !9
  %191 = load i64, ptr %9, align 8, !tbaa !9
  %192 = sub i64 %190, %191
  store i64 %192, ptr %4, align 8, !tbaa !9
  br label %194

193:                                              ; preds = %175
  store i64 0, ptr %4, align 8, !tbaa !9
  br label %194

194:                                              ; preds = %193, %189
  %195 = load i32, ptr %13, align 4, !tbaa !11
  %196 = add i32 %195, 1
  store i32 %196, ptr %13, align 4, !tbaa !11
  br label %197

197:                                              ; preds = %194
  %198 = load i32, ptr %14, align 4, !tbaa !11
  %199 = add i32 %198, 1
  store i32 %199, ptr %14, align 4, !tbaa !11
  br label %139, !llvm.loop !26

200:                                              ; preds = %139
  store i32 1, ptr %15, align 4
  br label %309

201:                                              ; preds = %131
  %202 = load ptr, ptr %2, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %202, i32 0, i32 11
  %204 = load ptr, ptr %203, align 8, !tbaa !27
  %205 = ptrtoint ptr %204 to i64
  store i64 %205, ptr %5, align 8, !tbaa !9
  %206 = load ptr, ptr %2, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %206, i32 0, i32 20
  %208 = load ptr, ptr %207, align 8, !tbaa !21
  %209 = getelementptr inbounds %struct.TXM_MODULE_PREAMBLE_STRUCT, ptr %208, i32 0, i32 15
  %210 = load i64, ptr %209, align 8, !tbaa !28
  store i64 %210, ptr %6, align 8, !tbaa !9
  %211 = load ptr, ptr %2, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %211, i32 0, i32 20
  %213 = load ptr, ptr %212, align 8, !tbaa !21
  %214 = getelementptr inbounds %struct.TXM_MODULE_PREAMBLE_STRUCT, ptr %213, i32 0, i32 10
  %215 = load i64, ptr %214, align 8, !tbaa !29
  store i64 %215, ptr %7, align 8, !tbaa !9
  %216 = load ptr, ptr %2, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %216, i32 0, i32 20
  %218 = load ptr, ptr %217, align 8, !tbaa !21
  %219 = getelementptr inbounds %struct.TXM_MODULE_PREAMBLE_STRUCT, ptr %218, i32 0, i32 13
  %220 = load i64, ptr %219, align 8, !tbaa !30
  store i64 %220, ptr %8, align 8, !tbaa !9
  %221 = load i64, ptr %6, align 8, !tbaa !9
  %222 = add i64 %221, 4
  %223 = sub i64 %222, 1
  %224 = udiv i64 %223, 4
  %225 = mul i64 %224, 4
  store i64 %225, ptr %6, align 8, !tbaa !9
  %226 = load i64, ptr %7, align 8, !tbaa !9
  %227 = add i64 %226, 4
  %228 = sub i64 %227, 1
  %229 = udiv i64 %228, 4
  %230 = mul i64 %229, 4
  store i64 %230, ptr %7, align 8, !tbaa !9
  %231 = load i64, ptr %8, align 8, !tbaa !9
  %232 = add i64 %231, 4
  %233 = sub i64 %232, 1
  %234 = udiv i64 %233, 4
  %235 = mul i64 %234, 4
  store i64 %235, ptr %8, align 8, !tbaa !9
  %236 = load i64, ptr %6, align 8, !tbaa !9
  %237 = load i64, ptr %7, align 8, !tbaa !9
  %238 = add i64 %236, %237
  %239 = load i64, ptr %8, align 8, !tbaa !9
  %240 = add i64 %238, %239
  store i64 %240, ptr %6, align 8, !tbaa !9
  %241 = load i64, ptr %6, align 8, !tbaa !9
  %242 = udiv i64 %241, 3
  %243 = call i64 @_txm_power_of_two_block_size(i64 noundef %242)
  store i64 %243, ptr %9, align 8, !tbaa !9
  store i64 0, ptr %12, align 8, !tbaa !9
  %244 = load i64, ptr %9, align 8, !tbaa !9
  %245 = call i64 @_txm_module_manager_region_size_get(i64 noundef %244)
  %246 = shl i64 %245, 1
  store i64 %246, ptr %11, align 8, !tbaa !9
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %247

247:                                              ; preds = %305, %201
  %248 = load i32, ptr %14, align 4, !tbaa !11
  %249 = icmp ult i32 %248, 3
  br i1 %249, label %250, label %308

250:                                              ; preds = %247
  %251 = load i64, ptr %5, align 8, !tbaa !9
  %252 = load i64, ptr %9, align 8, !tbaa !9
  %253 = sub i64 %252, 1
  %254 = xor i64 %253, -1
  %255 = and i64 %251, %254
  %256 = load i32, ptr %13, align 4, !tbaa !11
  %257 = zext i32 %256 to i64
  %258 = or i64 %255, %257
  %259 = or i64 %258, 16
  %260 = load ptr, ptr %2, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %260, i32 0, i32 25
  %262 = load i32, ptr %13, align 4, !tbaa !11
  %263 = zext i32 %262 to i64
  %264 = getelementptr inbounds [8 x %struct.TXM_MODULE_MPU_INFO_STRUCT], ptr %261, i64 0, i64 %263
  %265 = getelementptr inbounds %struct.TXM_MODULE_MPU_INFO_STRUCT, ptr %264, i32 0, i32 0
  store i64 %259, ptr %265, align 8, !tbaa !13
  %266 = load i64, ptr %6, align 8, !tbaa !9
  %267 = load i64, ptr %9, align 8, !tbaa !9
  %268 = icmp ult i64 %266, %267
  br i1 %268, label %269, label %273

269:                                              ; preds = %250
  %270 = load i64, ptr %9, align 8, !tbaa !9
  %271 = load i64, ptr %6, align 8, !tbaa !9
  %272 = call i64 @_txm_module_manager_calculate_srd_bits(i64 noundef %270, i64 noundef %271)
  store i64 %272, ptr %12, align 8, !tbaa !9
  br label %273

273:                                              ; preds = %269, %250
  %274 = load i64, ptr %11, align 8, !tbaa !9
  %275 = load i64, ptr %12, align 8, !tbaa !9
  %276 = or i64 %274, %275
  %277 = or i64 %276, 319225856
  store i64 %277, ptr %10, align 8, !tbaa !9
  %278 = load i64, ptr %6, align 8, !tbaa !9
  %279 = icmp ne i64 %278, 0
  br i1 %279, label %280, label %283

280:                                              ; preds = %273
  %281 = load i64, ptr %10, align 8, !tbaa !9
  %282 = or i64 %281, 1
  store i64 %282, ptr %10, align 8, !tbaa !9
  br label %283

283:                                              ; preds = %280, %273
  %284 = load i64, ptr %10, align 8, !tbaa !9
  %285 = load ptr, ptr %2, align 8, !tbaa !5
  %286 = getelementptr inbounds %struct.TXM_MODULE_INSTANCE_STRUCT, ptr %285, i32 0, i32 25
  %287 = load i32, ptr %13, align 4, !tbaa !11
  %288 = zext i32 %287 to i64
  %289 = getelementptr inbounds [8 x %struct.TXM_MODULE_MPU_INFO_STRUCT], ptr %286, i64 0, i64 %288
  %290 = getelementptr inbounds %struct.TXM_MODULE_MPU_INFO_STRUCT, ptr %289, i32 0, i32 1
  store i64 %284, ptr %290, align 8, !tbaa !15
  %291 = load i64, ptr %5, align 8, !tbaa !9
  %292 = load i64, ptr %9, align 8, !tbaa !9
  %293 = add i64 %291, %292
  store i64 %293, ptr %5, align 8, !tbaa !9
  %294 = load i64, ptr %6, align 8, !tbaa !9
  %295 = load i64, ptr %9, align 8, !tbaa !9
  %296 = icmp ugt i64 %294, %295
  br i1 %296, label %297, label %301

297:                                              ; preds = %283
  %298 = load i64, ptr %6, align 8, !tbaa !9
  %299 = load i64, ptr %9, align 8, !tbaa !9
  %300 = sub i64 %298, %299
  store i64 %300, ptr %6, align 8, !tbaa !9
  br label %302

301:                                              ; preds = %283
  store i64 0, ptr %6, align 8, !tbaa !9
  br label %302

302:                                              ; preds = %301, %297
  %303 = load i32, ptr %13, align 4, !tbaa !11
  %304 = add i32 %303, 1
  store i32 %304, ptr %13, align 4, !tbaa !11
  br label %305

305:                                              ; preds = %302
  %306 = load i32, ptr %14, align 4, !tbaa !11
  %307 = add i32 %306, 1
  store i32 %307, ptr %14, align 4, !tbaa !11
  br label %247, !llvm.loop !31

308:                                              ; preds = %247
  store i32 0, ptr %15, align 4
  br label %309

309:                                              ; preds = %308, %200
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  %310 = load i32, ptr %15, align 4
  switch i32 %310, label %312 [
    i32 0, label %311
    i32 1, label %311
  ]

311:                                              ; preds = %309, %309
  ret void

312:                                              ; preds = %309
  unreachable
}

declare i64 @_txm_module_manager_user_mode_entry(i64 noundef, i64 noundef, i64 noundef, i64 noundef) #2

declare i64 @_txm_power_of_two_block_size(i64 noundef) #2

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 = { "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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"TXM_MODULE_MPU_INFO_STRUCT", !10, i64 0, !10, i64 8}
!15 = !{!14, !10, i64 8}
!16 = !{!17, !6, i64 48}
!17 = !{!"TXM_MODULE_INSTANCE_STRUCT", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !10, i64 40, !6, i64 48, !6, i64 56, !10, i64 64, !6, i64 72, !10, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !10, i64 112, !10, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !7, i64 200, !10, i64 328, !10, i64 336, !18, i64 344, !18, i64 688, !20, i64 1032, !7, i64 1136, !10, i64 1968, !10, i64 1976, !10, i64 1984, !10, i64 1992, !10, i64 2000, !12, i64 2008, !6, i64 2016, !10, i64 2024, !6, i64 2032, !6, i64 2040}
!18 = !{!"TX_THREAD_STRUCT", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !6, i64 96, !6, i64 104, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !6, i64 136, !6, i64 144, !10, i64 152, !19, i64 160, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !10, i64 248, !6, i64 256, !12, i64 264, !12, i64 268, !6, i64 272, !6, i64 280, !6, i64 288, !12, i64 296, !12, i64 300, !12, i64 304, !12, i64 308, !6, i64 312, !6, i64 320, !6, i64 328, !10, i64 336}
!19 = !{!"TX_TIMER_INTERNAL_STRUCT", !10, i64 0, !10, i64 8, !6, i64 16, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!20 = !{!"TX_QUEUE_STRUCT", !10, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !12, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!21 = !{!17, !6, i64 160}
!22 = !{!23, !10, i64 112}
!23 = !{!"TXM_MODULE_PREAMBLE_STRUCT", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = !{!17, !6, i64 88}
!28 = !{!23, !10, i64 120}
!29 = !{!23, !10, i64 80}
!30 = !{!23, !10, i64 104}
!31 = distinct !{!31, !25}


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

; Function Attrs: nounwind uwtable
declare dso_local i64 @_txm_module_manager_region_size_get(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @_txm_module_manager_calculate_srd_bits(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @_txm_module_manager_mm_register_setup(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = and i64 ptrtoint (ptr @_txm_module_manager_user_mode_entry to i64), 4294967264
  %3 = or disjoint i64 %2, 16
  %4 = getelementptr inbounds i8, ptr %0, i64 200
  store i64 %3, ptr %4, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 208
  store i64 101122057, ptr %5, align 8, !tbaa !10
  %6 = getelementptr inbounds i8, ptr %0, i64 48
  %7 = load ptr, ptr %6, align 8, !tbaa !11
  %8 = ptrtoint ptr %7 to i64
  %9 = getelementptr inbounds i8, ptr %0, i64 160
  %10 = load ptr, ptr %9, align 8, !tbaa !18
  %11 = getelementptr inbounds i8, ptr %10, i64 112
  %12 = load i64, ptr %11, align 8, !tbaa !19
  %13 = getelementptr inbounds i8, ptr %0, i64 264
  %14 = load i64, ptr %13, align 8, !tbaa !5
  %15 = icmp eq i64 %14, 0
  br i1 %15, label %16, label %102

16:                                               ; preds = %1
  %17 = tail call i64 @_txm_power_of_two_block_size(i64 noundef %12) #3
  %18 = lshr i64 %17, 2
  %19 = sub nsw i64 0, %18
  %20 = and i64 %8, %19
  %21 = or i64 %20, 17
  %22 = getelementptr inbounds i8, ptr %0, i64 216
  store i64 %21, ptr %22, align 8, !tbaa !5
  %.not129 = icmp ult i64 %17, 4
  br i1 %.not129, label %37, label %23

23:                                               ; preds = %16
  %24 = tail call i64 @_txm_module_manager_region_size_get(i64 noundef %18)
  %25 = shl i64 %24, 1
  %26 = or i64 %25, 101122049
  %27 = add i64 %18, %8
  %28 = getelementptr inbounds i8, ptr %0, i64 224
  store i64 %26, ptr %28, align 8
  %29 = sub nsw i64 0, %18
  %30 = and i64 %27, %29
  %31 = or i64 %30, 18
  %32 = getelementptr inbounds i8, ptr %0, i64 232
  store i64 %31, ptr %32, align 8, !tbaa !5
  %33 = tail call i64 @_txm_module_manager_region_size_get(i64 noundef %18)
  %34 = shl i64 %33, 1
  %35 = or i64 %34, 101122049
  %36 = add i64 %18, %27
  br label %40

37:                                               ; preds = %16
  %38 = getelementptr inbounds i8, ptr %0, i64 224
  store i64 0, ptr %38, align 8
  %39 = getelementptr inbounds i8, ptr %0, i64 232
  store i64 18, ptr %39, align 8, !tbaa !5
  br label %40

40:                                               ; preds = %37, %23
  %.sink153 = phi i64 [ 0, %37 ], [ %35, %23 ]
  %.1112.1 = phi i64 [ %8, %37 ], [ %36, %23 ]
  %41 = getelementptr inbounds i8, ptr %0, i64 240
  store i64 %.sink153, ptr %41, align 8
  %42 = shl nuw nsw i64 %18, 1
  %43 = sub i64 %12, %42
  %44 = tail call i64 @_txm_power_of_two_block_size(i64 noundef %43) #3
  %45 = icmp ugt i64 %44, 32
  %46 = zext i1 %45 to i64
  %spec.select.2 = lshr i64 %44, %46
  %47 = sub i64 0, %spec.select.2
  %48 = and i64 %.1112.1, %47
  %49 = or i64 %48, 19
  %50 = getelementptr inbounds i8, ptr %0, i64 248
  store i64 %49, ptr %50, align 8, !tbaa !5
  %.not129.2 = icmp eq i64 %spec.select.2, 0
  br i1 %.not129.2, label %56, label %51

51:                                               ; preds = %40
  %52 = tail call i64 @_txm_module_manager_region_size_get(i64 noundef %spec.select.2)
  %53 = shl i64 %52, 1
  %54 = or i64 %53, 101122049
  %55 = add i64 %spec.select.2, %.1112.1
  br label %56

56:                                               ; preds = %51, %40
  %.sink154 = phi i64 [ %54, %51 ], [ 0, %40 ]
  %.1112.2 = phi i64 [ %55, %51 ], [ %.1112.1, %40 ]
  %57 = getelementptr inbounds i8, ptr %0, i64 256
  store i64 %.sink154, ptr %57, align 8
  %58 = icmp ugt i64 %spec.select.2, %43
  br i1 %58, label %.thread160, label %60

.thread160:                                       ; preds = %56
  %59 = getelementptr inbounds i8, ptr %0, i64 264
  store i64 20, ptr %59, align 8, !tbaa !5
  br label %73

60:                                               ; preds = %56
  %61 = sub i64 %43, %spec.select.2
  %62 = tail call i64 @_txm_power_of_two_block_size(i64 noundef %61) #3
  %63 = tail call i64 @_txm_module_manager_calculate_srd_bits(i64 noundef %62, i64 noundef %61)
  %64 = sub i64 0, %62
  %65 = and i64 %.1112.2, %64
  %66 = or i64 %65, 20
  %67 = getelementptr inbounds i8, ptr %0, i64 264
  store i64 %66, ptr %67, align 8, !tbaa !5
  %.not129.3 = icmp eq i64 %62, 0
  br i1 %.not129.3, label %73, label %68

68:                                               ; preds = %60
  %69 = tail call i64 @_txm_module_manager_region_size_get(i64 noundef %62)
  %70 = shl i64 %69, 1
  %71 = or i64 %63, %70
  %72 = or i64 %71, 101122049
  br label %73

73:                                               ; preds = %60, %.thread160, %68
  %.sink155 = phi i64 [ %72, %68 ], [ 0, %.thread160 ], [ 0, %60 ]
  %74 = getelementptr inbounds i8, ptr %0, i64 272
  store i64 %.sink155, ptr %74, align 8
  %75 = getelementptr inbounds i8, ptr %0, i64 88
  %76 = load ptr, ptr %75, align 8, !tbaa !21
  %77 = ptrtoint ptr %76 to i64
  %78 = load ptr, ptr %9, align 8, !tbaa !18
  %79 = getelementptr inbounds i8, ptr %78, i64 120
  %80 = load i64, ptr %79, align 8, !tbaa !22
  %81 = getelementptr inbounds i8, ptr %78, i64 80
  %82 = load i64, ptr %81, align 8, !tbaa !23
  %83 = getelementptr inbounds i8, ptr %78, i64 104
  %84 = load i64, ptr %83, align 8, !tbaa !24
  %85 = add i64 %80, 3
  %86 = and i64 %85, -4
  %87 = add i64 %82, 3
  %88 = and i64 %87, -4
  %89 = add i64 %84, 3
  %90 = and i64 %89, -4
  %91 = add i64 %88, %86
  %92 = add i64 %91, %90
  %93 = udiv i64 %92, 3
  %94 = tail call i64 @_txm_power_of_two_block_size(i64 noundef %93) #3
  %95 = tail call i64 @_txm_module_manager_region_size_get(i64 noundef %94)
  %96 = shl i64 %95, 1
  %97 = sub i64 0, %94
  %98 = and i64 %77, %97
  %99 = or i64 %98, 21
  %100 = getelementptr inbounds i8, ptr %0, i64 280
  store i64 %99, ptr %100, align 8, !tbaa !5
  %101 = icmp ult i64 %92, %94
  br i1 %101, label %135, label %137

102:                                              ; preds = %1
  %103 = udiv i64 %12, 3
  %104 = tail call i64 @_txm_power_of_two_block_size(i64 noundef %103) #3
  %105 = tail call i64 @_txm_module_manager_region_size_get(i64 noundef %104)
  %106 = shl i64 %105, 1
  %107 = sub i64 0, %104
  %108 = and i64 %8, %107
  %109 = or i64 %108, 17
  %110 = getelementptr inbounds i8, ptr %0, i64 216
  store i64 %109, ptr %110, align 8, !tbaa !5
  %111 = icmp ult i64 %12, %104
  br i1 %111, label %112, label %114

112:                                              ; preds = %102
  %113 = tail call i64 @_txm_module_manager_calculate_srd_bits(i64 noundef %104, i64 noundef %12)
  br label %114

114:                                              ; preds = %112, %102
  %.3 = phi i64 [ %113, %112 ], [ 0, %102 ]
  %.not = icmp eq i64 %12, 0
  %spec.select130.v = select i1 %.not, i64 101122048, i64 101122049
  %115 = or i64 %spec.select130.v, %106
  %spec.select130 = or i64 %115, %.3
  %116 = getelementptr inbounds i8, ptr %0, i64 224
  store i64 %spec.select130, ptr %116, align 8, !tbaa !10
  %117 = add i64 %104, %8
  %.3117 = tail call i64 @llvm.usub.sat.i64(i64 %12, i64 %104)
  %118 = and i64 %117, %107
  %119 = or i64 %118, 18
  %120 = getelementptr inbounds i8, ptr %0, i64 232
  store i64 %119, ptr %120, align 8, !tbaa !5
  %121 = icmp ult i64 %.3117, %104
  br i1 %121, label %122, label %124

122:                                              ; preds = %114
  %123 = tail call i64 @_txm_module_manager_calculate_srd_bits(i64 noundef %104, i64 noundef %.3117)
  br label %124

124:                                              ; preds = %122, %114
  %.3.1 = phi i64 [ %123, %122 ], [ %.3, %114 ]
  %.not.1.not = icmp ugt i64 %12, %104
  %spec.select130.v.1 = select i1 %.not.1.not, i64 101122049, i64 101122048
  %125 = or i64 %spec.select130.v.1, %106
  %spec.select130.1 = or i64 %125, %.3.1
  %126 = getelementptr inbounds i8, ptr %0, i64 240
  store i64 %spec.select130.1, ptr %126, align 8, !tbaa !10
  %127 = add i64 %117, %104
  %.3117.1 = tail call i64 @llvm.usub.sat.i64(i64 %.3117, i64 %104)
  %128 = and i64 %127, %107
  %129 = or i64 %128, 19
  %130 = getelementptr inbounds i8, ptr %0, i64 248
  store i64 %129, ptr %130, align 8, !tbaa !5
  %131 = icmp ult i64 %.3117.1, %104
  br i1 %131, label %132, label %.loopexit.loopexit149

132:                                              ; preds = %124
  %133 = tail call i64 @_txm_module_manager_calculate_srd_bits(i64 noundef %104, i64 noundef %.3117.1)
  br label %.loopexit.loopexit149

.loopexit.loopexit149:                            ; preds = %132, %124
  %.3.2 = phi i64 [ %133, %132 ], [ %.3.1, %124 ]
  %.not.2.not = icmp ugt i64 %.3117, %104
  %spec.select130.v.2 = select i1 %.not.2.not, i64 101122049, i64 101122048
  %134 = or i64 %spec.select130.v.2, %.3.2
  %spec.select130.2 = or i64 %134, %106
  br label %.loopexit

135:                                              ; preds = %73
  %136 = tail call i64 @_txm_module_manager_calculate_srd_bits(i64 noundef %94, i64 noundef %92)
  br label %137

137:                                              ; preds = %135, %73
  %.5 = phi i64 [ %136, %135 ], [ 0, %73 ]
  %.not128 = icmp eq i64 %92, 0
  %spec.select131.v = select i1 %.not128, i64 319225856, i64 319225857
  %138 = or i64 %spec.select131.v, %96
  %spec.select131 = or i64 %138, %.5
  %139 = getelementptr inbounds i8, ptr %0, i64 288
  store i64 %spec.select131, ptr %139, align 8, !tbaa !10
  %140 = add i64 %94, %77
  %.1119 = tail call i64 @llvm.usub.sat.i64(i64 %92, i64 %94)
  %141 = and i64 %140, %97
  %142 = or i64 %141, 22
  %143 = getelementptr inbounds i8, ptr %0, i64 296
  store i64 %142, ptr %143, align 8, !tbaa !5
  %144 = icmp ult i64 %.1119, %94
  br i1 %144, label %145, label %147

145:                                              ; preds = %137
  %146 = tail call i64 @_txm_module_manager_calculate_srd_bits(i64 noundef %94, i64 noundef %.1119)
  br label %147

147:                                              ; preds = %145, %137
  %.5.1 = phi i64 [ %146, %145 ], [ %.5, %137 ]
  %.not128.1.not = icmp ugt i64 %92, %94
  %spec.select131.v.1 = select i1 %.not128.1.not, i64 319225857, i64 319225856
  %148 = or i64 %spec.select131.v.1, %96
  %spec.select131.1 = or i64 %148, %.5.1
  %149 = getelementptr inbounds i8, ptr %0, i64 304
  store i64 %spec.select131.1, ptr %149, align 8, !tbaa !10
  %150 = add i64 %140, %94
  %.1119.1 = tail call i64 @llvm.usub.sat.i64(i64 %.1119, i64 %94)
  %151 = and i64 %150, %97
  %152 = or i64 %151, 23
  %153 = getelementptr inbounds i8, ptr %0, i64 312
  store i64 %152, ptr %153, align 8, !tbaa !5
  %154 = icmp ult i64 %.1119.1, %94
  br i1 %154, label %155, label %.loopexit.loopexit

155:                                              ; preds = %147
  %156 = tail call i64 @_txm_module_manager_calculate_srd_bits(i64 noundef %94, i64 noundef %.1119.1)
  br label %.loopexit.loopexit

.loopexit.loopexit:                               ; preds = %155, %147
  %.5.2 = phi i64 [ %156, %155 ], [ %.5.1, %147 ]
  %.not128.2.not = icmp ugt i64 %.1119, %94
  %spec.select131.v.2 = select i1 %.not128.2.not, i64 319225857, i64 319225856
  %157 = or i64 %spec.select131.v.2, %.5.2
  %spec.select131.2 = or i64 %157, %96
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit149, %.loopexit.loopexit
  %.sink164 = phi i64 [ 256, %.loopexit.loopexit149 ], [ 320, %.loopexit.loopexit ]
  %spec.select130.2.sink = phi i64 [ %spec.select130.2, %.loopexit.loopexit149 ], [ %spec.select131.2, %.loopexit.loopexit ]
  %158 = getelementptr inbounds i8, ptr %0, i64 %.sink164
  store i64 %spec.select130.2.sink, ptr %158, align 8, !tbaa !10
  ret void
}

declare i64 @_txm_module_manager_user_mode_entry(i64 noundef, i64 noundef, i64 noundef, i64 noundef) #1

declare i64 @_txm_power_of_two_block_size(i64 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.usub.sat.i64(i64, i64) #2

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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !7, i64 0}
!6 = !{!"TXM_MODULE_MPU_INFO_STRUCT", !7, i64 0, !7, i64 8}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!12, !13, i64 48}
!12 = !{!"TXM_MODULE_INSTANCE_STRUCT", !7, i64 0, !13, i64 8, !7, i64 16, !7, i64 24, !13, i64 32, !7, i64 40, !13, i64 48, !13, i64 56, !7, i64 64, !13, i64 72, !7, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !7, i64 112, !7, i64 120, !13, i64 128, !13, i64 136, !13, i64 144, !13, i64 152, !13, i64 160, !13, i64 168, !13, i64 176, !13, i64 184, !13, i64 192, !8, i64 200, !7, i64 328, !7, i64 336, !14, i64 344, !14, i64 688, !17, i64 1032, !8, i64 1136, !7, i64 1968, !7, i64 1976, !7, i64 1984, !7, i64 1992, !7, i64 2000, !15, i64 2008, !13, i64 2016, !7, i64 2024, !13, i64 2032, !13, i64 2040}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"TX_THREAD_STRUCT", !7, i64 0, !7, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !15, i64 88, !13, i64 96, !13, i64 104, !15, i64 112, !15, i64 116, !15, i64 120, !15, i64 124, !15, i64 128, !13, i64 136, !13, i64 144, !7, i64 152, !16, i64 160, !13, i64 216, !13, i64 224, !13, i64 232, !13, i64 240, !7, i64 248, !13, i64 256, !15, i64 264, !15, i64 268, !13, i64 272, !13, i64 280, !13, i64 288, !15, i64 296, !15, i64 300, !15, i64 304, !15, i64 308, !13, i64 312, !13, i64 320, !13, i64 328, !7, i64 336}
!15 = !{!"int", !8, i64 0}
!16 = !{!"TX_TIMER_INTERNAL_STRUCT", !7, i64 0, !7, i64 8, !13, i64 16, !7, i64 24, !13, i64 32, !13, i64 40, !13, i64 48}
!17 = !{!"TX_QUEUE_STRUCT", !7, i64 0, !13, i64 8, !15, i64 16, !15, i64 20, !15, i64 24, !15, i64 28, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !15, i64 72, !13, i64 80, !13, i64 88, !13, i64 96}
!18 = !{!12, !13, i64 160}
!19 = !{!20, !7, i64 112}
!20 = !{!"TXM_MODULE_PREAMBLE_STRUCT", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248}
!21 = !{!12, !13, i64 88}
!22 = !{!20, !7, i64 120}
!23 = !{!20, !7, i64 80}
!24 = !{!20, !7, i64 104}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass