; LLVM IR from freakout42/macrocalc :: mc/mex (search)

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

@readpattern.oldpati = external hidden global i32, align 4
@readpattern.maxpati = external hidden global i32, align 4
@readpattern.oldpat = external hidden global [4 x ptr], align 16
@pat = external global [0 x i8], align 1
@casesens = external global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @readpattern(ptr noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [128 x i8], align 16
  %10 = alloca [128 x i8], align 16
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr %10) #5
  %12 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %12, i8 0, i64 128, i1 false)
  %13 = load i8, ptr @pat, align 1, !tbaa !9
  %14 = sext i8 %13 to i32
  %15 = icmp ne i32 %14, 0
  br i1 %15, label %16, label %17

16:                                               ; preds = %1
  store ptr @pat, ptr %7, align 8, !tbaa !5
  br label %28

17:                                               ; preds = %1
  br label %18

18:                                               ; preds = %111, %95, %17
  %19 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !10
  %20 = icmp sge i32 %19, 0
  br i1 %20, label %21, label %26

21:                                               ; preds = %18
  %22 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !10
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [4 x ptr], ptr @readpattern.oldpat, i64 0, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  store ptr %25, ptr %7, align 8, !tbaa !5
  br label %27

26:                                               ; preds = %18
  store ptr null, ptr %7, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %26, %21
  br label %28

28:                                               ; preds = %27, %16
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %72

31:                                               ; preds = %28
  store i32 0, ptr %5, align 4, !tbaa !10
  br label %32

32:                                               ; preds = %67, %31
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = load i32, ptr %5, align 4, !tbaa !10
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i8, ptr %33, i64 %35
  %37 = load i8, ptr %36, align 1, !tbaa !9
  %38 = sext i8 %37 to i32
  store i32 %38, ptr %4, align 4, !tbaa !10
  %39 = load i32, ptr @casesens, align 4, !tbaa !10
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %47

41:                                               ; preds = %32
  %42 = load i32, ptr %4, align 4, !tbaa !10
  %43 = trunc i32 %42 to i8
  %44 = load i32, ptr %5, align 4, !tbaa !10
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [128 x i8], ptr %9, i64 0, i64 %45
  store i8 %43, ptr %46, align 1, !tbaa !9
  br label %64

47:                                               ; preds = %32
  %48 = load i32, ptr %4, align 4, !tbaa !10
  %49 = icmp sge i32 %48, 97
  br i1 %49, label %50, label %56

50:                                               ; preds = %47
  %51 = load i32, ptr %4, align 4, !tbaa !10
  %52 = icmp sle i32 %51, 122
  br i1 %52, label %53, label %56

53:                                               ; preds = %50
  %54 = load i32, ptr %4, align 4, !tbaa !10
  %55 = sub nsw i32 %54, 32
  br label %58

56:                                               ; preds = %50, %47
  %57 = load i32, ptr %4, align 4, !tbaa !10
  br label %58

58:                                               ; preds = %56, %53
  %59 = phi i32 [ %55, %53 ], [ %57, %56 ]
  %60 = trunc i32 %59 to i8
  %61 = load i32, ptr %5, align 4, !tbaa !10
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [128 x i8], ptr %9, i64 0, i64 %62
  store i8 %60, ptr %63, align 1, !tbaa !9
  br label %64

64:                                               ; preds = %58, %41
  %65 = load i32, ptr %5, align 4, !tbaa !10
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %5, align 4, !tbaa !10
  br label %67

67:                                               ; preds = %64
  %68 = load i32, ptr %4, align 4, !tbaa !10
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %32, label %70, !llvm.loop !12

70:                                               ; preds = %67
  %71 = getelementptr inbounds [128 x i8], ptr %9, i64 0, i64 0
  store ptr %71, ptr %8, align 8, !tbaa !5
  br label %73

72:                                               ; preds = %28
  store ptr null, ptr %8, align 8, !tbaa !5
  br label %73

73:                                               ; preds = %72, %70
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  %77 = call i32 @mlreply(ptr noundef %74, ptr noundef %75, ptr noundef %76, i32 noundef 128, i32 noundef 1)
  store i32 %77, ptr %6, align 4, !tbaa !10
  %78 = load i32, ptr %6, align 4, !tbaa !10
  %79 = icmp eq i32 %78, 336
  br i1 %79, label %80, label %96

80:                                               ; preds = %73
  %81 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !10
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %83, label %86

83:                                               ; preds = %80
  %84 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !10
  %85 = add nsw i32 %84, -1
  store i32 %85, ptr @readpattern.oldpati, align 4, !tbaa !10
  br label %95

86:                                               ; preds = %80
  %87 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !10
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %89, label %94

89:                                               ; preds = %86
  %90 = load i32, ptr @readpattern.maxpati, align 4, !tbaa !10
  %91 = icmp sgt i32 %90, 0
  br i1 %91, label %92, label %94

92:                                               ; preds = %89
  %93 = load i32, ptr @readpattern.maxpati, align 4, !tbaa !10
  store i32 %93, ptr @readpattern.oldpati, align 4, !tbaa !10
  br label %94

94:                                               ; preds = %92, %89, %86
  br label %95

95:                                               ; preds = %94, %83
  br label %18

96:                                               ; preds = %73
  %97 = load i32, ptr %6, align 4, !tbaa !10
  %98 = icmp eq i32 %97, 334
  br i1 %98, label %99, label %112

99:                                               ; preds = %96
  %100 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !10
  %101 = load i32, ptr @readpattern.maxpati, align 4, !tbaa !10
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %103, label %106

103:                                              ; preds = %99
  %104 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !10
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr @readpattern.oldpati, align 4, !tbaa !10
  br label %111

106:                                              ; preds = %99
  %107 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !10
  %108 = icmp sgt i32 %107, 0
  br i1 %108, label %109, label %110

109:                                              ; preds = %106
  store i32 0, ptr @readpattern.oldpati, align 4, !tbaa !10
  br label %110

110:                                              ; preds = %109, %106
  br label %111

111:                                              ; preds = %110, %103
  br label %18

112:                                              ; preds = %96
  %113 = load i32, ptr %6, align 4, !tbaa !10
  %114 = icmp ne i32 %113, 1
  br i1 %114, label %115, label %120

115:                                              ; preds = %112
  %116 = load i32, ptr %6, align 4, !tbaa !10
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %120

118:                                              ; preds = %115
  %119 = call i32 (...) @ctrlg()
  store i32 %119, ptr %2, align 4
  store i32 1, ptr %11, align 4
  br label %158

120:                                              ; preds = %115, %112
  %121 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  %122 = load i8, ptr %121, align 16, !tbaa !9
  %123 = sext i8 %122 to i32
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %150

125:                                              ; preds = %120
  %126 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  %127 = call ptr @strcpy(ptr noundef @pat, ptr noundef %126) #5
  %128 = load i32, ptr %6, align 4, !tbaa !10
  %129 = icmp eq i32 %128, 1
  br i1 %129, label %130, label %149

130:                                              ; preds = %125
  %131 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !10
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr @readpattern.oldpati, align 4, !tbaa !10
  %133 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !10
  %134 = icmp sgt i32 %133, 3
  br i1 %134, label %135, label %136

135:                                              ; preds = %130
  store i32 0, ptr @readpattern.oldpati, align 4, !tbaa !10
  br label %136

136:                                              ; preds = %135, %130
  %137 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !10
  %138 = load i32, ptr @readpattern.maxpati, align 4, !tbaa !10
  %139 = icmp sgt i32 %137, %138
  br i1 %139, label %140, label %142

140:                                              ; preds = %136
  %141 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !10
  store i32 %141, ptr @readpattern.maxpati, align 4, !tbaa !10
  br label %142

142:                                              ; preds = %140, %136
  %143 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !10
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [4 x ptr], ptr @readpattern.oldpat, i64 0, i64 %144
  %146 = load ptr, ptr %145, align 8, !tbaa !5
  %147 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  %148 = call ptr @strcpy(ptr noundef %146, ptr noundef %147) #5
  br label %149

149:                                              ; preds = %142, %125
  br label %156

150:                                              ; preds = %120
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = icmp eq ptr %151, null
  br i1 %152, label %153, label %155

153:                                              ; preds = %150
  %154 = call i32 (...) @ctrlg()
  store i32 %154, ptr %2, align 4
  store i32 1, ptr %11, align 4
  br label %158

155:                                              ; preds = %150
  br label %156

156:                                              ; preds = %155, %149
  %157 = load i32, ptr %6, align 4, !tbaa !10
  store i32 %157, ptr %2, align 4
  store i32 1, ptr %11, align 4
  br label %158

158:                                              ; preds = %156, %153, %118
  call void @llvm.lifetime.end.p0(i64 128, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  %159 = load i32, ptr %2, align 4
  ret i32 %159
}

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare i32 @mlreply(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #3

declare i32 @ctrlg(...) #3

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #4

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "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 }

!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"}


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

@readpattern.oldpati = external hidden local_unnamed_addr global i32, align 4
@readpattern.maxpati = external hidden local_unnamed_addr global i32, align 4
@readpattern.oldpat = external hidden local_unnamed_addr global [4 x ptr], align 16
@pat = external global [0 x i8], align 1
@casesens = external local_unnamed_addr global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @readpattern(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca [128 x i8], align 16
  %3 = alloca [128 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %3) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %3, i8 0, i64 128, i1 false)
  %4 = load i8, ptr @pat, align 1, !tbaa !5
  %.not = icmp eq i8 %4, 0
  br i1 %.not, label %.thread-pre-split_crit_edge, label %.preheader

.thread-pre-split_crit_edge:                      ; preds = %1
  %.pr.pre = load i32, ptr @readpattern.oldpati, align 4, !tbaa !8
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %27, %.thread-pre-split_crit_edge, %36, %40, %38, %25, %31
  %5 = phi i32 [ %37, %36 ], [ 0, %40 ], [ %33, %38 ], [ %26, %25 ], [ %29, %31 ], [ %.pr.pre, %.thread-pre-split_crit_edge ], [ %23, %27 ]
  %6 = icmp sgt i32 %5, -1
  br i1 %6, label %7, label %.thread

7:                                                ; preds = %thread-pre-split
  %8 = zext nneg i32 %5 to i64
  %9 = getelementptr inbounds [4 x ptr], ptr @readpattern.oldpat, i64 0, i64 %8
  %10 = load ptr, ptr %9, align 8, !tbaa !10
  %.not36 = icmp eq ptr %10, null
  br i1 %.not36, label %.thread, label %.preheader

.preheader:                                       ; preds = %1, %7
  %.151 = phi ptr [ %10, %7 ], [ @pat, %1 ]
  %11 = load i32, ptr @casesens, align 4, !tbaa !8
  %.not37 = icmp eq i32 %11, 0
  br i1 %.not37, label %.preheader.split.us, label %.preheader.split

.preheader.split.us:                              ; preds = %.preheader, %.preheader.split.us
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %.preheader.split.us ], [ 0, %.preheader ]
  %12 = getelementptr inbounds i8, ptr %.151, i64 %indvars.iv44
  %13 = load i8, ptr %12, align 1, !tbaa !5
  %14 = add i8 %13, -97
  %or.cond.us = icmp ult i8 %14, 26
  %15 = add i8 %13, -32
  %16 = select i1 %or.cond.us, i8 %15, i8 %13
  %17 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 %indvars.iv44
  store i8 %16, ptr %17, align 1, !tbaa !5
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %.not38.us = icmp eq i8 %13, 0
  br i1 %.not38.us, label %.thread, label %.preheader.split.us, !llvm.loop !12

.preheader.split:                                 ; preds = %.preheader, %.preheader.split
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader.split ], [ 0, %.preheader ]
  %18 = getelementptr inbounds i8, ptr %.151, i64 %indvars.iv
  %19 = load i8, ptr %18, align 1, !tbaa !5
  %20 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 %indvars.iv
  store i8 %19, ptr %20, align 1, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not38 = icmp eq i8 %19, 0
  br i1 %.not38, label %.thread, label %.preheader.split, !llvm.loop !12

.thread:                                          ; preds = %.preheader.split, %.preheader.split.us, %thread-pre-split, %7
  %.0 = phi ptr [ null, %7 ], [ null, %thread-pre-split ], [ %2, %.preheader.split.us ], [ %2, %.preheader.split ]
  %21 = call i32 @mlreply(ptr noundef %0, ptr noundef %.0, ptr noundef nonnull %3, i32 noundef 128, i32 noundef 1) #5
  switch i32 %21, label %41 [
    i32 336, label %22
    i32 334, label %32
  ]

22:                                               ; preds = %.thread
  %23 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !8
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %25, label %27

25:                                               ; preds = %22
  %26 = add nsw i32 %23, -1
  store i32 %26, ptr @readpattern.oldpati, align 4, !tbaa !8
  br label %thread-pre-split

27:                                               ; preds = %22
  %28 = icmp eq i32 %23, 0
  %29 = load i32, ptr @readpattern.maxpati, align 4
  %30 = icmp sgt i32 %29, 0
  %or.cond3 = select i1 %28, i1 %30, i1 false
  br i1 %or.cond3, label %31, label %thread-pre-split

31:                                               ; preds = %27
  store i32 %29, ptr @readpattern.oldpati, align 4, !tbaa !8
  br label %thread-pre-split

32:                                               ; preds = %.thread
  %33 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !8
  %34 = load i32, ptr @readpattern.maxpati, align 4, !tbaa !8
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %36, label %38

36:                                               ; preds = %32
  %37 = add nsw i32 %33, 1
  store i32 %37, ptr @readpattern.oldpati, align 4, !tbaa !8
  br label %thread-pre-split

38:                                               ; preds = %32
  %39 = icmp sgt i32 %33, 0
  br i1 %39, label %40, label %thread-pre-split

40:                                               ; preds = %38
  store i32 0, ptr @readpattern.oldpati, align 4, !tbaa !8
  br label %thread-pre-split

41:                                               ; preds = %.thread
  %or.cond5 = icmp ugt i32 %21, 1
  br i1 %or.cond5, label %42, label %44

42:                                               ; preds = %41
  %43 = call i32 (...) @ctrlg() #5
  br label %65

44:                                               ; preds = %41
  %45 = load i8, ptr %3, align 16, !tbaa !5
  %.not39 = icmp eq i8 %45, 0
  br i1 %.not39, label %61, label %46

46:                                               ; preds = %44
  %47 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) @pat, ptr noundef nonnull dereferenceable(1) %3) #5
  %48 = icmp eq i32 %21, 1
  br i1 %48, label %49, label %65

49:                                               ; preds = %46
  %50 = load i32, ptr @readpattern.oldpati, align 4, !tbaa !8
  %51 = add nsw i32 %50, 1
  %52 = icmp sgt i32 %50, 2
  %spec.store.select = select i1 %52, i32 0, i32 %51
  store i32 %spec.store.select, ptr @readpattern.oldpati, align 4
  %53 = load i32, ptr @readpattern.maxpati, align 4, !tbaa !8
  %54 = icmp sgt i32 %spec.store.select, %53
  br i1 %54, label %55, label %56

55:                                               ; preds = %49
  store i32 %spec.store.select, ptr @readpattern.maxpati, align 4, !tbaa !8
  br label %56

56:                                               ; preds = %55, %49
  %57 = sext i32 %spec.store.select to i64
  %58 = getelementptr inbounds [4 x ptr], ptr @readpattern.oldpat, i64 0, i64 %57
  %59 = load ptr, ptr %58, align 8, !tbaa !10
  %60 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %59, ptr noundef nonnull dereferenceable(1) %3) #5
  br label %65

61:                                               ; preds = %44
  %62 = icmp eq ptr %.0, null
  br i1 %62, label %63, label %65

63:                                               ; preds = %61
  %64 = call i32 (...) @ctrlg() #5
  br label %65

65:                                               ; preds = %56, %46, %61, %63, %42
  %.027 = phi i32 [ %43, %42 ], [ %64, %63 ], [ %21, %61 ], [ 0, %46 ], [ 1, %56 ]
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %2) #5
  ret i32 %.027
}

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare i32 @mlreply(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @ctrlg(...) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #4

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

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 nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 }

!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/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass