; LLVM IR from albertobsd/keyhunt :: secp256k1/IntMod.ll (ZN3Int6ModInvEv)

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

%class.Int = type { %union.anon }
%union.anon = type { [5 x i64] }

@_ZL2_P = external hidden global %class.Int, align 8
@_ZL4MM64 = external hidden global i64, align 8

declare void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #0

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

declare void @_ZN3Int3AddEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #0

declare void @_ZN3Int3SetEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #0

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

declare void @_ZN3Int3AddEPS_S0_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, ptr noundef) #0

declare void @_ZN3Int3SubEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #0

declare noundef zeroext i1 @_ZN3Int10IsNegativeEv(ptr noundef nonnull align 8 dereferenceable(40)) #0

declare void @_ZN3Int3NegEv(ptr noundef nonnull align 8 dereferenceable(40)) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3Int6ModInvEv(ptr noundef nonnull align 8 dereferenceable(40) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca %class.Int, align 8
  %4 = alloca %class.Int, align 8
  %5 = alloca %class.Int, align 8
  %6 = alloca %class.Int, align 8
  %7 = alloca %class.Int, align 8
  %8 = alloca %class.Int, align 8
  %9 = alloca %class.Int, align 8
  %10 = alloca %class.Int, align 8
  %11 = alloca %class.Int, align 8
  %12 = alloca %class.Int, align 8
  %13 = alloca %class.Int, align 8
  %14 = alloca %class.Int, align 8
  %15 = alloca %class.Int, align 8
  %16 = alloca %class.Int, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %28 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr %3) #4
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %3, ptr noundef @_ZL2_P)
  call void @llvm.lifetime.start.p0(i64 40, ptr %4) #4
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef %28)
  call void @llvm.lifetime.start.p0(i64 40, ptr %5) #4
  call void @_ZN3IntC1El(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 40, ptr %6) #4
  call void @_ZN3IntC1El(ptr noundef nonnull align 8 dereferenceable(40) %6, i64 noundef 1)
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %7)
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %8)
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %9)
  call void @llvm.lifetime.start.p0(i64 40, ptr %10) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %10)
  call void @llvm.lifetime.start.p0(i64 40, ptr %11) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %11)
  call void @llvm.lifetime.start.p0(i64 40, ptr %12) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %12)
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %13)
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %14)
  call void @llvm.lifetime.start.p0(i64 40, ptr %15) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %15)
  call void @llvm.lifetime.start.p0(i64 40, ptr %16) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %16)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  br label %29

29:                                               ; preds = %109, %1
  %30 = call noundef zeroext i1 @_ZN3Int6IsZeroEv(ptr noundef nonnull align 8 dereferenceable(40) %3)
  %31 = xor i1 %30, true
  br i1 %31, label %32, label %148

32:                                               ; preds = %29
  store i64 1, ptr %18, align 8, !tbaa !9
  store i64 0, ptr %19, align 8, !tbaa !9
  store i64 0, ptr %20, align 8, !tbaa !9
  store i64 1, ptr %21, align 8, !tbaa !9
  %33 = getelementptr inbounds %class.Int, ptr %3, i32 0, i32 0
  %34 = getelementptr inbounds [5 x i64], ptr %33, i64 0, i64 0
  %35 = load i64, ptr %34, align 8, !tbaa !11
  store i64 %35, ptr %23, align 8, !tbaa !9
  %36 = getelementptr inbounds %class.Int, ptr %4, i32 0, i32 0
  %37 = getelementptr inbounds [5 x i64], ptr %36, i64 0, i64 0
  %38 = load i64, ptr %37, align 8, !tbaa !11
  store i64 %38, ptr %22, align 8, !tbaa !9
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %39

39:                                               ; preds = %108, %32
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %50, %40
  %42 = load i64, ptr %23, align 8, !tbaa !9
  %43 = and i64 %42, 1
  %44 = icmp eq i64 %43, 0
  br i1 %44, label %45, label %48

45:                                               ; preds = %41
  %46 = load i64, ptr %17, align 8, !tbaa !9
  %47 = icmp slt i64 %46, 62
  br label %48

48:                                               ; preds = %45, %41
  %49 = phi i1 [ false, %41 ], [ %47, %45 ]
  br i1 %49, label %50, label %59

50:                                               ; preds = %48
  %51 = load i64, ptr %17, align 8, !tbaa !9
  %52 = add nsw i64 %51, 1
  store i64 %52, ptr %17, align 8, !tbaa !9
  %53 = load i64, ptr %23, align 8, !tbaa !9
  %54 = ashr i64 %53, 1
  store i64 %54, ptr %23, align 8, !tbaa !9
  %55 = load i64, ptr %20, align 8, !tbaa !9
  %56 = shl i64 %55, 1
  store i64 %56, ptr %20, align 8, !tbaa !9
  %57 = load i64, ptr %21, align 8, !tbaa !9
  %58 = shl i64 %57, 1
  store i64 %58, ptr %21, align 8, !tbaa !9
  br label %41, !llvm.loop !12

59:                                               ; preds = %48
  %60 = load i64, ptr %17, align 8, !tbaa !9
  %61 = icmp eq i64 %60, 62
  br i1 %61, label %62, label %63

62:                                               ; preds = %59
  br label %109

63:                                               ; preds = %59
  %64 = load i64, ptr %22, align 8, !tbaa !9
  %65 = load i64, ptr %23, align 8, !tbaa !9
  %66 = add nsw i64 %64, %65
  %67 = and i64 %66, 3
  store i64 %67, ptr %24, align 8, !tbaa !9
  %68 = load i64, ptr %24, align 8, !tbaa !9
  %69 = icmp eq i64 %68, 0
  br i1 %69, label %70, label %89

70:                                               ; preds = %63
  %71 = load i64, ptr %21, align 8, !tbaa !9
  %72 = load i64, ptr %19, align 8, !tbaa !9
  %73 = add nsw i64 %72, %71
  store i64 %73, ptr %19, align 8, !tbaa !9
  %74 = load i64, ptr %19, align 8, !tbaa !9
  %75 = load i64, ptr %21, align 8, !tbaa !9
  %76 = sub nsw i64 %75, %74
  store i64 %76, ptr %21, align 8, !tbaa !9
  %77 = load i64, ptr %20, align 8, !tbaa !9
  %78 = load i64, ptr %18, align 8, !tbaa !9
  %79 = add nsw i64 %78, %77
  store i64 %79, ptr %18, align 8, !tbaa !9
  %80 = load i64, ptr %18, align 8, !tbaa !9
  %81 = load i64, ptr %20, align 8, !tbaa !9
  %82 = sub nsw i64 %81, %80
  store i64 %82, ptr %20, align 8, !tbaa !9
  %83 = load i64, ptr %22, align 8, !tbaa !9
  %84 = load i64, ptr %23, align 8, !tbaa !9
  %85 = add nsw i64 %84, %83
  store i64 %85, ptr %23, align 8, !tbaa !9
  %86 = load i64, ptr %23, align 8, !tbaa !9
  %87 = load i64, ptr %22, align 8, !tbaa !9
  %88 = sub nsw i64 %87, %86
  store i64 %88, ptr %22, align 8, !tbaa !9
  br label %108

89:                                               ; preds = %63
  %90 = load i64, ptr %21, align 8, !tbaa !9
  %91 = load i64, ptr %19, align 8, !tbaa !9
  %92 = sub nsw i64 %91, %90
  store i64 %92, ptr %19, align 8, !tbaa !9
  %93 = load i64, ptr %19, align 8, !tbaa !9
  %94 = load i64, ptr %21, align 8, !tbaa !9
  %95 = add nsw i64 %94, %93
  store i64 %95, ptr %21, align 8, !tbaa !9
  %96 = load i64, ptr %20, align 8, !tbaa !9
  %97 = load i64, ptr %18, align 8, !tbaa !9
  %98 = sub nsw i64 %97, %96
  store i64 %98, ptr %18, align 8, !tbaa !9
  %99 = load i64, ptr %18, align 8, !tbaa !9
  %100 = load i64, ptr %20, align 8, !tbaa !9
  %101 = add nsw i64 %100, %99
  store i64 %101, ptr %20, align 8, !tbaa !9
  %102 = load i64, ptr %22, align 8, !tbaa !9
  %103 = load i64, ptr %23, align 8, !tbaa !9
  %104 = sub nsw i64 %103, %102
  store i64 %104, ptr %23, align 8, !tbaa !9
  %105 = load i64, ptr %23, align 8, !tbaa !9
  %106 = load i64, ptr %22, align 8, !tbaa !9
  %107 = add nsw i64 %106, %105
  store i64 %107, ptr %22, align 8, !tbaa !9
  br label %108

108:                                              ; preds = %89, %70
  br label %39, !llvm.loop !14

109:                                              ; preds = %62
  %110 = load i64, ptr %18, align 8, !tbaa !9
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef %3, i64 noundef %110)
  %111 = load i64, ptr %19, align 8, !tbaa !9
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %10, ptr noundef %4, i64 noundef %111)
  %112 = load i64, ptr %20, align 8, !tbaa !9
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %11, ptr noundef %3, i64 noundef %112)
  %113 = load i64, ptr %21, align 8, !tbaa !9
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef %4, i64 noundef %113)
  %114 = load i64, ptr %18, align 8, !tbaa !9
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %13, ptr noundef %5, i64 noundef %114)
  %115 = load i64, ptr %19, align 8, !tbaa !9
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %14, ptr noundef %6, i64 noundef %115)
  %116 = load i64, ptr %20, align 8, !tbaa !9
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %15, ptr noundef %5, i64 noundef %116)
  %117 = load i64, ptr %21, align 8, !tbaa !9
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %16, ptr noundef %6, i64 noundef %117)
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %118 = getelementptr inbounds %class.Int, ptr %13, i32 0, i32 0
  %119 = getelementptr inbounds [5 x i64], ptr %118, i64 0, i64 0
  %120 = load i64, ptr %119, align 8, !tbaa !11
  %121 = getelementptr inbounds %class.Int, ptr %14, i32 0, i32 0
  %122 = getelementptr inbounds [5 x i64], ptr %121, i64 0, i64 0
  %123 = load i64, ptr %122, align 8, !tbaa !11
  %124 = add i64 %120, %123
  %125 = load i64, ptr @_ZL4MM64, align 8, !tbaa !9
  %126 = mul i64 %124, %125
  %127 = and i64 %126, 4611686018427387903
  store i64 %127, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %128 = getelementptr inbounds %class.Int, ptr %15, i32 0, i32 0
  %129 = getelementptr inbounds [5 x i64], ptr %128, i64 0, i64 0
  %130 = load i64, ptr %129, align 8, !tbaa !11
  %131 = getelementptr inbounds %class.Int, ptr %16, i32 0, i32 0
  %132 = getelementptr inbounds [5 x i64], ptr %131, i64 0, i64 0
  %133 = load i64, ptr %132, align 8, !tbaa !11
  %134 = add i64 %130, %133
  %135 = load i64, ptr @_ZL4MM64, align 8, !tbaa !9
  %136 = mul i64 %134, %135
  %137 = and i64 %136, 4611686018427387903
  store i64 %137, ptr %26, align 8, !tbaa !9
  %138 = load i64, ptr %25, align 8, !tbaa !9
  call void @_ZN3Int4MultEPS_m(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef @_ZL2_P, i64 noundef %138)
  %139 = load i64, ptr %26, align 8, !tbaa !9
  call void @_ZN3Int4MultEPS_m(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef @_ZL2_P, i64 noundef %139)
  call void @_ZN3Int3AddEPS_S0_(ptr noundef nonnull align 8 dereferenceable(40) %3, ptr noundef %9, ptr noundef %10)
  call void @_ZN3Int3AddEPS_S0_(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef %11, ptr noundef %12)
  call void @_ZN3Int3AddEPS_S0_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef %13, ptr noundef %14)
  call void @_ZN3Int3AddEPS_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef %7)
  call void @_ZN3Int3AddEPS_S0_(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef %15, ptr noundef %16)
  call void @_ZN3Int3AddEPS_(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef %8)
  %140 = getelementptr inbounds %class.Int, ptr %3, i32 0, i32 0
  %141 = getelementptr inbounds [5 x i64], ptr %140, i64 0, i64 0
  call void @_ZL6shiftRhPm(i8 noundef zeroext 62, ptr noundef %141)
  %142 = getelementptr inbounds %class.Int, ptr %4, i32 0, i32 0
  %143 = getelementptr inbounds [5 x i64], ptr %142, i64 0, i64 0
  call void @_ZL6shiftRhPm(i8 noundef zeroext 62, ptr noundef %143)
  %144 = getelementptr inbounds %class.Int, ptr %5, i32 0, i32 0
  %145 = getelementptr inbounds [5 x i64], ptr %144, i64 0, i64 0
  call void @_ZL6shiftRhPm(i8 noundef zeroext 62, ptr noundef %145)
  %146 = getelementptr inbounds %class.Int, ptr %6, i32 0, i32 0
  %147 = getelementptr inbounds [5 x i64], ptr %146, i64 0, i64 0
  call void @_ZL6shiftRhPm(i8 noundef zeroext 62, ptr noundef %147)
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  br label %29, !llvm.loop !15

148:                                              ; preds = %29
  %149 = call noundef zeroext i1 @_ZN3Int10IsNegativeEv(ptr noundef nonnull align 8 dereferenceable(40) %4)
  br i1 %149, label %150, label %151

150:                                              ; preds = %148
  call void @_ZN3Int3NegEv(ptr noundef nonnull align 8 dereferenceable(40) %4)
  call void @_ZN3Int3NegEv(ptr noundef nonnull align 8 dereferenceable(40) %6)
  call void @_ZN3Int3AddEPS_(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef @_ZL2_P)
  br label %151

151:                                              ; preds = %150, %148
  %152 = call noundef zeroext i1 @_ZN3Int5IsOneEv(ptr noundef nonnull align 8 dereferenceable(40) %4)
  br i1 %152, label %154, label %153

153:                                              ; preds = %151
  call void @_ZN3Int5CLEAREv(ptr noundef nonnull align 8 dereferenceable(40) %28)
  store i32 1, ptr %27, align 4
  br label %161

154:                                              ; preds = %151
  %155 = call noundef zeroext i1 @_ZN3Int10IsNegativeEv(ptr noundef nonnull align 8 dereferenceable(40) %6)
  br i1 %155, label %156, label %157

156:                                              ; preds = %154
  call void @_ZN3Int3AddEPS_(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef @_ZL2_P)
  br label %157

157:                                              ; preds = %156, %154
  %158 = call noundef zeroext i1 @_ZN3Int16IsGreaterOrEqualEPS_(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef @_ZL2_P)
  br i1 %158, label %159, label %160

159:                                              ; preds = %157
  call void @_ZN3Int3SubEPS_(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef @_ZL2_P)
  br label %160

160:                                              ; preds = %159, %157
  call void @_ZN3Int3SetEPS_(ptr noundef nonnull align 8 dereferenceable(40) %28, ptr noundef %6)
  store i32 0, ptr %27, align 4
  br label %161

161:                                              ; preds = %160, %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %3) #4
  %162 = load i32, ptr %27, align 4
  switch i32 %162, label %164 [
    i32 0, label %163
    i32 1, label %163
  ]

163:                                              ; preds = %161, %161
  ret void

164:                                              ; preds = %161
  unreachable
}

declare void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) unnamed_addr #0

declare void @_ZN3IntC1El(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) unnamed_addr #0

declare noundef zeroext i1 @_ZN3Int6IsZeroEv(ptr noundef nonnull align 8 dereferenceable(40)) #0

declare void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, i64 noundef) #0

declare void @_ZN3Int4MultEPS_m(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, i64 noundef) #0

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL6shiftRhPm(i8 noundef zeroext, ptr noundef) #3

declare noundef zeroext i1 @_ZN3Int5IsOneEv(ptr noundef nonnull align 8 dereferenceable(40)) #0

declare void @_ZN3Int5CLEAREv(ptr noundef nonnull align 8 dereferenceable(40)) #0

declare noundef zeroext i1 @_ZN3Int16IsGreaterOrEqualEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #0

attributes #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 = { mustprogress 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 = { inlinehint mustprogress 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 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


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

%class.Int = type { %union.anon }
%union.anon = type { [5 x i64] }

@_ZL2_P = external hidden global %class.Int, align 8
@_ZL4MM64 = external hidden local_unnamed_addr global i64, align 8

declare void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40)) 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 @_ZN3Int3AddEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #0

declare void @_ZN3Int3SetEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #0

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

declare void @_ZN3Int3AddEPS_S0_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @_ZN3Int3SubEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #0

declare noundef zeroext i1 @_ZN3Int10IsNegativeEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0

declare void @_ZN3Int3NegEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3Int6ModInvEv(ptr noundef nonnull align 8 dereferenceable(40) %0) local_unnamed_addr #2 align 2 {
  %2 = alloca %class.Int, align 8
  %3 = alloca %class.Int, align 8
  %4 = alloca %class.Int, align 8
  %5 = alloca %class.Int, align 8
  %6 = alloca %class.Int, align 8
  %7 = alloca %class.Int, align 8
  %8 = alloca %class.Int, align 8
  %9 = alloca %class.Int, align 8
  %10 = alloca %class.Int, align 8
  %11 = alloca %class.Int, align 8
  %12 = alloca %class.Int, align 8
  %13 = alloca %class.Int, align 8
  %14 = alloca %class.Int, align 8
  %15 = alloca %class.Int, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %2) #4
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef nonnull @_ZL2_P)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #4
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %3, ptr noundef nonnull %0)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #4
  call void @_ZN3IntC1El(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #4
  call void @_ZN3IntC1El(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef 1)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %6)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %7)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %8)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %9)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %10) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %10)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %11) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %11)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %12) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %12)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %13) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %13)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %14) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %14)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %15) #4
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %15)
  %16 = call noundef zeroext i1 @_ZN3Int6IsZeroEv(ptr noundef nonnull align 8 dereferenceable(40) %2)
  br i1 %16, label %._crit_edge67, label %.lr.ph66

.lr.ph66:                                         ; preds = %1, %46
  %17 = load i64, ptr %2, align 8, !tbaa !5
  %18 = load i64, ptr %3, align 8, !tbaa !5
  br label %19

19:                                               ; preds = %.backedge, %.lr.ph66
  %.055 = phi i64 [ 0, %.lr.ph66 ], [ %.055.be, %.backedge ]
  %.052 = phi i64 [ 1, %.lr.ph66 ], [ %.052.be, %.backedge ]
  %.050 = phi i64 [ %18, %.lr.ph66 ], [ %.050.be, %.backedge ]
  %.048 = phi i64 [ %17, %.lr.ph66 ], [ %.048.be, %.backedge ]
  %.046 = phi i64 [ 0, %.lr.ph66 ], [ %.046.be, %.backedge ]
  %.044 = phi i64 [ 1, %.lr.ph66 ], [ %.044.be, %.backedge ]
  %.0 = phi i64 [ 0, %.lr.ph66 ], [ %.1.lcssa78, %.backedge ]
  %20 = and i64 %.048, 1
  %21 = icmp eq i64 %20, 0
  %22 = icmp slt i64 %.0, 62
  %23 = and i1 %21, %22
  br i1 %23, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %19, %.lr.ph
  %.161 = phi i64 [ %24, %.lr.ph ], [ %.0, %19 ]
  %.14960 = phi i64 [ %25, %.lr.ph ], [ %.048, %19 ]
  %.15359 = phi i64 [ %27, %.lr.ph ], [ %.052, %19 ]
  %.15658 = phi i64 [ %26, %.lr.ph ], [ %.055, %19 ]
  %24 = add nsw i64 %.161, 1
  %25 = ashr exact i64 %.14960, 1
  %26 = shl i64 %.15658, 1
  %27 = shl i64 %.15359, 1
  %28 = and i64 %.14960, 2
  %29 = icmp eq i64 %28, 0
  %30 = icmp slt i64 %.161, 61
  %31 = select i1 %29, i1 %30, i1 false
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !8

._crit_edge:                                      ; preds = %.lr.ph
  %32 = icmp eq i64 %24, 62
  br i1 %32, label %46, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %19, %._crit_edge
  %.1.lcssa78 = phi i64 [ %24, %._crit_edge ], [ %.0, %19 ]
  %.149.lcssa77 = phi i64 [ %25, %._crit_edge ], [ %.048, %19 ]
  %.153.lcssa76 = phi i64 [ %27, %._crit_edge ], [ %.052, %19 ]
  %.156.lcssa75 = phi i64 [ %26, %._crit_edge ], [ %.055, %19 ]
  %33 = add nsw i64 %.149.lcssa77, %.050
  %34 = and i64 %33, 3
  %35 = icmp eq i64 %34, 0
  br i1 %35, label %36, label %42

36:                                               ; preds = %._crit_edge.thread
  %37 = add nsw i64 %.153.lcssa76, %.046
  %38 = sub i64 0, %.046
  %39 = add nsw i64 %.156.lcssa75, %.044
  %40 = sub i64 0, %.044
  %41 = sub i64 0, %.149.lcssa77
  br label %.backedge

42:                                               ; preds = %._crit_edge.thread
  %43 = sub nsw i64 %.046, %.153.lcssa76
  %44 = sub nsw i64 %.044, %.156.lcssa75
  %45 = sub nsw i64 %.149.lcssa77, %.050
  br label %.backedge

.backedge:                                        ; preds = %42, %36
  %.055.be = phi i64 [ %40, %36 ], [ %.044, %42 ]
  %.052.be = phi i64 [ %38, %36 ], [ %.046, %42 ]
  %.050.be = phi i64 [ %41, %36 ], [ %.149.lcssa77, %42 ]
  %.048.be = phi i64 [ %33, %36 ], [ %45, %42 ]
  %.046.be = phi i64 [ %37, %36 ], [ %43, %42 ]
  %.044.be = phi i64 [ %39, %36 ], [ %44, %42 ]
  br label %19, !llvm.loop !10

46:                                               ; preds = %._crit_edge
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull %2, i64 noundef %.044)
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef nonnull %3, i64 noundef %.046)
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %10, ptr noundef nonnull %2, i64 noundef %26)
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %11, ptr noundef nonnull %3, i64 noundef %27)
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull %4, i64 noundef %.044)
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %13, ptr noundef nonnull %5, i64 noundef %.046)
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %14, ptr noundef nonnull %4, i64 noundef %26)
  call void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40) %15, ptr noundef nonnull %5, i64 noundef %27)
  %47 = load i64, ptr %12, align 8, !tbaa !5
  %48 = load i64, ptr %13, align 8, !tbaa !5
  %49 = add i64 %48, %47
  %50 = load i64, ptr @_ZL4MM64, align 8, !tbaa !11
  %51 = mul i64 %49, %50
  %52 = and i64 %51, 4611686018427387903
  %53 = load i64, ptr %14, align 8, !tbaa !5
  %54 = load i64, ptr %15, align 8, !tbaa !5
  %55 = add i64 %54, %53
  %56 = mul i64 %55, %50
  %57 = and i64 %56, 4611686018427387903
  call void @_ZN3Int4MultEPS_m(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef nonnull @_ZL2_P, i64 noundef %52)
  call void @_ZN3Int4MultEPS_m(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull @_ZL2_P, i64 noundef %57)
  call void @_ZN3Int3AddEPS_S0_(ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef nonnull %8, ptr noundef nonnull %9)
  call void @_ZN3Int3AddEPS_S0_(ptr noundef nonnull align 8 dereferenceable(40) %3, ptr noundef nonnull %10, ptr noundef nonnull %11)
  call void @_ZN3Int3AddEPS_S0_(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull %12, ptr noundef nonnull %13)
  call void @_ZN3Int3AddEPS_(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull %6)
  call void @_ZN3Int3AddEPS_S0_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull %14, ptr noundef nonnull %15)
  call void @_ZN3Int3AddEPS_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull %7)
  call void @_ZL6shiftRhPm(i8 noundef zeroext 62, ptr noundef nonnull %2)
  call void @_ZL6shiftRhPm(i8 noundef zeroext 62, ptr noundef nonnull %3)
  call void @_ZL6shiftRhPm(i8 noundef zeroext 62, ptr noundef nonnull %4)
  call void @_ZL6shiftRhPm(i8 noundef zeroext 62, ptr noundef nonnull %5)
  %58 = call noundef zeroext i1 @_ZN3Int6IsZeroEv(ptr noundef nonnull align 8 dereferenceable(40) %2)
  br i1 %58, label %._crit_edge67, label %.lr.ph66, !llvm.loop !13

._crit_edge67:                                    ; preds = %46, %1
  %59 = call noundef zeroext i1 @_ZN3Int10IsNegativeEv(ptr noundef nonnull align 8 dereferenceable(40) %3)
  br i1 %59, label %60, label %61

60:                                               ; preds = %._crit_edge67
  call void @_ZN3Int3NegEv(ptr noundef nonnull align 8 dereferenceable(40) %3)
  call void @_ZN3Int3NegEv(ptr noundef nonnull align 8 dereferenceable(40) %5)
  call void @_ZN3Int3AddEPS_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull @_ZL2_P)
  br label %61

61:                                               ; preds = %60, %._crit_edge67
  %62 = call noundef zeroext i1 @_ZN3Int5IsOneEv(ptr noundef nonnull align 8 dereferenceable(40) %3)
  br i1 %62, label %64, label %63

63:                                               ; preds = %61
  call void @_ZN3Int5CLEAREv(ptr noundef nonnull align 8 dereferenceable(40) %0)
  br label %71

64:                                               ; preds = %61
  %65 = call noundef zeroext i1 @_ZN3Int10IsNegativeEv(ptr noundef nonnull align 8 dereferenceable(40) %5)
  br i1 %65, label %66, label %67

66:                                               ; preds = %64
  call void @_ZN3Int3AddEPS_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull @_ZL2_P)
  br label %67

67:                                               ; preds = %66, %64
  %68 = call noundef zeroext i1 @_ZN3Int16IsGreaterOrEqualEPS_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull @_ZL2_P)
  br i1 %68, label %69, label %70

69:                                               ; preds = %67
  call void @_ZN3Int3SubEPS_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull @_ZL2_P)
  br label %70

70:                                               ; preds = %69, %67
  call void @_ZN3Int3SetEPS_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull %5)
  br label %71

71:                                               ; preds = %70, %63
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #4
  ret void
}

declare void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) unnamed_addr #0

declare void @_ZN3IntC1El(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) unnamed_addr #0

declare noundef zeroext i1 @_ZN3Int6IsZeroEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0

declare void @_ZN3Int5IMultEPS_l(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, i64 noundef) local_unnamed_addr #0

declare void @_ZN3Int4MultEPS_m(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL6shiftRhPm(i8 noundef zeroext, ptr noundef) local_unnamed_addr #3

declare noundef zeroext i1 @_ZN3Int5IsOneEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0

declare void @_ZN3Int5CLEAREv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0

declare noundef zeroext i1 @_ZN3Int16IsGreaterOrEqualEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #0

attributes #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 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 = { inlinehint mustprogress 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 = { 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++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !6, i64 0}
!13 = distinct !{!13, !9}


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