; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/CROC-MBTU 2012, Elimination Round (ACM-ICPC)/Problem C (C)

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@a = external dso_local global [111 x i32], align 16
@ans = 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 [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef 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
  store i32 0, ptr %1, align 4
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp slt i32 %9, 3
  br i1 %10, label %15, label %11

11:                                               ; preds = %0
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = srem i32 %12, 2
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %17

15:                                               ; preds = %11, %0
  %16 = call i32 @puts(ptr noundef @.str.1)
  store i32 0, ptr %1, align 4
  br label %155

17:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %28, %17
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp sle i32 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %31

23:                                               ; preds = %18
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %25
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %26)
  br label %28

28:                                               ; preds = %23
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %2, align 4, !tbaa !5
  br label %18, !llvm.loop !9

31:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %32 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %32, ptr %3, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %145, %31
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 1
  br i1 %35, label %37, label %36

36:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %148

37:                                               ; preds = %33
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = srem i32 %38, 2
  %40 = icmp eq i32 %39, 1
  br i1 %40, label %41, label %94

41:                                               ; preds = %37
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sub nsw i32 %46, 1
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = sub nsw i32 %50, %45
  store i32 %51, ptr %49, align 4, !tbaa !5
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sub nsw i32 %56, 1
  %58 = sdiv i32 %57, 2
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = sub nsw i32 %61, %55
  store i32 %62, ptr %60, align 4, !tbaa !5
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = sub nsw i32 %63, 1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %66, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = sub nsw i32 %69, 1
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %71
  store i32 %68, ptr %72, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = sub nsw i32 %73, 1
  %75 = sdiv i32 %74, 2
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %77, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = sub nsw i32 %80, 1
  %82 = sdiv i32 %81, 2
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %83
  store i32 %79, ptr %84, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = load i32, ptr @ans, align 4, !tbaa !5
  %90 = add nsw i32 %89, %88
  store i32 %90, ptr @ans, align 4, !tbaa !5
  %91 = load i32, ptr %3, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %92
  store i32 0, ptr %93, align 4, !tbaa !5
  br label %144

94:                                               ; preds = %37
  %95 = load i32, ptr %3, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = load i32, ptr %3, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = sub nsw i32 %103, %98
  store i32 %104, ptr %102, align 4, !tbaa !5
  %105 = load i32, ptr %3, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = load i32, ptr %3, align 4, !tbaa !5
  %110 = sdiv i32 %109, 2
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = sub nsw i32 %113, %108
  store i32 %114, ptr %112, align 4, !tbaa !5
  %115 = load i32, ptr %3, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  %119 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %118, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = load i32, ptr %3, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %123
  store i32 %120, ptr %124, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %125 = load i32, ptr %3, align 4, !tbaa !5
  %126 = sdiv i32 %125, 2
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  %129 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %128, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = load i32, ptr %3, align 4, !tbaa !5
  %132 = sdiv i32 %131, 2
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %133
  store i32 %130, ptr %134, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  %135 = load i32, ptr %3, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = load i32, ptr @ans, align 4, !tbaa !5
  %140 = add nsw i32 %139, %138
  store i32 %140, ptr @ans, align 4, !tbaa !5
  %141 = load i32, ptr %3, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %142
  store i32 0, ptr %143, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %94, %41
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %3, align 4, !tbaa !5
  %147 = add nsw i32 %146, -1
  store i32 %147, ptr %3, align 4, !tbaa !5
  br label %33, !llvm.loop !11

148:                                              ; preds = %36
  %149 = load i32, ptr getelementptr inbounds ([111 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5
  %150 = load i32, ptr @ans, align 4, !tbaa !5
  %151 = add nsw i32 %150, %149
  store i32 %151, ptr @ans, align 4, !tbaa !5
  %152 = load i32, ptr @ans, align 4, !tbaa !5
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %152)
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %153, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  br label %155

155:                                              ; preds = %148, %15
  %156 = load i32, ptr %1, align 4
  ret i32 %156
}

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

declare i32 @puts(ptr noundef) #1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

attributes #0 = { 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 #1 = { "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 = { inlinehint 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 #4 = { 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 #5 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !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"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@a = external dso_local global [111 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = icmp slt i32 %6, 3
  %8 = and i32 %6, 1
  %9 = icmp eq i32 %8, 0
  %or.cond = or i1 %7, %9
  br i1 %or.cond, label %10, label %.lr.ph

10:                                               ; preds = %0
  %11 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %63

.preheader:                                       ; preds = %.lr.ph
  %12 = icmp sgt i32 %16, 1
  br i1 %12, label %.lr.ph37.preheader, label %.preheader.._crit_edge_crit_edge

.preheader.._crit_edge_crit_edge:                 ; preds = %.preheader
  %.pre = load i32, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge

.lr.ph37.preheader:                               ; preds = %.preheader
  %13 = zext nneg i32 %16 to i64
  br label %.lr.ph37

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %14 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %indvars.iv
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %14)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %.not.not = icmp slt i64 %indvars.iv, %17
  br i1 %.not.not, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge:                                      ; preds = %60, %.preheader.._crit_edge_crit_edge
  %18 = phi i32 [ %.pre, %.preheader.._crit_edge_crit_edge ], [ %61, %60 ]
  %19 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 4), align 4, !tbaa !5
  %20 = add nsw i32 %18, %19
  store i32 %20, ptr @ans, align 4, !tbaa !5
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %20)
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %63

.lr.ph37:                                         ; preds = %.lr.ph37.preheader, %60
  %indvars.iv40 = phi i64 [ %13, %.lr.ph37.preheader ], [ %indvars.iv.next41.pre-phi, %60 ]
  %23 = and i64 %indvars.iv40, 1
  %.not31 = icmp eq i64 %23, 0
  %24 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %indvars.iv40
  %25 = load i32, ptr %24, align 4, !tbaa !5
  br i1 %.not31, label %43, label %26

26:                                               ; preds = %.lr.ph37
  %27 = add nsw i64 %indvars.iv40, -1
  %28 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = sub nsw i32 %29, %25
  store i32 %30, ptr %28, align 4, !tbaa !5
  %31 = lshr exact i64 %27, 1
  %32 = and i64 %31, 2147483647
  %33 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = sub nsw i32 %34, %25
  store i32 %35, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !5
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %37 = load i32, ptr %36, align 4, !tbaa !5
  store i32 %37, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %33, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %39 = load i32, ptr %38, align 4, !tbaa !5
  store i32 %39, ptr %33, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %40 = load i32, ptr %24, align 4, !tbaa !5
  %41 = load i32, ptr @ans, align 4, !tbaa !5
  %42 = add nsw i32 %41, %40
  store i32 %42, ptr @ans, align 4, !tbaa !5
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %60

43:                                               ; preds = %.lr.ph37
  %44 = or disjoint i64 %indvars.iv40, 1
  %45 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sub nsw i32 %46, %25
  store i32 %47, ptr %45, align 4, !tbaa !5
  %48 = lshr exact i64 %indvars.iv40, 1
  %49 = and i64 %48, 2147483647
  %50 = getelementptr inbounds [111 x i32], ptr @a, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = sub nsw i32 %51, %25
  store i32 %52, ptr %50, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %45, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %54 = load i32, ptr %53, align 4, !tbaa !5
  store i32 %54, ptr %45, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %50, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %56 = load i32, ptr %55, align 4, !tbaa !5
  store i32 %56, ptr %50, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %57 = load i32, ptr %24, align 4, !tbaa !5
  %58 = load i32, ptr @ans, align 4, !tbaa !5
  %59 = add nsw i32 %58, %57
  store i32 %59, ptr @ans, align 4, !tbaa !5
  store i32 0, ptr %24, align 4, !tbaa !5
  %.pre43 = add nsw i64 %indvars.iv40, -1
  br label %60

60:                                               ; preds = %26, %43
  %indvars.iv.next41.pre-phi = phi i64 [ %27, %26 ], [ %.pre43, %43 ]
  %61 = phi i32 [ %42, %26 ], [ %59, %43 ]
  %62 = icmp sgt i64 %indvars.iv40, 2
  br i1 %62, label %.lr.ph37, label %._crit_edge, !llvm.loop !11

63:                                               ; preds = %._crit_edge, %10
  ret i32 0
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

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


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