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

; 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.HASH_HandleTypeDef = type { %struct.HASH_InitTypeDef, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, ptr, i32, i32, i32, i32, i32, i32 }
%struct.HASH_InitTypeDef = type { i32, i32, ptr }

; Function Attrs: nounwind uwtable
define dso_local i32 @HMAC_Start(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5) #0 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i32 %2, ptr %10, align 4, !tbaa !9
  store ptr %3, ptr %11, align 8, !tbaa !5
  store i32 %4, ptr %12, align 4, !tbaa !9
  store i32 %5, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #2
  %16 = load ptr, ptr %8, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %16, i32 0, i32 13
  %18 = load volatile i32, ptr %17, align 4, !tbaa !11
  store i32 %18, ptr %14, align 4, !tbaa !9
  %19 = load i32, ptr %14, align 4, !tbaa !9
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %24, label %21

21:                                               ; preds = %6
  %22 = load i32, ptr %14, align 4, !tbaa !9
  %23 = icmp eq i32 %22, 8
  br i1 %23, label %24, label %125

24:                                               ; preds = %21, %6
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = icmp eq ptr %25, null
  br i1 %26, label %45, label %27

27:                                               ; preds = %24
  %28 = load i32, ptr %10, align 4, !tbaa !9
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %45, label %30

30:                                               ; preds = %27
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %31, i32 0, i32 0
  %33 = getelementptr inbounds %struct.HASH_InitTypeDef, ptr %32, i32 0, i32 2
  %34 = load ptr, ptr %33, align 8, !tbaa !14
  %35 = icmp eq ptr %34, null
  br i1 %35, label %45, label %36

36:                                               ; preds = %30
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %37, i32 0, i32 0
  %39 = getelementptr inbounds %struct.HASH_InitTypeDef, ptr %38, i32 0, i32 1
  %40 = load i32, ptr %39, align 4, !tbaa !15
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %45, label %42

42:                                               ; preds = %36
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  %44 = icmp eq ptr %43, null
  br i1 %44, label %45, label %48

45:                                               ; preds = %42, %36, %30, %27, %24
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %46, i32 0, i32 13
  store volatile i32 1, ptr %47, align 4, !tbaa !11
  store i32 1, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %126

48:                                               ; preds = %42
  br label %49

49:                                               ; preds = %48
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %50, i32 0, i32 12
  %52 = load i32, ptr %51, align 8, !tbaa !16
  %53 = icmp eq i32 %52, 1
  br i1 %53, label %54, label %55

54:                                               ; preds = %49
  store i32 2, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %126

55:                                               ; preds = %49
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %56, i32 0, i32 12
  store i32 1, ptr %57, align 8, !tbaa !16
  br label %58

58:                                               ; preds = %55
  br label %59

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %61, i32 0, i32 13
  store volatile i32 2, ptr %62, align 4, !tbaa !11
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %63, i32 0, i32 10
  %65 = load i32, ptr %64, align 4, !tbaa !17
  %66 = icmp eq i32 %65, 1
  br i1 %66, label %67, label %121

67:                                               ; preds = %60
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %68, i32 0, i32 0
  %70 = getelementptr inbounds %struct.HASH_InitTypeDef, ptr %69, i32 0, i32 1
  %71 = load i32, ptr %70, align 4, !tbaa !15
  %72 = icmp ugt i32 %71, 64
  br i1 %72, label %73, label %84

73:                                               ; preds = %67
  %74 = load volatile i32, ptr inttoptr (i64 1208095744 to ptr), align 4, !tbaa !18
  %75 = zext i32 %74 to i64
  %76 = and i64 %75, -327877
  %77 = load i32, ptr %13, align 4, !tbaa !9
  %78 = zext i32 %77 to i64
  %79 = or i64 %78, 64
  %80 = or i64 %79, 65536
  %81 = or i64 %80, 4
  %82 = or i64 %76, %81
  %83 = trunc i64 %82 to i32
  store volatile i32 %83, ptr inttoptr (i64 1208095744 to ptr), align 4, !tbaa !18
  br label %94

84:                                               ; preds = %67
  %85 = load volatile i32, ptr inttoptr (i64 1208095744 to ptr), align 4, !tbaa !18
  %86 = zext i32 %85 to i64
  %87 = and i64 %86, -327877
  %88 = load i32, ptr %13, align 4, !tbaa !9
  %89 = zext i32 %88 to i64
  %90 = or i64 %89, 64
  %91 = or i64 %90, 4
  %92 = or i64 %87, %91
  %93 = trunc i64 %92 to i32
  store volatile i32 %93, ptr inttoptr (i64 1208095744 to ptr), align 4, !tbaa !18
  br label %94

94:                                               ; preds = %84, %73
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %95, i32 0, i32 10
  store i32 3, ptr %96, align 4, !tbaa !17
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %98, i32 0, i32 2
  store ptr %97, ptr %99, align 8, !tbaa !20
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %101, i32 0, i32 1
  store ptr %100, ptr %102, align 8, !tbaa !21
  %103 = load i32, ptr %10, align 4, !tbaa !9
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %104, i32 0, i32 6
  store volatile i32 %103, ptr %105, align 4, !tbaa !22
  %106 = load i32, ptr %10, align 4, !tbaa !9
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %107, i32 0, i32 5
  store i32 %106, ptr %108, align 8, !tbaa !23
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %109, i32 0, i32 0
  %111 = getelementptr inbounds %struct.HASH_InitTypeDef, ptr %110, i32 0, i32 2
  %112 = load ptr, ptr %111, align 8, !tbaa !14
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %113, i32 0, i32 3
  store ptr %112, ptr %114, align 8, !tbaa !24
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %115, i32 0, i32 0
  %117 = getelementptr inbounds %struct.HASH_InitTypeDef, ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 4, !tbaa !15
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.HASH_HandleTypeDef, ptr %119, i32 0, i32 8
  store volatile i32 %118, ptr %120, align 4, !tbaa !25
  br label %121

121:                                              ; preds = %94, %60
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = load i32, ptr %12, align 4, !tbaa !9
  %124 = call i32 @HMAC_Processing(ptr noundef %122, i32 noundef %123)
  store i32 %124, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %126

125:                                              ; preds = %21
  store i32 2, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %126

126:                                              ; preds = %125, %121, %54, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #2
  %127 = load i32, ptr %7, align 4
  ret i32 %127
}

; 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 hidden i32 @HMAC_Processing(ptr noundef, i32 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" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 84}
!12 = !{!"", !13, i64 0, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !6, i64 72, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100}
!13 = !{!"", !10, i64 0, !10, i64 4, !6, i64 8}
!14 = !{!12, !6, i64 8}
!15 = !{!12, !10, i64 4}
!16 = !{!12, !10, i64 80}
!17 = !{!12, !10, i64 68}
!18 = !{!19, !10, i64 0}
!19 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !7, i64 12, !10, i64 32, !10, i64 36, !7, i64 40, !7, i64 248}
!20 = !{!12, !6, i64 24}
!21 = !{!12, !6, i64 16}
!22 = !{!12, !10, i64 52}
!23 = !{!12, !10, i64 48}
!24 = !{!12, !6, i64 32}
!25 = !{!12, !10, i64 60}


; 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 i32 @HMAC_Start(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #0 {
  %7 = getelementptr inbounds i8, ptr %0, i64 84
  %8 = load volatile i32, ptr %7, align 4, !tbaa !5
  switch i32 %8, label %44 [
    i32 8, label %9
    i32 1, label %9
  ]

9:                                                ; preds = %6, %6
  %10 = icmp eq ptr %1, null
  %11 = icmp eq i32 %2, 0
  %or.cond3 = or i1 %10, %11
  br i1 %or.cond3, label %21, label %12

12:                                               ; preds = %9
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !12
  %15 = icmp eq ptr %14, null
  br i1 %15, label %21, label %16

16:                                               ; preds = %12
  %17 = getelementptr inbounds i8, ptr %0, i64 4
  %18 = load i32, ptr %17, align 4, !tbaa !13
  %19 = icmp eq i32 %18, 0
  %20 = icmp eq ptr %3, null
  %or.cond5 = or i1 %20, %19
  br i1 %or.cond5, label %21, label %22

21:                                               ; preds = %16, %12, %9
  store volatile i32 1, ptr %7, align 4, !tbaa !5
  br label %44

22:                                               ; preds = %16
  %23 = getelementptr inbounds i8, ptr %0, i64 80
  %24 = load i32, ptr %23, align 8, !tbaa !14
  %25 = icmp eq i32 %24, 1
  br i1 %25, label %44, label %26

26:                                               ; preds = %22
  store i32 1, ptr %23, align 8, !tbaa !14
  store volatile i32 2, ptr %7, align 4, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 68
  %28 = load i32, ptr %27, align 4, !tbaa !15
  %29 = icmp eq i32 %28, 1
  br i1 %29, label %30, label %42

30:                                               ; preds = %26
  %31 = icmp ugt i32 %18, 64
  %32 = load volatile i32, ptr inttoptr (i64 1208095744 to ptr), align 1024, !tbaa !16
  %33 = and i32 %32, -327877
  %34 = or i32 %33, %5
  %. = select i1 %31, i32 65604, i32 68
  %35 = or i32 %34, %.
  store volatile i32 %35, ptr inttoptr (i64 1208095744 to ptr), align 1024, !tbaa !16
  store i32 3, ptr %27, align 4, !tbaa !15
  %36 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %3, ptr %36, align 8, !tbaa !18
  %37 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %1, ptr %37, align 8, !tbaa !19
  %38 = getelementptr inbounds i8, ptr %0, i64 52
  store volatile i32 %2, ptr %38, align 4, !tbaa !20
  %39 = getelementptr inbounds i8, ptr %0, i64 48
  store i32 %2, ptr %39, align 8, !tbaa !21
  %40 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %14, ptr %40, align 8, !tbaa !22
  %41 = getelementptr inbounds i8, ptr %0, i64 60
  store volatile i32 %18, ptr %41, align 4, !tbaa !23
  br label %42

42:                                               ; preds = %30, %26
  %43 = tail call i32 @HMAC_Processing(ptr noundef nonnull %0, i32 noundef %4)
  br label %44

44:                                               ; preds = %6, %22, %42, %21
  %.0 = phi i32 [ 1, %21 ], [ %43, %42 ], [ 2, %22 ], [ 2, %6 ]
  ret i32 %.0
}

; Function Attrs: nounwind uwtable
declare hidden i32 @HMAC_Processing(ptr noundef, i32 noundef) local_unnamed_addr #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, !8, i64 84}
!6 = !{!"", !7, i64 0, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !8, i64 48, !8, i64 52, !8, i64 56, !8, i64 60, !8, i64 64, !8, i64 68, !11, i64 72, !8, i64 80, !8, i64 84, !8, i64 88, !8, i64 92, !8, i64 96, !8, i64 100}
!7 = !{!"", !8, i64 0, !8, i64 4, !11, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!6, !11, i64 8}
!13 = !{!6, !8, i64 4}
!14 = !{!6, !8, i64 80}
!15 = !{!6, !8, i64 68}
!16 = !{!17, !8, i64 0}
!17 = !{!"", !8, i64 0, !8, i64 4, !8, i64 8, !9, i64 12, !8, i64 32, !8, i64 36, !9, i64 40, !9, i64 248}
!18 = !{!6, !11, i64 24}
!19 = !{!6, !11, i64 16}
!20 = !{!6, !8, i64 52}
!21 = !{!6, !8, i64 48}
!22 = !{!6, !11, i64 32}
!23 = !{!6, !8, i64 60}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass