; LLVM IR from tangjz/acm-icpc :: leetcode/extra (DD_2020002-算式转移)

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

@_ZZ4mainE3val = external hidden global [100001 x i32], align 16
@_ZZ4mainE2op = external hidden global [100001 x i8], align 16
@_ZZ4mainE3buf = external hidden global [3 x i8], align 1
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1

; 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
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef @_ZZ4mainE3val)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %24, %0
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %27

15:                                               ; preds = %10
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds i32, ptr @_ZZ4mainE3val, i64 %17
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @_ZZ4mainE3buf, ptr noundef %18)
  %20 = load i8, ptr @_ZZ4mainE3buf, align 1, !tbaa !9
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %22
  store i8 %20, ptr %23, align 1, !tbaa !9
  br label %24

24:                                               ; preds = %15
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %3, align 4, !tbaa !5
  br label %10, !llvm.loop !10

27:                                               ; preds = %14
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %29
  store i8 0, ptr %30, align 1, !tbaa !9
  store i8 0, ptr @_ZZ4mainE2op, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  br label %31

31:                                               ; preds = %161, %27
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %163

37:                                               ; preds = %31
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %5, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %62, %37
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %45, label %59

45:                                               ; preds = %40
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !9
  %51 = sext i8 %50 to i32
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %54
  %56 = load i8, ptr %55, align 1, !tbaa !9
  %57 = sext i8 %56 to i32
  %58 = icmp eq i32 %51, %57
  br label %59

59:                                               ; preds = %45, %40
  %60 = phi i1 [ false, %40 ], [ %58, %45 ]
  br i1 %60, label %61, label %65

61:                                               ; preds = %59
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %5, align 4, !tbaa !5
  br label %40, !llvm.loop !12

65:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %66 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %66, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %67 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %67, ptr %7, align 4, !tbaa !5
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %70
  %72 = load i8, ptr %71, align 1, !tbaa !9
  %73 = sext i8 %72 to i32
  %74 = icmp eq i32 %73, 43
  br i1 %74, label %83, label %75

75:                                               ; preds = %65
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !9
  %81 = sext i8 %80 to i32
  %82 = icmp eq i32 %81, 45
  br i1 %82, label %83, label %126

83:                                               ; preds = %75, %65
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = icmp sgt i32 %84, 0
  br i1 %85, label %94, label %86

86:                                               ; preds = %83
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %89
  %91 = load i8, ptr %90, align 1, !tbaa !9
  %92 = sext i8 %91 to i32
  %93 = icmp ne i32 %92, 43
  br label %94

94:                                               ; preds = %86, %83
  %95 = phi i1 [ true, %83 ], [ %93, %86 ]
  %96 = zext i1 %95 to i32
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = add nsw i32 %97, %96
  store i32 %98, ptr %6, align 4, !tbaa !5
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  %101 = load i32, ptr %2, align 4, !tbaa !5
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %103, label %121

103:                                              ; preds = %94
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %106
  %108 = load i8, ptr %107, align 1, !tbaa !9
  %109 = sext i8 %108 to i32
  %110 = icmp eq i32 %109, 42
  br i1 %110, label %119, label %111

111:                                              ; preds = %103
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %114
  %116 = load i8, ptr %115, align 1, !tbaa !9
  %117 = sext i8 %116 to i32
  %118 = icmp eq i32 %117, 47
  br label %119

119:                                              ; preds = %111, %103
  %120 = phi i1 [ true, %103 ], [ %118, %111 ]
  br label %121

121:                                              ; preds = %119, %94
  %122 = phi i1 [ false, %94 ], [ %120, %119 ]
  %123 = zext i1 %122 to i32
  %124 = load i32, ptr %7, align 4, !tbaa !5
  %125 = sub nsw i32 %124, %123
  store i32 %125, ptr %7, align 4, !tbaa !5
  br label %153

126:                                              ; preds = %75
  %127 = load i32, ptr %4, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %129
  %131 = load i8, ptr %130, align 1, !tbaa !9
  %132 = sext i8 %131 to i32
  %133 = icmp eq i32 %132, 42
  br i1 %133, label %134, label %149

134:                                              ; preds = %126
  %135 = load i32, ptr %4, align 4, !tbaa !5
  %136 = icmp sgt i32 %135, 0
  br i1 %136, label %137, label %144

137:                                              ; preds = %134
  %138 = load i32, ptr %4, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %139
  %141 = load i8, ptr %140, align 1, !tbaa !9
  %142 = sext i8 %141 to i32
  %143 = icmp eq i32 %142, 47
  br label %144

144:                                              ; preds = %137, %134
  %145 = phi i1 [ false, %134 ], [ %143, %137 ]
  %146 = zext i1 %145 to i32
  %147 = load i32, ptr %6, align 4, !tbaa !5
  %148 = add nsw i32 %147, %146
  store i32 %148, ptr %6, align 4, !tbaa !5
  br label %152

149:                                              ; preds = %126
  %150 = load i32, ptr %6, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %6, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %149, %144
  br label %153

153:                                              ; preds = %152, %121
  %154 = load i32, ptr %6, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds i32, ptr @_ZZ4mainE3val, i64 %155
  %157 = load i32, ptr %7, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds i32, ptr @_ZZ4mainE3val, i64 %158
  %160 = getelementptr inbounds i32, ptr %159, i64 1
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef %156, ptr noundef %160)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %161

161:                                              ; preds = %153
  %162 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %162, ptr %4, align 4, !tbaa !5
  br label %31, !llvm.loop !13

163:                                              ; preds = %36
  %164 = load i32, ptr @_ZZ4mainE3val, align 16, !tbaa !5
  %165 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %164)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %182, %163
  %167 = load i32, ptr %8, align 4, !tbaa !5
  %168 = load i32, ptr %2, align 4, !tbaa !5
  %169 = icmp slt i32 %167, %168
  br i1 %169, label %171, label %170

170:                                              ; preds = %166
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %185

171:                                              ; preds = %166
  %172 = load i32, ptr %8, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %173
  %175 = load i8, ptr %174, align 1, !tbaa !9
  %176 = sext i8 %175 to i32
  %177 = load i32, ptr %8, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3val, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %176, i32 noundef %180)
  br label %182

182:                                              ; preds = %171
  %183 = load i32, ptr %8, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %8, align 4, !tbaa !5
  br label %166, !llvm.loop !14

185:                                              ; preds = %170
  %186 = call i32 @puts(ptr noundef @.str.4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  ret i32 0
}

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

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

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

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

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

declare i32 @puts(ptr noundef) #2

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}


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

@_ZZ4mainE3val = external hidden global [100001 x i32], align 16
@_ZZ4mainE2op = external hidden local_unnamed_addr global [100001 x i8], align 16
@_ZZ4mainE3buf = external hidden global [3 x i8], align 1
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull @_ZZ4mainE3val)
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %4 = icmp sgt i32 %3, 1
  br i1 %4, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0
  %.pre = sext i32 %3 to i64
  %5 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %.pre
  store i8 0, ptr %5, align 1, !tbaa !9
  store i8 0, ptr @_ZZ4mainE2op, align 16, !tbaa !9
  br label %._crit_edge48

._crit_edge:                                      ; preds = %.lr.ph
  %6 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %13
  store i8 0, ptr %6, align 1, !tbaa !9
  store i8 0, ptr @_ZZ4mainE2op, align 16, !tbaa !9
  %7 = icmp sgt i32 %12, 1
  br i1 %7, label %.preheader, label %._crit_edge48

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %8 = getelementptr inbounds i32, ptr @_ZZ4mainE3val, i64 %indvars.iv
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @_ZZ4mainE3buf, ptr noundef nonnull %8)
  %10 = load i8, ptr @_ZZ4mainE3buf, align 1, !tbaa !9
  %11 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %indvars.iv
  store i8 %10, ptr %11, align 1, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = icmp slt i64 %indvars.iv.next, %13
  br i1 %14, label %.lr.ph, label %._crit_edge, !llvm.loop !10

.preheader:                                       ; preds = %._crit_edge, %59
  %15 = phi i32 [ %64, %59 ], [ %12, %._crit_edge ]
  %16 = phi i32 [ %63, %59 ], [ 1, %._crit_edge ]
  %.03647 = phi i32 [ %.035.lcssa, %59 ], [ 0, %._crit_edge ]
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %17
  %19 = sext i32 %15 to i64
  %20 = add nsw i32 %16, 1
  %smax = call i32 @llvm.smax.i32(i32 %15, i32 %20)
  %21 = add nsw i32 %smax, -1
  %.pre.pre = load i8, ptr %18, align 1, !tbaa !9
  br label %26

._crit_edge48:                                    ; preds = %59, %._crit_edge.thread, %._crit_edge
  %22 = load i32, ptr @_ZZ4mainE3val, align 16, !tbaa !5
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22)
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 1
  br i1 %25, label %.lr.ph51, label %._crit_edge52

26:                                               ; preds = %.preheader, %28
  %indvars.iv56 = phi i64 [ %17, %.preheader ], [ %indvars.iv.next57, %28 ]
  %indvars.iv.next57 = add nsw i64 %indvars.iv56, 1
  %27 = icmp slt i64 %indvars.iv.next57, %19
  br i1 %27, label %28, label %.critedge

28:                                               ; preds = %26
  %29 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %indvars.iv.next57
  %30 = load i8, ptr %29, align 1, !tbaa !9
  %31 = icmp eq i8 %30, %.pre.pre
  br i1 %31, label %26, label %.critedge.split.loop.exit65, !llvm.loop !12

.critedge.split.loop.exit65:                      ; preds = %28
  %32 = trunc nsw i64 %indvars.iv56 to i32
  %33 = trunc nsw i64 %indvars.iv.next57 to i32
  br label %.critedge

.critedge:                                        ; preds = %26, %.critedge.split.loop.exit65
  %.035.lcssa = phi i32 [ %32, %.critedge.split.loop.exit65 ], [ %21, %26 ]
  %.lcssa53 = phi i32 [ %33, %.critedge.split.loop.exit65 ], [ %smax, %26 ]
  switch i8 %.pre.pre, label %59 [
    i8 43, label %34
    i8 45, label %34
    i8 42, label %48
  ]

34:                                               ; preds = %.critedge, %.critedge
  %35 = icmp sgt i32 %.03647, 0
  %36 = icmp ne i8 %.pre.pre, 43
  %spec.select43 = or i1 %35, %36
  %37 = zext i1 %spec.select43 to i32
  %38 = add nsw i32 %.03647, %37
  br i1 %27, label %39, label %45

39:                                               ; preds = %34
  %40 = sext i32 %.lcssa53 to i64
  %41 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %43 = icmp eq i8 %42, 42
  %44 = icmp eq i8 %42, 47
  %spec.select = or i1 %43, %44
  br label %45

45:                                               ; preds = %39, %34
  %46 = phi i1 [ false, %34 ], [ %spec.select, %39 ]
  %.neg = sext i1 %46 to i32
  %47 = add i32 %.035.lcssa, %.neg
  br label %59

48:                                               ; preds = %.critedge
  %49 = icmp sgt i32 %.03647, 0
  br i1 %49, label %50, label %55

50:                                               ; preds = %48
  %51 = zext nneg i32 %.03647 to i64
  %52 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %51
  %53 = load i8, ptr %52, align 1, !tbaa !9
  %54 = icmp eq i8 %53, 47
  br label %55

55:                                               ; preds = %50, %48
  %56 = phi i1 [ false, %48 ], [ %54, %50 ]
  %57 = zext i1 %56 to i32
  %58 = add nsw i32 %.03647, %57
  br label %59

59:                                               ; preds = %.critedge, %55, %45
  %.034 = phi i32 [ %38, %45 ], [ %58, %55 ], [ %16, %.critedge ]
  %.033 = phi i32 [ %47, %45 ], [ %.035.lcssa, %55 ], [ %.035.lcssa, %.critedge ]
  %60 = sext i32 %.034 to i64
  %61 = getelementptr inbounds i32, ptr @_ZZ4mainE3val, i64 %60
  %62 = sext i32 %.033 to i64
  %gep = getelementptr i32, ptr getelementptr inbounds (i8, ptr @_ZZ4mainE3val, i64 4), i64 %62
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull %61, ptr noundef nonnull %gep)
  %63 = add nsw i32 %.035.lcssa, 1
  %64 = load i32, ptr %1, align 4, !tbaa !5
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %.preheader, label %._crit_edge48, !llvm.loop !13

._crit_edge52:                                    ; preds = %.lr.ph51, %._crit_edge48
  %66 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

.lr.ph51:                                         ; preds = %._crit_edge48, %.lr.ph51
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %.lr.ph51 ], [ 1, %._crit_edge48 ]
  %67 = getelementptr inbounds [100001 x i8], ptr @_ZZ4mainE2op, i64 0, i64 %indvars.iv59
  %68 = load i8, ptr %67, align 1, !tbaa !9
  %69 = sext i8 %68 to i32
  %70 = getelementptr inbounds [100001 x i32], ptr @_ZZ4mainE3val, i64 0, i64 %indvars.iv59
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %69, i32 noundef %71)
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %73 = load i32, ptr %1, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv.next60, %74
  br i1 %75, label %.lr.ph51, label %._crit_edge52, !llvm.loop !14
}

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

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(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) #4

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}


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