; LLVM IR from tezc/sc :: queue (queue_test)

; 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.sc_queue_32 = type { i8, i64, i64, i64, ptr }

@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [60 x i8], align 1
@__PRETTY_FUNCTION__.test0 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [23 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: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; 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 @test0() #4 {
  %1 = alloca i32, align 4
  %2 = alloca %struct.sc_queue_32, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr %2) #6
  br label %15

15:                                               ; preds = %0
  %16 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 0
  store i8 0, ptr %16, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 1
  store i64 8, ptr %17, align 8, !tbaa !12
  %18 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 2
  store i64 0, ptr %18, align 8, !tbaa !13
  %19 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 3
  store i64 0, ptr %19, align 8, !tbaa !14
  %20 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 32) #7
  %21 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 4
  store ptr %20, ptr %21, align 8, !tbaa !15
  %22 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 4
  %23 = load ptr, ptr %22, align 8, !tbaa !15
  %24 = icmp eq ptr %23, null
  br i1 %24, label %25, label %27

25:                                               ; preds = %15
  %26 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 0
  store i8 1, ptr %26, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %25, %15
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !16
  br label %30

30:                                               ; preds = %127, %29
  %31 = load i32, ptr %3, align 4, !tbaa !16
  %32 = icmp ult i32 %31, 10000
  br i1 %32, label %34, label %33

33:                                               ; preds = %30
  store i32 4, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %130

34:                                               ; preds = %30
  br label %35

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %37 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 3
  %38 = load i64, ptr %37, align 8, !tbaa !14
  %39 = add i64 %38, 1
  %40 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 1
  %41 = load i64, ptr %40, align 8, !tbaa !12
  %42 = sub i64 %41, 1
  %43 = and i64 %39, %42
  store i64 %43, ptr %8, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %44 = load i64, ptr %8, align 8, !tbaa !18
  %45 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 2
  %46 = load i64, ptr %45, align 8, !tbaa !13
  %47 = icmp eq i64 %44, %46
  br i1 %47, label %48, label %99

48:                                               ; preds = %36
  %49 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 1
  %50 = load i64, ptr %49, align 8, !tbaa !12
  %51 = icmp ugt i64 %50, 9223372036854775807
  br i1 %51, label %52, label %54

52:                                               ; preds = %48
  %53 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 0
  store i8 1, ptr %53, align 8, !tbaa !5
  store i32 9, ptr %4, align 4
  br label %100

54:                                               ; preds = %48
  %55 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 1
  %56 = load i64, ptr %55, align 8, !tbaa !12
  %57 = mul i64 %56, 2
  store i64 %57, ptr %5, align 8, !tbaa !18
  %58 = load i64, ptr %5, align 8, !tbaa !18
  %59 = call noalias ptr @calloc(i64 noundef %58, i64 noundef 4) #7
  store ptr %59, ptr %9, align 8, !tbaa !19
  %60 = load ptr, ptr %9, align 8, !tbaa !19
  %61 = icmp eq ptr %60, null
  br i1 %61, label %62, label %64

62:                                               ; preds = %54
  %63 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 0
  store i8 1, ptr %63, align 8, !tbaa !5
  store i32 9, ptr %4, align 4
  br label %100

64:                                               ; preds = %54
  %65 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 1
  %66 = load i64, ptr %65, align 8, !tbaa !12
  %67 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 2
  %68 = load i64, ptr %67, align 8, !tbaa !13
  %69 = sub i64 %66, %68
  %70 = mul i64 %69, 4
  store i64 %70, ptr %6, align 8, !tbaa !18
  %71 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 2
  %72 = load i64, ptr %71, align 8, !tbaa !13
  %73 = mul i64 %72, 4
  store i64 %73, ptr %7, align 8, !tbaa !18
  %74 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 4
  %75 = load ptr, ptr %74, align 8, !tbaa !15
  %76 = load i64, ptr %7, align 8, !tbaa !18
  %77 = getelementptr inbounds i8, ptr %75, i64 %76
  store ptr %77, ptr %10, align 8, !tbaa !19
  %78 = load ptr, ptr %9, align 8, !tbaa !19
  %79 = load ptr, ptr %10, align 8, !tbaa !19
  %80 = load i64, ptr %6, align 8, !tbaa !18
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %78, ptr align 1 %79, i64 %80, i1 false)
  %81 = load ptr, ptr %9, align 8, !tbaa !19
  %82 = load i64, ptr %6, align 8, !tbaa !18
  %83 = getelementptr inbounds i8, ptr %81, i64 %82
  %84 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 4
  %85 = load ptr, ptr %84, align 8, !tbaa !15
  %86 = load i64, ptr %7, align 8, !tbaa !18
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %83, ptr align 4 %85, i64 %86, i1 false)
  %87 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 0
  store i8 0, ptr %87, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 1
  %89 = load i64, ptr %88, align 8, !tbaa !12
  %90 = sub i64 %89, 1
  %91 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 3
  store i64 %90, ptr %91, align 8, !tbaa !14
  %92 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 2
  store i64 0, ptr %92, align 8, !tbaa !13
  %93 = load i64, ptr %5, align 8, !tbaa !18
  %94 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 1
  store i64 %93, ptr %94, align 8, !tbaa !12
  %95 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 4
  %96 = load ptr, ptr %95, align 8, !tbaa !15
  call void @free(ptr noundef %96) #6
  %97 = load ptr, ptr %9, align 8, !tbaa !19
  %98 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 4
  store ptr %97, ptr %98, align 8, !tbaa !15
  br label %99

99:                                               ; preds = %64, %36
  store i32 0, ptr %4, align 4
  br label %100

100:                                              ; preds = %99, %62, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  %101 = load i32, ptr %4, align 4
  switch i32 %101, label %279 [
    i32 0, label %102
    i32 9, label %104
  ]

102:                                              ; preds = %100
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103, %100
  %105 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 0
  %106 = load i8, ptr %105, align 8, !tbaa !5, !range !20, !noundef !21
  %107 = trunc i8 %106 to i1
  br i1 %107, label %108, label %109

108:                                              ; preds = %104
  br label %126

109:                                              ; preds = %104
  %110 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 0
  store i8 0, ptr %110, align 8, !tbaa !5
  %111 = load i32, ptr %3, align 4, !tbaa !16
  %112 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 4
  %113 = load ptr, ptr %112, align 8, !tbaa !15
  %114 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 3
  %115 = load i64, ptr %114, align 8, !tbaa !14
  %116 = getelementptr inbounds i32, ptr %113, i64 %115
  store i32 %111, ptr %116, align 4, !tbaa !16
  %117 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 3
  %118 = load i64, ptr %117, align 8, !tbaa !14
  %119 = add i64 %118, 1
  %120 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 1
  %121 = load i64, ptr %120, align 8, !tbaa !12
  %122 = sub i64 %121, 1
  %123 = and i64 %119, %122
  %124 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 3
  store i64 %123, ptr %124, align 8, !tbaa !14
  br label %125

125:                                              ; preds = %109
  br label %126

126:                                              ; preds = %125, %108
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %3, align 4, !tbaa !16
  %129 = add i32 %128, 1
  store i32 %129, ptr %3, align 4, !tbaa !16
  br label %30, !llvm.loop !22

130:                                              ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !16
  br label %131

131:                                              ; preds = %154, %130
  %132 = load i32, ptr %11, align 4, !tbaa !16
  %133 = icmp ult i32 %132, 10000
  br i1 %133, label %135, label %134

134:                                              ; preds = %131
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %157

135:                                              ; preds = %131
  %136 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 4
  %137 = load ptr, ptr %136, align 8, !tbaa !15
  %138 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 2
  %139 = load i64, ptr %138, align 8, !tbaa !13
  %140 = load i32, ptr %11, align 4, !tbaa !16
  %141 = zext i32 %140 to i64
  %142 = add i64 %139, %141
  %143 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 1
  %144 = load i64, ptr %143, align 8, !tbaa !12
  %145 = sub i64 %144, 1
  %146 = and i64 %142, %145
  %147 = getelementptr inbounds i32, ptr %137, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !16
  %149 = load i32, ptr %11, align 4, !tbaa !16
  %150 = icmp eq i32 %148, %149
  br i1 %150, label %151, label %152

151:                                              ; preds = %135
  br label %153

152:                                              ; preds = %135
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 137, ptr noundef @__PRETTY_FUNCTION__.test0) #8
  unreachable

153:                                              ; preds = %151
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %11, align 4, !tbaa !16
  %156 = add i32 %155, 1
  store i32 %156, ptr %11, align 4, !tbaa !16
  br label %131, !llvm.loop !24

157:                                              ; preds = %134
  %158 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 4
  %159 = load ptr, ptr %158, align 8, !tbaa !15
  %160 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 2
  %161 = load i64, ptr %160, align 8, !tbaa !13
  %162 = getelementptr inbounds i32, ptr %159, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !16
  %164 = icmp eq i32 %163, 0
  br i1 %164, label %165, label %166

165:                                              ; preds = %157
  br label %167

166:                                              ; preds = %157
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.4, i32 noundef 140, ptr noundef @__PRETTY_FUNCTION__.test0) #8
  unreachable

167:                                              ; preds = %165
  %168 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 4
  %169 = load ptr, ptr %168, align 8, !tbaa !15
  %170 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 3
  %171 = load i64, ptr %170, align 8, !tbaa !14
  %172 = sub i64 %171, 1
  %173 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 1
  %174 = load i64, ptr %173, align 8, !tbaa !12
  %175 = sub i64 %174, 1
  %176 = and i64 %172, %175
  %177 = getelementptr inbounds i32, ptr %169, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !16
  %179 = icmp eq i32 %178, 9999
  br i1 %179, label %180, label %181

180:                                              ; preds = %167
  br label %182

181:                                              ; preds = %167
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.4, i32 noundef 141, ptr noundef @__PRETTY_FUNCTION__.test0) #8
  unreachable

182:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 1, ptr %13, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %183 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 2
  %184 = load i64, ptr %183, align 8, !tbaa !13
  store i64 %184, ptr %14, align 8, !tbaa !18
  br label %185

185:                                              ; preds = %220, %182
  %186 = load i64, ptr %13, align 8, !tbaa !18
  %187 = icmp ne i64 %186, 0
  br i1 %187, label %188, label %193

188:                                              ; preds = %185
  %189 = load i64, ptr %14, align 8, !tbaa !18
  %190 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 3
  %191 = load i64, ptr %190, align 8, !tbaa !14
  %192 = icmp ne i64 %189, %191
  br label %193

193:                                              ; preds = %188, %185
  %194 = phi i1 [ false, %185 ], [ %192, %188 ]
  br i1 %194, label %196, label %195

195:                                              ; preds = %193
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %232

196:                                              ; preds = %193
  %197 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 4
  %198 = load ptr, ptr %197, align 8, !tbaa !15
  %199 = load i64, ptr %14, align 8, !tbaa !18
  %200 = getelementptr inbounds i32, ptr %198, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !16
  store i32 %201, ptr %1, align 4, !tbaa !16
  br label %202

202:                                              ; preds = %213, %196
  %203 = load i64, ptr %13, align 8, !tbaa !18
  %204 = icmp ne i64 %203, 0
  br i1 %204, label %205, label %219

205:                                              ; preds = %202
  %206 = load i32, ptr %1, align 4, !tbaa !16
  %207 = load i32, ptr %12, align 4, !tbaa !16
  %208 = add i32 %207, 1
  store i32 %208, ptr %12, align 4, !tbaa !16
  %209 = icmp eq i32 %206, %207
  br i1 %209, label %210, label %211

210:                                              ; preds = %205
  br label %212

211:                                              ; preds = %205
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.4, i32 noundef 145, ptr noundef @__PRETTY_FUNCTION__.test0) #8
  unreachable

212:                                              ; preds = %210
  br label %213

213:                                              ; preds = %212
  %214 = load i64, ptr %13, align 8, !tbaa !18
  %215 = icmp ne i64 %214, 0
  %216 = xor i1 %215, true
  %217 = zext i1 %216 to i32
  %218 = sext i32 %217 to i64
  store i64 %218, ptr %13, align 8, !tbaa !18
  br label %202, !llvm.loop !25

219:                                              ; preds = %202
  br label %220

220:                                              ; preds = %219
  %221 = load i64, ptr %13, align 8, !tbaa !18
  %222 = icmp ne i64 %221, 0
  %223 = xor i1 %222, true
  %224 = zext i1 %223 to i32
  %225 = sext i32 %224 to i64
  store i64 %225, ptr %13, align 8, !tbaa !18
  %226 = load i64, ptr %14, align 8, !tbaa !18
  %227 = add i64 %226, 1
  %228 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 1
  %229 = load i64, ptr %228, align 8, !tbaa !12
  %230 = sub i64 %229, 1
  %231 = and i64 %227, %230
  store i64 %231, ptr %14, align 8, !tbaa !18
  br label %185, !llvm.loop !26

232:                                              ; preds = %195
  store i32 10000, ptr %12, align 4, !tbaa !16
  br label %233

233:                                              ; preds = %254, %232
  %234 = load i32, ptr %12, align 4, !tbaa !16
  %235 = add i32 %234, -1
  store i32 %235, ptr %12, align 4, !tbaa !16
  %236 = icmp ugt i32 %234, 0
  br i1 %236, label %237, label %255

237:                                              ; preds = %233
  %238 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 4
  %239 = load ptr, ptr %238, align 8, !tbaa !15
  %240 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 3
  %241 = load i64, ptr %240, align 8, !tbaa !14
  %242 = sub i64 %241, 1
  %243 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 1
  %244 = load i64, ptr %243, align 8, !tbaa !12
  %245 = sub i64 %244, 1
  %246 = and i64 %242, %245
  %247 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 3
  store i64 %246, ptr %247, align 8, !tbaa !14
  %248 = getelementptr inbounds i32, ptr %239, i64 %246
  %249 = load i32, ptr %248, align 4, !tbaa !16
  %250 = load i32, ptr %12, align 4, !tbaa !16
  %251 = icmp eq i32 %249, %250
  br i1 %251, label %252, label %253

252:                                              ; preds = %237
  br label %254

253:                                              ; preds = %237
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.4, i32 noundef 151, ptr noundef @__PRETTY_FUNCTION__.test0) #8
  unreachable

254:                                              ; preds = %252
  br label %233, !llvm.loop !27

255:                                              ; preds = %233
  %256 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 3
  %257 = load i64, ptr %256, align 8, !tbaa !14
  %258 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 2
  %259 = load i64, ptr %258, align 8, !tbaa !13
  %260 = sub i64 %257, %259
  %261 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 1
  %262 = load i64, ptr %261, align 8, !tbaa !12
  %263 = sub i64 %262, 1
  %264 = and i64 %260, %263
  %265 = icmp eq i64 %264, 0
  br i1 %265, label %266, label %267

266:                                              ; preds = %255
  br label %268

267:                                              ; preds = %255
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.4, i32 noundef 154, ptr noundef @__PRETTY_FUNCTION__.test0) #8
  unreachable

268:                                              ; preds = %266
  br label %269

269:                                              ; preds = %268
  %270 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 4
  %271 = load ptr, ptr %270, align 8, !tbaa !15
  call void @free(ptr noundef %271) #6
  %272 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 4
  store ptr null, ptr %272, align 8, !tbaa !15
  %273 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 1
  store i64 0, ptr %273, align 8, !tbaa !12
  %274 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 2
  store i64 0, ptr %274, align 8, !tbaa !13
  %275 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 3
  store i64 0, ptr %275, align 8, !tbaa !14
  %276 = getelementptr inbounds %struct.sc_queue_32, ptr %2, i32 0, i32 0
  store i8 0, ptr %276, align 8, !tbaa !5
  br label %277

277:                                              ; preds = %269
  br label %278

278:                                              ; preds = %277
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  ret void

279:                                              ; preds = %100
  unreachable
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(0,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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { nounwind allocsize(0,1) }
attributes #8 = { noreturn 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, !7, i64 0}
!6 = !{!"sc_queue_32", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !11, i64 32}
!7 = !{!"_Bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !10, i64 8}
!13 = !{!6, !10, i64 16}
!14 = !{!6, !10, i64 24}
!15 = !{!6, !11, i64 32}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !8, i64 0}
!18 = !{!10, !10, i64 0}
!19 = !{!11, !11, i64 0}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = distinct !{!25, !23}
!26 = distinct !{!26, !23}
!27 = distinct !{!27, !23}


; 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.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [60 x i8], align 1
@__PRETTY_FUNCTION__.test0 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @test0() local_unnamed_addr #3 {
  %1 = tail call noalias dereferenceable_or_null(32) ptr @calloc(i64 noundef 1, i64 noundef 32) #5
  %2 = icmp eq ptr %1, null
  br label %4

.preheader86:                                     ; preds = %.thread
  %3 = add i64 %.sroa.1028.275, 16383
  br label %48

4:                                                ; preds = %0, %.thread
  %.sroa.46.093 = phi ptr [ %1, %0 ], [ %.sroa.46.276, %.thread ]
  %.sroa.34.092 = phi i64 [ 0, %0 ], [ %.sroa.34.3, %.thread ]
  %.sroa.1028.091 = phi i64 [ 8, %0 ], [ %.sroa.1028.275, %.thread ]
  %.sroa.0.190 = phi i1 [ %2, %0 ], [ %.sroa.0.4, %.thread ]
  %.06689 = phi i32 [ 0, %0 ], [ %19, %.thread ]
  %5 = add i64 %.sroa.34.092, 1
  %6 = add i64 %.sroa.1028.091, -1
  %7 = and i64 %5, %6
  %8 = icmp eq i64 %7, 0
  br i1 %8, label %9, label %16

9:                                                ; preds = %4
  %10 = icmp slt i64 %.sroa.1028.091, 0
  br i1 %10, label %.thread, label %11

11:                                               ; preds = %9
  %12 = shl nuw i64 %.sroa.1028.091, 1
  %13 = tail call noalias ptr @calloc(i64 noundef %12, i64 noundef 4) #5
  %14 = icmp eq ptr %13, null
  br i1 %14, label %.thread, label %.thread77

.thread77:                                        ; preds = %11
  %15 = shl i64 %.sroa.1028.091, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %13, ptr align 1 %.sroa.46.093, i64 %15, i1 false)
  tail call void @free(ptr noundef %.sroa.46.093) #6
  %.pre102 = add i64 %12, 9223372036854775807
  %.pre104 = and i64 %.pre102, %.sroa.1028.091
  br label %17

16:                                               ; preds = %4
  br i1 %.sroa.0.190, label %.thread, label %17

17:                                               ; preds = %.thread77, %16
  %.pre-phi105 = phi i64 [ %.pre104, %.thread77 ], [ %7, %16 ]
  %.sroa.46.284 = phi ptr [ %13, %.thread77 ], [ %.sroa.46.093, %16 ]
  %.sroa.34.283 = phi i64 [ %6, %.thread77 ], [ %.sroa.34.092, %16 ]
  %.sroa.1028.282 = phi i64 [ %12, %.thread77 ], [ %.sroa.1028.091, %16 ]
  %18 = getelementptr inbounds i32, ptr %.sroa.46.284, i64 %.sroa.34.283
  store i32 %.06689, ptr %18, align 4, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %11, %9, %17, %16
  %.sroa.46.276 = phi ptr [ %.sroa.46.093, %16 ], [ %.sroa.46.284, %17 ], [ %.sroa.46.093, %9 ], [ %.sroa.46.093, %11 ]
  %.sroa.1028.275 = phi i64 [ %.sroa.1028.091, %16 ], [ %.sroa.1028.282, %17 ], [ %.sroa.1028.091, %9 ], [ %.sroa.1028.091, %11 ]
  %.sroa.0.4 = phi i1 [ true, %16 ], [ false, %17 ], [ true, %9 ], [ true, %11 ]
  %.sroa.34.3 = phi i64 [ %.sroa.34.092, %16 ], [ %.pre-phi105, %17 ], [ %.sroa.34.092, %9 ], [ %.sroa.34.092, %11 ]
  %19 = add nuw nsw i32 %.06689, 1
  %exitcond.not = icmp eq i32 %19, 10000
  br i1 %exitcond.not, label %.preheader86, label %4, !llvm.loop !9

20:                                               ; preds = %48
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = and i64 %3, %indvars.iv.next
  %22 = getelementptr inbounds i32, ptr %.sroa.46.276, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = zext i32 %23 to i64
  %25 = icmp eq i64 %indvars.iv.next, %24
  br i1 %25, label %26, label %54

26:                                               ; preds = %20
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %27 = and i64 %3, %indvars.iv.next.1
  %28 = getelementptr inbounds i32, ptr %.sroa.46.276, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = zext i32 %29 to i64
  %31 = icmp eq i64 %indvars.iv.next.1, %30
  br i1 %31, label %32, label %54

32:                                               ; preds = %26
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %33 = and i64 %3, %indvars.iv.next.2
  %34 = getelementptr inbounds i32, ptr %.sroa.46.276, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = zext i32 %35 to i64
  %37 = icmp eq i64 %indvars.iv.next.2, %36
  br i1 %37, label %38, label %54

38:                                               ; preds = %32
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %39 = and i64 %3, %indvars.iv.next.3
  %40 = getelementptr inbounds i32, ptr %.sroa.46.276, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = zext i32 %41 to i64
  %43 = icmp eq i64 %indvars.iv.next.3, %42
  br i1 %43, label %44, label %54

44:                                               ; preds = %38
  %indvars.iv.next.4 = add nuw nsw i64 %indvars.iv, 5
  %exitcond101.not.4 = icmp eq i64 %indvars.iv.next.4, 10000
  br i1 %exitcond101.not.4, label %45, label %48, !llvm.loop !11

45:                                               ; preds = %44
  %46 = load i32, ptr %.sroa.46.276, align 4, !tbaa !5
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %56, label %55

48:                                               ; preds = %44, %.preheader86
  %indvars.iv = phi i64 [ 0, %.preheader86 ], [ %indvars.iv.next.4, %44 ]
  %49 = and i64 %3, %indvars.iv
  %50 = getelementptr inbounds i32, ptr %.sroa.46.276, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = zext i32 %51 to i64
  %53 = icmp eq i64 %indvars.iv, %52
  br i1 %53, label %20, label %54

54:                                               ; preds = %38, %32, %26, %20, %48
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 137, ptr noundef nonnull @__PRETTY_FUNCTION__.test0) #7
  unreachable

55:                                               ; preds = %45
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.4, i32 noundef 140, ptr noundef nonnull @__PRETTY_FUNCTION__.test0) #7
  unreachable

56:                                               ; preds = %45
  %57 = add i64 %.sroa.34.3, -1
  %58 = add i64 %.sroa.1028.275, -1
  %59 = and i64 %57, %58
  %60 = getelementptr inbounds i32, ptr %.sroa.46.276, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = icmp eq i32 %61, 9999
  br i1 %62, label %.preheader85, label %63

.preheader85:                                     ; preds = %56
  %.not96 = icmp eq i64 %.sroa.34.3, 0
  br i1 %.not96, label %.preheader.preheader, label %.lr.ph

63:                                               ; preds = %56
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.4, i32 noundef 141, ptr noundef nonnull @__PRETTY_FUNCTION__.test0) #7
  unreachable

.lr.ph:                                           ; preds = %.preheader85, %68
  %.098 = phi i64 [ %71, %68 ], [ 0, %.preheader85 ]
  %.06397 = phi i32 [ %69, %68 ], [ 0, %.preheader85 ]
  %64 = getelementptr inbounds i32, ptr %.sroa.46.276, i64 %.098
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = icmp eq i32 %65, %.06397
  br i1 %66, label %68, label %67

67:                                               ; preds = %.lr.ph
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.4, i32 noundef 145, ptr noundef nonnull @__PRETTY_FUNCTION__.test0) #7
  unreachable

68:                                               ; preds = %.lr.ph
  %69 = add i32 %.06397, 1
  %70 = add i64 %.098, 1
  %71 = and i64 %70, %58
  %.not = icmp eq i64 %71, %.sroa.34.3
  br i1 %.not, label %.preheader.preheader, label %.lr.ph, !llvm.loop !12

.preheader.preheader:                             ; preds = %68, %.preheader85
  br label %.preheader

.preheader:                                       ; preds = %.preheader.3, %.preheader.preheader
  %.sroa.34.4 = phi i64 [ %.sroa.34.3, %.preheader.preheader ], [ %93, %.preheader.3 ]
  %.2 = phi i32 [ 10000, %.preheader.preheader ], [ %91, %.preheader.3 ]
  %.not69 = icmp eq i32 %.2, 0
  br i1 %.not69, label %98, label %72

72:                                               ; preds = %.preheader
  %73 = add nsw i32 %.2, -1
  %74 = add i64 %.sroa.34.4, -1
  %75 = and i64 %74, %58
  %76 = getelementptr inbounds i32, ptr %.sroa.46.276, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = icmp eq i32 %77, %73
  br i1 %78, label %.preheader.1, label %97, !llvm.loop !13

.preheader.1:                                     ; preds = %72
  %79 = add nsw i32 %.2, -2
  %80 = add i64 %75, -1
  %81 = and i64 %80, %58
  %82 = getelementptr inbounds i32, ptr %.sroa.46.276, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = icmp eq i32 %83, %79
  br i1 %84, label %.preheader.2, label %97, !llvm.loop !13

.preheader.2:                                     ; preds = %.preheader.1
  %85 = add nsw i32 %.2, -3
  %86 = add i64 %81, -1
  %87 = and i64 %86, %58
  %88 = getelementptr inbounds i32, ptr %.sroa.46.276, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = icmp eq i32 %89, %85
  br i1 %90, label %.preheader.3, label %97, !llvm.loop !13

.preheader.3:                                     ; preds = %.preheader.2
  %91 = add nsw i32 %.2, -4
  %92 = add i64 %87, -1
  %93 = and i64 %92, %58
  %94 = getelementptr inbounds i32, ptr %.sroa.46.276, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = icmp eq i32 %95, %91
  br i1 %96, label %.preheader, label %97, !llvm.loop !13

97:                                               ; preds = %.preheader.3, %.preheader.2, %.preheader.1, %72
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.4, i32 noundef 151, ptr noundef nonnull @__PRETTY_FUNCTION__.test0) #7
  unreachable

98:                                               ; preds = %.preheader
  %99 = and i64 %.sroa.34.4, %58
  %100 = icmp eq i64 %99, 0
  br i1 %100, label %102, label %101

101:                                              ; preds = %98
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.4, i32 noundef 154, ptr noundef nonnull @__PRETTY_FUNCTION__.test0) #7
  unreachable

102:                                              ; preds = %98
  tail call void @free(ptr noundef nonnull %.sroa.46.276) #6
  ret void
}

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { 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 #5 = { nounwind allocsize(0,1) }
attributes #6 = { nounwind }
attributes #7 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


; Effective O3 passes: AggressiveInstCombinePass,BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass