; LLVM IR from ARMmbed/mbed-crypto :: programs/test (selftest)

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

@selftests = external dso_local constant [28 x %struct.selftest_t], align 16
@.str.27 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  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 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 8, i1 false)
  %15 = load ptr, ptr %12, align 8, !tbaa !9
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %19

17:                                               ; preds = %2
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str.27)
  call void @exit(i32 noundef 1) #7
  unreachable

19:                                               ; preds = %2
  %20 = call i32 @run_test_snprintf()
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %24

22:                                               ; preds = %19
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.28)
  call void @exit(i32 noundef 1) #7
  unreachable

24:                                               ; preds = %19
  %25 = load ptr, ptr %5, align 8, !tbaa !9
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = icmp sge i32 %26, 1
  br i1 %27, label %28, label %29

28:                                               ; preds = %24
  br label %31

29:                                               ; preds = %24
  %30 = load i32, ptr %4, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %29, %28
  %32 = phi i32 [ 1, %28 ], [ %30, %29 ]
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds ptr, ptr %25, i64 %33
  store ptr %34, ptr %7, align 8, !tbaa !9
  br label %35

35:                                               ; preds = %64, %31
  %36 = load ptr, ptr %7, align 8, !tbaa !9
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %67

39:                                               ; preds = %35
  %40 = load ptr, ptr %7, align 8, !tbaa !9
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  %42 = call i32 @strcmp(ptr noundef %41, ptr noundef @.str.29) #8
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %49, label %44

44:                                               ; preds = %39
  %45 = load ptr, ptr %7, align 8, !tbaa !9
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = call i32 @strcmp(ptr noundef %46, ptr noundef @.str.30) #8
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %44, %39
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %63

50:                                               ; preds = %44
  %51 = load ptr, ptr %7, align 8, !tbaa !9
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = call i32 @strcmp(ptr noundef %52, ptr noundef @.str.31) #8
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %60, label %55

55:                                               ; preds = %50
  %56 = load ptr, ptr %7, align 8, !tbaa !9
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = call i32 @strcmp(ptr noundef %57, ptr noundef @.str.32) #8
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %60, label %61

60:                                               ; preds = %55, %50
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %62

61:                                               ; preds = %55
  br label %67

62:                                               ; preds = %60
  br label %63

63:                                               ; preds = %62, %49
  br label %64

64:                                               ; preds = %63
  %65 = load ptr, ptr %7, align 8, !tbaa !9
  %66 = getelementptr inbounds ptr, ptr %65, i32 1
  store ptr %66, ptr %7, align 8, !tbaa !9
  br label %35, !llvm.loop !11

67:                                               ; preds = %61, %35
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %72

70:                                               ; preds = %67
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.33)
  br label %72

72:                                               ; preds = %70, %67
  %73 = load ptr, ptr %7, align 8, !tbaa !9
  %74 = load ptr, ptr %73, align 8, !tbaa !9
  %75 = icmp ne ptr %74, null
  br i1 %75, label %76, label %131

76:                                               ; preds = %72
  %77 = load i32, ptr %9, align 4, !tbaa !5
  %78 = icmp eq i32 %77, 0
  br i1 %78, label %79, label %131

79:                                               ; preds = %76
  br label %80

80:                                               ; preds = %127, %79
  %81 = load ptr, ptr %7, align 8, !tbaa !9
  %82 = load ptr, ptr %81, align 8, !tbaa !9
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %130

84:                                               ; preds = %80
  store ptr @selftests, ptr %6, align 8, !tbaa !9
  br label %85

85:                                               ; preds = %112, %84
  %86 = load ptr, ptr %6, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct.selftest_t, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8, !tbaa !13
  %89 = icmp ne ptr %88, null
  br i1 %89, label %90, label %115

90:                                               ; preds = %85
  %91 = load ptr, ptr %7, align 8, !tbaa !9
  %92 = load ptr, ptr %91, align 8, !tbaa !9
  %93 = load ptr, ptr %6, align 8, !tbaa !9
  %94 = getelementptr inbounds %struct.selftest_t, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !13
  %96 = call i32 @strcmp(ptr noundef %92, ptr noundef %95) #8
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %111, label %98

98:                                               ; preds = %90
  %99 = load ptr, ptr %6, align 8, !tbaa !9
  %100 = getelementptr inbounds %struct.selftest_t, ptr %99, i32 0, i32 1
  %101 = load ptr, ptr %100, align 8, !tbaa !15
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = call i32 %101(i32 noundef %102)
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %108

105:                                              ; preds = %98
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %11, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %105, %98
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %10, align 4, !tbaa !5
  br label %115

111:                                              ; preds = %90
  br label %112

112:                                              ; preds = %111
  %113 = load ptr, ptr %6, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct.selftest_t, ptr %113, i32 1
  store ptr %114, ptr %6, align 8, !tbaa !9
  br label %85, !llvm.loop !16

115:                                              ; preds = %108, %85
  %116 = load ptr, ptr %6, align 8, !tbaa !9
  %117 = getelementptr inbounds %struct.selftest_t, ptr %116, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !13
  %119 = icmp eq ptr %118, null
  br i1 %119, label %120, label %126

120:                                              ; preds = %115
  %121 = load ptr, ptr %7, align 8, !tbaa !9
  %122 = load ptr, ptr %121, align 8, !tbaa !9
  %123 = call i32 (ptr, ...) @printf(ptr noundef @.str.34, ptr noundef %122)
  %124 = load i32, ptr %11, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %11, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %120, %115
  br label %127

127:                                              ; preds = %126
  %128 = load ptr, ptr %7, align 8, !tbaa !9
  %129 = getelementptr inbounds ptr, ptr %128, i32 1
  store ptr %129, ptr %7, align 8, !tbaa !9
  br label %80, !llvm.loop !17

130:                                              ; preds = %80
  br label %193

131:                                              ; preds = %76, %72
  store ptr @selftests, ptr %6, align 8, !tbaa !9
  br label %132

132:                                              ; preds = %189, %131
  %133 = load ptr, ptr %6, align 8, !tbaa !9
  %134 = getelementptr inbounds %struct.selftest_t, ptr %133, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !13
  %136 = icmp ne ptr %135, null
  br i1 %136, label %137, label %192

137:                                              ; preds = %132
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %176

140:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %141 = load ptr, ptr %7, align 8, !tbaa !9
  store ptr %141, ptr %13, align 8, !tbaa !9
  br label %142

142:                                              ; preds = %156, %140
  %143 = load ptr, ptr %13, align 8, !tbaa !9
  %144 = load ptr, ptr %143, align 8, !tbaa !9
  %145 = icmp ne ptr %144, null
  br i1 %145, label %146, label %159

146:                                              ; preds = %142
  %147 = load ptr, ptr %13, align 8, !tbaa !9
  %148 = load ptr, ptr %147, align 8, !tbaa !9
  %149 = load ptr, ptr %6, align 8, !tbaa !9
  %150 = getelementptr inbounds %struct.selftest_t, ptr %149, i32 0, i32 0
  %151 = load ptr, ptr %150, align 8, !tbaa !13
  %152 = call i32 @strcmp(ptr noundef %148, ptr noundef %151) #8
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %155, label %154

154:                                              ; preds = %146
  br label %159

155:                                              ; preds = %146
  br label %156

156:                                              ; preds = %155
  %157 = load ptr, ptr %13, align 8, !tbaa !9
  %158 = getelementptr inbounds ptr, ptr %157, i32 1
  store ptr %158, ptr %13, align 8, !tbaa !9
  br label %142, !llvm.loop !18

159:                                              ; preds = %154, %142
  %160 = load ptr, ptr %13, align 8, !tbaa !9
  %161 = load ptr, ptr %160, align 8, !tbaa !9
  %162 = icmp ne ptr %161, null
  br i1 %162, label %163, label %172

163:                                              ; preds = %159
  %164 = load i32, ptr %8, align 4, !tbaa !5
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %166, label %171

166:                                              ; preds = %163
  %167 = load ptr, ptr %6, align 8, !tbaa !9
  %168 = getelementptr inbounds %struct.selftest_t, ptr %167, i32 0, i32 0
  %169 = load ptr, ptr %168, align 8, !tbaa !13
  %170 = call i32 (ptr, ...) @printf(ptr noundef @.str.35, ptr noundef %169)
  br label %171

171:                                              ; preds = %166, %163
  store i32 13, ptr %14, align 4
  br label %173

172:                                              ; preds = %159
  store i32 0, ptr %14, align 4
  br label %173

173:                                              ; preds = %172, %171
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %174 = load i32, ptr %14, align 4
  switch i32 %174, label %213 [
    i32 0, label %175
    i32 13, label %189
  ]

175:                                              ; preds = %173
  br label %176

176:                                              ; preds = %175, %137
  %177 = load ptr, ptr %6, align 8, !tbaa !9
  %178 = getelementptr inbounds %struct.selftest_t, ptr %177, i32 0, i32 1
  %179 = load ptr, ptr %178, align 8, !tbaa !15
  %180 = load i32, ptr %8, align 4, !tbaa !5
  %181 = call i32 %179(i32 noundef %180)
  %182 = icmp ne i32 %181, 0
  br i1 %182, label %183, label %186

183:                                              ; preds = %176
  %184 = load i32, ptr %11, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %11, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %183, %176
  %187 = load i32, ptr %10, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %10, align 4, !tbaa !5
  br label %189

189:                                              ; preds = %186, %173
  %190 = load ptr, ptr %6, align 8, !tbaa !9
  %191 = getelementptr inbounds %struct.selftest_t, ptr %190, i32 1
  store ptr %191, ptr %6, align 8, !tbaa !9
  br label %132, !llvm.loop !19

192:                                              ; preds = %132
  br label %193

193:                                              ; preds = %192, %130
  %194 = load i32, ptr %8, align 4, !tbaa !5
  %195 = icmp ne i32 %194, 0
  br i1 %195, label %196, label %207

196:                                              ; preds = %193
  %197 = load i32, ptr %10, align 4, !tbaa !5
  %198 = call i32 (ptr, ...) @printf(ptr noundef @.str.36, i32 noundef %197)
  %199 = load i32, ptr %11, align 4, !tbaa !5
  %200 = icmp sgt i32 %199, 0
  br i1 %200, label %201, label %204

201:                                              ; preds = %196
  %202 = load i32, ptr %11, align 4, !tbaa !5
  %203 = call i32 (ptr, ...) @printf(ptr noundef @.str.37, i32 noundef %202)
  br label %206

204:                                              ; preds = %196
  %205 = call i32 (ptr, ...) @printf(ptr noundef @.str.38)
  br label %206

206:                                              ; preds = %204, %201
  br label %207

207:                                              ; preds = %206, %193
  %208 = load i32, ptr %11, align 4, !tbaa !5
  %209 = icmp sgt i32 %208, 0
  br i1 %209, label %210, label %211

210:                                              ; preds = %207
  call void @exit(i32 noundef 1) #7
  unreachable

211:                                              ; preds = %207
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, 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
  %212 = load i32, ptr %3, align 4
  ret i32 %212

213:                                              ; preds = %173
  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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

; Function Attrs: nounwind uwtable
declare hidden i32 @run_test_snprintf() #0

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #5

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

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 = { "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 willreturn memory(read) "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 = { noreturn nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 0}
!14 = !{!"", !10, i64 0, !10, i64 8}
!15 = !{!14, !10, i64 8}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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

%struct.selftest_t = type { ptr, ptr }

@selftests = external dso_local local_unnamed_addr constant [28 x %struct.selftest_t], align 16
@.str.28 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = tail call i32 @run_test_snprintf()
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %6, label %4

4:                                                ; preds = %2
  %5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28)
  tail call void @exit(i32 noundef 1) #5
  unreachable

6:                                                ; preds = %2
  %7 = tail call i32 @llvm.smin.i32(i32 %0, i32 1)
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds ptr, ptr %1, i64 %8
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %.not66100 = icmp eq ptr %10, null
  br i1 %.not66100, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %6, %23
  %11 = phi ptr [ %25, %23 ], [ %10, %6 ]
  %.055103 = phi i32 [ %.156, %23 ], [ 0, %6 ]
  %.057102 = phi i32 [ %.158, %23 ], [ 1, %6 ]
  %.059101 = phi ptr [ %24, %23 ], [ %9, %6 ]
  %12 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str.29) #6
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %23, label %14

14:                                               ; preds = %.lr.ph
  %15 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str.30) #6
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %23, label %17

17:                                               ; preds = %14
  %18 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str.31) #6
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %23, label %20

20:                                               ; preds = %17
  %21 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %11, ptr noundef nonnull dereferenceable(1) @.str.32) #6
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %._crit_edge

23:                                               ; preds = %17, %20, %.lr.ph, %14
  %.158 = phi i32 [ 0, %14 ], [ 0, %.lr.ph ], [ %.057102, %20 ], [ %.057102, %17 ]
  %.156 = phi i32 [ %.055103, %14 ], [ %.055103, %.lr.ph ], [ 1, %20 ], [ 1, %17 ]
  %24 = getelementptr inbounds i8, ptr %.059101, i64 8
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  %.not66 = icmp eq ptr %25, null
  br i1 %.not66, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %23, %20
  %26 = phi ptr [ null, %23 ], [ %11, %20 ]
  %.059.lcssa.ph = phi ptr [ %24, %23 ], [ %.059101, %20 ]
  %.057.lcssa.ph = phi i32 [ %.158, %23 ], [ %.057102, %20 ]
  %.055.lcssa.ph = phi i32 [ %.156, %23 ], [ %.055103, %20 ]
  %27 = icmp eq i32 %.055.lcssa.ph, 0
  %.not67 = icmp eq i32 %.057.lcssa.ph, 0
  br i1 %.not67, label %29, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %6, %._crit_edge
  %.055.lcssa144 = phi i1 [ %27, %._crit_edge ], [ true, %6 ]
  %.057.lcssa142 = phi i32 [ %.057.lcssa.ph, %._crit_edge ], [ 1, %6 ]
  %.059.lcssa140 = phi ptr [ %.059.lcssa.ph, %._crit_edge ], [ %9, %6 ]
  %28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.33)
  %.pre = load ptr, ptr %.059.lcssa140, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %._crit_edge.thread, %._crit_edge
  %.not67147 = phi i1 [ false, %._crit_edge.thread ], [ true, %._crit_edge ]
  %.055.lcssa145 = phi i1 [ %.055.lcssa144, %._crit_edge.thread ], [ %27, %._crit_edge ]
  %.057.lcssa143 = phi i32 [ %.057.lcssa142, %._crit_edge.thread ], [ 0, %._crit_edge ]
  %.059.lcssa141 = phi ptr [ %.059.lcssa140, %._crit_edge.thread ], [ %.059.lcssa.ph, %._crit_edge ]
  %30 = phi ptr [ %.pre, %._crit_edge.thread ], [ %26, %._crit_edge ]
  %31 = icmp ne ptr %30, null
  %or.cond = select i1 %31, i1 %.055.lcssa145, i1 false
  %32 = load ptr, ptr @selftests, align 16, !tbaa !11
  %.not75122 = icmp eq ptr %32, null
  br i1 %or.cond, label %.preheader95, label %.preheader97

.preheader97:                                     ; preds = %29
  br i1 %.not75122, label %.loopexit.thread, label %.lr.ph118

.lr.ph118:                                        ; preds = %.preheader97
  br i1 %.055.lcssa145, label %.thread87.us, label %.preheader96

.thread87.us:                                     ; preds = %.lr.ph118, %.thread87.us
  %.4117.us = phi i32 [ %spec.select78.us, %.thread87.us ], [ 0, %.lr.ph118 ]
  %.252115.us = phi i32 [ %37, %.thread87.us ], [ 0, %.lr.ph118 ]
  %.162114.us = phi ptr [ %38, %.thread87.us ], [ @selftests, %.lr.ph118 ]
  %33 = getelementptr inbounds i8, ptr %.162114.us, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !13
  %35 = tail call i32 %34(i32 noundef %.057.lcssa143) #7
  %.not73.us = icmp ne i32 %35, 0
  %36 = zext i1 %.not73.us to i32
  %spec.select78.us = add nuw nsw i32 %.4117.us, %36
  %37 = add nuw nsw i32 %.252115.us, 1
  %38 = getelementptr inbounds i8, ptr %.162114.us, i64 16
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %.not68.us = icmp eq ptr %39, null
  br i1 %.not68.us, label %.loopexit, label %.thread87.us, !llvm.loop !14

.preheader95:                                     ; preds = %29
  br i1 %.not75122, label %.preheader.us, label %.preheader

.preheader.us:                                    ; preds = %.preheader95, %.preheader.us
  %40 = phi ptr [ %.pr.us, %.preheader.us ], [ %30, %.preheader95 ]
  %.049128.us = phi i32 [ %42, %.preheader.us ], [ 0, %.preheader95 ]
  %.160126.us = phi ptr [ %43, %.preheader.us ], [ %.059.lcssa141, %.preheader95 ]
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.34, ptr noundef nonnull %40)
  %42 = add nuw nsw i32 %.049128.us, 1
  %43 = getelementptr inbounds i8, ptr %.160126.us, i64 8
  %.pr.us = load ptr, ptr %43, align 8, !tbaa !5
  %.not74.us = icmp eq ptr %.pr.us, null
  br i1 %.not74.us, label %.loopexit, label %.preheader.us, !llvm.loop !15

.preheader:                                       ; preds = %.preheader95, %59
  %.049128 = phi i32 [ %.3, %59 ], [ 0, %.preheader95 ]
  %.050127 = phi i32 [ %.15181, %59 ], [ 0, %.preheader95 ]
  %.160126 = phi ptr [ %60, %59 ], [ %.059.lcssa141, %.preheader95 ]
  %44 = phi ptr [ %.pr, %59 ], [ %30, %.preheader95 ]
  br label %45

45:                                               ; preds = %.preheader, %48
  %46 = phi ptr [ %32, %.preheader ], [ %50, %48 ]
  %.061123 = phi ptr [ @selftests, %.preheader ], [ %49, %48 ]
  %47 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %44, ptr noundef nonnull dereferenceable(1) %46) #6
  %.not76 = icmp eq i32 %47, 0
  br i1 %.not76, label %51, label %48

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %.061123, i64 16
  %50 = load ptr, ptr %49, align 8, !tbaa !11
  %.not75 = icmp eq ptr %50, null
  br i1 %.not75, label %._crit_edge125, label %45, !llvm.loop !16

51:                                               ; preds = %45
  %52 = getelementptr inbounds i8, ptr %.061123, i64 8
  %53 = load ptr, ptr %52, align 8, !tbaa !13
  %54 = tail call i32 %53(i32 noundef %.057.lcssa143) #7
  %.not77 = icmp ne i32 %54, 0
  %55 = zext i1 %.not77 to i32
  %spec.select = add nsw i32 %.049128, %55
  %56 = add nsw i32 %.050127, 1
  br label %59

._crit_edge125:                                   ; preds = %48
  %57 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.34, ptr noundef nonnull %44)
  %58 = add nsw i32 %.049128, 1
  br label %59

59:                                               ; preds = %51, %._crit_edge125
  %.15181 = phi i32 [ %.050127, %._crit_edge125 ], [ %56, %51 ]
  %.3 = phi i32 [ %58, %._crit_edge125 ], [ %spec.select, %51 ]
  %60 = getelementptr inbounds i8, ptr %.160126, i64 8
  %.pr = load ptr, ptr %60, align 8, !tbaa !5
  %.not74 = icmp eq ptr %.pr, null
  br i1 %.not74, label %.loopexit, label %.preheader, !llvm.loop !15

.preheader96:                                     ; preds = %.lr.ph118, %75
  %61 = phi ptr [ %77, %75 ], [ %32, %.lr.ph118 ]
  %.4117 = phi i32 [ %.6, %75 ], [ 0, %.lr.ph118 ]
  %.252115 = phi i32 [ %.353, %75 ], [ 0, %.lr.ph118 ]
  %.162114 = phi ptr [ %76, %75 ], [ @selftests, %.lr.ph118 ]
  %62 = load ptr, ptr %.059.lcssa141, align 8, !tbaa !5
  %.not70110 = icmp eq ptr %62, null
  br i1 %.not70110, label %.thread87.loopexit, label %.lr.ph112

63:                                               ; preds = %.lr.ph112
  %64 = getelementptr inbounds i8, ptr %.048111, i64 8
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %.not70 = icmp eq ptr %65, null
  br i1 %.not70, label %.thread87.loopexit, label %.lr.ph112, !llvm.loop !17

.lr.ph112:                                        ; preds = %.preheader96, %63
  %66 = phi ptr [ %65, %63 ], [ %62, %.preheader96 ]
  %.048111 = phi ptr [ %64, %63 ], [ %.059.lcssa141, %.preheader96 ]
  %67 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %66, ptr noundef nonnull dereferenceable(1) %61) #6
  %.not71 = icmp eq i32 %67, 0
  br i1 %.not71, label %68, label %63

68:                                               ; preds = %.lr.ph112
  br i1 %.not67147, label %75, label %.thread90

.thread90:                                        ; preds = %68
  %69 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.35, ptr noundef nonnull %61)
  br label %75

.thread87.loopexit:                               ; preds = %63, %.preheader96
  %70 = getelementptr inbounds i8, ptr %.162114, i64 8
  %71 = load ptr, ptr %70, align 8, !tbaa !13
  %72 = tail call i32 %71(i32 noundef %.057.lcssa143) #7
  %.not73 = icmp ne i32 %72, 0
  %73 = zext i1 %.not73 to i32
  %spec.select78 = add nsw i32 %.4117, %73
  %74 = add nsw i32 %.252115, 1
  br label %75

75:                                               ; preds = %68, %.thread90, %.thread87.loopexit
  %.353 = phi i32 [ %74, %.thread87.loopexit ], [ %.252115, %.thread90 ], [ %.252115, %68 ]
  %.6 = phi i32 [ %spec.select78, %.thread87.loopexit ], [ %.4117, %.thread90 ], [ %.4117, %68 ]
  %76 = getelementptr inbounds i8, ptr %.162114, i64 16
  %77 = load ptr, ptr %76, align 8, !tbaa !11
  %.not68 = icmp eq ptr %77, null
  br i1 %.not68, label %.loopexit, label %.preheader96, !llvm.loop !14

.loopexit:                                        ; preds = %75, %.thread87.us, %59, %.preheader.us
  %.454 = phi i32 [ 0, %.preheader.us ], [ %.15181, %59 ], [ %37, %.thread87.us ], [ %.353, %75 ]
  %.7 = phi i32 [ %42, %.preheader.us ], [ %.3, %59 ], [ %spec.select78.us, %.thread87.us ], [ %.6, %75 ]
  br i1 %.not67147, label %84, label %79

.loopexit.thread:                                 ; preds = %.preheader97
  br i1 %.not67147, label %.thread155, label %.thread

.thread:                                          ; preds = %.loopexit.thread
  %78 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.36, i32 noundef 0)
  br label %.thread94

79:                                               ; preds = %.loopexit
  %80 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.36, i32 noundef %.454)
  %81 = icmp sgt i32 %.7, 0
  br i1 %81, label %.thread93, label %.thread94

.thread93:                                        ; preds = %79
  %82 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.37, i32 noundef %.7)
  br label %86

.thread94:                                        ; preds = %.thread, %79
  %83 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.38)
  br label %.thread155

84:                                               ; preds = %.loopexit
  %85 = icmp sgt i32 %.7, 0
  br i1 %85, label %86, label %.thread155

86:                                               ; preds = %.thread93, %84
  tail call void @exit(i32 noundef 1) #5
  unreachable

.thread155:                                       ; preds = %.loopexit.thread, %.thread94, %84
  ret i32 0
}

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @run_test_snprintf() local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4

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 nofree nounwind willreturn memory(argmem: read) "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { noreturn nounwind }
attributes #6 = { nounwind willreturn memory(read) }
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"}
!11 = !{!12, !6, i64 0}
!12 = !{!"", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass