; LLVM IR from gem5/gem5 :: src/systemc/tlm_core/2/generic_payload (gp)

; 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.tlm::tlm_generic_payload" = type <{ ptr, i64, i32, [4 x i8], ptr, i32, i32, i8, [7 x i8], ptr, i32, i32, i32, [4 x i8], %"class.tlm::tlm_array", ptr, i32, [4 x i8] }>
%"class.tlm::tlm_array" = type { %"class.std::vector", %"class.std::vector.0" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<tlm::tlm_extension_base *, std::allocator<tlm::tlm_extension_base *>>::_Vector_impl" }
%"struct.std::_Vector_base<tlm::tlm_extension_base *, std::allocator<tlm::tlm_extension_base *>>::_Vector_impl" = type { %"struct.std::_Vector_base<tlm::tlm_extension_base *, std::allocator<tlm::tlm_extension_base *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<tlm::tlm_extension_base *, std::allocator<tlm::tlm_extension_base *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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 noundef i32 @_ZNK3tlm19tlm_generic_payload19get_response_statusEv(ptr noundef nonnull align 8 dereferenceable(132)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3tlm19tlm_generic_payload14is_dmi_allowedEv(ptr noundef nonnull align 8 dereferenceable(132)) #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 @_ZN3tlm19tlm_generic_payload20update_original_fromERKS0_b(ptr noundef nonnull align 8 dereferenceable(132) %0, ptr noundef nonnull align 8 dereferenceable(132) %1, i1 noundef zeroext %2) #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %10 = zext i1 %2 to i8
  store i8 %10, ptr %6, align 1, !tbaa !9
  %11 = load ptr, ptr %4, align 8
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN3tlm19tlm_generic_payload22update_extensions_fromERKS0_(ptr noundef nonnull align 8 dereferenceable(132) %11, ptr noundef nonnull align 8 dereferenceable(132) %12)
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = call noundef i32 @_ZNK3tlm19tlm_generic_payload19get_response_statusEv(ptr noundef nonnull align 8 dereferenceable(132) %13)
  %15 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 6
  store i32 %14, ptr %15, align 4, !tbaa !11
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = call noundef zeroext i1 @_ZNK3tlm19tlm_generic_payload14is_dmi_allowedEv(ptr noundef nonnull align 8 dereferenceable(132) %16)
  %18 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 7
  %19 = zext i1 %17 to i8
  store i8 %19, ptr %18, align 8, !tbaa !27
  %20 = call noundef zeroext i1 @_ZNK3tlm19tlm_generic_payload7is_readEv(ptr noundef nonnull align 8 dereferenceable(132) %11)
  br i1 %20, label %21, label %192

21:                                               ; preds = %3
  %22 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 4
  %23 = load ptr, ptr %22, align 8, !tbaa !28
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %192

25:                                               ; preds = %21
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %26, i32 0, i32 4
  %28 = load ptr, ptr %27, align 8, !tbaa !28
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %192

30:                                               ; preds = %25
  %31 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 4
  %32 = load ptr, ptr %31, align 8, !tbaa !28
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %33, i32 0, i32 4
  %35 = load ptr, ptr %34, align 8, !tbaa !28
  %36 = icmp ne ptr %32, %35
  br i1 %36, label %37, label %192

37:                                               ; preds = %30
  %38 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 9
  %39 = load ptr, ptr %38, align 8, !tbaa !29
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %182

41:                                               ; preds = %37
  %42 = load i8, ptr %6, align 1, !tbaa !9, !range !30, !noundef !31
  %43 = trunc i8 %42 to i1
  br i1 %43, label %44, label %182

44:                                               ; preds = %41
  %45 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 10
  %46 = load i32, ptr %45, align 8, !tbaa !32
  %47 = icmp eq i32 %46, 8
  br i1 %47, label %48, label %94

48:                                               ; preds = %44
  %49 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 5
  %50 = load i32, ptr %49, align 8, !tbaa !33
  %51 = urem i32 %50, 8
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %53, label %94

53:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !34
  br label %54

54:                                               ; preds = %90, %53
  %55 = load i32, ptr %7, align 4, !tbaa !34
  %56 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 5
  %57 = load i32, ptr %56, align 8, !tbaa !33
  %58 = icmp ult i32 %55, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %93

60:                                               ; preds = %54
  %61 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 9
  %62 = load ptr, ptr %61, align 8, !tbaa !29
  %63 = load i64, ptr %62, align 8, !tbaa !35
  %64 = xor i64 %63, -1
  %65 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 4
  %66 = load ptr, ptr %65, align 8, !tbaa !28
  %67 = load i32, ptr %7, align 4, !tbaa !34
  %68 = zext i32 %67 to i64
  %69 = getelementptr inbounds i8, ptr %66, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !35
  %71 = and i64 %70, %64
  store i64 %71, ptr %69, align 8, !tbaa !35
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %72, i32 0, i32 4
  %74 = load ptr, ptr %73, align 8, !tbaa !28
  %75 = load i32, ptr %7, align 4, !tbaa !34
  %76 = zext i32 %75 to i64
  %77 = getelementptr inbounds i8, ptr %74, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !35
  %79 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 9
  %80 = load ptr, ptr %79, align 8, !tbaa !29
  %81 = load i64, ptr %80, align 8, !tbaa !35
  %82 = and i64 %78, %81
  %83 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 4
  %84 = load ptr, ptr %83, align 8, !tbaa !28
  %85 = load i32, ptr %7, align 4, !tbaa !34
  %86 = zext i32 %85 to i64
  %87 = getelementptr inbounds i8, ptr %84, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !35
  %89 = or i64 %88, %82
  store i64 %89, ptr %87, align 8, !tbaa !35
  br label %90

90:                                               ; preds = %60
  %91 = load i32, ptr %7, align 4, !tbaa !34
  %92 = add i32 %91, 8
  store i32 %92, ptr %7, align 4, !tbaa !34
  br label %54, !llvm.loop !36

93:                                               ; preds = %59
  br label %181

94:                                               ; preds = %48, %44
  %95 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 10
  %96 = load i32, ptr %95, align 8, !tbaa !32
  %97 = icmp eq i32 %96, 4
  br i1 %97, label %98, label %144

98:                                               ; preds = %94
  %99 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 5
  %100 = load i32, ptr %99, align 8, !tbaa !33
  %101 = urem i32 %100, 4
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %103, label %144

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !34
  br label %104

104:                                              ; preds = %140, %103
  %105 = load i32, ptr %8, align 4, !tbaa !34
  %106 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 5
  %107 = load i32, ptr %106, align 8, !tbaa !33
  %108 = icmp ult i32 %105, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %143

110:                                              ; preds = %104
  %111 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 9
  %112 = load ptr, ptr %111, align 8, !tbaa !29
  %113 = load i32, ptr %112, align 4, !tbaa !34
  %114 = xor i32 %113, -1
  %115 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 4
  %116 = load ptr, ptr %115, align 8, !tbaa !28
  %117 = load i32, ptr %8, align 4, !tbaa !34
  %118 = zext i32 %117 to i64
  %119 = getelementptr inbounds i8, ptr %116, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !34
  %121 = and i32 %120, %114
  store i32 %121, ptr %119, align 4, !tbaa !34
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %122, i32 0, i32 4
  %124 = load ptr, ptr %123, align 8, !tbaa !28
  %125 = load i32, ptr %8, align 4, !tbaa !34
  %126 = zext i32 %125 to i64
  %127 = getelementptr inbounds i8, ptr %124, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !34
  %129 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 9
  %130 = load ptr, ptr %129, align 8, !tbaa !29
  %131 = load i32, ptr %130, align 4, !tbaa !34
  %132 = and i32 %128, %131
  %133 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 4
  %134 = load ptr, ptr %133, align 8, !tbaa !28
  %135 = load i32, ptr %8, align 4, !tbaa !34
  %136 = zext i32 %135 to i64
  %137 = getelementptr inbounds i8, ptr %134, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !34
  %139 = or i32 %138, %132
  store i32 %139, ptr %137, align 4, !tbaa !34
  br label %140

140:                                              ; preds = %110
  %141 = load i32, ptr %8, align 4, !tbaa !34
  %142 = add i32 %141, 4
  store i32 %142, ptr %8, align 4, !tbaa !34
  br label %104, !llvm.loop !38

143:                                              ; preds = %109
  br label %180

144:                                              ; preds = %98, %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !34
  br label %145

145:                                              ; preds = %176, %144
  %146 = load i32, ptr %9, align 4, !tbaa !34
  %147 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 5
  %148 = load i32, ptr %147, align 8, !tbaa !33
  %149 = icmp ult i32 %146, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %145
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %179

151:                                              ; preds = %145
  %152 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 9
  %153 = load ptr, ptr %152, align 8, !tbaa !29
  %154 = load i32, ptr %9, align 4, !tbaa !34
  %155 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 10
  %156 = load i32, ptr %155, align 8, !tbaa !32
  %157 = urem i32 %154, %156
  %158 = zext i32 %157 to i64
  %159 = getelementptr inbounds i8, ptr %153, i64 %158
  %160 = load i8, ptr %159, align 1, !tbaa !39
  %161 = icmp ne i8 %160, 0
  br i1 %161, label %162, label %175

162:                                              ; preds = %151
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %163, i32 0, i32 4
  %165 = load ptr, ptr %164, align 8, !tbaa !28
  %166 = load i32, ptr %9, align 4, !tbaa !34
  %167 = zext i32 %166 to i64
  %168 = getelementptr inbounds i8, ptr %165, i64 %167
  %169 = load i8, ptr %168, align 1, !tbaa !39
  %170 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 4
  %171 = load ptr, ptr %170, align 8, !tbaa !28
  %172 = load i32, ptr %9, align 4, !tbaa !34
  %173 = zext i32 %172 to i64
  %174 = getelementptr inbounds i8, ptr %171, i64 %173
  store i8 %169, ptr %174, align 1, !tbaa !39
  br label %175

175:                                              ; preds = %162, %151
  br label %176

176:                                              ; preds = %175
  %177 = load i32, ptr %9, align 4, !tbaa !34
  %178 = add i32 %177, 1
  store i32 %178, ptr %9, align 4, !tbaa !34
  br label %145, !llvm.loop !40

179:                                              ; preds = %150
  br label %180

180:                                              ; preds = %179, %143
  br label %181

181:                                              ; preds = %180, %93
  br label %191

182:                                              ; preds = %41, %37
  %183 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 4
  %184 = load ptr, ptr %183, align 8, !tbaa !28
  %185 = load ptr, ptr %5, align 8, !tbaa !5
  %186 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %185, i32 0, i32 4
  %187 = load ptr, ptr %186, align 8, !tbaa !28
  %188 = getelementptr inbounds %"class.tlm::tlm_generic_payload", ptr %11, i32 0, i32 5
  %189 = load i32, ptr %188, align 8, !tbaa !33
  %190 = zext i32 %189 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %184, ptr align 1 %187, i64 %190, i1 false)
  br label %191

191:                                              ; preds = %182, %181
  br label %192

192:                                              ; preds = %191, %30, %25, %21, %3
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3tlm19tlm_generic_payload7is_readEv(ptr noundef nonnull align 8 dereferenceable(132)) #1 align 2

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, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !16, i64 36}
!12 = !{!"_ZTSN3tlm19tlm_generic_payloadE", !13, i64 8, !14, i64 16, !6, i64 24, !15, i64 32, !16, i64 36, !10, i64 40, !6, i64 48, !15, i64 56, !15, i64 60, !17, i64 64, !18, i64 72, !6, i64 120, !15, i64 128}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_ZTSN3tlm11tlm_commandE", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSN3tlm19tlm_response_statusE", !7, i64 0}
!17 = !{!"_ZTSN3tlm13tlm_gp_optionE", !7, i64 0}
!18 = !{!"_ZTSN3tlm9tlm_arrayIPNS_18tlm_extension_baseEEE", !19, i64 0, !23, i64 24}
!19 = !{!"_ZTSSt6vectorIPN3tlm18tlm_extension_baseESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIPN3tlm18tlm_extension_baseESaIS2_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIPN3tlm18tlm_extension_baseESaIS2_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIPN3tlm18tlm_extension_baseESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTSSt6vectorImSaImEE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseImSaImEE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseImSaImEE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseImSaImEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!12, !10, i64 40}
!28 = !{!12, !6, i64 24}
!29 = !{!12, !6, i64 48}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = !{!12, !15, i64 56}
!33 = !{!12, !15, i64 32}
!34 = !{!15, !15, i64 0}
!35 = !{!13, !13, i64 0}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = distinct !{!38, !37}
!39 = !{!7, !7, i64 0}
!40 = distinct !{!40, !37}


; 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 nounwind uwtable
declare dso_local noundef i32 @_ZNK3tlm19tlm_generic_payload19get_response_statusEv(ptr noundef nonnull align 8 dereferenceable(132)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3tlm19tlm_generic_payload14is_dmi_allowedEv(ptr noundef nonnull align 8 dereferenceable(132)) 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 @_ZN3tlm19tlm_generic_payload20update_original_fromERKS0_b(ptr noundef nonnull align 8 dereferenceable(132) %0, ptr noundef nonnull align 8 dereferenceable(132) %1, i1 noundef zeroext %2) local_unnamed_addr #2 align 2 {
  tail call void @_ZN3tlm19tlm_generic_payload22update_extensions_fromERKS0_(ptr noundef nonnull align 8 dereferenceable(132) %0, ptr noundef nonnull align 8 dereferenceable(132) %1)
  %4 = tail call noundef i32 @_ZNK3tlm19tlm_generic_payload19get_response_statusEv(ptr noundef nonnull align 8 dereferenceable(132) %1)
  %5 = getelementptr inbounds i8, ptr %0, i64 36
  store i32 %4, ptr %5, align 4, !tbaa !5
  %6 = tail call noundef zeroext i1 @_ZNK3tlm19tlm_generic_payload14is_dmi_allowedEv(ptr noundef nonnull align 8 dereferenceable(132) %1)
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  %8 = zext i1 %6 to i8
  store i8 %8, ptr %7, align 8, !tbaa !25
  %9 = tail call noundef zeroext i1 @_ZNK3tlm19tlm_generic_payload7is_readEv(ptr noundef nonnull align 8 dereferenceable(132) %0)
  br i1 %9, label %10, label %.loopexit

10:                                               ; preds = %3
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  %12 = load ptr, ptr %11, align 8, !tbaa !26
  %.not = icmp eq ptr %12, null
  br i1 %.not, label %.loopexit, label %13

13:                                               ; preds = %10
  %14 = getelementptr inbounds i8, ptr %1, i64 24
  %15 = load ptr, ptr %14, align 8, !tbaa !26
  %.not29 = icmp eq ptr %15, null
  %.not30 = icmp eq ptr %12, %15
  %or.cond = or i1 %.not29, %.not30
  br i1 %or.cond, label %.loopexit, label %16

16:                                               ; preds = %13
  %17 = getelementptr inbounds i8, ptr %0, i64 48
  %18 = load ptr, ptr %17, align 8, !tbaa !27
  %.not31 = icmp ne ptr %18, null
  %brmerge.not = and i1 %.not31, %2
  br i1 %brmerge.not, label %19, label %89

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %0, i64 56
  %21 = load i32, ptr %20, align 8, !tbaa !28
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 32
  %.pre = load i32, ptr %.phi.trans.insert, align 8, !tbaa !29
  switch i32 %21, label %.thread [
    i32 8, label %22
    i32 4, label %53
  ]

22:                                               ; preds = %19
  %23 = and i32 %.pre, 7
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %.preheader, label %.lr.ph41.preheader

.preheader:                                       ; preds = %22
  %.not43 = icmp eq i32 %.pre, 0
  br i1 %.not43, label %.loopexit, label %.lr.ph39.preheader

.lr.ph39.preheader:                               ; preds = %.preheader
  %25 = zext i32 %.pre to i64
  %26 = add nsw i64 %25, -1
  %27 = lshr i64 %26, 3
  %28 = add nuw nsw i64 %27, 1
  %min.iters.check = icmp ult i32 %.pre, 73
  br i1 %min.iters.check, label %.lr.ph39.preheader65, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph39.preheader
  %29 = add nsw i64 %25, -1
  %30 = and i64 %29, -8
  %31 = add nsw i64 %30, 8
  %scevgep = getelementptr i8, ptr %12, i64 %31
  %scevgep57 = getelementptr i8, ptr %18, i64 8
  %scevgep58 = getelementptr i8, ptr %15, i64 %31
  %bound0 = icmp ult ptr %12, %scevgep57
  %bound1 = icmp ult ptr %18, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound059 = icmp ult ptr %12, %scevgep58
  %bound160 = icmp ult ptr %15, %scevgep
  %found.conflict61 = and i1 %bound059, %bound160
  %conflict.rdx = or i1 %found.conflict, %found.conflict61
  br i1 %conflict.rdx, label %.lr.ph39.preheader65, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %28, 4611686018427387902
  %ind.end = shl i64 %n.vec, 3
  %32 = load i64, ptr %18, align 8, !tbaa !30, !alias.scope !31
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %32, i64 0
  %33 = xor <2 x i64> %broadcast.splatinsert, <i64 -1, i64 poison>
  %34 = shufflevector <2 x i64> %33, <2 x i64> poison, <2 x i32> zeroinitializer
  %35 = load i64, ptr %18, align 8, !tbaa !30, !alias.scope !31
  %broadcast.splatinsert63 = insertelement <2 x i64> poison, i64 %35, i64 0
  %broadcast.splat64 = shufflevector <2 x i64> %broadcast.splatinsert63, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = shl i64 %index, 3
  %36 = getelementptr inbounds i8, ptr %12, i64 %offset.idx
  %wide.load = load <2 x i64>, ptr %36, align 8, !tbaa !30, !alias.scope !34, !noalias !36
  %37 = and <2 x i64> %wide.load, %34
  store <2 x i64> %37, ptr %36, align 8, !tbaa !30, !alias.scope !34, !noalias !36
  %38 = getelementptr inbounds i8, ptr %15, i64 %offset.idx
  %wide.load62 = load <2 x i64>, ptr %38, align 8, !tbaa !30, !alias.scope !38
  %39 = and <2 x i64> %broadcast.splat64, %wide.load62
  %40 = or <2 x i64> %39, %37
  store <2 x i64> %40, ptr %36, align 8, !tbaa !30, !alias.scope !34, !noalias !36
  %index.next = add nuw i64 %index, 2
  %41 = icmp eq i64 %index.next, %n.vec
  br i1 %41, label %middle.block, label %vector.body, !llvm.loop !39

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %28, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph39.preheader65

.lr.ph39.preheader65:                             ; preds = %middle.block, %vector.memcheck, %.lr.ph39.preheader
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph39.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph39

.lr.ph39:                                         ; preds = %.lr.ph39.preheader65, %.lr.ph39
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph39 ], [ %indvars.iv.ph, %.lr.ph39.preheader65 ]
  %42 = load i64, ptr %18, align 8, !tbaa !30
  %43 = xor i64 %42, -1
  %44 = getelementptr inbounds i8, ptr %12, i64 %indvars.iv
  %45 = load i64, ptr %44, align 8, !tbaa !30
  %46 = and i64 %45, %43
  store i64 %46, ptr %44, align 8, !tbaa !30
  %47 = getelementptr inbounds i8, ptr %15, i64 %indvars.iv
  %48 = load i64, ptr %47, align 8, !tbaa !30
  %49 = load i64, ptr %18, align 8, !tbaa !30
  %50 = and i64 %49, %48
  %51 = or i64 %50, %46
  store i64 %51, ptr %44, align 8, !tbaa !30
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 8
  %52 = icmp ult i64 %indvars.iv.next, %25
  br i1 %52, label %.lr.ph39, label %.loopexit, !llvm.loop !43

53:                                               ; preds = %19
  %54 = and i32 %.pre, 3
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %.preheader35, label %.lr.ph41.preheader

.preheader35:                                     ; preds = %53
  %.not42 = icmp eq i32 %.pre, 0
  br i1 %.not42, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader35, %.lr.ph
  %.02537 = phi i32 [ %67, %.lr.ph ], [ 0, %.preheader35 ]
  %56 = load i32, ptr %18, align 4, !tbaa !44
  %57 = xor i32 %56, -1
  %58 = zext i32 %.02537 to i64
  %59 = getelementptr inbounds i8, ptr %12, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !44
  %61 = and i32 %60, %57
  store i32 %61, ptr %59, align 4, !tbaa !44
  %62 = getelementptr inbounds i8, ptr %15, i64 %58
  %63 = load i32, ptr %62, align 4, !tbaa !44
  %64 = load i32, ptr %18, align 4, !tbaa !44
  %65 = and i32 %64, %63
  %66 = or i32 %65, %61
  store i32 %66, ptr %59, align 4, !tbaa !44
  %67 = add i32 %.02537, 4
  %68 = load i32, ptr %.phi.trans.insert, align 8, !tbaa !29
  %69 = icmp ult i32 %67, %68
  br i1 %69, label %.lr.ph, label %.loopexit, !llvm.loop !45

.thread:                                          ; preds = %19
  %.not44 = icmp eq i32 %.pre, 0
  br i1 %.not44, label %.loopexit, label %.lr.ph41.preheader

.lr.ph41.preheader:                               ; preds = %53, %22, %.thread
  %70 = getelementptr inbounds i8, ptr %0, i64 32
  br label %.lr.ph41

.lr.ph41:                                         ; preds = %.lr.ph41.preheader, %85
  %71 = phi i32 [ %.pre, %.lr.ph41.preheader ], [ %86, %85 ]
  %indvars.iv48 = phi i64 [ 0, %.lr.ph41.preheader ], [ %indvars.iv.next49, %85 ]
  %72 = load ptr, ptr %17, align 8, !tbaa !27
  %73 = load i32, ptr %20, align 8, !tbaa !28
  %74 = trunc nuw i64 %indvars.iv48 to i32
  %75 = urem i32 %74, %73
  %76 = zext i32 %75 to i64
  %77 = getelementptr inbounds i8, ptr %72, i64 %76
  %78 = load i8, ptr %77, align 1, !tbaa !46
  %.not32 = icmp eq i8 %78, 0
  br i1 %.not32, label %85, label %79

79:                                               ; preds = %.lr.ph41
  %80 = load ptr, ptr %14, align 8, !tbaa !26
  %81 = getelementptr inbounds i8, ptr %80, i64 %indvars.iv48
  %82 = load i8, ptr %81, align 1, !tbaa !46
  %83 = load ptr, ptr %11, align 8, !tbaa !26
  %84 = getelementptr inbounds i8, ptr %83, i64 %indvars.iv48
  store i8 %82, ptr %84, align 1, !tbaa !46
  %.pre51 = load i32, ptr %70, align 8, !tbaa !29
  br label %85

85:                                               ; preds = %.lr.ph41, %79
  %86 = phi i32 [ %71, %.lr.ph41 ], [ %.pre51, %79 ]
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %87 = zext i32 %86 to i64
  %88 = icmp ult i64 %indvars.iv.next49, %87
  br i1 %88, label %.lr.ph41, label %.loopexit, !llvm.loop !47

89:                                               ; preds = %16
  %90 = getelementptr inbounds i8, ptr %0, i64 32
  %91 = load i32, ptr %90, align 8, !tbaa !29
  %92 = zext i32 %91 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %12, ptr nonnull align 1 %15, i64 %92, i1 false)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %.lr.ph39, %85, %middle.block, %.preheader35, %.preheader, %.thread, %89, %13, %10, %3
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3tlm19tlm_generic_payload7is_readEv(ptr noundef nonnull align 8 dereferenceable(132)) local_unnamed_addr #0 align 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, !13, i64 36}
!6 = !{!"_ZTSN3tlm19tlm_generic_payloadE", !7, i64 8, !10, i64 16, !11, i64 24, !12, i64 32, !13, i64 36, !14, i64 40, !11, i64 48, !12, i64 56, !12, i64 60, !15, i64 64, !16, i64 72, !11, i64 120, !12, i64 128}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN3tlm11tlm_commandE", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_ZTSN3tlm19tlm_response_statusE", !8, i64 0}
!14 = !{!"bool", !8, i64 0}
!15 = !{!"_ZTSN3tlm13tlm_gp_optionE", !8, i64 0}
!16 = !{!"_ZTSN3tlm9tlm_arrayIPNS_18tlm_extension_baseEEE", !17, i64 0, !21, i64 24}
!17 = !{!"_ZTSSt6vectorIPN3tlm18tlm_extension_baseESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIPN3tlm18tlm_extension_baseESaIS2_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIPN3tlm18tlm_extension_baseESaIS2_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIPN3tlm18tlm_extension_baseESaIS2_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!21 = !{!"_ZTSSt6vectorImSaImEE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseImSaImEE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseImSaImEE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseImSaImEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!25 = !{!6, !14, i64 40}
!26 = !{!6, !11, i64 24}
!27 = !{!6, !11, i64 48}
!28 = !{!6, !12, i64 56}
!29 = !{!6, !12, i64 32}
!30 = !{!7, !7, i64 0}
!31 = !{!32}
!32 = distinct !{!32, !33}
!33 = distinct !{!33, !"LVerDomain"}
!34 = !{!35}
!35 = distinct !{!35, !33}
!36 = !{!32, !37}
!37 = distinct !{!37, !33}
!38 = !{!37}
!39 = distinct !{!39, !40, !41, !42}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{!"llvm.loop.isvectorized", i32 1}
!42 = !{!"llvm.loop.unroll.runtime.disable"}
!43 = distinct !{!43, !40, !41}
!44 = !{!12, !12, i64 0}
!45 = distinct !{!45, !40}
!46 = !{!8, !8, i64 0}
!47 = distinct !{!47, !40}


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