; LLVM IR from sfu-dis/mosaicdb :: benchmarks/egen/TradeGen.ll (ZN4TPCE9CTradeGen23GenerateTradeCommissionEv)

; 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.TPCE::CMoney" = type { i64 }
%"class.TPCE::CTradeGen" = type <{ %"class.TPCE::CRandom", %"class.TPCE::CAddressTable", %"class.TPCE::CCustomerSelection", %"class.TPCE::CCustomerTable", %"class.TPCE::CCustomerTaxratesTable", %"class.TPCE::CCustomerAccountsAndPermissionsTable", %"class.TPCE::CHoldingsAndTradesTable", %"class.TPCE::CBrokersTable", %"class.TPCE::CSecurityTable", %"class.TPCE::CPerson", ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64, i32, i32, i32, i32, double, double, %"class.TPCE::CDateTime", double, %"class.std::priority_queue", i64, i64, i64, i32, [4 x i8], ptr, %"struct.TPCE::TTradeInfo", %"struct.TPCE::TAdditionalTradeInfo", %"struct.TPCE::TTradeRow", %"struct.TPCE::HOLDING_ROW", %"struct.TPCE::HOLDING_SUMMARY_ROW", i32, i32, i32, i32, %"class.TPCE::CMEESecurity", i32, i32, %"struct.std::_List_iterator", i32, i32, i64, i32, [4 x i8] }>
%"class.TPCE::CRandom" = type { i64 }
%"class.TPCE::CAddressTable" = type { %"class.TPCE::TableTemplate", %"class.TPCE::CDateTime", ptr, ptr, ptr, ptr, i64, i64, i8, i8, i64, i32, i64, i8, i32, i64, ptr }
%"class.TPCE::TableTemplate" = type { ptr, %"struct.TPCE::ADDRESS_ROW", i64, i8, %"class.TPCE::CRandom" }
%"struct.TPCE::ADDRESS_ROW" = type { i64, [81 x i8], [81 x i8], [13 x i8], [81 x i8] }
%"class.TPCE::CCustomerSelection" = type { ptr, i64, i64, i8, i32, i64, i64 }
%"class.TPCE::CCustomerTable" = type { %"class.TPCE::TableTemplate.0", i64, %"class.TPCE::CPerson", ptr, i64, i64, i64, i32, ptr, %"class.TPCE::CCustomerSelection" }
%"class.TPCE::TableTemplate.0" = type { ptr, %"struct.TPCE::CUSTOMER_ROW", i64, i8, %"class.TPCE::CRandom" }
%"struct.TPCE::CUSTOMER_ROW" = type <{ i64, [21 x i8], [5 x i8], [26 x i8], [21 x i8], [2 x i8], i8, i8, [3 x i8], %"class.TPCE::CDateTime", i64, [4 x i8], [4 x i8], [11 x i8], [6 x i8], [4 x i8], [4 x i8], [11 x i8], [6 x i8], [4 x i8], [4 x i8], [11 x i8], [6 x i8], [51 x i8], [51 x i8], [7 x i8] }>
%"class.TPCE::CCustomerTaxratesTable" = type { %"class.TPCE::TableTemplate.1", %"class.TPCE::CCustomerTable", %"class.TPCE::CAddressTable", ptr, ptr }
%"class.TPCE::TableTemplate.1" = type { ptr, %"struct.TPCE::CUSTOMER_TAXRATE_ROWS", i64, i8, %"class.TPCE::CRandom" }
%"struct.TPCE::CUSTOMER_TAXRATE_ROWS" = type { [2 x %"struct.TPCE::CUSTOMER_TAXRATE_ROW"] }
%"struct.TPCE::CUSTOMER_TAXRATE_ROW" = type { [5 x i8], i64 }
%"class.TPCE::CCustomerAccountsAndPermissionsTable" = type { %"class.TPCE::TableTemplate.2", ptr, ptr, i64, i64, i64, i32, i32, %"class.TPCE::CCustomerTable", %"class.TPCE::CPerson", i32, i64, %"class.TPCE::CAddressTable", i32, %"class.TPCE::CCustomerSelection", i8, i32, i64, ptr, i32, i64, ptr }
%"class.TPCE::TableTemplate.2" = type { ptr, %"struct.TPCE::CUSTOMER_ACCOUNT_AND_PERMISSION_ROW", i64, i8, %"class.TPCE::CRandom" }
%"struct.TPCE::CUSTOMER_ACCOUNT_AND_PERMISSION_ROW" = type { %"struct.TPCE::CUSTOMER_ACCOUNT_ROW", [4 x %"struct.TPCE::ACCOUNT_PERMISSION_ROW"] }
%"struct.TPCE::CUSTOMER_ACCOUNT_ROW" = type { i64, i64, i64, [51 x i8], i8, double }
%"struct.TPCE::ACCOUNT_PERMISSION_ROW" = type { i64, [5 x i8], [21 x i8], [26 x i8], [21 x i8] }
%"class.TPCE::CHoldingsAndTradesTable" = type { %"class.TPCE::CRandom", %"class.TPCE::CCustomerAccountsAndPermissionsTable", i64, i32, [18 x i64], i8, i64, i32, ptr, i64, i32, ptr }
%"class.TPCE::CBrokersTable" = type { %"class.TPCE::TableTemplate.3", i64, i64, i64, %"class.TPCE::CPerson", ptr, ptr, ptr }
%"class.TPCE::TableTemplate.3" = type { ptr, %"struct.TPCE::BROKER_ROW", i64, i8, %"class.TPCE::CRandom" }
%"struct.TPCE::BROKER_ROW" = type { i64, [5 x i8], [50 x i8], i32, double }
%"class.TPCE::CSecurityTable" = type { %"class.TPCE::TableTemplate.4", i64, i64, ptr, ptr, %"class.TPCE::CDateTime", i32, i32, i32, i64 }
%"class.TPCE::TableTemplate.4" = type { ptr, %"struct.TPCE::SECURITY_ROW", i64, i8, %"class.TPCE::CRandom" }
%"struct.TPCE::SECURITY_ROW" = type { [16 x i8], [7 x i8], [5 x i8], [71 x i8], [7 x i8], i64, i64, %"class.TPCE::CDateTime", %"class.TPCE::CDateTime", double, float, %"class.TPCE::CDateTime", float, %"class.TPCE::CDateTime", double, double }
%"class.TPCE::CPerson" = type { ptr, ptr, ptr, %"class.TPCE::CRandom", i8, i32, i64, ptr, ptr }
%"class.TPCE::CDateTime" = type { i32, i32, ptr }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<TPCE::TTradeInfo, std::allocator<TPCE::TTradeInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<TPCE::TTradeInfo, std::allocator<TPCE::TTradeInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<TPCE::TTradeInfo, std::allocator<TPCE::TTradeInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<TPCE::TTradeInfo, std::allocator<TPCE::TTradeInfo>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.TPCE::TTradeInfo" = type <{ i64, i32, i32, double, double, double, i64, i32, i32, %"class.TPCE::CMoney", %"class.TPCE::CMoney", i64, i32, [4 x i8], i64, i8, [7 x i8] }>
%"struct.TPCE::TAdditionalTradeInfo" = type { %"class.TPCE::CMoney", %"class.TPCE::CMoney", i64, i32, %"class.TPCE::CMoney", %"class.TPCE::CMoney", %"class.TPCE::CMoney", %"class.TPCE::CMoney" }
%"struct.TPCE::TTradeRow" = type { %"struct.TPCE::TRADE_ROW", %"struct.TPCE::TRADE_REQUEST_ROW", [3 x %"struct.TPCE::TRADE_HISTORY_ROW"], %"struct.TPCE::SETTLEMENT_ROW", %"struct.TPCE::CASH_TRANSACTION_ROW", [8 x %"struct.TPCE::HOLDING_HISTORY_ROW"] }
%"struct.TPCE::TRADE_ROW" = type <{ i64, %"class.TPCE::CDateTime", [5 x i8], [4 x i8], i8, [16 x i8], [2 x i8], i32, double, i64, [50 x i8], [6 x i8], double, double, double, double, i8, [7 x i8] }>
%"struct.TPCE::TRADE_REQUEST_ROW" = type { i64, [4 x i8], [16 x i8], i32, double, i64 }
%"struct.TPCE::TRADE_HISTORY_ROW" = type <{ i64, %"class.TPCE::CDateTime", [5 x i8], [3 x i8] }>
%"struct.TPCE::SETTLEMENT_ROW" = type { i64, [41 x i8], %"class.TPCE::CDateTime", double }
%"struct.TPCE::CASH_TRANSACTION_ROW" = type <{ i64, %"class.TPCE::CDateTime", double, [101 x i8], [3 x i8] }>
%"struct.TPCE::HOLDING_HISTORY_ROW" = type { i64, i64, i32, i32 }
%"struct.TPCE::HOLDING_ROW" = type <{ i64, i64, [16 x i8], %"class.TPCE::CDateTime", double, i32, [4 x i8] }>
%"struct.TPCE::HOLDING_SUMMARY_ROW" = type { i64, [16 x i8], i32 }
%"class.TPCE::CMEESecurity" = type { %"class.TPCE::CRandom", %"class.TPCE::CMoney", %"class.TPCE::CMoney", %"class.TPCE::CMoney", i32, i32, ptr, ptr, double }
%"struct.std::_List_iterator" = type { ptr }
%"struct.TPCE::COMMISSION_RATE_ROW" = type { %"struct.TPCE::TBaseInputRow", i32, [4 x i8], [7 x i8], double, double, double }
%"struct.TPCE::TBaseInputRow" = type { ptr }
%"struct.TPCE::TRADE_TYPE_ROW" = type { [4 x i8], [13 x i8], i8, i8 }
%"struct.TPCE::TSecurityInputRow" = type { %"struct.TPCE::TBaseInputRow", i64, [7 x i8], [5 x i8], [16 x i8], [7 x i8], i64 }

@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@__PRETTY_FUNCTION__._ZN4TPCE9CTradeGen23GenerateTradeCommissionEv = external hidden unnamed_addr constant [48 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4TPCE9CTradeGen18GetCurrentTradeQtyEv(ptr noundef nonnull align 8 dereferenceable(7356)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4TPCE9CTradeGen19GetCurrentTradeTypeEv(ptr noundef nonnull align 8 dereferenceable(7356)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i64 @_ZN4TPCE9CTradeGen20GetCurrentTradePriceEv(ptr noundef nonnull align 8 dereferenceable(7356)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4TPCE9CTradeGen23GetCurrentSecurityIndexEv(ptr noundef nonnull align 8 dereferenceable(7356)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4TPCE9CTradeGen23GenerateTradeCommissionEv(ptr noundef nonnull align 8 dereferenceable(7356) %0) #4 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca double, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %"class.TPCE::CMoney", align 8
  %18 = alloca %"class.TPCE::CMoney", align 8
  %19 = alloca %"class.TPCE::CMoney", align 8
  %20 = alloca %"class.TPCE::CMoney", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %21 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %22 = call noundef i32 @_ZN4TPCE9CTradeGen18GetCurrentCustTierEv(ptr noundef nonnull align 8 dereferenceable(7356) %21)
  store i32 %22, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %23 = call noundef i32 @_ZN4TPCE9CTradeGen18GetCurrentTradeQtyEv(ptr noundef nonnull align 8 dereferenceable(7356) %21)
  %24 = sitofp i32 %23 to double
  store double %24, ptr %4, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %25 = call noundef i32 @_ZN4TPCE9CTradeGen19GetCurrentTradeTypeEv(ptr noundef nonnull align 8 dereferenceable(7356) %21)
  store i32 %25, ptr %5, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %26 = getelementptr inbounds %"class.TPCE::CTradeGen", ptr %21, i32 0, i32 11
  %27 = load ptr, ptr %26, align 8, !tbaa !15
  %28 = call noundef i64 @_ZN4TPCE9CTradeGen23GetCurrentSecurityIndexEv(ptr noundef nonnull align 8 dereferenceable(7356) %21)
  %29 = call noundef i32 @_ZN4TPCE13CSecurityFile16GetExchangeIndexEx(ptr noundef nonnull align 8 dereferenceable(161) %27, i64 noundef %28)
  store i32 %29, ptr %6, align 4, !tbaa !65
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %30 = getelementptr inbounds %"class.TPCE::CTradeGen", ptr %21, i32 0, i32 15
  %31 = load ptr, ptr %30, align 8, !tbaa !67
  %32 = load i32, ptr %5, align 4, !tbaa !13
  %33 = call noundef ptr @_ZN4TPCE9CFlatFileINS_14TRADE_TYPE_ROWENS_16TTradeTypeLimitsEE9GetRecordEi(ptr noundef nonnull align 8 dereferenceable(40) %31, i32 noundef %32)
  store ptr %33, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %34 = getelementptr inbounds %"class.TPCE::CTradeGen", ptr %21, i32 0, i32 11
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %36 = call noundef i64 @_ZN4TPCE9CTradeGen23GetCurrentSecurityIndexEv(ptr noundef nonnull align 8 dereferenceable(7356) %21)
  %37 = call noundef ptr @_ZN4TPCE13CSecurityFile9GetRecordEx(ptr noundef nonnull align 8 dereferenceable(161) %35, i64 noundef %36)
  store ptr %37, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %38 = getelementptr inbounds %"class.TPCE::CTradeGen", ptr %21, i32 0, i32 13
  %39 = load ptr, ptr %38, align 8, !tbaa !68
  %40 = call noundef i32 @_ZN4TPCE9CFlatFileINS_19COMMISSION_RATE_ROWENS_21TCommissionRateLimitsEE7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(40) %39)
  %41 = udiv i32 %40, 3
  store i32 %41, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = getelementptr inbounds %"class.TPCE::CTradeGen", ptr %21, i32 0, i32 15
  %44 = load ptr, ptr %43, align 8, !tbaa !67
  %45 = call noundef i32 @_ZN4TPCE9CFlatFileINS_14TRADE_TYPE_ROWENS_16TTradeTypeLimitsEE7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(40) %44)
  %46 = udiv i32 %42, %45
  store i32 %46, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = getelementptr inbounds %"class.TPCE::CTradeGen", ptr %21, i32 0, i32 16
  %49 = load ptr, ptr %48, align 8, !tbaa !69
  %50 = call noundef i32 @_ZN4TPCE9CFlatFileINS_12EXCHANGE_ROWENS_15TExchangeLimitsEE7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(40) %49)
  %51 = udiv i32 %47, %50
  store i32 %51, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %52 = load i32, ptr %3, align 4, !tbaa !9
  %53 = sub nsw i32 %52, 1
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = mul i32 %53, %54
  %56 = load i32, ptr %5, align 4, !tbaa !13
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = mul i32 %56, %57
  %59 = add i32 %55, %58
  %60 = load i32, ptr %6, align 4, !tbaa !65
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = mul i32 %60, %61
  %63 = add i32 %59, %62
  store i32 %63, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %64 = load i32, ptr %12, align 4, !tbaa !9
  %65 = load i32, ptr %11, align 4, !tbaa !9
  %66 = add i32 %64, %65
  store i32 %66, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %67 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %67, ptr %14, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %135, %1
  %69 = load i32, ptr %14, align 4, !tbaa !9
  %70 = load i32, ptr %13, align 4, !tbaa !9
  %71 = icmp ult i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  store i32 2, ptr %15, align 4
  br label %138

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %74 = getelementptr inbounds %"class.TPCE::CTradeGen", ptr %21, i32 0, i32 13
  %75 = load ptr, ptr %74, align 8, !tbaa !68
  %76 = load i32, ptr %14, align 4, !tbaa !9
  %77 = call noundef ptr @_ZN4TPCE9CFlatFileINS_19COMMISSION_RATE_ROWENS_21TCommissionRateLimitsEE9GetRecordEi(ptr noundef nonnull align 8 dereferenceable(40) %75, i32 noundef %76)
  store ptr %77, ptr %16, align 8, !tbaa !5
  %78 = load i32, ptr %3, align 4, !tbaa !9
  %79 = load ptr, ptr %16, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.TPCE::COMMISSION_RATE_ROW", ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 8, !tbaa !70
  %82 = icmp ne i32 %78, %81
  br i1 %82, label %101, label %83

83:                                               ; preds = %73
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.TPCE::TRADE_TYPE_ROW", ptr %84, i32 0, i32 0
  %86 = getelementptr inbounds [4 x i8], ptr %85, i64 0, i64 0
  %87 = load ptr, ptr %16, align 8, !tbaa !5
  %88 = getelementptr inbounds %"struct.TPCE::COMMISSION_RATE_ROW", ptr %87, i32 0, i32 2
  %89 = getelementptr inbounds [4 x i8], ptr %88, i64 0, i64 0
  %90 = call i32 @strcmp(ptr noundef %86, ptr noundef %89) #8
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %101, label %92

92:                                               ; preds = %83
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.TPCE::TSecurityInputRow", ptr %93, i32 0, i32 5
  %95 = getelementptr inbounds [7 x i8], ptr %94, i64 0, i64 0
  %96 = load ptr, ptr %16, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.TPCE::COMMISSION_RATE_ROW", ptr %96, i32 0, i32 3
  %98 = getelementptr inbounds [7 x i8], ptr %97, i64 0, i64 0
  %99 = call i32 @strcmp(ptr noundef %95, ptr noundef %98) #8
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %102

101:                                              ; preds = %92, %83, %73
  store i32 2, ptr %15, align 4
  br label %132

102:                                              ; preds = %92
  %103 = load double, ptr %4, align 8, !tbaa !11
  %104 = load ptr, ptr %16, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.TPCE::COMMISSION_RATE_ROW", ptr %104, i32 0, i32 4
  %106 = load double, ptr %105, align 8, !tbaa !73
  %107 = fcmp oge double %103, %106
  br i1 %107, label %108, label %131

108:                                              ; preds = %102
  %109 = load double, ptr %4, align 8, !tbaa !11
  %110 = load ptr, ptr %16, align 8, !tbaa !5
  %111 = getelementptr inbounds %"struct.TPCE::COMMISSION_RATE_ROW", ptr %110, i32 0, i32 5
  %112 = load double, ptr %111, align 8, !tbaa !74
  %113 = fcmp ole double %109, %112
  br i1 %113, label %114, label %131

114:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %115 = load double, ptr %4, align 8, !tbaa !11
  %116 = call i64 @_ZN4TPCE9CTradeGen20GetCurrentTradePriceEv(ptr noundef nonnull align 8 dereferenceable(7356) %21)
  %117 = getelementptr inbounds %"class.TPCE::CMoney", ptr %20, i32 0, i32 0
  store i64 %116, ptr %117, align 8
  %118 = getelementptr inbounds %"class.TPCE::CMoney", ptr %20, i32 0, i32 0
  %119 = load i64, ptr %118, align 8
  %120 = call i64 @_ZN4TPCEmlEdNS_6CMoneyE(double noundef %115, i64 %119)
  %121 = getelementptr inbounds %"class.TPCE::CMoney", ptr %19, i32 0, i32 0
  store i64 %120, ptr %121, align 8
  %122 = load ptr, ptr %16, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.TPCE::COMMISSION_RATE_ROW", ptr %122, i32 0, i32 6
  %124 = load double, ptr %123, align 8, !tbaa !75
  %125 = call i64 @_ZN4TPCE6CMoneymlEd(ptr noundef nonnull align 8 dereferenceable(8) %19, double noundef %124)
  %126 = getelementptr inbounds %"class.TPCE::CMoney", ptr %18, i32 0, i32 0
  store i64 %125, ptr %126, align 8
  %127 = call i64 @_ZN4TPCE6CMoneydvEd(ptr noundef nonnull align 8 dereferenceable(8) %18, double noundef 1.000000e+02)
  %128 = getelementptr inbounds %"class.TPCE::CMoney", ptr %17, i32 0, i32 0
  store i64 %127, ptr %128, align 8
  %129 = getelementptr inbounds %"class.TPCE::CTradeGen", ptr %21, i32 0, i32 37
  %130 = getelementptr inbounds %"struct.TPCE::TAdditionalTradeInfo", ptr %129, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %130, ptr align 8 %17, i64 8, i1 false), !tbaa.struct !76
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  store i32 1, ptr %15, align 4
  br label %132

131:                                              ; preds = %108, %102
  store i32 0, ptr %15, align 4
  br label %132

132:                                              ; preds = %131, %114, %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  %133 = load i32, ptr %15, align 4
  switch i32 %133, label %138 [
    i32 0, label %134
  ]

134:                                              ; preds = %132
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %14, align 4, !tbaa !9
  %137 = add i32 %136, 1
  store i32 %137, ptr %14, align 4, !tbaa !9
  br label %68, !llvm.loop !78

138:                                              ; preds = %132, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  %139 = load i32, ptr %15, align 4
  switch i32 %139, label %141 [
    i32 2, label %140
  ]

140:                                              ; preds = %138
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 1221, ptr noundef @__PRETTY_FUNCTION__._ZN4TPCE9CTradeGen23GenerateTradeCommissionEv) #9
  unreachable

141:                                              ; preds = %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4TPCE9CFlatFileINS_14TRADE_TYPE_ROWENS_16TTradeTypeLimitsEE9GetRecordEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4TPCE9CTradeGen18GetCurrentCustTierEv(ptr noundef nonnull align 8 dereferenceable(7356)) #3 align 2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4TPCE13CSecurityFile16GetExchangeIndexEx(ptr noundef nonnull align 8 dereferenceable(161), i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4TPCE13CSecurityFile9GetRecordEx(ptr noundef nonnull align 8 dereferenceable(161), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN4TPCE9CFlatFileINS_19COMMISSION_RATE_ROWENS_21TCommissionRateLimitsEE7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN4TPCE9CFlatFileINS_14TRADE_TYPE_ROWENS_16TTradeTypeLimitsEE7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN4TPCE9CFlatFileINS_12EXCHANGE_ROWENS_15TExchangeLimitsEE7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4TPCE9CFlatFileINS_19COMMISSION_RATE_ROWENS_21TCommissionRateLimitsEE9GetRecordEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #4 align 2

declare i64 @_ZN4TPCEmlEdNS_6CMoneyE(double noundef, i64) #6

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

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync 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 = { nounwind willreturn memory(read) "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 = { "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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTSN4TPCE12eTradeTypeIDE", !7, i64 0}
!15 = !{!16, !6, i64 6048}
!16 = !{!"_ZTSN4TPCE9CTradeGenE", !17, i64 0, !19, i64 8, !24, i64 424, !25, i64 472, !29, i64 968, !32, i64 1960, !36, i64 3576, !37, i64 5416, !40, i64 5640, !28, i64 5976, !6, i64 6040, !6, i64 6048, !6, i64 6056, !6, i64 6064, !6, i64 6072, !6, i64 6080, !6, i64 6088, !18, i64 6096, !18, i64 6104, !18, i64 6112, !18, i64 6120, !10, i64 6128, !10, i64 6132, !10, i64 6136, !10, i64 6140, !12, i64 6144, !12, i64 6152, !23, i64 6160, !12, i64 6176, !44, i64 6184, !18, i64 6216, !18, i64 6224, !18, i64 6232, !10, i64 6240, !6, i64 6248, !50, i64 6256, !54, i64 6360, !56, i64 6424, !61, i64 7144, !62, i64 7208, !10, i64 7240, !10, i64 7244, !10, i64 7248, !10, i64 7252, !63, i64 7256, !10, i64 7320, !10, i64 7324, !64, i64 7328, !10, i64 7336, !10, i64 7340, !18, i64 7344, !10, i64 7352}
!17 = !{!"_ZTSN4TPCE7CRandomE", !18, i64 0}
!18 = !{!"long long", !7, i64 0}
!19 = !{!"_ZTSN4TPCE13CAddressTableE", !20, i64 0, !23, i64 296, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !18, i64 344, !18, i64 352, !22, i64 360, !22, i64 361, !18, i64 368, !10, i64 376, !18, i64 384, !22, i64 392, !10, i64 396, !18, i64 400, !6, i64 408}
!20 = !{!"_ZTSN4TPCE13TableTemplateINS_11ADDRESS_ROWEEE", !21, i64 8, !18, i64 272, !22, i64 280, !17, i64 288}
!21 = !{!"_ZTSN4TPCE11ADDRESS_ROWE", !18, i64 0, !7, i64 8, !7, i64 89, !7, i64 170, !7, i64 183}
!22 = !{!"bool", !7, i64 0}
!23 = !{!"_ZTSN4TPCE9CDateTimeE", !10, i64 0, !10, i64 4, !6, i64 8}
!24 = !{!"_ZTSN4TPCE18CCustomerSelectionE", !6, i64 0, !18, i64 8, !18, i64 16, !22, i64 24, !10, i64 28, !18, i64 32, !18, i64 40}
!25 = !{!"_ZTSN4TPCE14CCustomerTableE", !26, i64 0, !18, i64 328, !28, i64 336, !6, i64 400, !18, i64 408, !18, i64 416, !18, i64 424, !10, i64 432, !6, i64 440, !24, i64 448}
!26 = !{!"_ZTSN4TPCE13TableTemplateINS_12CUSTOMER_ROWEEE", !27, i64 8, !18, i64 304, !22, i64 312, !17, i64 320}
!27 = !{!"_ZTSN4TPCE12CUSTOMER_ROWE", !18, i64 0, !7, i64 8, !7, i64 29, !7, i64 34, !7, i64 60, !7, i64 81, !7, i64 83, !7, i64 84, !23, i64 88, !18, i64 104, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 131, !7, i64 137, !7, i64 141, !7, i64 145, !7, i64 156, !7, i64 162, !7, i64 166, !7, i64 170, !7, i64 181, !7, i64 187, !7, i64 238}
!28 = !{!"_ZTSN4TPCE7CPersonE", !6, i64 0, !6, i64 8, !6, i64 16, !17, i64 24, !22, i64 32, !10, i64 36, !18, i64 40, !6, i64 48, !6, i64 56}
!29 = !{!"_ZTSN4TPCE22CCustomerTaxratesTableE", !30, i64 0, !25, i64 64, !19, i64 560, !6, i64 976, !6, i64 984}
!30 = !{!"_ZTSN4TPCE13TableTemplateINS_21CUSTOMER_TAXRATE_ROWSEEE", !31, i64 8, !18, i64 40, !22, i64 48, !17, i64 56}
!31 = !{!"_ZTSN4TPCE21CUSTOMER_TAXRATE_ROWSE", !7, i64 0}
!32 = !{!"_ZTSN4TPCE36CCustomerAccountsAndPermissionsTableE", !33, i64 0, !6, i64 472, !6, i64 480, !18, i64 488, !18, i64 496, !18, i64 504, !10, i64 512, !10, i64 516, !25, i64 520, !28, i64 1016, !10, i64 1080, !18, i64 1088, !19, i64 1096, !10, i64 1512, !24, i64 1520, !22, i64 1568, !10, i64 1572, !18, i64 1576, !6, i64 1584, !10, i64 1592, !18, i64 1600, !6, i64 1608}
!33 = !{!"_ZTSN4TPCE13TableTemplateINS_35CUSTOMER_ACCOUNT_AND_PERMISSION_ROWEEE", !34, i64 8, !18, i64 448, !22, i64 456, !17, i64 464}
!34 = !{!"_ZTSN4TPCE35CUSTOMER_ACCOUNT_AND_PERMISSION_ROWE", !35, i64 0, !7, i64 88}
!35 = !{!"_ZTSN4TPCE20CUSTOMER_ACCOUNT_ROWE", !18, i64 0, !18, i64 8, !18, i64 16, !7, i64 24, !7, i64 75, !12, i64 80}
!36 = !{!"_ZTSN4TPCE23CHoldingsAndTradesTableE", !17, i64 0, !32, i64 8, !18, i64 1624, !10, i64 1632, !7, i64 1640, !22, i64 1784, !18, i64 1792, !10, i64 1800, !6, i64 1808, !18, i64 1816, !10, i64 1824, !6, i64 1832}
!37 = !{!"_ZTSN4TPCE13CBrokersTableE", !38, i64 0, !18, i64 112, !18, i64 120, !18, i64 128, !28, i64 136, !6, i64 200, !6, i64 208, !6, i64 216}
!38 = !{!"_ZTSN4TPCE13TableTemplateINS_10BROKER_ROWEEE", !39, i64 8, !18, i64 88, !22, i64 96, !17, i64 104}
!39 = !{!"_ZTSN4TPCE10BROKER_ROWE", !18, i64 0, !7, i64 8, !7, i64 13, !10, i64 64, !12, i64 72}
!40 = !{!"_ZTSN4TPCE14CSecurityTableE", !41, i64 0, !18, i64 264, !18, i64 272, !6, i64 280, !6, i64 288, !23, i64 296, !10, i64 312, !10, i64 316, !10, i64 320, !18, i64 328}
!41 = !{!"_ZTSN4TPCE13TableTemplateINS_12SECURITY_ROWEEE", !42, i64 8, !18, i64 240, !22, i64 248, !17, i64 256}
!42 = !{!"_ZTSN4TPCE12SECURITY_ROWE", !7, i64 0, !7, i64 16, !7, i64 23, !7, i64 28, !7, i64 99, !18, i64 112, !18, i64 120, !23, i64 128, !23, i64 144, !12, i64 160, !43, i64 168, !23, i64 176, !43, i64 192, !23, i64 200, !12, i64 216, !12, i64 224}
!43 = !{!"float", !7, i64 0}
!44 = !{!"_ZTSSt14priority_queueIN4TPCE10TTradeInfoESt6vectorIS1_SaIS1_EESt7greaterIS1_EE", !45, i64 0, !49, i64 24}
!45 = !{!"_ZTSSt6vectorIN4TPCE10TTradeInfoESaIS1_EE", !46, i64 0}
!46 = !{!"_ZTSSt12_Vector_baseIN4TPCE10TTradeInfoESaIS1_EE", !47, i64 0}
!47 = !{!"_ZTSNSt12_Vector_baseIN4TPCE10TTradeInfoESaIS1_EE12_Vector_implE", !48, i64 0}
!48 = !{!"_ZTSNSt12_Vector_baseIN4TPCE10TTradeInfoESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!49 = !{!"_ZTSSt7greaterIN4TPCE10TTradeInfoEE"}
!50 = !{!"_ZTSN4TPCE10TTradeInfoE", !18, i64 0, !14, i64 8, !51, i64 12, !12, i64 16, !12, i64 24, !12, i64 32, !18, i64 40, !10, i64 48, !10, i64 52, !52, i64 56, !52, i64 64, !18, i64 72, !53, i64 80, !18, i64 88, !22, i64 96}
!51 = !{!"_ZTSN4TPCE13eStatusTypeIDE", !7, i64 0}
!52 = !{!"_ZTSN4TPCE6CMoneyE", !18, i64 0}
!53 = !{!"_ZTSN4TPCE13eCustomerTierE", !7, i64 0}
!54 = !{!"_ZTSN4TPCE20TAdditionalTradeInfoE", !52, i64 0, !52, i64 8, !18, i64 16, !55, i64 24, !52, i64 32, !52, i64 40, !52, i64 48, !52, i64 56}
!55 = !{!"_ZTSN4TPCE10eTaxStatusE", !7, i64 0}
!56 = !{!"_ZTSN4TPCE9TTradeRowE", !57, i64 0, !58, i64 168, !7, i64 216, !59, i64 312, !60, i64 392, !7, i64 528}
!57 = !{!"_ZTSN4TPCE9TRADE_ROWE", !18, i64 0, !23, i64 8, !7, i64 24, !7, i64 29, !22, i64 33, !7, i64 34, !10, i64 52, !12, i64 56, !18, i64 64, !7, i64 72, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !22, i64 160}
!58 = !{!"_ZTSN4TPCE17TRADE_REQUEST_ROWE", !18, i64 0, !7, i64 8, !7, i64 12, !10, i64 28, !12, i64 32, !18, i64 40}
!59 = !{!"_ZTSN4TPCE14SETTLEMENT_ROWE", !18, i64 0, !7, i64 8, !23, i64 56, !12, i64 72}
!60 = !{!"_ZTSN4TPCE20CASH_TRANSACTION_ROWE", !18, i64 0, !23, i64 8, !12, i64 24, !7, i64 32}
!61 = !{!"_ZTSN4TPCE11HOLDING_ROWE", !18, i64 0, !18, i64 8, !7, i64 16, !23, i64 32, !12, i64 48, !10, i64 56}
!62 = !{!"_ZTSN4TPCE19HOLDING_SUMMARY_ROWE", !18, i64 0, !7, i64 8, !10, i64 24}
!63 = !{!"_ZTSN4TPCE12CMEESecurityE", !17, i64 0, !52, i64 8, !52, i64 16, !52, i64 24, !10, i64 32, !10, i64 36, !6, i64 40, !6, i64 48, !12, i64 56}
!64 = !{!"_ZTSSt14_List_iteratorIN4TPCE12THoldingInfoEE", !6, i64 0}
!65 = !{!66, !66, i64 0}
!66 = !{!"_ZTSN4TPCE11eExchangeIDE", !7, i64 0}
!67 = !{!16, !6, i64 6080}
!68 = !{!16, !6, i64 6064}
!69 = !{!16, !6, i64 6088}
!70 = !{!71, !10, i64 8}
!71 = !{!"_ZTSN4TPCE19COMMISSION_RATE_ROWE", !72, i64 0, !10, i64 8, !7, i64 12, !7, i64 16, !12, i64 24, !12, i64 32, !12, i64 40}
!72 = !{!"_ZTSN4TPCE13TBaseInputRowE"}
!73 = !{!71, !12, i64 24}
!74 = !{!71, !12, i64 32}
!75 = !{!71, !12, i64 40}
!76 = !{i64 0, i64 8, !77}
!77 = !{!18, !18, i64 0}
!78 = distinct !{!78, !79}
!79 = !{!"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"

%"class.TPCE::CMoney" = type { i64 }

@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@__PRETTY_FUNCTION__._ZN4TPCE9CTradeGen23GenerateTradeCommissionEv = external hidden unnamed_addr constant [48 x i8], align 1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 i32 @_ZN4TPCE9CTradeGen18GetCurrentTradeQtyEv(ptr noundef nonnull align 8 dereferenceable(7356)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4TPCE9CTradeGen19GetCurrentTradeTypeEv(ptr noundef nonnull align 8 dereferenceable(7356)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i64 @_ZN4TPCE9CTradeGen20GetCurrentTradePriceEv(ptr noundef nonnull align 8 dereferenceable(7356)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4TPCE9CTradeGen23GetCurrentSecurityIndexEv(ptr noundef nonnull align 8 dereferenceable(7356)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4TPCE9CTradeGen23GenerateTradeCommissionEv(ptr noundef nonnull align 8 dereferenceable(7356) %0) local_unnamed_addr #3 align 2 {
  %2 = alloca %"class.TPCE::CMoney", align 8
  %3 = alloca %"class.TPCE::CMoney", align 8
  %4 = tail call noundef i32 @_ZN4TPCE9CTradeGen18GetCurrentCustTierEv(ptr noundef nonnull align 8 dereferenceable(7356) %0)
  %5 = tail call noundef i32 @_ZN4TPCE9CTradeGen18GetCurrentTradeQtyEv(ptr noundef nonnull align 8 dereferenceable(7356) %0)
  %6 = sitofp i32 %5 to double
  %7 = tail call noundef i32 @_ZN4TPCE9CTradeGen19GetCurrentTradeTypeEv(ptr noundef nonnull align 8 dereferenceable(7356) %0)
  %8 = getelementptr inbounds i8, ptr %0, i64 6048
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call noundef i64 @_ZN4TPCE9CTradeGen23GetCurrentSecurityIndexEv(ptr noundef nonnull align 8 dereferenceable(7356) %0)
  %11 = tail call noundef i32 @_ZN4TPCE13CSecurityFile16GetExchangeIndexEx(ptr noundef nonnull align 8 dereferenceable(161) %9, i64 noundef %10)
  %12 = getelementptr inbounds i8, ptr %0, i64 6080
  %13 = load ptr, ptr %12, align 8, !tbaa !61
  %14 = tail call noundef ptr @_ZN4TPCE9CFlatFileINS_14TRADE_TYPE_ROWENS_16TTradeTypeLimitsEE9GetRecordEi(ptr noundef nonnull align 8 dereferenceable(40) %13, i32 noundef %7)
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  %16 = tail call noundef i64 @_ZN4TPCE9CTradeGen23GetCurrentSecurityIndexEv(ptr noundef nonnull align 8 dereferenceable(7356) %0)
  %17 = tail call noundef ptr @_ZN4TPCE13CSecurityFile9GetRecordEx(ptr noundef nonnull align 8 dereferenceable(161) %15, i64 noundef %16)
  %18 = getelementptr inbounds i8, ptr %0, i64 6064
  %19 = load ptr, ptr %18, align 8, !tbaa !62
  %20 = tail call noundef i32 @_ZN4TPCE9CFlatFileINS_19COMMISSION_RATE_ROWENS_21TCommissionRateLimitsEE7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(40) %19)
  %21 = udiv i32 %20, 3
  %22 = load ptr, ptr %12, align 8, !tbaa !61
  %23 = tail call noundef i32 @_ZN4TPCE9CFlatFileINS_14TRADE_TYPE_ROWENS_16TTradeTypeLimitsEE7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(40) %22)
  %24 = udiv i32 %21, %23
  %25 = getelementptr inbounds i8, ptr %0, i64 6088
  %26 = load ptr, ptr %25, align 8, !tbaa !63
  %27 = tail call noundef i32 @_ZN4TPCE9CFlatFileINS_12EXCHANGE_ROWENS_15TExchangeLimitsEE7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(40) %26)
  %28 = udiv i32 %24, %27
  %29 = add nsw i32 %4, -1
  %30 = mul i32 %21, %29
  %31 = mul i32 %24, %7
  %32 = add i32 %31, %30
  %33 = mul i32 %28, %11
  %34 = add i32 %32, %33
  %35 = add i32 %34, %28
  %36 = icmp ult i32 %34, %35
  br i1 %36, label %.lr.ph, label %.thread38

.lr.ph:                                           ; preds = %1
  %37 = getelementptr inbounds i8, ptr %17, i64 44
  br label %38

38:                                               ; preds = %.lr.ph, %57
  %.045 = phi i32 [ %34, %.lr.ph ], [ %58, %57 ]
  %39 = load ptr, ptr %18, align 8, !tbaa !62
  %40 = tail call noundef ptr @_ZN4TPCE9CFlatFileINS_19COMMISSION_RATE_ROWENS_21TCommissionRateLimitsEE9GetRecordEi(ptr noundef nonnull align 8 dereferenceable(40) %39, i32 noundef %.045)
  %41 = getelementptr inbounds i8, ptr %40, i64 8
  %42 = load i32, ptr %41, align 8, !tbaa !64
  %.not = icmp eq i32 %4, %42
  br i1 %.not, label %43, label %.thread38

43:                                               ; preds = %38
  %44 = getelementptr inbounds i8, ptr %40, i64 12
  %45 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %14, ptr noundef nonnull dereferenceable(1) %44) #6
  %.not34 = icmp eq i32 %45, 0
  br i1 %.not34, label %46, label %.thread38

46:                                               ; preds = %43
  %47 = getelementptr inbounds i8, ptr %40, i64 16
  %48 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %37, ptr noundef nonnull dereferenceable(1) %47) #6
  %.not35 = icmp eq i32 %48, 0
  br i1 %.not35, label %49, label %.thread38

49:                                               ; preds = %46
  %50 = getelementptr inbounds i8, ptr %40, i64 24
  %51 = load double, ptr %50, align 8, !tbaa !67
  %52 = fcmp ugt double %51, %6
  br i1 %52, label %57, label %53

53:                                               ; preds = %49
  %54 = getelementptr inbounds i8, ptr %40, i64 32
  %55 = load double, ptr %54, align 8, !tbaa !68
  %56 = fcmp ult double %55, %6
  br i1 %56, label %57, label %60

57:                                               ; preds = %53, %49
  %58 = add nuw i32 %.045, 1
  %59 = icmp ult i32 %58, %35
  br i1 %59, label %38, label %.thread38, !llvm.loop !69

.thread38:                                        ; preds = %57, %38, %43, %46, %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 1221, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4TPCE9CTradeGen23GenerateTradeCommissionEv) #7
  unreachable

60:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %61 = tail call i64 @_ZN4TPCE9CTradeGen20GetCurrentTradePriceEv(ptr noundef nonnull align 8 dereferenceable(7356) %0)
  %62 = tail call i64 @_ZN4TPCEmlEdNS_6CMoneyE(double noundef %6, i64 %61)
  store i64 %62, ptr %3, align 8
  %63 = getelementptr inbounds i8, ptr %40, i64 40
  %64 = load double, ptr %63, align 8, !tbaa !71
  %65 = call i64 @_ZN4TPCE6CMoneymlEd(ptr noundef nonnull align 8 dereferenceable(8) %3, double noundef %64)
  store i64 %65, ptr %2, align 8
  %66 = call i64 @_ZN4TPCE6CMoneydvEd(ptr noundef nonnull align 8 dereferenceable(8) %2, double noundef 1.000000e+02)
  %67 = getelementptr inbounds i8, ptr %0, i64 6392
  store i64 %66, ptr %67, align 8, !tbaa !72
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4TPCE9CFlatFileINS_14TRADE_TYPE_ROWENS_16TTradeTypeLimitsEE9GetRecordEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4TPCE9CTradeGen18GetCurrentCustTierEv(ptr noundef nonnull align 8 dereferenceable(7356)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4TPCE13CSecurityFile16GetExchangeIndexEx(ptr noundef nonnull align 8 dereferenceable(161), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4TPCE13CSecurityFile9GetRecordEx(ptr noundef nonnull align 8 dereferenceable(161), i64 noundef) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4TPCE9CFlatFileINS_19COMMISSION_RATE_ROWENS_21TCommissionRateLimitsEE9GetRecordEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #3 align 2

declare i64 @_ZN4TPCEmlEdNS_6CMoneyE(double noundef, i64) local_unnamed_addr #5

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

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

attributes #0 = { mustprogress nocallback nofree nosync 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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 willreturn memory(read) }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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, !17, i64 6048}
!6 = !{!"_ZTSN4TPCE9CTradeGenE", !7, i64 0, !11, i64 8, !18, i64 424, !19, i64 472, !23, i64 968, !26, i64 1960, !31, i64 3576, !32, i64 5416, !35, i64 5640, !22, i64 5976, !17, i64 6040, !17, i64 6048, !17, i64 6056, !17, i64 6064, !17, i64 6072, !17, i64 6080, !17, i64 6088, !8, i64 6096, !8, i64 6104, !8, i64 6112, !8, i64 6120, !16, i64 6128, !16, i64 6132, !16, i64 6136, !16, i64 6140, !30, i64 6144, !30, i64 6152, !15, i64 6160, !30, i64 6176, !39, i64 6184, !8, i64 6216, !8, i64 6224, !8, i64 6232, !16, i64 6240, !17, i64 6248, !45, i64 6256, !50, i64 6360, !52, i64 6424, !57, i64 7144, !58, i64 7208, !16, i64 7240, !16, i64 7244, !16, i64 7248, !16, i64 7252, !59, i64 7256, !16, i64 7320, !16, i64 7324, !60, i64 7328, !16, i64 7336, !16, i64 7340, !8, i64 7344, !16, i64 7352}
!7 = !{!"_ZTSN4TPCE7CRandomE", !8, i64 0}
!8 = !{!"long long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN4TPCE13CAddressTableE", !12, i64 0, !15, i64 296, !17, i64 312, !17, i64 320, !17, i64 328, !17, i64 336, !8, i64 344, !8, i64 352, !14, i64 360, !14, i64 361, !8, i64 368, !16, i64 376, !8, i64 384, !14, i64 392, !16, i64 396, !8, i64 400, !17, i64 408}
!12 = !{!"_ZTSN4TPCE13TableTemplateINS_11ADDRESS_ROWEEE", !13, i64 8, !8, i64 272, !14, i64 280, !7, i64 288}
!13 = !{!"_ZTSN4TPCE11ADDRESS_ROWE", !8, i64 0, !9, i64 8, !9, i64 89, !9, i64 170, !9, i64 183}
!14 = !{!"bool", !9, i64 0}
!15 = !{!"_ZTSN4TPCE9CDateTimeE", !16, i64 0, !16, i64 4, !17, i64 8}
!16 = !{!"int", !9, i64 0}
!17 = !{!"any pointer", !9, i64 0}
!18 = !{!"_ZTSN4TPCE18CCustomerSelectionE", !17, i64 0, !8, i64 8, !8, i64 16, !14, i64 24, !16, i64 28, !8, i64 32, !8, i64 40}
!19 = !{!"_ZTSN4TPCE14CCustomerTableE", !20, i64 0, !8, i64 328, !22, i64 336, !17, i64 400, !8, i64 408, !8, i64 416, !8, i64 424, !16, i64 432, !17, i64 440, !18, i64 448}
!20 = !{!"_ZTSN4TPCE13TableTemplateINS_12CUSTOMER_ROWEEE", !21, i64 8, !8, i64 304, !14, i64 312, !7, i64 320}
!21 = !{!"_ZTSN4TPCE12CUSTOMER_ROWE", !8, i64 0, !9, i64 8, !9, i64 29, !9, i64 34, !9, i64 60, !9, i64 81, !9, i64 83, !9, i64 84, !15, i64 88, !8, i64 104, !9, i64 112, !9, i64 116, !9, i64 120, !9, i64 131, !9, i64 137, !9, i64 141, !9, i64 145, !9, i64 156, !9, i64 162, !9, i64 166, !9, i64 170, !9, i64 181, !9, i64 187, !9, i64 238}
!22 = !{!"_ZTSN4TPCE7CPersonE", !17, i64 0, !17, i64 8, !17, i64 16, !7, i64 24, !14, i64 32, !16, i64 36, !8, i64 40, !17, i64 48, !17, i64 56}
!23 = !{!"_ZTSN4TPCE22CCustomerTaxratesTableE", !24, i64 0, !19, i64 64, !11, i64 560, !17, i64 976, !17, i64 984}
!24 = !{!"_ZTSN4TPCE13TableTemplateINS_21CUSTOMER_TAXRATE_ROWSEEE", !25, i64 8, !8, i64 40, !14, i64 48, !7, i64 56}
!25 = !{!"_ZTSN4TPCE21CUSTOMER_TAXRATE_ROWSE", !9, i64 0}
!26 = !{!"_ZTSN4TPCE36CCustomerAccountsAndPermissionsTableE", !27, i64 0, !17, i64 472, !17, i64 480, !8, i64 488, !8, i64 496, !8, i64 504, !16, i64 512, !16, i64 516, !19, i64 520, !22, i64 1016, !16, i64 1080, !8, i64 1088, !11, i64 1096, !16, i64 1512, !18, i64 1520, !14, i64 1568, !16, i64 1572, !8, i64 1576, !17, i64 1584, !16, i64 1592, !8, i64 1600, !17, i64 1608}
!27 = !{!"_ZTSN4TPCE13TableTemplateINS_35CUSTOMER_ACCOUNT_AND_PERMISSION_ROWEEE", !28, i64 8, !8, i64 448, !14, i64 456, !7, i64 464}
!28 = !{!"_ZTSN4TPCE35CUSTOMER_ACCOUNT_AND_PERMISSION_ROWE", !29, i64 0, !9, i64 88}
!29 = !{!"_ZTSN4TPCE20CUSTOMER_ACCOUNT_ROWE", !8, i64 0, !8, i64 8, !8, i64 16, !9, i64 24, !9, i64 75, !30, i64 80}
!30 = !{!"double", !9, i64 0}
!31 = !{!"_ZTSN4TPCE23CHoldingsAndTradesTableE", !7, i64 0, !26, i64 8, !8, i64 1624, !16, i64 1632, !9, i64 1640, !14, i64 1784, !8, i64 1792, !16, i64 1800, !17, i64 1808, !8, i64 1816, !16, i64 1824, !17, i64 1832}
!32 = !{!"_ZTSN4TPCE13CBrokersTableE", !33, i64 0, !8, i64 112, !8, i64 120, !8, i64 128, !22, i64 136, !17, i64 200, !17, i64 208, !17, i64 216}
!33 = !{!"_ZTSN4TPCE13TableTemplateINS_10BROKER_ROWEEE", !34, i64 8, !8, i64 88, !14, i64 96, !7, i64 104}
!34 = !{!"_ZTSN4TPCE10BROKER_ROWE", !8, i64 0, !9, i64 8, !9, i64 13, !16, i64 64, !30, i64 72}
!35 = !{!"_ZTSN4TPCE14CSecurityTableE", !36, i64 0, !8, i64 264, !8, i64 272, !17, i64 280, !17, i64 288, !15, i64 296, !16, i64 312, !16, i64 316, !16, i64 320, !8, i64 328}
!36 = !{!"_ZTSN4TPCE13TableTemplateINS_12SECURITY_ROWEEE", !37, i64 8, !8, i64 240, !14, i64 248, !7, i64 256}
!37 = !{!"_ZTSN4TPCE12SECURITY_ROWE", !9, i64 0, !9, i64 16, !9, i64 23, !9, i64 28, !9, i64 99, !8, i64 112, !8, i64 120, !15, i64 128, !15, i64 144, !30, i64 160, !38, i64 168, !15, i64 176, !38, i64 192, !15, i64 200, !30, i64 216, !30, i64 224}
!38 = !{!"float", !9, i64 0}
!39 = !{!"_ZTSSt14priority_queueIN4TPCE10TTradeInfoESt6vectorIS1_SaIS1_EESt7greaterIS1_EE", !40, i64 0, !44, i64 24}
!40 = !{!"_ZTSSt6vectorIN4TPCE10TTradeInfoESaIS1_EE", !41, i64 0}
!41 = !{!"_ZTSSt12_Vector_baseIN4TPCE10TTradeInfoESaIS1_EE", !42, i64 0}
!42 = !{!"_ZTSNSt12_Vector_baseIN4TPCE10TTradeInfoESaIS1_EE12_Vector_implE", !43, i64 0}
!43 = !{!"_ZTSNSt12_Vector_baseIN4TPCE10TTradeInfoESaIS1_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!44 = !{!"_ZTSSt7greaterIN4TPCE10TTradeInfoEE"}
!45 = !{!"_ZTSN4TPCE10TTradeInfoE", !8, i64 0, !46, i64 8, !47, i64 12, !30, i64 16, !30, i64 24, !30, i64 32, !8, i64 40, !16, i64 48, !16, i64 52, !48, i64 56, !48, i64 64, !8, i64 72, !49, i64 80, !8, i64 88, !14, i64 96}
!46 = !{!"_ZTSN4TPCE12eTradeTypeIDE", !9, i64 0}
!47 = !{!"_ZTSN4TPCE13eStatusTypeIDE", !9, i64 0}
!48 = !{!"_ZTSN4TPCE6CMoneyE", !8, i64 0}
!49 = !{!"_ZTSN4TPCE13eCustomerTierE", !9, i64 0}
!50 = !{!"_ZTSN4TPCE20TAdditionalTradeInfoE", !48, i64 0, !48, i64 8, !8, i64 16, !51, i64 24, !48, i64 32, !48, i64 40, !48, i64 48, !48, i64 56}
!51 = !{!"_ZTSN4TPCE10eTaxStatusE", !9, i64 0}
!52 = !{!"_ZTSN4TPCE9TTradeRowE", !53, i64 0, !54, i64 168, !9, i64 216, !55, i64 312, !56, i64 392, !9, i64 528}
!53 = !{!"_ZTSN4TPCE9TRADE_ROWE", !8, i64 0, !15, i64 8, !9, i64 24, !9, i64 29, !14, i64 33, !9, i64 34, !16, i64 52, !30, i64 56, !8, i64 64, !9, i64 72, !30, i64 128, !30, i64 136, !30, i64 144, !30, i64 152, !14, i64 160}
!54 = !{!"_ZTSN4TPCE17TRADE_REQUEST_ROWE", !8, i64 0, !9, i64 8, !9, i64 12, !16, i64 28, !30, i64 32, !8, i64 40}
!55 = !{!"_ZTSN4TPCE14SETTLEMENT_ROWE", !8, i64 0, !9, i64 8, !15, i64 56, !30, i64 72}
!56 = !{!"_ZTSN4TPCE20CASH_TRANSACTION_ROWE", !8, i64 0, !15, i64 8, !30, i64 24, !9, i64 32}
!57 = !{!"_ZTSN4TPCE11HOLDING_ROWE", !8, i64 0, !8, i64 8, !9, i64 16, !15, i64 32, !30, i64 48, !16, i64 56}
!58 = !{!"_ZTSN4TPCE19HOLDING_SUMMARY_ROWE", !8, i64 0, !9, i64 8, !16, i64 24}
!59 = !{!"_ZTSN4TPCE12CMEESecurityE", !7, i64 0, !48, i64 8, !48, i64 16, !48, i64 24, !16, i64 32, !16, i64 36, !17, i64 40, !17, i64 48, !30, i64 56}
!60 = !{!"_ZTSSt14_List_iteratorIN4TPCE12THoldingInfoEE", !17, i64 0}
!61 = !{!6, !17, i64 6080}
!62 = !{!6, !17, i64 6064}
!63 = !{!6, !17, i64 6088}
!64 = !{!65, !16, i64 8}
!65 = !{!"_ZTSN4TPCE19COMMISSION_RATE_ROWE", !66, i64 0, !16, i64 8, !9, i64 12, !9, i64 16, !30, i64 24, !30, i64 32, !30, i64 40}
!66 = !{!"_ZTSN4TPCE13TBaseInputRowE"}
!67 = !{!65, !30, i64 24}
!68 = !{!65, !30, i64 32}
!69 = distinct !{!69, !70}
!70 = !{!"llvm.loop.mustprogress"}
!71 = !{!65, !30, i64 40}
!72 = !{!8, !8, i64 0}


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