; LLVM IR from mwarning/KadNode :: src (utils)

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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @addr_parse(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #3 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca [256 x i8], align 16
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 256, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = call i64 @strlen(ptr noundef %18) #6
  store i64 %19, ptr %16, align 8, !tbaa !11
  %20 = load i64, ptr %16, align 8, !tbaa !11
  %21 = icmp uge i64 %20, 255
  br i1 %21, label %22, label %23

22:                                               ; preds = %4
  store i1 false, ptr %5, align 1
  store i32 1, ptr %17, align 4
  br label %90

23:                                               ; preds = %4
  %24 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 0
  store ptr %24, ptr %11, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %23
  %26 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %26, i8 0, i64 256, i1 false)
  %27 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 0
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = load i64, ptr %16, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %27, ptr align 1 %28, i64 %29, i1 false)
  %30 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 0
  %31 = call ptr @strrchr(ptr noundef %30, i32 noundef 58) #6
  store ptr %31, ptr %13, align 8, !tbaa !5
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 0
  %34 = load i8, ptr %33, align 1, !tbaa !13
  %35 = sext i8 %34 to i32
  %36 = icmp eq i32 %35, 91
  br i1 %36, label %37, label %66

37:                                               ; preds = %25
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = call ptr @strrchr(ptr noundef %38, i32 noundef 93) #6
  store ptr %39, ptr %12, align 8, !tbaa !5
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %43

42:                                               ; preds = %37
  store i1 false, ptr %5, align 1
  store i32 1, ptr %17, align 4
  br label %90

43:                                               ; preds = %37
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  store i8 0, ptr %44, align 1, !tbaa !13
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 1
  store ptr %46, ptr %14, align 8, !tbaa !5
  %47 = load ptr, ptr %12, align 8, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %47, i64 1
  %49 = load i8, ptr %48, align 1, !tbaa !13
  %50 = sext i8 %49 to i32
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %52, label %54

52:                                               ; preds = %43
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %53, ptr %15, align 8, !tbaa !5
  br label %65

54:                                               ; preds = %43
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i64 1
  %57 = load i8, ptr %56, align 1, !tbaa !13
  %58 = sext i8 %57 to i32
  %59 = icmp eq i32 %58, 58
  br i1 %59, label %60, label %63

60:                                               ; preds = %54
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 2
  store ptr %62, ptr %15, align 8, !tbaa !5
  br label %64

63:                                               ; preds = %54
  store i1 false, ptr %5, align 1
  store i32 1, ptr %17, align 4
  br label %90

64:                                               ; preds = %60
  br label %65

65:                                               ; preds = %64, %52
  br label %84

66:                                               ; preds = %25
  %67 = load ptr, ptr %13, align 8, !tbaa !5
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %80

69:                                               ; preds = %66
  %70 = load ptr, ptr %13, align 8, !tbaa !5
  %71 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 0
  %72 = call ptr @strchr(ptr noundef %71, i32 noundef 58) #6
  %73 = icmp eq ptr %70, %72
  br i1 %73, label %74, label %80

74:                                               ; preds = %69
  %75 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %75, ptr %12, align 8, !tbaa !5
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  store i8 0, ptr %76, align 1, !tbaa !13
  %77 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 0
  store ptr %77, ptr %14, align 8, !tbaa !5
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = getelementptr inbounds i8, ptr %78, i64 1
  store ptr %79, ptr %15, align 8, !tbaa !5
  br label %83

80:                                               ; preds = %69, %66
  %81 = getelementptr inbounds [256 x i8], ptr %10, i64 0, i64 0
  store ptr %81, ptr %14, align 8, !tbaa !5
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %82, ptr %15, align 8, !tbaa !5
  br label %83

83:                                               ; preds = %80, %74
  br label %84

84:                                               ; preds = %83, %65
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  %88 = load i32, ptr %9, align 4, !tbaa !9
  %89 = call zeroext i1 @addr_parse_internal(ptr noundef %85, ptr noundef %86, ptr noundef %87, i32 noundef %88)
  store i1 %89, ptr %5, align 1
  store i32 1, ptr %17, align 4
  br label %90

90:                                               ; preds = %84, %63, %42, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %10) #5
  %91 = load i1, ptr %5, align 1
  ret i1 %91
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @addr_parse_internal(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!7, !7, i64 0}


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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @addr_parse(ptr noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #3 {
  %5 = alloca [256 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %5) #5
  %6 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #6
  %7 = icmp ugt i64 %6, 254
  br i1 %7, label %29, label %8

8:                                                ; preds = %4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %5, i8 0, i64 256, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %5, ptr align 1 %1, i64 %6, i1 false)
  %9 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %5, i32 noundef 58) #6
  %10 = load i8, ptr %5, align 16, !tbaa !5
  %11 = icmp eq i8 %10, 91
  br i1 %11, label %12, label %21

12:                                               ; preds = %8
  %13 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %5, i32 noundef 93) #6
  %14 = icmp eq ptr %13, null
  br i1 %14, label %29, label %15

15:                                               ; preds = %12
  store i8 0, ptr %13, align 1, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %5, i64 1
  %17 = getelementptr inbounds i8, ptr %13, i64 1
  %18 = load i8, ptr %17, align 1, !tbaa !5
  switch i8 %18, label %29 [
    i8 0, label %27
    i8 58, label %19
  ]

19:                                               ; preds = %15
  %20 = getelementptr inbounds i8, ptr %13, i64 2
  br label %27

21:                                               ; preds = %8
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %27, label %22

22:                                               ; preds = %21
  %23 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %5, i32 noundef 58) #6
  %24 = icmp eq ptr %9, %23
  br i1 %24, label %25, label %27

25:                                               ; preds = %22
  store i8 0, ptr %9, align 1, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %9, i64 1
  br label %27

27:                                               ; preds = %21, %22, %15, %25, %19
  %.024 = phi ptr [ %16, %19 ], [ %5, %25 ], [ %16, %15 ], [ %5, %22 ], [ %5, %21 ]
  %.023 = phi ptr [ %20, %19 ], [ %26, %25 ], [ %2, %15 ], [ %2, %22 ], [ %2, %21 ]
  %28 = call zeroext i1 @addr_parse_internal(ptr noundef %0, ptr noundef nonnull %.024, ptr noundef %.023, i32 noundef %3)
  br label %29

29:                                               ; preds = %15, %12, %4, %27
  %.0 = phi i1 [ %28, %27 ], [ false, %4 ], [ false, %12 ], [ false, %15 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #5
  ret i1 %.0
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @addr_parse_internal(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass