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

; 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.RTC_HandleTypeDef = type { ptr, %struct.RTC_InitTypeDef, i32, i32 }
%struct.RTC_InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.RTC_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, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.RTC_TimeTypeDef = type { i8, i8, i8, i8, 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: nounwind uwtable
declare dso_local i32 @RTC_EnterInitMode(ptr noundef) #1

; 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
declare dso_local i32 @HAL_RTC_WaitForSynchro(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @HAL_RTC_SetTime(ptr noundef %0, ptr noundef %1, i32 noundef %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  br label %10

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

15:                                               ; preds = %10
  store i32 2, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %210

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

19:                                               ; preds = %16
  br label %20

20:                                               ; preds = %19
  br label %21

21:                                               ; preds = %20
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %22, i32 0, i32 3
  store volatile i32 2, ptr %23, align 8, !tbaa !14
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %65

26:                                               ; preds = %21
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !15
  %30 = getelementptr inbounds %struct.RTC_TypeDef, ptr %29, i32 0, i32 2
  %31 = load volatile i32, ptr %30, align 4, !tbaa !16
  %32 = zext i32 %31 to i64
  %33 = and i64 %32, 64
  %34 = icmp ne i64 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %26
  br label %39

36:                                               ; preds = %26
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.RTC_TimeTypeDef, ptr %37, i32 0, i32 3
  store i8 0, ptr %38, align 1, !tbaa !18
  br label %39

39:                                               ; preds = %36, %35
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.RTC_TimeTypeDef, ptr %40, i32 0, i32 0
  %42 = load i8, ptr %41, align 4, !tbaa !20
  %43 = call zeroext i8 @RTC_ByteToBcd2(i8 noundef zeroext %42)
  %44 = zext i8 %43 to i32
  %45 = shl i32 %44, 16
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.RTC_TimeTypeDef, ptr %46, i32 0, i32 1
  %48 = load i8, ptr %47, align 1, !tbaa !21
  %49 = call zeroext i8 @RTC_ByteToBcd2(i8 noundef zeroext %48)
  %50 = zext i8 %49 to i32
  %51 = shl i32 %50, 8
  %52 = or i32 %45, %51
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.RTC_TimeTypeDef, ptr %53, i32 0, i32 2
  %55 = load i8, ptr %54, align 2, !tbaa !22
  %56 = call zeroext i8 @RTC_ByteToBcd2(i8 noundef zeroext %55)
  %57 = zext i8 %56 to i32
  %58 = or i32 %52, %57
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.RTC_TimeTypeDef, ptr %59, i32 0, i32 3
  %61 = load i8, ptr %60, align 1, !tbaa !18
  %62 = zext i8 %61 to i32
  %63 = shl i32 %62, 22
  %64 = or i32 %58, %63
  store i32 %64, ptr %8, align 4, !tbaa !9
  br label %101

65:                                               ; preds = %21
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !15
  %69 = getelementptr inbounds %struct.RTC_TypeDef, ptr %68, i32 0, i32 2
  %70 = load volatile i32, ptr %69, align 4, !tbaa !16
  %71 = zext i32 %70 to i64
  %72 = and i64 %71, 64
  %73 = icmp ne i64 %72, 0
  br i1 %73, label %74, label %75

74:                                               ; preds = %65
  br label %78

75:                                               ; preds = %65
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.RTC_TimeTypeDef, ptr %76, i32 0, i32 3
  store i8 0, ptr %77, align 1, !tbaa !18
  br label %78

78:                                               ; preds = %75, %74
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.RTC_TimeTypeDef, ptr %79, i32 0, i32 0
  %81 = load i8, ptr %80, align 4, !tbaa !20
  %82 = zext i8 %81 to i32
  %83 = shl i32 %82, 16
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.RTC_TimeTypeDef, ptr %84, i32 0, i32 1
  %86 = load i8, ptr %85, align 1, !tbaa !21
  %87 = zext i8 %86 to i32
  %88 = shl i32 %87, 8
  %89 = or i32 %83, %88
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.RTC_TimeTypeDef, ptr %90, i32 0, i32 2
  %92 = load i8, ptr %91, align 2, !tbaa !22
  %93 = zext i8 %92 to i32
  %94 = or i32 %89, %93
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.RTC_TimeTypeDef, ptr %95, i32 0, i32 3
  %97 = load i8, ptr %96, align 1, !tbaa !18
  %98 = zext i8 %97 to i32
  %99 = shl i32 %98, 22
  %100 = or i32 %94, %99
  store i32 %100, ptr %8, align 4, !tbaa !9
  br label %101

101:                                              ; preds = %78, %39
  br label %102

102:                                              ; preds = %101
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !15
  %106 = getelementptr inbounds %struct.RTC_TypeDef, ptr %105, i32 0, i32 9
  store volatile i32 202, ptr %106, align 4, !tbaa !23
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !15
  %110 = getelementptr inbounds %struct.RTC_TypeDef, ptr %109, i32 0, i32 9
  store volatile i32 83, ptr %110, align 4, !tbaa !23
  br label %111

111:                                              ; preds = %102
  br label %112

112:                                              ; preds = %111
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = call i32 @RTC_EnterInitMode(ptr noundef %113)
  %115 = icmp ne i32 %114, 0
  br i1 %115, label %116, label %131

116:                                              ; preds = %112
  br label %117

117:                                              ; preds = %116
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %118, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8, !tbaa !15
  %121 = getelementptr inbounds %struct.RTC_TypeDef, ptr %120, i32 0, i32 9
  store volatile i32 255, ptr %121, align 4, !tbaa !23
  br label %122

122:                                              ; preds = %117
  br label %123

123:                                              ; preds = %122
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %124, i32 0, i32 3
  store volatile i32 4, ptr %125, align 8, !tbaa !14
  br label %126

126:                                              ; preds = %123
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %127, i32 0, i32 2
  store i32 0, ptr %128, align 4, !tbaa !11
  br label %129

129:                                              ; preds = %126
  br label %130

130:                                              ; preds = %129
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %210

131:                                              ; preds = %112
  %132 = load i32, ptr %8, align 4, !tbaa !9
  %133 = zext i32 %132 to i64
  %134 = and i64 %133, 8355711
  %135 = trunc i64 %134 to i32
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !15
  %139 = getelementptr inbounds %struct.RTC_TypeDef, ptr %138, i32 0, i32 0
  store volatile i32 %135, ptr %139, align 4, !tbaa !24
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %140, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8, !tbaa !15
  %143 = getelementptr inbounds %struct.RTC_TypeDef, ptr %142, i32 0, i32 2
  %144 = load volatile i32, ptr %143, align 4, !tbaa !16
  %145 = and i32 %144, -262145
  store volatile i32 %145, ptr %143, align 4, !tbaa !16
  %146 = load ptr, ptr %6, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.RTC_TimeTypeDef, ptr %146, i32 0, i32 6
  %148 = load i32, ptr %147, align 4, !tbaa !25
  %149 = load ptr, ptr %6, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.RTC_TimeTypeDef, ptr %149, i32 0, i32 7
  %151 = load i32, ptr %150, align 4, !tbaa !26
  %152 = or i32 %148, %151
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !15
  %156 = getelementptr inbounds %struct.RTC_TypeDef, ptr %155, i32 0, i32 2
  %157 = load volatile i32, ptr %156, align 4, !tbaa !16
  %158 = or i32 %157, %152
  store volatile i32 %158, ptr %156, align 4, !tbaa !16
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %159, i32 0, i32 0
  %161 = load ptr, ptr %160, align 8, !tbaa !15
  %162 = getelementptr inbounds %struct.RTC_TypeDef, ptr %161, i32 0, i32 3
  %163 = load volatile i32, ptr %162, align 4, !tbaa !27
  %164 = zext i32 %163 to i64
  %165 = and i64 %164, -129
  %166 = trunc i64 %165 to i32
  store volatile i32 %166, ptr %162, align 4, !tbaa !27
  %167 = load ptr, ptr %5, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %167, i32 0, i32 0
  %169 = load ptr, ptr %168, align 8, !tbaa !15
  %170 = getelementptr inbounds %struct.RTC_TypeDef, ptr %169, i32 0, i32 2
  %171 = load volatile i32, ptr %170, align 4, !tbaa !16
  %172 = zext i32 %171 to i64
  %173 = and i64 %172, 32
  %174 = icmp eq i64 %173, 0
  br i1 %174, label %175, label %195

175:                                              ; preds = %131
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = call i32 @HAL_RTC_WaitForSynchro(ptr noundef %176)
  %178 = icmp ne i32 %177, 0
  br i1 %178, label %179, label %194

179:                                              ; preds = %175
  br label %180

180:                                              ; preds = %179
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %181, i32 0, i32 0
  %183 = load ptr, ptr %182, align 8, !tbaa !15
  %184 = getelementptr inbounds %struct.RTC_TypeDef, ptr %183, i32 0, i32 9
  store volatile i32 255, ptr %184, align 4, !tbaa !23
  br label %185

185:                                              ; preds = %180
  br label %186

186:                                              ; preds = %185
  %187 = load ptr, ptr %5, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %187, i32 0, i32 3
  store volatile i32 4, ptr %188, align 8, !tbaa !14
  br label %189

189:                                              ; preds = %186
  %190 = load ptr, ptr %5, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %190, i32 0, i32 2
  store i32 0, ptr %191, align 4, !tbaa !11
  br label %192

192:                                              ; preds = %189
  br label %193

193:                                              ; preds = %192
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %210

194:                                              ; preds = %175
  br label %195

195:                                              ; preds = %194, %131
  br label %196

196:                                              ; preds = %195
  %197 = load ptr, ptr %5, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %197, i32 0, i32 0
  %199 = load ptr, ptr %198, align 8, !tbaa !15
  %200 = getelementptr inbounds %struct.RTC_TypeDef, ptr %199, i32 0, i32 9
  store volatile i32 255, ptr %200, align 4, !tbaa !23
  br label %201

201:                                              ; preds = %196
  br label %202

202:                                              ; preds = %201
  %203 = load ptr, ptr %5, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %203, i32 0, i32 3
  store volatile i32 1, ptr %204, align 8, !tbaa !14
  br label %205

205:                                              ; preds = %202
  %206 = load ptr, ptr %5, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.RTC_HandleTypeDef, ptr %206, i32 0, i32 2
  store i32 0, ptr %207, align 4, !tbaa !11
  br label %208

208:                                              ; preds = %205
  br label %209

209:                                              ; preds = %208
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %210

210:                                              ; preds = %209, %193, %130, %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  %211 = load i32, ptr %4, align 4
  ret i32 %211
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @RTC_ByteToBcd2(i8 noundef zeroext) #1

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 36}
!12 = !{!"", !6, i64 0, !13, i64 8, !10, i64 36, !10, i64 40}
!13 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24}
!14 = !{!12, !10, i64 40}
!15 = !{!12, !6, i64 0}
!16 = !{!17, !10, i64 8}
!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, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !10, i64 152, !10, i64 156, !10, i64 160, !10, i64 164, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204}
!18 = !{!19, !7, i64 3}
!19 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16}
!20 = !{!19, !7, i64 0}
!21 = !{!19, !7, i64 1}
!22 = !{!19, !7, i64 2}
!23 = !{!17, !10, i64 36}
!24 = !{!17, !10, i64 0}
!25 = !{!19, !10, i64 12}
!26 = !{!19, !10, i64 16}
!27 = !{!17, !10, i64 12}


; 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
declare dso_local i32 @RTC_EnterInitMode(ptr noundef) local_unnamed_addr #0

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

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

7:                                                ; preds = %3
  store i32 1, ptr %4, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 40
  store volatile i32 2, ptr %8, align 8, !tbaa !12
  %9 = icmp eq i32 %2, 0
  %10 = load ptr, ptr %0, align 8, !tbaa !13
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  %12 = load volatile i32, ptr %11, align 4, !tbaa !14
  %13 = and i32 %12, 64
  %.not38 = icmp eq i32 %13, 0
  br i1 %9, label %14, label %38

14:                                               ; preds = %7
  br i1 %.not38, label %15, label %17

15:                                               ; preds = %14
  %16 = getelementptr inbounds i8, ptr %1, i64 3
  store i8 0, ptr %16, align 1, !tbaa !16
  br label %17

17:                                               ; preds = %14, %15
  %18 = load i8, ptr %1, align 4, !tbaa !18
  %19 = tail call zeroext i8 @RTC_ByteToBcd2(i8 noundef zeroext %18)
  %20 = zext i8 %19 to i32
  %21 = shl nuw nsw i32 %20, 16
  %22 = getelementptr inbounds i8, ptr %1, i64 1
  %23 = load i8, ptr %22, align 1, !tbaa !19
  %24 = tail call zeroext i8 @RTC_ByteToBcd2(i8 noundef zeroext %23)
  %25 = zext i8 %24 to i32
  %26 = shl nuw nsw i32 %25, 8
  %27 = or disjoint i32 %26, %21
  %28 = getelementptr inbounds i8, ptr %1, i64 2
  %29 = load i8, ptr %28, align 2, !tbaa !20
  %30 = tail call zeroext i8 @RTC_ByteToBcd2(i8 noundef zeroext %29)
  %31 = zext i8 %30 to i32
  %32 = or disjoint i32 %27, %31
  %33 = getelementptr inbounds i8, ptr %1, i64 3
  %34 = load i8, ptr %33, align 1, !tbaa !16
  %35 = zext i8 %34 to i32
  %36 = shl nuw nsw i32 %35, 22
  %37 = or i32 %36, %32
  %.pre41 = load ptr, ptr %0, align 8, !tbaa !13
  br label %58

38:                                               ; preds = %7
  %39 = getelementptr inbounds i8, ptr %1, i64 3
  br i1 %.not38, label %42, label %._crit_edge

._crit_edge:                                      ; preds = %38
  %.pre = load i8, ptr %39, align 1, !tbaa !16
  %40 = zext i8 %.pre to i32
  %41 = shl nuw nsw i32 %40, 22
  br label %43

42:                                               ; preds = %38
  store i8 0, ptr %39, align 1, !tbaa !16
  br label %43

43:                                               ; preds = %._crit_edge, %42
  %44 = phi i32 [ %41, %._crit_edge ], [ 0, %42 ]
  %45 = load i8, ptr %1, align 4, !tbaa !18
  %46 = zext i8 %45 to i32
  %47 = shl nuw nsw i32 %46, 16
  %48 = getelementptr inbounds i8, ptr %1, i64 1
  %49 = load i8, ptr %48, align 1, !tbaa !19
  %50 = zext i8 %49 to i32
  %51 = shl nuw nsw i32 %50, 8
  %52 = or disjoint i32 %51, %47
  %53 = getelementptr inbounds i8, ptr %1, i64 2
  %54 = load i8, ptr %53, align 2, !tbaa !20
  %55 = zext i8 %54 to i32
  %56 = or disjoint i32 %52, %55
  %57 = or i32 %56, %44
  br label %58

58:                                               ; preds = %17, %43
  %59 = phi ptr [ %.pre41, %17 ], [ %10, %43 ]
  %.0 = phi i32 [ %37, %17 ], [ %57, %43 ]
  %60 = getelementptr inbounds i8, ptr %59, i64 36
  store volatile i32 202, ptr %60, align 4, !tbaa !21
  store volatile i32 83, ptr %60, align 4, !tbaa !21
  %61 = tail call i32 @RTC_EnterInitMode(ptr noundef nonnull %0)
  %.not39 = icmp eq i32 %61, 0
  br i1 %.not39, label %64, label %62

62:                                               ; preds = %58
  %63 = load ptr, ptr %0, align 8, !tbaa !13
  br label %.sink.split

64:                                               ; preds = %58
  %65 = and i32 %.0, 8355711
  %66 = load ptr, ptr %0, align 8, !tbaa !13
  store volatile i32 %65, ptr %66, align 4, !tbaa !22
  %67 = getelementptr inbounds i8, ptr %66, i64 8
  %68 = load volatile i32, ptr %67, align 4, !tbaa !14
  %69 = and i32 %68, -262145
  store volatile i32 %69, ptr %67, align 4, !tbaa !14
  %70 = getelementptr inbounds i8, ptr %1, i64 12
  %71 = load i32, ptr %70, align 4, !tbaa !23
  %72 = getelementptr inbounds i8, ptr %1, i64 16
  %73 = load i32, ptr %72, align 4, !tbaa !24
  %74 = or i32 %73, %71
  %75 = load volatile i32, ptr %67, align 4, !tbaa !14
  %76 = or i32 %74, %75
  store volatile i32 %76, ptr %67, align 4, !tbaa !14
  %77 = getelementptr inbounds i8, ptr %66, i64 12
  %78 = load volatile i32, ptr %77, align 4, !tbaa !25
  %79 = and i32 %78, -129
  store volatile i32 %79, ptr %77, align 4, !tbaa !25
  %80 = load volatile i32, ptr %67, align 4, !tbaa !14
  %81 = and i32 %80, 32
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %83, label %.sink.split

83:                                               ; preds = %64
  %84 = tail call i32 @HAL_RTC_WaitForSynchro(ptr noundef nonnull %0)
  %.not40 = icmp ne i32 %84, 0
  %.pre42 = load ptr, ptr %0, align 8, !tbaa !13
  %spec.select = select i1 %.not40, i32 4, i32 1
  %spec.select45 = zext i1 %.not40 to i32
  br label %.sink.split

.sink.split:                                      ; preds = %83, %64, %62
  %.sink44 = phi ptr [ %63, %62 ], [ %66, %64 ], [ %.pre42, %83 ]
  %.sink = phi i32 [ 4, %62 ], [ 1, %64 ], [ %spec.select, %83 ]
  %.037.ph = phi i32 [ 1, %62 ], [ 0, %64 ], [ %spec.select45, %83 ]
  %85 = getelementptr inbounds i8, ptr %.sink44, i64 36
  store volatile i32 255, ptr %85, align 4, !tbaa !21
  store volatile i32 %.sink, ptr %8, align 8, !tbaa !12
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %.sink.split, %3
  %.037 = phi i32 [ 2, %3 ], [ %.037.ph, %.sink.split ]
  ret i32 %.037
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @RTC_ByteToBcd2(i8 noundef zeroext) 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, !11, i64 36}
!6 = !{!"", !7, i64 0, !10, i64 8, !11, i64 36, !11, i64 40}
!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, !11, i64 24}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !11, i64 40}
!13 = !{!6, !7, i64 0}
!14 = !{!15, !11, i64 8}
!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, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !11, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !11, i64 192, !11, i64 196, !11, i64 200, !11, i64 204}
!16 = !{!17, !8, i64 3}
!17 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16}
!18 = !{!17, !8, i64 0}
!19 = !{!17, !8, i64 1}
!20 = !{!17, !8, i64 2}
!21 = !{!15, !11, i64 36}
!22 = !{!15, !11, i64 0}
!23 = !{!17, !11, i64 12}
!24 = !{!17, !11, i64 16}
!25 = !{!15, !11, i64 12}


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