; LLVM IR from ctlst-tech/catpilot :: os/freertos/services/misc (ring_buf)

; 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.ring_buf_t = type { ptr, ptr, ptr, i16, i16, ptr, ptr, ptr, ptr }

; 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

declare i64 @xQueueSemaphoreTake(ptr noundef, i32 noundef) #1

declare i64 @xQueueGenericSend(ptr noundef, ptr noundef, i32 noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i16 @ring_buf_get_free_size(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @ring_buf_write(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i16, align 2
  %8 = alloca i32, align 4
  %9 = alloca i16, align 2
  %10 = alloca i16, align 2
  %11 = alloca i32, align 4
  %12 = alloca i16, align 2
  %13 = alloca i16, align 2
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i16 %2, ptr %7, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #4
  %14 = load i16, ptr %7, align 2, !tbaa !9
  store i16 %14, ptr %10, align 2, !tbaa !9
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %22, label %17

17:                                               ; preds = %3
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.ring_buf_t, ptr %18, i32 0, i32 2
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %17, %3
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %175

23:                                               ; preds = %17
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.ring_buf_t, ptr %24, i32 0, i32 5
  %26 = load ptr, ptr %25, align 8, !tbaa !13
  %27 = call i64 @xQueueSemaphoreTake(ptr noundef %26, i32 noundef -1)
  br label %28

28:                                               ; preds = %139, %23
  %29 = load i16, ptr %10, align 2, !tbaa !9
  %30 = zext i16 %29 to i32
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %167

32:                                               ; preds = %28
  br label %33

33:                                               ; preds = %38, %32
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = call zeroext i16 @ring_buf_get_free_size(ptr noundef %34)
  store i16 %35, ptr %9, align 2, !tbaa !9
  %36 = zext i16 %35 to i32
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %43

38:                                               ; preds = %33
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ring_buf_t, ptr %39, i32 0, i32 7
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  %42 = call i64 @xQueueSemaphoreTake(ptr noundef %41, i32 noundef -1)
  br label %33, !llvm.loop !15

43:                                               ; preds = %33
  %44 = load i16, ptr %9, align 2, !tbaa !9
  %45 = zext i16 %44 to i32
  %46 = load i16, ptr %10, align 2, !tbaa !9
  %47 = zext i16 %46 to i32
  %48 = icmp slt i32 %45, %47
  br i1 %48, label %49, label %52

49:                                               ; preds = %43
  %50 = load i16, ptr %9, align 2, !tbaa !9
  %51 = zext i16 %50 to i32
  br label %55

52:                                               ; preds = %43
  %53 = load i16, ptr %10, align 2, !tbaa !9
  %54 = zext i16 %53 to i32
  br label %55

55:                                               ; preds = %52, %49
  %56 = phi i32 [ %51, %49 ], [ %54, %52 ]
  %57 = trunc i32 %56 to i16
  store i16 %57, ptr %9, align 2, !tbaa !9
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.ring_buf_t, ptr %58, i32 0, i32 6
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  %61 = call i64 @xQueueSemaphoreTake(ptr noundef %60, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #4
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.ring_buf_t, ptr %62, i32 0, i32 2
  %64 = load ptr, ptr %63, align 8, !tbaa !11
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.ring_buf_t, ptr %65, i32 0, i32 3
  %67 = load i16, ptr %66, align 8, !tbaa !18
  %68 = zext i16 %67 to i32
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i8, ptr %64, i64 %69
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.ring_buf_t, ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !19
  %74 = ptrtoint ptr %70 to i64
  %75 = ptrtoint ptr %73 to i64
  %76 = sub i64 %74, %75
  %77 = trunc i64 %76 to i16
  store i16 %77, ptr %12, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #4
  %78 = load i16, ptr %9, align 2, !tbaa !9
  %79 = zext i16 %78 to i32
  %80 = load i16, ptr %12, align 2, !tbaa !9
  %81 = zext i16 %80 to i32
  %82 = icmp slt i32 %79, %81
  br i1 %82, label %83, label %86

83:                                               ; preds = %55
  %84 = load i16, ptr %9, align 2, !tbaa !9
  %85 = zext i16 %84 to i32
  br label %89

86:                                               ; preds = %55
  %87 = load i16, ptr %12, align 2, !tbaa !9
  %88 = zext i16 %87 to i32
  br label %89

89:                                               ; preds = %86, %83
  %90 = phi i32 [ %85, %83 ], [ %88, %86 ]
  %91 = trunc i32 %90 to i16
  store i16 %91, ptr %13, align 2, !tbaa !9
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.ring_buf_t, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !19
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = load i16, ptr %13, align 2, !tbaa !9
  %97 = zext i16 %96 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %94, ptr align 1 %95, i64 %97, i1 false)
  %98 = load i16, ptr %13, align 2, !tbaa !9
  %99 = zext i16 %98 to i32
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.ring_buf_t, ptr %100, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !19
  %103 = sext i32 %99 to i64
  %104 = getelementptr inbounds i8, ptr %102, i64 %103
  store ptr %104, ptr %101, align 8, !tbaa !19
  %105 = load i16, ptr %9, align 2, !tbaa !9
  %106 = zext i16 %105 to i32
  %107 = load i16, ptr %13, align 2, !tbaa !9
  %108 = zext i16 %107 to i32
  %109 = icmp sgt i32 %106, %108
  br i1 %109, label %110, label %139

110:                                              ; preds = %89
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.ring_buf_t, ptr %111, i32 0, i32 2
  %113 = load ptr, ptr %112, align 8, !tbaa !11
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = load i16, ptr %13, align 2, !tbaa !9
  %116 = zext i16 %115 to i32
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i8, ptr %114, i64 %117
  %119 = load i16, ptr %9, align 2, !tbaa !9
  %120 = zext i16 %119 to i32
  %121 = load i16, ptr %13, align 2, !tbaa !9
  %122 = zext i16 %121 to i32
  %123 = sub nsw i32 %120, %122
  %124 = sext i32 %123 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %113, ptr align 1 %118, i64 %124, i1 false)
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.ring_buf_t, ptr %125, i32 0, i32 2
  %127 = load ptr, ptr %126, align 8, !tbaa !11
  %128 = load i16, ptr %9, align 2, !tbaa !9
  %129 = zext i16 %128 to i32
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i8, ptr %127, i64 %130
  %132 = load i16, ptr %13, align 2, !tbaa !9
  %133 = zext i16 %132 to i32
  %134 = sext i32 %133 to i64
  %135 = sub i64 0, %134
  %136 = getelementptr inbounds i8, ptr %131, i64 %135
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.ring_buf_t, ptr %137, i32 0, i32 0
  store ptr %136, ptr %138, align 8, !tbaa !19
  br label %139

139:                                              ; preds = %110, %89
  %140 = load i16, ptr %9, align 2, !tbaa !9
  %141 = zext i16 %140 to i32
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.ring_buf_t, ptr %142, i32 0, i32 4
  %144 = load i16, ptr %143, align 2, !tbaa !20
  %145 = zext i16 %144 to i32
  %146 = add nsw i32 %145, %141
  %147 = trunc i32 %146 to i16
  store i16 %147, ptr %143, align 2, !tbaa !20
  %148 = load i16, ptr %9, align 2, !tbaa !9
  %149 = zext i16 %148 to i32
  %150 = load ptr, ptr %6, align 8, !tbaa !5
  %151 = sext i32 %149 to i64
  %152 = getelementptr inbounds i8, ptr %150, i64 %151
  store ptr %152, ptr %6, align 8, !tbaa !5
  %153 = load i16, ptr %9, align 2, !tbaa !9
  %154 = zext i16 %153 to i32
  %155 = load i16, ptr %10, align 2, !tbaa !9
  %156 = zext i16 %155 to i32
  %157 = sub nsw i32 %156, %154
  %158 = trunc i32 %157 to i16
  store i16 %158, ptr %10, align 2, !tbaa !9
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.ring_buf_t, ptr %159, i32 0, i32 8
  %161 = load ptr, ptr %160, align 8, !tbaa !21
  %162 = call i64 @xQueueGenericSend(ptr noundef %161, ptr noundef null, i32 noundef 0, i64 noundef 0)
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.ring_buf_t, ptr %163, i32 0, i32 6
  %165 = load ptr, ptr %164, align 8, !tbaa !17
  %166 = call i64 @xQueueGenericSend(ptr noundef %165, ptr noundef null, i32 noundef 0, i64 noundef 0)
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #4
  br label %28, !llvm.loop !22

167:                                              ; preds = %28
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.ring_buf_t, ptr %168, i32 0, i32 5
  %170 = load ptr, ptr %169, align 8, !tbaa !13
  %171 = call i64 @xQueueGenericSend(ptr noundef %170, ptr noundef null, i32 noundef 0, i64 noundef 0)
  %172 = load i16, ptr %7, align 2, !tbaa !9
  %173 = zext i16 %172 to i32
  store i32 %173, ptr %8, align 4, !tbaa !23
  %174 = load i32, ptr %8, align 4, !tbaa !23
  store i32 %174, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %175

175:                                              ; preds = %167, %22
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %176 = load i32, ptr %4, align 4
  ret i32 %176
}

; 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) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = !{!"short", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 26, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!13 = !{!12, !6, i64 32}
!14 = !{!12, !6, i64 48}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!12, !6, i64 40}
!18 = !{!12, !10, i64 24}
!19 = !{!12, !6, i64 0}
!20 = !{!12, !10, i64 26}
!21 = !{!12, !6, i64 56}
!22 = distinct !{!22, !16}
!23 = !{!24, !24, i64 0}
!24 = !{!"int", !7, i64 0}


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

declare i64 @xQueueSemaphoreTake(ptr noundef, i32 noundef) local_unnamed_addr #0

declare i64 @xQueueGenericSend(ptr noundef, ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i16 @ring_buf_get_free_size(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 65536) i32 @ring_buf_write(ptr noundef %0, ptr nocapture noundef readonly %1, i16 noundef zeroext %2) local_unnamed_addr #1 {
  %4 = icmp eq ptr %0, null
  br i1 %4, label %65, label %5

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = icmp eq ptr %7, null
  br i1 %8, label %65, label %9

9:                                                ; preds = %5
  %10 = getelementptr inbounds i8, ptr %0, i64 32
  %11 = load ptr, ptr %10, align 8, !tbaa !11
  %12 = tail call i64 @xQueueSemaphoreTake(ptr noundef %11, i32 noundef -1) #4
  %.not52 = icmp eq i16 %2, 0
  br i1 %.not52, label %._crit_edge55, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %9
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  %14 = getelementptr inbounds i8, ptr %0, i64 40
  %15 = getelementptr inbounds i8, ptr %0, i64 24
  %16 = getelementptr inbounds i8, ptr %0, i64 26
  %17 = getelementptr inbounds i8, ptr %0, i64 56
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %53
  %.04654 = phi ptr [ %1, %.preheader.lr.ph ], [ %56, %53 ]
  %.04753 = phi i16 [ %2, %.preheader.lr.ph ], [ %57, %53 ]
  %18 = tail call zeroext i16 @ring_buf_get_free_size(ptr noundef nonnull %0)
  %19 = icmp eq i16 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %20 = load ptr, ptr %13, align 8, !tbaa !12
  %21 = tail call i64 @xQueueSemaphoreTake(ptr noundef %20, i32 noundef -1) #4
  %22 = tail call zeroext i16 @ring_buf_get_free_size(ptr noundef nonnull %0)
  %23 = icmp eq i16 %22, 0
  br i1 %23, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %.lcssa = phi i16 [ %18, %.preheader ], [ %22, %.lr.ph ]
  %24 = tail call i16 @llvm.umin.i16(i16 %.lcssa, i16 %.04753)
  %25 = load ptr, ptr %14, align 8, !tbaa !15
  %26 = tail call i64 @xQueueSemaphoreTake(ptr noundef %25, i32 noundef -1) #4
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = load i16, ptr %15, align 8, !tbaa !16
  %29 = zext i16 %28 to i64
  %30 = getelementptr inbounds i8, ptr %27, i64 %29
  %31 = load ptr, ptr %0, align 8, !tbaa !17
  %32 = ptrtoint ptr %30 to i64
  %33 = ptrtoint ptr %31 to i64
  %34 = sub i64 %32, %33
  %35 = trunc i64 %34 to i32
  %36 = zext i16 %24 to i32
  %37 = and i32 %35, 65535
  %38 = tail call i32 @llvm.umin.i32(i32 %37, i32 %36)
  %39 = zext nneg i32 %38 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %31, ptr align 1 %.04654, i64 %39, i1 false)
  %40 = load ptr, ptr %0, align 8, !tbaa !17
  %41 = getelementptr inbounds i8, ptr %40, i64 %39
  store ptr %41, ptr %0, align 8, !tbaa !17
  %42 = icmp ult i32 %37, %36
  br i1 %42, label %43, label %._crit_edge._crit_edge

._crit_edge._crit_edge:                           ; preds = %._crit_edge
  %.pre = zext i16 %24 to i64
  br label %53

43:                                               ; preds = %._crit_edge
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %.04654, i64 %39
  %46 = sub nsw i32 %36, %38
  %47 = sext i32 %46 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %44, ptr align 1 %45, i64 %47, i1 false)
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = zext i16 %24 to i64
  %50 = getelementptr inbounds i8, ptr %48, i64 %49
  %51 = sub nsw i64 0, %39
  %52 = getelementptr inbounds i8, ptr %50, i64 %51
  store ptr %52, ptr %0, align 8, !tbaa !17
  br label %53

53:                                               ; preds = %._crit_edge._crit_edge, %43
  %.pre-phi = phi i64 [ %.pre, %._crit_edge._crit_edge ], [ %49, %43 ]
  %54 = load i16, ptr %16, align 2, !tbaa !18
  %55 = add i16 %54, %24
  store i16 %55, ptr %16, align 2, !tbaa !18
  %56 = getelementptr inbounds i8, ptr %.04654, i64 %.pre-phi
  %57 = sub i16 %.04753, %24
  %58 = load ptr, ptr %17, align 8, !tbaa !19
  %59 = tail call i64 @xQueueGenericSend(ptr noundef %58, ptr noundef null, i32 noundef 0, i64 noundef 0) #4
  %60 = load ptr, ptr %14, align 8, !tbaa !15
  %61 = tail call i64 @xQueueGenericSend(ptr noundef %60, ptr noundef null, i32 noundef 0, i64 noundef 0) #4
  %.not = icmp eq i16 %57, 0
  br i1 %.not, label %._crit_edge55, label %.preheader, !llvm.loop !20

._crit_edge55:                                    ; preds = %53, %9
  %62 = load ptr, ptr %10, align 8, !tbaa !11
  %63 = tail call i64 @xQueueGenericSend(ptr noundef %62, ptr noundef null, i32 noundef 0, i64 noundef 0) #4
  %64 = zext i16 %2 to i32
  br label %65

65:                                               ; preds = %3, %5, %._crit_edge55
  %.0 = phi i32 [ %64, %._crit_edge55 ], [ -1, %5 ], [ -1, %3 ]
  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) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.umin.i16(i16, i16) #3

attributes #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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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, !7, i64 16}
!6 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 26, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!6, !7, i64 32}
!12 = !{!6, !7, i64 48}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!6, !7, i64 40}
!16 = !{!6, !10, i64 24}
!17 = !{!6, !7, i64 0}
!18 = !{!6, !10, i64 26}
!19 = !{!6, !7, i64 56}
!20 = distinct !{!20, !14}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass