; LLVM IR from libxsmm/libxsmm :: src (libxsmm_malloc)

; 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.internal_malloc_info_type = type { %union.libxsmm_free_function, ptr, ptr, ptr, i64, i32 }
%union.libxsmm_free_function = type { ptr }

@.str.1 = external hidden unnamed_addr constant [70 x i8], align 1
@libxsmm_verbosity = external global i32, align 4
@stderr = external global ptr, align 8
@internal_malloc_local_cur = external dso_local global i64, align 64
@internal_malloc_private_cur = external dso_local global i64, align 64
@internal_xfree.error_once = external hidden global i32, align 4
@.str.15 = external hidden unnamed_addr constant [81 x i8], align 1
@__PRETTY_FUNCTION__.internal_xfree = external hidden unnamed_addr constant [62 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [46 x i8], align 1
@internal_malloc_hugetlb = external dso_local global i64, align 64
@internal_malloc_plocked = external dso_local global i64, align 64
@internal_malloc_public_cur = external dso_local global i64, align 64
@.str.20 = external hidden unnamed_addr constant [78 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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

18:                                               ; preds = %2
  br label %19

19:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #5
  store i8 48, ptr %7, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store ptr %6, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  store i8 0, ptr %9, align 1, !tbaa !11
  br label %20

20:                                               ; preds = %36, %19
  %21 = load i8, ptr %9, align 1, !tbaa !11
  %22 = sext i8 %21 to i32
  %23 = load i8, ptr %7, align 1, !tbaa !11
  %24 = sext i8 %23 to i32
  %25 = icmp slt i32 %22, %24
  br i1 %25, label %26, label %39

26:                                               ; preds = %20
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = load i8, ptr %9, align 1, !tbaa !11
  %29 = sext i8 %28 to i64
  %30 = getelementptr inbounds i8, ptr %27, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !11
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = load i8, ptr %9, align 1, !tbaa !11
  %34 = sext i8 %33 to i64
  %35 = getelementptr inbounds i8, ptr %32, i64 %34
  store i8 %31, ptr %35, align 1, !tbaa !11
  br label %36

36:                                               ; preds = %26
  %37 = load i8, ptr %9, align 1, !tbaa !11
  %38 = add i8 %37, 1
  store i8 %38, ptr %9, align 1, !tbaa !11
  br label %20, !llvm.loop !12

39:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  %44 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 1
  %45 = load ptr, ptr %44, align 8, !tbaa !15
  %46 = icmp ne ptr null, %45
  br i1 %46, label %51, label %47

47:                                               ; preds = %43
  %48 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 4
  %49 = load i64, ptr %48, align 8, !tbaa !18
  %50 = icmp eq i64 0, %49
  br i1 %50, label %51, label %296

51:                                               ; preds = %47, %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %52 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 4
  %53 = load i64, ptr %52, align 8, !tbaa !18
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 1
  %56 = load ptr, ptr %55, align 8, !tbaa !15
  %57 = ptrtoint ptr %54 to i64
  %58 = ptrtoint ptr %56 to i64
  %59 = sub i64 %57, %58
  %60 = add i64 %53, %59
  store i64 %60, ptr %10, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %61 = load i64, ptr %10, align 8, !tbaa !19
  store i64 %61, ptr %11, align 8, !tbaa !19
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = icmp ne ptr null, %62
  br i1 %63, label %64, label %71

64:                                               ; preds = %51
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = icmp ne ptr null, %65
  br i1 %66, label %67, label %71

67:                                               ; preds = %64
  %68 = load i64, ptr %11, align 8, !tbaa !19
  %69 = icmp ult i64 48, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %67
  br label %72

71:                                               ; preds = %67, %64, %51
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.1, i32 noundef 1059, ptr noundef @__PRETTY_FUNCTION__.internal_xfree) #6
  unreachable

72:                                               ; preds = %70
  %73 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 5
  %74 = load i32, ptr %73, align 8, !tbaa !20
  %75 = and i32 32, %74
  %76 = icmp eq i32 0, %75
  br i1 %76, label %77, label %129

77:                                               ; preds = %72
  %78 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !11
  %80 = icmp ne ptr null, %79
  br i1 %80, label %81, label %128

81:                                               ; preds = %77
  br label %82

82:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #5
  store i8 48, ptr %12, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %83, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #5
  store i8 0, ptr %14, align 1, !tbaa !11
  br label %84

84:                                               ; preds = %95, %82
  %85 = load i8, ptr %14, align 1, !tbaa !11
  %86 = sext i8 %85 to i32
  %87 = load i8, ptr %12, align 1, !tbaa !11
  %88 = sext i8 %87 to i32
  %89 = icmp slt i32 %86, %88
  br i1 %89, label %90, label %98

90:                                               ; preds = %84
  %91 = load ptr, ptr %13, align 8, !tbaa !5
  %92 = load i8, ptr %14, align 1, !tbaa !11
  %93 = sext i8 %92 to i64
  %94 = getelementptr inbounds i8, ptr %91, i64 %93
  store i8 0, ptr %94, align 1, !tbaa !11
  br label %95

95:                                               ; preds = %90
  %96 = load i8, ptr %14, align 1, !tbaa !11
  %97 = add i8 %96, 1
  store i8 %97, ptr %14, align 1, !tbaa !11
  br label %84, !llvm.loop !21

98:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #5
  br label %99

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %99
  %101 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 3
  %102 = load ptr, ptr %101, align 8, !tbaa !22
  %103 = icmp eq ptr null, %102
  br i1 %103, label %104, label %114

104:                                              ; preds = %100
  %105 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !11
  %107 = icmp ne ptr null, %106
  br i1 %107, label %108, label %113

108:                                              ; preds = %104
  %109 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !11
  %111 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 1
  %112 = load ptr, ptr %111, align 8, !tbaa !15
  call void %110(ptr noundef %112)
  br label %113

113:                                              ; preds = %108, %104
  br label %127

114:                                              ; preds = %100
  %115 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !11
  %117 = icmp ne ptr null, %116
  br i1 %117, label %118, label %119

118:                                              ; preds = %114
  br label %120

119:                                              ; preds = %114
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str.1, i32 noundef 1080, ptr noundef @__PRETTY_FUNCTION__.internal_xfree) #6
  unreachable

120:                                              ; preds = %118
  %121 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !11
  %123 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 1
  %124 = load ptr, ptr %123, align 8, !tbaa !15
  %125 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 3
  %126 = load ptr, ptr %125, align 8, !tbaa !22
  call void %122(ptr noundef %124, ptr noundef %126)
  br label %127

127:                                              ; preds = %120, %113
  br label %128

128:                                              ; preds = %127, %77
  br label %198

129:                                              ; preds = %72
  %130 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 1
  %131 = load ptr, ptr %130, align 8, !tbaa !15
  %132 = load i64, ptr %11, align 8, !tbaa !19
  %133 = call i32 @munmap(ptr noundef %131, i64 noundef %132) #5
  %134 = icmp ne i32 0, %133
  br i1 %134, label %135, label %152

135:                                              ; preds = %129
  %136 = load i32, ptr @libxsmm_verbosity, align 4, !tbaa !9
  %137 = icmp ne i32 0, %136
  br i1 %137, label %138, label %151

138:                                              ; preds = %135
  %139 = atomicrmw add ptr @internal_xfree.error_once, i32 1 seq_cst, align 4
  %140 = add i32 %139, 1
  %141 = icmp eq i32 1, %140
  br i1 %141, label %142, label %151

142:                                              ; preds = %138
  %143 = load ptr, ptr @stderr, align 8, !tbaa !5
  %144 = call ptr @__errno_location() #7
  %145 = load i32, ptr %144, align 4, !tbaa !9
  %146 = call ptr @strerror(i32 noundef %145) #5
  %147 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 1
  %148 = load ptr, ptr %147, align 8, !tbaa !15
  %149 = load i64, ptr %11, align 8, !tbaa !19
  %150 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %143, ptr noundef @.str.17, ptr noundef %146, ptr noundef %148, i64 noundef %149) #5
  br label %151

151:                                              ; preds = %142, %138, %135
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %152

152:                                              ; preds = %151, %129
  %153 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 5
  %154 = load i32, ptr %153, align 8, !tbaa !20
  %155 = and i32 256, %154
  %156 = icmp ne i32 0, %155
  br i1 %156, label %157, label %197

157:                                              ; preds = %152
  %158 = load i32, ptr %5, align 4, !tbaa !9
  %159 = icmp eq i32 0, %158
  br i1 %159, label %160, label %197

160:                                              ; preds = %157
  %161 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 2
  %162 = load ptr, ptr %161, align 8, !tbaa !23
  %163 = icmp ne ptr null, %162
  br i1 %163, label %164, label %197

164:                                              ; preds = %160
  %165 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 2
  %166 = load ptr, ptr %165, align 8, !tbaa !23
  %167 = icmp ne ptr inttoptr (i64 -1 to ptr), %166
  br i1 %167, label %168, label %197

168:                                              ; preds = %164
  %169 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 1
  %170 = load ptr, ptr %169, align 8, !tbaa !15
  %171 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 2
  %172 = load ptr, ptr %171, align 8, !tbaa !23
  %173 = icmp ne ptr %170, %172
  br i1 %173, label %174, label %197

174:                                              ; preds = %168
  %175 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 2
  %176 = load ptr, ptr %175, align 8, !tbaa !23
  %177 = load i64, ptr %11, align 8, !tbaa !19
  %178 = call i32 @munmap(ptr noundef %176, i64 noundef %177) #5
  %179 = icmp ne i32 0, %178
  br i1 %179, label %180, label %197

180:                                              ; preds = %174
  %181 = load i32, ptr @libxsmm_verbosity, align 4, !tbaa !9
  %182 = icmp ne i32 0, %181
  br i1 %182, label %183, label %196

183:                                              ; preds = %180
  %184 = atomicrmw add ptr @internal_xfree.error_once, i32 1 seq_cst, align 4
  %185 = add i32 %184, 1
  %186 = icmp eq i32 1, %185
  br i1 %186, label %187, label %196

187:                                              ; preds = %183
  %188 = load ptr, ptr @stderr, align 8, !tbaa !5
  %189 = call ptr @__errno_location() #7
  %190 = load i32, ptr %189, align 4, !tbaa !9
  %191 = call ptr @strerror(i32 noundef %190) #5
  %192 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 2
  %193 = load ptr, ptr %192, align 8, !tbaa !23
  %194 = load i64, ptr %11, align 8, !tbaa !19
  %195 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %188, ptr noundef @.str.18, ptr noundef %191, ptr noundef %193, i64 noundef %194) #5
  br label %196

196:                                              ; preds = %187, %183, %180
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %197

197:                                              ; preds = %196, %174, %168, %164, %160, %157, %152
  br label %198

198:                                              ; preds = %197, %128
  %199 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 5
  %200 = load i32, ptr %199, align 8, !tbaa !20
  %201 = and i32 256, %200
  %202 = icmp eq i32 0, %201
  br i1 %202, label %203, label %295

203:                                              ; preds = %198
  %204 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 5
  %205 = load i32, ptr %204, align 8, !tbaa !20
  %206 = and i32 8, %205
  %207 = icmp ne i32 0, %206
  br i1 %207, label %208, label %219

208:                                              ; preds = %203
  %209 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 5
  %210 = load i32, ptr %209, align 8, !tbaa !20
  %211 = and i32 32, %210
  %212 = icmp ne i32 0, %211
  br i1 %212, label %213, label %214

213:                                              ; preds = %208
  br label %215

214:                                              ; preds = %208
  call void @__assert_fail(ptr noundef @.str.19, ptr noundef @.str.1, i32 noundef 1123, ptr noundef @__PRETTY_FUNCTION__.internal_xfree) #6
  unreachable

215:                                              ; preds = %213
  %216 = load i64, ptr %11, align 8, !tbaa !19
  %217 = atomicrmw sub ptr @internal_malloc_hugetlb, i64 %216 seq_cst, align 64
  %218 = sub i64 %217, %216
  br label %219

219:                                              ; preds = %215, %203
  %220 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 5
  %221 = load i32, ptr %220, align 8, !tbaa !20
  %222 = and i32 16, %221
  %223 = icmp ne i32 0, %222
  br i1 %223, label %224, label %235

224:                                              ; preds = %219
  %225 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 5
  %226 = load i32, ptr %225, align 8, !tbaa !20
  %227 = and i32 32, %226
  %228 = icmp ne i32 0, %227
  br i1 %228, label %229, label %230

229:                                              ; preds = %224
  br label %231

230:                                              ; preds = %224
  call void @__assert_fail(ptr noundef @.str.19, ptr noundef @.str.1, i32 noundef 1129, ptr noundef @__PRETTY_FUNCTION__.internal_xfree) #6
  unreachable

231:                                              ; preds = %229
  %232 = load i64, ptr %11, align 8, !tbaa !19
  %233 = atomicrmw sub ptr @internal_malloc_plocked, i64 %232 seq_cst, align 64
  %234 = sub i64 %233, %232
  br label %235

235:                                              ; preds = %231, %219
  %236 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 5
  %237 = load i32, ptr %236, align 8, !tbaa !20
  %238 = and i32 2, %237
  %239 = icmp eq i32 0, %238
  br i1 %239, label %240, label %278

240:                                              ; preds = %235
  %241 = getelementptr inbounds %struct.internal_malloc_info_type, ptr %6, i32 0, i32 5
  %242 = load i32, ptr %241, align 8, !tbaa !20
  %243 = and i32 1, %242
  %244 = icmp ne i32 0, %243
  br i1 %244, label %245, label %261

245:                                              ; preds = %240
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %246 = atomicrmw or ptr @internal_malloc_public_cur, i64 0 seq_cst, align 64
  %247 = or i64 %246, 0
  store i64 %247, ptr %15, align 8, !tbaa !19
  br label %248

248:                                              ; preds = %245
  call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !24
  %249 = load i64, ptr %11, align 8, !tbaa !19
  %250 = load i64, ptr %15, align 8, !tbaa !19
  %251 = icmp ule i64 %249, %250
  br i1 %251, label %252, label %256

252:                                              ; preds = %248
  %253 = load i64, ptr %15, align 8, !tbaa !19
  %254 = load i64, ptr %11, align 8, !tbaa !19
  %255 = sub i64 %253, %254
  br label %257

256:                                              ; preds = %248
  br label %257

257:                                              ; preds = %256, %252
  %258 = phi i64 [ %255, %252 ], [ 0, %256 ]
  store i64 %258, ptr @internal_malloc_public_cur, align 64, !tbaa !19
  call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !25
  br label %259

259:                                              ; preds = %257
  br label %260

260:                                              ; preds = %259
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %277

261:                                              ; preds = %240
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %262 = atomicrmw or ptr @internal_malloc_local_cur, i64 0 seq_cst, align 64
  %263 = or i64 %262, 0
  store i64 %263, ptr %16, align 8, !tbaa !19
  br label %264

264:                                              ; preds = %261
  call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !26
  %265 = load i64, ptr %11, align 8, !tbaa !19
  %266 = load i64, ptr %16, align 8, !tbaa !19
  %267 = icmp ule i64 %265, %266
  br i1 %267, label %268, label %272

268:                                              ; preds = %264
  %269 = load i64, ptr %16, align 8, !tbaa !19
  %270 = load i64, ptr %11, align 8, !tbaa !19
  %271 = sub i64 %269, %270
  br label %273

272:                                              ; preds = %264
  br label %273

273:                                              ; preds = %272, %268
  %274 = phi i64 [ %271, %268 ], [ 0, %272 ]
  store i64 %274, ptr @internal_malloc_local_cur, align 64, !tbaa !19
  call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !27
  br label %275

275:                                              ; preds = %273
  br label %276

276:                                              ; preds = %275
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %277

277:                                              ; preds = %276, %260
  br label %294

278:                                              ; preds = %235
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %279 = atomicrmw or ptr @internal_malloc_private_cur, i64 0 seq_cst, align 64
  %280 = or i64 %279, 0
  store i64 %280, ptr %17, align 8, !tbaa !19
  br label %281

281:                                              ; preds = %278
  call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !28
  %282 = load i64, ptr %11, align 8, !tbaa !19
  %283 = load i64, ptr %17, align 8, !tbaa !19
  %284 = icmp ule i64 %282, %283
  br i1 %284, label %285, label %289

285:                                              ; preds = %281
  %286 = load i64, ptr %17, align 8, !tbaa !19
  %287 = load i64, ptr %11, align 8, !tbaa !19
  %288 = sub i64 %286, %287
  br label %290

289:                                              ; preds = %281
  br label %290

290:                                              ; preds = %289, %285
  %291 = phi i64 [ %288, %285 ], [ 0, %289 ]
  store i64 %291, ptr @internal_malloc_private_cur, align 64, !tbaa !19
  call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #5, !srcloc !29
  br label %292

292:                                              ; preds = %290
  br label %293

293:                                              ; preds = %292
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %294

294:                                              ; preds = %293, %277
  br label %295

295:                                              ; preds = %294, %198
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %310

296:                                              ; preds = %47
  %297 = load i32, ptr @libxsmm_verbosity, align 4, !tbaa !9
  %298 = icmp sle i32 2, %297
  br i1 %298, label %302, label %299

299:                                              ; preds = %296
  %300 = load i32, ptr @libxsmm_verbosity, align 4, !tbaa !9
  %301 = icmp sgt i32 0, %300
  br i1 %301, label %302, label %309

302:                                              ; preds = %299, %296
  %303 = atomicrmw add ptr @internal_xfree.error_once, i32 1 seq_cst, align 4
  %304 = add i32 %303, 1
  %305 = icmp eq i32 1, %304
  br i1 %305, label %306, label %309

306:                                              ; preds = %302
  %307 = load ptr, ptr @stderr, align 8, !tbaa !5
  %308 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %307, ptr noundef @.str.20) #5
  br label %309

309:                                              ; preds = %306, %302, %299
  br label %310

310:                                              ; preds = %309, %295
  %311 = load i32, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 48, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret i32 %311
}

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

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

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn 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 = { 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 = { 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 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 #5 = { nounwind }
attributes #6 = { noreturn nounwind }
attributes #7 = { 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 = !{!"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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13, !14}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!"llvm.loop.unroll.count", i32 4}
!15 = !{!16, !6, i64 8}
!16 = !{!"internal_malloc_info_type", !7, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !17, i64 32, !10, i64 40}
!17 = !{!"long", !7, i64 0}
!18 = !{!16, !17, i64 32}
!19 = !{!17, !17, i64 0}
!20 = !{!16, !10, i64 40}
!21 = distinct !{!21, !13, !14}
!22 = !{!16, !6, i64 24}
!23 = !{!16, !6, i64 16}
!24 = !{i64 2152916101}
!25 = !{i64 2152916178}
!26 = !{i64 2152916434}
!27 = !{i64 2152916511}
!28 = !{i64 2152916768}
!29 = !{i64 2152916845}


; 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.1 = external hidden unnamed_addr constant [70 x i8], align 1
@libxsmm_verbosity = external local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@internal_malloc_local_cur = external dso_local global i64, align 64
@internal_malloc_private_cur = external dso_local global i64, align 64
@internal_xfree.error_once = external hidden global i32, align 4
@.str.15 = external hidden unnamed_addr constant [81 x i8], align 1
@__PRETTY_FUNCTION__.internal_xfree = external hidden unnamed_addr constant [62 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [46 x i8], align 1
@internal_malloc_hugetlb = external dso_local global i64, align 64
@internal_malloc_plocked = external dso_local global i64, align 64
@internal_malloc_public_cur = external dso_local global i64, align 64
@.str.20 = external hidden unnamed_addr constant [78 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @internal_xfree(ptr noundef %0, ptr nocapture noundef %1) local_unnamed_addr #1 {
  %.sroa.0.0.copyload = load ptr, ptr %1, align 1, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 8
  %.sroa.4.0.copyload = load ptr, ptr %.sroa.4.0..sroa_idx, align 1, !tbaa !5
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 16
  %.sroa.7.0.copyload = load ptr, ptr %.sroa.7.0..sroa_idx, align 1, !tbaa !5
  %.sroa.9.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 24
  %.sroa.9.0.copyload = load ptr, ptr %.sroa.9.0..sroa_idx, align 1, !tbaa !5
  %.sroa.10.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 32
  %.sroa.10.0.copyload = load i64, ptr %.sroa.10.0..sroa_idx, align 1, !tbaa !5
  %.sroa.11.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 40
  %.sroa.11.0.copyload = load i32, ptr %.sroa.11.0..sroa_idx, align 1, !tbaa !5
  %3 = icmp ne ptr %.sroa.4.0.copyload, null
  %4 = icmp eq i64 %.sroa.10.0.copyload, 0
  %or.cond = select i1 %3, i1 true, i1 %4
  br i1 %or.cond, label %5, label %81

5:                                                ; preds = %2
  %6 = ptrtoint ptr %0 to i64
  %7 = ptrtoint ptr %.sroa.4.0.copyload to i64
  %8 = sub i64 %6, %7
  %9 = add i64 %8, %.sroa.10.0.copyload
  %10 = icmp ne ptr %0, null
  %11 = icmp ugt i64 %9, 48
  %or.cond6 = select i1 %10, i1 %11, i1 false
  br i1 %or.cond6, label %13, label %12

12:                                               ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.1, i32 noundef 1059, ptr noundef nonnull @__PRETTY_FUNCTION__.internal_xfree) #7
  unreachable

13:                                               ; preds = %5
  %14 = and i32 %.sroa.11.0.copyload, 32
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %20

16:                                               ; preds = %13
  %.not65 = icmp eq ptr %.sroa.0.0.copyload, null
  br i1 %.not65, label %53, label %.preheader.preheader

.preheader.preheader:                             ; preds = %16
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(48) %1, i8 0, i64 48, i1 false), !tbaa !5
  %17 = icmp eq ptr %.sroa.9.0.copyload, null
  br i1 %17, label %18, label %19

18:                                               ; preds = %.preheader.preheader
  tail call void %.sroa.0.0.copyload(ptr noundef %.sroa.4.0.copyload) #8
  br label %53

19:                                               ; preds = %.preheader.preheader
  tail call void %.sroa.0.0.copyload(ptr noundef %.sroa.4.0.copyload, ptr noundef nonnull %.sroa.9.0.copyload) #8
  br label %53

20:                                               ; preds = %13
  %21 = tail call i32 @munmap(ptr noundef %.sroa.4.0.copyload, i64 noundef %9) #8
  %.not = icmp eq i32 %21, 0
  br i1 %.not, label %33, label %22

22:                                               ; preds = %20
  %23 = load i32, ptr @libxsmm_verbosity, align 4, !tbaa !8
  %.not61 = icmp eq i32 %23, 0
  br i1 %.not61, label %33, label %24

24:                                               ; preds = %22
  %25 = atomicrmw add ptr @internal_xfree.error_once, i32 1 seq_cst, align 4
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %33

27:                                               ; preds = %24
  %28 = load ptr, ptr @stderr, align 8, !tbaa !10
  %29 = tail call ptr @__errno_location() #9
  %30 = load i32, ptr %29, align 4, !tbaa !8
  %31 = tail call ptr @strerror(i32 noundef %30) #8
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef nonnull @.str.17, ptr noundef %31, ptr noundef %.sroa.4.0.copyload, i64 noundef %9) #10
  br label %33

33:                                               ; preds = %22, %24, %27, %20
  %.0 = phi i32 [ 0, %20 ], [ 1, %27 ], [ 1, %24 ], [ 1, %22 ]
  %34 = and i32 %.sroa.11.0.copyload, 256
  %35 = icmp ne i32 %34, 0
  %or.cond8 = and i1 %.not, %35
  %36 = icmp ne ptr %.sroa.7.0.copyload, null
  %37 = icmp ne ptr %.sroa.7.0.copyload, inttoptr (i64 -1 to ptr)
  %38 = and i1 %36, %37
  %or.cond14 = select i1 %or.cond8, i1 %38, i1 false
  br i1 %or.cond14, label %39, label %53

39:                                               ; preds = %33
  %.not62 = icmp eq ptr %.sroa.4.0.copyload, %.sroa.7.0.copyload
  br i1 %.not62, label %53, label %40

40:                                               ; preds = %39
  %41 = tail call i32 @munmap(ptr noundef nonnull %.sroa.7.0.copyload, i64 noundef %9) #8
  %.not63 = icmp eq i32 %41, 0
  br i1 %.not63, label %53, label %42

42:                                               ; preds = %40
  %43 = load i32, ptr @libxsmm_verbosity, align 4, !tbaa !8
  %.not64 = icmp eq i32 %43, 0
  br i1 %.not64, label %53, label %44

44:                                               ; preds = %42
  %45 = atomicrmw add ptr @internal_xfree.error_once, i32 1 seq_cst, align 4
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %53

47:                                               ; preds = %44
  %48 = load ptr, ptr @stderr, align 8, !tbaa !10
  %49 = tail call ptr @__errno_location() #9
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = tail call ptr @strerror(i32 noundef %50) #8
  %52 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.18, ptr noundef %51, ptr noundef nonnull %.sroa.7.0.copyload, i64 noundef %9) #10
  br label %53

53:                                               ; preds = %42, %44, %47, %33, %39, %40, %16, %18, %19
  %.1 = phi i32 [ 0, %18 ], [ 0, %19 ], [ 0, %16 ], [ 0, %40 ], [ 0, %39 ], [ %.0, %33 ], [ 1, %47 ], [ 1, %44 ], [ 1, %42 ]
  %54 = and i32 %.sroa.11.0.copyload, 256
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %89

56:                                               ; preds = %53
  %57 = and i32 %.sroa.11.0.copyload, 8
  %.not68 = icmp eq i32 %57, 0
  br i1 %.not68, label %60, label %58

58:                                               ; preds = %56
  br i1 %15, label %59, label %.thread

59:                                               ; preds = %58
  tail call void @__assert_fail(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.1, i32 noundef 1123, ptr noundef nonnull @__PRETTY_FUNCTION__.internal_xfree) #7
  unreachable

60:                                               ; preds = %56
  %61 = and i32 %.sroa.11.0.copyload, 16
  %.not70 = icmp eq i32 %61, 0
  br i1 %.not70, label %67, label %64

.thread:                                          ; preds = %58
  %62 = atomicrmw sub ptr @internal_malloc_hugetlb, i64 %9 seq_cst, align 64
  %63 = and i32 %.sroa.11.0.copyload, 16
  %.not7087 = icmp eq i32 %63, 0
  br i1 %.not7087, label %67, label %.thread88

64:                                               ; preds = %60
  br i1 %15, label %65, label %.thread88

65:                                               ; preds = %64
  tail call void @__assert_fail(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.1, i32 noundef 1129, ptr noundef nonnull @__PRETTY_FUNCTION__.internal_xfree) #7
  unreachable

.thread88:                                        ; preds = %.thread, %64
  %66 = atomicrmw sub ptr @internal_malloc_plocked, i64 %9 seq_cst, align 64
  br label %67

67:                                               ; preds = %.thread, %.thread88, %60
  %68 = and i32 %.sroa.11.0.copyload, 2
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %78

70:                                               ; preds = %67
  %71 = and i32 %.sroa.11.0.copyload, 1
  %.not73 = icmp eq i32 %71, 0
  br i1 %.not73, label %75, label %72

72:                                               ; preds = %70
  %73 = atomicrmw or ptr @internal_malloc_public_cur, i64 0 seq_cst, align 64
  tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !12
  %74 = tail call i64 @llvm.usub.sat.i64(i64 %73, i64 %9)
  store i64 %74, ptr @internal_malloc_public_cur, align 64, !tbaa !13
  tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !15
  br label %89

75:                                               ; preds = %70
  %76 = atomicrmw or ptr @internal_malloc_local_cur, i64 0 seq_cst, align 64
  tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !16
  %77 = tail call i64 @llvm.usub.sat.i64(i64 %76, i64 %9)
  store i64 %77, ptr @internal_malloc_local_cur, align 64, !tbaa !13
  tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !17
  br label %89

78:                                               ; preds = %67
  %79 = atomicrmw or ptr @internal_malloc_private_cur, i64 0 seq_cst, align 64
  tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !18
  %80 = tail call i64 @llvm.usub.sat.i64(i64 %79, i64 %9)
  store i64 %80, ptr @internal_malloc_private_cur, align 64, !tbaa !13
  tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #8, !srcloc !19
  br label %89

81:                                               ; preds = %2
  %82 = load i32, ptr @libxsmm_verbosity, align 4
  %or.cond16 = icmp ugt i32 %82, 1
  br i1 %or.cond16, label %83, label %89

83:                                               ; preds = %81
  %84 = atomicrmw add ptr @internal_xfree.error_once, i32 1 seq_cst, align 4
  %85 = icmp eq i32 %84, 0
  br i1 %85, label %86, label %89

86:                                               ; preds = %83
  %87 = load ptr, ptr @stderr, align 8, !tbaa !10
  %88 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef nonnull @.str.20) #10
  br label %89

89:                                               ; preds = %53, %72, %75, %78, %83, %86, %81
  %.2 = phi i32 [ 0, %86 ], [ 0, %83 ], [ 0, %81 ], [ %.1, %78 ], [ %.1, %75 ], [ %.1, %72 ], [ %.1, %53 ]
  ret i32 %.2
}

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

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

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #4

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

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

attributes #0 = { noreturn 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 #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 = { 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 #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 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(none) }
attributes #10 = { cold 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = !{i64 2152916101}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !6, i64 0}
!15 = !{i64 2152916178}
!16 = !{i64 2152916434}
!17 = !{i64 2152916511}
!18 = !{i64 2152916768}
!19 = !{i64 2152916845}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass