; LLVM IR from litespeedtech/ls-qpack :: test (test_enc_str)

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

@tests = external hidden constant [10 x %struct.str_test], align 16
@.str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [40 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %6 = call noalias ptr @malloc(i64 noundef 4096) #8
  store ptr %6, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %4, align 8, !tbaa !5
  %8 = icmp ne ptr %7, null
  br i1 %8, label %10, label %9

9:                                                ; preds = %0
  store i32 1, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %56

10:                                               ; preds = %0
  store ptr @tests, ptr %2, align 8, !tbaa !5
  br label %11

11:                                               ; preds = %51, %10
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = icmp ult ptr %12, getelementptr inbounds (%struct.str_test, ptr @tests, i64 10)
  br i1 %13, label %14, label %54

14:                                               ; preds = %11
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 0
  store i8 0, ptr %16, align 1, !tbaa !9
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.str_test, ptr %17, i32 0, i32 1
  %19 = load i32, ptr %18, align 4, !tbaa !10
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.str_test, ptr %21, i32 0, i32 2
  %23 = load ptr, ptr %22, align 8, !tbaa !13
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.str_test, ptr %24, i32 0, i32 3
  %26 = load i32, ptr %25, align 8, !tbaa !14
  %27 = call i32 @lsqpack_enc_enc_str(i32 noundef %19, ptr noundef %20, i64 noundef 4096, ptr noundef %23, i32 noundef %26)
  store i32 %27, ptr %3, align 4, !tbaa !15
  %28 = load i32, ptr %3, align 4, !tbaa !15
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.str_test, ptr %29, i32 0, i32 5
  %31 = load i32, ptr %30, align 8, !tbaa !16
  %32 = icmp eq i32 %28, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %14
  br label %35

34:                                               ; preds = %14
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 132, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

35:                                               ; preds = %33
  %36 = load i32, ptr %3, align 4, !tbaa !15
  %37 = icmp sgt i32 %36, 0
  br i1 %37, label %38, label %50

38:                                               ; preds = %35
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.str_test, ptr %39, i32 0, i32 4
  %41 = load ptr, ptr %40, align 8, !tbaa !17
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = load i32, ptr %3, align 4, !tbaa !15
  %44 = sext i32 %43 to i64
  %45 = call i32 @memcmp(ptr noundef %41, ptr noundef %42, i64 noundef %44) #10
  %46 = icmp eq i32 0, %45
  br i1 %46, label %47, label %48

47:                                               ; preds = %38
  br label %49

48:                                               ; preds = %38
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 134, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

49:                                               ; preds = %47
  br label %50

50:                                               ; preds = %49, %35
  br label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.str_test, ptr %52, i32 1
  store ptr %53, ptr %2, align 8, !tbaa !5
  br label %11, !llvm.loop !18

54:                                               ; preds = %11
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %55) #7
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %56

56:                                               ; preds = %54, %9
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %57 = load i32, ptr %1, align 4
  ret i32 %57
}

; 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)
declare noalias ptr @malloc(i64 noundef) #2

declare i32 @lsqpack_enc_enc_str(i32 noundef, ptr noundef, i64 noundef, ptr noundef, i32 noundef) #3

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

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

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

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


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

@tests = external hidden local_unnamed_addr constant [10 x %struct.str_test], align 16
@.str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [40 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main() local_unnamed_addr #0 {
  %1 = tail call noalias dereferenceable_or_null(4096) ptr @malloc(i64 noundef 4096) #6
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %125, label %.preheader.preheader

.preheader.preheader:                             ; preds = %0
  store i8 0, ptr %1, align 1, !tbaa !5
  %2 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 4), align 4, !tbaa !8
  %3 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 8), align 8, !tbaa !12
  %4 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 16), align 16, !tbaa !13
  %5 = tail call i32 @lsqpack_enc_enc_str(i32 noundef %2, ptr noundef nonnull %1, i64 noundef 4096, ptr noundef %3, i32 noundef %4) #7
  %6 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 32), align 16, !tbaa !14
  %7 = icmp eq i32 %5, %6
  br i1 %7, label %9, label %8

8:                                                ; preds = %.preheader.9, %.preheader.8, %.preheader.7, %.preheader.6, %.preheader.5, %.preheader.4, %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 132, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

9:                                                ; preds = %.preheader.preheader
  %10 = icmp sgt i32 %5, 0
  br i1 %10, label %11, label %.preheader.1

11:                                               ; preds = %9
  %12 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 24), align 8, !tbaa !15
  %13 = zext nneg i32 %5 to i64
  %bcmp = tail call i32 @bcmp(ptr %12, ptr nonnull %1, i64 %13)
  %14 = icmp eq i32 %bcmp, 0
  br i1 %14, label %.preheader.1, label %15

15:                                               ; preds = %120, %108, %96, %84, %72, %60, %48, %36, %24, %11
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 134, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

.preheader.1:                                     ; preds = %9, %11
  store i8 0, ptr %1, align 1, !tbaa !5
  %16 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 44), align 4, !tbaa !8
  %17 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 48), align 16, !tbaa !12
  %18 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 56), align 8, !tbaa !13
  %19 = tail call i32 @lsqpack_enc_enc_str(i32 noundef %16, ptr noundef nonnull %1, i64 noundef 4096, ptr noundef %17, i32 noundef %18) #7
  %20 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 72), align 8, !tbaa !14
  %21 = icmp eq i32 %19, %20
  br i1 %21, label %22, label %8

22:                                               ; preds = %.preheader.1
  %23 = icmp sgt i32 %19, 0
  br i1 %23, label %24, label %.preheader.2

24:                                               ; preds = %22
  %25 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 64), align 16, !tbaa !15
  %26 = zext nneg i32 %19 to i64
  %bcmp.1 = tail call i32 @bcmp(ptr %25, ptr nonnull %1, i64 %26)
  %27 = icmp eq i32 %bcmp.1, 0
  br i1 %27, label %.preheader.2, label %15

.preheader.2:                                     ; preds = %24, %22
  store i8 0, ptr %1, align 1, !tbaa !5
  %28 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 84), align 4, !tbaa !8
  %29 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 88), align 8, !tbaa !12
  %30 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 96), align 16, !tbaa !13
  %31 = tail call i32 @lsqpack_enc_enc_str(i32 noundef %28, ptr noundef nonnull %1, i64 noundef 4096, ptr noundef %29, i32 noundef %30) #7
  %32 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 112), align 16, !tbaa !14
  %33 = icmp eq i32 %31, %32
  br i1 %33, label %34, label %8

34:                                               ; preds = %.preheader.2
  %35 = icmp sgt i32 %31, 0
  br i1 %35, label %36, label %.preheader.3

36:                                               ; preds = %34
  %37 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 104), align 8, !tbaa !15
  %38 = zext nneg i32 %31 to i64
  %bcmp.2 = tail call i32 @bcmp(ptr %37, ptr nonnull %1, i64 %38)
  %39 = icmp eq i32 %bcmp.2, 0
  br i1 %39, label %.preheader.3, label %15

.preheader.3:                                     ; preds = %36, %34
  store i8 0, ptr %1, align 1, !tbaa !5
  %40 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 124), align 4, !tbaa !8
  %41 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 128), align 16, !tbaa !12
  %42 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 136), align 8, !tbaa !13
  %43 = tail call i32 @lsqpack_enc_enc_str(i32 noundef %40, ptr noundef nonnull %1, i64 noundef 4096, ptr noundef %41, i32 noundef %42) #7
  %44 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 152), align 8, !tbaa !14
  %45 = icmp eq i32 %43, %44
  br i1 %45, label %46, label %8

46:                                               ; preds = %.preheader.3
  %47 = icmp sgt i32 %43, 0
  br i1 %47, label %48, label %.preheader.4

48:                                               ; preds = %46
  %49 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 144), align 16, !tbaa !15
  %50 = zext nneg i32 %43 to i64
  %bcmp.3 = tail call i32 @bcmp(ptr %49, ptr nonnull %1, i64 %50)
  %51 = icmp eq i32 %bcmp.3, 0
  br i1 %51, label %.preheader.4, label %15

.preheader.4:                                     ; preds = %48, %46
  store i8 0, ptr %1, align 1, !tbaa !5
  %52 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 164), align 4, !tbaa !8
  %53 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 168), align 8, !tbaa !12
  %54 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 176), align 16, !tbaa !13
  %55 = tail call i32 @lsqpack_enc_enc_str(i32 noundef %52, ptr noundef nonnull %1, i64 noundef 4096, ptr noundef %53, i32 noundef %54) #7
  %56 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 192), align 16, !tbaa !14
  %57 = icmp eq i32 %55, %56
  br i1 %57, label %58, label %8

58:                                               ; preds = %.preheader.4
  %59 = icmp sgt i32 %55, 0
  br i1 %59, label %60, label %.preheader.5

60:                                               ; preds = %58
  %61 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 184), align 8, !tbaa !15
  %62 = zext nneg i32 %55 to i64
  %bcmp.4 = tail call i32 @bcmp(ptr %61, ptr nonnull %1, i64 %62)
  %63 = icmp eq i32 %bcmp.4, 0
  br i1 %63, label %.preheader.5, label %15

.preheader.5:                                     ; preds = %60, %58
  store i8 0, ptr %1, align 1, !tbaa !5
  %64 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 204), align 4, !tbaa !8
  %65 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 208), align 16, !tbaa !12
  %66 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 216), align 8, !tbaa !13
  %67 = tail call i32 @lsqpack_enc_enc_str(i32 noundef %64, ptr noundef nonnull %1, i64 noundef 4096, ptr noundef %65, i32 noundef %66) #7
  %68 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 232), align 8, !tbaa !14
  %69 = icmp eq i32 %67, %68
  br i1 %69, label %70, label %8

70:                                               ; preds = %.preheader.5
  %71 = icmp sgt i32 %67, 0
  br i1 %71, label %72, label %.preheader.6

72:                                               ; preds = %70
  %73 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 224), align 16, !tbaa !15
  %74 = zext nneg i32 %67 to i64
  %bcmp.5 = tail call i32 @bcmp(ptr %73, ptr nonnull %1, i64 %74)
  %75 = icmp eq i32 %bcmp.5, 0
  br i1 %75, label %.preheader.6, label %15

.preheader.6:                                     ; preds = %72, %70
  store i8 0, ptr %1, align 1, !tbaa !5
  %76 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 244), align 4, !tbaa !8
  %77 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 248), align 8, !tbaa !12
  %78 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 256), align 16, !tbaa !13
  %79 = tail call i32 @lsqpack_enc_enc_str(i32 noundef %76, ptr noundef nonnull %1, i64 noundef 4096, ptr noundef %77, i32 noundef %78) #7
  %80 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 272), align 16, !tbaa !14
  %81 = icmp eq i32 %79, %80
  br i1 %81, label %82, label %8

82:                                               ; preds = %.preheader.6
  %83 = icmp sgt i32 %79, 0
  br i1 %83, label %84, label %.preheader.7

84:                                               ; preds = %82
  %85 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 264), align 8, !tbaa !15
  %86 = zext nneg i32 %79 to i64
  %bcmp.6 = tail call i32 @bcmp(ptr %85, ptr nonnull %1, i64 %86)
  %87 = icmp eq i32 %bcmp.6, 0
  br i1 %87, label %.preheader.7, label %15

.preheader.7:                                     ; preds = %84, %82
  store i8 0, ptr %1, align 1, !tbaa !5
  %88 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 284), align 4, !tbaa !8
  %89 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 288), align 16, !tbaa !12
  %90 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 296), align 8, !tbaa !13
  %91 = tail call i32 @lsqpack_enc_enc_str(i32 noundef %88, ptr noundef nonnull %1, i64 noundef 4096, ptr noundef %89, i32 noundef %90) #7
  %92 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 312), align 8, !tbaa !14
  %93 = icmp eq i32 %91, %92
  br i1 %93, label %94, label %8

94:                                               ; preds = %.preheader.7
  %95 = icmp sgt i32 %91, 0
  br i1 %95, label %96, label %.preheader.8

96:                                               ; preds = %94
  %97 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 304), align 16, !tbaa !15
  %98 = zext nneg i32 %91 to i64
  %bcmp.7 = tail call i32 @bcmp(ptr %97, ptr nonnull %1, i64 %98)
  %99 = icmp eq i32 %bcmp.7, 0
  br i1 %99, label %.preheader.8, label %15

.preheader.8:                                     ; preds = %96, %94
  store i8 0, ptr %1, align 1, !tbaa !5
  %100 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 324), align 4, !tbaa !8
  %101 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 328), align 8, !tbaa !12
  %102 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 336), align 16, !tbaa !13
  %103 = tail call i32 @lsqpack_enc_enc_str(i32 noundef %100, ptr noundef nonnull %1, i64 noundef 4096, ptr noundef %101, i32 noundef %102) #7
  %104 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 352), align 16, !tbaa !14
  %105 = icmp eq i32 %103, %104
  br i1 %105, label %106, label %8

106:                                              ; preds = %.preheader.8
  %107 = icmp sgt i32 %103, 0
  br i1 %107, label %108, label %.preheader.9

108:                                              ; preds = %106
  %109 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 344), align 8, !tbaa !15
  %110 = zext nneg i32 %103 to i64
  %bcmp.8 = tail call i32 @bcmp(ptr %109, ptr nonnull %1, i64 %110)
  %111 = icmp eq i32 %bcmp.8, 0
  br i1 %111, label %.preheader.9, label %15

.preheader.9:                                     ; preds = %108, %106
  store i8 0, ptr %1, align 1, !tbaa !5
  %112 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 364), align 4, !tbaa !8
  %113 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 368), align 16, !tbaa !12
  %114 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 376), align 8, !tbaa !13
  %115 = tail call i32 @lsqpack_enc_enc_str(i32 noundef %112, ptr noundef nonnull %1, i64 noundef 4096, ptr noundef %113, i32 noundef %114) #7
  %116 = load i32, ptr getelementptr inbounds (i8, ptr @tests, i64 392), align 8, !tbaa !14
  %117 = icmp eq i32 %115, %116
  br i1 %117, label %118, label %8

118:                                              ; preds = %.preheader.9
  %119 = icmp sgt i32 %115, 0
  br i1 %119, label %120, label %124

120:                                              ; preds = %118
  %121 = load ptr, ptr getelementptr inbounds (i8, ptr @tests, i64 384), align 16, !tbaa !15
  %122 = zext nneg i32 %115 to i64
  %bcmp.9 = tail call i32 @bcmp(ptr %121, ptr nonnull %1, i64 %122)
  %123 = icmp eq i32 %bcmp.9, 0
  br i1 %123, label %124, label %15

124:                                              ; preds = %120, %118
  tail call void @free(ptr noundef nonnull %1) #7
  br label %125

125:                                              ; preds = %0, %124
  %.0 = phi i32 [ 0, %124 ], [ 1, %0 ]
  ret i32 %.0
}

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

declare i32 @lsqpack_enc_enc_str(i32 noundef, ptr noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #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 memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) 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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) 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 = { "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 = { 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 #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 memory(argmem: read) }
attributes #6 = { nounwind allocsize(0) }
attributes #7 = { nounwind }
attributes #8 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 4}
!9 = !{!"str_test", !10, i64 0, !10, i64 4, !11, i64 8, !10, i64 16, !11, i64 24, !10, i64 32}
!10 = !{!"int", !6, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = !{!9, !11, i64 8}
!13 = !{!9, !10, i64 16}
!14 = !{!9, !10, i64 32}
!15 = !{!9, !11, i64 24}


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