; LLVM IR from lichen-community-systems/signaletic :: hosts/daisy/vendor/libDaisy/Drivers/STM32H7xx_HAL_Driver/Src (SimpleCaptureStop)

; 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.HRTIM_HandleTypeDef = type { ptr, %struct.HRTIM_InitTypeDef, [6 x %struct.HRTIM_TimerParamTypeDef], i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.HRTIM_InitTypeDef = type { i32, i32, i32, i32, i32 }
%struct.HRTIM_TimerParamTypeDef = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.HRTIM_TypeDef = type { %struct.HRTIM_Master_TypeDef, [5 x %struct.HRTIM_Timerx_TypeDef], [32 x i32], %struct.HRTIM_Common_TypeDef }
%struct.HRTIM_Master_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [20 x i32] }
%struct.HRTIM_Timerx_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [5 x i32] }
%struct.HRTIM_Common_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@TimerIdxToTimerId = external hidden global [6 x i32], align 16

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

; 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 @HAL_HRTIM_SimpleCaptureStop(ptr noundef %0, i32 noundef %1, i32 noundef %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  br label %11

11:                                               ; preds = %3
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %12, i32 0, i32 3
  %14 = load i32, ptr %13, align 4, !tbaa !11
  %15 = icmp eq i32 %14, 1
  br i1 %15, label %16, label %17

16:                                               ; preds = %11
  store i32 2, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %257

17:                                               ; preds = %11
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %18, i32 0, i32 3
  store i32 1, ptr %19, align 4, !tbaa !11
  br label %20

20:                                               ; preds = %17
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %23, i32 0, i32 4
  store volatile i32 2, ptr %24, align 8, !tbaa !14
  %25 = load i32, ptr %7, align 4, !tbaa !9
  switch i32 %25, label %44 [
    i32 1, label %26
    i32 2, label %35
  ]

26:                                               ; preds = %22
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !15
  %30 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %29, i32 0, i32 1
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = zext i32 %31 to i64
  %33 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %30, i64 0, i64 %32
  %34 = getelementptr inbounds %struct.HRTIM_Timerx_TypeDef, ptr %33, i32 0, i32 23
  store volatile i32 0, ptr %34, align 4, !tbaa !16
  br label %52

35:                                               ; preds = %22
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %36, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8, !tbaa !15
  %39 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %38, i32 0, i32 1
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = zext i32 %40 to i64
  %42 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %39, i64 0, i64 %41
  %43 = getelementptr inbounds %struct.HRTIM_Timerx_TypeDef, ptr %42, i32 0, i32 24
  store volatile i32 0, ptr %43, align 4, !tbaa !18
  br label %52

44:                                               ; preds = %22
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %45, i32 0, i32 4
  store volatile i32 7, ptr %46, align 8, !tbaa !14
  br label %47

47:                                               ; preds = %44
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %48, i32 0, i32 3
  store i32 0, ptr %49, align 4, !tbaa !11
  br label %50

50:                                               ; preds = %47
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51, %35, %26
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %53, i32 0, i32 4
  %55 = load volatile i32, ptr %54, align 8, !tbaa !14
  %56 = icmp eq i32 %55, 7
  br i1 %56, label %57, label %58

57:                                               ; preds = %52
  store i32 1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %257

58:                                               ; preds = %52
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !15
  %62 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %61, i32 0, i32 1
  %63 = load i32, ptr %6, align 4, !tbaa !9
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %62, i64 0, i64 %64
  %66 = getelementptr inbounds %struct.HRTIM_Timerx_TypeDef, ptr %65, i32 0, i32 23
  %67 = load volatile i32, ptr %66, align 4, !tbaa !16
  store i32 %67, ptr %8, align 4, !tbaa !9
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !15
  %71 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %6, align 4, !tbaa !9
  %73 = zext i32 %72 to i64
  %74 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %71, i64 0, i64 %73
  %75 = getelementptr inbounds %struct.HRTIM_Timerx_TypeDef, ptr %74, i32 0, i32 24
  %76 = load volatile i32, ptr %75, align 4, !tbaa !18
  store i32 %76, ptr %9, align 4, !tbaa !9
  %77 = load i32, ptr %8, align 4, !tbaa !9
  %78 = icmp eq i32 %77, 0
  br i1 %78, label %79, label %249

79:                                               ; preds = %58
  %80 = load i32, ptr %9, align 4, !tbaa !9
  %81 = icmp eq i32 %80, 0
  br i1 %81, label %82, label %249

82:                                               ; preds = %79
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %6, align 4, !tbaa !9
  %85 = zext i32 %84 to i64
  %86 = getelementptr inbounds [6 x i32], ptr @TimerIdxToTimerId, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = zext i32 %87 to i64
  %89 = and i64 %88, 65536
  %90 = icmp eq i64 %89, 65536
  br i1 %90, label %91, label %101

91:                                               ; preds = %83
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !15
  %95 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %94, i32 0, i32 0
  %96 = getelementptr inbounds %struct.HRTIM_Master_TypeDef, ptr %95, i32 0, i32 0
  %97 = load volatile i32, ptr %96, align 4, !tbaa !19
  %98 = zext i32 %97 to i64
  %99 = and i64 %98, -65537
  %100 = trunc i64 %99 to i32
  store volatile i32 %100, ptr %96, align 4, !tbaa !19
  br label %101

101:                                              ; preds = %91, %83
  %102 = load i32, ptr %6, align 4, !tbaa !9
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds [6 x i32], ptr @TimerIdxToTimerId, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !9
  %106 = zext i32 %105 to i64
  %107 = and i64 %106, 131072
  %108 = icmp eq i64 %107, 131072
  br i1 %108, label %109, label %130

109:                                              ; preds = %101
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !15
  %113 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %112, i32 0, i32 3
  %114 = getelementptr inbounds %struct.HRTIM_Common_TypeDef, ptr %113, i32 0, i32 5
  %115 = load volatile i32, ptr %114, align 4, !tbaa !23
  %116 = zext i32 %115 to i64
  %117 = and i64 %116, 3
  %118 = icmp eq i64 %117, 0
  br i1 %118, label %119, label %129

119:                                              ; preds = %109
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %120, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !15
  %123 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %122, i32 0, i32 0
  %124 = getelementptr inbounds %struct.HRTIM_Master_TypeDef, ptr %123, i32 0, i32 0
  %125 = load volatile i32, ptr %124, align 4, !tbaa !19
  %126 = zext i32 %125 to i64
  %127 = and i64 %126, -131073
  %128 = trunc i64 %127 to i32
  store volatile i32 %128, ptr %124, align 4, !tbaa !19
  br label %129

129:                                              ; preds = %119, %109
  br label %130

130:                                              ; preds = %129, %101
  %131 = load i32, ptr %6, align 4, !tbaa !9
  %132 = zext i32 %131 to i64
  %133 = getelementptr inbounds [6 x i32], ptr @TimerIdxToTimerId, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !9
  %135 = zext i32 %134 to i64
  %136 = and i64 %135, 262144
  %137 = icmp eq i64 %136, 262144
  br i1 %137, label %138, label %159

138:                                              ; preds = %130
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !15
  %142 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %141, i32 0, i32 3
  %143 = getelementptr inbounds %struct.HRTIM_Common_TypeDef, ptr %142, i32 0, i32 5
  %144 = load volatile i32, ptr %143, align 4, !tbaa !23
  %145 = zext i32 %144 to i64
  %146 = and i64 %145, 12
  %147 = icmp eq i64 %146, 0
  br i1 %147, label %148, label %158

148:                                              ; preds = %138
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %149, i32 0, i32 0
  %151 = load ptr, ptr %150, align 8, !tbaa !15
  %152 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %151, i32 0, i32 0
  %153 = getelementptr inbounds %struct.HRTIM_Master_TypeDef, ptr %152, i32 0, i32 0
  %154 = load volatile i32, ptr %153, align 4, !tbaa !19
  %155 = zext i32 %154 to i64
  %156 = and i64 %155, -262145
  %157 = trunc i64 %156 to i32
  store volatile i32 %157, ptr %153, align 4, !tbaa !19
  br label %158

158:                                              ; preds = %148, %138
  br label %159

159:                                              ; preds = %158, %130
  %160 = load i32, ptr %6, align 4, !tbaa !9
  %161 = zext i32 %160 to i64
  %162 = getelementptr inbounds [6 x i32], ptr @TimerIdxToTimerId, i64 0, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !9
  %164 = zext i32 %163 to i64
  %165 = and i64 %164, 524288
  %166 = icmp eq i64 %165, 524288
  br i1 %166, label %167, label %188

167:                                              ; preds = %159
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %168, i32 0, i32 0
  %170 = load ptr, ptr %169, align 8, !tbaa !15
  %171 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %170, i32 0, i32 3
  %172 = getelementptr inbounds %struct.HRTIM_Common_TypeDef, ptr %171, i32 0, i32 5
  %173 = load volatile i32, ptr %172, align 4, !tbaa !23
  %174 = zext i32 %173 to i64
  %175 = and i64 %174, 48
  %176 = icmp eq i64 %175, 0
  br i1 %176, label %177, label %187

177:                                              ; preds = %167
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %178, i32 0, i32 0
  %180 = load ptr, ptr %179, align 8, !tbaa !15
  %181 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %180, i32 0, i32 0
  %182 = getelementptr inbounds %struct.HRTIM_Master_TypeDef, ptr %181, i32 0, i32 0
  %183 = load volatile i32, ptr %182, align 4, !tbaa !19
  %184 = zext i32 %183 to i64
  %185 = and i64 %184, -524289
  %186 = trunc i64 %185 to i32
  store volatile i32 %186, ptr %182, align 4, !tbaa !19
  br label %187

187:                                              ; preds = %177, %167
  br label %188

188:                                              ; preds = %187, %159
  %189 = load i32, ptr %6, align 4, !tbaa !9
  %190 = zext i32 %189 to i64
  %191 = getelementptr inbounds [6 x i32], ptr @TimerIdxToTimerId, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !9
  %193 = zext i32 %192 to i64
  %194 = and i64 %193, 1048576
  %195 = icmp eq i64 %194, 1048576
  br i1 %195, label %196, label %217

196:                                              ; preds = %188
  %197 = load ptr, ptr %5, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %197, i32 0, i32 0
  %199 = load ptr, ptr %198, align 8, !tbaa !15
  %200 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %199, i32 0, i32 3
  %201 = getelementptr inbounds %struct.HRTIM_Common_TypeDef, ptr %200, i32 0, i32 5
  %202 = load volatile i32, ptr %201, align 4, !tbaa !23
  %203 = zext i32 %202 to i64
  %204 = and i64 %203, 192
  %205 = icmp eq i64 %204, 0
  br i1 %205, label %206, label %216

206:                                              ; preds = %196
  %207 = load ptr, ptr %5, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %207, i32 0, i32 0
  %209 = load ptr, ptr %208, align 8, !tbaa !15
  %210 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %209, i32 0, i32 0
  %211 = getelementptr inbounds %struct.HRTIM_Master_TypeDef, ptr %210, i32 0, i32 0
  %212 = load volatile i32, ptr %211, align 4, !tbaa !19
  %213 = zext i32 %212 to i64
  %214 = and i64 %213, -1048577
  %215 = trunc i64 %214 to i32
  store volatile i32 %215, ptr %211, align 4, !tbaa !19
  br label %216

216:                                              ; preds = %206, %196
  br label %217

217:                                              ; preds = %216, %188
  %218 = load i32, ptr %6, align 4, !tbaa !9
  %219 = zext i32 %218 to i64
  %220 = getelementptr inbounds [6 x i32], ptr @TimerIdxToTimerId, i64 0, i64 %219
  %221 = load i32, ptr %220, align 4, !tbaa !9
  %222 = zext i32 %221 to i64
  %223 = and i64 %222, 2097152
  %224 = icmp eq i64 %223, 2097152
  br i1 %224, label %225, label %246

225:                                              ; preds = %217
  %226 = load ptr, ptr %5, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %226, i32 0, i32 0
  %228 = load ptr, ptr %227, align 8, !tbaa !15
  %229 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %228, i32 0, i32 3
  %230 = getelementptr inbounds %struct.HRTIM_Common_TypeDef, ptr %229, i32 0, i32 5
  %231 = load volatile i32, ptr %230, align 4, !tbaa !23
  %232 = zext i32 %231 to i64
  %233 = and i64 %232, 768
  %234 = icmp eq i64 %233, 0
  br i1 %234, label %235, label %245

235:                                              ; preds = %225
  %236 = load ptr, ptr %5, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %236, i32 0, i32 0
  %238 = load ptr, ptr %237, align 8, !tbaa !15
  %239 = getelementptr inbounds %struct.HRTIM_TypeDef, ptr %238, i32 0, i32 0
  %240 = getelementptr inbounds %struct.HRTIM_Master_TypeDef, ptr %239, i32 0, i32 0
  %241 = load volatile i32, ptr %240, align 4, !tbaa !19
  %242 = zext i32 %241 to i64
  %243 = and i64 %242, -2097153
  %244 = trunc i64 %243 to i32
  store volatile i32 %244, ptr %240, align 4, !tbaa !19
  br label %245

245:                                              ; preds = %235, %225
  br label %246

246:                                              ; preds = %245, %217
  br label %247

247:                                              ; preds = %246
  br label %248

248:                                              ; preds = %247
  br label %249

249:                                              ; preds = %248, %79, %58
  %250 = load ptr, ptr %5, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %250, i32 0, i32 4
  store volatile i32 1, ptr %251, align 8, !tbaa !14
  br label %252

252:                                              ; preds = %249
  %253 = load ptr, ptr %5, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.HRTIM_HandleTypeDef, ptr %253, i32 0, i32 3
  store i32 0, ptr %254, align 4, !tbaa !11
  br label %255

255:                                              ; preds = %252
  br label %256

256:                                              ; preds = %255
  store i32 0, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %257

257:                                              ; preds = %256, %57, %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  %258 = load i32, ptr %4, align 4
  ret i32 %258
}

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 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 196}
!12 = !{!"", !6, i64 0, !13, i64 8, !7, i64 28, !10, i64 196, !10, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248}
!13 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16}
!14 = !{!12, !10, i64 200}
!15 = !{!12, !6, i64 0}
!16 = !{!17, !10, i64 92}
!17 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !7, i64 108}
!18 = !{!17, !10, i64 96}
!19 = !{!20, !10, i64 0}
!20 = !{!"", !21, i64 0, !7, i64 128, !7, i64 768, !22, i64 896}
!21 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !7, i64 48}
!22 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112}
!23 = !{!20, !10, i64 916}


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

%struct.HRTIM_Timerx_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [5 x i32] }

@TimerIdxToTimerId = external hidden local_unnamed_addr global [6 x i32], align 16

; Function Attrs: nofree norecurse nounwind uwtable
define dso_local range(i32 0, 3) i32 @HAL_HRTIM_SimpleCaptureStop(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 196
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = icmp eq i32 %5, 1
  br i1 %6, label %96, label %7

7:                                                ; preds = %3
  store i32 1, ptr %4, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 200
  store volatile i32 2, ptr %8, align 8, !tbaa !12
  switch i32 %2, label %19 [
    i32 1, label %9
    i32 2, label %14
  ]

9:                                                ; preds = %7
  %10 = load ptr, ptr %0, align 8, !tbaa !13
  %11 = getelementptr inbounds i8, ptr %10, i64 128
  %12 = zext i32 %1 to i64
  %13 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %11, i64 0, i64 %12, i32 23
  store volatile i32 0, ptr %13, align 4, !tbaa !14
  br label %20

14:                                               ; preds = %7
  %15 = load ptr, ptr %0, align 8, !tbaa !13
  %16 = getelementptr inbounds i8, ptr %15, i64 128
  %17 = zext i32 %1 to i64
  %18 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %16, i64 0, i64 %17, i32 24
  store volatile i32 0, ptr %18, align 4, !tbaa !16
  br label %20

19:                                               ; preds = %7
  store volatile i32 7, ptr %8, align 8, !tbaa !12
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %19, %14, %9
  %21 = load volatile i32, ptr %8, align 8, !tbaa !12
  %22 = icmp eq i32 %21, 7
  br i1 %22, label %96, label %23

23:                                               ; preds = %20
  %24 = load ptr, ptr %0, align 8, !tbaa !13
  %25 = getelementptr inbounds i8, ptr %24, i64 128
  %26 = zext i32 %1 to i64
  %27 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %25, i64 0, i64 %26, i32 23
  %28 = load volatile i32, ptr %27, align 4, !tbaa !14
  %29 = getelementptr inbounds [5 x %struct.HRTIM_Timerx_TypeDef], ptr %25, i64 0, i64 %26, i32 24
  %30 = load volatile i32, ptr %29, align 4, !tbaa !16
  %31 = icmp eq i32 %28, 0
  %32 = icmp eq i32 %30, 0
  %or.cond = select i1 %31, i1 %32, i1 false
  br i1 %or.cond, label %33, label %95

33:                                               ; preds = %23
  %34 = getelementptr inbounds [6 x i32], ptr @TimerIdxToTimerId, i64 0, i64 %26
  %35 = load i32, ptr %34, align 4, !tbaa !17
  %36 = and i32 %35, 65536
  %.not = icmp eq i32 %36, 0
  br i1 %.not, label %40, label %37

37:                                               ; preds = %33
  %38 = load volatile i32, ptr %24, align 4, !tbaa !18
  %39 = and i32 %38, -65537
  store volatile i32 %39, ptr %24, align 4, !tbaa !18
  %.pre = load i32, ptr %34, align 4, !tbaa !17
  br label %40

40:                                               ; preds = %37, %33
  %41 = phi i32 [ %.pre, %37 ], [ %35, %33 ]
  %42 = and i32 %41, 131072
  %.not37 = icmp eq i32 %42, 0
  br i1 %.not37, label %51, label %43

43:                                               ; preds = %40
  %44 = getelementptr inbounds i8, ptr %24, i64 916
  %45 = load volatile i32, ptr %44, align 4, !tbaa !22
  %46 = and i32 %45, 3
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %51

48:                                               ; preds = %43
  %49 = load volatile i32, ptr %24, align 4, !tbaa !18
  %50 = and i32 %49, -131073
  store volatile i32 %50, ptr %24, align 4, !tbaa !18
  %.pre42 = load i32, ptr %34, align 4, !tbaa !17
  br label %51

51:                                               ; preds = %43, %48, %40
  %52 = phi i32 [ %41, %43 ], [ %.pre42, %48 ], [ %41, %40 ]
  %53 = and i32 %52, 262144
  %.not38 = icmp eq i32 %53, 0
  br i1 %.not38, label %62, label %54

54:                                               ; preds = %51
  %55 = getelementptr inbounds i8, ptr %24, i64 916
  %56 = load volatile i32, ptr %55, align 4, !tbaa !22
  %57 = and i32 %56, 12
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %62

59:                                               ; preds = %54
  %60 = load volatile i32, ptr %24, align 4, !tbaa !18
  %61 = and i32 %60, -262145
  store volatile i32 %61, ptr %24, align 4, !tbaa !18
  %.pre43 = load i32, ptr %34, align 4, !tbaa !17
  br label %62

62:                                               ; preds = %54, %59, %51
  %63 = phi i32 [ %52, %54 ], [ %.pre43, %59 ], [ %52, %51 ]
  %64 = and i32 %63, 524288
  %.not39 = icmp eq i32 %64, 0
  br i1 %.not39, label %73, label %65

65:                                               ; preds = %62
  %66 = getelementptr inbounds i8, ptr %24, i64 916
  %67 = load volatile i32, ptr %66, align 4, !tbaa !22
  %68 = and i32 %67, 48
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %73

70:                                               ; preds = %65
  %71 = load volatile i32, ptr %24, align 4, !tbaa !18
  %72 = and i32 %71, -524289
  store volatile i32 %72, ptr %24, align 4, !tbaa !18
  %.pre44 = load i32, ptr %34, align 4, !tbaa !17
  br label %73

73:                                               ; preds = %65, %70, %62
  %74 = phi i32 [ %63, %65 ], [ %.pre44, %70 ], [ %63, %62 ]
  %75 = and i32 %74, 1048576
  %.not40 = icmp eq i32 %75, 0
  br i1 %.not40, label %84, label %76

76:                                               ; preds = %73
  %77 = getelementptr inbounds i8, ptr %24, i64 916
  %78 = load volatile i32, ptr %77, align 4, !tbaa !22
  %79 = and i32 %78, 192
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %81, label %84

81:                                               ; preds = %76
  %82 = load volatile i32, ptr %24, align 4, !tbaa !18
  %83 = and i32 %82, -1048577
  store volatile i32 %83, ptr %24, align 4, !tbaa !18
  %.pre45 = load i32, ptr %34, align 4, !tbaa !17
  br label %84

84:                                               ; preds = %76, %81, %73
  %85 = phi i32 [ %74, %76 ], [ %.pre45, %81 ], [ %74, %73 ]
  %86 = and i32 %85, 2097152
  %.not41 = icmp eq i32 %86, 0
  br i1 %.not41, label %95, label %87

87:                                               ; preds = %84
  %88 = getelementptr inbounds i8, ptr %24, i64 916
  %89 = load volatile i32, ptr %88, align 4, !tbaa !22
  %90 = and i32 %89, 768
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %92, label %95

92:                                               ; preds = %87
  %93 = load volatile i32, ptr %24, align 4, !tbaa !18
  %94 = and i32 %93, -2097153
  store volatile i32 %94, ptr %24, align 4, !tbaa !18
  br label %95

95:                                               ; preds = %84, %92, %87, %23
  store volatile i32 1, ptr %8, align 8, !tbaa !12
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %20, %3, %95
  %.0 = phi i32 [ 0, %95 ], [ 2, %3 ], [ 1, %20 ]
  ret i32 %.0
}

attributes #0 = { nofree norecurse 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" }

!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, !11, i64 196}
!6 = !{!"", !7, i64 0, !10, i64 8, !8, i64 28, !11, i64 196, !11, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !11, i64 200}
!13 = !{!6, !7, i64 0}
!14 = !{!15, !11, i64 92}
!15 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !8, i64 108}
!16 = !{!15, !11, i64 96}
!17 = !{!11, !11, i64 0}
!18 = !{!19, !11, i64 0}
!19 = !{!"", !20, i64 0, !8, i64 128, !8, i64 768, !21, i64 896}
!20 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !8, i64 48}
!21 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112}
!22 = !{!19, !11, i64 916}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass