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

; 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.DFSDM_Filter_HandleTypeDef = type { ptr, %struct.DFSDM_Filter_InitTypeDef, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.DFSDM_Filter_InitTypeDef = type { %struct.DFSDM_Filter_RegularParamTypeDef, %struct.DFSDM_Filter_InjectedParamTypeDef, %struct.DFSDM_Filter_FilterParamTypeDef }
%struct.DFSDM_Filter_RegularParamTypeDef = type { i32, i32, i32 }
%struct.DFSDM_Filter_InjectedParamTypeDef = type { i32, i32, i32, i32, i32 }
%struct.DFSDM_Filter_FilterParamTypeDef = type { i32, i32, i32 }
%struct.DFSDM_Filter_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.DFSDM_Filter_AwdParamTypeDef = type { i32, i32, i32, i32, i32, i32 }

; 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_DFSDM_FilterAwdStart_IT(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  store i32 0, ptr %5, align 4, !tbaa !9
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.DFSDM_Filter_HandleTypeDef, ptr %6, i32 0, i32 11
  %8 = load i32, ptr %7, align 4, !tbaa !11
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %15, label %10

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

15:                                               ; preds = %10, %2
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %101

16:                                               ; preds = %10
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.DFSDM_Filter_HandleTypeDef, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !16
  %20 = getelementptr inbounds %struct.DFSDM_Filter_TypeDef, ptr %19, i32 0, i32 0
  %21 = load volatile i32, ptr %20, align 4, !tbaa !17
  %22 = zext i32 %21 to i64
  %23 = and i64 %22, -1073741825
  %24 = trunc i64 %23 to i32
  store volatile i32 %24, ptr %20, align 4, !tbaa !17
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.DFSDM_Filter_AwdParamTypeDef, ptr %25, i32 0, i32 0
  %27 = load i32, ptr %26, align 4, !tbaa !19
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.DFSDM_Filter_HandleTypeDef, ptr %28, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8, !tbaa !16
  %31 = getelementptr inbounds %struct.DFSDM_Filter_TypeDef, ptr %30, i32 0, i32 0
  %32 = load volatile i32, ptr %31, align 4, !tbaa !17
  %33 = or i32 %32, %27
  store volatile i32 %33, ptr %31, align 4, !tbaa !17
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.DFSDM_Filter_HandleTypeDef, ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !16
  %37 = getelementptr inbounds %struct.DFSDM_Filter_TypeDef, ptr %36, i32 0, i32 8
  %38 = load volatile i32, ptr %37, align 4, !tbaa !21
  %39 = zext i32 %38 to i64
  %40 = and i64 %39, -4294967056
  %41 = trunc i64 %40 to i32
  store volatile i32 %41, ptr %37, align 4, !tbaa !21
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.DFSDM_Filter_AwdParamTypeDef, ptr %42, i32 0, i32 2
  %44 = load i32, ptr %43, align 4, !tbaa !22
  %45 = shl i32 %44, 8
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.DFSDM_Filter_AwdParamTypeDef, ptr %46, i32 0, i32 4
  %48 = load i32, ptr %47, align 4, !tbaa !23
  %49 = or i32 %45, %48
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.DFSDM_Filter_HandleTypeDef, ptr %50, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !16
  %53 = getelementptr inbounds %struct.DFSDM_Filter_TypeDef, ptr %52, i32 0, i32 8
  %54 = load volatile i32, ptr %53, align 4, !tbaa !21
  %55 = or i32 %54, %49
  store volatile i32 %55, ptr %53, align 4, !tbaa !21
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.DFSDM_Filter_HandleTypeDef, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !16
  %59 = getelementptr inbounds %struct.DFSDM_Filter_TypeDef, ptr %58, i32 0, i32 9
  %60 = load volatile i32, ptr %59, align 4, !tbaa !24
  %61 = zext i32 %60 to i64
  %62 = and i64 %61, -4294967056
  %63 = trunc i64 %62 to i32
  store volatile i32 %63, ptr %59, align 4, !tbaa !24
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.DFSDM_Filter_AwdParamTypeDef, ptr %64, i32 0, i32 3
  %66 = load i32, ptr %65, align 4, !tbaa !25
  %67 = shl i32 %66, 8
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.DFSDM_Filter_AwdParamTypeDef, ptr %68, i32 0, i32 5
  %70 = load i32, ptr %69, align 4, !tbaa !26
  %71 = or i32 %67, %70
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.DFSDM_Filter_HandleTypeDef, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !16
  %75 = getelementptr inbounds %struct.DFSDM_Filter_TypeDef, ptr %74, i32 0, i32 9
  %76 = load volatile i32, ptr %75, align 4, !tbaa !24
  %77 = or i32 %76, %71
  store volatile i32 %77, ptr %75, align 4, !tbaa !24
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.DFSDM_Filter_HandleTypeDef, ptr %78, i32 0, i32 0
  %80 = load ptr, ptr %79, align 8, !tbaa !16
  %81 = getelementptr inbounds %struct.DFSDM_Filter_TypeDef, ptr %80, i32 0, i32 1
  %82 = load volatile i32, ptr %81, align 4, !tbaa !27
  %83 = zext i32 %82 to i64
  %84 = and i64 %83, -16711681
  %85 = trunc i64 %84 to i32
  store volatile i32 %85, ptr %81, align 4, !tbaa !27
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.DFSDM_Filter_AwdParamTypeDef, ptr %86, i32 0, i32 1
  %88 = load i32, ptr %87, align 4, !tbaa !28
  %89 = and i32 %88, 65535
  %90 = shl i32 %89, 16
  %91 = zext i32 %90 to i64
  %92 = or i64 %91, 16
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.DFSDM_Filter_HandleTypeDef, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !16
  %96 = getelementptr inbounds %struct.DFSDM_Filter_TypeDef, ptr %95, i32 0, i32 1
  %97 = load volatile i32, ptr %96, align 4, !tbaa !27
  %98 = zext i32 %97 to i64
  %99 = or i64 %98, %92
  %100 = trunc i64 %99 to i32
  store volatile i32 %100, ptr %96, align 4, !tbaa !27
  br label %101

101:                                              ; preds = %16, %15
  %102 = load i32, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  ret i32 %102
}

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 100}
!12 = !{!"", !6, i64 0, !13, i64 8, !6, i64 56, !6, i64 64, !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}
!13 = !{!"", !14, i64 0, !15, i64 12, !14, i64 32}
!14 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8}
!15 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16}
!16 = !{!12, !6, i64 0}
!17 = !{!18, !10, i64 0}
!18 = !{!"", !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}
!19 = !{!20, !10, i64 0}
!20 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!21 = !{!18, !10, i64 32}
!22 = !{!20, !10, i64 8}
!23 = !{!20, !10, i64 16}
!24 = !{!18, !10, i64 36}
!25 = !{!20, !10, i64 12}
!26 = !{!20, !10, i64 20}
!27 = !{!18, !10, i64 4}
!28 = !{!20, !10, i64 4}


; 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: nofree norecurse nounwind uwtable
define dso_local range(i32 0, 2) i32 @HAL_DFSDM_FilterAwdStart_IT(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 100
  %4 = load i32, ptr %3, align 4, !tbaa !5
  switch i32 %4, label %5 [
    i32 0, label %43
    i32 255, label %43
  ]

5:                                                ; preds = %2
  %6 = load ptr, ptr %0, align 8, !tbaa !14
  %7 = load volatile i32, ptr %6, align 4, !tbaa !15
  %8 = and i32 %7, -1073741825
  store volatile i32 %8, ptr %6, align 4, !tbaa !15
  %9 = load i32, ptr %1, align 4, !tbaa !17
  %10 = load volatile i32, ptr %6, align 4, !tbaa !15
  %11 = or i32 %10, %9
  store volatile i32 %11, ptr %6, align 4, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %6, i64 32
  %13 = load volatile i32, ptr %12, align 4, !tbaa !19
  %14 = and i32 %13, 240
  store volatile i32 %14, ptr %12, align 4, !tbaa !19
  %15 = getelementptr inbounds i8, ptr %1, i64 8
  %16 = load i32, ptr %15, align 4, !tbaa !20
  %17 = shl i32 %16, 8
  %18 = getelementptr inbounds i8, ptr %1, i64 16
  %19 = load i32, ptr %18, align 4, !tbaa !21
  %20 = or i32 %17, %19
  %21 = load volatile i32, ptr %12, align 4, !tbaa !19
  %22 = or i32 %20, %21
  store volatile i32 %22, ptr %12, align 4, !tbaa !19
  %23 = getelementptr inbounds i8, ptr %6, i64 36
  %24 = load volatile i32, ptr %23, align 4, !tbaa !22
  %25 = and i32 %24, 240
  store volatile i32 %25, ptr %23, align 4, !tbaa !22
  %26 = getelementptr inbounds i8, ptr %1, i64 12
  %27 = load i32, ptr %26, align 4, !tbaa !23
  %28 = shl i32 %27, 8
  %29 = getelementptr inbounds i8, ptr %1, i64 20
  %30 = load i32, ptr %29, align 4, !tbaa !24
  %31 = or i32 %28, %30
  %32 = load volatile i32, ptr %23, align 4, !tbaa !22
  %33 = or i32 %31, %32
  store volatile i32 %33, ptr %23, align 4, !tbaa !22
  %34 = getelementptr inbounds i8, ptr %6, i64 4
  %35 = load volatile i32, ptr %34, align 4, !tbaa !25
  %36 = and i32 %35, -16711681
  store volatile i32 %36, ptr %34, align 4, !tbaa !25
  %37 = getelementptr inbounds i8, ptr %1, i64 4
  %38 = load i32, ptr %37, align 4, !tbaa !26
  %39 = shl i32 %38, 16
  %40 = load volatile i32, ptr %34, align 4, !tbaa !25
  %41 = or i32 %39, %40
  %42 = or i32 %41, 16
  store volatile i32 %42, ptr %34, align 4, !tbaa !25
  br label %43

43:                                               ; preds = %2, %2, %5
  %.0 = phi i32 [ 0, %5 ], [ 1, %2 ], [ 1, %2 ]
  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, !12, i64 100}
!6 = !{!"", !7, i64 0, !10, i64 8, !7, i64 56, !7, i64 64, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !13, i64 12, !11, i64 32}
!11 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8}
!12 = !{!"int", !8, i64 0}
!13 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16}
!14 = !{!6, !7, i64 0}
!15 = !{!16, !12, i64 0}
!16 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56}
!17 = !{!18, !12, i64 0}
!18 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!19 = !{!16, !12, i64 32}
!20 = !{!18, !12, i64 8}
!21 = !{!18, !12, i64 16}
!22 = !{!16, !12, i64 36}
!23 = !{!18, !12, i64 12}
!24 = !{!18, !12, i64 20}
!25 = !{!16, !12, i64 4}
!26 = !{!18, !12, i64 4}


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