; LLVM IR from tangjz/acm-icpc :: poj (2799)

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

@m = external dso_local global i32, align 4
@ip = external dso_local global [1001 x [4 x i32]], align 16
@maxl = external dso_local global i32, align 4
@addr = external dso_local global [4 x i32], align 16
@mask = external dso_local global [4 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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
  store i32 0, ptr %1, align 4
  br label %11

11:                                               ; preds = %192, %0
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @m)
  %13 = icmp eq i32 %12, 1
  br i1 %13, label %14, label %193

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

15:                                               ; preds = %26, %14
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = icmp slt i32 %16, 4
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %15
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [4 x i32], ptr @mask, i64 0, i64 %21
  store i32 255, ptr %22, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [4 x i32], ptr @addr, i64 0, i64 %24
  store i32 255, ptr %25, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %19
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !9

29:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %64, %29
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = load i32, ptr @m, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i32 7, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %67

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %60, %35
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = icmp slt i32 %37, 4
  br i1 %38, label %40, label %39

39:                                               ; preds = %36
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %63

40:                                               ; preds = %36
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [1001 x [4 x i32]], ptr @ip, i64 0, i64 %42
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [4 x i32], ptr %43, i64 0, i64 %45
  %47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %46)
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [1001 x [4 x i32]], ptr @ip, i64 0, i64 %49
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [4 x i32], ptr %50, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [4 x i32], ptr @addr, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = and i32 %58, %54
  store i32 %59, ptr %57, align 4, !tbaa !5
  br label %60

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

63:                                               ; preds = %39
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %3, align 4, !tbaa !5
  br label %30, !llvm.loop !12

67:                                               ; preds = %34
  store i32 0, ptr @maxl, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %117, %67
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = load i32, ptr @m, align 4, !tbaa !5
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %120

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %113, %73
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = icmp slt i32 %75, 4
  br i1 %76, label %78, label %77

77:                                               ; preds = %74
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %116

78:                                               ; preds = %74
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [4 x i32], ptr @addr, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [1001 x [4 x i32]], ptr @ip, i64 0, i64 %84
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [4 x i32], ptr %85, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = xor i32 %82, %89
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %112

92:                                               ; preds = %78
  %93 = load i32, ptr @maxl, align 4, !tbaa !5
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [4 x i32], ptr @addr, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [1001 x [4 x i32]], ptr @ip, i64 0, i64 %99
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [4 x i32], ptr %100, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = xor i32 %97, %104
  %106 = call noundef i32 @_Z3leni(i32 noundef %105)
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sub nsw i32 3, %107
  %109 = shl i32 %108, 3
  %110 = add nsw i32 %106, %109
  %111 = call noundef i32 @_Z3maxii(i32 noundef %93, i32 noundef %110)
  store i32 %111, ptr @maxl, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %92, %78
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %7, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %7, align 4, !tbaa !5
  br label %74, !llvm.loop !13

116:                                              ; preds = %77
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %6, align 4, !tbaa !5
  br label %68, !llvm.loop !14

120:                                              ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 3, ptr %8, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %142, %120
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = icmp sge i32 %122, 0
  br i1 %123, label %125, label %124

124:                                              ; preds = %121
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %145

125:                                              ; preds = %121
  %126 = load i32, ptr @maxl, align 4, !tbaa !5
  %127 = icmp sgt i32 %126, 0
  br i1 %127, label %128, label %141

128:                                              ; preds = %125
  %129 = load i32, ptr @maxl, align 4, !tbaa !5
  %130 = call noundef i32 @_Z3minii(i32 noundef %129, i32 noundef 8)
  %131 = shl i32 1, %130
  %132 = sub nsw i32 %131, 1
  %133 = xor i32 %132, -1
  %134 = load i32, ptr %8, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [4 x i32], ptr @mask, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = and i32 %137, %133
  store i32 %138, ptr %136, align 4, !tbaa !5
  %139 = load i32, ptr @maxl, align 4, !tbaa !5
  %140 = sub nsw i32 %139, 8
  store i32 %140, ptr @maxl, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %128, %125
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %8, align 4, !tbaa !5
  %144 = add nsw i32 %143, -1
  store i32 %144, ptr %8, align 4, !tbaa !5
  br label %121, !llvm.loop !15

145:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %168, %145
  %147 = load i32, ptr %9, align 4, !tbaa !5
  %148 = icmp slt i32 %147, 4
  br i1 %148, label %150, label %149

149:                                              ; preds = %146
  store i32 22, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %171

150:                                              ; preds = %146
  %151 = load i32, ptr %9, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [4 x i32], ptr @addr, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = load i32, ptr %9, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [4 x i32], ptr @mask, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = and i32 %154, %158
  %160 = load i32, ptr %9, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  %162 = icmp eq i32 %161, 4
  %163 = zext i1 %162 to i64
  %164 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %163
  %165 = load i8, ptr %164, align 1, !tbaa !16
  %166 = sext i8 %165 to i32
  %167 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %159, i32 noundef %166)
  br label %168

168:                                              ; preds = %150
  %169 = load i32, ptr %9, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %9, align 4, !tbaa !5
  br label %146, !llvm.loop !17

171:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %172

172:                                              ; preds = %189, %171
  %173 = load i32, ptr %10, align 4, !tbaa !5
  %174 = icmp slt i32 %173, 4
  br i1 %174, label %176, label %175

175:                                              ; preds = %172
  store i32 25, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %192

176:                                              ; preds = %172
  %177 = load i32, ptr %10, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [4 x i32], ptr @mask, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = load i32, ptr %10, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  %183 = icmp eq i32 %182, 4
  %184 = zext i1 %183 to i64
  %185 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %184
  %186 = load i8, ptr %185, align 1, !tbaa !16
  %187 = sext i8 %186 to i32
  %188 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %180, i32 noundef %187)
  br label %189

189:                                              ; preds = %176
  %190 = load i32, ptr %10, align 4, !tbaa !5
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %10, align 4, !tbaa !5
  br label %172, !llvm.loop !18

192:                                              ; preds = %175
  br label %11, !llvm.loop !19

193:                                              ; preds = %11
  ret i32 0
}

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 #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 = { 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}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !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"

@m = external dso_local global i32, align 4
@ip = external dso_local global [1001 x [4 x i32]], align 16
@maxl = external dso_local local_unnamed_addr global i32, align 4
@addr = external dso_local local_unnamed_addr global [4 x i32], align 16
@mask = external dso_local local_unnamed_addr global [4 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

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

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
  %2 = icmp eq i32 %1, 1
  br i1 %2, label %.preheader50.preheader, label %._crit_edge59

.preheader50.preheader:                           ; preds = %0
  %3 = load i8, ptr @.str.3, align 1
  %4 = sext i8 %3 to i32
  %5 = load i8, ptr getelementptr inbounds (i8, ptr @.str.3, i64 1), align 1
  %6 = sext i8 %5 to i32
  br label %.preheader50

.preheader50:                                     ; preds = %.preheader50.preheader, %.preheader47
  store <4 x i32> <i32 255, i32 255, i32 255, i32 255>, ptr @mask, align 16, !tbaa !5
  store <4 x i32> <i32 255, i32 255, i32 255, i32 255>, ptr @addr, align 16, !tbaa !5
  %7 = load i32, ptr @m, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.preheader45, label %.preheader47.sink.split

.preheader45:                                     ; preds = %.preheader50, %.preheader45
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader45 ], [ 0, %.preheader50 ]
  %9 = getelementptr inbounds [1001 x [4 x i32]], ptr @ip, i64 0, i64 %indvars.iv, i64 0
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %9)
  %11 = load i32, ptr %9, align 16, !tbaa !5
  %12 = load i32, ptr @addr, align 16, !tbaa !5
  %13 = and i32 %12, %11
  store i32 %13, ptr @addr, align 16, !tbaa !5
  %14 = getelementptr inbounds [1001 x [4 x i32]], ptr @ip, i64 0, i64 %indvars.iv, i64 1
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %14)
  %16 = load i32, ptr %14, align 4, !tbaa !5
  %17 = load i32, ptr getelementptr inbounds (i8, ptr @addr, i64 4), align 4, !tbaa !5
  %18 = and i32 %17, %16
  store i32 %18, ptr getelementptr inbounds (i8, ptr @addr, i64 4), align 4, !tbaa !5
  %19 = getelementptr inbounds [1001 x [4 x i32]], ptr @ip, i64 0, i64 %indvars.iv, i64 2
  %20 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %19)
  %21 = load i32, ptr %19, align 8, !tbaa !5
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @addr, i64 8), align 8, !tbaa !5
  %23 = and i32 %22, %21
  store i32 %23, ptr getelementptr inbounds (i8, ptr @addr, i64 8), align 8, !tbaa !5
  %24 = getelementptr inbounds [1001 x [4 x i32]], ptr @ip, i64 0, i64 %indvars.iv, i64 3
  %25 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %24)
  %26 = load i32, ptr %24, align 4, !tbaa !5
  %27 = load i32, ptr getelementptr inbounds (i8, ptr @addr, i64 12), align 4, !tbaa !5
  %28 = and i32 %27, %26
  store i32 %28, ptr getelementptr inbounds (i8, ptr @addr, i64 12), align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr @m, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next, %30
  br i1 %31, label %.preheader45, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.preheader45
  store i32 0, ptr @maxl, align 4, !tbaa !5
  %32 = icmp sgt i32 %29, 0
  br i1 %32, label %.preheader, label %.preheader47

.preheader48:                                     ; preds = %72
  %33 = icmp sgt i32 %73, 0
  br i1 %33, label %.preheader48.split.1, label %.preheader47

.preheader:                                       ; preds = %._crit_edge, %72
  %34 = phi i32 [ %73, %72 ], [ 0, %._crit_edge ]
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %72 ], [ 0, %._crit_edge ]
  %35 = load i32, ptr @addr, align 16, !tbaa !5
  %36 = getelementptr inbounds [1001 x [4 x i32]], ptr @ip, i64 0, i64 %indvars.iv69, i64 0
  %37 = load i32, ptr %36, align 16, !tbaa !5
  %.not = icmp eq i32 %35, %37
  br i1 %.not, label %43, label %38

38:                                               ; preds = %.preheader
  %39 = xor i32 %37, %35
  %40 = tail call noundef i32 @_Z3leni(i32 noundef %39)
  %41 = add i32 %40, 24
  %42 = tail call noundef i32 @_Z3maxii(i32 noundef %34, i32 noundef %41)
  store i32 %42, ptr @maxl, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %.preheader, %38
  %44 = phi i32 [ %34, %.preheader ], [ %42, %38 ]
  %45 = load i32, ptr getelementptr inbounds (i8, ptr @addr, i64 4), align 4, !tbaa !5
  %46 = getelementptr inbounds [1001 x [4 x i32]], ptr @ip, i64 0, i64 %indvars.iv69, i64 1
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %.not.1 = icmp eq i32 %45, %47
  br i1 %.not.1, label %53, label %48

48:                                               ; preds = %43
  %49 = xor i32 %47, %45
  %50 = tail call noundef i32 @_Z3leni(i32 noundef %49)
  %51 = add i32 %50, 16
  %52 = tail call noundef i32 @_Z3maxii(i32 noundef %44, i32 noundef %51)
  store i32 %52, ptr @maxl, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %48, %43
  %54 = phi i32 [ %52, %48 ], [ %44, %43 ]
  %55 = load i32, ptr getelementptr inbounds (i8, ptr @addr, i64 8), align 8, !tbaa !5
  %56 = getelementptr inbounds [1001 x [4 x i32]], ptr @ip, i64 0, i64 %indvars.iv69, i64 2
  %57 = load i32, ptr %56, align 8, !tbaa !5
  %.not.2 = icmp eq i32 %55, %57
  br i1 %.not.2, label %63, label %58

58:                                               ; preds = %53
  %59 = xor i32 %57, %55
  %60 = tail call noundef i32 @_Z3leni(i32 noundef %59)
  %61 = add i32 %60, 8
  %62 = tail call noundef i32 @_Z3maxii(i32 noundef %54, i32 noundef %61)
  store i32 %62, ptr @maxl, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %58, %53
  %64 = phi i32 [ %62, %58 ], [ %54, %53 ]
  %65 = load i32, ptr getelementptr inbounds (i8, ptr @addr, i64 12), align 4, !tbaa !5
  %66 = getelementptr inbounds [1001 x [4 x i32]], ptr @ip, i64 0, i64 %indvars.iv69, i64 3
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %.not.3 = icmp eq i32 %65, %67
  br i1 %.not.3, label %72, label %68

68:                                               ; preds = %63
  %69 = xor i32 %67, %65
  %70 = tail call noundef i32 @_Z3leni(i32 noundef %69)
  %71 = tail call noundef i32 @_Z3maxii(i32 noundef %64, i32 noundef %70)
  store i32 %71, ptr @maxl, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %68, %63
  %73 = phi i32 [ %71, %68 ], [ %64, %63 ]
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %74 = load i32, ptr @m, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = icmp slt i64 %indvars.iv.next70, %75
  br i1 %76, label %.preheader, label %.preheader48, !llvm.loop !11

.preheader47.sink.split:                          ; preds = %.preheader50, %121
  %.sink = phi i32 [ %126, %121 ], [ 0, %.preheader50 ]
  store i32 %.sink, ptr @maxl, align 4, !tbaa !5
  br label %.preheader47

.preheader47:                                     ; preds = %.preheader47.sink.split, %.preheader48.split.1, %.preheader48.split.2, %._crit_edge, %.preheader48.split.3, %.preheader48
  %77 = load i32, ptr @addr, align 16, !tbaa !5
  %78 = load i32, ptr @mask, align 16, !tbaa !5
  %79 = and i32 %78, %77
  %80 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %79, i32 noundef %4)
  %81 = load i32, ptr getelementptr inbounds (i8, ptr @addr, i64 4), align 4, !tbaa !5
  %82 = load i32, ptr getelementptr inbounds (i8, ptr @mask, i64 4), align 4, !tbaa !5
  %83 = and i32 %82, %81
  %84 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %83, i32 noundef %4)
  %85 = load i32, ptr getelementptr inbounds (i8, ptr @addr, i64 8), align 8, !tbaa !5
  %86 = load i32, ptr getelementptr inbounds (i8, ptr @mask, i64 8), align 8, !tbaa !5
  %87 = and i32 %86, %85
  %88 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %87, i32 noundef %4)
  %89 = load i32, ptr getelementptr inbounds (i8, ptr @addr, i64 12), align 4, !tbaa !5
  %90 = load i32, ptr getelementptr inbounds (i8, ptr @mask, i64 12), align 4, !tbaa !5
  %91 = and i32 %90, %89
  %92 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %91, i32 noundef %6)
  %93 = load i32, ptr @mask, align 16, !tbaa !5
  %94 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %93, i32 noundef %4)
  %95 = load i32, ptr getelementptr inbounds (i8, ptr @mask, i64 4), align 4, !tbaa !5
  %96 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %95, i32 noundef %4)
  %97 = load i32, ptr getelementptr inbounds (i8, ptr @mask, i64 8), align 8, !tbaa !5
  %98 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %97, i32 noundef %4)
  %99 = load i32, ptr getelementptr inbounds (i8, ptr @mask, i64 12), align 4, !tbaa !5
  %100 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %99, i32 noundef %6)
  %101 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
  %102 = icmp eq i32 %101, 1
  br i1 %102, label %.preheader50, label %._crit_edge59, !llvm.loop !12

.preheader48.split.1:                             ; preds = %.preheader48
  %103 = tail call noundef i32 @_Z3minii(i32 noundef %73, i32 noundef 8)
  %notmask = shl nsw i32 -1, %103
  %104 = load i32, ptr getelementptr inbounds (i8, ptr @mask, i64 12), align 4, !tbaa !5
  %105 = and i32 %104, %notmask
  store i32 %105, ptr getelementptr inbounds (i8, ptr @mask, i64 12), align 4, !tbaa !5
  %106 = load i32, ptr @maxl, align 4, !tbaa !5
  %107 = add nsw i32 %106, -8
  store i32 %107, ptr @maxl, align 4, !tbaa !5
  %108 = icmp sgt i32 %106, 8
  br i1 %108, label %.preheader48.split.2, label %.preheader47

.preheader48.split.2:                             ; preds = %.preheader48.split.1
  %109 = tail call noundef i32 @_Z3minii(i32 noundef %107, i32 noundef 8)
  %notmask.1 = shl nsw i32 -1, %109
  %110 = load i32, ptr getelementptr inbounds (i8, ptr @mask, i64 8), align 8, !tbaa !5
  %111 = and i32 %110, %notmask.1
  store i32 %111, ptr getelementptr inbounds (i8, ptr @mask, i64 8), align 8, !tbaa !5
  %112 = load i32, ptr @maxl, align 4, !tbaa !5
  %113 = add nsw i32 %112, -8
  store i32 %113, ptr @maxl, align 4, !tbaa !5
  %114 = icmp sgt i32 %112, 8
  br i1 %114, label %.preheader48.split.3, label %.preheader47

.preheader48.split.3:                             ; preds = %.preheader48.split.2
  %115 = tail call noundef i32 @_Z3minii(i32 noundef %113, i32 noundef 8)
  %notmask.2 = shl nsw i32 -1, %115
  %116 = load i32, ptr getelementptr inbounds (i8, ptr @mask, i64 4), align 4, !tbaa !5
  %117 = and i32 %116, %notmask.2
  store i32 %117, ptr getelementptr inbounds (i8, ptr @mask, i64 4), align 4, !tbaa !5
  %118 = load i32, ptr @maxl, align 4, !tbaa !5
  %119 = add nsw i32 %118, -8
  store i32 %119, ptr @maxl, align 4, !tbaa !5
  %120 = icmp sgt i32 %118, 8
  br i1 %120, label %121, label %.preheader47

121:                                              ; preds = %.preheader48.split.3
  %122 = tail call noundef i32 @_Z3minii(i32 noundef %119, i32 noundef 8)
  %notmask.3 = shl nsw i32 -1, %122
  %123 = load i32, ptr @mask, align 16, !tbaa !5
  %124 = and i32 %123, %notmask.3
  store i32 %124, ptr @mask, align 16, !tbaa !5
  %125 = load i32, ptr @maxl, align 4, !tbaa !5
  %126 = add nsw i32 %125, -8
  br label %.preheader47.sink.split

._crit_edge59:                                    ; preds = %.preheader47, %0
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(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 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 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 #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" }

!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}
!12 = distinct !{!12, !10}


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