; LLVM IR from yourtion/LearningMasteringAlgorithms-C :: Example/page (main)

; 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.CList_ = type { i32, ptr, ptr, ptr }
%struct.Page_ = type { i32, i32 }
%struct.CListElmt_ = type { ptr, ptr }

@stdout = external global ptr, align 8
@.str = external hidden unnamed_addr constant [37 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %struct.CList_, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @clist_init(ptr noundef %6, ptr noundef @free)
  store ptr null, ptr %7, align 8, !tbaa !9
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %49, %2
  %12 = load i32, ptr %9, align 4, !tbaa !5
  %13 = icmp slt i32 %12, 10
  br i1 %13, label %14, label %52

14:                                               ; preds = %11
  %15 = call noalias ptr @malloc(i64 noundef 8) #6
  store ptr %15, ptr %8, align 8, !tbaa !9
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %18

17:                                               ; preds = %14
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %113

18:                                               ; preds = %14
  %19 = load i32, ptr %9, align 4, !tbaa !5
  %20 = icmp slt i32 %19, 5
  br i1 %20, label %21, label %24

21:                                               ; preds = %18
  %22 = load ptr, ptr %8, align 8, !tbaa !9
  %23 = getelementptr inbounds %struct.Page_, ptr %22, i32 0, i32 1
  store i32 1, ptr %23, align 4, !tbaa !11
  br label %27

24:                                               ; preds = %18
  %25 = load ptr, ptr %8, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.Page_, ptr %25, i32 0, i32 1
  store i32 0, ptr %26, align 4, !tbaa !11
  br label %27

27:                                               ; preds = %24, %21
  %28 = load i32, ptr %9, align 4, !tbaa !5
  %29 = load ptr, ptr %8, align 8, !tbaa !9
  %30 = getelementptr inbounds %struct.Page_, ptr %29, i32 0, i32 0
  store i32 %28, ptr %30, align 4, !tbaa !13
  %31 = load ptr, ptr %7, align 8, !tbaa !9
  %32 = load ptr, ptr %8, align 8, !tbaa !9
  %33 = call i32 @clist_ins_next(ptr noundef %6, ptr noundef %31, ptr noundef %32)
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %27
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %113

36:                                               ; preds = %27
  %37 = load ptr, ptr %7, align 8, !tbaa !9
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %44

39:                                               ; preds = %36
  %40 = getelementptr inbounds %struct.CList_, ptr %6, i32 0, i32 3
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  %42 = getelementptr inbounds %struct.CListElmt_, ptr %41, i32 0, i32 1
  %43 = load ptr, ptr %42, align 8, !tbaa !16
  store ptr %43, ptr %7, align 8, !tbaa !9
  br label %48

44:                                               ; preds = %36
  %45 = load ptr, ptr %7, align 8, !tbaa !9
  %46 = getelementptr inbounds %struct.CListElmt_, ptr %45, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !16
  store ptr %47, ptr %7, align 8, !tbaa !9
  br label %48

48:                                               ; preds = %44, %39
  br label %49

49:                                               ; preds = %48
  %50 = load i32, ptr %9, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %9, align 4, !tbaa !5
  br label %11, !llvm.loop !18

52:                                               ; preds = %11
  %53 = getelementptr inbounds %struct.CList_, ptr %6, i32 0, i32 3
  %54 = load ptr, ptr %53, align 8, !tbaa !14
  store ptr %54, ptr %7, align 8, !tbaa !9
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %75, %52
  %56 = load i32, ptr %9, align 4, !tbaa !5
  %57 = icmp slt i32 %56, 10
  br i1 %57, label %58, label %78

58:                                               ; preds = %55
  %59 = load ptr, ptr %7, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.CListElmt_, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !20
  store ptr %61, ptr %8, align 8, !tbaa !9
  %62 = load ptr, ptr @stdout, align 8, !tbaa !9
  %63 = load i32, ptr %9, align 4, !tbaa !5
  %64 = load ptr, ptr %8, align 8, !tbaa !9
  %65 = getelementptr inbounds %struct.Page_, ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 4, !tbaa !13
  %67 = load i32, ptr %9, align 4, !tbaa !5
  %68 = load ptr, ptr %8, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct.Page_, ptr %68, i32 0, i32 1
  %70 = load i32, ptr %69, align 4, !tbaa !11
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef @.str, i32 noundef %63, i32 noundef %66, i32 noundef %67, i32 noundef %70) #5
  %72 = load ptr, ptr %7, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct.CListElmt_, ptr %72, i32 0, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !16
  store ptr %74, ptr %7, align 8, !tbaa !9
  br label %75

75:                                               ; preds = %58
  %76 = load i32, ptr %9, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %9, align 4, !tbaa !5
  br label %55, !llvm.loop !21

78:                                               ; preds = %55
  %79 = getelementptr inbounds %struct.CList_, ptr %6, i32 0, i32 3
  %80 = load ptr, ptr %79, align 8, !tbaa !14
  store ptr %80, ptr %7, align 8, !tbaa !9
  %81 = call i32 @replace_page(ptr noundef %7)
  store i32 %81, ptr %9, align 4, !tbaa !5
  %82 = load ptr, ptr @stdout, align 8, !tbaa !9
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef @.str.1, i32 noundef %83) #5
  %85 = getelementptr inbounds %struct.CList_, ptr %6, i32 0, i32 3
  %86 = load ptr, ptr %85, align 8, !tbaa !14
  store ptr %86, ptr %7, align 8, !tbaa !9
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %107, %78
  %88 = load i32, ptr %9, align 4, !tbaa !5
  %89 = icmp slt i32 %88, 10
  br i1 %89, label %90, label %110

90:                                               ; preds = %87
  %91 = load ptr, ptr %7, align 8, !tbaa !9
  %92 = getelementptr inbounds %struct.CListElmt_, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !20
  store ptr %93, ptr %8, align 8, !tbaa !9
  %94 = load ptr, ptr @stdout, align 8, !tbaa !9
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = load ptr, ptr %8, align 8, !tbaa !9
  %97 = getelementptr inbounds %struct.Page_, ptr %96, i32 0, i32 0
  %98 = load i32, ptr %97, align 4, !tbaa !13
  %99 = load i32, ptr %9, align 4, !tbaa !5
  %100 = load ptr, ptr %8, align 8, !tbaa !9
  %101 = getelementptr inbounds %struct.Page_, ptr %100, i32 0, i32 1
  %102 = load i32, ptr %101, align 4, !tbaa !11
  %103 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef @.str, i32 noundef %95, i32 noundef %98, i32 noundef %99, i32 noundef %102) #5
  %104 = load ptr, ptr %7, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct.CListElmt_, ptr %104, i32 0, i32 1
  %106 = load ptr, ptr %105, align 8, !tbaa !16
  store ptr %106, ptr %7, align 8, !tbaa !9
  br label %107

107:                                              ; preds = %90
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %9, align 4, !tbaa !5
  br label %87, !llvm.loop !22

110:                                              ; preds = %87
  %111 = load ptr, ptr @stdout, align 8, !tbaa !9
  %112 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef @.str.2) #5
  call void @clist_destroy(ptr noundef %6)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %113

113:                                              ; preds = %110, %35, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #5
  %114 = load i32, ptr %3, align 4
  ret i32 %114
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare void @clist_init(ptr noundef, ptr noundef) #2

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

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

declare i32 @clist_ins_next(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

declare i32 @replace_page(ptr noundef) #2

declare void @clist_destroy(ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 = { 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 #5 = { nounwind }
attributes #6 = { 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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 4}
!12 = !{!"Page_", !6, i64 0, !6, i64 4}
!13 = !{!12, !6, i64 0}
!14 = !{!15, !10, i64 24}
!15 = !{!"CList_", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!16 = !{!17, !10, i64 8}
!17 = !{!"CListElmt_", !10, i64 0, !10, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!17, !10, i64 0}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}


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

@stdout = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [37 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca %struct.CList_, align 8
  %4 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @clist_init(ptr noundef nonnull %3, ptr noundef nonnull @free) #6
  %5 = getelementptr inbounds i8, ptr %3, i64 24
  %6 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #7
  %7 = icmp eq ptr %6, null
  br i1 %7, label %.loopexit, label %8

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 1, ptr %9, align 4
  store i32 0, ptr %6, align 4, !tbaa !5
  %10 = call i32 @clist_ins_next(ptr noundef nonnull %3, ptr noundef null, ptr noundef nonnull %6) #6
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %11, label %.loopexit

11:                                               ; preds = %8
  %12 = load ptr, ptr %5, align 8
  %storemerge.in = getelementptr inbounds i8, ptr %12, i64 8
  %storemerge = load ptr, ptr %storemerge.in, align 8, !tbaa !10
  %13 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #7
  %14 = icmp eq ptr %13, null
  br i1 %14, label %.loopexit, label %15

15:                                               ; preds = %11
  %16 = getelementptr inbounds i8, ptr %13, i64 4
  store i32 1, ptr %16, align 4
  store i32 1, ptr %13, align 4, !tbaa !5
  %17 = call i32 @clist_ins_next(ptr noundef nonnull %3, ptr noundef %storemerge, ptr noundef nonnull %13) #6
  %.not.1 = icmp eq i32 %17, 0
  br i1 %.not.1, label %18, label %.loopexit

18:                                               ; preds = %15
  %19 = icmp eq ptr %storemerge, null
  %20 = load ptr, ptr %5, align 8
  %.pn.1 = select i1 %19, ptr %20, ptr %storemerge
  %storemerge.in.1 = getelementptr inbounds i8, ptr %.pn.1, i64 8
  %storemerge.1 = load ptr, ptr %storemerge.in.1, align 8, !tbaa !10
  %21 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #7
  %22 = icmp eq ptr %21, null
  br i1 %22, label %.loopexit, label %23

23:                                               ; preds = %18
  %24 = getelementptr inbounds i8, ptr %21, i64 4
  store i32 1, ptr %24, align 4
  store i32 2, ptr %21, align 4, !tbaa !5
  %25 = call i32 @clist_ins_next(ptr noundef nonnull %3, ptr noundef %storemerge.1, ptr noundef nonnull %21) #6
  %.not.2 = icmp eq i32 %25, 0
  br i1 %.not.2, label %26, label %.loopexit

26:                                               ; preds = %23
  %27 = icmp eq ptr %storemerge.1, null
  %28 = load ptr, ptr %5, align 8
  %.pn.2 = select i1 %27, ptr %28, ptr %storemerge.1
  %storemerge.in.2 = getelementptr inbounds i8, ptr %.pn.2, i64 8
  %storemerge.2 = load ptr, ptr %storemerge.in.2, align 8, !tbaa !10
  %29 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #7
  %30 = icmp eq ptr %29, null
  br i1 %30, label %.loopexit, label %31

31:                                               ; preds = %26
  %32 = getelementptr inbounds i8, ptr %29, i64 4
  store i32 1, ptr %32, align 4
  store i32 3, ptr %29, align 4, !tbaa !5
  %33 = call i32 @clist_ins_next(ptr noundef nonnull %3, ptr noundef %storemerge.2, ptr noundef nonnull %29) #6
  %.not.3 = icmp eq i32 %33, 0
  br i1 %.not.3, label %34, label %.loopexit

34:                                               ; preds = %31
  %35 = icmp eq ptr %storemerge.2, null
  %36 = load ptr, ptr %5, align 8
  %.pn.3 = select i1 %35, ptr %36, ptr %storemerge.2
  %storemerge.in.3 = getelementptr inbounds i8, ptr %.pn.3, i64 8
  %storemerge.3 = load ptr, ptr %storemerge.in.3, align 8, !tbaa !10
  %37 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #7
  %38 = icmp eq ptr %37, null
  br i1 %38, label %.loopexit, label %39

39:                                               ; preds = %34
  %40 = getelementptr inbounds i8, ptr %37, i64 4
  store i32 1, ptr %40, align 4
  store i32 4, ptr %37, align 4, !tbaa !5
  %41 = call i32 @clist_ins_next(ptr noundef nonnull %3, ptr noundef %storemerge.3, ptr noundef nonnull %37) #6
  %.not.4 = icmp eq i32 %41, 0
  br i1 %.not.4, label %42, label %.loopexit

42:                                               ; preds = %39
  %43 = icmp eq ptr %storemerge.3, null
  %44 = load ptr, ptr %5, align 8
  %.pn.4 = select i1 %43, ptr %44, ptr %storemerge.3
  %storemerge.in.4 = getelementptr inbounds i8, ptr %.pn.4, i64 8
  %storemerge.4 = load ptr, ptr %storemerge.in.4, align 8, !tbaa !10
  store ptr %storemerge.4, ptr %4, align 8, !tbaa !13
  %45 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #7
  %46 = icmp eq ptr %45, null
  br i1 %46, label %.loopexit, label %47

47:                                               ; preds = %42
  %48 = getelementptr inbounds i8, ptr %45, i64 4
  store i32 0, ptr %48, align 4
  store i32 5, ptr %45, align 4, !tbaa !5
  %49 = call i32 @clist_ins_next(ptr noundef nonnull %3, ptr noundef %storemerge.4, ptr noundef nonnull %45) #6
  %.not.5 = icmp eq i32 %49, 0
  br i1 %.not.5, label %50, label %.loopexit

50:                                               ; preds = %47
  %51 = icmp eq ptr %storemerge.4, null
  %52 = load ptr, ptr %5, align 8
  %.pn.5 = select i1 %51, ptr %52, ptr %storemerge.4
  %storemerge.in.5 = getelementptr inbounds i8, ptr %.pn.5, i64 8
  %storemerge.5 = load ptr, ptr %storemerge.in.5, align 8, !tbaa !10
  %53 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #7
  %54 = icmp eq ptr %53, null
  br i1 %54, label %.loopexit, label %55

55:                                               ; preds = %50
  %56 = getelementptr inbounds i8, ptr %53, i64 4
  store i32 0, ptr %56, align 4
  store i32 6, ptr %53, align 4, !tbaa !5
  %57 = call i32 @clist_ins_next(ptr noundef nonnull %3, ptr noundef %storemerge.5, ptr noundef nonnull %53) #6
  %.not.6 = icmp eq i32 %57, 0
  br i1 %.not.6, label %58, label %.loopexit

58:                                               ; preds = %55
  %59 = icmp eq ptr %storemerge.5, null
  %60 = load ptr, ptr %5, align 8
  %.pn.6 = select i1 %59, ptr %60, ptr %storemerge.5
  %storemerge.in.6 = getelementptr inbounds i8, ptr %.pn.6, i64 8
  %storemerge.6 = load ptr, ptr %storemerge.in.6, align 8, !tbaa !10
  %61 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #7
  %62 = icmp eq ptr %61, null
  br i1 %62, label %.loopexit, label %63

63:                                               ; preds = %58
  %64 = getelementptr inbounds i8, ptr %61, i64 4
  store i32 0, ptr %64, align 4
  store i32 7, ptr %61, align 4, !tbaa !5
  %65 = call i32 @clist_ins_next(ptr noundef nonnull %3, ptr noundef %storemerge.6, ptr noundef nonnull %61) #6
  %.not.7 = icmp eq i32 %65, 0
  br i1 %.not.7, label %66, label %.loopexit

66:                                               ; preds = %63
  %67 = icmp eq ptr %storemerge.6, null
  %68 = load ptr, ptr %5, align 8
  %.pn.7 = select i1 %67, ptr %68, ptr %storemerge.6
  %storemerge.in.7 = getelementptr inbounds i8, ptr %.pn.7, i64 8
  %storemerge.7 = load ptr, ptr %storemerge.in.7, align 8, !tbaa !10
  %69 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #7
  %70 = icmp eq ptr %69, null
  br i1 %70, label %.loopexit, label %71

71:                                               ; preds = %66
  %72 = getelementptr inbounds i8, ptr %69, i64 4
  store i32 0, ptr %72, align 4
  store i32 8, ptr %69, align 4, !tbaa !5
  %73 = call i32 @clist_ins_next(ptr noundef nonnull %3, ptr noundef %storemerge.7, ptr noundef nonnull %69) #6
  %.not.8 = icmp eq i32 %73, 0
  br i1 %.not.8, label %74, label %.loopexit

74:                                               ; preds = %71
  %75 = icmp eq ptr %storemerge.7, null
  %76 = load ptr, ptr %5, align 8
  %.pn.8 = select i1 %75, ptr %76, ptr %storemerge.7
  %storemerge.in.8 = getelementptr inbounds i8, ptr %.pn.8, i64 8
  %storemerge.8 = load ptr, ptr %storemerge.in.8, align 8, !tbaa !10
  %77 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #7
  %78 = icmp eq ptr %77, null
  br i1 %78, label %.loopexit, label %79

79:                                               ; preds = %74
  %80 = getelementptr inbounds i8, ptr %77, i64 4
  store i32 0, ptr %80, align 4
  store i32 9, ptr %77, align 4, !tbaa !5
  %81 = call i32 @clist_ins_next(ptr noundef nonnull %3, ptr noundef %storemerge.8, ptr noundef nonnull %77) #6
  %.not.9 = icmp eq i32 %81, 0
  br i1 %.not.9, label %82, label %.loopexit

82:                                               ; preds = %79
  %83 = load ptr, ptr %5, align 8
  %84 = load ptr, ptr %83, align 8, !tbaa !14
  %85 = load ptr, ptr @stdout, align 8, !tbaa !13
  %86 = load i32, ptr %84, align 4, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %84, i64 4
  %88 = load i32, ptr %87, align 4, !tbaa !15
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef nonnull @.str, i32 noundef 0, i32 noundef %86, i32 noundef 0, i32 noundef %88) #6
  %90 = getelementptr inbounds i8, ptr %83, i64 8
  %91 = load ptr, ptr %90, align 8, !tbaa !10
  %92 = load ptr, ptr %91, align 8, !tbaa !14
  %93 = load ptr, ptr @stdout, align 8, !tbaa !13
  %94 = load i32, ptr %92, align 4, !tbaa !5
  %95 = getelementptr inbounds i8, ptr %92, i64 4
  %96 = load i32, ptr %95, align 4, !tbaa !15
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %93, ptr noundef nonnull @.str, i32 noundef 1, i32 noundef %94, i32 noundef 1, i32 noundef %96) #6
  %98 = getelementptr inbounds i8, ptr %91, i64 8
  %99 = load ptr, ptr %98, align 8, !tbaa !10
  %100 = load ptr, ptr %99, align 8, !tbaa !14
  %101 = load ptr, ptr @stdout, align 8, !tbaa !13
  %102 = load i32, ptr %100, align 4, !tbaa !5
  %103 = getelementptr inbounds i8, ptr %100, i64 4
  %104 = load i32, ptr %103, align 4, !tbaa !15
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %101, ptr noundef nonnull @.str, i32 noundef 2, i32 noundef %102, i32 noundef 2, i32 noundef %104) #6
  %106 = getelementptr inbounds i8, ptr %99, i64 8
  %107 = load ptr, ptr %106, align 8, !tbaa !10
  %108 = load ptr, ptr %107, align 8, !tbaa !14
  %109 = load ptr, ptr @stdout, align 8, !tbaa !13
  %110 = load i32, ptr %108, align 4, !tbaa !5
  %111 = getelementptr inbounds i8, ptr %108, i64 4
  %112 = load i32, ptr %111, align 4, !tbaa !15
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef nonnull @.str, i32 noundef 3, i32 noundef %110, i32 noundef 3, i32 noundef %112) #6
  %114 = getelementptr inbounds i8, ptr %107, i64 8
  %115 = load ptr, ptr %114, align 8, !tbaa !10
  %116 = load ptr, ptr %115, align 8, !tbaa !14
  %117 = load ptr, ptr @stdout, align 8, !tbaa !13
  %118 = load i32, ptr %116, align 4, !tbaa !5
  %119 = getelementptr inbounds i8, ptr %116, i64 4
  %120 = load i32, ptr %119, align 4, !tbaa !15
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %117, ptr noundef nonnull @.str, i32 noundef 4, i32 noundef %118, i32 noundef 4, i32 noundef %120) #6
  %122 = getelementptr inbounds i8, ptr %115, i64 8
  %123 = load ptr, ptr %122, align 8, !tbaa !10
  %124 = load ptr, ptr %123, align 8, !tbaa !14
  %125 = load ptr, ptr @stdout, align 8, !tbaa !13
  %126 = load i32, ptr %124, align 4, !tbaa !5
  %127 = getelementptr inbounds i8, ptr %124, i64 4
  %128 = load i32, ptr %127, align 4, !tbaa !15
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %125, ptr noundef nonnull @.str, i32 noundef 5, i32 noundef %126, i32 noundef 5, i32 noundef %128) #6
  %130 = getelementptr inbounds i8, ptr %123, i64 8
  %131 = load ptr, ptr %130, align 8, !tbaa !10
  %132 = load ptr, ptr %131, align 8, !tbaa !14
  %133 = load ptr, ptr @stdout, align 8, !tbaa !13
  %134 = load i32, ptr %132, align 4, !tbaa !5
  %135 = getelementptr inbounds i8, ptr %132, i64 4
  %136 = load i32, ptr %135, align 4, !tbaa !15
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef nonnull @.str, i32 noundef 6, i32 noundef %134, i32 noundef 6, i32 noundef %136) #6
  %138 = getelementptr inbounds i8, ptr %131, i64 8
  %139 = load ptr, ptr %138, align 8, !tbaa !10
  %140 = load ptr, ptr %139, align 8, !tbaa !14
  %141 = load ptr, ptr @stdout, align 8, !tbaa !13
  %142 = load i32, ptr %140, align 4, !tbaa !5
  %143 = getelementptr inbounds i8, ptr %140, i64 4
  %144 = load i32, ptr %143, align 4, !tbaa !15
  %145 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %141, ptr noundef nonnull @.str, i32 noundef 7, i32 noundef %142, i32 noundef 7, i32 noundef %144) #6
  %146 = getelementptr inbounds i8, ptr %139, i64 8
  %147 = load ptr, ptr %146, align 8, !tbaa !10
  %148 = load ptr, ptr %147, align 8, !tbaa !14
  %149 = load ptr, ptr @stdout, align 8, !tbaa !13
  %150 = load i32, ptr %148, align 4, !tbaa !5
  %151 = getelementptr inbounds i8, ptr %148, i64 4
  %152 = load i32, ptr %151, align 4, !tbaa !15
  %153 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %149, ptr noundef nonnull @.str, i32 noundef 8, i32 noundef %150, i32 noundef 8, i32 noundef %152) #6
  %154 = getelementptr inbounds i8, ptr %147, i64 8
  %155 = load ptr, ptr %154, align 8, !tbaa !10
  %156 = load ptr, ptr %155, align 8, !tbaa !14
  %157 = load ptr, ptr @stdout, align 8, !tbaa !13
  %158 = load i32, ptr %156, align 4, !tbaa !5
  %159 = getelementptr inbounds i8, ptr %156, i64 4
  %160 = load i32, ptr %159, align 4, !tbaa !15
  %161 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %157, ptr noundef nonnull @.str, i32 noundef 9, i32 noundef %158, i32 noundef 9, i32 noundef %160) #6
  %162 = load ptr, ptr %5, align 8, !tbaa !16
  store ptr %162, ptr %4, align 8, !tbaa !13
  %163 = call i32 @replace_page(ptr noundef nonnull %4) #6
  %164 = load ptr, ptr @stdout, align 8, !tbaa !13
  %165 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %164, ptr noundef nonnull @.str.1, i32 noundef %163) #6
  %166 = load ptr, ptr %5, align 8, !tbaa !16
  store ptr %166, ptr %4, align 8, !tbaa !13
  %167 = load ptr, ptr %166, align 8, !tbaa !14
  %168 = load ptr, ptr @stdout, align 8, !tbaa !13
  %169 = load i32, ptr %167, align 4, !tbaa !5
  %170 = getelementptr inbounds i8, ptr %167, i64 4
  %171 = load i32, ptr %170, align 4, !tbaa !15
  %172 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %168, ptr noundef nonnull @.str, i32 noundef 0, i32 noundef %169, i32 noundef 0, i32 noundef %171) #6
  %173 = load ptr, ptr %4, align 8, !tbaa !13
  %174 = getelementptr inbounds i8, ptr %173, i64 8
  %175 = load ptr, ptr %174, align 8, !tbaa !10
  store ptr %175, ptr %4, align 8, !tbaa !13
  %176 = load ptr, ptr %175, align 8, !tbaa !14
  %177 = load ptr, ptr @stdout, align 8, !tbaa !13
  %178 = load i32, ptr %176, align 4, !tbaa !5
  %179 = getelementptr inbounds i8, ptr %176, i64 4
  %180 = load i32, ptr %179, align 4, !tbaa !15
  %181 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %177, ptr noundef nonnull @.str, i32 noundef 1, i32 noundef %178, i32 noundef 1, i32 noundef %180) #6
  %182 = load ptr, ptr %4, align 8, !tbaa !13
  %183 = getelementptr inbounds i8, ptr %182, i64 8
  %184 = load ptr, ptr %183, align 8, !tbaa !10
  store ptr %184, ptr %4, align 8, !tbaa !13
  %185 = load ptr, ptr %184, align 8, !tbaa !14
  %186 = load ptr, ptr @stdout, align 8, !tbaa !13
  %187 = load i32, ptr %185, align 4, !tbaa !5
  %188 = getelementptr inbounds i8, ptr %185, i64 4
  %189 = load i32, ptr %188, align 4, !tbaa !15
  %190 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %186, ptr noundef nonnull @.str, i32 noundef 2, i32 noundef %187, i32 noundef 2, i32 noundef %189) #6
  %191 = load ptr, ptr %4, align 8, !tbaa !13
  %192 = getelementptr inbounds i8, ptr %191, i64 8
  %193 = load ptr, ptr %192, align 8, !tbaa !10
  store ptr %193, ptr %4, align 8, !tbaa !13
  %194 = load ptr, ptr %193, align 8, !tbaa !14
  %195 = load ptr, ptr @stdout, align 8, !tbaa !13
  %196 = load i32, ptr %194, align 4, !tbaa !5
  %197 = getelementptr inbounds i8, ptr %194, i64 4
  %198 = load i32, ptr %197, align 4, !tbaa !15
  %199 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %195, ptr noundef nonnull @.str, i32 noundef 3, i32 noundef %196, i32 noundef 3, i32 noundef %198) #6
  %200 = load ptr, ptr %4, align 8, !tbaa !13
  %201 = getelementptr inbounds i8, ptr %200, i64 8
  %202 = load ptr, ptr %201, align 8, !tbaa !10
  store ptr %202, ptr %4, align 8, !tbaa !13
  %203 = load ptr, ptr %202, align 8, !tbaa !14
  %204 = load ptr, ptr @stdout, align 8, !tbaa !13
  %205 = load i32, ptr %203, align 4, !tbaa !5
  %206 = getelementptr inbounds i8, ptr %203, i64 4
  %207 = load i32, ptr %206, align 4, !tbaa !15
  %208 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %204, ptr noundef nonnull @.str, i32 noundef 4, i32 noundef %205, i32 noundef 4, i32 noundef %207) #6
  %209 = load ptr, ptr %4, align 8, !tbaa !13
  %210 = getelementptr inbounds i8, ptr %209, i64 8
  %211 = load ptr, ptr %210, align 8, !tbaa !10
  store ptr %211, ptr %4, align 8, !tbaa !13
  %212 = load ptr, ptr %211, align 8, !tbaa !14
  %213 = load ptr, ptr @stdout, align 8, !tbaa !13
  %214 = load i32, ptr %212, align 4, !tbaa !5
  %215 = getelementptr inbounds i8, ptr %212, i64 4
  %216 = load i32, ptr %215, align 4, !tbaa !15
  %217 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %213, ptr noundef nonnull @.str, i32 noundef 5, i32 noundef %214, i32 noundef 5, i32 noundef %216) #6
  %218 = load ptr, ptr %4, align 8, !tbaa !13
  %219 = getelementptr inbounds i8, ptr %218, i64 8
  %220 = load ptr, ptr %219, align 8, !tbaa !10
  store ptr %220, ptr %4, align 8, !tbaa !13
  %221 = load ptr, ptr %220, align 8, !tbaa !14
  %222 = load ptr, ptr @stdout, align 8, !tbaa !13
  %223 = load i32, ptr %221, align 4, !tbaa !5
  %224 = getelementptr inbounds i8, ptr %221, i64 4
  %225 = load i32, ptr %224, align 4, !tbaa !15
  %226 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %222, ptr noundef nonnull @.str, i32 noundef 6, i32 noundef %223, i32 noundef 6, i32 noundef %225) #6
  %227 = load ptr, ptr %4, align 8, !tbaa !13
  %228 = getelementptr inbounds i8, ptr %227, i64 8
  %229 = load ptr, ptr %228, align 8, !tbaa !10
  store ptr %229, ptr %4, align 8, !tbaa !13
  %230 = load ptr, ptr %229, align 8, !tbaa !14
  %231 = load ptr, ptr @stdout, align 8, !tbaa !13
  %232 = load i32, ptr %230, align 4, !tbaa !5
  %233 = getelementptr inbounds i8, ptr %230, i64 4
  %234 = load i32, ptr %233, align 4, !tbaa !15
  %235 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %231, ptr noundef nonnull @.str, i32 noundef 7, i32 noundef %232, i32 noundef 7, i32 noundef %234) #6
  %236 = load ptr, ptr %4, align 8, !tbaa !13
  %237 = getelementptr inbounds i8, ptr %236, i64 8
  %238 = load ptr, ptr %237, align 8, !tbaa !10
  store ptr %238, ptr %4, align 8, !tbaa !13
  %239 = load ptr, ptr %238, align 8, !tbaa !14
  %240 = load ptr, ptr @stdout, align 8, !tbaa !13
  %241 = load i32, ptr %239, align 4, !tbaa !5
  %242 = getelementptr inbounds i8, ptr %239, i64 4
  %243 = load i32, ptr %242, align 4, !tbaa !15
  %244 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %240, ptr noundef nonnull @.str, i32 noundef 8, i32 noundef %241, i32 noundef 8, i32 noundef %243) #6
  %245 = load ptr, ptr %4, align 8, !tbaa !13
  %246 = getelementptr inbounds i8, ptr %245, i64 8
  %247 = load ptr, ptr %246, align 8, !tbaa !10
  store ptr %247, ptr %4, align 8, !tbaa !13
  %248 = load ptr, ptr %247, align 8, !tbaa !14
  %249 = load ptr, ptr @stdout, align 8, !tbaa !13
  %250 = load i32, ptr %248, align 4, !tbaa !5
  %251 = getelementptr inbounds i8, ptr %248, i64 4
  %252 = load i32, ptr %251, align 4, !tbaa !15
  %253 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %249, ptr noundef nonnull @.str, i32 noundef 9, i32 noundef %250, i32 noundef 9, i32 noundef %252) #6
  %254 = load ptr, ptr %4, align 8, !tbaa !13
  %255 = getelementptr inbounds i8, ptr %254, i64 8
  %256 = load ptr, ptr %255, align 8, !tbaa !10
  store ptr %256, ptr %4, align 8, !tbaa !13
  %257 = load ptr, ptr @stdout, align 8, !tbaa !13
  %258 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %257, ptr noundef nonnull @.str.2) #6
  call void @clist_destroy(ptr noundef nonnull %3) #6
  br label %.loopexit

.loopexit:                                        ; preds = %8, %2, %11, %15, %18, %23, %26, %31, %34, %39, %42, %47, %50, %55, %58, %63, %66, %71, %74, %79, %82
  %.021 = phi i32 [ 0, %82 ], [ 1, %79 ], [ 1, %74 ], [ 1, %71 ], [ 1, %66 ], [ 1, %63 ], [ 1, %58 ], [ 1, %55 ], [ 1, %50 ], [ 1, %47 ], [ 1, %42 ], [ 1, %39 ], [ 1, %34 ], [ 1, %31 ], [ 1, %26 ], [ 1, %23 ], [ 1, %18 ], [ 1, %15 ], [ 1, %11 ], [ 1, %2 ], [ 1, %8 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  ret i32 %.021
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare void @clist_init(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) #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

declare i32 @clist_ins_next(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare i32 @replace_page(ptr noundef) local_unnamed_addr #2

declare void @clist_destroy(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #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 = { 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 #6 = { nounwind }
attributes #7 = { 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 = !{!"Page_", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !12, i64 8}
!11 = !{!"CListElmt_", !12, i64 0, !12, i64 8}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!11, !12, i64 0}
!15 = !{!6, !7, i64 4}
!16 = !{!17, !12, i64 24}
!17 = !{!"CList_", !7, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}


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