; LLVM IR from aap/librw :: src/frame.ll (ZN2rw5Frame9syncDirtyEv)

; 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.rw::Engine" = type { ptr, ptr, %"struct.rw::LinkList", %"struct.rw::FileFunctions", [13 x ptr], %"struct.rw::Device", ptr }
%"struct.rw::LinkList" = type { %"struct.rw::LLLink" }
%"struct.rw::LLLink" = type { ptr, ptr }
%"struct.rw::FileFunctions" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"struct.rw::Device" = type { float, float, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"struct.rw::Frame" = type { %"struct.rw::Object", %"struct.rw::LLLink", %"struct.rw::LinkList", %"struct.rw::Matrix", %"struct.rw::Matrix", ptr, ptr, ptr }
%"struct.rw::Object" = type { i8, i8, i8, i8, ptr }
%"struct.rw::Matrix" = type { %"struct.rw::V3d", i32, %"struct.rw::V3d", i32, %"struct.rw::V3d", i32, %"struct.rw::V3d", i32 }
%"struct.rw::V3d" = type { float, float, float }

@_ZN2rw6engineE = external global ptr, align 8

; 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 nounwind uwtable
declare dso_local void @_ZN2rw8LinkList4initEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw15ObjectWithFrame9fromFrameEPNS_6LLLinkE(ptr noundef) #1 align 2

; 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: mustprogress uwtable
define dso_local void @_ZN2rw5Frame9syncDirtyEv() #3 align 2 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  store ptr null, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %9 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %10 = getelementptr inbounds %"struct.rw::Engine", ptr %9, i32 0, i32 2
  %11 = getelementptr inbounds %"struct.rw::LinkList", ptr %10, i32 0, i32 0
  %12 = getelementptr inbounds %"struct.rw::LLLink", ptr %11, i32 0, i32 0
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %13, ptr %3, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %109, %0
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %"struct.rw::LLLink", ptr %15, i32 0, i32 0
  %17 = load ptr, ptr %16, align 8, !tbaa !16
  store ptr %17, ptr %2, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.rw::Engine", ptr %19, i32 0, i32 2
  %21 = call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %20)
  %22 = icmp ne ptr %18, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %14
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  br label %111

24:                                               ; preds = %14
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 -16
  store ptr %26, ptr %1, align 8, !tbaa !5
  %27 = load ptr, ptr %1, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.rw::Frame", ptr %27, i32 0, i32 0
  %29 = getelementptr inbounds %"struct.rw::Object", ptr %28, i32 0, i32 3
  %30 = load i8, ptr %29, align 1, !tbaa !17
  %31 = zext i8 %30 to i32
  %32 = and i32 %31, 1
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %76

34:                                               ; preds = %24
  %35 = load ptr, ptr %1, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.rw::Frame", ptr %35, i32 0, i32 0
  %37 = getelementptr inbounds %"struct.rw::Object", ptr %36, i32 0, i32 3
  %38 = load i8, ptr %37, align 1, !tbaa !17
  %39 = zext i8 %38 to i32
  %40 = and i32 %39, 4
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %47

42:                                               ; preds = %34
  %43 = load ptr, ptr %1, align 8, !tbaa !5
  %44 = getelementptr inbounds %"struct.rw::Frame", ptr %43, i32 0, i32 3
  %45 = load ptr, ptr %1, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.rw::Frame", ptr %45, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %46, ptr align 8 %44, i64 64, i1 false), !tbaa.struct !23
  br label %47

47:                                               ; preds = %42, %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %48 = load ptr, ptr %1, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.rw::Frame", ptr %48, i32 0, i32 2
  %50 = getelementptr inbounds %"struct.rw::LinkList", ptr %49, i32 0, i32 0
  %51 = getelementptr inbounds %"struct.rw::LLLink", ptr %50, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !26
  store ptr %52, ptr %6, align 8, !tbaa !5
  br label %53

53:                                               ; preds = %66, %47
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %"struct.rw::LLLink", ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !16
  store ptr %56, ptr %5, align 8, !tbaa !5
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = load ptr, ptr %1, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.rw::Frame", ptr %58, i32 0, i32 2
  %60 = call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %59)
  %61 = icmp ne ptr %57, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %53
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %68

63:                                               ; preds = %53
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = call noundef ptr @_ZN2rw15ObjectWithFrame9fromFrameEPNS_6LLLinkE(ptr noundef %64)
  call void @_ZN2rw15ObjectWithFrame4syncEv(ptr noundef nonnull align 8 dereferenceable(40) %65)
  br label %66

66:                                               ; preds = %63
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %67, ptr %6, align 8, !tbaa !5
  br label %53, !llvm.loop !27

68:                                               ; preds = %62
  %69 = load ptr, ptr %1, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.rw::Frame", ptr %69, i32 0, i32 5
  %71 = load ptr, ptr %70, align 8, !tbaa !29
  %72 = load ptr, ptr %1, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.rw::Frame", ptr %72, i32 0, i32 0
  %74 = getelementptr inbounds %"struct.rw::Object", ptr %73, i32 0, i32 3
  %75 = load i8, ptr %74, align 1, !tbaa !17
  call void @_ZN2rwL11syncRecurseEPNS_5FrameEh(ptr noundef %71, i8 noundef zeroext %75)
  br label %101

76:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %77 = load ptr, ptr %1, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.rw::Frame", ptr %77, i32 0, i32 2
  %79 = getelementptr inbounds %"struct.rw::LinkList", ptr %78, i32 0, i32 0
  %80 = getelementptr inbounds %"struct.rw::LLLink", ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !26
  store ptr %81, ptr %8, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %95, %76
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = getelementptr inbounds %"struct.rw::LLLink", ptr %83, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8, !tbaa !16
  store ptr %85, ptr %7, align 8, !tbaa !5
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = load ptr, ptr %1, align 8, !tbaa !5
  %88 = getelementptr inbounds %"struct.rw::Frame", ptr %87, i32 0, i32 2
  %89 = call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %88)
  %90 = icmp ne ptr %86, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %82
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %97

92:                                               ; preds = %82
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = call noundef ptr @_ZN2rw15ObjectWithFrame9fromFrameEPNS_6LLLinkE(ptr noundef %93)
  call void @_ZN2rw15ObjectWithFrame4syncEv(ptr noundef nonnull align 8 dereferenceable(40) %94)
  br label %95

95:                                               ; preds = %92
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %96, ptr %8, align 8, !tbaa !5
  br label %82, !llvm.loop !30

97:                                               ; preds = %91
  %98 = load ptr, ptr %1, align 8, !tbaa !5
  %99 = getelementptr inbounds %"struct.rw::Frame", ptr %98, i32 0, i32 5
  %100 = load ptr, ptr %99, align 8, !tbaa !29
  call void @_ZN2rwL14syncObjRecurseEPNS_5FrameE(ptr noundef %100)
  br label %101

101:                                              ; preds = %97, %68
  %102 = load ptr, ptr %1, align 8, !tbaa !5
  %103 = getelementptr inbounds %"struct.rw::Frame", ptr %102, i32 0, i32 0
  %104 = getelementptr inbounds %"struct.rw::Object", ptr %103, i32 0, i32 3
  %105 = load i8, ptr %104, align 1, !tbaa !17
  %106 = zext i8 %105 to i32
  %107 = and i32 %106, -16
  %108 = trunc i32 %107 to i8
  store i8 %108, ptr %104, align 1, !tbaa !17
  br label %109

109:                                              ; preds = %101
  %110 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %110, ptr %3, align 8, !tbaa !5
  br label %14, !llvm.loop !31

111:                                              ; preds = %23
  %112 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.rw::Engine", ptr %112, i32 0, i32 2
  call void @_ZN2rw8LinkList4initEv(ptr noundef nonnull align 8 dereferenceable(16) %113)
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2rw15ObjectWithFrame4syncEv(ptr noundef nonnull align 8 dereferenceable(40)) #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN2rwL11syncRecurseEPNS_5FrameEh(ptr noundef, i8 noundef zeroext) #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN2rwL14syncObjRecurseEPNS_5FrameE(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"_ZTSN2rw6EngineE", !6, i64 0, !6, i64 8, !11, i64 16, !13, i64 32, !7, i64 88, !14, i64 192, !6, i64 328}
!11 = !{!"_ZTSN2rw8LinkListE", !12, i64 0}
!12 = !{!"_ZTSN2rw6LLLinkE", !6, i64 0, !6, i64 8}
!13 = !{!"_ZTSN2rw13FileFunctionsE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!14 = !{!"_ZTSN2rw6DeviceE", !15, i64 0, !15, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128}
!15 = !{!"float", !7, i64 0}
!16 = !{!12, !6, i64 0}
!17 = !{!18, !7, i64 3}
!18 = !{!"_ZTSN2rw5FrameE", !19, i64 0, !12, i64 16, !11, i64 32, !20, i64 48, !20, i64 112, !6, i64 176, !6, i64 184, !6, i64 192}
!19 = !{!"_ZTSN2rw6ObjectE", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !6, i64 8}
!20 = !{!"_ZTSN2rw6MatrixE", !21, i64 0, !22, i64 12, !21, i64 16, !22, i64 28, !21, i64 32, !22, i64 44, !21, i64 48, !22, i64 60}
!21 = !{!"_ZTSN2rw3V3dE", !15, i64 0, !15, i64 4, !15, i64 8}
!22 = !{!"int", !7, i64 0}
!23 = !{i64 0, i64 4, !24, i64 4, i64 4, !24, i64 8, i64 4, !24, i64 12, i64 4, !25, i64 16, i64 4, !24, i64 20, i64 4, !24, i64 24, i64 4, !24, i64 28, i64 4, !25, i64 32, i64 4, !24, i64 36, i64 4, !24, i64 40, i64 4, !24, i64 44, i64 4, !25, i64 48, i64 4, !24, i64 52, i64 4, !24, i64 56, i64 4, !24, i64 60, i64 4, !25}
!24 = !{!15, !15, i64 0}
!25 = !{!22, !22, i64 0}
!26 = !{!18, !6, i64 32}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!18, !6, i64 176}
!30 = distinct !{!30, !28}
!31 = distinct !{!31, !28}


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

@_ZN2rw6engineE = external local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2rw8LinkList4initEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw15ObjectWithFrame9fromFrameEPNS_6LLLinkE(ptr noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw5Frame9syncDirtyEv() local_unnamed_addr #2 align 2 {
  %1 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %1, i64 16
  %3 = load ptr, ptr %2, align 8, !tbaa !9
  %4 = load ptr, ptr %3, align 8, !tbaa !16
  %5 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %2)
  %.not37 = icmp eq ptr %3, %5
  br i1 %.not37, label %._crit_edge41, label %.lr.ph40

._crit_edge41:                                    ; preds = %41, %0
  %6 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 16
  tail call void @_ZN2rw8LinkList4initEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  ret void

.lr.ph40:                                         ; preds = %0, %41
  %8 = phi ptr [ %44, %41 ], [ %4, %0 ]
  %.02538 = phi ptr [ %8, %41 ], [ %3, %0 ]
  %9 = getelementptr inbounds i8, ptr %.02538, i64 -13
  %10 = load i8, ptr %9, align 1, !tbaa !17
  %11 = zext i8 %10 to i32
  %12 = and i32 %11, 1
  %.not26 = icmp eq i32 %12, 0
  br i1 %.not26, label %30, label %13

13:                                               ; preds = %.lr.ph40
  %14 = and i32 %11, 4
  %.not28 = icmp eq i32 %14, 0
  br i1 %.not28, label %18, label %15

15:                                               ; preds = %13
  %16 = getelementptr inbounds i8, ptr %.02538, i64 32
  %17 = getelementptr inbounds i8, ptr %.02538, i64 96
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %17, ptr noundef nonnull align 8 dereferenceable(64) %16, i64 64, i1 false), !tbaa.struct !23
  br label %18

18:                                               ; preds = %15, %13
  %19 = getelementptr inbounds i8, ptr %.02538, i64 16
  %20 = load ptr, ptr %19, align 8, !tbaa !26
  %21 = load ptr, ptr %20, align 8, !tbaa !16
  %22 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %19)
  %.not2930 = icmp eq ptr %20, %22
  br i1 %.not2930, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %18
  %23 = getelementptr inbounds i8, ptr %.02538, i64 160
  %24 = load ptr, ptr %23, align 8, !tbaa !27
  %25 = load i8, ptr %9, align 1, !tbaa !17
  tail call void @_ZN2rwL11syncRecurseEPNS_5FrameEh(ptr noundef %24, i8 noundef zeroext %25)
  br label %41

.lr.ph:                                           ; preds = %18, %.lr.ph
  %26 = phi ptr [ %28, %.lr.ph ], [ %21, %18 ]
  %.02431 = phi ptr [ %26, %.lr.ph ], [ %20, %18 ]
  %27 = tail call noundef ptr @_ZN2rw15ObjectWithFrame9fromFrameEPNS_6LLLinkE(ptr noundef nonnull %.02431)
  tail call void @_ZN2rw15ObjectWithFrame4syncEv(ptr noundef nonnull align 8 dereferenceable(40) %27)
  %28 = load ptr, ptr %26, align 8, !tbaa !16
  %29 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %19)
  %.not29 = icmp eq ptr %26, %29
  br i1 %.not29, label %._crit_edge, label %.lr.ph, !llvm.loop !28

30:                                               ; preds = %.lr.ph40
  %31 = getelementptr inbounds i8, ptr %.02538, i64 16
  %32 = load ptr, ptr %31, align 8, !tbaa !26
  %33 = load ptr, ptr %32, align 8, !tbaa !16
  %34 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %31)
  %.not2732 = icmp eq ptr %32, %34
  br i1 %.not2732, label %._crit_edge36, label %.lr.ph35

._crit_edge36:                                    ; preds = %.lr.ph35, %30
  %35 = getelementptr inbounds i8, ptr %.02538, i64 160
  %36 = load ptr, ptr %35, align 8, !tbaa !27
  tail call void @_ZN2rwL14syncObjRecurseEPNS_5FrameE(ptr noundef %36)
  br label %41

.lr.ph35:                                         ; preds = %30, %.lr.ph35
  %37 = phi ptr [ %39, %.lr.ph35 ], [ %33, %30 ]
  %.033 = phi ptr [ %37, %.lr.ph35 ], [ %32, %30 ]
  %38 = tail call noundef ptr @_ZN2rw15ObjectWithFrame9fromFrameEPNS_6LLLinkE(ptr noundef nonnull %.033)
  tail call void @_ZN2rw15ObjectWithFrame4syncEv(ptr noundef nonnull align 8 dereferenceable(40) %38)
  %39 = load ptr, ptr %37, align 8, !tbaa !16
  %40 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %31)
  %.not27 = icmp eq ptr %37, %40
  br i1 %.not27, label %._crit_edge36, label %.lr.ph35, !llvm.loop !30

41:                                               ; preds = %._crit_edge36, %._crit_edge
  %42 = load i8, ptr %9, align 1, !tbaa !17
  %43 = and i8 %42, -16
  store i8 %43, ptr %9, align 1, !tbaa !17
  %44 = load ptr, ptr %8, align 8, !tbaa !16
  %45 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 16
  %47 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %46)
  %.not = icmp eq ptr %8, %47
  br i1 %.not, label %._crit_edge41, label %.lr.ph40, !llvm.loop !31
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2rw15ObjectWithFrame4syncEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN2rwL11syncRecurseEPNS_5FrameEh(ptr noundef, i8 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN2rwL14syncObjRecurseEPNS_5FrameE(ptr noundef) local_unnamed_addr #2

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

!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, !6, i64 16}
!10 = !{!"_ZTSN2rw6EngineE", !6, i64 0, !6, i64 8, !11, i64 16, !13, i64 32, !7, i64 88, !14, i64 192, !6, i64 328}
!11 = !{!"_ZTSN2rw8LinkListE", !12, i64 0}
!12 = !{!"_ZTSN2rw6LLLinkE", !6, i64 0, !6, i64 8}
!13 = !{!"_ZTSN2rw13FileFunctionsE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!14 = !{!"_ZTSN2rw6DeviceE", !15, i64 0, !15, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128}
!15 = !{!"float", !7, i64 0}
!16 = !{!12, !6, i64 0}
!17 = !{!18, !7, i64 3}
!18 = !{!"_ZTSN2rw5FrameE", !19, i64 0, !12, i64 16, !11, i64 32, !20, i64 48, !20, i64 112, !6, i64 176, !6, i64 184, !6, i64 192}
!19 = !{!"_ZTSN2rw6ObjectE", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !6, i64 8}
!20 = !{!"_ZTSN2rw6MatrixE", !21, i64 0, !22, i64 12, !21, i64 16, !22, i64 28, !21, i64 32, !22, i64 44, !21, i64 48, !22, i64 60}
!21 = !{!"_ZTSN2rw3V3dE", !15, i64 0, !15, i64 4, !15, i64 8}
!22 = !{!"int", !7, i64 0}
!23 = !{i64 0, i64 4, !24, i64 4, i64 4, !24, i64 8, i64 4, !24, i64 12, i64 4, !25, i64 16, i64 4, !24, i64 20, i64 4, !24, i64 24, i64 4, !24, i64 28, i64 4, !25, i64 32, i64 4, !24, i64 36, i64 4, !24, i64 40, i64 4, !24, i64 44, i64 4, !25, i64 48, i64 4, !24, i64 52, i64 4, !24, i64 56, i64 4, !24, i64 60, i64 4, !25}
!24 = !{!15, !15, i64 0}
!25 = !{!22, !22, i64 0}
!26 = !{!18, !6, i64 32}
!27 = !{!18, !6, i64 176}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}
!31 = distinct !{!31, !29}


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