; LLVM IR from tangjz/acm-icpc :: codeforces/gym/100827A.ll (Z5solvev)

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

@_ZZ5solvevE3buf = external hidden global [25 x i8], align 16
@_ZZ5solvevE2in = external hidden global [25 x i8], align 16
@_ZZ5solvevE3out = external hidden global [25 x i8], align 16
@.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 [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @_ZZ5solvevE3buf)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %33, %0
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %17
  %19 = load i8, ptr %18, align 1, !tbaa !9
  %20 = sext i8 %19 to i32
  %21 = call i32 @isdigit(i32 noundef %20) #6
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %30, label %23

23:                                               ; preds = %15
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %25
  %27 = load i8, ptr %26, align 1, !tbaa !9
  %28 = sext i8 %27 to i32
  %29 = icmp eq i32 %28, 63
  br label %30

30:                                               ; preds = %23, %15
  %31 = phi i1 [ true, %15 ], [ %29, %23 ]
  br i1 %31, label %32, label %36

32:                                               ; preds = %30
  br label %33

33:                                               ; preds = %32
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %1, align 4, !tbaa !5
  br label %15, !llvm.loop !10

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

39:                                               ; preds = %47, %36
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !9
  %44 = sext i8 %43 to i32
  %45 = icmp ne i32 %44, 61
  br i1 %45, label %46, label %50

46:                                               ; preds = %39
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %2, align 4, !tbaa !5
  br label %39, !llvm.loop !12

50:                                               ; preds = %39
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %3, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %60, %50
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !9
  %58 = icmp ne i8 %57, 0
  br i1 %58, label %59, label %63

59:                                               ; preds = %53
  br label %60

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

63:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  %64 = load i32, ptr %1, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !9
  store i8 %67, ptr %4, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %92, %63
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %95

73:                                               ; preds = %68
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %75
  %77 = load i8, ptr %76, align 1, !tbaa !9
  %78 = sext i8 %77 to i32
  %79 = call i32 @isdigit(i32 noundef %78) #6
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %91

81:                                               ; preds = %73
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %83
  %85 = load i8, ptr %84, align 1, !tbaa !9
  %86 = sext i8 %85 to i32
  %87 = sub nsw i32 %86, 48
  %88 = shl i32 1, %87
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = or i32 %89, %88
  store i32 %90, ptr %5, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %81, %73
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %6, align 4, !tbaa !5
  br label %68, !llvm.loop !14

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

96:                                               ; preds = %206, %95
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = icmp slt i32 %97, 10
  br i1 %98, label %100, label %99

99:                                               ; preds = %96
  store i32 14, ptr %8, align 4
  br label %211

100:                                              ; preds = %96
  %101 = load i32, ptr %5, align 4, !tbaa !5
  %102 = and i32 %101, 1
  %103 = icmp ne i32 %102, 0
  br i1 %103, label %104, label %105

104:                                              ; preds = %100
  br label %206

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

106:                                              ; preds = %135, %105
  %107 = load i32, ptr %9, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %108
  %110 = load i8, ptr %109, align 1, !tbaa !9
  %111 = icmp ne i8 %110, 0
  br i1 %111, label %113, label %112

112:                                              ; preds = %106
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %138

113:                                              ; preds = %106
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %115
  %117 = load i8, ptr %116, align 1, !tbaa !9
  %118 = sext i8 %117 to i32
  %119 = icmp eq i32 %118, 63
  br i1 %119, label %120, label %123

120:                                              ; preds = %113
  %121 = load i32, ptr %7, align 4, !tbaa !5
  %122 = add nsw i32 48, %121
  br label %129

123:                                              ; preds = %113
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %125
  %127 = load i8, ptr %126, align 1, !tbaa !9
  %128 = sext i8 %127 to i32
  br label %129

129:                                              ; preds = %123, %120
  %130 = phi i32 [ %122, %120 ], [ %128, %123 ]
  %131 = trunc i32 %130 to i8
  %132 = load i32, ptr %9, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE2in, i64 0, i64 %133
  store i8 %131, ptr %134, align 1, !tbaa !9
  br label %135

135:                                              ; preds = %129
  %136 = load i32, ptr %9, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %9, align 4, !tbaa !5
  br label %106, !llvm.loop !15

138:                                              ; preds = %112
  %139 = load i32, ptr %3, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE2in, i64 0, i64 %140
  store i8 0, ptr %141, align 1, !tbaa !9
  %142 = load i32, ptr %2, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE2in, i64 0, i64 %143
  store i8 0, ptr %144, align 1, !tbaa !9
  %145 = load i32, ptr %1, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE2in, i64 0, i64 %146
  store i8 0, ptr %147, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %148 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef @_ZZ5solvevE2in, ptr noundef @.str.1, ptr noundef %10) #5
  %149 = load i32, ptr %1, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds i8, ptr @_ZZ5solvevE2in, i64 %150
  %152 = getelementptr inbounds i8, ptr %151, i64 1
  %153 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %152, ptr noundef @.str.1, ptr noundef %11) #5
  %154 = load i32, ptr %2, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds i8, ptr @_ZZ5solvevE2in, i64 %155
  %157 = getelementptr inbounds i8, ptr %156, i64 1
  %158 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %157, ptr noundef @.str.1, ptr noundef %12) #5
  %159 = load i32, ptr %10, align 4, !tbaa !5
  %160 = load i8, ptr %4, align 1, !tbaa !9
  %161 = sext i8 %160 to i32
  %162 = load i32, ptr %11, align 4, !tbaa !5
  %163 = load i32, ptr %12, align 4, !tbaa !5
  %164 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef @_ZZ5solvevE3out, ptr noundef @.str.2, i32 noundef %159, i32 noundef %161, i32 noundef %162, i32 noundef %163) #5
  %165 = load i8, ptr %4, align 1, !tbaa !9
  %166 = load i32, ptr %1, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE2in, i64 0, i64 %167
  store i8 %165, ptr %168, align 1, !tbaa !9
  %169 = load i32, ptr %2, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE2in, i64 0, i64 %170
  store i8 61, ptr %171, align 1, !tbaa !9
  %172 = call i32 @strcmp(ptr noundef @_ZZ5solvevE2in, ptr noundef @_ZZ5solvevE3out) #6
  %173 = icmp ne i32 %172, 0
  br i1 %173, label %174, label %175

174:                                              ; preds = %138
  store i32 16, ptr %8, align 4
  br label %204

175:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %176 = load i8, ptr %4, align 1, !tbaa !9
  %177 = sext i8 %176 to i32
  switch i32 %177, label %194 [
    i32 43, label %178
    i32 45, label %183
    i32 42, label %188
  ]

178:                                              ; preds = %175
  %179 = load i32, ptr %10, align 4, !tbaa !5
  %180 = load i32, ptr %11, align 4, !tbaa !5
  %181 = add nsw i32 %179, %180
  %182 = sext i32 %181 to i64
  store i64 %182, ptr %13, align 8, !tbaa !16
  br label %194

183:                                              ; preds = %175
  %184 = load i32, ptr %10, align 4, !tbaa !5
  %185 = load i32, ptr %11, align 4, !tbaa !5
  %186 = sub nsw i32 %184, %185
  %187 = sext i32 %186 to i64
  store i64 %187, ptr %13, align 8, !tbaa !16
  br label %194

188:                                              ; preds = %175
  %189 = load i32, ptr %10, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = load i32, ptr %11, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = mul nsw i64 %190, %192
  store i64 %193, ptr %13, align 8, !tbaa !16
  br label %194

194:                                              ; preds = %188, %183, %178, %175
  %195 = load i64, ptr %13, align 8, !tbaa !16
  %196 = load i32, ptr %12, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = icmp ne i64 %195, %197
  br i1 %198, label %199, label %200

199:                                              ; preds = %194
  store i32 16, ptr %8, align 4
  br label %203

200:                                              ; preds = %194
  %201 = load i32, ptr %7, align 4, !tbaa !5
  %202 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %201)
  store i32 1, ptr %8, align 4
  br label %203

203:                                              ; preds = %200, %199
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %204

204:                                              ; preds = %203, %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %205 = load i32, ptr %8, align 4
  switch i32 %205, label %211 [
    i32 16, label %206
  ]

206:                                              ; preds = %204, %104
  %207 = load i32, ptr %7, align 4, !tbaa !5
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %7, align 4, !tbaa !5
  %209 = load i32, ptr %5, align 4, !tbaa !5
  %210 = ashr i32 %209, 1
  store i32 %210, ptr %5, align 4, !tbaa !5
  br label %96, !llvm.loop !18

211:                                              ; preds = %204, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  %212 = load i32, ptr %8, align 4
  switch i32 %212, label %215 [
    i32 14, label %213
  ]

213:                                              ; preds = %211
  %214 = call i32 @puts(ptr noundef @.str.4)
  store i32 0, ptr %8, align 4
  br label %215

215:                                              ; preds = %213, %211
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  %216 = load i32, ptr %8, align 4
  switch i32 %216, label %218 [
    i32 0, label %217
    i32 1, label %217
  ]

217:                                              ; preds = %215, %215
  ret void

218:                                              ; preds = %215
  unreachable
}

declare i32 @__isoc99_scanf(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: nounwind willreturn memory(read)
declare i32 @isdigit(i32 noundef) #3

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

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #4

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #4

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #3

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

declare i32 @puts(ptr noundef) #1

attributes #0 = { 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 #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 = { nounwind willreturn memory(read) "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 "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 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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}
!15 = distinct !{!15, !11}
!16 = !{!17, !17, i64 0}
!17 = !{!"long long", !7, i64 0}
!18 = distinct !{!18, !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"

@_ZZ5solvevE3buf = external hidden global [25 x i8], align 16
@_ZZ5solvevE2in = external hidden global [25 x i8], align 16
@_ZZ5solvevE3out = external hidden global [25 x i8], align 16
@.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 [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nofree nounwind uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @_ZZ5solvevE3buf)
  br label %.critedge

.critedge:                                        ; preds = %.critedge, %0
  %indvars.iv90 = phi i64 [ %indvars.iv.next91, %.critedge ], [ 3, %0 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.critedge ], [ 1, %0 ]
  %5 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %indvars.iv
  %6 = load i8, ptr %5, align 1, !tbaa !5
  %7 = sext i8 %6 to i32
  %isdigittmp = add nsw i32 %7, -48
  %isdigit = icmp ult i32 %isdigittmp, 10
  %8 = icmp eq i8 %6, 63
  %or.cond = or i1 %8, %isdigit
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %indvars.iv.next91 = add i64 %indvars.iv90, 1
  br i1 %or.cond, label %.critedge, label %.preheader69, !llvm.loop !8

.preheader69:                                     ; preds = %.critedge, %.preheader69
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %.preheader69 ], [ %indvars.iv90, %.critedge ]
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %.preheader69 ], [ %indvars.iv, %.critedge ]
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %9 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %indvars.iv.next88
  %10 = load i8, ptr %9, align 1, !tbaa !5
  %.not = icmp eq i8 %10, 61
  %indvars.iv.next93 = add i64 %indvars.iv92, 1
  br i1 %.not, label %.preheader112, label %.preheader69, !llvm.loop !10

.preheader112:                                    ; preds = %.preheader69, %.preheader112
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %.preheader112 ], [ %indvars.iv92, %.preheader69 ]
  %11 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %indvars.iv94
  %12 = load i8, ptr %11, align 1, !tbaa !5
  %.not55 = icmp eq i8 %12, 0
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  br i1 %.not55, label %.preheader68, label %.preheader112, !llvm.loop !11

.preheader68:                                     ; preds = %.preheader112
  %13 = and i64 %indvars.iv94, 4294967295
  %min.iters.check = icmp ult i64 %13, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader68
  %indvars.iv97.ph = phi i64 [ 0, %.preheader68 ], [ %n.vec, %middle.block ]
  %.04775.ph = phi i32 [ 0, %.preheader68 ], [ %29, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.preheader68
  %n.vec = and i64 %indvars.iv94, 4294967288
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %26, %vector.body ]
  %vec.phi107 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %27, %vector.body ]
  %14 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %index
  %15 = getelementptr inbounds i8, ptr %14, i64 4
  %wide.load = load <4 x i8>, ptr %14, align 8, !tbaa !5
  %wide.load108 = load <4 x i8>, ptr %15, align 4, !tbaa !5
  %16 = sext <4 x i8> %wide.load to <4 x i32>
  %17 = sext <4 x i8> %wide.load108 to <4 x i32>
  %18 = add nsw <4 x i32> %16, <i32 -48, i32 -48, i32 -48, i32 -48>
  %19 = add nsw <4 x i32> %17, <i32 -48, i32 -48, i32 -48, i32 -48>
  %20 = icmp ult <4 x i32> %18, <i32 10, i32 10, i32 10, i32 10>
  %21 = icmp ult <4 x i32> %19, <i32 10, i32 10, i32 10, i32 10>
  %22 = shl nuw nsw <4 x i32> <i32 1, i32 1, i32 1, i32 1>, %18
  %23 = shl nuw nsw <4 x i32> <i32 1, i32 1, i32 1, i32 1>, %19
  %24 = select <4 x i1> %20, <4 x i32> %22, <4 x i32> zeroinitializer
  %25 = select <4 x i1> %21, <4 x i32> %23, <4 x i32> zeroinitializer
  %26 = or <4 x i32> %24, %vec.phi
  %27 = or <4 x i32> %25, %vec.phi107
  %index.next = add nuw i64 %index, 8
  %28 = icmp eq i64 %index.next, %n.vec
  br i1 %28, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %bin.rdx = or <4 x i32> %27, %26
  %29 = tail call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %13, %n.vec
  br i1 %cmp.n, label %.preheader67, label %scalar.ph.preheader

.preheader67:                                     ; preds = %scalar.ph, %middle.block
  %.148.lcssa = phi i32 [ %29, %middle.block ], [ %.148, %scalar.ph ]
  %30 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE2in, i64 0, i64 %indvars.iv94
  %31 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE2in, i64 0, i64 %indvars.iv.next88
  %32 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE2in, i64 0, i64 %indvars.iv
  %33 = getelementptr inbounds i8, ptr %32, i64 1
  %34 = getelementptr inbounds i8, ptr %31, i64 1
  br label %41

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv97 = phi i64 [ %indvars.iv.next98, %scalar.ph ], [ %indvars.iv97.ph, %scalar.ph.preheader ]
  %.04775 = phi i32 [ %.148, %scalar.ph ], [ %.04775.ph, %scalar.ph.preheader ]
  %35 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %indvars.iv97
  %36 = load i8, ptr %35, align 1, !tbaa !5
  %37 = sext i8 %36 to i32
  %isdigittmp60 = add nsw i32 %37, -48
  %isdigit61 = icmp ult i32 %isdigittmp60, 10
  %38 = shl nuw nsw i32 1, %isdigittmp60
  %39 = select i1 %isdigit61, i32 %38, i32 0
  %.148 = or i32 %39, %.04775
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %40 = icmp ult i64 %indvars.iv.next98, %13
  br i1 %40, label %scalar.ph, label %.preheader67, !llvm.loop !15

41:                                               ; preds = %.preheader67, %82
  %.080 = phi i64 [ undef, %.preheader67 ], [ %.3, %82 ]
  %.04578 = phi i32 [ 0, %.preheader67 ], [ %83, %82 ]
  %.24977 = phi i32 [ %.148.lcssa, %.preheader67 ], [ %84, %82 ]
  %42 = and i32 %.24977, 1
  %.not56 = icmp eq i32 %42, 0
  br i1 %.not56, label %.preheader, label %82

.preheader:                                       ; preds = %41
  %43 = or disjoint i32 %.04578, 48
  br label %44

44:                                               ; preds = %.preheader, %58
  %indvars.iv100 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next101, %58 ]
  %45 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %indvars.iv100
  %46 = load i8, ptr %45, align 1, !tbaa !5
  switch i8 %46, label %56 [
    i8 0, label %47
    i8 63, label %58
  ]

47:                                               ; preds = %44
  store i8 0, ptr %30, align 1, !tbaa !5
  store i8 0, ptr %31, align 1, !tbaa !5
  store i8 0, ptr %32, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %48 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull @_ZZ5solvevE2in, ptr noundef nonnull @.str.1, ptr noundef nonnull %1) #5
  %49 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %33, ptr noundef nonnull @.str.1, ptr noundef nonnull %2) #5
  %50 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %34, ptr noundef nonnull @.str.1, ptr noundef nonnull %3) #5
  %51 = load i32, ptr %1, align 4, !tbaa !16
  %52 = load i32, ptr %2, align 4, !tbaa !16
  %53 = load i32, ptr %3, align 4, !tbaa !16
  %54 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) @_ZZ5solvevE3out, ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %51, i32 noundef %7, i32 noundef %52, i32 noundef %53) #5
  store i8 %6, ptr %32, align 1, !tbaa !5
  store i8 61, ptr %31, align 1, !tbaa !5
  %55 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @_ZZ5solvevE2in, ptr noundef nonnull dereferenceable(1) @_ZZ5solvevE3out) #6
  %.not58 = icmp eq i32 %55, 0
  br i1 %.not58, label %62, label %.thread

56:                                               ; preds = %44
  %57 = zext i8 %46 to i32
  br label %58

58:                                               ; preds = %44, %56
  %59 = phi i32 [ %57, %56 ], [ %43, %44 ]
  %60 = trunc i32 %59 to i8
  %61 = getelementptr inbounds [25 x i8], ptr @_ZZ5solvevE2in, i64 0, i64 %indvars.iv100
  store i8 %60, ptr %61, align 1, !tbaa !5
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  br label %44, !llvm.loop !18

62:                                               ; preds = %47
  switch i8 %6, label %79 [
    i8 43, label %63
    i8 45, label %68
    i8 42, label %73
  ]

63:                                               ; preds = %62
  %64 = load i32, ptr %1, align 4, !tbaa !16
  %65 = load i32, ptr %2, align 4, !tbaa !16
  %66 = add nsw i32 %65, %64
  %67 = sext i32 %66 to i64
  br label %79

68:                                               ; preds = %62
  %69 = load i32, ptr %1, align 4, !tbaa !16
  %70 = load i32, ptr %2, align 4, !tbaa !16
  %71 = sub nsw i32 %69, %70
  %72 = sext i32 %71 to i64
  br label %79

73:                                               ; preds = %62
  %74 = load i32, ptr %1, align 4, !tbaa !16
  %75 = sext i32 %74 to i64
  %76 = load i32, ptr %2, align 4, !tbaa !16
  %77 = sext i32 %76 to i64
  %78 = mul nsw i64 %77, %75
  br label %79

79:                                               ; preds = %73, %68, %63, %62
  %.1 = phi i64 [ %.080, %62 ], [ %78, %73 ], [ %72, %68 ], [ %67, %63 ]
  %80 = load i32, ptr %3, align 4, !tbaa !16
  %81 = sext i32 %80 to i64
  %.not59 = icmp eq i64 %.1, %81
  br i1 %.not59, label %85, label %.thread

.thread:                                          ; preds = %47, %79
  %.2.ph = phi i64 [ %.1, %79 ], [ %.080, %47 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  br label %82

82:                                               ; preds = %.thread, %41
  %.3 = phi i64 [ %.080, %41 ], [ %.2.ph, %.thread ]
  %83 = add nuw nsw i32 %.04578, 1
  %84 = ashr i32 %.24977, 1
  %exitcond = icmp eq i32 %83, 10
  br i1 %exitcond, label %.critedge63, label %41, !llvm.loop !19

85:                                               ; preds = %79
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.04578)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  br label %88

.critedge63:                                      ; preds = %82
  %87 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %88

88:                                               ; preds = %85, %.critedge63
  ret void
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(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: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.or.v4i32(<4 x i32>) #4

attributes #0 = { mustprogress nofree 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 = { 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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 }
attributes #6 = { nounwind willreturn memory(read) }

!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 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
!12 = distinct !{!12, !9, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !9, !14, !13}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !6, i64 0}
!18 = distinct !{!18, !9}
!19 = distinct !{!19, !9}


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