; LLVM IR from tangjz/acm-icpc :: codeforces/complete (663A)

; 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
@tot = external dso_local global i32, align 4
@sgn = external dso_local global [110 x i32], align 16
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@str = external dso_local global [2 x i8], align 1
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i8, align 1
  %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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %2) #4
  store i8 43, ptr %2, align 1, !tbaa !5
  br label %13

13:                                               ; preds = %39, %0
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @str)
  %15 = icmp eq i32 %14, 1
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  store i32 2, ptr %3, align 4
  br label %40

17:                                               ; preds = %13
  %18 = load i8, ptr @str, align 1, !tbaa !5
  %19 = sext i8 %18 to i32
  %20 = icmp eq i32 %19, 63
  br i1 %20, label %21, label %39

21:                                               ; preds = %17
  %22 = load i8, ptr %2, align 1, !tbaa !5
  %23 = sext i8 %22 to i32
  %24 = icmp eq i32 %23, 43
  %25 = zext i1 %24 to i64
  %26 = select i1 %24, i32 1, i32 -1
  %27 = load i32, ptr @tot, align 4, !tbaa !8
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr @tot, align 4, !tbaa !8
  %29 = sext i32 %27 to i64
  %30 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %29
  store i32 %26, ptr %30, align 4, !tbaa !8
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @str)
  %32 = load i8, ptr @str, align 1, !tbaa !5
  store i8 %32, ptr %2, align 1, !tbaa !5
  %33 = load i8, ptr %2, align 1, !tbaa !5
  %34 = sext i8 %33 to i32
  %35 = icmp eq i32 %34, 61
  br i1 %35, label %36, label %38

36:                                               ; preds = %21
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n)
  store i32 2, ptr %3, align 4
  br label %40

38:                                               ; preds = %21
  br label %39

39:                                               ; preds = %38, %17
  br label %13, !llvm.loop !10

40:                                               ; preds = %36, %16
  call void @llvm.lifetime.end.p0(i64 1, ptr %2) #4
  br label %41

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %42

42:                                               ; preds = %70, %41
  %43 = load i32, ptr %4, align 4, !tbaa !8
  %44 = load i32, ptr @tot, align 4, !tbaa !8
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 4, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %73

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %48 = load i32, ptr %4, align 4, !tbaa !8
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !8
  %52 = mul nsw i32 %51, 1
  store i32 %52, ptr %5, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %53 = load i32, ptr %4, align 4, !tbaa !8
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !8
  %57 = load i32, ptr @n, align 4, !tbaa !8
  %58 = mul nsw i32 %56, %57
  store i32 %58, ptr %6, align 4, !tbaa !8
  %59 = load i32, ptr %5, align 4, !tbaa !8
  %60 = load i32, ptr %6, align 4, !tbaa !8
  %61 = icmp sgt i32 %59, %60
  br i1 %61, label %62, label %63

62:                                               ; preds = %47
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6) #4
  br label %63

63:                                               ; preds = %62, %47
  %64 = load i32, ptr %5, align 4, !tbaa !8
  %65 = load i32, ptr @L, align 4, !tbaa !8
  %66 = add nsw i32 %65, %64
  store i32 %66, ptr @L, align 4, !tbaa !8
  %67 = load i32, ptr %6, align 4, !tbaa !8
  %68 = load i32, ptr @R, align 4, !tbaa !8
  %69 = add nsw i32 %68, %67
  store i32 %69, ptr @R, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %70

70:                                               ; preds = %63
  %71 = load i32, ptr %4, align 4, !tbaa !8
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %4, align 4, !tbaa !8
  br label %42, !llvm.loop !12

73:                                               ; preds = %46
  %74 = load i32, ptr @n, align 4, !tbaa !8
  %75 = load i32, ptr @L, align 4, !tbaa !8
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %81, label %77

77:                                               ; preds = %73
  %78 = load i32, ptr @R, align 4, !tbaa !8
  %79 = load i32, ptr @n, align 4, !tbaa !8
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %81, label %83

81:                                               ; preds = %77, %73
  %82 = call i32 @puts(ptr noundef @.str.2)
  store i32 0, ptr %1, align 4
  br label %175

83:                                               ; preds = %77
  %84 = call i32 @puts(ptr noundef @.str.3)
  %85 = load i32, ptr @tot, align 4, !tbaa !8
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %86
  store i32 0, ptr %87, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %88 = load i32, ptr @n, align 4, !tbaa !8
  store i32 %88, ptr %8, align 4, !tbaa !8
  br label %89

89:                                               ; preds = %169, %83
  %90 = load i32, ptr %7, align 4, !tbaa !8
  %91 = load i32, ptr @tot, align 4, !tbaa !8
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 7, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %172

94:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %95 = load i32, ptr %7, align 4, !tbaa !8
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !8
  %99 = mul nsw i32 %98, 1
  store i32 %99, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %100 = load i32, ptr %7, align 4, !tbaa !8
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !8
  %104 = load i32, ptr @n, align 4, !tbaa !8
  %105 = mul nsw i32 %103, %104
  store i32 %105, ptr %10, align 4, !tbaa !8
  %106 = load i32, ptr %9, align 4, !tbaa !8
  %107 = load i32, ptr %10, align 4, !tbaa !8
  %108 = icmp sgt i32 %106, %107
  br i1 %108, label %109, label %110

109:                                              ; preds = %94
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10) #4
  br label %110

110:                                              ; preds = %109, %94
  %111 = load i32, ptr %9, align 4, !tbaa !8
  %112 = load i32, ptr @L, align 4, !tbaa !8
  %113 = sub nsw i32 %112, %111
  store i32 %113, ptr @L, align 4, !tbaa !8
  %114 = load i32, ptr %10, align 4, !tbaa !8
  %115 = load i32, ptr @R, align 4, !tbaa !8
  %116 = sub nsw i32 %115, %114
  store i32 %116, ptr @R, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %117 = load i32, ptr %7, align 4, !tbaa !8
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !8
  %121 = load i32, ptr %8, align 4, !tbaa !8
  %122 = load i32, ptr @L, align 4, !tbaa !8
  %123 = sub nsw i32 %121, %122
  %124 = mul nsw i32 %120, %123
  store i32 %124, ptr %11, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %125 = load i32, ptr %7, align 4, !tbaa !8
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !8
  %129 = load i32, ptr %8, align 4, !tbaa !8
  %130 = load i32, ptr @R, align 4, !tbaa !8
  %131 = sub nsw i32 %129, %130
  %132 = mul nsw i32 %128, %131
  store i32 %132, ptr %12, align 4, !tbaa !8
  %133 = load i32, ptr %11, align 4, !tbaa !8
  %134 = load i32, ptr %12, align 4, !tbaa !8
  %135 = icmp sgt i32 %133, %134
  br i1 %135, label %136, label %137

136:                                              ; preds = %110
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12) #4
  br label %137

137:                                              ; preds = %136, %110
  %138 = load i32, ptr %11, align 4, !tbaa !8
  %139 = icmp slt i32 %138, 1
  br i1 %139, label %140, label %141

140:                                              ; preds = %137
  store i32 1, ptr %11, align 4, !tbaa !8
  br label %141

141:                                              ; preds = %140, %137
  %142 = load i32, ptr %7, align 4, !tbaa !8
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !8
  %146 = load i32, ptr %11, align 4, !tbaa !8
  %147 = mul nsw i32 %145, %146
  %148 = load i32, ptr %8, align 4, !tbaa !8
  %149 = sub nsw i32 %148, %147
  store i32 %149, ptr %8, align 4, !tbaa !8
  %150 = load i32, ptr %11, align 4, !tbaa !8
  %151 = load i32, ptr %7, align 4, !tbaa !8
  %152 = load i32, ptr @tot, align 4, !tbaa !8
  %153 = sub nsw i32 %152, 1
  %154 = icmp eq i32 %151, %153
  br i1 %154, label %155, label %156

155:                                              ; preds = %141
  br label %165

156:                                              ; preds = %141
  %157 = load i32, ptr %7, align 4, !tbaa !8
  %158 = add nsw i32 %157, 1
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !8
  %162 = icmp slt i32 %161, 0
  %163 = zext i1 %162 to i64
  %164 = select i1 %162, i8 45, i8 43
  br label %165

165:                                              ; preds = %156, %155
  %166 = phi i8 [ 61, %155 ], [ %164, %156 ]
  %167 = sext i8 %166 to i32
  %168 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %150, i32 noundef %167)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %169

169:                                              ; preds = %165
  %170 = load i32, ptr %7, align 4, !tbaa !8
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %7, align 4, !tbaa !8
  br label %89, !llvm.loop !13

172:                                              ; preds = %93
  %173 = load i32, ptr @n, align 4, !tbaa !8
  %174 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %173)
  store i32 0, ptr %1, align 4
  br label %175

175:                                              ; preds = %172, %81
  %176 = load i32, ptr %1, align 4
  ret i32 %176
}

; 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 nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

declare i32 @puts(ptr noundef) #2

declare i32 @printf(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 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 = { nounwind }

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

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

@n = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@sgn = external dso_local local_unnamed_addr global [110 x i32], align 16
@L = external dso_local local_unnamed_addr global i32, align 4
@R = external dso_local local_unnamed_addr global i32, align 4
@str = external dso_local global [2 x i8], align 1
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind 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 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @str)
  %8 = icmp eq i32 %7, 1
  br i1 %8, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %0, %23
  %.02125 = phi i8 [ %.1, %23 ], [ 43, %0 ]
  %9 = load i8, ptr @str, align 1, !tbaa !5
  %10 = icmp eq i8 %9, 63
  br i1 %10, label %11, label %23

11:                                               ; preds = %.lr.ph
  %12 = icmp eq i8 %.02125, 43
  %13 = select i1 %12, i32 1, i32 -1
  %14 = load i32, ptr @tot, align 4, !tbaa !8
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr @tot, align 4, !tbaa !8
  %16 = sext i32 %14 to i64
  %17 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %16
  store i32 %13, ptr %17, align 4, !tbaa !8
  %18 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @str)
  %19 = load i8, ptr @str, align 1, !tbaa !5
  %20 = icmp eq i8 %19, 61
  br i1 %20, label %21, label %23

21:                                               ; preds = %11
  %22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n)
  br label %.loopexit

23:                                               ; preds = %11, %.lr.ph
  %.1 = phi i8 [ %19, %11 ], [ %.02125, %.lr.ph ]
  %24 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @str)
  %25 = icmp eq i32 %24, 1
  br i1 %25, label %.lr.ph, label %.loopexit, !llvm.loop !10

.loopexit:                                        ; preds = %23, %0, %21
  %26 = load i32, ptr @tot, align 4, !tbaa !8
  %27 = icmp sgt i32 %26, 0
  %.pre41 = load i32, ptr @n, align 4, !tbaa !8
  br i1 %27, label %.lr.ph27, label %.loopexit.._crit_edge_crit_edge

.loopexit.._crit_edge_crit_edge:                  ; preds = %.loopexit
  %.pre42 = load i32, ptr @L, align 4, !tbaa !8
  %.pre43 = load i32, ptr @R, align 4
  br label %._crit_edge

._crit_edge:                                      ; preds = %40, %.loopexit.._crit_edge_crit_edge
  %28 = phi i32 [ %.pre43, %.loopexit.._crit_edge_crit_edge ], [ %48, %40 ]
  %29 = phi i32 [ %.pre42, %.loopexit.._crit_edge_crit_edge ], [ %46, %40 ]
  %30 = phi i32 [ %.pre41, %.loopexit.._crit_edge_crit_edge ], [ %44, %40 ]
  %31 = icmp slt i32 %30, %29
  %32 = icmp slt i32 %28, %30
  %or.cond = select i1 %31, i1 true, i1 %32
  br i1 %or.cond, label %51, label %53

.lr.ph27:                                         ; preds = %.loopexit, %40
  %33 = phi i32 [ %41, %40 ], [ %26, %.loopexit ]
  %34 = phi i32 [ %44, %40 ], [ %.pre41, %.loopexit ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %40 ], [ 0, %.loopexit ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %35 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %indvars.iv
  %36 = load i32, ptr %35, align 4, !tbaa !8
  store i32 %36, ptr %1, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %37 = mul nsw i32 %34, %36
  store i32 %37, ptr %2, align 4, !tbaa !8
  %38 = icmp sgt i32 %36, %37
  br i1 %38, label %39, label %40

39:                                               ; preds = %.lr.ph27
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2) #4
  %.pre = load i32, ptr @n, align 4, !tbaa !8
  %.pre38 = load i32, ptr %1, align 4, !tbaa !8
  %.pre39 = load i32, ptr %2, align 4, !tbaa !8
  %.pre40 = load i32, ptr @tot, align 4, !tbaa !8
  br label %40

40:                                               ; preds = %39, %.lr.ph27
  %41 = phi i32 [ %.pre40, %39 ], [ %33, %.lr.ph27 ]
  %42 = phi i32 [ %.pre39, %39 ], [ %37, %.lr.ph27 ]
  %43 = phi i32 [ %.pre38, %39 ], [ %36, %.lr.ph27 ]
  %44 = phi i32 [ %.pre, %39 ], [ %34, %.lr.ph27 ]
  %45 = load i32, ptr @L, align 4, !tbaa !8
  %46 = add nsw i32 %45, %43
  store i32 %46, ptr @L, align 4, !tbaa !8
  %47 = load i32, ptr @R, align 4, !tbaa !8
  %48 = add nsw i32 %47, %42
  store i32 %48, ptr @R, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %49 = sext i32 %41 to i64
  %50 = icmp slt i64 %indvars.iv.next, %49
  br i1 %50, label %.lr.ph27, label %._crit_edge, !llvm.loop !12

51:                                               ; preds = %._crit_edge
  %52 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %105

53:                                               ; preds = %._crit_edge
  %54 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  %55 = load i32, ptr @tot, align 4, !tbaa !8
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %56
  store i32 0, ptr %57, align 4, !tbaa !8
  %58 = load i32, ptr @n, align 4, !tbaa !8
  %59 = icmp sgt i32 %55, 0
  br i1 %59, label %.lr.ph31, label %._crit_edge32

._crit_edge32.loopexit:                           ; preds = %._crit_edge49
  %.pre48 = load i32, ptr @n, align 4, !tbaa !8
  br label %._crit_edge32

._crit_edge32:                                    ; preds = %._crit_edge32.loopexit, %53
  %60 = phi i32 [ %.pre48, %._crit_edge32.loopexit ], [ %58, %53 ]
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %60)
  br label %105

.lr.ph31:                                         ; preds = %53, %._crit_edge49
  %indvars.iv34 = phi i64 [ %.pre50, %._crit_edge49 ], [ 0, %53 ]
  %.029 = phi i32 [ %90, %._crit_edge49 ], [ %58, %53 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %62 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %indvars.iv34
  %63 = load i32, ptr %62, align 4, !tbaa !8
  store i32 %63, ptr %3, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %64 = load i32, ptr @n, align 4, !tbaa !8
  %65 = mul nsw i32 %64, %63
  store i32 %65, ptr %4, align 4, !tbaa !8
  %66 = icmp sgt i32 %63, %65
  br i1 %66, label %67, label %68

67:                                               ; preds = %.lr.ph31
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #4
  %.pre44 = load i32, ptr %3, align 4, !tbaa !8
  %.pre45 = load i32, ptr %4, align 4, !tbaa !8
  %.pre46 = load i32, ptr %62, align 4, !tbaa !8
  br label %68

68:                                               ; preds = %67, %.lr.ph31
  %69 = phi i32 [ %.pre46, %67 ], [ %63, %.lr.ph31 ]
  %70 = phi i32 [ %.pre45, %67 ], [ %65, %.lr.ph31 ]
  %71 = phi i32 [ %.pre44, %67 ], [ %63, %.lr.ph31 ]
  %72 = load i32, ptr @L, align 4, !tbaa !8
  %73 = sub nsw i32 %72, %71
  store i32 %73, ptr @L, align 4, !tbaa !8
  %74 = load i32, ptr @R, align 4, !tbaa !8
  %75 = sub nsw i32 %74, %70
  store i32 %75, ptr @R, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %76 = sub nsw i32 %.029, %73
  %77 = mul nsw i32 %69, %76
  store i32 %77, ptr %5, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  %78 = sub nsw i32 %.029, %75
  %79 = mul nsw i32 %69, %78
  store i32 %79, ptr %6, align 4, !tbaa !8
  %80 = icmp sgt i32 %77, %79
  br i1 %80, label %81, label %82

81:                                               ; preds = %68
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6) #4
  %.pre47 = load i32, ptr %5, align 4, !tbaa !8
  br label %82

82:                                               ; preds = %81, %68
  %83 = phi i32 [ %.pre47, %81 ], [ %77, %68 ]
  %84 = icmp slt i32 %83, 1
  br i1 %84, label %85, label %86

85:                                               ; preds = %82
  store i32 1, ptr %5, align 4, !tbaa !8
  br label %86

86:                                               ; preds = %85, %82
  %87 = phi i32 [ 1, %85 ], [ %83, %82 ]
  %88 = load i32, ptr %62, align 4, !tbaa !8
  %89 = mul nsw i32 %87, %88
  %90 = sub nsw i32 %.029, %89
  %91 = load i32, ptr @tot, align 4, !tbaa !8
  %92 = add nsw i32 %91, -1
  %93 = zext i32 %92 to i64
  %94 = icmp eq i64 %indvars.iv34, %93
  %.pre50 = add nuw nsw i64 %indvars.iv34, 1
  br i1 %94, label %._crit_edge49, label %95

95:                                               ; preds = %86
  %96 = getelementptr inbounds [110 x i32], ptr @sgn, i64 0, i64 %.pre50
  %97 = load i32, ptr %96, align 4, !tbaa !8
  %98 = icmp slt i32 %97, 0
  %99 = select i1 %98, i32 45, i32 43
  br label %._crit_edge49

._crit_edge49:                                    ; preds = %86, %95
  %100 = phi i32 [ %99, %95 ], [ 61, %86 ]
  %101 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %87, i32 noundef %100)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  %102 = load i32, ptr @tot, align 4, !tbaa !8
  %103 = sext i32 %102 to i64
  %104 = icmp slt i64 %.pre50, %103
  br i1 %104, label %.lr.ph31, label %._crit_edge32.loopexit, !llvm.loop !13

105:                                              ; preds = %._crit_edge32, %51
  ret i32 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: 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 nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

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

attributes #0 = { mustprogress norecurse 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 = { 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 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 = { nounwind }

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

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


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