; LLVM IR from LeoVen/C-Macro-Collections :: examples (heapsort)

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

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@cmc_flags_to_str = external hidden global [12 x ptr], align 16
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @h_new(i64 noundef, i32 noundef, ptr noundef) #0

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @h_insert(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @h_remove(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @h_empty(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @h_count(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca %struct.heap_fval, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 48, i1 false)
  %11 = getelementptr inbounds %struct.heap_fval, ptr %3, i32 0, i32 0
  store ptr @cmc_i32_cmp, ptr %11, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.heap_fval, ptr %3, i32 0, i32 1
  %13 = getelementptr inbounds %struct.heap_fval, ptr %3, i32 0, i32 2
  %14 = getelementptr inbounds %struct.heap_fval, ptr %3, i32 0, i32 3
  %15 = getelementptr inbounds %struct.heap_fval, ptr %3, i32 0, i32 4
  %16 = getelementptr inbounds %struct.heap_fval, ptr %3, i32 0, i32 5
  %17 = call ptr @h_new(i64 noundef 32, i32 noundef -1, ptr noundef %3)
  store ptr %17, ptr %2, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1000, ptr %4, align 4, !tbaa !11
  br label %18

18:                                               ; preds = %36, %0
  %19 = load i32, ptr %4, align 4, !tbaa !11
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  store i32 2, ptr %5, align 4
  br label %39

22:                                               ; preds = %18
  %23 = load ptr, ptr %2, align 8, !tbaa !10
  %24 = load i32, ptr %4, align 4, !tbaa !11
  %25 = call zeroext i1 @h_insert(ptr noundef %23, i32 noundef %24)
  br i1 %25, label %35, label %26

26:                                               ; preds = %22
  %27 = load ptr, ptr %2, align 8, !tbaa !10
  %28 = call i32 @h_flag(ptr noundef %27)
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [12 x ptr], ptr @cmc_flags_to_str, i64 0, i64 %29
  %31 = load ptr, ptr %30, align 8, !tbaa !10
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %31)
  %33 = load ptr, ptr %2, align 8, !tbaa !10
  %34 = call i32 @h_flag(ptr noundef %33)
  store i32 %34, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %39

35:                                               ; preds = %22
  br label %36

36:                                               ; preds = %35
  %37 = load i32, ptr %4, align 4, !tbaa !11
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr %4, align 4, !tbaa !11
  br label %18, !llvm.loop !13

39:                                               ; preds = %26, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  %40 = load i32, ptr %5, align 4
  switch i32 %40, label %120 [
    i32 2, label %41
  ]

41:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %42 = load ptr, ptr %2, align 8, !tbaa !10
  %43 = call i64 @h_count(ptr noundef %42)
  store i64 %43, ptr %6, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %44 = load i64, ptr %6, align 8, !tbaa !15
  %45 = mul i64 4, %44
  %46 = call noalias ptr @malloc(i64 noundef %45) #8
  store ptr %46, ptr %7, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %47

47:                                               ; preds = %78, %41
  %48 = load ptr, ptr %2, align 8, !tbaa !10
  %49 = call zeroext i1 @h_empty(ptr noundef %48)
  %50 = xor i1 %49, true
  br i1 %50, label %51, label %79

51:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %52 = load ptr, ptr %2, align 8, !tbaa !10
  %53 = call i32 @h_peek(ptr noundef %52)
  store i32 %53, ptr %9, align 4, !tbaa !11
  %54 = load ptr, ptr %2, align 8, !tbaa !10
  %55 = call i32 @h_flag(ptr noundef %54)
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %66

57:                                               ; preds = %51
  %58 = load i32, ptr %9, align 4, !tbaa !11
  %59 = load ptr, ptr %7, align 8, !tbaa !10
  %60 = load i32, ptr %8, align 4, !tbaa !11
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %8, align 4, !tbaa !11
  %62 = sext i32 %60 to i64
  %63 = getelementptr inbounds i32, ptr %59, i64 %62
  store i32 %58, ptr %63, align 4, !tbaa !11
  %64 = load ptr, ptr %2, align 8, !tbaa !10
  %65 = call zeroext i1 @h_remove(ptr noundef %64)
  br label %75

66:                                               ; preds = %51
  %67 = load ptr, ptr %2, align 8, !tbaa !10
  %68 = call i32 @h_flag(ptr noundef %67)
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [12 x ptr], ptr @cmc_flags_to_str, i64 0, i64 %69
  %71 = load ptr, ptr %70, align 8, !tbaa !10
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %71)
  %73 = load ptr, ptr %2, align 8, !tbaa !10
  %74 = call i32 @h_flag(ptr noundef %73)
  store i32 %74, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %76

75:                                               ; preds = %57
  store i32 0, ptr %5, align 4
  br label %76

76:                                               ; preds = %75, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  %77 = load i32, ptr %5, align 4
  switch i32 %77, label %119 [
    i32 0, label %78
  ]

78:                                               ; preds = %76
  br label %47, !llvm.loop !17

79:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !15
  br label %80

80:                                               ; preds = %113, %79
  %81 = load i64, ptr %10, align 8, !tbaa !15
  %82 = load i64, ptr %6, align 8, !tbaa !15
  %83 = icmp ult i64 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 7, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %116

85:                                               ; preds = %80
  %86 = load i64, ptr %10, align 8, !tbaa !15
  %87 = icmp eq i64 %86, 0
  br i1 %87, label %88, label %94

88:                                               ; preds = %85
  %89 = load ptr, ptr %7, align 8, !tbaa !10
  %90 = load i64, ptr %10, align 8, !tbaa !15
  %91 = getelementptr inbounds i32, ptr %89, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !11
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %92)
  br label %112

94:                                               ; preds = %85
  %95 = load i64, ptr %10, align 8, !tbaa !15
  %96 = load i64, ptr %6, align 8, !tbaa !15
  %97 = sub i64 %96, 1
  %98 = icmp eq i64 %95, %97
  br i1 %98, label %99, label %105

99:                                               ; preds = %94
  %100 = load ptr, ptr %7, align 8, !tbaa !10
  %101 = load i64, ptr %10, align 8, !tbaa !15
  %102 = getelementptr inbounds i32, ptr %100, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !11
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %103)
  br label %111

105:                                              ; preds = %94
  %106 = load ptr, ptr %7, align 8, !tbaa !10
  %107 = load i64, ptr %10, align 8, !tbaa !15
  %108 = getelementptr inbounds i32, ptr %106, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !11
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %109)
  br label %111

111:                                              ; preds = %105, %99
  br label %112

112:                                              ; preds = %111, %88
  br label %113

113:                                              ; preds = %112
  %114 = load i64, ptr %10, align 8, !tbaa !15
  %115 = add i64 %114, 1
  store i64 %115, ptr %10, align 8, !tbaa !15
  br label %80, !llvm.loop !18

116:                                              ; preds = %84
  %117 = load ptr, ptr %7, align 8, !tbaa !10
  call void @free(ptr noundef %117) #7
  %118 = load ptr, ptr %2, align 8, !tbaa !10
  call void @h_free(ptr noundef %118)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %119

119:                                              ; preds = %116, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %120

120:                                              ; preds = %119, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %121 = load i32, ptr %1, align 4
  ret i32 %121
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @cmc_i32_cmp(i32 noundef, i32 noundef) #3

declare i32 @printf(ptr noundef, ...) #4

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #5

; Function Attrs: nounwind
declare void @free(ptr noundef) #6

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { inlinehint 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 #4 = { "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 allocsize(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 #6 = { nounwind "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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }

!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 0}
!6 = !{!"heap_fval", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !8, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}


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

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@cmc_flags_to_str = external hidden local_unnamed_addr global [12 x ptr], align 16
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @h_insert(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @h_remove(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @h_empty(ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.heap_fval, align 8
  %2 = getelementptr inbounds i8, ptr %1, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %2, i8 0, i64 40, i1 false)
  store ptr @cmc_i32_cmp, ptr %1, align 8, !tbaa !5
  %3 = call ptr @h_new(i64 noundef 32, i32 noundef -1, ptr noundef nonnull %1)
  br label %7

4:                                                ; preds = %7
  %5 = add nsw i32 %.03746, -1
  %6 = icmp ult i32 %.03746, 2
  br i1 %6, label %16, label %7, !llvm.loop !10

7:                                                ; preds = %0, %4
  %.03746 = phi i32 [ 1000, %0 ], [ %5, %4 ]
  %8 = call zeroext i1 @h_insert(ptr noundef %3, i32 noundef %.03746)
  br i1 %8, label %4, label %9

9:                                                ; preds = %7
  %10 = call i32 @h_flag(ptr noundef %3)
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds [12 x ptr], ptr @cmc_flags_to_str, i64 0, i64 %11
  %13 = load ptr, ptr %12, align 8, !tbaa !12
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %13)
  %15 = call i32 @h_flag(ptr noundef %3)
  br label %42

16:                                               ; preds = %4
  %17 = call i64 @h_count(ptr noundef %3)
  %18 = shl i64 %17, 2
  %19 = call noalias ptr @malloc(i64 noundef %18) #6
  %20 = call zeroext i1 @h_empty(ptr noundef %3)
  br i1 %20, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %34, %16
  %.not = icmp eq i64 %17, 0
  br i1 %.not, label %._crit_edge, label %21

21:                                               ; preds = %.preheader
  %22 = add i64 %17, -1
  %23 = load i32, ptr %19, align 4, !tbaa !13
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23)
  %exitcond.peel.not = icmp eq i64 %17, 1
  br i1 %exitcond.peel.not, label %._crit_edge, label %.peel.next

.lr.ph:                                           ; preds = %16, %34
  %indvars.iv = phi i64 [ %indvars.iv.next, %34 ], [ 0, %16 ]
  %25 = call i32 @h_peek(ptr noundef %3)
  %26 = call i32 @h_flag(ptr noundef %3)
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %34, label %.thread43

.thread43:                                        ; preds = %.lr.ph
  %28 = call i32 @h_flag(ptr noundef %3)
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [12 x ptr], ptr @cmc_flags_to_str, i64 0, i64 %29
  %31 = load ptr, ptr %30, align 8, !tbaa !12
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %31)
  %33 = call i32 @h_flag(ptr noundef %3)
  br label %42

34:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = getelementptr inbounds i32, ptr %19, i64 %indvars.iv
  store i32 %25, ptr %35, align 4, !tbaa !13
  %36 = call zeroext i1 @h_remove(ptr noundef %3)
  %37 = call zeroext i1 @h_empty(ptr noundef %3)
  br i1 %37, label %.preheader, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %.peel.next, %21, %.preheader
  call void @free(ptr noundef %19) #7
  call void @h_free(ptr noundef %3)
  br label %42

.peel.next:                                       ; preds = %21, %.peel.next
  %.048 = phi i64 [ %41, %.peel.next ], [ 1, %21 ]
  %38 = icmp eq i64 %.048, %22
  %.sink52 = getelementptr inbounds i32, ptr %19, i64 %.048
  %.str.4.sink = select i1 %38, ptr @.str.3, ptr @.str.4
  %39 = load i32, ptr %.sink52, align 4, !tbaa !13
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.4.sink, i32 noundef %39)
  %41 = add nuw i64 %.048, 1
  %exitcond.not = icmp eq i64 %41, %17
  br i1 %exitcond.not, label %._crit_edge, label %.peel.next, !llvm.loop !16

42:                                               ; preds = %.thread43, %9, %._crit_edge
  %.4 = phi i32 [ %15, %9 ], [ 0, %._crit_edge ], [ %33, %.thread43 ]
  ret i32 %.4
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @cmc_i32_cmp(i32 noundef, i32 noundef) #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { inlinehint 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 = { nofree nounwind "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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #6 = { nounwind allocsize(0) }
attributes #7 = { 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 0}
!6 = !{!"heap_fval", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11, !17}
!17 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass