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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @example_str() #0 {
  %1 = alloca ptr, align 8
  %2 = alloca %struct.sc_queue_str, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr %2) #6
  br label %24

24:                                               ; preds = %0
  %25 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  store i8 0, ptr %25, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  store i64 8, ptr %26, align 8, !tbaa !12
  %27 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 2
  store i64 0, ptr %27, align 8, !tbaa !13
  %28 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  store i64 0, ptr %28, align 8, !tbaa !14
  %29 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 64) #7
  %30 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  store ptr %29, ptr %30, align 8, !tbaa !15
  %31 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  %32 = load ptr, ptr %31, align 8, !tbaa !15
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %36

34:                                               ; preds = %24
  %35 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  store i8 1, ptr %35, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %34, %24
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %41 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  %42 = load i64, ptr %41, align 8, !tbaa !14
  %43 = add i64 %42, 1
  %44 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %45 = load i64, ptr %44, align 8, !tbaa !12
  %46 = sub i64 %45, 1
  %47 = and i64 %43, %46
  store i64 %47, ptr %6, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %48 = load i64, ptr %6, align 8, !tbaa !16
  %49 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 2
  %50 = load i64, ptr %49, align 8, !tbaa !13
  %51 = icmp eq i64 %48, %50
  br i1 %51, label %52, label %103

52:                                               ; preds = %40
  %53 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %54 = load i64, ptr %53, align 8, !tbaa !12
  %55 = icmp ugt i64 %54, 9223372036854775807
  br i1 %55, label %56, label %58

56:                                               ; preds = %52
  %57 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  store i8 1, ptr %57, align 8, !tbaa !5
  store i32 6, ptr %9, align 4
  br label %104

58:                                               ; preds = %52
  %59 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %60 = load i64, ptr %59, align 8, !tbaa !12
  %61 = mul i64 %60, 2
  store i64 %61, ptr %3, align 8, !tbaa !16
  %62 = load i64, ptr %3, align 8, !tbaa !16
  %63 = call noalias ptr @calloc(i64 noundef %62, i64 noundef 8) #7
  store ptr %63, ptr %7, align 8, !tbaa !17
  %64 = load ptr, ptr %7, align 8, !tbaa !17
  %65 = icmp eq ptr %64, null
  br i1 %65, label %66, label %68

66:                                               ; preds = %58
  %67 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  store i8 1, ptr %67, align 8, !tbaa !5
  store i32 6, ptr %9, align 4
  br label %104

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

103:                                              ; preds = %68, %40
  store i32 0, ptr %9, align 4
  br label %104

104:                                              ; preds = %103, %66, %56
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  %105 = load i32, ptr %9, align 4
  switch i32 %105, label %367 [
    i32 0, label %106
    i32 6, label %108
  ]

106:                                              ; preds = %104
  br label %107

107:                                              ; preds = %106
  br label %108

108:                                              ; preds = %107, %104
  %109 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  %110 = load i8, ptr %109, align 8, !tbaa !5, !range !18, !noundef !19
  %111 = trunc i8 %110 to i1
  br i1 %111, label %112, label %113

112:                                              ; preds = %108
  br label %129

113:                                              ; preds = %108
  %114 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  store i8 0, ptr %114, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  %116 = load ptr, ptr %115, align 8, !tbaa !15
  %117 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  %118 = load i64, ptr %117, align 8, !tbaa !14
  %119 = getelementptr inbounds ptr, ptr %116, i64 %118
  store ptr @.str, ptr %119, align 8, !tbaa !17
  %120 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  %121 = load i64, ptr %120, align 8, !tbaa !14
  %122 = add i64 %121, 1
  %123 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %124 = load i64, ptr %123, align 8, !tbaa !12
  %125 = sub i64 %124, 1
  %126 = and i64 %122, %125
  %127 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  store i64 %126, ptr %127, align 8, !tbaa !14
  br label %128

128:                                              ; preds = %113
  br label %129

129:                                              ; preds = %128, %112
  br label %130

130:                                              ; preds = %129
  br label %131

131:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %132 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  %133 = load i64, ptr %132, align 8, !tbaa !14
  %134 = add i64 %133, 1
  %135 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %136 = load i64, ptr %135, align 8, !tbaa !12
  %137 = sub i64 %136, 1
  %138 = and i64 %134, %137
  store i64 %138, ptr %13, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %139 = load i64, ptr %13, align 8, !tbaa !16
  %140 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 2
  %141 = load i64, ptr %140, align 8, !tbaa !13
  %142 = icmp eq i64 %139, %141
  br i1 %142, label %143, label %194

143:                                              ; preds = %131
  %144 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %145 = load i64, ptr %144, align 8, !tbaa !12
  %146 = icmp ugt i64 %145, 9223372036854775807
  br i1 %146, label %147, label %149

147:                                              ; preds = %143
  %148 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  store i8 1, ptr %148, align 8, !tbaa !5
  store i32 10, ptr %9, align 4
  br label %195

149:                                              ; preds = %143
  %150 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %151 = load i64, ptr %150, align 8, !tbaa !12
  %152 = mul i64 %151, 2
  store i64 %152, ptr %10, align 8, !tbaa !16
  %153 = load i64, ptr %10, align 8, !tbaa !16
  %154 = call noalias ptr @calloc(i64 noundef %153, i64 noundef 8) #7
  store ptr %154, ptr %14, align 8, !tbaa !17
  %155 = load ptr, ptr %14, align 8, !tbaa !17
  %156 = icmp eq ptr %155, null
  br i1 %156, label %157, label %159

157:                                              ; preds = %149
  %158 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  store i8 1, ptr %158, align 8, !tbaa !5
  store i32 10, ptr %9, align 4
  br label %195

159:                                              ; preds = %149
  %160 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %161 = load i64, ptr %160, align 8, !tbaa !12
  %162 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 2
  %163 = load i64, ptr %162, align 8, !tbaa !13
  %164 = sub i64 %161, %163
  %165 = mul i64 %164, 8
  store i64 %165, ptr %11, align 8, !tbaa !16
  %166 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 2
  %167 = load i64, ptr %166, align 8, !tbaa !13
  %168 = mul i64 %167, 8
  store i64 %168, ptr %12, align 8, !tbaa !16
  %169 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  %170 = load ptr, ptr %169, align 8, !tbaa !15
  %171 = load i64, ptr %12, align 8, !tbaa !16
  %172 = getelementptr inbounds i8, ptr %170, i64 %171
  store ptr %172, ptr %15, align 8, !tbaa !17
  %173 = load ptr, ptr %14, align 8, !tbaa !17
  %174 = load ptr, ptr %15, align 8, !tbaa !17
  %175 = load i64, ptr %11, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %173, ptr align 1 %174, i64 %175, i1 false)
  %176 = load ptr, ptr %14, align 8, !tbaa !17
  %177 = load i64, ptr %11, align 8, !tbaa !16
  %178 = getelementptr inbounds i8, ptr %176, i64 %177
  %179 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  %180 = load ptr, ptr %179, align 8, !tbaa !15
  %181 = load i64, ptr %12, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %178, ptr align 8 %180, i64 %181, i1 false)
  %182 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  store i8 0, ptr %182, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %184 = load i64, ptr %183, align 8, !tbaa !12
  %185 = sub i64 %184, 1
  %186 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  store i64 %185, ptr %186, align 8, !tbaa !14
  %187 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 2
  store i64 0, ptr %187, align 8, !tbaa !13
  %188 = load i64, ptr %10, align 8, !tbaa !16
  %189 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  store i64 %188, ptr %189, align 8, !tbaa !12
  %190 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  %191 = load ptr, ptr %190, align 8, !tbaa !15
  call void @free(ptr noundef %191) #6
  %192 = load ptr, ptr %14, align 8, !tbaa !17
  %193 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  store ptr %192, ptr %193, align 8, !tbaa !15
  br label %194

194:                                              ; preds = %159, %131
  store i32 0, ptr %9, align 4
  br label %195

195:                                              ; preds = %194, %157, %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %196 = load i32, ptr %9, align 4
  switch i32 %196, label %367 [
    i32 0, label %197
    i32 10, label %199
  ]

197:                                              ; preds = %195
  br label %198

198:                                              ; preds = %197
  br label %199

199:                                              ; preds = %198, %195
  %200 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  %201 = load i8, ptr %200, align 8, !tbaa !5, !range !18, !noundef !19
  %202 = trunc i8 %201 to i1
  br i1 %202, label %203, label %204

203:                                              ; preds = %199
  br label %220

204:                                              ; preds = %199
  %205 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  store i8 0, ptr %205, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  %207 = load ptr, ptr %206, align 8, !tbaa !15
  %208 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  %209 = load i64, ptr %208, align 8, !tbaa !14
  %210 = getelementptr inbounds ptr, ptr %207, i64 %209
  store ptr @.str.1, ptr %210, align 8, !tbaa !17
  %211 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  %212 = load i64, ptr %211, align 8, !tbaa !14
  %213 = add i64 %212, 1
  %214 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %215 = load i64, ptr %214, align 8, !tbaa !12
  %216 = sub i64 %215, 1
  %217 = and i64 %213, %216
  %218 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  store i64 %217, ptr %218, align 8, !tbaa !14
  br label %219

219:                                              ; preds = %204
  br label %220

220:                                              ; preds = %219, %203
  br label %221

221:                                              ; preds = %220
  br label %222

222:                                              ; preds = %221
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %223 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  %224 = load i64, ptr %223, align 8, !tbaa !14
  %225 = add i64 %224, 1
  %226 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %227 = load i64, ptr %226, align 8, !tbaa !12
  %228 = sub i64 %227, 1
  %229 = and i64 %225, %228
  store i64 %229, ptr %19, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %230 = load i64, ptr %19, align 8, !tbaa !16
  %231 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 2
  %232 = load i64, ptr %231, align 8, !tbaa !13
  %233 = icmp eq i64 %230, %232
  br i1 %233, label %234, label %285

234:                                              ; preds = %222
  %235 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %236 = load i64, ptr %235, align 8, !tbaa !12
  %237 = icmp ugt i64 %236, 9223372036854775807
  br i1 %237, label %238, label %240

238:                                              ; preds = %234
  %239 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  store i8 1, ptr %239, align 8, !tbaa !5
  store i32 14, ptr %9, align 4
  br label %286

240:                                              ; preds = %234
  %241 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %242 = load i64, ptr %241, align 8, !tbaa !12
  %243 = mul i64 %242, 2
  store i64 %243, ptr %16, align 8, !tbaa !16
  %244 = load i64, ptr %16, align 8, !tbaa !16
  %245 = call noalias ptr @calloc(i64 noundef %244, i64 noundef 8) #7
  store ptr %245, ptr %20, align 8, !tbaa !17
  %246 = load ptr, ptr %20, align 8, !tbaa !17
  %247 = icmp eq ptr %246, null
  br i1 %247, label %248, label %250

248:                                              ; preds = %240
  %249 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  store i8 1, ptr %249, align 8, !tbaa !5
  store i32 14, ptr %9, align 4
  br label %286

250:                                              ; preds = %240
  %251 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %252 = load i64, ptr %251, align 8, !tbaa !12
  %253 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 2
  %254 = load i64, ptr %253, align 8, !tbaa !13
  %255 = sub i64 %252, %254
  %256 = mul i64 %255, 8
  store i64 %256, ptr %17, align 8, !tbaa !16
  %257 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 2
  %258 = load i64, ptr %257, align 8, !tbaa !13
  %259 = mul i64 %258, 8
  store i64 %259, ptr %18, align 8, !tbaa !16
  %260 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  %261 = load ptr, ptr %260, align 8, !tbaa !15
  %262 = load i64, ptr %18, align 8, !tbaa !16
  %263 = getelementptr inbounds i8, ptr %261, i64 %262
  store ptr %263, ptr %21, align 8, !tbaa !17
  %264 = load ptr, ptr %20, align 8, !tbaa !17
  %265 = load ptr, ptr %21, align 8, !tbaa !17
  %266 = load i64, ptr %17, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %264, ptr align 1 %265, i64 %266, i1 false)
  %267 = load ptr, ptr %20, align 8, !tbaa !17
  %268 = load i64, ptr %17, align 8, !tbaa !16
  %269 = getelementptr inbounds i8, ptr %267, i64 %268
  %270 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  %271 = load ptr, ptr %270, align 8, !tbaa !15
  %272 = load i64, ptr %18, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %269, ptr align 8 %271, i64 %272, i1 false)
  %273 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  store i8 0, ptr %273, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %275 = load i64, ptr %274, align 8, !tbaa !12
  %276 = sub i64 %275, 1
  %277 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  store i64 %276, ptr %277, align 8, !tbaa !14
  %278 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 2
  store i64 0, ptr %278, align 8, !tbaa !13
  %279 = load i64, ptr %16, align 8, !tbaa !16
  %280 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  store i64 %279, ptr %280, align 8, !tbaa !12
  %281 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  %282 = load ptr, ptr %281, align 8, !tbaa !15
  call void @free(ptr noundef %282) #6
  %283 = load ptr, ptr %20, align 8, !tbaa !17
  %284 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  store ptr %283, ptr %284, align 8, !tbaa !15
  br label %285

285:                                              ; preds = %250, %222
  store i32 0, ptr %9, align 4
  br label %286

286:                                              ; preds = %285, %248, %238
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  %287 = load i32, ptr %9, align 4
  switch i32 %287, label %367 [
    i32 0, label %288
    i32 14, label %290
  ]

288:                                              ; preds = %286
  br label %289

289:                                              ; preds = %288
  br label %290

290:                                              ; preds = %289, %286
  %291 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  %292 = load i8, ptr %291, align 8, !tbaa !5, !range !18, !noundef !19
  %293 = trunc i8 %292 to i1
  br i1 %293, label %294, label %295

294:                                              ; preds = %290
  br label %311

295:                                              ; preds = %290
  %296 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  store i8 0, ptr %296, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  %298 = load ptr, ptr %297, align 8, !tbaa !15
  %299 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  %300 = load i64, ptr %299, align 8, !tbaa !14
  %301 = getelementptr inbounds ptr, ptr %298, i64 %300
  store ptr @.str.2, ptr %301, align 8, !tbaa !17
  %302 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  %303 = load i64, ptr %302, align 8, !tbaa !14
  %304 = add i64 %303, 1
  %305 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %306 = load i64, ptr %305, align 8, !tbaa !12
  %307 = sub i64 %306, 1
  %308 = and i64 %304, %307
  %309 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  store i64 %308, ptr %309, align 8, !tbaa !14
  br label %310

310:                                              ; preds = %295
  br label %311

311:                                              ; preds = %310, %294
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  store i64 1, ptr %22, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %312 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 2
  %313 = load i64, ptr %312, align 8, !tbaa !13
  store i64 %313, ptr %23, align 8, !tbaa !16
  br label %314

314:                                              ; preds = %344, %311
  %315 = load i64, ptr %22, align 8, !tbaa !16
  %316 = icmp ne i64 %315, 0
  br i1 %316, label %317, label %322

317:                                              ; preds = %314
  %318 = load i64, ptr %23, align 8, !tbaa !16
  %319 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  %320 = load i64, ptr %319, align 8, !tbaa !14
  %321 = icmp ne i64 %318, %320
  br label %322

322:                                              ; preds = %317, %314
  %323 = phi i1 [ false, %314 ], [ %321, %317 ]
  br i1 %323, label %325, label %324

324:                                              ; preds = %322
  store i32 16, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %356

325:                                              ; preds = %322
  %326 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  %327 = load ptr, ptr %326, align 8, !tbaa !15
  %328 = load i64, ptr %23, align 8, !tbaa !16
  %329 = getelementptr inbounds ptr, ptr %327, i64 %328
  %330 = load ptr, ptr %329, align 8, !tbaa !17
  store ptr %330, ptr %1, align 8, !tbaa !17
  br label %331

331:                                              ; preds = %337, %325
  %332 = load i64, ptr %22, align 8, !tbaa !16
  %333 = icmp ne i64 %332, 0
  br i1 %333, label %334, label %343

334:                                              ; preds = %331
  %335 = load ptr, ptr %1, align 8, !tbaa !17
  %336 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, ptr noundef %335)
  br label %337

337:                                              ; preds = %334
  %338 = load i64, ptr %22, align 8, !tbaa !16
  %339 = icmp ne i64 %338, 0
  %340 = xor i1 %339, true
  %341 = zext i1 %340 to i32
  %342 = sext i32 %341 to i64
  store i64 %342, ptr %22, align 8, !tbaa !16
  br label %331, !llvm.loop !20

343:                                              ; preds = %331
  br label %344

344:                                              ; preds = %343
  %345 = load i64, ptr %22, align 8, !tbaa !16
  %346 = icmp ne i64 %345, 0
  %347 = xor i1 %346, true
  %348 = zext i1 %347 to i32
  %349 = sext i32 %348 to i64
  store i64 %349, ptr %22, align 8, !tbaa !16
  %350 = load i64, ptr %23, align 8, !tbaa !16
  %351 = add i64 %350, 1
  %352 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  %353 = load i64, ptr %352, align 8, !tbaa !12
  %354 = sub i64 %353, 1
  %355 = and i64 %351, %354
  store i64 %355, ptr %23, align 8, !tbaa !16
  br label %314, !llvm.loop !22

356:                                              ; preds = %324
  br label %357

357:                                              ; preds = %356
  %358 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  %359 = load ptr, ptr %358, align 8, !tbaa !15
  call void @free(ptr noundef %359) #6
  %360 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 4
  store ptr null, ptr %360, align 8, !tbaa !15
  %361 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 1
  store i64 0, ptr %361, align 8, !tbaa !12
  %362 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 2
  store i64 0, ptr %362, align 8, !tbaa !13
  %363 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 3
  store i64 0, ptr %363, align 8, !tbaa !14
  %364 = getelementptr inbounds %struct.sc_queue_str, ptr %2, i32 0, i32 0
  store i8 0, ptr %364, align 8, !tbaa !5
  br label %365

365:                                              ; preds = %357
  br label %366

366:                                              ; preds = %365
  call void @llvm.lifetime.end.p0(i64 40, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  ret void

367:                                              ; preds = %286, %195, %104
  unreachable
}

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #2

; 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) #3

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 }
attributes #7 = { nounwind allocsize(0,1) }

!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_str", !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 = !{!10, !10, i64 0}
!17 = !{!11, !11, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

; Function Attrs: nounwind uwtable
define dso_local void @example_str() local_unnamed_addr #0 {
  %1 = tail call noalias dereferenceable_or_null(64) ptr @calloc(i64 noundef 1, i64 noundef 64) #4
  %2 = icmp eq ptr %1, null
  br i1 %2, label %._crit_edge, label %.critedge.preheader

.critedge.preheader:                              ; preds = %0
  store ptr @.str, ptr %1, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr @.str.1, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %1, i64 16
  store ptr @.str.2, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %1, align 8, !tbaa !5
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef %5)
  %7 = getelementptr inbounds i8, ptr %1, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef %8)
  %10 = getelementptr inbounds i8, ptr %1, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef %11)
  br label %._crit_edge

._crit_edge:                                      ; preds = %.critedge.preheader, %0
  tail call void @free(ptr noundef %1) #5
  ret void
}

; 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 #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind allocsize(0,1) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass