; LLVM IR from ahampriyanshu/algo-ds-101 :: Algorithms/Cryptography/Affine_Cipher (affine_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
@stdin = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @CalcGCD(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: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca [100 x i32], align 16
  %9 = alloca [100 x i32], align 16
  %10 = alloca [100 x i8], align 16
  %11 = alloca [100 x i8], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 400, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 400, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 100, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 100, ptr %11) #6
  %14 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %15 = getelementptr inbounds [100 x i8], ptr %10, i64 0, i64 0
  %16 = load ptr, ptr @stdin, align 8, !tbaa !5
  %17 = call ptr @fgets(ptr noundef %15, i32 noundef 100000, ptr noundef %16)
  store i32 0, ptr %2, align 4, !tbaa !9
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %57, %0
  %19 = load i32, ptr %2, align 4, !tbaa !9
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [100 x i8], ptr %10, i64 0, i64 0
  %22 = call i64 @strlen(ptr noundef %21) #7
  %23 = icmp ult i64 %20, %22
  br i1 %23, label %24, label %60

24:                                               ; preds = %18
  %25 = load i32, ptr %2, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100 x i8], ptr %10, i64 0, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !11
  %29 = sext i8 %28 to i32
  %30 = icmp ne i32 %29, 32
  br i1 %30, label %31, label %50

31:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %32 = call ptr @__ctype_toupper_loc() #8
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = load i32, ptr %2, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100 x i8], ptr %10, i64 0, i64 %35
  %37 = load i8, ptr %36, align 1, !tbaa !11
  %38 = sext i8 %37 to i32
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i32, ptr %33, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !9
  store i32 %41, ptr %12, align 4, !tbaa !9
  %42 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %42, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %43 = load i32, ptr %13, align 4, !tbaa !9
  %44 = trunc i32 %43 to i8
  %45 = load i32, ptr %3, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100 x i8], ptr %10, i64 0, i64 %46
  store i8 %44, ptr %47, align 1, !tbaa !11
  %48 = load i32, ptr %3, align 4, !tbaa !9
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %3, align 4, !tbaa !9
  br label %56

50:                                               ; preds = %24
  %51 = load i32, ptr %3, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100 x i8], ptr %10, i64 0, i64 %52
  store i8 32, ptr %53, align 1, !tbaa !11
  %54 = load i32, ptr %3, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %3, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %50, %31
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %2, align 4, !tbaa !9
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %2, align 4, !tbaa !9
  br label %18, !llvm.loop !12

60:                                               ; preds = %18
  %61 = load i32, ptr %3, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100 x i8], ptr %10, i64 0, i64 %62
  store i8 0, ptr %63, align 1, !tbaa !11
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %65 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %6)
  %66 = load i32, ptr %6, align 4, !tbaa !9
  %67 = icmp slt i32 %66, 1
  br i1 %67, label %71, label %68

68:                                               ; preds = %60
  %69 = load i32, ptr %6, align 4, !tbaa !9
  %70 = icmp sgt i32 %69, 25
  br i1 %70, label %71, label %73

71:                                               ; preds = %68, %60
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  call void @exit(i32 noundef 0) #9
  unreachable

73:                                               ; preds = %68
  %74 = load i32, ptr %6, align 4, !tbaa !9
  %75 = call i32 @CalcGCD(i32 noundef %74)
  store i32 %75, ptr %5, align 4, !tbaa !9
  %76 = load i32, ptr %5, align 4, !tbaa !9
  %77 = icmp ne i32 %76, 1
  br i1 %77, label %78, label %82

78:                                               ; preds = %73
  %79 = load i32, ptr %6, align 4, !tbaa !9
  %80 = load i32, ptr %5, align 4, !tbaa !9
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %79, i32 noundef %80)
  call void @exit(i32 noundef 0) #9
  unreachable

82:                                               ; preds = %73
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %84 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %7)
  %85 = load i32, ptr %7, align 4, !tbaa !9
  %86 = icmp slt i32 %85, 0
  br i1 %86, label %90, label %87

87:                                               ; preds = %82
  %88 = load i32, ptr %7, align 4, !tbaa !9
  %89 = icmp sgt i32 %88, 25
  br i1 %89, label %90, label %92

90:                                               ; preds = %87, %82
  %91 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  call void @exit(i32 noundef 0) #9
  unreachable

92:                                               ; preds = %87
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %93

93:                                               ; preds = %121, %92
  %94 = load i32, ptr %2, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100 x i8], ptr %10, i64 0, i64 0
  %97 = call i64 @strlen(ptr noundef %96) #7
  %98 = icmp ult i64 %95, %97
  br i1 %98, label %99, label %124

99:                                               ; preds = %93
  %100 = load i32, ptr %2, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100 x i8], ptr %10, i64 0, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !11
  %104 = sext i8 %103 to i32
  %105 = icmp ne i32 %104, 32
  br i1 %105, label %106, label %116

106:                                              ; preds = %99
  %107 = load i32, ptr %2, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100 x i8], ptr %10, i64 0, i64 %108
  %110 = load i8, ptr %109, align 1, !tbaa !11
  %111 = sext i8 %110 to i32
  %112 = sub nsw i32 %111, 65
  %113 = load i32, ptr %2, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100 x i32], ptr %8, i64 0, i64 %114
  store i32 %112, ptr %115, align 4, !tbaa !9
  br label %120

116:                                              ; preds = %99
  %117 = load i32, ptr %2, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [100 x i32], ptr %8, i64 0, i64 %118
  store i32 -20, ptr %119, align 4, !tbaa !9
  br label %120

120:                                              ; preds = %116, %106
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %2, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %2, align 4, !tbaa !9
  br label %93, !llvm.loop !14

124:                                              ; preds = %93
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %126

126:                                              ; preds = %160, %124
  %127 = load i32, ptr %2, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100 x i8], ptr %10, i64 0, i64 0
  %130 = call i64 @strlen(ptr noundef %129) #7
  %131 = icmp ult i64 %128, %130
  br i1 %131, label %132, label %163

132:                                              ; preds = %126
  %133 = load i32, ptr %2, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [100 x i32], ptr %8, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !9
  %137 = icmp ne i32 %136, -20
  br i1 %137, label %138, label %157

138:                                              ; preds = %132
  %139 = load i32, ptr %6, align 4, !tbaa !9
  %140 = load i32, ptr %2, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [100 x i32], ptr %8, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !9
  %144 = mul nsw i32 %139, %143
  %145 = load i32, ptr %7, align 4, !tbaa !9
  %146 = add nsw i32 %144, %145
  %147 = srem i32 %146, 26
  %148 = load i32, ptr %2, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [100 x i32], ptr %9, i64 0, i64 %149
  store i32 %147, ptr %150, align 4, !tbaa !9
  %151 = load i32, ptr %2, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [100 x i32], ptr %9, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !9
  %155 = add nsw i32 %154, 65
  %156 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %155)
  br label %159

157:                                              ; preds = %132
  %158 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %159

159:                                              ; preds = %157, %138
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %2, align 4, !tbaa !9
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %2, align 4, !tbaa !9
  br label %126, !llvm.loop !15

163:                                              ; preds = %126
  %164 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  call void @llvm.lifetime.end.p0(i64 100, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 100, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 400, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 400, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %165 = load i32, ptr %1, align 4
  ret i32 %165
}

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

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__ctype_toupper_loc() #4

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 willreturn memory(none) "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 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind willreturn memory(none) }
attributes #9 = { noreturn 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


; 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
@stdin = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @CalcGCD(i32 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [100 x i32], align 16
  %4 = alloca [100 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %4) #6
  %5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %6 = load ptr, ptr @stdin, align 8, !tbaa !5
  %7 = call ptr @fgets(ptr noundef nonnull %4, i32 noundef 100000, ptr noundef %6)
  %char0 = load i8, ptr %4, align 16
  %.not51 = icmp eq i8 %char0, 0
  br i1 %.not51, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %17
  %indvars.iv = phi i64 [ %indvars.iv.next, %17 ], [ 0, %0 ]
  %8 = getelementptr inbounds [100 x i8], ptr %4, i64 0, i64 %indvars.iv
  %9 = load i8, ptr %8, align 1, !tbaa !9
  %.not41 = icmp eq i8 %9, 32
  br i1 %.not41, label %17, label %10

10:                                               ; preds = %.lr.ph
  %11 = tail call ptr @__ctype_toupper_loc() #7
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = sext i8 %9 to i64
  %14 = getelementptr inbounds i32, ptr %12, i64 %13
  %15 = load i32, ptr %14, align 4, !tbaa !10
  %16 = trunc i32 %15 to i8
  br label %17

17:                                               ; preds = %.lr.ph, %10
  %.sink = phi i8 [ %16, %10 ], [ 32, %.lr.ph ]
  store i8 %.sink, ptr %8, align 1
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %4) #8
  %19 = icmp ugt i64 %18, %indvars.iv.next
  br i1 %19, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !12

._crit_edge.loopexit:                             ; preds = %17
  %20 = and i64 %indvars.iv.next, 4294967295
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %.029.lcssa = phi i64 [ 0, %0 ], [ %20, %._crit_edge.loopexit ]
  %21 = getelementptr inbounds [100 x i8], ptr %4, i64 0, i64 %.029.lcssa
  store i8 0, ptr %21, align 1, !tbaa !9
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %1)
  %24 = load i32, ptr %1, align 4
  %25 = add i32 %24, -26
  %or.cond = icmp ult i32 %25, -25
  br i1 %or.cond, label %26, label %28

26:                                               ; preds = %._crit_edge
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @exit(i32 noundef 0) #9
  unreachable

28:                                               ; preds = %._crit_edge
  %29 = call i32 @CalcGCD(i32 noundef %24)
  %.not = icmp eq i32 %29, 1
  br i1 %.not, label %33, label %30

30:                                               ; preds = %28
  %31 = load i32, ptr %1, align 4, !tbaa !10
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %31, i32 noundef %29)
  call void @exit(i32 noundef 0) #9
  unreachable

33:                                               ; preds = %28
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %2)
  %36 = load i32, ptr %2, align 4
  %or.cond3 = icmp ugt i32 %36, 25
  br i1 %or.cond3, label %51, label %.preheader

.preheader:                                       ; preds = %33
  %37 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %4) #8
  %.not52 = icmp eq i64 %37, 0
  br i1 %.not52, label %._crit_edge46, label %.lr.ph45.preheader

.lr.ph45.preheader:                               ; preds = %.preheader
  %min.iters.check = icmp ult i64 %37, 8
  br i1 %min.iters.check, label %.lr.ph45.preheader66, label %vector.ph

.lr.ph45.preheader66:                             ; preds = %middle.block, %.lr.ph45.preheader
  %indvars.iv58.ph = phi i64 [ 0, %.lr.ph45.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph45

vector.ph:                                        ; preds = %.lr.ph45.preheader
  %n.vec = and i64 %37, -8
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %38 = getelementptr inbounds [100 x i8], ptr %4, i64 0, i64 %index
  %39 = getelementptr inbounds i8, ptr %38, i64 4
  %wide.load = load <4 x i8>, ptr %38, align 8, !tbaa !9
  %wide.load65 = load <4 x i8>, ptr %39, align 4, !tbaa !9
  %40 = icmp eq <4 x i8> %wide.load, <i8 32, i8 32, i8 32, i8 32>
  %41 = icmp eq <4 x i8> %wide.load65, <i8 32, i8 32, i8 32, i8 32>
  %42 = sext <4 x i8> %wide.load to <4 x i32>
  %43 = sext <4 x i8> %wide.load65 to <4 x i32>
  %44 = add nsw <4 x i32> %42, <i32 -65, i32 -65, i32 -65, i32 -65>
  %45 = add nsw <4 x i32> %43, <i32 -65, i32 -65, i32 -65, i32 -65>
  %46 = select <4 x i1> %40, <4 x i32> <i32 -20, i32 -20, i32 -20, i32 -20>, <4 x i32> %44
  %47 = select <4 x i1> %41, <4 x i32> <i32 -20, i32 -20, i32 -20, i32 -20>, <4 x i32> %45
  %48 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 %index
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  store <4 x i32> %46, ptr %48, align 16
  store <4 x i32> %47, ptr %49, align 16
  %index.next = add nuw i64 %index, 8
  %50 = icmp eq i64 %index.next, %n.vec
  br i1 %50, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %37, %n.vec
  br i1 %cmp.n, label %._crit_edge46, label %.lr.ph45.preheader66

51:                                               ; preds = %33
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  call void @exit(i32 noundef 0) #9
  unreachable

.lr.ph45:                                         ; preds = %.lr.ph45.preheader66, %.lr.ph45
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %.lr.ph45 ], [ %indvars.iv58.ph, %.lr.ph45.preheader66 ]
  %53 = getelementptr inbounds [100 x i8], ptr %4, i64 0, i64 %indvars.iv58
  %54 = load i8, ptr %53, align 1, !tbaa !9
  %.not40 = icmp eq i8 %54, 32
  %55 = sext i8 %54 to i32
  %56 = add nsw i32 %55, -65
  %.sink64 = select i1 %.not40, i32 -20, i32 %56
  %57 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 %indvars.iv58
  store i32 %.sink64, ptr %57, align 4
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next59, %37
  br i1 %exitcond.not, label %._crit_edge46, label %.lr.ph45, !llvm.loop !17

._crit_edge46:                                    ; preds = %.lr.ph45, %middle.block, %.preheader
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %char053 = load i8, ptr %4, align 16
  %.not54 = icmp eq i8 %char053, 0
  br i1 %.not54, label %._crit_edge50, label %.lr.ph49

.lr.ph49:                                         ; preds = %._crit_edge46, %71
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %71 ], [ 0, %._crit_edge46 ]
  %59 = getelementptr inbounds [100 x i32], ptr %3, i64 0, i64 %indvars.iv61
  %60 = load i32, ptr %59, align 4, !tbaa !10
  %.not39 = icmp eq i32 %60, -20
  br i1 %.not39, label %69, label %61

61:                                               ; preds = %.lr.ph49
  %62 = load i32, ptr %1, align 4, !tbaa !10
  %63 = mul nsw i32 %62, %60
  %64 = load i32, ptr %2, align 4, !tbaa !10
  %65 = add nsw i32 %63, %64
  %66 = srem i32 %65, 26
  %67 = add nsw i32 %66, 65
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %67)
  br label %71

69:                                               ; preds = %.lr.ph49
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %71

71:                                               ; preds = %61, %69
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %72 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %4) #8
  %73 = icmp ugt i64 %72, %indvars.iv.next62
  br i1 %73, label %.lr.ph49, label %._crit_edge50, !llvm.loop !18

._crit_edge50:                                    ; preds = %71, %._crit_edge46
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

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

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_toupper_loc() local_unnamed_addr #4

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

; 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { nounwind willreturn memory(none) }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { noreturn 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !13, !16, !15}
!18 = distinct !{!18, !13}


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