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

; 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.bignum256 = type { [9 x i32] }
%struct.curve_point = type { %struct.bignum256, %struct.bignum256 }
%struct.ecdsa_curve = type { %struct.bignum256, %struct.curve_point, %struct.bignum256, %struct.bignum256, i32, %struct.bignum256, [64 x [8 x %struct.curve_point]] }

; 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) #0

; Function Attrs: nounwind uwtable
declare dso_local void @point_add(ptr noundef, ptr noundef, ptr noundef) #1

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

; 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 dso_local i32 @point_is_infinity(ptr noundef) #1

declare void @bn_inverse(ptr noundef, ptr noundef) #4

declare void @bn_multiply(ptr noundef, ptr noundef, ptr noundef) #4

declare void @bn_mod(ptr noundef, ptr noundef) #4

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

declare i32 @bn_is_zero(ptr noundef) #4

declare void @bn_add(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @point_multiply(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @bn_is_less(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @scalar_multiply(ptr noundef, ptr noundef, ptr noundef) #1

declare void @bn_read_be(ptr noundef, ptr noundef) #4

declare void @bn_write_be(ptr noundef, ptr noundef) #4

declare void @bn_subtract(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local void @uncompress_coords(ptr noundef, i8 noundef zeroext, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @ecdsa_validate_pubkey(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @ecdsa_recover_pub_from_sig(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4) #1 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.bignum256, align 4
  %13 = alloca %struct.bignum256, align 4
  %14 = alloca %struct.bignum256, align 4
  %15 = alloca %struct.curve_point, align 4
  %16 = alloca %struct.curve_point, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 36, ptr %12) #5
  call void @llvm.memset.p0.i64(ptr align 4 %12, i8 0, i64 36, i1 false)
  call void @llvm.lifetime.start.p0(i64 36, ptr %13) #5
  call void @llvm.memset.p0.i64(ptr align 4 %13, i8 0, i64 36, i1 false)
  call void @llvm.lifetime.start.p0(i64 36, ptr %14) #5
  call void @llvm.memset.p0.i64(ptr align 4 %14, i8 0, i64 36, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr %15) #5
  call void @llvm.memset.p0.i64(ptr align 4 %15, i8 0, i64 72, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr %16) #5
  call void @llvm.memset.p0.i64(ptr align 4 %16, i8 0, i64 72, i1 false)
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bn_read_be(ptr noundef %18, ptr noundef %12)
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 32
  call void @bn_read_be(ptr noundef %20, ptr noundef %13)
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.ecdsa_curve, ptr %21, i32 0, i32 2
  %23 = call i32 @bn_is_less(ptr noundef %12, ptr noundef %22)
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %28

25:                                               ; preds = %5
  %26 = call i32 @bn_is_zero(ptr noundef %12)
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %25, %5
  store i32 1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %98

29:                                               ; preds = %25
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.ecdsa_curve, ptr %30, i32 0, i32 2
  %32 = call i32 @bn_is_less(ptr noundef %13, ptr noundef %31)
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %37

34:                                               ; preds = %29
  %35 = call i32 @bn_is_zero(ptr noundef %13)
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %34, %29
  store i32 1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %98

38:                                               ; preds = %34
  %39 = getelementptr inbounds %struct.curve_point, ptr %15, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %39, ptr align 4 %12, i64 36, i1 false)
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = and i32 %40, 2
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %54

43:                                               ; preds = %38
  %44 = getelementptr inbounds %struct.curve_point, ptr %15, i32 0, i32 0
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ecdsa_curve, ptr %45, i32 0, i32 2
  call void @bn_add(ptr noundef %44, ptr noundef %46)
  %47 = getelementptr inbounds %struct.curve_point, ptr %15, i32 0, i32 0
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.ecdsa_curve, ptr %48, i32 0, i32 0
  %50 = call i32 @bn_is_less(ptr noundef %47, ptr noundef %49)
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %53, label %52

52:                                               ; preds = %43
  store i32 1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %98

53:                                               ; preds = %43
  br label %54

54:                                               ; preds = %53, %38
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = load i32, ptr %11, align 4, !tbaa !9
  %57 = and i32 %56, 1
  %58 = trunc i32 %57 to i8
  %59 = getelementptr inbounds %struct.curve_point, ptr %15, i32 0, i32 0
  %60 = getelementptr inbounds %struct.curve_point, ptr %15, i32 0, i32 1
  call void @uncompress_coords(ptr noundef %55, i8 noundef zeroext %58, ptr noundef %59, ptr noundef %60)
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = call i32 @ecdsa_validate_pubkey(ptr noundef %61, ptr noundef %15)
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %65, label %64

64:                                               ; preds = %54
  store i32 1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %98

65:                                               ; preds = %54
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  call void @bn_read_be(ptr noundef %66, ptr noundef %14)
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.ecdsa_curve, ptr %67, i32 0, i32 2
  call void @bn_mod(ptr noundef %14, ptr noundef %68)
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ecdsa_curve, ptr %69, i32 0, i32 2
  call void @bn_subtract(ptr noundef %70, ptr noundef %14, ptr noundef %14)
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.ecdsa_curve, ptr %71, i32 0, i32 2
  call void @bn_inverse(ptr noundef %12, ptr noundef %72)
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.ecdsa_curve, ptr %73, i32 0, i32 2
  call void @bn_multiply(ptr noundef %12, ptr noundef %14, ptr noundef %74)
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ecdsa_curve, ptr %75, i32 0, i32 2
  call void @bn_mod(ptr noundef %14, ptr noundef %76)
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.ecdsa_curve, ptr %77, i32 0, i32 2
  call void @bn_multiply(ptr noundef %12, ptr noundef %13, ptr noundef %78)
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.ecdsa_curve, ptr %79, i32 0, i32 2
  call void @bn_mod(ptr noundef %13, ptr noundef %80)
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = call i32 @point_multiply(ptr noundef %81, ptr noundef %13, ptr noundef %15, ptr noundef %15)
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = call i32 @scalar_multiply(ptr noundef %83, ptr noundef %14, ptr noundef %16)
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  call void @point_add(ptr noundef %85, ptr noundef %16, ptr noundef %15)
  %86 = call i32 @point_is_infinity(ptr noundef %15)
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %89

88:                                               ; preds = %65
  store i32 1, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %98

89:                                               ; preds = %65
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = getelementptr inbounds i8, ptr %90, i64 0
  store i8 4, ptr %91, align 1, !tbaa !11
  %92 = getelementptr inbounds %struct.curve_point, ptr %15, i32 0, i32 0
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %93, i64 1
  call void @bn_write_be(ptr noundef %92, ptr noundef %94)
  %95 = getelementptr inbounds %struct.curve_point, ptr %15, i32 0, i32 1
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = getelementptr inbounds i8, ptr %96, i64 33
  call void @bn_write_be(ptr noundef %95, ptr noundef %97)
  store i32 0, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %98

98:                                               ; preds = %89, %88, %64, %52, %37, %28
  call void @llvm.lifetime.end.p0(i64 72, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %12) #5
  %99 = load i32, ptr %6, align 4
  ret i32 %99
}

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

!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 = !{!7, !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.bignum256 = type { [9 x i32] }
%struct.curve_point = type { %struct.bignum256, %struct.bignum256 }

; 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) #0

; Function Attrs: nounwind uwtable
declare dso_local void @point_add(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: nounwind uwtable
declare dso_local i32 @point_is_infinity(ptr noundef) local_unnamed_addr #1

declare void @bn_inverse(ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @bn_multiply(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @bn_mod(ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare i32 @bn_is_zero(ptr noundef) local_unnamed_addr #4

declare void @bn_add(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @point_multiply(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @bn_is_less(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @scalar_multiply(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @bn_read_be(ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @bn_write_be(ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @bn_subtract(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @uncompress_coords(ptr noundef, i8 noundef zeroext, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @ecdsa_validate_pubkey(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @ecdsa_recover_pub_from_sig(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4) local_unnamed_addr #1 {
  %6 = alloca %struct.bignum256, align 4
  %7 = alloca %struct.bignum256, align 4
  %8 = alloca %struct.bignum256, align 4
  %9 = alloca %struct.curve_point, align 4
  %10 = alloca %struct.curve_point, align 4
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %6) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %6, i8 0, i64 36, i1 false)
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %7) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %7, i8 0, i64 36, i1 false)
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %8) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %8, i8 0, i64 36, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %9) #5
  %11 = getelementptr inbounds i8, ptr %9, i64 36
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(72) %11, i8 0, i64 36, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %10) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(72) %10, i8 0, i64 72, i1 false)
  call void @bn_read_be(ptr noundef %2, ptr noundef nonnull %6) #5
  %12 = getelementptr inbounds i8, ptr %2, i64 32
  call void @bn_read_be(ptr noundef nonnull %12, ptr noundef nonnull %7) #5
  %13 = getelementptr inbounds i8, ptr %0, i64 108
  %14 = call i32 @bn_is_less(ptr noundef nonnull %6, ptr noundef nonnull %13) #5
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %37, label %15

15:                                               ; preds = %5
  %16 = call i32 @bn_is_zero(ptr noundef nonnull %6) #5
  %.not24 = icmp eq i32 %16, 0
  br i1 %.not24, label %17, label %37

17:                                               ; preds = %15
  %18 = call i32 @bn_is_less(ptr noundef nonnull %7, ptr noundef nonnull %13) #5
  %.not25 = icmp eq i32 %18, 0
  br i1 %.not25, label %37, label %19

19:                                               ; preds = %17
  %20 = call i32 @bn_is_zero(ptr noundef nonnull %7) #5
  %.not26 = icmp eq i32 %20, 0
  br i1 %.not26, label %21, label %37

21:                                               ; preds = %19
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %9, ptr noundef nonnull align 4 dereferenceable(36) %6, i64 36, i1 false)
  %22 = and i32 %4, 2
  %.not27 = icmp eq i32 %22, 0
  br i1 %.not27, label %25, label %23

23:                                               ; preds = %21
  call void @bn_add(ptr noundef nonnull %9, ptr noundef nonnull %13) #5
  %24 = call i32 @bn_is_less(ptr noundef nonnull %9, ptr noundef %0) #5
  %.not28 = icmp eq i32 %24, 0
  br i1 %.not28, label %37, label %25

25:                                               ; preds = %23, %21
  %26 = trunc i32 %4 to i8
  %27 = and i8 %26, 1
  %28 = getelementptr inbounds i8, ptr %9, i64 36
  call void @uncompress_coords(ptr noundef %0, i8 noundef zeroext %27, ptr noundef nonnull %9, ptr noundef nonnull %28)
  %29 = call i32 @ecdsa_validate_pubkey(ptr noundef %0, ptr noundef nonnull %9)
  %.not29 = icmp eq i32 %29, 0
  br i1 %.not29, label %37, label %30

30:                                               ; preds = %25
  call void @bn_read_be(ptr noundef %3, ptr noundef nonnull %8) #5
  call void @bn_mod(ptr noundef nonnull %8, ptr noundef nonnull %13) #5
  call void @bn_subtract(ptr noundef nonnull %13, ptr noundef nonnull %8, ptr noundef nonnull %8) #5
  call void @bn_inverse(ptr noundef nonnull %6, ptr noundef nonnull %13) #5
  call void @bn_multiply(ptr noundef nonnull %6, ptr noundef nonnull %8, ptr noundef nonnull %13) #5
  call void @bn_mod(ptr noundef nonnull %8, ptr noundef nonnull %13) #5
  call void @bn_multiply(ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %13) #5
  call void @bn_mod(ptr noundef nonnull %7, ptr noundef nonnull %13) #5
  %31 = call i32 @point_multiply(ptr noundef %0, ptr noundef nonnull %7, ptr noundef nonnull %9, ptr noundef nonnull %9)
  %32 = call i32 @scalar_multiply(ptr noundef %0, ptr noundef nonnull %8, ptr noundef nonnull %10)
  call void @point_add(ptr noundef %0, ptr noundef nonnull %10, ptr noundef nonnull %9)
  %33 = call i32 @point_is_infinity(ptr noundef nonnull %9)
  %.not30 = icmp eq i32 %33, 0
  br i1 %.not30, label %34, label %37

34:                                               ; preds = %30
  store i8 4, ptr %1, align 1, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %1, i64 1
  call void @bn_write_be(ptr noundef nonnull %9, ptr noundef nonnull %35) #5
  %36 = getelementptr inbounds i8, ptr %1, i64 33
  call void @bn_write_be(ptr noundef nonnull %28, ptr noundef nonnull %36) #5
  br label %37

37:                                               ; preds = %30, %25, %23, %17, %19, %5, %15, %34
  %.0 = phi i32 [ 0, %34 ], [ 1, %15 ], [ 1, %5 ], [ 1, %19 ], [ 1, %17 ], [ 1, %23 ], [ 1, %25 ], [ 1, %30 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %6) #5
  ret i32 %.0
}

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

!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: DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass