; LLVM IR from Montimage/mmt-security :: src (main_gen_plugin)

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

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [43 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [40 x i8], align 1

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

18:                                               ; preds = %2
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = icmp ne i32 %19, 4
  br i1 %20, label %21, label %41

21:                                               ; preds = %18
  %22 = load ptr, ptr @stderr, align 8, !tbaa !9
  %23 = load ptr, ptr %5, align 8, !tbaa !9
  %24 = getelementptr inbounds ptr, ptr %23, i64 0
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef @.str, ptr noundef %25) #6
  %27 = load ptr, ptr @stderr, align 8, !tbaa !9
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef @.str.1) #6
  %29 = load ptr, ptr @stderr, align 8, !tbaa !9
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef @.str.2) #6
  %31 = load ptr, ptr @stderr, align 8, !tbaa !9
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str.3) #6
  %33 = load ptr, ptr @stderr, align 8, !tbaa !9
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef @.str.4) #6
  %35 = load ptr, ptr @stderr, align 8, !tbaa !9
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.5) #6
  %37 = load ptr, ptr @stderr, align 8, !tbaa !9
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.6) #6
  %39 = load ptr, ptr @stderr, align 8, !tbaa !9
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str.7) #6
  store i32 1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %150

41:                                               ; preds = %18, %2
  %42 = load ptr, ptr %5, align 8, !tbaa !9
  %43 = getelementptr inbounds ptr, ptr %42, i64 2
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  store ptr %44, ptr %11, align 8, !tbaa !9
  %45 = load ptr, ptr %5, align 8, !tbaa !9
  %46 = getelementptr inbounds ptr, ptr %45, i64 1
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  store ptr %47, ptr %12, align 8, !tbaa !9
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = icmp eq i32 %48, 4
  br i1 %49, label %50, label %69

50:                                               ; preds = %41
  %51 = load ptr, ptr %5, align 8, !tbaa !9
  %52 = getelementptr inbounds ptr, ptr %51, i64 3
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  %54 = call i32 @strcmp(ptr noundef %53, ptr noundef @.str.8) #7
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %69

56:                                               ; preds = %50
  %57 = load ptr, ptr %12, align 8, !tbaa !9
  %58 = load ptr, ptr %12, align 8, !tbaa !9
  %59 = call i64 @strlen(ptr noundef %58) #7
  %60 = getelementptr inbounds i8, ptr %57, i64 %59
  %61 = getelementptr inbounds i8, ptr %60, i64 -2
  %62 = call i32 @strcmp(ptr noundef %61, ptr noundef @.str.9) #7
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %65, label %64

64:                                               ; preds = %56
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 3, ptr noundef @.str.10)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %150

65:                                               ; preds = %56
  %66 = getelementptr inbounds [10000 x i8], ptr %9, i64 0, i64 0
  %67 = load ptr, ptr %12, align 8, !tbaa !9
  %68 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %66, i64 noundef 10000, ptr noundef @.str.11, ptr noundef %67) #6
  br label %82

69:                                               ; preds = %50, %41
  %70 = load ptr, ptr %12, align 8, !tbaa !9
  %71 = load ptr, ptr %12, align 8, !tbaa !9
  %72 = call i64 @strlen(ptr noundef %71) #7
  %73 = getelementptr inbounds i8, ptr %70, i64 %72
  %74 = getelementptr inbounds i8, ptr %73, i64 -3
  %75 = call i32 @strcmp(ptr noundef %74, ptr noundef @.str.12) #7
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %78, label %77

77:                                               ; preds = %69
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 3, ptr noundef @.str.13)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %150

78:                                               ; preds = %69
  %79 = getelementptr inbounds [10000 x i8], ptr %9, i64 0, i64 0
  %80 = load ptr, ptr %12, align 8, !tbaa !9
  %81 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %79, i64 noundef 10000, ptr noundef @.str.14, ptr noundef %80) #6
  br label %82

82:                                               ; preds = %78, %65
  %83 = load ptr, ptr %11, align 8, !tbaa !9
  %84 = call i64 @read_rules_from_file(ptr noundef %83, ptr noundef %6, ptr noundef %13)
  store i64 %84, ptr %7, align 8, !tbaa !11
  %85 = getelementptr inbounds [10000 x i8], ptr %9, i64 0, i64 0
  %86 = load ptr, ptr %6, align 8, !tbaa !9
  %87 = load i64, ptr %7, align 8, !tbaa !11
  %88 = load ptr, ptr %13, align 8, !tbaa !9
  %89 = call i32 @generate_fsm(ptr noundef %85, ptr noundef %86, i64 noundef %87, ptr noundef %88)
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = icmp eq i32 %90, 4
  br i1 %91, label %92, label %103

92:                                               ; preds = %82
  %93 = load ptr, ptr %5, align 8, !tbaa !9
  %94 = getelementptr inbounds ptr, ptr %93, i64 3
  %95 = load ptr, ptr %94, align 8, !tbaa !9
  %96 = call i32 @strcmp(ptr noundef %95, ptr noundef @.str.8) #7
  %97 = icmp eq i32 %96, 0
  br i1 %97, label %98, label %103

98:                                               ; preds = %92
  %99 = load i64, ptr %7, align 8, !tbaa !11
  %100 = load ptr, ptr %11, align 8, !tbaa !9
  %101 = getelementptr inbounds [10000 x i8], ptr %9, i64 0, i64 0
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 0, ptr noundef @.str.15, i64 noundef %99, ptr noundef %100, ptr noundef %101)
  %102 = getelementptr inbounds [10000 x i8], ptr %9, i64 0, i64 0
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 0, ptr noundef @.str.16, ptr noundef %102)
  br label %132

103:                                              ; preds = %92, %82
  %104 = load i32, ptr %4, align 4, !tbaa !5
  %105 = icmp eq i32 %104, 3
  br i1 %105, label %106, label %110

106:                                              ; preds = %103
  %107 = load ptr, ptr %12, align 8, !tbaa !9
  %108 = getelementptr inbounds [10000 x i8], ptr %9, i64 0, i64 0
  %109 = call i32 @compile_gen_code(ptr noundef %107, ptr noundef %108, ptr noundef @.str.17)
  store i32 %109, ptr %14, align 4, !tbaa !5
  br label %120

110:                                              ; preds = %103
  %111 = getelementptr inbounds [10000 x i8], ptr %10, i64 0, i64 0
  %112 = load ptr, ptr %5, align 8, !tbaa !9
  %113 = getelementptr inbounds ptr, ptr %112, i64 3
  %114 = load ptr, ptr %113, align 8, !tbaa !9
  %115 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %111, i64 noundef 10000, ptr noundef @.str.18, ptr noundef %114) #6
  %116 = load ptr, ptr %12, align 8, !tbaa !9
  %117 = getelementptr inbounds [10000 x i8], ptr %9, i64 0, i64 0
  %118 = getelementptr inbounds [10000 x i8], ptr %10, i64 0, i64 0
  %119 = call i32 @compile_gen_code(ptr noundef %116, ptr noundef %117, ptr noundef %118)
  store i32 %119, ptr %14, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %110, %106
  %121 = load i32, ptr %14, align 4, !tbaa !5
  %122 = icmp eq i32 %121, 0
  br i1 %122, label %123, label %129

123:                                              ; preds = %120
  %124 = load i64, ptr %7, align 8, !tbaa !11
  %125 = load ptr, ptr %11, align 8, !tbaa !9
  %126 = load ptr, ptr %12, align 8, !tbaa !9
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 0, ptr noundef @.str.15, i64 noundef %124, ptr noundef %125, ptr noundef %126)
  %127 = getelementptr inbounds [10000 x i8], ptr %9, i64 0, i64 0
  %128 = call i32 @remove(ptr noundef %127) #6
  br label %131

129:                                              ; preds = %120
  %130 = load ptr, ptr %11, align 8, !tbaa !9
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 3, ptr noundef @.str.19, ptr noundef %130)
  br label %131

131:                                              ; preds = %129, %123
  br label %132

132:                                              ; preds = %131, %98
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %133

133:                                              ; preds = %142, %132
  %134 = load i64, ptr %8, align 8, !tbaa !11
  %135 = load i64, ptr %7, align 8, !tbaa !11
  %136 = icmp ult i64 %134, %135
  br i1 %136, label %137, label %145

137:                                              ; preds = %133
  %138 = load ptr, ptr %6, align 8, !tbaa !9
  %139 = load i64, ptr %8, align 8, !tbaa !11
  %140 = getelementptr inbounds ptr, ptr %138, i64 %139
  %141 = load ptr, ptr %140, align 8, !tbaa !9
  call void @free_a_rule(ptr noundef %141, i1 noundef zeroext true)
  br label %142

142:                                              ; preds = %137
  %143 = load i64, ptr %8, align 8, !tbaa !11
  %144 = add i64 %143, 1
  store i64 %144, ptr %8, align 8, !tbaa !11
  br label %133, !llvm.loop !13

145:                                              ; preds = %133
  %146 = load ptr, ptr %6, align 8, !tbaa !9
  %147 = call i64 @mmt_mem_free(ptr noundef %146)
  %148 = load ptr, ptr %13, align 8, !tbaa !9
  %149 = call i64 @mmt_mem_free(ptr noundef %148)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %150

150:                                              ; preds = %145, %77, %64, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 10000, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 10000, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %151 = load i32, ptr %3, align 4
  ret i32 %151
}

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

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

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

declare void @mmt_sec_log(i32 noundef, ptr noundef, ...) #4

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #2

declare i64 @read_rules_from_file(ptr noundef, ptr noundef, ptr noundef) #4

declare i32 @generate_fsm(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #4

declare i32 @compile_gen_code(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind
declare i32 @remove(ptr noundef) #2

declare void @free_a_rule(ptr noundef, i1 noundef zeroext) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @mmt_mem_free(ptr noundef) #5

; 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 = { 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 = { 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 = { "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 = { inlinehint 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 #6 = { 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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [43 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [40 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca [10000 x i8], align 16
  %5 = alloca [10000 x i8], align 16
  %6 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %7 = add i32 %0, -5
  %or.cond = icmp ult i32 %7, -2
  br i1 %or.cond, label %8, label %26

8:                                                ; preds = %2
  %9 = load ptr, ptr @stderr, align 8, !tbaa !5
  %10 = load ptr, ptr %1, align 8, !tbaa !5
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str, ptr noundef %10) #7
  %12 = load ptr, ptr @stderr, align 8, !tbaa !5
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef nonnull @.str.1) #7
  %14 = load ptr, ptr @stderr, align 8, !tbaa !5
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.2) #7
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.3) #7
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.4) #7
  %20 = load ptr, ptr @stderr, align 8, !tbaa !5
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str.5) #7
  %22 = load ptr, ptr @stderr, align 8, !tbaa !5
  %23 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.6) #7
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.7) #7
  br label %80

26:                                               ; preds = %2
  %27 = getelementptr inbounds i8, ptr %1, i64 16
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %1, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = icmp eq i32 %0, 4
  br i1 %31, label %32, label %44

32:                                               ; preds = %26
  %33 = getelementptr inbounds i8, ptr %1, i64 24
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %34, ptr noundef nonnull dereferenceable(1) @.str.8) #8
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %44

37:                                               ; preds = %32
  %38 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %30) #8
  %39 = getelementptr inbounds i8, ptr %30, i64 %38
  %40 = getelementptr inbounds i8, ptr %39, i64 -2
  %41 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %40, ptr noundef nonnull dereferenceable(1) @.str.9) #8
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %51, label %43

43:                                               ; preds = %37
  tail call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 3, ptr noundef nonnull @.str.10) #6
  br label %80

44:                                               ; preds = %32, %26
  %45 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %30) #8
  %46 = getelementptr inbounds i8, ptr %30, i64 %45
  %47 = getelementptr inbounds i8, ptr %46, i64 -3
  %48 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %47, ptr noundef nonnull dereferenceable(1) @.str.12) #8
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %51, label %50

50:                                               ; preds = %44
  tail call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 3, ptr noundef nonnull @.str.13) #6
  br label %80

51:                                               ; preds = %44, %37
  %.str.14.sink = phi ptr [ @.str.11, %37 ], [ @.str.14, %44 ]
  %52 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %4, i64 noundef 10000, ptr noundef nonnull %.str.14.sink, ptr noundef %30) #6
  %53 = call i64 @read_rules_from_file(ptr noundef %28, ptr noundef nonnull %3, ptr noundef nonnull %6) #6
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = call i32 @generate_fsm(ptr noundef nonnull %4, ptr noundef %54, i64 noundef %53, ptr noundef %55) #6
  br i1 %31, label %57, label %65

57:                                               ; preds = %51
  %58 = getelementptr inbounds i8, ptr %1, i64 24
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  %60 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %59, ptr noundef nonnull dereferenceable(1) @.str.8) #8
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %57
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 0, ptr noundef nonnull @.str.15, i64 noundef %53, ptr noundef %28, ptr noundef nonnull %4) #6
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 0, ptr noundef nonnull @.str.16, ptr noundef nonnull %4) #6
  br label %71

63:                                               ; preds = %57
  %64 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %5, i64 noundef 10000, ptr noundef nonnull @.str.18, ptr noundef %59) #6
  br label %65

65:                                               ; preds = %51, %63
  %.sink = phi ptr [ %5, %63 ], [ @.str.17, %51 ]
  %66 = call i32 @compile_gen_code(ptr noundef %30, ptr noundef nonnull %4, ptr noundef nonnull %.sink) #6
  %67 = icmp eq i32 %66, 0
  br i1 %67, label %68, label %70

68:                                               ; preds = %65
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 0, ptr noundef nonnull @.str.15, i64 noundef %53, ptr noundef %28, ptr noundef %30) #6
  %69 = call i32 @remove(ptr noundef nonnull %4) #6
  br label %71

70:                                               ; preds = %65
  call void (i32, ptr, ...) @mmt_sec_log(i32 noundef 3, ptr noundef nonnull @.str.19, ptr noundef %28) #6
  br label %71

71:                                               ; preds = %68, %70, %62
  %.not = icmp eq i64 %53, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %71, %.lr.ph
  %.03435 = phi i64 [ %75, %.lr.ph ], [ 0, %71 ]
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds ptr, ptr %72, i64 %.03435
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  call void @free_a_rule(ptr noundef %74, i1 noundef zeroext true) #6
  %75 = add nuw i64 %.03435, 1
  %exitcond.not = icmp eq i64 %75, %53
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %71
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = call i64 @mmt_mem_free(ptr noundef %76)
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = call i64 @mmt_mem_free(ptr noundef %78)
  br label %80

80:                                               ; preds = %._crit_edge, %50, %43, %8
  %.033 = phi i32 [ 1, %8 ], [ 0, %._crit_edge ], [ 1, %43 ], [ 1, %50 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i32 %.033
}

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

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

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

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

declare void @mmt_sec_log(i32 noundef, ptr noundef, ...) local_unnamed_addr #4

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

declare i64 @read_rules_from_file(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @generate_fsm(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #4

declare i32 @compile_gen_code(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare void @free_a_rule(ptr noundef, i1 noundef zeroext) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @mmt_mem_free(ptr noundef) local_unnamed_addr #5

; 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 = { 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 = { "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 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { cold 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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