; LLVM IR from AngoraFuzzer/Angora :: llvm_mode/dfsan_rt/sanitizer_common (sanitizer_linux_libcdep)

; 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.rlimit = type { i64, i64 }
%"class.__sanitizer::MemoryMappingLayout" = type { %"struct.__sanitizer::ProcSelfMapsBuff", ptr }
%"struct.__sanitizer::ProcSelfMapsBuff" = type { ptr, i64, i64 }
%union.pthread_attr_t = type { i64, [48 x i8] }

@.str = external hidden unnamed_addr constant [116 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [41 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer26GetThreadStackTopAndBottomEbPmS0_(i1 noundef zeroext %0, ptr noundef %1, ptr noundef %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca i8, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca %struct.rlimit, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca %"class.__sanitizer::MemoryMappingLayout", align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca %union.pthread_attr_t, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca ptr, align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = zext i1 %0 to i8
  store i8 %31, ptr %4, align 1, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !9
  br label %32

32:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %33 = load ptr, ptr %5, align 8, !tbaa !9
  %34 = ptrtoint ptr %33 to i64
  store i64 %34, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !11
  %35 = load i64, ptr %7, align 8, !tbaa !11
  %36 = load i64, ptr %8, align 8, !tbaa !11
  %37 = icmp ne i64 %35, %36
  %38 = xor i1 %37, true
  %39 = xor i1 %38, true
  %40 = xor i1 %39, true
  %41 = zext i1 %40 to i64
  %42 = call i64 @llvm.expect.i64(i64 %41, i64 0)
  %43 = icmp ne i64 %42, 0
  br i1 %43, label %44, label %47

44:                                               ; preds = %32
  %45 = load i64, ptr %7, align 8, !tbaa !11
  %46 = load i64, ptr %8, align 8, !tbaa !11
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 78, ptr noundef @.str.1, i64 noundef %45, i64 noundef %46) #8
  unreachable

47:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %50 = load ptr, ptr %6, align 8, !tbaa !9
  %51 = ptrtoint ptr %50 to i64
  store i64 %51, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !11
  %52 = load i64, ptr %9, align 8, !tbaa !11
  %53 = load i64, ptr %10, align 8, !tbaa !11
  %54 = icmp ne i64 %52, %53
  %55 = xor i1 %54, true
  %56 = xor i1 %55, true
  %57 = xor i1 %56, true
  %58 = zext i1 %57 to i64
  %59 = call i64 @llvm.expect.i64(i64 %58, i64 0)
  %60 = icmp ne i64 %59, 0
  br i1 %60, label %61, label %64

61:                                               ; preds = %49
  %62 = load i64, ptr %9, align 8, !tbaa !11
  %63 = load i64, ptr %10, align 8, !tbaa !11
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 79, ptr noundef @.str.2, i64 noundef %62, i64 noundef %63) #8
  unreachable

64:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %65

65:                                               ; preds = %64
  %66 = load i8, ptr %4, align 1, !tbaa !5, !range !13, !noundef !14
  %67 = trunc i8 %66 to i1
  br i1 %67, label %68, label %156

68:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  br label %69

69:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %70 = call i32 @getrlimit(i32 noundef 3, ptr noundef %11) #7
  %71 = sext i32 %70 to i64
  store i64 %71, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 0, ptr %13, align 8, !tbaa !11
  %72 = load i64, ptr %12, align 8, !tbaa !11
  %73 = load i64, ptr %13, align 8, !tbaa !11
  %74 = icmp eq i64 %72, %73
  %75 = xor i1 %74, true
  %76 = xor i1 %75, true
  %77 = xor i1 %76, true
  %78 = zext i1 %77 to i64
  %79 = call i64 @llvm.expect.i64(i64 %78, i64 0)
  %80 = icmp ne i64 %79, 0
  br i1 %80, label %81, label %84

81:                                               ; preds = %69
  %82 = load i64, ptr %12, align 8, !tbaa !11
  %83 = load i64, ptr %13, align 8, !tbaa !11
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 83, ptr noundef @.str.3, i64 noundef %82, i64 noundef %83) #8
  unreachable

84:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %85

85:                                               ; preds = %84
  br label %86

86:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #7
  call void @_ZN11__sanitizer19MemoryMappingLayoutC1Eb(ptr noundef nonnull align 8 dereferenceable(32) %14, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store i64 0, ptr %18, align 8, !tbaa !15
  br label %87

87:                                               ; preds = %99, %86
  %88 = invoke noundef zeroext i1 @_ZN11__sanitizer19MemoryMappingLayout4NextEPmS1_S1_PcmS1_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef null, i64 noundef 0, ptr noundef null)
          to label %89 unwind label %95

89:                                               ; preds = %87
  br i1 %88, label %90, label %101

90:                                               ; preds = %89
  %91 = ptrtoint ptr %11 to i64
  %92 = load i64, ptr %16, align 8, !tbaa !15
  %93 = icmp ult i64 %91, %92
  br i1 %93, label %94, label %99

94:                                               ; preds = %90
  br label %101

95:                                               ; preds = %87
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %19, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %20, align 4
  br label %155

99:                                               ; preds = %90
  %100 = load i64, ptr %16, align 8, !tbaa !15
  store i64 %100, ptr %18, align 8, !tbaa !15
  br label %87, !llvm.loop !17

101:                                              ; preds = %94, %89
  br label %102

102:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %103 = ptrtoint ptr %11 to i64
  %104 = load i64, ptr %15, align 8, !tbaa !15
  %105 = icmp uge i64 %103, %104
  br i1 %105, label %106, label %110

106:                                              ; preds = %102
  %107 = ptrtoint ptr %11 to i64
  %108 = load i64, ptr %16, align 8, !tbaa !15
  %109 = icmp ult i64 %107, %108
  br label %110

110:                                              ; preds = %106, %102
  %111 = phi i1 [ false, %102 ], [ %109, %106 ]
  %112 = zext i1 %111 to i64
  store i64 %112, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store i64 0, ptr %22, align 8, !tbaa !11
  %113 = load i64, ptr %21, align 8, !tbaa !11
  %114 = load i64, ptr %22, align 8, !tbaa !11
  %115 = icmp ne i64 %113, %114
  %116 = xor i1 %115, true
  %117 = xor i1 %116, true
  %118 = xor i1 %117, true
  %119 = zext i1 %118 to i64
  %120 = call i64 @llvm.expect.i64(i64 %119, i64 0)
  %121 = icmp ne i64 %120, 0
  br i1 %121, label %122, label %130

122:                                              ; preds = %110
  %123 = load i64, ptr %21, align 8, !tbaa !11
  %124 = load i64, ptr %22, align 8, !tbaa !11
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 95, ptr noundef @.str.4, i64 noundef %123, i64 noundef %124) #8
          to label %125 unwind label %126

125:                                              ; preds = %122
  unreachable

126:                                              ; preds = %122
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %19, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %155

130:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %133 = getelementptr inbounds %struct.rlimit, ptr %11, i32 0, i32 0
  %134 = load i64, ptr %133, align 8, !tbaa !19
  store i64 %134, ptr %23, align 8, !tbaa !15
  %135 = load i64, ptr %23, align 8, !tbaa !15
  %136 = load i64, ptr %16, align 8, !tbaa !15
  %137 = load i64, ptr %18, align 8, !tbaa !15
  %138 = sub i64 %136, %137
  %139 = icmp ugt i64 %135, %138
  br i1 %139, label %140, label %144

140:                                              ; preds = %132
  %141 = load i64, ptr %16, align 8, !tbaa !15
  %142 = load i64, ptr %18, align 8, !tbaa !15
  %143 = sub i64 %141, %142
  store i64 %143, ptr %23, align 8, !tbaa !15
  br label %144

144:                                              ; preds = %140, %132
  %145 = load i64, ptr %23, align 8, !tbaa !15
  %146 = icmp ugt i64 %145, 1073741824
  br i1 %146, label %147, label %148

147:                                              ; preds = %144
  store i64 1073741824, ptr %23, align 8, !tbaa !15
  br label %148

148:                                              ; preds = %147, %144
  %149 = load i64, ptr %16, align 8, !tbaa !15
  %150 = load ptr, ptr %5, align 8, !tbaa !9
  store i64 %149, ptr %150, align 8, !tbaa !15
  %151 = load i64, ptr %16, align 8, !tbaa !15
  %152 = load i64, ptr %23, align 8, !tbaa !15
  %153 = sub i64 %151, %152
  %154 = load ptr, ptr %6, align 8, !tbaa !9
  store i64 %153, ptr %154, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @_ZN11__sanitizer19MemoryMappingLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  br label %204

155:                                              ; preds = %126, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @_ZN11__sanitizer19MemoryMappingLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  br label %205

156:                                              ; preds = %65
  call void @llvm.lifetime.start.p0(i64 56, ptr %24) #7
  %157 = call i32 @pthread_attr_init(ptr noundef %24) #7
  br label %158

158:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %159 = call i64 @pthread_self() #9
  %160 = call i32 @pthread_getattr_np(i64 noundef %159, ptr noundef %24) #7
  %161 = sext i32 %160 to i64
  store i64 %161, ptr %25, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  store i64 0, ptr %26, align 8, !tbaa !11
  %162 = load i64, ptr %25, align 8, !tbaa !11
  %163 = load i64, ptr %26, align 8, !tbaa !11
  %164 = icmp eq i64 %162, %163
  %165 = xor i1 %164, true
  %166 = xor i1 %165, true
  %167 = xor i1 %166, true
  %168 = zext i1 %167 to i64
  %169 = call i64 @llvm.expect.i64(i64 %168, i64 0)
  %170 = icmp ne i64 %169, 0
  br i1 %170, label %171, label %174

171:                                              ; preds = %158
  %172 = load i64, ptr %25, align 8, !tbaa !11
  %173 = load i64, ptr %26, align 8, !tbaa !11
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 113, ptr noundef @.str.5, i64 noundef %172, i64 noundef %173) #8
  unreachable

174:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %175

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  store i64 0, ptr %27, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  store ptr null, ptr %28, align 8, !tbaa !9
  %177 = call noundef i32 @_ZN11__sanitizer24my_pthread_attr_getstackEPvPS0_Pm(ptr noundef %24, ptr noundef %28, ptr noundef %27)
  %178 = call i32 @pthread_attr_destroy(ptr noundef %24) #7
  br label %179

179:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %180 = load i64, ptr %27, align 8, !tbaa !15
  store i64 %180, ptr %29, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  store i64 1073741824, ptr %30, align 8, !tbaa !11
  %181 = load i64, ptr %29, align 8, !tbaa !11
  %182 = load i64, ptr %30, align 8, !tbaa !11
  %183 = icmp ule i64 %181, %182
  %184 = xor i1 %183, true
  %185 = xor i1 %184, true
  %186 = xor i1 %185, true
  %187 = zext i1 %186 to i64
  %188 = call i64 @llvm.expect.i64(i64 %187, i64 0)
  %189 = icmp ne i64 %188, 0
  br i1 %189, label %190, label %193

190:                                              ; preds = %179
  %191 = load i64, ptr %29, align 8, !tbaa !11
  %192 = load i64, ptr %30, align 8, !tbaa !11
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str, i32 noundef 119, ptr noundef @.str.6, i64 noundef %191, i64 noundef %192) #8
  unreachable

193:                                              ; preds = %179
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  br label %194

194:                                              ; preds = %193
  br label %195

195:                                              ; preds = %194
  %196 = load ptr, ptr %28, align 8, !tbaa !9
  %197 = ptrtoint ptr %196 to i64
  %198 = load i64, ptr %27, align 8, !tbaa !15
  %199 = add i64 %197, %198
  %200 = load ptr, ptr %5, align 8, !tbaa !9
  store i64 %199, ptr %200, align 8, !tbaa !15
  %201 = load ptr, ptr %28, align 8, !tbaa !9
  %202 = ptrtoint ptr %201 to i64
  %203 = load ptr, ptr %6, align 8, !tbaa !9
  store i64 %202, ptr %203, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %24) #7
  br label %204

204:                                              ; preds = %195, %148
  ret void

205:                                              ; preds = %155
  %206 = load ptr, ptr %19, align 8
  %207 = load i32, ptr %20, align 4
  %208 = insertvalue { ptr, i32 } poison, ptr %206, 0
  %209 = insertvalue { ptr, i32 } %208, i32 %207, 1
  resume { ptr, i32 } %209
}

; 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(none)
declare i64 @llvm.expect.i64(i64, i64) #2

; Function Attrs: noreturn
declare void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef, i32 noundef, ptr noundef, i64 noundef, i64 noundef) #3

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

; Function Attrs: nounwind
declare i32 @getrlimit(i32 noundef, ptr noundef) #4

declare void @_ZN11__sanitizer19MemoryMappingLayoutC1Eb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) unnamed_addr #5

declare noundef zeroext i1 @_ZN11__sanitizer19MemoryMappingLayout4NextEPmS1_S1_PcmS1_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) #5

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN11__sanitizer19MemoryMappingLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4

; Function Attrs: nounwind
declare i32 @pthread_attr_init(ptr noundef) #4

; Function Attrs: nounwind
declare i32 @pthread_getattr_np(i64 noundef, ptr noundef) #4

; Function Attrs: nounwind willreturn memory(none)
declare i64 @pthread_self() #6

declare noundef i32 @_ZN11__sanitizer24my_pthread_attr_getstackEPvPS0_Pm(ptr noundef, ptr noundef, ptr noundef) #5

; Function Attrs: nounwind
declare i32 @pthread_attr_destroy(ptr noundef) #4

attributes #0 = { mustprogress 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 nosync nounwind willreturn memory(none) }
attributes #3 = { noreturn "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 "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 = { "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 willreturn memory(none) "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 = { noreturn }
attributes #9 = { nounwind willreturn memory(none) }

!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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !16, i64 0}
!20 = !{!"_ZTS6rlimit", !16, i64 0, !16, i64 8}


; 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.rlimit = type { i64, i64 }
%"class.__sanitizer::MemoryMappingLayout" = type { %"struct.__sanitizer::ProcSelfMapsBuff", ptr }
%"struct.__sanitizer::ProcSelfMapsBuff" = type { ptr, i64, i64 }
%union.pthread_attr_t = type { i64, [48 x i8] }

@.str = external hidden unnamed_addr constant [116 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [41 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer26GetThreadStackTopAndBottomEbPmS0_(i1 noundef zeroext %0, ptr noundef writeonly %1, ptr noundef writeonly %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct.rlimit, align 8
  %5 = alloca %"class.__sanitizer::MemoryMappingLayout", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca %union.pthread_attr_t, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %.not45 = icmp eq ptr %1, null
  br i1 %.not45, label %12, label %13, !prof !5

12:                                               ; preds = %3
  tail call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 78, ptr noundef nonnull @.str.1, i64 noundef 0, i64 noundef 0) #7
  unreachable

13:                                               ; preds = %3
  %.not46 = icmp eq ptr %2, null
  br i1 %.not46, label %14, label %15, !prof !5

14:                                               ; preds = %13
  tail call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 79, ptr noundef nonnull @.str.2, i64 noundef 0, i64 noundef 0) #7
  unreachable

15:                                               ; preds = %13
  br i1 %0, label %16, label %42

16:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #8
  %17 = call i32 @getrlimit(i32 noundef 3, ptr noundef nonnull %4) #8
  %.not48 = icmp eq i32 %17, 0
  br i1 %.not48, label %20, label %18, !prof !6

18:                                               ; preds = %16
  %19 = sext i32 %17 to i64
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 83, ptr noundef nonnull @.str.3, i64 noundef %19, i64 noundef 0) #7
  unreachable

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #8
  call void @_ZN11__sanitizer19MemoryMappingLayoutC1Eb(ptr noundef nonnull align 8 dereferenceable(32) %5, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  %21 = ptrtoint ptr %4 to i64
  br label %22

22:                                               ; preds = %24, %20
  %.0 = phi i64 [ 0, %20 ], [ %25, %24 ]
  %23 = invoke noundef zeroext i1 @_ZN11__sanitizer19MemoryMappingLayout4NextEPmS1_S1_PcmS1_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef null, i64 noundef 0, ptr noundef null)
          to label %24 unwind label %27

24:                                               ; preds = %22
  %.not = xor i1 %23, true
  %25 = load i64, ptr %7, align 8
  %26 = icmp ugt i64 %25, %21
  %or.cond = select i1 %.not, i1 true, i1 %26
  br i1 %or.cond, label %29, label %22, !llvm.loop !7

27:                                               ; preds = %22
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %41

29:                                               ; preds = %24
  %30 = load i64, ptr %6, align 8, !tbaa !9
  %31 = icmp ule i64 %30, %21
  %32 = select i1 %31, i1 %26, i1 false
  br i1 %32, label %37, label %33, !prof !6

33:                                               ; preds = %29
  invoke void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 95, ptr noundef nonnull @.str.4, i64 noundef 0, i64 noundef 0) #7
          to label %34 unwind label %35

34:                                               ; preds = %33
  unreachable

35:                                               ; preds = %33
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %41

37:                                               ; preds = %29
  %38 = load i64, ptr %4, align 8, !tbaa !13
  %39 = sub i64 %25, %.0
  %spec.select = call i64 @llvm.umin.i64(i64 %38, i64 %39)
  %spec.store.select = call i64 @llvm.umin.i64(i64 %spec.select, i64 1073741824)
  store i64 %25, ptr %1, align 8, !tbaa !9
  %40 = sub i64 %25, %spec.store.select
  store i64 %40, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @_ZN11__sanitizer19MemoryMappingLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  br label %58

41:                                               ; preds = %35, %27
  %.pn = phi { ptr, i32 } [ %36, %35 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @_ZN11__sanitizer19MemoryMappingLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn

42:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %9) #8
  %43 = call i32 @pthread_attr_init(ptr noundef nonnull %9) #8
  %44 = tail call i64 @pthread_self() #9
  %45 = call i32 @pthread_getattr_np(i64 noundef %44, ptr noundef nonnull %9) #8
  %.not47 = icmp eq i32 %45, 0
  br i1 %.not47, label %48, label %46, !prof !6

46:                                               ; preds = %42
  %47 = sext i32 %45 to i64
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 113, ptr noundef nonnull @.str.5, i64 noundef %47, i64 noundef 0) #7
  unreachable

48:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  store i64 0, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  store ptr null, ptr %11, align 8, !tbaa !15
  %49 = call noundef i32 @_ZN11__sanitizer24my_pthread_attr_getstackEPvPS0_Pm(ptr noundef nonnull %9, ptr noundef nonnull %11, ptr noundef nonnull %10)
  %50 = call i32 @pthread_attr_destroy(ptr noundef nonnull %9) #8
  %51 = load i64, ptr %10, align 8, !tbaa !9
  %52 = icmp ugt i64 %51, 1073741824
  br i1 %52, label %53, label %54, !prof !5

53:                                               ; preds = %48
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str, i32 noundef 119, ptr noundef nonnull @.str.6, i64 noundef %51, i64 noundef 1073741824) #7
  unreachable

54:                                               ; preds = %48
  %55 = load ptr, ptr %11, align 8, !tbaa !15
  %56 = ptrtoint ptr %55 to i64
  %57 = add i64 %51, %56
  store i64 %57, ptr %1, align 8, !tbaa !9
  store i64 %56, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %9) #8
  br label %58

58:                                               ; preds = %54, %37
  ret void
}

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

; Function Attrs: noreturn
declare void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef, i32 noundef, ptr noundef, i64 noundef, i64 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

; Function Attrs: nounwind
declare i32 @getrlimit(i32 noundef, ptr noundef) local_unnamed_addr #3

declare void @_ZN11__sanitizer19MemoryMappingLayoutC1Eb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) unnamed_addr #4

declare noundef zeroext i1 @_ZN11__sanitizer19MemoryMappingLayout4NextEPmS1_S1_PcmS1_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN11__sanitizer19MemoryMappingLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

; Function Attrs: nounwind
declare i32 @pthread_attr_init(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @pthread_getattr_np(i64 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare i64 @pthread_self() local_unnamed_addr #5

declare noundef i32 @_ZN11__sanitizer24my_pthread_attr_getstackEPvPS0_Pm(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare i32 @pthread_attr_destroy(ptr noundef) local_unnamed_addr #3

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

attributes #0 = { mustprogress 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 = { noreturn "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 = { "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 nofree nosync nounwind willreturn memory(none) "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { noreturn }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(none) }

!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 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!6 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!7 = distinct !{!7, !8}
!8 = !{!"llvm.loop.mustprogress"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTS6rlimit", !10, i64 0, !10, i64 8}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopUnrollPass,LowerExpectIntrinsicPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass