; LLVM IR from bartobri/data-structures-c :: priority-queue/doubly-linked-list-ordered-first-class (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"

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

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

10:                                               ; preds = %18, %0
  %11 = load i32, ptr %2, align 4, !tbaa !9
  %12 = icmp slt i32 %11, 20
  br i1 %12, label %13, label %21

13:                                               ; preds = %10
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = call i32 @rand() #4
  %16 = srem i32 %15, 20
  %17 = call ptr @PQinsert(ptr noundef %14, i32 noundef %16)
  br label %18

18:                                               ; preds = %13
  %19 = load i32, ptr %2, align 4, !tbaa !9
  %20 = add nsw i32 %19, 1
  store i32 %20, ptr %2, align 4, !tbaa !9
  br label %10, !llvm.loop !11

21:                                               ; preds = %10
  br label %22

22:                                               ; preds = %27, %21
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = call i32 @PQempty(ptr noundef %23)
  %25 = icmp ne i32 %24, 0
  %26 = xor i1 %25, true
  br i1 %26, label %27, label %31

27:                                               ; preds = %22
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = call i32 @PQdelmax(ptr noundef %28)
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %29)
  br label %22, !llvm.loop !13

31:                                               ; preds = %22
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %33

33:                                               ; preds = %41, %31
  %34 = load i32, ptr %2, align 4, !tbaa !9
  %35 = icmp slt i32 %34, 10
  br i1 %35, label %36, label %44

36:                                               ; preds = %33
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = call i32 @rand() #4
  %39 = srem i32 %38, 20
  %40 = call ptr @PQinsert(ptr noundef %37, i32 noundef %39)
  store ptr %40, ptr %5, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %36
  %42 = load i32, ptr %2, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %2, align 4, !tbaa !9
  br label %33, !llvm.loop !14

44:                                               ; preds = %33
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %53, %44
  %46 = load i32, ptr %2, align 4, !tbaa !9
  %47 = icmp slt i32 %46, 10
  br i1 %47, label %48, label %56

48:                                               ; preds = %45
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = call i32 @rand() #4
  %51 = srem i32 %50, 20
  %52 = call ptr @PQinsert(ptr noundef %49, i32 noundef %51)
  br label %53

53:                                               ; preds = %48
  %54 = load i32, ptr %2, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %2, align 4, !tbaa !9
  br label %45, !llvm.loop !15

56:                                               ; preds = %45
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  call void @PQchange(ptr noundef %57, ptr noundef %58, i32 noundef 10)
  br label %59

59:                                               ; preds = %64, %56
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = call i32 @PQempty(ptr noundef %60)
  %62 = icmp ne i32 %61, 0
  %63 = xor i1 %62, true
  br i1 %63, label %64, label %68

64:                                               ; preds = %59
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = call i32 @PQdelmax(ptr noundef %65)
  %67 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %66)
  br label %59, !llvm.loop !16

68:                                               ; preds = %59
  %69 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %78, %68
  %71 = load i32, ptr %2, align 4, !tbaa !9
  %72 = icmp slt i32 %71, 10
  br i1 %72, label %73, label %81

73:                                               ; preds = %70
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = call i32 @rand() #4
  %76 = srem i32 %75, 20
  %77 = call ptr @PQinsert(ptr noundef %74, i32 noundef %76)
  br label %78

78:                                               ; preds = %73
  %79 = load i32, ptr %2, align 4, !tbaa !9
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %2, align 4, !tbaa !9
  br label %70, !llvm.loop !17

81:                                               ; preds = %70
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %90, %81
  %83 = load i32, ptr %2, align 4, !tbaa !9
  %84 = icmp slt i32 %83, 10
  br i1 %84, label %85, label %93

85:                                               ; preds = %82
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = call i32 @rand() #4
  %88 = srem i32 %87, 20
  %89 = call ptr @PQinsert(ptr noundef %86, i32 noundef %88)
  br label %90

90:                                               ; preds = %85
  %91 = load i32, ptr %2, align 4, !tbaa !9
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %2, align 4, !tbaa !9
  br label %82, !llvm.loop !18

93:                                               ; preds = %82
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  call void @PQjoin(ptr noundef %94, ptr noundef %95)
  br label %96

96:                                               ; preds = %101, %93
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = call i32 @PQempty(ptr noundef %97)
  %99 = icmp ne i32 %98, 0
  %100 = xor i1 %99, true
  br i1 %100, label %101, label %105

101:                                              ; preds = %96
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = call i32 @PQdelmax(ptr noundef %102)
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %103)
  br label %96, !llvm.loop !19

105:                                              ; preds = %96
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  call void @PQdestroy(ptr noundef %107)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  ret i32 0
}

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) #2

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #2

declare ptr @PQinit() #3

declare ptr @PQinsert(ptr noundef, i32 noundef) #3

; Function Attrs: nounwind
declare i32 @rand() #2

declare i32 @PQempty(ptr noundef) #3

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

declare i32 @PQdelmax(ptr noundef) #3

declare void @PQchange(ptr noundef, ptr noundef, i32 noundef) #3

declare void @PQjoin(ptr noundef, ptr noundef) #3

declare void @PQdestroy(ptr noundef) #3

; 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 = { 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 #3 = { "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 }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !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"

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
.preheader29:
  %0 = tail call i64 @time(ptr noundef null) #4
  %1 = trunc i64 %0 to i32
  tail call void @srand(i32 noundef %1) #4
  %2 = tail call ptr @PQinit() #4
  %3 = tail call ptr @PQinit() #4
  %4 = tail call i32 @rand() #4
  %5 = srem i32 %4, 20
  %6 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %5) #4
  %7 = tail call i32 @rand() #4
  %8 = srem i32 %7, 20
  %9 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %8) #4
  %10 = tail call i32 @rand() #4
  %11 = srem i32 %10, 20
  %12 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %11) #4
  %13 = tail call i32 @rand() #4
  %14 = srem i32 %13, 20
  %15 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %14) #4
  %16 = tail call i32 @rand() #4
  %17 = srem i32 %16, 20
  %18 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %17) #4
  %19 = tail call i32 @rand() #4
  %20 = srem i32 %19, 20
  %21 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %20) #4
  %22 = tail call i32 @rand() #4
  %23 = srem i32 %22, 20
  %24 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %23) #4
  %25 = tail call i32 @rand() #4
  %26 = srem i32 %25, 20
  %27 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %26) #4
  %28 = tail call i32 @rand() #4
  %29 = srem i32 %28, 20
  %30 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %29) #4
  %31 = tail call i32 @rand() #4
  %32 = srem i32 %31, 20
  %33 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %32) #4
  %34 = tail call i32 @rand() #4
  %35 = srem i32 %34, 20
  %36 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %35) #4
  %37 = tail call i32 @rand() #4
  %38 = srem i32 %37, 20
  %39 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %38) #4
  %40 = tail call i32 @rand() #4
  %41 = srem i32 %40, 20
  %42 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %41) #4
  %43 = tail call i32 @rand() #4
  %44 = srem i32 %43, 20
  %45 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %44) #4
  %46 = tail call i32 @rand() #4
  %47 = srem i32 %46, 20
  %48 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %47) #4
  %49 = tail call i32 @rand() #4
  %50 = srem i32 %49, 20
  %51 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %50) #4
  %52 = tail call i32 @rand() #4
  %53 = srem i32 %52, 20
  %54 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %53) #4
  %55 = tail call i32 @rand() #4
  %56 = srem i32 %55, 20
  %57 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %56) #4
  %58 = tail call i32 @rand() #4
  %59 = srem i32 %58, 20
  %60 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %59) #4
  %61 = tail call i32 @rand() #4
  %62 = srem i32 %61, 20
  %63 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %62) #4
  %64 = tail call i32 @PQempty(ptr noundef %2) #4
  %.not31 = icmp eq i32 %64, 0
  br i1 %.not31, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader29, %.lr.ph
  %65 = tail call i32 @PQdelmax(ptr noundef %2) #4
  %66 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %65)
  %67 = tail call i32 @PQempty(ptr noundef %2) #4
  %.not = icmp eq i32 %67, 0
  br i1 %.not, label %.lr.ph, label %._crit_edge, !llvm.loop !5

._crit_edge:                                      ; preds = %.lr.ph, %.preheader29
  %68 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %69 = tail call i32 @rand() #4
  %70 = srem i32 %69, 20
  %71 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %70) #4
  %72 = tail call i32 @rand() #4
  %73 = srem i32 %72, 20
  %74 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %73) #4
  %75 = tail call i32 @rand() #4
  %76 = srem i32 %75, 20
  %77 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %76) #4
  %78 = tail call i32 @rand() #4
  %79 = srem i32 %78, 20
  %80 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %79) #4
  %81 = tail call i32 @rand() #4
  %82 = srem i32 %81, 20
  %83 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %82) #4
  %84 = tail call i32 @rand() #4
  %85 = srem i32 %84, 20
  %86 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %85) #4
  %87 = tail call i32 @rand() #4
  %88 = srem i32 %87, 20
  %89 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %88) #4
  %90 = tail call i32 @rand() #4
  %91 = srem i32 %90, 20
  %92 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %91) #4
  %93 = tail call i32 @rand() #4
  %94 = srem i32 %93, 20
  %95 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %94) #4
  %96 = tail call i32 @rand() #4
  %97 = srem i32 %96, 20
  %98 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %97) #4
  %99 = tail call i32 @rand() #4
  %100 = srem i32 %99, 20
  %101 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %100) #4
  %102 = tail call i32 @rand() #4
  %103 = srem i32 %102, 20
  %104 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %103) #4
  %105 = tail call i32 @rand() #4
  %106 = srem i32 %105, 20
  %107 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %106) #4
  %108 = tail call i32 @rand() #4
  %109 = srem i32 %108, 20
  %110 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %109) #4
  %111 = tail call i32 @rand() #4
  %112 = srem i32 %111, 20
  %113 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %112) #4
  %114 = tail call i32 @rand() #4
  %115 = srem i32 %114, 20
  %116 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %115) #4
  %117 = tail call i32 @rand() #4
  %118 = srem i32 %117, 20
  %119 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %118) #4
  %120 = tail call i32 @rand() #4
  %121 = srem i32 %120, 20
  %122 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %121) #4
  %123 = tail call i32 @rand() #4
  %124 = srem i32 %123, 20
  %125 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %124) #4
  %126 = tail call i32 @rand() #4
  %127 = srem i32 %126, 20
  %128 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %127) #4
  tail call void @PQchange(ptr noundef %2, ptr noundef %98, i32 noundef 10) #4
  %129 = tail call i32 @PQempty(ptr noundef %2) #4
  %.not2634 = icmp eq i32 %129, 0
  br i1 %.not2634, label %.lr.ph36, label %._crit_edge37

.lr.ph36:                                         ; preds = %._crit_edge, %.lr.ph36
  %130 = tail call i32 @PQdelmax(ptr noundef %2) #4
  %131 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %130)
  %132 = tail call i32 @PQempty(ptr noundef %2) #4
  %.not26 = icmp eq i32 %132, 0
  br i1 %.not26, label %.lr.ph36, label %._crit_edge37, !llvm.loop !7

._crit_edge37:                                    ; preds = %.lr.ph36, %._crit_edge
  %133 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %134 = tail call i32 @rand() #4
  %135 = srem i32 %134, 20
  %136 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %135) #4
  %137 = tail call i32 @rand() #4
  %138 = srem i32 %137, 20
  %139 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %138) #4
  %140 = tail call i32 @rand() #4
  %141 = srem i32 %140, 20
  %142 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %141) #4
  %143 = tail call i32 @rand() #4
  %144 = srem i32 %143, 20
  %145 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %144) #4
  %146 = tail call i32 @rand() #4
  %147 = srem i32 %146, 20
  %148 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %147) #4
  %149 = tail call i32 @rand() #4
  %150 = srem i32 %149, 20
  %151 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %150) #4
  %152 = tail call i32 @rand() #4
  %153 = srem i32 %152, 20
  %154 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %153) #4
  %155 = tail call i32 @rand() #4
  %156 = srem i32 %155, 20
  %157 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %156) #4
  %158 = tail call i32 @rand() #4
  %159 = srem i32 %158, 20
  %160 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %159) #4
  %161 = tail call i32 @rand() #4
  %162 = srem i32 %161, 20
  %163 = tail call ptr @PQinsert(ptr noundef %2, i32 noundef %162) #4
  %164 = tail call i32 @rand() #4
  %165 = srem i32 %164, 20
  %166 = tail call ptr @PQinsert(ptr noundef %3, i32 noundef %165) #4
  %167 = tail call i32 @rand() #4
  %168 = srem i32 %167, 20
  %169 = tail call ptr @PQinsert(ptr noundef %3, i32 noundef %168) #4
  %170 = tail call i32 @rand() #4
  %171 = srem i32 %170, 20
  %172 = tail call ptr @PQinsert(ptr noundef %3, i32 noundef %171) #4
  %173 = tail call i32 @rand() #4
  %174 = srem i32 %173, 20
  %175 = tail call ptr @PQinsert(ptr noundef %3, i32 noundef %174) #4
  %176 = tail call i32 @rand() #4
  %177 = srem i32 %176, 20
  %178 = tail call ptr @PQinsert(ptr noundef %3, i32 noundef %177) #4
  %179 = tail call i32 @rand() #4
  %180 = srem i32 %179, 20
  %181 = tail call ptr @PQinsert(ptr noundef %3, i32 noundef %180) #4
  %182 = tail call i32 @rand() #4
  %183 = srem i32 %182, 20
  %184 = tail call ptr @PQinsert(ptr noundef %3, i32 noundef %183) #4
  %185 = tail call i32 @rand() #4
  %186 = srem i32 %185, 20
  %187 = tail call ptr @PQinsert(ptr noundef %3, i32 noundef %186) #4
  %188 = tail call i32 @rand() #4
  %189 = srem i32 %188, 20
  %190 = tail call ptr @PQinsert(ptr noundef %3, i32 noundef %189) #4
  %191 = tail call i32 @rand() #4
  %192 = srem i32 %191, 20
  %193 = tail call ptr @PQinsert(ptr noundef %3, i32 noundef %192) #4
  tail call void @PQjoin(ptr noundef %2, ptr noundef %3) #4
  %194 = tail call i32 @PQempty(ptr noundef %2) #4
  %.not2740 = icmp eq i32 %194, 0
  br i1 %.not2740, label %.lr.ph42, label %._crit_edge43

.lr.ph42:                                         ; preds = %._crit_edge37, %.lr.ph42
  %195 = tail call i32 @PQdelmax(ptr noundef %2) #4
  %196 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %195)
  %197 = tail call i32 @PQempty(ptr noundef %2) #4
  %.not27 = icmp eq i32 %197, 0
  br i1 %.not27, label %.lr.ph42, label %._crit_edge43, !llvm.loop !8

._crit_edge43:                                    ; preds = %.lr.ph42, %._crit_edge37
  %198 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  tail call void @PQdestroy(ptr noundef %2) #4
  ret i32 0
}

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #1

declare ptr @PQinit() local_unnamed_addr #2

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

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #1

declare i32 @PQempty(ptr noundef) local_unnamed_addr #2

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

declare i32 @PQdelmax(ptr noundef) local_unnamed_addr #2

declare void @PQchange(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

declare void @PQdestroy(ptr noundef) local_unnamed_addr #2

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 = { 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 #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 = { 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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}


; Effective O3 passes: GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass