; LLVM IR from ermig1979/Simd :: src/Simd/SimdBaseImageLoadBmp.ll (ZN4Simd4Base14ImageBmpLoader10FromStreamEv)

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

%"class.Simd::ImageLoader" = type { ptr, %"struct.Simd::ImageLoaderParam", %"class.Simd::InputMemoryStream", %"struct.Simd::View" }
%"struct.Simd::ImageLoaderParam" = type { ptr, i64, i32, i32 }
%"class.Simd::InputMemoryStream" = type { ptr, i64, i64, i64, i64 }
%"struct.Simd::View" = type <{ i64, i64, i64, i32, [4 x i8], ptr, i8, [7 x i8] }>
%"class.Simd::Base::ImageBmpLoader" = type <{ %"class.Simd::ImageLoader", ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x i8] }>

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Simd4Base14ImageBmpLoader10FromStreamEv(ptr noundef nonnull align 8 dereferenceable(172) %0) unnamed_addr #0 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8
  %9 = call noundef zeroext i1 @_ZN4Simd4Base14ImageBmpLoader11ParseHeaderEv(ptr noundef nonnull align 8 dereferenceable(172) %8)
  br i1 %9, label %11, label %10

10:                                               ; preds = %1
  store i1 false, ptr %2, align 1
  br label %127

11:                                               ; preds = %1
  %12 = load ptr, ptr %8, align 8, !tbaa !9
  %13 = getelementptr inbounds ptr, ptr %12, i64 3
  %14 = load ptr, ptr %13, align 8
  call void %14(ptr noundef nonnull align 8 dereferenceable(172) %8)
  %15 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 3
  %16 = getelementptr inbounds %"class.Simd::Base::ImageBmpLoader", ptr %8, i32 0, i32 3
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %18 = zext i32 %17 to i64
  %19 = getelementptr inbounds %"class.Simd::Base::ImageBmpLoader", ptr %8, i32 0, i32 4
  %20 = load i32, ptr %19, align 4, !tbaa !23
  %21 = zext i32 %20 to i64
  %22 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 1
  %23 = getelementptr inbounds %"struct.Simd::ImageLoaderParam", ptr %22, i32 0, i32 3
  %24 = load i32, ptr %23, align 4, !tbaa !24
  %25 = call noundef i64 @_ZN4Simd9AllocatorIhE9AlignmentEv()
  call void @_ZN4Simd4ViewINS_9AllocatorEE8RecreateEmmNS2_6FormatEPvm(ptr noundef nonnull align 8 dereferenceable(41) %15, i64 noundef %18, i64 noundef %21, i32 noundef %24, ptr noundef null, i64 noundef %25)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %26 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 3
  %27 = getelementptr inbounds %"struct.Simd::View", ptr %26, i32 0, i32 5
  %28 = load ptr, ptr %27, align 8, !tbaa !25
  %29 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 3
  %30 = getelementptr inbounds %"struct.Simd::View", ptr %29, i32 0, i32 1
  %31 = load i64, ptr %30, align 8, !tbaa !26
  %32 = sub i64 %31, 1
  %33 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 3
  %34 = getelementptr inbounds %"struct.Simd::View", ptr %33, i32 0, i32 2
  %35 = load i64, ptr %34, align 8, !tbaa !27
  %36 = mul i64 %32, %35
  %37 = getelementptr inbounds i8, ptr %28, i64 %36
  store ptr %37, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 0, ptr %5, align 8, !tbaa !28
  br label %38

38:                                               ; preds = %120, %11
  %39 = load i64, ptr %5, align 8, !tbaa !28
  %40 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 3
  %41 = getelementptr inbounds %"struct.Simd::View", ptr %40, i32 0, i32 1
  %42 = load i64, ptr %41, align 8, !tbaa !26
  %43 = icmp ult i64 %39, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %38
  store i32 2, ptr %6, align 4
  br label %123

45:                                               ; preds = %38
  %46 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 2
  %47 = getelementptr inbounds %"class.Simd::Base::ImageBmpLoader", ptr %8, i32 0, i32 6
  %48 = load i32, ptr %47, align 4, !tbaa !29
  %49 = getelementptr inbounds %"class.Simd::Base::ImageBmpLoader", ptr %8, i32 0, i32 7
  %50 = load i32, ptr %49, align 8, !tbaa !30
  %51 = add i32 %48, %50
  %52 = zext i32 %51 to i64
  %53 = call noundef zeroext i1 @_ZNK4Simd17InputMemoryStream7CanReadEm(ptr noundef nonnull align 8 dereferenceable(40) %46, i64 noundef %52)
  br i1 %53, label %55, label %54

54:                                               ; preds = %45
  store i1 false, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %123

55:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %56 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 2
  %57 = call noundef ptr @_ZNK4Simd17InputMemoryStream7CurrentEv(ptr noundef nonnull align 8 dereferenceable(40) %56)
  store ptr %57, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %"class.Simd::Base::ImageBmpLoader", ptr %8, i32 0, i32 1
  %59 = load ptr, ptr %58, align 8, !tbaa !31
  %60 = icmp ne ptr %59, null
  br i1 %60, label %61, label %75

61:                                               ; preds = %55
  %62 = getelementptr inbounds %"class.Simd::Base::ImageBmpLoader", ptr %8, i32 0, i32 1
  %63 = load ptr, ptr %62, align 8, !tbaa !31
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 3
  %66 = getelementptr inbounds %"struct.Simd::View", ptr %65, i32 0, i32 0
  %67 = load i64, ptr %66, align 8, !tbaa !32
  %68 = getelementptr inbounds %"class.Simd::Base::ImageBmpLoader", ptr %8, i32 0, i32 6
  %69 = load i32, ptr %68, align 4, !tbaa !29
  %70 = zext i32 %69 to i64
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 3
  %73 = getelementptr inbounds %"struct.Simd::View", ptr %72, i32 0, i32 2
  %74 = load i64, ptr %73, align 8, !tbaa !27
  call void %63(ptr noundef %64, i64 noundef %67, i64 noundef 1, i64 noundef %70, ptr noundef %71, i64 noundef %74)
  br label %100

75:                                               ; preds = %55
  %76 = getelementptr inbounds %"class.Simd::Base::ImageBmpLoader", ptr %8, i32 0, i32 2
  %77 = load ptr, ptr %76, align 8, !tbaa !33
  %78 = icmp ne ptr %77, null
  br i1 %78, label %79, label %93

79:                                               ; preds = %75
  %80 = getelementptr inbounds %"class.Simd::Base::ImageBmpLoader", ptr %8, i32 0, i32 2
  %81 = load ptr, ptr %80, align 8, !tbaa !33
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 3
  %84 = getelementptr inbounds %"struct.Simd::View", ptr %83, i32 0, i32 0
  %85 = load i64, ptr %84, align 8, !tbaa !32
  %86 = getelementptr inbounds %"class.Simd::Base::ImageBmpLoader", ptr %8, i32 0, i32 6
  %87 = load i32, ptr %86, align 4, !tbaa !29
  %88 = zext i32 %87 to i64
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 3
  %91 = getelementptr inbounds %"struct.Simd::View", ptr %90, i32 0, i32 2
  %92 = load i64, ptr %91, align 8, !tbaa !27
  call void %81(ptr noundef %82, i64 noundef %85, i64 noundef 1, i64 noundef %88, ptr noundef %89, i64 noundef %92, i8 noundef zeroext -1)
  br label %99

93:                                               ; preds = %75
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = getelementptr inbounds %"class.Simd::Base::ImageBmpLoader", ptr %8, i32 0, i32 6
  %97 = load i32, ptr %96, align 4, !tbaa !29
  %98 = zext i32 %97 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %94, ptr align 1 %95, i64 %98, i1 false)
  br label %99

99:                                               ; preds = %93, %79
  br label %100

100:                                              ; preds = %99, %61
  %101 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 2
  %102 = getelementptr inbounds %"class.Simd::Base::ImageBmpLoader", ptr %8, i32 0, i32 6
  %103 = load i32, ptr %102, align 4, !tbaa !29
  %104 = getelementptr inbounds %"class.Simd::Base::ImageBmpLoader", ptr %8, i32 0, i32 7
  %105 = load i32, ptr %104, align 8, !tbaa !30
  %106 = add i32 %103, %105
  %107 = zext i32 %106 to i64
  %108 = call noundef zeroext i1 @_ZN4Simd17InputMemoryStream4SkipEm(ptr noundef nonnull align 8 dereferenceable(40) %101, i64 noundef %107)
  br i1 %108, label %110, label %109

109:                                              ; preds = %100
  store i1 false, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %117

110:                                              ; preds = %100
  %111 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 3
  %112 = getelementptr inbounds %"struct.Simd::View", ptr %111, i32 0, i32 2
  %113 = load i64, ptr %112, align 8, !tbaa !27
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = sub i64 0, %113
  %116 = getelementptr inbounds i8, ptr %114, i64 %115
  store ptr %116, ptr %4, align 8, !tbaa !5
  store i32 0, ptr %6, align 4
  br label %117

117:                                              ; preds = %110, %109
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %118 = load i32, ptr %6, align 4
  switch i32 %118, label %123 [
    i32 0, label %119
  ]

119:                                              ; preds = %117
  br label %120

120:                                              ; preds = %119
  %121 = load i64, ptr %5, align 8, !tbaa !28
  %122 = add i64 %121, 1
  store i64 %122, ptr %5, align 8, !tbaa !28
  br label %38, !llvm.loop !34

123:                                              ; preds = %117, %54, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  %124 = load i32, ptr %6, align 4
  switch i32 %124, label %126 [
    i32 2, label %125
  ]

125:                                              ; preds = %123
  store i1 true, ptr %2, align 1
  store i32 1, ptr %6, align 4
  br label %126

126:                                              ; preds = %125, %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %127

127:                                              ; preds = %126, %10
  %128 = load i1, ptr %2, align 1
  ret i1 %128
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImageBmpLoader11ParseHeaderEv(ptr noundef nonnull align 8 dereferenceable(172)) #0 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd4ViewINS_9AllocatorEE8RecreateEmmNS2_6FormatEPvm(ptr noundef nonnull align 8 dereferenceable(41), i64 noundef, i64 noundef, i32 noundef, ptr noundef, i64 noundef) #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i64 @_ZN4Simd9AllocatorIhE9AlignmentEv() #1 align 2

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4Simd17InputMemoryStream7CanReadEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #3 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4Simd17InputMemoryStream7CurrentEv(ptr noundef nonnull align 8 dereferenceable(40)) #3 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) #4

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd17InputMemoryStream4SkipEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #3 align 2

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

attributes #0 = { 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 #1 = { alwaysinline 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { alwaysinline 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !22, i64 136}
!12 = !{!"_ZTSN4Simd4Base14ImageBmpLoaderE", !13, i64 0, !6, i64 120, !6, i64 128, !22, i64 136, !22, i64 140, !22, i64 144, !22, i64 148, !22, i64 152, !22, i64 156, !22, i64 160, !22, i64 164, !22, i64 168}
!13 = !{!"_ZTSN4Simd11ImageLoaderE", !14, i64 8, !18, i64 32, !19, i64 72}
!14 = !{!"_ZTSN4Simd16ImageLoaderParamE", !6, i64 0, !15, i64 8, !16, i64 16, !17, i64 20}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTS17SimdImageFileType", !7, i64 0}
!17 = !{!"_ZTS19SimdPixelFormatType", !7, i64 0}
!18 = !{!"_ZTSN4Simd17InputMemoryStreamE", !6, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32}
!19 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEEE", !15, i64 0, !15, i64 8, !15, i64 16, !20, i64 24, !6, i64 32, !21, i64 40}
!20 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEE6FormatE", !7, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = !{!12, !22, i64 140}
!24 = !{!13, !17, i64 28}
!25 = !{!13, !6, i64 104}
!26 = !{!13, !15, i64 80}
!27 = !{!13, !15, i64 88}
!28 = !{!15, !15, i64 0}
!29 = !{!12, !22, i64 148}
!30 = !{!12, !22, i64 152}
!31 = !{!12, !6, i64 120}
!32 = !{!13, !15, i64 72}
!33 = !{!12, !6, i64 128}
!34 = distinct !{!34, !35}
!35 = !{!"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"

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4Simd4Base14ImageBmpLoader10FromStreamEv(ptr noundef nonnull align 8 dereferenceable(172) %0) unnamed_addr #0 align 2 {
  %2 = tail call noundef zeroext i1 @_ZN4Simd4Base14ImageBmpLoader11ParseHeaderEv(ptr noundef nonnull align 8 dereferenceable(172) %0)
  br i1 %2, label %3, label %.critedge

3:                                                ; preds = %1
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 24
  %6 = load ptr, ptr %5, align 8
  tail call void %6(ptr noundef nonnull align 8 dereferenceable(172) %0)
  %7 = getelementptr inbounds i8, ptr %0, i64 72
  %8 = getelementptr inbounds i8, ptr %0, i64 136
  %9 = load i32, ptr %8, align 8, !tbaa !8
  %10 = zext i32 %9 to i64
  %11 = getelementptr inbounds i8, ptr %0, i64 140
  %12 = load i32, ptr %11, align 4, !tbaa !22
  %13 = zext i32 %12 to i64
  %14 = getelementptr inbounds i8, ptr %0, i64 28
  %15 = load i32, ptr %14, align 4, !tbaa !23
  %16 = tail call noundef i64 @_ZN4Simd9AllocatorIhE9AlignmentEv()
  tail call void @_ZN4Simd4ViewINS_9AllocatorEE8RecreateEmmNS2_6FormatEPvm(ptr noundef nonnull align 8 dereferenceable(41) %7, i64 noundef %10, i64 noundef %13, i32 noundef %15, ptr noundef null, i64 noundef %16)
  %17 = getelementptr inbounds i8, ptr %0, i64 80
  %18 = getelementptr inbounds i8, ptr %0, i64 88
  %19 = load i64, ptr %17, align 8, !tbaa !24
  %.not21.not22.not = icmp eq i64 %19, 0
  br i1 %.not21.not22.not, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %20 = getelementptr inbounds i8, ptr %0, i64 104
  %21 = load ptr, ptr %20, align 8, !tbaa !25
  %22 = add i64 %19, -1
  %23 = load i64, ptr %18, align 8, !tbaa !26
  %24 = mul i64 %22, %23
  %25 = getelementptr inbounds i8, ptr %21, i64 %24
  %26 = getelementptr inbounds i8, ptr %0, i64 32
  %27 = getelementptr inbounds i8, ptr %0, i64 148
  %28 = getelementptr inbounds i8, ptr %0, i64 152
  %29 = getelementptr inbounds i8, ptr %0, i64 120
  %30 = getelementptr inbounds i8, ptr %0, i64 128
  br label %31

31:                                               ; preds = %.lr.ph, %61
  %.01524 = phi i64 [ 0, %.lr.ph ], [ %65, %61 ]
  %.01623 = phi ptr [ %25, %.lr.ph ], [ %64, %61 ]
  %32 = load i32, ptr %27, align 4, !tbaa !27
  %33 = load i32, ptr %28, align 8, !tbaa !28
  %34 = add i32 %33, %32
  %35 = zext i32 %34 to i64
  %36 = tail call noundef zeroext i1 @_ZNK4Simd17InputMemoryStream7CanReadEm(ptr noundef nonnull align 8 dereferenceable(40) %26, i64 noundef %35)
  br i1 %36, label %37, label %.critedge

37:                                               ; preds = %31
  %38 = tail call noundef ptr @_ZNK4Simd17InputMemoryStream7CurrentEv(ptr noundef nonnull align 8 dereferenceable(40) %26)
  %39 = load ptr, ptr %29, align 8, !tbaa !29
  %.not = icmp eq ptr %39, null
  br i1 %.not, label %45, label %40

40:                                               ; preds = %37
  %41 = load i64, ptr %7, align 8, !tbaa !30
  %42 = load i32, ptr %27, align 4, !tbaa !27
  %43 = zext i32 %42 to i64
  %44 = load i64, ptr %18, align 8, !tbaa !26
  tail call void %39(ptr noundef %38, i64 noundef %41, i64 noundef 1, i64 noundef %43, ptr noundef %.01623, i64 noundef %44)
  br label %55

45:                                               ; preds = %37
  %46 = load ptr, ptr %30, align 8, !tbaa !31
  %.not20 = icmp eq ptr %46, null
  br i1 %.not20, label %52, label %47

47:                                               ; preds = %45
  %48 = load i64, ptr %7, align 8, !tbaa !30
  %49 = load i32, ptr %27, align 4, !tbaa !27
  %50 = zext i32 %49 to i64
  %51 = load i64, ptr %18, align 8, !tbaa !26
  tail call void %46(ptr noundef %38, i64 noundef %48, i64 noundef 1, i64 noundef %50, ptr noundef %.01623, i64 noundef %51, i8 noundef zeroext -1)
  br label %55

52:                                               ; preds = %45
  %53 = load i32, ptr %27, align 4, !tbaa !27
  %54 = zext i32 %53 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.01623, ptr align 1 %38, i64 %54, i1 false)
  br label %55

55:                                               ; preds = %47, %52, %40
  %56 = load i32, ptr %27, align 4, !tbaa !27
  %57 = load i32, ptr %28, align 8, !tbaa !28
  %58 = add i32 %57, %56
  %59 = zext i32 %58 to i64
  %60 = tail call noundef zeroext i1 @_ZN4Simd17InputMemoryStream4SkipEm(ptr noundef nonnull align 8 dereferenceable(40) %26, i64 noundef %59)
  br i1 %60, label %61, label %.critedge

61:                                               ; preds = %55
  %62 = load i64, ptr %18, align 8
  %63 = sub i64 0, %62
  %64 = getelementptr inbounds i8, ptr %.01623, i64 %63
  %65 = add nuw i64 %.01524, 1
  %66 = load i64, ptr %17, align 8, !tbaa !24
  %.not21.not = icmp ult i64 %65, %66
  br i1 %.not21.not, label %31, label %.critedge, !llvm.loop !32

.critedge:                                        ; preds = %31, %55, %61, %3, %1
  %.4 = phi i1 [ false, %1 ], [ true, %3 ], [ false, %31 ], [ false, %55 ], [ true, %61 ]
  ret i1 %.4
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd4Base14ImageBmpLoader11ParseHeaderEv(ptr noundef nonnull align 8 dereferenceable(172)) local_unnamed_addr #0 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd4ViewINS_9AllocatorEE8RecreateEmmNS2_6FormatEPvm(ptr noundef nonnull align 8 dereferenceable(41), i64 noundef, i64 noundef, i32 noundef, ptr noundef, i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i64 @_ZN4Simd9AllocatorIhE9AlignmentEv() local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4Simd17InputMemoryStream7CanReadEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4Simd17InputMemoryStream7CurrentEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2 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) #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4Simd17InputMemoryStream4SkipEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #2 align 2

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

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !21, i64 136}
!9 = !{!"_ZTSN4Simd4Base14ImageBmpLoaderE", !10, i64 0, !12, i64 120, !12, i64 128, !21, i64 136, !21, i64 140, !21, i64 144, !21, i64 148, !21, i64 152, !21, i64 156, !21, i64 160, !21, i64 164, !21, i64 168}
!10 = !{!"_ZTSN4Simd11ImageLoaderE", !11, i64 8, !17, i64 32, !18, i64 72}
!11 = !{!"_ZTSN4Simd16ImageLoaderParamE", !12, i64 0, !14, i64 8, !15, i64 16, !16, i64 20}
!12 = !{!"any pointer", !13, i64 0}
!13 = !{!"omnipotent char", !7, i64 0}
!14 = !{!"long", !13, i64 0}
!15 = !{!"_ZTS17SimdImageFileType", !13, i64 0}
!16 = !{!"_ZTS19SimdPixelFormatType", !13, i64 0}
!17 = !{!"_ZTSN4Simd17InputMemoryStreamE", !12, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32}
!18 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEEE", !14, i64 0, !14, i64 8, !14, i64 16, !19, i64 24, !12, i64 32, !20, i64 40}
!19 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEE6FormatE", !13, i64 0}
!20 = !{!"bool", !13, i64 0}
!21 = !{!"int", !13, i64 0}
!22 = !{!9, !21, i64 140}
!23 = !{!10, !16, i64 28}
!24 = !{!10, !14, i64 80}
!25 = !{!10, !12, i64 104}
!26 = !{!10, !14, i64 88}
!27 = !{!9, !21, i64 148}
!28 = !{!9, !21, i64 152}
!29 = !{!9, !12, i64 120}
!30 = !{!10, !14, i64 72}
!31 = !{!9, !12, i64 128}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


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