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

; 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.RipemdCtx_st = type { [16 x i32], [64 x i8], i64, i64, i64, ptr }

@.str = external hidden unnamed_addr constant [16 x i8], align 1

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

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

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

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

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

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

10:                                               ; preds = %2
  %11 = load ptr, ptr %3, 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 !9
  %14 = load i32, ptr %9, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 408, i32 noundef %14, ptr noundef null)
  br label %197

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 %4, 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 !9
  %22 = load i32, ptr %9, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 409, i32 noundef %22, ptr noundef null)
  br label %197

23:                                               ; preds = %18
  br label %24

24:                                               ; preds = %23
  br label %25

25:                                               ; preds = %24
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.RipemdCtx_st, ptr %26, i32 0, i32 1
  %28 = getelementptr inbounds [64 x i8], ptr %27, i64 0, i64 0
  store ptr %28, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds [16 x i32], ptr %5, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %29, i8 0, i64 64, i1 false)
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %30

30:                                               ; preds = %51, %25
  %31 = load i64, ptr %8, align 8, !tbaa !11
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.RipemdCtx_st, ptr %32, i32 0, i32 2
  %34 = load i64, ptr %33, align 8, !tbaa !13
  %35 = icmp ult i64 %31, %34
  br i1 %35, label %36, label %54

36:                                               ; preds = %30
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %37, i32 1
  store ptr %38, ptr %6, align 8, !tbaa !5
  %39 = load i8, ptr %37, align 1, !tbaa !15
  %40 = zext i8 %39 to i32
  %41 = load i64, ptr %8, align 8, !tbaa !11
  %42 = and i64 %41, 3
  %43 = mul i64 8, %42
  %44 = trunc i64 %43 to i32
  %45 = shl i32 %40, %44
  %46 = load i64, ptr %8, align 8, !tbaa !11
  %47 = lshr i64 %46, 2
  %48 = getelementptr inbounds [16 x i32], ptr %5, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = xor i32 %49, %45
  store i32 %50, ptr %48, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %36
  %52 = load i64, ptr %8, align 8, !tbaa !11
  %53 = add i64 %52, 1
  store i64 %53, ptr %8, align 8, !tbaa !11
  br label %30, !llvm.loop !16

54:                                               ; preds = %30
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.RipemdCtx_st, ptr %55, i32 0, i32 4
  %57 = load i64, ptr %56, align 8, !tbaa !18
  %58 = and i64 %57, 3
  %59 = mul i64 8, %58
  %60 = add i64 %59, 7
  %61 = trunc i64 %60 to i32
  %62 = shl i32 1, %61
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.RipemdCtx_st, ptr %63, i32 0, i32 4
  %65 = load i64, ptr %64, align 8, !tbaa !18
  %66 = lshr i64 %65, 2
  %67 = and i64 %66, 15
  %68 = getelementptr inbounds [16 x i32], ptr %5, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = xor i32 %69, %62
  store i32 %70, ptr %68, align 4, !tbaa !9
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.RipemdCtx_st, ptr %71, i32 0, i32 2
  %73 = load i64, ptr %72, align 8, !tbaa !13
  %74 = icmp ugt i64 %73, 55
  br i1 %74, label %75, label %84

75:                                               ; preds = %54
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.RipemdCtx_st, ptr %76, i32 0, i32 5
  %78 = load ptr, ptr %77, align 8, !tbaa !19
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.RipemdCtx_st, ptr %79, i32 0, i32 0
  %81 = getelementptr inbounds [16 x i32], ptr %80, i64 0, i64 0
  %82 = getelementptr inbounds [16 x i32], ptr %5, i64 0, i64 0
  call void %78(ptr noundef %81, ptr noundef %82)
  %83 = getelementptr inbounds [16 x i32], ptr %5, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %83, i8 0, i64 64, i1 false)
  br label %84

84:                                               ; preds = %75, %54
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.RipemdCtx_st, ptr %85, i32 0, i32 4
  %87 = load i64, ptr %86, align 8, !tbaa !18
  %88 = shl i64 %87, 3
  %89 = trunc i64 %88 to i32
  %90 = getelementptr inbounds [16 x i32], ptr %5, i64 0, i64 14
  store i32 %89, ptr %90, align 8, !tbaa !9
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.RipemdCtx_st, ptr %91, i32 0, i32 4
  %93 = load i64, ptr %92, align 8, !tbaa !18
  %94 = lshr i64 %93, 29
  %95 = trunc i64 %94 to i32
  %96 = getelementptr inbounds [16 x i32], ptr %5, i64 0, i64 15
  store i32 %95, ptr %96, align 4, !tbaa !9
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.RipemdCtx_st, ptr %97, i32 0, i32 5
  %99 = load ptr, ptr %98, align 8, !tbaa !19
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.RipemdCtx_st, ptr %100, i32 0, i32 0
  %102 = getelementptr inbounds [16 x i32], ptr %101, i64 0, i64 0
  %103 = getelementptr inbounds [16 x i32], ptr %5, i64 0, i64 0
  call void %99(ptr noundef %102, ptr noundef %103)
  br label %104

104:                                              ; preds = %84
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.RipemdCtx_st, ptr %105, i32 0, i32 3
  %107 = load i64, ptr %106, align 8, !tbaa !20
  %108 = lshr i64 %107, 3
  %109 = call noalias ptr @malloc(i64 noundef %108) #8
  store ptr %109, ptr %7, align 8, !tbaa !5
  %110 = icmp eq ptr null, %109
  br i1 %110, label %111, label %113

111:                                              ; preds = %104
  store i32 1, ptr %9, align 4, !tbaa !9
  %112 = load i32, ptr %9, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 435, i32 noundef %112, ptr noundef null)
  br label %197

113:                                              ; preds = %104
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %116

116:                                              ; preds = %170, %115
  %117 = load i64, ptr %8, align 8, !tbaa !11
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.RipemdCtx_st, ptr %118, i32 0, i32 3
  %120 = load i64, ptr %119, align 8, !tbaa !20
  %121 = udiv i64 %120, 8
  %122 = icmp ult i64 %117, %121
  br i1 %122, label %123, label %173

123:                                              ; preds = %116
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.RipemdCtx_st, ptr %124, i32 0, i32 0
  %126 = load i64, ptr %8, align 8, !tbaa !11
  %127 = lshr i64 %126, 2
  %128 = getelementptr inbounds [16 x i32], ptr %125, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !9
  %130 = trunc i32 %129 to i8
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = load i64, ptr %8, align 8, !tbaa !11
  %133 = getelementptr inbounds i8, ptr %131, i64 %132
  store i8 %130, ptr %133, align 1, !tbaa !15
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.RipemdCtx_st, ptr %134, i32 0, i32 0
  %136 = load i64, ptr %8, align 8, !tbaa !11
  %137 = lshr i64 %136, 2
  %138 = getelementptr inbounds [16 x i32], ptr %135, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !9
  %140 = lshr i32 %139, 8
  %141 = trunc i32 %140 to i8
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = load i64, ptr %8, align 8, !tbaa !11
  %144 = add i64 %143, 1
  %145 = getelementptr inbounds i8, ptr %142, i64 %144
  store i8 %141, ptr %145, align 1, !tbaa !15
  %146 = load ptr, ptr %3, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.RipemdCtx_st, ptr %146, i32 0, i32 0
  %148 = load i64, ptr %8, align 8, !tbaa !11
  %149 = lshr i64 %148, 2
  %150 = getelementptr inbounds [16 x i32], ptr %147, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !9
  %152 = lshr i32 %151, 16
  %153 = trunc i32 %152 to i8
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = load i64, ptr %8, align 8, !tbaa !11
  %156 = add i64 %155, 2
  %157 = getelementptr inbounds i8, ptr %154, i64 %156
  store i8 %153, ptr %157, align 1, !tbaa !15
  %158 = load ptr, ptr %3, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.RipemdCtx_st, ptr %158, i32 0, i32 0
  %160 = load i64, ptr %8, align 8, !tbaa !11
  %161 = lshr i64 %160, 2
  %162 = getelementptr inbounds [16 x i32], ptr %159, i64 0, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !9
  %164 = lshr i32 %163, 24
  %165 = trunc i32 %164 to i8
  %166 = load ptr, ptr %7, align 8, !tbaa !5
  %167 = load i64, ptr %8, align 8, !tbaa !11
  %168 = add i64 %167, 3
  %169 = getelementptr inbounds i8, ptr %166, i64 %168
  store i8 %165, ptr %169, align 1, !tbaa !15
  br label %170

170:                                              ; preds = %123
  %171 = load i64, ptr %8, align 8, !tbaa !11
  %172 = add i64 %171, 4
  store i64 %172, ptr %8, align 8, !tbaa !11
  br label %116, !llvm.loop !21

173:                                              ; preds = %116
  br label %174

174:                                              ; preds = %173
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = load ptr, ptr %3, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.RipemdCtx_st, ptr %176, i32 0, i32 3
  %178 = load i64, ptr %177, align 8, !tbaa !20
  %179 = udiv i64 %178, 8
  %180 = call ptr @ba_alloc_from_uint8(ptr noundef %175, i64 noundef %179)
  %181 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %180, ptr %181, align 8, !tbaa !5
  %182 = icmp eq ptr null, %180
  br i1 %182, label %183, label %185

183:                                              ; preds = %174
  store i32 2, ptr %9, align 4, !tbaa !9
  %184 = load i32, ptr %9, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 443, i32 noundef %184)
  br label %197

185:                                              ; preds = %174
  br label %186

186:                                              ; preds = %185
  br label %187

187:                                              ; preds = %186
  %188 = load ptr, ptr %3, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.RipemdCtx_st, ptr %188, i32 0, i32 3
  %190 = load i64, ptr %189, align 8, !tbaa !20
  %191 = icmp eq i64 %190, 160
  br i1 %191, label %192, label %194

192:                                              ; preds = %187
  %193 = load ptr, ptr %3, align 8, !tbaa !5
  call void @ripemd_init160(ptr noundef %193)
  br label %196

194:                                              ; preds = %187
  %195 = load ptr, ptr %3, align 8, !tbaa !5
  call void @ripemd_init128(ptr noundef %195)
  br label %196

196:                                              ; preds = %194, %192
  br label %197

197:                                              ; preds = %196, %183, %111, %21, %13
  %198 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %198) #7
  %199 = load i32, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %5) #7
  ret i32 %199
}

; 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: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #5

declare ptr @ba_alloc_from_uint8(ptr noundef, i64 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @ripemd_init160(ptr noundef) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @ripemd_init128(ptr noundef) #6

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 128}
!14 = !{!"RipemdCtx_st", !7, i64 0, !7, i64 64, !12, i64 128, !12, i64 136, !12, i64 144, !6, i64 152}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!14, !12, i64 144}
!19 = !{!14, !6, i64 152}
!20 = !{!14, !12, i64 136}
!21 = distinct !{!21, !17}


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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 3) i32 @ripemd_final(ptr noundef %0, ptr noundef writeonly %1) local_unnamed_addr #3 {
  %3 = alloca [16 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #7
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %5

4:                                                ; preds = %2
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 408, i32 noundef 2, ptr noundef null) #7
  br label %98

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

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

7:                                                ; preds = %5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %3, i8 0, i64 64, i1 false)
  %8 = getelementptr inbounds i8, ptr %0, i64 128
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %.not64 = icmp eq i64 %9, 0
  br i1 %.not64, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %7
  %10 = getelementptr inbounds i8, ptr %0, i64 64
  %xtraiter = and i64 %9, 1
  %11 = icmp eq i64 %9, 1
  br i1 %11, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

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

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.04960 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %33, %.lr.ph ]
  %.05159 = phi ptr [ %10, %.lr.ph.preheader.new ], [ %22, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %12 = getelementptr inbounds i8, ptr %.05159, i64 1
  %13 = load i8, ptr %.05159, align 1, !tbaa !11
  %14 = zext i8 %13 to i32
  %.049.tr = trunc i64 %.04960 to i32
  %15 = shl i32 %.049.tr, 3
  %16 = and i32 %15, 16
  %17 = shl nuw nsw i32 %14, %16
  %18 = lshr i64 %.04960, 2
  %19 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !12
  %21 = xor i32 %17, %20
  store i32 %21, ptr %19, align 4, !tbaa !12
  %22 = getelementptr inbounds i8, ptr %.05159, i64 2
  %23 = load i8, ptr %12, align 1, !tbaa !11
  %24 = zext i8 %23 to i32
  %25 = trunc i64 %.04960 to i32
  %.049.tr.1 = shl i32 %25, 3
  %26 = and i32 %.049.tr.1, 16
  %27 = or disjoint i32 %26, 8
  %28 = shl nuw i32 %24, %27
  %29 = lshr i64 %.04960, 2
  %30 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !12
  %32 = xor i32 %28, %31
  store i32 %32, ptr %30, align 4, !tbaa !12
  %33 = add nuw i64 %.04960, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !14

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %.04960.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %33, %.lr.ph ]
  %.05159.unr = phi ptr [ %10, %.lr.ph.preheader ], [ %22, %.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.loopexit.unr-lcssa
  %34 = load i8, ptr %.05159.unr, align 1, !tbaa !11
  %35 = zext i8 %34 to i32
  %.049.tr.epil = trunc i64 %.04960.unr to i32
  %36 = shl i32 %.049.tr.epil, 3
  %37 = and i32 %36, 24
  %38 = shl nuw i32 %35, %37
  %39 = lshr i64 %.04960.unr, 2
  %40 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !12
  %42 = xor i32 %38, %41
  store i32 %42, ptr %40, align 4, !tbaa !12
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.epil, %._crit_edge.loopexit.unr-lcssa, %7
  %43 = getelementptr inbounds i8, ptr %0, i64 144
  %44 = load i64, ptr %43, align 8, !tbaa !16
  %.tr = trunc i64 %44 to i32
  %45 = shl i32 %.tr, 3
  %46 = and i32 %45, 24
  %47 = shl nuw i32 128, %46
  %48 = lshr i64 %44, 2
  %49 = and i64 %48, 15
  %50 = getelementptr inbounds [16 x i32], ptr %3, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !12
  %52 = xor i32 %47, %51
  store i32 %52, ptr %50, align 4, !tbaa !12
  %53 = icmp ugt i64 %9, 55
  br i1 %53, label %54, label %57

54:                                               ; preds = %._crit_edge
  %55 = getelementptr inbounds i8, ptr %0, i64 152
  %56 = load ptr, ptr %55, align 8, !tbaa !17
  call void %56(ptr noundef nonnull %0, ptr noundef nonnull %3) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %3, i8 0, i64 64, i1 false)
  %.pre = load i64, ptr %43, align 8, !tbaa !16
  %.pre66 = trunc i64 %.pre to i32
  %.pre67 = shl i32 %.pre66, 3
  br label %57

57:                                               ; preds = %54, %._crit_edge
  %.pre-phi = phi i32 [ %.pre67, %54 ], [ %45, %._crit_edge ]
  %58 = phi i64 [ %.pre, %54 ], [ %44, %._crit_edge ]
  %59 = getelementptr inbounds i8, ptr %3, i64 56
  store i32 %.pre-phi, ptr %59, align 8, !tbaa !12
  %60 = lshr i64 %58, 29
  %61 = trunc i64 %60 to i32
  %62 = getelementptr inbounds i8, ptr %3, i64 60
  store i32 %61, ptr %62, align 4, !tbaa !12
  %63 = getelementptr inbounds i8, ptr %0, i64 152
  %64 = load ptr, ptr %63, align 8, !tbaa !17
  call void %64(ptr noundef nonnull %0, ptr noundef nonnull %3) #7
  %65 = getelementptr inbounds i8, ptr %0, i64 136
  %66 = load i64, ptr %65, align 8, !tbaa !18
  %67 = lshr i64 %66, 3
  %68 = call noalias ptr @malloc(i64 noundef %67) #8
  %69 = icmp eq ptr %68, null
  br i1 %69, label %70, label %.preheader

.preheader:                                       ; preds = %57
  %.not65 = icmp ult i64 %66, 8
  br i1 %.not65, label %._crit_edge63, label %.lr.ph62

70:                                               ; preds = %57
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 435, i32 noundef 1, ptr noundef null) #7
  br label %98

.lr.ph62:                                         ; preds = %.preheader, %.lr.ph62
  %.161 = phi i64 [ %88, %.lr.ph62 ], [ 0, %.preheader ]
  %71 = lshr exact i64 %.161, 2
  %72 = getelementptr inbounds [16 x i32], ptr %0, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !12
  %74 = trunc i32 %73 to i8
  %75 = getelementptr inbounds i8, ptr %68, i64 %.161
  store i8 %74, ptr %75, align 1, !tbaa !11
  %76 = lshr i32 %73, 8
  %77 = trunc i32 %76 to i8
  %78 = or disjoint i64 %.161, 1
  %79 = getelementptr inbounds i8, ptr %68, i64 %78
  store i8 %77, ptr %79, align 1, !tbaa !11
  %80 = lshr i32 %73, 16
  %81 = trunc i32 %80 to i8
  %82 = or disjoint i64 %.161, 2
  %83 = getelementptr inbounds i8, ptr %68, i64 %82
  store i8 %81, ptr %83, align 1, !tbaa !11
  %84 = lshr i32 %73, 24
  %85 = trunc nuw i32 %84 to i8
  %86 = or disjoint i64 %.161, 3
  %87 = getelementptr inbounds i8, ptr %68, i64 %86
  store i8 %85, ptr %87, align 1, !tbaa !11
  %88 = add nuw nsw i64 %.161, 4
  %89 = icmp ult i64 %88, %67
  br i1 %89, label %.lr.ph62, label %._crit_edge63, !llvm.loop !19

._crit_edge63:                                    ; preds = %.lr.ph62, %.preheader
  %90 = call ptr @ba_alloc_from_uint8(ptr noundef nonnull %68, i64 noundef %67) #7
  store ptr %90, ptr %1, align 8, !tbaa !20
  %91 = icmp eq ptr %90, null
  br i1 %91, label %92, label %93

92:                                               ; preds = %._crit_edge63
  call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 443, i32 noundef 2) #7
  br label %98

93:                                               ; preds = %._crit_edge63
  %94 = load i64, ptr %65, align 8, !tbaa !18
  %95 = icmp eq i64 %94, 160
  br i1 %95, label %96, label %97

96:                                               ; preds = %93
  call void @ripemd_init160(ptr noundef nonnull %0)
  br label %98

97:                                               ; preds = %93
  call void @ripemd_init128(ptr noundef nonnull %0)
  br label %98

98:                                               ; preds = %96, %97, %92, %70, %6, %4
  %.050 = phi ptr [ null, %70 ], [ %68, %92 ], [ %68, %96 ], [ %68, %97 ], [ null, %6 ], [ null, %4 ]
  %.0 = phi i32 [ 1, %70 ], [ 2, %92 ], [ 0, %96 ], [ 0, %97 ], [ 2, %6 ], [ 2, %4 ]
  call void @free(ptr noundef %.050) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #7
  ret i32 %.0
}

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

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

declare ptr @ba_alloc_from_uint8(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @ripemd_init160(ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @ripemd_init128(ptr noundef) local_unnamed_addr #6

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }

!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, !9, i64 128}
!6 = !{!"RipemdCtx_st", !7, i64 0, !7, i64 64, !9, i64 128, !9, i64 136, !9, i64 144, !10, i64 152}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"long", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!6, !9, i64 144}
!17 = !{!6, !10, i64 152}
!18 = !{!6, !9, i64 136}
!19 = distinct !{!19, !15}
!20 = !{!10, !10, i64 0}


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