; LLVM IR from snowballstem/snowball :: compiler (analyser)

; 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.analyser = type { ptr, ptr, ptr, ptr, i8, i8, ptr, ptr, [6 x i32], ptr, ptr, i32, i32, i32, ptr, ptr, ptr, i32, i8 }
%struct.node = type { ptr, ptr, ptr, ptr, ptr, i8, i8, i8, ptr, ptr, ptr, i32, i32, i32 }
%struct.name = type { ptr, ptr, i8, i8, i8, i8, i8, i8, i8, ptr, i32, ptr, ptr, ptr, i32 }
%struct.literalstring = type { ptr, ptr }
%struct.among = type { ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr }
%struct.grouping = type { ptr, ptr, i32, i32, ptr, i32 }

; 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 void @close_analyser(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.analyser, ptr %13, i32 0, i32 1
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  store ptr %15, ptr %3, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %19, %1
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %25

19:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.node, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !12
  store ptr %22, ptr %4, align 8, !tbaa !5
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  call void @check_free(ptr noundef %23)
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %24, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  br label %16, !llvm.loop !14

25:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.analyser, ptr %26, i32 0, i32 2
  %28 = load ptr, ptr %27, align 8, !tbaa !16
  store ptr %28, ptr %5, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %32, %25
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %41

32:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.name, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !17
  store ptr %35, ptr %6, align 8, !tbaa !5
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.name, ptr %36, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !19
  call void @lose_s(ptr noundef %38)
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  call void @check_free(ptr noundef %39)
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %40, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %29, !llvm.loop !20

41:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.analyser, ptr %42, i32 0, i32 3
  %44 = load ptr, ptr %43, align 8, !tbaa !21
  store ptr %44, ptr %7, align 8, !tbaa !5
  br label %45

45:                                               ; preds = %48, %41
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = icmp ne ptr %46, null
  br i1 %47, label %48, label %57

48:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.literalstring, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !22
  store ptr %51, ptr %8, align 8, !tbaa !5
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.literalstring, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !24
  call void @lose_b(ptr noundef %54)
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  call void @check_free(ptr noundef %55)
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %56, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %45, !llvm.loop !25

57:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.analyser, ptr %58, i32 0, i32 9
  %60 = load ptr, ptr %59, align 8, !tbaa !26
  store ptr %60, ptr %9, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %64, %57
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %76

64:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.among, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !27
  store ptr %67, ptr %10, align 8, !tbaa !5
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.among, ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !29
  call void @check_free(ptr noundef %70)
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.among, ptr %71, i32 0, i32 11
  %73 = load ptr, ptr %72, align 8, !tbaa !30
  call void @check_free(ptr noundef %73)
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  call void @check_free(ptr noundef %74)
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %75, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %61, !llvm.loop !31

76:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.analyser, ptr %77, i32 0, i32 14
  %79 = load ptr, ptr %78, align 8, !tbaa !32
  store ptr %79, ptr %11, align 8, !tbaa !5
  br label %80

80:                                               ; preds = %83, %76
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = icmp ne ptr %81, null
  br i1 %82, label %83, label %92

83:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.grouping, ptr %84, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !33
  store ptr %86, ptr %12, align 8, !tbaa !5
  %87 = load ptr, ptr %11, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.grouping, ptr %87, i32 0, i32 1
  %89 = load ptr, ptr %88, align 8, !tbaa !35
  call void @lose_b(ptr noundef %89)
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  call void @check_free(ptr noundef %90)
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %91, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %80, !llvm.loop !36

92:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  call void @check_free(ptr noundef %93)
  ret void
}

declare void @check_free(ptr noundef) #2

declare void @lose_s(ptr noundef) #2

declare void @lose_b(ptr noundef) #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 = { "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/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"analyser", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !7, i64 32, !7, i64 33, !6, i64 40, !6, i64 48, !7, i64 56, !6, i64 80, !6, i64 88, !11, i64 96, !11, i64 100, !11, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !11, i64 136, !7, i64 140}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"node", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !7, i64 40, !7, i64 41, !7, i64 42, !6, i64 48, !6, i64 56, !6, i64 64, !11, i64 72, !11, i64 76, !11, i64 80}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!10, !6, i64 16}
!17 = !{!18, !6, i64 0}
!18 = !{!"name", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19, !7, i64 20, !7, i64 21, !7, i64 22, !6, i64 24, !11, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !11, i64 64}
!19 = !{!18, !6, i64 8}
!20 = distinct !{!20, !15}
!21 = !{!10, !6, i64 24}
!22 = !{!23, !6, i64 0}
!23 = !{!"literalstring", !6, i64 0, !6, i64 8}
!24 = !{!23, !6, i64 8}
!25 = distinct !{!25, !15}
!26 = !{!10, !6, i64 80}
!27 = !{!28, !6, i64 0}
!28 = !{!"among", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !6, i64 48, !6, i64 56, !6, i64 64}
!29 = !{!28, !6, i64 8}
!30 = !{!28, !6, i64 56}
!31 = distinct !{!31, !15}
!32 = !{!10, !6, i64 112}
!33 = !{!34, !6, i64 0}
!34 = !{!"grouping", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !6, i64 24, !11, i64 32}
!35 = !{!34, !6, i64 8}
!36 = distinct !{!36, !15}


; 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: nounwind uwtable
define dso_local void @close_analyser(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %.not39 = icmp eq ptr %3, null
  br i1 %.not39, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1, %.lr.ph
  %.040 = phi ptr [ %4, %.lr.ph ], [ %3, %1 ]
  %4 = load ptr, ptr %.040, align 8, !tbaa !11
  tail call void @check_free(ptr noundef nonnull %.040) #2
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph, %1
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  %6 = load ptr, ptr %5, align 8, !tbaa !15
  %.not3541 = icmp eq ptr %6, null
  br i1 %.not3541, label %._crit_edge45, label %.lr.ph44

.lr.ph44:                                         ; preds = %._crit_edge, %.lr.ph44
  %.03242 = phi ptr [ %7, %.lr.ph44 ], [ %6, %._crit_edge ]
  %7 = load ptr, ptr %.03242, align 8, !tbaa !16
  %8 = getelementptr inbounds i8, ptr %.03242, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !18
  tail call void @lose_s(ptr noundef %9) #2
  tail call void @check_free(ptr noundef nonnull %.03242) #2
  %.not35 = icmp eq ptr %7, null
  br i1 %.not35, label %._crit_edge45, label %.lr.ph44, !llvm.loop !19

._crit_edge45:                                    ; preds = %.lr.ph44, %._crit_edge
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = load ptr, ptr %10, align 8, !tbaa !20
  %.not3646 = icmp eq ptr %11, null
  br i1 %.not3646, label %._crit_edge50, label %.lr.ph49

.lr.ph49:                                         ; preds = %._crit_edge45, %.lr.ph49
  %.03447 = phi ptr [ %12, %.lr.ph49 ], [ %11, %._crit_edge45 ]
  %12 = load ptr, ptr %.03447, align 8, !tbaa !21
  %13 = getelementptr inbounds i8, ptr %.03447, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !23
  tail call void @lose_b(ptr noundef %14) #2
  tail call void @check_free(ptr noundef nonnull %.03447) #2
  %.not36 = icmp eq ptr %12, null
  br i1 %.not36, label %._crit_edge50, label %.lr.ph49, !llvm.loop !24

._crit_edge50:                                    ; preds = %.lr.ph49, %._crit_edge45
  %15 = getelementptr inbounds i8, ptr %0, i64 80
  %16 = load ptr, ptr %15, align 8, !tbaa !25
  %.not3751 = icmp eq ptr %16, null
  br i1 %.not3751, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %._crit_edge50, %.lr.ph54
  %.03352 = phi ptr [ %17, %.lr.ph54 ], [ %16, %._crit_edge50 ]
  %17 = load ptr, ptr %.03352, align 8, !tbaa !26
  %18 = getelementptr inbounds i8, ptr %.03352, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !28
  tail call void @check_free(ptr noundef %19) #2
  %20 = getelementptr inbounds i8, ptr %.03352, i64 56
  %21 = load ptr, ptr %20, align 8, !tbaa !29
  tail call void @check_free(ptr noundef %21) #2
  tail call void @check_free(ptr noundef nonnull %.03352) #2
  %.not37 = icmp eq ptr %17, null
  br i1 %.not37, label %._crit_edge55, label %.lr.ph54, !llvm.loop !30

._crit_edge55:                                    ; preds = %.lr.ph54, %._crit_edge50
  %22 = getelementptr inbounds i8, ptr %0, i64 112
  %23 = load ptr, ptr %22, align 8, !tbaa !31
  %.not3856 = icmp eq ptr %23, null
  br i1 %.not3856, label %._crit_edge60, label %.lr.ph59

.lr.ph59:                                         ; preds = %._crit_edge55, %.lr.ph59
  %.03157 = phi ptr [ %24, %.lr.ph59 ], [ %23, %._crit_edge55 ]
  %24 = load ptr, ptr %.03157, align 8, !tbaa !32
  %25 = getelementptr inbounds i8, ptr %.03157, i64 8
  %26 = load ptr, ptr %25, align 8, !tbaa !34
  tail call void @lose_b(ptr noundef %26) #2
  tail call void @check_free(ptr noundef nonnull %.03157) #2
  %.not38 = icmp eq ptr %24, null
  br i1 %.not38, label %._crit_edge60, label %.lr.ph59, !llvm.loop !35

._crit_edge60:                                    ; preds = %.lr.ph59, %._crit_edge55
  tail call void @check_free(ptr noundef %0) #2
  ret void
}

declare void @check_free(ptr noundef) local_unnamed_addr #1

declare void @lose_s(ptr noundef) local_unnamed_addr #1

declare void @lose_b(ptr noundef) local_unnamed_addr #1

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 = { 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, !7, i64 8}
!6 = !{!"analyser", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !8, i64 32, !8, i64 33, !7, i64 40, !7, i64 48, !8, i64 56, !7, i64 80, !7, i64 88, !10, i64 96, !10, i64 100, !10, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !10, i64 136, !8, i64 140}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"node", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !8, i64 40, !8, i64 41, !8, i64 42, !7, i64 48, !7, i64 56, !7, i64 64, !10, i64 72, !10, i64 76, !10, i64 80}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!6, !7, i64 16}
!16 = !{!17, !7, i64 0}
!17 = !{!"name", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !8, i64 18, !8, i64 19, !8, i64 20, !8, i64 21, !8, i64 22, !7, i64 24, !10, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !10, i64 64}
!18 = !{!17, !7, i64 8}
!19 = distinct !{!19, !14}
!20 = !{!6, !7, i64 24}
!21 = !{!22, !7, i64 0}
!22 = !{!"literalstring", !7, i64 0, !7, i64 8}
!23 = !{!22, !7, i64 8}
!24 = distinct !{!24, !14}
!25 = !{!6, !7, i64 80}
!26 = !{!27, !7, i64 0}
!27 = !{!"among", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !7, i64 48, !7, i64 56, !7, i64 64}
!28 = !{!27, !7, i64 8}
!29 = !{!27, !7, i64 56}
!30 = distinct !{!30, !14}
!31 = !{!6, !7, i64 112}
!32 = !{!33, !7, i64 0}
!33 = !{!"grouping", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !7, i64 24, !10, i64 32}
!34 = !{!33, !7, i64 8}
!35 = distinct !{!35, !14}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass