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

; 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.DCMI_HandleTypeDef = type { ptr, %struct.DCMI_InitTypeDef, i32, i32, i32, i32, i32, i32, ptr, i32 }
%struct.DCMI_InitTypeDef = type { i32, i32, i32, i32, i32, i32, %struct.DCMI_CodesInitTypeDef, i32, i32, i32, i32, i32 }
%struct.DCMI_CodesInitTypeDef = type { i8, i8, i8, i8 }
%struct.DCMI_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

; Function Attrs: nounwind uwtable
define dso_local i32 @HAL_DCMI_Init(ptr noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = icmp eq ptr %4, null
  br i1 %5, label %6, label %7

6:                                                ; preds = %1
  store i32 1, ptr %2, align 4
  br label %136

7:                                                ; preds = %1
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %8, i32 0, i32 3
  %10 = load volatile i32, ptr %9, align 4, !tbaa !9
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %12, label %14

12:                                               ; preds = %7
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  call void @HAL_DCMI_MspInit(ptr noundef %13)
  br label %14

14:                                               ; preds = %12, %7
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %15, i32 0, i32 3
  store volatile i32 2, ptr %16, align 4, !tbaa !9
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  %20 = getelementptr inbounds %struct.DCMI_TypeDef, ptr %19, i32 0, i32 0
  %21 = load volatile i32, ptr %20, align 4, !tbaa !15
  %22 = zext i32 %21 to i64
  %23 = and i64 %22, -2035705
  %24 = trunc i64 %23 to i32
  store volatile i32 %24, ptr %20, align 4, !tbaa !15
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %25, i32 0, i32 1
  %27 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %26, i32 0, i32 0
  %28 = load i32, ptr %27, align 8, !tbaa !17
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %29, i32 0, i32 1
  %31 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %30, i32 0, i32 4
  %32 = load i32, ptr %31, align 8, !tbaa !18
  %33 = or i32 %28, %32
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %34, i32 0, i32 1
  %36 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %35, i32 0, i32 2
  %37 = load i32, ptr %36, align 8, !tbaa !19
  %38 = or i32 %33, %37
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %39, i32 0, i32 1
  %41 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %40, i32 0, i32 3
  %42 = load i32, ptr %41, align 4, !tbaa !20
  %43 = or i32 %38, %42
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %44, i32 0, i32 1
  %46 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %45, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !21
  %48 = or i32 %43, %47
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %49, i32 0, i32 1
  %51 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %50, i32 0, i32 5
  %52 = load i32, ptr %51, align 4, !tbaa !22
  %53 = or i32 %48, %52
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %54, i32 0, i32 1
  %56 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %55, i32 0, i32 7
  %57 = load i32, ptr %56, align 4, !tbaa !23
  %58 = or i32 %53, %57
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %59, i32 0, i32 1
  %61 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %60, i32 0, i32 8
  %62 = load i32, ptr %61, align 8, !tbaa !24
  %63 = or i32 %58, %62
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %64, i32 0, i32 1
  %66 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %65, i32 0, i32 9
  %67 = load i32, ptr %66, align 4, !tbaa !25
  %68 = or i32 %63, %67
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %69, i32 0, i32 1
  %71 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %70, i32 0, i32 10
  %72 = load i32, ptr %71, align 8, !tbaa !26
  %73 = or i32 %68, %72
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %74, i32 0, i32 1
  %76 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %75, i32 0, i32 11
  %77 = load i32, ptr %76, align 4, !tbaa !27
  %78 = or i32 %73, %77
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !14
  %82 = getelementptr inbounds %struct.DCMI_TypeDef, ptr %81, i32 0, i32 0
  %83 = load volatile i32, ptr %82, align 4, !tbaa !15
  %84 = or i32 %83, %78
  store volatile i32 %84, ptr %82, align 4, !tbaa !15
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %85, i32 0, i32 1
  %87 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %86, i32 0, i32 0
  %88 = load i32, ptr %87, align 8, !tbaa !17
  %89 = icmp eq i32 %88, 16
  br i1 %89, label %90, label %125

90:                                               ; preds = %14
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %91, i32 0, i32 1
  %93 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %92, i32 0, i32 6
  %94 = getelementptr inbounds %struct.DCMI_CodesInitTypeDef, ptr %93, i32 0, i32 0
  %95 = load i8, ptr %94, align 8, !tbaa !28
  %96 = zext i8 %95 to i32
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %97, i32 0, i32 1
  %99 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %98, i32 0, i32 6
  %100 = getelementptr inbounds %struct.DCMI_CodesInitTypeDef, ptr %99, i32 0, i32 1
  %101 = load i8, ptr %100, align 1, !tbaa !29
  %102 = zext i8 %101 to i32
  %103 = shl i32 %102, 8
  %104 = or i32 %96, %103
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %105, i32 0, i32 1
  %107 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %106, i32 0, i32 6
  %108 = getelementptr inbounds %struct.DCMI_CodesInitTypeDef, ptr %107, i32 0, i32 2
  %109 = load i8, ptr %108, align 2, !tbaa !30
  %110 = zext i8 %109 to i32
  %111 = shl i32 %110, 16
  %112 = or i32 %104, %111
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %113, i32 0, i32 1
  %115 = getelementptr inbounds %struct.DCMI_InitTypeDef, ptr %114, i32 0, i32 6
  %116 = getelementptr inbounds %struct.DCMI_CodesInitTypeDef, ptr %115, i32 0, i32 3
  %117 = load i8, ptr %116, align 1, !tbaa !31
  %118 = zext i8 %117 to i32
  %119 = shl i32 %118, 24
  %120 = or i32 %112, %119
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %121, i32 0, i32 0
  %123 = load ptr, ptr %122, align 8, !tbaa !14
  %124 = getelementptr inbounds %struct.DCMI_TypeDef, ptr %123, i32 0, i32 6
  store volatile i32 %120, ptr %124, align 4, !tbaa !32
  br label %125

125:                                              ; preds = %90, %14
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %126, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8, !tbaa !14
  %129 = getelementptr inbounds %struct.DCMI_TypeDef, ptr %128, i32 0, i32 3
  %130 = load volatile i32, ptr %129, align 4, !tbaa !33
  %131 = or i32 %130, 30
  store volatile i32 %131, ptr %129, align 4, !tbaa !33
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %132, i32 0, i32 9
  store volatile i32 0, ptr %133, align 8, !tbaa !34
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.DCMI_HandleTypeDef, ptr %134, i32 0, i32 3
  store volatile i32 1, ptr %135, align 4, !tbaa !9
  store i32 0, ptr %2, align 4
  br label %136

136:                                              ; preds = %125, %6
  %137 = load i32, ptr %2, align 4
  ret i32 %137
}

; Function Attrs: nounwind uwtable
declare dso_local void @HAL_DCMI_MspInit(ptr noundef) #0

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

!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, !12, i64 60}
!10 = !{!"", !6, i64 0, !11, i64 8, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !6, i64 80, !12, i64 88}
!11 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !13, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44}
!12 = !{!"int", !7, i64 0}
!13 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!14 = !{!10, !6, 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}
!17 = !{!10, !12, i64 8}
!18 = !{!10, !12, i64 24}
!19 = !{!10, !12, i64 16}
!20 = !{!10, !12, i64 20}
!21 = !{!10, !12, i64 12}
!22 = !{!10, !12, i64 28}
!23 = !{!10, !12, i64 36}
!24 = !{!10, !12, i64 40}
!25 = !{!10, !12, i64 44}
!26 = !{!10, !12, i64 48}
!27 = !{!10, !12, i64 52}
!28 = !{!10, !7, i64 32}
!29 = !{!10, !7, i64 33}
!30 = !{!10, !7, i64 34}
!31 = !{!10, !7, i64 35}
!32 = !{!16, !12, i64 24}
!33 = !{!16, !12, i64 12}
!34 = !{!10, !12, i64 88}


; 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
define dso_local range(i32 0, 2) i32 @HAL_DCMI_Init(ptr noundef %0) local_unnamed_addr #0 {
  %2 = icmp eq ptr %0, null
  br i1 %2, label %35, label %3

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 60
  %5 = load volatile i32, ptr %4, align 4, !tbaa !5
  %6 = icmp eq i32 %5, 0
  br i1 %6, label %7, label %8

7:                                                ; preds = %3
  tail call void @HAL_DCMI_MspInit(ptr noundef nonnull %0)
  br label %8

8:                                                ; preds = %7, %3
  store volatile i32 2, ptr %4, align 4, !tbaa !5
  %9 = load ptr, ptr %0, align 8, !tbaa !13
  %10 = load volatile i32, ptr %9, align 4, !tbaa !14
  %11 = and i32 %10, -2035705
  store volatile i32 %11, ptr %9, align 4, !tbaa !14
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load i32, ptr %12, align 8, !tbaa !16
  %14 = getelementptr inbounds i8, ptr %0, i64 12
  %15 = load <4 x i32>, ptr %14, align 4, !tbaa !17
  %16 = getelementptr inbounds i8, ptr %0, i64 28
  %17 = load i32, ptr %16, align 4, !tbaa !18
  %18 = getelementptr inbounds i8, ptr %0, i64 36
  %19 = load <4 x i32>, ptr %18, align 4, !tbaa !17
  %20 = getelementptr inbounds i8, ptr %0, i64 52
  %21 = load i32, ptr %20, align 4, !tbaa !19
  %22 = load volatile i32, ptr %9, align 4, !tbaa !14
  %23 = tail call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> %15)
  %24 = tail call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> %19)
  %op.rdx = or i32 %23, %24
  %op.rdx27 = or i32 %op.rdx, %17
  %op.rdx28 = or i32 %21, %13
  %op.rdx29 = or i32 %op.rdx27, %op.rdx28
  %op.rdx30 = or i32 %op.rdx29, %22
  store volatile i32 %op.rdx30, ptr %9, align 4, !tbaa !14
  %25 = icmp eq i32 %13, 16
  br i1 %25, label %26, label %30

26:                                               ; preds = %8
  %27 = getelementptr inbounds i8, ptr %0, i64 32
  %28 = load i32, ptr %27, align 8
  %29 = getelementptr inbounds i8, ptr %9, i64 24
  store volatile i32 %28, ptr %29, align 4, !tbaa !20
  br label %30

30:                                               ; preds = %26, %8
  %31 = getelementptr inbounds i8, ptr %9, i64 12
  %32 = load volatile i32, ptr %31, align 4, !tbaa !21
  %33 = or i32 %32, 30
  store volatile i32 %33, ptr %31, align 4, !tbaa !21
  %34 = getelementptr inbounds i8, ptr %0, i64 88
  store volatile i32 0, ptr %34, align 8, !tbaa !22
  store volatile i32 1, ptr %4, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %1, %30
  %.0 = phi i32 [ 0, %30 ], [ 1, %1 ]
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare dso_local void @HAL_DCMI_MspInit(ptr noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.or.v4i32(<4 x i32>) #1

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 speculatable willreturn memory(none) }

!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 60}
!6 = !{!"", !7, i64 0, !10, i64 8, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !7, i64 80, !11, i64 88}
!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, i64 20, !12, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44}
!11 = !{!"int", !8, i64 0}
!12 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3}
!13 = !{!6, !7, i64 0}
!14 = !{!15, !11, i64 0}
!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}
!16 = !{!6, !11, i64 8}
!17 = !{!11, !11, i64 0}
!18 = !{!6, !11, i64 28}
!19 = !{!6, !11, i64 52}
!20 = !{!15, !11, i64 24}
!21 = !{!15, !11, i64 12}
!22 = !{!6, !11, i64 88}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass