; LLVM IR from HarshCasper/NeoAlgo :: C/cryptography (Vernam_Cipher)

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

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @decrypt(ptr noundef, ptr 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: nounwind willreturn memory(read)
declare i64 @strlen(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: nounwind uwtable
declare dso_local ptr @encrypt(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [100 x i8], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca [100 x i8], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [100 x i8], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [100 x i8], align 16
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %15

15:                                               ; preds = %235, %0
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %17 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  %19 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef %2)
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = icmp eq i32 %22, 3
  br i1 %23, label %24, label %25

24:                                               ; preds = %15
  call void @exit(i32 noundef 0) #6
  unreachable

25:                                               ; preds = %15
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = icmp eq i32 %26, 1
  br i1 %27, label %28, label %128

28:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 100, ptr %3) #5
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %30 = getelementptr inbounds [100 x i8], ptr %3, i64 0, i64 0
  %31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.7, ptr noundef %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %32 = getelementptr inbounds [100 x i8], ptr %3, i64 0, i64 0
  %33 = call i64 @strlen(ptr noundef %32) #7
  %34 = trunc i64 %33 to i32
  store i32 %34, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %66, %28
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100 x i8], ptr %3, i64 0, i64 %37
  %39 = load i8, ptr %38, align 1, !tbaa !9
  %40 = sext i8 %39 to i32
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %43, label %42

42:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %69

43:                                               ; preds = %35
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100 x i8], ptr %3, i64 0, i64 %45
  %47 = load i8, ptr %46, align 1, !tbaa !9
  %48 = sext i8 %47 to i32
  %49 = icmp sge i32 %48, 97
  br i1 %49, label %50, label %65

50:                                               ; preds = %43
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100 x i8], ptr %3, i64 0, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !9
  %55 = sext i8 %54 to i32
  %56 = icmp sle i32 %55, 122
  br i1 %56, label %57, label %65

57:                                               ; preds = %50
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100 x i8], ptr %3, i64 0, i64 %59
  %61 = load i8, ptr %60, align 1, !tbaa !9
  %62 = sext i8 %61 to i32
  %63 = sub nsw i32 %62, 32
  %64 = trunc i32 %63 to i8
  store i8 %64, ptr %60, align 1, !tbaa !9
  br label %65

65:                                               ; preds = %57, %50, %43
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %5, align 4, !tbaa !5
  br label %35, !llvm.loop !10

69:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 100, ptr %6) #5
  %70 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %71 = getelementptr inbounds [100 x i8], ptr %6, i64 0, i64 0
  %72 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.7, ptr noundef %71)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %73 = getelementptr inbounds [100 x i8], ptr %6, i64 0, i64 0
  %74 = call i64 @strlen(ptr noundef %73) #7
  %75 = trunc i64 %74 to i32
  store i32 %75, ptr %7, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %80, %69
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = icmp ne i32 %77, %78
  br i1 %79, label %80, label %88

80:                                               ; preds = %76
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  %82 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %83 = getelementptr inbounds [100 x i8], ptr %6, i64 0, i64 0
  %84 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.7, ptr noundef %83)
  %85 = getelementptr inbounds [100 x i8], ptr %6, i64 0, i64 0
  %86 = call i64 @strlen(ptr noundef %85) #7
  %87 = trunc i64 %86 to i32
  store i32 %87, ptr %7, align 4, !tbaa !5
  br label %76, !llvm.loop !12

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

89:                                               ; preds = %120, %88
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100 x i8], ptr %6, i64 0, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !9
  %94 = sext i8 %93 to i32
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %97, label %96

96:                                               ; preds = %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %123

97:                                               ; preds = %89
  %98 = load i32, ptr %8, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100 x i8], ptr %6, i64 0, i64 %99
  %101 = load i8, ptr %100, align 1, !tbaa !9
  %102 = sext i8 %101 to i32
  %103 = icmp sge i32 %102, 97
  br i1 %103, label %104, label %119

104:                                              ; preds = %97
  %105 = load i32, ptr %8, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100 x i8], ptr %6, i64 0, i64 %106
  %108 = load i8, ptr %107, align 1, !tbaa !9
  %109 = sext i8 %108 to i32
  %110 = icmp sle i32 %109, 122
  br i1 %110, label %111, label %119

111:                                              ; preds = %104
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [100 x i8], ptr %6, i64 0, i64 %113
  %115 = load i8, ptr %114, align 1, !tbaa !9
  %116 = sext i8 %115 to i32
  %117 = sub nsw i32 %116, 32
  %118 = trunc i32 %117 to i8
  store i8 %118, ptr %114, align 1, !tbaa !9
  br label %119

119:                                              ; preds = %111, %104, %97
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %8, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %8, align 4, !tbaa !5
  br label %89, !llvm.loop !13

123:                                              ; preds = %96
  %124 = getelementptr inbounds [100 x i8], ptr %3, i64 0, i64 0
  %125 = getelementptr inbounds [100 x i8], ptr %6, i64 0, i64 0
  %126 = call ptr @encrypt(ptr noundef %124, ptr noundef %125)
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, ptr noundef %126)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 100, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 100, ptr %3) #5
  br label %234

128:                                              ; preds = %25
  %129 = load i32, ptr %2, align 4, !tbaa !5
  %130 = icmp eq i32 %129, 2
  br i1 %130, label %131, label %231

131:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 100, ptr %9) #5
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  %133 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 0
  %134 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.7, ptr noundef %133)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %135 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 0
  %136 = call i64 @strlen(ptr noundef %135) #7
  %137 = trunc i64 %136 to i32
  store i32 %137, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %169, %131
  %139 = load i32, ptr %11, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 %140
  %142 = load i8, ptr %141, align 1, !tbaa !9
  %143 = sext i8 %142 to i32
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %146, label %145

145:                                              ; preds = %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %172

146:                                              ; preds = %138
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 %148
  %150 = load i8, ptr %149, align 1, !tbaa !9
  %151 = sext i8 %150 to i32
  %152 = icmp sge i32 %151, 97
  br i1 %152, label %153, label %168

153:                                              ; preds = %146
  %154 = load i32, ptr %11, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 %155
  %157 = load i8, ptr %156, align 1, !tbaa !9
  %158 = sext i8 %157 to i32
  %159 = icmp sle i32 %158, 122
  br i1 %159, label %160, label %168

160:                                              ; preds = %153
  %161 = load i32, ptr %11, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 %162
  %164 = load i8, ptr %163, align 1, !tbaa !9
  %165 = sext i8 %164 to i32
  %166 = sub nsw i32 %165, 32
  %167 = trunc i32 %166 to i8
  store i8 %167, ptr %163, align 1, !tbaa !9
  br label %168

168:                                              ; preds = %160, %153, %146
  br label %169

169:                                              ; preds = %168
  %170 = load i32, ptr %11, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %11, align 4, !tbaa !5
  br label %138, !llvm.loop !14

172:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 100, ptr %12) #5
  %173 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  %174 = getelementptr inbounds [100 x i8], ptr %12, i64 0, i64 0
  %175 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.7, ptr noundef %174)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %176 = getelementptr inbounds [100 x i8], ptr %12, i64 0, i64 0
  %177 = call i64 @strlen(ptr noundef %176) #7
  %178 = trunc i64 %177 to i32
  store i32 %178, ptr %13, align 4, !tbaa !5
  br label %179

179:                                              ; preds = %183, %172
  %180 = load i32, ptr %13, align 4, !tbaa !5
  %181 = load i32, ptr %10, align 4, !tbaa !5
  %182 = icmp ne i32 %180, %181
  br i1 %182, label %183, label %191

183:                                              ; preds = %179
  %184 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  %185 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %186 = getelementptr inbounds [100 x i8], ptr %12, i64 0, i64 0
  %187 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.7, ptr noundef %186)
  %188 = getelementptr inbounds [100 x i8], ptr %12, i64 0, i64 0
  %189 = call i64 @strlen(ptr noundef %188) #7
  %190 = trunc i64 %189 to i32
  store i32 %190, ptr %13, align 4, !tbaa !5
  br label %179, !llvm.loop !15

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

192:                                              ; preds = %223, %191
  %193 = load i32, ptr %14, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [100 x i8], ptr %12, i64 0, i64 %194
  %196 = load i8, ptr %195, align 1, !tbaa !9
  %197 = sext i8 %196 to i32
  %198 = icmp ne i32 %197, 0
  br i1 %198, label %200, label %199

199:                                              ; preds = %192
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %226

200:                                              ; preds = %192
  %201 = load i32, ptr %14, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [100 x i8], ptr %12, i64 0, i64 %202
  %204 = load i8, ptr %203, align 1, !tbaa !9
  %205 = sext i8 %204 to i32
  %206 = icmp sge i32 %205, 97
  br i1 %206, label %207, label %222

207:                                              ; preds = %200
  %208 = load i32, ptr %14, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [100 x i8], ptr %12, i64 0, i64 %209
  %211 = load i8, ptr %210, align 1, !tbaa !9
  %212 = sext i8 %211 to i32
  %213 = icmp sle i32 %212, 122
  br i1 %213, label %214, label %222

214:                                              ; preds = %207
  %215 = load i32, ptr %14, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [100 x i8], ptr %12, i64 0, i64 %216
  %218 = load i8, ptr %217, align 1, !tbaa !9
  %219 = sext i8 %218 to i32
  %220 = sub nsw i32 %219, 32
  %221 = trunc i32 %220 to i8
  store i8 %221, ptr %217, align 1, !tbaa !9
  br label %222

222:                                              ; preds = %214, %207, %200
  br label %223

223:                                              ; preds = %222
  %224 = load i32, ptr %14, align 4, !tbaa !5
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %14, align 4, !tbaa !5
  br label %192, !llvm.loop !16

226:                                              ; preds = %199
  %227 = getelementptr inbounds [100 x i8], ptr %9, i64 0, i64 0
  %228 = getelementptr inbounds [100 x i8], ptr %12, i64 0, i64 0
  %229 = call ptr @decrypt(ptr noundef %227, ptr noundef %228)
  %230 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, ptr noundef %229)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 100, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 100, ptr %9) #5
  br label %233

231:                                              ; preds = %128
  %232 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  br label %233

233:                                              ; preds = %231, %226
  br label %234

234:                                              ; preds = %233, %123
  br label %235

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

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

attributes #0 = { 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 = { 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 #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 = { noreturn 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 = { noreturn nounwind }
attributes #7 = { 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/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 = distinct !{!16, !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"

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @decrypt(ptr noundef, ptr noundef) local_unnamed_addr #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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) 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: nounwind uwtable
declare dso_local ptr @encrypt(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca [100 x i8], align 16
  %3 = alloca [100 x i8], align 16
  %4 = alloca [100 x i8], align 16
  %5 = alloca [100 x i8], align 16
  br label %6

6:                                                ; preds = %77, %0
  %7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %1)
  %13 = load i32, ptr %1, align 4, !tbaa !5
  switch i32 %13, label %75 [
    i32 3, label %14
    i32 1, label %15
    i32 2, label %45
  ]

14:                                               ; preds = %6
  call void @exit(i32 noundef 0) #7
  unreachable

15:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %2) #6
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %2)
  %18 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #8
  %19 = trunc i64 %18 to i32
  %20 = load i8, ptr %2, align 16, !tbaa !9
  %.not3756 = icmp eq i8 %20, 0
  br i1 %.not3756, label %._crit_edge60, label %.lr.ph59

._crit_edge60:                                    ; preds = %28, %15
  call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %3) #6
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %3)
  %23 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #8
  %.02861 = trunc i64 %23 to i32
  %.not3862 = icmp eq i32 %.02861, %19
  br i1 %.not3862, label %.preheader, label %.lr.ph64

.lr.ph59:                                         ; preds = %15, %28
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %28 ], [ 0, %15 ]
  %24 = phi i8 [ %30, %28 ], [ %20, %15 ]
  %25 = phi ptr [ %29, %28 ], [ %2, %15 ]
  %26 = add i8 %24, -97
  %or.cond = icmp ult i8 %26, 26
  br i1 %or.cond, label %27, label %28

27:                                               ; preds = %.lr.ph59
  %narrow41 = add nsw i8 %24, -32
  store i8 %narrow41, ptr %25, align 1, !tbaa !9
  br label %28

28:                                               ; preds = %.lr.ph59, %27
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %29 = getelementptr inbounds [100 x i8], ptr %2, i64 0, i64 %indvars.iv.next72
  %30 = load i8, ptr %29, align 1, !tbaa !9
  %.not37 = icmp eq i8 %30, 0
  br i1 %.not37, label %._crit_edge60, label %.lr.ph59, !llvm.loop !10

.preheader:                                       ; preds = %.lr.ph64, %._crit_edge60
  %31 = load i8, ptr %3, align 16, !tbaa !9
  %.not3965 = icmp eq i8 %31, 0
  br i1 %.not3965, label %._crit_edge68, label %.lr.ph67

.lr.ph64:                                         ; preds = %._crit_edge60, %.lr.ph64
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %3)
  %35 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #8
  %.028 = trunc i64 %35 to i32
  %.not38 = icmp eq i32 %.028, %19
  br i1 %.not38, label %.preheader, label %.lr.ph64, !llvm.loop !12

._crit_edge68:                                    ; preds = %42, %.preheader
  %36 = call ptr @encrypt(ptr noundef nonnull %2, ptr noundef nonnull %3)
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, ptr noundef %36)
  call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %2) #6
  br label %77

.lr.ph67:                                         ; preds = %.preheader, %42
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %42 ], [ 0, %.preheader ]
  %38 = phi i8 [ %44, %42 ], [ %31, %.preheader ]
  %39 = phi ptr [ %43, %42 ], [ %3, %.preheader ]
  %40 = add i8 %38, -97
  %or.cond42 = icmp ult i8 %40, 26
  br i1 %or.cond42, label %41, label %42

41:                                               ; preds = %.lr.ph67
  %narrow40 = add nsw i8 %38, -32
  store i8 %narrow40, ptr %39, align 1, !tbaa !9
  br label %42

42:                                               ; preds = %.lr.ph67, %41
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %43 = getelementptr inbounds [100 x i8], ptr %3, i64 0, i64 %indvars.iv.next74
  %44 = load i8, ptr %43, align 1, !tbaa !9
  %.not39 = icmp eq i8 %44, 0
  br i1 %.not39, label %._crit_edge68, label %.lr.ph67, !llvm.loop !13

45:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %4) #6
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  %47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %4)
  %48 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %4) #8
  %49 = trunc i64 %48 to i32
  %50 = load i8, ptr %4, align 16, !tbaa !9
  %.not46 = icmp eq i8 %50, 0
  br i1 %.not46, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %58, %45
  call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %5) #6
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %52 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %5)
  %53 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %5) #8
  %.02448 = trunc i64 %53 to i32
  %.not3449 = icmp eq i32 %.02448, %49
  br i1 %.not3449, label %.preheader45, label %.lr.ph51

.lr.ph:                                           ; preds = %45, %58
  %indvars.iv = phi i64 [ %indvars.iv.next, %58 ], [ 0, %45 ]
  %54 = phi i8 [ %60, %58 ], [ %50, %45 ]
  %55 = phi ptr [ %59, %58 ], [ %4, %45 ]
  %56 = add i8 %54, -97
  %or.cond43 = icmp ult i8 %56, 26
  br i1 %or.cond43, label %57, label %58

57:                                               ; preds = %.lr.ph
  %narrow36 = add nsw i8 %54, -32
  store i8 %narrow36, ptr %55, align 1, !tbaa !9
  br label %58

58:                                               ; preds = %.lr.ph, %57
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %59 = getelementptr inbounds [100 x i8], ptr %4, i64 0, i64 %indvars.iv.next
  %60 = load i8, ptr %59, align 1, !tbaa !9
  %.not = icmp eq i8 %60, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !14

.preheader45:                                     ; preds = %.lr.ph51, %._crit_edge
  %61 = load i8, ptr %5, align 16, !tbaa !9
  %.not3552 = icmp eq i8 %61, 0
  br i1 %.not3552, label %._crit_edge55, label %.lr.ph54

.lr.ph51:                                         ; preds = %._crit_edge, %.lr.ph51
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %64 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %5)
  %65 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %5) #8
  %.024 = trunc i64 %65 to i32
  %.not34 = icmp eq i32 %.024, %49
  br i1 %.not34, label %.preheader45, label %.lr.ph51, !llvm.loop !15

._crit_edge55:                                    ; preds = %72, %.preheader45
  %66 = call ptr @decrypt(ptr noundef nonnull %4, ptr noundef nonnull %5)
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, ptr noundef %66)
  call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %4) #6
  br label %77

.lr.ph54:                                         ; preds = %.preheader45, %72
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %72 ], [ 0, %.preheader45 ]
  %68 = phi i8 [ %74, %72 ], [ %61, %.preheader45 ]
  %69 = phi ptr [ %73, %72 ], [ %5, %.preheader45 ]
  %70 = add i8 %68, -97
  %or.cond44 = icmp ult i8 %70, 26
  br i1 %or.cond44, label %71, label %72

71:                                               ; preds = %.lr.ph54
  %narrow = add nsw i8 %68, -32
  store i8 %narrow, ptr %69, align 1, !tbaa !9
  br label %72

72:                                               ; preds = %.lr.ph54, %71
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %73 = getelementptr inbounds [100 x i8], ptr %5, i64 0, i64 %indvars.iv.next70
  %74 = load i8, ptr %73, align 1, !tbaa !9
  %.not35 = icmp eq i8 %74, 0
  br i1 %.not35, label %._crit_edge55, label %.lr.ph54, !llvm.loop !16

75:                                               ; preds = %6
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16)
  br label %77

77:                                               ; preds = %._crit_edge68, %75, %._crit_edge55
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  br label %6
}

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #5

attributes #0 = { 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 = { 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 #3 = { noreturn 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 = { 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 #5 = { noreturn 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 #6 = { nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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/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 = distinct !{!16, !11}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass