; LLVM IR from specinfo-ua/UAPKI :: library/uapkic/src (dstu7564)

; 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.Dstu7564Ctx_st = type { [256 x i8], i64, [2 x i64], [128 x i8], i64, i64, i64, i64, i64, ptr }
%struct.Dstu7564Hmac = type { [128 x i8], [128 x i8], i64 }

@.str = external hidden unnamed_addr constant [18 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

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

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #2

; 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
declare hidden void @dstu7564_hmac_free(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @dstu7564_init(ptr noundef, i64 noundef) #3

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @digest(ptr noundef, ptr noundef) #5

; Function Attrs: nounwind uwtable
declare hidden void @padding(ptr noundef, i64 noundef, ptr noundef, i64 noundef) #3

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) #2

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

10:                                               ; preds = %3
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = icmp ne ptr %11, null
  br i1 %12, label %15, label %13

13:                                               ; preds = %10
  store i32 2, ptr %9, align 4, !tbaa !11
  %14 = load i32, ptr %9, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 737, i32 noundef %14, ptr noundef null)
  br label %165

15:                                               ; preds = %10
  br label %16

16:                                               ; preds = %15
  br label %17

17:                                               ; preds = %16
  br label %18

18:                                               ; preds = %17
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %23, label %21

21:                                               ; preds = %18
  store i32 2, ptr %9, align 4, !tbaa !11
  %22 = load i32, ptr %9, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 738, i32 noundef %22, ptr noundef null)
  br label %165

23:                                               ; preds = %18
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  br label %26

26:                                               ; preds = %25
  %27 = load i64, ptr %6, align 8, !tbaa !9
  %28 = icmp eq i64 %27, 32
  br i1 %28, label %37, label %29

29:                                               ; preds = %26
  %30 = load i64, ptr %6, align 8, !tbaa !9
  %31 = icmp eq i64 %30, 48
  br i1 %31, label %37, label %32

32:                                               ; preds = %29
  %33 = load i64, ptr %6, align 8, !tbaa !9
  %34 = icmp eq i64 %33, 64
  br i1 %34, label %37, label %35

35:                                               ; preds = %32
  store i32 2, ptr %9, align 4, !tbaa !11
  %36 = load i32, ptr %9, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 739, i32 noundef %36, ptr noundef null)
  br label %165

37:                                               ; preds = %32, %29, %26
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = call i64 @ba_get_len(ptr noundef %40)
  store i64 %41, ptr %7, align 8, !tbaa !9
  br label %42

42:                                               ; preds = %39
  %43 = load i64, ptr %7, align 8, !tbaa !9
  %44 = load i64, ptr %6, align 8, !tbaa !9
  %45 = icmp eq i64 %43, %44
  br i1 %45, label %48, label %46

46:                                               ; preds = %42
  store i32 2, ptr %9, align 4, !tbaa !11
  %47 = load i32, ptr %9, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 741, i32 noundef %47, ptr noundef null)
  br label %165

48:                                               ; preds = %42
  br label %49

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = load i64, ptr %6, align 8, !tbaa !9
  %54 = call i32 @dstu7564_init(ptr noundef %52, i64 noundef %53)
  store i32 %54, ptr %9, align 4, !tbaa !11
  %55 = load i32, ptr %9, align 4, !tbaa !11
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %59

57:                                               ; preds = %51
  %58 = load i32, ptr %9, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 744, i32 noundef %58)
  br label %165

59:                                               ; preds = %51
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %62, i32 0, i32 9
  %64 = load ptr, ptr %63, align 8, !tbaa !13
  call void @dstu7564_hmac_free(ptr noundef %64)
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %65, i32 0, i32 9
  store ptr null, ptr %66, align 8, !tbaa !13
  br label %67

67:                                               ; preds = %61
  %68 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 264) #7
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %69, i32 0, i32 9
  store ptr %68, ptr %70, align 8, !tbaa !13
  %71 = icmp eq ptr null, %68
  br i1 %71, label %72, label %74

72:                                               ; preds = %67
  store i32 1, ptr %9, align 4, !tbaa !11
  %73 = load i32, ptr %9, align 4, !tbaa !11
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 749, i32 noundef %73, ptr noundef null)
  br label %165

74:                                               ; preds = %67
  br label %75

75:                                               ; preds = %74
  br label %76

76:                                               ; preds = %75
  br label %77

77:                                               ; preds = %76
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %79, i32 0, i32 9
  %81 = load ptr, ptr %80, align 8, !tbaa !13
  %82 = getelementptr inbounds %struct.Dstu7564Hmac, ptr %81, i32 0, i32 0
  %83 = getelementptr inbounds [128 x i8], ptr %82, i64 0, i64 0
  %84 = load i64, ptr %7, align 8, !tbaa !9
  %85 = call i32 @ba_to_uint8(ptr noundef %78, ptr noundef %83, i64 noundef %84)
  store i32 %85, ptr %9, align 4, !tbaa !11
  %86 = load i32, ptr %9, align 4, !tbaa !11
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %90

88:                                               ; preds = %77
  %89 = load i32, ptr %9, align 4, !tbaa !11
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 751, i32 noundef %89)
  br label %165

90:                                               ; preds = %77
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  %93 = load i64, ptr %7, align 8, !tbaa !9
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %94, i32 0, i32 9
  %96 = load ptr, ptr %95, align 8, !tbaa !13
  %97 = getelementptr inbounds %struct.Dstu7564Hmac, ptr %96, i32 0, i32 2
  store i64 %93, ptr %97, align 8, !tbaa !15
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %98, i32 0, i32 9
  %100 = load ptr, ptr %99, align 8, !tbaa !13
  %101 = getelementptr inbounds %struct.Dstu7564Hmac, ptr %100, i32 0, i32 1
  %102 = getelementptr inbounds [128 x i8], ptr %101, i64 0, i64 0
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %103, i32 0, i32 4
  %105 = load i64, ptr %104, align 8, !tbaa !17
  call void @llvm.memset.p0.i64(ptr align 8 %102, i8 0, i64 %105, i1 false)
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %106, i32 0, i32 0
  %108 = getelementptr inbounds [256 x i8], ptr %107, i64 0, i64 0
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %109, i32 0, i32 4
  %111 = load i64, ptr %110, align 8, !tbaa !17
  call void @llvm.memset.p0.i64(ptr align 8 %108, i8 0, i64 %111, i1 false)
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %112

112:                                              ; preds = %133, %92
  %113 = load i64, ptr %8, align 8, !tbaa !9
  %114 = load i64, ptr %7, align 8, !tbaa !9
  %115 = icmp ult i64 %113, %114
  br i1 %115, label %116, label %136

116:                                              ; preds = %112
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %117, i32 0, i32 9
  %119 = load ptr, ptr %118, align 8, !tbaa !13
  %120 = getelementptr inbounds %struct.Dstu7564Hmac, ptr %119, i32 0, i32 0
  %121 = load i64, ptr %8, align 8, !tbaa !9
  %122 = getelementptr inbounds [128 x i8], ptr %120, i64 0, i64 %121
  %123 = load i8, ptr %122, align 1, !tbaa !18
  %124 = zext i8 %123 to i32
  %125 = xor i32 %124, -1
  %126 = trunc i32 %125 to i8
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %127, i32 0, i32 9
  %129 = load ptr, ptr %128, align 8, !tbaa !13
  %130 = getelementptr inbounds %struct.Dstu7564Hmac, ptr %129, i32 0, i32 1
  %131 = load i64, ptr %8, align 8, !tbaa !9
  %132 = getelementptr inbounds [128 x i8], ptr %130, i64 0, i64 %131
  store i8 %126, ptr %132, align 1, !tbaa !18
  br label %133

133:                                              ; preds = %116
  %134 = load i64, ptr %8, align 8, !tbaa !9
  %135 = add i64 %134, 1
  store i64 %135, ptr %8, align 8, !tbaa !9
  br label %112, !llvm.loop !19

136:                                              ; preds = %112
  %137 = load i64, ptr %7, align 8, !tbaa !9
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %138, i32 0, i32 2
  %140 = getelementptr inbounds [2 x i64], ptr %139, i64 0, i64 0
  store i64 %137, ptr %140, align 8, !tbaa !9
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %141, i32 0, i32 9
  %143 = load ptr, ptr %142, align 8, !tbaa !13
  %144 = getelementptr inbounds %struct.Dstu7564Hmac, ptr %143, i32 0, i32 0
  %145 = getelementptr inbounds [128 x i8], ptr %144, i64 0, i64 0
  %146 = load i64, ptr %7, align 8, !tbaa !9
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %147, i32 0, i32 2
  %149 = getelementptr inbounds [2 x i64], ptr %148, i64 0, i64 0
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %150, i32 0, i32 4
  %152 = load i64, ptr %151, align 8, !tbaa !17
  call void @padding(ptr noundef %145, i64 noundef %146, ptr noundef %149, i64 noundef %152)
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %153, i32 0, i32 2
  %155 = getelementptr inbounds [2 x i64], ptr %154, i64 0, i64 0
  store i64 0, ptr %155, align 8, !tbaa !9
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %157, i32 0, i32 9
  %159 = load ptr, ptr %158, align 8, !tbaa !13
  %160 = getelementptr inbounds %struct.Dstu7564Hmac, ptr %159, i32 0, i32 0
  %161 = getelementptr inbounds [128 x i8], ptr %160, i64 0, i64 0
  call void @digest(ptr noundef %156, ptr noundef %161)
  %162 = load i64, ptr %6, align 8, !tbaa !9
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.Dstu7564Ctx_st, ptr %163, i32 0, i32 5
  store i64 %162, ptr %164, align 8, !tbaa !21
  br label %165

165:                                              ; preds = %136, %88, %72, %57, %46, %35, %21, %13
  %166 = load i32, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  ret i32 %166
}

declare i64 @ba_get_len(ptr noundef) #2

declare i32 @ba_to_uint8(ptr noundef, ptr noundef, i64 noundef) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 448}
!14 = !{!"Dstu7564Ctx_st", !7, i64 0, !10, i64 256, !7, i64 264, !7, i64 280, !10, i64 408, !10, i64 416, !10, i64 424, !10, i64 432, !10, i64 440, !6, i64 448}
!15 = !{!16, !10, i64 256}
!16 = !{!"", !7, i64 0, !7, i64 128, !10, i64 256}
!17 = !{!14, !10, i64 408}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!14, !10, i64 416}


; 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 [18 x i8], align 1

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

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @dstu7564_init(ptr noundef, i64 noundef) local_unnamed_addr #2

; 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: inlinehint nounwind uwtable
declare hidden void @digest(ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @dstu7564_init_kmac(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #2 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %5

4:                                                ; preds = %3
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 737, i32 noundef 2, ptr noundef null) #5
  br label %73

5:                                                ; preds = %3
  %.not60 = icmp eq ptr %1, null
  br i1 %.not60, label %6, label %7

6:                                                ; preds = %5
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 738, i32 noundef 2, ptr noundef null) #5
  br label %73

7:                                                ; preds = %5
  switch i64 %2, label %8 [
    i64 64, label %9
    i64 48, label %9
    i64 32, label %9
  ]

8:                                                ; preds = %7
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 739, i32 noundef 2, ptr noundef null) #5
  br label %73

9:                                                ; preds = %7, %7, %7
  %10 = tail call i64 @ba_get_len(ptr noundef nonnull %1) #5
  %11 = icmp eq i64 %10, %2
  br i1 %11, label %13, label %12

12:                                               ; preds = %9
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 741, i32 noundef 2, ptr noundef null) #5
  br label %73

13:                                               ; preds = %9
  %14 = tail call i32 @dstu7564_init(ptr noundef nonnull %0, i64 noundef %2)
  %.not61 = icmp eq i32 %14, 0
  br i1 %.not61, label %16, label %15

15:                                               ; preds = %13
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 744, i32 noundef %14) #5
  br label %73

16:                                               ; preds = %13
  %17 = getelementptr inbounds i8, ptr %0, i64 448
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  tail call void @dstu7564_hmac_free(ptr noundef %18)
  %19 = tail call noalias dereferenceable_or_null(264) ptr @calloc(i64 noundef 1, i64 noundef 264) #6
  store ptr %19, ptr %17, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %16
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 749, i32 noundef 1, ptr noundef null) #5
  br label %73

22:                                               ; preds = %16
  %23 = tail call i32 @ba_to_uint8(ptr noundef nonnull %1, ptr noundef nonnull %19, i64 noundef %2) #5
  %.not62 = icmp eq i32 %23, 0
  br i1 %.not62, label %.lr.ph.preheader, label %24

24:                                               ; preds = %22
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 751, i32 noundef %23) #5
  br label %73

.lr.ph.preheader:                                 ; preds = %22
  %25 = load ptr, ptr %17, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 256
  store i64 %2, ptr %26, align 8, !tbaa !11
  %27 = getelementptr inbounds i8, ptr %25, i64 128
  %28 = getelementptr inbounds i8, ptr %0, i64 408
  %29 = load i64, ptr %28, align 8, !tbaa !13
  tail call void @llvm.memset.p0.i64(ptr nonnull align 8 %27, i8 0, i64 %29, i1 false)
  %30 = load i64, ptr %28, align 8, !tbaa !13
  tail call void @llvm.memset.p0.i64(ptr nonnull align 8 %0, i8 0, i64 %30, i1 false)
  %31 = add i64 %2, -1
  %xtraiter = and i64 %2, 3
  %32 = icmp ult i64 %31, 3
  br i1 %32, label %._crit_edge.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %2, -4
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.05263 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %60, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %33 = load ptr, ptr %17, align 8, !tbaa !5
  %34 = getelementptr inbounds [128 x i8], ptr %33, i64 0, i64 %.05263
  %35 = load i8, ptr %34, align 1, !tbaa !14
  %36 = xor i8 %35, -1
  %37 = getelementptr inbounds i8, ptr %33, i64 128
  %38 = getelementptr inbounds [128 x i8], ptr %37, i64 0, i64 %.05263
  store i8 %36, ptr %38, align 1, !tbaa !14
  %39 = or disjoint i64 %.05263, 1
  %40 = load ptr, ptr %17, align 8, !tbaa !5
  %41 = getelementptr inbounds [128 x i8], ptr %40, i64 0, i64 %39
  %42 = load i8, ptr %41, align 1, !tbaa !14
  %43 = xor i8 %42, -1
  %44 = getelementptr inbounds i8, ptr %40, i64 128
  %45 = getelementptr inbounds [128 x i8], ptr %44, i64 0, i64 %39
  store i8 %43, ptr %45, align 1, !tbaa !14
  %46 = or disjoint i64 %.05263, 2
  %47 = load ptr, ptr %17, align 8, !tbaa !5
  %48 = getelementptr inbounds [128 x i8], ptr %47, i64 0, i64 %46
  %49 = load i8, ptr %48, align 1, !tbaa !14
  %50 = xor i8 %49, -1
  %51 = getelementptr inbounds i8, ptr %47, i64 128
  %52 = getelementptr inbounds [128 x i8], ptr %51, i64 0, i64 %46
  store i8 %50, ptr %52, align 1, !tbaa !14
  %53 = or disjoint i64 %.05263, 3
  %54 = load ptr, ptr %17, align 8, !tbaa !5
  %55 = getelementptr inbounds [128 x i8], ptr %54, i64 0, i64 %53
  %56 = load i8, ptr %55, align 1, !tbaa !14
  %57 = xor i8 %56, -1
  %58 = getelementptr inbounds i8, ptr %54, i64 128
  %59 = getelementptr inbounds [128 x i8], ptr %58, i64 0, i64 %53
  store i8 %57, ptr %59, align 1, !tbaa !14
  %60 = add nuw i64 %.05263, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.unr-lcssa, label %.lr.ph, !llvm.loop !15

._crit_edge.unr-lcssa:                            ; preds = %.lr.ph, %.lr.ph.preheader
  %.05263.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %60, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.unr-lcssa, %.lr.ph.epil
  %.05263.epil = phi i64 [ %67, %.lr.ph.epil ], [ %.05263.unr, %._crit_edge.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %._crit_edge.unr-lcssa ]
  %61 = load ptr, ptr %17, align 8, !tbaa !5
  %62 = getelementptr inbounds [128 x i8], ptr %61, i64 0, i64 %.05263.epil
  %63 = load i8, ptr %62, align 1, !tbaa !14
  %64 = xor i8 %63, -1
  %65 = getelementptr inbounds i8, ptr %61, i64 128
  %66 = getelementptr inbounds [128 x i8], ptr %65, i64 0, i64 %.05263.epil
  store i8 %64, ptr %66, align 1, !tbaa !14
  %67 = add nuw i64 %.05263.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph.epil, !llvm.loop !17

._crit_edge:                                      ; preds = %.lr.ph.epil, %._crit_edge.unr-lcssa
  %68 = getelementptr inbounds i8, ptr %0, i64 264
  store i64 %2, ptr %68, align 8, !tbaa !19
  %69 = load ptr, ptr %17, align 8, !tbaa !5
  %70 = load i64, ptr %28, align 8, !tbaa !13
  tail call void @padding(ptr noundef %69, i64 noundef %2, ptr noundef nonnull %68, i64 noundef %70)
  store i64 0, ptr %68, align 8, !tbaa !19
  %71 = load ptr, ptr %17, align 8, !tbaa !5
  tail call void @digest(ptr noundef nonnull %0, ptr noundef %71)
  %72 = getelementptr inbounds i8, ptr %0, i64 416
  store i64 %2, ptr %72, align 8, !tbaa !20
  br label %73

73:                                               ; preds = %._crit_edge, %24, %21, %15, %12, %8, %6, %4
  %.0 = phi i32 [ %14, %15 ], [ 1, %21 ], [ %23, %24 ], [ 0, %._crit_edge ], [ 2, %12 ], [ 2, %8 ], [ 2, %6 ], [ 2, %4 ]
  ret i32 %.0
}

declare i64 @ba_get_len(ptr noundef) local_unnamed_addr #1

declare i32 @ba_to_uint8(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { inlinehint 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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0,1) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 448}
!6 = !{!"Dstu7564Ctx_st", !7, i64 0, !9, i64 256, !7, i64 264, !7, i64 280, !9, i64 408, !9, i64 416, !9, i64 424, !9, i64 432, !9, i64 440, !10, i64 448}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"long", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !9, i64 256}
!12 = !{!"", !7, i64 0, !7, i64 128, !9, i64 256}
!13 = !{!6, !9, i64 408}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.unroll.disable"}
!19 = !{!9, !9, i64 0}
!20 = !{!6, !9, i64 416}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass