; LLVM IR from mitdbg/deneva :: transport/message.ll (ZN16TPCCQueryMessage13copy_from_bufEPc)

; 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.mem_alloc = type { i8 }
%class.TPCCQueryMessage = type { %class.QueryMessage, i64, i64, i64, i64, i64, i64, i64, i64, [16 x i8], i64, i8, %class.Array.2, i8, i8, i64, i64 }
%class.QueryMessage = type { %class.Message, i64, i64 }
%class.Message = type { ptr, i32, i64, i64, i64, i64, i64, i64, double, double, double, double, double, double, double }
%class.Array.2 = type { ptr, i64, i64 }

@.str.1 = external hidden unnamed_addr constant [69 x i8], align 1
@mem_allocator = external global %class.mem_alloc, align 1
@.str.9 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [55 x i8], align 1
@__PRETTY_FUNCTION__._ZN16TPCCQueryMessage13copy_from_bufEPc = external hidden unnamed_addr constant [53 x i8], align 1

; 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 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; 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 noundef i64 @_ZN12QueryMessage8get_sizeEv(ptr noundef nonnull align 8 dereferenceable(136)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12QueryMessage13copy_from_bufEPc(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef) unnamed_addr #4 align 2

declare noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1), i64 noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5ArrayIP7Item_noE4initEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5ArrayIP7Item_noE3addES1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16TPCCQueryMessage13copy_from_bufEPc(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef %1) unnamed_addr #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN12QueryMessage13copy_from_bufEPc(ptr noundef nonnull align 8 dereferenceable(136) %9, ptr noundef %10)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %11 = call noundef i64 @_ZN12QueryMessage8get_sizeEv(ptr noundef nonnull align 8 dereferenceable(136) %9)
  store i64 %11, ptr %5, align 8, !tbaa !9
  %12 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 1
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = load i64, ptr %5, align 8, !tbaa !9
  %15 = getelementptr inbounds i8, ptr %13, i64 %14
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 1 %15, i64 8, i1 false)
  %16 = load i64, ptr %5, align 8, !tbaa !9
  %17 = add i64 %16, 8
  store i64 %17, ptr %5, align 8, !tbaa !9
  %18 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 1
  %19 = load i64, ptr %18, align 8, !tbaa !11
  %20 = icmp eq i64 %19, 1
  br i1 %20, label %25, label %21

21:                                               ; preds = %2
  %22 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 1
  %23 = load i64, ptr %22, align 8, !tbaa !11
  %24 = icmp eq i64 %23, 2
  br label %25

25:                                               ; preds = %21, %2
  %26 = phi i1 [ true, %2 ], [ %24, %21 ]
  br i1 %26, label %27, label %28

27:                                               ; preds = %25
  br label %30

28:                                               ; preds = %25
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 1500, ptr noundef @__PRETTY_FUNCTION__._ZN16TPCCQueryMessage13copy_from_bufEPc) #7
  unreachable

29:                                               ; No predecessors!
  br label %30

30:                                               ; preds = %29, %27
  %31 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 2
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = load i64, ptr %5, align 8, !tbaa !9
  %34 = getelementptr inbounds i8, ptr %32, i64 %33
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %31, ptr align 1 %34, i64 8, i1 false)
  %35 = load i64, ptr %5, align 8, !tbaa !9
  %36 = add i64 %35, 8
  store i64 %36, ptr %5, align 8, !tbaa !9
  %37 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 3
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = load i64, ptr %5, align 8, !tbaa !9
  %40 = getelementptr inbounds i8, ptr %38, i64 %39
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 1 %40, i64 8, i1 false)
  %41 = load i64, ptr %5, align 8, !tbaa !9
  %42 = add i64 %41, 8
  store i64 %42, ptr %5, align 8, !tbaa !9
  %43 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 4
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = load i64, ptr %5, align 8, !tbaa !9
  %46 = getelementptr inbounds i8, ptr %44, i64 %45
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %43, ptr align 1 %46, i64 8, i1 false)
  %47 = load i64, ptr %5, align 8, !tbaa !9
  %48 = add i64 %47, 8
  store i64 %48, ptr %5, align 8, !tbaa !9
  %49 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 5
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = load i64, ptr %5, align 8, !tbaa !9
  %52 = getelementptr inbounds i8, ptr %50, i64 %51
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %49, ptr align 1 %52, i64 8, i1 false)
  %53 = load i64, ptr %5, align 8, !tbaa !9
  %54 = add i64 %53, 8
  store i64 %54, ptr %5, align 8, !tbaa !9
  %55 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 1
  %56 = load i64, ptr %55, align 8, !tbaa !11
  %57 = icmp eq i64 %56, 1
  br i1 %57, label %58, label %95

58:                                               ; preds = %30
  %59 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 6
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = load i64, ptr %5, align 8, !tbaa !9
  %62 = getelementptr inbounds i8, ptr %60, i64 %61
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %59, ptr align 1 %62, i64 8, i1 false)
  %63 = load i64, ptr %5, align 8, !tbaa !9
  %64 = add i64 %63, 8
  store i64 %64, ptr %5, align 8, !tbaa !9
  %65 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 7
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = load i64, ptr %5, align 8, !tbaa !9
  %68 = getelementptr inbounds i8, ptr %66, i64 %67
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %65, ptr align 1 %68, i64 8, i1 false)
  %69 = load i64, ptr %5, align 8, !tbaa !9
  %70 = add i64 %69, 8
  store i64 %70, ptr %5, align 8, !tbaa !9
  %71 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 8
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = load i64, ptr %5, align 8, !tbaa !9
  %74 = getelementptr inbounds i8, ptr %72, i64 %73
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %71, ptr align 1 %74, i64 8, i1 false)
  %75 = load i64, ptr %5, align 8, !tbaa !9
  %76 = add i64 %75, 8
  store i64 %76, ptr %5, align 8, !tbaa !9
  %77 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 9
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = load i64, ptr %5, align 8, !tbaa !9
  %80 = getelementptr inbounds i8, ptr %78, i64 %79
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %77, ptr align 1 %80, i64 16, i1 false)
  %81 = load i64, ptr %5, align 8, !tbaa !9
  %82 = add i64 %81, 16
  store i64 %82, ptr %5, align 8, !tbaa !9
  %83 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 10
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = load i64, ptr %5, align 8, !tbaa !9
  %86 = getelementptr inbounds i8, ptr %84, i64 %85
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %83, ptr align 1 %86, i64 8, i1 false)
  %87 = load i64, ptr %5, align 8, !tbaa !9
  %88 = add i64 %87, 8
  store i64 %88, ptr %5, align 8, !tbaa !9
  %89 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 11
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = load i64, ptr %5, align 8, !tbaa !9
  %92 = getelementptr inbounds i8, ptr %90, i64 %91
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %89, ptr align 1 %92, i64 1, i1 false)
  %93 = load i64, ptr %5, align 8, !tbaa !9
  %94 = add i64 %93, 1
  store i64 %94, ptr %5, align 8, !tbaa !9
  br label %95

95:                                               ; preds = %58, %30
  %96 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 1
  %97 = load i64, ptr %96, align 8, !tbaa !11
  %98 = icmp eq i64 %97, 2
  br i1 %98, label %99, label %150

99:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = load i64, ptr %5, align 8, !tbaa !9
  %102 = getelementptr inbounds i8, ptr %100, i64 %101
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 1 %102, i64 8, i1 false)
  %103 = load i64, ptr %5, align 8, !tbaa !9
  %104 = add i64 %103, 8
  store i64 %104, ptr %5, align 8, !tbaa !9
  %105 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 12
  %106 = load i64, ptr %6, align 8, !tbaa !9
  call void @_ZN5ArrayIP7Item_noE4initEm(ptr noundef nonnull align 8 dereferenceable(24) %105, i64 noundef %106)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %107

107:                                              ; preds = %122, %99
  %108 = load i64, ptr %7, align 8, !tbaa !9
  %109 = load i64, ptr %6, align 8, !tbaa !9
  %110 = icmp ult i64 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %125

112:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %113 = call noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef 24)
  store ptr %113, ptr %8, align 8, !tbaa !5
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = load i64, ptr %5, align 8, !tbaa !9
  %117 = getelementptr inbounds i8, ptr %115, i64 %116
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %114, ptr align 1 %117, i64 24, i1 false)
  %118 = load i64, ptr %5, align 8, !tbaa !9
  %119 = add i64 %118, 24
  store i64 %119, ptr %5, align 8, !tbaa !9
  %120 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 12
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN5ArrayIP7Item_noE3addES1_(ptr noundef nonnull align 8 dereferenceable(24) %120, ptr noundef %121)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %122

122:                                              ; preds = %112
  %123 = load i64, ptr %7, align 8, !tbaa !9
  %124 = add i64 %123, 1
  store i64 %124, ptr %7, align 8, !tbaa !9
  br label %107, !llvm.loop !19

125:                                              ; preds = %111
  %126 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 13
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = load i64, ptr %5, align 8, !tbaa !9
  %129 = getelementptr inbounds i8, ptr %127, i64 %128
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %126, ptr align 1 %129, i64 1, i1 false)
  %130 = load i64, ptr %5, align 8, !tbaa !9
  %131 = add i64 %130, 1
  store i64 %131, ptr %5, align 8, !tbaa !9
  %132 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 14
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = load i64, ptr %5, align 8, !tbaa !9
  %135 = getelementptr inbounds i8, ptr %133, i64 %134
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %132, ptr align 1 %135, i64 1, i1 false)
  %136 = load i64, ptr %5, align 8, !tbaa !9
  %137 = add i64 %136, 1
  store i64 %137, ptr %5, align 8, !tbaa !9
  %138 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 15
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = load i64, ptr %5, align 8, !tbaa !9
  %141 = getelementptr inbounds i8, ptr %139, i64 %140
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %138, ptr align 1 %141, i64 8, i1 false)
  %142 = load i64, ptr %5, align 8, !tbaa !9
  %143 = add i64 %142, 8
  store i64 %143, ptr %5, align 8, !tbaa !9
  %144 = getelementptr inbounds %class.TPCCQueryMessage, ptr %9, i32 0, i32 16
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = load i64, ptr %5, align 8, !tbaa !9
  %147 = getelementptr inbounds i8, ptr %145, i64 %146
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %144, ptr align 1 %147, i64 8, i1 false)
  %148 = load i64, ptr %5, align 8, !tbaa !9
  %149 = add i64 %148, 8
  store i64 %149, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %150

150:                                              ; preds = %125, %95
  %151 = load i64, ptr %5, align 8, !tbaa !9
  %152 = load ptr, ptr %9, align 8, !tbaa !21
  %153 = getelementptr inbounds ptr, ptr %152, i64 2
  %154 = load ptr, ptr %153, align 8
  %155 = call noundef i64 %154(ptr noundef nonnull align 8 dereferenceable(280) %9)
  %156 = icmp eq i64 %151, %155
  br i1 %156, label %157, label %158

157:                                              ; preds = %150
  br label %160

158:                                              ; preds = %150
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 1535, ptr noundef @__PRETTY_FUNCTION__._ZN16TPCCQueryMessage13copy_from_bufEPc) #7
  unreachable

159:                                              ; No predecessors!
  br label %160

160:                                              ; preds = %159, %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn nounwind "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 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 = { 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 #5 = { "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 #6 = { nounwind }
attributes #7 = { noreturn 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 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 136}
!12 = !{!"_ZTS16TPCCQueryMessage", !13, i64 0, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !7, i64 200, !10, i64 216, !17, i64 224, !18, i64 232, !17, i64 256, !17, i64 257, !10, i64 264, !10, i64 272}
!13 = !{!"_ZTS12QueryMessage", !14, i64 0, !10, i64 120, !10, i64 128}
!14 = !{!"_ZTS7Message", !15, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !16, i64 64, !16, i64 72, !16, i64 80, !16, i64 88, !16, i64 96, !16, i64 104, !16, i64 112}
!15 = !{!"_ZTS10RemReqType", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"_ZTS5ArrayIP7Item_noE", !6, i64 0, !10, i64 8, !10, i64 16}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!22, !22, i64 0}
!22 = !{!"vtable pointer", !8, 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"

%class.mem_alloc = type { i8 }

@.str.1 = external hidden unnamed_addr constant [69 x i8], align 1
@mem_allocator = external global %class.mem_alloc, align 1
@.str.9 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [55 x i8], align 1
@__PRETTY_FUNCTION__._ZN16TPCCQueryMessage13copy_from_bufEPc = external hidden unnamed_addr constant [53 x i8], align 1

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN12QueryMessage8get_sizeEv(ptr noundef nonnull align 8 dereferenceable(136)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12QueryMessage13copy_from_bufEPc(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef) unnamed_addr #3 align 2

declare noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1), i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5ArrayIP7Item_noE4initEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5ArrayIP7Item_noE3addES1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN16TPCCQueryMessage13copy_from_bufEPc(ptr noundef nonnull align 8 dereferenceable(280) %0, ptr noundef %1) unnamed_addr #3 align 2 {
  tail call void @_ZN12QueryMessage13copy_from_bufEPc(ptr noundef nonnull align 8 dereferenceable(136) %0, ptr noundef %1)
  %3 = tail call noundef i64 @_ZN12QueryMessage8get_sizeEv(ptr noundef nonnull align 8 dereferenceable(136) %0)
  %4 = getelementptr inbounds i8, ptr %0, i64 136
  %5 = getelementptr inbounds i8, ptr %1, i64 %3
  %6 = load i64, ptr %5, align 1
  store i64 %6, ptr %4, align 8
  %.off = add i64 %6, -1
  %switch = icmp ult i64 %.off, 2
  br i1 %switch, label %.critedge, label %7

7:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 1500, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN16TPCCQueryMessage13copy_from_bufEPc) #5
  unreachable

.critedge:                                        ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 144
  %9 = getelementptr i8, ptr %5, i64 8
  %10 = load i64, ptr %9, align 1
  store i64 %10, ptr %8, align 8
  %11 = getelementptr inbounds i8, ptr %0, i64 152
  %12 = getelementptr i8, ptr %5, i64 16
  %13 = load i64, ptr %12, align 1
  store i64 %13, ptr %11, align 8
  %14 = getelementptr inbounds i8, ptr %0, i64 160
  %15 = getelementptr i8, ptr %5, i64 24
  %16 = load i64, ptr %15, align 1
  store i64 %16, ptr %14, align 8
  %17 = getelementptr inbounds i8, ptr %0, i64 168
  %18 = getelementptr i8, ptr %5, i64 32
  %19 = load i64, ptr %18, align 1
  store i64 %19, ptr %17, align 8
  %20 = add i64 %3, 40
  %21 = icmp eq i64 %6, 1
  br i1 %21, label %22, label %41

22:                                               ; preds = %.critedge
  %23 = getelementptr inbounds i8, ptr %0, i64 176
  %24 = getelementptr inbounds i8, ptr %1, i64 %20
  %25 = load i64, ptr %24, align 1
  store i64 %25, ptr %23, align 8
  %26 = getelementptr inbounds i8, ptr %0, i64 184
  %27 = getelementptr i8, ptr %5, i64 48
  %28 = load i64, ptr %27, align 1
  store i64 %28, ptr %26, align 8
  %29 = getelementptr inbounds i8, ptr %0, i64 192
  %30 = getelementptr i8, ptr %5, i64 56
  %31 = load i64, ptr %30, align 1
  store i64 %31, ptr %29, align 8
  %32 = getelementptr inbounds i8, ptr %0, i64 200
  %33 = getelementptr i8, ptr %5, i64 64
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 1 dereferenceable(16) %33, i64 16, i1 false)
  %34 = getelementptr inbounds i8, ptr %0, i64 216
  %35 = getelementptr i8, ptr %5, i64 80
  %36 = load i64, ptr %35, align 1
  store i64 %36, ptr %34, align 8
  %37 = getelementptr inbounds i8, ptr %0, i64 224
  %38 = getelementptr i8, ptr %5, i64 88
  %39 = load i8, ptr %38, align 1
  store i8 %39, ptr %37, align 8
  %40 = add i64 %3, 89
  br label %62

41:                                               ; preds = %.critedge
  %42 = getelementptr inbounds i8, ptr %1, i64 %20
  %.0.copyload = load i64, ptr %42, align 1
  %43 = add i64 %3, 48
  %44 = getelementptr inbounds i8, ptr %0, i64 232
  tail call void @_ZN5ArrayIP7Item_noE4initEm(ptr noundef nonnull align 8 dereferenceable(24) %44, i64 noundef %.0.copyload)
  %.not = icmp eq i64 %.0.copyload, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %41
  %.1.lcssa = phi i64 [ %43, %41 ], [ %60, %.lr.ph ]
  %45 = getelementptr inbounds i8, ptr %0, i64 256
  %46 = getelementptr inbounds i8, ptr %1, i64 %.1.lcssa
  %47 = load i8, ptr %46, align 1
  store i8 %47, ptr %45, align 8
  %48 = getelementptr inbounds i8, ptr %0, i64 257
  %49 = getelementptr i8, ptr %46, i64 1
  %50 = load i8, ptr %49, align 1
  store i8 %50, ptr %48, align 1
  %51 = getelementptr inbounds i8, ptr %0, i64 264
  %52 = getelementptr i8, ptr %46, i64 2
  %53 = load i64, ptr %52, align 1
  store i64 %53, ptr %51, align 8
  %54 = getelementptr inbounds i8, ptr %0, i64 272
  %55 = getelementptr i8, ptr %46, i64 10
  %56 = load i64, ptr %55, align 1
  store i64 %56, ptr %54, align 8
  %57 = add i64 %.1.lcssa, 18
  br label %62

.lr.ph:                                           ; preds = %41, %.lr.ph
  %.164 = phi i64 [ %60, %.lr.ph ], [ %43, %41 ]
  %.05963 = phi i64 [ %61, %.lr.ph ], [ 0, %41 ]
  %58 = tail call noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef 24)
  %59 = getelementptr inbounds i8, ptr %1, i64 %.164
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 1 dereferenceable(24) %59, i64 24, i1 false)
  %60 = add i64 %.164, 24
  tail call void @_ZN5ArrayIP7Item_noE3addES1_(ptr noundef nonnull align 8 dereferenceable(24) %44, ptr noundef %58)
  %61 = add nuw i64 %.05963, 1
  %exitcond.not = icmp eq i64 %61, %.0.copyload
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !5

62:                                               ; preds = %22, %._crit_edge
  %.2 = phi i64 [ %57, %._crit_edge ], [ %40, %22 ]
  %63 = load ptr, ptr %0, align 8, !tbaa !7
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  %65 = load ptr, ptr %64, align 8
  %66 = tail call noundef i64 %65(ptr noundef nonnull align 8 dereferenceable(280) %0)
  %67 = icmp eq i64 %.2, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %62
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 1535, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN16TPCCQueryMessage13copy_from_bufEPc) #5
  unreachable

69:                                               ; preds = %62
  ret void
}

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "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 = { 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 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 = { "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 #5 = { noreturn 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"vtable pointer", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}


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