; LLVM IR from tangjz/acm-icpc :: 51nod (1039)

; 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.Triple = type { i32, i32, i32 }

@a = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(i32 noundef, i32 noundef) #0

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z7mod_invi(i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z8mod_sqrti(i32 noundef) #2

; Function Attrs: nounwind
declare i32 @rand() #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: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #5 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.Triple, align 4
  %4 = alloca %struct.Triple, align 4
  %5 = alloca { i64, i32 }, align 8
  %6 = alloca i32, align 4
  %7 = alloca [3 x i32], align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  %10 = call i64 @time(ptr noundef null) #8
  %11 = trunc i64 %10 to i32
  call void @srand(i32 noundef %11) #8
  br label %12

12:                                               ; preds = %159, %45, %30, %23, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr %2, align 4, !tbaa !5
  %15 = icmp ne i32 %13, 0
  br i1 %15, label %16, label %160

16:                                               ; preds = %12
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @p, ptr noundef @a)
  %18 = load i32, ptr @a, align 4, !tbaa !5
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %23

20:                                               ; preds = %16
  %21 = load i32, ptr @p, align 4, !tbaa !5
  %22 = icmp sle i32 %21, 3
  br i1 %22, label %23, label %26

23:                                               ; preds = %20, %16
  %24 = load i32, ptr @a, align 4, !tbaa !5
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %24)
  br label %12, !llvm.loop !9

26:                                               ; preds = %20
  %27 = load i32, ptr @p, align 4, !tbaa !5
  %28 = srem i32 %27, 3
  %29 = icmp ne i32 %28, 1
  br i1 %29, label %30, label %38

30:                                               ; preds = %26
  %31 = load i32, ptr @a, align 4, !tbaa !5
  %32 = load i32, ptr @p, align 4, !tbaa !5
  %33 = shl i32 %32, 1
  %34 = sub nsw i32 %33, 1
  %35 = sdiv i32 %34, 3
  %36 = call noundef i32 @_Z7mod_powii(i32 noundef %31, i32 noundef %35)
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %36)
  br label %12, !llvm.loop !9

38:                                               ; preds = %26
  %39 = load i32, ptr @a, align 4, !tbaa !5
  %40 = load i32, ptr @p, align 4, !tbaa !5
  %41 = sub nsw i32 %40, 1
  %42 = sdiv i32 %41, 3
  %43 = call noundef i32 @_Z7mod_powii(i32 noundef %39, i32 noundef %42)
  %44 = icmp ne i32 %43, 1
  br i1 %44, label %45, label %47

45:                                               ; preds = %38
  %46 = call i32 @puts(ptr noundef @.str.3)
  br label %12, !llvm.loop !9

47:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 12, ptr %3) #8
  br label %48

48:                                               ; preds = %94, %47
  %49 = call i32 @rand() #8
  %50 = sext i32 %49 to i64
  %51 = shl i64 %50, 15
  %52 = call i32 @rand() #8
  %53 = sext i32 %52 to i64
  %54 = or i64 %51, %53
  %55 = load i32, ptr @p, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = srem i64 %54, %56
  %58 = trunc i64 %57 to i32
  %59 = getelementptr inbounds %struct.Triple, ptr %3, i32 0, i32 0
  store i32 %58, ptr %59, align 4, !tbaa !11
  %60 = call i32 @rand() #8
  %61 = sext i32 %60 to i64
  %62 = shl i64 %61, 15
  %63 = call i32 @rand() #8
  %64 = sext i32 %63 to i64
  %65 = or i64 %62, %64
  %66 = load i32, ptr @p, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = srem i64 %65, %67
  %69 = trunc i64 %68 to i32
  %70 = getelementptr inbounds %struct.Triple, ptr %3, i32 0, i32 1
  store i32 %69, ptr %70, align 4, !tbaa !13
  %71 = call i32 @rand() #8
  %72 = sext i32 %71 to i64
  %73 = shl i64 %72, 15
  %74 = call i32 @rand() #8
  %75 = sext i32 %74 to i64
  %76 = or i64 %73, %75
  %77 = load i32, ptr @p, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = srem i64 %76, %78
  %80 = trunc i64 %79 to i32
  %81 = getelementptr inbounds %struct.Triple, ptr %3, i32 0, i32 2
  store i32 %80, ptr %81, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 12, ptr %4) #8
  %82 = load i32, ptr @p, align 4, !tbaa !5
  %83 = sub nsw i32 %82, 1
  %84 = sdiv i32 %83, 3
  %85 = call { i64, i32 } @_ZN6Triple3powEi(ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef %84)
  store { i64, i32 } %85, ptr %5, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 8 %5, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 4 %4, i64 12, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #8
  br label %86

86:                                               ; preds = %48
  %87 = getelementptr inbounds %struct.Triple, ptr %3, i32 0, i32 0
  %88 = load i32, ptr %87, align 4, !tbaa !11
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %94, label %90

90:                                               ; preds = %86
  %91 = getelementptr inbounds %struct.Triple, ptr %3, i32 0, i32 2
  %92 = load i32, ptr %91, align 4, !tbaa !14
  %93 = icmp ne i32 %92, 0
  br label %94

94:                                               ; preds = %90, %86
  %95 = phi i1 [ true, %86 ], [ %93, %90 ]
  br i1 %95, label %48, label %96, !llvm.loop !16

96:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %97 = load i32, ptr @p, align 4, !tbaa !5
  %98 = sub nsw i32 %97, 3
  %99 = call noundef i32 @_Z8mod_sqrti(i32 noundef %98)
  %100 = sext i32 %99 to i64
  %101 = sub nsw i64 %100, 1
  %102 = load i32, ptr @p, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  %104 = ashr i32 %103, 1
  %105 = sext i32 %104 to i64
  %106 = mul nsw i64 %101, %105
  %107 = load i32, ptr @p, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = srem i64 %106, %108
  %110 = trunc i64 %109 to i32
  store i32 %110, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #8
  %111 = getelementptr inbounds %struct.Triple, ptr %3, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !13
  %113 = call noundef i32 @_Z7mod_invi(i32 noundef %112)
  %114 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 0
  store i32 %113, ptr %114, align 4, !tbaa !5
  %115 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 0
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = mul nsw i64 %117, %119
  %121 = load i32, ptr @p, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = srem i64 %120, %122
  %124 = trunc i64 %123 to i32
  %125 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 1
  store i32 %124, ptr %125, align 4, !tbaa !5
  %126 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 1
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = load i32, ptr %6, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = mul nsw i64 %128, %130
  %132 = load i32, ptr @p, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = srem i64 %131, %133
  %135 = trunc i64 %134 to i32
  %136 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 2
  store i32 %135, ptr %136, align 4, !tbaa !5
  %137 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 0
  %138 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 0
  %139 = getelementptr inbounds i32, ptr %138, i64 3
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef %137, ptr noundef %139)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %156, %96
  %141 = load i32, ptr %8, align 4, !tbaa !5
  %142 = icmp slt i32 %141, 3
  br i1 %142, label %144, label %143

143:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %159

144:                                              ; preds = %140
  %145 = load i32, ptr %8, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [3 x i32], ptr %7, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = load i32, ptr %8, align 4, !tbaa !5
  %150 = icmp eq i32 %149, 2
  %151 = zext i1 %150 to i64
  %152 = getelementptr inbounds [3 x i8], ptr @.str.5, i64 0, i64 %151
  %153 = load i8, ptr %152, align 1, !tbaa !17
  %154 = sext i8 %153 to i32
  %155 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %148, i32 noundef %154)
  br label %156

156:                                              ; preds = %144
  %157 = load i32, ptr %8, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %8, align 4, !tbaa !5
  br label %140, !llvm.loop !18

159:                                              ; preds = %143
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %3) #8
  br label %12, !llvm.loop !9

160:                                              ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #6

; Function Attrs: nounwind
declare void @srand(i32 noundef) #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #3

declare i32 @printf(ptr noundef, ...) #6

declare i32 @puts(ptr noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZN6Triple3powEi(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #7

attributes #0 = { mustprogress 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 = { 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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "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 = { 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 #8 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS6Triple", !6, i64 0, !6, i64 4, !6, i64 8}
!13 = !{!12, !6, i64 4}
!14 = !{!12, !6, i64 8}
!15 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!16 = distinct !{!16, !10}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !10}


; 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.Triple = type { i32, i32, i32 }

@a = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(i32 noundef, i32 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

; 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 uwtable
declare dso_local noundef i32 @_Z7mod_invi(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z8mod_sqrti(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca i32, align 4
  %2 = alloca %struct.Triple, align 8
  %3 = alloca [3 x i32], align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %5 = call i64 @time(ptr noundef null) #7
  %6 = trunc i64 %5 to i32
  call void @srand(i32 noundef %6) #7
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  store i32 %8, ptr %1, align 4, !tbaa !5
  %.not14 = icmp eq i32 %7, 0
  br i1 %.not14, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %9 = getelementptr inbounds i8, ptr %2, i64 4
  %10 = getelementptr inbounds i8, ptr %2, i64 8
  %11 = getelementptr inbounds i8, ptr %3, i64 4
  %12 = getelementptr inbounds i8, ptr %3, i64 8
  %13 = getelementptr inbounds i8, ptr %3, i64 12
  %14 = load i8, ptr @.str.5, align 1
  %15 = sext i8 %14 to i32
  %16 = load i8, ptr getelementptr inbounds (i8, ptr @.str.5, i64 1), align 1
  %17 = sext i8 %16 to i32
  br label %18

18:                                               ; preds = %.lr.ph, %.backedge
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @p, ptr noundef nonnull @a)
  %20 = load i32, ptr @a, align 4, !tbaa !5
  %21 = icmp eq i32 %20, 0
  %22 = load i32, ptr @p, align 4
  %23 = icmp slt i32 %22, 4
  %or.cond = select i1 %21, i1 true, i1 %23
  br i1 %or.cond, label %24, label %28

24:                                               ; preds = %18
  %25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20)
  br label %.backedge

.backedge:                                        ; preds = %24, %30, %40, %81
  %26 = load i32, ptr %1, align 4, !tbaa !5
  %27 = add nsw i32 %26, -1
  store i32 %27, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %26, 0
  br i1 %.not, label %._crit_edge, label %18, !llvm.loop !9

28:                                               ; preds = %18
  %29 = urem i32 %22, 3
  %.not10 = icmp eq i32 %29, 1
  br i1 %.not10, label %36, label %30

30:                                               ; preds = %28
  %31 = shl nuw i32 %22, 1
  %32 = add nsw i32 %31, -1
  %33 = sdiv i32 %32, 3
  %34 = call noundef i32 @_Z7mod_powii(i32 noundef %20, i32 noundef %33)
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34)
  br label %.backedge

36:                                               ; preds = %28
  %37 = add nsw i32 %22, -1
  %38 = udiv i32 %37, 3
  %39 = call noundef i32 @_Z7mod_powii(i32 noundef %20, i32 noundef %38)
  %.not11 = icmp eq i32 %39, 1
  br i1 %.not11, label %42, label %40

40:                                               ; preds = %36
  %41 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %.backedge

42:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #7
  br label %43

43:                                               ; preds = %43, %42
  %44 = call i32 @rand() #7
  %45 = sext i32 %44 to i64
  %46 = shl nsw i64 %45, 15
  %47 = call i32 @rand() #7
  %48 = sext i32 %47 to i64
  %49 = or i64 %46, %48
  %50 = load i32, ptr @p, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = srem i64 %49, %51
  %53 = trunc nsw i64 %52 to i32
  store i32 %53, ptr %2, align 8, !tbaa !11
  %54 = call i32 @rand() #7
  %55 = sext i32 %54 to i64
  %56 = shl nsw i64 %55, 15
  %57 = call i32 @rand() #7
  %58 = sext i32 %57 to i64
  %59 = or i64 %56, %58
  %60 = load i32, ptr @p, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = srem i64 %59, %61
  %63 = trunc nsw i64 %62 to i32
  store i32 %63, ptr %9, align 4, !tbaa !13
  %64 = call i32 @rand() #7
  %65 = sext i32 %64 to i64
  %66 = shl nsw i64 %65, 15
  %67 = call i32 @rand() #7
  %68 = sext i32 %67 to i64
  %69 = or i64 %66, %68
  %70 = load i32, ptr @p, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = srem i64 %69, %71
  %73 = trunc nsw i64 %72 to i32
  store i32 %73, ptr %10, align 8, !tbaa !14
  %74 = add nsw i32 %70, -1
  %75 = sdiv i32 %74, 3
  %76 = call { i64, i32 } @_ZN6Triple3powEi(ptr noundef nonnull align 4 dereferenceable(12) %2, i32 noundef %75)
  %.fca.0.extract = extractvalue { i64, i32 } %76, 0
  %.fca.1.extract = extractvalue { i64, i32 } %76, 1
  store i64 %.fca.0.extract, ptr %2, align 8
  store i32 %.fca.1.extract, ptr %10, align 8, !tbaa !5
  %77 = and i64 %.fca.0.extract, 4294967295
  %78 = icmp ne i64 %77, 0
  %79 = icmp ne i32 %.fca.1.extract, 0
  %80 = select i1 %78, i1 true, i1 %79
  br i1 %80, label %43, label %81, !llvm.loop !15

81:                                               ; preds = %43
  %82 = load i32, ptr @p, align 4, !tbaa !5
  %83 = add nsw i32 %82, -3
  %84 = call noundef i32 @_Z8mod_sqrti(i32 noundef %83)
  %85 = sext i32 %84 to i64
  %86 = add nsw i64 %85, -1
  %87 = load i32, ptr @p, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  %89 = ashr i32 %88, 1
  %90 = sext i32 %89 to i64
  %91 = mul nsw i64 %86, %90
  %92 = sext i32 %87 to i64
  %93 = srem i64 %91, %92
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #7
  %94 = load i32, ptr %9, align 4, !tbaa !13
  %95 = call noundef i32 @_Z7mod_invi(i32 noundef %94)
  store i32 %95, ptr %3, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = mul nsw i64 %93, %96
  %98 = load i32, ptr @p, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = srem i64 %97, %99
  %101 = trunc nsw i64 %100 to i32
  store i32 %101, ptr %11, align 4, !tbaa !5
  %102 = mul nsw i64 %100, %93
  %103 = srem i64 %102, %99
  %104 = trunc nsw i64 %103 to i32
  store i32 %104, ptr %12, align 4, !tbaa !5
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull %3, ptr noundef nonnull %13)
  %105 = load i32, ptr %3, align 4, !tbaa !5
  %106 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %105, i32 noundef %15)
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %107, i32 noundef %15)
  %109 = load i32, ptr %12, align 4, !tbaa !5
  %110 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %109, i32 noundef %17)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #7
  br label %.backedge

._crit_edge:                                      ; preds = %.backedge, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZN6Triple3powEi(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #6

attributes #0 = { mustprogress 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 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 = { 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 #4 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree 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 #6 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS6Triple", !6, i64 0, !6, i64 4, !6, i64 8}
!13 = !{!12, !6, i64 4}
!14 = !{!12, !6, i64 8}
!15 = distinct !{!15, !10}


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