; LLVM IR from lichen-community-systems/signaletic :: hosts/daisy/vendor/libDaisy/src/per (spiMultislave)

; 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.daisy::SpiHandle::Config" = type { %struct.anon.0, i32, i32, i32, i64, i32, i32, i32, i32 }
%struct.anon.0 = type { %struct.dsy_gpio_pin, %struct.dsy_gpio_pin, %struct.dsy_gpio_pin, %struct.dsy_gpio_pin }
%struct.dsy_gpio_pin = type { i32, i8 }
%"struct.daisy::MultiSlaveSpiHandle::Config" = type { %struct.anon, i32, i32, i64, i32, i32, i32, i64 }
%struct.anon = type { %struct.dsy_gpio_pin, %struct.dsy_gpio_pin, %struct.dsy_gpio_pin, [4 x %struct.dsy_gpio_pin] }
%"class.daisy::MultiSlaveSpiHandle" = type { %"struct.daisy::MultiSlaveSpiHandle::Config", %"class.daisy::SpiHandle", [4 x %struct.dsy_gpio], %"struct.daisy::MultiSlaveSpiHandle::DmaTransfer" }
%"class.daisy::SpiHandle" = type { ptr }
%struct.dsy_gpio = type { %struct.dsy_gpio_pin, i32, i32 }
%"struct.daisy::MultiSlaveSpiHandle::DmaTransfer" = type { i8, ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5daisy19MultiSlaveSpiHandle4InitERKNS0_6ConfigE(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(96) %1) #0 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"struct.daisy::SpiHandle::Config", align 8
  %8 = alloca %struct.dsy_gpio_pin, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = getelementptr inbounds %"struct.daisy::MultiSlaveSpiHandle::Config", ptr %10, i32 0, i32 7
  %12 = load i64, ptr %11, align 8, !tbaa !9
  %13 = icmp uge i64 %12, 4
  br i1 %13, label %14, label %15

14:                                               ; preds = %2
  store i32 1, ptr %3, align 4
  br label %99

15:                                               ; preds = %2
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %"class.daisy::MultiSlaveSpiHandle", ptr %9, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %16, i64 96, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 0, ptr %6, align 8, !tbaa !25
  br label %18

18:                                               ; preds = %47, %15
  %19 = load i64, ptr %6, align 8, !tbaa !25
  %20 = getelementptr inbounds %"class.daisy::MultiSlaveSpiHandle", ptr %9, i32 0, i32 0
  %21 = getelementptr inbounds %"struct.daisy::MultiSlaveSpiHandle::Config", ptr %20, i32 0, i32 7
  %22 = load i64, ptr %21, align 8, !tbaa !29
  %23 = icmp ult i64 %19, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %50

25:                                               ; preds = %18
  %26 = getelementptr inbounds %"class.daisy::MultiSlaveSpiHandle", ptr %9, i32 0, i32 0
  %27 = getelementptr inbounds %"struct.daisy::MultiSlaveSpiHandle::Config", ptr %26, i32 0, i32 0
  %28 = getelementptr inbounds %struct.anon, ptr %27, i32 0, i32 3
  %29 = load i64, ptr %6, align 8, !tbaa !25
  %30 = getelementptr inbounds [4 x %struct.dsy_gpio_pin], ptr %28, i64 0, i64 %29
  %31 = getelementptr inbounds %"class.daisy::MultiSlaveSpiHandle", ptr %9, i32 0, i32 2
  %32 = load i64, ptr %6, align 8, !tbaa !25
  %33 = getelementptr inbounds [4 x %struct.dsy_gpio], ptr %31, i64 0, i64 %32
  %34 = getelementptr inbounds %struct.dsy_gpio, ptr %33, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %34, ptr align 8 %30, i64 8, i1 false), !tbaa.struct !33
  %35 = getelementptr inbounds %"class.daisy::MultiSlaveSpiHandle", ptr %9, i32 0, i32 2
  %36 = load i64, ptr %6, align 8, !tbaa !25
  %37 = getelementptr inbounds [4 x %struct.dsy_gpio], ptr %35, i64 0, i64 %36
  %38 = getelementptr inbounds %struct.dsy_gpio, ptr %37, i32 0, i32 1
  store i32 1, ptr %38, align 8, !tbaa !34
  %39 = getelementptr inbounds %"class.daisy::MultiSlaveSpiHandle", ptr %9, i32 0, i32 2
  %40 = load i64, ptr %6, align 8, !tbaa !25
  %41 = getelementptr inbounds [4 x %struct.dsy_gpio], ptr %39, i64 0, i64 %40
  %42 = getelementptr inbounds %struct.dsy_gpio, ptr %41, i32 0, i32 2
  store i32 0, ptr %42, align 4, !tbaa !38
  %43 = getelementptr inbounds %"class.daisy::MultiSlaveSpiHandle", ptr %9, i32 0, i32 2
  %44 = load i64, ptr %6, align 8, !tbaa !25
  %45 = getelementptr inbounds [4 x %struct.dsy_gpio], ptr %43, i64 0, i64 %44
  call void @dsy_gpio_init(ptr noundef %45)
  %46 = load i64, ptr %6, align 8, !tbaa !25
  call void @_ZN5daisy19MultiSlaveSpiHandle13DisableDeviceEm(ptr noundef nonnull align 8 dereferenceable(200) %9, i64 noundef %46)
  br label %47

47:                                               ; preds = %25
  %48 = load i64, ptr %6, align 8, !tbaa !25
  %49 = add i64 %48, 1
  store i64 %49, ptr %6, align 8, !tbaa !25
  br label %18, !llvm.loop !39

50:                                               ; preds = %24
  %51 = getelementptr inbounds %"class.daisy::MultiSlaveSpiHandle", ptr %9, i32 0, i32 3
  call void @_ZN5daisy19MultiSlaveSpiHandle11DmaTransfer10InvalidateEv(ptr noundef nonnull align 8 dereferenceable(32) %51)
  call void @llvm.lifetime.start.p0(i64 72, ptr %7) #5
  call void @_ZN5daisy9SpiHandle6ConfigC2Ev(ptr noundef nonnull align 8 dereferenceable(72) %7)
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.daisy::MultiSlaveSpiHandle::Config", ptr %52, i32 0, i32 6
  %54 = load i32, ptr %53, align 8, !tbaa !41
  %55 = getelementptr inbounds %"struct.daisy::SpiHandle::Config", ptr %7, i32 0, i32 8
  store i32 %54, ptr %55, align 4, !tbaa !42
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %"struct.daisy::MultiSlaveSpiHandle::Config", ptr %56, i32 0, i32 5
  %58 = load i32, ptr %57, align 4, !tbaa !47
  %59 = getelementptr inbounds %"struct.daisy::SpiHandle::Config", ptr %7, i32 0, i32 6
  store i32 %58, ptr %59, align 4, !tbaa !48
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.daisy::MultiSlaveSpiHandle::Config", ptr %60, i32 0, i32 4
  %62 = load i32, ptr %61, align 8, !tbaa !49
  %63 = getelementptr inbounds %"struct.daisy::SpiHandle::Config", ptr %7, i32 0, i32 5
  store i32 %62, ptr %63, align 8, !tbaa !50
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.daisy::MultiSlaveSpiHandle::Config", ptr %64, i32 0, i32 3
  %66 = load i64, ptr %65, align 8, !tbaa !51
  %67 = getelementptr inbounds %"struct.daisy::SpiHandle::Config", ptr %7, i32 0, i32 4
  store i64 %66, ptr %67, align 8, !tbaa !52
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.daisy::MultiSlaveSpiHandle::Config", ptr %68, i32 0, i32 2
  %70 = load i32, ptr %69, align 4, !tbaa !53
  %71 = getelementptr inbounds %"struct.daisy::SpiHandle::Config", ptr %7, i32 0, i32 3
  store i32 %70, ptr %71, align 8, !tbaa !54
  %72 = getelementptr inbounds %"struct.daisy::SpiHandle::Config", ptr %7, i32 0, i32 2
  store i32 0, ptr %72, align 4, !tbaa !55
  %73 = getelementptr inbounds %"struct.daisy::SpiHandle::Config", ptr %7, i32 0, i32 7
  store i32 0, ptr %73, align 8, !tbaa !56
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.daisy::MultiSlaveSpiHandle::Config", ptr %74, i32 0, i32 1
  %76 = load i32, ptr %75, align 8, !tbaa !57
  %77 = getelementptr inbounds %"struct.daisy::SpiHandle::Config", ptr %7, i32 0, i32 1
  store i32 %76, ptr %77, align 8, !tbaa !58
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.daisy::MultiSlaveSpiHandle::Config", ptr %78, i32 0, i32 0
  %80 = getelementptr inbounds %struct.anon, ptr %79, i32 0, i32 1
  %81 = getelementptr inbounds %"struct.daisy::SpiHandle::Config", ptr %7, i32 0, i32 0
  %82 = getelementptr inbounds %struct.anon.0, ptr %81, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %82, ptr align 8 %80, i64 8, i1 false), !tbaa.struct !33
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %"struct.daisy::MultiSlaveSpiHandle::Config", ptr %83, i32 0, i32 0
  %85 = getelementptr inbounds %struct.anon, ptr %84, i32 0, i32 2
  %86 = getelementptr inbounds %"struct.daisy::SpiHandle::Config", ptr %7, i32 0, i32 0
  %87 = getelementptr inbounds %struct.anon.0, ptr %86, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %87, ptr align 8 %85, i64 8, i1 false), !tbaa.struct !33
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.daisy::MultiSlaveSpiHandle::Config", ptr %88, i32 0, i32 0
  %90 = getelementptr inbounds %struct.anon, ptr %89, i32 0, i32 0
  %91 = getelementptr inbounds %"struct.daisy::SpiHandle::Config", ptr %7, i32 0, i32 0
  %92 = getelementptr inbounds %struct.anon.0, ptr %91, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %92, ptr align 8 %90, i64 8, i1 false), !tbaa.struct !33
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %93 = getelementptr inbounds %struct.dsy_gpio_pin, ptr %8, i32 0, i32 0
  store i32 11, ptr %93, align 4, !tbaa !59
  %94 = getelementptr inbounds %struct.dsy_gpio_pin, ptr %8, i32 0, i32 1
  store i8 0, ptr %94, align 4, !tbaa !60
  %95 = getelementptr inbounds %"struct.daisy::SpiHandle::Config", ptr %7, i32 0, i32 0
  %96 = getelementptr inbounds %struct.anon.0, ptr %95, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %96, ptr align 4 %8, i64 8, i1 false), !tbaa.struct !33
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %97 = getelementptr inbounds %"class.daisy::MultiSlaveSpiHandle", ptr %9, i32 0, i32 1
  %98 = call noundef i32 @_ZN5daisy9SpiHandle4InitERKNS0_6ConfigE(ptr noundef nonnull align 8 dereferenceable(8) %97, ptr noundef nonnull align 8 dereferenceable(72) %7)
  store i32 %98, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 72, ptr %7) #5
  br label %99

99:                                               ; preds = %50, %14
  %100 = load i32, ptr %3, align 4
  ret i32 %100
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

declare void @dsy_gpio_init(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5daisy19MultiSlaveSpiHandle13DisableDeviceEm(ptr noundef nonnull align 8 dereferenceable(200), i64 noundef) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5daisy19MultiSlaveSpiHandle11DmaTransfer10InvalidateEv(ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5daisy9SpiHandle6ConfigC2Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #4 align 2

declare noundef i32 @_ZN5daisy9SpiHandle4InitERKNS0_6ConfigE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(72)) #3

attributes #0 = { 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { 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 = { 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++ TBAA"}
!9 = !{!10, !16, i64 88}
!10 = !{!"_ZTSN5daisy19MultiSlaveSpiHandle6ConfigE", !11, i64 0, !14, i64 56, !15, i64 60, !16, i64 64, !17, i64 72, !18, i64 76, !19, i64 80, !16, i64 88}
!11 = !{!"_ZTSN5daisy19MultiSlaveSpiHandle6ConfigUt_E", !12, i64 0, !12, i64 8, !12, i64 16, !7, i64 24}
!12 = !{!"_ZTS12dsy_gpio_pin", !13, i64 0, !7, i64 4}
!13 = !{!"_ZTS13dsy_gpio_port", !7, i64 0}
!14 = !{!"_ZTSN5daisy9SpiHandle6Config10PeripheralE", !7, i64 0}
!15 = !{!"_ZTSN5daisy9SpiHandle6Config9DirectionE", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSN5daisy9SpiHandle6Config13ClockPolarityE", !7, i64 0}
!18 = !{!"_ZTSN5daisy9SpiHandle6Config10ClockPhaseE", !7, i64 0}
!19 = !{!"_ZTSN5daisy9SpiHandle6Config13BaudPrescalerE", !7, i64 0}
!20 = !{i64 0, i64 4, !21, i64 4, i64 1, !22, i64 8, i64 4, !21, i64 12, i64 1, !22, i64 16, i64 4, !21, i64 20, i64 1, !22, i64 24, i64 32, !22, i64 56, i64 4, !23, i64 60, i64 4, !24, i64 64, i64 8, !25, i64 72, i64 4, !26, i64 76, i64 4, !27, i64 80, i64 4, !28, i64 88, i64 8, !25}
!21 = !{!13, !13, i64 0}
!22 = !{!7, !7, i64 0}
!23 = !{!14, !14, i64 0}
!24 = !{!15, !15, i64 0}
!25 = !{!16, !16, i64 0}
!26 = !{!17, !17, i64 0}
!27 = !{!18, !18, i64 0}
!28 = !{!19, !19, i64 0}
!29 = !{!30, !16, i64 88}
!30 = !{!"_ZTSN5daisy19MultiSlaveSpiHandleE", !10, i64 0, !31, i64 96, !7, i64 104, !32, i64 168}
!31 = !{!"_ZTSN5daisy9SpiHandleE", !6, i64 0}
!32 = !{!"_ZTSN5daisy19MultiSlaveSpiHandle11DmaTransferE", !7, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!33 = !{i64 0, i64 4, !21, i64 4, i64 1, !22}
!34 = !{!35, !36, i64 8}
!35 = !{!"_ZTS8dsy_gpio", !12, i64 0, !36, i64 8, !37, i64 12}
!36 = !{!"_ZTS13dsy_gpio_mode", !7, i64 0}
!37 = !{!"_ZTS13dsy_gpio_pull", !7, i64 0}
!38 = !{!35, !37, i64 12}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{!10, !19, i64 80}
!42 = !{!43, !19, i64 68}
!43 = !{!"_ZTSN5daisy9SpiHandle6ConfigE", !44, i64 0, !14, i64 32, !45, i64 36, !15, i64 40, !16, i64 48, !17, i64 56, !18, i64 60, !46, i64 64, !19, i64 68}
!44 = !{!"_ZTSN5daisy9SpiHandle6ConfigUt_E", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!45 = !{!"_ZTSN5daisy9SpiHandle6Config4ModeE", !7, i64 0}
!46 = !{!"_ZTSN5daisy9SpiHandle6Config3NSSE", !7, i64 0}
!47 = !{!10, !18, i64 76}
!48 = !{!43, !18, i64 60}
!49 = !{!10, !17, i64 72}
!50 = !{!43, !17, i64 56}
!51 = !{!10, !16, i64 64}
!52 = !{!43, !16, i64 48}
!53 = !{!10, !15, i64 60}
!54 = !{!43, !15, i64 40}
!55 = !{!43, !45, i64 36}
!56 = !{!43, !46, i64 64}
!57 = !{!10, !14, i64 56}
!58 = !{!43, !14, i64 32}
!59 = !{!12, !13, i64 0}
!60 = !{!12, !7, 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"

%"struct.daisy::SpiHandle::Config" = type { %struct.anon.0, i32, i32, i32, i64, i32, i32, i32, i32 }
%struct.anon.0 = type { %struct.dsy_gpio_pin, %struct.dsy_gpio_pin, %struct.dsy_gpio_pin, %struct.dsy_gpio_pin }
%struct.dsy_gpio_pin = type { i32, i8 }
%struct.dsy_gpio = type { %struct.dsy_gpio_pin, i32, i32 }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5daisy19MultiSlaveSpiHandle4InitERKNS0_6ConfigE(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(96) %1) local_unnamed_addr #0 align 2 {
  %3 = alloca %"struct.daisy::SpiHandle::Config", align 16
  %4 = getelementptr inbounds i8, ptr %1, i64 88
  %5 = load i64, ptr %4, align 8, !tbaa !5
  %6 = icmp ugt i64 %5, 3
  br i1 %6, label %46, label %7

7:                                                ; preds = %2
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef nonnull align 8 dereferenceable(96) %1, i64 96, i1 false), !tbaa.struct !18
  %8 = getelementptr inbounds i8, ptr %0, i64 88
  %9 = load i64, ptr %8, align 8, !tbaa !27
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %7
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = getelementptr inbounds i8, ptr %0, i64 104
  br label %37

._crit_edge:                                      ; preds = %37, %7
  %12 = getelementptr inbounds i8, ptr %0, i64 168
  tail call void @_ZN5daisy19MultiSlaveSpiHandle11DmaTransfer10InvalidateEv(ptr noundef nonnull align 8 dereferenceable(32) %12)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %3) #5
  call void @_ZN5daisy9SpiHandle6ConfigC2Ev(ptr noundef nonnull align 8 dereferenceable(72) %3)
  %13 = getelementptr inbounds i8, ptr %1, i64 80
  %14 = load i32, ptr %13, align 8, !tbaa !32
  %15 = getelementptr inbounds i8, ptr %3, i64 68
  store i32 %14, ptr %15, align 4, !tbaa !33
  %16 = getelementptr inbounds i8, ptr %1, i64 72
  %17 = getelementptr inbounds i8, ptr %3, i64 56
  %18 = load <2 x i32>, ptr %16, align 8, !tbaa !20
  store <2 x i32> %18, ptr %17, align 8, !tbaa !20
  %19 = getelementptr inbounds i8, ptr %1, i64 64
  %20 = load i64, ptr %19, align 8, !tbaa !38
  %21 = getelementptr inbounds i8, ptr %3, i64 48
  store i64 %20, ptr %21, align 16, !tbaa !39
  %22 = getelementptr inbounds i8, ptr %1, i64 60
  %23 = load i32, ptr %22, align 4, !tbaa !40
  %24 = getelementptr inbounds i8, ptr %3, i64 40
  store i32 %23, ptr %24, align 8, !tbaa !41
  %25 = getelementptr inbounds i8, ptr %3, i64 36
  store i32 0, ptr %25, align 4, !tbaa !42
  %26 = getelementptr inbounds i8, ptr %3, i64 64
  store i32 0, ptr %26, align 16, !tbaa !43
  %27 = getelementptr inbounds i8, ptr %1, i64 56
  %28 = load i32, ptr %27, align 8, !tbaa !44
  %29 = getelementptr inbounds i8, ptr %3, i64 32
  store i32 %28, ptr %29, align 16, !tbaa !45
  %30 = getelementptr inbounds i8, ptr %1, i64 16
  %31 = getelementptr inbounds i8, ptr %3, i64 16
  %32 = load i64, ptr %30, align 8
  store i64 %32, ptr %31, align 16
  %33 = load <2 x i64>, ptr %1, align 8
  store <2 x i64> %33, ptr %3, align 16
  %34 = getelementptr inbounds i8, ptr %3, i64 24
  store i32 11, ptr %34, align 8, !tbaa !19
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 28
  store i8 0, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !20
  %35 = getelementptr inbounds i8, ptr %0, i64 96
  %36 = call noundef i32 @_ZN5daisy9SpiHandle4InitERKNS0_6ConfigE(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull align 8 dereferenceable(72) %3)
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %3) #5
  br label %46

37:                                               ; preds = %.lr.ph, %37
  %.02021 = phi i64 [ 0, %.lr.ph ], [ %43, %37 ]
  %38 = getelementptr inbounds [4 x %struct.dsy_gpio_pin], ptr %10, i64 0, i64 %.02021
  %39 = getelementptr inbounds [4 x %struct.dsy_gpio], ptr %11, i64 0, i64 %.02021
  %40 = load i64, ptr %38, align 8
  store i64 %40, ptr %39, align 8
  %41 = getelementptr inbounds i8, ptr %39, i64 8
  store i32 1, ptr %41, align 8, !tbaa !46
  %42 = getelementptr inbounds i8, ptr %39, i64 12
  store i32 0, ptr %42, align 4, !tbaa !50
  tail call void @dsy_gpio_init(ptr noundef nonnull %39)
  tail call void @_ZN5daisy19MultiSlaveSpiHandle13DisableDeviceEm(ptr noundef nonnull align 8 dereferenceable(200) %0, i64 noundef %.02021)
  %43 = add nuw i64 %.02021, 1
  %44 = load i64, ptr %8, align 8, !tbaa !27
  %45 = icmp ult i64 %43, %44
  br i1 %45, label %37, label %._crit_edge, !llvm.loop !51

46:                                               ; preds = %2, %._crit_edge
  %.0 = phi i32 [ %36, %._crit_edge ], [ 1, %2 ]
  ret i32 %.0
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

declare void @dsy_gpio_init(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5daisy19MultiSlaveSpiHandle13DisableDeviceEm(ptr noundef nonnull align 8 dereferenceable(200), i64 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5daisy19MultiSlaveSpiHandle11DmaTransfer10InvalidateEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5daisy9SpiHandle6ConfigC2Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #4 align 2

declare noundef i32 @_ZN5daisy9SpiHandle4InitERKNS0_6ConfigE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { 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 = { 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, !14, i64 88}
!6 = !{!"_ZTSN5daisy19MultiSlaveSpiHandle6ConfigE", !7, i64 0, !12, i64 56, !13, i64 60, !14, i64 64, !15, i64 72, !16, i64 76, !17, i64 80, !14, i64 88}
!7 = !{!"_ZTSN5daisy19MultiSlaveSpiHandle6ConfigUt_E", !8, i64 0, !8, i64 8, !8, i64 16, !10, i64 24}
!8 = !{!"_ZTS12dsy_gpio_pin", !9, i64 0, !10, i64 4}
!9 = !{!"_ZTS13dsy_gpio_port", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN5daisy9SpiHandle6Config10PeripheralE", !10, i64 0}
!13 = !{!"_ZTSN5daisy9SpiHandle6Config9DirectionE", !10, i64 0}
!14 = !{!"long", !10, i64 0}
!15 = !{!"_ZTSN5daisy9SpiHandle6Config13ClockPolarityE", !10, i64 0}
!16 = !{!"_ZTSN5daisy9SpiHandle6Config10ClockPhaseE", !10, i64 0}
!17 = !{!"_ZTSN5daisy9SpiHandle6Config13BaudPrescalerE", !10, i64 0}
!18 = !{i64 0, i64 4, !19, i64 4, i64 1, !20, i64 8, i64 4, !19, i64 12, i64 1, !20, i64 16, i64 4, !19, i64 20, i64 1, !20, i64 24, i64 32, !20, i64 56, i64 4, !21, i64 60, i64 4, !22, i64 64, i64 8, !23, i64 72, i64 4, !24, i64 76, i64 4, !25, i64 80, i64 4, !26, i64 88, i64 8, !23}
!19 = !{!9, !9, i64 0}
!20 = !{!10, !10, i64 0}
!21 = !{!12, !12, i64 0}
!22 = !{!13, !13, i64 0}
!23 = !{!14, !14, i64 0}
!24 = !{!15, !15, i64 0}
!25 = !{!16, !16, i64 0}
!26 = !{!17, !17, i64 0}
!27 = !{!28, !14, i64 88}
!28 = !{!"_ZTSN5daisy19MultiSlaveSpiHandleE", !6, i64 0, !29, i64 96, !10, i64 104, !31, i64 168}
!29 = !{!"_ZTSN5daisy9SpiHandleE", !30, i64 0}
!30 = !{!"any pointer", !10, i64 0}
!31 = !{!"_ZTSN5daisy19MultiSlaveSpiHandle11DmaTransferE", !10, i64 0, !30, i64 8, !30, i64 16, !30, i64 24}
!32 = !{!6, !17, i64 80}
!33 = !{!34, !17, i64 68}
!34 = !{!"_ZTSN5daisy9SpiHandle6ConfigE", !35, i64 0, !12, i64 32, !36, i64 36, !13, i64 40, !14, i64 48, !15, i64 56, !16, i64 60, !37, i64 64, !17, i64 68}
!35 = !{!"_ZTSN5daisy9SpiHandle6ConfigUt_E", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!36 = !{!"_ZTSN5daisy9SpiHandle6Config4ModeE", !10, i64 0}
!37 = !{!"_ZTSN5daisy9SpiHandle6Config3NSSE", !10, i64 0}
!38 = !{!6, !14, i64 64}
!39 = !{!34, !14, i64 48}
!40 = !{!6, !13, i64 60}
!41 = !{!34, !13, i64 40}
!42 = !{!34, !36, i64 36}
!43 = !{!34, !37, i64 64}
!44 = !{!6, !12, i64 56}
!45 = !{!34, !12, i64 32}
!46 = !{!47, !48, i64 8}
!47 = !{!"_ZTS8dsy_gpio", !8, i64 0, !48, i64 8, !49, i64 12}
!48 = !{!"_ZTS13dsy_gpio_mode", !10, i64 0}
!49 = !{!"_ZTS13dsy_gpio_pull", !10, i64 0}
!50 = !{!47, !49, i64 12}
!51 = distinct !{!51, !52}
!52 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass