; LLVM IR from ponylang/ponyc :: src/ponyc (main)

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

%struct.pass_opt_t = type { i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i64, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.typecheck_t, ptr, ptr }
%struct.typecheck_t = type { ptr, %struct.typecheck_stats_t, ptr }
%struct.typecheck_stats_t = type { i64, i64, i64, i64 }
%struct.opt_state_t = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [38 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 %struct.pass_opt_t, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca i8, align 1
  %14 = alloca %struct.opt_state_t, align 8
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = 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 (...) @stringtab_init()
  call void @llvm.lifetime.start.p0(i64 240, ptr %6) #6
  call void @pass_opt_init(ptr noundef %6)
  %18 = getelementptr inbounds %struct.pass_opt_t, ptr %6, i32 0, i32 2
  store i8 1, ptr %18, align 8, !tbaa !11
  %19 = getelementptr inbounds %struct.pass_opt_t, ptr %6, i32 0, i32 25
  store ptr @.str, ptr %19, align 8, !tbaa !17
  %20 = call i64 @get_width()
  %21 = getelementptr inbounds %struct.pass_opt_t, ptr %6, i32 0, i32 17
  store i64 %20, ptr %21, align 8, !tbaa !18
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 0
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct.pass_opt_t, ptr %6, i32 0, i32 23
  store ptr %24, ptr %25, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 1, ptr %7, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %41, %2
  %27 = load i32, ptr %8, align 4, !tbaa !5
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %44

31:                                               ; preds = %26
  %32 = load ptr, ptr %5, align 8, !tbaa !9
  %33 = load i32, ptr %8, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds ptr, ptr %32, i64 %34
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = call i64 @strlen(ptr noundef %36) #7
  %38 = add i64 %37, 1
  %39 = load i64, ptr %7, align 8, !tbaa !20
  %40 = add i64 %39, %38
  store i64 %40, ptr %7, align 8, !tbaa !20
  br label %41

41:                                               ; preds = %31
  %42 = load i32, ptr %8, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %8, align 4, !tbaa !5
  br label %26, !llvm.loop !21

44:                                               ; preds = %30
  %45 = load i64, ptr %7, align 8, !tbaa !20
  %46 = call noalias ptr @calloc(i64 noundef %45, i64 noundef 1) #8
  %47 = getelementptr inbounds %struct.pass_opt_t, ptr %6, i32 0, i32 24
  store ptr %46, ptr %47, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %48 = load i64, ptr %7, align 8, !tbaa !20
  store i64 %48, ptr %9, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %76, %44
  %50 = load i32, ptr %10, align 4, !tbaa !5
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %79

54:                                               ; preds = %49
  %55 = getelementptr inbounds %struct.pass_opt_t, ptr %6, i32 0, i32 24
  %56 = load ptr, ptr %55, align 8, !tbaa !23
  %57 = load ptr, ptr %5, align 8, !tbaa !9
  %58 = load i32, ptr %10, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds ptr, ptr %57, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  %62 = load i64, ptr %9, align 8, !tbaa !20
  %63 = call ptr @strncat(ptr noundef %56, ptr noundef %61, i64 noundef %62) #6
  %64 = getelementptr inbounds %struct.pass_opt_t, ptr %6, i32 0, i32 24
  %65 = load ptr, ptr %64, align 8, !tbaa !23
  %66 = call ptr @strncat(ptr noundef %65, ptr noundef @.str.1, i64 noundef 1) #6
  %67 = load ptr, ptr %5, align 8, !tbaa !9
  %68 = load i32, ptr %10, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds ptr, ptr %67, i64 %69
  %71 = load ptr, ptr %70, align 8, !tbaa !9
  %72 = call i64 @strlen(ptr noundef %71) #7
  %73 = add i64 %72, 1
  %74 = load i64, ptr %9, align 8, !tbaa !20
  %75 = sub i64 %74, %73
  store i64 %75, ptr %9, align 8, !tbaa !20
  br label %76

76:                                               ; preds = %54
  %77 = load i32, ptr %10, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %10, align 4, !tbaa !5
  br label %49, !llvm.loop !24

79:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %14) #6
  %80 = call ptr @ponyc_opt_std_args()
  %81 = load ptr, ptr %5, align 8, !tbaa !9
  call void @ponyint_opt_init(ptr noundef %80, ptr noundef %14, ptr noundef %4, ptr noundef %81)
  %82 = call i32 @ponyc_opt_process(ptr noundef %14, ptr noundef %6, ptr noundef %12, ptr noundef %13)
  store i32 %82, ptr %11, align 4, !tbaa !5
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = icmp eq i32 %83, 1
  br i1 %84, label %85, label %89

85:                                               ; preds = %79
  %86 = getelementptr inbounds %struct.pass_opt_t, ptr %6, i32 0, i32 36
  %87 = getelementptr inbounds %struct.typecheck_t, ptr %86, i32 0, i32 2
  %88 = load ptr, ptr %87, align 8, !tbaa !25
  call void @errors_print(ptr noundef %88)
  call void @pass_opt_done(ptr noundef %6)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %159

89:                                               ; preds = %79
  %90 = load i32, ptr %11, align 4, !tbaa !5
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %92, label %93

92:                                               ; preds = %89
  call void @pass_opt_done(ptr noundef %6)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %159

93:                                               ; preds = %89
  br label %94

94:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #6
  store i8 1, ptr %16, align 1, !tbaa !26
  %95 = call zeroext i1 @ponyc_init(ptr noundef %6)
  br i1 %95, label %96, label %141

96:                                               ; preds = %94
  %97 = load i32, ptr %4, align 4, !tbaa !5
  %98 = icmp eq i32 %97, 1
  br i1 %98, label %99, label %112

99:                                               ; preds = %96
  %100 = load i8, ptr %12, align 1, !tbaa !26, !range !27, !noundef !28
  %101 = trunc i8 %100 to i1
  %102 = load i8, ptr %13, align 1, !tbaa !26, !range !27, !noundef !28
  %103 = trunc i8 %102 to i1
  %104 = call zeroext i1 @compile_package(ptr noundef @.str, ptr noundef %6, i1 noundef zeroext %101, i1 noundef zeroext %103)
  %105 = zext i1 %104 to i32
  %106 = load i8, ptr %16, align 1, !tbaa !26, !range !27, !noundef !28
  %107 = trunc i8 %106 to i1
  %108 = zext i1 %107 to i32
  %109 = and i32 %108, %105
  %110 = icmp ne i32 %109, 0
  %111 = zext i1 %110 to i8
  store i8 %111, ptr %16, align 1, !tbaa !26
  br label %140

112:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %136, %112
  %114 = load i32, ptr %17, align 4, !tbaa !5
  %115 = load i32, ptr %4, align 4, !tbaa !5
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %139

118:                                              ; preds = %113
  %119 = load ptr, ptr %5, align 8, !tbaa !9
  %120 = load i32, ptr %17, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds ptr, ptr %119, i64 %121
  %123 = load ptr, ptr %122, align 8, !tbaa !9
  %124 = load i8, ptr %12, align 1, !tbaa !26, !range !27, !noundef !28
  %125 = trunc i8 %124 to i1
  %126 = load i8, ptr %13, align 1, !tbaa !26, !range !27, !noundef !28
  %127 = trunc i8 %126 to i1
  %128 = call zeroext i1 @compile_package(ptr noundef %123, ptr noundef %6, i1 noundef zeroext %125, i1 noundef zeroext %127)
  %129 = zext i1 %128 to i32
  %130 = load i8, ptr %16, align 1, !tbaa !26, !range !27, !noundef !28
  %131 = trunc i8 %130 to i1
  %132 = zext i1 %131 to i32
  %133 = and i32 %132, %129
  %134 = icmp ne i32 %133, 0
  %135 = zext i1 %134 to i8
  store i8 %135, ptr %16, align 1, !tbaa !26
  br label %136

136:                                              ; preds = %118
  %137 = load i32, ptr %17, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %17, align 4, !tbaa !5
  br label %113, !llvm.loop !29

139:                                              ; preds = %117
  br label %140

140:                                              ; preds = %139, %99
  br label %141

141:                                              ; preds = %140, %94
  %142 = load i8, ptr %16, align 1, !tbaa !26, !range !27, !noundef !28
  %143 = trunc i8 %142 to i1
  br i1 %143, label %152, label %144

144:                                              ; preds = %141
  %145 = getelementptr inbounds %struct.pass_opt_t, ptr %6, i32 0, i32 36
  %146 = getelementptr inbounds %struct.typecheck_t, ptr %145, i32 0, i32 2
  %147 = load ptr, ptr %146, align 8, !tbaa !25
  %148 = call i64 @errors_get_count(ptr noundef %147)
  %149 = icmp eq i64 %148, 0
  br i1 %149, label %150, label %152

150:                                              ; preds = %144
  %151 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %152

152:                                              ; preds = %150, %144, %141
  call void @ponyc_shutdown(ptr noundef %6)
  call void @pass_opt_done(ptr noundef %6)
  %153 = getelementptr inbounds %struct.pass_opt_t, ptr %6, i32 0, i32 24
  %154 = load ptr, ptr %153, align 8, !tbaa !23
  call void @free(ptr noundef %154) #6
  %155 = load i8, ptr %16, align 1, !tbaa !26, !range !27, !noundef !28
  %156 = trunc i8 %155 to i1
  %157 = zext i1 %156 to i64
  %158 = select i1 %156, i32 0, i32 -1
  store i32 %158, ptr %3, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  br label %159

159:                                              ; preds = %152, %92, %85
  call void @llvm.lifetime.end.p0(i64 64, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 240, ptr %6) #6
  %160 = load i32, ptr %3, align 4
  ret i32 %160
}

declare void @stringtab_init(...) #1

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

declare void @pass_opt_init(ptr noundef) #1

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

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #4

; Function Attrs: nounwind
declare ptr @strncat(ptr noundef, ptr noundef, i64 noundef) #5

declare void @ponyint_opt_init(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare ptr @ponyc_opt_std_args() #1

declare i32 @ponyc_opt_process(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare void @errors_print(ptr noundef) #1

declare void @pass_opt_done(ptr noundef) #1

declare zeroext i1 @ponyc_init(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @compile_package(ptr noundef, ptr noundef, i1 noundef zeroext, i1 noundef zeroext) #0

declare i64 @errors_get_count(ptr noundef) #1

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

declare void @ponyc_shutdown(ptr noundef) #1

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare hidden i64 @get_width() #0

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

!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, !13, i64 8}
!12 = !{!"pass_opt_t", !6, i64 0, !6, i64 4, !13, i64 8, !13, i64 9, !13, i64 10, !13, i64 11, !13, i64 12, !13, i64 13, !13, i64 14, !13, i64 15, !13, i64 16, !13, i64 17, !13, i64 18, !13, i64 19, !13, i64 20, !13, i64 21, !6, i64 24, !14, i64 32, !13, i64 40, !13, i64 41, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !15, i64 176, !10, i64 224, !10, i64 232}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"typecheck_t", !10, i64 0, !16, i64 8, !10, i64 40}
!16 = !{!"typecheck_stats_t", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!17 = !{!12, !10, i64 88}
!18 = !{!12, !14, i64 32}
!19 = !{!12, !10, i64 72}
!20 = !{!14, !14, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!12, !10, i64 80}
!24 = distinct !{!24, !22}
!25 = !{!12, !10, i64 216}
!26 = !{!13, !13, i64 0}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = distinct !{!29, !22}


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

%struct.pass_opt_t = type { i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i64, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.typecheck_t, ptr, ptr }
%struct.typecheck_t = type { ptr, %struct.typecheck_stats_t, ptr }
%struct.typecheck_stats_t = type { i64, i64, i64, i64 }
%struct.opt_state_t = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = alloca %struct.pass_opt_t, align 8
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  %7 = alloca %struct.opt_state_t, align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  tail call void (...) @stringtab_init() #8
  call void @llvm.lifetime.start.p0(i64 240, ptr nonnull %4) #8
  call void @pass_opt_init(ptr noundef nonnull %4) #8
  %8 = getelementptr inbounds i8, ptr %4, i64 8
  store i8 1, ptr %8, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %4, i64 88
  store ptr @.str, ptr %9, align 8, !tbaa !16
  %10 = call i64 @get_width()
  %11 = getelementptr inbounds i8, ptr %4, i64 32
  store i64 %10, ptr %11, align 8, !tbaa !17
  %12 = load ptr, ptr %1, align 8, !tbaa !18
  %13 = getelementptr inbounds i8, ptr %4, i64 72
  store ptr %12, ptr %13, align 8, !tbaa !19
  %14 = icmp sgt i32 %0, 1
  br i1 %14, label %.lr.ph.preheader, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %2
  %15 = call noalias dereferenceable_or_null(1) ptr @calloc(i64 noundef 1, i64 noundef 1) #9
  %16 = getelementptr inbounds i8, ptr %4, i64 80
  store ptr %15, ptr %16, align 8, !tbaa !20
  br label %._crit_edge43

.lr.ph.preheader:                                 ; preds = %2
  %wide.trip.count = zext nneg i32 %0 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  %17 = call noalias ptr @calloc(i64 noundef %24, i64 noundef 1) #9
  %18 = getelementptr inbounds i8, ptr %4, i64 80
  store ptr %17, ptr %18, align 8, !tbaa !20
  br i1 %14, label %.lr.ph42.preheader, label %._crit_edge43

.lr.ph42.preheader:                               ; preds = %._crit_edge
  %19 = zext nneg i32 %0 to i64
  br label %.lr.ph42

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %.03237 = phi i64 [ 1, %.lr.ph.preheader ], [ %24, %.lr.ph ]
  %20 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv
  %21 = load ptr, ptr %20, align 8, !tbaa !18
  %22 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %21) #10
  %23 = add i64 %.03237, 1
  %24 = add i64 %23, %22
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !21

._crit_edge43:                                    ; preds = %.lr.ph42, %._crit_edge.thread, %._crit_edge
  %25 = phi ptr [ %16, %._crit_edge.thread ], [ %18, %._crit_edge ], [ %18, %.lr.ph42 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #8
  %26 = call ptr @ponyc_opt_std_args() #8
  call void @ponyint_opt_init(ptr noundef %26, ptr noundef nonnull %7, ptr noundef nonnull %3, ptr noundef nonnull %1) #8
  %27 = call i32 @ponyc_opt_process(ptr noundef nonnull %7, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6) #8
  switch i32 %27, label %42 [
    i32 1, label %38
    i32 0, label %41
  ]

.lr.ph42:                                         ; preds = %.lr.ph42.preheader, %.lr.ph42
  %indvars.iv51 = phi i64 [ 1, %.lr.ph42.preheader ], [ %indvars.iv.next52, %.lr.ph42 ]
  %.03039 = phi i64 [ %24, %.lr.ph42.preheader ], [ %36, %.lr.ph42 ]
  %28 = load ptr, ptr %18, align 8, !tbaa !20
  %29 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv51
  %30 = load ptr, ptr %29, align 8, !tbaa !18
  %31 = call ptr @strncat(ptr noundef nonnull dereferenceable(1) %28, ptr noundef %30, i64 noundef %.03039) #8
  %32 = load ptr, ptr %18, align 8, !tbaa !20
  %33 = call ptr @strncat(ptr noundef nonnull dereferenceable(1) %32, ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef 1) #8
  %34 = load ptr, ptr %29, align 8, !tbaa !18
  %35 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %34) #10
  %.neg = xor i64 %35, -1
  %36 = add i64 %.03039, %.neg
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %37 = icmp ult i64 %indvars.iv.next52, %19
  br i1 %37, label %.lr.ph42, label %._crit_edge43, !llvm.loop !23

38:                                               ; preds = %._crit_edge43
  %39 = getelementptr inbounds i8, ptr %4, i64 216
  %40 = load ptr, ptr %39, align 8, !tbaa !24
  call void @errors_print(ptr noundef %40) #8
  call void @pass_opt_done(ptr noundef nonnull %4) #8
  br label %73

41:                                               ; preds = %._crit_edge43
  call void @pass_opt_done(ptr noundef nonnull %4) #8
  br label %73

42:                                               ; preds = %._crit_edge43
  %43 = call zeroext i1 @ponyc_init(ptr noundef nonnull %4) #8
  br i1 %43, label %44, label %.thread

44:                                               ; preds = %42
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = icmp eq i32 %45, 1
  br i1 %46, label %48, label %.preheader

.preheader:                                       ; preds = %44
  %47 = icmp sgt i32 %45, 1
  br i1 %47, label %.lr.ph46, label %.thread

48:                                               ; preds = %44
  %49 = load i8, ptr %5, align 1, !tbaa !25, !range !26, !noundef !27
  %50 = trunc nuw i8 %49 to i1
  %51 = load i8, ptr %6, align 1, !tbaa !25, !range !26, !noundef !27
  %52 = trunc nuw i8 %51 to i1
  %53 = call zeroext i1 @compile_package(ptr noundef nonnull @.str, ptr noundef nonnull %4, i1 noundef zeroext %50, i1 noundef zeroext %52)
  br i1 %53, label %.thread, label %65

.lr.ph46:                                         ; preds = %.preheader, %.lr.ph46
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %.lr.ph46 ], [ 1, %.preheader ]
  %.02744 = phi i1 [ %61, %.lr.ph46 ], [ true, %.preheader ]
  %54 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv54
  %55 = load ptr, ptr %54, align 8, !tbaa !18
  %56 = load i8, ptr %5, align 1, !tbaa !25, !range !26, !noundef !27
  %57 = trunc nuw i8 %56 to i1
  %58 = load i8, ptr %6, align 1, !tbaa !25, !range !26, !noundef !27
  %59 = trunc nuw i8 %58 to i1
  %60 = call zeroext i1 @compile_package(ptr noundef %55, ptr noundef nonnull %4, i1 noundef zeroext %57, i1 noundef zeroext %59)
  %61 = select i1 %60, i1 %.02744, i1 false
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %indvars.iv.next55, %63
  br i1 %64, label %.lr.ph46, label %._crit_edge47, !llvm.loop !28

._crit_edge47:                                    ; preds = %.lr.ph46
  br i1 %61, label %.thread, label %65

65:                                               ; preds = %48, %._crit_edge47
  %66 = getelementptr inbounds i8, ptr %4, i64 216
  %67 = load ptr, ptr %66, align 8, !tbaa !24
  %68 = call i64 @errors_get_count(ptr noundef %67) #8
  %69 = icmp eq i64 %68, 0
  br i1 %69, label %70, label %.thread

70:                                               ; preds = %65
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %.thread

.thread:                                          ; preds = %.preheader, %42, %48, %70, %65, %._crit_edge47
  %not..1 = phi i32 [ -1, %70 ], [ -1, %65 ], [ 0, %._crit_edge47 ], [ 0, %48 ], [ 0, %42 ], [ 0, %.preheader ]
  call void @ponyc_shutdown(ptr noundef nonnull %4) #8
  call void @pass_opt_done(ptr noundef nonnull %4) #8
  %72 = load ptr, ptr %25, align 8, !tbaa !20
  call void @free(ptr noundef %72) #8
  br label %73

73:                                               ; preds = %.thread, %41, %38
  %.028 = phi i32 [ -1, %38 ], [ 0, %41 ], [ %not..1, %.thread ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 240, ptr nonnull %4) #8
  ret i32 %.028
}

declare void @stringtab_init(...) local_unnamed_addr #1

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

declare void @pass_opt_init(ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #4

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

declare void @ponyint_opt_init(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @ponyc_opt_std_args() local_unnamed_addr #1

declare i32 @ponyc_opt_process(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @errors_print(ptr noundef) local_unnamed_addr #1

declare void @pass_opt_done(ptr noundef) local_unnamed_addr #1

declare zeroext i1 @ponyc_init(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @compile_package(ptr noundef, ptr noundef, i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #0

declare i64 @errors_get_count(ptr noundef) local_unnamed_addr #1

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

declare void @ponyc_shutdown(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #7

; Function Attrs: nounwind uwtable
declare hidden i64 @get_width() local_unnamed_addr #0

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #6 = { 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 #7 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #8 = { nounwind }
attributes #9 = { nounwind allocsize(0,1) }
attributes #10 = { 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, !11, i64 8}
!10 = !{!"pass_opt_t", !6, i64 0, !6, i64 4, !11, i64 8, !11, i64 9, !11, i64 10, !11, i64 11, !11, i64 12, !11, i64 13, !11, i64 14, !11, i64 15, !11, i64 16, !11, i64 17, !11, i64 18, !11, i64 19, !11, i64 20, !11, i64 21, !6, i64 24, !12, i64 32, !11, i64 40, !11, i64 41, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !13, i64 136, !13, i64 144, !13, i64 152, !13, i64 160, !13, i64 168, !14, i64 176, !13, i64 224, !13, i64 232}
!11 = !{!"_Bool", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"typecheck_t", !13, i64 0, !15, i64 8, !13, i64 40}
!15 = !{!"typecheck_stats_t", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!16 = !{!10, !13, i64 88}
!17 = !{!10, !12, i64 32}
!18 = !{!13, !13, i64 0}
!19 = !{!10, !13, i64 72}
!20 = !{!10, !13, i64 80}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = !{!10, !13, i64 216}
!25 = !{!11, !11, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = distinct !{!28, !22}


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