; LLVM IR from trustwallet/wallet-core :: trezor-crypto/crypto (shamir)

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

@__const.shamir_interpolate.num = external hidden unnamed_addr constant [8 x i32], align 16

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @shamir_interpolate(ptr noundef %0, i8 noundef zeroext %1, ptr noundef %2, ptr noundef %3, i8 noundef zeroext %4, i64 noundef %5) #0 {
  %7 = alloca i1, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca [8 x i32], align 16
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca [8 x i32], align 16
  %21 = alloca [8 x i32], align 16
  %22 = alloca [8 x i32], align 16
  %23 = alloca [8 x i32], align 16
  %24 = alloca i8, align 1
  %25 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i8 %1, ptr %9, align 1, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store i8 %4, ptr %12, align 1, !tbaa !9
  store i64 %5, ptr %13, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #6
  call void @llvm.memset.p0.i64(ptr align 16 %16, i8 0, i64 32, i1 false)
  %26 = load i8, ptr %12, align 1, !tbaa !9
  %27 = zext i8 %26 to i64
  %28 = call ptr @llvm.stacksave.p0()
  store ptr %28, ptr %17, align 8
  %29 = alloca [8 x i32], i64 %27, align 16
  store i64 %27, ptr %18, align 8
  %30 = mul nuw i64 32, %27
  call void @llvm.memset.p0.i64(ptr align 16 %29, i8 0, i64 %30, i1 false)
  %31 = load i8, ptr %12, align 1, !tbaa !9
  %32 = zext i8 %31 to i64
  %33 = alloca [8 x i32], i64 %32, align 16
  store i64 %32, ptr %19, align 8
  %34 = mul nuw i64 32, %32
  call void @llvm.memset.p0.i64(ptr align 16 %33, i8 0, i64 %34, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %20, ptr align 16 @__const.shamir_interpolate.num, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #6
  call void @llvm.memset.p0.i64(ptr align 16 %21, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #6
  call void @llvm.memset.p0.i64(ptr align 16 %22, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %23) #6
  call void @llvm.memset.p0.i64(ptr align 16 %23, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #6
  store i8 1, ptr %24, align 1, !tbaa !12
  %35 = load i64, ptr %13, align 8, !tbaa !10
  %36 = icmp ugt i64 %35, 32
  br i1 %36, label %37, label %38

37:                                               ; preds = %6
  store i1 false, ptr %7, align 1
  store i32 1, ptr %25, align 4
  br label %199

38:                                               ; preds = %6
  store i64 0, ptr %14, align 8, !tbaa !10
  br label %39

39:                                               ; preds = %60, %38
  %40 = load i64, ptr %14, align 8, !tbaa !10
  %41 = load i8, ptr %12, align 1, !tbaa !9
  %42 = zext i8 %41 to i64
  %43 = icmp ult i64 %40, %42
  br i1 %43, label %44, label %63

44:                                               ; preds = %39
  %45 = load i64, ptr %14, align 8, !tbaa !10
  %46 = getelementptr inbounds [8 x i32], ptr %29, i64 %45
  %47 = getelementptr inbounds [8 x i32], ptr %46, i64 0, i64 0
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = load i64, ptr %14, align 8, !tbaa !10
  %50 = getelementptr inbounds i8, ptr %48, i64 %49
  %51 = load i8, ptr %50, align 1, !tbaa !9
  call void @bitslice_setall(ptr noundef %47, i8 noundef zeroext %51)
  %52 = load i64, ptr %14, align 8, !tbaa !10
  %53 = getelementptr inbounds [8 x i32], ptr %33, i64 %52
  %54 = getelementptr inbounds [8 x i32], ptr %53, i64 0, i64 0
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = load i64, ptr %14, align 8, !tbaa !10
  %57 = getelementptr inbounds ptr, ptr %55, i64 %56
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = load i64, ptr %13, align 8, !tbaa !10
  call void @bitslice(ptr noundef %54, ptr noundef %58, i64 noundef %59)
  br label %60

60:                                               ; preds = %44
  %61 = load i64, ptr %14, align 8, !tbaa !10
  %62 = add i64 %61, 1
  store i64 %62, ptr %14, align 8, !tbaa !10
  br label %39, !llvm.loop !14

63:                                               ; preds = %39
  %64 = getelementptr inbounds [8 x i32], ptr %16, i64 0, i64 0
  %65 = load i8, ptr %9, align 1, !tbaa !9
  call void @bitslice_setall(ptr noundef %64, i8 noundef zeroext %65)
  store i64 0, ptr %14, align 8, !tbaa !10
  br label %66

66:                                               ; preds = %81, %63
  %67 = load i64, ptr %14, align 8, !tbaa !10
  %68 = load i8, ptr %12, align 1, !tbaa !9
  %69 = zext i8 %68 to i64
  %70 = icmp ult i64 %67, %69
  br i1 %70, label %71, label %84

71:                                               ; preds = %66
  %72 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 0
  %73 = getelementptr inbounds [8 x i32], ptr %16, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %72, ptr align 16 %73, i64 32, i1 false)
  %74 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 0
  %75 = load i64, ptr %14, align 8, !tbaa !10
  %76 = getelementptr inbounds [8 x i32], ptr %29, i64 %75
  %77 = getelementptr inbounds [8 x i32], ptr %76, i64 0, i64 0
  call void @gf256_add(ptr noundef %74, ptr noundef %77)
  %78 = getelementptr inbounds [8 x i32], ptr %20, i64 0, i64 0
  %79 = getelementptr inbounds [8 x i32], ptr %20, i64 0, i64 0
  %80 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 0
  call void @gf256_mul(ptr noundef %78, ptr noundef %79, ptr noundef %80)
  br label %81

81:                                               ; preds = %71
  %82 = load i64, ptr %14, align 8, !tbaa !10
  %83 = add i64 %82, 1
  store i64 %83, ptr %14, align 8, !tbaa !10
  br label %66, !llvm.loop !16

84:                                               ; preds = %66
  store i64 0, ptr %14, align 8, !tbaa !10
  br label %85

85:                                               ; preds = %177, %84
  %86 = load i64, ptr %14, align 8, !tbaa !10
  %87 = load i8, ptr %12, align 1, !tbaa !9
  %88 = zext i8 %87 to i64
  %89 = icmp ult i64 %86, %88
  br i1 %89, label %90, label %180

90:                                               ; preds = %85
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = load i64, ptr %14, align 8, !tbaa !10
  %93 = getelementptr inbounds i8, ptr %91, i64 %92
  %94 = load i8, ptr %93, align 1, !tbaa !9
  %95 = zext i8 %94 to i32
  %96 = load i8, ptr %9, align 1, !tbaa !9
  %97 = zext i8 %96 to i32
  %98 = icmp ne i32 %95, %97
  br i1 %98, label %99, label %106

99:                                               ; preds = %90
  %100 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 0
  %101 = getelementptr inbounds [8 x i32], ptr %16, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %100, ptr align 16 %101, i64 32, i1 false)
  %102 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 0
  %103 = load i64, ptr %14, align 8, !tbaa !10
  %104 = getelementptr inbounds [8 x i32], ptr %29, i64 %103
  %105 = getelementptr inbounds [8 x i32], ptr %104, i64 0, i64 0
  call void @gf256_add(ptr noundef %102, ptr noundef %105)
  br label %112

106:                                              ; preds = %90
  %107 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 0
  call void @bitslice_setall(ptr noundef %107, i8 noundef zeroext 1)
  %108 = getelementptr inbounds [8 x i32], ptr %23, i64 0, i64 0
  %109 = load i64, ptr %14, align 8, !tbaa !10
  %110 = getelementptr inbounds [8 x i32], ptr %33, i64 %109
  %111 = getelementptr inbounds [8 x i32], ptr %110, i64 0, i64 0
  call void @gf256_add(ptr noundef %108, ptr noundef %111)
  br label %112

112:                                              ; preds = %106, %99
  store i64 0, ptr %15, align 8, !tbaa !10
  br label %113

113:                                              ; preds = %135, %112
  %114 = load i64, ptr %15, align 8, !tbaa !10
  %115 = load i8, ptr %12, align 1, !tbaa !9
  %116 = zext i8 %115 to i64
  %117 = icmp ult i64 %114, %116
  br i1 %117, label %118, label %138

118:                                              ; preds = %113
  %119 = load i64, ptr %14, align 8, !tbaa !10
  %120 = load i64, ptr %15, align 8, !tbaa !10
  %121 = icmp eq i64 %119, %120
  br i1 %121, label %122, label %123

122:                                              ; preds = %118
  br label %135

123:                                              ; preds = %118
  %124 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 0
  %125 = load i64, ptr %14, align 8, !tbaa !10
  %126 = getelementptr inbounds [8 x i32], ptr %29, i64 %125
  %127 = getelementptr inbounds [8 x i32], ptr %126, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %124, ptr align 16 %127, i64 32, i1 false)
  %128 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 0
  %129 = load i64, ptr %15, align 8, !tbaa !10
  %130 = getelementptr inbounds [8 x i32], ptr %29, i64 %129
  %131 = getelementptr inbounds [8 x i32], ptr %130, i64 0, i64 0
  call void @gf256_add(ptr noundef %128, ptr noundef %131)
  %132 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 0
  %133 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 0
  %134 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 0
  call void @gf256_mul(ptr noundef %132, ptr noundef %133, ptr noundef %134)
  br label %135

135:                                              ; preds = %123, %122
  %136 = load i64, ptr %15, align 8, !tbaa !10
  %137 = add i64 %136, 1
  store i64 %137, ptr %15, align 8, !tbaa !10
  br label %113, !llvm.loop !17

138:                                              ; preds = %113
  %139 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 0
  %140 = load i32, ptr %139, align 16, !tbaa !18
  %141 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 1
  %142 = load i32, ptr %141, align 4, !tbaa !18
  %143 = or i32 %140, %142
  %144 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 2
  %145 = load i32, ptr %144, align 8, !tbaa !18
  %146 = or i32 %143, %145
  %147 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 3
  %148 = load i32, ptr %147, align 4, !tbaa !18
  %149 = or i32 %146, %148
  %150 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 4
  %151 = load i32, ptr %150, align 16, !tbaa !18
  %152 = or i32 %149, %151
  %153 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 5
  %154 = load i32, ptr %153, align 4, !tbaa !18
  %155 = or i32 %152, %154
  %156 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 6
  %157 = load i32, ptr %156, align 8, !tbaa !18
  %158 = or i32 %155, %157
  %159 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 7
  %160 = load i32, ptr %159, align 4, !tbaa !18
  %161 = or i32 %158, %160
  %162 = icmp eq i32 %161, 0
  br i1 %162, label %163, label %164

163:                                              ; preds = %138
  store i8 0, ptr %24, align 1, !tbaa !12
  br label %180

164:                                              ; preds = %138
  %165 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 0
  %166 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 0
  call void @gf256_inv(ptr noundef %165, ptr noundef %166)
  %167 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 0
  %168 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 0
  %169 = getelementptr inbounds [8 x i32], ptr %20, i64 0, i64 0
  call void @gf256_mul(ptr noundef %167, ptr noundef %168, ptr noundef %169)
  %170 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 0
  %171 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 0
  %172 = load i64, ptr %14, align 8, !tbaa !10
  %173 = getelementptr inbounds [8 x i32], ptr %33, i64 %172
  %174 = getelementptr inbounds [8 x i32], ptr %173, i64 0, i64 0
  call void @gf256_mul(ptr noundef %170, ptr noundef %171, ptr noundef %174)
  %175 = getelementptr inbounds [8 x i32], ptr %23, i64 0, i64 0
  %176 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 0
  call void @gf256_add(ptr noundef %175, ptr noundef %176)
  br label %177

177:                                              ; preds = %164
  %178 = load i64, ptr %14, align 8, !tbaa !10
  %179 = add i64 %178, 1
  store i64 %179, ptr %14, align 8, !tbaa !10
  br label %85, !llvm.loop !20

180:                                              ; preds = %163, %85
  %181 = load i8, ptr %24, align 1, !tbaa !12, !range !21, !noundef !22
  %182 = trunc i8 %181 to i1
  %183 = zext i1 %182 to i32
  %184 = icmp eq i32 %183, 1
  br i1 %184, label %185, label %189

185:                                              ; preds = %180
  %186 = load ptr, ptr %8, align 8, !tbaa !5
  %187 = getelementptr inbounds [8 x i32], ptr %23, i64 0, i64 0
  %188 = load i64, ptr %13, align 8, !tbaa !10
  call void @unbitslice(ptr noundef %186, ptr noundef %187, i64 noundef %188)
  br label %189

189:                                              ; preds = %185, %180
  %190 = getelementptr inbounds [8 x i32], ptr %16, i64 0, i64 0
  call void @memzero(ptr noundef %190, i64 noundef 32)
  %191 = mul nuw i64 32, %27
  call void @memzero(ptr noundef %29, i64 noundef %191)
  %192 = mul nuw i64 32, %32
  call void @memzero(ptr noundef %33, i64 noundef %192)
  %193 = getelementptr inbounds [8 x i32], ptr %20, i64 0, i64 0
  call void @memzero(ptr noundef %193, i64 noundef 32)
  %194 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 0
  call void @memzero(ptr noundef %194, i64 noundef 32)
  %195 = getelementptr inbounds [8 x i32], ptr %22, i64 0, i64 0
  call void @memzero(ptr noundef %195, i64 noundef 32)
  %196 = getelementptr inbounds [8 x i32], ptr %23, i64 0, i64 0
  call void @memzero(ptr noundef %196, i64 noundef 32)
  %197 = load i8, ptr %24, align 1, !tbaa !12, !range !21, !noundef !22
  %198 = trunc i8 %197 to i1
  store i1 %198, ptr %7, align 1
  store i32 1, ptr %25, align 4
  br label %199

199:                                              ; preds = %189, %37
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #6
  %200 = load ptr, ptr %17, align 8
  call void @llvm.stackrestore.p0(ptr %200)
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %201 = load i1, ptr %7, align 1
  ret i1 %201
}

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: nounwind uwtable
declare hidden void @bitslice_setall(ptr noundef, i8 noundef zeroext) #0

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

; Function Attrs: nounwind uwtable
declare hidden void @gf256_add(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @gf256_mul(ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @gf256_inv(ptr noundef, ptr noundef) #0

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

declare void @memzero(ptr noundef, i64 noundef) #5

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

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

!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, !11, i64 0}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"_Bool", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = !{!19, !19, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = distinct !{!20, !15}
!21 = !{i8 0, i8 2}
!22 = !{}


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

@__const.shamir_interpolate.num = external hidden unnamed_addr constant [8 x i32], align 16

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @shamir_interpolate(ptr noundef %0, i8 noundef zeroext %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, i8 noundef zeroext %4, i64 noundef %5) local_unnamed_addr #0 {
  %7 = alloca [8 x i32], align 16
  %8 = alloca [8 x i32], align 16
  %9 = alloca [8 x i32], align 16
  %10 = alloca [8 x i32], align 16
  %11 = alloca [8 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %7, i8 0, i64 32, i1 false)
  %12 = zext i8 %4 to i64
  %13 = tail call ptr @llvm.stacksave.p0()
  %14 = alloca [8 x i32], i64 %12, align 16
  %15 = shl nuw nsw i64 %12, 5
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %14, i8 0, i64 %15, i1 false)
  %16 = alloca [8 x i32], i64 %12, align 16
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %16, i8 0, i64 %15, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %8, ptr noundef nonnull align 16 dereferenceable(32) @__const.shamir_interpolate.num, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %9, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %10, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %11, i8 0, i64 32, i1 false)
  %17 = icmp ugt i64 %5, 32
  br i1 %17, label %50, label %.preheader44

.preheader44:                                     ; preds = %6
  %.not53 = icmp eq i8 %4, 0
  br i1 %.not53, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %.preheader44
  call void @bitslice_setall(ptr noundef nonnull %7, i8 noundef zeroext %1)
  br label %.critedge

.lr.ph:                                           ; preds = %.preheader44, %.lr.ph
  %.04046 = phi i64 [ %24, %.lr.ph ], [ 0, %.preheader44 ]
  %18 = getelementptr inbounds [8 x i32], ptr %14, i64 %.04046
  %19 = getelementptr inbounds i8, ptr %2, i64 %.04046
  %20 = load i8, ptr %19, align 1, !tbaa !5
  call void @bitslice_setall(ptr noundef nonnull %18, i8 noundef zeroext %20)
  %21 = getelementptr inbounds [8 x i32], ptr %16, i64 %.04046
  %22 = getelementptr inbounds ptr, ptr %3, i64 %.04046
  %23 = load ptr, ptr %22, align 8, !tbaa !8
  call void @bitslice(ptr noundef nonnull %21, ptr noundef %23, i64 noundef %5)
  %24 = add nuw nsw i64 %.04046, 1
  %exitcond.not = icmp eq i64 %24, %12
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !10

._crit_edge:                                      ; preds = %.lr.ph
  call void @bitslice_setall(ptr noundef nonnull %7, i8 noundef zeroext %1)
  br i1 %.not53, label %.critedge, label %.lr.ph49

.preheader:                                       ; preds = %.lr.ph49
  br i1 %.not53, label %.critedge, label %.lr.ph52

.lr.ph49:                                         ; preds = %._crit_edge, %.lr.ph49
  %.147 = phi i64 [ %26, %.lr.ph49 ], [ 0, %._crit_edge ]
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %10, ptr noundef nonnull align 16 dereferenceable(32) %7, i64 32, i1 false)
  %25 = getelementptr inbounds [8 x i32], ptr %14, i64 %.147
  call void @gf256_add(ptr noundef nonnull %10, ptr noundef nonnull %25)
  call void @gf256_mul(ptr noundef nonnull %8, ptr noundef nonnull %8, ptr noundef nonnull %10)
  %26 = add nuw nsw i64 %.147, 1
  %exitcond58.not = icmp eq i64 %26, %12
  br i1 %exitcond58.not, label %.preheader, label %.lr.ph49, !llvm.loop !12

.lr.ph52:                                         ; preds = %.preheader, %45
  %27 = phi i1 [ %48, %45 ], [ false, %.preheader ]
  %.251 = phi i64 [ %47, %45 ], [ 0, %.preheader ]
  %28 = getelementptr inbounds i8, ptr %2, i64 %.251
  %29 = load i8, ptr %28, align 1, !tbaa !5
  %.not = icmp eq i8 %29, %1
  br i1 %.not, label %31, label %30

30:                                               ; preds = %.lr.ph52
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %9, ptr noundef nonnull align 16 dereferenceable(32) %7, i64 32, i1 false)
  br label %32

31:                                               ; preds = %.lr.ph52
  call void @bitslice_setall(ptr noundef nonnull %9, i8 noundef zeroext 1)
  br label %32

32:                                               ; preds = %31, %30
  %.sink65 = phi ptr [ %16, %31 ], [ %14, %30 ]
  %.sink = phi ptr [ %11, %31 ], [ %9, %30 ]
  %33 = getelementptr inbounds [8 x i32], ptr %.sink65, i64 %.251
  call void @gf256_add(ptr noundef nonnull %.sink, ptr noundef nonnull %33)
  %34 = getelementptr inbounds [8 x i32], ptr %14, i64 %.251
  br label %35

35:                                               ; preds = %32, %39
  %.04150 = phi i64 [ 0, %32 ], [ %40, %39 ]
  %36 = icmp eq i64 %.251, %.04150
  br i1 %36, label %39, label %37

37:                                               ; preds = %35
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %10, ptr noundef nonnull align 16 dereferenceable(32) %34, i64 32, i1 false)
  %38 = getelementptr inbounds [8 x i32], ptr %14, i64 %.04150
  call void @gf256_add(ptr noundef nonnull %10, ptr noundef nonnull %38)
  call void @gf256_mul(ptr noundef nonnull %9, ptr noundef nonnull %9, ptr noundef nonnull %10)
  br label %39

39:                                               ; preds = %35, %37
  %40 = add nuw nsw i64 %.04150, 1
  %exitcond59.not = icmp eq i64 %40, %12
  br i1 %exitcond59.not, label %41, label %35, !llvm.loop !13

41:                                               ; preds = %39
  %42 = load <8 x i32>, ptr %9, align 16, !tbaa !14
  %43 = call i32 @llvm.vector.reduce.or.v8i32(<8 x i32> %42)
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %.loopexit, label %45

45:                                               ; preds = %41
  call void @gf256_inv(ptr noundef nonnull %10, ptr noundef nonnull %9)
  call void @gf256_mul(ptr noundef nonnull %10, ptr noundef nonnull %10, ptr noundef nonnull %8)
  %46 = getelementptr inbounds [8 x i32], ptr %16, i64 %.251
  call void @gf256_mul(ptr noundef nonnull %10, ptr noundef nonnull %10, ptr noundef nonnull %46)
  call void @gf256_add(ptr noundef nonnull %11, ptr noundef nonnull %10)
  %47 = add nuw nsw i64 %.251, 1
  %48 = icmp uge i64 %47, %12
  %exitcond60 = icmp eq i64 %47, %12
  br i1 %exitcond60, label %.critedge, label %.lr.ph52, !llvm.loop !16

.critedge:                                        ; preds = %45, %._crit_edge, %._crit_edge.thread, %.preheader
  %.lcssa = phi i1 [ true, %.preheader ], [ true, %._crit_edge.thread ], [ true, %._crit_edge ], [ %48, %45 ]
  call void @unbitslice(ptr noundef %0, ptr noundef nonnull %11, i64 noundef %5)
  br label %.loopexit

.loopexit:                                        ; preds = %41, %.critedge
  %49 = phi i1 [ %.lcssa, %.critedge ], [ %27, %41 ]
  call void @memzero(ptr noundef nonnull %7, i64 noundef 32) #7
  call void @memzero(ptr noundef nonnull %14, i64 noundef %15) #7
  call void @memzero(ptr noundef nonnull %16, i64 noundef %15) #7
  call void @memzero(ptr noundef nonnull %8, i64 noundef 32) #7
  call void @memzero(ptr noundef nonnull %9, i64 noundef 32) #7
  call void @memzero(ptr noundef nonnull %10, i64 noundef 32) #7
  call void @memzero(ptr noundef nonnull %11, i64 noundef 32) #7
  br label %50

50:                                               ; preds = %6, %.loopexit
  %.039 = phi i1 [ %49, %.loopexit ], [ false, %6 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #7
  call void @llvm.stackrestore.p0(ptr %13)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  ret i1 %.039
}

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

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

; Function Attrs: nounwind uwtable
declare hidden void @bitslice_setall(ptr noundef, i8 noundef zeroext) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare hidden void @gf256_add(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @gf256_mul(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @gf256_inv(ptr noundef, ptr noundef) local_unnamed_addr #0

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

declare void @memzero(ptr noundef, i64 noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.or.v8i32(<8 x i32>) #6

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }

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

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


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