; LLVM IR from li-xilin/axe :: src/core (one)

; 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.ax_location = type { ptr, ptr, i32 }

@constinit = external hidden constant [1 x %struct.ax_location], align 8
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@constinit.5 = external hidden constant [1 x %struct.ax_location], align 8
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @ax_one_is(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [1 x %struct.ax_location], align 8
  %7 = alloca [1 x %struct.ax_location], align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = icmp ne ptr %12, null
  br i1 %13, label %14, label %15

14:                                               ; preds = %2
  br label %18

15:                                               ; preds = %2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 @constinit, i64 24, i1 false), !tbaa.struct !9
  %16 = getelementptr inbounds [1 x %struct.ax_location], ptr %6, i64 0, i64 0
  %17 = call i32 (ptr, ptr, ptr, ...) @__ax_debug_assert_fail(ptr noundef %16, ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef @.str.4)
  br label %18

18:                                               ; preds = %15, %14
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %18
  br label %25

22:                                               ; preds = %18
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 @constinit.5, i64 24, i1 false), !tbaa.struct !9
  %23 = getelementptr inbounds [1 x %struct.ax_location], ptr %7, i64 0, i64 0
  %24 = call i32 (ptr, ptr, ptr, ...) @__ax_debug_assert_fail(ptr noundef %23, ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef @.str.6)
  br label %25

25:                                               ; preds = %22, %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = call ptr @ax_one_name(ptr noundef %26)
  store ptr %27, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %28, ptr %9, align 8, !tbaa !5
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %29, ptr %10, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %52, %25
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = load i8, ptr %31, align 1, !tbaa !10
  %33 = sext i8 %32 to i32
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %40

35:                                               ; preds = %30
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = load i8, ptr %36, align 1, !tbaa !10
  %38 = sext i8 %37 to i32
  %39 = icmp ne i32 %38, 0
  br label %40

40:                                               ; preds = %35, %30
  %41 = phi i1 [ false, %30 ], [ %39, %35 ]
  br i1 %41, label %42, label %57

42:                                               ; preds = %40
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = load i8, ptr %43, align 1, !tbaa !10
  %45 = sext i8 %44 to i32
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = load i8, ptr %46, align 1, !tbaa !10
  %48 = sext i8 %47 to i32
  %49 = icmp ne i32 %45, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %42
  store i1 false, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %76

51:                                               ; preds = %42
  br label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i32 1
  store ptr %54, ptr %9, align 8, !tbaa !5
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i32 1
  store ptr %56, ptr %10, align 8, !tbaa !5
  br label %30, !llvm.loop !11

57:                                               ; preds = %40
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = load i8, ptr %58, align 1, !tbaa !10
  %60 = sext i8 %59 to i32
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %74

62:                                               ; preds = %57
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = load i8, ptr %63, align 1, !tbaa !10
  %65 = sext i8 %64 to i32
  %66 = icmp eq i32 %65, 46
  br i1 %66, label %72, label %67

67:                                               ; preds = %62
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = load i8, ptr %68, align 1, !tbaa !10
  %70 = sext i8 %69 to i32
  %71 = icmp eq i32 %70, 0
  br label %72

72:                                               ; preds = %67, %62
  %73 = phi i1 [ true, %62 ], [ %71, %67 ]
  br label %74

74:                                               ; preds = %72, %57
  %75 = phi i1 [ false, %57 ], [ %73, %72 ]
  store i1 %75, ptr %3, align 1
  store i32 1, ptr %11, align 4
  br label %76

76:                                               ; preds = %74, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %77 = load i1, ptr %3, align 1
  ret i1 %77
}

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

; 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) #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ax_one_name(ptr noundef) #4

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

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 nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = !{i64 0, i64 24, !10}
!10 = !{!7, !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"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"

%struct.ax_location = type { ptr, ptr, i32 }

@constinit = external hidden local_unnamed_addr constant [1 x %struct.ax_location], align 8
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@constinit.5 = external hidden local_unnamed_addr constant [1 x %struct.ax_location], align 8
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @ax_one_is(ptr noundef %0, ptr noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca [1 x %struct.ax_location], align 8
  %4 = alloca [1 x %struct.ax_location], align 8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %5, label %7

5:                                                ; preds = %2
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) @constinit, i64 24, i1 false), !tbaa.struct !5
  %6 = call i32 (ptr, ptr, ptr, ...) @__ax_debug_assert_fail(ptr noundef nonnull %3, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4) #4
  br label %7

7:                                                ; preds = %2, %5
  %.not20 = icmp eq ptr %1, null
  br i1 %.not20, label %8, label %10

8:                                                ; preds = %7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) @constinit.5, i64 24, i1 false), !tbaa.struct !5
  %9 = call i32 (ptr, ptr, ptr, ...) @__ax_debug_assert_fail(ptr noundef nonnull %4, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.6) #4
  br label %10

10:                                               ; preds = %7, %8
  %11 = call ptr @ax_one_name(ptr noundef %0)
  %12 = load i8, ptr %1, align 1, !tbaa !6
  %.not2125 = icmp eq i8 %12, 0
  br i1 %.not2125, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %10, %15
  %13 = phi i8 [ %18, %15 ], [ %12, %10 ]
  %.027 = phi ptr [ %17, %15 ], [ %11, %10 ]
  %.01526 = phi ptr [ %16, %15 ], [ %1, %10 ]
  %14 = load i8, ptr %.027, align 1, !tbaa !6
  %.not23 = icmp eq i8 %13, %14
  br i1 %.not23, label %15, label %.critedge

15:                                               ; preds = %.lr.ph
  %16 = getelementptr inbounds i8, ptr %.01526, i64 1
  %17 = getelementptr inbounds i8, ptr %.027, i64 1
  %18 = load i8, ptr %16, align 1, !tbaa !6
  %.not21 = icmp eq i8 %18, 0
  br i1 %.not21, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %15, %10
  %.0.lcssa = phi ptr [ %11, %10 ], [ %17, %15 ]
  %19 = load i8, ptr %.0.lcssa, align 1, !tbaa !6
  %20 = icmp eq i8 %19, 46
  %21 = icmp eq i8 %19, 0
  %spec.select = or i1 %20, %21
  br label %.critedge

.critedge:                                        ; preds = %.lr.ph, %._crit_edge
  %.016 = phi i1 [ %spec.select, %._crit_edge ], [ false, %.lr.ph ]
  ret i1 %.016
}

declare i32 @__ax_debug_assert_fail(ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #1

; 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) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ax_one_name(ptr noundef) local_unnamed_addr #3

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 nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 = !{i64 0, i64 24, !6}
!6 = !{!7, !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: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass