; LLVM IR from tezc/sc :: array (array_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_array_str = type { i8, i64, i64, ptr }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [63 x i8], align 1
@__PRETTY_FUNCTION__.example_str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [12 x i8], align 1

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

17:                                               ; preds = %0
  call void @llvm.memset.p0.i64(ptr align 8 %2, i8 0, i64 32, i1 false)
  br label %18

18:                                               ; preds = %17
  br label %19

19:                                               ; preds = %18
  br label %20

20:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  store i64 2305843009213693951, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %21 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  %22 = load i64, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 2
  %24 = load i64, ptr %23, align 8, !tbaa !13
  %25 = icmp eq i64 %22, %24
  br i1 %25, label %26, label %57

26:                                               ; preds = %20
  %27 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  %28 = load i64, ptr %27, align 8, !tbaa !9
  %29 = icmp ugt i64 %28, 1152921504606846975
  br i1 %29, label %30, label %32

30:                                               ; preds = %26
  %31 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 0
  store i8 1, ptr %31, align 8, !tbaa !14
  store i32 4, ptr %6, align 4
  br label %65

32:                                               ; preds = %26
  %33 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = icmp eq i64 %34, 0
  br i1 %35, label %36, label %37

36:                                               ; preds = %32
  br label %41

37:                                               ; preds = %32
  %38 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = mul i64 %39, 2
  br label %41

41:                                               ; preds = %37, %36
  %42 = phi i64 [ 8, %36 ], [ %40, %37 ]
  store i64 %42, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 3
  %44 = load ptr, ptr %43, align 8, !tbaa !15
  %45 = load i64, ptr %4, align 8, !tbaa !5
  %46 = mul i64 %45, 8
  %47 = call ptr @realloc(ptr noundef %44, i64 noundef %46) #9
  store ptr %47, ptr %5, align 8, !tbaa !16
  %48 = load ptr, ptr %5, align 8, !tbaa !16
  %49 = icmp eq ptr %48, null
  br i1 %49, label %50, label %52

50:                                               ; preds = %41
  %51 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 0
  store i8 1, ptr %51, align 8, !tbaa !14
  store i32 4, ptr %6, align 4
  br label %65

52:                                               ; preds = %41
  %53 = load i64, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  store i64 %53, ptr %54, align 8, !tbaa !9
  %55 = load ptr, ptr %5, align 8, !tbaa !16
  %56 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 3
  store ptr %55, ptr %56, align 8, !tbaa !15
  br label %57

57:                                               ; preds = %52, %20
  %58 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 0
  store i8 0, ptr %58, align 8, !tbaa !14
  %59 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 3
  %60 = load ptr, ptr %59, align 8, !tbaa !15
  %61 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 2
  %62 = load i64, ptr %61, align 8, !tbaa !13
  %63 = add i64 %62, 1
  store i64 %63, ptr %61, align 8, !tbaa !13
  %64 = getelementptr inbounds ptr, ptr %60, i64 %62
  store ptr @.str, ptr %64, align 8, !tbaa !16
  store i32 0, ptr %6, align 4
  br label %65

65:                                               ; preds = %57, %50, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  %66 = load i32, ptr %6, align 4
  switch i32 %66, label %251 [
    i32 0, label %67
    i32 4, label %69
  ]

67:                                               ; preds = %65
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68, %65
  br label %70

70:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  store i64 2305843009213693951, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %71 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  %72 = load i64, ptr %71, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 2
  %74 = load i64, ptr %73, align 8, !tbaa !13
  %75 = icmp eq i64 %72, %74
  br i1 %75, label %76, label %107

76:                                               ; preds = %70
  %77 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  %78 = load i64, ptr %77, align 8, !tbaa !9
  %79 = icmp ugt i64 %78, 1152921504606846975
  br i1 %79, label %80, label %82

80:                                               ; preds = %76
  %81 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 0
  store i8 1, ptr %81, align 8, !tbaa !14
  store i32 6, ptr %6, align 4
  br label %115

82:                                               ; preds = %76
  %83 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  %84 = load i64, ptr %83, align 8, !tbaa !9
  %85 = icmp eq i64 %84, 0
  br i1 %85, label %86, label %87

86:                                               ; preds = %82
  br label %91

87:                                               ; preds = %82
  %88 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  %89 = load i64, ptr %88, align 8, !tbaa !9
  %90 = mul i64 %89, 2
  br label %91

91:                                               ; preds = %87, %86
  %92 = phi i64 [ 8, %86 ], [ %90, %87 ]
  store i64 %92, ptr %8, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 3
  %94 = load ptr, ptr %93, align 8, !tbaa !15
  %95 = load i64, ptr %8, align 8, !tbaa !5
  %96 = mul i64 %95, 8
  %97 = call ptr @realloc(ptr noundef %94, i64 noundef %96) #9
  store ptr %97, ptr %9, align 8, !tbaa !16
  %98 = load ptr, ptr %9, align 8, !tbaa !16
  %99 = icmp eq ptr %98, null
  br i1 %99, label %100, label %102

100:                                              ; preds = %91
  %101 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 0
  store i8 1, ptr %101, align 8, !tbaa !14
  store i32 6, ptr %6, align 4
  br label %115

102:                                              ; preds = %91
  %103 = load i64, ptr %8, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  store i64 %103, ptr %104, align 8, !tbaa !9
  %105 = load ptr, ptr %9, align 8, !tbaa !16
  %106 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 3
  store ptr %105, ptr %106, align 8, !tbaa !15
  br label %107

107:                                              ; preds = %102, %70
  %108 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 0
  store i8 0, ptr %108, align 8, !tbaa !14
  %109 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 3
  %110 = load ptr, ptr %109, align 8, !tbaa !15
  %111 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 2
  %112 = load i64, ptr %111, align 8, !tbaa !13
  %113 = add i64 %112, 1
  store i64 %113, ptr %111, align 8, !tbaa !13
  %114 = getelementptr inbounds ptr, ptr %110, i64 %112
  store ptr @.str.1, ptr %114, align 8, !tbaa !16
  store i32 0, ptr %6, align 4
  br label %115

115:                                              ; preds = %107, %100, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  %116 = load i32, ptr %6, align 4
  switch i32 %116, label %251 [
    i32 0, label %117
    i32 6, label %119
  ]

117:                                              ; preds = %115
  br label %118

118:                                              ; preds = %117
  br label %119

119:                                              ; preds = %118, %115
  br label %120

120:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  store i64 2305843009213693951, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %121 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  %122 = load i64, ptr %121, align 8, !tbaa !9
  %123 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 2
  %124 = load i64, ptr %123, align 8, !tbaa !13
  %125 = icmp eq i64 %122, %124
  br i1 %125, label %126, label %157

126:                                              ; preds = %120
  %127 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  %128 = load i64, ptr %127, align 8, !tbaa !9
  %129 = icmp ugt i64 %128, 1152921504606846975
  br i1 %129, label %130, label %132

130:                                              ; preds = %126
  %131 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 0
  store i8 1, ptr %131, align 8, !tbaa !14
  store i32 8, ptr %6, align 4
  br label %165

132:                                              ; preds = %126
  %133 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  %134 = load i64, ptr %133, align 8, !tbaa !9
  %135 = icmp eq i64 %134, 0
  br i1 %135, label %136, label %137

136:                                              ; preds = %132
  br label %141

137:                                              ; preds = %132
  %138 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  %139 = load i64, ptr %138, align 8, !tbaa !9
  %140 = mul i64 %139, 2
  br label %141

141:                                              ; preds = %137, %136
  %142 = phi i64 [ 8, %136 ], [ %140, %137 ]
  store i64 %142, ptr %11, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 3
  %144 = load ptr, ptr %143, align 8, !tbaa !15
  %145 = load i64, ptr %11, align 8, !tbaa !5
  %146 = mul i64 %145, 8
  %147 = call ptr @realloc(ptr noundef %144, i64 noundef %146) #9
  store ptr %147, ptr %12, align 8, !tbaa !16
  %148 = load ptr, ptr %12, align 8, !tbaa !16
  %149 = icmp eq ptr %148, null
  br i1 %149, label %150, label %152

150:                                              ; preds = %141
  %151 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 0
  store i8 1, ptr %151, align 8, !tbaa !14
  store i32 8, ptr %6, align 4
  br label %165

152:                                              ; preds = %141
  %153 = load i64, ptr %11, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 1
  store i64 %153, ptr %154, align 8, !tbaa !9
  %155 = load ptr, ptr %12, align 8, !tbaa !16
  %156 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 3
  store ptr %155, ptr %156, align 8, !tbaa !15
  br label %157

157:                                              ; preds = %152, %120
  %158 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 0
  store i8 0, ptr %158, align 8, !tbaa !14
  %159 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 3
  %160 = load ptr, ptr %159, align 8, !tbaa !15
  %161 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 2
  %162 = load i64, ptr %161, align 8, !tbaa !13
  %163 = add i64 %162, 1
  store i64 %163, ptr %161, align 8, !tbaa !13
  %164 = getelementptr inbounds ptr, ptr %160, i64 %162
  store ptr @.str.2, ptr %164, align 8, !tbaa !16
  store i32 0, ptr %6, align 4
  br label %165

165:                                              ; preds = %157, %150, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %166 = load i32, ptr %6, align 4
  switch i32 %166, label %251 [
    i32 0, label %167
    i32 8, label %169
  ]

167:                                              ; preds = %165
  br label %168

168:                                              ; preds = %167
  br label %169

169:                                              ; preds = %168, %165
  %170 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %171

171:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  store i64 0, ptr %13, align 8, !tbaa !5
  %172 = load i64, ptr %13, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 2
  %174 = load i64, ptr %173, align 8, !tbaa !13
  %175 = icmp ult i64 %172, %174
  br i1 %175, label %176, label %177

176:                                              ; preds = %171
  br label %178

177:                                              ; preds = %171
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.5, i32 noundef 17, ptr noundef @__PRETTY_FUNCTION__.example_str) #10
  unreachable

178:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %179 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 2
  %180 = load i64, ptr %179, align 8, !tbaa !13
  %181 = load i64, ptr %13, align 8, !tbaa !5
  %182 = sub i64 %180, %181
  %183 = sub i64 %182, 1
  store i64 %183, ptr %14, align 8, !tbaa !5
  %184 = load i64, ptr %14, align 8, !tbaa !5
  %185 = icmp ugt i64 %184, 0
  br i1 %185, label %186, label %198

186:                                              ; preds = %178
  %187 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 3
  %188 = load ptr, ptr %187, align 8, !tbaa !15
  %189 = load i64, ptr %13, align 8, !tbaa !5
  %190 = getelementptr inbounds ptr, ptr %188, i64 %189
  %191 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 3
  %192 = load ptr, ptr %191, align 8, !tbaa !15
  %193 = load i64, ptr %13, align 8, !tbaa !5
  %194 = add i64 %193, 1
  %195 = getelementptr inbounds ptr, ptr %192, i64 %194
  %196 = load i64, ptr %14, align 8, !tbaa !5
  %197 = mul i64 %196, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %190, ptr align 8 %195, i64 %197, i1 false)
  br label %198

198:                                              ; preds = %186, %178
  %199 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 2
  %200 = load i64, ptr %199, align 8, !tbaa !13
  %201 = add i64 %200, -1
  store i64 %201, ptr %199, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %202

202:                                              ; preds = %198
  br label %203

203:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  store i64 1, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  store i64 0, ptr %16, align 8, !tbaa !5
  br label %204

204:                                              ; preds = %234, %203
  %205 = load i64, ptr %15, align 8, !tbaa !5
  %206 = icmp ne i64 %205, 0
  br i1 %206, label %207, label %212

207:                                              ; preds = %204
  %208 = load i64, ptr %16, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 2
  %210 = load i64, ptr %209, align 8, !tbaa !13
  %211 = icmp ne i64 %208, %210
  br label %212

212:                                              ; preds = %207, %204
  %213 = phi i1 [ false, %204 ], [ %211, %207 ]
  br i1 %213, label %215, label %214

214:                                              ; preds = %212
  store i32 12, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %242

215:                                              ; preds = %212
  %216 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 3
  %217 = load ptr, ptr %216, align 8, !tbaa !15
  %218 = load i64, ptr %16, align 8, !tbaa !5
  %219 = getelementptr inbounds ptr, ptr %217, i64 %218
  %220 = load ptr, ptr %219, align 8, !tbaa !16
  store ptr %220, ptr %1, align 8, !tbaa !16
  br label %221

221:                                              ; preds = %227, %215
  %222 = load i64, ptr %15, align 8, !tbaa !5
  %223 = icmp ne i64 %222, 0
  br i1 %223, label %224, label %233

224:                                              ; preds = %221
  %225 = load ptr, ptr %1, align 8, !tbaa !16
  %226 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %225)
  br label %227

227:                                              ; preds = %224
  %228 = load i64, ptr %15, align 8, !tbaa !5
  %229 = icmp ne i64 %228, 0
  %230 = xor i1 %229, true
  %231 = zext i1 %230 to i32
  %232 = sext i32 %231 to i64
  store i64 %232, ptr %15, align 8, !tbaa !5
  br label %221, !llvm.loop !17

233:                                              ; preds = %221
  br label %234

234:                                              ; preds = %233
  %235 = load i64, ptr %15, align 8, !tbaa !5
  %236 = icmp ne i64 %235, 0
  %237 = xor i1 %236, true
  %238 = zext i1 %237 to i32
  %239 = sext i32 %238 to i64
  store i64 %239, ptr %15, align 8, !tbaa !5
  %240 = load i64, ptr %16, align 8, !tbaa !5
  %241 = add i64 %240, 1
  store i64 %241, ptr %16, align 8, !tbaa !5
  br label %204, !llvm.loop !19

242:                                              ; preds = %214
  br label %243

243:                                              ; preds = %242
  %244 = getelementptr inbounds %struct.sc_array_str, ptr %2, i32 0, i32 3
  %245 = load ptr, ptr %244, align 8, !tbaa !15
  call void @free(ptr noundef %245) #8
  br label %246

246:                                              ; preds = %243
  call void @llvm.memset.p0.i64(ptr align 8 %2, i8 0, i64 32, i1 false)
  br label %247

247:                                              ; preds = %246
  br label %248

248:                                              ; preds = %247
  br label %249

249:                                              ; preds = %248
  br label %250

250:                                              ; preds = %249
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #8
  ret void

251:                                              ; preds = %165, %115, %65
  unreachable
}

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

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

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #3

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

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

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

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nounwind allocsize(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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { nounwind }
attributes #9 = { nounwind allocsize(1) }
attributes #10 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"sc_array_str", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24}
!11 = !{!"_Bool", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!10, !6, i64 16}
!14 = !{!10, !11, i64 0}
!15 = !{!10, !12, i64 24}
!16 = !{!12, !12, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


; 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 [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [63 x i8], align 1
@__PRETTY_FUNCTION__.example_str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @example_str() local_unnamed_addr #0 {
  %malloc = tail call dereferenceable_or_null(64) ptr @malloc(i64 64)
  %1 = icmp eq ptr %malloc, null
  br i1 %1, label %3, label %.thread102

.thread102:                                       ; preds = %0
  store ptr @.str, ptr %malloc, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %malloc, i64 8
  br label %.critedge.preheader

3:                                                ; preds = %0
  %malloc110 = tail call dereferenceable_or_null(64) ptr @malloc(i64 64)
  %4 = icmp eq ptr %malloc110, null
  br i1 %4, label %5, label %.critedge.preheader

5:                                                ; preds = %3
  %malloc111 = tail call dereferenceable_or_null(64) ptr @malloc(i64 64)
  %6 = icmp eq ptr %malloc111, null
  br i1 %6, label %7, label %.thread123

7:                                                ; preds = %5
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, i32 noundef 17, ptr noundef nonnull @__PRETTY_FUNCTION__.example_str) #6
  unreachable

.thread123:                                       ; preds = %5
  store ptr @.str.2, ptr %malloc111, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %._crit_edge

.critedge.preheader:                              ; preds = %3, %.thread102
  %malloc110.sink = phi ptr [ %2, %.thread102 ], [ %malloc110, %3 ]
  %.sroa.28.199.ph = phi i64 [ 2, %.thread102 ], [ 1, %3 ]
  %.sroa.42.4.ph = phi ptr [ %malloc, %.thread102 ], [ %malloc110, %3 ]
  store ptr @.str.1, ptr %malloc110.sink, align 8, !tbaa !5
  %10 = getelementptr inbounds ptr, ptr %.sroa.42.4.ph, i64 %.sroa.28.199.ph
  store ptr @.str.2, ptr %10, align 8, !tbaa !5
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %12 = getelementptr inbounds i8, ptr %.sroa.42.4.ph, i64 8
  %13 = shl nuw nsw i64 %.sroa.28.199.ph, 3
  tail call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %.sroa.42.4.ph, ptr noundef nonnull align 8 dereferenceable(1) %12, i64 %13, i1 false)
  br label %.critedge

._crit_edge:                                      ; preds = %.critedge, %.thread123
  %.sroa.42.4122127 = phi ptr [ %malloc111, %.thread123 ], [ %.sroa.42.4.ph, %.critedge ]
  tail call void @free(ptr noundef nonnull %.sroa.42.4122127) #7
  ret void

.critedge:                                        ; preds = %.critedge.preheader, %.critedge
  %.0113 = phi i64 [ %17, %.critedge ], [ 0, %.critedge.preheader ]
  %14 = getelementptr inbounds ptr, ptr %.sroa.42.4.ph, i64 %.0113
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef %15)
  %17 = add i64 %.0113, 1
  %.not85 = icmp eq i64 %17, %.sroa.28.199.ph
  br i1 %.not85, label %._crit_edge, label %.critedge, !llvm.loop !9
}

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

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

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

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

; Function Attrs: nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #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 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #6 = { noreturn nounwind }
attributes #7 = { nounwind }

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

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


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