/*========================== begin_copyright_notice ============================

Copyright (C) 2019-2023 Intel Corporation

SPDX-License-Identifier: MIT

============================= end_copyright_notice ===========================*/


// This file is autogenerated.  It is not currently part of the build process as
// we don't expect to update that often.

static Type* _igc_struct_RTStackFormat__RTStack(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::RTStack";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_struct_RTStackFormat__MemHit(M),
      _igc_struct_RTStackFormat__MemHit(M),
      _igc_struct_RTStackFormat__MemRay(M),
      _igc_struct_RTStackFormat__MemRay(M),
      [&] {
        auto *EltTy =
          _igc_struct_RTStackFormat__MemTravStack(M);
        return ArrayType::get(EltTy, 2);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__MemHit(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::MemHit";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      Type::getFloatTy(M.getContext()),
      Type::getFloatTy(M.getContext()),
      Type::getFloatTy(M.getContext()),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 64),
      IntegerType::get(M.getContext(), 64),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__MemRay(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::MemRay";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      Type::getFloatTy(M.getContext()),
      Type::getFloatTy(M.getContext()),
      _igc_igc_auto_union_anon(M),
      IntegerType::get(M.getContext(), 64),
      IntegerType::get(M.getContext(), 64),
      _igc_igc_auto_union_anon_1(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_union_anon(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.union.anon";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_igc_auto_struct_anon_0(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_struct_anon_0(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.struct.anon.0";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 64),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_union_anon_1(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.union.anon.1";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_igc_auto_struct_anon_3(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_struct_anon_3(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.struct.anon.3";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 64),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__MemTravStack(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::MemTravStack";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_igc_auto_union_anon_5(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_union_anon_5(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.union.anon.5";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_igc_auto_struct_anon_7(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_struct_anon_7(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.struct.anon.7";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 64),
      IntegerType::get(M.getContext(), 32),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 32);
        return ArrayType::get(EltTy, 4);
      }(),
      [&] {
        auto *EltTy =
          _igc_struct_RTStackFormat__NodeInfo(M);
        return ArrayType::get(EltTy, 4);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__NodeInfo(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::NodeInfo";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 8),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__RTStack_8(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::RTStack.8";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_struct_RTStackFormat__MemHit_9(M),
      _igc_struct_RTStackFormat__MemHit_9(M),
      _igc_struct_RTStackFormat__MemRay_10(M),
      _igc_struct_RTStackFormat__MemRay_10(M),
      [&] {
        auto *EltTy =
          _igc_struct_RTStackFormat__MemTravStack(M);
        return ArrayType::get(EltTy, 2);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__MemHit_9(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::MemHit.9";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      Type::getFloatTy(M.getContext()),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 64),
      IntegerType::get(M.getContext(), 64),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__MemRay_10(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::MemRay.10";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      Type::getFloatTy(M.getContext()),
      Type::getFloatTy(M.getContext()),
      IntegerType::get(M.getContext(), 64),
      _igc_igc_auto_union_anon_11(M),
      _igc_igc_auto_union_anon_14(M),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      Type::getFloatTy(M.getContext()),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_union_anon_11(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.union.anon.11";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_igc_auto_struct_anon_13(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_struct_anon_13(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.struct.anon.13";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 64),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_union_anon_14(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.union.anon.14";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_igc_auto_struct_anon_16(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_struct_anon_16(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.struct.anon.16";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 32),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__SMStack(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::SMStack";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_struct_RTStackFormat__MemHit(M),
      _igc_struct_RTStackFormat__MemHit(M),
      _igc_struct_RTStackFormat__MemRay(M),
      _igc_struct_RTStackFormat__MemRay(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__SMStack_17(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::SMStack.17";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_struct_RTStackFormat__MemHit_9(M),
      _igc_struct_RTStackFormat__MemHit_9(M),
      _igc_struct_RTStackFormat__MemRay_10(M),
      _igc_struct_RTStackFormat__MemRay_10(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__SWHotZone_v1(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::SWHotZone_v1";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_struct_RTStackFormat__StackPtrDRIEncoding(M),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 8);
        return ArrayType::get(EltTy, 8);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__StackPtrDRIEncoding(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::StackPtrDRIEncoding";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_struct_RTStackFormat__StackPtrAndBudges(M),
      IntegerType::get(M.getContext(), 32),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__StackPtrAndBudges(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::StackPtrAndBudges";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 16),
      _igc_igc_auto_union_anon_18(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_union_anon_18(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.union.anon.18";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 16),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__SWHotZone_v2(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::SWHotZone_v2";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 32),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 32);
        return ArrayType::get(EltTy, 3);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__SWHotZone_v3(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::SWHotZone_v3";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 32),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 32);
        return ArrayType::get(EltTy, 3);
      }(),
      IntegerType::get(M.getContext(), 32),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 32);
        return ArrayType::get(EltTy, 3);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_IGC__RayDispatchGlobalData(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.IGC::RayDispatchGlobalData";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_union_IGC__RayDispatchGlobalData__RT(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_union_IGC__RayDispatchGlobalData__RT(Module &M)
{
  return
  [&] {
    StringRef StructName = "union.IGC::RayDispatchGlobalData::RT";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_struct_IGC__RayDispatchGlobalData__RT__Xe(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_IGC__RayDispatchGlobalData__RT__Xe(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.IGC::RayDispatchGlobalData::RT::Xe";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 64),
      IntegerType::get(M.getContext(), 64),
      _igc_igc_auto_union_anon_20(M),
      _igc_igc_auto_union_anon_22(M),
      _igc_igc_auto_union_anon_24(M),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 32);
        return ArrayType::get(EltTy, 9);
      }(),
      _igc_struct_IGC__RayDispatchGlobalData__RayDispatchGlobalDataCommon(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_union_anon_20(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.union.anon.20";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 32),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_union_anon_22(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.union.anon.22";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 32),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_union_anon_24(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.union.anon.24";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 32),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_IGC__RayDispatchGlobalData__RayDispatchGlobalDataCommon(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.IGC::RayDispatchGlobalData::RayDispatchGlobalDataCommon";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 64),
      IntegerType::get(M.getContext(), 64),
      _igc_igc_auto_union_anon_26(M),
      _igc_igc_auto_union_anon_27(M),
      IntegerType::get(M.getContext(), 64),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      _igc_igc_auto_union_anon_28(M),
      IntegerType::get(M.getContext(), 64),
      IntegerType::get(M.getContext(), 64),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 64),
      _igc_igc_auto_union_anon_29(M),
      IntegerType::get(M.getContext(), 64),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 32);
        return ArrayType::get(EltTy, 3);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_union_anon_26(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.union.anon.26";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 64),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_union_anon_27(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.union.anon.27";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 64),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_union_anon_28(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.union.anon.28";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 64),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_union_anon_29(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.union.anon.29";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_igc_auto_struct_anon_30(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_struct_anon_30(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.struct.anon.30";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_IGC__TypeHoleGlobalRootSig(Module &M, Type* TypeHoleGlobalRootSig)
{
  return
  [&] {
    (void)M;
    IGC_ASSERT_MESSAGE(checkAlign(M, cast<StructType>(TypeHoleGlobalRootSig), 8), "type not aligned!");
    return TypeHoleGlobalRootSig;
  }();
}
static Type* _igc_struct_IGC__RTGlobalsAndRootSig(Module &M, Type* TypeHoleGlobalRootSig)
{
  return
  [&] {
    StringRef StructName = "struct.IGC::RTGlobalsAndRootSig";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_struct_IGC__RayDispatchGlobalData(M),
      _igc_struct_IGC__TypeHoleGlobalRootSig(M, TypeHoleGlobalRootSig),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__BVH(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::BVH";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 64),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      [&] {
        auto *EltTy =
          _igc_struct_RTStackFormat__InternalNode(M);
        return ArrayType::get(EltTy, 1);
      }(),
      [&] {
        auto *EltTy =
          _igc_struct_RTStackFormat__QuadLeaf(M);
        return ArrayType::get(EltTy, 1);
      }(),
      [&] {
        auto *EltTy =
          _igc_struct_RTStackFormat__ProceduralLeaf(M);
        return ArrayType::get(EltTy, 1);
      }(),
      [&] {
        auto *EltTy =
          _igc_struct_RTStackFormat__InstanceLeaf(M);
        return ArrayType::get(EltTy, 1);
      }(),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 32);
        return ArrayType::get(EltTy, 1);
      }(),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 8);
        return ArrayType::get(EltTy, 124);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__InternalNode(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::InternalNode";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 8),
      IntegerType::get(M.getContext(), 8),
      IntegerType::get(M.getContext(), 8),
      IntegerType::get(M.getContext(), 8),
      IntegerType::get(M.getContext(), 8),
      IntegerType::get(M.getContext(), 8),
      [&] {
        auto *EltTy =
          _igc_struct_RTStackFormat__InternalNode__ChildData(M);
        return ArrayType::get(EltTy, 6);
      }(),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 8);
        return ArrayType::get(EltTy, 6);
      }(),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 8);
        return ArrayType::get(EltTy, 6);
      }(),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 8);
        return ArrayType::get(EltTy, 6);
      }(),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 8);
        return ArrayType::get(EltTy, 6);
      }(),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 8);
        return ArrayType::get(EltTy, 6);
      }(),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 8);
        return ArrayType::get(EltTy, 6);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__InternalNode__ChildData(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::InternalNode::ChildData";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 8),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__QuadLeaf(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::QuadLeaf";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_struct_RTStackFormat__PrimLeafDesc(M),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__PrimLeafDesc(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::PrimLeafDesc";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__ProceduralLeaf(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::ProceduralLeaf";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_struct_RTStackFormat__PrimLeafDesc(M),
      IntegerType::get(M.getContext(), 32),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 32);
        return ArrayType::get(EltTy, 13);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__InstanceLeaf(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::InstanceLeaf";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_struct_RTStackFormat__InstanceLeaf_RTStackFormat__Xe___Part0(M),
      _igc_struct_RTStackFormat__InstanceLeaf_RTStackFormat__Xe___Part1(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__InstanceLeaf_RTStackFormat__Xe___Part0(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::InstanceLeaf<RTStackFormat::Xe>::Part0";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 64),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__InstanceLeaf_RTStackFormat__Xe___Part1(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::InstanceLeaf<RTStackFormat::Xe>::Part1";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 64),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_igc_auto_struct_anon(Module &M)
{
  return
  [&] {
    StringRef StructName = "igc.auto.struct.anon";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 16),
      IntegerType::get(M.getContext(), 16),
      IntegerType::get(M.getContext(), 16),
      IntegerType::get(M.getContext(), 16),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__InstanceLeaf_36(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::InstanceLeaf.36";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_struct_RTStackFormat__InstanceLeaf_RTStackFormat__Xe3___Part0(M),
      _igc_struct_RTStackFormat__InstanceLeaf_RTStackFormat__Xe3___Part1(M),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__InstanceLeaf_RTStackFormat__Xe3___Part0(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::InstanceLeaf<RTStackFormat::Xe3>::Part0";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 64),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__InstanceLeaf_RTStackFormat__Xe3___Part1(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::InstanceLeaf<RTStackFormat::Xe3>::Part1";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 64),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__ProceduralLeaf_55(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::ProceduralLeaf.55";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_struct_RTStackFormat__PrimLeafDesc_56(M),
      IntegerType::get(M.getContext(), 32),
      [&] {
        auto *EltTy =
          IntegerType::get(M.getContext(), 32);
        return ArrayType::get(EltTy, 13);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__PrimLeafDesc_56(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::PrimLeafDesc.56";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _igc_struct_RTStackFormat__QuadLeaf_57(Module &M)
{
  return
  [&] {
    StringRef StructName = "struct.RTStackFormat::QuadLeaf.57";
    if (auto *Ty = IGCLLVM::getTypeByName(M, StructName))
      return Ty;
    Type* Tys[] = {
      _igc_struct_RTStackFormat__PrimLeafDesc_56(M),
      IntegerType::get(M.getContext(), 32),
      IntegerType::get(M.getContext(), 32),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
      [&] {
        auto *EltTy =
          Type::getFloatTy(M.getContext());
        return ArrayType::get(EltTy, 3);
      }(),
    };
    return StructType::create(M.getContext(), Tys, StructName, false);
  }();
}
static Type* _gettype_RTStack2_Xe(Module &M)
{
  return
  _igc_struct_RTStackFormat__RTStack(M);
}

static Type* _gettype_RTStack2_Xe3(Module &M)
{
  return
  _igc_struct_RTStackFormat__RTStack_8(M);
}

static Type* _gettype_SMStack2_Xe(Module &M)
{
  return
  _igc_struct_RTStackFormat__SMStack(M);
}

static Type* _gettype_SMStack2_Xe3(Module &M)
{
  return
  _igc_struct_RTStackFormat__SMStack_17(M);
}

static Type* _gettype_SWHotZone_v1(Module &M)
{
  return
  _igc_struct_RTStackFormat__SWHotZone_v1(M);
}

static Type* _gettype_SWHotZone_v2(Module &M)
{
  return
  _igc_struct_RTStackFormat__SWHotZone_v2(M);
}

static Type* _gettype_SWHotZone_v3(Module &M)
{
  return
  _igc_struct_RTStackFormat__SWHotZone_v3(M);
}

static Type* _gettype_RayDispatchGlobalData(Module &M)
{
  return
  _igc_struct_IGC__RayDispatchGlobalData(M);
}

static Type* _gettype_RTGlobalsAndRootSig(Module &M, Type* TypeHoleGlobalRootSig)
{
  return
  _igc_struct_IGC__RTGlobalsAndRootSig(M, TypeHoleGlobalRootSig);
}

auto* _get_rtMemBasePtr_fromGlobals_Xe(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_IGC__RayDispatchGlobalData(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(0) });
  auto* V_2 = CreateLoad(getInt64Ty(), V_1, _ReturnName);
  setInvariantLoad(V_2);
  return V_2;
}

auto* _get_rtMemBasePtr_Xe(const Twine& _ReturnName = "")
{
  auto* V_0 = getGlobalBufferPtr();
  auto* V_1 = CreateInBoundsGEP(_igc_struct_IGC__RayDispatchGlobalData(*Ctx.getModule()), V_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(0) });
  auto* V_2 = CreateLoad(getInt64Ty(), V_1, _ReturnName);
  setInvariantLoad(V_2);
  return V_2;
}

auto* _get_maxBVHLevels_fromGlobals_Xe(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_IGC__RayDispatchGlobalData(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(4), getInt32(0) });
  auto* V_2 = CreateLoad(getInt32Ty(), V_1, _ReturnName);
  setInvariantLoad(V_2);
  return V_2;
}

auto* _get_maxBVHLevels_Xe(const Twine& _ReturnName = "")
{
  auto* V_0 = getGlobalBufferPtr();
  auto* V_1 = CreateInBoundsGEP(_igc_struct_IGC__RayDispatchGlobalData(*Ctx.getModule()), V_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(4), getInt32(0) });
  auto* V_2 = CreateLoad(getInt32Ty(), V_1, _ReturnName);
  setInvariantLoad(V_2);
  return V_2;
}

auto* _get_stackSizePerRay_fromGlobals_Xe(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_IGC__RayDispatchGlobalData(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(2), getInt32(0) });
  auto* V_2 = CreateLoad(getInt32Ty(), V_1, _ReturnName);
  setInvariantLoad(V_2);
  return V_2;
}

auto* _get_stackSizePerRay_Xe(const Twine& _ReturnName = "")
{
  auto* V_0 = getGlobalBufferPtr();
  auto* V_1 = CreateInBoundsGEP(_igc_struct_IGC__RayDispatchGlobalData(*Ctx.getModule()), V_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(2), getInt32(0) });
  auto* V_2 = CreateLoad(getInt32Ty(), V_1, _ReturnName);
  setInvariantLoad(V_2);
  return V_2;
}

auto* _get_numDSSRTStacks_fromGlobals_Xe(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_IGC__RayDispatchGlobalData(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(3), getInt32(0) });
  auto* V_2 = CreateLoad(getInt32Ty(), V_1, _ReturnName);
  setInvariantLoad(V_2);
  return V_2;
}

auto* _get_numDSSRTStacks_Xe(const Twine& _ReturnName = "")
{
  auto* V_0 = getGlobalBufferPtr();
  auto* V_1 = CreateInBoundsGEP(_igc_struct_IGC__RayDispatchGlobalData(*Ctx.getModule()), V_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(3), getInt32(0) });
  auto* V_2 = CreateLoad(getInt32Ty(), V_1, _ReturnName);
  setInvariantLoad(V_2);
  return V_2;
}

auto* _get_maxBVHLevels_fromGlobals_Xe3(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_IGC__RayDispatchGlobalData(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(4), getInt32(0) });
  auto* V_2 = CreateLoad(getInt32Ty(), V_1);
  setInvariantLoad(V_2);
  auto* V_3 = CreateAnd(V_2, getInt32(7), _ReturnName);
  return V_3;
}

auto* _get_maxBVHLevels_Xe3(const Twine& _ReturnName = "")
{
  auto* V_0 = getGlobalBufferPtr();
  auto* V_1 = CreateInBoundsGEP(_igc_struct_IGC__RayDispatchGlobalData(*Ctx.getModule()), V_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(4), getInt32(0) });
  auto* V_2 = CreateLoad(getInt32Ty(), V_1);
  setInvariantLoad(V_2);
  auto* V_3 = CreateAnd(V_2, getInt32(7), _ReturnName);
  return V_3;
}

auto* _get_statelessScratchPtr_fromGlobals(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_IGC__RayDispatchGlobalData(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(6), getInt32(3), getInt32(0) });
  auto* V_2 = CreateLoad(getInt64Ty(), V_1, _ReturnName);
  setInvariantLoad(V_2);
  return V_2;
}

auto* _get_statelessScratchPtr(const Twine& _ReturnName = "")
{
  auto* V_0 = getGlobalBufferPtr();
  auto* V_1 = CreateInBoundsGEP(_igc_struct_IGC__RayDispatchGlobalData(*Ctx.getModule()), V_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(6), getInt32(3), getInt32(0) });
  auto* V_2 = CreateLoad(getInt64Ty(), V_1, _ReturnName);
  setInvariantLoad(V_2);
  return V_2;
}

auto* _gepof_StackOffset_v1(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_RTStackFormat__SWHotZone_v1(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(0) }, _ReturnName);
  return V_1;
}

auto* _gepof_StackOffset_v2(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_RTStackFormat__SWHotZone_v2(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0) }, _ReturnName);
  return V_1;
}

auto* _getDispatchRaysIndex_HotZone_v1(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__SWHotZone_v1(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(1), getInt32(0) });
  auto* V_3 = CreateLoad(getInt16Ty(), V_2);
  auto* V_4 = CreateAnd(V_3, getInt16(31));
  auto* V_5 = CreateZExt(V_4, getInt32Ty());
  auto* V_6 = CreateLShr(V_3, getInt16(5));
  auto* V_7 = CreateAnd(V_6, getInt16(31));
  auto* V_8 = CreateZExt(V_7, getInt32Ty());
  auto* V_9 = CreateLShr(V_3, getInt16(10));
  auto* V_10 = CreateAnd(V_9, getInt16(31));
  auto* V_11 = CreateZExt(V_10, getInt32Ty());
  auto* V_12 = CreateICmpEQ(arg_1, getInt32(0));
  auto* V_13 = CreateSelect(V_12, V_5, getInt32(0));
  auto* V_14 = CreateICmpEQ(arg_1, getInt32(1));
  auto* V_15 = CreateSelect(V_14, V_8, V_13);
  auto* V_16 = CreateICmpEQ(arg_1, getInt32(2));
  auto* V_17 = CreateSelect(V_16, V_11, V_15);
  auto* V_18 = CreateSelect(V_12, getInt32(0), V_5);
  auto* V_19 = CreateICmpUGT(arg_1, getInt32(1));
  auto* V_20 = CreateSelect(V_19, V_8, getInt32(0));
  auto* V_21 = CreateAdd(V_20, V_18);
  auto* V_22 = CreateShl(getInt32(4294967295), V_17);
  auto* V_23 = CreateXor(V_22, getInt32(4294967295));
  auto* V_24 = CreateInBoundsGEP(_igc_struct_RTStackFormat__SWHotZone_v1(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(1) });
  auto* V_25 = CreateLoad(getInt32Ty(), V_24);
  auto* V_26 = CreateLShr(V_25, V_21);
  auto* V_27 = CreateAnd(V_26, V_23, _ReturnName);
  return V_27;
}

auto* _getDispatchRaysIndex_HotZone_v2(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateZExt(arg_1, getInt64Ty());
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__SWHotZone_v2(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), V_2 });
  auto* V_4 = CreateLoad(getInt32Ty(), V_3, _ReturnName);
  return V_4;
}

void _setDispatchRaysIndex_HotZone_v1(Value* arg_0, Value* arg_1, Value* arg_2, Value* arg_3)
{
  auto* V_4 = ctlz(arg_1);
  auto* V_5 = CreateSub(getInt32(32), V_4);
  auto* V_6 = CreateTrunc(V_5, getInt16Ty());
  auto* V_7 = ctlz(arg_2);
  auto* V_8 = CreateSub(getInt32(32), V_7);
  auto* V_9 = CreateShl(arg_2, V_5);
  auto* V_10 = CreateOr(V_9, arg_1);
  auto* V_11 = CreateTrunc(V_8, getInt16Ty());
  auto* V_12 = CreateShl(V_11, getInt16(5));
  auto* V_13 = CreateOr(V_12, V_6);
  auto* V_14 = CreateAdd(V_8, V_5);
  auto* V_15 = ctlz(arg_3);
  auto* V_16 = CreateShl(arg_3, V_14);
  auto* V_17 = CreateOr(V_16, V_10);
  auto* V_18 = CreateTrunc(V_15, getInt16Ty());
  auto* V_19 = CreateMul(V_18, getInt16(64512));
  auto* V_20 = CreateXor(V_19, getInt16(32768));
  auto* V_21 = CreateOr(V_13, V_20);
  auto* V_22 = CreateInBoundsGEP(_igc_struct_RTStackFormat__SWHotZone_v1(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0), getInt32(1), getInt32(0) });
  CreateStore(V_21, V_22);
  auto* V_23 = CreateInBoundsGEP(_igc_struct_RTStackFormat__SWHotZone_v1(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(1) });
  CreateStore(V_17, V_23);
  return;
}

void _setDispatchRaysIndex_HotZone_v2(Value* arg_0, Value* arg_1, Value* arg_2)
{
  auto* V_3 = CreateZExt(arg_1, getInt64Ty());
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__SWHotZone_v2(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), V_3 });
  CreateStore(arg_2, V_4);
  return;
}

auto* _getBVHPtr(Value* arg_0, Value* arg_1, Value* arg_2, const Twine& _ReturnName = "")
{
  auto* BB_3 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_3->splitBasicBlock(_CurIP, VALUE_NAME("_getBVHPtr.join"));
  BB_3->getTerminator()->eraseFromParent();
  auto* BB_4 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getBVHPtr."), _JoinBB->getParent(), _JoinBB);
  auto* BB_5 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getBVHPtr."), _JoinBB->getParent(), _JoinBB);
  auto* BB_6 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getBVHPtr."), _JoinBB->getParent(), _JoinBB);
  auto* BB_7 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getBVHPtr."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_3);
  auto* V_8 = CreateICmpEQ(arg_0, getInt64(0));
  CreateCondBr(arg_2, BB_4, BB_5);
  SetInsertPoint(BB_4);
  auto* V_9 = CreateAdd(arg_1, arg_0);
  auto* V_10 = CreateSelect(V_8, getInt64(0), V_9);
  CreateBr(BB_7);
  SetInsertPoint(BB_7);
  auto* V_11 = CreatePHI(getInt64Ty(), 3, _ReturnName);
  CreateBr(_JoinBB);
  SetInsertPoint(BB_5);
  CreateCondBr(V_8, BB_7, BB_6);
  SetInsertPoint(BB_6);
  auto* V_12 = CreateIntToPtr(arg_0, PointerType::get(_igc_struct_RTStackFormat__BVH(*Ctx.getModule()), 2));
  auto* V_13 = CreateInBoundsGEP(_igc_struct_RTStackFormat__BVH(*Ctx.getModule()), V_12, { getInt64(0), getInt32(0) });
  auto* V_14 = CreateLoad(getInt64Ty(), V_13);
  auto* V_15 = CreateAdd(V_14, arg_0);
  CreateBr(BB_7);
  V_11->addIncoming(V_10, BB_4);
  V_11->addIncoming(V_15, BB_6);
  V_11->addIncoming(getInt64(0), BB_5);
  SetInsertPoint(_CurIP);
  return V_11;
}

auto* _getWorldRayOrig_Xe(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateZExt(arg_1, getInt64Ty());
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(0), V_2 });
  auto* V_4 = CreateLoad(getFloatTy(), V_3, _ReturnName);
  return V_4;
}

auto* _getWorldRayOrig_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateZExt(arg_1, getInt64Ty());
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(0), V_2 });
  auto* V_4 = CreateLoad(getFloatTy(), V_3, _ReturnName);
  return V_4;
}

auto* _getMemRayOrig_Xe(Value* arg_0, Value* arg_1, Value* arg_2, const Twine& _ReturnName = "")
{
  auto* V_3 = CreateICmpEQ(arg_2, getInt32(0));
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2) });
  auto* V_5 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(3) });
  auto* V_6 = CreateSelect(V_3, V_4, V_5);
  auto* V_7 = CreateZExt(arg_1, getInt64Ty());
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemRay(*Ctx.getModule()), V_6, { getInt64(0), getInt32(0), V_7 });
  auto* V_9 = CreateLoad(getFloatTy(), V_8, _ReturnName);
  return V_9;
}

auto* _getMemRayOrig_Xe3(Value* arg_0, Value* arg_1, Value* arg_2, const Twine& _ReturnName = "")
{
  auto* V_3 = CreateICmpEQ(arg_2, getInt32(0));
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2) });
  auto* V_5 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(3) });
  auto* V_6 = CreateSelect(V_3, V_4, V_5);
  auto* V_7 = CreateZExt(arg_1, getInt64Ty());
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemRay_10(*Ctx.getModule()), V_6, { getInt64(0), getInt32(0), V_7 });
  auto* V_9 = CreateLoad(getFloatTy(), V_8, _ReturnName);
  return V_9;
}

auto* _getMemRayDir_Xe(Value* arg_0, Value* arg_1, Value* arg_2, const Twine& _ReturnName = "")
{
  auto* V_3 = CreateICmpEQ(arg_2, getInt32(0));
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2) });
  auto* V_5 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(3) });
  auto* V_6 = CreateSelect(V_3, V_4, V_5);
  auto* V_7 = CreateZExt(arg_1, getInt64Ty());
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemRay(*Ctx.getModule()), V_6, { getInt64(0), getInt32(1), V_7 });
  auto* V_9 = CreateLoad(getFloatTy(), V_8, _ReturnName);
  return V_9;
}

auto* _getMemRayDir_Xe3(Value* arg_0, Value* arg_1, Value* arg_2, const Twine& _ReturnName = "")
{
  auto* V_3 = CreateICmpEQ(arg_2, getInt32(0));
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2) });
  auto* V_5 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(3) });
  auto* V_6 = CreateSelect(V_3, V_4, V_5);
  auto* V_7 = CreateZExt(arg_1, getInt64Ty());
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemRay_10(*Ctx.getModule()), V_6, { getInt64(0), getInt32(1), V_7 });
  auto* V_9 = CreateLoad(getFloatTy(), V_8, _ReturnName);
  return V_9;
}

auto* _getWorldRayDir_Xe(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateZExt(arg_1, getInt64Ty());
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(1), V_2 });
  auto* V_4 = CreateLoad(getFloatTy(), V_3, _ReturnName);
  return V_4;
}

auto* _getWorldRayDir_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateZExt(arg_1, getInt64Ty());
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(1), V_2 });
  auto* V_4 = CreateLoad(getFloatTy(), V_3, _ReturnName);
  return V_4;
}

auto* _getRayTMin_Xe(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(2) });
  auto* V_2 = CreateLoad(getFloatTy(), V_1, _ReturnName);
  return V_2;
}

auto* _getRayTMin_Xe3(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(2) });
  auto* V_2 = CreateLoad(getFloatTy(), V_1, _ReturnName);
  return V_2;
}

auto* _getRayInfo_Xe(Value* arg_0, Value* arg_1, Value* arg_2, const Twine& _ReturnName = "")
{
  auto* V_3 = CreateICmpEQ(arg_2, getInt32(0));
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2) });
  auto* V_5 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(3) });
  auto* V_6 = CreateSelect(V_3, V_4, V_5);
  auto* V_7 = CreateZExt(arg_1, getInt64Ty());
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemRay(*Ctx.getModule()), V_6, { getInt64(0), getInt32(0), V_7 });
  auto* V_9 = CreateLoad(getFloatTy(), V_8, _ReturnName);
  return V_9;
}

auto* _getRayInfo_Xe3(Value* arg_0, Value* arg_1, Value* arg_2, const Twine& _ReturnName = "")
{
  auto* V_3 = CreateICmpEQ(arg_2, getInt32(0));
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2) });
  auto* V_5 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(3) });
  auto* V_6 = CreateSelect(V_3, V_4, V_5);
  auto* V_7 = CreateZExt(arg_1, getInt64Ty());
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemRay_10(*Ctx.getModule()), V_6, { getInt64(0), getInt32(0), V_7 });
  auto* V_9 = CreateLoad(getFloatTy(), V_8, _ReturnName);
  return V_9;
}

auto* _getRayFlagsSync_Xe(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(4) });
  auto* V_2 = CreateBitCast(V_1, PointerType::get(_igc_igc_auto_struct_anon(*Ctx.getModule()), arg_0->getType()->getPointerAddressSpace()));
  auto* V_3 = CreateInBoundsGEP(_igc_igc_auto_struct_anon(*Ctx.getModule()), V_2, { getInt64(0), getInt32(3) });
  auto* V_4 = CreateLoad(getInt16Ty(), V_3, _ReturnName);
  return V_4;
}

auto* _getRayFlagsSync_Xe3(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(6) });
  auto* V_2 = CreateBitCast(V_1, PointerType::get(getInt16Ty(), arg_0->getType()->getPointerAddressSpace()));
  auto* V_3 = CreateLoad(getInt16Ty(), V_2, _ReturnName);
  return V_3;
}

void _setRayFlagsSync_Xe(Value* arg_0, Value* arg_1)
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(4) });
  auto* V_3 = CreateBitCast(V_2, PointerType::get(_igc_igc_auto_struct_anon(*Ctx.getModule()), arg_0->getType()->getPointerAddressSpace()));
  auto* V_4 = CreateInBoundsGEP(_igc_igc_auto_struct_anon(*Ctx.getModule()), V_3, { getInt64(0), getInt32(3) });
  CreateStore(arg_1, V_4);
  return;
}

void _setRayFlagsSync_Xe3(Value* arg_0, Value* arg_1)
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(6) });
  auto* V_3 = CreateBitCast(V_2, PointerType::get(getInt16Ty(), arg_0->getType()->getPointerAddressSpace()));
  CreateStore(arg_1, V_3);
  return;
}

auto* _getPrimLeaf_Xe(Value* arg_0, Value* arg_1)
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(4) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(4) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateLoad(getInt64Ty(), V_4);
  auto* V_6 = CreateShl(V_5, getInt64(6));
  auto* V_7 = CreateAnd(V_6, getInt64(281474976710592));
  auto* V_8 = canonizePointer(V_7);
  return V_8;
}

auto* _getPrimLeaf_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(4) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(4) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateLoad(getInt64Ty(), V_4);
  auto* V_6 = CreateAnd(V_5, getInt64(18446744073709551552u), _ReturnName);
  return V_6;
}

auto* _getInstanceLeaf_Xe(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_3 = CreateICmpEQ(arg_1, getInt32(1));
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  auto* V_5 = CreateSelect(V_3, V_4, V_2);
  auto* V_6 = CreateLoad(getInt64Ty(), V_5);
  auto* V_7 = CreateShl(V_6, getInt64(6));
  auto* V_8 = CreateAnd(V_7, getInt64(281474976710592));
  auto* V_9 = canonizePointer(V_8);
  auto* V_10 = CreateIntToPtr(V_9, PointerType::get(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), 1), _ReturnName);
  return V_10;
}

auto* _getInstanceLeaf_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_3 = CreateICmpEQ(arg_1, getInt32(1));
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  auto* V_5 = CreateSelect(V_3, V_4, V_2);
  auto* V_6 = CreateLoad(getInt64Ty(), V_5);
  auto* V_7 = CreateAnd(V_6, getInt64(18446744073709551552u));
  auto* V_8 = CreateIntToPtr(V_7, PointerType::get(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), 1), _ReturnName);
  return V_8;
}

auto* _getInstanceContributionToHitGroupIndex_Xe(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_3 = CreateICmpEQ(arg_1, getInt32(1));
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  auto* V_5 = CreateSelect(V_3, V_4, V_2);
  auto* V_6 = CreateLoad(getInt64Ty(), V_5);
  auto* V_7 = CreateShl(V_6, getInt64(6));
  auto* V_8 = CreateAnd(V_7, getInt64(281474976710592));
  auto* V_9 = canonizePointer(V_8);
  auto* V_10 = CreateIntToPtr(V_9, PointerType::get(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), 1));
  auto* V_11 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), V_10, { getInt64(0), getInt32(0), getInt32(1) });
  auto* V_12 = CreateLoad(getInt32Ty(), V_11);
  auto* V_13 = CreateAnd(V_12, getInt32(16777215), _ReturnName);
  return V_13;
}

auto* _getInstanceContributionToHitGroupIndex_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_3 = CreateICmpEQ(arg_1, getInt32(1));
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  auto* V_5 = CreateSelect(V_3, V_4, V_2);
  auto* V_6 = CreateLoad(getInt64Ty(), V_5);
  auto* V_7 = CreateAnd(V_6, getInt64(18446744073709551552u));
  auto* V_8 = CreateIntToPtr(V_7, PointerType::get(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), 1));
  auto* V_9 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), V_8, { getInt64(0), getInt32(0), getInt32(0) });
  auto* V_10 = CreateLoad(getInt32Ty(), V_9);
  auto* V_11 = CreateAnd(V_10, getInt32(16777215), _ReturnName);
  return V_11;
}

auto* _getRayMask_Xe(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(7), getInt32(0), getInt32(0) });
  auto* V_2 = CreateLoad(getInt64Ty(), V_1);
  auto* V_3 = CreateLShr(V_2, getInt64(48));
  auto* V_4 = CreateTrunc(V_3, getInt32Ty());
  auto* V_5 = CreateAnd(V_4, getInt32(255), _ReturnName);
  return V_5;
}

auto* _getRayMask_Xe3(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(6), getInt32(0), getInt32(0) });
  auto* V_2 = CreateLoad(getInt32Ty(), V_1);
  auto* V_3 = CreateLShr(V_2, getInt32(16));
  auto* V_4 = CreateAnd(V_3, getInt32(255), _ReturnName);
  return V_4;
}

auto* _getLeafNodeSubType_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateLoad(getInt32Ty(), V_4);
  auto* V_6 = CreateLShr(V_5, getInt32(12));
  auto* V_7 = CreateAnd(V_6, getInt32(15), _ReturnName);
  return V_7;
}

auto* _isValid_Xe(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemHit(*Ctx.getModule()), V_4, { getInt64(0), getInt32(3) });
  auto* V_6 = CreateLoad(getInt32Ty(), V_5);
  auto* V_7 = CreateAnd(V_6, getInt32(65536));
  auto* V_8 = CreateICmpNE(V_7, getInt32(0), _ReturnName);
  return V_8;
}

auto* _isValid_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemHit_9(*Ctx.getModule()), V_4, { getInt64(0), getInt32(3) });
  auto* V_6 = CreateLoad(getInt32Ty(), V_5);
  auto* V_7 = CreateAnd(V_6, getInt32(65536));
  auto* V_8 = CreateICmpNE(V_7, getInt32(0), _ReturnName);
  return V_8;
}

auto* _createLeafType_Xe(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemHit(*Ctx.getModule()), V_4, { getInt64(0), getInt32(3) });
  auto* V_6 = CreateLoad(getInt32Ty(), V_5);
  auto* V_7 = CreateLShr(V_6, getInt32(17));
  auto* V_8 = CreateAnd(V_7, getInt32(7), _ReturnName);
  return V_8;
}

auto* _createLeafType_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemHit_9(*Ctx.getModule()), V_4, { getInt64(0), getInt32(3) });
  auto* V_6 = CreateLoad(getInt32Ty(), V_5);
  auto* V_7 = CreateLShr(V_6, getInt32(17));
  auto* V_8 = CreateAnd(V_7, getInt32(7), _ReturnName);
  return V_8;
}

auto* _getIsFrontFace_Xe(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateLoad(getInt32Ty(), V_4);
  auto* V_6 = CreateAnd(V_5, getInt32(134217728));
  auto* V_7 = CreateICmpNE(V_6, getInt32(0), _ReturnName);
  return V_7;
}

auto* _getIsFrontFace_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateLoad(getInt32Ty(), V_4);
  auto* V_6 = CreateAnd(V_5, getInt32(134217728));
  auto* V_7 = CreateICmpNE(V_6, getInt32(0), _ReturnName);
  return V_7;
}

auto* _getBvhLevel_Xe(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateLoad(getInt32Ty(), V_4);
  auto* V_6 = CreateLShr(V_5, getInt32(24));
  auto* V_7 = CreateAnd(V_6, getInt32(7), _ReturnName);
  return V_7;
}

auto* _getBvhLevel_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateLoad(getInt32Ty(), V_4);
  auto* V_6 = CreateLShr(V_5, getInt32(24));
  auto* V_7 = CreateAnd(V_6, getInt32(7), _ReturnName);
  return V_7;
}

auto* _isDoneBitNotSet_Xe(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateLoad(getInt32Ty(), V_4);
  auto* V_6 = CreateAnd(V_5, getInt32(268435456));
  auto* V_7 = CreateICmpEQ(V_6, getInt32(0), _ReturnName);
  return V_7;
}

auto* _isDoneBitNotSet_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateLoad(getInt32Ty(), V_4);
  auto* V_6 = CreateAnd(V_5, getInt32(268435456));
  auto* V_7 = CreateICmpEQ(V_6, getInt32(0), _ReturnName);
  return V_7;
}

void _setDoneBit_Xe(Value* arg_0, Value* arg_1)
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_4 = CreateSelect(arg_1, V_3, V_2);
  auto* V_5 = CreateLoad(getInt32Ty(), V_4);
  auto* V_6 = CreateOr(V_5, getInt32(268435456));
  CreateStore(V_6, V_4);
  return;
}

void _setDoneBit_Xe3(Value* arg_0, Value* arg_1)
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_4 = CreateSelect(arg_1, V_3, V_2);
  auto* V_5 = CreateLoad(getInt32Ty(), V_4);
  auto* V_6 = CreateOr(V_5, getInt32(268435456));
  CreateStore(V_6, V_4);
  return;
}

void _setHitValid_Xe(Value* arg_0, Value* arg_1)
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_4 = CreateSelect(arg_1, V_3, V_2);
  auto* V_5 = CreateLoad(getInt32Ty(), V_4);
  auto* V_6 = CreateOr(V_5, getInt32(65536));
  CreateStore(V_6, V_4);
  return;
}

void _setHitValid_Xe3(Value* arg_0, Value* arg_1)
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_4 = CreateSelect(arg_1, V_3, V_2);
  auto* V_5 = CreateLoad(getInt32Ty(), V_4);
  auto* V_6 = CreateOr(V_5, getInt32(65536));
  CreateStore(V_6, V_4);
  return;
}

auto* _getHitBaryCentric_Xe(Value* arg_0, Value* arg_1, Value* arg_2, const Twine& _ReturnName = "")
{
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0) });
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1) });
  auto* V_5 = CreateSelect(arg_2, V_3, V_4);
  auto* V_6 = CreateICmpEQ(arg_1, getInt32(0));
  auto* V_7 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemHit(*Ctx.getModule()), V_5, { getInt64(0), getInt32(1) });
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemHit(*Ctx.getModule()), V_5, { getInt64(0), getInt32(2) });
  auto* V_9 = CreateSelect(V_6, V_7, V_8);
  auto* V_10 = CreateLoad(getFloatTy(), V_9, _ReturnName);
  return V_10;
}

auto* _getHitBaryCentric_Xe3(Value* arg_0, Value* arg_1, Value* arg_2, const Twine& _ReturnName = "")
{
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0) });
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1) });
  auto* V_5 = CreateSelect(arg_2, V_3, V_4);
  auto* V_6 = CreateICmpEQ(arg_1, getInt32(0));
  auto* V_7 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemHit_9(*Ctx.getModule()), V_5, { getInt64(0), getInt32(1) });
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemHit_9(*Ctx.getModule()), V_5, { getInt64(0), getInt32(2) });
  auto* V_9 = CreateSelect(V_6, V_7, V_8);
  auto* V_10 = CreateLoad(getInt32Ty(), V_9);
  auto* V_11 = CreateAnd(V_10, getInt32(16777215));
  auto* V_12 = CreateUIToFP(V_11, getFloatTy());
  auto* V_13 = CreateFMul(V_12, ConstantFP::get(*Ctx.getLLVMContext(), APFloat(APFloat::IEEEsingle(), APInt(32, 0x33800001))), _ReturnName);
  return V_13;
}

void _writeBaryCentricToStorage_Xe(Value* arg_0, Value* arg_1, Value* arg_2)
{
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(1) });
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(1) });
  auto* V_5 = CreateSelect(arg_2, V_3, V_4);
  auto* V_6 = CreateBitCast(V_5, PointerType::get(getInt64Ty(), arg_0->getType()->getPointerAddressSpace()));
  auto* V_7 = CreateBitCast(arg_1, PointerType::get(getInt64Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_8 = CreateLoad(getInt64Ty(), V_6);
  CreateStore(V_8, V_7);
  return;
}

void _writeBaryCentricToStorage_Xe3(Value* arg_0, Value* arg_1, Value* arg_2)
{
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0) });
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1) });
  auto* V_5 = CreateSelect(arg_2, V_3, V_4);
  auto* V_6 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemHit_9(*Ctx.getModule()), V_5, { getInt64(0), getInt32(1) });
  auto* V_7 = CreateInBoundsGEP(_igc_struct_RTStackFormat__MemHit_9(*Ctx.getModule()), V_5, { getInt64(0), getInt32(2) });
  auto* V_8 = CreateLoad(getInt32Ty(), V_6);
  auto* V_9 = CreateAnd(V_8, getInt32(16777215));
  auto* V_10 = CreateUIToFP(V_9, getFloatTy());
  auto* V_11 = CreateFMul(V_10, ConstantFP::get(*Ctx.getLLVMContext(), APFloat(APFloat::IEEEsingle(), APInt(32, 0x33800001))));
  CreateStore(V_11, arg_1);
  auto* V_12 = CreateLoad(getInt32Ty(), V_7);
  auto* V_13 = CreateAnd(V_12, getInt32(16777215));
  auto* V_14 = CreateUIToFP(V_13, getFloatTy());
  auto* V_15 = CreateFMul(V_14, ConstantFP::get(*Ctx.getLLVMContext(), APFloat(APFloat::IEEEsingle(), APInt(32, 0x33800001))));
  auto* V_16 = CreateInBoundsGEP(getFloatTy(), arg_1, getInt64(1));
  CreateStore(V_15, V_16);
  return;
}

auto* _TransformWorldToObject_Xe(Value* arg_0, Value* arg_1, Value* arg_2, Value* arg_3, const Twine& _ReturnName = "")
{
  auto* BB_4 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_4->splitBasicBlock(_CurIP, VALUE_NAME("_TransformWorldToObject_Xe.join"));
  BB_4->getTerminator()->eraseFromParent();
  auto* BB_5 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_TransformWorldToObject_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_6 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_TransformWorldToObject_Xe."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_4);
  auto* V_7 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_8 = CreateICmpEQ(arg_3, getInt32(1));
  auto* V_9 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  auto* V_10 = CreateSelect(V_8, V_9, V_7);
  auto* V_11 = CreateLoad(getInt64Ty(), V_10);
  auto* V_12 = CreateShl(V_11, getInt64(6));
  auto* V_13 = CreateAnd(V_12, getInt64(281474976710592));
  auto* V_14 = canonizePointer(V_13);
  auto* V_15 = CreateIntToPtr(V_14, PointerType::get(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), 1));
  auto* V_16 = CreateZExt(arg_1, getInt64Ty());
  CreateCondBr(arg_2, BB_5, BB_6);
  SetInsertPoint(BB_5);
  auto* V_17 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), V_15, { getInt64(0), getInt32(1), getInt32(6), V_16 });
  auto* V_18 = CreateLoad(getFloatTy(), V_17);
  CreateBr(BB_6);
  SetInsertPoint(BB_6);
  auto* V_19 = CreatePHI(getFloatTy(), 2);
  auto* V_20 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(0), getInt64(0) });
  auto* V_21 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(1), getInt64(0) });
  auto* V_22 = CreateSelect(arg_2, V_20, V_21);
  auto* V_23 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), V_15, { getInt64(0), getInt32(0), getInt32(3), V_16 });
  auto* V_24 = CreateLoad(getFloatTy(), V_23);
  auto* V_25 = CreateLoad(getFloatTy(), V_22);
  auto* V_26 = CreateFMul(V_24, V_25);
  auto* V_27 = CreateFAdd(V_19, V_26);
  auto* V_28 = CreateAdd(arg_1, getInt32(3));
  auto* V_29 = CreateZExt(V_28, getInt64Ty());
  auto* V_30 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), V_15, { getInt64(0), getInt32(0), getInt32(3), V_29 });
  auto* V_31 = CreateLoad(getFloatTy(), V_30);
  auto* V_32 = CreateInBoundsGEP(getFloatTy(), V_22, getInt64(1));
  auto* V_33 = CreateLoad(getFloatTy(), V_32);
  auto* V_34 = CreateFMul(V_31, V_33);
  auto* V_35 = CreateFAdd(V_27, V_34);
  auto* V_36 = CreateAdd(arg_1, getInt32(6));
  auto* V_37 = CreateZExt(V_36, getInt64Ty());
  auto* V_38 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), V_15, { getInt64(0), getInt32(0), getInt32(3), V_37 });
  auto* V_39 = CreateLoad(getFloatTy(), V_38);
  auto* V_40 = CreateInBoundsGEP(getFloatTy(), V_22, getInt64(2));
  auto* V_41 = CreateLoad(getFloatTy(), V_40);
  auto* V_42 = CreateFMul(V_39, V_41);
  auto* V_43 = CreateFAdd(V_35, V_42, _ReturnName);
  CreateBr(_JoinBB);
  V_19->addIncoming(V_18, BB_5);
  V_19->addIncoming(ConstantFP::get(*Ctx.getLLVMContext(), APFloat(APFloat::IEEEsingle(), APInt(32, 0x0))), BB_4);
  SetInsertPoint(_CurIP);
  return V_43;
}

auto* _TransformWorldToObject_Xe3(Value* arg_0, Value* arg_1, Value* arg_2, Value* arg_3, const Twine& _ReturnName = "")
{
  auto* BB_4 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_4->splitBasicBlock(_CurIP, VALUE_NAME("_TransformWorldToObject_Xe3.join"));
  BB_4->getTerminator()->eraseFromParent();
  auto* BB_5 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_TransformWorldToObject_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_6 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_TransformWorldToObject_Xe3."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_4);
  auto* V_7 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_8 = CreateICmpEQ(arg_3, getInt32(1));
  auto* V_9 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  auto* V_10 = CreateSelect(V_8, V_9, V_7);
  auto* V_11 = CreateLoad(getInt64Ty(), V_10);
  auto* V_12 = CreateAnd(V_11, getInt64(18446744073709551552u));
  auto* V_13 = CreateIntToPtr(V_12, PointerType::get(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), 1));
  auto* V_14 = CreateZExt(arg_1, getInt64Ty());
  CreateCondBr(arg_2, BB_5, BB_6);
  SetInsertPoint(BB_5);
  auto* V_15 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), V_13, { getInt64(0), getInt32(1), getInt32(6), V_14 });
  auto* V_16 = CreateLoad(getFloatTy(), V_15);
  CreateBr(BB_6);
  SetInsertPoint(BB_6);
  auto* V_17 = CreatePHI(getFloatTy(), 2);
  auto* V_18 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(0), getInt64(0) });
  auto* V_19 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(1), getInt64(0) });
  auto* V_20 = CreateSelect(arg_2, V_18, V_19);
  auto* V_21 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), V_13, { getInt64(0), getInt32(0), getInt32(3), V_14 });
  auto* V_22 = CreateLoad(getFloatTy(), V_21);
  auto* V_23 = CreateLoad(getFloatTy(), V_20);
  auto* V_24 = CreateFMul(V_22, V_23);
  auto* V_25 = CreateFAdd(V_17, V_24);
  auto* V_26 = CreateAdd(arg_1, getInt32(3));
  auto* V_27 = CreateZExt(V_26, getInt64Ty());
  auto* V_28 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), V_13, { getInt64(0), getInt32(0), getInt32(3), V_27 });
  auto* V_29 = CreateLoad(getFloatTy(), V_28);
  auto* V_30 = CreateInBoundsGEP(getFloatTy(), V_20, getInt64(1));
  auto* V_31 = CreateLoad(getFloatTy(), V_30);
  auto* V_32 = CreateFMul(V_29, V_31);
  auto* V_33 = CreateFAdd(V_25, V_32);
  auto* V_34 = CreateAdd(arg_1, getInt32(6));
  auto* V_35 = CreateZExt(V_34, getInt64Ty());
  auto* V_36 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), V_13, { getInt64(0), getInt32(0), getInt32(3), V_35 });
  auto* V_37 = CreateLoad(getFloatTy(), V_36);
  auto* V_38 = CreateInBoundsGEP(getFloatTy(), V_20, getInt64(2));
  auto* V_39 = CreateLoad(getFloatTy(), V_38);
  auto* V_40 = CreateFMul(V_37, V_39);
  auto* V_41 = CreateFAdd(V_33, V_40, _ReturnName);
  CreateBr(_JoinBB);
  V_17->addIncoming(V_16, BB_5);
  V_17->addIncoming(ConstantFP::get(*Ctx.getLLVMContext(), APFloat(APFloat::IEEEsingle(), APInt(32, 0x0))), BB_4);
  SetInsertPoint(_CurIP);
  return V_41;
}

auto* _getObjWorldAndWorldObj_Xe(Value* arg_0, Value* arg_1, Value* arg_2, Value* arg_3, const Twine& _ReturnName = "")
{
  auto* BB_4 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_4->splitBasicBlock(_CurIP, VALUE_NAME("_getObjWorldAndWorldObj_Xe.join"));
  BB_4->getTerminator()->eraseFromParent();
  auto* BB_5 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getObjWorldAndWorldObj_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_6 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getObjWorldAndWorldObj_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_7 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getObjWorldAndWorldObj_Xe."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_4);
  auto* V_8 = CreateICmpULT(arg_3, getInt32(3));
  CreateCondBr(V_8, BB_6, BB_5);
  SetInsertPoint(BB_6);
  auto* V_9 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_10 = CreateICmpEQ(arg_3, getInt32(1));
  auto* V_11 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  auto* V_12 = CreateSelect(V_10, V_11, V_9);
  auto* V_13 = CreateLoad(getInt64Ty(), V_12);
  auto* V_14 = CreateShl(V_13, getInt64(6));
  auto* V_15 = CreateAnd(V_14, getInt64(281474976710592));
  auto* V_16 = canonizePointer(V_15);
  auto* V_17 = CreateIntToPtr(V_16, PointerType::get(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), 1));
  auto* V_18 = CreateZExt(arg_1, getInt64Ty());
  auto* V_19 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), V_17, { getInt64(0), getInt32(1), getInt32(3), V_18 });
  auto* V_20 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), V_17, { getInt64(0), getInt32(0), getInt32(3), V_18 });
  auto* V_21 = CreateSelect(arg_2, V_19, V_20);
  auto* V_22 = CreateICmpUGT(arg_1, getInt32(8));
  auto* V_23 = CreateAdd(arg_1, getInt32(4294967287));
  auto* V_24 = CreateZExt(V_23, getInt64Ty());
  auto* V_25 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), V_17, { getInt64(0), getInt32(0), getInt32(6), V_24 });
  auto* V_26 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), V_17, { getInt64(0), getInt32(1), getInt32(6), V_24 });
  auto* V_27 = CreateSelect(arg_2, V_25, V_26);
  auto* V_28 = CreateSelect(V_22, V_27, V_21);
  auto* V_29 = CreateLoad(getFloatTy(), V_28);
  CreateBr(BB_7);
  SetInsertPoint(BB_7);
  auto* V_30 = CreatePHI(getFloatTy(), 2, _ReturnName);
  CreateBr(_JoinBB);
  SetInsertPoint(BB_5);
  auto* V_31 = CreateAnd(arg_1, getInt32(3));
  auto* V_32 = CreateICmpEQ(V_31, getInt32(0));
  auto* V_33 = CreateSelect(V_32, ConstantFP::get(*Ctx.getLLVMContext(), APFloat(APFloat::IEEEsingle(), APInt(32, 0x3f800000))), ConstantFP::get(*Ctx.getLLVMContext(), APFloat(APFloat::IEEEsingle(), APInt(32, 0x0))));
  CreateBr(BB_7);
  V_30->addIncoming(V_29, BB_6);
  V_30->addIncoming(V_33, BB_5);
  SetInsertPoint(_CurIP);
  return V_30;
}

auto* _getObjWorldAndWorldObj_Xe3(Value* arg_0, Value* arg_1, Value* arg_2, Value* arg_3, const Twine& _ReturnName = "")
{
  auto* BB_4 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_4->splitBasicBlock(_CurIP, VALUE_NAME("_getObjWorldAndWorldObj_Xe3.join"));
  BB_4->getTerminator()->eraseFromParent();
  auto* BB_5 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getObjWorldAndWorldObj_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_6 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getObjWorldAndWorldObj_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_7 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getObjWorldAndWorldObj_Xe3."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_4);
  auto* V_8 = CreateICmpULT(arg_3, getInt32(3));
  CreateCondBr(V_8, BB_6, BB_5);
  SetInsertPoint(BB_6);
  auto* V_9 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_10 = CreateICmpEQ(arg_3, getInt32(1));
  auto* V_11 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  auto* V_12 = CreateSelect(V_10, V_11, V_9);
  auto* V_13 = CreateLoad(getInt64Ty(), V_12);
  auto* V_14 = CreateAnd(V_13, getInt64(18446744073709551552u));
  auto* V_15 = CreateIntToPtr(V_14, PointerType::get(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), 1));
  auto* V_16 = CreateZExt(arg_1, getInt64Ty());
  auto* V_17 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), V_15, { getInt64(0), getInt32(1), getInt32(3), V_16 });
  auto* V_18 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), V_15, { getInt64(0), getInt32(0), getInt32(3), V_16 });
  auto* V_19 = CreateSelect(arg_2, V_17, V_18);
  auto* V_20 = CreateICmpUGT(arg_1, getInt32(8));
  auto* V_21 = CreateAdd(arg_1, getInt32(4294967287));
  auto* V_22 = CreateZExt(V_21, getInt64Ty());
  auto* V_23 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), V_15, { getInt64(0), getInt32(0), getInt32(6), V_22 });
  auto* V_24 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), V_15, { getInt64(0), getInt32(1), getInt32(6), V_22 });
  auto* V_25 = CreateSelect(arg_2, V_23, V_24);
  auto* V_26 = CreateSelect(V_20, V_25, V_19);
  auto* V_27 = CreateLoad(getFloatTy(), V_26);
  CreateBr(BB_7);
  SetInsertPoint(BB_7);
  auto* V_28 = CreatePHI(getFloatTy(), 2, _ReturnName);
  CreateBr(_JoinBB);
  SetInsertPoint(BB_5);
  auto* V_29 = CreateAnd(arg_1, getInt32(3));
  auto* V_30 = CreateICmpEQ(V_29, getInt32(0));
  auto* V_31 = CreateSelect(V_30, ConstantFP::get(*Ctx.getLLVMContext(), APFloat(APFloat::IEEEsingle(), APInt(32, 0x3f800000))), ConstantFP::get(*Ctx.getLLVMContext(), APFloat(APFloat::IEEEsingle(), APInt(32, 0x0))));
  CreateBr(BB_7);
  V_28->addIncoming(V_27, BB_6);
  V_28->addIncoming(V_31, BB_5);
  SetInsertPoint(_CurIP);
  return V_28;
}

auto* _getRayTCurrent_Xe(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(0) });
  auto* V_3 = CreateICmpEQ(arg_1, getInt32(3));
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(3) });
  auto* V_5 = CreateSelect(V_3, V_4, V_2);
  auto* V_6 = CreateICmpEQ(arg_1, getInt32(1));
  auto* V_7 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0) });
  auto* V_8 = CreateSelect(V_6, V_7, V_5);
  auto* V_9 = CreateLoad(getFloatTy(), V_8, _ReturnName);
  return V_9;
}

auto* _getRayTCurrent_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(0) });
  auto* V_3 = CreateICmpEQ(arg_1, getInt32(3));
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(3) });
  auto* V_5 = CreateSelect(V_3, V_4, V_2);
  auto* V_6 = CreateICmpEQ(arg_1, getInt32(1));
  auto* V_7 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0) });
  auto* V_8 = CreateSelect(V_6, V_7, V_5);
  auto* V_9 = CreateLoad(getFloatTy(), V_8, _ReturnName);
  return V_9;
}

auto* _getHitT_Xe(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(0) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateLoad(getFloatTy(), V_4, _ReturnName);
  return V_5;
}

auto* _getHitT_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(0) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateLoad(getFloatTy(), V_4, _ReturnName);
  return V_5;
}

void _setHitT_Xe(Value* arg_0, Value* arg_1, Value* arg_2)
{
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(0) });
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0) });
  auto* V_5 = CreateSelect(arg_2, V_4, V_3);
  CreateStore(arg_1, V_5);
  return;
}

void _setHitT_Xe3(Value* arg_0, Value* arg_1, Value* arg_2)
{
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(0) });
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0) });
  auto* V_5 = CreateSelect(arg_2, V_4, V_3);
  CreateStore(arg_1, V_5);
  return;
}

auto* _getInstanceIndex_Xe(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* BB_2 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_2->splitBasicBlock(_CurIP, VALUE_NAME("_getInstanceIndex_Xe.join"));
  BB_2->getTerminator()->eraseFromParent();
  auto* BB_3 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getInstanceIndex_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_4 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getInstanceIndex_Xe."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_2);
  auto* V_5 = CreateICmpULT(arg_1, getInt32(3));
  CreateCondBr(V_5, BB_3, BB_4);
  SetInsertPoint(BB_3);
  auto* V_6 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_7 = CreateICmpEQ(arg_1, getInt32(1));
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  auto* V_9 = CreateSelect(V_7, V_8, V_6);
  auto* V_10 = CreateLoad(getInt64Ty(), V_9);
  auto* V_11 = CreateShl(V_10, getInt64(6));
  auto* V_12 = CreateAnd(V_11, getInt64(281474976710592));
  auto* V_13 = canonizePointer(V_12);
  auto* V_14 = CreateIntToPtr(V_13, PointerType::get(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), 1));
  auto* V_15 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), V_14, { getInt64(0), getInt32(1), getInt32(2) });
  auto* V_16 = CreateLoad(getInt32Ty(), V_15);
  CreateBr(BB_4);
  SetInsertPoint(BB_4);
  auto* V_17 = CreatePHI(getInt32Ty(), 2, _ReturnName);
  CreateBr(_JoinBB);
  V_17->addIncoming(V_16, BB_3);
  V_17->addIncoming(getInt32(0), BB_2);
  SetInsertPoint(_CurIP);
  return V_17;
}

auto* _getInstanceIndex_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* BB_2 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_2->splitBasicBlock(_CurIP, VALUE_NAME("_getInstanceIndex_Xe3.join"));
  BB_2->getTerminator()->eraseFromParent();
  auto* BB_3 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getInstanceIndex_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_4 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getInstanceIndex_Xe3."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_2);
  auto* V_5 = CreateICmpULT(arg_1, getInt32(3));
  CreateCondBr(V_5, BB_3, BB_4);
  SetInsertPoint(BB_3);
  auto* V_6 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_7 = CreateICmpEQ(arg_1, getInt32(1));
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  auto* V_9 = CreateSelect(V_7, V_8, V_6);
  auto* V_10 = CreateLoad(getInt64Ty(), V_9);
  auto* V_11 = CreateAnd(V_10, getInt64(18446744073709551552u));
  auto* V_12 = CreateIntToPtr(V_11, PointerType::get(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), 1));
  auto* V_13 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), V_12, { getInt64(0), getInt32(1), getInt32(2) });
  auto* V_14 = CreateLoad(getInt32Ty(), V_13);
  CreateBr(BB_4);
  SetInsertPoint(BB_4);
  auto* V_15 = CreatePHI(getInt32Ty(), 2, _ReturnName);
  CreateBr(_JoinBB);
  V_15->addIncoming(V_14, BB_3);
  V_15->addIncoming(getInt32(0), BB_2);
  SetInsertPoint(_CurIP);
  return V_15;
}

auto* _getInstanceID_Xe(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* BB_2 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_2->splitBasicBlock(_CurIP, VALUE_NAME("_getInstanceID_Xe.join"));
  BB_2->getTerminator()->eraseFromParent();
  auto* BB_3 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getInstanceID_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_4 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getInstanceID_Xe."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_2);
  auto* V_5 = CreateICmpULT(arg_1, getInt32(3));
  CreateCondBr(V_5, BB_3, BB_4);
  SetInsertPoint(BB_3);
  auto* V_6 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_7 = CreateICmpEQ(arg_1, getInt32(1));
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  auto* V_9 = CreateSelect(V_7, V_8, V_6);
  auto* V_10 = CreateLoad(getInt64Ty(), V_9);
  auto* V_11 = CreateShl(V_10, getInt64(6));
  auto* V_12 = CreateAnd(V_11, getInt64(281474976710592));
  auto* V_13 = canonizePointer(V_12);
  auto* V_14 = CreateIntToPtr(V_13, PointerType::get(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), 1));
  auto* V_15 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf(*Ctx.getModule()), V_14, { getInt64(0), getInt32(1), getInt32(1) });
  auto* V_16 = CreateLoad(getInt32Ty(), V_15);
  CreateBr(BB_4);
  SetInsertPoint(BB_4);
  auto* V_17 = CreatePHI(getInt32Ty(), 2, _ReturnName);
  CreateBr(_JoinBB);
  V_17->addIncoming(V_16, BB_3);
  V_17->addIncoming(getInt32(0), BB_2);
  SetInsertPoint(_CurIP);
  return V_17;
}

auto* _getInstanceID_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* BB_2 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_2->splitBasicBlock(_CurIP, VALUE_NAME("_getInstanceID_Xe3.join"));
  BB_2->getTerminator()->eraseFromParent();
  auto* BB_3 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getInstanceID_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_4 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getInstanceID_Xe3."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_2);
  auto* V_5 = CreateICmpULT(arg_1, getInt32(3));
  CreateCondBr(V_5, BB_3, BB_4);
  SetInsertPoint(BB_3);
  auto* V_6 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_7 = CreateICmpEQ(arg_1, getInt32(1));
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  auto* V_9 = CreateSelect(V_7, V_8, V_6);
  auto* V_10 = CreateLoad(getInt64Ty(), V_9);
  auto* V_11 = CreateAnd(V_10, getInt64(18446744073709551552u));
  auto* V_12 = CreateIntToPtr(V_11, PointerType::get(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), 1));
  auto* V_13 = CreateInBoundsGEP(_igc_struct_RTStackFormat__InstanceLeaf_36(*Ctx.getModule()), V_12, { getInt64(0), getInt32(1), getInt32(1) });
  auto* V_14 = CreateLoad(getInt32Ty(), V_13);
  CreateBr(BB_4);
  SetInsertPoint(BB_4);
  auto* V_15 = CreatePHI(getInt32Ty(), 2, _ReturnName);
  CreateBr(_JoinBB);
  V_15->addIncoming(V_14, BB_3);
  V_15->addIncoming(getInt32(0), BB_2);
  SetInsertPoint(_CurIP);
  return V_15;
}

auto* _getPrimitiveIndex_Xe(Value* arg_0, Value* arg_1, Value* arg_2, const Twine& _ReturnName = "")
{
  auto* BB_3 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_3->splitBasicBlock(_CurIP, VALUE_NAME("_getPrimitiveIndex_Xe.join"));
  BB_3->getTerminator()->eraseFromParent();
  auto* BB_4 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getPrimitiveIndex_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_5 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getPrimitiveIndex_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_6 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getPrimitiveIndex_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_7 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getPrimitiveIndex_Xe."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_3);
  auto* V_8 = CreateICmpULT(arg_2, getInt32(3));
  CreateCondBr(V_8, BB_4, BB_7);
  SetInsertPoint(BB_4);
  auto* V_9 = CreateICmpEQ(arg_2, getInt32(1));
  auto* V_10 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(4) });
  auto* V_11 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(4) });
  auto* V_12 = CreateSelect(V_9, V_10, V_11);
  auto* V_13 = CreateLoad(getInt64Ty(), V_12);
  auto* V_14 = CreateShl(V_13, getInt64(6));
  auto* V_15 = CreateAnd(V_14, getInt64(281474976710592));
  auto* V_16 = canonizePointer(V_15);
  auto* V_17 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_18 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_19 = CreateSelect(V_9, V_17, V_18);
  auto* V_20 = CreateLoad(getInt32Ty(), V_19);
  auto* V_21 = CreateAnd(arg_1, getInt32(1));
  auto* V_22 = CreateICmpEQ(V_21, getInt32(0));
  CreateCondBr(V_22, BB_6, BB_5);
  SetInsertPoint(BB_6);
  auto* V_23 = CreateAnd(V_20, getInt32(65535));
  auto* V_24 = CreateIntToPtr(V_16, PointerType::get(_igc_struct_RTStackFormat__QuadLeaf(*Ctx.getModule()), 1));
  auto* V_25 = CreateInBoundsGEP(_igc_struct_RTStackFormat__QuadLeaf(*Ctx.getModule()), V_24, { getInt64(0), getInt32(1) });
  auto* V_26 = CreateLoad(getInt32Ty(), V_25);
  auto* V_27 = CreateAdd(V_26, V_23);
  CreateBr(BB_7);
  SetInsertPoint(BB_5);
  auto* V_28 = CreateLShr(V_20, getInt32(20));
  auto* V_29 = CreateAnd(V_28, getInt32(15));
  auto* V_30 = CreateIntToPtr(V_16, PointerType::get(_igc_struct_RTStackFormat__ProceduralLeaf(*Ctx.getModule()), 1));
  auto* V_31 = CreateZExt(V_29, getInt64Ty());
  auto* V_32 = CreateInBoundsGEP(_igc_struct_RTStackFormat__ProceduralLeaf(*Ctx.getModule()), V_30, { getInt64(0), getInt32(2), V_31 });
  auto* V_33 = CreateLoad(getInt32Ty(), V_32);
  CreateBr(BB_7);
  SetInsertPoint(BB_7);
  auto* V_34 = CreatePHI(getInt32Ty(), 3, _ReturnName);
  CreateBr(_JoinBB);
  V_34->addIncoming(getInt32(0), BB_3);
  V_34->addIncoming(V_33, BB_5);
  V_34->addIncoming(V_27, BB_6);
  SetInsertPoint(_CurIP);
  return V_34;
}

auto* _getPrimitiveIndex_Xe3(Value* arg_0, Value* arg_1, Value* arg_2, const Twine& _ReturnName = "")
{
  auto* BB_3 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_3->splitBasicBlock(_CurIP, VALUE_NAME("_getPrimitiveIndex_Xe3.join"));
  BB_3->getTerminator()->eraseFromParent();
  auto* BB_4 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getPrimitiveIndex_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_5 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getPrimitiveIndex_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_6 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getPrimitiveIndex_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_7 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getPrimitiveIndex_Xe3."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_3);
  auto* V_8 = CreateICmpULT(arg_2, getInt32(3));
  CreateCondBr(V_8, BB_4, BB_7);
  SetInsertPoint(BB_4);
  auto* V_9 = CreateICmpEQ(arg_2, getInt32(1));
  auto* V_10 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(4) });
  auto* V_11 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(4) });
  auto* V_12 = CreateSelect(V_9, V_10, V_11);
  auto* V_13 = CreateLoad(getInt64Ty(), V_12);
  auto* V_14 = CreateAnd(V_13, getInt64(18446744073709551552u));
  auto* V_15 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_16 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_17 = CreateSelect(V_9, V_15, V_16);
  auto* V_18 = CreateLoad(getInt32Ty(), V_17);
  auto* V_19 = CreateAnd(arg_1, getInt32(1));
  auto* V_20 = CreateICmpEQ(V_19, getInt32(0));
  CreateCondBr(V_20, BB_6, BB_5);
  SetInsertPoint(BB_6);
  auto* V_21 = CreateAnd(V_18, getInt32(31));
  auto* V_22 = CreateIntToPtr(V_14, PointerType::get(_igc_struct_RTStackFormat__QuadLeaf_57(*Ctx.getModule()), 1));
  auto* V_23 = CreateInBoundsGEP(_igc_struct_RTStackFormat__QuadLeaf_57(*Ctx.getModule()), V_22, { getInt64(0), getInt32(1) });
  auto* V_24 = CreateLoad(getInt32Ty(), V_23);
  auto* V_25 = CreateAdd(V_24, V_21);
  CreateBr(BB_7);
  SetInsertPoint(BB_5);
  auto* V_26 = CreateLShr(V_18, getInt32(20));
  auto* V_27 = CreateAnd(V_26, getInt32(15));
  auto* V_28 = CreateIntToPtr(V_14, PointerType::get(_igc_struct_RTStackFormat__ProceduralLeaf_55(*Ctx.getModule()), 1));
  auto* V_29 = CreateZExt(V_27, getInt64Ty());
  auto* V_30 = CreateInBoundsGEP(_igc_struct_RTStackFormat__ProceduralLeaf_55(*Ctx.getModule()), V_28, { getInt64(0), getInt32(2), V_29 });
  auto* V_31 = CreateLoad(getInt32Ty(), V_30);
  CreateBr(BB_7);
  SetInsertPoint(BB_7);
  auto* V_32 = CreatePHI(getInt32Ty(), 3, _ReturnName);
  CreateBr(_JoinBB);
  V_32->addIncoming(getInt32(0), BB_3);
  V_32->addIncoming(V_31, BB_5);
  V_32->addIncoming(V_25, BB_6);
  SetInsertPoint(_CurIP);
  return V_32;
}

auto* _getGeometryIndex_Xe(Value* arg_0, Value* arg_1, Value* arg_2, const Twine& _ReturnName = "")
{
  auto* BB_3 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_3->splitBasicBlock(_CurIP, VALUE_NAME("_getGeometryIndex_Xe.join"));
  BB_3->getTerminator()->eraseFromParent();
  auto* BB_4 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getGeometryIndex_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_5 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getGeometryIndex_Xe."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_3);
  auto* V_6 = CreateICmpULT(arg_2, getInt32(3));
  CreateCondBr(V_6, BB_4, BB_5);
  SetInsertPoint(BB_4);
  auto* V_7 = CreateICmpEQ(arg_2, getInt32(1));
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(4) });
  auto* V_9 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(4) });
  auto* V_10 = CreateSelect(V_7, V_8, V_9);
  auto* V_11 = CreateLoad(getInt64Ty(), V_10);
  auto* V_12 = CreateShl(V_11, getInt64(6));
  auto* V_13 = CreateAnd(V_12, getInt64(281474976710592));
  auto* V_14 = canonizePointer(V_13);
  auto* V_15 = CreateAnd(arg_1, getInt32(1));
  auto* V_16 = CreateICmpEQ(V_15, getInt32(0));
  auto* V_17 = CreateIntToPtr(V_14, PointerType::get(_igc_struct_RTStackFormat__ProceduralLeaf(*Ctx.getModule()), 1));
  auto* V_18 = CreateInBoundsGEP(_igc_struct_RTStackFormat__ProceduralLeaf(*Ctx.getModule()), V_17, { getInt64(0), getInt32(0), getInt32(1) });
  auto* V_19 = CreateIntToPtr(V_14, PointerType::get(_igc_struct_RTStackFormat__QuadLeaf(*Ctx.getModule()), 1));
  auto* V_20 = CreateInBoundsGEP(_igc_struct_RTStackFormat__QuadLeaf(*Ctx.getModule()), V_19, { getInt64(0), getInt32(0), getInt32(1) });
  auto* V_21 = CreateSelect(V_16, V_20, V_18);
  auto* V_22 = CreateLoad(getInt32Ty(), V_21);
  auto* V_23 = CreateAnd(V_22, getInt32(536870911));
  CreateBr(BB_5);
  SetInsertPoint(BB_5);
  auto* V_24 = CreatePHI(getInt32Ty(), 2, _ReturnName);
  CreateBr(_JoinBB);
  V_24->addIncoming(V_23, BB_4);
  V_24->addIncoming(getInt32(0), BB_3);
  SetInsertPoint(_CurIP);
  return V_24;
}

auto* _getGeometryIndex_Xe3(Value* arg_0, Value* arg_1, Value* arg_2, const Twine& _ReturnName = "")
{
  auto* BB_3 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_3->splitBasicBlock(_CurIP, VALUE_NAME("_getGeometryIndex_Xe3.join"));
  BB_3->getTerminator()->eraseFromParent();
  auto* BB_4 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getGeometryIndex_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_5 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_getGeometryIndex_Xe3."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_3);
  auto* V_6 = CreateICmpULT(arg_2, getInt32(3));
  CreateCondBr(V_6, BB_4, BB_5);
  SetInsertPoint(BB_4);
  auto* V_7 = CreateICmpEQ(arg_2, getInt32(1));
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(4) });
  auto* V_9 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(4) });
  auto* V_10 = CreateSelect(V_7, V_8, V_9);
  auto* V_11 = CreateLoad(getInt64Ty(), V_10);
  auto* V_12 = CreateAnd(V_11, getInt64(18446744073709551552u));
  auto* V_13 = CreateAnd(arg_1, getInt32(1));
  auto* V_14 = CreateICmpEQ(V_13, getInt32(0));
  auto* V_15 = CreateIntToPtr(V_12, PointerType::get(_igc_struct_RTStackFormat__ProceduralLeaf_55(*Ctx.getModule()), 1));
  auto* V_16 = CreateInBoundsGEP(_igc_struct_RTStackFormat__ProceduralLeaf_55(*Ctx.getModule()), V_15, { getInt64(0), getInt32(0), getInt32(1) });
  auto* V_17 = CreateIntToPtr(V_12, PointerType::get(_igc_struct_RTStackFormat__QuadLeaf_57(*Ctx.getModule()), 1));
  auto* V_18 = CreateInBoundsGEP(_igc_struct_RTStackFormat__QuadLeaf_57(*Ctx.getModule()), V_17, { getInt64(0), getInt32(0), getInt32(1) });
  auto* V_19 = CreateSelect(V_14, V_18, V_16);
  auto* V_20 = CreateLoad(getInt32Ty(), V_19);
  auto* V_21 = CreateAnd(V_20, getInt32(16777215));
  CreateBr(BB_5);
  SetInsertPoint(BB_5);
  auto* V_22 = CreatePHI(getInt32Ty(), 2, _ReturnName);
  CreateBr(_JoinBB);
  V_22->addIncoming(V_21, BB_4);
  V_22->addIncoming(getInt32(0), BB_3);
  SetInsertPoint(_CurIP);
  return V_22;
}

void _createPotentialHit2CommittedHit_Xe(Value* arg_0)
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(0) });
  auto* V_2 = CreateLoad(getFloatTy(), V_1);
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0) });
  CreateStore(V_2, V_3);
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(1) });
  auto* V_5 = CreateLoad(getFloatTy(), V_4);
  auto* V_6 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(1) });
  CreateStore(V_5, V_6);
  auto* V_7 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(2) });
  auto* V_8 = CreateLoad(getFloatTy(), V_7);
  auto* V_9 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(2) });
  CreateStore(V_8, V_9);
  auto* V_10 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_11 = CreateLoad(getInt32Ty(), V_10);
  auto* V_12 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  CreateStore(V_11, V_12);
  auto* V_13 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(4) });
  auto* V_14 = CreateLoad(getInt64Ty(), V_13);
  auto* V_15 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(4) });
  CreateStore(V_14, V_15);
  auto* V_16 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_17 = CreateLoad(getInt64Ty(), V_16);
  auto* V_18 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  CreateStore(V_17, V_18);
  return;
}

void _createPotentialHit2CommittedHit_Xe3(Value* arg_0)
{
  auto* V_1 = CreateBitCast(arg_0, PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()));
  auto* V_2 = CreateGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(0) });
  auto* V_3 = CreateBitCast(V_2, PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()));
  CreateIntrinsic(Intrinsic::memcpy, { PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()), PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()), getInt64Ty() }, { V_1, V_3, getInt64(32), getFalse() }, nullptr);
  return;
}

void _createTraceRayInlinePrologue_Xe(Value* arg_0, Value* arg_1, Value* arg_2, Value* arg_3, Value* arg_4, Value* arg_5, Value* arg_6, Value* arg_7, Value* arg_8)
{
  auto* BB_9 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_9->splitBasicBlock(_CurIP, VALUE_NAME("_createTraceRayInlinePrologue_Xe.join"));
  BB_9->getTerminator()->eraseFromParent();
  auto* BB_10 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_createTraceRayInlinePrologue_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_11 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_createTraceRayInlinePrologue_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_12 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_createTraceRayInlinePrologue_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_13 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_createTraceRayInlinePrologue_Xe."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_9);
  auto* V_14 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2) });
  auto* V_15 = CreateBitCast(V_14, PointerType::get(IGCLLVM::FixedVectorType::get(getFloatTy(), 8), arg_0->getType()->getPointerAddressSpace()));
  CreateStore(arg_1, V_15);
  CreateCondBr(arg_7, BB_10, BB_11);
  SetInsertPoint(BB_10);
  auto* V_16 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(4) });
  auto* V_17 = CreateBitCast(V_16, PointerType::get(_igc_igc_auto_struct_anon(*Ctx.getModule()), arg_0->getType()->getPointerAddressSpace()));
  auto* V_18 = CreateInBoundsGEP(_igc_igc_auto_struct_anon(*Ctx.getModule()), V_17, { getInt64(0), getInt32(3) });
  auto* V_19 = CreateLoad(getInt16Ty(), V_18);
  auto* V_20 = CreateZExt(V_19, getInt32Ty());
  auto* V_21 = CreateOr(V_20, arg_3);
  CreateBr(BB_11);
  SetInsertPoint(BB_11);
  auto* V_22 = CreatePHI(getInt32Ty(), 2);
  auto* V_23 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(4), getInt32(0), getInt32(0) });
  auto* V_24 = CreateAnd(arg_2, getInt64(281474976710655));
  auto* V_25 = CreateZExt(V_22, getInt64Ty());
  auto* V_26 = CreateShl(V_25, getInt64(48));
  auto* V_27 = CreateOr(V_26, V_24);
  CreateStore(V_27, V_23);
  auto* V_28 = supportStochasticLod();
  CreateCondBr(V_28, BB_12, BB_13);
  SetInsertPoint(BB_12);
  auto* V_29 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(5) });
  CreateStore(getInt64(0), V_29);
  auto* V_30 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(6) });
  auto* V_31 = CreateAnd(arg_5, getInt32(127));
  auto* V_32 = CreateZExt(V_31, getInt64Ty());
  auto* V_33 = CreateShl(V_32, getInt64(49));
  CreateStore(V_33, V_30);
  CreateBr(BB_13);
  SetInsertPoint(BB_13);
  auto* V_34 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(7), getInt32(0), getInt32(0) });
  auto* V_35 = CreateAnd(arg_4, getInt32(255));
  auto* V_36 = CreateZExt(V_35, getInt64Ty());
  auto* V_37 = CreateShl(V_36, getInt64(48));
  CreateStore(V_37, V_34);
  auto* V_38 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0) });
  CreateStore(arg_6, V_38);
  auto* V_39 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(1) });
  CreateStore(ConstantFP::get(*Ctx.getLLVMContext(), APFloat(APFloat::IEEEsingle(), APInt(32, 0x0))), V_39);
  auto* V_40 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(2) });
  CreateStore(ConstantFP::get(*Ctx.getLLVMContext(), APFloat(APFloat::IEEEsingle(), APInt(32, 0x0))), V_40);
  auto* V_41 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  CreateStore(getInt32(0), V_41);
  auto* V_42 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_43 = CreateSelect(arg_8, getInt32(268435456), getInt32(0));
  CreateStore(V_43, V_42);
  CreateBr(_JoinBB);
  V_22->addIncoming(V_21, BB_10);
  V_22->addIncoming(arg_3, BB_9);
  SetInsertPoint(_CurIP);
}

void _createTraceRayInlinePrologue_Xe3(Value* arg_0, Value* arg_1, Value* arg_2, Value* arg_3, Value* arg_4, Value* arg_5, Value* arg_6, Value* arg_7, Value* arg_8)
{
  auto* BB_9 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_9->splitBasicBlock(_CurIP, VALUE_NAME("_createTraceRayInlinePrologue_Xe3.join"));
  BB_9->getTerminator()->eraseFromParent();
  auto* BB_10 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_createTraceRayInlinePrologue_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_11 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_createTraceRayInlinePrologue_Xe3."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_9);
  auto* V_12 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2) });
  auto* V_13 = CreateBitCast(V_12, PointerType::get(IGCLLVM::FixedVectorType::get(getFloatTy(), 8), arg_0->getType()->getPointerAddressSpace()));
  CreateStore(arg_1, V_13);
  CreateCondBr(arg_7, BB_10, BB_11);
  SetInsertPoint(BB_10);
  auto* V_14 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(6) });
  auto* V_15 = CreateBitCast(V_14, PointerType::get(getInt16Ty(), arg_0->getType()->getPointerAddressSpace()));
  auto* V_16 = CreateLoad(getInt16Ty(), V_15);
  auto* V_17 = CreateZExt(V_16, getInt32Ty());
  auto* V_18 = CreateOr(V_17, arg_3);
  CreateBr(BB_11);
  SetInsertPoint(BB_11);
  auto* V_19 = CreatePHI(getInt32Ty(), 2);
  auto* V_20 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(4) });
  CreateStore(arg_2, V_20);
  auto* V_21 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(5), getInt32(0), getInt32(0) });
  CreateStore(getInt64(0), V_21);
  auto* V_22 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(6), getInt32(0), getInt32(0) });
  auto* V_23 = CreateAnd(V_19, getInt32(65535));
  auto* V_24 = CreateShl(arg_4, getInt32(16));
  auto* V_25 = CreateAnd(V_24, getInt32(16711680));
  auto* V_26 = CreateShl(arg_5, getInt32(24));
  auto* V_27 = CreateAnd(V_26, getInt32(2130706432));
  auto* V_28 = CreateOr(V_27, V_25);
  auto* V_29 = CreateOr(V_28, V_23);
  CreateStore(V_29, V_22);
  auto* V_30 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(7) });
  CreateStore(getInt32(0), V_30);
  auto* V_31 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(8) });
  CreateStore(getInt32(0), V_31);
  auto* V_32 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(9) });
  CreateStore(ConstantFP::get(*Ctx.getLLVMContext(), APFloat(APFloat::IEEEsingle(), APInt(32, 0x0))), V_32);
  auto* V_33 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0) });
  CreateStore(arg_6, V_33);
  auto* V_34 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  CreateStore(getInt32(0), V_34);
  auto* V_35 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_36 = CreateSelect(arg_8, getInt32(268435456), getInt32(0));
  CreateStore(V_36, V_35);
  CreateBr(_JoinBB);
  V_19->addIncoming(V_18, BB_10);
  V_19->addIncoming(arg_3, BB_9);
  SetInsertPoint(_CurIP);
}

void _emitSingleRQMemRayWrite_Xe(Value* arg_0, Value* arg_1, Value* arg_2)
{
  auto* BB_3 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_3->splitBasicBlock(_CurIP, VALUE_NAME("_emitSingleRQMemRayWrite_Xe.join"));
  BB_3->getTerminator()->eraseFromParent();
  auto* BB_4 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_emitSingleRQMemRayWrite_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_5 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_emitSingleRQMemRayWrite_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_6 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_emitSingleRQMemRayWrite_Xe."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_3);
  auto* V_7 = CreateGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(0), getInt64(0) });
  auto* V_8 = CreateBitCast(V_7, PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()));
  auto* V_9 = CreateGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(2), getInt32(0), getInt64(0) });
  auto* V_10 = CreateBitCast(V_9, PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()));
  CreateIntrinsic(Intrinsic::memcpy, { PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()), PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()), getInt64Ty() }, { V_8, V_10, getInt64(32), getFalse() }, nullptr);
  auto* V_11 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(2), getInt32(0), getInt64(8) });
  auto* V_12 = CreateBitCast(V_11, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_13 = CreateLoad(getInt32Ty(), V_12);
  auto* V_14 = CreateInsertElement(UndefValue::get(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8)), V_13, getInt64(0));
  auto* V_15 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(2), getInt32(0), getInt64(9) });
  auto* V_16 = CreateBitCast(V_15, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_17 = CreateLoad(getInt32Ty(), V_16);
  auto* V_18 = CreateInsertElement(V_14, V_17, getInt64(1));
  CreateCondBr(arg_2, BB_4, BB_5);
  SetInsertPoint(BB_4);
  auto* V_19 = CreateShuffleVector(V_18, ConstantVector::get({ UndefValue::get(getInt32Ty()), UndefValue::get(getInt32Ty()), getInt32(0), getInt32(0), getInt32(0), getInt32(0), UndefValue::get(getInt32Ty()), UndefValue::get(getInt32Ty()) }), ConstantVector::get({ getInt32(0), getInt32(1), getInt32(10), getInt32(11), getInt32(12), getInt32(13), getInt32(6), getInt32(7) }));
  CreateBr(BB_6);
  SetInsertPoint(BB_6);
  auto* V_20 = CreatePHI(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8), 2);
  auto* V_21 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(2), getInt32(0), getInt64(14) });
  auto* V_22 = CreateBitCast(V_21, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_23 = CreateLoad(getInt32Ty(), V_22);
  auto* V_24 = CreateInsertElement(V_20, V_23, getInt64(6));
  auto* V_25 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(2), getInt32(0), getInt64(15) });
  auto* V_26 = CreateBitCast(V_25, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_27 = CreateLoad(getInt32Ty(), V_26);
  auto* V_28 = CreateInsertElement(V_24, V_27, getInt64(7));
  auto* V_29 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(0), getInt64(8) });
  auto* V_30 = CreateBitCast(V_29, PointerType::get(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8), arg_0->getType()->getPointerAddressSpace()));
  CreateStore(V_28, V_30);
  CreateBr(_JoinBB);
  SetInsertPoint(BB_5);
  auto* V_31 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(2), getInt32(0), getInt64(10) });
  auto* V_32 = CreateBitCast(V_31, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_33 = CreateLoad(getInt32Ty(), V_32);
  auto* V_34 = CreateInsertElement(V_18, V_33, getInt64(2));
  auto* V_35 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(2), getInt32(0), getInt64(11) });
  auto* V_36 = CreateBitCast(V_35, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_37 = CreateLoad(getInt32Ty(), V_36);
  auto* V_38 = CreateInsertElement(V_34, V_37, getInt64(3));
  auto* V_39 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(2), getInt32(0), getInt64(12) });
  auto* V_40 = CreateBitCast(V_39, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_41 = CreateLoad(getInt32Ty(), V_40);
  auto* V_42 = CreateInsertElement(V_38, V_41, getInt64(4));
  auto* V_43 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(2), getInt32(0), getInt64(13) });
  auto* V_44 = CreateBitCast(V_43, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_45 = CreateLoad(getInt32Ty(), V_44);
  auto* V_46 = CreateInsertElement(V_42, V_45, getInt64(5));
  CreateBr(BB_6);
  V_20->addIncoming(V_19, BB_4);
  V_20->addIncoming(V_46, BB_5);
  SetInsertPoint(_CurIP);
}

void _emitSingleRQMemRayWrite_Xe3(Value* arg_0, Value* arg_1)
{
  auto* V_2 = CreateGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(0), getInt64(0) });
  auto* V_3 = CreateBitCast(V_2, PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()));
  auto* V_4 = CreateGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(2), getInt32(0), getInt64(0) });
  auto* V_5 = CreateBitCast(V_4, PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()));
  CreateIntrinsic(Intrinsic::memcpy, { PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()), PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()), getInt64Ty() }, { V_3, V_5, getInt64(32), getFalse() }, nullptr);
  auto* V_6 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(2), getInt32(0), getInt64(8) });
  auto* V_7 = CreateBitCast(V_6, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_8 = CreateLoad(getInt32Ty(), V_7);
  auto* V_9 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(2), getInt32(0), getInt64(9) });
  auto* V_10 = CreateBitCast(V_9, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_11 = CreateLoad(getInt32Ty(), V_10);
  auto* V_12 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(2), getInt32(0), getInt64(12) });
  auto* V_13 = CreateBitCast(V_12, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_14 = CreateLoad(getInt32Ty(), V_13);
  auto* V_15 = CreateInsertElement(ConstantVector::get({ UndefValue::get(getInt32Ty()), UndefValue::get(getInt32Ty()), getInt32(0), getInt32(0), UndefValue::get(getInt32Ty()), getInt32(0), getInt32(0), getInt32(0) }), V_8, getInt64(0));
  auto* V_16 = CreateInsertElement(V_15, V_11, getInt64(1));
  auto* V_17 = CreateInsertElement(V_16, V_14, getInt64(4));
  auto* V_18 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(2), getInt32(0), getInt64(8) });
  auto* V_19 = CreateBitCast(V_18, PointerType::get(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8), arg_0->getType()->getPointerAddressSpace()));
  CreateStore(V_17, V_19);
  return;
}

void _copyMemHitInProceed_Xe(Value* arg_0, Value* arg_1, Value* arg_2)
{
  auto* BB_3 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_3->splitBasicBlock(_CurIP, VALUE_NAME("_copyMemHitInProceed_Xe.join"));
  BB_3->getTerminator()->eraseFromParent();
  auto* BB_4 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_copyMemHitInProceed_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_5 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_copyMemHitInProceed_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_6 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_copyMemHitInProceed_Xe."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_3);
  auto* V_7 = CreateBitCast(arg_1, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  CreateCondBr(arg_2, BB_4, BB_5);
  SetInsertPoint(BB_4);
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_9 = CreateLoad(getInt32Ty(), V_8);
  auto* V_10 = CreateInsertElement(ConstantVector::get({ getInt32(0), getInt32(0), getInt32(0), UndefValue::get(getInt32Ty()), getInt32(0), getInt32(0), getInt32(0), getInt32(0) }), V_9, getInt64(3));
  auto* V_11 = CreateBitCast(arg_0, PointerType::get(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8), arg_0->getType()->getPointerAddressSpace()));
  CreateStore(V_10, V_11);
  auto* V_12 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1) });
  auto* V_13 = CreateBitCast(V_12, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_14 = CreateLoad(getInt32Ty(), V_13);
  auto* V_15 = CreateInsertElement(ConstantVector::get({ UndefValue::get(getInt32Ty()), getInt32(0), getInt32(0), UndefValue::get(getInt32Ty()), getInt32(0), getInt32(0), getInt32(0), getInt32(0) }), V_14, getInt64(0));
  CreateBr(BB_6);
  SetInsertPoint(BB_6);
  auto* V_16 = CreatePHI(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8), 2);
  auto* V_17 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_18 = CreateLoad(getInt32Ty(), V_17);
  auto* V_19 = CreateOr(V_18, getInt32(268435456));
  auto* V_20 = CreateInsertElement(V_16, V_19, getInt64(3));
  auto* V_21 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1) });
  auto* V_22 = CreateBitCast(V_21, PointerType::get(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8), arg_0->getType()->getPointerAddressSpace()));
  CreateStore(V_20, V_22);
  CreateBr(_JoinBB);
  SetInsertPoint(BB_5);
  auto* V_23 = CreateLoad(getInt32Ty(), V_7);
  auto* V_24 = CreateInsertElement(UndefValue::get(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8)), V_23, getInt64(0));
  auto* V_25 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(0), getInt32(1) });
  auto* V_26 = CreateBitCast(V_25, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_27 = CreateLoad(getInt32Ty(), V_26);
  auto* V_28 = CreateInsertElement(V_24, V_27, getInt64(1));
  auto* V_29 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(0), getInt32(2) });
  auto* V_30 = CreateBitCast(V_29, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_31 = CreateLoad(getInt32Ty(), V_30);
  auto* V_32 = CreateInsertElement(V_28, V_31, getInt64(2));
  auto* V_33 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(0), getInt32(4) });
  auto* V_34 = CreateBitCast(V_33, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_35 = CreateLoad(getInt32Ty(), V_34);
  auto* V_36 = CreateInsertElement(V_32, V_35, getInt64(4));
  auto* V_37 = CreateInBoundsGEP(getInt32Ty(), V_7, getInt64(5));
  auto* V_38 = CreateLoad(getInt32Ty(), V_37);
  auto* V_39 = CreateInsertElement(V_36, V_38, getInt64(5));
  auto* V_40 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(0), getInt32(5) });
  auto* V_41 = CreateBitCast(V_40, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_42 = CreateLoad(getInt32Ty(), V_41);
  auto* V_43 = CreateInsertElement(V_39, V_42, getInt64(6));
  auto* V_44 = CreateInBoundsGEP(getInt32Ty(), V_7, getInt64(7));
  auto* V_45 = CreateLoad(getInt32Ty(), V_44);
  auto* V_46 = CreateInsertElement(V_43, V_45, getInt64(7));
  auto* V_47 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_48 = CreateLoad(getInt32Ty(), V_47);
  auto* V_49 = CreateInsertElement(V_46, V_48, getInt64(3));
  auto* V_50 = CreateBitCast(arg_0, PointerType::get(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8), arg_0->getType()->getPointerAddressSpace()));
  CreateStore(V_49, V_50);
  auto* V_51 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1) });
  auto* V_52 = CreateBitCast(V_51, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_53 = CreateLoad(getInt32Ty(), V_52);
  auto* V_54 = CreateInsertElement(UndefValue::get(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8)), V_53, getInt64(0));
  auto* V_55 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1), getInt32(1) });
  auto* V_56 = CreateBitCast(V_55, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_57 = CreateLoad(getInt32Ty(), V_56);
  auto* V_58 = CreateInsertElement(V_54, V_57, getInt64(1));
  auto* V_59 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1), getInt32(2) });
  auto* V_60 = CreateBitCast(V_59, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_61 = CreateLoad(getInt32Ty(), V_60);
  auto* V_62 = CreateInsertElement(V_58, V_61, getInt64(2));
  auto* V_63 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1), getInt32(4) });
  auto* V_64 = CreateBitCast(V_63, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_65 = CreateLoad(getInt32Ty(), V_64);
  auto* V_66 = CreateInsertElement(V_62, V_65, getInt64(4));
  auto* V_67 = CreateInBoundsGEP(getInt32Ty(), V_52, getInt64(5));
  auto* V_68 = CreateLoad(getInt32Ty(), V_67);
  auto* V_69 = CreateInsertElement(V_66, V_68, getInt64(5));
  auto* V_70 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_71 = CreateBitCast(V_70, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_72 = CreateLoad(getInt32Ty(), V_71);
  auto* V_73 = CreateInsertElement(V_69, V_72, getInt64(6));
  auto* V_74 = CreateInBoundsGEP(getInt32Ty(), V_52, getInt64(7));
  auto* V_75 = CreateLoad(getInt32Ty(), V_74);
  auto* V_76 = CreateInsertElement(V_73, V_75, getInt64(7));
  CreateBr(BB_6);
  V_16->addIncoming(V_15, BB_4);
  V_16->addIncoming(V_76, BB_5);
  SetInsertPoint(_CurIP);
}

void _copyMemHitInProceed_Xe3(Value* arg_0, Value* arg_1, Value* arg_2)
{
  auto* BB_3 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_3->splitBasicBlock(_CurIP, VALUE_NAME("_copyMemHitInProceed_Xe3.join"));
  BB_3->getTerminator()->eraseFromParent();
  auto* BB_4 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_copyMemHitInProceed_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_5 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_copyMemHitInProceed_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_6 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_copyMemHitInProceed_Xe3."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_3);
  auto* V_7 = CreateBitCast(arg_1, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  CreateCondBr(arg_2, BB_4, BB_5);
  SetInsertPoint(BB_4);
  auto* V_8 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_9 = CreateLoad(getInt32Ty(), V_8);
  auto* V_10 = CreateInsertElement(ConstantVector::get({ getInt32(0), getInt32(0), getInt32(0), UndefValue::get(getInt32Ty()), getInt32(0), getInt32(0), getInt32(0), getInt32(0) }), V_9, getInt64(3));
  auto* V_11 = CreateBitCast(arg_0, PointerType::get(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8), arg_0->getType()->getPointerAddressSpace()));
  CreateStore(V_10, V_11);
  auto* V_12 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1) });
  auto* V_13 = CreateBitCast(V_12, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_14 = CreateLoad(getInt32Ty(), V_13);
  auto* V_15 = CreateInsertElement(ConstantVector::get({ UndefValue::get(getInt32Ty()), getInt32(0), getInt32(0), UndefValue::get(getInt32Ty()), getInt32(0), getInt32(0), getInt32(0), getInt32(0) }), V_14, getInt64(0));
  CreateBr(BB_6);
  SetInsertPoint(BB_6);
  auto* V_16 = CreatePHI(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8), 2);
  auto* V_17 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_18 = CreateLoad(getInt32Ty(), V_17);
  auto* V_19 = CreateOr(V_18, getInt32(268435456));
  auto* V_20 = CreateInsertElement(V_16, V_19, getInt64(3));
  auto* V_21 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1) });
  auto* V_22 = CreateBitCast(V_21, PointerType::get(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8), arg_0->getType()->getPointerAddressSpace()));
  CreateStore(V_20, V_22);
  CreateBr(_JoinBB);
  SetInsertPoint(BB_5);
  auto* V_23 = CreateLoad(getInt32Ty(), V_7);
  auto* V_24 = CreateInsertElement(UndefValue::get(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8)), V_23, getInt64(0));
  auto* V_25 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(0), getInt32(1) });
  auto* V_26 = CreateLoad(getInt32Ty(), V_25);
  auto* V_27 = CreateInsertElement(V_24, V_26, getInt64(1));
  auto* V_28 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(0), getInt32(2) });
  auto* V_29 = CreateLoad(getInt32Ty(), V_28);
  auto* V_30 = CreateInsertElement(V_27, V_29, getInt64(2));
  auto* V_31 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(0), getInt32(4) });
  auto* V_32 = CreateBitCast(V_31, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_33 = CreateLoad(getInt32Ty(), V_32);
  auto* V_34 = CreateInsertElement(V_30, V_33, getInt64(4));
  auto* V_35 = CreateInBoundsGEP(getInt32Ty(), V_7, getInt64(5));
  auto* V_36 = CreateLoad(getInt32Ty(), V_35);
  auto* V_37 = CreateInsertElement(V_34, V_36, getInt64(5));
  auto* V_38 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(0), getInt32(5) });
  auto* V_39 = CreateBitCast(V_38, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_40 = CreateLoad(getInt32Ty(), V_39);
  auto* V_41 = CreateInsertElement(V_37, V_40, getInt64(6));
  auto* V_42 = CreateInBoundsGEP(getInt32Ty(), V_7, getInt64(7));
  auto* V_43 = CreateLoad(getInt32Ty(), V_42);
  auto* V_44 = CreateInsertElement(V_41, V_43, getInt64(7));
  auto* V_45 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_46 = CreateLoad(getInt32Ty(), V_45);
  auto* V_47 = CreateInsertElement(V_44, V_46, getInt64(3));
  auto* V_48 = CreateBitCast(arg_0, PointerType::get(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8), arg_0->getType()->getPointerAddressSpace()));
  CreateStore(V_47, V_48);
  auto* V_49 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1) });
  auto* V_50 = CreateBitCast(V_49, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_51 = CreateLoad(getInt32Ty(), V_50);
  auto* V_52 = CreateInsertElement(UndefValue::get(IGCLLVM::FixedVectorType::get(getInt32Ty(), 8)), V_51, getInt64(0));
  auto* V_53 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1), getInt32(1) });
  auto* V_54 = CreateLoad(getInt32Ty(), V_53);
  auto* V_55 = CreateInsertElement(V_52, V_54, getInt64(1));
  auto* V_56 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1), getInt32(2) });
  auto* V_57 = CreateLoad(getInt32Ty(), V_56);
  auto* V_58 = CreateInsertElement(V_55, V_57, getInt64(2));
  auto* V_59 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1), getInt32(4) });
  auto* V_60 = CreateBitCast(V_59, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_61 = CreateLoad(getInt32Ty(), V_60);
  auto* V_62 = CreateInsertElement(V_58, V_61, getInt64(4));
  auto* V_63 = CreateInBoundsGEP(getInt32Ty(), V_50, getInt64(5));
  auto* V_64 = CreateLoad(getInt32Ty(), V_63);
  auto* V_65 = CreateInsertElement(V_62, V_64, getInt64(5));
  auto* V_66 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_67 = CreateBitCast(V_66, PointerType::get(getInt32Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_68 = CreateLoad(getInt32Ty(), V_67);
  auto* V_69 = CreateInsertElement(V_65, V_68, getInt64(6));
  auto* V_70 = CreateInBoundsGEP(getInt32Ty(), V_50, getInt64(7));
  auto* V_71 = CreateLoad(getInt32Ty(), V_70);
  auto* V_72 = CreateInsertElement(V_69, V_71, getInt64(7));
  CreateBr(BB_6);
  V_16->addIncoming(V_15, BB_4);
  V_16->addIncoming(V_72, BB_5);
  SetInsertPoint(_CurIP);
}

auto* _syncStackToShadowMemory_Xe(Value* arg_0, Value* arg_1, Value* arg_2, Value* arg_3, const Twine& _ReturnName = "")
{
  auto* BB_4 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_4->splitBasicBlock(_CurIP, VALUE_NAME("_syncStackToShadowMemory_Xe.join"));
  BB_4->getTerminator()->eraseFromParent();
  auto* BB_5 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_syncStackToShadowMemory_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_6 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_syncStackToShadowMemory_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_7 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_syncStackToShadowMemory_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_8 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_syncStackToShadowMemory_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_9 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_syncStackToShadowMemory_Xe."), _JoinBB->getParent(), _JoinBB);
  auto* BB_10 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_syncStackToShadowMemory_Xe."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_4);
  auto* V_11 = CreateBitCast(arg_1, PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_12 = CreateBitCast(arg_0, PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()));
  auto* V_13 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_14 = CreateLoad(getInt32Ty(), V_13);
  auto* V_15 = CreateAnd(V_14, getInt32(268435456));
  auto* V_16 = CreateICmpEQ(V_15, getInt32(0));
  CreateCondBr(V_16, BB_5, BB_10);
  SetInsertPoint(BB_5);
  createReadSyncTraceRay(arg_2);
  CreateStore(getInt32(3), arg_3);
  auto* V_17 = CreateGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1), getInt32(0) });
  auto* V_18 = CreateBitCast(V_17, PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_19 = CreateGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(0) });
  auto* V_20 = CreateBitCast(V_19, PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()));
  CreateIntrinsic(Intrinsic::memcpy, { PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()), PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()), getInt64Ty() }, { V_18, V_20, getInt64(32), getFalse() }, nullptr);
  auto* V_21 = CreateGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(3), getInt32(0), getInt64(0) });
  auto* V_22 = CreateBitCast(V_21, PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_23 = CreateGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(3), getInt32(0), getInt64(0) });
  auto* V_24 = CreateBitCast(V_23, PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()));
  CreateIntrinsic(Intrinsic::memcpy, { PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()), PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()), getInt64Ty() }, { V_22, V_24, getInt64(24), getFalse() }, nullptr);
  auto* V_25 = isRayQueryReturnOptimizationEnabled();
  CreateCondBr(V_25, BB_6, BB_7);
  SetInsertPoint(BB_6);
  auto* V_26 = CreateLoad(getInt32Ty(), V_13);
  auto* V_27 = CreateShl(arg_2, getInt32(28));
  auto* V_28 = CreateAnd(V_27, getInt32(268435456));
  auto* V_29 = CreateAnd(V_26, getInt32(4025614335));
  auto* V_30 = CreateAnd(arg_2, getInt32(8));
  auto* V_31 = CreateICmpEQ(V_30, getInt32(0));
  auto* V_32 = CreateSelect(V_31, getInt32(524288), getInt32(393216));
  auto* V_33 = CreateOr(V_32, V_28);
  auto* V_34 = CreateOr(V_33, V_29);
  auto* V_35 = CreateXor(V_34, getInt32(268435456));
  CreateStore(V_35, V_13);
  auto* V_36 = CreateAnd(arg_2, getInt32(6));
  auto* V_37 = CreateICmpEQ(V_36, getInt32(0));
  auto* V_38 = CreateICmpNE(V_28, getInt32(0));
  CreateCondBr(V_37, BB_10, BB_9);
  SetInsertPoint(BB_9);
  CreateIntrinsic(Intrinsic::memcpy, { PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()), PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()), getInt64Ty() }, { V_11, V_12, getInt64(32), getFalse() }, nullptr);
  auto* V_39 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_40 = CreateLoad(getInt32Ty(), V_39);
  auto* V_41 = CreateICmpEQ(V_36, getInt32(2));
  auto* V_42 = CreateAnd(V_40, getInt32(4293984255));
  auto* V_43 = CreateSelect(V_41, getInt32(589824), getInt32(458752));
  auto* V_44 = CreateOr(V_42, V_43);
  CreateStore(V_44, V_39);
  CreateBr(BB_10);
  SetInsertPoint(BB_7);
  auto* V_45 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_46 = CreateLoad(getInt32Ty(), V_45);
  auto* V_47 = CreateAnd(V_46, getInt32(65536));
  auto* V_48 = CreateLoad(getInt32Ty(), V_13);
  auto* V_49 = CreateICmpEQ(V_47, getInt32(0));
  auto* V_50 = CreateAnd(V_48, getInt32(268435456));
  auto* V_51 = CreateICmpEQ(V_50, getInt32(0));
  CreateCondBr(V_49, BB_10, BB_8);
  SetInsertPoint(BB_8);
  CreateIntrinsic(Intrinsic::memcpy, { PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()), PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()), getInt64Ty() }, { V_11, V_12, getInt64(32), getFalse() }, nullptr);
  CreateBr(BB_10);
  SetInsertPoint(BB_10);
  auto* V_52 = CreatePHI(getInt1Ty(), 5, _ReturnName);
  CreateBr(_JoinBB);
  V_52->addIncoming(V_38, BB_9);
  V_52->addIncoming(V_38, BB_6);
  V_52->addIncoming(getFalse(), BB_4);
  V_52->addIncoming(V_51, BB_7);
  V_52->addIncoming(V_51, BB_8);
  SetInsertPoint(_CurIP);
  return V_52;
}

auto* _syncStackToShadowMemory_Xe3(Value* arg_0, Value* arg_1, Value* arg_2, Value* arg_3, const Twine& _ReturnName = "")
{
  auto* BB_4 = GetInsertBlock();
  auto* _CurIP = &*GetInsertPoint();
  auto *_JoinBB = BB_4->splitBasicBlock(_CurIP, VALUE_NAME("_syncStackToShadowMemory_Xe3.join"));
  BB_4->getTerminator()->eraseFromParent();
  auto* BB_5 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_syncStackToShadowMemory_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_6 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_syncStackToShadowMemory_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_7 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_syncStackToShadowMemory_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_8 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_syncStackToShadowMemory_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_9 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_syncStackToShadowMemory_Xe3."), _JoinBB->getParent(), _JoinBB);
  auto* BB_10 = BasicBlock::Create(*Ctx.getLLVMContext(), VALUE_NAME("_syncStackToShadowMemory_Xe3."), _JoinBB->getParent(), _JoinBB);
  SetInsertPoint(BB_4);
  auto* V_11 = CreateBitCast(arg_1, PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_12 = CreateBitCast(arg_0, PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()));
  auto* V_13 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_14 = CreateLoad(getInt32Ty(), V_13);
  auto* V_15 = CreateAnd(V_14, getInt32(268435456));
  auto* V_16 = CreateICmpEQ(V_15, getInt32(0));
  CreateCondBr(V_16, BB_5, BB_10);
  SetInsertPoint(BB_5);
  createReadSyncTraceRay(arg_2);
  CreateStore(getInt32(3), arg_3);
  auto* V_17 = CreateGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(1), getInt32(0) });
  auto* V_18 = CreateBitCast(V_17, PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_19 = CreateGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(0) });
  auto* V_20 = CreateBitCast(V_19, PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()));
  CreateIntrinsic(Intrinsic::memcpy, { PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()), PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()), getInt64Ty() }, { V_18, V_20, getInt64(32), getFalse() }, nullptr);
  auto* V_21 = CreateGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(3), getInt32(0), getInt64(0) });
  auto* V_22 = CreateBitCast(V_21, PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()));
  auto* V_23 = CreateGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(3), getInt32(0), getInt64(0) });
  auto* V_24 = CreateBitCast(V_23, PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()));
  CreateIntrinsic(Intrinsic::memcpy, { PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()), PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()), getInt64Ty() }, { V_22, V_24, getInt64(24), getFalse() }, nullptr);
  auto* V_25 = isRayQueryReturnOptimizationEnabled();
  CreateCondBr(V_25, BB_6, BB_7);
  SetInsertPoint(BB_6);
  auto* V_26 = CreateLoad(getInt32Ty(), V_13);
  auto* V_27 = CreateShl(arg_2, getInt32(28));
  auto* V_28 = CreateAnd(V_27, getInt32(268435456));
  auto* V_29 = CreateAnd(V_26, getInt32(4025614335));
  auto* V_30 = CreateAnd(arg_2, getInt32(8));
  auto* V_31 = CreateICmpEQ(V_30, getInt32(0));
  auto* V_32 = CreateSelect(V_31, getInt32(524288), getInt32(393216));
  auto* V_33 = CreateOr(V_32, V_28);
  auto* V_34 = CreateOr(V_33, V_29);
  auto* V_35 = CreateXor(V_34, getInt32(268435456));
  CreateStore(V_35, V_13);
  auto* V_36 = CreateAnd(arg_2, getInt32(6));
  auto* V_37 = CreateICmpEQ(V_36, getInt32(0));
  auto* V_38 = CreateICmpNE(V_28, getInt32(0));
  CreateCondBr(V_37, BB_10, BB_9);
  SetInsertPoint(BB_9);
  CreateIntrinsic(Intrinsic::memcpy, { PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()), PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()), getInt64Ty() }, { V_11, V_12, getInt64(32), getFalse() }, nullptr);
  auto* V_39 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_1, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_40 = CreateLoad(getInt32Ty(), V_39);
  auto* V_41 = CreateICmpEQ(V_36, getInt32(2));
  auto* V_42 = CreateAnd(V_40, getInt32(4293984255));
  auto* V_43 = CreateSelect(V_41, getInt32(589824), getInt32(458752));
  auto* V_44 = CreateOr(V_42, V_43);
  CreateStore(V_44, V_39);
  CreateBr(BB_10);
  SetInsertPoint(BB_7);
  auto* V_45 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_46 = CreateLoad(getInt32Ty(), V_45);
  auto* V_47 = CreateAnd(V_46, getInt32(65536));
  auto* V_48 = CreateLoad(getInt32Ty(), V_13);
  auto* V_49 = CreateICmpEQ(V_47, getInt32(0));
  auto* V_50 = CreateAnd(V_48, getInt32(268435456));
  auto* V_51 = CreateICmpEQ(V_50, getInt32(0));
  CreateCondBr(V_49, BB_10, BB_8);
  SetInsertPoint(BB_8);
  CreateIntrinsic(Intrinsic::memcpy, { PointerType::get(getInt8Ty(), arg_1->getType()->getPointerAddressSpace()), PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()), getInt64Ty() }, { V_11, V_12, getInt64(32), getFalse() }, nullptr);
  CreateBr(BB_10);
  SetInsertPoint(BB_10);
  auto* V_52 = CreatePHI(getInt1Ty(), 5, _ReturnName);
  CreateBr(_JoinBB);
  V_52->addIncoming(V_38, BB_9);
  V_52->addIncoming(V_38, BB_6);
  V_52->addIncoming(getFalse(), BB_4);
  V_52->addIncoming(V_51, BB_7);
  V_52->addIncoming(V_51, BB_8);
  SetInsertPoint(_CurIP);
  return V_52;
}

auto* _getCommittedStatus_Xe(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_2 = CreateLoad(getInt32Ty(), V_1);
  auto* V_3 = CreateLShr(V_2, getInt32(17));
  auto* V_4 = CreateAnd(V_3, getInt32(1));
  auto* V_5 = CreateAdd(V_4, getInt32(1));
  auto* V_6 = CreateAnd(V_2, getInt32(65536));
  auto* V_7 = CreateICmpEQ(V_6, getInt32(0));
  auto* V_8 = CreateSelect(V_7, getInt32(0), V_5, _ReturnName);
  return V_8;
}

auto* _getCommittedStatus_Xe3(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_2 = CreateLoad(getInt32Ty(), V_1);
  auto* V_3 = CreateLShr(V_2, getInt32(17));
  auto* V_4 = CreateAnd(V_3, getInt32(1));
  auto* V_5 = CreateAdd(V_4, getInt32(1));
  auto* V_6 = CreateAnd(V_2, getInt32(65536));
  auto* V_7 = CreateICmpEQ(V_6, getInt32(0));
  auto* V_8 = CreateSelect(V_7, getInt32(0), V_5, _ReturnName);
  return V_8;
}

auto* _getCandidateType_Xe(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_2 = CreateLoad(getInt32Ty(), V_1);
  auto* V_3 = CreateLShr(V_2, getInt32(17));
  auto* V_4 = CreateAnd(V_3, getInt32(1), _ReturnName);
  return V_4;
}

auto* _getCandidateType_Xe3(Value* arg_0, const Twine& _ReturnName = "")
{
  auto* V_1 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_2 = CreateLoad(getInt32Ty(), V_1);
  auto* V_3 = CreateLShr(V_2, getInt32(17));
  auto* V_4 = CreateAnd(V_3, getInt32(1), _ReturnName);
  return V_4;
}

void _commitProceduralPrimitiveHit_Xe(Value* arg_0, Value* arg_1)
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0) });
  CreateStore(arg_1, V_2);
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(0) });
  CreateStore(arg_1, V_3);
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(1) });
  CreateStore(ConstantFP::get(*Ctx.getLLVMContext(), APFloat(APFloat::IEEEsingle(), APInt(32, 0x0))), V_4);
  auto* V_5 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(2) });
  CreateStore(ConstantFP::get(*Ctx.getLLVMContext(), APFloat(APFloat::IEEEsingle(), APInt(32, 0x0))), V_5);
  auto* V_6 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_7 = CreateLoad(getInt32Ty(), V_6);
  auto* V_8 = CreateOr(V_7, getInt32(65536));
  CreateStore(V_8, V_6);
  auto* V_9 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_10 = CreateLoad(getInt32Ty(), V_9);
  auto* V_11 = CreateOr(V_10, getInt32(65536));
  CreateStore(V_11, V_9);
  auto* V_12 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(4) });
  auto* V_13 = CreateLoad(getInt64Ty(), V_12);
  auto* V_14 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(4) });
  CreateStore(V_13, V_14);
  auto* V_15 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_16 = CreateLoad(getInt64Ty(), V_15);
  auto* V_17 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  CreateStore(V_16, V_17);
  return;
}

void _commitProceduralPrimitiveHit_Xe3(Value* arg_0, Value* arg_1)
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(0) });
  CreateStore(arg_1, V_2);
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(0) });
  CreateStore(arg_1, V_3);
  auto* V_4 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(1) });
  CreateStore(getInt32(0), V_4);
  auto* V_5 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(2) });
  CreateStore(getInt32(0), V_5);
  auto* V_6 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(3) });
  auto* V_7 = CreateLoad(getInt32Ty(), V_6);
  auto* V_8 = CreateOr(V_7, getInt32(65536));
  CreateStore(V_8, V_6);
  auto* V_9 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(3) });
  auto* V_10 = CreateLoad(getInt32Ty(), V_9);
  auto* V_11 = CreateOr(V_10, getInt32(65536));
  CreateStore(V_11, V_9);
  auto* V_12 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(4) });
  auto* V_13 = CreateLoad(getInt64Ty(), V_12);
  auto* V_14 = CreateAnd(V_13, getInt64(18446744073709551552u));
  auto* V_15 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(4) });
  CreateStore(V_14, V_15);
  auto* V_16 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1), getInt32(5) });
  auto* V_17 = CreateLoad(getInt64Ty(), V_16);
  auto* V_18 = CreateAnd(V_17, getInt64(18446744073709551552u));
  auto* V_19 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0), getInt32(5) });
  CreateStore(V_18, V_19);
  return;
}

auto* _getSyncStackID_Xe(const Twine& _ReturnName = "")
{
  auto* V_0 = getSr0_0();
  auto* V_1 = CreateShl(V_0, getInt32(3));
  auto* V_2 = CreateAnd(V_1, getInt32(1408));
  auto* V_3 = CreateShl(V_0, getInt32(1));
  auto* V_4 = CreateAnd(V_3, getInt32(512));
  auto* V_5 = get32BitLaneIDReplicate();
  auto* V_6 = CreateShl(V_0, getInt32(4));
  auto* V_7 = CreateAnd(V_6, getInt32(112));
  auto* V_8 = CreateOr(V_4, V_5);
  auto* V_9 = CreateOr(V_8, V_2);
  auto* V_10 = CreateOr(V_9, V_7, _ReturnName);
  return V_10;
}

auto* _getSyncStackID_Xe_HPC(const Twine& _ReturnName = "")
{
  auto* V_0 = getSr0_0();
  auto* V_1 = CreateShl(V_0, getInt32(4));
  auto* V_2 = CreateAnd(V_1, getInt32(768));
  auto* V_3 = CreateShl(V_0, getInt32(2));
  auto* V_4 = CreateAnd(V_3, getInt32(1024));
  auto* V_5 = get32BitLaneIDReplicate();
  auto* V_6 = CreateAnd(V_1, getInt32(112));
  auto* V_7 = CreateOr(V_4, V_5);
  auto* V_8 = CreateOr(V_7, V_2);
  auto* V_9 = CreateOr(V_8, V_6, _ReturnName);
  return V_9;
}

auto* _getSyncStackID_Xe2(const Twine& _ReturnName = "")
{
  auto* V_0 = getSr0_0();
  auto* V_1 = get32BitLaneIDReplicate();
  auto* V_2 = CreateShl(V_0, getInt32(4));
  auto* V_3 = CreateAnd(V_2, getInt32(1792));
  auto* V_4 = CreateAnd(V_2, getInt32(112));
  auto* V_5 = CreateOr(V_4, V_1);
  auto* V_6 = CreateOr(V_5, V_3, _ReturnName);
  return V_6;
}

auto* _getSyncStackID_Xe3(const Twine& _ReturnName = "")
{
  auto* V_0 = getSr0_0();
  auto* V_1 = get32BitLaneIDReplicate();
  auto* V_2 = CreateShl(V_0, getInt32(4));
  auto* V_3 = CreateAnd(V_2, getInt32(1792));
  auto* V_4 = CreateAnd(V_2, getInt32(240));
  auto* V_5 = CreateOr(V_4, V_1);
  auto* V_6 = CreateOr(V_5, V_3, _ReturnName);
  return V_6;
}

auto* _getHitAddress_Xe(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateBitCast(V_4, PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()), _ReturnName);
  return V_5;
}

auto* _getHitAddress_Xe3(Value* arg_0, Value* arg_1, const Twine& _ReturnName = "")
{
  auto* V_2 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(0) });
  auto* V_3 = CreateInBoundsGEP(_igc_struct_RTStackFormat__RTStack_8(*Ctx.getModule()), arg_0, { getInt64(0), getInt32(1) });
  auto* V_4 = CreateSelect(arg_1, V_2, V_3);
  auto* V_5 = CreateBitCast(V_4, PointerType::get(getInt8Ty(), arg_0->getType()->getPointerAddressSpace()), _ReturnName);
  return V_5;
}

