; LLVM IR from yinqiwen/ardb :: src/db (codec)

; 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.ardb::ZRangeSpec" = type { %"struct.ardb::Data", %"struct.ardb::Data", i8, i8, [6 x i8] }
%"struct.ardb::Data" = type <{ i64, i32, i8, [3 x i8] }>

; 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: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4ardb10ZRangeSpec5ParseERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_(ptr noundef nonnull align 8 dereferenceable(34) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) #1 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %12 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = getelementptr inbounds %"struct.ardb::ZRangeSpec", ptr %12, i32 0, i32 2
  %15 = call noundef i32 @_ZN4ardbL11parse_scoreERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERdRb(ptr noundef nonnull align 8 dereferenceable(32) %13, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 1 dereferenceable(1) %14)
  store i32 %15, ptr %10, align 4, !tbaa !9
  %16 = load i32, ptr %10, align 4, !tbaa !9
  %17 = icmp eq i32 0, %16
  br i1 %17, label %18, label %22

18:                                               ; preds = %3
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.ardb::ZRangeSpec", ptr %12, i32 0, i32 3
  %21 = call noundef i32 @_ZN4ardbL11parse_scoreERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERdRb(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 1 dereferenceable(1) %20)
  store i32 %21, ptr %10, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %18, %3
  %23 = load i32, ptr %10, align 4, !tbaa !9
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %30

25:                                               ; preds = %22
  %26 = load double, ptr %8, align 8, !tbaa !11
  %27 = load double, ptr %9, align 8, !tbaa !11
  %28 = fcmp ogt double %26, %27
  br i1 %28, label %29, label %30

29:                                               ; preds = %25
  store i1 false, ptr %4, align 1
  store i32 1, ptr %11, align 4
  br label %37

30:                                               ; preds = %25, %22
  %31 = getelementptr inbounds %"struct.ardb::ZRangeSpec", ptr %12, i32 0, i32 0
  %32 = load double, ptr %8, align 8, !tbaa !11
  call void @_ZN4ardb4Data10SetFloat64Ed(ptr noundef nonnull align 8 dereferenceable(13) %31, double noundef %32)
  %33 = getelementptr inbounds %"struct.ardb::ZRangeSpec", ptr %12, i32 0, i32 1
  %34 = load double, ptr %9, align 8, !tbaa !11
  call void @_ZN4ardb4Data10SetFloat64Ed(ptr noundef nonnull align 8 dereferenceable(13) %33, double noundef %34)
  %35 = load i32, ptr %10, align 4, !tbaa !9
  %36 = icmp eq i32 %35, 0
  store i1 %36, ptr %4, align 1
  store i32 1, ptr %11, align 4
  br label %37

37:                                               ; preds = %30, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %38 = load i1, ptr %4, align 1
  ret i1 %38
}

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN4ardbL11parse_scoreERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERdRb(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) #1

declare void @_ZN4ardb4Data10SetFloat64Ed(ptr noundef nonnull align 8 dereferenceable(13), double noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 #2 = { "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 }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !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 uwtable
define dso_local noundef zeroext i1 @_ZN4ardb10ZRangeSpec5ParseERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_(ptr noundef nonnull align 8 dereferenceable(34) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) local_unnamed_addr #1 align 2 {
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = call noundef i32 @_ZN4ardbL11parse_scoreERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERdRb(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 1 dereferenceable(1) %6)
  %8 = icmp eq i32 %7, 0
  br i1 %8, label %9, label %..thread_crit_edge

..thread_crit_edge:                               ; preds = %3
  %.pre = load double, ptr %4, align 8, !tbaa !5
  br label %.thread

9:                                                ; preds = %3
  %10 = getelementptr inbounds i8, ptr %0, i64 33
  %11 = call noundef i32 @_ZN4ardbL11parse_scoreERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERdRb(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 1 dereferenceable(1) %10)
  %12 = icmp eq i32 %11, 0
  %.pre10 = load double, ptr %4, align 8, !tbaa !5
  br i1 %12, label %13, label %.thread

13:                                               ; preds = %9
  %14 = load double, ptr %5, align 8, !tbaa !5
  %15 = fcmp ogt double %.pre10, %14
  br i1 %15, label %19, label %.thread

.thread:                                          ; preds = %..thread_crit_edge, %13, %9
  %16 = phi double [ %.pre10, %13 ], [ %.pre10, %9 ], [ %.pre, %..thread_crit_edge ]
  %.09 = phi i1 [ true, %13 ], [ false, %9 ], [ false, %..thread_crit_edge ]
  call void @_ZN4ardb4Data10SetFloat64Ed(ptr noundef nonnull align 8 dereferenceable(13) %0, double noundef %16)
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  %18 = load double, ptr %5, align 8, !tbaa !5
  call void @_ZN4ardb4Data10SetFloat64Ed(ptr noundef nonnull align 8 dereferenceable(13) %17, double noundef %18)
  br label %19

19:                                               ; preds = %13, %.thread
  %.06 = phi i1 [ %.09, %.thread ], [ false, %13 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret i1 %.06
}

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN4ardbL11parse_scoreERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERdRb(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1

declare void @_ZN4ardb4Data10SetFloat64Ed(ptr noundef nonnull align 8 dereferenceable(13), double noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 #2 = { "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 }

!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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass