; LLVM IR from NCAR/FastEddy-model :: SRC/PARAMETERS (hashTable)

; 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 uwtable
define dso_local ptr @str_trim(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %5, ptr %3, align 8, !tbaa !5
  br label %6

6:                                                ; preds = %19, %1
  %7 = call ptr @__ctype_b_loc() #4
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = load i8, ptr %9, align 1, !tbaa !9
  %11 = sext i8 %10 to i32
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds i16, ptr %8, i64 %12
  %14 = load i16, ptr %13, align 2, !tbaa !10
  %15 = zext i16 %14 to i32
  %16 = and i32 %15, 8192
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %22

18:                                               ; preds = %6
  br label %19

19:                                               ; preds = %18
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i32 1
  store ptr %21, ptr %3, align 8, !tbaa !5
  br label %6, !llvm.loop !12

22:                                               ; preds = %6
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %23, ptr %4, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %32, %22
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = load i8, ptr %25, align 1, !tbaa !9
  %27 = icmp ne i8 %26, 0
  br i1 %27, label %28, label %37

28:                                               ; preds = %24
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = load i8, ptr %29, align 1, !tbaa !9
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  store i8 %30, ptr %31, align 1, !tbaa !9
  br label %32

32:                                               ; preds = %28
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i32 1
  store ptr %34, ptr %3, align 8, !tbaa !5
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %35, i32 1
  store ptr %36, ptr %4, align 8, !tbaa !5
  br label %24, !llvm.loop !14

37:                                               ; preds = %24
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i32 -1
  store ptr %39, ptr %4, align 8, !tbaa !5
  store i8 0, ptr %38, align 1, !tbaa !9
  br label %40

40:                                               ; preds = %58, %37
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = icmp ugt ptr %41, %42
  br i1 %43, label %44, label %56

44:                                               ; preds = %40
  %45 = call ptr @__ctype_b_loc() #4
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = load i8, ptr %47, align 1, !tbaa !9
  %49 = sext i8 %48 to i32
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i16, ptr %46, i64 %50
  %52 = load i16, ptr %51, align 2, !tbaa !10
  %53 = zext i16 %52 to i32
  %54 = and i32 %53, 8192
  %55 = icmp ne i32 %54, 0
  br label %56

56:                                               ; preds = %44, %40
  %57 = phi i1 [ false, %40 ], [ %55, %44 ]
  br i1 %57, label %58, label %61

58:                                               ; preds = %56
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i32 -1
  store ptr %60, ptr %4, align 8, !tbaa !5
  store i8 0, ptr %59, align 1, !tbaa !9
  br label %40, !llvm.loop !15

61:                                               ; preds = %56
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret ptr %62
}

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() #2

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

!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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"short", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


; 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: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local noundef ptr @str_trim(ptr noundef returned %0) local_unnamed_addr #0 {
  %2 = tail call ptr @__ctype_b_loc() #2
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  br label %4

4:                                                ; preds = %4, %1
  %.015 = phi ptr [ %0, %1 ], [ %10, %4 ]
  %5 = load i8, ptr %.015, align 1, !tbaa !9
  %6 = sext i8 %5 to i64
  %7 = getelementptr inbounds i16, ptr %3, i64 %6
  %8 = load i16, ptr %7, align 2, !tbaa !10
  %9 = and i16 %8, 8192
  %.not = icmp eq i16 %9, 0
  %10 = getelementptr inbounds i8, ptr %.015, i64 1
  br i1 %.not, label %.preheader, label %4, !llvm.loop !12

.preheader:                                       ; preds = %4
  %.not1820 = icmp eq i8 %5, 0
  br i1 %.not1820, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %11 = phi i8 [ %14, %.lr.ph ], [ %5, %.preheader ]
  %.022 = phi ptr [ %13, %.lr.ph ], [ %0, %.preheader ]
  %.11621 = phi ptr [ %12, %.lr.ph ], [ %.015, %.preheader ]
  store i8 %11, ptr %.022, align 1, !tbaa !9
  %12 = getelementptr inbounds i8, ptr %.11621, i64 1
  %13 = getelementptr inbounds i8, ptr %.022, i64 1
  %14 = load i8, ptr %12, align 1, !tbaa !9
  %.not18 = icmp eq i8 %14, 0
  br i1 %.not18, label %._crit_edge, label %.lr.ph, !llvm.loop !14

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %.0.lcssa = phi ptr [ %0, %.preheader ], [ %13, %.lr.ph ]
  store i8 0, ptr %.0.lcssa, align 1, !tbaa !9
  %.123 = getelementptr inbounds i8, ptr %.0.lcssa, i64 -1
  %15 = icmp ugt ptr %.123, %0
  br i1 %15, label %.lr.ph26, label %.critedge

.lr.ph26:                                         ; preds = %._crit_edge, %22
  %.124 = phi ptr [ %.1, %22 ], [ %.123, %._crit_edge ]
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = load i8, ptr %.124, align 1, !tbaa !9
  %18 = sext i8 %17 to i64
  %19 = getelementptr inbounds i16, ptr %16, i64 %18
  %20 = load i16, ptr %19, align 2, !tbaa !10
  %21 = and i16 %20, 8192
  %.not19 = icmp eq i16 %21, 0
  br i1 %.not19, label %.critedge, label %22

22:                                               ; preds = %.lr.ph26
  store i8 0, ptr %.124, align 1, !tbaa !9
  %.1 = getelementptr inbounds i8, ptr %.124, i64 -1
  %23 = icmp ugt ptr %.1, %0
  br i1 %23, label %.lr.ph26, label %.critedge, !llvm.loop !15

.critedge:                                        ; preds = %.lr.ph26, %22, %._crit_edge
  ret ptr %0
}

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() local_unnamed_addr #1

attributes #0 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) 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 nofree nosync nounwind willreturn memory(none) "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 = { nounwind willreturn memory(none) }

!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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"short", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


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