; LLVM IR from sgtlaugh/algovault :: code_library (simulated_annealing)

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

@n = external dso_local global i32, align 4
@ar = external dso_local global [52 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@bits = external dso_local global [52 x i32], align 16
@last_bits = external dso_local global [52 x i32], align 16
@m = external dso_local global i32, align 4
@adj = external dso_local global [52 x i32], align 16
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local double @rand_real() #0

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @solve() #0

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  store i32 0, ptr %1, align 4
  call void @srand(i32 noundef 17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  br label %16

16:                                               ; preds = %199, %0
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %18 = icmp ne i32 %17, -1
  br i1 %18, label %19, label %202

19:                                               ; preds = %16
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %29, %19
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %24, label %32

24:                                               ; preds = %20
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [52 x i32], ptr @ar, i64 0, i64 %26
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %27)
  br label %29

29:                                               ; preds = %24
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %3, align 4, !tbaa !5
  br label %20, !llvm.loop !9

32:                                               ; preds = %20
  call void @llvm.memset.p0.i64(ptr align 16 @bits, i8 0, i64 208, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @last_bits, i8 0, i64 208, i1 false)
  %33 = call i32 @solve()
  store i32 %33, ptr %12, align 4, !tbaa !5
  store i32 %33, ptr %11, align 4, !tbaa !5
  store i32 180000, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store double 1.000000e+09, ptr %14, align 8, !tbaa !11
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %196, %32
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = load i32, ptr %9, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %38, label %199

38:                                               ; preds = %34
  %39 = load i32, ptr %9, align 4, !tbaa !5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sub nsw i32 %39, %40
  %42 = sub nsw i32 %41, 1
  %43 = load i32, ptr @n, align 4, !tbaa !5
  %44 = mul nsw i32 %42, %43
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = sdiv i32 %44, %45
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr @m, align 4, !tbaa !5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %60, %38
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %52, label %63

52:                                               ; preds = %48
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [52 x i32], ptr @bits, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [52 x i32], ptr @last_bits, i64 0, i64 %58
  store i32 %56, ptr %59, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %52
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %3, align 4, !tbaa !5
  br label %48, !llvm.loop !13

63:                                               ; preds = %48
  br label %64

64:                                               ; preds = %68, %63
  %65 = load i32, ptr @m, align 4, !tbaa !5
  %66 = add nsw i32 %65, -1
  store i32 %66, ptr @m, align 4, !tbaa !5
  %67 = icmp ne i32 %65, 0
  br i1 %67, label %68, label %76

68:                                               ; preds = %64
  %69 = call i32 @rand() #5
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %71 = srem i32 %69, %70
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [52 x i32], ptr @bits, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = xor i32 %74, 1
  store i32 %75, ptr %73, align 4, !tbaa !5
  br label %64, !llvm.loop !14

76:                                               ; preds = %64
  store i32 0, ptr %3, align 4, !tbaa !5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %94, %76
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %81, label %97

81:                                               ; preds = %77
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [52 x i32], ptr @bits, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %93

87:                                               ; preds = %81
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %10, align 4, !tbaa !5
  %91 = sext i32 %89 to i64
  %92 = getelementptr inbounds [52 x i32], ptr @adj, i64 0, i64 %91
  store i32 %88, ptr %92, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %87, %81
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %3, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %3, align 4, !tbaa !5
  br label %77, !llvm.loop !15

97:                                               ; preds = %77
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %143, %97
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = icmp slt i32 %99, 2
  br i1 %100, label %101, label %146

101:                                              ; preds = %98
  store i32 0, ptr %3, align 4, !tbaa !5
  %102 = load i32, ptr %10, align 4, !tbaa !5
  %103 = sub nsw i32 %102, 1
  store i32 %103, ptr %4, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %132, %101
  %105 = load i32, ptr %3, align 4, !tbaa !5
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = icmp slt i32 %105, %106
  br i1 %107, label %108, label %137

108:                                              ; preds = %104
  %109 = load i32, ptr %3, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [52 x i32], ptr @adj, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  store i32 %112, ptr %7, align 4, !tbaa !5
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [52 x i32], ptr @adj, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  store i32 %116, ptr %8, align 4, !tbaa !5
  %117 = load i32, ptr %7, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [52 x i32], ptr @ar, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  store i32 %120, ptr %6, align 4, !tbaa !5
  %121 = load i32, ptr %8, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [52 x i32], ptr @ar, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = load i32, ptr %7, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [52 x i32], ptr @ar, i64 0, i64 %126
  store i32 %124, ptr %127, align 4, !tbaa !5
  %128 = load i32, ptr %6, align 4, !tbaa !5
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [52 x i32], ptr @ar, i64 0, i64 %130
  store i32 %128, ptr %131, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %108
  %133 = load i32, ptr %3, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %3, align 4, !tbaa !5
  %135 = load i32, ptr %4, align 4, !tbaa !5
  %136 = add nsw i32 %135, -1
  store i32 %136, ptr %4, align 4, !tbaa !5
  br label %104, !llvm.loop !16

137:                                              ; preds = %104
  %138 = load i32, ptr %5, align 4, !tbaa !5
  %139 = icmp eq i32 %138, 0
  br i1 %139, label %140, label %142

140:                                              ; preds = %137
  %141 = call i32 @solve()
  store i32 %141, ptr %13, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %140, %137
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %5, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %5, align 4, !tbaa !5
  br label %98, !llvm.loop !17

146:                                              ; preds = %98
  %147 = load i32, ptr %13, align 4, !tbaa !5
  %148 = load i32, ptr %12, align 4, !tbaa !5
  %149 = icmp sgt i32 %147, %148
  br i1 %149, label %150, label %152

150:                                              ; preds = %146
  %151 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %151, ptr %12, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %150, %146
  %153 = load i32, ptr %13, align 4, !tbaa !5
  %154 = load i32, ptr %11, align 4, !tbaa !5
  %155 = icmp sgt i32 %153, %154
  br i1 %155, label %156, label %158

156:                                              ; preds = %152
  %157 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %157, ptr %11, align 4, !tbaa !5
  br label %189

158:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %159 = load i32, ptr %13, align 4, !tbaa !5
  %160 = load i32, ptr %11, align 4, !tbaa !5
  %161 = sub nsw i32 %159, %160
  %162 = sitofp i32 %161 to double
  %163 = load double, ptr %14, align 8, !tbaa !11
  %164 = fdiv double %162, %163
  %165 = call double @exp(double noundef %164) #5
  store double %165, ptr %15, align 8, !tbaa !11
  %166 = call double @rand_real()
  %167 = load double, ptr %15, align 8, !tbaa !11
  %168 = fcmp ole double %166, %167
  br i1 %168, label %169, label %171

169:                                              ; preds = %158
  %170 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %170, ptr %11, align 4, !tbaa !5
  br label %188

171:                                              ; preds = %158
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %172

172:                                              ; preds = %184, %171
  %173 = load i32, ptr %3, align 4, !tbaa !5
  %174 = load i32, ptr @n, align 4, !tbaa !5
  %175 = icmp slt i32 %173, %174
  br i1 %175, label %176, label %187

176:                                              ; preds = %172
  %177 = load i32, ptr %3, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [52 x i32], ptr @last_bits, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = load i32, ptr %3, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [52 x i32], ptr @bits, i64 0, i64 %182
  store i32 %180, ptr %183, align 4, !tbaa !5
  br label %184

184:                                              ; preds = %176
  %185 = load i32, ptr %3, align 4, !tbaa !5
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %3, align 4, !tbaa !5
  br label %172, !llvm.loop !18

187:                                              ; preds = %172
  br label %188

188:                                              ; preds = %187, %169
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %189

189:                                              ; preds = %188, %156
  %190 = load double, ptr %14, align 8, !tbaa !11
  %191 = fcmp ogt double %190, 0x3BC79CA10C924223
  br i1 %191, label %192, label %195

192:                                              ; preds = %189
  %193 = load double, ptr %14, align 8, !tbaa !11
  %194 = fmul double %193, 0x3FEFE76C8B439581
  store double %194, ptr %14, align 8, !tbaa !11
  br label %195

195:                                              ; preds = %192, %189
  br label %196

196:                                              ; preds = %195
  %197 = load i32, ptr %2, align 4, !tbaa !5
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %2, align 4, !tbaa !5
  br label %34, !llvm.loop !19

199:                                              ; preds = %34
  %200 = load i32, ptr %12, align 4, !tbaa !5
  %201 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %200)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %16, !llvm.loop !20

202:                                              ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

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

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

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

; Function Attrs: nounwind
declare double @exp(double noundef) #1

declare i32 @printf(ptr noundef, ...) #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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }

!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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !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"

@n = external dso_local global i32, align 4
@ar = external dso_local global [52 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@bits = external dso_local local_unnamed_addr global [52 x i32], align 16
@last_bits = external dso_local local_unnamed_addr global [52 x i32], align 16
@m = external dso_local local_unnamed_addr global i32, align 4
@adj = external dso_local local_unnamed_addr global [52 x i32], align 16
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local double @rand_real() local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @solve() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  tail call void @srand(i32 noundef 17) #7
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %.not96 = icmp eq i32 %1, -1
  br i1 %.not96, label %._crit_edge98, label %.preheader72

.preheader72:                                     ; preds = %0, %96
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader72, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader72 ]
  %4 = getelementptr inbounds [52 x i32], ptr @ar, i64 0, i64 %indvars.iv
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %4)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = icmp slt i64 %indvars.iv.next, %7
  br i1 %8, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %.preheader72
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) @bits, i8 0, i64 208, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) @last_bits, i8 0, i64 208, i1 false)
  %9 = tail call i32 @solve()
  br label %10

10:                                               ; preds = %._crit_edge, %.loopexit
  %.095 = phi i32 [ 0, %._crit_edge ], [ %95, %.loopexit ]
  %.05094 = phi double [ 1.000000e+09, %._crit_edge ], [ %.1, %.loopexit ]
  %.05392 = phi i32 [ %9, %._crit_edge ], [ %spec.select, %.loopexit ]
  %.05591 = phi i32 [ %9, %._crit_edge ], [ %.257, %.loopexit ]
  %11 = sub nuw nsw i32 179999, %.095
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = mul nsw i32 %12, %11
  %14 = sdiv i32 %13, 180000
  %15 = icmp sgt i32 %12, 0
  br i1 %15, label %.lr.ph76.preheader, label %.preheader71

.lr.ph76.preheader:                               ; preds = %10
  %16 = zext nneg i32 %12 to i64
  %17 = shl nuw nsw i64 %16, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @last_bits, ptr nonnull align 16 @bits, i64 %17, i1 false), !tbaa !5
  br label %.preheader71

.preheader71:                                     ; preds = %.lr.ph76.preheader, %10
  store i32 %14, ptr @m, align 4, !tbaa !5
  %.off = add i32 %13, 359999
  %.not6677 = icmp ult i32 %.off, 180000
  br i1 %.not6677, label %.preheader70, label %.lr.ph78

.preheader70:                                     ; preds = %.lr.ph78, %.preheader71
  %18 = phi i32 [ %12, %.preheader71 ], [ %22, %.lr.ph78 ]
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph81.preheader, label %.split.us.loopexit99

.lr.ph81.preheader:                               ; preds = %.preheader70
  %wide.trip.count = zext nneg i32 %18 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %20 = icmp eq i32 %18, 1
  br i1 %20, label %.preheader69.unr-lcssa, label %.lr.ph81.preheader.new

.lr.ph81.preheader.new:                           ; preds = %.lr.ph81.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph81

.lr.ph78:                                         ; preds = %.preheader71, %.lr.ph78
  %21 = tail call i32 @rand() #7
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = srem i32 %21, %22
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [52 x i32], ptr @bits, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = xor i32 %26, 1
  store i32 %27, ptr %25, align 4, !tbaa !5
  %28 = load i32, ptr @m, align 4, !tbaa !5
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr @m, align 4, !tbaa !5
  %.not66 = icmp eq i32 %28, 0
  br i1 %.not66, label %.preheader70, label %.lr.ph78, !llvm.loop !11

.preheader69.unr-lcssa:                           ; preds = %79, %.lr.ph81.preheader
  %.159.lcssa.ph = phi i32 [ poison, %.lr.ph81.preheader ], [ %.159.1, %79 ]
  %indvars.iv104.unr = phi i64 [ 0, %.lr.ph81.preheader ], [ %indvars.iv.next105.1, %79 ]
  %.05880.unr = phi i32 [ 0, %.lr.ph81.preheader ], [ %.159.1, %79 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader69, label %.lr.ph81.epil

.lr.ph81.epil:                                    ; preds = %.preheader69.unr-lcssa
  %30 = getelementptr inbounds [52 x i32], ptr @bits, i64 0, i64 %indvars.iv104.unr
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %.not67.epil = icmp eq i32 %31, 0
  br i1 %.not67.epil, label %.preheader69, label %32

32:                                               ; preds = %.lr.ph81.epil
  %33 = add nsw i32 %.05880.unr, 1
  %34 = sext i32 %.05880.unr to i64
  %35 = getelementptr inbounds [52 x i32], ptr @adj, i64 0, i64 %34
  %36 = trunc nuw nsw i64 %indvars.iv104.unr to i32
  store i32 %36, ptr %35, align 4, !tbaa !5
  br label %.preheader69

.preheader69:                                     ; preds = %.lr.ph81.epil, %32, %.preheader69.unr-lcssa
  %.159.lcssa = phi i32 [ %.159.lcssa.ph, %.preheader69.unr-lcssa ], [ %33, %32 ], [ %.05880.unr, %.lr.ph81.epil ]
  %37 = icmp sgt i32 %.159.lcssa, 1
  br i1 %37, label %.preheader.us.preheader, label %.split.us.loopexit99

.preheader.us.preheader:                          ; preds = %.preheader69
  %38 = zext nneg i32 %.159.lcssa to i64
  %39 = add nsw i64 %38, -1
  br label %53

.preheader.us.1:                                  ; preds = %53
  %40 = tail call i32 @solve()
  br label %41

41:                                               ; preds = %41, %.preheader.us.1
  %indvars.iv109.1 = phi i64 [ 0, %.preheader.us.1 ], [ %indvars.iv.next110.1, %41 ]
  %indvars.iv107.1 = phi i64 [ %39, %.preheader.us.1 ], [ %indvars.iv.next108.1, %41 ]
  %42 = getelementptr inbounds [52 x i32], ptr @adj, i64 0, i64 %indvars.iv109.1
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = getelementptr inbounds [52 x i32], ptr @adj, i64 0, i64 %indvars.iv107.1
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = sext i32 %43 to i64
  %47 = getelementptr inbounds [52 x i32], ptr @ar, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sext i32 %45 to i64
  %50 = getelementptr inbounds [52 x i32], ptr @ar, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  store i32 %51, ptr %47, align 4, !tbaa !5
  store i32 %48, ptr %50, align 4, !tbaa !5
  %indvars.iv.next110.1 = add nuw nsw i64 %indvars.iv109.1, 1
  %indvars.iv.next108.1 = add nsw i64 %indvars.iv107.1, -1
  %52 = icmp slt i64 %indvars.iv.next110.1, %indvars.iv.next108.1
  br i1 %52, label %41, label %.split.us, !llvm.loop !12

53:                                               ; preds = %.preheader.us.preheader, %53
  %indvars.iv109 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next110, %53 ]
  %indvars.iv107 = phi i64 [ %39, %.preheader.us.preheader ], [ %indvars.iv.next108, %53 ]
  %54 = getelementptr inbounds [52 x i32], ptr @adj, i64 0, i64 %indvars.iv109
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = getelementptr inbounds [52 x i32], ptr @adj, i64 0, i64 %indvars.iv107
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %55 to i64
  %59 = getelementptr inbounds [52 x i32], ptr @ar, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %57 to i64
  %62 = getelementptr inbounds [52 x i32], ptr @ar, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  store i32 %63, ptr %59, align 4, !tbaa !5
  store i32 %60, ptr %62, align 4, !tbaa !5
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %indvars.iv.next108 = add nsw i64 %indvars.iv107, -1
  %64 = icmp slt i64 %indvars.iv.next110, %indvars.iv.next108
  br i1 %64, label %53, label %.preheader.us.1, !llvm.loop !12

.lr.ph81:                                         ; preds = %79, %.lr.ph81.preheader.new
  %indvars.iv104 = phi i64 [ 0, %.lr.ph81.preheader.new ], [ %indvars.iv.next105.1, %79 ]
  %.05880 = phi i32 [ 0, %.lr.ph81.preheader.new ], [ %.159.1, %79 ]
  %niter = phi i64 [ 0, %.lr.ph81.preheader.new ], [ %niter.next.1, %79 ]
  %65 = getelementptr inbounds [52 x i32], ptr @bits, i64 0, i64 %indvars.iv104
  %66 = load i32, ptr %65, align 8, !tbaa !5
  %.not67 = icmp eq i32 %66, 0
  br i1 %.not67, label %.lr.ph81.1, label %67

67:                                               ; preds = %.lr.ph81
  %68 = add nsw i32 %.05880, 1
  %69 = sext i32 %.05880 to i64
  %70 = getelementptr inbounds [52 x i32], ptr @adj, i64 0, i64 %69
  %71 = trunc nuw nsw i64 %indvars.iv104 to i32
  store i32 %71, ptr %70, align 4, !tbaa !5
  br label %.lr.ph81.1

.lr.ph81.1:                                       ; preds = %.lr.ph81, %67
  %.159 = phi i32 [ %68, %67 ], [ %.05880, %.lr.ph81 ]
  %indvars.iv.next105 = or disjoint i64 %indvars.iv104, 1
  %72 = getelementptr inbounds [52 x i32], ptr @bits, i64 0, i64 %indvars.iv.next105
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %.not67.1 = icmp eq i32 %73, 0
  br i1 %.not67.1, label %79, label %74

74:                                               ; preds = %.lr.ph81.1
  %75 = add nsw i32 %.159, 1
  %76 = sext i32 %.159 to i64
  %77 = getelementptr inbounds [52 x i32], ptr @adj, i64 0, i64 %76
  %78 = trunc nuw nsw i64 %indvars.iv.next105 to i32
  store i32 %78, ptr %77, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %74, %.lr.ph81.1
  %.159.1 = phi i32 [ %75, %74 ], [ %.159, %.lr.ph81.1 ]
  %indvars.iv.next105.1 = add nuw nsw i64 %indvars.iv104, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader69.unr-lcssa, label %.lr.ph81, !llvm.loop !13

.split.us.loopexit99:                             ; preds = %.preheader70, %.preheader69
  %80 = tail call i32 @solve()
  br label %.split.us

.split.us:                                        ; preds = %41, %.split.us.loopexit99
  %.us-phi = phi i32 [ %80, %.split.us.loopexit99 ], [ %40, %41 ]
  %spec.select = tail call i32 @llvm.smax.i32(i32 %.us-phi, i32 %.05392)
  %81 = icmp sgt i32 %.us-phi, %.05591
  br i1 %81, label %.loopexit, label %82

82:                                               ; preds = %.split.us
  %83 = sub nsw i32 %.us-phi, %.05591
  %84 = sitofp i32 %83 to double
  %85 = fdiv double %84, %.05094
  %86 = tail call double @exp(double noundef %85) #7
  %87 = tail call double @rand_real()
  %88 = fcmp ugt double %87, %86
  br i1 %88, label %.preheader68, label %.loopexit

.preheader68:                                     ; preds = %82
  %89 = load i32, ptr @n, align 4, !tbaa !5
  %90 = icmp sgt i32 %89, 0
  br i1 %90, label %.lr.ph90.preheader, label %.loopexit

.lr.ph90.preheader:                               ; preds = %.preheader68
  %91 = zext nneg i32 %89 to i64
  %92 = shl nuw nsw i64 %91, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @bits, ptr nonnull align 16 @last_bits, i64 %92, i1 false), !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph90.preheader, %.preheader68, %82, %.split.us
  %.257 = phi i32 [ %.us-phi, %.split.us ], [ %.us-phi, %82 ], [ %.05591, %.preheader68 ], [ %.05591, %.lr.ph90.preheader ]
  %93 = fcmp ogt double %.05094, 0x3BC79CA10C924223
  %94 = fmul double %.05094, 0x3FEFE76C8B439581
  %.1 = select i1 %93, double %94, double %.05094
  %95 = add nuw nsw i32 %.095, 1
  %exitcond117.not = icmp eq i32 %95, 180000
  br i1 %exitcond117.not, label %96, label %10, !llvm.loop !14

96:                                               ; preds = %.loopexit
  %97 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
  %98 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %.not = icmp eq i32 %98, -1
  br i1 %.not, label %._crit_edge98, label %.preheader72, !llvm.loop !15

._crit_edge98:                                    ; preds = %96, %0
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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: mustprogress nofree nounwind willreturn memory(write)
declare double @exp(double noundef) local_unnamed_addr #4

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

; 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) #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 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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