; LLVM IR from ponylang/ponyc :: src/libponyrt/mem (pagemap)

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

@root = external hidden global ptr, align 8
@level = external hidden constant [3 x %struct.pagemap_level_t], align 16
@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [50 x i8], align 1
@__func__.ponyint_pagemap_set = external hidden unnamed_addr constant [20 x i8], align 1

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

declare void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

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

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

17:                                               ; preds = %103, %3
  %18 = load i64, ptr %10, align 8, !tbaa !9
  %19 = icmp ult i64 %18, 3
  br i1 %19, label %21, label %20

20:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %106

21:                                               ; preds = %17
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = load atomic i64, ptr %22 monotonic, align 8
  store i64 %23, ptr %11, align 8
  %24 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %24, ptr %8, align 8, !tbaa !5
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %59

27:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %28 = load i64, ptr %10, align 8, !tbaa !9
  %29 = getelementptr inbounds [3 x %struct.pagemap_level_t], ptr @level, i64 0, i64 %28
  %30 = getelementptr inbounds %struct.pagemap_level_t, ptr %29, i32 0, i32 3
  %31 = load i64, ptr %30, align 8, !tbaa !11
  %32 = call noalias ptr @ponyint_pool_alloc(i64 noundef %31)
  store ptr %32, ptr %12, align 8, !tbaa !5
  %33 = load ptr, ptr %12, align 8, !tbaa !5
  %34 = load i64, ptr %10, align 8, !tbaa !9
  %35 = getelementptr inbounds [3 x %struct.pagemap_level_t], ptr @level, i64 0, i64 %34
  %36 = getelementptr inbounds %struct.pagemap_level_t, ptr %35, i32 0, i32 2
  %37 = load i64, ptr %36, align 8, !tbaa !14
  call void @llvm.memset.p0.i64(ptr align 1 %33, i8 0, i64 %37, i1 false)
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %39, ptr %13, align 8, !tbaa !5
  %40 = load i64, ptr %8, align 8
  %41 = load i64, ptr %13, align 8
  %42 = cmpxchg ptr %38, i64 %40, i64 %41 acq_rel acquire, align 8
  %43 = extractvalue { i64, i1 } %42, 0
  %44 = extractvalue { i64, i1 } %42, 1
  br i1 %44, label %46, label %45

45:                                               ; preds = %27
  store i64 %43, ptr %8, align 8
  br label %46

46:                                               ; preds = %45, %27
  %47 = zext i1 %44 to i8
  store i8 %47, ptr %14, align 1, !tbaa !15
  %48 = load i8, ptr %14, align 1, !tbaa !15, !range !17, !noundef !18
  %49 = trunc i8 %48 to i1
  br i1 %49, label %56, label %50

50:                                               ; preds = %46
  %51 = load i64, ptr %10, align 8, !tbaa !9
  %52 = getelementptr inbounds [3 x %struct.pagemap_level_t], ptr @level, i64 0, i64 %51
  %53 = getelementptr inbounds %struct.pagemap_level_t, ptr %52, i32 0, i32 3
  %54 = load i64, ptr %53, align 8, !tbaa !11
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  call void @ponyint_pool_free(i64 noundef %54, ptr noundef %55)
  br label %58

56:                                               ; preds = %46
  %57 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %57, ptr %8, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %56, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %60

59:                                               ; preds = %21
  fence acquire
  br label %60

60:                                               ; preds = %59, %58
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = ptrtoint ptr %61 to i64
  %63 = load i64, ptr %10, align 8, !tbaa !9
  %64 = getelementptr inbounds [3 x %struct.pagemap_level_t], ptr @level, i64 0, i64 %63
  %65 = getelementptr inbounds %struct.pagemap_level_t, ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 8, !tbaa !19
  %67 = zext i32 %66 to i64
  %68 = lshr i64 %62, %67
  %69 = load i64, ptr %10, align 8, !tbaa !9
  %70 = getelementptr inbounds [3 x %struct.pagemap_level_t], ptr @level, i64 0, i64 %69
  %71 = getelementptr inbounds %struct.pagemap_level_t, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 4, !tbaa !20
  %73 = sext i32 %72 to i64
  %74 = and i64 %68, %73
  store i64 %74, ptr %9, align 8, !tbaa !9
  %75 = load i64, ptr %9, align 8, !tbaa !9
  %76 = load i64, ptr %10, align 8, !tbaa !9
  %77 = getelementptr inbounds [3 x %struct.pagemap_level_t], ptr @level, i64 0, i64 %76
  %78 = getelementptr inbounds %struct.pagemap_level_t, ptr %77, i32 0, i32 2
  %79 = load i64, ptr %78, align 8, !tbaa !14
  %80 = icmp ule i64 %75, %79
  br i1 %80, label %81, label %82

81:                                               ; preds = %60
  br label %83

82:                                               ; preds = %60
  call void @ponyint_assert_fail(ptr noundef @.str, ptr noundef @.str.1, i64 noundef 235, ptr noundef @__func__.ponyint_pagemap_set)
  br label %83

83:                                               ; preds = %82, %81
  %84 = load i64, ptr %9, align 8, !tbaa !9
  %85 = load i64, ptr %10, align 8, !tbaa !9
  %86 = getelementptr inbounds [3 x %struct.pagemap_level_t], ptr @level, i64 0, i64 %85
  %87 = getelementptr inbounds %struct.pagemap_level_t, ptr %86, i32 0, i32 1
  %88 = load i32, ptr %87, align 4, !tbaa !20
  %89 = sext i32 %88 to i64
  %90 = icmp ule i64 %84, %89
  br i1 %90, label %91, label %92

91:                                               ; preds = %83
  br label %93

92:                                               ; preds = %83
  call void @ponyint_assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i64 noundef 236, ptr noundef @__func__.ponyint_pagemap_set)
  br label %93

93:                                               ; preds = %92, %91
  %94 = load i64, ptr %10, align 8, !tbaa !9
  %95 = icmp eq i64 %94, 2
  br i1 %95, label %96, label %99

96:                                               ; preds = %93
  %97 = load i64, ptr %9, align 8, !tbaa !9
  %98 = mul i64 %97, 2
  store i64 %98, ptr %9, align 8, !tbaa !9
  br label %99

99:                                               ; preds = %96, %93
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = load i64, ptr %9, align 8, !tbaa !9
  %102 = getelementptr inbounds ptr, ptr %100, i64 %101
  store ptr %102, ptr %7, align 8, !tbaa !5
  br label %103

103:                                              ; preds = %99
  %104 = load i64, ptr %10, align 8, !tbaa !9
  %105 = add i64 %104, 1
  store i64 %105, ptr %10, align 8, !tbaa !9
  br label %17, !llvm.loop !21

106:                                              ; preds = %20
  %107 = load i64, ptr %9, align 8, !tbaa !9
  %108 = icmp ule i64 %107, 65536
  br i1 %108, label %109, label %110

109:                                              ; preds = %106
  br label %111

110:                                              ; preds = %106
  call void @ponyint_assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i64 noundef 245, ptr noundef @__func__.ponyint_pagemap_set)
  br label %111

111:                                              ; preds = %110, %109
  %112 = load i64, ptr %9, align 8, !tbaa !9
  %113 = udiv i64 %112, 2
  %114 = icmp ule i64 %113, 4095
  br i1 %114, label %115, label %116

115:                                              ; preds = %111
  br label %117

116:                                              ; preds = %111
  call void @ponyint_assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i64 noundef 246, ptr noundef @__func__.ponyint_pagemap_set)
  br label %117

117:                                              ; preds = %116, %115
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %119, ptr %15, align 8, !tbaa !5
  %120 = load i64, ptr %15, align 8
  store atomic i64 %120, ptr %118 release, align 8
  %121 = load i64, ptr %9, align 8, !tbaa !9
  %122 = add i64 %121, 1
  store i64 %122, ptr %9, align 8, !tbaa !9
  %123 = load i64, ptr %9, align 8, !tbaa !9
  %124 = icmp ule i64 %123, 65536
  br i1 %124, label %125, label %126

125:                                              ; preds = %117
  br label %127

126:                                              ; preds = %117
  call void @ponyint_assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i64 noundef 249, ptr noundef @__func__.ponyint_pagemap_set)
  br label %127

127:                                              ; preds = %126, %125
  %128 = load i64, ptr %9, align 8, !tbaa !9
  %129 = udiv i64 %128, 2
  %130 = icmp ule i64 %129, 4095
  br i1 %130, label %131, label %132

131:                                              ; preds = %127
  br label %133

132:                                              ; preds = %127
  call void @ponyint_assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i64 noundef 250, ptr noundef @__func__.ponyint_pagemap_set)
  br label %133

133:                                              ; preds = %132, %131
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = load i64, ptr %9, align 8, !tbaa !9
  %136 = getelementptr inbounds ptr, ptr %134, i64 %135
  store ptr %136, ptr %7, align 8, !tbaa !5
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %138, ptr %16, align 8, !tbaa !5
  %139 = load i64, ptr %16, align 8
  store atomic i64 %139, ptr %137 release, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  ret void
}

declare noalias ptr @ponyint_pool_alloc(i64 noundef) #1

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

declare void @ponyint_pool_free(i64 noundef, ptr noundef) #1

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: write) }
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 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"pagemap_level_t", !13, i64 0, !13, i64 4, !10, i64 8, !10, i64 16}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !10, i64 8}
!15 = !{!16, !16, i64 0}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!12, !13, i64 0}
!20 = !{!12, !13, i64 4}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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

@root = external hidden global ptr, align 8
@level = external hidden local_unnamed_addr constant [3 x %struct.pagemap_level_t], align 16
@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [50 x i8], align 1
@__func__.ponyint_pagemap_set = external hidden unnamed_addr constant [20 x i8], align 1

declare void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @ponyint_pagemap_set(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = ptrtoint ptr %0 to i64
  %5 = load atomic i64, ptr @root monotonic, align 8
  %6 = icmp eq i64 %5, 0
  br i1 %6, label %7, label %17

7:                                                ; preds = %3
  %8 = load i64, ptr getelementptr inbounds (i8, ptr @level, i64 16), align 16, !tbaa !5
  %9 = tail call noalias ptr @ponyint_pool_alloc(i64 noundef %8) #3
  %10 = load i64, ptr getelementptr inbounds (i8, ptr @level, i64 8), align 8, !tbaa !11
  tail call void @llvm.memset.p0.i64(ptr align 1 %9, i8 0, i64 %10, i1 false)
  %11 = ptrtoint ptr %9 to i64
  %12 = cmpxchg ptr @root, i64 0, i64 %11 acq_rel acquire, align 8
  %13 = extractvalue { i64, i1 } %12, 1
  br i1 %13, label %19, label %14

14:                                               ; preds = %7
  %15 = extractvalue { i64, i1 } %12, 0
  %16 = inttoptr i64 %15 to ptr
  tail call void @ponyint_pool_free(i64 noundef %8, ptr noundef %9) #3
  br label %19

17:                                               ; preds = %3
  %18 = inttoptr i64 %5 to ptr
  fence acquire
  br label %19

19:                                               ; preds = %14, %7, %17
  %.3 = phi ptr [ %18, %17 ], [ %16, %14 ], [ %9, %7 ]
  %20 = load i32, ptr @level, align 16, !tbaa !12
  %21 = zext nneg i32 %20 to i64
  %22 = lshr i64 %4, %21
  %23 = load i32, ptr getelementptr inbounds (i8, ptr @level, i64 4), align 4, !tbaa !13
  %24 = sext i32 %23 to i64
  %25 = and i64 %22, %24
  %26 = load i64, ptr getelementptr inbounds (i8, ptr @level, i64 8), align 8, !tbaa !11
  %.not = icmp ugt i64 %25, %26
  br i1 %.not, label %27, label %28

27:                                               ; preds = %19
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 235, ptr noundef nonnull @__func__.ponyint_pagemap_set) #3
  br label %28

28:                                               ; preds = %27, %19
  %29 = getelementptr inbounds ptr, ptr %.3, i64 %25
  %30 = load atomic i64, ptr %29 monotonic, align 8
  %31 = icmp eq i64 %30, 0
  br i1 %31, label %34, label %32

32:                                               ; preds = %28
  %33 = inttoptr i64 %30 to ptr
  fence acquire
  br label %44

34:                                               ; preds = %28
  %35 = load i64, ptr getelementptr inbounds (i8, ptr @level, i64 40), align 8, !tbaa !5
  %36 = tail call noalias ptr @ponyint_pool_alloc(i64 noundef %35) #3
  %37 = load i64, ptr getelementptr inbounds (i8, ptr @level, i64 32), align 16, !tbaa !11
  tail call void @llvm.memset.p0.i64(ptr align 1 %36, i8 0, i64 %37, i1 false)
  %38 = ptrtoint ptr %36 to i64
  %39 = cmpxchg ptr %29, i64 0, i64 %38 acq_rel acquire, align 8
  %40 = extractvalue { i64, i1 } %39, 1
  br i1 %40, label %44, label %41

41:                                               ; preds = %34
  %42 = extractvalue { i64, i1 } %39, 0
  %43 = inttoptr i64 %42 to ptr
  tail call void @ponyint_pool_free(i64 noundef %35, ptr noundef %36) #3
  br label %44

44:                                               ; preds = %41, %34, %32
  %.3.1 = phi ptr [ %33, %32 ], [ %43, %41 ], [ %36, %34 ]
  %45 = load i32, ptr getelementptr inbounds (i8, ptr @level, i64 24), align 8, !tbaa !12
  %46 = zext nneg i32 %45 to i64
  %47 = lshr i64 %4, %46
  %48 = load i32, ptr getelementptr inbounds (i8, ptr @level, i64 28), align 4, !tbaa !13
  %49 = sext i32 %48 to i64
  %50 = and i64 %47, %49
  %51 = load i64, ptr getelementptr inbounds (i8, ptr @level, i64 32), align 16, !tbaa !11
  %.not.1 = icmp ugt i64 %50, %51
  br i1 %.not.1, label %52, label %53

52:                                               ; preds = %44
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 235, ptr noundef nonnull @__func__.ponyint_pagemap_set) #3
  br label %53

53:                                               ; preds = %52, %44
  %54 = getelementptr inbounds ptr, ptr %.3.1, i64 %50
  %55 = load atomic i64, ptr %54 monotonic, align 8
  %56 = icmp eq i64 %55, 0
  br i1 %56, label %59, label %57

57:                                               ; preds = %53
  %58 = inttoptr i64 %55 to ptr
  fence acquire
  br label %69

59:                                               ; preds = %53
  %60 = load i64, ptr getelementptr inbounds (i8, ptr @level, i64 64), align 16, !tbaa !5
  %61 = tail call noalias ptr @ponyint_pool_alloc(i64 noundef %60) #3
  %62 = load i64, ptr getelementptr inbounds (i8, ptr @level, i64 56), align 8, !tbaa !11
  tail call void @llvm.memset.p0.i64(ptr align 1 %61, i8 0, i64 %62, i1 false)
  %63 = ptrtoint ptr %61 to i64
  %64 = cmpxchg ptr %54, i64 0, i64 %63 acq_rel acquire, align 8
  %65 = extractvalue { i64, i1 } %64, 1
  br i1 %65, label %69, label %66

66:                                               ; preds = %59
  %67 = extractvalue { i64, i1 } %64, 0
  %68 = inttoptr i64 %67 to ptr
  tail call void @ponyint_pool_free(i64 noundef %60, ptr noundef %61) #3
  br label %69

69:                                               ; preds = %66, %59, %57
  %.3.2 = phi ptr [ %58, %57 ], [ %68, %66 ], [ %61, %59 ]
  %70 = load i32, ptr getelementptr inbounds (i8, ptr @level, i64 48), align 16, !tbaa !12
  %71 = zext nneg i32 %70 to i64
  %72 = lshr i64 %4, %71
  %73 = load i32, ptr getelementptr inbounds (i8, ptr @level, i64 52), align 4, !tbaa !13
  %74 = sext i32 %73 to i64
  %75 = and i64 %72, %74
  %76 = load i64, ptr getelementptr inbounds (i8, ptr @level, i64 56), align 8, !tbaa !11
  %.not.2 = icmp ugt i64 %75, %76
  br i1 %.not.2, label %77, label %78

77:                                               ; preds = %69
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 235, ptr noundef nonnull @__func__.ponyint_pagemap_set) #3
  br label %78

78:                                               ; preds = %77, %69
  %spec.select.2 = shl i64 %75, 1
  %79 = getelementptr inbounds ptr, ptr %.3.2, i64 %spec.select.2
  %80 = icmp ult i64 %spec.select.2, 65537
  br i1 %80, label %81, label %.thread

.thread:                                          ; preds = %78
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i64 noundef 245, ptr noundef nonnull @__func__.ponyint_pagemap_set) #3
  br label %85

81:                                               ; preds = %78
  %82 = icmp ult i64 %spec.select.2, 8192
  br i1 %82, label %.thread50, label %85

.thread50:                                        ; preds = %81
  %83 = ptrtoint ptr %1 to i64
  store atomic i64 %83, ptr %79 release, align 8
  %84 = or disjoint i64 %spec.select.2, 1
  br label %90

85:                                               ; preds = %81, %.thread
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i64 noundef 246, ptr noundef nonnull @__func__.ponyint_pagemap_set) #3
  %86 = ptrtoint ptr %1 to i64
  store atomic i64 %86, ptr %79 release, align 8
  %87 = or disjoint i64 %spec.select.2, 1
  %88 = icmp ult i64 %87, 65537
  br i1 %88, label %89, label %.thread47

.thread47:                                        ; preds = %85
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i64 noundef 249, ptr noundef nonnull @__func__.ponyint_pagemap_set) #3
  br label %89

89:                                               ; preds = %85, %.thread47
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i64 noundef 250, ptr noundef nonnull @__func__.ponyint_pagemap_set) #3
  br label %90

90:                                               ; preds = %.thread50, %89
  %91 = phi i64 [ %87, %89 ], [ %84, %.thread50 ]
  %92 = getelementptr inbounds ptr, ptr %.3.2, i64 %91
  %93 = ptrtoint ptr %2 to i64
  store atomic i64 %93, ptr %92 release, align 8
  ret void
}

declare noalias ptr @ponyint_pool_alloc(i64 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) #2

declare void @ponyint_pool_free(i64 noundef, ptr noundef) local_unnamed_addr #0

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: write) }
attributes #3 = { 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, !10, i64 16}
!6 = !{!"pagemap_level_t", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!6, !7, i64 0}
!13 = !{!6, !7, i64 4}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass