; LLVM IR from ConcealNetwork/conceal-desktop :: libqrencode/tests (test_rs)

; 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"

@__func__.test_allQRSizeAndECCLevel = external hidden unnamed_addr constant [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1

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

declare void @testStartReal(ptr noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @test_allQRSizeAndECCLevel() #2 {
  %1 = alloca i32, align 4
  %2 = alloca [256 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 256, ptr %2) #4
  call void @testStartReal(ptr noundef @__func__.test_allQRSizeAndECCLevel, ptr noundef @.str.1)
  %3 = getelementptr inbounds [256 x i8], ptr %2, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %3, i8 0, i64 256, i1 false)
  %4 = getelementptr inbounds [256 x i8], ptr %2, i64 0, i64 0
  call void @compareRS(ptr noundef %4)
  %5 = getelementptr inbounds [256 x i8], ptr %2, i64 0, i64 0
  call void @compareRSMQR(ptr noundef %5)
  %6 = getelementptr inbounds [256 x i8], ptr %2, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %6, i8 -86, i64 256, i1 false)
  %7 = getelementptr inbounds [256 x i8], ptr %2, i64 0, i64 0
  call void @compareRS(ptr noundef %7)
  %8 = getelementptr inbounds [256 x i8], ptr %2, i64 0, i64 0
  call void @compareRSMQR(ptr noundef %8)
  %9 = getelementptr inbounds [256 x i8], ptr %2, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 -1, i64 256, i1 false)
  %10 = getelementptr inbounds [256 x i8], ptr %2, i64 0, i64 0
  call void @compareRS(ptr noundef %10)
  %11 = getelementptr inbounds [256 x i8], ptr %2, i64 0, i64 0
  call void @compareRSMQR(ptr noundef %11)
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %21, %0
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = icmp slt i32 %13, 256
  br i1 %14, label %15, label %24

15:                                               ; preds = %12
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = trunc i32 %16 to i8
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [256 x i8], ptr %2, i64 0, i64 %19
  store i8 %17, ptr %20, align 1, !tbaa !9
  br label %21

21:                                               ; preds = %15
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %1, align 4, !tbaa !5
  br label %12, !llvm.loop !10

24:                                               ; preds = %12
  %25 = getelementptr inbounds [256 x i8], ptr %2, i64 0, i64 0
  call void @compareRS(ptr noundef %25)
  %26 = getelementptr inbounds [256 x i8], ptr %2, i64 0, i64 0
  call void @compareRSMQR(ptr noundef %26)
  call void @testFinish()
  call void @llvm.lifetime.end.p0(i64 256, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void
}

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

; Function Attrs: nounwind uwtable
declare hidden void @compareRS(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @compareRSMQR(ptr noundef) #2

declare void @testFinish() #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"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"

@__func__.test_allQRSizeAndECCLevel = external hidden unnamed_addr constant [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [61 x i8], align 1

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

declare void @testStartReal(ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @test_allQRSizeAndECCLevel() local_unnamed_addr #2 {
vector.ph:
  %0 = alloca [256 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %0) #4
  tail call void @testStartReal(ptr noundef nonnull @__func__.test_allQRSizeAndECCLevel, ptr noundef nonnull @.str.1) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %0, i8 0, i64 256, i1 false)
  call void @compareRS(ptr noundef nonnull %0)
  call void @compareRSMQR(ptr noundef nonnull %0)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %0, i8 -86, i64 256, i1 false)
  call void @compareRS(ptr noundef nonnull %0)
  call void @compareRSMQR(ptr noundef nonnull %0)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %0, i8 -1, i64 256, i1 false)
  call void @compareRS(ptr noundef nonnull %0)
  call void @compareRSMQR(ptr noundef nonnull %0)
  store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, ptr %0, align 16, !tbaa !5
  %1 = getelementptr inbounds i8, ptr %0, i64 16
  store <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, ptr %1, align 16, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 32
  store <16 x i8> <i8 32, i8 33, i8 34, i8 35, i8 36, i8 37, i8 38, i8 39, i8 40, i8 41, i8 42, i8 43, i8 44, i8 45, i8 46, i8 47>, ptr %2, align 16, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 48
  store <16 x i8> <i8 48, i8 49, i8 50, i8 51, i8 52, i8 53, i8 54, i8 55, i8 56, i8 57, i8 58, i8 59, i8 60, i8 61, i8 62, i8 63>, ptr %3, align 16, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 64
  store <16 x i8> <i8 64, i8 65, i8 66, i8 67, i8 68, i8 69, i8 70, i8 71, i8 72, i8 73, i8 74, i8 75, i8 76, i8 77, i8 78, i8 79>, ptr %4, align 16, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 80
  store <16 x i8> <i8 80, i8 81, i8 82, i8 83, i8 84, i8 85, i8 86, i8 87, i8 88, i8 89, i8 90, i8 91, i8 92, i8 93, i8 94, i8 95>, ptr %5, align 16, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 96
  store <16 x i8> <i8 96, i8 97, i8 98, i8 99, i8 100, i8 101, i8 102, i8 103, i8 104, i8 105, i8 106, i8 107, i8 108, i8 109, i8 110, i8 111>, ptr %6, align 16, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 112
  store <16 x i8> <i8 112, i8 113, i8 114, i8 115, i8 116, i8 117, i8 118, i8 119, i8 120, i8 121, i8 122, i8 123, i8 124, i8 125, i8 126, i8 127>, ptr %7, align 16, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 128
  store <16 x i8> <i8 -128, i8 -127, i8 -126, i8 -125, i8 -124, i8 -123, i8 -122, i8 -121, i8 -120, i8 -119, i8 -118, i8 -117, i8 -116, i8 -115, i8 -114, i8 -113>, ptr %8, align 16, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 144
  store <16 x i8> <i8 -112, i8 -111, i8 -110, i8 -109, i8 -108, i8 -107, i8 -106, i8 -105, i8 -104, i8 -103, i8 -102, i8 -101, i8 -100, i8 -99, i8 -98, i8 -97>, ptr %9, align 16, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 160
  store <16 x i8> <i8 -96, i8 -95, i8 -94, i8 -93, i8 -92, i8 -91, i8 -90, i8 -89, i8 -88, i8 -87, i8 -86, i8 -85, i8 -84, i8 -83, i8 -82, i8 -81>, ptr %10, align 16, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 176
  store <16 x i8> <i8 -80, i8 -79, i8 -78, i8 -77, i8 -76, i8 -75, i8 -74, i8 -73, i8 -72, i8 -71, i8 -70, i8 -69, i8 -68, i8 -67, i8 -66, i8 -65>, ptr %11, align 16, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 192
  store <16 x i8> <i8 -64, i8 -63, i8 -62, i8 -61, i8 -60, i8 -59, i8 -58, i8 -57, i8 -56, i8 -55, i8 -54, i8 -53, i8 -52, i8 -51, i8 -50, i8 -49>, ptr %12, align 16, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 208
  store <16 x i8> <i8 -48, i8 -47, i8 -46, i8 -45, i8 -44, i8 -43, i8 -42, i8 -41, i8 -40, i8 -39, i8 -38, i8 -37, i8 -36, i8 -35, i8 -34, i8 -33>, ptr %13, align 16, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %0, i64 224
  store <16 x i8> <i8 -32, i8 -31, i8 -30, i8 -29, i8 -28, i8 -27, i8 -26, i8 -25, i8 -24, i8 -23, i8 -22, i8 -21, i8 -20, i8 -19, i8 -18, i8 -17>, ptr %14, align 16, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 240
  store <16 x i8> <i8 -16, i8 -15, i8 -14, i8 -13, i8 -12, i8 -11, i8 -10, i8 -9, i8 -8, i8 -7, i8 -6, i8 -5, i8 -4, i8 -3, i8 -2, i8 -1>, ptr %15, align 16, !tbaa !5
  call void @compareRS(ptr noundef nonnull %0)
  call void @compareRSMQR(ptr noundef nonnull %0)
  call void @testFinish() #4
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %0) #4
  ret void
}

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

; Function Attrs: nounwind uwtable
declare hidden void @compareRS(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @compareRSMQR(ptr noundef) local_unnamed_addr #2

declare void @testFinish() local_unnamed_addr #1

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopLoadEliminationPass,LoopRotatePass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass,TailCallElimPass