hexsha
stringlengths 40
40
| size
int64 7
1.05M
| ext
stringclasses 13
values | lang
stringclasses 1
value | max_stars_repo_path
stringlengths 4
269
| max_stars_repo_name
stringlengths 5
109
| max_stars_repo_head_hexsha
stringlengths 40
40
| max_stars_repo_licenses
listlengths 1
9
| max_stars_count
int64 1
191k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 4
269
| max_issues_repo_name
stringlengths 5
116
| max_issues_repo_head_hexsha
stringlengths 40
40
| max_issues_repo_licenses
listlengths 1
9
| max_issues_count
int64 1
48.5k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 4
269
| max_forks_repo_name
stringlengths 5
116
| max_forks_repo_head_hexsha
stringlengths 40
40
| max_forks_repo_licenses
listlengths 1
9
| max_forks_count
int64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 7
1.05M
| avg_line_length
float64 1.21
330k
| max_line_length
int64 6
990k
| alphanum_fraction
float64 0.01
0.99
| author_id
stringlengths 2
40
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
82514f2c72fa441a8101d2c52b132f4a07918596
| 6,737
|
cpp
|
C++
|
Engine/Source/GameBase/src/PhysicsSystem.cpp
|
AnkurSheel/RoutePlanner
|
a50b6ccb735db42ff4e5b2f4c87e710819c4564b
|
[
"CC-BY-4.0"
] | null | null | null |
Engine/Source/GameBase/src/PhysicsSystem.cpp
|
AnkurSheel/RoutePlanner
|
a50b6ccb735db42ff4e5b2f4c87e710819c4564b
|
[
"CC-BY-4.0"
] | null | null | null |
Engine/Source/GameBase/src/PhysicsSystem.cpp
|
AnkurSheel/RoutePlanner
|
a50b6ccb735db42ff4e5b2f4c87e710819c4564b
|
[
"CC-BY-4.0"
] | null | null | null |
#include "stdafx.h"
#include "PhysicsSystem.h"
#include "EntityManager.hxx"
#include "PhysicsComponent.h"
#include "TransformComponent.h"
#include "physics.hxx"
#include "EventManager.hxx"
#include "EntityInitializedEventData.h"
#include "EntityScaledEventData.h"
#include "BaseEntity.hxx"
using namespace GameBase;
using namespace Utilities;
using namespace Base;
using namespace Physics;
const cHashedString cPhysicsSystem::m_Type = cHashedString("physicssystem");
// *******************************************************************************************************************
cPhysicsSystem::cPhysicsSystem()
{
VInitialize();
}
// *******************************************************************************************************************
cPhysicsSystem::~cPhysicsSystem()
{
m_pPhysics.reset();
m_pEntityManager.reset();
shared_ptr<IEventManager> pEventManager = MakeStrongPtr(cServiceLocator::GetInstance()->GetService<IEventManager>());
if (pEventManager != NULL)
{
EventListenerCallBackFn listener = bind(&cPhysicsSystem::ActorInitializedListener, this, _1);
pEventManager->VRemoveListener(listener, cEntityInitializedEventData::m_Name);
listener = bind(&cPhysicsSystem::ActorScaledListener, this, _1);
pEventManager->VRemoveListener(listener, cEntityScaledEventData::m_Name);
}
}
// *******************************************************************************************************************
void cPhysicsSystem::VInitialize()
{
cProcess::VInitialize();
shared_ptr<IEventManager> pEventManager = MakeStrongPtr(cServiceLocator::GetInstance()->GetService<IEventManager>());
if (pEventManager != NULL)
{
EventListenerCallBackFn listener = bind(&cPhysicsSystem::ActorInitializedListener, this, _1);
pEventManager->VAddListener(listener, cEntityInitializedEventData::m_Name);
listener = bind(&cPhysicsSystem::ActorScaledListener, this, _1);
pEventManager->VAddListener(listener, cEntityScaledEventData::m_Name);
}
m_pEntityManager = cServiceLocator::GetInstance()->GetService<IEntityManager>();
m_pPhysics = (MakeStrongPtr<IPhysics>(cServiceLocator::GetInstance()->GetService<IPhysics>()));
if(m_pPhysics != NULL)
{
m_pPhysics->VInitialize("Physics");
}
}
// *******************************************************************************************************************
void cPhysicsSystem::VUpdate(const float deltaTime)
{
cProcess::VUpdate(deltaTime);
shared_ptr<IEntityManager> pEntityManager = MakeStrongPtr(m_pEntityManager);
if (pEntityManager == NULL)
{
return;
}
IEntityManager::EntityList entityList;
pEntityManager->VGetEntitiesWithComponent(cPhysicsComponent::GetName(), entityList);
for(auto enityIter = entityList.begin(); enityIter != entityList.end(); enityIter++)
{
IBaseEntity * pEntity = *enityIter;
cPhysicsComponent* pPhysicsComponent = CastToPhysicsComponent(pEntity);
if (pPhysicsComponent != NULL)
{
pPhysicsComponent->Update((int)(deltaTime * 10000));
}
}
if(m_pPhysics != NULL)
{
m_pPhysics->VUpdate(deltaTime);
}
for(auto enityIter = entityList.begin(); enityIter != entityList.end(); enityIter++)
{
IBaseEntity * pEntity = *enityIter;
cTransformComponent * pTransformComponent = dynamic_cast<cTransformComponent*>(pEntityManager->VGetComponent(pEntity, cTransformComponent::GetName()));
cPhysicsComponent * pPhysicsComponent = CastToPhysicsComponent(pEntity);
if (pTransformComponent != NULL && pPhysicsComponent != NULL)
{
pTransformComponent->SetPosition(pPhysicsComponent->GetPosition());
}
}
CollisionPairs triggerpairs;
if(m_pPhysics != NULL)
{
triggerpairs = m_pPhysics->VGetTriggerPairs();
}
for(auto Iter = triggerpairs.begin(); Iter != triggerpairs.end(); Iter++)
{
const CollisionPair pair = *Iter;
IBaseEntity * pEntity = pEntityManager->VGetEntityFromID(pair.first);
IBaseEntity * pTrigger = pEntityManager->VGetEntityFromID(pair.second);
if(pEntity != NULL && pTrigger != NULL)
{
pEntity->VOnEnteredTrigger(pTrigger);
}
}
CollisionPairs collisionpairs;
if(m_pPhysics != NULL)
{
collisionpairs = m_pPhysics->VGetCollisionPairs();
}
for(auto Iter = collisionpairs.begin(); Iter != collisionpairs.end(); Iter++)
{
const CollisionPair pair = *Iter;
IBaseEntity * pEntity1 = pEntityManager->VGetEntityFromID(pair.first);
IBaseEntity * pEntity2 = pEntityManager->VGetEntityFromID(pair.second);
if(pEntity1 != NULL && pEntity2 != NULL)
{
pEntity1->VOnCollided(pEntity2);
pEntity2->VOnCollided(pEntity1);
}
}
}
// *******************************************************************************************************************
void cPhysicsSystem::ActorInitializedListener(IEventDataPtr pEventData)
{
shared_ptr<IEntityManager> pEntityManager = MakeStrongPtr(m_pEntityManager);
if (pEntityManager == NULL)
{
return;
}
shared_ptr<cEntityInitializedEventData> pCastEventData = static_pointer_cast<cEntityInitializedEventData>(pEventData);
int id = pCastEventData->GetActorID();
IBaseEntity * pEntity = pEntityManager->VGetEntityFromID(id);
cPhysicsComponent * pPhysicsComponent = CastToPhysicsComponent(pEntity);
if(pPhysicsComponent != NULL)
{
if(pCastEventData->IsReInitializing())
{
pPhysicsComponent->ReInitialize(pCastEventData->GetPosition(), pCastEventData->GetRotation(), pCastEventData->GetSize());
}
else
{
pPhysicsComponent->Initialize(pCastEventData->GetPosition(), pCastEventData->GetRotation(), pCastEventData->GetSize());
}
}
}
// *******************************************************************************************************************
void cPhysicsSystem::ActorScaledListener(IEventDataPtr pEventData)
{
shared_ptr<IEntityManager> pEntityManager = MakeStrongPtr(m_pEntityManager);
if (pEntityManager == NULL)
{
return;
}
shared_ptr<cEntityScaledEventData> pCastEventData = static_pointer_cast<cEntityScaledEventData>(pEventData);
int id = pCastEventData->GetActorID();
cVector3 size = pCastEventData->GetSize();
IBaseEntity * pEntity = pEntityManager->VGetEntityFromID(id);
if(pEntity != NULL)
{
cPhysicsComponent * pPhysicsComponent = CastToPhysicsComponent(pEntity);
if(pPhysicsComponent != NULL)
{
pPhysicsComponent->OnSizeUpdated();
}
}
}
// *******************************************************************************************************************
cPhysicsComponent* const GameBase::cPhysicsSystem::CastToPhysicsComponent(const IBaseEntity * const pEntity)
{
shared_ptr<IEntityManager> pEntityManager = MakeStrongPtr(m_pEntityManager);
if (pEntityManager == NULL)
{
return NULL;
}
return (dynamic_cast<cPhysicsComponent*>(pEntityManager->VGetComponent(pEntity, cPhysicsComponent::GetName())));
}
| 32.545894
| 153
| 0.669586
|
AnkurSheel
|
825528b594bc12591413bcd8e9dc92c68f6b3c3d
| 3,742
|
cc
|
C++
|
cpp/src/precompiled/epoch_time_point_test.cc
|
ZMZ91/gandiva
|
6f11d4ef79b38074151e3107d46477f45ed21d11
|
[
"Apache-2.0"
] | 479
|
2018-06-21T18:28:52.000Z
|
2022-03-12T07:55:56.000Z
|
cpp/src/precompiled/epoch_time_point_test.cc
|
ZMZ91/gandiva
|
6f11d4ef79b38074151e3107d46477f45ed21d11
|
[
"Apache-2.0"
] | 11
|
2018-06-22T06:01:47.000Z
|
2018-10-01T11:56:24.000Z
|
cpp/src/precompiled/epoch_time_point_test.cc
|
ZMZ91/gandiva
|
6f11d4ef79b38074151e3107d46477f45ed21d11
|
[
"Apache-2.0"
] | 65
|
2018-06-22T06:05:30.000Z
|
2022-02-08T22:39:13.000Z
|
// Copyright (C) 2017-2018 Dremio Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <time.h>
#include <gtest/gtest.h>
#include "./epoch_time_point.h"
#include "precompiled/types.h"
namespace gandiva {
timestamp StringToTimestamp(const char *buf) {
struct tm tm;
strptime(buf, "%Y-%m-%d %H:%M:%S", &tm);
return timegm(&tm) * 1000; // to millis
}
TEST(TestEpochTimePoint, TestTm) {
auto ts = StringToTimestamp("2015-05-07 10:20:34");
EpochTimePoint tp(ts);
struct tm tm;
time_t tsec = ts / 1000;
gmtime_r(&tsec, &tm);
EXPECT_EQ(tp.TmYear(), tm.tm_year);
EXPECT_EQ(tp.TmMon(), tm.tm_mon);
EXPECT_EQ(tp.TmYday(), tm.tm_yday);
EXPECT_EQ(tp.TmMday(), tm.tm_mday);
EXPECT_EQ(tp.TmWday(), tm.tm_wday);
EXPECT_EQ(tp.TmHour(), tm.tm_hour);
EXPECT_EQ(tp.TmMin(), tm.tm_min);
EXPECT_EQ(tp.TmSec(), tm.tm_sec);
}
TEST(TestEpochTimePoint, TestAddYears) {
EXPECT_EQ(EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")).AddYears(2),
EpochTimePoint(StringToTimestamp("2017-05-05 10:20:34")));
EXPECT_EQ(EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")).AddYears(0),
EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")));
EXPECT_EQ(EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")).AddYears(-1),
EpochTimePoint(StringToTimestamp("2014-05-05 10:20:34")));
}
TEST(TestEpochTimePoint, TestAddMonths) {
EXPECT_EQ(EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")).AddMonths(2),
EpochTimePoint(StringToTimestamp("2015-07-05 10:20:34")));
EXPECT_EQ(EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")).AddMonths(11),
EpochTimePoint(StringToTimestamp("2016-04-05 10:20:34")));
EXPECT_EQ(EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")).AddMonths(0),
EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")));
EXPECT_EQ(EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")).AddMonths(-1),
EpochTimePoint(StringToTimestamp("2015-04-05 10:20:34")));
EXPECT_EQ(EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")).AddMonths(-10),
EpochTimePoint(StringToTimestamp("2014-07-05 10:20:34")));
}
TEST(TestEpochTimePoint, TestAddDays) {
EXPECT_EQ(EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")).AddDays(2),
EpochTimePoint(StringToTimestamp("2015-05-07 10:20:34")));
EXPECT_EQ(EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")).AddDays(11),
EpochTimePoint(StringToTimestamp("2015-05-16 10:20:34")));
EXPECT_EQ(EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")).AddDays(0),
EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")));
EXPECT_EQ(EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")).AddDays(-1),
EpochTimePoint(StringToTimestamp("2015-05-04 10:20:34")));
EXPECT_EQ(EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")).AddDays(-10),
EpochTimePoint(StringToTimestamp("2015-04-25 10:20:34")));
}
TEST(TestEpochTimePoint, TestClearTimeOfDay) {
EXPECT_EQ(EpochTimePoint(StringToTimestamp("2015-05-05 10:20:34")).ClearTimeOfDay(),
EpochTimePoint(StringToTimestamp("2015-05-05 00:00:00")));
}
} // namespace gandiva
| 38.183673
| 86
| 0.70604
|
ZMZ91
|
82567b36f40b6c056828f7aaa27de5c3a6d187a0
| 514
|
cpp
|
C++
|
Cpp_Q03.cpp
|
Samad-Cyber01/CPP_Practical_Project
|
4f5107b343e2b144e59f90a0bd859d53c65a9b17
|
[
"Unlicense"
] | null | null | null |
Cpp_Q03.cpp
|
Samad-Cyber01/CPP_Practical_Project
|
4f5107b343e2b144e59f90a0bd859d53c65a9b17
|
[
"Unlicense"
] | null | null | null |
Cpp_Q03.cpp
|
Samad-Cyber01/CPP_Practical_Project
|
4f5107b343e2b144e59f90a0bd859d53c65a9b17
|
[
"Unlicense"
] | null | null | null |
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(int argc, char *argv[])
{
string s = "";
for (int i = 1; i < argc; i++)
{
s += argv[i];
}
cout << s << endl;
int freq[26] = {0}; // because we have 26 alphabets.
for (int i = 0; i < s.size(); i++)
{
freq[s[i] - 'a']++;
}
for (int i = 0; i < 26; i++)
{
cout << char(i + 'a') << ", " << freq[i] << endl;
}
return 0;
}
| 17.724138
| 58
| 0.414397
|
Samad-Cyber01
|
8257da4d1c96b8d8cd36cb5c1d094df49cab0ce8
| 1,437
|
hpp
|
C++
|
libtest/src/test_ntcsensor.hpp
|
rvt/bbq-controller
|
6ff1591b238e180dc0431a5829a9f0f6eaa7c08d
|
[
"MIT"
] | 13
|
2019-02-26T20:14:32.000Z
|
2022-01-12T23:54:00.000Z
|
libtest/src/test_ntcsensor.hpp
|
rvt/bbq-controller
|
6ff1591b238e180dc0431a5829a9f0f6eaa7c08d
|
[
"MIT"
] | null | null | null |
libtest/src/test_ntcsensor.hpp
|
rvt/bbq-controller
|
6ff1591b238e180dc0431a5829a9f0f6eaa7c08d
|
[
"MIT"
] | 2
|
2021-09-21T22:44:06.000Z
|
2022-03-11T01:08:50.000Z
|
#include <catch2/catch.hpp>
#include "arduinostubs.hpp"
#include <memory>
#include <NTCSensor.h>
#include <array>
TEST_CASE("Should Calculate steinHartValues", "[ntcsensor]") {
float r, r1, r2, r3, t1, t2, t3, ka, kb, kc;
r = 10000;
r1 = 25415;
t1 = 5;
r2 = 10021;
t2 = 25;
r3 = 6545;
t3 = 35;
NTCSensor::calculateSteinhart(r, r1, t1, r2, t2, r3, t3, ka, kb, kc);
REQUIRE(ka == Approx(0.00113836653));
REQUIRE(kb == Approx(0.000232453211));
REQUIRE(kc == Approx(0.0000000948887404));
SECTION("Should measure temperature upstream") {
NTCSensor sensor(0, true, 0.0f, 1.0f, r, ka, kb, kc);
// https://ohmslawcalculator.com/voltage-divider-calculator
analogReadStubbed = (1023 * r) / (r + r2);
sensor.handle();
REQUIRE(sensor.get() == Approx(24.91409f));
analogReadStubbed = (1023 * r) / (r + r3);
sensor.handle();
REQUIRE(sensor.get() == Approx(34.96906));
analogReadStubbed = (1023 * r) / (r + r1);
sensor.handle();
REQUIRE(sensor.get() == Approx(4.91589));
}
SECTION("Should measure temperature downstream") {
NTCSensor sensor(0, false, 0.0f, 1.0f, r, ka, kb, kc);
// https://ohmslawcalculator.com/voltage-divider-calculator
analogReadStubbed = (1023 * r2) / (r + r2);
sensor.handle();
REQUIRE(sensor.get() == Approx(25.00327f));
}
}
| 27.634615
| 73
| 0.583159
|
rvt
|
825a36a5130925c6036ee9326fbe0dfe7cfd4f10
| 823
|
hpp
|
C++
|
Siv3D/include/Siv3D/None.hpp
|
tas9n/OpenSiv3D
|
c561cba1d88eb9cd9606ba983fcc1120192d5615
|
[
"MIT"
] | 2
|
2021-11-22T00:52:48.000Z
|
2021-12-24T09:33:55.000Z
|
Siv3D/include/Siv3D/None.hpp
|
tas9n/OpenSiv3D
|
c561cba1d88eb9cd9606ba983fcc1120192d5615
|
[
"MIT"
] | 32
|
2021-10-09T10:04:11.000Z
|
2022-02-25T06:10:13.000Z
|
Siv3D/include/Siv3D/None.hpp
|
tas9n/OpenSiv3D
|
c561cba1d88eb9cd9606ba983fcc1120192d5615
|
[
"MIT"
] | 1
|
2021-12-31T05:08:00.000Z
|
2021-12-31T05:08:00.000Z
|
//-----------------------------------------------
//
// This file is part of the Siv3D Engine.
//
// Copyright (c) 2008-2022 Ryo Suzuki
// Copyright (c) 2016-2022 OpenSiv3D Project
//
// Licensed under the MIT License.
//
//-----------------------------------------------
# pragma once
# include <ostream>
# include <optional>
# include "Common.hpp"
# include "FormatData.hpp"
namespace s3d
{
/// @brief 無効値の型
using None_t = std::nullopt_t;
template <class CharType>
inline std::basic_ostream<CharType>& operator <<(std::basic_ostream<CharType>& output, const None_t&)
{
const CharType no[] = { 'n','o','n','e','\0' };
return output << no;
}
inline void Formatter(FormatData& formatData, None_t)
{
formatData.string.append(U"none"_sv);
}
/// @brief 無効値
inline constexpr None_t none = std::nullopt;
}
| 21.657895
| 102
| 0.594168
|
tas9n
|
825aa0b3e26d8f6c30a8aa0b33723c3481a559e3
| 375
|
cpp
|
C++
|
source/node/Divide.cpp
|
xzrunner/sop
|
80f84765548fde33d990663d4a4b8054bb6714d1
|
[
"MIT"
] | null | null | null |
source/node/Divide.cpp
|
xzrunner/sop
|
80f84765548fde33d990663d4a4b8054bb6714d1
|
[
"MIT"
] | null | null | null |
source/node/Divide.cpp
|
xzrunner/sop
|
80f84765548fde33d990663d4a4b8054bb6714d1
|
[
"MIT"
] | null | null | null |
#include "sop/node/Divide.h"
#include "sop/GeometryImpl.h"
#include "sop/NodeHelper.h"
namespace sop
{
namespace node
{
void Divide::Execute(const ur::Device& dev, Evaluator& eval)
{
m_geo_impl.reset();
auto prev_geo = NodeHelper::GetInputGeo(*this, 0);
if (!prev_geo) {
return;
}
m_geo_impl = std::make_shared<GeometryImpl>(*prev_geo);
}
}
}
| 16.304348
| 60
| 0.664
|
xzrunner
|
82640d879a292ea2667f442bbb25ee11cde076ce
| 28,251
|
cpp
|
C++
|
bulletgba/generator/data/code/otakutwo/self-1011.cpp
|
pqrs-org/BulletGBA
|
a294007902970242b496f2528b4762cfef22bc86
|
[
"Unlicense"
] | 5
|
2020-03-24T07:44:49.000Z
|
2021-08-30T14:43:31.000Z
|
bulletgba/generator/data/code/otakutwo/self-1011.cpp
|
pqrs-org/BulletGBA
|
a294007902970242b496f2528b4762cfef22bc86
|
[
"Unlicense"
] | null | null | null |
bulletgba/generator/data/code/otakutwo/self-1011.cpp
|
pqrs-org/BulletGBA
|
a294007902970242b496f2528b4762cfef22bc86
|
[
"Unlicense"
] | null | null | null |
// XXX uniqID XXX d71264b76755bf6859ed2e8003714e02 XXX
#include <gba_types.h>
#include "bullet.hpp"
#include "fixed.hpp"
#include "otakutwo/self-1011.hpp"
extern const BulletStepFunc bullet_c5653fc1f3d44172edd1c912fbf88785_d71264b76755bf6859ed2e8003714e02[] = {
stepfunc_d63f935eaeadb4a3f83557ae10cc6a28_d71264b76755bf6859ed2e8003714e02,
stepfunc_9b5a426fc16fbeff6cb19aed9e879d14_d71264b76755bf6859ed2e8003714e02,
stepfunc_bbc91d6ae5ccdbfdab65447a1ceccb7a_d71264b76755bf6859ed2e8003714e02,
stepfunc_08a05b21d884c8300aab3f92f30a5e7c_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_874d2e5e90fe09b6f38462d1832d30d1_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_08a05b21d884c8300aab3f92f30a5e7c_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_08a05b21d884c8300aab3f92f30a5e7c_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_874d2e5e90fe09b6f38462d1832d30d1_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_08a05b21d884c8300aab3f92f30a5e7c_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_08a05b21d884c8300aab3f92f30a5e7c_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_874d2e5e90fe09b6f38462d1832d30d1_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_08a05b21d884c8300aab3f92f30a5e7c_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_08a05b21d884c8300aab3f92f30a5e7c_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_874d2e5e90fe09b6f38462d1832d30d1_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_08a05b21d884c8300aab3f92f30a5e7c_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_08a05b21d884c8300aab3f92f30a5e7c_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_874d2e5e90fe09b6f38462d1832d30d1_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_08a05b21d884c8300aab3f92f30a5e7c_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_08a05b21d884c8300aab3f92f30a5e7c_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_874d2e5e90fe09b6f38462d1832d30d1_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_08a05b21d884c8300aab3f92f30a5e7c_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02,
stepfunc_97e8979d1a7c719f55deab0bdea20675_d71264b76755bf6859ed2e8003714e02,
stepfunc_d097c937c08b1c5c6019e5e53c868b18_d71264b76755bf6859ed2e8003714e02,
stepfunc_9473ead6f510d816c6d2de6a7d2ff262_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02,
stepfunc_93a8ba7c25412e2d1e2c7b0537f947a3_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02,
stepfunc_28e5fd26b14def0c8f85da61274089fa_d71264b76755bf6859ed2e8003714e02,
stepfunc_49a52ab1a032295cc2f6062c4825eda2_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02,
stepfunc_9a262eab9bee9a27b0f4b6d72eb6d017_d71264b76755bf6859ed2e8003714e02,
NULL};
extern const BulletStepFunc bullet_318377f6e49fb585dc702be3971e066b_d71264b76755bf6859ed2e8003714e02[] = {
stepfunc_b29cebfac2f19abeac4b7b53f6b48124_d71264b76755bf6859ed2e8003714e02,
stepfunc_099de5a0f09778650c2bc144b0392411_d71264b76755bf6859ed2e8003714e02,
NULL};
extern const BulletStepFunc bullet_d3900a06d4ec5eb816a829195ea040b3_d71264b76755bf6859ed2e8003714e02[] = {
stepfunc_b29cebfac2f19abeac4b7b53f6b48124_d71264b76755bf6859ed2e8003714e02,
stepfunc_28701d515eba20086d93340ba33fde6d_d71264b76755bf6859ed2e8003714e02,
NULL};
extern const BulletStepFunc bullet_5f6f4cea851b2ffca6bc980bfe3b3d01_d71264b76755bf6859ed2e8003714e02[] = {
stepfunc_b29cebfac2f19abeac4b7b53f6b48124_d71264b76755bf6859ed2e8003714e02,
stepfunc_39fb1026339bd14e494b828e17246818_d71264b76755bf6859ed2e8003714e02,
NULL};
extern const BulletStepFunc bullet_c3ec0b7212662b5bf50f39333b094858_d71264b76755bf6859ed2e8003714e02[] = {
stepfunc_b29cebfac2f19abeac4b7b53f6b48124_d71264b76755bf6859ed2e8003714e02,
stepfunc_c2779d963337fc1c28ce2cbd0c260ea5_d71264b76755bf6859ed2e8003714e02,
NULL};
extern const BulletStepFunc bullet_199966bc8b2e37f5351792786cf0428c_d71264b76755bf6859ed2e8003714e02[] = {
stepfunc_7b56e635e682f2e2fba2b3e0c98047d8_d71264b76755bf6859ed2e8003714e02,
NULL};
void stepfunc_b29cebfac2f19abeac4b7b53f6b48124_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
p->wait = static_cast<u16>(50.0);
}
void stepfunc_099de5a0f09778650c2bc144b0392411_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
u16 life = static_cast<u16>(50.0); FixedPointNum speed = FixedPointNum((0.9) - p->getSpeed(), life);p->setAccel(speed, life);}
}
void stepfunc_28701d515eba20086d93340ba33fde6d_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
u16 life = static_cast<u16>(50.0); FixedPointNum speed = FixedPointNum((1.1) - p->getSpeed(), life);p->setAccel(speed, life);}
}
void stepfunc_39fb1026339bd14e494b828e17246818_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
u16 life = static_cast<u16>(50.0); FixedPointNum speed = FixedPointNum((1.3) - p->getSpeed(), life);p->setAccel(speed, life);}
}
void stepfunc_c2779d963337fc1c28ce2cbd0c260ea5_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
u16 life = static_cast<u16>(50.0); FixedPointNum speed = FixedPointNum((1.5) - p->getSpeed(), life);p->setAccel(speed, life);}
}
void stepfunc_09568b6b336c59ee15afd136a8410a0f_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
BulletInfo *bi; p->lastBulletAngle = p->lastBulletAngle + (FixedPointNum::degree2angle(2.0)); p->lastBulletSpeed = ((0.3 )); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, bullet_c3ec0b7212662b5bf50f39333b094858_d71264b76755bf6859ed2e8003714e02);
}
}
{
BulletInfo *bi; p->lastBulletAngle = p->lastBulletAngle + (FixedPointNum::degree2angle(2.0)); p->lastBulletSpeed = ((0.4 )); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, bullet_5f6f4cea851b2ffca6bc980bfe3b3d01_d71264b76755bf6859ed2e8003714e02);
}
}
{
BulletInfo *bi; p->lastBulletAngle = p->lastBulletAngle + (FixedPointNum::degree2angle(2.0)); p->lastBulletSpeed = ((0.5 )); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, bullet_d3900a06d4ec5eb816a829195ea040b3_d71264b76755bf6859ed2e8003714e02);
}
}
{
BulletInfo *bi; p->lastBulletAngle = p->lastBulletAngle + (FixedPointNum::degree2angle(2.0)); p->lastBulletSpeed = ((0.6 )); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, bullet_318377f6e49fb585dc702be3971e066b_d71264b76755bf6859ed2e8003714e02);
}
}
}
void stepfunc_5992a6b0264bfa9260ee7b11ab4a96fb_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
BulletInfo *bi; p->lastBulletAngle = p->lastBulletAngle + (FixedPointNum::degree2angle((-10.0+1.0*5.0 ))); p->lastBulletSpeed = p->lastBulletSpeed + (0.0); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, StepFunc::nullStepFuncList);
}
}
}
void stepfunc_d27ae192afd782479a7196cde2c8c951_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
BulletInfo *bi; p->lastBulletAngle = SelfPos::getAngle(p) + (FixedPointNum::degree2angle(30.0-1.0*15.0)); p->lastBulletSpeed = p->lastBulletSpeed + (0.2); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, StepFunc::nullStepFuncList);
}
}
for (u32 i = 0; i < 6; ++i) {
stepfunc_5992a6b0264bfa9260ee7b11ab4a96fb_d71264b76755bf6859ed2e8003714e02(p);}
p->wait = static_cast<u16>(1.0);
}
void stepfunc_59b36b64911d10a09634be3628165ed2_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
BulletInfo *bi; p->lastBulletAngle = p->lastBulletAngle + (FixedPointNum::degree2angle((-20.0+1.0*10.0))); p->lastBulletSpeed = p->lastBulletSpeed + (0.0); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, StepFunc::nullStepFuncList);
}
}
}
void stepfunc_cc1ddd703526dda71ead6a87d1abfe9c_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
BulletInfo *bi; p->lastBulletAngle = SelfPos::getAngle(p) + (FixedPointNum::degree2angle(30.0-1.0*15.0)); p->lastBulletSpeed = p->lastBulletSpeed + (0.2); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, StepFunc::nullStepFuncList);
}
}
for (u32 i = 0; i < 3; ++i) {
stepfunc_59b36b64911d10a09634be3628165ed2_d71264b76755bf6859ed2e8003714e02(p);}
p->wait = static_cast<u16>(1.0);
}
void stepfunc_18af53bc83dc0030a04a1f27ac437943_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
BulletInfo *bi; p->lastBulletAngle = p->lastBulletAngle + (FixedPointNum::degree2angle(10.0)); p->lastBulletSpeed = (((2.5)/(3.0-1.0*2.0))); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, StepFunc::nullStepFuncList);
}
}
}
void stepfunc_d3d0ca796fa6cc0800f20ab20f9f2231_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
BulletInfo *bi; p->lastBulletAngle = p->getAngle() + (FixedPointNum::degree2angle(-20.0+FixedPointNum::random()*20.0)); p->lastBulletSpeed = (((2.5)/(3.0-1.0*2.0))); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, StepFunc::nullStepFuncList);
}
}
for (u32 i = 0; i < 2; ++i) {
stepfunc_18af53bc83dc0030a04a1f27ac437943_d71264b76755bf6859ed2e8003714e02(p);}
p->wait = static_cast<u16>(4.0);
}
void stepfunc_08a05b21d884c8300aab3f92f30a5e7c_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
u16 life = static_cast<u16>((16.0)); FixedPointNum speed = FixedPointNum(p->getAngle() + (FixedPointNum::degree2angle((-45.0))) - p->getAngle(), life);p->setRound(speed, life);}
}
void stepfunc_874d2e5e90fe09b6f38462d1832d30d1_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
u16 life = static_cast<u16>((32.0)); FixedPointNum speed = FixedPointNum(p->getAngle() + (FixedPointNum::degree2angle(( 90.0))) - p->getAngle(), life);p->setRound(speed, life);}
}
void stepfunc_d63f935eaeadb4a3f83557ae10cc6a28_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
p->wait = static_cast<u16>(20.0);
}
void stepfunc_9b5a426fc16fbeff6cb19aed9e879d14_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
u16 life = static_cast<u16>(1.0); FixedPointNum speed = 0.0 - p->getSpeed();p->setAccel(speed, life);}
p->wait = static_cast<u16>(20.0);
}
void stepfunc_bbc91d6ae5ccdbfdab65447a1ceccb7a_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
u16 life = static_cast<u16>(5.0); FixedPointNum speed = FixedPointNum((FixedPointNum::degree2angle(180.0)) - p->getAngle(), life);p->setRound(speed, life);}
p->wait = static_cast<u16>(10.0);
}
void stepfunc_97e8979d1a7c719f55deab0bdea20675_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
p->wait = static_cast<u16>(100.0);
}
void stepfunc_d097c937c08b1c5c6019e5e53c868b18_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
p->wait = static_cast<u16>(200.0-1.0*200.0);
}
void stepfunc_9473ead6f510d816c6d2de6a7d2ff262_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
BulletInfo *bi; p->lastBulletAngle = SelfPos::getAngle(p) + (FixedPointNum::degree2angle(30.0-1.0*15.0)); p->lastBulletSpeed = ((1.2)); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, StepFunc::nullStepFuncList);
}
}
for (u32 i = 0; i < 3; ++i) {
stepfunc_59b36b64911d10a09634be3628165ed2_d71264b76755bf6859ed2e8003714e02(p);}
p->wait = static_cast<u16>(1.0);
}
void stepfunc_93a8ba7c25412e2d1e2c7b0537f947a3_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
BulletInfo *bi; p->lastBulletAngle = SelfPos::getAngle(p) + (FixedPointNum::degree2angle(30.0-1.0*15.0)); p->lastBulletSpeed = ((3.2)); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, StepFunc::nullStepFuncList);
}
}
for (u32 i = 0; i < 6; ++i) {
stepfunc_5992a6b0264bfa9260ee7b11ab4a96fb_d71264b76755bf6859ed2e8003714e02(p);}
p->wait = static_cast<u16>(1.0);
}
void stepfunc_28e5fd26b14def0c8f85da61274089fa_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
p->wait = static_cast<u16>(175.0);
}
void stepfunc_49a52ab1a032295cc2f6062c4825eda2_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
u16 life = static_cast<u16>(1.0); FixedPointNum speed = 1.0+FixedPointNum::random() - p->getSpeed();p->setAccel(speed, life);}
p->wait = (10.0+FixedPointNum::random()*65.0).toInt();
}
void stepfunc_9a262eab9bee9a27b0f4b6d72eb6d017_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
ListBullets::stepFuncDrop(p);}
void stepfunc_7b56e635e682f2e2fba2b3e0c98047d8_d71264b76755bf6859ed2e8003714e02(BulletInfo *p) {
{
BulletInfo *bi; p->lastBulletAngle = (FixedPointNum::degree2angle( 120.0)); p->lastBulletSpeed = (2.5); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, bullet_c5653fc1f3d44172edd1c912fbf88785_d71264b76755bf6859ed2e8003714e02);
}
}
{
BulletInfo *bi; p->lastBulletAngle = (FixedPointNum::degree2angle(-120.0)); p->lastBulletSpeed = (2.5); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, bullet_c5653fc1f3d44172edd1c912fbf88785_d71264b76755bf6859ed2e8003714e02);
}
}
{
BulletInfo *bi; p->lastBulletAngle = (FixedPointNum::degree2angle( 45.0)); p->lastBulletSpeed = ( 2.0); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, bullet_c5653fc1f3d44172edd1c912fbf88785_d71264b76755bf6859ed2e8003714e02);
}
}
{
BulletInfo *bi; p->lastBulletAngle = (FixedPointNum::degree2angle( -45.0)); p->lastBulletSpeed = ( 2.0); bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(p->getType() << 1, p->getPosX(), p->getPosY(), p->lastBulletAngle, p->lastBulletSpeed, bullet_c5653fc1f3d44172edd1c912fbf88785_d71264b76755bf6859ed2e8003714e02);
}
}
ListBullets::stepFuncDrop(p);}
BulletInfo *genBulletFunc_d71264b76755bf6859ed2e8003714e02(FixedPointNum posx, FixedPointNum posy) { BulletInfo * bi; bi = ListBullets::makeNewBullet(); if (bi != NULL) { bi->initialize(BULLET_TYPE_ROOT, posx, posy, BulletInfo::DEFAULT_ANGLE, 0, bullet_199966bc8b2e37f5351792786cf0428c_d71264b76755bf6859ed2e8003714e02);
}
return bi;}
| 70.6275
| 364
| 0.876925
|
pqrs-org
|
826688c5c8830649bacaea1883a3bc16f693d7fd
| 533
|
cpp
|
C++
|
BOJ_CPP/2238.cpp
|
tnsgh9603/BOJ_CPP
|
432b1350f6c67cce83aec3e723e30a3c6b5dbfda
|
[
"MIT"
] | null | null | null |
BOJ_CPP/2238.cpp
|
tnsgh9603/BOJ_CPP
|
432b1350f6c67cce83aec3e723e30a3c6b5dbfda
|
[
"MIT"
] | null | null | null |
BOJ_CPP/2238.cpp
|
tnsgh9603/BOJ_CPP
|
432b1350f6c67cce83aec3e723e30a3c6b5dbfda
|
[
"MIT"
] | null | null | null |
#include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
using namespace std;
int main() {
fastio;
int U, N;
cin >> U >> N;
map<int, vector<string>> mp;
for (int i = 0; i < N; ++i) {
string s;
int v;
cin >> s >> v;
mp[v].push_back(s);
}
int mn = INT_MAX, val;
for (auto&[a, b]: mp) {
if (mn > b.size()) {
mn = b.size();
val = a;
}
}
cout << mp[val].front() << " " << val;
return 0;
}
| 20.5
| 63
| 0.435272
|
tnsgh9603
|
8266eeb98d4ff136d11e60bc666ad74e7c1866c9
| 1,069
|
hh
|
C++
|
KalmanTrack/KalCodes.hh
|
brownd1978/FastSim
|
05f590d72d8e7f71856fd833114a38b84fc7fd48
|
[
"Apache-2.0"
] | null | null | null |
KalmanTrack/KalCodes.hh
|
brownd1978/FastSim
|
05f590d72d8e7f71856fd833114a38b84fc7fd48
|
[
"Apache-2.0"
] | null | null | null |
KalmanTrack/KalCodes.hh
|
brownd1978/FastSim
|
05f590d72d8e7f71856fd833114a38b84fc7fd48
|
[
"Apache-2.0"
] | null | null | null |
// File and Version Information:
// $Id: KalCodes.hh,v 1.7 2005/09/08 19:07:43 brownd Exp $
//
// Description:
// define codes used in KalRep fitting
//
// Environment:
// Software developed for the BaBar Detector at the SLAC B-Factory.
//
// Copyright Information:
// Copyright (C) 1997 Lawrence Berkeley Laboratory
//
// Author List:
// Dave Brown 3/15/97
//------------------------------------------------------------------------
#ifndef KALCODES_HH
#define KALCODES_HH
// use a class as a namespace
class KalCodes {
public:
enum kalFitFailCodes { dof=11,stops=12,diverge=13,matrix=14,processing=15,
notready=16,stubmatch=17,extendable=18,momentum=19,
endextend=20,inconsistent=21,nostop=22,cannotfullyextend=23,
badtraj=24};
enum kalFitSuccessCodes {current=11,valid=12,alreadyextended=13};
enum kalMakerFailCodes { makerep=30,fitresult=31,notkalrep=32,norep=33};
enum kalMakerSuccessCodes { hypoexists=30};
enum KalMiniSuccessCodes {unchanged=40};
enum KalMiniFailCodes {nohots=40,nocache=41,mustbeactive=42};
};
#endif
| 33.40625
| 76
| 0.682881
|
brownd1978
|
8267b549783c76a61d196991838495325ae2d3b4
| 695,994
|
cpp
|
C++
|
src/main_600.cpp
|
RedBrumbler/virtuoso-codegen
|
e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3
|
[
"Unlicense"
] | null | null | null |
src/main_600.cpp
|
RedBrumbler/virtuoso-codegen
|
e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3
|
[
"Unlicense"
] | null | null | null |
src/main_600.cpp
|
RedBrumbler/virtuoso-codegen
|
e83f6f0f9b47bec4b6dd976b21edc1d46bf3cfe3
|
[
"Unlicense"
] | null | null | null |
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRMessenger/BroadcastException
#include "GlobalNamespace/OVRMessenger_BroadcastException.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRMessenger/ListenerException
#include "GlobalNamespace/OVRMessenger_ListenerException.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: MessengerHelper
#include "GlobalNamespace/MessengerHelper.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: MessengerHelper.Awake
void GlobalNamespace::MessengerHelper::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MessengerHelper::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: MessengerHelper.OnDisable
void GlobalNamespace::MessengerHelper::OnDisable() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MessengerHelper::OnDisable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDisable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRMicInput
#include "GlobalNamespace/OVRMicInput.hpp"
// Including type: UnityEngine.AudioSource
#include "UnityEngine/AudioSource.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public UnityEngine.AudioSource audioSource
::UnityEngine::AudioSource*& GlobalNamespace::OVRMicInput::dyn_audioSource() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::dyn_audioSource");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "audioSource"))->offset;
return *reinterpret_cast<::UnityEngine::AudioSource**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Boolean GuiSelectDevice
bool& GlobalNamespace::OVRMicInput::dyn_GuiSelectDevice() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::dyn_GuiSelectDevice");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "GuiSelectDevice"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single sensitivity
float& GlobalNamespace::OVRMicInput::dyn_sensitivity() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::dyn_sensitivity");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "sensitivity"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single sourceVolume
float& GlobalNamespace::OVRMicInput::dyn_sourceVolume() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::dyn_sourceVolume");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "sourceVolume"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 micFrequency
int& GlobalNamespace::OVRMicInput::dyn_micFrequency() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::dyn_micFrequency");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "micFrequency"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public OVRMicInput/micActivation micControl
::GlobalNamespace::OVRMicInput::micActivation& GlobalNamespace::OVRMicInput::dyn_micControl() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::dyn_micControl");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "micControl"))->offset;
return *reinterpret_cast<::GlobalNamespace::OVRMicInput::micActivation*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String selectedDevice
::StringW& GlobalNamespace::OVRMicInput::dyn_selectedDevice() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::dyn_selectedDevice");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "selectedDevice"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Single loudness
float& GlobalNamespace::OVRMicInput::dyn_loudness() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::dyn_loudness");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "loudness"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean micSelected
bool& GlobalNamespace::OVRMicInput::dyn_micSelected() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::dyn_micSelected");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "micSelected"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 minFreq
int& GlobalNamespace::OVRMicInput::dyn_minFreq() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::dyn_minFreq");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "minFreq"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 maxFreq
int& GlobalNamespace::OVRMicInput::dyn_maxFreq() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::dyn_maxFreq");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "maxFreq"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean focused
bool& GlobalNamespace::OVRMicInput::dyn_focused() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::dyn_focused");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "focused"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: OVRMicInput.get_Sensitivity
float GlobalNamespace::OVRMicInput::get_Sensitivity() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::get_Sensitivity");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Sensitivity", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method);
}
// Autogenerated method: OVRMicInput.set_Sensitivity
void GlobalNamespace::OVRMicInput::set_Sensitivity(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::set_Sensitivity");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Sensitivity", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: OVRMicInput.get_SourceVolume
float GlobalNamespace::OVRMicInput::get_SourceVolume() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::get_SourceVolume");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SourceVolume", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method);
}
// Autogenerated method: OVRMicInput.set_SourceVolume
void GlobalNamespace::OVRMicInput::set_SourceVolume(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::set_SourceVolume");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_SourceVolume", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: OVRMicInput.get_MicFrequency
float GlobalNamespace::OVRMicInput::get_MicFrequency() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::get_MicFrequency");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_MicFrequency", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method);
}
// Autogenerated method: OVRMicInput.set_MicFrequency
void GlobalNamespace::OVRMicInput::set_MicFrequency(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::set_MicFrequency");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_MicFrequency", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: OVRMicInput.Awake
void GlobalNamespace::OVRMicInput::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRMicInput.Start
void GlobalNamespace::OVRMicInput::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRMicInput.Update
void GlobalNamespace::OVRMicInput::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRMicInput.OnApplicationFocus
void GlobalNamespace::OVRMicInput::OnApplicationFocus(bool focus) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::OnApplicationFocus");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnApplicationFocus", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(focus)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, focus);
}
// Autogenerated method: OVRMicInput.OnApplicationPause
void GlobalNamespace::OVRMicInput::OnApplicationPause(bool focus) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::OnApplicationPause");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnApplicationPause", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(focus)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, focus);
}
// Autogenerated method: OVRMicInput.OnDisable
void GlobalNamespace::OVRMicInput::OnDisable() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::OnDisable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDisable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRMicInput.OnGUI
void GlobalNamespace::OVRMicInput::OnGUI() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::OnGUI");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnGUI", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRMicInput.MicDeviceGUI
void GlobalNamespace::OVRMicInput::MicDeviceGUI(float left, float top, float width, float height, float buttonSpaceTop, float buttonSpaceLeft) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::MicDeviceGUI");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MicDeviceGUI", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(left), ::il2cpp_utils::ExtractType(top), ::il2cpp_utils::ExtractType(width), ::il2cpp_utils::ExtractType(height), ::il2cpp_utils::ExtractType(buttonSpaceTop), ::il2cpp_utils::ExtractType(buttonSpaceLeft)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, left, top, width, height, buttonSpaceTop, buttonSpaceLeft);
}
// Autogenerated method: OVRMicInput.GetMicCaps
void GlobalNamespace::OVRMicInput::GetMicCaps() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::GetMicCaps");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetMicCaps", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRMicInput.StartMicrophone
void GlobalNamespace::OVRMicInput::StartMicrophone() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::StartMicrophone");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StartMicrophone", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRMicInput.StopMicrophone
void GlobalNamespace::OVRMicInput::StopMicrophone() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::StopMicrophone");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StopMicrophone", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRMicInput.GetAveragedVolume
float GlobalNamespace::OVRMicInput::GetAveragedVolume() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::GetAveragedVolume");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetAveragedVolume", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRMicInput/micActivation
#include "GlobalNamespace/OVRMicInput.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRMicInput/micActivation HoldToSpeak
::GlobalNamespace::OVRMicInput::micActivation GlobalNamespace::OVRMicInput::micActivation::_get_HoldToSpeak() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::micActivation::_get_HoldToSpeak");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRMicInput::micActivation>("", "OVRMicInput/micActivation", "HoldToSpeak"));
}
// Autogenerated static field setter
// Set static field: static public OVRMicInput/micActivation HoldToSpeak
void GlobalNamespace::OVRMicInput::micActivation::_set_HoldToSpeak(::GlobalNamespace::OVRMicInput::micActivation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::micActivation::_set_HoldToSpeak");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRMicInput/micActivation", "HoldToSpeak", value));
}
// Autogenerated static field getter
// Get static field: static public OVRMicInput/micActivation PushToSpeak
::GlobalNamespace::OVRMicInput::micActivation GlobalNamespace::OVRMicInput::micActivation::_get_PushToSpeak() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::micActivation::_get_PushToSpeak");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRMicInput::micActivation>("", "OVRMicInput/micActivation", "PushToSpeak"));
}
// Autogenerated static field setter
// Set static field: static public OVRMicInput/micActivation PushToSpeak
void GlobalNamespace::OVRMicInput::micActivation::_set_PushToSpeak(::GlobalNamespace::OVRMicInput::micActivation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::micActivation::_set_PushToSpeak");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRMicInput/micActivation", "PushToSpeak", value));
}
// Autogenerated static field getter
// Get static field: static public OVRMicInput/micActivation ConstantSpeak
::GlobalNamespace::OVRMicInput::micActivation GlobalNamespace::OVRMicInput::micActivation::_get_ConstantSpeak() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::micActivation::_get_ConstantSpeak");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRMicInput::micActivation>("", "OVRMicInput/micActivation", "ConstantSpeak"));
}
// Autogenerated static field setter
// Set static field: static public OVRMicInput/micActivation ConstantSpeak
void GlobalNamespace::OVRMicInput::micActivation::_set_ConstantSpeak(::GlobalNamespace::OVRMicInput::micActivation value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::micActivation::_set_ConstantSpeak");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRMicInput/micActivation", "ConstantSpeak", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& GlobalNamespace::OVRMicInput::micActivation::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRMicInput::micActivation::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRVoiceMod
#include "GlobalNamespace/OVRVoiceMod.hpp"
// Including type: OVRVoiceMod/ovrVoiceModError
#include "GlobalNamespace/OVRVoiceMod_ovrVoiceModError.hpp"
// Including type: OVRVoiceMod/ovrViceModFlag
#include "GlobalNamespace/OVRVoiceMod_ovrViceModFlag.hpp"
// Including type: System.String
#include "System/String.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Int32 ovrVoiceModSuccess
int GlobalNamespace::OVRVoiceMod::_get_ovrVoiceModSuccess() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::_get_ovrVoiceModSuccess");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("", "OVRVoiceMod", "ovrVoiceModSuccess"));
}
// Autogenerated static field setter
// Set static field: static public System.Int32 ovrVoiceModSuccess
void GlobalNamespace::OVRVoiceMod::_set_ovrVoiceModSuccess(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::_set_ovrVoiceModSuccess");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceMod", "ovrVoiceModSuccess", value));
}
// Autogenerated static field getter
// Get static field: static public System.String strOVRLS
::StringW GlobalNamespace::OVRVoiceMod::_get_strOVRLS() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::_get_strOVRLS");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "OVRVoiceMod", "strOVRLS"));
}
// Autogenerated static field setter
// Set static field: static public System.String strOVRLS
void GlobalNamespace::OVRVoiceMod::_set_strOVRLS(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::_set_strOVRLS");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceMod", "strOVRLS", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 sOVRVoiceModInit
int GlobalNamespace::OVRVoiceMod::_get_sOVRVoiceModInit() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::_get_sOVRVoiceModInit");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("", "OVRVoiceMod", "sOVRVoiceModInit"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 sOVRVoiceModInit
void GlobalNamespace::OVRVoiceMod::_set_sOVRVoiceModInit(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::_set_sOVRVoiceModInit");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceMod", "sOVRVoiceModInit", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceMod sInstance
::GlobalNamespace::OVRVoiceMod* GlobalNamespace::OVRVoiceMod::_get_sInstance() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::_get_sInstance");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceMod*>("", "OVRVoiceMod", "sInstance"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceMod sInstance
void GlobalNamespace::OVRVoiceMod::_set_sInstance(::GlobalNamespace::OVRVoiceMod* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::_set_sInstance");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceMod", "sInstance", value));
}
// Autogenerated method: OVRVoiceMod.ovrVoiceModDll_Initialize
int GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_Initialize(int SampleRate, int BufferSize) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_Initialize");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "ovrVoiceModDll_Initialize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(SampleRate), ::il2cpp_utils::ExtractType(BufferSize)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, SampleRate, BufferSize);
}
// Autogenerated method: OVRVoiceMod.ovrVoiceModDll_Shutdown
void GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_Shutdown() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_Shutdown");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "ovrVoiceModDll_Shutdown", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: OVRVoiceMod.ovrVoicemodDll_GetVersion
::System::IntPtr GlobalNamespace::OVRVoiceMod::ovrVoicemodDll_GetVersion(ByRef<int> Major, ByRef<int> Minor, ByRef<int> Patch) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoicemodDll_GetVersion");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "ovrVoicemodDll_GetVersion", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(Major), ::il2cpp_utils::ExtractType(Minor), ::il2cpp_utils::ExtractType(Patch)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IntPtr, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, byref(Major), byref(Minor), byref(Patch));
}
// Autogenerated method: OVRVoiceMod.ovrVoiceModDll_CreateContext
int GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_CreateContext(ByRef<uint> Context) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_CreateContext");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "ovrVoiceModDll_CreateContext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(Context)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, byref(Context));
}
// Autogenerated method: OVRVoiceMod.ovrVoiceModDll_DestroyContext
int GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_DestroyContext(uint Context) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_DestroyContext");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "ovrVoiceModDll_DestroyContext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(Context)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, Context);
}
// Autogenerated method: OVRVoiceMod.ovrVoiceModDll_SendParameter
int GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_SendParameter(uint Context, int Parameter, int Value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_SendParameter");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "ovrVoiceModDll_SendParameter", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(Context), ::il2cpp_utils::ExtractType(Parameter), ::il2cpp_utils::ExtractType(Value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, Context, Parameter, Value);
}
// Autogenerated method: OVRVoiceMod.ovrVoiceModDll_ProcessFrame
int GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_ProcessFrame(uint Context, uint Flags, ::ArrayW<float> AudioBuffer) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_ProcessFrame");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "ovrVoiceModDll_ProcessFrame", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(Context), ::il2cpp_utils::ExtractType(Flags), ::il2cpp_utils::ExtractType(AudioBuffer)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, Context, Flags, AudioBuffer);
}
// Autogenerated method: OVRVoiceMod.ovrVoiceModDll_ProcessFrameInterleaved
int GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_ProcessFrameInterleaved(uint Context, uint Flags, ::ArrayW<float> AudioBuffer) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_ProcessFrameInterleaved");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "ovrVoiceModDll_ProcessFrameInterleaved", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(Context), ::il2cpp_utils::ExtractType(Flags), ::il2cpp_utils::ExtractType(AudioBuffer)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, Context, Flags, AudioBuffer);
}
// Autogenerated method: OVRVoiceMod.ovrVoiceModDll_GetAverageAbsVolume
int GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_GetAverageAbsVolume(uint Context, ByRef<float> Volume) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModDll_GetAverageAbsVolume");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "ovrVoiceModDll_GetAverageAbsVolume", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(Context), ::il2cpp_utils::ExtractType(Volume)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, Context, byref(Volume));
}
// Autogenerated method: OVRVoiceMod.Awake
void GlobalNamespace::OVRVoiceMod::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRVoiceMod.Start
void GlobalNamespace::OVRVoiceMod::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRVoiceMod.Update
void GlobalNamespace::OVRVoiceMod::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRVoiceMod.OnDestroy
void GlobalNamespace::OVRVoiceMod::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::OnDestroy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRVoiceMod.IsInitialized
int GlobalNamespace::OVRVoiceMod::IsInitialized() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::IsInitialized");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "IsInitialized", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: OVRVoiceMod.CreateContext
int GlobalNamespace::OVRVoiceMod::CreateContext(ByRef<uint> context) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::CreateContext");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "CreateContext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(context)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, byref(context));
}
// Autogenerated method: OVRVoiceMod.DestroyContext
int GlobalNamespace::OVRVoiceMod::DestroyContext(uint context) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::DestroyContext");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "DestroyContext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(context)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, context);
}
// Autogenerated method: OVRVoiceMod.SendParameter
int GlobalNamespace::OVRVoiceMod::SendParameter(uint context, int parameter, int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::SendParameter");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "SendParameter", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(context), ::il2cpp_utils::ExtractType(parameter), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, context, parameter, value);
}
// Autogenerated method: OVRVoiceMod.ProcessFrame
int GlobalNamespace::OVRVoiceMod::ProcessFrame(uint context, ::ArrayW<float> audioBuffer) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ProcessFrame");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "ProcessFrame", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(context), ::il2cpp_utils::ExtractType(audioBuffer)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, context, audioBuffer);
}
// Autogenerated method: OVRVoiceMod.ProcessFrameInterleaved
int GlobalNamespace::OVRVoiceMod::ProcessFrameInterleaved(uint context, ::ArrayW<float> audioBuffer) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ProcessFrameInterleaved");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "ProcessFrameInterleaved", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(context), ::il2cpp_utils::ExtractType(audioBuffer)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, context, audioBuffer);
}
// Autogenerated method: OVRVoiceMod.GetAverageAbsVolume
float GlobalNamespace::OVRVoiceMod::GetAverageAbsVolume(uint context) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::GetAverageAbsVolume");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", "GetAverageAbsVolume", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(context)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, context);
}
// Autogenerated method: OVRVoiceMod..cctor
void GlobalNamespace::OVRVoiceMod::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OVRVoiceMod", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRVoiceMod/ovrVoiceModError
#include "GlobalNamespace/OVRVoiceMod_ovrVoiceModError.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRVoiceMod/ovrVoiceModError Unknown
::GlobalNamespace::OVRVoiceMod::ovrVoiceModError GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_get_Unknown() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_get_Unknown");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceMod::ovrVoiceModError>("", "OVRVoiceMod/ovrVoiceModError", "Unknown"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceMod/ovrVoiceModError Unknown
void GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_set_Unknown(::GlobalNamespace::OVRVoiceMod::ovrVoiceModError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_set_Unknown");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceMod/ovrVoiceModError", "Unknown", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceMod/ovrVoiceModError CannotCreateContext
::GlobalNamespace::OVRVoiceMod::ovrVoiceModError GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_get_CannotCreateContext() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_get_CannotCreateContext");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceMod::ovrVoiceModError>("", "OVRVoiceMod/ovrVoiceModError", "CannotCreateContext"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceMod/ovrVoiceModError CannotCreateContext
void GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_set_CannotCreateContext(::GlobalNamespace::OVRVoiceMod::ovrVoiceModError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_set_CannotCreateContext");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceMod/ovrVoiceModError", "CannotCreateContext", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceMod/ovrVoiceModError InvalidParam
::GlobalNamespace::OVRVoiceMod::ovrVoiceModError GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_get_InvalidParam() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_get_InvalidParam");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceMod::ovrVoiceModError>("", "OVRVoiceMod/ovrVoiceModError", "InvalidParam"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceMod/ovrVoiceModError InvalidParam
void GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_set_InvalidParam(::GlobalNamespace::OVRVoiceMod::ovrVoiceModError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_set_InvalidParam");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceMod/ovrVoiceModError", "InvalidParam", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceMod/ovrVoiceModError BadSampleRate
::GlobalNamespace::OVRVoiceMod::ovrVoiceModError GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_get_BadSampleRate() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_get_BadSampleRate");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceMod::ovrVoiceModError>("", "OVRVoiceMod/ovrVoiceModError", "BadSampleRate"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceMod/ovrVoiceModError BadSampleRate
void GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_set_BadSampleRate(::GlobalNamespace::OVRVoiceMod::ovrVoiceModError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_set_BadSampleRate");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceMod/ovrVoiceModError", "BadSampleRate", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceMod/ovrVoiceModError MissingDLL
::GlobalNamespace::OVRVoiceMod::ovrVoiceModError GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_get_MissingDLL() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_get_MissingDLL");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceMod::ovrVoiceModError>("", "OVRVoiceMod/ovrVoiceModError", "MissingDLL"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceMod/ovrVoiceModError MissingDLL
void GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_set_MissingDLL(::GlobalNamespace::OVRVoiceMod::ovrVoiceModError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_set_MissingDLL");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceMod/ovrVoiceModError", "MissingDLL", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceMod/ovrVoiceModError BadVersion
::GlobalNamespace::OVRVoiceMod::ovrVoiceModError GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_get_BadVersion() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_get_BadVersion");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceMod::ovrVoiceModError>("", "OVRVoiceMod/ovrVoiceModError", "BadVersion"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceMod/ovrVoiceModError BadVersion
void GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_set_BadVersion(::GlobalNamespace::OVRVoiceMod::ovrVoiceModError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_set_BadVersion");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceMod/ovrVoiceModError", "BadVersion", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceMod/ovrVoiceModError UndefinedFunction
::GlobalNamespace::OVRVoiceMod::ovrVoiceModError GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_get_UndefinedFunction() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_get_UndefinedFunction");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceMod::ovrVoiceModError>("", "OVRVoiceMod/ovrVoiceModError", "UndefinedFunction"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceMod/ovrVoiceModError UndefinedFunction
void GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_set_UndefinedFunction(::GlobalNamespace::OVRVoiceMod::ovrVoiceModError value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::_set_UndefinedFunction");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceMod/ovrVoiceModError", "UndefinedFunction", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& GlobalNamespace::OVRVoiceMod::ovrVoiceModError::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrVoiceModError::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRVoiceMod/ovrViceModFlag
#include "GlobalNamespace/OVRVoiceMod_ovrViceModFlag.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRVoiceMod/ovrViceModFlag None
::GlobalNamespace::OVRVoiceMod::ovrViceModFlag GlobalNamespace::OVRVoiceMod::ovrViceModFlag::_get_None() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrViceModFlag::_get_None");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceMod::ovrViceModFlag>("", "OVRVoiceMod/ovrViceModFlag", "None"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceMod/ovrViceModFlag None
void GlobalNamespace::OVRVoiceMod::ovrViceModFlag::_set_None(::GlobalNamespace::OVRVoiceMod::ovrViceModFlag value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrViceModFlag::_set_None");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceMod/ovrViceModFlag", "None", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& GlobalNamespace::OVRVoiceMod::ovrViceModFlag::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceMod::ovrViceModFlag::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRVoiceModContext
#include "GlobalNamespace/OVRVoiceModContext.hpp"
// Including type: OVRVoiceModContext/ovrVoiceModParams
#include "GlobalNamespace/OVRVoiceModContext_ovrVoiceModParams.hpp"
// Including type: UnityEngine.Color
#include "UnityEngine/Color.hpp"
// Including type: UnityEngine.AudioSource
#include "UnityEngine/AudioSource.hpp"
// Including type: OVRTouchpad/TouchEvent
#include "GlobalNamespace/OVRTouchpad.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public UnityEngine.AudioSource audioSource
::UnityEngine::AudioSource*& GlobalNamespace::OVRVoiceModContext::dyn_audioSource() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_audioSource");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "audioSource"))->offset;
return *reinterpret_cast<::UnityEngine::AudioSource**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Single gain
float& GlobalNamespace::OVRVoiceModContext::dyn_gain() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_gain");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "gain"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Boolean audioMute
bool& GlobalNamespace::OVRVoiceModContext::dyn_audioMute() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_audioMute");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "audioMute"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.KeyCode loopback
::UnityEngine::KeyCode& GlobalNamespace::OVRVoiceModContext::dyn_loopback() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_loopback");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "loopback"))->offset;
return *reinterpret_cast<::UnityEngine::KeyCode*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private OVRVoiceModContext/VMPreset[] VMPresets
::ArrayW<::GlobalNamespace::OVRVoiceModContext::VMPreset>& GlobalNamespace::OVRVoiceModContext::dyn_VMPresets() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VMPresets");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VMPresets"))->offset;
return *reinterpret_cast<::ArrayW<::GlobalNamespace::OVRVoiceModContext::VMPreset>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Single VM_MixAudio
float& GlobalNamespace::OVRVoiceModContext::dyn_VM_MixAudio() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_MixAudio");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_MixAudio"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Single VM_Pitch
float& GlobalNamespace::OVRVoiceModContext::dyn_VM_Pitch() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_Pitch");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_Pitch"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 VM_Bands
int& GlobalNamespace::OVRVoiceModContext::dyn_VM_Bands() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_Bands");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_Bands"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 VM_FormantCorrect
int& GlobalNamespace::OVRVoiceModContext::dyn_VM_FormantCorrect() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_FormantCorrect");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_FormantCorrect"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 VM_C1_TrackPitch
int& GlobalNamespace::OVRVoiceModContext::dyn_VM_C1_TrackPitch() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_C1_TrackPitch");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_C1_TrackPitch"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 VM_C1_Type
int& GlobalNamespace::OVRVoiceModContext::dyn_VM_C1_Type() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_C1_Type");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_C1_Type"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Single VM_C1_Gain
float& GlobalNamespace::OVRVoiceModContext::dyn_VM_C1_Gain() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_C1_Gain");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_C1_Gain"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Single VM_C1_Freq
float& GlobalNamespace::OVRVoiceModContext::dyn_VM_C1_Freq() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_C1_Freq");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_C1_Freq"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 VM_C1_Note
int& GlobalNamespace::OVRVoiceModContext::dyn_VM_C1_Note() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_C1_Note");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_C1_Note"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Single VM_C1_PulseWidth
float& GlobalNamespace::OVRVoiceModContext::dyn_VM_C1_PulseWidth() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_C1_PulseWidth");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_C1_PulseWidth"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 VM_C1_CycledNoiseSize
int& GlobalNamespace::OVRVoiceModContext::dyn_VM_C1_CycledNoiseSize() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_C1_CycledNoiseSize");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_C1_CycledNoiseSize"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 VM_C2_TrackPitch
int& GlobalNamespace::OVRVoiceModContext::dyn_VM_C2_TrackPitch() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_C2_TrackPitch");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_C2_TrackPitch"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 VM_C2_Type
int& GlobalNamespace::OVRVoiceModContext::dyn_VM_C2_Type() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_C2_Type");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_C2_Type"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Single VM_C2_Gain
float& GlobalNamespace::OVRVoiceModContext::dyn_VM_C2_Gain() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_C2_Gain");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_C2_Gain"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Single VM_C2_Freq
float& GlobalNamespace::OVRVoiceModContext::dyn_VM_C2_Freq() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_C2_Freq");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_C2_Freq"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 VM_C2_Note
int& GlobalNamespace::OVRVoiceModContext::dyn_VM_C2_Note() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_C2_Note");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_C2_Note"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Single VM_C2_PulseWidth
float& GlobalNamespace::OVRVoiceModContext::dyn_VM_C2_PulseWidth() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_C2_PulseWidth");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_C2_PulseWidth"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 VM_C2_CycledNoiseSize
int& GlobalNamespace::OVRVoiceModContext::dyn_VM_C2_CycledNoiseSize() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_VM_C2_CycledNoiseSize");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "VM_C2_CycledNoiseSize"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.UInt32 context
uint& GlobalNamespace::OVRVoiceModContext::dyn_context() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_context");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "context"))->offset;
return *reinterpret_cast<uint*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single prevVol
float& GlobalNamespace::OVRVoiceModContext::dyn_prevVol() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::dyn_prevVol");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "prevVol"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: OVRVoiceModContext.Awake
void GlobalNamespace::OVRVoiceModContext::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRVoiceModContext.Start
void GlobalNamespace::OVRVoiceModContext::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRVoiceModContext.Update
void GlobalNamespace::OVRVoiceModContext::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRVoiceModContext.OnDestroy
void GlobalNamespace::OVRVoiceModContext::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::OnDestroy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRVoiceModContext.OnAudioFilterRead
void GlobalNamespace::OVRVoiceModContext::OnAudioFilterRead(::ArrayW<float> data, int channels) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::OnAudioFilterRead");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnAudioFilterRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(data), ::il2cpp_utils::ExtractType(channels)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, data, channels);
}
// Autogenerated method: OVRVoiceModContext.SendParameter
int GlobalNamespace::OVRVoiceModContext::SendParameter(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams parameter, int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::SendParameter");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SendParameter", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parameter), ::il2cpp_utils::ExtractType(value)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, parameter, value);
}
// Autogenerated method: OVRVoiceModContext.SetPreset
bool GlobalNamespace::OVRVoiceModContext::SetPreset(int preset) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::SetPreset");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetPreset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(preset)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, preset);
}
// Autogenerated method: OVRVoiceModContext.GetNumPresets
int GlobalNamespace::OVRVoiceModContext::GetNumPresets() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::GetNumPresets");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetNumPresets", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method);
}
// Autogenerated method: OVRVoiceModContext.GetPresetColor
::UnityEngine::Color GlobalNamespace::OVRVoiceModContext::GetPresetColor(int preset) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::GetPresetColor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetPresetColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(preset)})));
return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Color, false>(this, ___internal__method, preset);
}
// Autogenerated method: OVRVoiceModContext.GetAverageAbsVolume
float GlobalNamespace::OVRVoiceModContext::GetAverageAbsVolume() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::GetAverageAbsVolume");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetAverageAbsVolume", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method);
}
// Autogenerated method: OVRVoiceModContext.LocalTouchEventCallback
void GlobalNamespace::OVRVoiceModContext::LocalTouchEventCallback(::GlobalNamespace::OVRTouchpad::TouchEvent touchEvent) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::LocalTouchEventCallback");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LocalTouchEventCallback", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(touchEvent)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, touchEvent);
}
// Autogenerated method: OVRVoiceModContext.UpdateVoiceModUpdate
void GlobalNamespace::OVRVoiceModContext::UpdateVoiceModUpdate() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::UpdateVoiceModUpdate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateVoiceModUpdate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OVRVoiceModContext.SendVoiceModUpdate
void GlobalNamespace::OVRVoiceModContext::SendVoiceModUpdate() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::SendVoiceModUpdate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SendVoiceModUpdate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OVRVoiceModContext/ovrVoiceModParams
#include "GlobalNamespace/OVRVoiceModContext_ovrVoiceModParams.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams MixInputAudio
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_MixInputAudio() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_MixInputAudio");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "MixInputAudio"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams MixInputAudio
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_MixInputAudio(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_MixInputAudio");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "MixInputAudio", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams PitchInputAudio
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_PitchInputAudio() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_PitchInputAudio");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "PitchInputAudio"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams PitchInputAudio
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_PitchInputAudio(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_PitchInputAudio");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "PitchInputAudio", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams SetBands
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_SetBands() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_SetBands");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "SetBands"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams SetBands
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_SetBands(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_SetBands");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "SetBands", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams FormantCorrection
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_FormantCorrection() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_FormantCorrection");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "FormantCorrection"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams FormantCorrection
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_FormantCorrection(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_FormantCorrection");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "FormantCorrection", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier1_TrackPitch
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier1_TrackPitch() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier1_TrackPitch");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier1_TrackPitch"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier1_TrackPitch
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier1_TrackPitch(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier1_TrackPitch");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier1_TrackPitch", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier1_Type
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier1_Type() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier1_Type");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier1_Type"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier1_Type
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier1_Type(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier1_Type");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier1_Type", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier1_Gain
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier1_Gain() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier1_Gain");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier1_Gain"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier1_Gain
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier1_Gain(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier1_Gain");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier1_Gain", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier1_Frequency
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier1_Frequency() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier1_Frequency");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier1_Frequency"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier1_Frequency
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier1_Frequency(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier1_Frequency");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier1_Frequency", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier1_Note
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier1_Note() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier1_Note");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier1_Note"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier1_Note
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier1_Note(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier1_Note");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier1_Note", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier1_PulseWidth
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier1_PulseWidth() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier1_PulseWidth");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier1_PulseWidth"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier1_PulseWidth
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier1_PulseWidth(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier1_PulseWidth");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier1_PulseWidth", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier1_CycledNoiseSize
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier1_CycledNoiseSize() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier1_CycledNoiseSize");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier1_CycledNoiseSize"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier1_CycledNoiseSize
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier1_CycledNoiseSize(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier1_CycledNoiseSize");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier1_CycledNoiseSize", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier2_TrackPitch
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier2_TrackPitch() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier2_TrackPitch");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier2_TrackPitch"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier2_TrackPitch
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier2_TrackPitch(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier2_TrackPitch");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier2_TrackPitch", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier2_Type
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier2_Type() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier2_Type");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier2_Type"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier2_Type
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier2_Type(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier2_Type");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier2_Type", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier2_Gain
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier2_Gain() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier2_Gain");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier2_Gain"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier2_Gain
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier2_Gain(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier2_Gain");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier2_Gain", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier2_Frequency
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier2_Frequency() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier2_Frequency");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier2_Frequency"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier2_Frequency
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier2_Frequency(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier2_Frequency");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier2_Frequency", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier2_Note
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier2_Note() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier2_Note");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier2_Note"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier2_Note
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier2_Note(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier2_Note");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier2_Note", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier2_PulseWidth
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier2_PulseWidth() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier2_PulseWidth");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier2_PulseWidth"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier2_PulseWidth
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier2_PulseWidth(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier2_PulseWidth");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier2_PulseWidth", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier2_CycledNoiseSize
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier2_CycledNoiseSize() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Carrier2_CycledNoiseSize");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier2_CycledNoiseSize"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Carrier2_CycledNoiseSize
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier2_CycledNoiseSize(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Carrier2_CycledNoiseSize");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Carrier2_CycledNoiseSize", value));
}
// Autogenerated static field getter
// Get static field: static public OVRVoiceModContext/ovrVoiceModParams Count
::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Count() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_get_Count");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams>("", "OVRVoiceModContext/ovrVoiceModParams", "Count"));
}
// Autogenerated static field setter
// Set static field: static public OVRVoiceModContext/ovrVoiceModParams Count
void GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Count(::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::_set_Count");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OVRVoiceModContext/ovrVoiceModParams", "Count", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OVRVoiceModContext::ovrVoiceModParams::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Key
#include "GlobalNamespace/Key.hpp"
// Including type: Key/Type
#include "GlobalNamespace/Key_Type.hpp"
// Including type: PunchKeyData
#include "GlobalNamespace/PunchKeyData.hpp"
// Including type: VROSC.UI.UIInteractableColoring
#include "VROSC/UI/UIInteractableColoring.hpp"
// Including type: UnityEngine.Collider
#include "UnityEngine/Collider.hpp"
// Including type: UnityEngine.Rigidbody
#include "UnityEngine/Rigidbody.hpp"
// Including type: UnityEngine.Transform
#include "UnityEngine/Transform.hpp"
// Including type: TMPro.TextMeshPro
#include "TMPro/TextMeshPro.hpp"
// Including type: System.Action`2
#include "System/Action_2.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.Single DistanceToBePressed
float GlobalNamespace::Key::_get_DistanceToBePressed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::_get_DistanceToBePressed");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<float>("", "Key", "DistanceToBePressed"));
}
// Autogenerated static field setter
// Set static field: static private System.Single DistanceToBePressed
void GlobalNamespace::Key::_set_DistanceToBePressed(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::_set_DistanceToBePressed");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "Key", "DistanceToBePressed", value));
}
// Autogenerated static field getter
// Get static field: static private System.Single KeyBounceBackMultiplier
float GlobalNamespace::Key::_get_KeyBounceBackMultiplier() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::_get_KeyBounceBackMultiplier");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<float>("", "Key", "KeyBounceBackMultiplier"));
}
// Autogenerated static field setter
// Set static field: static private System.Single KeyBounceBackMultiplier
void GlobalNamespace::Key::_set_KeyBounceBackMultiplier(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::_set_KeyBounceBackMultiplier");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "Key", "KeyBounceBackMultiplier", value));
}
// Autogenerated static field getter
// Get static field: static public System.Action`2<Key,System.Single> OnKeyHit
::System::Action_2<::GlobalNamespace::Key*, float>* GlobalNamespace::Key::_get_OnKeyHit() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::_get_OnKeyHit");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Action_2<::GlobalNamespace::Key*, float>*>("", "Key", "OnKeyHit")));
}
// Autogenerated static field setter
// Set static field: static public System.Action`2<Key,System.Single> OnKeyHit
void GlobalNamespace::Key::_set_OnKeyHit(::System::Action_2<::GlobalNamespace::Key*, float>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::_set_OnKeyHit");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "Key", "OnKeyHit", value));
}
// Autogenerated instance field getter
// Get instance field: private PunchKeyData _data
::GlobalNamespace::PunchKeyData*& GlobalNamespace::Key::dyn__data() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn__data");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_data"))->offset;
return *reinterpret_cast<::GlobalNamespace::PunchKeyData**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UI.UIInteractableColoring _coloring
::VROSC::UI::UIInteractableColoring*& GlobalNamespace::Key::dyn__coloring() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn__coloring");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_coloring"))->offset;
return *reinterpret_cast<::VROSC::UI::UIInteractableColoring**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Collider _collider
::UnityEngine::Collider*& GlobalNamespace::Key::dyn__collider() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn__collider");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_collider"))->offset;
return *reinterpret_cast<::UnityEngine::Collider**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Rigidbody _rigidBody
::UnityEngine::Rigidbody*& GlobalNamespace::Key::dyn__rigidBody() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn__rigidBody");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_rigidBody"))->offset;
return *reinterpret_cast<::UnityEngine::Rigidbody**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Boolean KeyPressed
bool& GlobalNamespace::Key::dyn_KeyPressed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn_KeyPressed");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "KeyPressed"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _startRepeatedPressesDelay
float& GlobalNamespace::Key::dyn__startRepeatedPressesDelay() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn__startRepeatedPressesDelay");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_startRepeatedPressesDelay"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _repeatedPressDelay
float& GlobalNamespace::Key::dyn__repeatedPressDelay() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn__repeatedPressDelay");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_repeatedPressDelay"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: protected UnityEngine.Transform initialPosition
::UnityEngine::Transform*& GlobalNamespace::Key::dyn_initialPosition() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn_initialPosition");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "initialPosition"))->offset;
return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private TMPro.TextMeshPro keyCapText
::TMPro::TextMeshPro*& GlobalNamespace::Key::dyn_keyCapText() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn_keyCapText");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "keyCapText"))->offset;
return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Vector3 initialLocalPosition
::UnityEngine::Vector3& GlobalNamespace::Key::dyn_initialLocalPosition() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn_initialLocalPosition");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "initialLocalPosition"))->offset;
return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Quaternion initialLocalRotation
::UnityEngine::Quaternion& GlobalNamespace::Key::dyn_initialLocalRotation() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn_initialLocalRotation");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "initialLocalRotation"))->offset;
return *reinterpret_cast<::UnityEngine::Quaternion*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Vector3 constrainedPosition
::UnityEngine::Vector3& GlobalNamespace::Key::dyn_constrainedPosition() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn_constrainedPosition");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "constrainedPosition"))->offset;
return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Quaternion constrainedRotation
::UnityEngine::Quaternion& GlobalNamespace::Key::dyn_constrainedRotation() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn_constrainedRotation");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "constrainedRotation"))->offset;
return *reinterpret_cast<::UnityEngine::Quaternion*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean checkForButton
bool& GlobalNamespace::Key::dyn_checkForButton() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn_checkForButton");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "checkForButton"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single currentDistance
float& GlobalNamespace::Key::dyn_currentDistance() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn_currentDistance");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "currentDistance"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _pressedTimer
float& GlobalNamespace::Key::dyn__pressedTimer() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn__pressedTimer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_pressedTimer"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _isRepeating
bool& GlobalNamespace::Key::dyn__isRepeating() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::dyn__isRepeating");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_isRepeating"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Key.get_KeyType
::GlobalNamespace::Key::Type GlobalNamespace::Key::get_KeyType() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::get_KeyType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_KeyType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::GlobalNamespace::Key::Type, false>(this, ___internal__method);
}
// Autogenerated method: Key.get_KeyCapChar
::StringW GlobalNamespace::Key::get_KeyCapChar() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::get_KeyCapChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_KeyCapChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: Key.get_AlterateKeyCapChar
::StringW GlobalNamespace::Key::get_AlterateKeyCapChar() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::get_AlterateKeyCapChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_AlterateKeyCapChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: Key.get_OutputChar
::StringW GlobalNamespace::Key::get_OutputChar() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::get_OutputChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_OutputChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: Key.Start
void GlobalNamespace::Key::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Key.OnDestroy
void GlobalNamespace::Key::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::OnDestroy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Key.FixedUpdate
void GlobalNamespace::Key::FixedUpdate() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::FixedUpdate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FixedUpdate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Key.Update
void GlobalNamespace::Key::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Key.LateUpdate
void GlobalNamespace::Key::LateUpdate() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::LateUpdate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LateUpdate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Key.ChangeKeyColorOnPress
void GlobalNamespace::Key::ChangeKeyColorOnPress() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::ChangeKeyColorOnPress");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ChangeKeyColorOnPress", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Key.ConstrainPosition
void GlobalNamespace::Key::ConstrainPosition() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::ConstrainPosition");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ConstrainPosition", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Key.SwitchKeycapCharCase
void GlobalNamespace::Key::SwitchKeycapCharCase() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::SwitchKeycapCharCase");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SwitchKeycapCharCase", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Key.SwitchToSymbols
void GlobalNamespace::Key::SwitchToSymbols() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::SwitchToSymbols");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SwitchToSymbols", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Key.HitKey
void GlobalNamespace::Key::HitKey(bool send) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::HitKey");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "HitKey", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(send)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, send);
}
// Autogenerated method: Key.SetTextToDefault
void GlobalNamespace::Key::SetTextToDefault() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::SetTextToDefault");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetTextToDefault", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Key.SettingsUpdated
void GlobalNamespace::Key::SettingsUpdated() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::SettingsUpdated");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SettingsUpdated", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Key/Type
#include "GlobalNamespace/Key_Type.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public Key/Type ALPHA
::GlobalNamespace::Key::Type GlobalNamespace::Key::Type::_get_ALPHA() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::Type::_get_ALPHA");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::Key::Type>("", "Key/Type", "ALPHA"));
}
// Autogenerated static field setter
// Set static field: static public Key/Type ALPHA
void GlobalNamespace::Key::Type::_set_ALPHA(::GlobalNamespace::Key::Type value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::Type::_set_ALPHA");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "Key/Type", "ALPHA", value));
}
// Autogenerated static field getter
// Get static field: static public Key/Type BACKSPACE
::GlobalNamespace::Key::Type GlobalNamespace::Key::Type::_get_BACKSPACE() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::Type::_get_BACKSPACE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::Key::Type>("", "Key/Type", "BACKSPACE"));
}
// Autogenerated static field setter
// Set static field: static public Key/Type BACKSPACE
void GlobalNamespace::Key::Type::_set_BACKSPACE(::GlobalNamespace::Key::Type value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::Type::_set_BACKSPACE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "Key/Type", "BACKSPACE", value));
}
// Autogenerated static field getter
// Get static field: static public Key/Type SHIFT
::GlobalNamespace::Key::Type GlobalNamespace::Key::Type::_get_SHIFT() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::Type::_get_SHIFT");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::Key::Type>("", "Key/Type", "SHIFT"));
}
// Autogenerated static field setter
// Set static field: static public Key/Type SHIFT
void GlobalNamespace::Key::Type::_set_SHIFT(::GlobalNamespace::Key::Type value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::Type::_set_SHIFT");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "Key/Type", "SHIFT", value));
}
// Autogenerated static field getter
// Get static field: static public Key/Type RETURN
::GlobalNamespace::Key::Type GlobalNamespace::Key::Type::_get_RETURN() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::Type::_get_RETURN");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::Key::Type>("", "Key/Type", "RETURN"));
}
// Autogenerated static field setter
// Set static field: static public Key/Type RETURN
void GlobalNamespace::Key::Type::_set_RETURN(::GlobalNamespace::Key::Type value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::Type::_set_RETURN");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "Key/Type", "RETURN", value));
}
// Autogenerated static field getter
// Get static field: static public Key/Type SYMBOL
::GlobalNamespace::Key::Type GlobalNamespace::Key::Type::_get_SYMBOL() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::Type::_get_SYMBOL");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::Key::Type>("", "Key/Type", "SYMBOL"));
}
// Autogenerated static field setter
// Set static field: static public Key/Type SYMBOL
void GlobalNamespace::Key::Type::_set_SYMBOL(::GlobalNamespace::Key::Type value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::Type::_set_SYMBOL");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "Key/Type", "SYMBOL", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& GlobalNamespace::Key::Type::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Key::Type::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: KeySoundController
#include "GlobalNamespace/KeySoundController.hpp"
// Including type: KeySoundController/<PlayKeySound>d__2
#include "GlobalNamespace/KeySoundController_-PlayKeySound-d__2.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: UnityEngine.Transform
#include "UnityEngine/Transform.hpp"
// Including type: System.Collections.IEnumerator
#include "System/Collections/IEnumerator.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public UnityEngine.GameObject KeySoundPlayer
::UnityEngine::GameObject*& GlobalNamespace::KeySoundController::dyn_KeySoundPlayer() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeySoundController::dyn_KeySoundPlayer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "KeySoundPlayer"))->offset;
return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: KeySoundController.StartKeySound
void GlobalNamespace::KeySoundController::StartKeySound(::UnityEngine::Transform* keyTransform) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeySoundController::StartKeySound");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StartKeySound", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(keyTransform)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, keyTransform);
}
// Autogenerated method: KeySoundController.PlayKeySound
::System::Collections::IEnumerator* GlobalNamespace::KeySoundController::PlayKeySound(::UnityEngine::Transform* keyTransform) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeySoundController::PlayKeySound");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "PlayKeySound", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(keyTransform)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, keyTransform);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: KeySoundController/<PlayKeySound>d__2
#include "GlobalNamespace/KeySoundController_-PlayKeySound-d__2.hpp"
// Including type: UnityEngine.Transform
#include "UnityEngine/Transform.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Int32 <>1__state
int& GlobalNamespace::KeySoundController::$PlayKeySound$d__2::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeySoundController::$PlayKeySound$d__2::dyn_$$1__state");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Object <>2__current
::Il2CppObject*& GlobalNamespace::KeySoundController::$PlayKeySound$d__2::dyn_$$2__current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeySoundController::$PlayKeySound$d__2::dyn_$$2__current");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>2__current"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public KeySoundController <>4__this
::GlobalNamespace::KeySoundController*& GlobalNamespace::KeySoundController::$PlayKeySound$d__2::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeySoundController::$PlayKeySound$d__2::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::GlobalNamespace::KeySoundController**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.Transform keyTransform
::UnityEngine::Transform*& GlobalNamespace::KeySoundController::$PlayKeySound$d__2::dyn_keyTransform() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeySoundController::$PlayKeySound$d__2::dyn_keyTransform");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "keyTransform"))->offset;
return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.GameObject <player>5__2
::UnityEngine::GameObject*& GlobalNamespace::KeySoundController::$PlayKeySound$d__2::dyn_$player$5__2() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeySoundController::$PlayKeySound$d__2::dyn_$player$5__2");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<player>5__2"))->offset;
return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: KeySoundController/<PlayKeySound>d__2.System.Collections.Generic.IEnumerator<System.Object>.get_Current
::Il2CppObject* GlobalNamespace::KeySoundController::$PlayKeySound$d__2::System_Collections_Generic_IEnumerator$System_Object$_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeySoundController::$PlayKeySound$d__2::System.Collections.Generic.IEnumerator<System.Object>.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerator<System.Object>.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: KeySoundController/<PlayKeySound>d__2.System.Collections.IEnumerator.get_Current
::Il2CppObject* GlobalNamespace::KeySoundController::$PlayKeySound$d__2::System_Collections_IEnumerator_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeySoundController::$PlayKeySound$d__2::System.Collections.IEnumerator.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: KeySoundController/<PlayKeySound>d__2.System.IDisposable.Dispose
void GlobalNamespace::KeySoundController::$PlayKeySound$d__2::System_IDisposable_Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeySoundController::$PlayKeySound$d__2::System.IDisposable.Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IDisposable.Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: KeySoundController/<PlayKeySound>d__2.MoveNext
bool GlobalNamespace::KeySoundController::$PlayKeySound$d__2::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeySoundController::$PlayKeySound$d__2::MoveNext");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveNext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: KeySoundController/<PlayKeySound>d__2.System.Collections.IEnumerator.Reset
void GlobalNamespace::KeySoundController::$PlayKeySound$d__2::System_Collections_IEnumerator_Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeySoundController::$PlayKeySound$d__2::System.Collections.IEnumerator.Reset");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: KeyboardLaserInput
#include "GlobalNamespace/KeyboardLaserInput.hpp"
// Including type: Key
#include "GlobalNamespace/Key.hpp"
// Including type: UnityEngine.Collider
#include "UnityEngine/Collider.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private Key _key
::GlobalNamespace::Key*& GlobalNamespace::KeyboardLaserInput::dyn__key() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeyboardLaserInput::dyn__key");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_key"))->offset;
return *reinterpret_cast<::GlobalNamespace::Key**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Collider _collider
::UnityEngine::Collider*& GlobalNamespace::KeyboardLaserInput::dyn__collider() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeyboardLaserInput::dyn__collider");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_collider"))->offset;
return *reinterpret_cast<::UnityEngine::Collider**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _startRepeatedPressesDelay
float& GlobalNamespace::KeyboardLaserInput::dyn__startRepeatedPressesDelay() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeyboardLaserInput::dyn__startRepeatedPressesDelay");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_startRepeatedPressesDelay"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _repeatedPressDelay
float& GlobalNamespace::KeyboardLaserInput::dyn__repeatedPressDelay() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeyboardLaserInput::dyn__repeatedPressDelay");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_repeatedPressDelay"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _repeatedClickStartTime
float& GlobalNamespace::KeyboardLaserInput::dyn__repeatedClickStartTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeyboardLaserInput::dyn__repeatedClickStartTime");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_repeatedClickStartTime"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _sentRepeatedClicks
int& GlobalNamespace::KeyboardLaserInput::dyn__sentRepeatedClicks() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeyboardLaserInput::dyn__sentRepeatedClicks");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_sentRepeatedClicks"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: KeyboardLaserInput.Awake
void GlobalNamespace::KeyboardLaserInput::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeyboardLaserInput::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: KeyboardLaserInput.Clicked
void GlobalNamespace::KeyboardLaserInput::Clicked(bool clicked) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeyboardLaserInput::Clicked");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Clicked", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(clicked)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, clicked);
}
// Autogenerated method: KeyboardLaserInput.SettingsUpdated
void GlobalNamespace::KeyboardLaserInput::SettingsUpdated() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeyboardLaserInput::SettingsUpdated");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SettingsUpdated", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: KeyboardLaserInput.Update
void GlobalNamespace::KeyboardLaserInput::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeyboardLaserInput::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: KeyboardLaserInput.ShouldSendRepeatedClick
bool GlobalNamespace::KeyboardLaserInput::ShouldSendRepeatedClick() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeyboardLaserInput::ShouldSendRepeatedClick");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ShouldSendRepeatedClick", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: KeyboardLaserInput.OnDestroy
void GlobalNamespace::KeyboardLaserInput::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeyboardLaserInput::OnDestroy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: KeyboardLaserInput.get_InteractionStopsLaser
bool GlobalNamespace::KeyboardLaserInput::get_InteractionStopsLaser() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::KeyboardLaserInput::get_InteractionStopsLaser");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_InteractionStopsLaser", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: PunchKeyData
#include "GlobalNamespace/PunchKeyData.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private Key/Type _keyType
::GlobalNamespace::Key::Type& GlobalNamespace::PunchKeyData::dyn__keyType() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyData::dyn__keyType");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_keyType"))->offset;
return *reinterpret_cast<::GlobalNamespace::Key::Type*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.String _keyCapChar
::StringW& GlobalNamespace::PunchKeyData::dyn__keyCapChar() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyData::dyn__keyCapChar");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_keyCapChar"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.String _alterateKeyCapChar
::StringW& GlobalNamespace::PunchKeyData::dyn__alterateKeyCapChar() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyData::dyn__alterateKeyCapChar");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_alterateKeyCapChar"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: PunchKeyData.get_KeyType
::GlobalNamespace::Key::Type GlobalNamespace::PunchKeyData::get_KeyType() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyData::get_KeyType");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_KeyType", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::GlobalNamespace::Key::Type, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyData.get_KeyCapChar
::StringW GlobalNamespace::PunchKeyData::get_KeyCapChar() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyData::get_KeyCapChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_KeyCapChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyData.get_AlterateKeyCapChar
::StringW GlobalNamespace::PunchKeyData::get_AlterateKeyCapChar() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyData::get_AlterateKeyCapChar");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_AlterateKeyCapChar", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyData.Set
void GlobalNamespace::PunchKeyData::Set(::GlobalNamespace::Key::Type keyType, ::StringW keyCapChar, ::StringW alterateKeyCapChar) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyData::Set");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Set", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(keyType), ::il2cpp_utils::ExtractType(keyCapChar), ::il2cpp_utils::ExtractType(alterateKeyCapChar)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, keyType, keyCapChar, alterateKeyCapChar);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: PunchKeyboard
#include "GlobalNamespace/PunchKeyboard.hpp"
// Including type: PunchKeyboard/HitKey
#include "GlobalNamespace/PunchKeyboard_HitKey.hpp"
// Including type: PunchKeyboard/<Animate>d__35
#include "GlobalNamespace/PunchKeyboard_-Animate-d__35.hpp"
// Including type: PunchKeyboardInputField
#include "GlobalNamespace/PunchKeyboardInputField.hpp"
// Including type: KeySoundController
#include "GlobalNamespace/KeySoundController.hpp"
// Including type: VROSC.UIButton
#include "VROSC/UIButton.hpp"
// Including type: VROSC.ObjectActivation
#include "VROSC/ObjectActivation.hpp"
// Including type: Key
#include "GlobalNamespace/Key.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: System.Action`1
#include "System/Action_1.hpp"
// Including type: System.Action
#include "System/Action.hpp"
// Including type: System.String
#include "System/String.hpp"
// Including type: System.Collections.IEnumerator
#include "System/Collections/IEnumerator.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Boolean IsUppercase
bool GlobalNamespace::PunchKeyboard::_get_IsUppercase() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::_get_IsUppercase");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("", "PunchKeyboard", "IsUppercase"));
}
// Autogenerated static field setter
// Set static field: static public System.Boolean IsUppercase
void GlobalNamespace::PunchKeyboard::_set_IsUppercase(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::_set_IsUppercase");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "PunchKeyboard", "IsUppercase", value));
}
// Autogenerated static field getter
// Get static field: static public System.Boolean IsSymbol
bool GlobalNamespace::PunchKeyboard::_get_IsSymbol() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::_get_IsSymbol");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("", "PunchKeyboard", "IsSymbol"));
}
// Autogenerated static field setter
// Set static field: static public System.Boolean IsSymbol
void GlobalNamespace::PunchKeyboard::_set_IsSymbol(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::_set_IsSymbol");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "PunchKeyboard", "IsSymbol", value));
}
// Autogenerated static field getter
// Get static field: static public System.Action`1<Key> OnKeyPressed
::System::Action_1<::GlobalNamespace::Key*>* GlobalNamespace::PunchKeyboard::_get_OnKeyPressed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::_get_OnKeyPressed");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Action_1<::GlobalNamespace::Key*>*>("", "PunchKeyboard", "OnKeyPressed"));
}
// Autogenerated static field setter
// Set static field: static public System.Action`1<Key> OnKeyPressed
void GlobalNamespace::PunchKeyboard::_set_OnKeyPressed(::System::Action_1<::GlobalNamespace::Key*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::_set_OnKeyPressed");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "PunchKeyboard", "OnKeyPressed", value));
}
// Autogenerated static field getter
// Get static field: static public System.Action`1<System.String> OnTextSubmitted
::System::Action_1<::StringW>* GlobalNamespace::PunchKeyboard::_get_OnTextSubmitted() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::_get_OnTextSubmitted");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Action_1<::StringW>*>("", "PunchKeyboard", "OnTextSubmitted"));
}
// Autogenerated static field setter
// Set static field: static public System.Action`1<System.String> OnTextSubmitted
void GlobalNamespace::PunchKeyboard::_set_OnTextSubmitted(::System::Action_1<::StringW>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::_set_OnTextSubmitted");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "PunchKeyboard", "OnTextSubmitted", value));
}
// Autogenerated static field getter
// Get static field: static public System.Action OnClosed
::System::Action* GlobalNamespace::PunchKeyboard::_get_OnClosed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::_get_OnClosed");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Action*>("", "PunchKeyboard", "OnClosed"));
}
// Autogenerated static field setter
// Set static field: static public System.Action OnClosed
void GlobalNamespace::PunchKeyboard::_set_OnClosed(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::_set_OnClosed");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "PunchKeyboard", "OnClosed", value));
}
// Autogenerated static field getter
// Get static field: static public System.String KeyboardLayerName
::StringW GlobalNamespace::PunchKeyboard::_get_KeyboardLayerName() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::_get_KeyboardLayerName");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "PunchKeyboard", "KeyboardLayerName"));
}
// Autogenerated static field setter
// Set static field: static public System.String KeyboardLayerName
void GlobalNamespace::PunchKeyboard::_set_KeyboardLayerName(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::_set_KeyboardLayerName");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "PunchKeyboard", "KeyboardLayerName", value));
}
// Autogenerated instance field getter
// Get instance field: private PunchKeyboardInputField _previewInputField
::GlobalNamespace::PunchKeyboardInputField*& GlobalNamespace::PunchKeyboard::dyn__previewInputField() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::dyn__previewInputField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_previewInputField"))->offset;
return *reinterpret_cast<::GlobalNamespace::PunchKeyboardInputField**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private KeySoundController _keySoundController
::GlobalNamespace::KeySoundController*& GlobalNamespace::PunchKeyboard::dyn__keySoundController() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::dyn__keySoundController");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_keySoundController"))->offset;
return *reinterpret_cast<::GlobalNamespace::KeySoundController**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _simultaneousKeyPressFilterDuration
float& GlobalNamespace::PunchKeyboard::dyn__simultaneousKeyPressFilterDuration() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::dyn__simultaneousKeyPressFilterDuration");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_simultaneousKeyPressFilterDuration"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UIButton _closeButton
::VROSC::UIButton*& GlobalNamespace::PunchKeyboard::dyn__closeButton() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::dyn__closeButton");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_closeButton"))->offset;
return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UIButton _clearButton
::VROSC::UIButton*& GlobalNamespace::PunchKeyboard::dyn__clearButton() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::dyn__clearButton");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_clearButton"))->offset;
return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.ObjectActivation _objectActivation
::VROSC::ObjectActivation*& GlobalNamespace::PunchKeyboard::dyn__objectActivation() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::dyn__objectActivation");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_objectActivation"))->offset;
return *reinterpret_cast<::VROSC::ObjectActivation**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _openAnimationDuration
float& GlobalNamespace::PunchKeyboard::dyn__openAnimationDuration() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::dyn__openAnimationDuration");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_openAnimationDuration"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _closeAnimationDuration
float& GlobalNamespace::PunchKeyboard::dyn__closeAnimationDuration() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::dyn__closeAnimationDuration");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_closeAnimationDuration"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Key[] _keys
::ArrayW<::GlobalNamespace::Key*>& GlobalNamespace::PunchKeyboard::dyn__keys() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::dyn__keys");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_keys"))->offset;
return *reinterpret_cast<::ArrayW<::GlobalNamespace::Key*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<PunchKeyboard/HitKey> _hitKeys
::System::Collections::Generic::List_1<::GlobalNamespace::PunchKeyboard::HitKey*>*& GlobalNamespace::PunchKeyboard::dyn__hitKeys() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::dyn__hitKeys");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hitKeys"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::GlobalNamespace::PunchKeyboard::HitKey*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _isActive
bool& GlobalNamespace::PunchKeyboard::dyn__isActive() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::dyn__isActive");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_isActive"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _filterTimer
float& GlobalNamespace::PunchKeyboard::dyn__filterTimer() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::dyn__filterTimer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_filterTimer"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _hasSubmitted
bool& GlobalNamespace::PunchKeyboard::dyn__hasSubmitted() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::dyn__hasSubmitted");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hasSubmitted"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _isMultiline
bool& GlobalNamespace::PunchKeyboard::dyn__isMultiline() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::dyn__isMultiline");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_isMultiline"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: PunchKeyboard.Awake
void GlobalNamespace::PunchKeyboard::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard.OnDestroy
void GlobalNamespace::PunchKeyboard::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::OnDestroy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard.Request
void GlobalNamespace::PunchKeyboard::Request(::StringW startText, ::StringW infoText, bool multiline, bool secret) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::Request");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Request", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(startText), ::il2cpp_utils::ExtractType(infoText), ::il2cpp_utils::ExtractType(multiline), ::il2cpp_utils::ExtractType(secret)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, startText, infoText, multiline, secret);
}
// Autogenerated method: PunchKeyboard.Release
void GlobalNamespace::PunchKeyboard::Release() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::Release");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Release", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard.Toggle
void GlobalNamespace::PunchKeyboard::Toggle() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::Toggle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Toggle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard.SetKeyHittersActive
void GlobalNamespace::PunchKeyboard::SetKeyHittersActive(bool active) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::SetKeyHittersActive");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetKeyHittersActive", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(active)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, active);
}
// Autogenerated method: PunchKeyboard.MoveToFront
void GlobalNamespace::PunchKeyboard::MoveToFront() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::MoveToFront");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveToFront", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard.Update
void GlobalNamespace::PunchKeyboard::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard.KeyHit
void GlobalNamespace::PunchKeyboard::KeyHit(::GlobalNamespace::Key* hitKey, float strength) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::KeyHit");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "KeyHit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(hitKey), ::il2cpp_utils::ExtractType(strength)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, hitKey, strength);
}
// Autogenerated method: PunchKeyboard.PressKey
void GlobalNamespace::PunchKeyboard::PressKey(::GlobalNamespace::Key* pressedKey) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::PressKey");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "PressKey", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pressedKey)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, pressedKey);
}
// Autogenerated method: PunchKeyboard.SubmitText
void GlobalNamespace::PunchKeyboard::SubmitText() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::SubmitText");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SubmitText", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard.EnterPressed
void GlobalNamespace::PunchKeyboard::EnterPressed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::EnterPressed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EnterPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard.CloseButtonPressed
void GlobalNamespace::PunchKeyboard::CloseButtonPressed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::CloseButtonPressed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CloseButtonPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard.ClearButtonPressed
void GlobalNamespace::PunchKeyboard::ClearButtonPressed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::ClearButtonPressed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ClearButtonPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard.Animate
::System::Collections::IEnumerator* GlobalNamespace::PunchKeyboard::Animate(bool open, ::System::Action* callback) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::Animate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Animate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(open), ::il2cpp_utils::ExtractType(callback)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, open, callback);
}
// Autogenerated method: PunchKeyboard.<Toggle>b__25_0
void GlobalNamespace::PunchKeyboard::$Toggle$b__25_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::<Toggle>b__25_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Toggle>b__25_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard..cctor
void GlobalNamespace::PunchKeyboard::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "PunchKeyboard", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: PunchKeyboard/HitKey
#include "GlobalNamespace/PunchKeyboard_HitKey.hpp"
// Including type: Key
#include "GlobalNamespace/Key.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public Key Key
::GlobalNamespace::Key*& GlobalNamespace::PunchKeyboard::HitKey::dyn_Key() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::HitKey::dyn_Key");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Key"))->offset;
return *reinterpret_cast<::GlobalNamespace::Key**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Single Strength
float& GlobalNamespace::PunchKeyboard::HitKey::dyn_Strength() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::HitKey::dyn_Strength");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Strength"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: PunchKeyboard/<Animate>d__35
#include "GlobalNamespace/PunchKeyboard_-Animate-d__35.hpp"
// Including type: System.Action
#include "System/Action.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Int32 <>1__state
int& GlobalNamespace::PunchKeyboard::$Animate$d__35::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::$Animate$d__35::dyn_$$1__state");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Object <>2__current
::Il2CppObject*& GlobalNamespace::PunchKeyboard::$Animate$d__35::dyn_$$2__current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::$Animate$d__35::dyn_$$2__current");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>2__current"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Boolean open
bool& GlobalNamespace::PunchKeyboard::$Animate$d__35::dyn_open() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::$Animate$d__35::dyn_open");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "open"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public PunchKeyboard <>4__this
::GlobalNamespace::PunchKeyboard*& GlobalNamespace::PunchKeyboard::$Animate$d__35::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::$Animate$d__35::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::GlobalNamespace::PunchKeyboard**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Action callback
::System::Action*& GlobalNamespace::PunchKeyboard::$Animate$d__35::dyn_callback() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::$Animate$d__35::dyn_callback");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "callback"))->offset;
return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single <t>5__2
float& GlobalNamespace::PunchKeyboard::$Animate$d__35::dyn_$t$5__2() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::$Animate$d__35::dyn_$t$5__2");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<t>5__2"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: PunchKeyboard/<Animate>d__35.System.Collections.Generic.IEnumerator<System.Object>.get_Current
::Il2CppObject* GlobalNamespace::PunchKeyboard::$Animate$d__35::System_Collections_Generic_IEnumerator$System_Object$_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::$Animate$d__35::System.Collections.Generic.IEnumerator<System.Object>.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerator<System.Object>.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard/<Animate>d__35.System.Collections.IEnumerator.get_Current
::Il2CppObject* GlobalNamespace::PunchKeyboard::$Animate$d__35::System_Collections_IEnumerator_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::$Animate$d__35::System.Collections.IEnumerator.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard/<Animate>d__35.System.IDisposable.Dispose
void GlobalNamespace::PunchKeyboard::$Animate$d__35::System_IDisposable_Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::$Animate$d__35::System.IDisposable.Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IDisposable.Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard/<Animate>d__35.MoveNext
bool GlobalNamespace::PunchKeyboard::$Animate$d__35::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::$Animate$d__35::MoveNext");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveNext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboard/<Animate>d__35.System.Collections.IEnumerator.Reset
void GlobalNamespace::PunchKeyboard::$Animate$d__35::System_Collections_IEnumerator_Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboard::$Animate$d__35::System.Collections.IEnumerator.Reset");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: PunchKeyboardInputField
#include "GlobalNamespace/PunchKeyboardInputField.hpp"
// Including type: PunchKeyboardInputField/<UpdateCursorPosition>d__15
#include "GlobalNamespace/PunchKeyboardInputField_-UpdateCursorPosition-d__15.hpp"
// Including type: TMPro.TextMeshPro
#include "TMPro/TextMeshPro.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: System.Action
#include "System/Action.hpp"
// Including type: System.Collections.IEnumerator
#include "System/Collections/IEnumerator.hpp"
// Including type: Key
#include "GlobalNamespace/Key.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private TMPro.TextMeshPro _infoLabel
::TMPro::TextMeshPro*& GlobalNamespace::PunchKeyboardInputField::dyn__infoLabel() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::dyn__infoLabel");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_infoLabel"))->offset;
return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private TMPro.TextMeshPro _textField
::TMPro::TextMeshPro*& GlobalNamespace::PunchKeyboardInputField::dyn__textField() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::dyn__textField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_textField"))->offset;
return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.GameObject _cursor
::UnityEngine::GameObject*& GlobalNamespace::PunchKeyboardInputField::dyn__cursor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::dyn__cursor");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_cursor"))->offset;
return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _cursorOffset
float& GlobalNamespace::PunchKeyboardInputField::dyn__cursorOffset() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::dyn__cursorOffset");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_cursorOffset"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Vector3 _cursorStartPosition
::UnityEngine::Vector3& GlobalNamespace::PunchKeyboardInputField::dyn__cursorStartPosition() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::dyn__cursorStartPosition");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_cursorStartPosition"))->offset;
return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Action OnEnterPressed
::System::Action*& GlobalNamespace::PunchKeyboardInputField::dyn_OnEnterPressed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::dyn_OnEnterPressed");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnEnterPressed"))->offset;
return *reinterpret_cast<::System::Action**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _isMultiline
bool& GlobalNamespace::PunchKeyboardInputField::dyn__isMultiline() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::dyn__isMultiline");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_isMultiline"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: PunchKeyboardInputField.get_Text
::StringW GlobalNamespace::PunchKeyboardInputField::get_Text() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::get_Text");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Text", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardInputField.set_Text
void GlobalNamespace::PunchKeyboardInputField::set_Text(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::set_Text");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Text", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: PunchKeyboardInputField.Awake
void GlobalNamespace::PunchKeyboardInputField::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardInputField.OnEnable
void GlobalNamespace::PunchKeyboardInputField::OnEnable() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::OnEnable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardInputField.OnDestroy
void GlobalNamespace::PunchKeyboardInputField::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::OnDestroy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardInputField.Set
void GlobalNamespace::PunchKeyboardInputField::Set(::StringW startText, ::StringW infoText, bool multiline) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::Set");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Set", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(startText), ::il2cpp_utils::ExtractType(infoText), ::il2cpp_utils::ExtractType(multiline)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, startText, infoText, multiline);
}
// Autogenerated method: PunchKeyboardInputField.ClearText
void GlobalNamespace::PunchKeyboardInputField::ClearText() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::ClearText");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ClearText", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardInputField.UpdateCursorPosition
::System::Collections::IEnumerator* GlobalNamespace::PunchKeyboardInputField::UpdateCursorPosition() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::UpdateCursorPosition");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateCursorPosition", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardInputField.KeyPressed
void GlobalNamespace::PunchKeyboardInputField::KeyPressed(::GlobalNamespace::Key* key) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::KeyPressed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "KeyPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(key)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, key);
}
// Autogenerated method: PunchKeyboardInputField.BacksspacePressed
void GlobalNamespace::PunchKeyboardInputField::BacksspacePressed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::BacksspacePressed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "BacksspacePressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardInputField.EnterPressed
void GlobalNamespace::PunchKeyboardInputField::EnterPressed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::EnterPressed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EnterPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardInputField.Update
void GlobalNamespace::PunchKeyboardInputField::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardInputField.GetExternalKeyboardInput
void GlobalNamespace::PunchKeyboardInputField::GetExternalKeyboardInput() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::GetExternalKeyboardInput");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetExternalKeyboardInput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: PunchKeyboardInputField/<UpdateCursorPosition>d__15
#include "GlobalNamespace/PunchKeyboardInputField_-UpdateCursorPosition-d__15.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Int32 <>1__state
int& GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::dyn_$$1__state");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Object <>2__current
::Il2CppObject*& GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::dyn_$$2__current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::dyn_$$2__current");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>2__current"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public PunchKeyboardInputField <>4__this
::GlobalNamespace::PunchKeyboardInputField*& GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::GlobalNamespace::PunchKeyboardInputField**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Vector3 <newPosition>5__2
::UnityEngine::Vector3& GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::dyn_$newPosition$5__2() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::dyn_$newPosition$5__2");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<newPosition>5__2"))->offset;
return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: PunchKeyboardInputField/<UpdateCursorPosition>d__15.System.Collections.Generic.IEnumerator<System.Object>.get_Current
::Il2CppObject* GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::System_Collections_Generic_IEnumerator$System_Object$_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::System.Collections.Generic.IEnumerator<System.Object>.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerator<System.Object>.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardInputField/<UpdateCursorPosition>d__15.System.Collections.IEnumerator.get_Current
::Il2CppObject* GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::System_Collections_IEnumerator_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::System.Collections.IEnumerator.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardInputField/<UpdateCursorPosition>d__15.System.IDisposable.Dispose
void GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::System_IDisposable_Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::System.IDisposable.Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IDisposable.Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardInputField/<UpdateCursorPosition>d__15.MoveNext
bool GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::MoveNext");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveNext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardInputField/<UpdateCursorPosition>d__15.System.Collections.IEnumerator.Reset
void GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::System_Collections_IEnumerator_Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardInputField::$UpdateCursorPosition$d__15::System.Collections.IEnumerator.Reset");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: PunchKeyboardSettings
#include "GlobalNamespace/PunchKeyboardSettings.hpp"
// Including type: VROSC.UISlideToggle
#include "VROSC/UISlideToggle.hpp"
// Including type: VROSC.UIToggle
#include "VROSC/UIToggle.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: System.Action
#include "System/Action.hpp"
// Including type: VROSC.UserDataControllers
#include "VROSC/UserDataControllers.hpp"
// Including type: VROSC.InputDevice
#include "VROSC/InputDevice.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Boolean AllowExternalKeyboard
bool GlobalNamespace::PunchKeyboardSettings::_get_AllowExternalKeyboard() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::_get_AllowExternalKeyboard");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("", "PunchKeyboardSettings", "AllowExternalKeyboard"));
}
// Autogenerated static field setter
// Set static field: static public System.Boolean AllowExternalKeyboard
void GlobalNamespace::PunchKeyboardSettings::_set_AllowExternalKeyboard(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::_set_AllowExternalKeyboard");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "PunchKeyboardSettings", "AllowExternalKeyboard", value));
}
// Autogenerated static field getter
// Get static field: static public System.Boolean UseTouch
bool GlobalNamespace::PunchKeyboardSettings::_get_UseTouch() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::_get_UseTouch");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("", "PunchKeyboardSettings", "UseTouch"));
}
// Autogenerated static field setter
// Set static field: static public System.Boolean UseTouch
void GlobalNamespace::PunchKeyboardSettings::_set_UseTouch(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::_set_UseTouch");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "PunchKeyboardSettings", "UseTouch", value));
}
// Autogenerated static field getter
// Get static field: static public System.Boolean UsePointAndClick
bool GlobalNamespace::PunchKeyboardSettings::_get_UsePointAndClick() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::_get_UsePointAndClick");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("", "PunchKeyboardSettings", "UsePointAndClick"));
}
// Autogenerated static field setter
// Set static field: static public System.Boolean UsePointAndClick
void GlobalNamespace::PunchKeyboardSettings::_set_UsePointAndClick(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::_set_UsePointAndClick");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "PunchKeyboardSettings", "UsePointAndClick", value));
}
// Autogenerated static field getter
// Get static field: static public System.Boolean KeyboardPlaysClickSound
bool GlobalNamespace::PunchKeyboardSettings::_get_KeyboardPlaysClickSound() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::_get_KeyboardPlaysClickSound");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("", "PunchKeyboardSettings", "KeyboardPlaysClickSound"));
}
// Autogenerated static field setter
// Set static field: static public System.Boolean KeyboardPlaysClickSound
void GlobalNamespace::PunchKeyboardSettings::_set_KeyboardPlaysClickSound(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::_set_KeyboardPlaysClickSound");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "PunchKeyboardSettings", "KeyboardPlaysClickSound", value));
}
// Autogenerated static field getter
// Get static field: static public System.Action OnSettingsUpdated
::System::Action* GlobalNamespace::PunchKeyboardSettings::_get_OnSettingsUpdated() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::_get_OnSettingsUpdated");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Action*>("", "PunchKeyboardSettings", "OnSettingsUpdated"));
}
// Autogenerated static field setter
// Set static field: static public System.Action OnSettingsUpdated
void GlobalNamespace::PunchKeyboardSettings::_set_OnSettingsUpdated(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::_set_OnSettingsUpdated");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "PunchKeyboardSettings", "OnSettingsUpdated", value));
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UISlideToggle _usePointAndClick
::VROSC::UISlideToggle*& GlobalNamespace::PunchKeyboardSettings::dyn__usePointAndClick() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::dyn__usePointAndClick");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_usePointAndClick"))->offset;
return *reinterpret_cast<::VROSC::UISlideToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UISlideToggle _useTouchables
::VROSC::UISlideToggle*& GlobalNamespace::PunchKeyboardSettings::dyn__useTouchables() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::dyn__useTouchables");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_useTouchables"))->offset;
return *reinterpret_cast<::VROSC::UISlideToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UISlideToggle _allowExternalKeyboard
::VROSC::UISlideToggle*& GlobalNamespace::PunchKeyboardSettings::dyn__allowExternalKeyboard() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::dyn__allowExternalKeyboard");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_allowExternalKeyboard"))->offset;
return *reinterpret_cast<::VROSC::UISlideToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UISlideToggle _keySounds
::VROSC::UISlideToggle*& GlobalNamespace::PunchKeyboardSettings::dyn__keySounds() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::dyn__keySounds");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_keySounds"))->offset;
return *reinterpret_cast<::VROSC::UISlideToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UIToggle _settingsButton
::VROSC::UIToggle*& GlobalNamespace::PunchKeyboardSettings::dyn__settingsButton() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::dyn__settingsButton");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_settingsButton"))->offset;
return *reinterpret_cast<::VROSC::UIToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.GameObject _panelObject
::UnityEngine::GameObject*& GlobalNamespace::PunchKeyboardSettings::dyn__panelObject() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::dyn__panelObject");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_panelObject"))->offset;
return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: PunchKeyboardSettings.Awake
void GlobalNamespace::PunchKeyboardSettings::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardSettings.OnDestroy
void GlobalNamespace::PunchKeyboardSettings::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::OnDestroy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardSettings.OnEnable
void GlobalNamespace::PunchKeyboardSettings::OnEnable() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::OnEnable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardSettings.UserDataLoaded
void GlobalNamespace::PunchKeyboardSettings::UserDataLoaded(::VROSC::UserDataControllers* user) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::UserDataLoaded");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UserDataLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(user)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, user);
}
// Autogenerated method: PunchKeyboardSettings.OnDisable
void GlobalNamespace::PunchKeyboardSettings::OnDisable() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::OnDisable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDisable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PunchKeyboardSettings.TogglePanel
void GlobalNamespace::PunchKeyboardSettings::TogglePanel(::VROSC::InputDevice* device, bool toggled) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::TogglePanel");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "TogglePanel", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(toggled)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, toggled);
}
// Autogenerated method: PunchKeyboardSettings.UseExternalKeyboardToggled
void GlobalNamespace::PunchKeyboardSettings::UseExternalKeyboardToggled(::VROSC::InputDevice* arg1, bool toggled) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::UseExternalKeyboardToggled");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UseExternalKeyboardToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(arg1), ::il2cpp_utils::ExtractType(toggled)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, arg1, toggled);
}
// Autogenerated method: PunchKeyboardSettings.UseTouchablesToggled
void GlobalNamespace::PunchKeyboardSettings::UseTouchablesToggled(::VROSC::InputDevice* arg1, bool toggled) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::UseTouchablesToggled");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UseTouchablesToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(arg1), ::il2cpp_utils::ExtractType(toggled)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, arg1, toggled);
}
// Autogenerated method: PunchKeyboardSettings.UsePointAndClickToggled
void GlobalNamespace::PunchKeyboardSettings::UsePointAndClickToggled(::VROSC::InputDevice* arg1, bool toggled) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::UsePointAndClickToggled");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UsePointAndClickToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(arg1), ::il2cpp_utils::ExtractType(toggled)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, arg1, toggled);
}
// Autogenerated method: PunchKeyboardSettings.KeySoundsToggled
void GlobalNamespace::PunchKeyboardSettings::KeySoundsToggled(::VROSC::InputDevice* arg1, bool toggled) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PunchKeyboardSettings::KeySoundsToggled");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "KeySoundsToggled", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(arg1), ::il2cpp_utils::ExtractType(toggled)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, arg1, toggled);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: ShiftKeyBehaviour
#include "GlobalNamespace/ShiftKeyBehaviour.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: UnityEngine.Renderer
#include "UnityEngine/Renderer.hpp"
// Including type: UnityEngine.BoxCollider
#include "UnityEngine/BoxCollider.hpp"
// Including type: Key
#include "GlobalNamespace/Key.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public UnityEngine.GameObject Housing
::UnityEngine::GameObject*& GlobalNamespace::ShiftKeyBehaviour::dyn_Housing() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ShiftKeyBehaviour::dyn_Housing");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Housing"))->offset;
return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Renderer keyRenderer
::UnityEngine::Renderer*& GlobalNamespace::ShiftKeyBehaviour::dyn_keyRenderer() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ShiftKeyBehaviour::dyn_keyRenderer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "keyRenderer"))->offset;
return *reinterpret_cast<::UnityEngine::Renderer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.BoxCollider keyCollider
::UnityEngine::BoxCollider*& GlobalNamespace::ShiftKeyBehaviour::dyn_keyCollider() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ShiftKeyBehaviour::dyn_keyCollider");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "keyCollider"))->offset;
return *reinterpret_cast<::UnityEngine::BoxCollider**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.GameObject keyCap
::UnityEngine::GameObject*& GlobalNamespace::ShiftKeyBehaviour::dyn_keyCap() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ShiftKeyBehaviour::dyn_keyCap");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "keyCap"))->offset;
return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Key shiftKeyController
::GlobalNamespace::Key*& GlobalNamespace::ShiftKeyBehaviour::dyn_shiftKeyController() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ShiftKeyBehaviour::dyn_shiftKeyController");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "shiftKeyController"))->offset;
return *reinterpret_cast<::GlobalNamespace::Key**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: ShiftKeyBehaviour.Awake
void GlobalNamespace::ShiftKeyBehaviour::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ShiftKeyBehaviour::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: ShiftKeyBehaviour.ShiftKeyPressed
void GlobalNamespace::ShiftKeyBehaviour::ShiftKeyPressed(::GlobalNamespace::Key* key) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ShiftKeyBehaviour::ShiftKeyPressed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ShiftKeyPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(key)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, key);
}
// Autogenerated method: ShiftKeyBehaviour.ShiftVisibilityToggle
void GlobalNamespace::ShiftKeyBehaviour::ShiftVisibilityToggle(bool state) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ShiftKeyBehaviour::ShiftVisibilityToggle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ShiftVisibilityToggle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(state)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, state);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: SymbolsKeyBehaviour
#include "GlobalNamespace/SymbolsKeyBehaviour.hpp"
// Including type: ShiftKeyBehaviour
#include "GlobalNamespace/ShiftKeyBehaviour.hpp"
// Including type: Key
#include "GlobalNamespace/Key.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public ShiftKeyBehaviour ShiftBehaviour
::GlobalNamespace::ShiftKeyBehaviour*& GlobalNamespace::SymbolsKeyBehaviour::dyn_ShiftBehaviour() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SymbolsKeyBehaviour::dyn_ShiftBehaviour");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "ShiftBehaviour"))->offset;
return *reinterpret_cast<::GlobalNamespace::ShiftKeyBehaviour**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Key symbolKeyController
::GlobalNamespace::Key*& GlobalNamespace::SymbolsKeyBehaviour::dyn_symbolKeyController() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SymbolsKeyBehaviour::dyn_symbolKeyController");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "symbolKeyController"))->offset;
return *reinterpret_cast<::GlobalNamespace::Key**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: SymbolsKeyBehaviour.Awake
void GlobalNamespace::SymbolsKeyBehaviour::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SymbolsKeyBehaviour::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: SymbolsKeyBehaviour.SpecialKeyPressed
void GlobalNamespace::SymbolsKeyBehaviour::SpecialKeyPressed(::GlobalNamespace::Key* key) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SymbolsKeyBehaviour::SpecialKeyPressed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SpecialKeyPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(key)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, key);
}
// Autogenerated method: SymbolsKeyBehaviour.OnDisable
void GlobalNamespace::SymbolsKeyBehaviour::OnDisable() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SymbolsKeyBehaviour::OnDisable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDisable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: AddCorrectWord
#include "GlobalNamespace/AddCorrectWord.hpp"
// Including type: AutocompleteWordPicker
#include "GlobalNamespace/AutocompleteWordPicker.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private AutocompleteWordPicker wordPicker
::GlobalNamespace::AutocompleteWordPicker*& GlobalNamespace::AddCorrectWord::dyn_wordPicker() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::AddCorrectWord::dyn_wordPicker");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "wordPicker"))->offset;
return *reinterpret_cast<::GlobalNamespace::AutocompleteWordPicker**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: AddCorrectWord.Start
void GlobalNamespace::AddCorrectWord::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::AddCorrectWord::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: AddCorrectWord.WordChosen
void GlobalNamespace::AddCorrectWord::WordChosen() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::AddCorrectWord::WordChosen");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "WordChosen", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: AutocompleteWordPicker
#include "GlobalNamespace/AutocompleteWordPicker.hpp"
// Including type: UnityEngine.UI.InputField
#include "UnityEngine/UI/InputField.hpp"
// Including type: NGramGenerator
#include "GlobalNamespace/NGramGenerator.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public UnityEngine.UI.InputField TextField
::UnityEngine::UI::InputField*& GlobalNamespace::AutocompleteWordPicker::dyn_TextField() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::AutocompleteWordPicker::dyn_TextField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "TextField"))->offset;
return *reinterpret_cast<::UnityEngine::UI::InputField**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public NGramGenerator WordPredictor
::GlobalNamespace::NGramGenerator*& GlobalNamespace::AutocompleteWordPicker::dyn_WordPredictor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::AutocompleteWordPicker::dyn_WordPredictor");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "WordPredictor"))->offset;
return *reinterpret_cast<::GlobalNamespace::NGramGenerator**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: AutocompleteWordPicker.ReplaceWord
void GlobalNamespace::AutocompleteWordPicker::ReplaceWord(::StringW correctWord) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::AutocompleteWordPicker::ReplaceWord");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ReplaceWord", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(correctWord)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, correctWord);
}
// Autogenerated method: AutocompleteWordPicker.ReverseString
::StringW GlobalNamespace::AutocompleteWordPicker::ReverseString(::StringW s) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::AutocompleteWordPicker::ReverseString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "AutocompleteWordPicker", "ReverseString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Levenshtein
#include "GlobalNamespace/Levenshtein.hpp"
// Including type: Levenshtein/LevenshteinDistance
#include "GlobalNamespace/Levenshtein_LevenshteinDistance.hpp"
// Including type: Levenshtein/<>c
#include "GlobalNamespace/Levenshtein_--c.hpp"
// Including type: NGramGenerator
#include "GlobalNamespace/NGramGenerator.hpp"
// Including type: UnityEngine.UI.Text
#include "UnityEngine/UI/Text.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.Int32 maxWordLength
int GlobalNamespace::Levenshtein::_get_maxWordLength() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::_get_maxWordLength");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("", "Levenshtein", "maxWordLength"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 maxWordLength
void GlobalNamespace::Levenshtein::_set_maxWordLength(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::_set_maxWordLength");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "Levenshtein", "maxWordLength", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 maxLevenshteinCost
int GlobalNamespace::Levenshtein::_get_maxLevenshteinCost() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::_get_maxLevenshteinCost");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("", "Levenshtein", "maxLevenshteinCost"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 maxLevenshteinCost
void GlobalNamespace::Levenshtein::_set_maxLevenshteinCost(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::_set_maxLevenshteinCost");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "Levenshtein", "maxLevenshteinCost", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 minLevenshteinCost
int GlobalNamespace::Levenshtein::_get_minLevenshteinCost() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::_get_minLevenshteinCost");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("", "Levenshtein", "minLevenshteinCost"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 minLevenshteinCost
void GlobalNamespace::Levenshtein::_set_minLevenshteinCost(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::_set_minLevenshteinCost");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "Levenshtein", "minLevenshteinCost", value));
}
// Autogenerated instance field getter
// Get instance field: public NGramGenerator NGramHandler
::GlobalNamespace::NGramGenerator*& GlobalNamespace::Levenshtein::dyn_NGramHandler() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::dyn_NGramHandler");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "NGramHandler"))->offset;
return *reinterpret_cast<::GlobalNamespace::NGramGenerator**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.UI.Text[] ButtonLabels
::ArrayW<::UnityEngine::UI::Text*>& GlobalNamespace::Levenshtein::dyn_ButtonLabels() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::dyn_ButtonLabels");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "ButtonLabels"))->offset;
return *reinterpret_cast<::ArrayW<::UnityEngine::UI::Text*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<System.String> corpus
::System::Collections::Generic::List_1<::StringW>*& GlobalNamespace::Levenshtein::dyn_corpus() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::dyn_corpus");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "corpus"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::StringW>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean isUppercase
bool& GlobalNamespace::Levenshtein::dyn_isUppercase() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::dyn_isUppercase");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "isUppercase"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean isFirstLetterUpper
bool& GlobalNamespace::Levenshtein::dyn_isFirstLetterUpper() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::dyn_isFirstLetterUpper");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "isFirstLetterUpper"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Levenshtein.Start
void GlobalNamespace::Levenshtein::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Levenshtein.RunAutoComplete
void GlobalNamespace::Levenshtein::RunAutoComplete(::StringW input) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::RunAutoComplete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RunAutoComplete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(input)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, input);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Levenshtein/LevenshteinDistance
#include "GlobalNamespace/Levenshtein_LevenshteinDistance.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: Levenshtein/LevenshteinDistance.Compute
int GlobalNamespace::Levenshtein::LevenshteinDistance::Compute(::StringW s, ::StringW t) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::LevenshteinDistance::Compute");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "Levenshtein/LevenshteinDistance", "Compute", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s), ::il2cpp_utils::ExtractType(t)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, s, t);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Levenshtein/<>c
#include "GlobalNamespace/Levenshtein_--c.hpp"
// Including type: System.Func`2
#include "System/Func_2.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly Levenshtein/<>c <>9
::GlobalNamespace::Levenshtein::$$c* GlobalNamespace::Levenshtein::$$c::_get_$$9() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::$$c::_get_$$9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::GlobalNamespace::Levenshtein::$$c*>("", "Levenshtein/<>c", "<>9")));
}
// Autogenerated static field setter
// Set static field: static public readonly Levenshtein/<>c <>9
void GlobalNamespace::Levenshtein::$$c::_set_$$9(::GlobalNamespace::Levenshtein::$$c* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::$$c::_set_$$9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "Levenshtein/<>c", "<>9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Int32>,System.Int32> <>9__10_0
::System::Func_2<::System::Collections::Generic::KeyValuePair_2<int, int>, int>* GlobalNamespace::Levenshtein::$$c::_get_$$9__10_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::$$c::_get_$$9__10_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Collections::Generic::KeyValuePair_2<int, int>, int>*>("", "Levenshtein/<>c", "<>9__10_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Int32>,System.Int32> <>9__10_0
void GlobalNamespace::Levenshtein::$$c::_set_$$9__10_0(::System::Func_2<::System::Collections::Generic::KeyValuePair_2<int, int>, int>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::$$c::_set_$$9__10_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "Levenshtein/<>c", "<>9__10_0", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Int32>,System.Int32> <>9__10_1
::System::Func_2<::System::Collections::Generic::KeyValuePair_2<int, int>, int>* GlobalNamespace::Levenshtein::$$c::_get_$$9__10_1() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::$$c::_get_$$9__10_1");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Collections::Generic::KeyValuePair_2<int, int>, int>*>("", "Levenshtein/<>c", "<>9__10_1")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.Int32,System.Int32>,System.Int32> <>9__10_1
void GlobalNamespace::Levenshtein::$$c::_set_$$9__10_1(::System::Func_2<::System::Collections::Generic::KeyValuePair_2<int, int>, int>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::$$c::_set_$$9__10_1");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "Levenshtein/<>c", "<>9__10_1", value)));
}
// Autogenerated method: Levenshtein/<>c..cctor
void GlobalNamespace::Levenshtein::$$c::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::$$c::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "Levenshtein/<>c", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: Levenshtein/<>c.<RunAutoComplete>b__10_0
int GlobalNamespace::Levenshtein::$$c::$RunAutoComplete$b__10_0(::System::Collections::Generic::KeyValuePair_2<int, int> kp) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::$$c::<RunAutoComplete>b__10_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<RunAutoComplete>b__10_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(kp)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, kp);
}
// Autogenerated method: Levenshtein/<>c.<RunAutoComplete>b__10_1
int GlobalNamespace::Levenshtein::$$c::$RunAutoComplete$b__10_1(::System::Collections::Generic::KeyValuePair_2<int, int> kp) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Levenshtein::$$c::<RunAutoComplete>b__10_1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<RunAutoComplete>b__10_1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(kp)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, kp);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: NGramGenerator
#include "GlobalNamespace/NGramGenerator.hpp"
// Including type: NGramGenerator/<>c
#include "GlobalNamespace/NGramGenerator_--c.hpp"
// Including type: NGramGenerator/<MakeNgrams>d__11
#include "GlobalNamespace/NGramGenerator_-MakeNgrams-d__11.hpp"
// Including type: UnityEngine.UI.Text
#include "UnityEngine/UI/Text.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: System.Collections.Generic.Dictionary`2
#include "System/Collections/Generic/Dictionary_2.hpp"
// Including type: System.Collections.Generic.IEnumerable`1
#include "System/Collections/Generic/IEnumerable_1.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public UnityEngine.UI.Text[] ButtonLabels
::ArrayW<::UnityEngine::UI::Text*>& GlobalNamespace::NGramGenerator::dyn_ButtonLabels() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::dyn_ButtonLabels");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "ButtonLabels"))->offset;
return *reinterpret_cast<::ArrayW<::UnityEngine::UI::Text*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Collections.Generic.List`1<System.String> LevenshteinCorpus
::System::Collections::Generic::List_1<::StringW>*& GlobalNamespace::NGramGenerator::dyn_LevenshteinCorpus() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::dyn_LevenshteinCorpus");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "LevenshteinCorpus"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::StringW>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.Dictionary`2<System.String,System.Int32> biGramDict
::System::Collections::Generic::Dictionary_2<::StringW, int>*& GlobalNamespace::NGramGenerator::dyn_biGramDict() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::dyn_biGramDict");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "biGramDict"))->offset;
return *reinterpret_cast<::System::Collections::Generic::Dictionary_2<::StringW, int>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.Dictionary`2<System.String,System.Int32> levenshteinDict
::System::Collections::Generic::Dictionary_2<::StringW, int>*& GlobalNamespace::NGramGenerator::dyn_levenshteinDict() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::dyn_levenshteinDict");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "levenshteinDict"))->offset;
return *reinterpret_cast<::System::Collections::Generic::Dictionary_2<::StringW, int>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<System.String> biGramPredictionCorpus
::System::Collections::Generic::List_1<::StringW>*& GlobalNamespace::NGramGenerator::dyn_biGramPredictionCorpus() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::dyn_biGramPredictionCorpus");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "biGramPredictionCorpus"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::StringW>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: NGramGenerator.Awake
void GlobalNamespace::NGramGenerator::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: NGramGenerator.OrderDictionary
::System::Collections::Generic::Dictionary_2<::StringW, int>* GlobalNamespace::NGramGenerator::OrderDictionary(::StringW filePath) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::OrderDictionary");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OrderDictionary", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filePath)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::Dictionary_2<::StringW, int>*, false>(this, ___internal__method, filePath);
}
// Autogenerated method: NGramGenerator.LoadDictionary
::System::Collections::Generic::Dictionary_2<::StringW, int>* GlobalNamespace::NGramGenerator::LoadDictionary(::StringW filePath) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::LoadDictionary");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LoadDictionary", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filePath)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::Dictionary_2<::StringW, int>*, false>(this, ___internal__method, filePath);
}
// Autogenerated method: NGramGenerator.GenerateBiGrams
void GlobalNamespace::NGramGenerator::GenerateBiGrams(::StringW corpus) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::GenerateBiGrams");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GenerateBiGrams", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(corpus)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, corpus);
}
// Autogenerated method: NGramGenerator.GenerateLevenshteinDict
void GlobalNamespace::NGramGenerator::GenerateLevenshteinDict(::StringW corpus) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::GenerateLevenshteinDict");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GenerateLevenshteinDict", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(corpus)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, corpus);
}
// Autogenerated method: NGramGenerator.PredictNextWords
void GlobalNamespace::NGramGenerator::PredictNextWords(::StringW input) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::PredictNextWords");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "PredictNextWords", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(input)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, input);
}
// Autogenerated method: NGramGenerator.MakeNgrams
::System::Collections::Generic::IEnumerable_1<::StringW>* GlobalNamespace::NGramGenerator::MakeNgrams(::StringW text, uint8_t nGramSize) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::MakeNgrams");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MakeNgrams", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(text), ::il2cpp_utils::ExtractType(nGramSize)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerable_1<::StringW>*, false>(this, ___internal__method, text, nGramSize);
}
// Autogenerated method: NGramGenerator.GetLine
::StringW GlobalNamespace::NGramGenerator::GetLine(::System::Collections::Generic::Dictionary_2<::StringW, int>* d) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::GetLine");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetLine", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(d)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, d);
}
// Autogenerated method: NGramGenerator.GetDict
::System::Collections::Generic::Dictionary_2<::StringW, int>* GlobalNamespace::NGramGenerator::GetDict(::StringW s) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::GetDict");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetDict", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(s)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::Dictionary_2<::StringW, int>*, false>(this, ___internal__method, s);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: NGramGenerator/<>c
#include "GlobalNamespace/NGramGenerator_--c.hpp"
// Including type: System.Func`2
#include "System/Func_2.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly NGramGenerator/<>c <>9
::GlobalNamespace::NGramGenerator::$$c* GlobalNamespace::NGramGenerator::$$c::_get_$$9() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_get_$$9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::GlobalNamespace::NGramGenerator::$$c*>("", "NGramGenerator/<>c", "<>9")));
}
// Autogenerated static field setter
// Set static field: static public readonly NGramGenerator/<>c <>9
void GlobalNamespace::NGramGenerator::$$c::_set_$$9(::GlobalNamespace::NGramGenerator::$$c* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_set_$$9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "NGramGenerator/<>c", "<>9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.Int32> <>9__6_0
::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>* GlobalNamespace::NGramGenerator::$$c::_get_$$9__6_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_get_$$9__6_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>*>("", "NGramGenerator/<>c", "<>9__6_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.Int32> <>9__6_0
void GlobalNamespace::NGramGenerator::$$c::_set_$$9__6_0(::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_set_$$9__6_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "NGramGenerator/<>c", "<>9__6_0", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.String> <>9__6_1
::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, ::StringW>* GlobalNamespace::NGramGenerator::$$c::_get_$$9__6_1() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_get_$$9__6_1");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, ::StringW>*>("", "NGramGenerator/<>c", "<>9__6_1")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.String> <>9__6_1
void GlobalNamespace::NGramGenerator::$$c::_set_$$9__6_1(::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, ::StringW>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_set_$$9__6_1");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "NGramGenerator/<>c", "<>9__6_1", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.Int32> <>9__6_2
::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>* GlobalNamespace::NGramGenerator::$$c::_get_$$9__6_2() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_get_$$9__6_2");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>*>("", "NGramGenerator/<>c", "<>9__6_2")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.Int32> <>9__6_2
void GlobalNamespace::NGramGenerator::$$c::_set_$$9__6_2(::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_set_$$9__6_2");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "NGramGenerator/<>c", "<>9__6_2", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.Int32> <>9__8_0
::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>* GlobalNamespace::NGramGenerator::$$c::_get_$$9__8_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_get_$$9__8_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>*>("", "NGramGenerator/<>c", "<>9__8_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.Int32> <>9__8_0
void GlobalNamespace::NGramGenerator::$$c::_set_$$9__8_0(::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_set_$$9__8_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "NGramGenerator/<>c", "<>9__8_0", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.String> <>9__8_1
::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, ::StringW>* GlobalNamespace::NGramGenerator::$$c::_get_$$9__8_1() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_get_$$9__8_1");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, ::StringW>*>("", "NGramGenerator/<>c", "<>9__8_1")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.String> <>9__8_1
void GlobalNamespace::NGramGenerator::$$c::_set_$$9__8_1(::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, ::StringW>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_set_$$9__8_1");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "NGramGenerator/<>c", "<>9__8_1", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.Int32> <>9__8_2
::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>* GlobalNamespace::NGramGenerator::$$c::_get_$$9__8_2() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_get_$$9__8_2");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>*>("", "NGramGenerator/<>c", "<>9__8_2")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.Int32> <>9__8_2
void GlobalNamespace::NGramGenerator::$$c::_set_$$9__8_2(::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_set_$$9__8_2");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "NGramGenerator/<>c", "<>9__8_2", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.Int32> <>9__9_0
::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>* GlobalNamespace::NGramGenerator::$$c::_get_$$9__9_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_get_$$9__9_0");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>*>("", "NGramGenerator/<>c", "<>9__9_0")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.Int32> <>9__9_0
void GlobalNamespace::NGramGenerator::$$c::_set_$$9__9_0(::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_set_$$9__9_0");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "NGramGenerator/<>c", "<>9__9_0", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.String> <>9__9_1
::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, ::StringW>* GlobalNamespace::NGramGenerator::$$c::_get_$$9__9_1() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_get_$$9__9_1");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, ::StringW>*>("", "NGramGenerator/<>c", "<>9__9_1")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.String> <>9__9_1
void GlobalNamespace::NGramGenerator::$$c::_set_$$9__9_1(::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, ::StringW>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_set_$$9__9_1");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "NGramGenerator/<>c", "<>9__9_1", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.Int32> <>9__9_2
::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>* GlobalNamespace::NGramGenerator::$$c::_get_$$9__9_2() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_get_$$9__9_2");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>*>("", "NGramGenerator/<>c", "<>9__9_2")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`2<System.Collections.Generic.KeyValuePair`2<System.String,System.Int32>,System.Int32> <>9__9_2
void GlobalNamespace::NGramGenerator::$$c::_set_$$9__9_2(::System::Func_2<::System::Collections::Generic::KeyValuePair_2<::StringW, int>, int>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::_set_$$9__9_2");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "NGramGenerator/<>c", "<>9__9_2", value)));
}
// Autogenerated method: NGramGenerator/<>c..cctor
void GlobalNamespace::NGramGenerator::$$c::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "NGramGenerator/<>c", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: NGramGenerator/<>c.<OrderDictionary>b__6_0
int GlobalNamespace::NGramGenerator::$$c::$OrderDictionary$b__6_0(::System::Collections::Generic::KeyValuePair_2<::StringW, int> entry) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::<OrderDictionary>b__6_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<OrderDictionary>b__6_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(entry)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, entry);
}
// Autogenerated method: NGramGenerator/<>c.<OrderDictionary>b__6_1
::StringW GlobalNamespace::NGramGenerator::$$c::$OrderDictionary$b__6_1(::System::Collections::Generic::KeyValuePair_2<::StringW, int> pair) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::<OrderDictionary>b__6_1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<OrderDictionary>b__6_1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pair)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, pair);
}
// Autogenerated method: NGramGenerator/<>c.<OrderDictionary>b__6_2
int GlobalNamespace::NGramGenerator::$$c::$OrderDictionary$b__6_2(::System::Collections::Generic::KeyValuePair_2<::StringW, int> pair) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::<OrderDictionary>b__6_2");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<OrderDictionary>b__6_2", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pair)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, pair);
}
// Autogenerated method: NGramGenerator/<>c.<GenerateBiGrams>b__8_0
int GlobalNamespace::NGramGenerator::$$c::$GenerateBiGrams$b__8_0(::System::Collections::Generic::KeyValuePair_2<::StringW, int> entry) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::<GenerateBiGrams>b__8_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<GenerateBiGrams>b__8_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(entry)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, entry);
}
// Autogenerated method: NGramGenerator/<>c.<GenerateBiGrams>b__8_1
::StringW GlobalNamespace::NGramGenerator::$$c::$GenerateBiGrams$b__8_1(::System::Collections::Generic::KeyValuePair_2<::StringW, int> pair) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::<GenerateBiGrams>b__8_1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<GenerateBiGrams>b__8_1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pair)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, pair);
}
// Autogenerated method: NGramGenerator/<>c.<GenerateBiGrams>b__8_2
int GlobalNamespace::NGramGenerator::$$c::$GenerateBiGrams$b__8_2(::System::Collections::Generic::KeyValuePair_2<::StringW, int> pair) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::<GenerateBiGrams>b__8_2");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<GenerateBiGrams>b__8_2", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pair)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, pair);
}
// Autogenerated method: NGramGenerator/<>c.<GenerateLevenshteinDict>b__9_0
int GlobalNamespace::NGramGenerator::$$c::$GenerateLevenshteinDict$b__9_0(::System::Collections::Generic::KeyValuePair_2<::StringW, int> entry) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::<GenerateLevenshteinDict>b__9_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<GenerateLevenshteinDict>b__9_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(entry)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, entry);
}
// Autogenerated method: NGramGenerator/<>c.<GenerateLevenshteinDict>b__9_1
::StringW GlobalNamespace::NGramGenerator::$$c::$GenerateLevenshteinDict$b__9_1(::System::Collections::Generic::KeyValuePair_2<::StringW, int> pair) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::<GenerateLevenshteinDict>b__9_1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<GenerateLevenshteinDict>b__9_1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pair)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, pair);
}
// Autogenerated method: NGramGenerator/<>c.<GenerateLevenshteinDict>b__9_2
int GlobalNamespace::NGramGenerator::$$c::$GenerateLevenshteinDict$b__9_2(::System::Collections::Generic::KeyValuePair_2<::StringW, int> pair) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$$c::<GenerateLevenshteinDict>b__9_2");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<GenerateLevenshteinDict>b__9_2", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pair)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(this, ___internal__method, pair);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: NGramGenerator/<MakeNgrams>d__11
#include "GlobalNamespace/NGramGenerator_-MakeNgrams-d__11.hpp"
// Including type: System.Text.StringBuilder
#include "System/Text/StringBuilder.hpp"
// Including type: System.Collections.Generic.Queue`1
#include "System/Collections/Generic/Queue_1.hpp"
// Including type: System.Collections.IEnumerator
#include "System/Collections/IEnumerator.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Int32 <>1__state
int& GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$$1__state");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.String <>2__current
::StringW& GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$$2__current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$$2__current");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>2__current"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 <>l__initialThreadId
int& GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$$l__initialThreadId() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$$l__initialThreadId");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>l__initialThreadId"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.String text
::StringW& GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_text() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_text");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "text"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String <>3__text
::StringW& GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$$3__text() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$$3__text");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>3__text"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Byte nGramSize
uint8_t& GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_nGramSize() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_nGramSize");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "nGramSize"))->offset;
return *reinterpret_cast<uint8_t*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Byte <>3__nGramSize
uint8_t& GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$$3__nGramSize() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$$3__nGramSize");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>3__nGramSize"))->offset;
return *reinterpret_cast<uint8_t*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Text.StringBuilder <nGram>5__2
::System::Text::StringBuilder*& GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$nGram$5__2() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$nGram$5__2");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<nGram>5__2"))->offset;
return *reinterpret_cast<::System::Text::StringBuilder**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.Queue`1<System.Int32> <wordLengths>5__3
::System::Collections::Generic::Queue_1<int>*& GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$wordLengths$5__3() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$wordLengths$5__3");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<wordLengths>5__3"))->offset;
return *reinterpret_cast<::System::Collections::Generic::Queue_1<int>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 <wordCount>5__4
int& GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$wordCount$5__4() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$wordCount$5__4");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<wordCount>5__4"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 <lastWordLen>5__5
int& GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$lastWordLen$5__5() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$lastWordLen$5__5");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<lastWordLen>5__5"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 <i>5__6
int& GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$i$5__6() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::dyn_$i$5__6");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<i>5__6"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: NGramGenerator/<MakeNgrams>d__11.System.Collections.Generic.IEnumerator<System.String>.get_Current
::StringW GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::System_Collections_Generic_IEnumerator$System_String$_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::System.Collections.Generic.IEnumerator<System.String>.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerator<System.String>.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: NGramGenerator/<MakeNgrams>d__11.System.Collections.IEnumerator.get_Current
::Il2CppObject* GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::System_Collections_IEnumerator_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::System.Collections.IEnumerator.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: NGramGenerator/<MakeNgrams>d__11.System.IDisposable.Dispose
void GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::System_IDisposable_Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::System.IDisposable.Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IDisposable.Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: NGramGenerator/<MakeNgrams>d__11.MoveNext
bool GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::MoveNext");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveNext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: NGramGenerator/<MakeNgrams>d__11.System.Collections.IEnumerator.Reset
void GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::System_Collections_IEnumerator_Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::System.Collections.IEnumerator.Reset");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: NGramGenerator/<MakeNgrams>d__11.System.Collections.Generic.IEnumerable<System.String>.GetEnumerator
::System::Collections::Generic::IEnumerator_1<::StringW>* GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::System_Collections_Generic_IEnumerable$System_String$_GetEnumerator() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::System.Collections.Generic.IEnumerable<System.String>.GetEnumerator");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerable<System.String>.GetEnumerator", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::IEnumerator_1<::StringW>*, false>(this, ___internal__method);
}
// Autogenerated method: NGramGenerator/<MakeNgrams>d__11.System.Collections.IEnumerable.GetEnumerator
::System::Collections::IEnumerator* GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::System_Collections_IEnumerable_GetEnumerator() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::NGramGenerator::$MakeNgrams$d__11::System.Collections.IEnumerable.GetEnumerator");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerable.GetEnumerator", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: TextFieldBehaviour
#include "GlobalNamespace/TextFieldBehaviour.hpp"
// Including type: TextFieldBehaviour/<DisableHighlight>d__5
#include "GlobalNamespace/TextFieldBehaviour_-DisableHighlight-d__5.hpp"
// Including type: NGramGenerator
#include "GlobalNamespace/NGramGenerator.hpp"
// Including type: UnityEngine.UI.InputField
#include "UnityEngine/UI/InputField.hpp"
// Including type: UnityEngine.EventSystems.BaseEventData
#include "UnityEngine/EventSystems/BaseEventData.hpp"
// Including type: System.Collections.IEnumerator
#include "System/Collections/IEnumerator.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public NGramGenerator NGramHandler
::GlobalNamespace::NGramGenerator*& GlobalNamespace::TextFieldBehaviour::dyn_NGramHandler() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::dyn_NGramHandler");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "NGramHandler"))->offset;
return *reinterpret_cast<::GlobalNamespace::NGramGenerator**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.UI.InputField inputField
::UnityEngine::UI::InputField*& GlobalNamespace::TextFieldBehaviour::dyn_inputField() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::dyn_inputField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "inputField"))->offset;
return *reinterpret_cast<::UnityEngine::UI::InputField**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: TextFieldBehaviour.Start
void GlobalNamespace::TextFieldBehaviour::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: TextFieldBehaviour.OnSelect
void GlobalNamespace::TextFieldBehaviour::OnSelect(::UnityEngine::EventSystems::BaseEventData* eventData) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::OnSelect");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnSelect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(eventData)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, eventData);
}
// Autogenerated method: TextFieldBehaviour.MoveCaretToEnd
void GlobalNamespace::TextFieldBehaviour::MoveCaretToEnd() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::MoveCaretToEnd");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveCaretToEnd", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: TextFieldBehaviour.DisableHighlight
::System::Collections::IEnumerator* GlobalNamespace::TextFieldBehaviour::DisableHighlight() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::DisableHighlight");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DisableHighlight", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method);
}
// Autogenerated method: TextFieldBehaviour.Update
void GlobalNamespace::TextFieldBehaviour::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: TextFieldBehaviour/<DisableHighlight>d__5
#include "GlobalNamespace/TextFieldBehaviour_-DisableHighlight-d__5.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Int32 <>1__state
int& GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::dyn_$$1__state");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Object <>2__current
::Il2CppObject*& GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::dyn_$$2__current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::dyn_$$2__current");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>2__current"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public TextFieldBehaviour <>4__this
::GlobalNamespace::TextFieldBehaviour*& GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::GlobalNamespace::TextFieldBehaviour**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Color <originalTextColor>5__2
::UnityEngine::Color& GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::dyn_$originalTextColor$5__2() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::dyn_$originalTextColor$5__2");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<originalTextColor>5__2"))->offset;
return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: TextFieldBehaviour/<DisableHighlight>d__5.System.Collections.Generic.IEnumerator<System.Object>.get_Current
::Il2CppObject* GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::System_Collections_Generic_IEnumerator$System_Object$_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::System.Collections.Generic.IEnumerator<System.Object>.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerator<System.Object>.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: TextFieldBehaviour/<DisableHighlight>d__5.System.Collections.IEnumerator.get_Current
::Il2CppObject* GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::System_Collections_IEnumerator_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::System.Collections.IEnumerator.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: TextFieldBehaviour/<DisableHighlight>d__5.System.IDisposable.Dispose
void GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::System_IDisposable_Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::System.IDisposable.Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IDisposable.Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: TextFieldBehaviour/<DisableHighlight>d__5.MoveNext
bool GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::MoveNext");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveNext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: TextFieldBehaviour/<DisableHighlight>d__5.System.Collections.IEnumerator.Reset
void GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::System_Collections_IEnumerator_Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TextFieldBehaviour::$DisableHighlight$d__5::System.Collections.IEnumerator.Reset");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: MainScript
#include "GlobalNamespace/MainScript.hpp"
// Including type: MainScript/<>c__DisplayClass3_0
#include "GlobalNamespace/MainScript_--c__DisplayClass3_0.hpp"
// Including type: MainScript/<>c
#include "GlobalNamespace/MainScript_--c.hpp"
// Including type: Proyecto26.RequestHelper
#include "Proyecto26/RequestHelper.hpp"
// Including type: Proyecto26.Models.Post
#include "Proyecto26/Models/Post.hpp"
// Including type: System.Exception
#include "System/Exception.hpp"
// Including type: Proyecto26.RequestException
#include "Proyecto26/RequestException.hpp"
// Including type: Proyecto26.ResponseHelper
#include "Proyecto26/ResponseHelper.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private readonly System.String basePath
::StringW& GlobalNamespace::MainScript::dyn_basePath() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::dyn_basePath");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "basePath"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Proyecto26.RequestHelper currentRequest
::Proyecto26::RequestHelper*& GlobalNamespace::MainScript::dyn_currentRequest() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::dyn_currentRequest");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "currentRequest"))->offset;
return *reinterpret_cast<::Proyecto26::RequestHelper**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: MainScript.LogMessage
void GlobalNamespace::MainScript::LogMessage(::StringW title, ::StringW message) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::LogMessage");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LogMessage", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(title), ::il2cpp_utils::ExtractType(message)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, title, message);
}
// Autogenerated method: MainScript.Get
void GlobalNamespace::MainScript::Get() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::Get");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Get", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: MainScript.Post
void GlobalNamespace::MainScript::Post() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::Post");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Post", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: MainScript.Put
void GlobalNamespace::MainScript::Put() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::Put");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Put", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: MainScript.Delete
void GlobalNamespace::MainScript::Delete() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::Delete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Delete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: MainScript.AbortRequest
void GlobalNamespace::MainScript::AbortRequest() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::AbortRequest");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AbortRequest", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: MainScript.DownloadFile
void GlobalNamespace::MainScript::DownloadFile() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::DownloadFile");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DownloadFile", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: MainScript.<Post>b__4_0
void GlobalNamespace::MainScript::$Post$b__4_0(::Proyecto26::Models::Post* res) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::<Post>b__4_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Post>b__4_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(res)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, res);
}
// Autogenerated method: MainScript.<Post>b__4_1
void GlobalNamespace::MainScript::$Post$b__4_1(::System::Exception* err) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::<Post>b__4_1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Post>b__4_1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(err)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, err);
}
// Autogenerated method: MainScript.<Put>b__5_0
void GlobalNamespace::MainScript::$Put$b__5_0(::Proyecto26::RequestException* err, ::Proyecto26::ResponseHelper* res, ::Proyecto26::Models::Post* body) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::<Put>b__5_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Put>b__5_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(err), ::il2cpp_utils::ExtractType(res), ::il2cpp_utils::ExtractType(body)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, err, res, body);
}
// Autogenerated method: MainScript.<Delete>b__6_0
void GlobalNamespace::MainScript::$Delete$b__6_0(::Proyecto26::RequestException* err, ::Proyecto26::ResponseHelper* res) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::<Delete>b__6_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Delete>b__6_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(err), ::il2cpp_utils::ExtractType(res)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, err, res);
}
// Autogenerated method: MainScript.<DownloadFile>b__8_0
void GlobalNamespace::MainScript::$DownloadFile$b__8_0(::Proyecto26::ResponseHelper* res) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::<DownloadFile>b__8_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<DownloadFile>b__8_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(res)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, res);
}
// Autogenerated method: MainScript.<DownloadFile>b__8_1
void GlobalNamespace::MainScript::$DownloadFile$b__8_1(::System::Exception* err) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::<DownloadFile>b__8_1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<DownloadFile>b__8_1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(err)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, err);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: MainScript/<>c__DisplayClass3_0
#include "GlobalNamespace/MainScript_--c__DisplayClass3_0.hpp"
// Including type: Proyecto26.RequestHelper
#include "Proyecto26/RequestHelper.hpp"
// Including type: RSG.IPromise`1
#include "RSG/IPromise_1.hpp"
// Including type: Models.Todo
#include "Models/Todo.hpp"
// Including type: Proyecto26.Models.Post
#include "Proyecto26/Models/Post.hpp"
// Including type: Models.User
#include "Models/User.hpp"
// Including type: Models.Photo
#include "Models/Photo.hpp"
// Including type: System.Exception
#include "System/Exception.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public MainScript <>4__this
::GlobalNamespace::MainScript*& GlobalNamespace::MainScript::$$c__DisplayClass3_0::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::$$c__DisplayClass3_0::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::GlobalNamespace::MainScript**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Proyecto26.RequestHelper requestOptions
::Proyecto26::RequestHelper*& GlobalNamespace::MainScript::$$c__DisplayClass3_0::dyn_requestOptions() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::$$c__DisplayClass3_0::dyn_requestOptions");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "requestOptions"))->offset;
return *reinterpret_cast<::Proyecto26::RequestHelper**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: MainScript/<>c__DisplayClass3_0.<Get>b__0
::RSG::IPromise_1<::ArrayW<::Models::Todo*>>* GlobalNamespace::MainScript::$$c__DisplayClass3_0::$Get$b__0(::ArrayW<::Proyecto26::Models::Post*> res) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::$$c__DisplayClass3_0::<Get>b__0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Get>b__0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(res)})));
return ::il2cpp_utils::RunMethodRethrow<::RSG::IPromise_1<::ArrayW<::Models::Todo*>>*, false>(this, ___internal__method, res);
}
// Autogenerated method: MainScript/<>c__DisplayClass3_0.<Get>b__1
::RSG::IPromise_1<::ArrayW<::Models::User*>>* GlobalNamespace::MainScript::$$c__DisplayClass3_0::$Get$b__1(::ArrayW<::Models::Todo*> res) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::$$c__DisplayClass3_0::<Get>b__1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Get>b__1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(res)})));
return ::il2cpp_utils::RunMethodRethrow<::RSG::IPromise_1<::ArrayW<::Models::User*>>*, false>(this, ___internal__method, res);
}
// Autogenerated method: MainScript/<>c__DisplayClass3_0.<Get>b__2
::RSG::IPromise_1<::ArrayW<::Models::Photo*>>* GlobalNamespace::MainScript::$$c__DisplayClass3_0::$Get$b__2(::ArrayW<::Models::User*> res) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::$$c__DisplayClass3_0::<Get>b__2");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Get>b__2", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(res)})));
return ::il2cpp_utils::RunMethodRethrow<::RSG::IPromise_1<::ArrayW<::Models::Photo*>>*, false>(this, ___internal__method, res);
}
// Autogenerated method: MainScript/<>c__DisplayClass3_0.<Get>b__3
void GlobalNamespace::MainScript::$$c__DisplayClass3_0::$Get$b__3(::ArrayW<::Models::Photo*> res) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::$$c__DisplayClass3_0::<Get>b__3");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Get>b__3", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(res)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, res);
}
// Autogenerated method: MainScript/<>c__DisplayClass3_0.<Get>b__4
void GlobalNamespace::MainScript::$$c__DisplayClass3_0::$Get$b__4(::System::Exception* err) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::$$c__DisplayClass3_0::<Get>b__4");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Get>b__4", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(err)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, err);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: MainScript/<>c
#include "GlobalNamespace/MainScript_--c.hpp"
// Including type: System.Action`2
#include "System/Action_2.hpp"
// Including type: Proyecto26.RequestException
#include "Proyecto26/RequestException.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly MainScript/<>c <>9
::GlobalNamespace::MainScript::$$c* GlobalNamespace::MainScript::$$c::_get_$$9() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::$$c::_get_$$9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::GlobalNamespace::MainScript::$$c*>("", "MainScript/<>c", "<>9")));
}
// Autogenerated static field setter
// Set static field: static public readonly MainScript/<>c <>9
void GlobalNamespace::MainScript::$$c::_set_$$9(::GlobalNamespace::MainScript::$$c* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::$$c::_set_$$9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "MainScript/<>c", "<>9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Action`2<Proyecto26.RequestException,System.Int32> <>9__5_1
::System::Action_2<::Proyecto26::RequestException*, int>* GlobalNamespace::MainScript::$$c::_get_$$9__5_1() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::$$c::_get_$$9__5_1");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Action_2<::Proyecto26::RequestException*, int>*>("", "MainScript/<>c", "<>9__5_1")));
}
// Autogenerated static field setter
// Set static field: static public System.Action`2<Proyecto26.RequestException,System.Int32> <>9__5_1
void GlobalNamespace::MainScript::$$c::_set_$$9__5_1(::System::Action_2<::Proyecto26::RequestException*, int>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::$$c::_set_$$9__5_1");
THROW_UNLESS((il2cpp_utils::SetFieldValue("", "MainScript/<>c", "<>9__5_1", value)));
}
// Autogenerated method: MainScript/<>c..cctor
void GlobalNamespace::MainScript::$$c::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::$$c::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "MainScript/<>c", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: MainScript/<>c.<Put>b__5_1
void GlobalNamespace::MainScript::$$c::$Put$b__5_1(::Proyecto26::RequestException* err, int retries) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MainScript::$$c::<Put>b__5_1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Put>b__5_1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(err), ::il2cpp_utils::ExtractType(retries)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, err, retries);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: SteamManager
#include "GlobalNamespace/SteamManager.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: SteamManager.get_Initialized
bool GlobalNamespace::SteamManager::get_Initialized() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SteamManager::get_Initialized");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "SteamManager", "get_Initialized", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: OSCHandler
#include "GlobalNamespace/OSCHandler.hpp"
// Including type: System.Collections.Generic.Dictionary`2
#include "System/Collections/Generic/Dictionary_2.hpp"
// Including type: System.Net.IPAddress
#include "System/Net/IPAddress.hpp"
// Including type: UnityOSC.OSCServer
#include "UnityOSC/OSCServer.hpp"
// Including type: UnityOSC.OSCPacket
#include "UnityOSC/OSCPacket.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private OSCHandler _instance
::GlobalNamespace::OSCHandler* GlobalNamespace::OSCHandler::_get__instance() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::_get__instance");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::OSCHandler*>("", "OSCHandler", "_instance"));
}
// Autogenerated static field setter
// Set static field: static private OSCHandler _instance
void GlobalNamespace::OSCHandler::_set__instance(::GlobalNamespace::OSCHandler* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::_set__instance");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OSCHandler", "_instance", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 _loglength
int GlobalNamespace::OSCHandler::_get__loglength() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::_get__loglength");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("", "OSCHandler", "_loglength"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 _loglength
void GlobalNamespace::OSCHandler::_set__loglength(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::_set__loglength");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "OSCHandler", "_loglength", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.Dictionary`2<System.String,ClientLog> _clients
::System::Collections::Generic::Dictionary_2<::StringW, ::GlobalNamespace::ClientLog>*& GlobalNamespace::OSCHandler::dyn__clients() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::dyn__clients");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_clients"))->offset;
return *reinterpret_cast<::System::Collections::Generic::Dictionary_2<::StringW, ::GlobalNamespace::ClientLog>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.Dictionary`2<System.String,ServerLog> _servers
::System::Collections::Generic::Dictionary_2<::StringW, ::GlobalNamespace::ServerLog>*& GlobalNamespace::OSCHandler::dyn__servers() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::dyn__servers");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_servers"))->offset;
return *reinterpret_cast<::System::Collections::Generic::Dictionary_2<::StringW, ::GlobalNamespace::ServerLog>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: OSCHandler.get_Instance
::GlobalNamespace::OSCHandler* GlobalNamespace::OSCHandler::get_Instance() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::get_Instance");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OSCHandler", "get_Instance", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::GlobalNamespace::OSCHandler*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: OSCHandler.get_Clients
::System::Collections::Generic::Dictionary_2<::StringW, ::GlobalNamespace::ClientLog>* GlobalNamespace::OSCHandler::get_Clients() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::get_Clients");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Clients", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::Dictionary_2<::StringW, ::GlobalNamespace::ClientLog>*, false>(this, ___internal__method);
}
// Autogenerated method: OSCHandler.get_Servers
::System::Collections::Generic::Dictionary_2<::StringW, ::GlobalNamespace::ServerLog>* GlobalNamespace::OSCHandler::get_Servers() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::get_Servers");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Servers", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::Dictionary_2<::StringW, ::GlobalNamespace::ServerLog>*, false>(this, ___internal__method);
}
// Autogenerated method: OSCHandler.Init
void GlobalNamespace::OSCHandler::Init() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::Init");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Init", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OSCHandler.OnApplicationQuit
void GlobalNamespace::OSCHandler::OnApplicationQuit() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::OnApplicationQuit");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnApplicationQuit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OSCHandler.CreateClient
void GlobalNamespace::OSCHandler::CreateClient(::StringW clientId, ::System::Net::IPAddress* destination, int port) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::CreateClient");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CreateClient", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(clientId), ::il2cpp_utils::ExtractType(destination), ::il2cpp_utils::ExtractType(port)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, clientId, destination, port);
}
// Autogenerated method: OSCHandler.CreateServer
void GlobalNamespace::OSCHandler::CreateServer(::StringW serverId, int port) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::CreateServer");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CreateServer", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(serverId), ::il2cpp_utils::ExtractType(port)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, serverId, port);
}
// Autogenerated method: OSCHandler.OnPacketReceived
void GlobalNamespace::OSCHandler::OnPacketReceived(::UnityOSC::OSCServer* server, ::UnityOSC::OSCPacket* packet) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::OnPacketReceived");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnPacketReceived", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(server), ::il2cpp_utils::ExtractType(packet)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, server, packet);
}
// Autogenerated method: OSCHandler.UpdateLogs
void GlobalNamespace::OSCHandler::UpdateLogs() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::UpdateLogs");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateLogs", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: OSCHandler.DataToString
::StringW GlobalNamespace::OSCHandler::DataToString(::System::Collections::Generic::List_1<::Il2CppObject*>* data) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::DataToString");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "DataToString", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(data)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, data);
}
// Autogenerated method: OSCHandler.FormatMilliseconds
::StringW GlobalNamespace::OSCHandler::FormatMilliseconds(int milliseconds) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::FormatMilliseconds");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FormatMilliseconds", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(milliseconds)})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method, milliseconds);
}
// Autogenerated method: OSCHandler..cctor
void GlobalNamespace::OSCHandler::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OSCHandler::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "OSCHandler", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: SetCameraUseDepthTexture
#include "GlobalNamespace/SetCameraUseDepthTexture.hpp"
// Including type: UnityEngine.Camera
#include "UnityEngine/Camera.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Camera cam
::UnityEngine::Camera*& GlobalNamespace::SetCameraUseDepthTexture::dyn_cam() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SetCameraUseDepthTexture::dyn_cam");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "cam"))->offset;
return *reinterpret_cast<::UnityEngine::Camera**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: SetCameraUseDepthTexture.Start
void GlobalNamespace::SetCameraUseDepthTexture::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SetCameraUseDepthTexture::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: EnvironmentManager
#include "GlobalNamespace/EnvironmentManager.hpp"
// Including type: EnvironmentManager/<AnimateLight>d__14
#include "GlobalNamespace/EnvironmentManager_-AnimateLight-d__14.hpp"
// Including type: TimeOfDayPreset
#include "GlobalNamespace/TimeOfDayPreset.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: UnityEngine.Coroutine
#include "UnityEngine/Coroutine.hpp"
// Including type: UnityEngine.Light
#include "UnityEngine/Light.hpp"
// Including type: UnityEngine.Material
#include "UnityEngine/Material.hpp"
// Including type: System.Collections.Generic.Dictionary`2
#include "System/Collections/Generic/Dictionary_2.hpp"
// Including type: System.Collections.IEnumerator
#include "System/Collections/IEnumerator.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public TimeOfDayPreset[] TimeOfDayPresets
::ArrayW<::GlobalNamespace::TimeOfDayPreset*>& GlobalNamespace::EnvironmentManager::dyn_TimeOfDayPresets() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::dyn_TimeOfDayPresets");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "TimeOfDayPresets"))->offset;
return *reinterpret_cast<::ArrayW<::GlobalNamespace::TimeOfDayPreset*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.GameObject DirLightObject
::UnityEngine::GameObject*& GlobalNamespace::EnvironmentManager::dyn_DirLightObject() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::dyn_DirLightObject");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "DirLightObject"))->offset;
return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Coroutine _activeCoroutine
::UnityEngine::Coroutine*& GlobalNamespace::EnvironmentManager::dyn__activeCoroutine() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::dyn__activeCoroutine");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_activeCoroutine"))->offset;
return *reinterpret_cast<::UnityEngine::Coroutine**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Light _activeLight
::UnityEngine::Light*& GlobalNamespace::EnvironmentManager::dyn__activeLight() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::dyn__activeLight");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_activeLight"))->offset;
return *reinterpret_cast<::UnityEngine::Light**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Material _skyboxMaterial
::UnityEngine::Material*& GlobalNamespace::EnvironmentManager::dyn__skyboxMaterial() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::dyn__skyboxMaterial");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_skyboxMaterial"))->offset;
return *reinterpret_cast<::UnityEngine::Material**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.Material SunMaterial
::UnityEngine::Material*& GlobalNamespace::EnvironmentManager::dyn_SunMaterial() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::dyn_SunMaterial");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "SunMaterial"))->offset;
return *reinterpret_cast<::UnityEngine::Material**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.GameObject SunObject
::UnityEngine::GameObject*& GlobalNamespace::EnvironmentManager::dyn_SunObject() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::dyn_SunObject");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "SunObject"))->offset;
return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.GameObject AnimationPivot
::UnityEngine::GameObject*& GlobalNamespace::EnvironmentManager::dyn_AnimationPivot() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::dyn_AnimationPivot");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "AnimationPivot"))->offset;
return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Material _sunMaterial
::UnityEngine::Material*& GlobalNamespace::EnvironmentManager::dyn__sunMaterial() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::dyn__sunMaterial");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_sunMaterial"))->offset;
return *reinterpret_cast<::UnityEngine::Material**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private TimeOfDayPreset _currentLighting
::GlobalNamespace::TimeOfDayPreset*& GlobalNamespace::EnvironmentManager::dyn__currentLighting() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::dyn__currentLighting");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_currentLighting"))->offset;
return *reinterpret_cast<::GlobalNamespace::TimeOfDayPreset**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.Dictionary`2<TimeOfDayType,TimeOfDayPreset> _presetsMap
::System::Collections::Generic::Dictionary_2<::GlobalNamespace::TimeOfDayType, ::GlobalNamespace::TimeOfDayPreset*>*& GlobalNamespace::EnvironmentManager::dyn__presetsMap() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::dyn__presetsMap");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_presetsMap"))->offset;
return *reinterpret_cast<::System::Collections::Generic::Dictionary_2<::GlobalNamespace::TimeOfDayType, ::GlobalNamespace::TimeOfDayPreset*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 cycleIndex
int& GlobalNamespace::EnvironmentManager::dyn_cycleIndex() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::dyn_cycleIndex");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "cycleIndex"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: EnvironmentManager.Start
void GlobalNamespace::EnvironmentManager::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentManager.TransitionTimeOfDay
void GlobalNamespace::EnvironmentManager::TransitionTimeOfDay(::GlobalNamespace::TimeOfDayType timeOfDay, float animationTime) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::TransitionTimeOfDay");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "TransitionTimeOfDay", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(timeOfDay), ::il2cpp_utils::ExtractType(animationTime)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, timeOfDay, animationTime);
}
// Autogenerated method: EnvironmentManager.AnimateLight
::System::Collections::IEnumerator* GlobalNamespace::EnvironmentManager::AnimateLight(::GlobalNamespace::TimeOfDayType timeOfDay, float animationTime) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::AnimateLight");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AnimateLight", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(timeOfDay), ::il2cpp_utils::ExtractType(animationTime)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, timeOfDay, animationTime);
}
// Autogenerated method: EnvironmentManager.SetTimeOfDay
void GlobalNamespace::EnvironmentManager::SetTimeOfDay(::GlobalNamespace::TimeOfDayType timeOfDay) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::SetTimeOfDay");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetTimeOfDay", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(timeOfDay)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, timeOfDay);
}
// Autogenerated method: EnvironmentManager.CycleTimeOfDay
void GlobalNamespace::EnvironmentManager::CycleTimeOfDay() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::CycleTimeOfDay");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CycleTimeOfDay", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentManager.CycleTimeOfDayTransition
void GlobalNamespace::EnvironmentManager::CycleTimeOfDayTransition() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::CycleTimeOfDayTransition");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CycleTimeOfDayTransition", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentManager.Update
void GlobalNamespace::EnvironmentManager::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: EnvironmentManager/<AnimateLight>d__14
#include "GlobalNamespace/EnvironmentManager_-AnimateLight-d__14.hpp"
// Including type: UnityEngine.Material
#include "UnityEngine/Material.hpp"
// Including type: UnityEngine.Light
#include "UnityEngine/Light.hpp"
// Including type: UnityEngine.Transform
#include "UnityEngine/Transform.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Int32 <>1__state
int& GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$$1__state");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Object <>2__current
::Il2CppObject*& GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$$2__current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$$2__current");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>2__current"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public EnvironmentManager <>4__this
::GlobalNamespace::EnvironmentManager*& GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::GlobalNamespace::EnvironmentManager**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public TimeOfDayType timeOfDay
::GlobalNamespace::TimeOfDayType& GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_timeOfDay() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_timeOfDay");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "timeOfDay"))->offset;
return *reinterpret_cast<::GlobalNamespace::TimeOfDayType*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Single animationTime
float& GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_animationTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_animationTime");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "animationTime"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Material <currentSkybox>5__2
::UnityEngine::Material*& GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$currentSkybox$5__2() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$currentSkybox$5__2");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<currentSkybox>5__2"))->offset;
return *reinterpret_cast<::UnityEngine::Material**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Material <targetSkybox>5__3
::UnityEngine::Material*& GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$targetSkybox$5__3() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$targetSkybox$5__3");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<targetSkybox>5__3"))->offset;
return *reinterpret_cast<::UnityEngine::Material**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Light <currentDirLight>5__4
::UnityEngine::Light*& GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$currentDirLight$5__4() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$currentDirLight$5__4");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<currentDirLight>5__4"))->offset;
return *reinterpret_cast<::UnityEngine::Light**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Light <targetDirLight>5__5
::UnityEngine::Light*& GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$targetDirLight$5__5() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$targetDirLight$5__5");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<targetDirLight>5__5"))->offset;
return *reinterpret_cast<::UnityEngine::Light**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Transform <currentSunTransform>5__6
::UnityEngine::Transform*& GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$currentSunTransform$5__6() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$currentSunTransform$5__6");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<currentSunTransform>5__6"))->offset;
return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Transform <targetSunTransform>5__7
::UnityEngine::Transform*& GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$targetSunTransform$5__7() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$targetSunTransform$5__7");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<targetSunTransform>5__7"))->offset;
return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Color <sourceColor>5__8
::UnityEngine::Color& GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$sourceColor$5__8() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$sourceColor$5__8");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<sourceColor>5__8"))->offset;
return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Color <targetColor>5__9
::UnityEngine::Color& GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$targetColor$5__9() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$targetColor$5__9");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<targetColor>5__9"))->offset;
return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single <elapsedTime>5__10
float& GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$elapsedTime$5__10() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::dyn_$elapsedTime$5__10");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<elapsedTime>5__10"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: EnvironmentManager/<AnimateLight>d__14.System.Collections.Generic.IEnumerator<System.Object>.get_Current
::Il2CppObject* GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::System_Collections_Generic_IEnumerator$System_Object$_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::System.Collections.Generic.IEnumerator<System.Object>.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerator<System.Object>.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentManager/<AnimateLight>d__14.System.Collections.IEnumerator.get_Current
::Il2CppObject* GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::System_Collections_IEnumerator_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::System.Collections.IEnumerator.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentManager/<AnimateLight>d__14.System.IDisposable.Dispose
void GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::System_IDisposable_Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::System.IDisposable.Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IDisposable.Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentManager/<AnimateLight>d__14.MoveNext
bool GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::MoveNext");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveNext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentManager/<AnimateLight>d__14.System.Collections.IEnumerator.Reset
void GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::System_Collections_IEnumerator_Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentManager::$AnimateLight$d__14::System.Collections.IEnumerator.Reset");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: TimeOfDayPreset
#include "GlobalNamespace/TimeOfDayPreset.hpp"
// Including type: UnityEngine.Material
#include "UnityEngine/Material.hpp"
// Including type: UnityEngine.Light
#include "UnityEngine/Light.hpp"
// Including type: UnityEngine.Transform
#include "UnityEngine/Transform.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public TimeOfDayType timeOfDay
::GlobalNamespace::TimeOfDayType& GlobalNamespace::TimeOfDayPreset::dyn_timeOfDay() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TimeOfDayPreset::dyn_timeOfDay");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "timeOfDay"))->offset;
return *reinterpret_cast<::GlobalNamespace::TimeOfDayType*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.Material SkyboxMaterial
::UnityEngine::Material*& GlobalNamespace::TimeOfDayPreset::dyn_SkyboxMaterial() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TimeOfDayPreset::dyn_SkyboxMaterial");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "SkyboxMaterial"))->offset;
return *reinterpret_cast<::UnityEngine::Material**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.Light directionalLight
::UnityEngine::Light*& GlobalNamespace::TimeOfDayPreset::dyn_directionalLight() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TimeOfDayPreset::dyn_directionalLight");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "directionalLight"))->offset;
return *reinterpret_cast<::UnityEngine::Light**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.Transform SunTransform
::UnityEngine::Transform*& GlobalNamespace::TimeOfDayPreset::dyn_SunTransform() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TimeOfDayPreset::dyn_SunTransform");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "SunTransform"))->offset;
return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.Color SunColor
::UnityEngine::Color& GlobalNamespace::TimeOfDayPreset::dyn_SunColor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TimeOfDayPreset::dyn_SunColor");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "SunColor"))->offset;
return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.GameObject[] ObjectsToActivate
::ArrayW<::UnityEngine::GameObject*>& GlobalNamespace::TimeOfDayPreset::dyn_ObjectsToActivate() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TimeOfDayPreset::dyn_ObjectsToActivate");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "ObjectsToActivate"))->offset;
return *reinterpret_cast<::ArrayW<::UnityEngine::GameObject*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: TimeOfDayType
#include "GlobalNamespace/TimeOfDayType.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public TimeOfDayType Day
::GlobalNamespace::TimeOfDayType GlobalNamespace::TimeOfDayType::_get_Day() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TimeOfDayType::_get_Day");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::TimeOfDayType>("", "TimeOfDayType", "Day"));
}
// Autogenerated static field setter
// Set static field: static public TimeOfDayType Day
void GlobalNamespace::TimeOfDayType::_set_Day(::GlobalNamespace::TimeOfDayType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TimeOfDayType::_set_Day");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "TimeOfDayType", "Day", value));
}
// Autogenerated static field getter
// Get static field: static public TimeOfDayType Sunset
::GlobalNamespace::TimeOfDayType GlobalNamespace::TimeOfDayType::_get_Sunset() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TimeOfDayType::_get_Sunset");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::GlobalNamespace::TimeOfDayType>("", "TimeOfDayType", "Sunset"));
}
// Autogenerated static field setter
// Set static field: static public TimeOfDayType Sunset
void GlobalNamespace::TimeOfDayType::_set_Sunset(::GlobalNamespace::TimeOfDayType value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TimeOfDayType::_set_Sunset");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "TimeOfDayType", "Sunset", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& GlobalNamespace::TimeOfDayType::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TimeOfDayType::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: FirebaseHelper
#include "GlobalNamespace/FirebaseHelper.hpp"
// Including type: FirebaseHelper/NewUser
#include "GlobalNamespace/FirebaseHelper_NewUser.hpp"
// Including type: FirebaseHelper/RefreshedUser
#include "GlobalNamespace/FirebaseHelper_RefreshedUser.hpp"
// Including type: FirebaseHelper/RefreshUser
#include "GlobalNamespace/FirebaseHelper_RefreshUser.hpp"
// Including type: FirebaseHelper/LinkUserEmail
#include "GlobalNamespace/FirebaseHelper_LinkUserEmail.hpp"
// Including type: FirebaseHelper/LinkedUser
#include "GlobalNamespace/FirebaseHelper_LinkedUser.hpp"
// Including type: FirebaseHelper/ErrorLog
#include "GlobalNamespace/FirebaseHelper_ErrorLog.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: FirebaseHelper/NewUser
#include "GlobalNamespace/FirebaseHelper_NewUser.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.String kind
::StringW& GlobalNamespace::FirebaseHelper::NewUser::dyn_kind() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::NewUser::dyn_kind");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "kind"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String idToken
::StringW& GlobalNamespace::FirebaseHelper::NewUser::dyn_idToken() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::NewUser::dyn_idToken");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "idToken"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String refreshToken
::StringW& GlobalNamespace::FirebaseHelper::NewUser::dyn_refreshToken() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::NewUser::dyn_refreshToken");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "refreshToken"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String expiresIn
::StringW& GlobalNamespace::FirebaseHelper::NewUser::dyn_expiresIn() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::NewUser::dyn_expiresIn");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "expiresIn"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String localId
::StringW& GlobalNamespace::FirebaseHelper::NewUser::dyn_localId() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::NewUser::dyn_localId");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "localId"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: FirebaseHelper/RefreshedUser
#include "GlobalNamespace/FirebaseHelper_RefreshedUser.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.String access_token
::StringW& GlobalNamespace::FirebaseHelper::RefreshedUser::dyn_access_token() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::RefreshedUser::dyn_access_token");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "access_token"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String expires_in
::StringW& GlobalNamespace::FirebaseHelper::RefreshedUser::dyn_expires_in() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::RefreshedUser::dyn_expires_in");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "expires_in"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String token_type
::StringW& GlobalNamespace::FirebaseHelper::RefreshedUser::dyn_token_type() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::RefreshedUser::dyn_token_type");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "token_type"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String refresh_token
::StringW& GlobalNamespace::FirebaseHelper::RefreshedUser::dyn_refresh_token() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::RefreshedUser::dyn_refresh_token");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "refresh_token"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String id_token
::StringW& GlobalNamespace::FirebaseHelper::RefreshedUser::dyn_id_token() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::RefreshedUser::dyn_id_token");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "id_token"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String user_id
::StringW& GlobalNamespace::FirebaseHelper::RefreshedUser::dyn_user_id() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::RefreshedUser::dyn_user_id");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "user_id"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String project_id
::StringW& GlobalNamespace::FirebaseHelper::RefreshedUser::dyn_project_id() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::RefreshedUser::dyn_project_id");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "project_id"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: FirebaseHelper/RefreshUser
#include "GlobalNamespace/FirebaseHelper_RefreshUser.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.String refresh_token
::StringW& GlobalNamespace::FirebaseHelper::RefreshUser::dyn_refresh_token() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::RefreshUser::dyn_refresh_token");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "refresh_token"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String grant_type
::StringW& GlobalNamespace::FirebaseHelper::RefreshUser::dyn_grant_type() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::RefreshUser::dyn_grant_type");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "grant_type"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: FirebaseHelper/LinkUserEmail
#include "GlobalNamespace/FirebaseHelper_LinkUserEmail.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.String idToken
::StringW& GlobalNamespace::FirebaseHelper::LinkUserEmail::dyn_idToken() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::LinkUserEmail::dyn_idToken");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "idToken"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String email
::StringW& GlobalNamespace::FirebaseHelper::LinkUserEmail::dyn_email() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::LinkUserEmail::dyn_email");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "email"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String password
::StringW& GlobalNamespace::FirebaseHelper::LinkUserEmail::dyn_password() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::LinkUserEmail::dyn_password");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "password"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Boolean returnSecureToken
bool& GlobalNamespace::FirebaseHelper::LinkUserEmail::dyn_returnSecureToken() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::LinkUserEmail::dyn_returnSecureToken");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "returnSecureToken"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: FirebaseHelper/LinkedUser
#include "GlobalNamespace/FirebaseHelper_LinkedUser.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.String localId
::StringW& GlobalNamespace::FirebaseHelper::LinkedUser::dyn_localId() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::LinkedUser::dyn_localId");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "localId"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String email
::StringW& GlobalNamespace::FirebaseHelper::LinkedUser::dyn_email() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::LinkedUser::dyn_email");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "email"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String displayName
::StringW& GlobalNamespace::FirebaseHelper::LinkedUser::dyn_displayName() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::LinkedUser::dyn_displayName");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "displayName"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String photoUrl
::StringW& GlobalNamespace::FirebaseHelper::LinkedUser::dyn_photoUrl() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::LinkedUser::dyn_photoUrl");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "photoUrl"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String passwordHash
::StringW& GlobalNamespace::FirebaseHelper::LinkedUser::dyn_passwordHash() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::LinkedUser::dyn_passwordHash");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "passwordHash"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Collections.Generic.List`1<System.Object> providerUserInfo
::System::Collections::Generic::List_1<::Il2CppObject*>*& GlobalNamespace::FirebaseHelper::LinkedUser::dyn_providerUserInfo() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::LinkedUser::dyn_providerUserInfo");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "providerUserInfo"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::Il2CppObject*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Boolean emailVerified
bool& GlobalNamespace::FirebaseHelper::LinkedUser::dyn_emailVerified() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::LinkedUser::dyn_emailVerified");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "emailVerified"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String idToken
::StringW& GlobalNamespace::FirebaseHelper::LinkedUser::dyn_idToken() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::LinkedUser::dyn_idToken");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "idToken"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String refreshToken
::StringW& GlobalNamespace::FirebaseHelper::LinkedUser::dyn_refreshToken() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::LinkedUser::dyn_refreshToken");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "refreshToken"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String expiresIn
::StringW& GlobalNamespace::FirebaseHelper::LinkedUser::dyn_expiresIn() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::LinkedUser::dyn_expiresIn");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "expiresIn"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: FirebaseHelper/ErrorLog
#include "GlobalNamespace/FirebaseHelper_ErrorLog.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.String AppVersion
::StringW& GlobalNamespace::FirebaseHelper::ErrorLog::dyn_AppVersion() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::ErrorLog::dyn_AppVersion");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "AppVersion"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String Date
::StringW& GlobalNamespace::FirebaseHelper::ErrorLog::dyn_Date() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::ErrorLog::dyn_Date");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Date"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String Device
::StringW& GlobalNamespace::FirebaseHelper::ErrorLog::dyn_Device() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::ErrorLog::dyn_Device");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Device"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String OperatingSystem
::StringW& GlobalNamespace::FirebaseHelper::ErrorLog::dyn_OperatingSystem() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::ErrorLog::dyn_OperatingSystem");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OperatingSystem"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String Message
::StringW& GlobalNamespace::FirebaseHelper::ErrorLog::dyn_Message() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::ErrorLog::dyn_Message");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Message"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String Stack
::StringW& GlobalNamespace::FirebaseHelper::ErrorLog::dyn_Stack() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::FirebaseHelper::ErrorLog::dyn_Stack");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Stack"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: ReallyAnalytics
#include "GlobalNamespace/ReallyAnalytics.hpp"
// Including type: System.String
#include "System/String.hpp"
// Including type: System.Collections.Generic.Dictionary`2
#include "System/Collections/Generic/Dictionary_2.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.String MAIN_MENU_SELECTION
::StringW GlobalNamespace::ReallyAnalytics::_get_MAIN_MENU_SELECTION() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_MAIN_MENU_SELECTION");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "MAIN_MENU_SELECTION"));
}
// Autogenerated static field setter
// Set static field: static private System.String MAIN_MENU_SELECTION
void GlobalNamespace::ReallyAnalytics::_set_MAIN_MENU_SELECTION(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_MAIN_MENU_SELECTION");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "MAIN_MENU_SELECTION", value));
}
// Autogenerated static field getter
// Get static field: static private System.String INSTRUMENT_OPEN
::StringW GlobalNamespace::ReallyAnalytics::_get_INSTRUMENT_OPEN() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_INSTRUMENT_OPEN");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "INSTRUMENT_OPEN"));
}
// Autogenerated static field setter
// Set static field: static private System.String INSTRUMENT_OPEN
void GlobalNamespace::ReallyAnalytics::_set_INSTRUMENT_OPEN(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_INSTRUMENT_OPEN");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "INSTRUMENT_OPEN", value));
}
// Autogenerated static field getter
// Get static field: static private System.String INSTRUMENT_CLOSE
::StringW GlobalNamespace::ReallyAnalytics::_get_INSTRUMENT_CLOSE() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_INSTRUMENT_CLOSE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "INSTRUMENT_CLOSE"));
}
// Autogenerated static field setter
// Set static field: static private System.String INSTRUMENT_CLOSE
void GlobalNamespace::ReallyAnalytics::_set_INSTRUMENT_CLOSE(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_INSTRUMENT_CLOSE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "INSTRUMENT_CLOSE", value));
}
// Autogenerated static field getter
// Get static field: static private System.String INSTRUMENT_CHANGE_PATCH
::StringW GlobalNamespace::ReallyAnalytics::_get_INSTRUMENT_CHANGE_PATCH() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_INSTRUMENT_CHANGE_PATCH");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "INSTRUMENT_CHANGE_PATCH"));
}
// Autogenerated static field setter
// Set static field: static private System.String INSTRUMENT_CHANGE_PATCH
void GlobalNamespace::ReallyAnalytics::_set_INSTRUMENT_CHANGE_PATCH(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_INSTRUMENT_CHANGE_PATCH");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "INSTRUMENT_CHANGE_PATCH", value));
}
// Autogenerated static field getter
// Get static field: static private System.String INSTRUMENT_CHANGE_SAMPLE
::StringW GlobalNamespace::ReallyAnalytics::_get_INSTRUMENT_CHANGE_SAMPLE() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_INSTRUMENT_CHANGE_SAMPLE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "INSTRUMENT_CHANGE_SAMPLE"));
}
// Autogenerated static field setter
// Set static field: static private System.String INSTRUMENT_CHANGE_SAMPLE
void GlobalNamespace::ReallyAnalytics::_set_INSTRUMENT_CHANGE_SAMPLE(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_INSTRUMENT_CHANGE_SAMPLE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "INSTRUMENT_CHANGE_SAMPLE", value));
}
// Autogenerated static field getter
// Get static field: static private System.String TOOL_OPEN
::StringW GlobalNamespace::ReallyAnalytics::_get_TOOL_OPEN() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_TOOL_OPEN");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "TOOL_OPEN"));
}
// Autogenerated static field setter
// Set static field: static private System.String TOOL_OPEN
void GlobalNamespace::ReallyAnalytics::_set_TOOL_OPEN(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_TOOL_OPEN");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "TOOL_OPEN", value));
}
// Autogenerated static field getter
// Get static field: static private System.String TOOL_CLOSE
::StringW GlobalNamespace::ReallyAnalytics::_get_TOOL_CLOSE() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_TOOL_CLOSE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "TOOL_CLOSE"));
}
// Autogenerated static field setter
// Set static field: static private System.String TOOL_CLOSE
void GlobalNamespace::ReallyAnalytics::_set_TOOL_CLOSE(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_TOOL_CLOSE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "TOOL_CLOSE", value));
}
// Autogenerated static field getter
// Get static field: static private System.String ENVIRONMENT_ENTER
::StringW GlobalNamespace::ReallyAnalytics::_get_ENVIRONMENT_ENTER() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_ENVIRONMENT_ENTER");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "ENVIRONMENT_ENTER"));
}
// Autogenerated static field setter
// Set static field: static private System.String ENVIRONMENT_ENTER
void GlobalNamespace::ReallyAnalytics::_set_ENVIRONMENT_ENTER(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_ENVIRONMENT_ENTER");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "ENVIRONMENT_ENTER", value));
}
// Autogenerated static field getter
// Get static field: static private System.String ENVIRONMENT_EXIT
::StringW GlobalNamespace::ReallyAnalytics::_get_ENVIRONMENT_EXIT() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_ENVIRONMENT_EXIT");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "ENVIRONMENT_EXIT"));
}
// Autogenerated static field setter
// Set static field: static private System.String ENVIRONMENT_EXIT
void GlobalNamespace::ReallyAnalytics::_set_ENVIRONMENT_EXIT(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_ENVIRONMENT_EXIT");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "ENVIRONMENT_EXIT", value));
}
// Autogenerated static field getter
// Get static field: static private System.String SONG_SAVE
::StringW GlobalNamespace::ReallyAnalytics::_get_SONG_SAVE() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_SONG_SAVE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "SONG_SAVE"));
}
// Autogenerated static field setter
// Set static field: static private System.String SONG_SAVE
void GlobalNamespace::ReallyAnalytics::_set_SONG_SAVE(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_SONG_SAVE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "SONG_SAVE", value));
}
// Autogenerated static field getter
// Get static field: static private System.String SONG_LOAD
::StringW GlobalNamespace::ReallyAnalytics::_get_SONG_LOAD() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_SONG_LOAD");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "SONG_LOAD"));
}
// Autogenerated static field setter
// Set static field: static private System.String SONG_LOAD
void GlobalNamespace::ReallyAnalytics::_set_SONG_LOAD(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_SONG_LOAD");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "SONG_LOAD", value));
}
// Autogenerated static field getter
// Get static field: static private System.String SONG_DELETE
::StringW GlobalNamespace::ReallyAnalytics::_get_SONG_DELETE() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_SONG_DELETE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "SONG_DELETE"));
}
// Autogenerated static field setter
// Set static field: static private System.String SONG_DELETE
void GlobalNamespace::ReallyAnalytics::_set_SONG_DELETE(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_SONG_DELETE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "SONG_DELETE", value));
}
// Autogenerated static field getter
// Get static field: static private System.String SONG_UPVOTE
::StringW GlobalNamespace::ReallyAnalytics::_get_SONG_UPVOTE() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_SONG_UPVOTE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "SONG_UPVOTE"));
}
// Autogenerated static field setter
// Set static field: static private System.String SONG_UPVOTE
void GlobalNamespace::ReallyAnalytics::_set_SONG_UPVOTE(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_SONG_UPVOTE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "SONG_UPVOTE", value));
}
// Autogenerated static field getter
// Get static field: static private System.String SONG_FAVORITE
::StringW GlobalNamespace::ReallyAnalytics::_get_SONG_FAVORITE() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_SONG_FAVORITE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "SONG_FAVORITE"));
}
// Autogenerated static field setter
// Set static field: static private System.String SONG_FAVORITE
void GlobalNamespace::ReallyAnalytics::_set_SONG_FAVORITE(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_SONG_FAVORITE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "SONG_FAVORITE", value));
}
// Autogenerated static field getter
// Get static field: static private System.String SONG_PREVIEW_PLAY
::StringW GlobalNamespace::ReallyAnalytics::_get_SONG_PREVIEW_PLAY() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_SONG_PREVIEW_PLAY");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "SONG_PREVIEW_PLAY"));
}
// Autogenerated static field setter
// Set static field: static private System.String SONG_PREVIEW_PLAY
void GlobalNamespace::ReallyAnalytics::_set_SONG_PREVIEW_PLAY(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_SONG_PREVIEW_PLAY");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "SONG_PREVIEW_PLAY", value));
}
// Autogenerated static field getter
// Get static field: static private System.String LOOP_CREATE
::StringW GlobalNamespace::ReallyAnalytics::_get_LOOP_CREATE() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_LOOP_CREATE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "LOOP_CREATE"));
}
// Autogenerated static field setter
// Set static field: static private System.String LOOP_CREATE
void GlobalNamespace::ReallyAnalytics::_set_LOOP_CREATE(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_LOOP_CREATE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "LOOP_CREATE", value));
}
// Autogenerated static field getter
// Get static field: static private System.String TUTORIAL_VIDEO_PLAY
::StringW GlobalNamespace::ReallyAnalytics::_get_TUTORIAL_VIDEO_PLAY() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_TUTORIAL_VIDEO_PLAY");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "TUTORIAL_VIDEO_PLAY"));
}
// Autogenerated static field setter
// Set static field: static private System.String TUTORIAL_VIDEO_PLAY
void GlobalNamespace::ReallyAnalytics::_set_TUTORIAL_VIDEO_PLAY(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_TUTORIAL_VIDEO_PLAY");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "TUTORIAL_VIDEO_PLAY", value));
}
// Autogenerated static field getter
// Get static field: static private System.String INSTRUMENT_ID
::StringW GlobalNamespace::ReallyAnalytics::_get_INSTRUMENT_ID() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_INSTRUMENT_ID");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "INSTRUMENT_ID"));
}
// Autogenerated static field setter
// Set static field: static private System.String INSTRUMENT_ID
void GlobalNamespace::ReallyAnalytics::_set_INSTRUMENT_ID(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_INSTRUMENT_ID");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "INSTRUMENT_ID", value));
}
// Autogenerated static field getter
// Get static field: static private System.String TOOL_ID
::StringW GlobalNamespace::ReallyAnalytics::_get_TOOL_ID() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_TOOL_ID");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "TOOL_ID"));
}
// Autogenerated static field setter
// Set static field: static private System.String TOOL_ID
void GlobalNamespace::ReallyAnalytics::_set_TOOL_ID(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_TOOL_ID");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "TOOL_ID", value));
}
// Autogenerated static field getter
// Get static field: static private System.String PATCH_ID
::StringW GlobalNamespace::ReallyAnalytics::_get_PATCH_ID() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_PATCH_ID");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "PATCH_ID"));
}
// Autogenerated static field setter
// Set static field: static private System.String PATCH_ID
void GlobalNamespace::ReallyAnalytics::_set_PATCH_ID(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_PATCH_ID");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "PATCH_ID", value));
}
// Autogenerated static field getter
// Get static field: static private System.String SAMPLE_ID
::StringW GlobalNamespace::ReallyAnalytics::_get_SAMPLE_ID() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_SAMPLE_ID");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "SAMPLE_ID"));
}
// Autogenerated static field setter
// Set static field: static private System.String SAMPLE_ID
void GlobalNamespace::ReallyAnalytics::_set_SAMPLE_ID(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_SAMPLE_ID");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "SAMPLE_ID", value));
}
// Autogenerated static field getter
// Get static field: static private System.String ENVIRONMENT_ID
::StringW GlobalNamespace::ReallyAnalytics::_get_ENVIRONMENT_ID() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_ENVIRONMENT_ID");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "ENVIRONMENT_ID"));
}
// Autogenerated static field setter
// Set static field: static private System.String ENVIRONMENT_ID
void GlobalNamespace::ReallyAnalytics::_set_ENVIRONMENT_ID(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_ENVIRONMENT_ID");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "ENVIRONMENT_ID", value));
}
// Autogenerated static field getter
// Get static field: static private System.String SONG_ID
::StringW GlobalNamespace::ReallyAnalytics::_get_SONG_ID() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_SONG_ID");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "SONG_ID"));
}
// Autogenerated static field setter
// Set static field: static private System.String SONG_ID
void GlobalNamespace::ReallyAnalytics::_set_SONG_ID(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_SONG_ID");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "SONG_ID", value));
}
// Autogenerated static field getter
// Get static field: static private System.String TUTORIAL_VIDEO_ID
::StringW GlobalNamespace::ReallyAnalytics::_get_TUTORIAL_VIDEO_ID() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_TUTORIAL_VIDEO_ID");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "TUTORIAL_VIDEO_ID"));
}
// Autogenerated static field setter
// Set static field: static private System.String TUTORIAL_VIDEO_ID
void GlobalNamespace::ReallyAnalytics::_set_TUTORIAL_VIDEO_ID(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_TUTORIAL_VIDEO_ID");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "TUTORIAL_VIDEO_ID", value));
}
// Autogenerated static field getter
// Get static field: static private System.String TIME_OPEN
::StringW GlobalNamespace::ReallyAnalytics::_get_TIME_OPEN() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_TIME_OPEN");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "TIME_OPEN"));
}
// Autogenerated static field setter
// Set static field: static private System.String TIME_OPEN
void GlobalNamespace::ReallyAnalytics::_set_TIME_OPEN(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_TIME_OPEN");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "TIME_OPEN", value));
}
// Autogenerated static field getter
// Get static field: static private System.String TIME_TO_COMPLETE
::StringW GlobalNamespace::ReallyAnalytics::_get_TIME_TO_COMPLETE() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_TIME_TO_COMPLETE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "TIME_TO_COMPLETE"));
}
// Autogenerated static field setter
// Set static field: static private System.String TIME_TO_COMPLETE
void GlobalNamespace::ReallyAnalytics::_set_TIME_TO_COMPLETE(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_TIME_TO_COMPLETE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "TIME_TO_COMPLETE", value));
}
// Autogenerated static field getter
// Get static field: static private System.String MAIN_MENU_OPTION
::StringW GlobalNamespace::ReallyAnalytics::_get_MAIN_MENU_OPTION() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_MAIN_MENU_OPTION");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "MAIN_MENU_OPTION"));
}
// Autogenerated static field setter
// Set static field: static private System.String MAIN_MENU_OPTION
void GlobalNamespace::ReallyAnalytics::_set_MAIN_MENU_OPTION(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_MAIN_MENU_OPTION");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "MAIN_MENU_OPTION", value));
}
// Autogenerated static field getter
// Get static field: static private System.String SONG_TYPE
::StringW GlobalNamespace::ReallyAnalytics::_get_SONG_TYPE() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_SONG_TYPE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "SONG_TYPE"));
}
// Autogenerated static field setter
// Set static field: static private System.String SONG_TYPE
void GlobalNamespace::ReallyAnalytics::_set_SONG_TYPE(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_SONG_TYPE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "SONG_TYPE", value));
}
// Autogenerated static field getter
// Get static field: static private System.String IS_FAVORITE
::StringW GlobalNamespace::ReallyAnalytics::_get_IS_FAVORITE() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_IS_FAVORITE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "IS_FAVORITE"));
}
// Autogenerated static field setter
// Set static field: static private System.String IS_FAVORITE
void GlobalNamespace::ReallyAnalytics::_set_IS_FAVORITE(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_IS_FAVORITE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "IS_FAVORITE", value));
}
// Autogenerated static field getter
// Get static field: static private System.String TRACK_COUNT
::StringW GlobalNamespace::ReallyAnalytics::_get_TRACK_COUNT() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_TRACK_COUNT");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "TRACK_COUNT"));
}
// Autogenerated static field setter
// Set static field: static private System.String TRACK_COUNT
void GlobalNamespace::ReallyAnalytics::_set_TRACK_COUNT(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_TRACK_COUNT");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "TRACK_COUNT", value));
}
// Autogenerated static field getter
// Get static field: static private System.String TUTORIAL_SKIPPED_STEP
::StringW GlobalNamespace::ReallyAnalytics::_get_TUTORIAL_SKIPPED_STEP() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_TUTORIAL_SKIPPED_STEP");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "TUTORIAL_SKIPPED_STEP"));
}
// Autogenerated static field setter
// Set static field: static private System.String TUTORIAL_SKIPPED_STEP
void GlobalNamespace::ReallyAnalytics::_set_TUTORIAL_SKIPPED_STEP(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_TUTORIAL_SKIPPED_STEP");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "TUTORIAL_SKIPPED_STEP", value));
}
// Autogenerated static field getter
// Get static field: static private System.String LOCAL_SONG
::StringW GlobalNamespace::ReallyAnalytics::_get_LOCAL_SONG() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_LOCAL_SONG");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "LOCAL_SONG"));
}
// Autogenerated static field setter
// Set static field: static private System.String LOCAL_SONG
void GlobalNamespace::ReallyAnalytics::_set_LOCAL_SONG(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_LOCAL_SONG");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "LOCAL_SONG", value));
}
// Autogenerated static field getter
// Get static field: static private System.String CLOUD_SONG
::StringW GlobalNamespace::ReallyAnalytics::_get_CLOUD_SONG() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_CLOUD_SONG");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "CLOUD_SONG"));
}
// Autogenerated static field setter
// Set static field: static private System.String CLOUD_SONG
void GlobalNamespace::ReallyAnalytics::_set_CLOUD_SONG(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_CLOUD_SONG");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "CLOUD_SONG", value));
}
// Autogenerated static field getter
// Get static field: static private System.String COMMUNITY_SONG
::StringW GlobalNamespace::ReallyAnalytics::_get_COMMUNITY_SONG() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get_COMMUNITY_SONG");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "ReallyAnalytics", "COMMUNITY_SONG"));
}
// Autogenerated static field setter
// Set static field: static private System.String COMMUNITY_SONG
void GlobalNamespace::ReallyAnalytics::_set_COMMUNITY_SONG(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set_COMMUNITY_SONG");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "COMMUNITY_SONG", value));
}
// Autogenerated static field getter
// Get static field: static private System.Single _tutorialStartTime
float GlobalNamespace::ReallyAnalytics::_get__tutorialStartTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get__tutorialStartTime");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<float>("", "ReallyAnalytics", "_tutorialStartTime"));
}
// Autogenerated static field setter
// Set static field: static private System.Single _tutorialStartTime
void GlobalNamespace::ReallyAnalytics::_set__tutorialStartTime(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set__tutorialStartTime");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "_tutorialStartTime", value));
}
// Autogenerated static field getter
// Get static field: static private System.Single _lastTutorialStepTime
float GlobalNamespace::ReallyAnalytics::_get__lastTutorialStepTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get__lastTutorialStepTime");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<float>("", "ReallyAnalytics", "_lastTutorialStepTime"));
}
// Autogenerated static field setter
// Set static field: static private System.Single _lastTutorialStepTime
void GlobalNamespace::ReallyAnalytics::_set__lastTutorialStepTime(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set__lastTutorialStepTime");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "_lastTutorialStepTime", value));
}
// Autogenerated static field getter
// Get static field: static private System.Single _lastEnvironmentEnterTime
float GlobalNamespace::ReallyAnalytics::_get__lastEnvironmentEnterTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get__lastEnvironmentEnterTime");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<float>("", "ReallyAnalytics", "_lastEnvironmentEnterTime"));
}
// Autogenerated static field setter
// Set static field: static private System.Single _lastEnvironmentEnterTime
void GlobalNamespace::ReallyAnalytics::_set__lastEnvironmentEnterTime(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set__lastEnvironmentEnterTime");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "_lastEnvironmentEnterTime", value));
}
// Autogenerated static field getter
// Get static field: static private System.Collections.Generic.Dictionary`2<System.String,System.Single> _instrumentsOpenTimes
::System::Collections::Generic::Dictionary_2<::StringW, float>* GlobalNamespace::ReallyAnalytics::_get__instrumentsOpenTimes() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_get__instrumentsOpenTimes");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Collections::Generic::Dictionary_2<::StringW, float>*>("", "ReallyAnalytics", "_instrumentsOpenTimes")));
}
// Autogenerated static field setter
// Set static field: static private System.Collections.Generic.Dictionary`2<System.String,System.Single> _instrumentsOpenTimes
void GlobalNamespace::ReallyAnalytics::_set__instrumentsOpenTimes(::System::Collections::Generic::Dictionary_2<::StringW, float>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::_set__instrumentsOpenTimes");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "ReallyAnalytics", "_instrumentsOpenTimes", value));
}
// Autogenerated method: ReallyAnalytics..cctor
void GlobalNamespace::ReallyAnalytics::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: ReallyAnalytics.MainMenuSelection
void GlobalNamespace::ReallyAnalytics::MainMenuSelection(::StringW optionId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::MainMenuSelection");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "MainMenuSelection", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(optionId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, optionId);
}
// Autogenerated method: ReallyAnalytics.EnterScreen
void GlobalNamespace::ReallyAnalytics::EnterScreen(::StringW screenId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::EnterScreen");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "EnterScreen", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(screenId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, screenId);
}
// Autogenerated method: ReallyAnalytics.InstrumentOpen
void GlobalNamespace::ReallyAnalytics::InstrumentOpen(::StringW instrumentId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::InstrumentOpen");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "InstrumentOpen", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(instrumentId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, instrumentId);
}
// Autogenerated method: ReallyAnalytics.InstrumentClose
void GlobalNamespace::ReallyAnalytics::InstrumentClose(::StringW instrumentId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::InstrumentClose");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "InstrumentClose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(instrumentId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, instrumentId);
}
// Autogenerated method: ReallyAnalytics.InstrumentChangePatch
void GlobalNamespace::ReallyAnalytics::InstrumentChangePatch(::StringW instrumentId, ::StringW patchId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::InstrumentChangePatch");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "InstrumentChangePatch", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(instrumentId), ::il2cpp_utils::ExtractType(patchId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, instrumentId, patchId);
}
// Autogenerated method: ReallyAnalytics.ToolOpen
void GlobalNamespace::ReallyAnalytics::ToolOpen(::StringW toolId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::ToolOpen");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "ToolOpen", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(toolId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, toolId);
}
// Autogenerated method: ReallyAnalytics.ToolClose
void GlobalNamespace::ReallyAnalytics::ToolClose(::StringW toolId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::ToolClose");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "ToolClose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(toolId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, toolId);
}
// Autogenerated method: ReallyAnalytics.EnvironmentEnter
void GlobalNamespace::ReallyAnalytics::EnvironmentEnter(::StringW environmentId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::EnvironmentEnter");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "EnvironmentEnter", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(environmentId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, environmentId);
}
// Autogenerated method: ReallyAnalytics.EnvironmentExit
void GlobalNamespace::ReallyAnalytics::EnvironmentExit(::StringW environmentId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::EnvironmentExit");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "EnvironmentExit", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(environmentId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, environmentId);
}
// Autogenerated method: ReallyAnalytics.SongSave
void GlobalNamespace::ReallyAnalytics::SongSave(::StringW songId, bool isCloud, bool isCommunity, int trackCount) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::SongSave");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "SongSave", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(songId), ::il2cpp_utils::ExtractType(isCloud), ::il2cpp_utils::ExtractType(isCommunity), ::il2cpp_utils::ExtractType(trackCount)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, songId, isCloud, isCommunity, trackCount);
}
// Autogenerated method: ReallyAnalytics.SongLoad
void GlobalNamespace::ReallyAnalytics::SongLoad(::StringW songId, bool isCloud, bool isCommunity, bool isFavorite) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::SongLoad");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "SongLoad", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(songId), ::il2cpp_utils::ExtractType(isCloud), ::il2cpp_utils::ExtractType(isCommunity), ::il2cpp_utils::ExtractType(isFavorite)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, songId, isCloud, isCommunity, isFavorite);
}
// Autogenerated method: ReallyAnalytics.SongDelete
void GlobalNamespace::ReallyAnalytics::SongDelete(::StringW songId, bool isCloud, bool isCommunity) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::SongDelete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "SongDelete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(songId), ::il2cpp_utils::ExtractType(isCloud), ::il2cpp_utils::ExtractType(isCommunity)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, songId, isCloud, isCommunity);
}
// Autogenerated method: ReallyAnalytics.SongUpVote
void GlobalNamespace::ReallyAnalytics::SongUpVote(::StringW songId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::SongUpVote");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "SongUpVote", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(songId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, songId);
}
// Autogenerated method: ReallyAnalytics.SongFavorite
void GlobalNamespace::ReallyAnalytics::SongFavorite(::StringW songId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::SongFavorite");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "SongFavorite", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(songId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, songId);
}
// Autogenerated method: ReallyAnalytics.SongPreviewPlay
void GlobalNamespace::ReallyAnalytics::SongPreviewPlay(::StringW songId, bool isCloud, bool isCommunity) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::SongPreviewPlay");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "SongPreviewPlay", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(songId), ::il2cpp_utils::ExtractType(isCloud), ::il2cpp_utils::ExtractType(isCommunity)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, songId, isCloud, isCommunity);
}
// Autogenerated method: ReallyAnalytics.LoopCreate
void GlobalNamespace::ReallyAnalytics::LoopCreate(::StringW instrumentId, ::StringW patchId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::LoopCreate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "LoopCreate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(instrumentId), ::il2cpp_utils::ExtractType(patchId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, instrumentId, patchId);
}
// Autogenerated method: ReallyAnalytics.TutorialStart
void GlobalNamespace::ReallyAnalytics::TutorialStart(::StringW tutorialId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::TutorialStart");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "TutorialStart", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(tutorialId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, tutorialId);
}
// Autogenerated method: ReallyAnalytics.TutorialStepComplete
void GlobalNamespace::ReallyAnalytics::TutorialStepComplete(::StringW tutorialId, int stepIndex) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::TutorialStepComplete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "TutorialStepComplete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(tutorialId), ::il2cpp_utils::ExtractType(stepIndex)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, tutorialId, stepIndex);
}
// Autogenerated method: ReallyAnalytics.TutorialSkip
void GlobalNamespace::ReallyAnalytics::TutorialSkip(::StringW tutorialId, int skippedStepIndex) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::TutorialSkip");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "TutorialSkip", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(tutorialId), ::il2cpp_utils::ExtractType(skippedStepIndex)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, tutorialId, skippedStepIndex);
}
// Autogenerated method: ReallyAnalytics.TutorialComplete
void GlobalNamespace::ReallyAnalytics::TutorialComplete(::StringW tutorialId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::TutorialComplete");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "TutorialComplete", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(tutorialId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, tutorialId);
}
// Autogenerated method: ReallyAnalytics.TutorialVideoPlay
void GlobalNamespace::ReallyAnalytics::TutorialVideoPlay(::StringW tutorialVideoId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::ReallyAnalytics::TutorialVideoPlay");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "ReallyAnalytics", "TutorialVideoPlay", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(tutorialVideoId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, tutorialVideoId);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: TutorialSettings
#include "GlobalNamespace/TutorialSettings.hpp"
// Including type: UnityEngine.AnimationCurve
#include "UnityEngine/AnimationCurve.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private UnityEngine.AnimationCurve _pattern
::UnityEngine::AnimationCurve*& GlobalNamespace::TutorialSettings::dyn__pattern() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TutorialSettings::dyn__pattern");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_pattern"))->offset;
return *reinterpret_cast<::UnityEngine::AnimationCurve**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _patternDuration
float& GlobalNamespace::TutorialSettings::dyn__patternDuration() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TutorialSettings::dyn__patternDuration");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_patternDuration"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Color _flashColor
::UnityEngine::Color& GlobalNamespace::TutorialSettings::dyn__flashColor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TutorialSettings::dyn__flashColor");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_flashColor"))->offset;
return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: TutorialSettings.get_FlashColor
::UnityEngine::Color GlobalNamespace::TutorialSettings::get_FlashColor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TutorialSettings::get_FlashColor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_FlashColor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Color, false>(this, ___internal__method);
}
// Autogenerated method: TutorialSettings.GetBlink
float GlobalNamespace::TutorialSettings::GetBlink() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TutorialSettings::GetBlink");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetBlink", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method);
}
// Autogenerated method: TutorialSettings.GetNextBlinkStart
float GlobalNamespace::TutorialSettings::GetNextBlinkStart() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TutorialSettings::GetNextBlinkStart");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetNextBlinkStart", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: HandMover
#include "GlobalNamespace/HandMover.hpp"
// Including type: UnityEngine.Transform
#include "UnityEngine/Transform.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Transform _leftHand
::UnityEngine::Transform*& GlobalNamespace::HandMover::dyn__leftHand() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::HandMover::dyn__leftHand");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_leftHand"))->offset;
return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Transform _rightHand
::UnityEngine::Transform*& GlobalNamespace::HandMover::dyn__rightHand() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::HandMover::dyn__rightHand");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_rightHand"))->offset;
return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.HandType _useHand
::VROSC::HandType& GlobalNamespace::HandMover::dyn__useHand() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::HandMover::dyn__useHand");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_useHand"))->offset;
return *reinterpret_cast<::VROSC::HandType*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _depthScrollSpeed
float& GlobalNamespace::HandMover::dyn__depthScrollSpeed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::HandMover::dyn__depthScrollSpeed");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_depthScrollSpeed"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _depthOffset
float& GlobalNamespace::HandMover::dyn__depthOffset() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::HandMover::dyn__depthOffset");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_depthOffset"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: HandMover.get_UseHand
::VROSC::HandType GlobalNamespace::HandMover::get_UseHand() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::HandMover::get_UseHand");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_UseHand", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::VROSC::HandType, false>(this, ___internal__method);
}
// Autogenerated method: HandMover.Update
void GlobalNamespace::HandMover::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::HandMover::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: OverrideStartPosition
#include "GlobalNamespace/OverrideStartPosition.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Vector3 _startPosition
::UnityEngine::Vector3& GlobalNamespace::OverrideStartPosition::dyn__startPosition() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OverrideStartPosition::dyn__startPosition");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_startPosition"))->offset;
return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Vector3 _startRotation
::UnityEngine::Vector3& GlobalNamespace::OverrideStartPosition::dyn__startRotation() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OverrideStartPosition::dyn__startRotation");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_startRotation"))->offset;
return *reinterpret_cast<::UnityEngine::Vector3*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: OverrideStartPosition.Start
void GlobalNamespace::OverrideStartPosition::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::OverrideStartPosition::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: WASDMove
#include "GlobalNamespace/WASDMove.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Single _movementSpeed
float& GlobalNamespace::WASDMove::dyn__movementSpeed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::WASDMove::dyn__movementSpeed");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_movementSpeed"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: WASDMove.Update
void GlobalNamespace::WASDMove::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::WASDMove::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: EffectLightmapping
#include "GlobalNamespace/EffectLightmapping.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private UnityEngine.GameObject _normalLighting
::UnityEngine::GameObject*& GlobalNamespace::EffectLightmapping::dyn__normalLighting() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EffectLightmapping::dyn__normalLighting");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_normalLighting"))->offset;
return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.GameObject _effectLighting
::UnityEngine::GameObject*& GlobalNamespace::EffectLightmapping::dyn__effectLighting() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EffectLightmapping::dyn__effectLighting");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_effectLighting"))->offset;
return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: EffectLightmapping.ShowEffectLighting
void GlobalNamespace::EffectLightmapping::ShowEffectLighting(bool showEffects) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EffectLightmapping::ShowEffectLighting");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ShowEffectLighting", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(showEffects)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, showEffects);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: Environment
#include "GlobalNamespace/Environment.hpp"
// Including type: VROSC.EnvironmentData
#include "VROSC/EnvironmentData.hpp"
// Including type: UnityEngine.Material
#include "UnityEngine/Material.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private VROSC.EnvironmentData _data
::VROSC::EnvironmentData*& GlobalNamespace::Environment::dyn__data() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Environment::dyn__data");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_data"))->offset;
return *reinterpret_cast<::VROSC::EnvironmentData**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _effectsAmount
float& GlobalNamespace::Environment::dyn__effectsAmount() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Environment::dyn__effectsAmount");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_effectsAmount"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: Environment.get_Data
::VROSC::EnvironmentData* GlobalNamespace::Environment::get_Data() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Environment::get_Data");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Data", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::VROSC::EnvironmentData*, false>(this, ___internal__method);
}
// Autogenerated method: Environment.get_SkyboxMaterial
::UnityEngine::Material* GlobalNamespace::Environment::get_SkyboxMaterial() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Environment::get_SkyboxMaterial");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SkyboxMaterial", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Material*, false>(this, ___internal__method);
}
// Autogenerated method: Environment.get_BassModifier
float GlobalNamespace::Environment::get_BassModifier() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Environment::get_BassModifier");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_BassModifier", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method);
}
// Autogenerated method: Environment.get_MidModifier
float GlobalNamespace::Environment::get_MidModifier() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Environment::get_MidModifier");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_MidModifier", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method);
}
// Autogenerated method: Environment.get_TopModifier
float GlobalNamespace::Environment::get_TopModifier() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Environment::get_TopModifier");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_TopModifier", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method);
}
// Autogenerated method: Environment.SetEffectsAmount
void GlobalNamespace::Environment::SetEffectsAmount(float effectsAmount) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Environment::SetEffectsAmount");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetEffectsAmount", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(effectsAmount)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, effectsAmount);
}
// Autogenerated method: Environment.Awake
void GlobalNamespace::Environment::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Environment::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Environment.SetAllSubObjectsToEnvironmentLayer
void GlobalNamespace::Environment::SetAllSubObjectsToEnvironmentLayer() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Environment::SetAllSubObjectsToEnvironmentLayer");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetAllSubObjectsToEnvironmentLayer", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: Environment.GetChildrenRecurisve
void GlobalNamespace::Environment::GetChildrenRecurisve(::System::Collections::Generic::List_1<::UnityEngine::GameObject*>* list, ::UnityEngine::GameObject* gameObject) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::Environment::GetChildrenRecurisve");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetChildrenRecurisve", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(list), ::il2cpp_utils::ExtractType(gameObject)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, list, gameObject);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: EnvironmentController
#include "GlobalNamespace/EnvironmentController.hpp"
// Including type: EnvironmentController/<FadeToOtherEnvironment>d__26
#include "GlobalNamespace/EnvironmentController_-FadeToOtherEnvironment-d__26.hpp"
// Including type: VROSC.EnvironmentData
#include "VROSC/EnvironmentData.hpp"
// Including type: UnityEngine.AnimationCurve
#include "UnityEngine/AnimationCurve.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: Environment
#include "GlobalNamespace/Environment.hpp"
// Including type: System.Action`1
#include "System/Action_1.hpp"
// Including type: UnityEngine.SceneManagement.Scene
#include "UnityEngine/SceneManagement/Scene.hpp"
// Including type: UnityEngine.SceneManagement.LoadSceneMode
#include "UnityEngine/SceneManagement/LoadSceneMode.hpp"
// Including type: System.Collections.IEnumerator
#include "System/Collections/IEnumerator.hpp"
// Including type: VROSC.UserDataControllers
#include "VROSC/UserDataControllers.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Action`1<Environment> OnNewEnvironment
::System::Action_1<::GlobalNamespace::Environment*>* GlobalNamespace::EnvironmentController::_get_OnNewEnvironment() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::_get_OnNewEnvironment");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Action_1<::GlobalNamespace::Environment*>*>("", "EnvironmentController", "OnNewEnvironment"));
}
// Autogenerated static field setter
// Set static field: static public System.Action`1<Environment> OnNewEnvironment
void GlobalNamespace::EnvironmentController::_set_OnNewEnvironment(::System::Action_1<::GlobalNamespace::Environment*>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::_set_OnNewEnvironment");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "EnvironmentController", "OnNewEnvironment", value));
}
// Autogenerated instance field getter
// Get instance field: private VROSC.EnvironmentData _startEnvironment
::VROSC::EnvironmentData*& GlobalNamespace::EnvironmentController::dyn__startEnvironment() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::dyn__startEnvironment");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_startEnvironment"))->offset;
return *reinterpret_cast<::VROSC::EnvironmentData**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.AnimationCurve _screenFadeCurve
::UnityEngine::AnimationCurve*& GlobalNamespace::EnvironmentController::dyn__screenFadeCurve() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::dyn__screenFadeCurve");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_screenFadeCurve"))->offset;
return *reinterpret_cast<::UnityEngine::AnimationCurve**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _screenFadeTime
float& GlobalNamespace::EnvironmentController::dyn__screenFadeTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::dyn__screenFadeTime");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_screenFadeTime"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<System.String> _scenes
::System::Collections::Generic::List_1<::StringW>*& GlobalNamespace::EnvironmentController::dyn__scenes() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::dyn__scenes");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_scenes"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::StringW>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private Environment <CurrentEnvironment>k__BackingField
::GlobalNamespace::Environment*& GlobalNamespace::EnvironmentController::dyn_$CurrentEnvironment$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::dyn_$CurrentEnvironment$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<CurrentEnvironment>k__BackingField"))->offset;
return *reinterpret_cast<::GlobalNamespace::Environment**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single <EffectsAmount>k__BackingField
float& GlobalNamespace::EnvironmentController::dyn_$EffectsAmount$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::dyn_$EffectsAmount$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<EffectsAmount>k__BackingField"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<Environment> _environments
::System::Collections::Generic::List_1<::GlobalNamespace::Environment*>*& GlobalNamespace::EnvironmentController::dyn__environments() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::dyn__environments");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_environments"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::GlobalNamespace::Environment*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean <ScenesLoaded>k__BackingField
bool& GlobalNamespace::EnvironmentController::dyn_$ScenesLoaded$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::dyn_$ScenesLoaded$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<ScenesLoaded>k__BackingField"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: EnvironmentController.get_StartEnvironment
::VROSC::EnvironmentData* GlobalNamespace::EnvironmentController::get_StartEnvironment() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::get_StartEnvironment");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_StartEnvironment", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::VROSC::EnvironmentData*, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentController.get_CurrentEnvironment
::GlobalNamespace::Environment* GlobalNamespace::EnvironmentController::get_CurrentEnvironment() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::get_CurrentEnvironment");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CurrentEnvironment", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::GlobalNamespace::Environment*, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentController.set_CurrentEnvironment
void GlobalNamespace::EnvironmentController::set_CurrentEnvironment(::GlobalNamespace::Environment* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::set_CurrentEnvironment");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_CurrentEnvironment", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: EnvironmentController.get_EffectsAmount
float GlobalNamespace::EnvironmentController::get_EffectsAmount() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::get_EffectsAmount");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_EffectsAmount", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentController.set_EffectsAmount
void GlobalNamespace::EnvironmentController::set_EffectsAmount(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::set_EffectsAmount");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_EffectsAmount", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: EnvironmentController.get_ScenesLoaded
bool GlobalNamespace::EnvironmentController::get_ScenesLoaded() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::get_ScenesLoaded");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_ScenesLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentController.set_ScenesLoaded
void GlobalNamespace::EnvironmentController::set_ScenesLoaded(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::set_ScenesLoaded");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_ScenesLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: EnvironmentController.Awake
void GlobalNamespace::EnvironmentController::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentController.OnDestroy
void GlobalNamespace::EnvironmentController::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::OnDestroy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentController.LoadScenes
void GlobalNamespace::EnvironmentController::LoadScenes() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::LoadScenes");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LoadScenes", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentController.SceneLoaded
void GlobalNamespace::EnvironmentController::SceneLoaded(::UnityEngine::SceneManagement::Scene scene, ::UnityEngine::SceneManagement::LoadSceneMode mode) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::SceneLoaded");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SceneLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(scene), ::il2cpp_utils::ExtractType(mode)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, scene, mode);
}
// Autogenerated method: EnvironmentController.SetEnvironment
void GlobalNamespace::EnvironmentController::SetEnvironment(::VROSC::EnvironmentData* environmentData, bool animate) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::SetEnvironment");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetEnvironment", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(environmentData), ::il2cpp_utils::ExtractType(animate)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, environmentData, animate);
}
// Autogenerated method: EnvironmentController.SetEnvironment
void GlobalNamespace::EnvironmentController::SetEnvironment(::GlobalNamespace::Environment* environment) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::SetEnvironment");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetEnvironment", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(environment)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, environment);
}
// Autogenerated method: EnvironmentController.FadeToOtherEnvironment
::System::Collections::IEnumerator* GlobalNamespace::EnvironmentController::FadeToOtherEnvironment(::GlobalNamespace::Environment* environment) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::FadeToOtherEnvironment");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FadeToOtherEnvironment", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(environment)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, environment);
}
// Autogenerated method: EnvironmentController.ActivateEnvironment
void GlobalNamespace::EnvironmentController::ActivateEnvironment(::GlobalNamespace::Environment* environment) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::ActivateEnvironment");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ActivateEnvironment", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(environment)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, environment);
}
// Autogenerated method: EnvironmentController.HideCurrentEnvironment
void GlobalNamespace::EnvironmentController::HideCurrentEnvironment() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::HideCurrentEnvironment");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "HideCurrentEnvironment", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentController.SetEnvironmentEffectsInput
void GlobalNamespace::EnvironmentController::SetEnvironmentEffectsInput(float effectsAmount) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::SetEnvironmentEffectsInput");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetEnvironmentEffectsInput", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(effectsAmount)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, effectsAmount);
}
// Autogenerated method: EnvironmentController.GetEnvironment
::GlobalNamespace::Environment* GlobalNamespace::EnvironmentController::GetEnvironment(::StringW environmentId) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::GetEnvironment");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetEnvironment", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(environmentId)})));
return ::il2cpp_utils::RunMethodRethrow<::GlobalNamespace::Environment*, false>(this, ___internal__method, environmentId);
}
// Autogenerated method: EnvironmentController.UserDataLoaded
void GlobalNamespace::EnvironmentController::UserDataLoaded(::VROSC::UserDataControllers* userDataControllers) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::UserDataLoaded");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UserDataLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(userDataControllers)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, userDataControllers);
}
// Autogenerated method: EnvironmentController.SessionDataLoaded
void GlobalNamespace::EnvironmentController::SessionDataLoaded(::VROSC::UserDataControllers* userDataControllers) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::SessionDataLoaded");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SessionDataLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(userDataControllers)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, userDataControllers);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: EnvironmentController/<FadeToOtherEnvironment>d__26
#include "GlobalNamespace/EnvironmentController_-FadeToOtherEnvironment-d__26.hpp"
// Including type: Environment
#include "GlobalNamespace/Environment.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Int32 <>1__state
int& GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::dyn_$$1__state");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Object <>2__current
::Il2CppObject*& GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::dyn_$$2__current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::dyn_$$2__current");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>2__current"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public EnvironmentController <>4__this
::GlobalNamespace::EnvironmentController*& GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::GlobalNamespace::EnvironmentController**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public Environment environment
::GlobalNamespace::Environment*& GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::dyn_environment() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::dyn_environment");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "environment"))->offset;
return *reinterpret_cast<::GlobalNamespace::Environment**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: EnvironmentController/<FadeToOtherEnvironment>d__26.System.Collections.Generic.IEnumerator<System.Object>.get_Current
::Il2CppObject* GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::System_Collections_Generic_IEnumerator$System_Object$_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::System.Collections.Generic.IEnumerator<System.Object>.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerator<System.Object>.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentController/<FadeToOtherEnvironment>d__26.System.Collections.IEnumerator.get_Current
::Il2CppObject* GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::System_Collections_IEnumerator_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::System.Collections.IEnumerator.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentController/<FadeToOtherEnvironment>d__26.System.IDisposable.Dispose
void GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::System_IDisposable_Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::System.IDisposable.Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IDisposable.Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentController/<FadeToOtherEnvironment>d__26.MoveNext
bool GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::MoveNext");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveNext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: EnvironmentController/<FadeToOtherEnvironment>d__26.System.Collections.IEnumerator.Reset
void GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::System_Collections_IEnumerator_Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::EnvironmentController::$FadeToOtherEnvironment$d__26::System.Collections.IEnumerator.Reset");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: LanternLookAtCenter
#include "GlobalNamespace/LanternLookAtCenter.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Single _height
float& GlobalNamespace::LanternLookAtCenter::dyn__height() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::LanternLookAtCenter::dyn__height");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_height"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: LanternLookAtCenter.OnEnable
void GlobalNamespace::LanternLookAtCenter::OnEnable() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::LanternLookAtCenter::OnEnable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: LanternLookAtCenter.LookAtCenter
void GlobalNamespace::LanternLookAtCenter::LookAtCenter() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::LanternLookAtCenter::LookAtCenter");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LookAtCenter", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: SetCameraSettingsOnEnvironmentSwitch
#include "GlobalNamespace/SetCameraSettingsOnEnvironmentSwitch.hpp"
// Including type: BeautifyEffect.Beautify
#include "BeautifyEffect/Beautify.hpp"
// Including type: Environment
#include "GlobalNamespace/Environment.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private BeautifyEffect.Beautify _beautify
::BeautifyEffect::Beautify*& GlobalNamespace::SetCameraSettingsOnEnvironmentSwitch::dyn__beautify() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SetCameraSettingsOnEnvironmentSwitch::dyn__beautify");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_beautify"))->offset;
return *reinterpret_cast<::BeautifyEffect::Beautify**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: SetCameraSettingsOnEnvironmentSwitch.Awake
void GlobalNamespace::SetCameraSettingsOnEnvironmentSwitch::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SetCameraSettingsOnEnvironmentSwitch::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: SetCameraSettingsOnEnvironmentSwitch.NewEnvironmentSet
void GlobalNamespace::SetCameraSettingsOnEnvironmentSwitch::NewEnvironmentSet(::GlobalNamespace::Environment* settings) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SetCameraSettingsOnEnvironmentSwitch::NewEnvironmentSet");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "NewEnvironmentSet", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(settings)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, settings);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: TwitchSecrets
#include "GlobalNamespace/TwitchSecrets.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.String CLIENT_ID
::StringW GlobalNamespace::TwitchSecrets::_get_CLIENT_ID() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TwitchSecrets::_get_CLIENT_ID");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "TwitchSecrets", "CLIENT_ID"));
}
// Autogenerated static field setter
// Set static field: static public System.String CLIENT_ID
void GlobalNamespace::TwitchSecrets::_set_CLIENT_ID(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TwitchSecrets::_set_CLIENT_ID");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "TwitchSecrets", "CLIENT_ID", value));
}
// Autogenerated static field getter
// Get static field: static public System.String CLIENT_SECRET
::StringW GlobalNamespace::TwitchSecrets::_get_CLIENT_SECRET() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TwitchSecrets::_get_CLIENT_SECRET");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "TwitchSecrets", "CLIENT_SECRET"));
}
// Autogenerated static field setter
// Set static field: static public System.String CLIENT_SECRET
void GlobalNamespace::TwitchSecrets::_set_CLIENT_SECRET(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TwitchSecrets::_set_CLIENT_SECRET");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "TwitchSecrets", "CLIENT_SECRET", value));
}
// Autogenerated static field getter
// Get static field: static public System.String BOT_NAME
::StringW GlobalNamespace::TwitchSecrets::_get_BOT_NAME() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TwitchSecrets::_get_BOT_NAME");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "TwitchSecrets", "BOT_NAME"));
}
// Autogenerated static field setter
// Set static field: static public System.String BOT_NAME
void GlobalNamespace::TwitchSecrets::_set_BOT_NAME(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TwitchSecrets::_set_BOT_NAME");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "TwitchSecrets", "BOT_NAME", value));
}
// Autogenerated static field getter
// Get static field: static public System.String BOT_ACCESS_TOKEN
::StringW GlobalNamespace::TwitchSecrets::_get_BOT_ACCESS_TOKEN() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TwitchSecrets::_get_BOT_ACCESS_TOKEN");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "TwitchSecrets", "BOT_ACCESS_TOKEN"));
}
// Autogenerated static field setter
// Set static field: static public System.String BOT_ACCESS_TOKEN
void GlobalNamespace::TwitchSecrets::_set_BOT_ACCESS_TOKEN(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TwitchSecrets::_set_BOT_ACCESS_TOKEN");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "TwitchSecrets", "BOT_ACCESS_TOKEN", value));
}
// Autogenerated static field getter
// Get static field: static public System.String BOT_REFRESH_TOKEN
::StringW GlobalNamespace::TwitchSecrets::_get_BOT_REFRESH_TOKEN() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TwitchSecrets::_get_BOT_REFRESH_TOKEN");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("", "TwitchSecrets", "BOT_REFRESH_TOKEN"));
}
// Autogenerated static field setter
// Set static field: static public System.String BOT_REFRESH_TOKEN
void GlobalNamespace::TwitchSecrets::_set_BOT_REFRESH_TOKEN(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TwitchSecrets::_set_BOT_REFRESH_TOKEN");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "TwitchSecrets", "BOT_REFRESH_TOKEN", value));
}
// Autogenerated method: TwitchSecrets..cctor
void GlobalNamespace::TwitchSecrets::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::TwitchSecrets::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "TwitchSecrets", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: MalletSettingsPanel
#include "GlobalNamespace/MalletSettingsPanel.hpp"
// Including type: VROSC.UISlider
#include "VROSC/UISlider.hpp"
// Including type: VROSC.UserPreferencesDataController
#include "VROSC/UserPreferencesDataController.hpp"
// Including type: VROSC.MinMaxFloat
#include "VROSC/MinMaxFloat.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private VROSC.UISlider _malletsAngleSlider
::VROSC::UISlider*& GlobalNamespace::MalletSettingsPanel::dyn__malletsAngleSlider() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MalletSettingsPanel::dyn__malletsAngleSlider");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_malletsAngleSlider"))->offset;
return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UISlider _malletsLengthSlider
::VROSC::UISlider*& GlobalNamespace::MalletSettingsPanel::dyn__malletsLengthSlider() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MalletSettingsPanel::dyn__malletsLengthSlider");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_malletsLengthSlider"))->offset;
return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: MalletSettingsPanel.Awake
void GlobalNamespace::MalletSettingsPanel::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MalletSettingsPanel::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: MalletSettingsPanel.OnEnable
void GlobalNamespace::MalletSettingsPanel::OnEnable() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MalletSettingsPanel::OnEnable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: MalletSettingsPanel.SetMalletsValues
void GlobalNamespace::MalletSettingsPanel::SetMalletsValues(::VROSC::UserPreferencesDataController* data) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MalletSettingsPanel::SetMalletsValues");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetMalletsValues", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(data)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, data);
}
// Autogenerated method: MalletSettingsPanel.OnDisable
void GlobalNamespace::MalletSettingsPanel::OnDisable() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MalletSettingsPanel::OnDisable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDisable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: MalletSettingsPanel.AngleChanged
void GlobalNamespace::MalletSettingsPanel::AngleChanged(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MalletSettingsPanel::AngleChanged");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AngleChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: MalletSettingsPanel.LengthChanged
void GlobalNamespace::MalletSettingsPanel::LengthChanged(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MalletSettingsPanel::LengthChanged");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LengthChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: MalletSettingsPanel.OnDestroy
void GlobalNamespace::MalletSettingsPanel::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MalletSettingsPanel::OnDestroy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: MalletSettingsPanel.AngleValueChangedByUI
void GlobalNamespace::MalletSettingsPanel::AngleValueChangedByUI(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MalletSettingsPanel::AngleValueChangedByUI");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AngleValueChangedByUI", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: MalletSettingsPanel.LengthValueChangedByUI
void GlobalNamespace::MalletSettingsPanel::LengthValueChangedByUI(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MalletSettingsPanel::LengthValueChangedByUI");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LengthValueChangedByUI", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: MalletSettingsPanel.SetSliderValue
void GlobalNamespace::MalletSettingsPanel::SetSliderValue(::VROSC::UISlider* slider, float value, ::VROSC::MinMaxFloat* minMax) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MalletSettingsPanel::SetSliderValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetSliderValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(slider), ::il2cpp_utils::ExtractType(value), ::il2cpp_utils::ExtractType(minMax)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, slider, value, minMax);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: UIProgressBar
#include "GlobalNamespace/UIProgressBar.hpp"
// Including type: VROSC.AdjustableMesh
#include "VROSC/AdjustableMesh.hpp"
// Including type: VROSC.AdjustableMeshTransformUVEffect
#include "VROSC/AdjustableMeshTransformUVEffect.hpp"
// Including type: VROSC.AdjustableMeshColorChangeEffect
#include "VROSC/AdjustableMeshColorChangeEffect.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private VROSC.AdjustableMesh _progressBar
::VROSC::AdjustableMesh*& GlobalNamespace::UIProgressBar::dyn__progressBar() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIProgressBar::dyn__progressBar");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_progressBar"))->offset;
return *reinterpret_cast<::VROSC::AdjustableMesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.AdjustableMeshTransformUVEffect _progressBarValue
::VROSC::AdjustableMeshTransformUVEffect*& GlobalNamespace::UIProgressBar::dyn__progressBarValue() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIProgressBar::dyn__progressBarValue");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_progressBarValue"))->offset;
return *reinterpret_cast<::VROSC::AdjustableMeshTransformUVEffect**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.AdjustableMeshColorChangeEffect _progressBarColor
::VROSC::AdjustableMeshColorChangeEffect*& GlobalNamespace::UIProgressBar::dyn__progressBarColor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIProgressBar::dyn__progressBarColor");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_progressBarColor"))->offset;
return *reinterpret_cast<::VROSC::AdjustableMeshColorChangeEffect**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Color _successColor
::UnityEngine::Color& GlobalNamespace::UIProgressBar::dyn__successColor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIProgressBar::dyn__successColor");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_successColor"))->offset;
return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Color _failureColor
::UnityEngine::Color& GlobalNamespace::UIProgressBar::dyn__failureColor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIProgressBar::dyn__failureColor");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_failureColor"))->offset;
return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Color _inProgressColor
::UnityEngine::Color& GlobalNamespace::UIProgressBar::dyn__inProgressColor() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIProgressBar::dyn__inProgressColor");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_inProgressColor"))->offset;
return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single <Progress>k__BackingField
float& GlobalNamespace::UIProgressBar::dyn_$Progress$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIProgressBar::dyn_$Progress$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Progress>k__BackingField"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: UIProgressBar.get_Progress
float GlobalNamespace::UIProgressBar::get_Progress() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIProgressBar::get_Progress");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Progress", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method);
}
// Autogenerated method: UIProgressBar.set_Progress
void GlobalNamespace::UIProgressBar::set_Progress(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIProgressBar::set_Progress");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Progress", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: UIProgressBar.Awake
void GlobalNamespace::UIProgressBar::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIProgressBar::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: UIProgressBar.StartUpdating
void GlobalNamespace::UIProgressBar::StartUpdating() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIProgressBar::StartUpdating");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StartUpdating", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: UIProgressBar.StopUpdating
void GlobalNamespace::UIProgressBar::StopUpdating(bool success) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIProgressBar::StopUpdating");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StopUpdating", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(success)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, success);
}
// Autogenerated method: UIProgressBar.UpdateValue
void GlobalNamespace::UIProgressBar::UpdateValue(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIProgressBar::UpdateValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: PasswordField
#include "GlobalNamespace/PasswordField.hpp"
// Including type: TMPro.TextMeshPro
#include "TMPro/TextMeshPro.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private TMPro.TextMeshPro _hiddenText
::TMPro::TextMeshPro*& GlobalNamespace::PasswordField::dyn__hiddenText() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PasswordField::dyn__hiddenText");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_hiddenText"))->offset;
return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: PasswordField.EnteredPasswordChanged
void GlobalNamespace::PasswordField::EnteredPasswordChanged(::StringW password) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PasswordField::EnteredPasswordChanged");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "EnteredPasswordChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(password)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, password);
}
// Autogenerated method: PasswordField.Awake
void GlobalNamespace::PasswordField::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PasswordField::Awake");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: PasswordField.OnDestroy
void GlobalNamespace::PasswordField::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::PasswordField::OnDestroy");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: UIInputField
#include "GlobalNamespace/UIInputField.hpp"
// Including type: TMPro.TextMeshPro
#include "TMPro/TextMeshPro.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: System.Action`1
#include "System/Action_1.hpp"
// Including type: VROSC.ClickData
#include "VROSC/ClickData.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: protected System.String _descriptionText
::StringW& GlobalNamespace::UIInputField::dyn__descriptionText() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::dyn__descriptionText");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_descriptionText"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: protected TMPro.TextMeshPro _textInput
::TMPro::TextMeshPro*& GlobalNamespace::UIInputField::dyn__textInput() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::dyn__textInput");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_textInput"))->offset;
return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: protected TMPro.TextMeshPro _placeholderText
::TMPro::TextMeshPro*& GlobalNamespace::UIInputField::dyn__placeholderText() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::dyn__placeholderText");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_placeholderText"))->offset;
return *reinterpret_cast<::TMPro::TextMeshPro**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: protected UnityEngine.GameObject _toggleObject
::UnityEngine::GameObject*& GlobalNamespace::UIInputField::dyn__toggleObject() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::dyn__toggleObject");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_toggleObject"))->offset;
return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: protected System.Boolean _isActive
bool& GlobalNamespace::UIInputField::dyn__isActive() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::dyn__isActive");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_isActive"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Action`1<UIInputField> OnSelected
::System::Action_1<::GlobalNamespace::UIInputField*>*& GlobalNamespace::UIInputField::dyn_OnSelected() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::dyn_OnSelected");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnSelected"))->offset;
return *reinterpret_cast<::System::Action_1<::GlobalNamespace::UIInputField*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Action`1<System.String> OnValueChanged
::System::Action_1<::StringW>*& GlobalNamespace::UIInputField::dyn_OnValueChanged() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::dyn_OnValueChanged");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "OnValueChanged"))->offset;
return *reinterpret_cast<::System::Action_1<::StringW>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: UIInputField.get_Text
::StringW GlobalNamespace::UIInputField::get_Text() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::get_Text");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Text", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: UIInputField.Awake
void GlobalNamespace::UIInputField::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::Awake");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: UIInputField.OnDestroy
void GlobalNamespace::UIInputField::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::OnDestroy");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: UIInputField.Toggle
void GlobalNamespace::UIInputField::Toggle() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::Toggle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Toggle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: UIInputField.Select
void GlobalNamespace::UIInputField::Select() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::Select");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Select", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: UIInputField.Deselect
void GlobalNamespace::UIInputField::Deselect(bool releaseKeyboard) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::Deselect");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Deselect", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(releaseKeyboard)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, releaseKeyboard);
}
// Autogenerated method: UIInputField.SetText
void GlobalNamespace::UIInputField::SetText(::StringW text) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::SetText");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetText", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(text)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, text);
}
// Autogenerated method: UIInputField.KeyboardClosed
void GlobalNamespace::UIInputField::KeyboardClosed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::KeyboardClosed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "KeyboardClosed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: UIInputField.InputFieldPressed
void GlobalNamespace::UIInputField::InputFieldPressed(::VROSC::ClickData* clickData) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::InputFieldPressed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InputFieldPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(clickData)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, clickData);
}
// Autogenerated method: UIInputField.get_InteractionStopsLaser
bool GlobalNamespace::UIInputField::get_InteractionStopsLaser() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::get_InteractionStopsLaser");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_InteractionStopsLaser", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: UIInputField.OnDisable
void GlobalNamespace::UIInputField::OnDisable() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::UIInputField::OnDisable");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDisable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: LoopStationController
#include "GlobalNamespace/LoopStationController.hpp"
// Including type: VROSC.LoopStation
#include "VROSC/LoopStation.hpp"
// Including type: VROSC.UIButton
#include "VROSC/UIButton.hpp"
// Including type: VROSC.UserDataControllers
#include "VROSC/UserDataControllers.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private VROSC.LoopStation _loopStation
::VROSC::LoopStation*& GlobalNamespace::LoopStationController::dyn__loopStation() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::LoopStationController::dyn__loopStation");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_loopStation"))->offset;
return *reinterpret_cast<::VROSC::LoopStation**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UIButton _closeButton
::VROSC::UIButton*& GlobalNamespace::LoopStationController::dyn__closeButton() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::LoopStationController::dyn__closeButton");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_closeButton"))->offset;
return *reinterpret_cast<::VROSC::UIButton**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: LoopStationController.CloseButtonPressed
void GlobalNamespace::LoopStationController::CloseButtonPressed() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::LoopStationController::CloseButtonPressed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CloseButtonPressed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: LoopStationController.Setup
void GlobalNamespace::LoopStationController::Setup() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::LoopStationController::Setup");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: LoopStationController.OnDestroy
void GlobalNamespace::LoopStationController::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::LoopStationController::OnDestroy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: LoopStationController.ResetWidget
void GlobalNamespace::LoopStationController::ResetWidget() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::LoopStationController::ResetWidget");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ResetWidget", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: LoopStationController.UserDataLoaded
void GlobalNamespace::LoopStationController::UserDataLoaded(::VROSC::UserDataControllers* user) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::LoopStationController::UserDataLoaded");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UserDataLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(user)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, user);
}
// Autogenerated method: LoopStationController.SynthesizerSourceChanged
void GlobalNamespace::LoopStationController::SynthesizerSourceChanged(bool useMidi) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::LoopStationController::SynthesizerSourceChanged");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SynthesizerSourceChanged", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(useMidi)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, useMidi);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: SavWav
#include "GlobalNamespace/SavWav.hpp"
// Including type: System.IO.FileStream
#include "System/IO/FileStream.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.Int32 HEADER_SIZE
int GlobalNamespace::SavWav::_get_HEADER_SIZE() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SavWav::_get_HEADER_SIZE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("", "SavWav", "HEADER_SIZE"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 HEADER_SIZE
void GlobalNamespace::SavWav::_set_HEADER_SIZE(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SavWav::_set_HEADER_SIZE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "SavWav", "HEADER_SIZE", value));
}
// Autogenerated static field getter
// Get static field: static private System.Int32 BUFFER_SIZE
int GlobalNamespace::SavWav::_get_BUFFER_SIZE() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SavWav::_get_BUFFER_SIZE");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("", "SavWav", "BUFFER_SIZE"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 BUFFER_SIZE
void GlobalNamespace::SavWav::_set_BUFFER_SIZE(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SavWav::_set_BUFFER_SIZE");
THROW_UNLESS(il2cpp_utils::SetFieldValue("", "SavWav", "BUFFER_SIZE", value));
}
// Autogenerated method: SavWav.Save
void GlobalNamespace::SavWav::Save(::StringW filename, ::ArrayW<float> samples, int sampleRate, int channels, float normalizeMultiplier, int startIndex, int endIndex) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SavWav::Save");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "SavWav", "Save", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filename), ::il2cpp_utils::ExtractType(samples), ::il2cpp_utils::ExtractType(sampleRate), ::il2cpp_utils::ExtractType(channels), ::il2cpp_utils::ExtractType(normalizeMultiplier), ::il2cpp_utils::ExtractType(startIndex), ::il2cpp_utils::ExtractType(endIndex)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filename, samples, sampleRate, channels, normalizeMultiplier, startIndex, endIndex);
}
// Autogenerated method: SavWav.CreateEmpty
::System::IO::FileStream* GlobalNamespace::SavWav::CreateEmpty(::StringW filepath) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SavWav::CreateEmpty");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "SavWav", "CreateEmpty", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(filepath)})));
return ::il2cpp_utils::RunMethodRethrow<::System::IO::FileStream*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, filepath);
}
// Autogenerated method: SavWav.ConvertAndWrite
void GlobalNamespace::SavWav::ConvertAndWrite(::System::IO::FileStream* fileStream, ::ArrayW<float> samples, float normalizeMultiplier, int startIndex, int length) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SavWav::ConvertAndWrite");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "SavWav", "ConvertAndWrite", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(fileStream), ::il2cpp_utils::ExtractType(samples), ::il2cpp_utils::ExtractType(normalizeMultiplier), ::il2cpp_utils::ExtractType(startIndex), ::il2cpp_utils::ExtractType(length)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, fileStream, samples, normalizeMultiplier, startIndex, length);
}
// Autogenerated method: SavWav.WriteHeader
void GlobalNamespace::SavWav::WriteHeader(::System::IO::FileStream* fileStream, int length, int hz, int channels) {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::SavWav::WriteHeader");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("", "SavWav", "WriteHeader", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(fileStream), ::il2cpp_utils::ExtractType(length), ::il2cpp_utils::ExtractType(hz), ::il2cpp_utils::ExtractType(channels)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, fileStream, length, hz, channels);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: MirrorTransform
#include "GlobalNamespace/MirrorTransform.hpp"
// Including type: UnityEngine.Transform
#include "UnityEngine/Transform.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Transform _mirror
::UnityEngine::Transform*& GlobalNamespace::MirrorTransform::dyn__mirror() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MirrorTransform::dyn__mirror");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_mirror"))->offset;
return *reinterpret_cast<::UnityEngine::Transform**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: MirrorTransform.Update
void GlobalNamespace::MirrorTransform::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MirrorTransform::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: MirrorTransform.OnDrawGizmos
void GlobalNamespace::MirrorTransform::OnDrawGizmos() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::MirrorTransform::OnDrawGizmos");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDrawGizmos", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: StaticBatchable
#include "GlobalNamespace/StaticBatchable.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: StaticBatcher
#include "GlobalNamespace/StaticBatcher.hpp"
// Including type: StaticBatcher/<Start>d__1
#include "GlobalNamespace/StaticBatcher_-Start-d__1.hpp"
// Including type: System.Collections.IEnumerator
#include "System/Collections/IEnumerator.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Single _delay
float& GlobalNamespace::StaticBatcher::dyn__delay() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::StaticBatcher::dyn__delay");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_delay"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: StaticBatcher.Start
::System::Collections::IEnumerator* GlobalNamespace::StaticBatcher::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::StaticBatcher::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method);
}
// Autogenerated method: StaticBatcher.Batch
void GlobalNamespace::StaticBatcher::Batch() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::StaticBatcher::Batch");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Batch", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: StaticBatcher/<Start>d__1
#include "GlobalNamespace/StaticBatcher_-Start-d__1.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Int32 <>1__state
int& GlobalNamespace::StaticBatcher::$Start$d__1::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::StaticBatcher::$Start$d__1::dyn_$$1__state");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Object <>2__current
::Il2CppObject*& GlobalNamespace::StaticBatcher::$Start$d__1::dyn_$$2__current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::StaticBatcher::$Start$d__1::dyn_$$2__current");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>2__current"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public StaticBatcher <>4__this
::GlobalNamespace::StaticBatcher*& GlobalNamespace::StaticBatcher::$Start$d__1::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::StaticBatcher::$Start$d__1::dyn_$$4__this");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::GlobalNamespace::StaticBatcher**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: StaticBatcher/<Start>d__1.System.Collections.Generic.IEnumerator<System.Object>.get_Current
::Il2CppObject* GlobalNamespace::StaticBatcher::$Start$d__1::System_Collections_Generic_IEnumerator$System_Object$_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::StaticBatcher::$Start$d__1::System.Collections.Generic.IEnumerator<System.Object>.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.Generic.IEnumerator<System.Object>.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: StaticBatcher/<Start>d__1.System.Collections.IEnumerator.get_Current
::Il2CppObject* GlobalNamespace::StaticBatcher::$Start$d__1::System_Collections_IEnumerator_get_Current() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::StaticBatcher::$Start$d__1::System.Collections.IEnumerator.get_Current");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.get_Current", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::Il2CppObject*, false>(this, ___internal__method);
}
// Autogenerated method: StaticBatcher/<Start>d__1.System.IDisposable.Dispose
void GlobalNamespace::StaticBatcher::$Start$d__1::System_IDisposable_Dispose() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::StaticBatcher::$Start$d__1::System.IDisposable.Dispose");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.IDisposable.Dispose", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: StaticBatcher/<Start>d__1.MoveNext
bool GlobalNamespace::StaticBatcher::$Start$d__1::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::StaticBatcher::$Start$d__1::MoveNext");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "MoveNext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: StaticBatcher/<Start>d__1.System.Collections.IEnumerator.Reset
void GlobalNamespace::StaticBatcher::$Start$d__1::System_Collections_IEnumerator_Reset() {
static auto ___internal__logger = ::Logger::get().WithContext("::GlobalNamespace::StaticBatcher::$Start$d__1::System.Collections.IEnumerator.Reset");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "System.Collections.IEnumerator.Reset", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VRVisuals.SetSoundReactiveColors
#include "VRVisuals/SetSoundReactiveColors.hpp"
// Including type: UnityEngine.Renderer
#include "UnityEngine/Renderer.hpp"
// Including type: UnityEngine.MaterialPropertyBlock
#include "UnityEngine/MaterialPropertyBlock.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Color _baseColor
::UnityEngine::Color& VRVisuals::SetSoundReactiveColors::dyn__baseColor() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSoundReactiveColors::dyn__baseColor");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_baseColor"))->offset;
return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Color _midColor
::UnityEngine::Color& VRVisuals::SetSoundReactiveColors::dyn__midColor() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSoundReactiveColors::dyn__midColor");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_midColor"))->offset;
return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Color _topColor
::UnityEngine::Color& VRVisuals::SetSoundReactiveColors::dyn__topColor() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSoundReactiveColors::dyn__topColor");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_topColor"))->offset;
return *reinterpret_cast<::UnityEngine::Color*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _rotation
float& VRVisuals::SetSoundReactiveColors::dyn__rotation() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSoundReactiveColors::dyn__rotation");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_rotation"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _rotationSpeed
float& VRVisuals::SetSoundReactiveColors::dyn__rotationSpeed() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSoundReactiveColors::dyn__rotationSpeed");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_rotationSpeed"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _bobbing
float& VRVisuals::SetSoundReactiveColors::dyn__bobbing() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSoundReactiveColors::dyn__bobbing");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_bobbing"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _bobbingSpeed
float& VRVisuals::SetSoundReactiveColors::dyn__bobbingSpeed() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSoundReactiveColors::dyn__bobbingSpeed");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_bobbingSpeed"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Vector4 _jumpOnSound
::UnityEngine::Vector4& VRVisuals::SetSoundReactiveColors::dyn__jumpOnSound() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSoundReactiveColors::dyn__jumpOnSound");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_jumpOnSound"))->offset;
return *reinterpret_cast<::UnityEngine::Vector4*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Renderer _renderer
::UnityEngine::Renderer*& VRVisuals::SetSoundReactiveColors::dyn__renderer() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSoundReactiveColors::dyn__renderer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_renderer"))->offset;
return *reinterpret_cast<::UnityEngine::Renderer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.MaterialPropertyBlock _materialBlock
::UnityEngine::MaterialPropertyBlock*& VRVisuals::SetSoundReactiveColors::dyn__materialBlock() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSoundReactiveColors::dyn__materialBlock");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_materialBlock"))->offset;
return *reinterpret_cast<::UnityEngine::MaterialPropertyBlock**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VRVisuals.SetSoundReactiveColors.Awake
void VRVisuals::SetSoundReactiveColors::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSoundReactiveColors::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VRVisuals.SetSoundReactiveColors.Start
void VRVisuals::SetSoundReactiveColors::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSoundReactiveColors::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VRVisuals.SetSoundReactiveColors.SetColors
void VRVisuals::SetSoundReactiveColors::SetColors() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSoundReactiveColors::SetColors");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetColors", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VRVisuals.SetSpectrogramShaderValues
#include "VRVisuals/SetSpectrogramShaderValues.hpp"
// Including type: VRVisuals.SetSpectrogramShaderValues/VRVisuals.TimestampedValues
#include "VRVisuals/SetSpectrogramShaderValues_TimestampedValues.hpp"
// Including type: UnityEngine.MeshFilter
#include "UnityEngine/MeshFilter.hpp"
// Including type: UnityEngine.Mesh
#include "UnityEngine/Mesh.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Single _life
float& VRVisuals::SetSpectrogramShaderValues::dyn__life() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::dyn__life");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_life"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _minRange
float& VRVisuals::SetSpectrogramShaderValues::dyn__minRange() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::dyn__minRange");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_minRange"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _maxRange
float& VRVisuals::SetSpectrogramShaderValues::dyn__maxRange() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::dyn__maxRange");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_maxRange"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _scale
float& VRVisuals::SetSpectrogramShaderValues::dyn__scale() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::dyn__scale");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_scale"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.MeshFilter[] _meshFilters
::ArrayW<::UnityEngine::MeshFilter*>& VRVisuals::SetSpectrogramShaderValues::dyn__meshFilters() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::dyn__meshFilters");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_meshFilters"))->offset;
return *reinterpret_cast<::ArrayW<::UnityEngine::MeshFilter*>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Mesh _mesh
::UnityEngine::Mesh*& VRVisuals::SetSpectrogramShaderValues::dyn__mesh() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::dyn__mesh");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_mesh"))->offset;
return *reinterpret_cast<::UnityEngine::Mesh**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<VRVisuals.SetSpectrogramShaderValues/VRVisuals.TimestampedValues> _timestampedValues
::System::Collections::Generic::List_1<::VRVisuals::SetSpectrogramShaderValues::TimestampedValues*>*& VRVisuals::SetSpectrogramShaderValues::dyn__timestampedValues() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::dyn__timestampedValues");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_timestampedValues"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::VRVisuals::SetSpectrogramShaderValues::TimestampedValues*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VRVisuals.SetSpectrogramShaderValues.Awake
void VRVisuals::SetSpectrogramShaderValues::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VRVisuals.SetSpectrogramShaderValues.Update
void VRVisuals::SetSpectrogramShaderValues::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VRVisuals.SetSpectrogramShaderValues.GetValuesFromAudioPeer
void VRVisuals::SetSpectrogramShaderValues::GetValuesFromAudioPeer() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::GetValuesFromAudioPeer");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValuesFromAudioPeer", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VRVisuals.SetSpectrogramShaderValues.Generate
void VRVisuals::SetSpectrogramShaderValues::Generate() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::Generate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Generate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VRVisuals.SetSpectrogramShaderValues.Get64Values
::System::Collections::Generic::List_1<float>* VRVisuals::SetSpectrogramShaderValues::Get64Values() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::Get64Values");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Get64Values", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::List_1<float>*, false>(this, ___internal__method);
}
// Autogenerated method: VRVisuals.SetSpectrogramShaderValues.OnDrawGizmosSelected
void VRVisuals::SetSpectrogramShaderValues::OnDrawGizmosSelected() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::OnDrawGizmosSelected");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDrawGizmosSelected", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VRVisuals.SetSpectrogramShaderValues/VRVisuals.TimestampedValues
#include "VRVisuals/SetSpectrogramShaderValues_TimestampedValues.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private System.Single <Life>k__BackingField
float& VRVisuals::SetSpectrogramShaderValues::TimestampedValues::dyn_$Life$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::TimestampedValues::dyn_$Life$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Life>k__BackingField"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<System.Single> <Values>k__BackingField
::System::Collections::Generic::List_1<float>*& VRVisuals::SetSpectrogramShaderValues::TimestampedValues::dyn_$Values$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::TimestampedValues::dyn_$Values$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<Values>k__BackingField"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<float>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VRVisuals.SetSpectrogramShaderValues/VRVisuals.TimestampedValues.get_Life
float VRVisuals::SetSpectrogramShaderValues::TimestampedValues::get_Life() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::TimestampedValues::get_Life");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Life", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method);
}
// Autogenerated method: VRVisuals.SetSpectrogramShaderValues/VRVisuals.TimestampedValues.set_Life
void VRVisuals::SetSpectrogramShaderValues::TimestampedValues::set_Life(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::TimestampedValues::set_Life");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Life", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: VRVisuals.SetSpectrogramShaderValues/VRVisuals.TimestampedValues.get_Values
::System::Collections::Generic::List_1<float>* VRVisuals::SetSpectrogramShaderValues::TimestampedValues::get_Values() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::TimestampedValues::get_Values");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_Values", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::List_1<float>*, false>(this, ___internal__method);
}
// Autogenerated method: VRVisuals.SetSpectrogramShaderValues/VRVisuals.TimestampedValues.set_Values
void VRVisuals::SetSpectrogramShaderValues::TimestampedValues::set_Values(::System::Collections::Generic::List_1<float>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::TimestampedValues::set_Values");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_Values", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: VRVisuals.SetSpectrogramShaderValues/VRVisuals.TimestampedValues.Age
void VRVisuals::SetSpectrogramShaderValues::TimestampedValues::Age(float decay) {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::TimestampedValues::Age");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Age", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(decay)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, decay);
}
// Autogenerated method: VRVisuals.SetSpectrogramShaderValues/VRVisuals.TimestampedValues.GetAsCircle
::System::Collections::Generic::List_1<::UnityEngine::Vector3>* VRVisuals::SetSpectrogramShaderValues::TimestampedValues::GetAsCircle(float minRange, float maxRange, float scale) {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::TimestampedValues::GetAsCircle");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetAsCircle", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(minRange), ::il2cpp_utils::ExtractType(maxRange), ::il2cpp_utils::ExtractType(scale)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::Generic::List_1<::UnityEngine::Vector3>*, false>(this, ___internal__method, minRange, maxRange, scale);
}
// Autogenerated method: VRVisuals.SetSpectrogramShaderValues/VRVisuals.TimestampedValues.ArcVector
::UnityEngine::Vector3 VRVisuals::SetSpectrogramShaderValues::TimestampedValues::ArcVector(float yaw, float radius) {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::SetSpectrogramShaderValues::TimestampedValues::ArcVector");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ArcVector", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(yaw), ::il2cpp_utils::ExtractType(radius)})));
return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::Vector3, false>(this, ___internal__method, yaw, radius);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VRVisuals.ShaderValues
#include "VRVisuals/ShaderValues.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: VRVisuals.ShaderValues.GetValuesFromTime
void VRVisuals::ShaderValues::GetValuesFromTime() {
static auto ___internal__logger = ::Logger::get().WithContext("::VRVisuals::ShaderValues::GetValuesFromTime");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetValuesFromTime", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: UI.UITrack
#include "UI/UITrack.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VROSC.AppController
#include "VROSC/AppController.hpp"
// Including type: VROSC.AppController/VROSC.<>c
#include "VROSC/AppController_--c.hpp"
// Including type: VROSC.UISchemeController
#include "VROSC/UISchemeController.hpp"
// Including type: VROSC.SettingsDataDefaults
#include "VROSC/SettingsDataDefaults.hpp"
// Including type: VROSC.Dashboard
#include "VROSC/Dashboard.hpp"
// Including type: UnityEngine.GameObject
#include "UnityEngine/GameObject.hpp"
// Including type: PunchKeyboard
#include "GlobalNamespace/PunchKeyboard.hpp"
// Including type: VROSC.StartMenu
#include "VROSC/StartMenu.hpp"
// Including type: UnityEngine.AudioSource
#include "UnityEngine/AudioSource.hpp"
// Including type: EnvironmentController
#include "GlobalNamespace/EnvironmentController.hpp"
// Including type: VROSC.FullScreenFxController
#include "VROSC/FullScreenFxController.hpp"
// Including type: VROSC.MicrophoneDeviceManager
#include "VROSC/MicrophoneDeviceManager.hpp"
// Including type: VROSC.IntroVideoPlayer
#include "VROSC/IntroVideoPlayer.hpp"
// Including type: VROSC.StateMachine
#include "VROSC/StateMachine.hpp"
// Including type: VROSC.StartState
#include "VROSC/StartState.hpp"
// Including type: VROSC.MainState
#include "VROSC/MainState.hpp"
// Including type: System.Action`1
#include "System/Action_1.hpp"
// Including type: System.Func`1
#include "System/Func_1.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Action`1<System.Boolean> OnAppPaused
::System::Action_1<bool>* VROSC::AppController::_get_OnAppPaused() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::_get_OnAppPaused");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Action_1<bool>*>("VROSC", "AppController", "OnAppPaused"));
}
// Autogenerated static field setter
// Set static field: static public System.Action`1<System.Boolean> OnAppPaused
void VROSC::AppController::_set_OnAppPaused(::System::Action_1<bool>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::_set_OnAppPaused");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AppController", "OnAppPaused", value));
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UISchemeController _uiSchemeController
::VROSC::UISchemeController*& VROSC::AppController::dyn__uiSchemeController() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn__uiSchemeController");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_uiSchemeController"))->offset;
return *reinterpret_cast<::VROSC::UISchemeController**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.SettingsDataDefaults _settingsDataDefaults
::VROSC::SettingsDataDefaults*& VROSC::AppController::dyn__settingsDataDefaults() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn__settingsDataDefaults");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_settingsDataDefaults"))->offset;
return *reinterpret_cast<::VROSC::SettingsDataDefaults**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.Dashboard _dashboardPrefab
::VROSC::Dashboard*& VROSC::AppController::dyn__dashboardPrefab() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn__dashboardPrefab");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_dashboardPrefab"))->offset;
return *reinterpret_cast<::VROSC::Dashboard**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.GameObject _sessionsLibraryWindow
::UnityEngine::GameObject*& VROSC::AppController::dyn__sessionsLibraryWindow() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn__sessionsLibraryWindow");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_sessionsLibraryWindow"))->offset;
return *reinterpret_cast<::UnityEngine::GameObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private PunchKeyboard _keyboardPrefab
::GlobalNamespace::PunchKeyboard*& VROSC::AppController::dyn__keyboardPrefab() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn__keyboardPrefab");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_keyboardPrefab"))->offset;
return *reinterpret_cast<::GlobalNamespace::PunchKeyboard**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.StartMenu _startMenuPrefab
::VROSC::StartMenu*& VROSC::AppController::dyn__startMenuPrefab() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn__startMenuPrefab");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_startMenuPrefab"))->offset;
return *reinterpret_cast<::VROSC::StartMenu**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.AudioSource _startMenuMusic
::UnityEngine::AudioSource*& VROSC::AppController::dyn__startMenuMusic() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn__startMenuMusic");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_startMenuMusic"))->offset;
return *reinterpret_cast<::UnityEngine::AudioSource**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private EnvironmentController _environmentController
::GlobalNamespace::EnvironmentController*& VROSC::AppController::dyn__environmentController() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn__environmentController");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_environmentController"))->offset;
return *reinterpret_cast<::GlobalNamespace::EnvironmentController**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.FullScreenFxController _fullScreenFxController
::VROSC::FullScreenFxController*& VROSC::AppController::dyn__fullScreenFxController() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn__fullScreenFxController");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_fullScreenFxController"))->offset;
return *reinterpret_cast<::VROSC::FullScreenFxController**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.MicrophoneDeviceManager _microphoneDeviceManager
::VROSC::MicrophoneDeviceManager*& VROSC::AppController::dyn__microphoneDeviceManager() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn__microphoneDeviceManager");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_microphoneDeviceManager"))->offset;
return *reinterpret_cast<::VROSC::MicrophoneDeviceManager**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.IntroVideoPlayer _introVideoPlayer
::VROSC::IntroVideoPlayer*& VROSC::AppController::dyn__introVideoPlayer() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn__introVideoPlayer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_introVideoPlayer"))->offset;
return *reinterpret_cast<::VROSC::IntroVideoPlayer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.StateMachine _stateMachine
::VROSC::StateMachine*& VROSC::AppController::dyn__stateMachine() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn__stateMachine");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_stateMachine"))->offset;
return *reinterpret_cast<::VROSC::StateMachine**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.StartState _startState
::VROSC::StartState*& VROSC::AppController::dyn__startState() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn__startState");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_startState"))->offset;
return *reinterpret_cast<::VROSC::StartState**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.MainState _mainState
::VROSC::MainState*& VROSC::AppController::dyn__mainState() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn__mainState");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_mainState"))->offset;
return *reinterpret_cast<::VROSC::MainState**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean <IsPaused>k__BackingField
bool& VROSC::AppController::dyn_$IsPaused$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::dyn_$IsPaused$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<IsPaused>k__BackingField"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VROSC.AppController.get_SessionsLibraryWindow
::UnityEngine::GameObject* VROSC::AppController::get_SessionsLibraryWindow() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::get_SessionsLibraryWindow");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_SessionsLibraryWindow", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::UnityEngine::GameObject*, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController.get_FullScreenFxController
::VROSC::FullScreenFxController* VROSC::AppController::get_FullScreenFxController() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::get_FullScreenFxController");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_FullScreenFxController", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::VROSC::FullScreenFxController*, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController.get_IsPaused
bool VROSC::AppController::get_IsPaused() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::get_IsPaused");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsPaused", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController.set_IsPaused
void VROSC::AppController::set_IsPaused(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::set_IsPaused");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_IsPaused", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: VROSC.AppController.get_IsReady
bool VROSC::AppController::get_IsReady() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::get_IsReady");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsReady", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController.Awake
void VROSC::AppController::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController.Start
void VROSC::AppController::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController.OnDestroy
void VROSC::AppController::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::OnDestroy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController.Update
void VROSC::AppController::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController.InitializeApp
void VROSC::AppController::InitializeApp() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::InitializeApp");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "InitializeApp", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController.<Awake>g__Continue|25_0
::System::Func_1<bool>* VROSC::AppController::$Awake$g__Continue_25_0() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::<Awake>g__Continue|25_0");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "AppController", "<Awake>g__Continue|25_0", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Func_1<bool>*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: VROSC.AppController.<Awake>g__IsPlatformSelectorReady|25_1
::System::Func_1<bool>* VROSC::AppController::$Awake$g__IsPlatformSelectorReady_25_1() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::<Awake>g__IsPlatformSelectorReady|25_1");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "AppController", "<Awake>g__IsPlatformSelectorReady|25_1", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Func_1<bool>*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: VROSC.AppController.<Awake>g__IsMidiManagerReady|25_2
::System::Func_1<bool>* VROSC::AppController::$Awake$g__IsMidiManagerReady_25_2() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::<Awake>g__IsMidiManagerReady|25_2");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "AppController", "<Awake>g__IsMidiManagerReady|25_2", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Func_1<bool>*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: VROSC.AppController.<Awake>g__IsMicrophoneInitialized|25_3
::System::Func_1<bool>* VROSC::AppController::$Awake$g__IsMicrophoneInitialized_25_3() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::<Awake>g__IsMicrophoneInitialized|25_3");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Awake>g__IsMicrophoneInitialized|25_3", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Func_1<bool>*, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController.<Awake>b__25_11
bool VROSC::AppController::$Awake$b__25_11() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::<Awake>b__25_11");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Awake>b__25_11", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController.<Awake>g__IsLocalDataLoaded|25_4
::System::Func_1<bool>* VROSC::AppController::$Awake$g__IsLocalDataLoaded_25_4() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::<Awake>g__IsLocalDataLoaded|25_4");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "AppController", "<Awake>g__IsLocalDataLoaded|25_4", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Func_1<bool>*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: VROSC.AppController.<Awake>g__HasSplashVideoFinished|25_5
::System::Func_1<bool>* VROSC::AppController::$Awake$g__HasSplashVideoFinished_25_5() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::<Awake>g__HasSplashVideoFinished|25_5");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Awake>g__HasSplashVideoFinished|25_5", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Func_1<bool>*, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController.<Awake>b__25_13
bool VROSC::AppController::$Awake$b__25_13() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::<Awake>b__25_13");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Awake>b__25_13", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController.<Awake>g__IsAppValid|25_6
::System::Func_1<bool>* VROSC::AppController::$Awake$g__IsAppValid_25_6() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::<Awake>g__IsAppValid|25_6");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "AppController", "<Awake>g__IsAppValid|25_6", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Func_1<bool>*, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: VROSC.AppController.<Awake>g__IsScenesLoaded|25_7
::System::Func_1<bool>* VROSC::AppController::$Awake$g__IsScenesLoaded_25_7() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::<Awake>g__IsScenesLoaded|25_7");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Awake>g__IsScenesLoaded|25_7", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Func_1<bool>*, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController.<Awake>b__25_15
bool VROSC::AppController::$Awake$b__25_15() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::<Awake>b__25_15");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Awake>b__25_15", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VROSC.AppController/VROSC.<>c
#include "VROSC/AppController_--c.hpp"
// Including type: System.Func`1
#include "System/Func_1.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public readonly VROSC.AppController/VROSC.<>c <>9
::VROSC::AppController::$$c* VROSC::AppController::$$c::_get_$$9() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::_get_$$9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::VROSC::AppController::$$c*>("VROSC", "AppController/<>c", "<>9")));
}
// Autogenerated static field setter
// Set static field: static public readonly VROSC.AppController/VROSC.<>c <>9
void VROSC::AppController::$$c::_set_$$9(::VROSC::AppController::$$c* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::_set_$$9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("VROSC", "AppController/<>c", "<>9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`1<System.Boolean> <>9__25_8
::System::Func_1<bool>* VROSC::AppController::$$c::_get_$$9__25_8() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::_get_$$9__25_8");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_1<bool>*>("VROSC", "AppController/<>c", "<>9__25_8")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`1<System.Boolean> <>9__25_8
void VROSC::AppController::$$c::_set_$$9__25_8(::System::Func_1<bool>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::_set_$$9__25_8");
THROW_UNLESS((il2cpp_utils::SetFieldValue("VROSC", "AppController/<>c", "<>9__25_8", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`1<System.Boolean> <>9__25_9
::System::Func_1<bool>* VROSC::AppController::$$c::_get_$$9__25_9() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::_get_$$9__25_9");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_1<bool>*>("VROSC", "AppController/<>c", "<>9__25_9")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`1<System.Boolean> <>9__25_9
void VROSC::AppController::$$c::_set_$$9__25_9(::System::Func_1<bool>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::_set_$$9__25_9");
THROW_UNLESS((il2cpp_utils::SetFieldValue("VROSC", "AppController/<>c", "<>9__25_9", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`1<System.Boolean> <>9__25_10
::System::Func_1<bool>* VROSC::AppController::$$c::_get_$$9__25_10() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::_get_$$9__25_10");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_1<bool>*>("VROSC", "AppController/<>c", "<>9__25_10")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`1<System.Boolean> <>9__25_10
void VROSC::AppController::$$c::_set_$$9__25_10(::System::Func_1<bool>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::_set_$$9__25_10");
THROW_UNLESS((il2cpp_utils::SetFieldValue("VROSC", "AppController/<>c", "<>9__25_10", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`1<System.Boolean> <>9__25_12
::System::Func_1<bool>* VROSC::AppController::$$c::_get_$$9__25_12() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::_get_$$9__25_12");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_1<bool>*>("VROSC", "AppController/<>c", "<>9__25_12")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`1<System.Boolean> <>9__25_12
void VROSC::AppController::$$c::_set_$$9__25_12(::System::Func_1<bool>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::_set_$$9__25_12");
THROW_UNLESS((il2cpp_utils::SetFieldValue("VROSC", "AppController/<>c", "<>9__25_12", value)));
}
// Autogenerated static field getter
// Get static field: static public System.Func`1<System.Boolean> <>9__25_14
::System::Func_1<bool>* VROSC::AppController::$$c::_get_$$9__25_14() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::_get_$$9__25_14");
return THROW_UNLESS((il2cpp_utils::GetFieldValue<::System::Func_1<bool>*>("VROSC", "AppController/<>c", "<>9__25_14")));
}
// Autogenerated static field setter
// Set static field: static public System.Func`1<System.Boolean> <>9__25_14
void VROSC::AppController::$$c::_set_$$9__25_14(::System::Func_1<bool>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::_set_$$9__25_14");
THROW_UNLESS((il2cpp_utils::SetFieldValue("VROSC", "AppController/<>c", "<>9__25_14", value)));
}
// Autogenerated method: VROSC.AppController/VROSC.<>c..cctor
void VROSC::AppController::$$c::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "AppController/<>c", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated method: VROSC.AppController/VROSC.<>c.<Awake>b__25_8
bool VROSC::AppController::$$c::$Awake$b__25_8() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::<Awake>b__25_8");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Awake>b__25_8", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController/VROSC.<>c.<Awake>b__25_9
bool VROSC::AppController::$$c::$Awake$b__25_9() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::<Awake>b__25_9");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Awake>b__25_9", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController/VROSC.<>c.<Awake>b__25_10
bool VROSC::AppController::$$c::$Awake$b__25_10() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::<Awake>b__25_10");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Awake>b__25_10", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController/VROSC.<>c.<Awake>b__25_12
bool VROSC::AppController::$$c::$Awake$b__25_12() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::<Awake>b__25_12");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Awake>b__25_12", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppController/VROSC.<>c.<Awake>b__25_14
bool VROSC::AppController::$$c::$Awake$b__25_14() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppController::$$c::<Awake>b__25_14");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "<Awake>b__25_14", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VROSC.AppValidityChecker
#include "VROSC/AppValidityChecker.hpp"
// Including type: VROSC.AppValidityChecker/VROSC.ForceUpdates
#include "VROSC/AppValidityChecker_ForceUpdates.hpp"
// Including type: VROSC.AppValidityChecker/VROSC.<ForceUpdatesDataLoadFailure>d__19
#include "VROSC/AppValidityChecker_-ForceUpdatesDataLoadFailure-d__19.hpp"
// Including type: System.Action
#include "System/Action.hpp"
// Including type: System.Action`1
#include "System/Action_1.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.Int32 TimeoutRetries
int VROSC::AppValidityChecker::_get_TimeoutRetries() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::_get_TimeoutRetries");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("VROSC", "AppValidityChecker", "TimeoutRetries"));
}
// Autogenerated static field setter
// Set static field: static private System.Int32 TimeoutRetries
void VROSC::AppValidityChecker::_set_TimeoutRetries(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::_set_TimeoutRetries");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AppValidityChecker", "TimeoutRetries", value));
}
// Autogenerated static field getter
// Get static field: static private System.Action _onSuccessCallback
::System::Action* VROSC::AppValidityChecker::_get__onSuccessCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::_get__onSuccessCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Action*>("VROSC", "AppValidityChecker", "_onSuccessCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.Action _onSuccessCallback
void VROSC::AppValidityChecker::_set__onSuccessCallback(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::_set__onSuccessCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AppValidityChecker", "_onSuccessCallback", value));
}
// Autogenerated static field getter
// Get static field: static private System.Action`1<VROSC.Error> _onFailureCallback
::System::Action_1<::VROSC::Error>* VROSC::AppValidityChecker::_get__onFailureCallback() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::_get__onFailureCallback");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Action_1<::VROSC::Error>*>("VROSC", "AppValidityChecker", "_onFailureCallback"));
}
// Autogenerated static field setter
// Set static field: static private System.Action`1<VROSC.Error> _onFailureCallback
void VROSC::AppValidityChecker::_set__onFailureCallback(::System::Action_1<::VROSC::Error>* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::_set__onFailureCallback");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AppValidityChecker", "_onFailureCallback", value));
}
// Autogenerated instance field getter
// Get instance field: private VROSC.AppValidityChecker/VROSC.ForceUpdates ForceUpdatesData
::VROSC::AppValidityChecker::ForceUpdates*& VROSC::AppValidityChecker::dyn_ForceUpdatesData() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::dyn_ForceUpdatesData");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "ForceUpdatesData"))->offset;
return *reinterpret_cast<::VROSC::AppValidityChecker::ForceUpdates**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _isDataLoadAttempted
bool& VROSC::AppValidityChecker::dyn__isDataLoadAttempted() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::dyn__isDataLoadAttempted");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_isDataLoadAttempted"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Int32 _retries
int& VROSC::AppValidityChecker::dyn__retries() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::dyn__retries");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_retries"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean <IsForceUpdateDataLoaded>k__BackingField
bool& VROSC::AppValidityChecker::dyn_$IsForceUpdateDataLoaded$k__BackingField() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::dyn_$IsForceUpdateDataLoaded$k__BackingField");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<IsForceUpdateDataLoaded>k__BackingField"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VROSC.AppValidityChecker.get_EULATermsVersion
::StringW VROSC::AppValidityChecker::get_EULATermsVersion() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::get_EULATermsVersion");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_EULATermsVersion", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppValidityChecker.get_IsForceUpdateDataLoaded
bool VROSC::AppValidityChecker::get_IsForceUpdateDataLoaded() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::get_IsForceUpdateDataLoaded");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_IsForceUpdateDataLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppValidityChecker.set_IsForceUpdateDataLoaded
void VROSC::AppValidityChecker::set_IsForceUpdateDataLoaded(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::set_IsForceUpdateDataLoaded");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "set_IsForceUpdateDataLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(value)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, value);
}
// Autogenerated method: VROSC.AppValidityChecker.LoadData
void VROSC::AppValidityChecker::LoadData(::System::Action* onSuccess, ::System::Action_1<::VROSC::Error>* onFailure) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::LoadData");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LoadData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(onSuccess), ::il2cpp_utils::ExtractType(onFailure)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, onSuccess, onFailure);
}
// Autogenerated method: VROSC.AppValidityChecker.IsAppValid
bool VROSC::AppValidityChecker::IsAppValid() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::IsAppValid");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "IsAppValid", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppValidityChecker.HasUserAcceptedTerms
bool VROSC::AppValidityChecker::HasUserAcceptedTerms() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::HasUserAcceptedTerms");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "HasUserAcceptedTerms", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppValidityChecker.CanUserUseLibrary
bool VROSC::AppValidityChecker::CanUserUseLibrary() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::CanUserUseLibrary");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "CanUserUseLibrary", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppValidityChecker.ForceUpdatesDataLoadSuccess
void VROSC::AppValidityChecker::ForceUpdatesDataLoadSuccess(::StringW jsonData) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::ForceUpdatesDataLoadSuccess");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ForceUpdatesDataLoadSuccess", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(jsonData)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, jsonData);
}
// Autogenerated method: VROSC.AppValidityChecker.ForceUpdatesDataLoadFailure
void VROSC::AppValidityChecker::ForceUpdatesDataLoadFailure(::VROSC::Error error) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::ForceUpdatesDataLoadFailure");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ForceUpdatesDataLoadFailure", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(error)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, error);
}
// Autogenerated method: VROSC.AppValidityChecker.IsVersionCompatible
bool VROSC::AppValidityChecker::IsVersionCompatible(::StringW requiredVersion, ::StringW versionToCheck) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::IsVersionCompatible");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "IsVersionCompatible", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(requiredVersion), ::il2cpp_utils::ExtractType(versionToCheck)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, requiredVersion, versionToCheck);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VROSC.AppValidityChecker/VROSC.ForceUpdates
#include "VROSC/AppValidityChecker_ForceUpdates.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.String EULATermsVersion
::StringW& VROSC::AppValidityChecker::ForceUpdates::dyn_EULATermsVersion() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::ForceUpdates::dyn_EULATermsVersion");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "EULATermsVersion"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String MinVersionForApp
::StringW& VROSC::AppValidityChecker::ForceUpdates::dyn_MinVersionForApp() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::ForceUpdates::dyn_MinVersionForApp");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "MinVersionForApp"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.String MinVersionForLibrary
::StringW& VROSC::AppValidityChecker::ForceUpdates::dyn_MinVersionForLibrary() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::ForceUpdates::dyn_MinVersionForLibrary");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "MinVersionForLibrary"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VROSC.AppValidityChecker/VROSC.<ForceUpdatesDataLoadFailure>d__19
#include "VROSC/AppValidityChecker_-ForceUpdatesDataLoadFailure-d__19.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.Int32 <>1__state
int& VROSC::AppValidityChecker::$ForceUpdatesDataLoadFailure$d__19::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::$ForceUpdatesDataLoadFailure$d__19::dyn_$$1__state");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Runtime.CompilerServices.AsyncVoidMethodBuilder <>t__builder
::System::Runtime::CompilerServices::AsyncVoidMethodBuilder& VROSC::AppValidityChecker::$ForceUpdatesDataLoadFailure$d__19::dyn_$$t__builder() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::$ForceUpdatesDataLoadFailure$d__19::dyn_$$t__builder");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset;
return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncVoidMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public VROSC.Error error
::VROSC::Error& VROSC::AppValidityChecker::$ForceUpdatesDataLoadFailure$d__19::dyn_error() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::$ForceUpdatesDataLoadFailure$d__19::dyn_error");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "error"))->offset;
return *reinterpret_cast<::VROSC::Error*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public VROSC.AppValidityChecker <>4__this
::VROSC::AppValidityChecker*& VROSC::AppValidityChecker::$ForceUpdatesDataLoadFailure$d__19::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::$ForceUpdatesDataLoadFailure$d__19::dyn_$$4__this");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::VROSC::AppValidityChecker**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1
::System::Runtime::CompilerServices::TaskAwaiter& VROSC::AppValidityChecker::$ForceUpdatesDataLoadFailure$d__19::dyn_$$u__1() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::$ForceUpdatesDataLoadFailure$d__19::dyn_$$u__1");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset;
return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VROSC.AppValidityChecker/VROSC.<ForceUpdatesDataLoadFailure>d__19.MoveNext
void VROSC::AppValidityChecker::$ForceUpdatesDataLoadFailure$d__19::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::$ForceUpdatesDataLoadFailure$d__19::MoveNext");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "MoveNext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AppValidityChecker/VROSC.<ForceUpdatesDataLoadFailure>d__19.SetStateMachine
void VROSC::AppValidityChecker::$ForceUpdatesDataLoadFailure$d__19::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AppValidityChecker::$ForceUpdatesDataLoadFailure$d__19::SetStateMachine");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "SetStateMachine", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(stateMachine)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VROSC.AudioAnalyzer
#include "VROSC/AudioAnalyzer.hpp"
// Including type: UnityEngine.AudioSource
#include "UnityEngine/AudioSource.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.Single[] _monoMasterSamplesRaw
::ArrayW<float> VROSC::AudioAnalyzer::_get__monoMasterSamplesRaw() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_get__monoMasterSamplesRaw");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<float>>("VROSC", "AudioAnalyzer", "_monoMasterSamplesRaw"));
}
// Autogenerated static field setter
// Set static field: static private System.Single[] _monoMasterSamplesRaw
void VROSC::AudioAnalyzer::_set__monoMasterSamplesRaw(::ArrayW<float> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_set__monoMasterSamplesRaw");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioAnalyzer", "_monoMasterSamplesRaw", value));
}
// Autogenerated static field getter
// Get static field: static private System.Single[] _monoMasterSamplesNormalized
::ArrayW<float> VROSC::AudioAnalyzer::_get__monoMasterSamplesNormalized() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_get__monoMasterSamplesNormalized");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<float>>("VROSC", "AudioAnalyzer", "_monoMasterSamplesNormalized"));
}
// Autogenerated static field setter
// Set static field: static private System.Single[] _monoMasterSamplesNormalized
void VROSC::AudioAnalyzer::_set__monoMasterSamplesNormalized(::ArrayW<float> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_set__monoMasterSamplesNormalized");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioAnalyzer", "_monoMasterSamplesNormalized", value));
}
// Autogenerated static field getter
// Get static field: static private System.Single[] _monoMasterSamplesNormalizedSmoothed
::ArrayW<float> VROSC::AudioAnalyzer::_get__monoMasterSamplesNormalizedSmoothed() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_get__monoMasterSamplesNormalizedSmoothed");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<float>>("VROSC", "AudioAnalyzer", "_monoMasterSamplesNormalizedSmoothed"));
}
// Autogenerated static field setter
// Set static field: static private System.Single[] _monoMasterSamplesNormalizedSmoothed
void VROSC::AudioAnalyzer::_set__monoMasterSamplesNormalizedSmoothed(::ArrayW<float> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_set__monoMasterSamplesNormalizedSmoothed");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioAnalyzer", "_monoMasterSamplesNormalizedSmoothed", value));
}
// Autogenerated static field getter
// Get static field: static private System.Single[] _monoPlayingSamplesRaw
::ArrayW<float> VROSC::AudioAnalyzer::_get__monoPlayingSamplesRaw() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_get__monoPlayingSamplesRaw");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<float>>("VROSC", "AudioAnalyzer", "_monoPlayingSamplesRaw"));
}
// Autogenerated static field setter
// Set static field: static private System.Single[] _monoPlayingSamplesRaw
void VROSC::AudioAnalyzer::_set__monoPlayingSamplesRaw(::ArrayW<float> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_set__monoPlayingSamplesRaw");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioAnalyzer", "_monoPlayingSamplesRaw", value));
}
// Autogenerated static field getter
// Get static field: static private System.Single[] _monoPlayingSamplesNormalized
::ArrayW<float> VROSC::AudioAnalyzer::_get__monoPlayingSamplesNormalized() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_get__monoPlayingSamplesNormalized");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<float>>("VROSC", "AudioAnalyzer", "_monoPlayingSamplesNormalized"));
}
// Autogenerated static field setter
// Set static field: static private System.Single[] _monoPlayingSamplesNormalized
void VROSC::AudioAnalyzer::_set__monoPlayingSamplesNormalized(::ArrayW<float> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_set__monoPlayingSamplesNormalized");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioAnalyzer", "_monoPlayingSamplesNormalized", value));
}
// Autogenerated static field getter
// Get static field: static private System.Single[] _monoPlayingSamplesNormalizedSmoothed
::ArrayW<float> VROSC::AudioAnalyzer::_get__monoPlayingSamplesNormalizedSmoothed() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_get__monoPlayingSamplesNormalizedSmoothed");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<float>>("VROSC", "AudioAnalyzer", "_monoPlayingSamplesNormalizedSmoothed"));
}
// Autogenerated static field setter
// Set static field: static private System.Single[] _monoPlayingSamplesNormalizedSmoothed
void VROSC::AudioAnalyzer::_set__monoPlayingSamplesNormalizedSmoothed(::ArrayW<float> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_set__monoPlayingSamplesNormalizedSmoothed");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioAnalyzer", "_monoPlayingSamplesNormalizedSmoothed", value));
}
// Autogenerated static field getter
// Get static field: static public System.Int32 MaxVisualizerBands
int VROSC::AudioAnalyzer::_get_MaxVisualizerBands() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_get_MaxVisualizerBands");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<int>("VROSC", "AudioAnalyzer", "MaxVisualizerBands"));
}
// Autogenerated static field setter
// Set static field: static public System.Int32 MaxVisualizerBands
void VROSC::AudioAnalyzer::_set_MaxVisualizerBands(int value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_set_MaxVisualizerBands");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioAnalyzer", "MaxVisualizerBands", value));
}
// Autogenerated static field getter
// Get static field: static private System.Single[] _cachedBands
::ArrayW<float> VROSC::AudioAnalyzer::_get__cachedBands() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_get__cachedBands");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<float>>("VROSC", "AudioAnalyzer", "_cachedBands"));
}
// Autogenerated static field setter
// Set static field: static private System.Single[] _cachedBands
void VROSC::AudioAnalyzer::_set__cachedBands(::ArrayW<float> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_set__cachedBands");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioAnalyzer", "_cachedBands", value));
}
// Autogenerated static field getter
// Get static field: static private System.Single[] _cachedBandsPlaying
::ArrayW<float> VROSC::AudioAnalyzer::_get__cachedBandsPlaying() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_get__cachedBandsPlaying");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::ArrayW<float>>("VROSC", "AudioAnalyzer", "_cachedBandsPlaying"));
}
// Autogenerated static field setter
// Set static field: static private System.Single[] _cachedBandsPlaying
void VROSC::AudioAnalyzer::_set__cachedBandsPlaying(::ArrayW<float> value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_set__cachedBandsPlaying");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioAnalyzer", "_cachedBandsPlaying", value));
}
// Autogenerated static field getter
// Get static field: static private System.Boolean _hasCachedBands
bool VROSC::AudioAnalyzer::_get__hasCachedBands() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_get__hasCachedBands");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("VROSC", "AudioAnalyzer", "_hasCachedBands"));
}
// Autogenerated static field setter
// Set static field: static private System.Boolean _hasCachedBands
void VROSC::AudioAnalyzer::_set__hasCachedBands(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_set__hasCachedBands");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioAnalyzer", "_hasCachedBands", value));
}
// Autogenerated static field getter
// Get static field: static private System.Boolean _hasCachedBandsPlaying
bool VROSC::AudioAnalyzer::_get__hasCachedBandsPlaying() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_get__hasCachedBandsPlaying");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<bool>("VROSC", "AudioAnalyzer", "_hasCachedBandsPlaying"));
}
// Autogenerated static field setter
// Set static field: static private System.Boolean _hasCachedBandsPlaying
void VROSC::AudioAnalyzer::_set__hasCachedBandsPlaying(bool value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::_set__hasCachedBandsPlaying");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioAnalyzer", "_hasCachedBandsPlaying", value));
}
// Autogenerated instance field getter
// Get instance field: private System.Single[] _currentlyPlayingData
::ArrayW<float>& VROSC::AudioAnalyzer::dyn__currentlyPlayingData() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::dyn__currentlyPlayingData");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_currentlyPlayingData"))->offset;
return *reinterpret_cast<::ArrayW<float>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.AudioSource _currentlyPlayingAudioSource
::UnityEngine::AudioSource*& VROSC::AudioAnalyzer::dyn__currentlyPlayingAudioSource() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::dyn__currentlyPlayingAudioSource");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_currentlyPlayingAudioSource"))->offset;
return *reinterpret_cast<::UnityEngine::AudioSource**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.FFTWindow _fftWindow
::UnityEngine::FFTWindow& VROSC::AudioAnalyzer::dyn__fftWindow() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::dyn__fftWindow");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_fftWindow"))->offset;
return *reinterpret_cast<::UnityEngine::FFTWindow*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single[] _leftMasterSamplesRaw
::ArrayW<float>& VROSC::AudioAnalyzer::dyn__leftMasterSamplesRaw() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::dyn__leftMasterSamplesRaw");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_leftMasterSamplesRaw"))->offset;
return *reinterpret_cast<::ArrayW<float>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single[] _rightMasterSamplesRaw
::ArrayW<float>& VROSC::AudioAnalyzer::dyn__rightMasterSamplesRaw() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::dyn__rightMasterSamplesRaw");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_rightMasterSamplesRaw"))->offset;
return *reinterpret_cast<::ArrayW<float>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single[] _leftPlayingSamplesRaw
::ArrayW<float>& VROSC::AudioAnalyzer::dyn__leftPlayingSamplesRaw() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::dyn__leftPlayingSamplesRaw");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_leftPlayingSamplesRaw"))->offset;
return *reinterpret_cast<::ArrayW<float>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single[] _rightPlayingSamplesRaw
::ArrayW<float>& VROSC::AudioAnalyzer::dyn__rightPlayingSamplesRaw() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::dyn__rightPlayingSamplesRaw");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_rightPlayingSamplesRaw"))->offset;
return *reinterpret_cast<::ArrayW<float>*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _normalizeFloor
float& VROSC::AudioAnalyzer::dyn__normalizeFloor() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::dyn__normalizeFloor");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_normalizeFloor"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _normalizeCeiling
float& VROSC::AudioAnalyzer::dyn__normalizeCeiling() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::dyn__normalizeCeiling");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_normalizeCeiling"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Single _smoothingSpeed
float& VROSC::AudioAnalyzer::dyn__smoothingSpeed() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::dyn__smoothingSpeed");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_smoothingSpeed"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _masterIsMono
bool& VROSC::AudioAnalyzer::dyn__masterIsMono() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::dyn__masterIsMono");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_masterIsMono"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VROSC.AudioAnalyzer.RoutingDemo_GetData
void VROSC::AudioAnalyzer::RoutingDemo_GetData(int target, ::ArrayW<float> data, int numsamples, int numchannels) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::RoutingDemo_GetData");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "AudioAnalyzer", "RoutingDemo_GetData", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(target), ::il2cpp_utils::ExtractType(data), ::il2cpp_utils::ExtractType(numsamples), ::il2cpp_utils::ExtractType(numchannels)})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, target, data, numsamples, numchannels);
}
// Autogenerated method: VROSC.AudioAnalyzer.Start
void VROSC::AudioAnalyzer::Start() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::Start");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Start", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AudioAnalyzer.Update
void VROSC::AudioAnalyzer::Update() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::Update");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Update", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AudioAnalyzer.GetSpectrumAudioSource
void VROSC::AudioAnalyzer::GetSpectrumAudioSource() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::GetSpectrumAudioSource");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetSpectrumAudioSource", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AudioAnalyzer.Normalize
float VROSC::AudioAnalyzer::Normalize(float rawValue) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::Normalize");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Normalize", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(rawValue)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, rawValue);
}
// Autogenerated method: VROSC.AudioAnalyzer.Smooth
float VROSC::AudioAnalyzer::Smooth(float newValue, float oldValue) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::Smooth");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Smooth", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(newValue), ::il2cpp_utils::ExtractType(oldValue)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, newValue, oldValue);
}
// Autogenerated method: VROSC.AudioAnalyzer.GetAmplitude
float VROSC::AudioAnalyzer::GetAmplitude(float minFrequency, float maxFrequency, bool currentlyPlayingOnly, bool usePeakInsteadOfAverage, bool smoothed) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::GetAmplitude");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "AudioAnalyzer", "GetAmplitude", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(minFrequency), ::il2cpp_utils::ExtractType(maxFrequency), ::il2cpp_utils::ExtractType(currentlyPlayingOnly), ::il2cpp_utils::ExtractType(usePeakInsteadOfAverage), ::il2cpp_utils::ExtractType(smoothed)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, minFrequency, maxFrequency, currentlyPlayingOnly, usePeakInsteadOfAverage, smoothed);
}
// Autogenerated method: VROSC.AudioAnalyzer.GetAmplitude
float VROSC::AudioAnalyzer::GetAmplitude(::ArrayW<float> samples, float minFrequency, float maxFrequency, bool usePeakInsteadOfAverage) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::GetAmplitude");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "AudioAnalyzer", "GetAmplitude", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(samples), ::il2cpp_utils::ExtractType(minFrequency), ::il2cpp_utils::ExtractType(maxFrequency), ::il2cpp_utils::ExtractType(usePeakInsteadOfAverage)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, samples, minFrequency, maxFrequency, usePeakInsteadOfAverage);
}
// Autogenerated method: VROSC.AudioAnalyzer.GetBands
::ArrayW<float> VROSC::AudioAnalyzer::GetBands(int numberOfBands, bool currentPlayingOnly) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::GetBands");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "AudioAnalyzer", "GetBands", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(numberOfBands), ::il2cpp_utils::ExtractType(currentPlayingOnly)})));
return ::il2cpp_utils::RunMethodRethrow<::ArrayW<float>, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, numberOfBands, currentPlayingOnly);
}
// Autogenerated method: VROSC.AudioAnalyzer.FrequencyToSpectrumIndex
int VROSC::AudioAnalyzer::FrequencyToSpectrumIndex(float frequency) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::FrequencyToSpectrumIndex");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "AudioAnalyzer", "FrequencyToSpectrumIndex", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(frequency)})));
return ::il2cpp_utils::RunMethodRethrow<int, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, frequency);
}
// Autogenerated method: VROSC.AudioAnalyzer.SpectrumIndexToFrequency
float VROSC::AudioAnalyzer::SpectrumIndexToFrequency(int index) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::SpectrumIndexToFrequency");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "AudioAnalyzer", "SpectrumIndexToFrequency", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(index)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, index);
}
// Autogenerated method: VROSC.AudioAnalyzer.OnAudioFilterRead
void VROSC::AudioAnalyzer::OnAudioFilterRead(::ArrayW<float> data, int channels) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::OnAudioFilterRead");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnAudioFilterRead", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(data), ::il2cpp_utils::ExtractType(channels)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, data, channels);
}
// Autogenerated method: VROSC.AudioAnalyzer..cctor
void VROSC::AudioAnalyzer::_cctor() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioAnalyzer::.cctor");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "AudioAnalyzer", ".cctor", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VROSC.ArpeggiatorWrapper
#include "VROSC/ArpeggiatorWrapper.hpp"
// Including type: VROSC.ArpeggiatorWrapper/VROSC.Pattern
#include "VROSC/ArpeggiatorWrapper_Pattern.hpp"
// Including type: VROSC.UISpinner
#include "VROSC/UISpinner.hpp"
// Including type: VROSC.UISlider
#include "VROSC/UISlider.hpp"
// Including type: VROSC.UISlideToggle
#include "VROSC/UISlideToggle.hpp"
// Including type: VROSC.InternalSynthesizer
#include "VROSC/InternalSynthesizer.hpp"
// Including type: VROSC.InstrumentController
#include "VROSC/InstrumentController.hpp"
// Including type: VROSC.InputDevice
#include "VROSC/InputDevice.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private VROSC.UISpinner _tempo
::VROSC::UISpinner*& VROSC::ArpeggiatorWrapper::dyn__tempo() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::dyn__tempo");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_tempo"))->offset;
return *reinterpret_cast<::VROSC::UISpinner**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UISpinner _octaves
::VROSC::UISpinner*& VROSC::ArpeggiatorWrapper::dyn__octaves() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::dyn__octaves");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_octaves"))->offset;
return *reinterpret_cast<::VROSC::UISpinner**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UISpinner _pattern
::VROSC::UISpinner*& VROSC::ArpeggiatorWrapper::dyn__pattern() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::dyn__pattern");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_pattern"))->offset;
return *reinterpret_cast<::VROSC::UISpinner**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UISlider _gateSlider
::VROSC::UISlider*& VROSC::ArpeggiatorWrapper::dyn__gateSlider() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::dyn__gateSlider");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_gateSlider"))->offset;
return *reinterpret_cast<::VROSC::UISlider**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.UISlideToggle _onOffButton
::VROSC::UISlideToggle*& VROSC::ArpeggiatorWrapper::dyn__onOffButton() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::dyn__onOffButton");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_onOffButton"))->offset;
return *reinterpret_cast<::VROSC::UISlideToggle**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.InternalSynthesizer _internalSynthesizer
::VROSC::InternalSynthesizer*& VROSC::ArpeggiatorWrapper::dyn__internalSynthesizer() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::dyn__internalSynthesizer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_internalSynthesizer"))->offset;
return *reinterpret_cast<::VROSC::InternalSynthesizer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.InstrumentController _instrument
::VROSC::InstrumentController*& VROSC::ArpeggiatorWrapper::dyn__instrument() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::dyn__instrument");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_instrument"))->offset;
return *reinterpret_cast<::VROSC::InstrumentController**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.Setup
void VROSC::ArpeggiatorWrapper::Setup(::VROSC::InstrumentController* instrument) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::Setup");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(instrument)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, instrument);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.OnEnable
void VROSC::ArpeggiatorWrapper::OnEnable() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::OnEnable");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnEnable", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.ResetArpeggiator
void VROSC::ArpeggiatorWrapper::ResetArpeggiator() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::ResetArpeggiator");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ResetArpeggiator", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.LoadPatchValues
void VROSC::ArpeggiatorWrapper::LoadPatchValues() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::LoadPatchValues");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LoadPatchValues", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.UpdateEnableState
void VROSC::ArpeggiatorWrapper::UpdateEnableState() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::UpdateEnableState");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateEnableState", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.ChangeTempo
void VROSC::ArpeggiatorWrapper::ChangeTempo(int frequency) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::ChangeTempo");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ChangeTempo", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(frequency)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, frequency);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.UpdateTempoAndDisplay
void VROSC::ArpeggiatorWrapper::UpdateTempoAndDisplay(int frequency) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::UpdateTempoAndDisplay");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateTempoAndDisplay", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(frequency)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, frequency);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.ChangeGate
void VROSC::ArpeggiatorWrapper::ChangeGate(float gate) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::ChangeGate");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ChangeGate", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(gate)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, gate);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.UpdateGateAndDisplay
void VROSC::ArpeggiatorWrapper::UpdateGateAndDisplay(float gate) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::UpdateGateAndDisplay");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateGateAndDisplay", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(gate)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, gate);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.ChangeOctaves
void VROSC::ArpeggiatorWrapper::ChangeOctaves(int octaves) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::ChangeOctaves");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ChangeOctaves", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(octaves)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, octaves);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.UpdateOctavesAndDisplay
void VROSC::ArpeggiatorWrapper::UpdateOctavesAndDisplay(int octaves) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::UpdateOctavesAndDisplay");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdateOctavesAndDisplay", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(octaves)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, octaves);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.ChangePattern
void VROSC::ArpeggiatorWrapper::ChangePattern(int pattern) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::ChangePattern");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ChangePattern", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pattern)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, pattern);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.UpdatePatternAndDisplay
void VROSC::ArpeggiatorWrapper::UpdatePatternAndDisplay(int pattern) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::UpdatePatternAndDisplay");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UpdatePatternAndDisplay", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pattern)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, pattern);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.ToggleArpeggiator
void VROSC::ArpeggiatorWrapper::ToggleArpeggiator(::VROSC::InputDevice* device, bool isOn) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::ToggleArpeggiator");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ToggleArpeggiator", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(device), ::il2cpp_utils::ExtractType(isOn)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, device, isOn);
}
// Autogenerated method: VROSC.ArpeggiatorWrapper.OnDestroy
void VROSC::ArpeggiatorWrapper::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::OnDestroy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VROSC.ArpeggiatorWrapper/VROSC.Pattern
#include "VROSC/ArpeggiatorWrapper_Pattern.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public VROSC.ArpeggiatorWrapper/VROSC.Pattern Up
::VROSC::ArpeggiatorWrapper::Pattern VROSC::ArpeggiatorWrapper::Pattern::_get_Up() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::Pattern::_get_Up");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::VROSC::ArpeggiatorWrapper::Pattern>("VROSC", "ArpeggiatorWrapper/Pattern", "Up"));
}
// Autogenerated static field setter
// Set static field: static public VROSC.ArpeggiatorWrapper/VROSC.Pattern Up
void VROSC::ArpeggiatorWrapper::Pattern::_set_Up(::VROSC::ArpeggiatorWrapper::Pattern value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::Pattern::_set_Up");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "ArpeggiatorWrapper/Pattern", "Up", value));
}
// Autogenerated static field getter
// Get static field: static public VROSC.ArpeggiatorWrapper/VROSC.Pattern Down
::VROSC::ArpeggiatorWrapper::Pattern VROSC::ArpeggiatorWrapper::Pattern::_get_Down() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::Pattern::_get_Down");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::VROSC::ArpeggiatorWrapper::Pattern>("VROSC", "ArpeggiatorWrapper/Pattern", "Down"));
}
// Autogenerated static field setter
// Set static field: static public VROSC.ArpeggiatorWrapper/VROSC.Pattern Down
void VROSC::ArpeggiatorWrapper::Pattern::_set_Down(::VROSC::ArpeggiatorWrapper::Pattern value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::Pattern::_set_Down");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "ArpeggiatorWrapper/Pattern", "Down", value));
}
// Autogenerated static field getter
// Get static field: static public VROSC.ArpeggiatorWrapper/VROSC.Pattern UpDown
::VROSC::ArpeggiatorWrapper::Pattern VROSC::ArpeggiatorWrapper::Pattern::_get_UpDown() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::Pattern::_get_UpDown");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::VROSC::ArpeggiatorWrapper::Pattern>("VROSC", "ArpeggiatorWrapper/Pattern", "UpDown"));
}
// Autogenerated static field setter
// Set static field: static public VROSC.ArpeggiatorWrapper/VROSC.Pattern UpDown
void VROSC::ArpeggiatorWrapper::Pattern::_set_UpDown(::VROSC::ArpeggiatorWrapper::Pattern value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::Pattern::_set_UpDown");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "ArpeggiatorWrapper/Pattern", "UpDown", value));
}
// Autogenerated static field getter
// Get static field: static public VROSC.ArpeggiatorWrapper/VROSC.Pattern AsPlayed
::VROSC::ArpeggiatorWrapper::Pattern VROSC::ArpeggiatorWrapper::Pattern::_get_AsPlayed() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::Pattern::_get_AsPlayed");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::VROSC::ArpeggiatorWrapper::Pattern>("VROSC", "ArpeggiatorWrapper/Pattern", "AsPlayed"));
}
// Autogenerated static field setter
// Set static field: static public VROSC.ArpeggiatorWrapper/VROSC.Pattern AsPlayed
void VROSC::ArpeggiatorWrapper::Pattern::_set_AsPlayed(::VROSC::ArpeggiatorWrapper::Pattern value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::Pattern::_set_AsPlayed");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "ArpeggiatorWrapper/Pattern", "AsPlayed", value));
}
// Autogenerated static field getter
// Get static field: static public VROSC.ArpeggiatorWrapper/VROSC.Pattern Random
::VROSC::ArpeggiatorWrapper::Pattern VROSC::ArpeggiatorWrapper::Pattern::_get_Random() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::Pattern::_get_Random");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::VROSC::ArpeggiatorWrapper::Pattern>("VROSC", "ArpeggiatorWrapper/Pattern", "Random"));
}
// Autogenerated static field setter
// Set static field: static public VROSC.ArpeggiatorWrapper/VROSC.Pattern Random
void VROSC::ArpeggiatorWrapper::Pattern::_set_Random(::VROSC::ArpeggiatorWrapper::Pattern value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::Pattern::_set_Random");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "ArpeggiatorWrapper/Pattern", "Random", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& VROSC::ArpeggiatorWrapper::Pattern::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::ArpeggiatorWrapper::Pattern::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VROSC.AudioHelmInstrumentWrapper
#include "VROSC/AudioHelmInstrumentWrapper.hpp"
// Including type: VROSC.InternalSynthesizer
#include "VROSC/InternalSynthesizer.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated method: VROSC.AudioHelmInstrumentWrapper.Setup
void VROSC::AudioHelmInstrumentWrapper::Setup(::VROSC::InternalSynthesizer* internalSynthesizer) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioHelmInstrumentWrapper::Setup");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(internalSynthesizer)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, internalSynthesizer);
}
// Autogenerated method: VROSC.AudioHelmInstrumentWrapper.NoteOn
void VROSC::AudioHelmInstrumentWrapper::NoteOn(int note, float velocity, double predictedDspTime, float pitch) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioHelmInstrumentWrapper::NoteOn");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "NoteOn", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(note), ::il2cpp_utils::ExtractType(velocity), ::il2cpp_utils::ExtractType(predictedDspTime), ::il2cpp_utils::ExtractType(pitch)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, note, velocity, predictedDspTime, pitch);
}
// Autogenerated method: VROSC.AudioHelmInstrumentWrapper.NoteOff
void VROSC::AudioHelmInstrumentWrapper::NoteOff(int note) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioHelmInstrumentWrapper::NoteOff");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "NoteOff", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(note)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, note);
}
// Autogenerated method: VROSC.AudioHelmInstrumentWrapper.AllNotesOff
void VROSC::AudioHelmInstrumentWrapper::AllNotesOff() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioHelmInstrumentWrapper::AllNotesOff");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AllNotesOff", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AudioHelmInstrumentWrapper.SetMidiCC
void VROSC::AudioHelmInstrumentWrapper::SetMidiCC(float midiCCValue, int midiCC) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioHelmInstrumentWrapper::SetMidiCC");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetMidiCC", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(midiCCValue), ::il2cpp_utils::ExtractType(midiCC)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, midiCCValue, midiCC);
}
// Autogenerated method: VROSC.AudioHelmInstrumentWrapper.SetPitchBend
void VROSC::AudioHelmInstrumentWrapper::SetPitchBend(float pitchBendValue) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioHelmInstrumentWrapper::SetPitchBend");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetPitchBend", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pitchBendValue)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, pitchBendValue);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VROSC.HelmWrapper
#include "VROSC/HelmWrapper.hpp"
// Including type: AudioHelm.HelmController
#include "AudioHelm/HelmController.hpp"
// Including type: AudioHelm.HelmPatch
#include "AudioHelm/HelmPatch.hpp"
// Including type: VROSC.PatchSettings
#include "VROSC/PatchSettings.hpp"
// Including type: AudioHelm.HelmPatchFormat
#include "AudioHelm/HelmPatchFormat.hpp"
// Including type: AudioHelm.Param
#include "AudioHelm/Param.hpp"
// Including type: VROSC.InternalSynthesizer
#include "VROSC/InternalSynthesizer.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private AudioHelm.HelmController _helmController
::AudioHelm::HelmController*& VROSC::HelmWrapper::dyn__helmController() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::dyn__helmController");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_helmController"))->offset;
return *reinterpret_cast<::AudioHelm::HelmController**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private AudioHelm.HelmPatch _helmPatch
::AudioHelm::HelmPatch*& VROSC::HelmWrapper::dyn__helmPatch() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::dyn__helmPatch");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_helmPatch"))->offset;
return *reinterpret_cast<::AudioHelm::HelmPatch**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.PatchSettings _patchSettings
::VROSC::PatchSettings*& VROSC::HelmWrapper::dyn__patchSettings() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::dyn__patchSettings");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_patchSettings"))->offset;
return *reinterpret_cast<::VROSC::PatchSettings**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VROSC.HelmWrapper.get_CurrentPatch
::AudioHelm::HelmPatchFormat* VROSC::HelmWrapper::get_CurrentPatch() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::get_CurrentPatch");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "get_CurrentPatch", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::AudioHelm::HelmPatchFormat*, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.HelmWrapper.LoadPatch
void VROSC::HelmWrapper::LoadPatch(::VROSC::PatchSettings* patchSettings) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::LoadPatch");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LoadPatch", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(patchSettings)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, patchSettings);
}
// Autogenerated method: VROSC.HelmWrapper.ApplyGlobalOverloadSettings
void VROSC::HelmWrapper::ApplyGlobalOverloadSettings() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::ApplyGlobalOverloadSettings");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ApplyGlobalOverloadSettings", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.HelmWrapper.SetParameterValue
void VROSC::HelmWrapper::SetParameterValue(::AudioHelm::Param parameter, float newValue) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::SetParameterValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetParameterValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parameter), ::il2cpp_utils::ExtractType(newValue)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, parameter, newValue);
}
// Autogenerated method: VROSC.HelmWrapper.SetParameterPercent
void VROSC::HelmWrapper::SetParameterPercent(::AudioHelm::Param parameter, float newValue) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::SetParameterPercent");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetParameterPercent", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parameter), ::il2cpp_utils::ExtractType(newValue)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, parameter, newValue);
}
// Autogenerated method: VROSC.HelmWrapper.IsPlaying
bool VROSC::HelmWrapper::IsPlaying() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::IsPlaying");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "IsPlaying", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.HelmWrapper.UsesPatch
bool VROSC::HelmWrapper::UsesPatch(::VROSC::PatchSettings* patchSettings) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::UsesPatch");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UsesPatch", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(patchSettings)})));
return ::il2cpp_utils::RunMethodRethrow<bool, false>(this, ___internal__method, patchSettings);
}
// Autogenerated method: VROSC.HelmWrapper.Setup
void VROSC::HelmWrapper::Setup(::VROSC::InternalSynthesizer* internalSynthesizer) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::Setup");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(internalSynthesizer)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, internalSynthesizer);
}
// Autogenerated method: VROSC.HelmWrapper.AllNotesOff
void VROSC::HelmWrapper::AllNotesOff() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::AllNotesOff");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AllNotesOff", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.HelmWrapper.NoteOff
void VROSC::HelmWrapper::NoteOff(int note) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::NoteOff");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "NoteOff", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(note)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, note);
}
// Autogenerated method: VROSC.HelmWrapper.NoteOn
void VROSC::HelmWrapper::NoteOn(int note, float velocity, double predictedDspTime, float pitch) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::NoteOn");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "NoteOn", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(note), ::il2cpp_utils::ExtractType(velocity), ::il2cpp_utils::ExtractType(predictedDspTime), ::il2cpp_utils::ExtractType(pitch)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, note, velocity, predictedDspTime, pitch);
}
// Autogenerated method: VROSC.HelmWrapper.SetMidiCC
void VROSC::HelmWrapper::SetMidiCC(float midiCCValue, int midiCC) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::SetMidiCC");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetMidiCC", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(midiCCValue), ::il2cpp_utils::ExtractType(midiCC)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, midiCCValue, midiCC);
}
// Autogenerated method: VROSC.HelmWrapper.SetPitchBend
void VROSC::HelmWrapper::SetPitchBend(float pitchBendValue) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::HelmWrapper::SetPitchBend");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetPitchBend", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pitchBendValue)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, pitchBendValue);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VROSC.SoundSource
#include "VROSC/SoundSource.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public VROSC.SoundSource None
::VROSC::SoundSource VROSC::SoundSource::_get_None() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SoundSource::_get_None");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::VROSC::SoundSource>("VROSC", "SoundSource", "None"));
}
// Autogenerated static field setter
// Set static field: static public VROSC.SoundSource None
void VROSC::SoundSource::_set_None(::VROSC::SoundSource value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SoundSource::_set_None");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "SoundSource", "None", value));
}
// Autogenerated static field getter
// Get static field: static public VROSC.SoundSource Helm
::VROSC::SoundSource VROSC::SoundSource::_get_Helm() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SoundSource::_get_Helm");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::VROSC::SoundSource>("VROSC", "SoundSource", "Helm"));
}
// Autogenerated static field setter
// Set static field: static public VROSC.SoundSource Helm
void VROSC::SoundSource::_set_Helm(::VROSC::SoundSource value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SoundSource::_set_Helm");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "SoundSource", "Helm", value));
}
// Autogenerated static field getter
// Get static field: static public VROSC.SoundSource Drums
::VROSC::SoundSource VROSC::SoundSource::_get_Drums() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SoundSource::_get_Drums");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::VROSC::SoundSource>("VROSC", "SoundSource", "Drums"));
}
// Autogenerated static field setter
// Set static field: static public VROSC.SoundSource Drums
void VROSC::SoundSource::_set_Drums(::VROSC::SoundSource value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SoundSource::_set_Drums");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "SoundSource", "Drums", value));
}
// Autogenerated static field getter
// Get static field: static public VROSC.SoundSource Microphone
::VROSC::SoundSource VROSC::SoundSource::_get_Microphone() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SoundSource::_get_Microphone");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::VROSC::SoundSource>("VROSC", "SoundSource", "Microphone"));
}
// Autogenerated static field setter
// Set static field: static public VROSC.SoundSource Microphone
void VROSC::SoundSource::_set_Microphone(::VROSC::SoundSource value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SoundSource::_set_Microphone");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "SoundSource", "Microphone", value));
}
// Autogenerated static field getter
// Get static field: static public VROSC.SoundSource Master
::VROSC::SoundSource VROSC::SoundSource::_get_Master() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SoundSource::_get_Master");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::VROSC::SoundSource>("VROSC", "SoundSource", "Master"));
}
// Autogenerated static field setter
// Set static field: static public VROSC.SoundSource Master
void VROSC::SoundSource::_set_Master(::VROSC::SoundSource value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SoundSource::_set_Master");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "SoundSource", "Master", value));
}
// Autogenerated instance field getter
// Get instance field: public System.Int32 value__
int& VROSC::SoundSource::dyn_value__() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SoundSource::dyn_value__");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "value__"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: VROSC.InternalSynthesizer
#include "VROSC/InternalSynthesizer.hpp"
// Including type: VROSC.InternalSynthesizer/VROSC.<Setup>d__9
#include "VROSC/InternalSynthesizer_-Setup-d__9.hpp"
// Including type: AudioHelm.AudioHelmClock
#include "AudioHelm/AudioHelmClock.hpp"
// Including type: VROSC.VirtuosoSampler
#include "VROSC/VirtuosoSampler.hpp"
// Including type: VROSC.HelmWrapper
#include "VROSC/HelmWrapper.hpp"
// Including type: System.Action
#include "System/Action.hpp"
// Including type: System.Threading.Tasks.Task
#include "System/Threading/Tasks/Task.hpp"
// Including type: VROSC.PatchSettings
#include "VROSC/PatchSettings.hpp"
// Including type: VROSC.HandType
#include "VROSC/HandType.hpp"
// Including type: AudioHelm.Param
#include "AudioHelm/Param.hpp"
// Including type: VROSC.AudioHelmInstrumentWrapper
#include "VROSC/AudioHelmInstrumentWrapper.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static public System.Action OnActivePatchChanged
::System::Action* VROSC::InternalSynthesizer::_get_OnActivePatchChanged() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::_get_OnActivePatchChanged");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::System::Action*>("VROSC", "InternalSynthesizer", "OnActivePatchChanged"));
}
// Autogenerated static field setter
// Set static field: static public System.Action OnActivePatchChanged
void VROSC::InternalSynthesizer::_set_OnActivePatchChanged(::System::Action* value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::_set_OnActivePatchChanged");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "InternalSynthesizer", "OnActivePatchChanged", value));
}
// Autogenerated instance field getter
// Get instance field: private AudioHelm.AudioHelmClock _audioHelmClock
::AudioHelm::AudioHelmClock*& VROSC::InternalSynthesizer::dyn__audioHelmClock() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::dyn__audioHelmClock");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_audioHelmClock"))->offset;
return *reinterpret_cast<::AudioHelm::AudioHelmClock**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.VirtuosoSampler _sampler
::VROSC::VirtuosoSampler*& VROSC::InternalSynthesizer::dyn__sampler() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::dyn__sampler");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_sampler"))->offset;
return *reinterpret_cast<::VROSC::VirtuosoSampler**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.HelmWrapper _leftHelm
::VROSC::HelmWrapper*& VROSC::InternalSynthesizer::dyn__leftHelm() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::dyn__leftHelm");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_leftHelm"))->offset;
return *reinterpret_cast<::VROSC::HelmWrapper**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.HelmWrapper _rightHelm
::VROSC::HelmWrapper*& VROSC::InternalSynthesizer::dyn__rightHelm() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::dyn__rightHelm");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_rightHelm"))->offset;
return *reinterpret_cast<::VROSC::HelmWrapper**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.HelmWrapper _activeHelm
::VROSC::HelmWrapper*& VROSC::InternalSynthesizer::dyn__activeHelm() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::dyn__activeHelm");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_activeHelm"))->offset;
return *reinterpret_cast<::VROSC::HelmWrapper**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.SoundSource _currentSoundSource
::VROSC::SoundSource& VROSC::InternalSynthesizer::dyn__currentSoundSource() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::dyn__currentSoundSource");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_currentSoundSource"))->offset;
return *reinterpret_cast<::VROSC::SoundSource*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.WidgetSettings/VROSC.Identifier _currentInstrumentId
::VROSC::WidgetSettings::Identifier& VROSC::InternalSynthesizer::dyn__currentInstrumentId() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::dyn__currentInstrumentId");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_currentInstrumentId"))->offset;
return *reinterpret_cast<::VROSC::WidgetSettings::Identifier*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _patchSet
bool& VROSC::InternalSynthesizer::dyn__patchSet() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::dyn__patchSet");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_patchSet"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VROSC.InternalSynthesizer.Setup
::System::Threading::Tasks::Task* VROSC::InternalSynthesizer::Setup() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::Setup");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::System::Threading::Tasks::Task*, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.InternalSynthesizer.PlayNote
void VROSC::InternalSynthesizer::PlayNote(::VROSC::WidgetSettings::Identifier instrumentId, int note, float velocity, ::VROSC::PatchSettings* patchSettings, double predictedDspTime, ::VROSC::HandType handType, float pitch) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::PlayNote");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "PlayNote", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(instrumentId), ::il2cpp_utils::ExtractType(note), ::il2cpp_utils::ExtractType(velocity), ::il2cpp_utils::ExtractType(patchSettings), ::il2cpp_utils::ExtractType(predictedDspTime), ::il2cpp_utils::ExtractType(handType), ::il2cpp_utils::ExtractType(pitch)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, instrumentId, note, velocity, patchSettings, predictedDspTime, handType, pitch);
}
// Autogenerated method: VROSC.InternalSynthesizer.StopNote
void VROSC::InternalSynthesizer::StopNote(int note, ::VROSC::PatchSettings* patchSettings, ::VROSC::HandType handType) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::StopNote");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "StopNote", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(note), ::il2cpp_utils::ExtractType(patchSettings), ::il2cpp_utils::ExtractType(handType)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, note, patchSettings, handType);
}
// Autogenerated method: VROSC.InternalSynthesizer.SetMidiCC
void VROSC::InternalSynthesizer::SetMidiCC(float midiCCValue, int midiCC, ::VROSC::PatchSettings* patchSettings, ::VROSC::HandType handType, bool saveToPatch) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::SetMidiCC");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetMidiCC", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(midiCCValue), ::il2cpp_utils::ExtractType(midiCC), ::il2cpp_utils::ExtractType(patchSettings), ::il2cpp_utils::ExtractType(handType), ::il2cpp_utils::ExtractType(saveToPatch)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, midiCCValue, midiCC, patchSettings, handType, saveToPatch);
}
// Autogenerated method: VROSC.InternalSynthesizer.SetPitchBend
void VROSC::InternalSynthesizer::SetPitchBend(float pitchBendValue, ::VROSC::PatchSettings* patchSettings, ::VROSC::HandType handType) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::SetPitchBend");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetPitchBend", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pitchBendValue), ::il2cpp_utils::ExtractType(patchSettings), ::il2cpp_utils::ExtractType(handType)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, pitchBendValue, patchSettings, handType);
}
// Autogenerated method: VROSC.InternalSynthesizer.SetHelmParameterValue
void VROSC::InternalSynthesizer::SetHelmParameterValue(::VROSC::PatchSettings* patchSettings, ::AudioHelm::Param parameter, float newValue, ::VROSC::HandType handType, bool saveToPatch) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::SetHelmParameterValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetHelmParameterValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(patchSettings), ::il2cpp_utils::ExtractType(parameter), ::il2cpp_utils::ExtractType(newValue), ::il2cpp_utils::ExtractType(handType), ::il2cpp_utils::ExtractType(saveToPatch)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, patchSettings, parameter, newValue, handType, saveToPatch);
}
// Autogenerated method: VROSC.InternalSynthesizer.SetHelmParameterPercent
void VROSC::InternalSynthesizer::SetHelmParameterPercent(::VROSC::PatchSettings* patchSettings, ::AudioHelm::Param parameter, float newValue, ::VROSC::HandType handType, bool saveToPatch) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::SetHelmParameterPercent");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetHelmParameterPercent", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(patchSettings), ::il2cpp_utils::ExtractType(parameter), ::il2cpp_utils::ExtractType(newValue), ::il2cpp_utils::ExtractType(handType), ::il2cpp_utils::ExtractType(saveToPatch)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, patchSettings, parameter, newValue, handType, saveToPatch);
}
// Autogenerated method: VROSC.InternalSynthesizer.SetPatchToModularDrums
void VROSC::InternalSynthesizer::SetPatchToModularDrums() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::SetPatchToModularDrums");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetPatchToModularDrums", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.InternalSynthesizer.SetPatch
void VROSC::InternalSynthesizer::SetPatch(::VROSC::HelmWrapper* helmWrapper, ::VROSC::PatchSettings* patchSettings) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::SetPatch");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetPatch", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(helmWrapper), ::il2cpp_utils::ExtractType(patchSettings)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, helmWrapper, patchSettings);
}
// Autogenerated method: VROSC.InternalSynthesizer.AllNotesOff
void VROSC::InternalSynthesizer::AllNotesOff() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::AllNotesOff");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AllNotesOff", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.InternalSynthesizer.AllNotesOff
void VROSC::InternalSynthesizer::AllNotesOff(::Il2CppObject* patch) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::AllNotesOff");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AllNotesOff", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(patch)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, patch);
}
// Autogenerated method: VROSC.InternalSynthesizer.SetPatchToMicrophone
void VROSC::InternalSynthesizer::SetPatchToMicrophone() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::SetPatchToMicrophone");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetPatchToMicrophone", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.InternalSynthesizer.SetBPM
void VROSC::InternalSynthesizer::SetBPM(float bpm, bool reset) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::SetBPM");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetBPM", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(bpm), ::il2cpp_utils::ExtractType(reset)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, bpm, reset);
}
// Autogenerated method: VROSC.InternalSynthesizer.GetHelmOrSamplerWrapper
::VROSC::AudioHelmInstrumentWrapper* VROSC::InternalSynthesizer::GetHelmOrSamplerWrapper(::VROSC::PatchSettings* patchSettings, ::VROSC::HandType handType) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::GetHelmOrSamplerWrapper");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetHelmOrSamplerWrapper", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(patchSettings), ::il2cpp_utils::ExtractType(handType)})));
return ::il2cpp_utils::RunMethodRethrow<::VROSC::AudioHelmInstrumentWrapper*, false>(this, ___internal__method, patchSettings, handType);
}
// Autogenerated method: VROSC.InternalSynthesizer.GetCurrentInstrumentName
::StringW VROSC::InternalSynthesizer::GetCurrentInstrumentName() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::GetCurrentInstrumentName");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetCurrentInstrumentName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.InternalSynthesizer.GetCurrentPatchName
::StringW VROSC::InternalSynthesizer::GetCurrentPatchName() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::GetCurrentPatchName");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetCurrentPatchName", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::StringW, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.InternalSynthesizer.GetCurrentSoundSource
::VROSC::SoundSource VROSC::InternalSynthesizer::GetCurrentSoundSource() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::GetCurrentSoundSource");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetCurrentSoundSource", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<::VROSC::SoundSource, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VROSC.InternalSynthesizer/VROSC.<Setup>d__9
#include "VROSC/InternalSynthesizer_-Setup-d__9.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.Int32 <>1__state
int& VROSC::InternalSynthesizer::$Setup$d__9::dyn_$$1__state() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::$Setup$d__9::dyn_$$1__state");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>1__state"))->offset;
return *reinterpret_cast<int*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Runtime.CompilerServices.AsyncTaskMethodBuilder <>t__builder
::System::Runtime::CompilerServices::AsyncTaskMethodBuilder& VROSC::InternalSynthesizer::$Setup$d__9::dyn_$$t__builder() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::$Setup$d__9::dyn_$$t__builder");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>t__builder"))->offset;
return *reinterpret_cast<::System::Runtime::CompilerServices::AsyncTaskMethodBuilder*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public VROSC.InternalSynthesizer <>4__this
::VROSC::InternalSynthesizer*& VROSC::InternalSynthesizer::$Setup$d__9::dyn_$$4__this() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::$Setup$d__9::dyn_$$4__this");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>4__this"))->offset;
return *reinterpret_cast<::VROSC::InternalSynthesizer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Runtime.CompilerServices.TaskAwaiter <>u__1
::System::Runtime::CompilerServices::TaskAwaiter& VROSC::InternalSynthesizer::$Setup$d__9::dyn_$$u__1() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::$Setup$d__9::dyn_$$u__1");
auto ___internal__instance = *this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "<>u__1"))->offset;
return *reinterpret_cast<::System::Runtime::CompilerServices::TaskAwaiter*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VROSC.InternalSynthesizer/VROSC.<Setup>d__9.MoveNext
void VROSC::InternalSynthesizer::$Setup$d__9::MoveNext() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::$Setup$d__9::MoveNext");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "MoveNext", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.InternalSynthesizer/VROSC.<Setup>d__9.SetStateMachine
void VROSC::InternalSynthesizer::$Setup$d__9::SetStateMachine(::System::Runtime::CompilerServices::IAsyncStateMachine* stateMachine) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::InternalSynthesizer::$Setup$d__9::SetStateMachine");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(*this, "SetStateMachine", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(stateMachine)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, stateMachine);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VROSC.PatchSettings
#include "VROSC/PatchSettings.hpp"
// Including type: AudioHelm.HelmPatchFormat
#include "AudioHelm/HelmPatchFormat.hpp"
// Including type: AudioHelm.Param
#include "AudioHelm/Param.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public AudioHelm.HelmPatchFormat Patch
::AudioHelm::HelmPatchFormat*& VROSC::PatchSettings::dyn_Patch() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PatchSettings::dyn_Patch");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Patch"))->offset;
return *reinterpret_cast<::AudioHelm::HelmPatchFormat**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VROSC.PatchSettings.GetVirtuosoAdjustedPercentValue
float VROSC::PatchSettings::GetVirtuosoAdjustedPercentValue(::AudioHelm::Param parameter, float percent) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PatchSettings::GetVirtuosoAdjustedPercentValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod("VROSC", "PatchSettings", "GetVirtuosoAdjustedPercentValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parameter), ::il2cpp_utils::ExtractType(percent)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(static_cast<Il2CppObject*>(nullptr), ___internal__method, parameter, percent);
}
// Autogenerated method: VROSC.PatchSettings.SetParameterPercent
void VROSC::PatchSettings::SetParameterPercent(::AudioHelm::Param parameter, float percent) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PatchSettings::SetParameterPercent");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetParameterPercent", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parameter), ::il2cpp_utils::ExtractType(percent)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, parameter, percent);
}
// Autogenerated method: VROSC.PatchSettings.GetParameterPercent
float VROSC::PatchSettings::GetParameterPercent(::AudioHelm::Param parameter) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PatchSettings::GetParameterPercent");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetParameterPercent", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parameter)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, parameter);
}
// Autogenerated method: VROSC.PatchSettings.SetParameterValue
void VROSC::PatchSettings::SetParameterValue(::AudioHelm::Param parameter, float newValue) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PatchSettings::SetParameterValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetParameterValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parameter), ::il2cpp_utils::ExtractType(newValue)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, parameter, newValue);
}
// Autogenerated method: VROSC.PatchSettings.GetParameterValue
float VROSC::PatchSettings::GetParameterValue(::AudioHelm::Param parameter) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::PatchSettings::GetParameterValue");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetParameterValue", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parameter)})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method, parameter);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
// Including type: VROSC.SamplerWrapper
#include "VROSC/SamplerWrapper.hpp"
// Including type: AudioHelm.Sampler
#include "AudioHelm/Sampler.hpp"
// Including type: VROSC.InternalSynthesizer
#include "VROSC/InternalSynthesizer.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: private AudioHelm.Sampler _sampler
::AudioHelm::Sampler*& VROSC::SamplerWrapper::dyn__sampler() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SamplerWrapper::dyn__sampler");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_sampler"))->offset;
return *reinterpret_cast<::AudioHelm::Sampler**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private VROSC.InternalSynthesizer _internalSynthesizer
::VROSC::InternalSynthesizer*& VROSC::SamplerWrapper::dyn__internalSynthesizer() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SamplerWrapper::dyn__internalSynthesizer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_internalSynthesizer"))->offset;
return *reinterpret_cast<::VROSC::InternalSynthesizer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VROSC.SamplerWrapper.ResetInstrument
void VROSC::SamplerWrapper::ResetInstrument() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SamplerWrapper::ResetInstrument");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "ResetInstrument", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.SamplerWrapper.Setup
void VROSC::SamplerWrapper::Setup(::VROSC::InternalSynthesizer* internalSynthesizer) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SamplerWrapper::Setup");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Setup", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(internalSynthesizer)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, internalSynthesizer);
}
// Autogenerated method: VROSC.SamplerWrapper.NoteOn
void VROSC::SamplerWrapper::NoteOn(int note, float velocity, double predictedDspTime, float pitch) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SamplerWrapper::NoteOn");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "NoteOn", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(note), ::il2cpp_utils::ExtractType(velocity), ::il2cpp_utils::ExtractType(predictedDspTime), ::il2cpp_utils::ExtractType(pitch)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, note, velocity, predictedDspTime, pitch);
}
// Autogenerated method: VROSC.SamplerWrapper.NoteOff
void VROSC::SamplerWrapper::NoteOff(int note) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SamplerWrapper::NoteOff");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "NoteOff", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(note)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, note);
}
// Autogenerated method: VROSC.SamplerWrapper.AllNotesOff
void VROSC::SamplerWrapper::AllNotesOff() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SamplerWrapper::AllNotesOff");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "AllNotesOff", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.SamplerWrapper.SetMidiCC
void VROSC::SamplerWrapper::SetMidiCC(float midiCCValue, int midiCC) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SamplerWrapper::SetMidiCC");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetMidiCC", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(midiCCValue), ::il2cpp_utils::ExtractType(midiCC)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, midiCCValue, midiCC);
}
// Autogenerated method: VROSC.SamplerWrapper.SetPitchBend
void VROSC::SamplerWrapper::SetPitchBend(float pitchBendValue) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::SamplerWrapper::SetPitchBend");
auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetPitchBend", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(pitchBendValue)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, pitchBendValue);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: VROSC.AudioMixManager
#include "VROSC/AudioMixManager.hpp"
// Including type: VROSC.AudioMixManager/VROSC.VolumeParameter
#include "VROSC/AudioMixManager_VolumeParameter.hpp"
// Including type: VROSC.AudioMixManager/VROSC.<FadeCoroutine>d__11
#include "VROSC/AudioMixManager_-FadeCoroutine-d__11.hpp"
// Including type: UnityEngine.Audio.AudioMixer
#include "UnityEngine/Audio/AudioMixer.hpp"
// Including type: System.Collections.Generic.Dictionary`2
#include "System/Collections/Generic/Dictionary_2.hpp"
// Including type: System.String
#include "System/String.hpp"
// Including type: System.Collections.IEnumerator
#include "System/Collections/IEnumerator.hpp"
// Including type: VROSC.UserDataControllers
#include "VROSC/UserDataControllers.hpp"
// Including type: VROSC.Error
#include "VROSC/Error.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated static field getter
// Get static field: static private System.Single _minVolumeDb
float VROSC::AudioMixManager::_get__minVolumeDb() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::_get__minVolumeDb");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<float>("VROSC", "AudioMixManager", "_minVolumeDb"));
}
// Autogenerated static field setter
// Set static field: static private System.Single _minVolumeDb
void VROSC::AudioMixManager::_set__minVolumeDb(float value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::_set__minVolumeDb");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioMixManager", "_minVolumeDb", value));
}
// Autogenerated static field getter
// Get static field: static public System.String GameSoundsVolume
::StringW VROSC::AudioMixManager::_get_GameSoundsVolume() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::_get_GameSoundsVolume");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "AudioMixManager", "GameSoundsVolume"));
}
// Autogenerated static field setter
// Set static field: static public System.String GameSoundsVolume
void VROSC::AudioMixManager::_set_GameSoundsVolume(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::_set_GameSoundsVolume");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioMixManager", "GameSoundsVolume", value));
}
// Autogenerated static field getter
// Get static field: static public System.String MicrophoneReverbVolume
::StringW VROSC::AudioMixManager::_get_MicrophoneReverbVolume() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::_get_MicrophoneReverbVolume");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "AudioMixManager", "MicrophoneReverbVolume"));
}
// Autogenerated static field setter
// Set static field: static public System.String MicrophoneReverbVolume
void VROSC::AudioMixManager::_set_MicrophoneReverbVolume(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::_set_MicrophoneReverbVolume");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioMixManager", "MicrophoneReverbVolume", value));
}
// Autogenerated static field getter
// Get static field: static public System.String MasterVolume
::StringW VROSC::AudioMixManager::_get_MasterVolume() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::_get_MasterVolume");
return THROW_UNLESS(il2cpp_utils::GetFieldValue<::StringW>("VROSC", "AudioMixManager", "MasterVolume"));
}
// Autogenerated static field setter
// Set static field: static public System.String MasterVolume
void VROSC::AudioMixManager::_set_MasterVolume(::StringW value) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::_set_MasterVolume");
THROW_UNLESS(il2cpp_utils::SetFieldValue("VROSC", "AudioMixManager", "MasterVolume", value));
}
// Autogenerated instance field getter
// Get instance field: private UnityEngine.Audio.AudioMixer _audioMixer
::UnityEngine::Audio::AudioMixer*& VROSC::AudioMixManager::dyn__audioMixer() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::dyn__audioMixer");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_audioMixer"))->offset;
return *reinterpret_cast<::UnityEngine::Audio::AudioMixer**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.Dictionary`2<System.String,VROSC.AudioMixManager/VROSC.VolumeParameter> _volumeParameters
::System::Collections::Generic::Dictionary_2<::StringW, ::VROSC::AudioMixManager::VolumeParameter*>*& VROSC::AudioMixManager::dyn__volumeParameters() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::dyn__volumeParameters");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_volumeParameters"))->offset;
return *reinterpret_cast<::System::Collections::Generic::Dictionary_2<::StringW, ::VROSC::AudioMixManager::VolumeParameter*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Boolean _fadedOutMaster
bool& VROSC::AudioMixManager::dyn__fadedOutMaster() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::dyn__fadedOutMaster");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_fadedOutMaster"))->offset;
return *reinterpret_cast<bool*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VROSC.AudioMixManager.Awake
void VROSC::AudioMixManager::Awake() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::Awake");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Awake", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AudioMixManager.OnDestroy
void VROSC::AudioMixManager::OnDestroy() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::OnDestroy");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "OnDestroy", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AudioMixManager.Fade
void VROSC::AudioMixManager::Fade(::StringW parameterName, float fadeTime, float targetVolumeFraction, ::Il2CppObject* source) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::Fade");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "Fade", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parameterName), ::il2cpp_utils::ExtractType(fadeTime), ::il2cpp_utils::ExtractType(targetVolumeFraction), ::il2cpp_utils::ExtractType(source)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, parameterName, fadeTime, targetVolumeFraction, source);
}
// Autogenerated method: VROSC.AudioMixManager.FadeCoroutine
::System::Collections::IEnumerator* VROSC::AudioMixManager::FadeCoroutine(::StringW parameterName, float fadeTime, float unfadedVolume, float targetVolumeFractionDb) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::FadeCoroutine");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FadeCoroutine", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parameterName), ::il2cpp_utils::ExtractType(fadeTime), ::il2cpp_utils::ExtractType(unfadedVolume), ::il2cpp_utils::ExtractType(targetVolumeFractionDb)})));
return ::il2cpp_utils::RunMethodRethrow<::System::Collections::IEnumerator*, false>(this, ___internal__method, parameterName, fadeTime, unfadedVolume, targetVolumeFractionDb);
}
// Autogenerated method: VROSC.AudioMixManager.SetVolume
void VROSC::AudioMixManager::SetVolume(::StringW parameterName, float volume) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::SetVolume");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetVolume", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parameterName), ::il2cpp_utils::ExtractType(volume)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, parameterName, volume);
}
// Autogenerated method: VROSC.AudioMixManager.SetVolumeDb
void VROSC::AudioMixManager::SetVolumeDb(::StringW parameterName, float volume) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::SetVolumeDb");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SetVolumeDb", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(parameterName), ::il2cpp_utils::ExtractType(volume)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, parameterName, volume);
}
// Autogenerated method: VROSC.AudioMixManager.PreferencesDataLoaded
void VROSC::AudioMixManager::PreferencesDataLoaded(::VROSC::UserDataControllers* userDataControllers) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::PreferencesDataLoaded");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "PreferencesDataLoaded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(userDataControllers)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, userDataControllers);
}
// Autogenerated method: VROSC.AudioMixManager.SaveSucceeded
void VROSC::AudioMixManager::SaveSucceeded(::StringW sessionId) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::SaveSucceeded");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SaveSucceeded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sessionId)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, sessionId);
}
// Autogenerated method: VROSC.AudioMixManager.SaveFailed
void VROSC::AudioMixManager::SaveFailed(::StringW sessionId, ::VROSC::Error error) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::SaveFailed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "SaveFailed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sessionId), ::il2cpp_utils::ExtractType(error)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, sessionId, error);
}
// Autogenerated method: VROSC.AudioMixManager.LoadSucceeded
void VROSC::AudioMixManager::LoadSucceeded(::StringW sessionId, bool isDefaultSession) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::LoadSucceeded");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LoadSucceeded", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sessionId), ::il2cpp_utils::ExtractType(isDefaultSession)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, sessionId, isDefaultSession);
}
// Autogenerated method: VROSC.AudioMixManager.LoadFailed
void VROSC::AudioMixManager::LoadFailed(::StringW sessionId, bool isDefaultSession, ::VROSC::Error error) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::LoadFailed");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "LoadFailed", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(sessionId), ::il2cpp_utils::ExtractType(isDefaultSession), ::il2cpp_utils::ExtractType(error)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, sessionId, isDefaultSession, error);
}
// Autogenerated method: VROSC.AudioMixManager.FadeOutForLoadSave
void VROSC::AudioMixManager::FadeOutForLoadSave() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::FadeOutForLoadSave");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FadeOutForLoadSave", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated method: VROSC.AudioMixManager.FadeInAfterLoadSave
void VROSC::AudioMixManager::FadeInAfterLoadSave() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::FadeInAfterLoadSave");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "FadeInAfterLoadSave", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: VROSC.AudioMixManager/VROSC.VolumeParameter
#include "VROSC/AudioMixManager_VolumeParameter.hpp"
// Including type: VROSC.AudioMixManager/VROSC.VolumeParameter/VROSC.FadeSource
#include "VROSC/AudioMixManager_VolumeParameter_FadeSource.hpp"
// Including type: UnityEngine.Coroutine
#include "UnityEngine/Coroutine.hpp"
// Including type: System.Collections.Generic.List`1
#include "System/Collections/Generic/List_1.hpp"
// Including type: UnityEngine.Audio.AudioMixer
#include "UnityEngine/Audio/AudioMixer.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.String Name
::StringW& VROSC::AudioMixManager::VolumeParameter::dyn_Name() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::VolumeParameter::dyn_Name");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Name"))->offset;
return *reinterpret_cast<::StringW*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Single UnfadedVolume
float& VROSC::AudioMixManager::VolumeParameter::dyn_UnfadedVolume() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::VolumeParameter::dyn_UnfadedVolume");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "UnfadedVolume"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public UnityEngine.Coroutine FadingCoroutine
::UnityEngine::Coroutine*& VROSC::AudioMixManager::VolumeParameter::dyn_FadingCoroutine() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::VolumeParameter::dyn_FadingCoroutine");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "FadingCoroutine"))->offset;
return *reinterpret_cast<::UnityEngine::Coroutine**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: private System.Collections.Generic.List`1<VROSC.AudioMixManager/VROSC.VolumeParameter/VROSC.FadeSource> _fadeSources
::System::Collections::Generic::List_1<::VROSC::AudioMixManager::VolumeParameter::FadeSource*>*& VROSC::AudioMixManager::VolumeParameter::dyn__fadeSources() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::VolumeParameter::dyn__fadeSources");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "_fadeSources"))->offset;
return *reinterpret_cast<::System::Collections::Generic::List_1<::VROSC::AudioMixManager::VolumeParameter::FadeSource*>**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated method: VROSC.AudioMixManager/VROSC.VolumeParameter.RegisterFade
void VROSC::AudioMixManager::VolumeParameter::RegisterFade(::Il2CppObject* source, float volume) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::VolumeParameter::RegisterFade");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "RegisterFade", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(source), ::il2cpp_utils::ExtractType(volume)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, source, volume);
}
// Autogenerated method: VROSC.AudioMixManager/VROSC.VolumeParameter.UnregisterFade
void VROSC::AudioMixManager::VolumeParameter::UnregisterFade(::Il2CppObject* source) {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::VolumeParameter::UnregisterFade");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "UnregisterFade", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{::il2cpp_utils::ExtractType(source)})));
::il2cpp_utils::RunMethodRethrow<void, false>(this, ___internal__method, source);
}
// Autogenerated method: VROSC.AudioMixManager/VROSC.VolumeParameter.GetFadeVolume
float VROSC::AudioMixManager::VolumeParameter::GetFadeVolume() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::VolumeParameter::GetFadeVolume");
static auto* ___internal__method = THROW_UNLESS((::il2cpp_utils::FindMethod(this, "GetFadeVolume", std::vector<Il2CppClass*>{}, ::std::vector<const Il2CppType*>{})));
return ::il2cpp_utils::RunMethodRethrow<float, false>(this, ___internal__method);
}
// Autogenerated from CppSourceCreator
// Created by Sc2ad
// =========================================================================
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
// Including type: VROSC.AudioMixManager/VROSC.VolumeParameter/VROSC.FadeSource
#include "VROSC/AudioMixManager_VolumeParameter_FadeSource.hpp"
#include "beatsaber-hook/shared/utils/il2cpp-utils.hpp"
#include "beatsaber-hook/shared/utils/utils.h"
// Completed includes
// Autogenerated instance field getter
// Get instance field: public System.Object Source
::Il2CppObject*& VROSC::AudioMixManager::VolumeParameter::FadeSource::dyn_Source() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::VolumeParameter::FadeSource::dyn_Source");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Source"))->offset;
return *reinterpret_cast<::Il2CppObject**>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
// Autogenerated instance field getter
// Get instance field: public System.Single Volume
float& VROSC::AudioMixManager::VolumeParameter::FadeSource::dyn_Volume() {
static auto ___internal__logger = ::Logger::get().WithContext("::VROSC::AudioMixManager::VolumeParameter::FadeSource::dyn_Volume");
auto ___internal__instance = this;
static auto ___internal__field__offset = THROW_UNLESS(il2cpp_utils::FindField(___internal__instance, "Volume"))->offset;
return *reinterpret_cast<float*>(reinterpret_cast<char*>(this) + ___internal__field__offset);
}
| 75.462865
| 452
| 0.78189
|
RedBrumbler
|
8269a7fd53c3ca0623d8cd1de02c8fd29db19750
| 12,190
|
hpp
|
C++
|
libbitcoin/include/bitcoin/network/channel.hpp
|
mousewu/bcclient
|
64ee1f6f8337103d40a4a0c3dfb73cabcd09a04c
|
[
"MIT"
] | 8
|
2019-05-31T01:37:08.000Z
|
2021-10-19T05:52:45.000Z
|
libbitcoin/include/bitcoin/network/channel.hpp
|
mousewu/bcclient
|
64ee1f6f8337103d40a4a0c3dfb73cabcd09a04c
|
[
"MIT"
] | 3
|
2017-12-18T17:27:09.000Z
|
2018-01-15T16:50:05.000Z
|
libbitcoin/include/bitcoin/network/channel.hpp
|
mousewu/bcclient
|
64ee1f6f8337103d40a4a0c3dfb73cabcd09a04c
|
[
"MIT"
] | 5
|
2018-01-09T15:05:55.000Z
|
2020-12-17T13:27:25.000Z
|
/*
* Copyright (c) 2011-2013 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* libbitcoin is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License with
* additional permissions to the one published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version. For more information see LICENSE.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_NET_CHANNEL_HPP
#define LIBBITCOIN_NET_CHANNEL_HPP
#include <boost/asio.hpp>
#include <boost/array.hpp>
#include <boost/utility.hpp>
#include <boost/asio/streambuf.hpp>
#include <atomic>
#include <cstdint>
#include <memory>
#include <mutex>
#include <stack>
#include <bitcoin/network/network.hpp>
#include <bitcoin/network/shared_const_buffer.hpp>
#include <bitcoin/primitives.hpp>
#include <bitcoin/format.hpp>
#include <bitcoin/satoshi_serialize.hpp>
#include <bitcoin/utility/assert.hpp>
#include <bitcoin/utility/logger.hpp>
#include <bitcoin/utility/serializer.hpp>
#include <bitcoin/utility/subscriber.hpp>
namespace libbitcoin {
template <typename Message>
data_chunk create_raw_message(const Message& packet)
{
data_chunk payload(satoshi_raw_size(packet));
satoshi_save(packet, payload.begin());
// Make the header packet and serialise it
header_type head;
head.magic = magic_value();
head.command = satoshi_command(packet);
head.payload_length = payload.size();
head.checksum = generate_sha256_checksum(payload);
data_chunk raw_header(satoshi_raw_size(head));
satoshi_save(head, raw_header.begin());
// Construct completed packet with header + payload
data_chunk whole_message = raw_header;
extend_data(whole_message, payload);
// Probably not the right place for this
// Networking output in an exporter
log_debug(LOG_NETWORK) << "s: " << head.command
<< " (" << payload.size() << " bytes)";
return whole_message;
}
class channel_loader_module_base
{
public:
virtual ~channel_loader_module_base() {}
virtual void attempt_load(const data_chunk& stream) const = 0;
virtual const std::string lookup_symbol() const = 0;
};
class channel_stream_loader
{
public:
~channel_stream_loader();
void add(channel_loader_module_base* module);
void load_lookup(const std::string& symbol,
const data_chunk& stream) const;
private:
typedef std::vector<channel_loader_module_base*> module_list;
module_list modules_;
};
class channel_proxy
: public std::enable_shared_from_this<channel_proxy>
{
public:
typedef std::function<void (const std::error_code&)> send_handler;
typedef std::function<void (const std::error_code&,
const version_type&)> receive_version_handler;
typedef std::function<void (const std::error_code&,
const verack_type&)> receive_verack_handler;
typedef std::function<void (const std::error_code&,
const address_type&)> receive_address_handler;
typedef std::function<void (const std::error_code&,
const get_address_type&)> receive_get_address_handler;
typedef std::function<void (const std::error_code&,
const inventory_type&)> receive_inventory_handler;
typedef std::function<void (const std::error_code&,
const get_data_type&)> receive_get_data_handler;
typedef std::function<void (const std::error_code&,
const get_blocks_type&)> receive_get_blocks_handler;
typedef std::function<void (const std::error_code&,
const transaction_type&)> receive_transaction_handler;
typedef std::function<void (const std::error_code&,
const block_type&)> receive_block_handler;
typedef std::function<void (const std::error_code&,
const header_type&, const data_chunk&)> receive_raw_handler;
typedef std::function<void (const std::error_code&)> stop_handler;
channel_proxy(threadpool& pool, socket_ptr socket);
~channel_proxy();
channel_proxy(const channel_proxy&) = delete;
void operator=(const channel_proxy&) = delete;
void start();
void stop();
bool stopped() const;
// List of bitcoin messages
// version
// verack
// addr
// getaddr
// inv
// getdata
// getblocks
// tx
// block
// getheaders [unused]
// headers [unused]
// checkorder [deprecated]
// submitorder [deprecated]
// reply [deprecated]
// ping [internal]
// alert [not supported]
template <typename Message>
void send(const Message& packet, send_handler handle_send)
{
if (stopped_)
handle_send(error::service_stopped);
else
{
auto this_ptr = shared_from_this();
strand_.post(
[this, this_ptr, packet, handle_send]
{
do_send_common(create_raw_message(packet),
handle_send);
});
}
}
void send_raw(const header_type& packet_header,
const data_chunk& payload, send_handler handle_send);
void subscribe_version(receive_version_handler handle_receive);
void subscribe_verack(receive_verack_handler handle_receive);
void subscribe_address(receive_address_handler handle_receive);
void subscribe_get_address(receive_get_address_handler handle_receive);
void subscribe_inventory(receive_inventory_handler handle_receive);
void subscribe_get_data(receive_get_data_handler handle_receive);
void subscribe_get_blocks(receive_get_blocks_handler handle_receive);
void subscribe_transaction(receive_transaction_handler handle_receive);
void subscribe_block(receive_block_handler handle_receive);
void subscribe_raw(receive_raw_handler handle_receive);
void subscribe_stop(stop_handler handle_stop);
std::string get_remote_endpoint();
private:
typedef subscriber<const std::error_code&, const version_type&>
version_subscriber_type;
typedef subscriber<const std::error_code&, const verack_type&>
verack_subscriber_type;
typedef subscriber<const std::error_code&, const address_type&>
address_subscriber_type;
typedef subscriber<const std::error_code&, const get_address_type&>
get_address_subscriber_type;
typedef subscriber<const std::error_code&, const inventory_type&>
inventory_subscriber_type;
typedef subscriber<const std::error_code&, const get_data_type&>
get_data_subscriber_type;
typedef subscriber<const std::error_code&, const get_blocks_type&>
get_blocks_subscriber_type;
typedef subscriber<const std::error_code&, const transaction_type&>
transaction_subscriber_type;
typedef subscriber<const std::error_code&, const block_type&>
block_subscriber_type;
typedef subscriber<const std::error_code&,
const header_type&, const data_chunk&> raw_subscriber_type;
typedef subscriber<const std::error_code&> stop_subscriber_type;
void do_send_raw(const header_type& packet_header,
const data_chunk& payload, send_handler handle_send);
void do_send_common(const data_chunk& whole_message,
send_handler handle_send);
template <typename Message, typename Callback, typename SubscriberPtr>
void generic_subscribe(Callback handle_message,
SubscriberPtr message_subscribe)
{
// Subscribing must be immediate. We cannot switch thread contexts
if (stopped_)
handle_message(error::service_stopped, Message());
else
message_subscribe->subscribe(handle_message);
}
void read_header();
void read_checksum(const header_type& header_msg);
void read_payload(const header_type& header_msg);
void handle_read_header(const boost::system::error_code& ec,
size_t bytes_transferred);
void handle_read_checksum(const boost::system::error_code& ec,
size_t bytes_transferred, header_type& header_msg);
void handle_read_payload(const boost::system::error_code& ec,
size_t bytes_transferred, const header_type& header_msg);
// Calls the send handler after a successful send, translating
// the boost error_code to std::error_code
void call_handle_send(const boost::system::error_code& ec,
send_handler handle_send);
void handle_timeout(const boost::system::error_code& ec);
void handle_heartbeat(const boost::system::error_code& ec);
void set_timeout(const boost::posix_time::time_duration timeout);
void set_heartbeat(const boost::posix_time::time_duration timeout);
void reset_timers();
bool problems_check(const boost::system::error_code& ec);
void stop_impl();
void clear_subscriptions();
io_service::strand strand_;
socket_ptr socket_;
// We keep the service alive for lifetime rules
boost::asio::deadline_timer timeout_, heartbeat_;
std::atomic<bool> stopped_;
channel_stream_loader loader_;
// Header minus checksum is 4 + 12 + 4 = 20 bytes
static constexpr size_t header_chunk_size = 20;
// Checksum size is 4 bytes
static constexpr size_t header_checksum_size = 4;
boost::array<uint8_t, header_chunk_size> inbound_header_;
boost::array<uint8_t, header_checksum_size> inbound_checksum_;
std::vector<uint8_t> inbound_payload_;
// We should be using variadic templates for these
version_subscriber_type::ptr version_subscriber_;
verack_subscriber_type::ptr verack_subscriber_;
address_subscriber_type::ptr address_subscriber_;
get_address_subscriber_type::ptr get_address_subscriber_;
inventory_subscriber_type::ptr inventory_subscriber_;
get_data_subscriber_type::ptr get_data_subscriber_;
get_blocks_subscriber_type::ptr get_blocks_subscriber_;
transaction_subscriber_type::ptr transaction_subscriber_;
block_subscriber_type::ptr block_subscriber_;
raw_subscriber_type::ptr raw_subscriber_;
stop_subscriber_type::ptr stop_subscriber_;
};
class channel
{
public:
typedef std::shared_ptr<channel_proxy> channel_proxy_ptr;
channel(channel_proxy_ptr proxy);
~channel();
void stop();
bool stopped() const;
template <typename Message>
void send(const Message& packet,
channel_proxy::send_handler handle_send)
{
channel_proxy_ptr proxy = weak_proxy_.lock();
if (!proxy)
handle_send(error::service_stopped);
else
proxy->send(packet, handle_send);
}
void send_raw(const header_type& packet_header,
const data_chunk& payload, channel_proxy::send_handler handle_send);
void subscribe_version(
channel_proxy::receive_version_handler handle_receive);
void subscribe_verack(
channel_proxy::receive_verack_handler handle_receive);
void subscribe_address(
channel_proxy::receive_address_handler handle_receive);
void subscribe_get_address(
channel_proxy::receive_get_address_handler handle_receive);
void subscribe_inventory(
channel_proxy::receive_inventory_handler handle_receive);
void subscribe_get_data(
channel_proxy::receive_get_data_handler handle_receive);
void subscribe_get_blocks(
channel_proxy::receive_get_blocks_handler handle_receive);
void subscribe_transaction(
channel_proxy::receive_transaction_handler handle_receive);
void subscribe_block(
channel_proxy::receive_block_handler handle_receive);
void subscribe_raw(
channel_proxy::receive_raw_handler handle_receive);
void subscribe_stop(
channel_proxy::stop_handler handle_stop);
std::string get_remote_endpoint();
private:
std::weak_ptr<channel_proxy> weak_proxy_;
};
} // namespace libbitcoin
#endif
| 35.333333
| 76
| 0.728138
|
mousewu
|
826b219df29c09ea0b3cf5fba7e0df1950d86c37
| 4,344
|
cc
|
C++
|
release/src/router/aria2/test/BtBitfieldMessageTest.cc
|
Clarkmania/ripetomato
|
5eda5521468cb9cb7156ae6750cf8229b776d10e
|
[
"FSFAP"
] | 3
|
2019-01-13T09:19:57.000Z
|
2022-01-15T12:16:14.000Z
|
release/src/router/aria2/test/BtBitfieldMessageTest.cc
|
Clarkmania/ripetomato
|
5eda5521468cb9cb7156ae6750cf8229b776d10e
|
[
"FSFAP"
] | 1
|
2020-07-28T08:22:45.000Z
|
2020-07-28T08:22:45.000Z
|
release/src/router/aria2/test/BtBitfieldMessageTest.cc
|
Clarkmania/ripetomato
|
5eda5521468cb9cb7156ae6750cf8229b776d10e
|
[
"FSFAP"
] | 1
|
2020-03-06T21:17:24.000Z
|
2020-03-06T21:17:24.000Z
|
#include "BtBitfieldMessage.h"
#include <cstring>
#include <cppunit/extensions/HelperMacros.h>
#include "bittorrent_helper.h"
#include "util.h"
#include "Peer.h"
#include "MockPieceStorage.h"
#include "DlAbortEx.h"
#include "FileEntry.h"
namespace aria2 {
class BtBitfieldMessageTest:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(BtBitfieldMessageTest);
CPPUNIT_TEST(testCreate);
CPPUNIT_TEST(testCreateMessage);
CPPUNIT_TEST(testDoReceivedAction);
CPPUNIT_TEST(testDoReceivedAction_goodByeSeeder);
CPPUNIT_TEST(testToString);
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp() {
}
void testCreate();
void testCreateMessage();
void testDoReceivedAction();
void testDoReceivedAction_goodByeSeeder();
void testToString();
};
CPPUNIT_TEST_SUITE_REGISTRATION(BtBitfieldMessageTest);
void BtBitfieldMessageTest::testCreate() {
unsigned char msg[5+2];
bittorrent::createPeerMessageString(msg, sizeof(msg), 3, 5);
unsigned char bitfield[2];
memset(bitfield, 0xff, sizeof(bitfield));
memcpy(&msg[5], bitfield, sizeof(bitfield));
SharedHandle<BtBitfieldMessage> pm(BtBitfieldMessage::create(&msg[4], 3));
CPPUNIT_ASSERT_EQUAL((uint8_t)5, pm->getId());
CPPUNIT_ASSERT(memcmp(bitfield, pm->getBitfield(), sizeof(bitfield)) == 0);
CPPUNIT_ASSERT_EQUAL((size_t)2, pm->getBitfieldLength());
// case: payload size is wrong
try {
unsigned char msg[5];
bittorrent::createPeerMessageString(msg, sizeof(msg), 1, 5);
BtBitfieldMessage::create(&msg[4], 1);
CPPUNIT_FAIL("exception must be thrown.");
} catch(...) {
}
// case: id is wrong
try {
unsigned char msg[5+2];
bittorrent::createPeerMessageString(msg, sizeof(msg), 3, 6);
BtBitfieldMessage::create(&msg[4], 3);
CPPUNIT_FAIL("exception must be thrown.");
} catch(...) {
}
}
void BtBitfieldMessageTest::testCreateMessage() {
BtBitfieldMessage msg;
unsigned char bitfield[2];
memset(bitfield, 0xff, sizeof(bitfield));
msg.setBitfield(bitfield, sizeof(bitfield));
unsigned char data[5+2];
bittorrent::createPeerMessageString(data, sizeof(data), 3, 5);
memcpy(&data[5], bitfield, sizeof(bitfield));
unsigned char* rawmsg = msg.createMessage();
CPPUNIT_ASSERT(memcmp(rawmsg, data, 7) == 0);
delete [] rawmsg;
CPPUNIT_ASSERT_EQUAL((size_t)7, msg.getMessageLength());
}
void BtBitfieldMessageTest::testDoReceivedAction() {
SharedHandle<Peer> peer(new Peer("host1", 6969));
peer->allocateSessionResource(16*1024, 16*16*1024);
BtBitfieldMessage msg;
msg.setPeer(peer);
SharedHandle<MockPieceStorage> pieceStorage(new MockPieceStorage());
msg.setPieceStorage(pieceStorage);
unsigned char bitfield[] = { 0xff, 0xff };
msg.setBitfield(bitfield, sizeof(bitfield));
CPPUNIT_ASSERT_EQUAL(std::string("0000"), util::toHex(peer->getBitfield(),
peer->getBitfieldLength()));
msg.doReceivedAction();
CPPUNIT_ASSERT_EQUAL(std::string("ffff"), util::toHex(peer->getBitfield(),
peer->getBitfieldLength()));
}
void BtBitfieldMessageTest::testDoReceivedAction_goodByeSeeder()
{
SharedHandle<Peer> peer(new Peer("ip", 6000));
peer->allocateSessionResource(1024, 1024);
BtBitfieldMessage msg;
msg.setPeer(peer);
SharedHandle<MockPieceStorage> pieceStorage(new MockPieceStorage());
msg.setPieceStorage(pieceStorage);
unsigned char bitfield[] = { 0x00 };
msg.setBitfield(bitfield, sizeof(bitfield));
// peer is not seeder and client have not completed download
msg.doReceivedAction();
pieceStorage->setDownloadFinished(true);
// client completed download, but peer is not seeder
msg.doReceivedAction();
pieceStorage->setDownloadFinished(false);
bitfield[0] = 0x80;
msg.setBitfield(bitfield, sizeof(bitfield));
// peer is seeder, but client have not completed download
msg.doReceivedAction();
pieceStorage->setDownloadFinished(true);
try {
msg.doReceivedAction();
CPPUNIT_FAIL("exception must be thrown.");
} catch(DlAbortEx& e) {
// success
}
}
void BtBitfieldMessageTest::testToString() {
BtBitfieldMessage msg;
unsigned char bitfield[] = { 0xff, 0xff };
msg.setBitfield(bitfield, sizeof(bitfield));
CPPUNIT_ASSERT_EQUAL(std::string("bitfield ffff"), msg.toString());
}
} // namespace aria2
| 30.166667
| 84
| 0.715239
|
Clarkmania
|
826c72304da612bbbf802b6c33b1bbb45f90fd24
| 1,794
|
cpp
|
C++
|
src/Rcpp_s2point.cpp
|
odvratnozgodan/s2
|
e5293d0944e5053e0300d61823914728032c16c9
|
[
"Apache-2.0"
] | 33
|
2016-08-10T09:13:43.000Z
|
2021-06-22T22:52:04.000Z
|
src/Rcpp_s2point.cpp
|
odvratnozgodan/s2
|
e5293d0944e5053e0300d61823914728032c16c9
|
[
"Apache-2.0"
] | 9
|
2016-12-12T17:28:20.000Z
|
2020-08-11T14:41:19.000Z
|
src/Rcpp_s2point.cpp
|
odvratnozgodan/s2
|
e5293d0944e5053e0300d61823914728032c16c9
|
[
"Apache-2.0"
] | 10
|
2016-12-12T17:19:40.000Z
|
2021-12-03T17:44:29.000Z
|
#include "Rcpp_datatypes.h"
#include "s2/s2.h"
#include "s2/s2polyline.h"
#include <Rcpp.h>
using namespace Rcpp;
// Find break points to split polyline with vertices `points` in n pieces of
// equal length (incl. start and end vertex). Only used with two points in our
// code.
std::vector<S2Point> s2point_interpolate_int(std::vector<S2Point> points, int n){
S2Polyline line(points);
std::vector<S2Point> output;
for( int i=0; i<=n; i++ ){
output.push_back(line.Interpolate(i*1.0/n));
}
return output;
}
// Consider `points` as vetices in a polyline and add interpolating vertices if
// necessary so no segment is more than `eps` long.
std::vector<S2Point> s2point_interpolate(std::vector<S2Point> points, double eps){
int npoints = points.size();
if(npoints<=1) return points;
std::vector<S2Point> output;
output.push_back(points[0]);
auto it = points.begin();
for( int i=0; i<npoints-1; i++ ){
std::vector<S2Point> endpoints(it+i, it+i+2);
double dist = endpoints[0].Angle(endpoints[1]);
int n = ceilf(dist/eps);
auto tmp = s2point_interpolate_int(endpoints, n);
output.insert(output.end(), tmp.begin()+1, tmp.end());
}
return output;
}
//' Interpolation of points on unit sphere
//'
//' Given a sequence of points on the unit sphere add interpolating points so
//' consecutive points are within distance `eps` of each other.
//' @param x Matrix with three columns representing the points.
//' @param eps Strictly positive real number. Values greater than or equal to pi
//' correspond to no interpolation.
//' @export S2Point_interpolate
//[[Rcpp::export]]
NumericMatrix S2Point_interpolate(NumericMatrix x, double eps){
std::vector<S2Point> points = S2PointVecFromR(x);
return S2PointVecToR(s2point_interpolate(points, eps));
}
| 35.88
| 82
| 0.714604
|
odvratnozgodan
|
826e473c8d456a6f3bdeedfd87fd2dbd9e1195e1
| 4,008
|
cpp
|
C++
|
src/expression_evaluator/evaluator.cpp
|
vadikrobot/asio-calc
|
aab5b6aed7369483186df7174fb5665985f0876b
|
[
"MIT"
] | null | null | null |
src/expression_evaluator/evaluator.cpp
|
vadikrobot/asio-calc
|
aab5b6aed7369483186df7174fb5665985f0876b
|
[
"MIT"
] | null | null | null |
src/expression_evaluator/evaluator.cpp
|
vadikrobot/asio-calc
|
aab5b6aed7369483186df7174fb5665985f0876b
|
[
"MIT"
] | null | null | null |
#include "evaluator.hpp"
#include <string>
#include <sstream>
#include <iterator>
#include <limits>
#include <spdlog/spdlog.h>
namespace AsioCalc {
template<class T, typename std::enable_if<std::is_integral<T>::value, int>::type = 0>
T ParseInteger(const std::string &s) {
return std::stoi(s);
}
template<class InputInteger, class ResultType>
std::string Evaluator<InputInteger, ResultType>::Run() {
try {
std::stringstream output;
output << std::setprecision(std::numeric_limits<ResultType>::max_digits10)
<< handleAddition();
if (it != input.end()) {
return "Error wrong input";
}
return output.str();
} catch (const std::exception& e) {
return e.what();
}
}
template<class InputInteger, class ResultType>
ResultType Evaluator<InputInteger, ResultType>::handleMultiplication() {
ResultType left = prim();
while(true) {
auto tok = getNextToken();
if (tok.operation == '*') {
left*= prim();
} else if (tok.operation == '/') {
ResultType denom = prim();
if (denom == 0) {
throw std::overflow_error("Error division by zero");
}
left/= denom;
} else {
unread();
return left;
}
}
}
template<class InputInteger, class ResultType>
ResultType Evaluator<InputInteger, ResultType>::handleAddition() {
ResultType left = handleMultiplication();
while(true) {
auto tok = getNextToken();
if (tok.operation == '+') {
left+= handleMultiplication();
} else if (tok.operation == '-') {
left-= handleMultiplication();
} else {
unread();
return left;
}
}
}
template<class InputInteger, class ResultType>
ResultType Evaluator<InputInteger, ResultType>::prim() {
auto tok = getNextToken();
if (tok.tokenType == TokenType::number) {
return tok.num;
}
if (tok.operation == '-') {
return -prim();
}
if (tok.operation == '(') {
auto res = handleAddition();
tok = getNextToken();
if (tok.operation == ')') {
return res;
}
throw std::domain_error(") expected");
}
throw std::domain_error("'()' or 'number' expected");
}
template<class InputInteger, class ResultType>
void Evaluator<InputInteger, ResultType>::unread() {
logger->debug("unread");
it = prev;
}
template<class InputInteger, class ResultType>
typename Evaluator<InputInteger, ResultType>::Token Evaluator<InputInteger, ResultType>::getNextToken() {
std::string num;
char symbol{0};
prev = it;
while (it != input.end()) {
symbol = *it;
if (std::isspace(*it)) {
++it;
continue;
}
if (std::isdigit(symbol)) {
num.push_back(symbol);
} else {
break;
}
++it;
}
logger->debug("parsed '{}', '{}'", num, symbol);
if (!num.empty()) {
return Token::BuildFromInteger(ParseInteger<InputInteger>(num));
} else if (mask.count(symbol)) {
++it;
return Token::BuildFromOperation(symbol);
} else if (it != input.end()) {
throw std::domain_error("unexpected symbol");
}
logger->debug("final token");
return Token::FinalToken();
}
template<class InputInteger, class ResultType>
Evaluator<InputInteger, ResultType>::Evaluator(std::string &&input_) :
input{std::move(input_)},
it{input.begin()},
prev{it} {
if (!spdlog::get("parser")) {
logger = spdlog::stdout_color_mt("parser");
} else {
logger = spdlog::get("parser");
}
for (char i : {'(', ')', '/', '*', '+', '-'}) {
mask.insert(i);
}
}
template class Evaluator<int, long double>;
template class Evaluator<int, boost::multiprecision::cpp_dec_float_100>;
template class Evaluator<int, long long>;
template class Evaluator<int, int>;
}
| 26.899329
| 105
| 0.574601
|
vadikrobot
|
826f50faf103f47713ac6981e44453d84c9fda16
| 50
|
hpp
|
C++
|
src/boost_statechart_in_state_reaction.hpp
|
miathedev/BoostForArduino
|
919621dcd0c157094bed4df752b583ba6ea6409e
|
[
"BSL-1.0"
] | 10
|
2018-03-17T00:58:42.000Z
|
2021-07-06T02:48:49.000Z
|
src/boost_statechart_in_state_reaction.hpp
|
miathedev/BoostForArduino
|
919621dcd0c157094bed4df752b583ba6ea6409e
|
[
"BSL-1.0"
] | 2
|
2021-03-26T15:17:35.000Z
|
2021-05-20T23:55:08.000Z
|
src/boost_statechart_in_state_reaction.hpp
|
miathedev/BoostForArduino
|
919621dcd0c157094bed4df752b583ba6ea6409e
|
[
"BSL-1.0"
] | 4
|
2019-05-28T21:06:37.000Z
|
2021-07-06T03:06:52.000Z
|
#include <boost/statechart/in_state_reaction.hpp>
| 25
| 49
| 0.84
|
miathedev
|
8270f7db0cfd5621980fc2f4f3ea43be86e3868d
| 1,659
|
cpp
|
C++
|
src/AWEngine/PacketClient_StatusRequest.cpp
|
graymadness/AWEngine_Packet
|
5a00aa954edf5bc5d496746cfdeab1511d5633b1
|
[
"MIT"
] | null | null | null |
src/AWEngine/PacketClient_StatusRequest.cpp
|
graymadness/AWEngine_Packet
|
5a00aa954edf5bc5d496746cfdeab1511d5633b1
|
[
"MIT"
] | null | null | null |
src/AWEngine/PacketClient_StatusRequest.cpp
|
graymadness/AWEngine_Packet
|
5a00aa954edf5bc5d496746cfdeab1511d5633b1
|
[
"MIT"
] | null | null | null |
#include "PacketClient.hpp"
#include <AWEngine/Packet/PacketWrapper.hpp>
#include <AWEngine/Packet/ToServer/Login/Init.hpp>
#include <AWEngine/Packet/ToClient/Login/ServerInfo.hpp>
namespace AWEngine
{
::AWEngine::Packet::ToClient::Login::ServerInfo PacketClient::GetServerStatus(const std::string& host, uint16_t port)
{
using tcp = asio::ip::tcp;
/// Own context to not conflict with anything else in the game
asio::io_context io_context;
// New connection
tcp::socket socket(io_context);
tcp::resolver resolver(io_context);
asio::connect(socket, resolver.resolve(host, std::to_string(port)));
/// Temporary buffer to hopefully decrease amount of allocation during packet read/write
Packet::PacketBuffer tmpBuffer;
// Send info request
Packet::PacketWrapper::WritePacket(socket, ::AWEngine::Packet::ToServer::Login::Init(::AWEngine::Packet::ToServer::Login::Init::NextStep::ServerInfo), tmpBuffer);
// Read response
{
Packet::PacketID_t packetID;
Packet::PacketWrapper::ReadPacket(socket, packetID, tmpBuffer);
switch(packetID)
{
default:
throw std::runtime_error("Received unexpected packet from the server");
case ::AWEngine::Packet::ToClient::Login::ServerInfo::s_PacketID():
{
//return std::make_unique<::AWEngine::Packet::ToClient::Login::ServerInfo>(buff);
return ::AWEngine::Packet::ToClient::Login::ServerInfo(tmpBuffer);
}
}
}
}
}
| 36.065217
| 170
| 0.625075
|
graymadness
|
8272a40fd799f5de7c76eb537d89e82d48f00d4c
| 738
|
cpp
|
C++
|
python/bindings/define_environments.cpp
|
juloberno/mamcts
|
6bbc33ddc95ce2b55a67a4d4b037f996e343eefc
|
[
"MIT"
] | 3
|
2019-11-06T20:36:12.000Z
|
2021-11-24T13:55:07.000Z
|
python/bindings/define_environments.cpp
|
juloberno/mamcts
|
6bbc33ddc95ce2b55a67a4d4b037f996e343eefc
|
[
"MIT"
] | null | null | null |
python/bindings/define_environments.cpp
|
juloberno/mamcts
|
6bbc33ddc95ce2b55a67a4d4b037f996e343eefc
|
[
"MIT"
] | 5
|
2019-09-18T20:30:01.000Z
|
2021-11-24T13:55:17.000Z
|
// Copyright (c) 2019 Julian Bernhard
//
// This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>.
// ========================================================
#include "python/bindings/define_environments.hpp"
#include "python/bindings/define_crossing_state.hpp"
#include "mcts/mcts.h"
namespace py = pybind11;
using namespace mcts;
void define_environments(py::module m)
{
py::class_<Viewer,
PyViewer,
std::shared_ptr<Viewer>>(m, "Viewer")
.def(py::init<>())
.def("drawPoint", &Viewer::drawPoint)
.def("drawLine", &Viewer::drawLine);
define_crossing_state<int>(m, "Int");
define_crossing_state<float>(m, "Float");
}
| 29.52
| 60
| 0.617886
|
juloberno
|
8276b81f6c3301a136880c591480ec207f54257b
| 780
|
cpp
|
C++
|
ballfactory.cpp
|
andinsbing/BrickBreaker
|
cc93db7f4e294419c8884ca3f75bb239bbbf0edd
|
[
"MIT"
] | null | null | null |
ballfactory.cpp
|
andinsbing/BrickBreaker
|
cc93db7f4e294419c8884ca3f75bb239bbbf0edd
|
[
"MIT"
] | null | null | null |
ballfactory.cpp
|
andinsbing/BrickBreaker
|
cc93db7f4e294419c8884ca3f75bb239bbbf0edd
|
[
"MIT"
] | null | null | null |
#include "ballfactory.h"
#include"normalball.h"
#include"fastball.h"
#include"slowball.h"
#include"bigball.h"
#include"smallball.h"
#include"superball.h"
AbstractBall* BallFactory::constructNormalBall(QGraphicsItem* parent)
{
return new NormalBall(parent);
}
AbstractBall* BallFactory::constructFastBall(QGraphicsItem* parent)
{
return new FastBall(parent);
}
AbstractBall*BallFactory::constructSlowBall(QGraphicsItem* parent)
{
return new SlowBall(parent);
}
AbstractBall*BallFactory::constructBigBall(QGraphicsItem* parent)
{
return new BigBall(parent);
}
AbstractBall*BallFactory::constructSmallBall(QGraphicsItem* parent)
{
return new SmallBall(parent);
}
AbstractBall*BallFactory::constructSuperBall(QGraphicsItem* parent)
{
return new SuperBall(parent);
}
| 20.526316
| 69
| 0.789744
|
andinsbing
|
827deab044e9c282d4b2ac0fcac70f1c8a832ca7
| 783
|
cpp
|
C++
|
2nd/125_valid_palindrome.cpp
|
buptlxb/leetcode
|
b641419de040801c4f54618d7ee26edcf10ee53c
|
[
"BSD-3-Clause"
] | null | null | null |
2nd/125_valid_palindrome.cpp
|
buptlxb/leetcode
|
b641419de040801c4f54618d7ee26edcf10ee53c
|
[
"BSD-3-Clause"
] | null | null | null |
2nd/125_valid_palindrome.cpp
|
buptlxb/leetcode
|
b641419de040801c4f54618d7ee26edcf10ee53c
|
[
"BSD-3-Clause"
] | null | null | null |
#include <iostream>
#include <string>
#include <cctype>
#include <cassert>
using namespace std;
class Solution {
public:
bool isPalindrome(string s) {
for (string::iterator i = s.begin(), j = s.end(); i < j; ) {
if (!isalnum(*i)) {
++i;
continue;
}
if (!isalnum(*(j-1))) {
--j;
continue;
}
if (toupper(*i++) != toupper(*(--j)))
return false;
}
return true;
}
};
int main(void)
{
Solution s;
assert(s.isPalindrome("A man, a plan, a canal: Panama") && "'A man, a plan, a canal: Panama' is a palindrome");
assert(!s.isPalindrome("race a car") && "'race a car' is not a palindrome");
return 0;
}
| 23.029412
| 115
| 0.478927
|
buptlxb
|
827f777f5e31139c27fa6736cf31c1cdc2ae0c06
| 4,448
|
hpp
|
C++
|
common/StateEnum.hpp
|
pree/collabora-online
|
9f7fe7cb54a29d0894c2d4d960b737e1fda89dc6
|
[
"BSD-2-Clause"
] | null | null | null |
common/StateEnum.hpp
|
pree/collabora-online
|
9f7fe7cb54a29d0894c2d4d960b737e1fda89dc6
|
[
"BSD-2-Clause"
] | null | null | null |
common/StateEnum.hpp
|
pree/collabora-online
|
9f7fe7cb54a29d0894c2d4d960b737e1fda89dc6
|
[
"BSD-2-Clause"
] | null | null | null |
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include <iosfwd>
#include <type_traits>
#include <string>
/// Enum macro specifically for state-machines.
/// Has several limitations, some intentional. For example,
/// the states must have automatic, sequential, values.
/// But also has some advantages, for example it can be used inside classes.
/// Some ideas from https://stackoverflow.com/questions/28828957/enum-to-string-in-modern-c11-c14-c17-and-future-c20
/// and from https://github.com/pfultz2/Cloak/wiki/C-Preprocessor-tricks,-tips,-and-idioms
#define STRINGIFY2(NAME, e) #NAME "::" #e,
#define CONCAT(X, Y) X##Y
#define CALL(X, ...) X(__VA_ARGS__)
#define APPLY1(MACRO, NAME, e) MACRO(NAME, e)
#define APPLY2(MACRO, NAME, e, ...) MACRO(NAME, e) APPLY1(MACRO, NAME, __VA_ARGS__)
#define APPLY3(MACRO, NAME, e, ...) MACRO(NAME, e) APPLY2(MACRO, NAME, __VA_ARGS__)
#define APPLY4(MACRO, NAME, e, ...) MACRO(NAME, e) APPLY3(MACRO, NAME, __VA_ARGS__)
#define APPLY5(MACRO, NAME, e, ...) MACRO(NAME, e) APPLY4(MACRO, NAME, __VA_ARGS__)
#define APPLY6(MACRO, NAME, e, ...) MACRO(NAME, e) APPLY5(MACRO, NAME, __VA_ARGS__)
#define APPLY7(MACRO, NAME, e, ...) MACRO(NAME, e) APPLY6(MACRO, NAME, __VA_ARGS__)
#define APPLY8(MACRO, NAME, e, ...) MACRO(NAME, e) APPLY7(MACRO, NAME, __VA_ARGS__)
#define APPLY9(MACRO, NAME, e, ...) MACRO(NAME, e) APPLY8(MACRO, NAME, __VA_ARGS__)
#define APPLY10(MACRO, NAME, e, ...) MACRO(NAME, e) APPLY9(MACRO, NAME, __VA_ARGS__)
#define APPLY11(MACRO, NAME, e, ...) MACRO(NAME, e) APPLY10(MACRO, NAME, __VA_ARGS__)
#define APPLY12(MACRO, NAME, e, ...) MACRO(NAME, e) APPLY11(MACRO, NAME, __VA_ARGS__)
#define APPLY13(MACRO, NAME, e, ...) MACRO(NAME, e) APPLY12(MACRO, NAME, __VA_ARGS__)
#define APPLY14(MACRO, NAME, e, ...) MACRO(NAME, e) APPLY13(MACRO, NAME, __VA_ARGS__)
#define APPLY15(MACRO, NAME, e, ...) MACRO(NAME, e) APPLY14(MACRO, NAME, __VA_ARGS__)
// Credit to Anton Bachin for this trick.
#define GET_COUNT(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, c, ...) c
#define COUNT_ARGS(...) GET_COUNT(__VA_ARGS__, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
#define APPLY(MACRO, NAME, ...) \
CALL(CONCAT, APPLY, COUNT_ARGS(__VA_ARGS__))(MACRO, NAME, __VA_ARGS__)
#define FOR_EACH(MACRO, NAME, ...) APPLY(MACRO, NAME, __VA_ARGS__)
/// Define a state-machine with various independent states.
/// NAME is the name of the state enum followed by the state names.
#define STATE_ENUM(NAME, ...) \
enum class NAME : char; \
static inline const char* name(NAME e) \
{ \
static const char* const NAME##_names[] = { FOR_EACH(STRINGIFY2, NAME, __VA_ARGS__) }; \
assert(static_cast<unsigned>(e) < sizeof(NAME##_names) / sizeof(NAME##_names[0]) && \
"Enum value is out of range."); \
return NAME##_names[static_cast<int>(e)]; \
} \
static inline std::string toString(NAME e) { return name(e); } \
enum class NAME : char \
{ \
__VA_ARGS__ \
}
/// Support seemless serialization of STATE_ENUM to ostream.
template <typename T, typename std::enable_if<
std::is_same<decltype(name(T())), const char*>::value>::type* = nullptr>
inline std::ostream& operator<<(std::ostream& os, const T state)
{
os << name(state);
return os;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
| 58.526316
| 116
| 0.54429
|
pree
|
82819dcf2d376631ed1516b6d9d69c02ba8e71e6
| 4,799
|
cpp
|
C++
|
bbs/bbsovl3.cpp
|
k5jat/wwiv
|
b390e476c75f68e0f4f28c66d4a2eecd74753b7c
|
[
"Apache-2.0"
] | null | null | null |
bbs/bbsovl3.cpp
|
k5jat/wwiv
|
b390e476c75f68e0f4f28c66d4a2eecd74753b7c
|
[
"Apache-2.0"
] | null | null | null |
bbs/bbsovl3.cpp
|
k5jat/wwiv
|
b390e476c75f68e0f4f28c66d4a2eecd74753b7c
|
[
"Apache-2.0"
] | null | null | null |
/**************************************************************************/
/* */
/* WWIV Version 5.x */
/* Copyright (C)1998-2017, WWIV Software Services */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, */
/* software distributed under the License is distributed on an */
/* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, */
/* either express or implied. See the License for the specific */
/* language governing permissions and limitations under the License. */
/* */
/**************************************************************************/
#include <string>
#include "bbs/bbsovl3.h"
#include "bbs/bbs.h"
#include "bbs/com.h"
#include "bbs/bgetch.h"
#include "bbs/utility.h"
#include "core/strings.h"
#include "core/wwivassert.h"
#include "local_io/keycodes.h"
#include "local_io/wconstants.h"
using std::string;
using namespace wwiv::core;
bool do_sysop_command(int nCommandID) {
unsigned int nKeyStroke = 0;
bool bNeedToRedraw = false;
switch (nCommandID) {
// Commands that cause screen to need to be redrawn go here
case COMMAND_F1:
case COMMAND_CF1:
case COMMAND_CF9:
case COMMAND_F10:
case COMMAND_CF10:
bNeedToRedraw = true;
nKeyStroke = nCommandID - 256;
break;
// Commands that don't change the screen around
case COMMAND_SF1:
case COMMAND_F2:
case COMMAND_SF2:
case COMMAND_CF2:
case COMMAND_F3:
case COMMAND_SF3:
case COMMAND_CF3:
case COMMAND_F4:
case COMMAND_SF4:
case COMMAND_CF4:
case COMMAND_F5:
case COMMAND_SF5:
case COMMAND_CF5:
case COMMAND_F6:
case COMMAND_SF6:
case COMMAND_CF6:
case COMMAND_F7:
case COMMAND_SF7:
case COMMAND_CF7:
case COMMAND_F8:
case COMMAND_SF8:
case COMMAND_CF8:
case COMMAND_F9:
case COMMAND_SF9:
case COMMAND_SF10:
bNeedToRedraw = false;
nKeyStroke = nCommandID - 256;
break;
default:
nKeyStroke = 0;
break;
}
if (nKeyStroke) {
if (bNeedToRedraw) {
bout.cls();
}
a()->handle_sysop_key(static_cast<uint8_t>(nKeyStroke));
if (bNeedToRedraw) {
bout.cls();
}
}
return bNeedToRedraw;
}
/**
* copyfile - Copies a file from one location to another
*
* @param input - fully-qualified name of the source file
* @param output - fully-qualified name of the destination file
* @param stats - if true, print stuff to the screen
*
* @return - false on failure, true on success
*
*/
bool copyfile(const string& sourceFileName, const string& destFileName, bool stats) {
if (stats) {
bout << "|#7File movement ";
}
if ((sourceFileName != destFileName) &&
File::Exists(sourceFileName) &&
!File::Exists(destFileName)) {
if (File::Copy(sourceFileName, destFileName)) {
return true;
}
}
return false;
}
/**
* movefile - Moves a file from one location to another
*
* @param src - fully-qualified name of the source file
* @param dst - fully-qualified name of the destination file
* @param stats - if true, print stuff to the screen (not used)
*
* @return - false on failure, true on success
*
*/
bool movefile(const string& sourceFileName, const string& destFileName, bool stats) {
if (sourceFileName != destFileName && File::Exists(sourceFileName)) {
bool bCanUseRename = false;
if (sourceFileName[1] != ':' && destFileName[1] != ':') {
bCanUseRename = true;
}
if (sourceFileName[1] == ':' && destFileName[1] == ':' && sourceFileName[0] == destFileName[0]) {
bCanUseRename = true;
}
if (bCanUseRename) {
File::Rename(sourceFileName, destFileName);
if (File::Exists(destFileName)) {
return false;
}
}
}
bool bCopyFileResult = copyfile(sourceFileName, destFileName, stats);
File::Remove(sourceFileName);
return bCopyFileResult;
}
void ListAllColors() {
bout.nl();
for (int i = 0; i < 128; i++) {
if ((i % 26) == 0) {
bout.nl();
}
bout.SystemColor(i);
bout.bprintf("%3d", i);
}
bout.Color(0);
bout.nl();
}
| 28.39645
| 101
| 0.567618
|
k5jat
|
8282d4c4db6081ac3ac6867261d931c13819bf34
| 3,392
|
cc
|
C++
|
IntegrationWithMacSim/src/memreq_info.cc
|
uwuser/MCsim
|
df0033e73aa7669fd89bc669ff25a659dbb253f6
|
[
"MIT"
] | 1
|
2021-11-25T20:09:08.000Z
|
2021-11-25T20:09:08.000Z
|
IntegrationWithMacSim/src/memreq_info.cc
|
uwuser/MCsim
|
df0033e73aa7669fd89bc669ff25a659dbb253f6
|
[
"MIT"
] | 1
|
2021-11-03T21:15:53.000Z
|
2021-11-04T15:53:20.000Z
|
IntegrationWithMacSim/src/memreq_info.cc
|
uwuser/MCsim
|
df0033e73aa7669fd89bc669ff25a659dbb253f6
|
[
"MIT"
] | 1
|
2020-11-25T14:09:30.000Z
|
2020-11-25T14:09:30.000Z
|
/*
Copyright (c) <2012>, <Georgia Institute of Technology> All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials provided
with the distribution.
Neither the name of the <Georgia Institue of Technology> nor the names of its contributors
may be used to endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/**********************************************************************************************
* File : memreq_info.cc
* Author : Hyesoon Kim
* Date : 3/20/2008
* SVN : $Id: memreq_info.h,v 1.5 2008-09-17 21:01:41 kacear Exp $:
* Description : Memory request information
*********************************************************************************************/
#include "memreq_info.h"
// memory request type string
const char* mem_req_c::mem_req_type_name[MAX_MEM_REQ_TYPE] = {
"IFETCH",
"DFETCH",
"DSTORE",
"IPRF",
"DPRF",
"WB",
"SW_DPRF",
"SW_DPRF_NTA",
"SW_DPRF_T0",
"SW_DPRF_T1",
"SW_DPRF_T2",
};
// memory request state string
const char* mem_req_c::mem_state[MEM_STATE_MAX] = {
"MEM_INV",
"MEM_NEW",
"MEM_MERGED",
"MEM_OUTQUEUE_NEW",
"MEM_IN_NOC",
"MEM_OUT_FILL",
"MEM_OUT_WB",
"MEM_FILL_NEW",
"MEM_FILL_WAIT_DONE",
"MEM_FILL_WAIT_FILL",
"MEM_DRAM_START",
"MEM_DRAM_CMD",
"MEM_DRAM_DATA",
"MEM_DRAM_DONE",
"MEM_NOC_START",
"MEM_NOC_DONE",
};
mem_req_s::mem_req_s(macsim_c* simBase)
{
m_id = 0;
m_appl_id = 0;
m_core_id = 0;
m_thread_id = 0;
m_block_id = 0;
m_state = MEM_INV;
m_type = MRT_IFETCH;
m_priority = 0;
m_addr = 0;
m_size = 0;
m_rdy_cycle = 0;
m_pc = 0;
m_prefetcher_id = 0;
m_pref_loadPC = 0;
m_ptx = false;
m_queue = NULL;
for (int ii = 0; ii < MEM_LAST; ++ii)
m_cache_id[ii] = 0;
m_uop = NULL;
m_in = 0;
m_dirty = false;
m_done = false;
m_merged_req = NULL;
m_msg_type = 0;
m_msg_src = 0;
m_msg_dst = 0;
m_done_func = NULL;
m_bypass = 0;
m_simBase = simBase;
}
| 30.285714
| 95
| 0.634434
|
uwuser
|
8282ffc688bf4fc37c1270dbb8bcea6f20d6bb02
| 7,916
|
cpp
|
C++
|
src/e131_receiver.cpp
|
shenghaoyang/e131_blinkt
|
79db8d2cde6b5ba39316b16fb809384790e86b4d
|
[
"MIT"
] | null | null | null |
src/e131_receiver.cpp
|
shenghaoyang/e131_blinkt
|
79db8d2cde6b5ba39316b16fb809384790e86b4d
|
[
"MIT"
] | null | null | null |
src/e131_receiver.cpp
|
shenghaoyang/e131_blinkt
|
79db8d2cde6b5ba39316b16fb809384790e86b4d
|
[
"MIT"
] | null | null | null |
/**
* \file e131_receiver.cpp
*
* \copyright Shenghao Yang, 2018
*
* See LICENSE for details
*/
#include <e131_receiver.hpp>
namespace e131_receiver
{
std::string
cid_str(const cid& uuid)
{
std::string s;
static constexpr std::array<char, 16> hex_lut{'0', '1', '2', '3', '4', '5',
'6', '7', '8', '9', 'a', 'b',
'c', 'd', 'e', 'f'};
s.reserve(34);
s.append("0x");
for (const auto b : uuid) {
std::uint8_t msnibble{static_cast<std::uint8_t>((b & 0xf0) >> 0x04)};
std::uint8_t lsnibble{static_cast<std::uint8_t>(b & 0x0f)};
s.push_back(hex_lut[msnibble]);
s.push_back(hex_lut[lsnibble]);
}
return s;
}
unique_fd::~unique_fd() noexcept
{
if (fd != -1) close(fd);
}
priority::priority()
{
prio_cnt[minimum_priority] = 1;
}
priority::operator priority::priority_type() const noexcept
{
return prio_cnt.crbegin()->first;
}
priority::priority_type
priority::add(priority_type p)
{
++prio_cnt[p];
return *this;
}
priority::priority_type
priority::remove(priority_type p)
{
--prio_cnt[p];
if (prio_cnt[p] <= 0) prio_cnt.erase(p);
return *this;
}
priority::count_type
priority::sources() const noexcept
{
return (*this == minimum_priority) ? prio_cnt.rbegin()->second - 1
: prio_cnt.rbegin()->second;
}
priority::count_type
priority::total_sources() const noexcept
{
return (std::accumulate(prio_cnt.cbegin(), prio_cnt.cend(), count_type{},
[](const auto& count, const auto& pair) {
return (count + pair.second);
}) -
1);
}
channel_data_updated_event::channel_data_updated_event(const cid& uuid)
: update_event{update_event::event_type::CHANNEL_DATA_UPDATED, uuid}
{
}
source_added_event::source_added_event(const cid& uuid)
: update_event{update_event::event_type::SOURCE_ADDED, uuid}
{
}
source_removed_event::source_removed_event(const cid& uuid)
: update_event{update_event::event_type::SOURCE_REMOVED, uuid}
{
}
source_limit_reached_event::source_limit_reached_event(const cid& uuid)
: update_event{update_event::event_type::SOURCE_LIMIT_REACHED, uuid}
{
}
void
universe::add_source(const cid& uuid, const e131_packet_t& pkt)
{
if (srcs.size() == max_sources) throw source_limit_reached_event{uuid};
int r;
std::uint64_t now;
if ((r = sd_event_now(ev.get(), CLOCK_MONOTONIC, &now)) < 0)
throw std::system_error{-r, std::system_category()};
sd_event_source* evs;
if ((r = sd_event_add_time(
ev.get(), &evs, CLOCK_MONOTONIC,
now + ms_to_us<std::uint64_t>(network_data_loss_timeout),
0, timer_callback, this)) < 0)
throw std::system_error{-r, std::system_category()};
prio.add(pkt.frame.priority);
srcs.try_emplace(
uuid,
source{uuid, pkt.frame.priority, pkt.frame.seq_number, 0,
std::unique_ptr<sd_event_source, deleters::sd_event_source>{evs}});
evs_cid.try_emplace(evs, uuid);
queued_events.push_back(source_added_event{uuid});
}
void
universe::source_timer_reset(const source& src)
{
int r;
std::uint64_t now;
if ((r = sd_event_now(ev.get(), CLOCK_MONOTONIC, &now)) < 0)
throw std::system_error{-r, std::system_category()};
if ((r = sd_event_source_set_time(
src.timer_evs.get(),
now + ms_to_us<std::uint64_t>(network_data_loss_timeout))) < 0)
throw std::system_error{-r, std::system_category()};
}
void
universe::remove_source(const source& src)
{
auto uuid{src.uuid};
prio.remove(src.prio);
evs_cid.erase(src.timer_evs.get());
srcs.erase(src.uuid);
queued_events.push_back(source_removed_event{uuid});
}
auto
universe::valid_packet(const e131_packet_t& pkt) const
{
if ((e131_pkt_validate(&pkt) == E131_ERR_NONE) &&
(be32toh(pkt.root.vector) == e131_data_vector) &&
(be16toh(pkt.frame.universe) == uni) &&
((!e131_get_option(&pkt, E131_OPT_PREVIEW) || ignore_preview_flag)))
return true;
return false;
}
int
universe::timer_callback(sd_event_source* const s, std::uint64_t usec,
void* userdata) noexcept
{
auto& uni{*reinterpret_cast<universe* const>(userdata)};
auto& src{uni.srcs[uni.evs_cid.at(s)]};
try {
uni.remove_source(src);
} catch (const std::exception& e) {
sd_event_exit(uni.ev.get(), -1);
return -1;
}
return 0;
}
bool
universe::socket_handler(std::uint32_t revents) noexcept
{
try {
if (revents & EPOLLERR) throw std::runtime_error{"error on E1.31 socket"};
/* Other EPOLL events don't happen for UDP sockets */
do {
e131_packet_t pkt;
::ssize_t r{e131_recv(e131_socket, &pkt)};
if (r == -1) {
if ((errno != EWOULDBLOCK) && (errno != EAGAIN))
throw std::system_error{errno, std::system_category()};
break;
}
if (!valid_packet(pkt)) break;
cid uuid{pkt.root.cid, pkt.root.cid + sizeof(pkt.root.cid)};
bool terminated{e131_get_option(&pkt, E131_OPT_TERMINATED)};
bool registered_source{srcs.find(uuid) != srcs.end()};
if (registered_source) {
auto& src{srcs[uuid]};
if (e131_pkt_discard(&pkt, src.sequence_data)) break;
if (terminated) remove_source(src);
if (pkt.frame.priority != src.prio) {
prio.remove(src.prio);
prio.add(pkt.frame.priority);
src.prio = pkt.frame.priority;
}
} else if (terminated) {
break;
} else {
add_source(uuid, pkt);
}
auto& src{srcs[uuid]};
source_timer_reset(src);
if ((pkt.frame.priority >= prio) && pkt.dmp.prop_val_cnt &&
(pkt.dmp.prop_val[0] == 0x00)) {
std::copy(pkt.dmp.prop_val + 1,
pkt.dmp.prop_val + be16toh(pkt.dmp.prop_val_cnt),
channel_data.data());
queued_events.push_back(channel_data_updated_event{uuid});
}
src.sequence_data = pkt.frame.seq_number;
} while (true);
} catch (const std::exception& e) {
return false;
}
return true;
}
int
universe::socket_callback(sd_event_source* s, int fd, std::uint32_t revents,
void* userdata) noexcept
{
universe& uni{*reinterpret_cast<universe* const>(userdata)};
if (!uni.socket_handler(revents)) {
sd_event_exit(uni.ev.get(), -1);
return -1;
}
return 0;
}
universe::universe(priority::count_type sources, bool preview_flag_ignore,
int universe_num)
: max_sources{sources}, ignore_preview_flag{preview_flag_ignore},
uni{universe_num}, e131_socket{::e131_socket()}
{
int r;
sd_event* evp;
if ((e131_socket == -1) ||
(::e131_bind(e131_socket, E131_DEFAULT_PORT) == -1))
throw std::system_error{errno, std::system_category()};
int flags{fcntl(e131_socket, F_GETFL)};
if (flags == -1) throw std::system_error{errno, std::system_category()};
if (fcntl(e131_socket, F_SETFL, flags | O_NONBLOCK))
throw std::system_error{errno, std::system_category()};
if ((r = sd_event_new(&evp)) < 0)
throw std::system_error{-r, std::system_category()};
ev.reset(evp);
if ((r = sd_event_add_io(ev.get(), nullptr, e131_socket, EPOLLIN | EPOLLERR,
socket_callback, this)) < 0)
throw std::system_error{-r, std::system_category()};
}
int
universe::event_fd() const noexcept
{
return sd_event_get_fd(ev.get());
}
const std::vector<update_event>&
universe::update()
{
int r;
queued_events.clear();
while ((r = sd_event_run(ev.get(), 0)) > 0)
;
if (r < 0) throw std::system_error{-r, std::system_category()};
return queued_events;
}
const priority&
universe::prio_tracker() const noexcept
{
return prio;
}
const universe::channel_data_type&
universe::dmx_data() const noexcept
{
return channel_data;
}
} // namespace e131_receiver
| 25.371795
| 80
| 0.637696
|
shenghaoyang
|
82860f338280150e082386907a277869f1a12a47
| 76,437
|
cpp
|
C++
|
libdqmc/cx_dqmc_greens_general_renyi.cpp
|
pebroecker/DQMC
|
c4a96cb20347ef722b6ae68c415233d464c89e93
|
[
"BSD-3-Clause"
] | null | null | null |
libdqmc/cx_dqmc_greens_general_renyi.cpp
|
pebroecker/DQMC
|
c4a96cb20347ef722b6ae68c415233d464c89e93
|
[
"BSD-3-Clause"
] | null | null | null |
libdqmc/cx_dqmc_greens_general_renyi.cpp
|
pebroecker/DQMC
|
c4a96cb20347ef722b6ae68c415233d464c89e93
|
[
"BSD-3-Clause"
] | null | null | null |
#include "cx_dqmc_greens_general_renyi.hpp"
using namespace std;
void cx_dqmc::greens_general_renyi::initialize() {
vol = p->n_A + 2 * p->n_B;
sites = ws->sites;
if (p->update_type == p->CX_SPINFUL_UPDATE) {
delayed_buffer_size = min(200, sites/2);
}
else if (p->update_type == p->CX_SPINLESS_UPDATE) {
delayed_buffer_size = min(50, ws->num_bonds);
}
if (delayed_buffer_size % 2 != 0) {
++delayed_buffer_size; }
X.resize(vol, delayed_buffer_size);
Y.resize(vol, delayed_buffer_size);
X_sls.resize(vol, 2);
Y_sls.resize(vol, 2);
Y_sls_row_1.resize(2, vol);
Y_sls_row_2.resize(2, vol);
u_temp.resize(p->N, p->N);
d_temp.resize(p->N);
t_temp.resize(p->N, p->N);
slices = p->slices;
safe_mult = p->safe_mult;
greens.resize(vol, vol);
prop_greens.resize(vol, vol);
temp_greens.resize(vol, vol);
first_initialization = true;
}
void cx_dqmc::greens_general_renyi::set_greens(cx_dqmc::greens_general * gs_0_,
cx_dqmc::greens_general * gs_1_) {
gs_0 = gs_0_;
gs_1 = gs_1_;
}
void cx_dqmc::greens_general_renyi::build_stack() {
direction = 1;
if (first_initialization == true) {
vol = ws->vol;
sites = ws->sites;
n_elements = (2 * slices) / p->safe_mult;
chunks = n_elements;
for (int i = 0; i < n_elements; ++i) {
stability.push_back(0);
}
try {
Ul.resize(vol, vol);
Um.resize(vol, vol);
Ur.resize(vol, vol);
Tl.resize(vol, vol);
Tm.resize(vol, vol);
Tr.resize(vol, vol);
Dl.resize(vol);
Dm.resize(vol);
Dr.resize(vol);
Us.push_back(&Ur);
Us.push_back(&Ul);
Ds.push_back(&Dr);
Ds.push_back(&Dl);
Ts.push_back(&Tr);
Ts.push_back(&Tl);
large_mats.push_back(&ws->large_mat_1);
large_mats.push_back(&ws->large_mat_2);
large_mats.push_back(&ws->large_mat_3);
large_mats.push_back(&ws->large_mat_4);
large_mats.push_back(&ws->large_mat_5);
large_vecs.push_back(&ws->large_vec_1);
large_vecs.push_back(&ws->large_vec_2);
large_vecs.push_back(&ws->large_vec_3);
} catch (const std::bad_alloc&) {
cout << "bad alloc when initializing additional items" << endl;
throw std::bad_alloc();
}
}
direction = 1;
current_slice = 0;
gs_0->build_stack();
gs_1->build_stack();
if (gs_0->current_slice != 0 || gs_0->direction != 1
|| gs_1->current_slice != 0 || gs_1->direction != 1) {
throw std::runtime_error("general_renyi: slice and directions incorrect");
}
alps::RealObservable dummy("dummy");
for (int i = 0; i < 3 * slices; ++i) {
propagate(dummy);
}
// cout << p->outp << "Log weight" << endl;
// log_weight();
// propagate(dummy);
if (first_initialization) {
if (greens.rows() < 10) {
cout << greens.trace() << " is renyi trace" << endl;
cout << greens << endl;
}
}
first_initialization = false;
}
int cx_dqmc::greens_general_renyi::propagate(alps::Observable& stability) {
greens_general * gs;
int offset;
if (current_slice < slices) {
gs = gs_0;
offset = 0;
} else {
gs = gs_1;
offset = slices;
}
int ret = gs->propagate(stability);
if ((current_slice + direction) % slices != gs->current_slice) {
cout << p->outp << direction << " - " << current_slice << "\tvs\t"
<< gs->direction << " - " << gs->current_slice << endl;
throw std::runtime_error("propagate: invalid slice");
}
if (direction != gs->direction) {
cout << p->outp << direction << " - " << current_slice << "\tvs\t"
<< gs->direction << " - " << gs->current_slice << endl;
throw std::runtime_error("propagate: invalid direction");
}
if (ret == 1) {
if (direction == -1) {
current_slice = gs->current_slice + offset;
slice_matrix_left_renyi(current_slice, greens, true);
slice_matrix_right_renyi(current_slice, greens, false);
return 1;
} else {
current_slice = gs->current_slice + offset;
slice_matrix_right_renyi(current_slice - 1, greens, true);
slice_matrix_left_renyi(current_slice - 1, greens, false);
}
}
else if (ret == 2) {
if (direction == -1) {
current_slice = gs_0->current_slice + 1;
calculate_greens();
check_stability();
--current_slice;
slice_matrix_left_renyi(current_slice, greens, true);
slice_matrix_right_renyi(current_slice, greens, false);
}
else {
current_slice = gs_0->current_slice - 1;
slice_matrix_right_renyi(current_slice, greens, true);
slice_matrix_left_renyi(current_slice, greens, false);
++current_slice;
temp_greens = greens;
calculate_greens();
check_stability();
}
} else if (ret == 3) {
}
return -1;
}
double cx_dqmc::greens_general_renyi::check_stability() {
static int warnings = 0;
static pdouble_t diff;
static int max_warnings = 8 * slices/safe_mult;
ws->re_mat_1 = (temp_greens - greens).cwiseAbs().real();
diff = ws->re_mat_1.maxCoeff();
if (warnings < max_warnings) {
if (diff > 1e-7) {
++warnings;
cout << p->outp << ws->step << " renyi unstable: "
<< "(" << warnings << ")\t" << direction << "[" << idx << "]\t"
<< current_slice << " / " << slices << "\t";
cout << setw(15) << std::right << diff << endl;
}
} else if (diff > 1e-1) {
++warnings;
cout << p->outp << ws->step << " renyi really unstable: "
<< "(" << warnings << ")\t" << direction << "[" << idx << "]\t"
<< current_slice << " / " << slices << "\t";
cout << setw(15) << std::right << diff << " vs. exact " << endl;
}
return diff;
}
void cx_dqmc::greens_general_renyi::slice_sequence_left(int start, int stop, cx_mat_t& M) {
for (int i = start; i < stop; ++i) { slice_matrix_left(i, M); }
}
void cx_dqmc::greens_general_renyi::slice_sequence_left_renyi(int start, int stop, cx_mat_t& M) {
for (int i = start; i < stop; ++i) { slice_matrix_left_renyi(i, M); }
}
void cx_dqmc::greens_general_renyi::slice_sequence_left_t(int start, int stop, cx_mat_t& M) {
for (int i = stop - 1; i >= start; --i) { slice_matrix_left_t(i, M); }
}
void cx_dqmc::greens_general_renyi::slice_sequence_left_renyi_t(int start, int stop, cx_mat_t& M) {
for (int i = stop - 1; i >= start; --i) { slice_matrix_left_renyi_t(i, M); }
}
void cx_dqmc::greens_general_renyi::slice_sequence_right(int start, int stop, cx_mat_t& M) {
for (int i = stop - 1; i >= start; --i) { slice_matrix_left_t(i, M); }
}
void cx_dqmc::greens_general_renyi::slice_matrix_left(int slice, cx_mat_t& M, bool inv) {
int s = slice % slices;
int replica = slice / slices;
if (inv == false) {
cx_dqmc::interaction::interaction_left(p, reg_ws, M, reg_ws->vec_1,
(*aux_spins)[replica][s], 1., 0);
cx_dqmc::checkerboard::hop_left(reg_ws, M, 1.);
} else {
cx_dqmc::checkerboard::hop_left(reg_ws, M, -1.);
cx_dqmc::interaction::interaction_left(p, reg_ws, M, reg_ws->vec_1,
(*aux_spins)[replica][s], -1., 0);
}
}
void cx_dqmc::greens_general_renyi::slice_matrix_left_t(int slice, cx_mat_t& M, bool inv) {
int s = slice % slices;
int replica = slice / slices;
if (inv == false) {
cx_dqmc::checkerboard::hop_left(reg_ws, M, 1.);
cx_dqmc::interaction::interaction_left(p, reg_ws, M, reg_ws->vec_1,
(*aux_spins)[replica][s], 1., 0);
} else {
cx_dqmc::interaction::interaction_left(p, reg_ws, M, reg_ws->vec_1,
(*aux_spins)[replica][s], -1., 0);
cx_dqmc::checkerboard::hop_left(reg_ws, M, -1.);
}
}
void cx_dqmc::greens_general_renyi::slice_matrix_left_renyi(int slice, cx_mat_t& M, bool inv) {
int replica = slice / slices;
int s = slice % slices;
if (inv == false) {
cx_dqmc::interaction::interaction_left(p, ws, M, ws->vec_1,
((*aux_spins))[replica][s],
1, replica);
cx_dqmc::checkerboard::hop_left_renyi(ws, M, 1.,
(2 * slice) / slices);
} else {
cx_dqmc::checkerboard::hop_left_renyi(ws, M, -1.,
(2 * slice) / slices);
cx_dqmc::interaction::interaction_left(p, ws, M, ws->vec_1,
((*aux_spins))[replica][s],
-1., replica);
}
}
void cx_dqmc::greens_general_renyi::slice_matrix_left_renyi_t(int slice, cx_mat_t& M, bool inv) {
int s = slice % slices;
int replica = slice / slices;
if (inv == false) {
cx_dqmc::checkerboard::hop_left_renyi(ws, M, 1., (2 * slice) / slices);
cx_dqmc::interaction::interaction_left(p, ws, M, ws->vec_1,
(*aux_spins)[replica][s], 1., replica);
} else {
cx_dqmc::interaction::interaction_left(p, ws, M, ws->vec_1,
(*aux_spins)[replica][s], -1., replica);
cx_dqmc::checkerboard::hop_left_renyi(ws, M, -1., (2 * slice) / slices);
}
}
void cx_dqmc::greens_general_renyi::slice_matrix_right(int slice, cx_mat_t& M, bool inv) {
int s = slice % slices;
int replica = slice / slices;
if (inv == false) {
cx_dqmc::checkerboard::hop_right(reg_ws, M, 1.);
cx_dqmc::interaction::interaction_right(p, reg_ws, M, reg_ws->vec_1,
(*aux_spins)[replica][s], 1., 0);
} else {
cx_dqmc::interaction::interaction_right(p, reg_ws, M, reg_ws->vec_1,
(*aux_spins)[replica][s], -1., 0);
cx_dqmc::checkerboard::hop_right(reg_ws, M, -1.);
}
}
void cx_dqmc::greens_general_renyi::slice_matrix_right_renyi(int slice, cx_mat_t& M, bool inv) {
int replica = slice / slices;
int s = slice % slices;
if (inv == false) {
cx_dqmc::checkerboard::hop_right_renyi(ws, M, 1.,
(2 * slice) / slices);
cx_dqmc::interaction::interaction_right(p, ws, M, ws->vec_1,
(*aux_spins)[replica][s],
1, replica);
} else {
cx_dqmc::interaction::interaction_right(p, ws, M, ws->vec_1,
(*aux_spins)[replica][s],
-1., replica);
cx_dqmc::checkerboard::hop_right_renyi(ws, M, -1.,
(2 * slice) / slices);
}
}
void cx_dqmc::greens_general_renyi::hopping_matrix_left(int slice, cx_mat_t& M, bool inv) {
int s = slice % slices;
if (inv == false) {
cx_dqmc::checkerboard::hop_left(reg_ws, M, 1.);
} else {
cx_dqmc::checkerboard::hop_left(reg_ws, M, -1.);
}
}
void cx_dqmc::greens_general_renyi::hopping_matrix_right(int slice, cx_mat_t& M, bool inv) {
int s = slice % slices;
if (inv == false) {
cx_dqmc::checkerboard::hop_right(reg_ws, M, 1.);
} else {
cx_dqmc::checkerboard::hop_right(reg_ws, M, -1.);
}
}
void cx_dqmc::greens_general_renyi::hopping_matrix_left_renyi(int slice, cx_mat_t& M, bool inv) {
int s = slice / slices;
if (inv == false) {
cx_dqmc::checkerboard::hop_left_renyi(ws, M, 1., (2 * slice) / slices);
} else {
cx_dqmc::checkerboard::hop_left_renyi(ws, M, -1., (2 * slice) / slices);
}
}
void cx_dqmc::greens_general_renyi::hopping_matrix_right_renyi(int slice, cx_mat_t& M, bool inv) {
int s = slice / slices;
if (inv == false) {
cx_dqmc::checkerboard::hop_right_renyi(ws, M, 1., (2 * slice) / slices);
} else {
cx_dqmc::checkerboard::hop_right_renyi(ws, M, -1., (2 * slice) / slices);
}
}
void cx_dqmc::greens_general_renyi::regularize_svd(vec_t& in, vec_t& out) {
double length = vol - ws->particles - 1;
double min_log = log10(in.minCoeff()) - 25.;
double max_log = min_log;// min(150., min_log + 2 * length);
for (int i = 0; i < ws->eff_particles; ++i) {
out(i) = in(i);
}
for (int i = ws->eff_particles; i < vol; ++i) {
out(i) = pow(10, min_log);
}
}
void cx_dqmc::greens_general_renyi::log_weight() {
fresh_det = true;
if (current_slice % (slices / 2) != 0) {
throw std::runtime_error("Not at the correct time "
"slice to calculate the log weight");
}
int is[4], rs[4];
is[0] = 0;
is[1] = chunks / 2 - 1;
is[2] = chunks / 2;
is[3] = chunks - 1;
rs[0] = 0;
rs[1] = 0;
rs[2] = 1;
rs[3] = 1;
try {
dqmc::la::thin_col_to_invertible(u_stack[is[3]], reg_ws->mat_8);
enlarge_thin_ized_col(rs[3], reg_ws->mat_8, ws->mat_8);
dqmc::la::thin_col_to_invertible(u_stack[is[2]], reg_ws->mat_6);
enlarge_thin_ized_col(rs[2], reg_ws->mat_6, ws->mat_6);
dqmc::la::thin_col_to_invertible(u_stack[is[1]], reg_ws->mat_4);
enlarge_thin_ized_col(rs[1], reg_ws->mat_4, ws->mat_4);
dqmc::la::thin_col_to_invertible(u_stack[is[0]], reg_ws->mat_2);
enlarge_thin_ized_col(rs[0], reg_ws->mat_2, ws->mat_2);
enlarge_thin(rs[3], d_stack[is[3]], ws->re_tiny_vec_4);
regularize_svd(ws->re_tiny_vec_4, ws->re_vec_4);
enlarge_thin(rs[3], t_stack[is[3]], ws->mat_7);
enlarge_thin(rs[2], d_stack[is[2]], ws->re_tiny_vec_3);
regularize_svd(ws->re_tiny_vec_3, ws->re_vec_3);
enlarge_thin(rs[2], t_stack[is[2]], ws->mat_5);
enlarge_thin(rs[1], d_stack[is[1]], ws->re_tiny_vec_2);
regularize_svd(ws->re_tiny_vec_2, ws->re_vec_2);
enlarge_thin(rs[1], t_stack[is[1]], ws->mat_3);
enlarge_thin(rs[0], d_stack[is[0]], ws->re_tiny_vec_1);
regularize_svd(ws->re_tiny_vec_1, ws->re_vec_1);
enlarge_thin(rs[0], t_stack[is[0]], ws->mat_1);
} catch (const std::bad_alloc&) {
throw std::runtime_error("Enlaring matrices failed with bad_alloc");
}
static cx_mat large_mat_1;
static cx_mat large_mat_2;
static cx_mat large_mat_3;
static vec large_vec_1;
try {
if (large_mat_1.rows() != 4 * vol) {
large_mat_1.resize(4 * vol, 4 * vol);
large_mat_2.resize(4 * vol, 4 * vol);
large_mat_3.resize(4 * vol, 4 * vol);
large_vec_1.resize(4 * vol);
}
} catch (const std::bad_alloc&) {
throw std::runtime_error("Resizing matrices failed with bad_alloc");
}
static Eigen::FullPivLU<cx_mat_t> lu1(vol, vol);
static Eigen::FullPivLU<cx_mat_t> lu2(vol, vol);
static Eigen::FullPivLU<cx_mat_t> large_lu(4 * vol, 4 * vol);
large_mat_1.setZero();
det_sign = cx_double(1.0, 0);
lu1.compute(ws->mat_8); lu2.compute(ws->mat_2.transpose());
large_mat_1.block(0, 0, vol, vol) = lu1.inverse() * lu2.inverse();
det_sign *= lu1.determinant() * (lu2.determinant());
if (fabs(fabs(det_sign) - 1) > 1e-9) {
cout << u_stack[is[3]] << endl << endl;
cout << reg_ws->mat_8 << endl << endl;
cout << ws->mat_8 << endl << endl;
cout << p->outp << "log_weight(): abs det is not one " << det_sign << endl;
}
// cout << "current det sign\t" << det_sign << endl;
lu1.compute(ws->mat_1.transpose()); lu2.compute(ws->mat_3);
large_mat_1.block(vol, vol, vol, vol) = lu1.inverse() * lu2.inverse();
det_sign *= (lu1.determinant()) * (lu2.determinant());
if (fabs(fabs(det_sign) - 1) > 1e-9)
cout << p->outp << "log_weight(): abs det is not one" << endl;
// cout << "current det sign\t" << det_sign << endl;
lu1.compute(ws->mat_4); lu2.compute(ws->mat_6.transpose());
large_mat_1.block(2*vol, 2*vol, vol, vol) = lu1.inverse() * lu2.inverse();
det_sign *= (lu1.determinant()) * (lu2.determinant());
if (fabs(fabs(det_sign) - 1) > 1e-9)
cout << p->outp << "log_weight(): abs det is not one" << endl;
// cout << "current det sign\t" << det_sign << endl;
lu1.compute(ws->mat_5.transpose()); lu2.compute(ws->mat_7);
large_mat_1.block(3*vol, 3*vol, vol, vol) = lu1.inverse() * lu2.inverse();
det_sign *= (lu1.determinant()) * (lu2.determinant());
if (fabs(fabs(det_sign) - 1) > 1e-9)
cout << p->outp << "log_weight(): abs det is not one" << endl;
// cout << "current det sign\t" << det_sign << endl;
large_mat_1.block(0, 3*vol, vol, vol).diagonal().real()
= ws->re_vec_4;
large_mat_1.block(vol, 0, vol, vol).diagonal().real()
= -ws->re_vec_1;
large_mat_1.block(2 * vol, vol, vol, vol).diagonal().real()
= -ws->re_vec_2;
large_mat_1.block(3 * vol, 2 * vol, vol, vol).diagonal().real()
= -ws->re_vec_3;
dqmc::la::decompose_udt_col_piv(large_mat_1, large_mat_2, large_vec_1, large_mat_3);
large_lu.compute(large_mat_2);
det_sign *= (large_lu.determinant());
// cout << "current det sign\t" << det_sign << endl;
if (fabs(fabs(det_sign) - 1) > 1e-9) cout << p->outp << "log_weight(): abs det is not one" << endl;
large_lu.compute(large_mat_3);
det_sign *= (large_lu.determinant());
// cout << "current det sign\t" << det_sign << endl;
if (fabs(fabs(det_sign) - 1) > 1e-9) cout << p->outp << "log_weight(): abs det is not one" << endl;
dqmc::la::log_sum(large_vec_1, log_det);
// cout << "and the logdet\t" << log_det << endl;
double prefactor_spin_sum = 0.;
for(auto i = aux_spins->origin(); i < (aux_spins->origin() + aux_spins->num_elements()); ++i) {
prefactor_spin_sum += double(*i);
}
// prefactor_spin_sum = 0.;
// for (uint s = 0; s < p->slices; s++) {
// for (int i = 0; i < p->num_aux_spins; i++) {
// prefactor_spin_sum += (*aux_spins)[0][s][i];
// prefactor_spin_sum += (*aux_spins)[1][s][i];
// }
// }
phase = std::exp(-1. * prefactor_spin_sum * p->cx_osi_lambda);
}
void cx_dqmc::greens_general_renyi::calculate_greens_general() {
// boost::timer::auto_cpu_timer t;
// cout << "greens_general_renyi::calculate_greens_general()\t";
int is[5], rs[5];
Us.clear();
Ds.clear();
Ts.clear();
large_mats.clear();
large_vecs.clear();
U_is_unitary.clear();
T_is_unitary.clear();
if (current_slice % slices == 0) {
if ((direction == 1 && current_slice == 0) ||
(direction == -1 && current_slice == 2 * slices)) {
is[0] = 0;
is[1] = chunks / 2 - 1;
is[2] = chunks / 2;
is[3] = chunks - 1;
rs[0] = 0;
rs[1] = 0;
rs[2] = 1;
rs[3] = 1;
}
else {
is[0] = chunks / 2;
is[1] = chunks - 1;
is[2] = 0;
is[3] = chunks / 2 - 1;
rs[0] = 1;
rs[1] = 1;
rs[2] = 0;
rs[3] = 0;
}
dqmc::la::thin_col_to_invertible(u_stack[is[3]], reg_ws->mat_8);
enlarge_thin_ized_col(rs[3], reg_ws->mat_8, ws->mat_8);
dqmc::la::thin_col_to_invertible(u_stack[is[2]], reg_ws->mat_6);
enlarge_thin_ized_col(rs[2], reg_ws->mat_6, ws->mat_6);
dqmc::la::thin_col_to_invertible(u_stack[is[1]], reg_ws->mat_4);
enlarge_thin_ized_col(rs[1], reg_ws->mat_4, ws->mat_4);
dqmc::la::thin_col_to_invertible(u_stack[is[0]], reg_ws->mat_2);
enlarge_thin_ized_col(rs[0], reg_ws->mat_2, ws->mat_2);
enlarge_thin(rs[3], d_stack[is[3]], ws->re_tiny_vec_4);
regularize_svd(ws->re_tiny_vec_4, ws->re_vec_4);
enlarge_thin(rs[3], t_stack[is[3]], ws->mat_7);
enlarge_thin(rs[2], d_stack[is[2]], ws->re_tiny_vec_3);
regularize_svd(ws->re_tiny_vec_3, ws->re_vec_3);
enlarge_thin(rs[2], t_stack[is[2]], ws->mat_5);
enlarge_thin(rs[1], d_stack[is[1]], ws->re_tiny_vec_2);
regularize_svd(ws->re_tiny_vec_2, ws->re_vec_2);
enlarge_thin(rs[1], t_stack[is[1]], ws->mat_3);
enlarge_thin(rs[0], d_stack[is[0]], ws->re_tiny_vec_1);
regularize_svd(ws->re_tiny_vec_1, ws->re_vec_1);
enlarge_thin(rs[0], t_stack[is[0]], ws->mat_1);
ws->la_mat_1 = ws->mat_1;
ws->mat_1 = ws->mat_2.transpose();
ws->mat_2 = ws->la_mat_1.transpose();
ws->la_mat_1 = ws->mat_5;
ws->mat_5 = ws->mat_6.transpose();
ws->mat_6 = ws->la_mat_1.transpose();
Us.push_back(&ws->mat_2); U_is_unitary.push_back(0);
Us.push_back(&ws->mat_4); U_is_unitary.push_back(1);
Us.push_back(&ws->mat_6); U_is_unitary.push_back(0);
Us.push_back(&ws->mat_8); U_is_unitary.push_back(1);
Ts.push_back(&ws->mat_1); T_is_unitary.push_back(1);
Ts.push_back(&ws->mat_3); T_is_unitary.push_back(0);
Ts.push_back(&ws->mat_5); T_is_unitary.push_back(1);
Ts.push_back(&ws->mat_7); T_is_unitary.push_back(0);
Ds.push_back(&ws->re_vec_1);
Ds.push_back(&ws->re_vec_2);
Ds.push_back(&ws->re_vec_3);
Ds.push_back(&ws->re_vec_4);
cx_mat_t large_mat_1 = cx_mat::Zero(4 * vol, 4 * vol);
cx_mat_t large_mat_2 = cx_mat::Zero(4 * vol, 4 * vol);
cx_mat_t large_mat_3 = cx_mat::Zero(4 * vol, 4 * vol);
cx_mat_t large_mat_4 = cx_mat::Zero(4 * vol, 4 * vol);
large_mats.push_back(&large_mat_1);
large_mats.push_back(&large_mat_2);
large_mats.push_back(&large_mat_3);
large_mats.push_back(&large_mat_4);
cx_mat_t large_U = cx_mat_t::Zero(4 * vol, 4 * vol);
cx_mat_t large_T = cx_mat_t::Zero(4 * vol, 4 * vol);
vec_t large_vec_1 = vec_t::Zero(4 * vol);
vec_t large_vec_2 = vec_t::Zero(4 * vol);
vec_t large_vec_3 = vec_t::Zero(4 * vol);
vec_t large_vec_4 = vec_t::Zero(4 * vol);
large_vecs.push_back(&large_vec_1);
large_vecs.push_back(&large_vec_2);
large_vecs.push_back(&large_vec_3);
large_vecs.push_back(&large_vec_4);
// cout << "Full piv from four" << endl;;
// cout << *Ts[0] << endl << endl;
// cout << *Ts[1] << endl << endl;
// cout << *Ts[2] << endl << endl;
// cout << *Ts[3] << endl << endl;
dqmc::calculate_greens::col_piv_qr_partial_piv_lu(Us, U_is_unitary,
Ds,
Ts, T_is_unitary,
large_mats,
large_U, large_T,
large_vecs, *ws,
greens);
}
// 2 * vol - up
else if (direction != 4) {
if ((direction == 1 && (current_slice + 1) < slices / 2
&& current_slice > 0)
|| (direction == 1 && (current_slice + 1) < 3 * (slices / 2)
&& current_slice > slices)) {
// cout << "Combining my way to the top" << endl;
if (current_slice < slices / 2) {
is[0] = current_slice / safe_mult;
is[1] = chunks / 2 - 1;
is[2] = chunks / 2;
is[3] = chunks - 1;
rs[0] = 0;
rs[1] = 0;
rs[2] = 1;
rs[3] = 1;
rs[4] = 0;
}
else {
is[0] = current_slice / safe_mult;
is[1] = chunks - 1;
is[2] = 0;
is[3] = chunks / 2 - 1;
rs[0] = 1;
rs[1] = 1;
rs[2] = 0;
rs[3] = 0;
rs[4] = 1;
}
{
enlarge_thin(rs[0], u_stack[is[0]], ws->col_mat_1);
enlarge_thin(rs[0], d_stack[is[0]], ws->re_tiny_vec_1);
enlarge_thin(rs[0], t_stack[is[0]], ws->tiny_mat_1);
enlarge_thin(rs[1], u_stack[is[1]], ws->col_mat_2);
enlarge_thin(rs[1], d_stack[is[1]], ws->re_tiny_vec_2);
enlarge_thin(rs[1], t_stack[is[1]], ws->tiny_mat_2);
enlarge_thin(rs[2], u_stack[is[2]], ws->col_mat_3);
enlarge_thin(rs[2], d_stack[is[2]], ws->re_tiny_vec_3);
enlarge_thin(rs[2], t_stack[is[2]], ws->tiny_mat_3);
enlarge_thin(rs[3], u_stack[is[3]], ws->col_mat_4);
enlarge_thin(rs[3], d_stack[is[3]], ws->re_tiny_vec_4);
enlarge_thin(rs[3], t_stack[is[3]], ws->tiny_mat_4);
enlarge(rs[4], u_temp, ws->mat_1);
enlarge(rs[4], d_temp, ws->re_vec_1);
enlarge(rs[4], t_temp, ws->mat_2);
//============================================================
ws->col_mat_5 = ws->mat_2 * ws->col_mat_4;
ws->col_mat_4 = ws->re_vec_1.asDiagonal() * ws->col_mat_5;
ws->col_mat_5 = ws->col_mat_4 * ws->re_tiny_vec_4.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->col_mat_5, ws->col_mat_6,
ws->re_tiny_vec_4, ws->tiny_mat_5);
ws->col_mat_4 = ws->mat_1 * ws->col_mat_6;
ws->tiny_mat_6 = ws->tiny_mat_5 * ws->tiny_mat_4;
ws->tiny_mat_5 = ws->tiny_mat_6 * ws->tiny_mat_3.transpose();
ws->tiny_mat_4 = ws->re_tiny_vec_4.asDiagonal() * ws->tiny_mat_5;
ws->tiny_mat_5 = ws->tiny_mat_4 * ws->re_tiny_vec_3.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->tiny_mat_5, ws->tiny_mat_6,
ws->re_tiny_vec_6, ws->tiny_mat_7);
ws->col_mat_5 = ws->col_mat_4 * ws->tiny_mat_6;
dqmc::la::thin_col_to_invertible(ws->col_mat_5, ws->mat_3);
Ul = ws->mat_3;
regularize_svd(ws->re_tiny_vec_6, Dl);
ws->row_mat_1 = ws->tiny_mat_7 * ws->col_mat_3.transpose();
dqmc::la::thin_row_to_invertible(ws->row_mat_1, ws->mat_3);
Tl = ws->mat_3;
//============================================================
ws->tiny_mat_5 = ws->tiny_mat_2 * ws->tiny_mat_1.transpose();
ws->tiny_mat_2 = ws->re_tiny_vec_2.asDiagonal() * ws->tiny_mat_5;
ws->tiny_mat_5 = ws->tiny_mat_2 * ws->re_tiny_vec_1.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->tiny_mat_5,
ws->tiny_mat_6, ws->re_tiny_vec_6,
ws->tiny_mat_7);
ws->col_mat_5 = ws->col_mat_2 * ws->tiny_mat_6;
dqmc::la::thin_col_to_invertible(ws->col_mat_5, ws->mat_3);
Ur = ws->mat_3;
regularize_svd(ws->re_tiny_vec_6, Dr);
ws->col_mat_1 = ws->col_mat_1 * ws->tiny_mat_7.transpose();
ws->row_mat_1 = ws->col_mat_1.transpose();
dqmc::la::thin_row_to_invertible(ws->row_mat_1, ws->mat_3);
Tr = ws->mat_3;
Us.push_back(&Ur); U_is_unitary.push_back(0);
Us.push_back(&Ul); U_is_unitary.push_back(0);
Ds.push_back(&Dr);
Ds.push_back(&Dl);
Ts.push_back(&Tr); T_is_unitary.push_back(0);
Ts.push_back(&Tl); T_is_unitary.push_back(0);
large_mats.push_back(&ws->large_mat_1);
large_mats.push_back(&ws->large_mat_2);
large_mats.push_back(&ws->large_mat_3);
large_vecs.push_back(&ws->large_vec_1);
large_vecs.push_back(&ws->large_vec_2);
large_vecs.push_back(&ws->large_vec_3);
// cout << "greens up" << endl;
// cout << Dr.transpose() << endl;
// cout << Dl.transpose() << endl;
dqmc::calculate_greens::col_piv_qr_partial_piv_lu(Us,
U_is_unitary,
Ds, Ts, T_is_unitary,
large_mats,
ws->large_mat_4,
ws->large_mat_5,
large_vecs, *ws,
greens);
return;
}
}
else if ((direction == -2 && current_slice < slices
&& current_slice > slices / 2)
|| (direction == -2 && current_slice < 2 * slices
&& current_slice > 3 * (slices / 2))) {
// cout << "Combining my way to the top" << endl;
if (current_slice < slices) {
is[0] = chunks / 2;
is[1] = chunks - 1;
is[2] = 0;
is[3] = chunks / 2 - 1 - (slices - current_slice) / safe_mult;
rs[0] = 1;
rs[1] = 1;
rs[2] = 0;
rs[3] = 0;
enlarge_thin(1, u_stack[is[0]], ws->col_mat_1);
enlarge_thin(1, d_stack[is[0]], ws->re_tiny_vec_1);
enlarge_thin(1, t_stack[is[0]], ws->tiny_mat_1);
enlarge_thin(1, u_stack[is[1]], ws->col_mat_2);
enlarge_thin(1, d_stack[is[1]], ws->re_tiny_vec_2);
enlarge_thin(1, t_stack[is[1]], ws->tiny_mat_2);
enlarge_thin(0, u_stack[is[2]], ws->col_mat_3);
enlarge_thin(0, d_stack[is[2]], ws->re_tiny_vec_3);
enlarge_thin(0, t_stack[is[2]], ws->tiny_mat_3);
enlarge_thin(0, u_stack[is[3]], ws->col_mat_4);
enlarge_thin(0, d_stack[is[3]], ws->re_tiny_vec_4);
enlarge_thin(0, t_stack[is[3]], ws->tiny_mat_4);
enlarge(0, u_temp, ws->mat_1);
enlarge(0, d_temp, ws->re_vec_1);
enlarge(0, t_temp, ws->mat_2);
}
else {
is[0] = 0;
is[1] = chunks / 2 - 1;
is[2] = chunks / 2;
is[3] = chunks - 1 - (2*slices - current_slice) / safe_mult; //chunks - 1;
rs[0] = 0;
rs[1] = 0;
rs[2] = 1;
rs[3] = 1;
// cout << "Chunk " << is[3] << " " << chunks << endl;
enlarge_thin(0, u_stack[is[0]], ws->col_mat_1);
enlarge_thin(0, d_stack[is[0]], ws->re_tiny_vec_1);
enlarge_thin(0, t_stack[is[0]], ws->tiny_mat_1);
enlarge_thin(0, u_stack[is[1]], ws->col_mat_2);
enlarge_thin(0, d_stack[is[1]], ws->re_tiny_vec_2);
enlarge_thin(0, t_stack[is[1]], ws->tiny_mat_2);
enlarge_thin(1, u_stack[is[2]], ws->col_mat_3);
enlarge_thin(1, d_stack[is[2]], ws->re_tiny_vec_3);
enlarge_thin(1, t_stack[is[2]], ws->tiny_mat_3);
enlarge_thin(1, u_stack[is[3]], ws->col_mat_4);
enlarge_thin(1, d_stack[is[3]], ws->re_tiny_vec_4);
enlarge_thin(1, t_stack[is[3]], ws->tiny_mat_4);
enlarge(1, u_temp, ws->mat_1);
enlarge(1, d_temp, ws->re_vec_1);
enlarge(1, t_temp, ws->mat_2);
// cout << "Other direction" << endl;
}
{
//============================================================
ws->col_mat_5 = ws->mat_2 * ws->col_mat_4;
ws->col_mat_4 = ws->re_vec_1.asDiagonal() * ws->col_mat_5;
ws->col_mat_5 = ws->col_mat_4 * ws->re_tiny_vec_4.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->col_mat_5, ws->col_mat_6,
ws->re_tiny_vec_4, ws->tiny_mat_5);
ws->col_mat_4 = ws->mat_1 * ws->col_mat_6;
ws->tiny_mat_6 = ws->tiny_mat_5 * ws->tiny_mat_4;
ws->tiny_mat_5 = ws->tiny_mat_6 * ws->tiny_mat_3.transpose();
ws->tiny_mat_4 = ws->re_tiny_vec_4.asDiagonal() * ws->tiny_mat_5;
ws->tiny_mat_5 = ws->tiny_mat_4 * ws->re_tiny_vec_3.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->tiny_mat_5, ws->tiny_mat_6,
ws->re_tiny_vec_6, ws->tiny_mat_7);
ws->col_mat_5 = ws->col_mat_4 * ws->tiny_mat_6;
dqmc::la::thin_col_to_invertible(ws->col_mat_5, ws->mat_3);
Ul = ws->mat_3;
regularize_svd(ws->re_tiny_vec_6, Dl);
ws->row_mat_1 = ws->tiny_mat_7 * ws->col_mat_3.transpose();
dqmc::la::thin_row_to_invertible(ws->row_mat_1, ws->mat_3);
Tl = ws->mat_3;
//============================================================
ws->tiny_mat_5 = ws->tiny_mat_2 * ws->tiny_mat_1.transpose();
ws->tiny_mat_2 = ws->re_tiny_vec_2.asDiagonal() * ws->tiny_mat_5;
ws->tiny_mat_5 = ws->tiny_mat_2 * ws->re_tiny_vec_1.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->tiny_mat_5,
ws->tiny_mat_6, ws->re_tiny_vec_6,
ws->tiny_mat_7);
ws->col_mat_5 = ws->col_mat_2 * ws->tiny_mat_6;
dqmc::la::thin_col_to_invertible(ws->col_mat_5, ws->mat_3);
Ur = ws->mat_3;
regularize_svd(ws->re_tiny_vec_6, Dr);
ws->col_mat_1 = ws->col_mat_1 * ws->tiny_mat_7.transpose();
ws->row_mat_1 = ws->col_mat_1.transpose();
dqmc::la::thin_row_to_invertible(ws->row_mat_1, ws->mat_3);
Tr = ws->mat_3;
Us.push_back(&Ur); U_is_unitary.push_back(0);
Us.push_back(&Ul); U_is_unitary.push_back(0);
Ds.push_back(&Dr);
Ds.push_back(&Dl);
Ts.push_back(&Tr); T_is_unitary.push_back(0);
Ts.push_back(&Tl); T_is_unitary.push_back(0);
large_mats.push_back(&ws->large_mat_1);
large_mats.push_back(&ws->large_mat_2);
large_mats.push_back(&ws->large_mat_3);
large_vecs.push_back(&ws->large_vec_1);
large_vecs.push_back(&ws->large_vec_2);
large_vecs.push_back(&ws->large_vec_3);
// cout << "greens up" << endl;
// cout << Dr.transpose() << endl;
// cout << Dl.transpose() << endl;
dqmc::calculate_greens::col_piv_qr_partial_piv_lu(Us,
U_is_unitary,
Ds, Ts, T_is_unitary,
large_mats,
ws->large_mat_4,
ws->large_mat_5,
large_vecs, *ws,
ws->mat_1);
greens = ws->mat_1.transpose();
return;
}
}
// 2 * vol - down
else if ((direction == -1 && (current_slice) < slices
&& current_slice > slices / 2)
|| (direction == -1 && (current_slice) < 2 * slices
&& current_slice > 3 * (slices / 2))) {
// cout << "Combining my way to the bottom" << endl;
if (current_slice < slices) {
is[0] = chunks / 2;
is[1] = chunks - 1;
is[2] = 0;
is[3] = chunks / 2 - 1 - (slices - current_slice) / safe_mult;
rs[0] = 1;
rs[1] = 1;
rs[2] = 0;
rs[3] = 0;
enlarge_thin(1, u_stack[is[0]], ws->col_mat_1);
enlarge_thin(1, d_stack[is[0]], ws->re_tiny_vec_1);
enlarge_thin(1, t_stack[is[0]], ws->tiny_mat_1);
enlarge_thin(1, u_stack[is[1]], ws->col_mat_2);
enlarge_thin(1, d_stack[is[1]], ws->re_tiny_vec_2);
enlarge_thin(1, t_stack[is[1]], ws->tiny_mat_2);
enlarge_thin(0, u_stack[is[2]], ws->col_mat_3);
enlarge_thin(0, d_stack[is[2]], ws->re_tiny_vec_3);
enlarge_thin(0, t_stack[is[2]], ws->tiny_mat_3);
enlarge_thin(0, u_stack[is[3]], ws->col_mat_4);
enlarge_thin(0, d_stack[is[3]], ws->re_tiny_vec_4);
enlarge_thin(0, t_stack[is[3]], ws->tiny_mat_4);
enlarge(0, u_temp, ws->mat_1);
enlarge(0, d_temp, ws->re_vec_1);
enlarge(0, t_temp, ws->mat_2);
}
else {
is[0] = 0;
is[1] = chunks / 2 - 1;
is[2] = chunks / 2;
is[3] = chunks - 1 - (2*slices - current_slice) / safe_mult; //chunks - 1;
rs[0] = 0;
rs[1] = 0;
rs[2] = 1;
rs[3] = 1;
// cout << "Chunk " << is[3] << " " << chunks << endl;
enlarge_thin(0, u_stack[is[0]], ws->col_mat_1);
enlarge_thin(0, d_stack[is[0]], ws->re_tiny_vec_1);
enlarge_thin(0, t_stack[is[0]], ws->tiny_mat_1);
enlarge_thin(0, u_stack[is[1]], ws->col_mat_2);
enlarge_thin(0, d_stack[is[1]], ws->re_tiny_vec_2);
enlarge_thin(0, t_stack[is[1]], ws->tiny_mat_2);
enlarge_thin(1, u_stack[is[2]], ws->col_mat_3);
enlarge_thin(1, d_stack[is[2]], ws->re_tiny_vec_3);
enlarge_thin(1, t_stack[is[2]], ws->tiny_mat_3);
enlarge_thin(1, u_stack[is[3]], ws->col_mat_4);
enlarge_thin(1, d_stack[is[3]], ws->re_tiny_vec_4);
enlarge_thin(1, t_stack[is[3]], ws->tiny_mat_4);
enlarge(1, u_temp, ws->mat_1);
enlarge(1, d_temp, ws->re_vec_1);
enlarge(1, t_temp, ws->mat_2);
// cout << "Other direction" << endl;
}
//============================================================
ws->tiny_mat_5 = ws->tiny_mat_4 * ws->tiny_mat_3.transpose();
ws->tiny_mat_4 = ws->re_tiny_vec_4.asDiagonal() * ws->tiny_mat_5;
ws->tiny_mat_5 = ws->tiny_mat_4 * ws->re_tiny_vec_3.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->tiny_mat_5,
ws->tiny_mat_6, ws->re_tiny_vec_6,
ws->tiny_mat_7);
ws->col_mat_5 = ws->col_mat_4 * ws->tiny_mat_6;
dqmc::la::thin_col_to_invertible(ws->col_mat_5, ws->mat_3);
Ul = ws->mat_3;
// enlarge_thin(rs[2], reg_ws->re_tiny_vec_6, ws->re_tiny_vec_6); //
regularize_svd(ws->re_tiny_vec_6, Dl);
ws->row_mat_1 = ws->tiny_mat_7 * ws->col_mat_3.transpose();
dqmc::la::thin_row_to_invertible(ws->row_mat_1, ws->mat_3);
Tl = ws->mat_3;
// cout << "Trivial part done" << endl;
//============================================================
ws->col_mat_5 = ws->mat_2 * ws->col_mat_1;
ws->col_mat_4 = ws->re_vec_1.asDiagonal() * ws->col_mat_5;
ws->col_mat_5 = ws->col_mat_4 * ws->re_tiny_vec_1.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->col_mat_5, ws->col_mat_6,
ws->re_tiny_vec_4, ws->tiny_mat_5);
ws->col_mat_4 = ws->mat_1 * ws->col_mat_6;
ws->tiny_mat_6 = ws->tiny_mat_5 * ws->tiny_mat_1;
ws->tiny_mat_5 = ws->tiny_mat_6 * ws->tiny_mat_2.transpose();
ws->tiny_mat_4 = ws->re_tiny_vec_4.asDiagonal() * ws->tiny_mat_5;
ws->tiny_mat_5 = ws->tiny_mat_4 * ws->re_tiny_vec_2.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->tiny_mat_5, ws->tiny_mat_6,
ws->re_tiny_vec_6, ws->tiny_mat_7);
ws->col_mat_5 = ws->col_mat_4 * ws->tiny_mat_6;
dqmc::la::thin_col_to_invertible(ws->col_mat_5, ws->mat_3);
Tr = ws->mat_3.transpose();
regularize_svd(ws->re_tiny_vec_6, Dr);
ws->row_mat_1 = ws->tiny_mat_7 * ws->col_mat_2.transpose();
dqmc::la::thin_row_to_invertible(ws->row_mat_1, ws->mat_3);
Ur = ws->mat_3.transpose();
// Us.push_back(&Ur);
// Us.push_back(&Ul);
// Ds.push_back(&Dr);
// Ds.push_back(&Dl);
// Ts.push_back(&Tr);
// Ts.push_back(&Tl);
Us.push_back(&Ur); U_is_unitary.push_back(0);
Us.push_back(&Ul); U_is_unitary.push_back(1);
Ds.push_back(&Dr);
Ds.push_back(&Dl);
Ts.push_back(&Tr); T_is_unitary.push_back(1);
Ts.push_back(&Tl); T_is_unitary.push_back(0);
large_mats.push_back(&ws->large_mat_1);
large_mats.push_back(&ws->large_mat_2);
large_mats.push_back(&ws->large_mat_3);
large_vecs.push_back(&ws->large_vec_1);
large_vecs.push_back(&ws->large_vec_2);
large_vecs.push_back(&ws->large_vec_3);
dqmc::calculate_greens::col_piv_qr_partial_piv_lu(Us, U_is_unitary,
Ds, Ts, T_is_unitary,
large_mats,
ws->large_mat_4,
ws->large_mat_5,
large_vecs, *ws,
greens);
return;
}
}
}
void cx_dqmc::greens_general_renyi::calculate_greens_basic() {
// boost::timer::auto_cpu_timer t;
// cout << "greens_general_renyi::calculate_greens_general()\t";
int is[5], rs[5];
Us.clear();
Ds.clear();
Ts.clear();
large_mats.clear();
large_vecs.clear();
U_is_unitary.clear();
T_is_unitary.clear();
if (current_slice % slices == 0) {
if ((direction == 1 && current_slice == 0) ||
(direction == -1 && current_slice == 2 * slices)) {
is[0] = 0;
is[1] = chunks / 2 - 1;
is[2] = chunks / 2;
is[3] = chunks - 1;
rs[0] = 0;
rs[1] = 0;
rs[2] = 1;
rs[3] = 1;
}
else {
is[0] = chunks / 2;
is[1] = chunks - 1;
is[2] = 0;
is[3] = chunks / 2 - 1;
rs[0] = 1;
rs[1] = 1;
rs[2] = 0;
rs[3] = 0;
}
reg_ws->tiny_mat_4 = d_stack[is[3]].asDiagonal()
* (t_stack[is[3]] * t_stack[is[2]].transpose())
* d_stack[is[2]].asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->tiny_mat_4,
reg_ws->tiny_mat_5,
reg_ws->re_tiny_vec_5,
reg_ws->tiny_mat_6);
reg_ws->col_mat_4 = u_stack[is[3]] * reg_ws->tiny_mat_5;
reg_ws->col_mat_3 = (reg_ws->tiny_mat_6 * u_stack[is[2]].transpose()).transpose();
reg_ws->tiny_mat_1 = d_stack[is[1]].asDiagonal()
* (t_stack[is[1]] * t_stack[is[0]].transpose())
* d_stack[is[0]].asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->tiny_mat_1,
reg_ws->tiny_mat_2,
reg_ws->re_tiny_vec_2,
reg_ws->tiny_mat_3);
reg_ws->col_mat_2 = u_stack[is[1]] * reg_ws->tiny_mat_2;
reg_ws->col_mat_1 = (reg_ws->tiny_mat_3 * u_stack[is[0]].transpose()).transpose();
enlarge_thin(rs[3], reg_ws->col_mat_4, ws->col_mat_4);
enlarge_thin(rs[2], reg_ws->col_mat_3, ws->col_mat_3);
enlarge_thin(rs[2], reg_ws->re_tiny_vec_5, ws->re_tiny_vec_3);
enlarge_thin(rs[1], reg_ws->col_mat_2, ws->col_mat_2);
enlarge_thin(rs[1], reg_ws->re_tiny_vec_2, ws->re_tiny_vec_2);
enlarge_thin(rs[0], reg_ws->col_mat_1, ws->col_mat_1);
ws->tiny_mat_1 = ws->re_tiny_vec_3.asDiagonal()
* ws->col_mat_3.transpose()
* ws->col_mat_2
* ws->re_tiny_vec_2.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->tiny_mat_1,
ws->tiny_mat_2,
ws->re_tiny_vec_2,
ws->tiny_mat_3);
ws->col_mat_3 = ws->col_mat_4 * ws->tiny_mat_2;
ws->col_mat_2 = (ws->tiny_mat_3 * ws->col_mat_1.transpose()).transpose();
dqmc::la::thin_col_to_invertible(ws->col_mat_3, Ul);
dqmc::la::thin_col_plus_random(ws->col_mat_2, ws->mat_1);
Tl = ws->mat_1.transpose();
regularize_svd(ws->re_tiny_vec_2, Dl);
ws->mat_1 = Tl.adjoint().partialPivLu().solve(Ul);
ws->mat_5 = ws->mat_1.adjoint();
ws->mat_5.diagonal().real() += Dl;
dqmc::la::decompose_udt_col_piv(ws->mat_5, ws->mat_2, ws->re_vec_2, ws->mat_3);
ws->mat_4 = ws->mat_3 * Tl;
ws->mat_5 = ws->re_vec_2.asDiagonal().inverse() * ws->mat_2.adjoint() * Ul.adjoint();
greens = ws->mat_4.partialPivLu().solve(ws->mat_5);
}
// 2 * vol - up
else if (direction != 4) {
if ((direction == 1 && (current_slice + 1) < slices / 2
&& current_slice > 0)
|| (direction == 1 && (current_slice + 1) < 3 * (slices / 2)
&& current_slice > slices)) {
// cout << "Combining my way to the top" << endl;
if (current_slice < slices / 2) {
is[0] = current_slice / safe_mult;
is[1] = chunks / 2 - 1;
is[2] = chunks / 2;
is[3] = chunks - 1;
rs[0] = 0;
rs[1] = 0;
rs[2] = 1;
rs[3] = 1;
rs[4] = 0;
}
else {
is[0] = current_slice / safe_mult;
is[1] = chunks - 1;
is[2] = 0;
is[3] = chunks / 2 - 1;
rs[0] = 1;
rs[1] = 1;
rs[2] = 0;
rs[3] = 0;
rs[4] = 1;
}
{
enlarge_thin(rs[0], u_stack[is[0]], ws->col_mat_1);
enlarge_thin(rs[0], d_stack[is[0]], ws->re_tiny_vec_1);
enlarge_thin(rs[0], t_stack[is[0]], ws->tiny_mat_1);
enlarge_thin(rs[1], u_stack[is[1]], ws->col_mat_2);
enlarge_thin(rs[1], d_stack[is[1]], ws->re_tiny_vec_2);
enlarge_thin(rs[1], t_stack[is[1]], ws->tiny_mat_2);
enlarge_thin(rs[2], u_stack[is[2]], ws->col_mat_3);
enlarge_thin(rs[2], d_stack[is[2]], ws->re_tiny_vec_3);
enlarge_thin(rs[2], t_stack[is[2]], ws->tiny_mat_3);
enlarge_thin(rs[3], u_stack[is[3]], ws->col_mat_4);
enlarge_thin(rs[3], d_stack[is[3]], ws->re_tiny_vec_4);
enlarge_thin(rs[3], t_stack[is[3]], ws->tiny_mat_4);
enlarge(rs[4], u_temp, ws->mat_1);
enlarge(rs[4], d_temp, ws->re_vec_1);
enlarge(rs[4], t_temp, ws->mat_2);
//============================================================
ws->col_mat_5 = ws->mat_2 * ws->col_mat_4;
ws->col_mat_4 = ws->re_vec_1.asDiagonal() * ws->col_mat_5;
ws->col_mat_5 = ws->col_mat_4 * ws->re_tiny_vec_4.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->col_mat_5, ws->col_mat_6,
ws->re_tiny_vec_4, ws->tiny_mat_5);
ws->col_mat_4 = ws->mat_1 * ws->col_mat_6;
ws->tiny_mat_6 = ws->tiny_mat_5 * ws->tiny_mat_4;
ws->tiny_mat_5 = ws->tiny_mat_6 * ws->tiny_mat_3.transpose();
ws->tiny_mat_4 = ws->re_tiny_vec_4.asDiagonal() * ws->tiny_mat_5;
ws->tiny_mat_5 = ws->tiny_mat_4 * ws->re_tiny_vec_3.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->tiny_mat_5, ws->tiny_mat_6,
ws->re_tiny_vec_6, ws->tiny_mat_7);
ws->col_mat_5 = ws->col_mat_4 * ws->tiny_mat_6;
// ws->re_tiny_vec_6
ws->col_mat_4 = (ws->tiny_mat_7 * ws->col_mat_3.transpose()).transpose();
//============================================================
ws->tiny_mat_5 = ws->tiny_mat_2 * ws->tiny_mat_1.transpose();
ws->tiny_mat_2 = ws->re_tiny_vec_2.asDiagonal() * ws->tiny_mat_5;
ws->tiny_mat_5 = ws->tiny_mat_2 * ws->re_tiny_vec_1.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->tiny_mat_5,
ws->tiny_mat_6, ws->re_tiny_vec_2,
ws->tiny_mat_7);
ws->col_mat_3 = ws->col_mat_2 * ws->tiny_mat_6;
// ws->re_tiny_vec_2
ws->col_mat_2 = ws->col_mat_1 * ws->tiny_mat_7.transpose();
// -----------
ws->tiny_mat_1 = ws->re_tiny_vec_6.asDiagonal()
* ws->col_mat_4.transpose()
* ws->col_mat_3
* ws->re_tiny_vec_2.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->tiny_mat_1,
ws->tiny_mat_2,
ws->re_tiny_vec_2,
ws->tiny_mat_3);
ws->col_mat_3 = ws->col_mat_5 * ws->tiny_mat_2;
ws->col_mat_4 = (ws->tiny_mat_3 * ws->col_mat_2.transpose()).transpose();
dqmc::la::thin_col_to_invertible(ws->col_mat_3, Ul);
dqmc::la::thin_col_plus_random(ws->col_mat_4, ws->mat_1);
Tl = ws->mat_1.transpose();
regularize_svd(ws->re_tiny_vec_2, Dl);
ws->mat_1 = Tl.adjoint().partialPivLu().solve(Ul);
ws->mat_5 = ws->mat_1.adjoint();
ws->mat_5.diagonal().real() += Dl;
dqmc::la::decompose_udt_col_piv(ws->mat_5, ws->mat_2, ws->re_vec_2, ws->mat_3);
ws->mat_4 = ws->mat_3 * Tl;
ws->mat_5 = ws->re_vec_2.asDiagonal().inverse() * ws->mat_2.adjoint() * Ul.adjoint();
greens = ws->mat_4.partialPivLu().solve(ws->mat_5);
return;
}
}
// 2 * vol - down
else if ((direction == -1 && (current_slice) < slices
&& current_slice > slices / 2)
|| (direction == -1 && (current_slice) < 2 * slices
&& current_slice > 3 * (slices / 2))) {
// cout << "Combining my way to the bottom" << endl;
if (current_slice < slices) {
is[0] = chunks / 2;
is[1] = chunks - 1;
is[2] = 0;
is[3] = chunks / 2 - 1 - (slices - current_slice) / safe_mult;
rs[0] = 1;
rs[1] = 1;
rs[2] = 0;
rs[3] = 0;
enlarge_thin(1, u_stack[is[0]], ws->col_mat_1);
enlarge_thin(1, d_stack[is[0]], ws->re_tiny_vec_1);
enlarge_thin(1, t_stack[is[0]], ws->tiny_mat_1);
enlarge_thin(1, u_stack[is[1]], ws->col_mat_2);
enlarge_thin(1, d_stack[is[1]], ws->re_tiny_vec_2);
enlarge_thin(1, t_stack[is[1]], ws->tiny_mat_2);
enlarge_thin(0, u_stack[is[2]], ws->col_mat_3);
enlarge_thin(0, d_stack[is[2]], ws->re_tiny_vec_3);
enlarge_thin(0, t_stack[is[2]], ws->tiny_mat_3);
enlarge_thin(0, u_stack[is[3]], ws->col_mat_4);
enlarge_thin(0, d_stack[is[3]], ws->re_tiny_vec_4);
enlarge_thin(0, t_stack[is[3]], ws->tiny_mat_4);
enlarge(0, u_temp, ws->mat_1);
enlarge(0, d_temp, ws->re_vec_1);
enlarge(0, t_temp, ws->mat_2);
}
else {
is[0] = 0;
is[1] = chunks / 2 - 1;
is[2] = chunks / 2;
is[3] = chunks - 1 - (2*slices - current_slice) / safe_mult; //chunks - 1;
rs[0] = 0;
rs[1] = 0;
rs[2] = 1;
rs[3] = 1;
// cout << "Chunk " << is[3] << " " << chunks << endl;
enlarge_thin(0, u_stack[is[0]], ws->col_mat_1);
enlarge_thin(0, d_stack[is[0]], ws->re_tiny_vec_1);
enlarge_thin(0, t_stack[is[0]], ws->tiny_mat_1);
enlarge_thin(0, u_stack[is[1]], ws->col_mat_2);
enlarge_thin(0, d_stack[is[1]], ws->re_tiny_vec_2);
enlarge_thin(0, t_stack[is[1]], ws->tiny_mat_2);
enlarge_thin(1, u_stack[is[2]], ws->col_mat_3);
enlarge_thin(1, d_stack[is[2]], ws->re_tiny_vec_3);
enlarge_thin(1, t_stack[is[2]], ws->tiny_mat_3);
enlarge_thin(1, u_stack[is[3]], ws->col_mat_4);
enlarge_thin(1, d_stack[is[3]], ws->re_tiny_vec_4);
enlarge_thin(1, t_stack[is[3]], ws->tiny_mat_4);
enlarge(1, u_temp, ws->mat_1);
enlarge(1, d_temp, ws->re_vec_1);
enlarge(1, t_temp, ws->mat_2);
// cout << "Other direction" << endl;
}
//============================================================
ws->tiny_mat_5 = ws->tiny_mat_4 * ws->tiny_mat_3.transpose();
ws->tiny_mat_4 = ws->re_tiny_vec_4.asDiagonal() * ws->tiny_mat_5;
ws->tiny_mat_5 = ws->tiny_mat_4 * ws->re_tiny_vec_3.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->tiny_mat_5,
ws->tiny_mat_6, ws->re_tiny_vec_6,
ws->tiny_mat_7);
ws->col_mat_5 = ws->col_mat_4 * ws->tiny_mat_6;
// ws->re_tiny_vec_6
ws->col_mat_4 = (ws->tiny_mat_7 * ws->col_mat_3.transpose()).transpose();
//============================================================
ws->col_mat_3 = ws->re_vec_1.asDiagonal()
* (ws->mat_2
* ws->col_mat_1)
*ws->re_tiny_vec_1.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->col_mat_3, ws->col_mat_6,
ws->re_tiny_vec_4, ws->tiny_mat_5);
ws->col_mat_1 = ws->mat_1 * ws->col_mat_6;
ws->tiny_mat_4 = ws->re_tiny_vec_4.asDiagonal()
* (ws->tiny_mat_5 * ws->tiny_mat_1 * ws->tiny_mat_2.transpose())
* ws->re_tiny_vec_2.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->tiny_mat_4, ws->tiny_mat_6,
ws->re_tiny_vec_2, ws->tiny_mat_7);
ws->col_mat_3 = (ws->tiny_mat_7 * ws->col_mat_2.transpose()).transpose();
ws->col_mat_2 = ws->col_mat_1 * ws->tiny_mat_6;
// ============================================================
ws->tiny_mat_1 = ws->re_tiny_vec_6.asDiagonal()
* ws->col_mat_4.transpose()
* ws->col_mat_3
* ws->re_tiny_vec_2.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->tiny_mat_1,
ws->tiny_mat_2,
ws->re_tiny_vec_2,
ws->tiny_mat_3);
ws->col_mat_3 = ws->col_mat_5 * ws->tiny_mat_2;
ws->col_mat_4 = (ws->tiny_mat_3 * ws->col_mat_2.transpose()).transpose();
dqmc::la::thin_col_to_invertible(ws->col_mat_3, Ul);
dqmc::la::thin_col_plus_random(ws->col_mat_4, ws->mat_1);
Tl = ws->mat_1.transpose();
regularize_svd(ws->re_tiny_vec_2, Dl);
ws->mat_1 = Tl.adjoint().partialPivLu().solve(Ul);
ws->mat_5 = ws->mat_1.adjoint();
ws->mat_5.diagonal().real() += Dl;
dqmc::la::decompose_udt_col_piv(ws->mat_5, ws->mat_2, ws->re_vec_2, ws->mat_3);
ws->mat_4 = ws->mat_3 * Tl;
ws->mat_5 = ws->re_vec_2.asDiagonal().inverse() * ws->mat_2.adjoint() * Ul.adjoint();
greens = ws->mat_4.partialPivLu().solve(ws->mat_5);
return;
}
}
}
//===============================================================
// enlarging
//===============================================================
void cx_dqmc::greens_general_renyi::enlarge_thin(int replica,
vec_t& in,
vec_t& out) {
out.setOnes();
out.segment(0, in.size()) = in;
}
void cx_dqmc::greens_general_renyi::enlarge_thin(int replica,
cx_mat_t& in,
cx_mat_t& out) {
using namespace dqmc::la;
using namespace std;
out.setZero();
if (out.rows() > out.cols()) {
if (replica == 0) {
out.block(0, 0, in.rows(), in.cols())
= in;
out.block(in.rows(), in.cols(),
p->n_B, p->n_B).setIdentity();
} else if (replica == 1) {
out.block(0, 0, p->n_A, ws->particles)
= in.block(0, 0, p->n_A, ws->particles);
out.block(p->n_A, ws->particles, p->n_B, p->n_B).setIdentity();
out.block(p->N, 0, p->n_B, ws->particles)
= in.block(p->n_A, 0, p->n_B, ws->particles);
}
} else if (out.rows() < out.cols()) {
if (replica == 0) {
out.block(0, 0, in.rows(), in.cols())
= in;
out.block(in.rows(), in.cols(),
p->n_B, p->n_B).setIdentity();
} else if (replica == 1) {
out.block(0, 0, ws->particles, p->n_A)
= in.block(0, 0, ws->particles, p->n_A);
out.block(ws->particles, p->n_A, p->n_B, p->n_B).setIdentity();
out.block(0, p->N, ws->particles, p->n_B)
= in.block(0, p->n_A, ws->particles, p->n_B);
}
}
else {
out.setIdentity();
out.block(0, 0, p->particles, p->particles)
= in;
}
}
void cx_dqmc::greens_general_renyi::enlarge_thin_ized_col(int replica,
cx_mat_t& in, cx_mat_t& out) {
using namespace dqmc::la;
using namespace std;
out.setZero();
if (replica == 0) {
out.block(0, 0, p->N, ws->particles)
= in.block(0, 0, p->N, ws->particles);
out.block(p->N, ws->particles,
p->n_B, p->n_B).setIdentity();
out.block(0, ws->eff_particles, p->N, in.cols() - ws->particles)
= in.block(0, ws->particles, p->N, in.cols() - ws->particles);
} else if (replica == 1) {
out.block(0, 0, p->n_A, ws->particles)
= in.block(0, 0, p->n_A, ws->particles);
out.block(p->n_A, ws->particles, p->n_B, p->n_B).setIdentity();
out.block(p->N, 0, p->n_B, ws->particles)
= in.block(p->n_A, 0, p->n_B, ws->particles);
out.block(0, ws->eff_particles, p->n_A, in.cols() - ws->particles)
= in.block(0, ws->particles, p->n_A, in.cols() - ws->particles);
out.block(p->N, ws->eff_particles, p->n_B, in.cols() - ws->particles)
= in.block(p->n_A, ws->particles, p->n_B, in.cols() - ws->particles);
}
}
void cx_dqmc::greens_general_renyi::enlarge_thin_ized_row(int replica,
cx_mat_t& in, cx_mat_t& out) {
using namespace dqmc::la;
using namespace std;
out.setZero();
if (replica == 0) {
out.block(0, 0, ws->particles, p->N)
= in.block(0, 0, ws->particles, p->N);
out.block(ws->particles, p->N,
p->n_B, p->n_B).setIdentity();
out.block(ws->eff_particles, 0, in.rows() - ws->particles, p->N)
= in.block(ws->particles, 0, in.rows() - ws->particles, p->N);
} else if (replica == 1) {
out.block(0, 0, ws->particles, p->n_A)
= in.block(0, 0, ws->particles, p->n_A);
out.block(ws->particles, p->n_A, p->n_B, p->n_B).setIdentity();
out.block(0, p->N, ws->particles, p->n_B)
= in.block(0, p->n_A, ws->particles, p->n_B);
out.block(ws->eff_particles, 0, in.rows() - ws->particles, p->n_A)
= in.block(ws->particles, 0, in.rows() - ws->particles, p->n_A);
out.block(ws->eff_particles, p->N, in.rows() - ws->particles, p->n_B)
= in.block( ws->particles, p->n_A, in.rows() - ws->particles, p->n_B);
}
}
void cx_dqmc::greens_general_renyi::enlarge(int replica, cx_mat_t& in, cx_mat_t& out) {
using namespace dqmc::la;
out.setIdentity();
if (replica == 0) {
out.block(0, 0, p->N, p->N) = in;
}
else if (replica == 1) {
out.block(0, 0, p->n_A, p->n_A)
= in.block(0, 0, p->n_A, p->n_A);
out.block(p->N, 0, p->n_B, p->n_A)
= in.block(p->n_A, 0, p->n_B, p->n_A);
out.block(0, p->N, p->n_A, p->n_B)
= in.block(0, p->n_A, p->n_A, p->n_B);
out.block(p->N, p->N, p->n_B, p->n_B)
= in.block(p->n_A, p->n_A, p->n_B, p->n_B);
}
}
void cx_dqmc::greens_general_renyi::enlarge(int replica, vec_t& in, vec_t& out) {
out.setOnes();
if (replica == 0) {
out.segment(0, p->N) = in;
}
else if (replica == 1) {
out.segment(0, p->n_A) = in.segment(0, p->n_A);
out.segment(p->N, p->n_B) = in.segment(p->n_A, p->n_B);
}
}
void cx_dqmc::greens_general_renyi::calculate_greens_exact(int slice) {
// cout << "Calculating greens exactly @ " << slice << endl;
int is[5], rs[5];
Us.clear();
Ds.clear();
Ts.clear();
large_mats.clear();
large_vecs.clear();
if (slice < slices / 2) {
// cout << "Part 1" << endl;
reg_ws->col_mat_1 = reg_ws->den_U.conjugate();
reg_ws->re_tiny_vec_1.setOnes();
reg_ws->tiny_mat_1.setIdentity();
for (int s = slices / 2; s > slice; s -= safe_mult) {
start = max(s - safe_mult, slice);
stop = s;
// cout << start << " to " << stop << endl;
slice_sequence_left_t(start, stop, reg_ws->col_mat_1);
reg_ws->col_mat_2 = reg_ws->col_mat_1 * reg_ws->re_tiny_vec_1.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_2, reg_ws->col_mat_1,
reg_ws->re_tiny_vec_1, reg_ws->tiny_mat_2);
reg_ws->tiny_mat_3 = reg_ws->tiny_mat_2 * reg_ws->tiny_mat_1;
reg_ws->tiny_mat_1 = reg_ws->tiny_mat_3;
}
reg_ws->col_mat_2 = reg_ws->den_U;
reg_ws->re_tiny_vec_2.setOnes();
reg_ws->tiny_mat_2.setIdentity();
for (int s = slices/2; s < slices; s += safe_mult) {
start = s;
stop = s + safe_mult;
slice_sequence_left(start, stop, reg_ws->col_mat_2);
reg_ws->col_mat_3 = reg_ws->col_mat_2 * reg_ws->re_tiny_vec_2.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_3, reg_ws->col_mat_2,
reg_ws->re_tiny_vec_2, reg_ws->tiny_mat_3);
reg_ws->tiny_mat_4 = reg_ws->tiny_mat_3 * reg_ws->tiny_mat_2;
reg_ws->tiny_mat_2 = reg_ws->tiny_mat_4;
}
reg_ws->col_mat_3 = reg_ws->den_U.conjugate();
reg_ws->re_tiny_vec_3.setOnes();
reg_ws->tiny_mat_3.setIdentity();
for (int s = 3 * (slices / 2); s > slices; s -= safe_mult) {
start = s - safe_mult;
stop = s;
// cout << start << " to " << stop << endl;
slice_sequence_left_t(start, stop, reg_ws->col_mat_3);
reg_ws->col_mat_4 = reg_ws->col_mat_3 * reg_ws->re_tiny_vec_3.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_4, reg_ws->col_mat_3,
reg_ws->re_tiny_vec_3, reg_ws->tiny_mat_4);
reg_ws->tiny_mat_5 = reg_ws->tiny_mat_4 * reg_ws->tiny_mat_3;
reg_ws->tiny_mat_3 = reg_ws->tiny_mat_5;
}
// cout << "col_mat_3" << endl;
// cout << reg_ws->col_mat_3 << endl;
reg_ws->col_mat_4 = reg_ws->den_U;
reg_ws->re_tiny_vec_4.setOnes();
reg_ws->tiny_mat_4.setIdentity();
for (int s = 3 * (slices / 2); s < 4 * (slices / 2); s += safe_mult) {
// cout << "tiny mat 4 " << endl <<reg_ws->tiny_mat_4 << endl << endl;
start = s;
stop = s + safe_mult;
// cout << start << " to " << stop << endl;
slice_sequence_left(start, stop, reg_ws->col_mat_4);
reg_ws->col_mat_5 = reg_ws->col_mat_4 * reg_ws->re_tiny_vec_4.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_5, reg_ws->col_mat_4,
reg_ws->re_tiny_vec_4, reg_ws->tiny_mat_5);
reg_ws->tiny_mat_6 = reg_ws->tiny_mat_5 * reg_ws->tiny_mat_4;
reg_ws->tiny_mat_4 = reg_ws->tiny_mat_6;
}
enlarge_thin(1, reg_ws->col_mat_4, ws->col_mat_4);
enlarge_thin(1, reg_ws->re_tiny_vec_4, ws->re_tiny_vec_4);
enlarge_thin(1, reg_ws->tiny_mat_4, ws->tiny_mat_4);
// cout << "And then adding the rest" << endl;
// cout << "Enlarged is this" << endl;
// cout << ws->col_mat_4 << endl << endl;;
// cout << ws->re_tiny_vec_4 << endl << endl;
// cout << ws->tiny_mat_4 << endl << endl;
// cout << ws->col_mat_4 << endl << endl;
// ws->mat_1.setIdentity();
// slice_sequence_left_renyi(0, slice, ws->mat_1);
// cout << "Here's the sequence\t" << 0 << " " << slice
// << endl << ws->mat_1 << endl << endl;
for (int s = 0; s < slice; s += safe_mult) {
start = s;
stop = min(s + safe_mult, slice);
// cout << start << " to " << stop << endl;
slice_sequence_left_renyi(start, stop, ws->col_mat_4);
ws->col_mat_5 = ws->col_mat_4 * ws->re_tiny_vec_4.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->col_mat_5, ws->col_mat_4,
ws->re_tiny_vec_4, ws->tiny_mat_5);
ws->tiny_mat_6 = ws->tiny_mat_5 * ws->tiny_mat_4;
ws->tiny_mat_4 = ws->tiny_mat_6;
}
// cout << ws->col_mat_4 << endl << endl;
rs[3] = 1;
rs[2] = 1;
rs[1] = 0;
rs[0] = 0;
dqmc::la::thin_col_to_invertible(ws->col_mat_4, ws->mat_8);
// cout << "From exact" << endl;
// cout << ws->col_mat_4 << endl << endl;
// cout << ws->re_tiny_vec_4.transpose() << endl << endl;
// cout << ws->tiny_mat_4 << endl << endl;
// cout << "It should be this" << endl << ws->mat_8 << endl << endl;
// dqmc::la::thin_col_to_invertible(reg_ws->col_mat_4, reg_ws->mat_8);
// enlarge_thin_ized_col(1, reg_ws->mat_8, ws->mat_8);
// cout << "But it is actually this " << endl << ws->mat_8 << endl;
dqmc::la::thin_col_to_invertible(reg_ws->col_mat_3, reg_ws->mat_6);
enlarge_thin_ized_col(1, reg_ws->mat_6, ws->mat_6);
dqmc::la::thin_col_to_invertible(reg_ws->col_mat_2, reg_ws->mat_4);
enlarge_thin_ized_col(0, reg_ws->mat_4, ws->mat_4);
dqmc::la::thin_col_to_invertible(reg_ws->col_mat_1, reg_ws->mat_2);
enlarge_thin_ized_col(0, reg_ws->mat_2, ws->mat_2);
// enlarge_thin(rs[3], ws->tiny_mat_4, ws->mat_7);
ws->mat_7.setIdentity();
ws->mat_7.block(0, 0, ws->eff_particles, ws->eff_particles) = ws->tiny_mat_4;
// cout << "I thought it was " << endl << ws->mat_7 << endl << endl;
// enlarge_thin(rs[3], reg_ws->re_tiny_vec_4, ws->re_tiny_vec_4);
regularize_svd(ws->re_tiny_vec_4, ws->re_vec_4);
// enlarge_thin(rs[3], reg_ws->tiny_mat_4, ws->mat_7);
// cout << "But then " << endl << ws->mat_7 << endl << endl;
enlarge_thin(rs[2], reg_ws->re_tiny_vec_3, ws->re_tiny_vec_3);
regularize_svd(ws->re_tiny_vec_3, ws->re_vec_3);
enlarge_thin(rs[2], reg_ws->tiny_mat_3, ws->mat_5);
enlarge_thin(rs[1], reg_ws->re_tiny_vec_2, ws->re_tiny_vec_2);
regularize_svd(ws->re_tiny_vec_2, ws->re_vec_2);
enlarge_thin(rs[1], reg_ws->tiny_mat_2, ws->mat_3);
enlarge_thin(rs[0], reg_ws->re_tiny_vec_1, ws->re_tiny_vec_1);
regularize_svd(ws->re_tiny_vec_1, ws->re_vec_1);
enlarge_thin(rs[0], reg_ws->tiny_mat_1, ws->mat_1);
ws->la_mat_1 = ws->mat_1;
ws->mat_1 = ws->mat_2.transpose();
ws->mat_2 = ws->la_mat_1.transpose();
ws->la_mat_1 = ws->mat_5;
ws->mat_5 = ws->mat_6.transpose();
ws->mat_6 = ws->la_mat_1.transpose();
}
else if (slice >= slices / 2 &&
slice < slices) {
reg_ws->col_mat_1 = reg_ws->den_U.conjugate();
reg_ws->re_tiny_vec_1.setOnes();
reg_ws->tiny_mat_1.setIdentity();
for (int s = 3 * (slices / 2); s > slices; s -= safe_mult) {
start = s - safe_mult;
stop = s;
// cout << start << " to " << stop << endl;
slice_sequence_left_t(start, stop, reg_ws->col_mat_1);
reg_ws->col_mat_2 = reg_ws->col_mat_1 * reg_ws->re_tiny_vec_1.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_2, reg_ws->col_mat_1,
reg_ws->re_tiny_vec_1, reg_ws->tiny_mat_2);
reg_ws->tiny_mat_3 = reg_ws->tiny_mat_2 * reg_ws->tiny_mat_1;
reg_ws->tiny_mat_1 = reg_ws->tiny_mat_3;
}
enlarge_thin(1, reg_ws->col_mat_1, ws->col_mat_1);
enlarge_thin(1, reg_ws->re_tiny_vec_1, ws->re_tiny_vec_1);
enlarge_thin(1, reg_ws->tiny_mat_1, ws->tiny_mat_1);
// cout << reg_ws->col_mat_1 << endl << endl;
// ws->mat_2.setIdentity();
for (int s = slices; s > slice; s -= safe_mult) {
start = max(s - safe_mult, slice);
stop = s;
cout << start << " to " << stop << endl;
// slice_sequence_left_renyi_t(start, stop, ws->mat_2);
// cout << ws->mat_2 << endl << endl;
slice_sequence_left_renyi_t(start, stop, ws->col_mat_1);
ws->col_mat_2 = ws->col_mat_1 * ws->re_tiny_vec_1.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->col_mat_2, ws->col_mat_1,
ws->re_tiny_vec_1, ws->tiny_mat_2);
ws->tiny_mat_3 = ws->tiny_mat_2 * ws->tiny_mat_1;
ws->tiny_mat_1 = ws->tiny_mat_3;
}
dqmc::la::decompose_udt_col_piv(ws->mat_2, ws->mat_1,
ws->re_vec_1, ws->mat_3);
// cout << ws->mat_1 << endl << endl;
// cout << ws->re_vec_1 << endl << endl;
// cout << ws->mat_3 << endl << endl;
reg_ws->col_mat_2 = reg_ws->den_U;
reg_ws->re_tiny_vec_2.setOnes();
reg_ws->tiny_mat_2.setIdentity();
for (int s = 3 * (slices / 2); s < 2 * slices; s += safe_mult) {
start = s;
stop = s + safe_mult;
// cout << start << " to " << stop << endl;
slice_sequence_left(start, stop, reg_ws->col_mat_2);
reg_ws->col_mat_3 = reg_ws->col_mat_2 * reg_ws->re_tiny_vec_2.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_3, reg_ws->col_mat_2,
reg_ws->re_tiny_vec_2, reg_ws->tiny_mat_3);
reg_ws->tiny_mat_4 = reg_ws->tiny_mat_3 * reg_ws->tiny_mat_2;
reg_ws->tiny_mat_2 = reg_ws->tiny_mat_4;
}
reg_ws->col_mat_3 = reg_ws->den_U.conjugate();
reg_ws->re_tiny_vec_3.setOnes();
reg_ws->tiny_mat_3.setIdentity();
for (int s = slices / 2; s > 0; s -= safe_mult) {
start = s - safe_mult;
stop = s;
// cout << start << " to " << stop << endl;
slice_sequence_left_t(start, stop, reg_ws->col_mat_3);
reg_ws->col_mat_4 = reg_ws->col_mat_3 * reg_ws->re_tiny_vec_3.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_4, reg_ws->col_mat_3,
reg_ws->re_tiny_vec_3, reg_ws->tiny_mat_4);
reg_ws->tiny_mat_5 = reg_ws->tiny_mat_4 * reg_ws->tiny_mat_3;
reg_ws->tiny_mat_3 = reg_ws->tiny_mat_5;
}
reg_ws->col_mat_4 = reg_ws->den_U;
reg_ws->re_tiny_vec_4.setOnes();
reg_ws->tiny_mat_4.setIdentity();
for (int s = slices / 2; s < slice; s += safe_mult) {
start = s;
stop = min (s + safe_mult, slice);
// cout << start << " to " << stop << endl;
slice_sequence_left(start, stop, reg_ws->col_mat_4);
reg_ws->col_mat_5 = reg_ws->col_mat_4 * reg_ws->re_tiny_vec_4.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_5, reg_ws->col_mat_4,
reg_ws->re_tiny_vec_4, reg_ws->tiny_mat_5);
reg_ws->tiny_mat_6 = reg_ws->tiny_mat_5 * reg_ws->tiny_mat_4;
reg_ws->tiny_mat_4 = reg_ws->tiny_mat_6;
}
rs[3] = 0;
rs[2] = 0;
rs[1] = 1;
rs[0] = 1;
dqmc::la::thin_col_to_invertible(reg_ws->col_mat_4, reg_ws->mat_8);
enlarge_thin_ized_col(rs[3], reg_ws->mat_8, ws->mat_8);
dqmc::la::thin_col_to_invertible(reg_ws->col_mat_3, reg_ws->mat_6);
enlarge_thin_ized_col(rs[2], reg_ws->mat_6, ws->mat_6);
dqmc::la::thin_col_to_invertible(reg_ws->col_mat_2, reg_ws->mat_4);
enlarge_thin_ized_col(rs[1], reg_ws->mat_4, ws->mat_4);
dqmc::la::thin_col_to_invertible(ws->col_mat_1, ws->mat_2);
enlarge_thin(rs[3], reg_ws->re_tiny_vec_4, ws->re_tiny_vec_4);
regularize_svd(ws->re_tiny_vec_4, ws->re_vec_4);
enlarge_thin(rs[3], reg_ws->tiny_mat_4, ws->mat_7);
enlarge_thin(rs[2], reg_ws->re_tiny_vec_3, ws->re_tiny_vec_3);
regularize_svd(ws->re_tiny_vec_3, ws->re_vec_3);
enlarge_thin(rs[2], reg_ws->tiny_mat_3, ws->mat_5);
enlarge_thin(rs[1], reg_ws->re_tiny_vec_2, ws->re_tiny_vec_2);
regularize_svd(ws->re_tiny_vec_2, ws->re_vec_2);
enlarge_thin(rs[1], reg_ws->tiny_mat_2, ws->mat_3);
// enlarge_thin(rs[0], reg_ws->re_tiny_vec_1, ws->re_tiny_vec_1);
regularize_svd(ws->re_tiny_vec_1, ws->re_vec_1);
// enlarge_thin(rs[0], reg_ws->tiny_mat_1, ws->mat_1);
ws->mat_1.setIdentity();
ws->mat_1.block(0, 0, ws->eff_particles, ws->eff_particles) = ws->tiny_mat_1;
ws->la_mat_1 = ws->mat_1;
ws->mat_1 = ws->mat_2.transpose();
ws->mat_2 = ws->la_mat_1.transpose();
ws->la_mat_1 = ws->mat_5;
ws->mat_5 = ws->mat_6.transpose();
ws->mat_6 = ws->la_mat_1.transpose();
}
else if (slice >= slices &&
slice < 3 * (slices / 2)) {
// cout << "Part 1" << endl;
reg_ws->col_mat_1 = reg_ws->den_U.conjugate();
reg_ws->re_tiny_vec_1.setOnes();
reg_ws->tiny_mat_1.setIdentity();
for (int s = 3 * (slices / 2); s > slice; s -= safe_mult) {
start = max(s - safe_mult, slice);
stop = s;
// cout << start << " to " << stop << endl;
slice_sequence_left_t(start, stop, reg_ws->col_mat_1);
reg_ws->col_mat_2 = reg_ws->col_mat_1 * reg_ws->re_tiny_vec_1.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_2, reg_ws->col_mat_1,
reg_ws->re_tiny_vec_1, reg_ws->tiny_mat_2);
reg_ws->tiny_mat_3 = reg_ws->tiny_mat_2 * reg_ws->tiny_mat_1;
reg_ws->tiny_mat_1 = reg_ws->tiny_mat_3;
}
reg_ws->col_mat_2 = reg_ws->den_U;
reg_ws->re_tiny_vec_2.setOnes();
reg_ws->tiny_mat_2.setIdentity();
for (int s = 3 * (slices / 2); s < 2 * slices; s += safe_mult) {
start = s;
stop = s + safe_mult;
// cout << start << " to " << stop << endl;
slice_sequence_left(start, stop, reg_ws->col_mat_2);
reg_ws->col_mat_3 = reg_ws->col_mat_2 * reg_ws->re_tiny_vec_2.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_3, reg_ws->col_mat_2,
reg_ws->re_tiny_vec_2, reg_ws->tiny_mat_3);
reg_ws->tiny_mat_4 = reg_ws->tiny_mat_3 * reg_ws->tiny_mat_2;
reg_ws->tiny_mat_2 = reg_ws->tiny_mat_4;
}
reg_ws->col_mat_3 = reg_ws->den_U.conjugate();
reg_ws->re_tiny_vec_3.setOnes();
reg_ws->tiny_mat_3.setIdentity();
for (int s = (slices / 2); s > 0; s -= safe_mult) {
start = s - safe_mult;
stop = s;
// cout << start << " to " << stop << endl;
slice_sequence_left_t(start, stop, reg_ws->col_mat_3);
reg_ws->col_mat_4 = reg_ws->col_mat_3 * reg_ws->re_tiny_vec_3.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_4, reg_ws->col_mat_3,
reg_ws->re_tiny_vec_3, reg_ws->tiny_mat_4);
reg_ws->tiny_mat_5 = reg_ws->tiny_mat_4 * reg_ws->tiny_mat_3;
reg_ws->tiny_mat_3 = reg_ws->tiny_mat_5;
}
// cout << "col_mat_3" << endl;
// cout << reg_ws->col_mat_3 << endl;
reg_ws->col_mat_4 = reg_ws->den_U;
reg_ws->re_tiny_vec_4.setOnes();
reg_ws->tiny_mat_4.setIdentity();
for (int s = (slices / 2); s < slices; s += safe_mult) {
// cout << "tiny mat 4 " << endl <<reg_ws->tiny_mat_4 << endl << endl;
start = s;
stop = s + safe_mult;
// cout << start << " to " << stop << endl;
slice_sequence_left(start, stop, reg_ws->col_mat_4);
reg_ws->col_mat_5 = reg_ws->col_mat_4 * reg_ws->re_tiny_vec_4.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_5, reg_ws->col_mat_4,
reg_ws->re_tiny_vec_4, reg_ws->tiny_mat_5);
reg_ws->tiny_mat_6 = reg_ws->tiny_mat_5 * reg_ws->tiny_mat_4;
reg_ws->tiny_mat_4 = reg_ws->tiny_mat_6;
}
enlarge_thin(0, reg_ws->col_mat_4, ws->col_mat_4);
enlarge_thin(0, reg_ws->re_tiny_vec_4, ws->re_tiny_vec_4);
enlarge_thin(0, reg_ws->tiny_mat_4, ws->tiny_mat_4);
// cout << "And then adding the rest" << endl;
// cout << ws->col_mat_4 << endl << endl;
for (int s = slices; s < slice; s += safe_mult) {
start = s;
stop = min(s + safe_mult, slice);
// cout << start << " to " << stop << endl;
slice_sequence_left_renyi(start, stop, ws->col_mat_4);
ws->col_mat_5 = ws->col_mat_4 * ws->re_tiny_vec_4.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->col_mat_5, ws->col_mat_4,
ws->re_tiny_vec_4, ws->tiny_mat_5);
ws->tiny_mat_6 = ws->tiny_mat_5 * ws->tiny_mat_4;
ws->tiny_mat_4 = ws->tiny_mat_6;
}
// cout << ws->col_mat_4 << endl << endl;
rs[3] = 0;
rs[2] = 0;
rs[1] = 1;
rs[0] = 1;
dqmc::la::thin_col_to_invertible(ws->col_mat_4, ws->mat_8);
// cout << "It should be this" << endl << ws->mat_8 << endl << endl;
// dqmc::la::thin_col_to_invertible(reg_ws->col_mat_4, reg_ws->mat_8);
// enlarge_thin_ized_col(1, reg_ws->mat_8, ws->mat_8);
// cout << "But it is actually this " << endl << ws->mat_8 << endl;
dqmc::la::thin_col_to_invertible(reg_ws->col_mat_3, reg_ws->mat_6);
enlarge_thin_ized_col(rs[2], reg_ws->mat_6, ws->mat_6);
dqmc::la::thin_col_to_invertible(reg_ws->col_mat_2, reg_ws->mat_4);
enlarge_thin_ized_col(rs[1], reg_ws->mat_4, ws->mat_4);
dqmc::la::thin_col_to_invertible(reg_ws->col_mat_1, reg_ws->mat_2);
enlarge_thin_ized_col(rs[0], reg_ws->mat_2, ws->mat_2);
// enlarge_thin(rs[3], ws->tiny_mat_4, ws->mat_7);
ws->mat_7.setIdentity();
ws->mat_7.block(0, 0, ws->eff_particles, ws->eff_particles) = ws->tiny_mat_4;
// cout << "I thought it was " << endl << ws->mat_7 << endl << endl;
// enlarge_thin(rs[3], reg_ws->re_tiny_vec_4, ws->re_tiny_vec_4);
regularize_svd(ws->re_tiny_vec_4, ws->re_vec_4);
// enlarge_thin(rs[3], reg_ws->tiny_mat_4, ws->mat_7);
// cout << "But then " << endl << ws->mat_7 << endl << endl;
enlarge_thin(rs[2], reg_ws->re_tiny_vec_3, ws->re_tiny_vec_3);
regularize_svd(ws->re_tiny_vec_3, ws->re_vec_3);
enlarge_thin(rs[2], reg_ws->tiny_mat_3, ws->mat_5);
enlarge_thin(rs[1], reg_ws->re_tiny_vec_2, ws->re_tiny_vec_2);
regularize_svd(ws->re_tiny_vec_2, ws->re_vec_2);
enlarge_thin(rs[1], reg_ws->tiny_mat_2, ws->mat_3);
enlarge_thin(rs[0], reg_ws->re_tiny_vec_1, ws->re_tiny_vec_1);
regularize_svd(ws->re_tiny_vec_1, ws->re_vec_1);
enlarge_thin(rs[0], reg_ws->tiny_mat_1, ws->mat_1);
ws->la_mat_1 = ws->mat_1;
ws->mat_1 = ws->mat_2.transpose();
ws->mat_2 = ws->la_mat_1.transpose();
ws->la_mat_1 = ws->mat_5;
ws->mat_5 = ws->mat_6.transpose();
ws->mat_6 = ws->la_mat_1.transpose();
}
else if (slice >= 3 * (slices / 2) &&
slice < 2 * slices) {
// cout << "Part 1" << endl;
reg_ws->col_mat_1 = reg_ws->den_U.conjugate();
reg_ws->re_tiny_vec_1.setOnes();
reg_ws->tiny_mat_1.setIdentity();
for (int s = slices / 2; s > 0; s -= safe_mult) {
start = s - safe_mult;
stop = s;
// cout << start << " to " << stop << endl;
slice_sequence_left_t(start, stop, reg_ws->col_mat_1);
reg_ws->col_mat_2 = reg_ws->col_mat_1 * reg_ws->re_tiny_vec_1.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_2, reg_ws->col_mat_1,
reg_ws->re_tiny_vec_1, reg_ws->tiny_mat_2);
reg_ws->tiny_mat_3 = reg_ws->tiny_mat_2 * reg_ws->tiny_mat_1;
reg_ws->tiny_mat_1 = reg_ws->tiny_mat_3;
}
enlarge_thin(0, reg_ws->col_mat_1, ws->col_mat_1);
enlarge_thin(0, reg_ws->re_tiny_vec_1, ws->re_tiny_vec_1);
enlarge_thin(0, reg_ws->tiny_mat_1, ws->tiny_mat_1);
for (int s = 2 * slices; s >= slice; s -= safe_mult) {
start = max(s - safe_mult, slice);
stop = s;
// cout << start << " to " << stop << endl;
slice_sequence_left_renyi_t(start, stop, ws->col_mat_1);
ws->col_mat_2 = ws->col_mat_1 * ws->re_tiny_vec_1.asDiagonal();
dqmc::la::decompose_udt_col_piv(ws->col_mat_2, ws->col_mat_1,
ws->re_tiny_vec_1, ws->tiny_mat_2);
ws->tiny_mat_3 = ws->tiny_mat_2 * ws->tiny_mat_1;
ws->tiny_mat_1 = ws->tiny_mat_3;
}
// cout << ws->tiny_mat_1 << endl << endl;
reg_ws->col_mat_2 = reg_ws->den_U;
reg_ws->re_tiny_vec_2.setOnes();
reg_ws->tiny_mat_2.setIdentity();
for (int s = slices / 2; s < slices; s += safe_mult) {
start = s;
stop = s + safe_mult;
// cout << start << " to " << stop << endl;
slice_sequence_left(start, stop, reg_ws->col_mat_2);
reg_ws->col_mat_3 = reg_ws->col_mat_2 * reg_ws->re_tiny_vec_2.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_3, reg_ws->col_mat_2,
reg_ws->re_tiny_vec_2, reg_ws->tiny_mat_3);
reg_ws->tiny_mat_4 = reg_ws->tiny_mat_3 * reg_ws->tiny_mat_2;
reg_ws->tiny_mat_2 = reg_ws->tiny_mat_4;
}
reg_ws->col_mat_3 = reg_ws->den_U.conjugate();
reg_ws->re_tiny_vec_3.setOnes();
reg_ws->tiny_mat_3.setIdentity();
for (int s = 3 * (slices / 2); s > slices; s -= safe_mult) {
start = s - safe_mult;
stop = s;
// cout << start << " to " << stop << endl;
slice_sequence_left_t(start, stop, reg_ws->col_mat_3);
reg_ws->col_mat_4 = reg_ws->col_mat_3 * reg_ws->re_tiny_vec_3.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_4, reg_ws->col_mat_3,
reg_ws->re_tiny_vec_3, reg_ws->tiny_mat_4);
reg_ws->tiny_mat_5 = reg_ws->tiny_mat_4 * reg_ws->tiny_mat_3;
reg_ws->tiny_mat_3 = reg_ws->tiny_mat_5;
}
reg_ws->col_mat_4 = reg_ws->den_U;
reg_ws->re_tiny_vec_4.setOnes();
reg_ws->tiny_mat_4.setIdentity();
for (int s = 3 * (slices / 2); s < slice; s += safe_mult) {
start = s;
stop = min(s + safe_mult, slice);
// cout << start << " to " << stop << endl;
slice_sequence_left(start, stop, reg_ws->col_mat_4);
reg_ws->col_mat_5 = reg_ws->col_mat_4 * reg_ws->re_tiny_vec_4.asDiagonal();
dqmc::la::decompose_udt_col_piv(reg_ws->col_mat_5, reg_ws->col_mat_4,
reg_ws->re_tiny_vec_4, reg_ws->tiny_mat_5);
reg_ws->tiny_mat_6 = reg_ws->tiny_mat_5 * reg_ws->tiny_mat_4;
reg_ws->tiny_mat_4 = reg_ws->tiny_mat_6;
}
rs[3] = 1;
rs[2] = 1;
rs[1] = 0;
rs[0] = 0;
dqmc::la::thin_col_to_invertible(reg_ws->col_mat_4, reg_ws->mat_8);
enlarge_thin_ized_col(rs[3], reg_ws->mat_8, ws->mat_8);
dqmc::la::thin_col_to_invertible(reg_ws->col_mat_3, reg_ws->mat_6);
enlarge_thin_ized_col(rs[2], reg_ws->mat_6, ws->mat_6);
dqmc::la::thin_col_to_invertible(reg_ws->col_mat_2, reg_ws->mat_4);
enlarge_thin_ized_col(rs[1], reg_ws->mat_4, ws->mat_4);
dqmc::la::thin_col_to_invertible(ws->col_mat_1, ws->mat_2);
enlarge_thin(rs[3], reg_ws->re_tiny_vec_4, ws->re_tiny_vec_4);
regularize_svd(ws->re_tiny_vec_4, ws->re_vec_4);
enlarge_thin(rs[3], reg_ws->tiny_mat_4, ws->mat_7);
enlarge_thin(rs[2], reg_ws->re_tiny_vec_3, ws->re_tiny_vec_3);
regularize_svd(ws->re_tiny_vec_3, ws->re_vec_3);
enlarge_thin(rs[2], reg_ws->tiny_mat_3, ws->mat_5);
enlarge_thin(rs[1], reg_ws->re_tiny_vec_2, ws->re_tiny_vec_2);
regularize_svd(ws->re_tiny_vec_2, ws->re_vec_2);
enlarge_thin(rs[1], reg_ws->tiny_mat_2, ws->mat_3);
regularize_svd(ws->re_tiny_vec_1, ws->re_vec_1);
ws->mat_1.setIdentity();
ws->mat_1.block(0, 0, ws->eff_particles, ws->eff_particles) = ws->tiny_mat_1;
ws->la_mat_1 = ws->mat_1;
ws->mat_1 = ws->mat_2.transpose();
ws->mat_2 = ws->la_mat_1.transpose();
ws->la_mat_1 = ws->mat_5;
ws->mat_5 = ws->mat_6.transpose();
ws->mat_6 = ws->la_mat_1.transpose();
}
Us.push_back(&ws->mat_2);
Us.push_back(&ws->mat_4);
Us.push_back(&ws->mat_6);
Us.push_back(&ws->mat_8);
Ts.push_back(&ws->mat_1);
Ts.push_back(&ws->mat_3);
Ts.push_back(&ws->mat_5);
Ts.push_back(&ws->mat_7);
Ds.push_back(&ws->re_vec_1);
Ds.push_back(&ws->re_vec_2);
Ds.push_back(&ws->re_vec_3);
Ds.push_back(&ws->re_vec_4);
cx_mat_t large_mat_1 = cx_mat::Zero(4 * vol, 4 * vol);
cx_mat_t large_mat_2 = cx_mat::Zero(4 * vol, 4 * vol);
cx_mat_t large_mat_3 = cx_mat::Zero(4 * vol, 4 * vol);
cx_mat_t large_mat_4 = cx_mat::Zero(4 * vol, 4 * vol);
large_mats.push_back(&large_mat_1);
large_mats.push_back(&large_mat_2);
large_mats.push_back(&large_mat_3);
large_mats.push_back(&large_mat_4);
cx_mat_t large_U = cx_mat_t::Zero(4 * vol, 4 * vol);
cx_mat_t large_T = cx_mat_t::Zero(4 * vol, 4 * vol);
vec_t large_vec_1 = vec_t::Zero(4 * vol);
vec_t large_vec_2 = vec_t::Zero(4 * vol);
vec_t large_vec_3 = vec_t::Zero(4 * vol);
vec_t large_vec_4 = vec_t::Zero(4 * vol);
large_vecs.push_back(&large_vec_1);
large_vecs.push_back(&large_vec_2);
large_vecs.push_back(&large_vec_3);
large_vecs.push_back(&large_vec_4);
// cout << "Full piv from four" << endl << endl;
// cout << "Ts[0]" << endl;
// cout << *Ts[0] << endl << endl;
// cout << *Ts[1] << endl << endl;
// cout << *Ts[2] << endl << endl;
// cout << *Ts[3] << endl << endl;
dqmc::calculate_greens::col_piv_qr_full_piv_lu(Us, Ds, Ts,
large_mats,
large_U, large_T,
large_vecs, *ws,
greens);
}
void cx_dqmc::greens_general_renyi::update_remove_interaction() {
prop_greens.setIdentity();
cx_dqmc::interaction::interaction_right(p, ws, prop_greens, ws->vec_1,
(*aux_spins)[current_slice / slices][current_slice], -1., 0);
}
void cx_dqmc::greens_general_renyi::update_add_interaction() {
cx_dqmc::interaction::interaction_right(p, ws, prop_greens, ws->vec_1,
(*aux_spins)[current_slice / slices][current_slice], 1., 0);
}
| 33.732127
| 103
| 0.61673
|
pebroecker
|
82871ae8f6feb8f16a665dd816f7fbd2330b61fe
| 2,596
|
cpp
|
C++
|
NOLF/ClientShellDLL/PlayerSoundFX.cpp
|
rastrup/no-one-lives-forever
|
dfbe22fb4cc01bf7e5f54a79174fa8f108dd2f54
|
[
"Unlicense"
] | 65
|
2015-02-28T03:35:14.000Z
|
2021-09-23T05:43:33.000Z
|
NOLF/ClientShellDLL/PlayerSoundFX.cpp
|
rastrup/no-one-lives-forever
|
dfbe22fb4cc01bf7e5f54a79174fa8f108dd2f54
|
[
"Unlicense"
] | null | null | null |
NOLF/ClientShellDLL/PlayerSoundFX.cpp
|
rastrup/no-one-lives-forever
|
dfbe22fb4cc01bf7e5f54a79174fa8f108dd2f54
|
[
"Unlicense"
] | 27
|
2015-02-28T07:42:01.000Z
|
2022-02-11T01:35:20.000Z
|
// ----------------------------------------------------------------------- //
//
// MODULE : PlayerSoundFX.cpp
//
// PURPOSE : Player sound special FX - Implementation
//
// CREATED : 7/28/98 (was WeaponSoundFX)
//
// (c) 1998-2000 Monolith Productions, Inc. All Rights Reserved
//
// ----------------------------------------------------------------------- //
#include "stdafx.h"
#include "PlayerSoundFX.h"
#include "GameClientShell.h"
#include "iltclient.h"
#include "MsgIds.h"
extern CGameClientShell* g_pGameClientShell;
// ----------------------------------------------------------------------- //
//
// ROUTINE: CPlayerSoundFX::Init
//
// PURPOSE: Init the fx
//
// ----------------------------------------------------------------------- //
LTBOOL CPlayerSoundFX::Init(SFXCREATESTRUCT* psfxCreateStruct)
{
if (!CSpecialFX::Init(psfxCreateStruct)) return LTFALSE;
PLAYERSOUNDCREATESTRUCT* pPSCS = (PLAYERSOUNDCREATESTRUCT*)psfxCreateStruct;
m_vPos = pPSCS->vPos;
m_nClientId = pPSCS->nClientId;
m_nType = pPSCS->nType;
m_nWeaponId = pPSCS->nWeaponId;
return LTTRUE;
}
// ----------------------------------------------------------------------- //
//
// ROUTINE: CPlayerSoundFX::CreateObject
//
// PURPOSE: Create object associated with the CPlayerSoundFX
//
// ----------------------------------------------------------------------- //
LTBOOL CPlayerSoundFX::CreateObject(ILTClient *pClientDE)
{
if (!CSpecialFX::CreateObject(pClientDE)) return LTFALSE;
uint32 dwId;
if (m_pClientDE->GetLocalClientID(&dwId) != LT_OK) return LTFALSE;
// Don't play sounds for this client...
if (int(dwId) == m_nClientId) return LTFALSE;
PlayerSoundId eSndType = (PlayerSoundId)m_nType;
if (::IsWeaponSound(eSndType))
{
WEAPON* pWeapon = g_pWeaponMgr->GetWeapon(m_nWeaponId);
if (!pWeapon) return LTFALSE;
PlayWeaponSound(pWeapon, m_vPos, (PlayerSoundId)m_nType);
}
else
{
switch (eSndType)
{
case PSI_JUMP :
{
char* pSounds[] = { "Chars\\Snd\\jump1.wav", "Chars\\Snd\\jump2.wav" };
g_pClientSoundMgr->PlaySoundFromPos(m_vPos, pSounds[GetRandom(0,1)], 1000.0f,
SOUNDPRIORITY_MISC_HIGH);
}
break;
case PSI_LAND :
{
char* pSounds[] = { "Chars\\Snd\\player\\landing1.wav", "Chars\\Snd\\player\\landing2.wav" };
g_pClientSoundMgr->PlaySoundFromPos(m_vPos, pSounds[GetRandom(0,1)], 1000.0f,
SOUNDPRIORITY_MISC_HIGH);
}
break;
default : break;
}
}
return LTFALSE; // Delete me, I'm done :)
}
| 26.762887
| 98
| 0.545455
|
rastrup
|
82935cb840ce28539f4ad2d5854a7736f6ea5816
| 620
|
cc
|
C++
|
hackt_docker/hackt/test/chpsim/installtest/hello.cc
|
broken-wheel/hacktist
|
36e832ae7dd38b27bca9be7d0889d06054dc2806
|
[
"MIT"
] | null | null | null |
hackt_docker/hackt/test/chpsim/installtest/hello.cc
|
broken-wheel/hacktist
|
36e832ae7dd38b27bca9be7d0889d06054dc2806
|
[
"MIT"
] | null | null | null |
hackt_docker/hackt/test/chpsim/installtest/hello.cc
|
broken-wheel/hacktist
|
36e832ae7dd38b27bca9be7d0889d06054dc2806
|
[
"MIT"
] | null | null | null |
#include <iostream>
#include <sim/chpsim/chpsim_dlfunction.hh>
using std::cout;
using std::endl;
USING_CHPSIM_DLFUNCTION_PROLOGUE
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static
void
hello(void) {
cout << "Hello, world!" << endl;
}
CHP_DLFUNCTION_LOAD_DEFAULT("hello", hello)
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static
int_value_type
plus(const int_value_type a, const int_value_type b) {
return a + b;
}
CHP_DLFUNCTION_LOAD_DEFAULT("plus", plus)
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 21.37931
| 79
| 0.462903
|
broken-wheel
|
8299303688cf17846ef183fd32ba010c19d7f781
| 744
|
cpp
|
C++
|
Object Oriented Algo Design in C++/practice/vector.cpp
|
aishwaryamallampati/BTech-IIITDM
|
4cfc25a4e6e066b848361cb92770cad3260c7d48
|
[
"MIT"
] | null | null | null |
Object Oriented Algo Design in C++/practice/vector.cpp
|
aishwaryamallampati/BTech-IIITDM
|
4cfc25a4e6e066b848361cb92770cad3260c7d48
|
[
"MIT"
] | null | null | null |
Object Oriented Algo Design in C++/practice/vector.cpp
|
aishwaryamallampati/BTech-IIITDM
|
4cfc25a4e6e066b848361cb92770cad3260c7d48
|
[
"MIT"
] | null | null | null |
#include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<int>vec;//creating a vector to store integers
int i,n,value;
cout<<"vector size="<<vec.size()<<endl;
cout<<"enter the number of elements to be inserted in the vector:";
cin>>n;
cout<<"\nenter the elements:";
for(i=1;i<=n;i++)//we have to store from i=0 if we want to print using for loop
{
cin>>value;
vec.push_back(value);
}
cout<<"\nthe stored elements are:";
for(i=1;i<=n;i++)
{
cout<<"\nthe value of vec["<<i<<"]="<<vec[i]<<endl;
}
vector<int>::iterator v=vec.begin();//using iterator to traverse through the array is best as it exactly gives out all the elements
while(v!=vec.end())
{
cout<<"\nthe value of vec="<<*v<<endl;
v++;
}
}
| 24.8
| 132
| 0.649194
|
aishwaryamallampati
|
829f476a47dd2f732f9e9132495e0318a970c9ee
| 953
|
cpp
|
C++
|
Progs/Ch03/Adswitch.cpp
|
singhnir/C-Plus-Plus-Robert-Lafore
|
7ce3c92d15958e157484fc989632b879360103aa
|
[
"MIT"
] | 4
|
2021-02-24T06:53:51.000Z
|
2022-02-18T11:15:19.000Z
|
Progs/Ch03/Adswitch.cpp
|
singhnir/C-Plus-Plus-Robert-Lafore
|
7ce3c92d15958e157484fc989632b879360103aa
|
[
"MIT"
] | null | null | null |
Progs/Ch03/Adswitch.cpp
|
singhnir/C-Plus-Plus-Robert-Lafore
|
7ce3c92d15958e157484fc989632b879360103aa
|
[
"MIT"
] | 4
|
2021-02-24T07:05:43.000Z
|
2022-03-09T17:45:32.000Z
|
// adswitch.cpp
// demonstrates SWITCH with adventure program
#include <iostream>
using namespace std;
#include <conio.h> //for getche()
int main()
{
char dir='a';
int x=10, y=10;
while( dir != '\r' )
{
cout << "\nYour location is " << x << ", " << y;
cout << "\nEnter direction (n, s, e, w): ";
dir = getche(); //get character
switch(dir) //switch on it
{
case 'n': y--; break; //go north
case 's': y++; break; //go south
case 'e': x++; break; //go east
case 'w': x--; break; //go west
case '\r': cout << "Exiting\n"; break; //Enter key
default: cout << "Try again\n"; //unknown char
} //end switch
} //end while
return 0;
} //end main
| 34.035714
| 64
| 0.400839
|
singhnir
|
82a4046dfca6f406ee9a8f7402e346bbe7977621
| 8,387
|
cpp
|
C++
|
src/main/report.cpp
|
jack-running/mmbot
|
f9015d88ac00524736545119ee1d073546bc2caa
|
[
"MIT"
] | null | null | null |
src/main/report.cpp
|
jack-running/mmbot
|
f9015d88ac00524736545119ee1d073546bc2caa
|
[
"MIT"
] | null | null | null |
src/main/report.cpp
|
jack-running/mmbot
|
f9015d88ac00524736545119ee1d073546bc2caa
|
[
"MIT"
] | null | null | null |
/*
* report.cpp
*
* Created on: 17. 5. 2019
* Author: ondra
*/
#include "report.h"
#include <imtjson/value.h>
#include <imtjson/object.h>
#include <imtjson/array.h>
#include <chrono>
#include <numeric>
#include "../shared/linear_map.h"
#include "../shared/logOutput.h"
#include "../shared/range.h"
#include "../shared/stdLogOutput.h"
#include "sgn.h"
using ondra_shared::logError;
using std::chrono::_V2::system_clock;
using namespace json;
Value fixNum(double val) {
if (isfinite(val)) return val;
else return "∞";
}
void Report::genReport() {
Object st;
exportCharts(st.object("charts"));
exportOrders(st.array("orders"));
exportTitles(st.object("info"));
exportPrices(st.object("prices"));
exportMisc(st.object("misc"));
st.set("interval", interval_in_ms);
st.set("time", std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::system_clock::now().time_since_epoch()
).count());
st.set("log", logLines);
while (logLines.size()>30) logLines.erase(0);
report->store(st);
}
struct ChartData {
Array records;
double last_price = 0;
double sums = 0;
double assets = 0;
double init_price = 0;
};
void Report::setOrders(StrViewA symb, const std::optional<IStockApi::Order> &buy,
const std::optional<IStockApi::Order> &sell) {
const json::Value &info = infoMap[symb];
bool inverted = info["inverted"].getBool();
int buyid = inverted?-1:1;
OKey buyKey {symb, buyid};
OKey sellKey {symb, -buyid};
if (buy.has_value()) {
orderMap[buyKey] = {inverted?1.0/buy->price:buy->price, buy->size*buyid};
} else{
orderMap[buyKey] = {0, 0};
}
if (sell.has_value()) {
orderMap[sellKey] = {inverted?1.0/sell->price:sell->price, sell->size*buyid};
} else {
orderMap[sellKey] = {0, 0};
}
}
void Report::setTrades(StrViewA symb, StringView<IStockApi::TradeWithBalance> trades) {
using ondra_shared::range;
json::Array records;
const json::Value &info = infoMap[symb];
bool inverted = info["inverted"].getBool();
bool margin = false; //TODO TBD
if (!trades.empty()) {
const auto &last = trades[trades.length-1];
std::size_t last_time = last.time;
std::size_t first = last_time - interval_in_ms;
auto tend = trades.end();
auto iter = trades.begin();
auto &&t = *iter;
std::size_t invest_beg_time = t.time;
double invst_value = t.eff_price*t.balance;
//so the first trade doesn't change the value of portfolio
// double init_value = init_balance*t.eff_price+init_fiat;
//
double init_price = t.eff_price;
double prev_balance = t.balance-t.eff_size;
double prev_price = init_price;
double ass_sum = 0;
double cur_sum = 0;
double cur_fromPos = 0;
double norm_sum_ass = 0;
double norm_sum_cur = 0;
while (iter != tend) {
auto &&t = *iter;
double gain = (t.eff_price - prev_price)*ass_sum ;
double earn = -t.eff_price * t.eff_size;
double bal_chng = (t.balance - prev_balance) - t.eff_size;
invst_value += bal_chng * t.eff_price;
double calcbal = prev_balance * sqrt(prev_price/t.eff_price);
double asschg = (prev_balance+t.eff_size) - calcbal ;
double curchg = -(calcbal * t.eff_price - prev_balance * prev_price - earn);
double norm_chng = 0;
if (iter != trades.begin() && !iter->manual_trade) {
cur_fromPos += gain;
ass_sum += t.eff_size;
cur_sum += earn;
norm_sum_ass += asschg;
norm_sum_cur += curchg;
norm_chng = curchg+asschg * t.eff_price;
}
if (iter->manual_trade) {
invst_value += earn;
}
double norm = norm_sum_cur+(margin?norm_sum_ass:0)*t.eff_price;
prev_balance = t.balance;
prev_price = t.eff_price;
double invst_time = t.time - invest_beg_time;
double invst_n = norm/invst_time;
if (!std::isfinite(invst_n)) invst_n = 0;
if (t.time >= first) {
records.push_back(Object
("id", t.id)
("time", t.time)
("achg", (inverted?-1:1)*t.eff_size)
("gain", gain)
("norm", norm)
("normch", norm_chng)
("nacum", (inverted?-1:1)*norm_sum_ass)
("pos", (inverted?-1:1)*ass_sum)
("pl", cur_fromPos)
("price", (inverted?1.0/t.price:t.price))
("invst_v", invst_value)
("invst_n", invst_n)
("volume", (inverted?1:-1)*t.eff_price*t.eff_size)
("man",t.manual_trade)
);
}
++iter;
}
}
tradeMap[symb] = records;
}
void Report::exportCharts(json::Object&& out) {
for (auto &&rec: tradeMap) {
out.set(rec.first, rec.second);
}
}
bool Report::OKeyCmp::operator ()(const OKey& a, const OKey& b) const {
int cmp = a.symb.compare(b.symb);
if (cmp == 0) {
return a.dir < b.dir;
} else {
return cmp < 0;
}
}
void Report::setInfo(StrViewA symb, const InfoObj &infoObj) {
infoMap[symb] = Object
("title",infoObj.title)
("currency", infoObj.currencySymb)
("asset", infoObj.assetSymb)
("price_symb", infoObj.priceSymb)
("inverted", infoObj.inverted)
("emulated",infoObj.emulated);
}
void Report::setPrice(StrViewA symb, double price) {
const json::Value &info = infoMap[symb];
bool inverted = info["inverted"].getBool();
priceMap[symb] = inverted?1.0/price:price;;
}
void Report::exportOrders(json::Array &&out) {
for (auto &&ord : orderMap) {
if (ord.second.size) {
out.push_back(Object
("symb",ord.first.symb)
("dir",static_cast<int>(ord.first.dir))
("size",ord.second.size)
("price",ord.second.price)
);
}
}
}
void Report::exportTitles(json::Object&& out) {
for (auto &&rec: infoMap) {
out.set(rec.first, rec.second);
}
}
void Report::exportPrices(json::Object &&out) {
for (auto &&rec: priceMap) {
out.set(rec.first, rec.second);
}
}
void Report::setError(StrViewA symb, const ErrorObj &errorObj) {
Object obj;
if (!errorObj.genError.empty()) obj.set("gen", errorObj.genError);
if (!errorObj.buyError.empty()) obj.set("buy", errorObj.buyError);
if (!errorObj.sellError.empty()) obj.set("sell", errorObj.sellError);
errorMap[symb] = obj;
}
void Report::exportMisc(json::Object &&out) {
for (auto &&rec: miscMap) {
auto erritr = errorMap.find(rec.first);
Value err = erritr == errorMap.end()?Value():erritr->second;
out.set(rec.first, rec.second.replace("error", err));
}
}
void Report::addLogLine(StrViewA ln) {
logLines.push_back(ln);
}
using namespace ondra_shared;
class CaptureLog: public ondra_shared::StdLogProviderFactory {
public:
CaptureLog(Report &rpt, ondra_shared::PStdLogProviderFactory target):rpt(rpt),target(target) {}
virtual void writeToLog(const StrViewA &line, const std::time_t &, LogLevel level) override;
virtual bool isLogLevelEnabled(ondra_shared::LogLevel lev) const override;
protected:
Report &rpt;
ondra_shared::PStdLogProviderFactory target;
};
inline void CaptureLog::writeToLog(const StrViewA& line, const std::time_t&tm, LogLevel level) {
if (level >= LogLevel::info) rpt.addLogLine(line);
target->sendToLog(line, tm, level);
}
inline bool CaptureLog::isLogLevelEnabled(ondra_shared::LogLevel lev) const {
return target->isLogLevelEnabled(lev);
}
ondra_shared::PStdLogProviderFactory Report::captureLog(ondra_shared::PStdLogProviderFactory target) {
return new CaptureLog(*this, target);
}
void Report::setMisc(StrViewA symb, const MiscData &miscData) {
const json::Value &info = infoMap[symb];
bool inverted = info["inverted"].getBool();
double spread;
if (inverted) {
spread = 1.0/miscData.calc_price - 1.0/(miscData.spread+miscData.calc_price) ;
} else {
spread = miscData.spread;
}
if (inverted) {
miscMap[symb] = Object
("t",-miscData.trade_dir)
("a", miscData.achieve)
("mcp", fixNum(1.0/miscData.calc_price))
("mv", fixNum(miscData.value))
("ms", fixNum(spread))
("mdmb", fixNum(miscData.dynmult_sell))
("mdms", fixNum(miscData.dynmult_buy))
("mb",fixNum(miscData.boost))
("ml",fixNum(1.0/miscData.highest_price))
("mh",fixNum(1.0/miscData.lowest_price))
("mt",miscData.total_trades);
} else {
miscMap[symb] = Object
("t",miscData.trade_dir)
("a", miscData.achieve)
("mcp", fixNum(miscData.calc_price))
("mv", fixNum(miscData.value))
("ms", fixNum(spread))
("mdmb", fixNum(miscData.dynmult_buy))
("mdms", fixNum(miscData.dynmult_sell))
("mb",fixNum(miscData.boost))
("ml",fixNum(miscData.lowest_price))
("mh",fixNum(miscData.highest_price))
("mt",miscData.total_trades);
}
}
| 24.380814
| 102
| 0.665435
|
jack-running
|
82a7211cfeb7b0ee1fdb5f38a7bec1f68d8340c2
| 499
|
cpp
|
C++
|
data/main.cpp
|
noahleft/serialization
|
731ebcee68339960308a86b25cf3c11ba815043e
|
[
"MIT"
] | null | null | null |
data/main.cpp
|
noahleft/serialization
|
731ebcee68339960308a86b25cf3c11ba815043e
|
[
"MIT"
] | null | null | null |
data/main.cpp
|
noahleft/serialization
|
731ebcee68339960308a86b25cf3c11ba815043e
|
[
"MIT"
] | null | null | null |
#include <iostream>
#include "data.hpp"
int main() {
std::string buf;
auto root = get_serializable_object();
#if defined(SERIALIZE)
buf = serialize(root);
auto des = deserialize(buf);
std::cout << "Is serialize/deserialize result equivalent:" << is_equal(root, des) << std::endl;
std::cout << "Is serialize/deserialize result identical :" << is_identical(root, des) << std::endl;
#else
buf = dump_object(root);
std::cout << buf << std::endl;
#endif
return 0;
}
| 26.263158
| 103
| 0.645291
|
noahleft
|
82a940641f8d61754e09d6f0ff19ab3dd922b25c
| 1,400
|
cpp
|
C++
|
game/src/BigAlan.cpp
|
unbgames/DigAlanDig
|
0e78ee6ef2d253c2d32db0835b24503a38850057
|
[
"Zlib"
] | null | null | null |
game/src/BigAlan.cpp
|
unbgames/DigAlanDig
|
0e78ee6ef2d253c2d32db0835b24503a38850057
|
[
"Zlib"
] | null | null | null |
game/src/BigAlan.cpp
|
unbgames/DigAlanDig
|
0e78ee6ef2d253c2d32db0835b24503a38850057
|
[
"Zlib"
] | 5
|
2018-08-28T01:50:25.000Z
|
2018-09-10T13:03:45.000Z
|
#include "BigAlan.h"
#include "Game.h"
#include "AlanAnimation.h"
#include "InputManager.h"
#include "GridControl.h"
void BigAlan::Update(float dt) {
int combo = Game::GetInstance()->combo;
int diffCombo = std::abs(combo - oldCombo);
oldCombo = combo;
if(Game::GetInstance()->GetGridControl()->GetAlan().lock()->GetComponent<AlanAnimation *>()->GetCurrentState() == AlanAnimation::State::DEAD){
if(currentState != BAState::TRASH){
currentState = BAState::TRASH;
sprite->Open(state[currentState], 0);
}
return;
}
BAState oldState = currentState;
switch (currentState) {
case BAState::STARTER:
case BAState::GOOD:
if (Game::GetInstance()->combo > 10)
currentState = BAState::GOOD;
else if (diffCombo > 5)
currentState = BAState::DECENT;
else if (diffCombo > 10)
currentState = BAState::TRASH;
break;
case BAState::DECENT:
if (Game::GetInstance()->combo > 2) currentState = BAState::STARTER;
break;
case BAState::TRASH:
if (Game::GetInstance()->combo > 3) currentState = BAState::STARTER;
break;
default:
currentState = BAState::STARTER;
}
if (currentState != oldState) sprite->Open(state[currentState], 0);
}
| 29.166667
| 146
| 0.576429
|
unbgames
|
82aae7812f8222a456908f2d0906b5b17f7d3276
| 1,929
|
cpp
|
C++
|
higan/processor/arm/arm.cpp
|
ameer-bauer/higan-097
|
a4a28968173ead8251cfa7cd6b5bf963ee68308f
|
[
"Info-ZIP"
] | 3
|
2016-03-23T01:17:36.000Z
|
2019-10-25T06:41:09.000Z
|
higan/processor/arm/arm.cpp
|
ameer-bauer/higan-097
|
a4a28968173ead8251cfa7cd6b5bf963ee68308f
|
[
"Info-ZIP"
] | null | null | null |
higan/processor/arm/arm.cpp
|
ameer-bauer/higan-097
|
a4a28968173ead8251cfa7cd6b5bf963ee68308f
|
[
"Info-ZIP"
] | null | null | null |
#include <processor/processor.hpp>
#include "arm.hpp"
namespace Processor {
#include "registers.cpp"
#include "algorithms.cpp"
#include "instructions-arm.cpp"
#include "instructions-thumb.cpp"
#include "step.cpp"
#include "disassembler.cpp"
#include "serialization.cpp"
auto ARM::power() -> void {
processor.power();
vector(0x00000000, Processor::Mode::SVC);
pipeline.reload = true;
pipeline.nonsequential = true;
crash = false;
r(15).modify = [&] {
pipeline.reload = true;
};
trace = false;
instructions = 0;
}
auto ARM::exec() -> void {
cpsr().t ? thumb_step() : arm_step();
}
auto ARM::idle() -> void {
pipeline.nonsequential = true;
return bus_idle();
}
auto ARM::read(unsigned mode, uint32 addr) -> uint32 {
return bus_read(mode, addr);
}
auto ARM::load(unsigned mode, uint32 addr) -> uint32 {
pipeline.nonsequential = true;
uint32 word = bus_read(Load | mode, addr);
if(mode & Half) {
addr &= 1;
word = mode & Signed ? (int16)word : (uint16)word;
}
if(mode & Byte) {
addr &= 0;
word = mode & Signed ? (int8)word : (uint8)word;
}
if(mode & Signed) {
word = asr(word, 8 * (addr & 3));
} else {
word = ror(word, 8 * (addr & 3));
}
idle();
return word;
}
auto ARM::write(unsigned mode, uint32 addr, uint32 word) -> void {
pipeline.nonsequential = true;
return bus_write(mode, addr, word);
}
auto ARM::store(unsigned mode, uint32 addr, uint32 word) -> void {
pipeline.nonsequential = true;
if(mode & Half) { word &= 0xffff; word |= word << 16; }
if(mode & Byte) { word &= 0xff; word |= word << 8; word |= word << 16; }
return bus_write(Store | mode, addr, word);
}
auto ARM::vector(uint32 addr, Processor::Mode mode) -> void {
auto psr = cpsr();
processor.setMode(mode);
spsr() = psr;
cpsr().i = 1;
cpsr().f |= mode == Processor::Mode::FIQ;
cpsr().t = 0;
r(14) = pipeline.decode.address;
r(15) = addr;
}
}
| 21.197802
| 74
| 0.622602
|
ameer-bauer
|
82acadd7d3cb5c0245dc70cc1ce0c57ad163287b
| 142
|
cpp
|
C++
|
obi-problems/problem011/main.cpp
|
Davi-Argemiro/Algorithms-and-Data-Structures
|
4cbf083fbe00da793c1147c4b9e3493d96ac50a1
|
[
"MIT"
] | 1
|
2022-03-01T15:47:08.000Z
|
2022-03-01T15:47:08.000Z
|
obi-problems/problem011/main.cpp
|
Davi-Argemiro/Algorithms-and-Data-Structures
|
4cbf083fbe00da793c1147c4b9e3493d96ac50a1
|
[
"MIT"
] | 1
|
2022-03-21T20:01:08.000Z
|
2022-03-21T20:01:08.000Z
|
obi-problems/problem011/main.cpp
|
Davi-Argemiro/Algorithms-and-Data-Structures
|
4cbf083fbe00da793c1147c4b9e3493d96ac50a1
|
[
"MIT"
] | 1
|
2022-03-21T17:53:34.000Z
|
2022-03-21T17:53:34.000Z
|
#include <iostream>
using namespace std;
int main() {
int a1, a2, r;
cin >> a1 >> a2;
r = a2-a1;
cout << a2+r << endl;
return 0;
}
| 9.466667
| 22
| 0.542254
|
Davi-Argemiro
|
82af3632e4d16adcbd7e4520df3148509afb5138
| 448,398
|
cpp
|
C++
|
test/OpenMP/target_parallel_if_codegen.cpp
|
tkolar23/llvm-clang
|
73c44a584ba4ff5e186d0c05a2b29b2dbed98148
|
[
"Apache-2.0"
] | null | null | null |
test/OpenMP/target_parallel_if_codegen.cpp
|
tkolar23/llvm-clang
|
73c44a584ba4ff5e186d0c05a2b29b2dbed98148
|
[
"Apache-2.0"
] | null | null | null |
test/OpenMP/target_parallel_if_codegen.cpp
|
tkolar23/llvm-clang
|
73c44a584ba4ff5e186d0c05a2b29b2dbed98148
|
[
"Apache-2.0"
] | null | null | null |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _
// Test host codegen.
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK1
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK2
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK3
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK4
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// Test target codegen - host bc file has to be created first.
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --check-prefix=CHECK9
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK10
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix=CHECK11
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
// RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK12
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK17
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK18
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK19
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK20
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// Test target codegen - host bc file has to be created first.
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --check-prefix=CHECK25
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK26
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix=CHECK27
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
// RUN: %clang_cc1 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK28
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm-bc %s -o %t-ppc-host.bc
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm-bc %s -o %t-x86-host.bc
// RUN: %clang_cc1 -verify -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o %t %s
// RUN: %clang_cc1 -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
// expected-no-diagnostics
#ifndef HEADER
#define HEADER
// We have 6 target regions
// Check target registration is registered as a Ctor.
template<typename tx>
tx ftemplate(int n) {
tx a = 0;
#pragma omp target parallel if(parallel: 0)
{
a += 1;
}
short b = 1;
#pragma omp target parallel if(parallel: 1)
{
a += b;
}
return a;
}
static
int fstatic(int n) {
#pragma omp target parallel if(n>1)
{
}
#pragma omp target parallel if(target: n-2>2)
{
}
return n+1;
}
struct S1 {
double a;
int r1(int n){
int b = 1;
#pragma omp target parallel if(parallel: n>3)
{
this->a = (double)b + 1.5;
}
#pragma omp target parallel if(target: n>4) if(parallel: n>5)
{
this->a = 2.5;
}
return (int)a;
}
};
int bar(int n){
int a = 0;
S1 S;
a += S.r1(n);
a += fstatic(n);
a += ftemplate<int>(n);
return a;
}
// Check that the offloading functions are emitted and that the parallel function
// is appropriately guarded.
#endif
// CHECK1-LABEL: define {{[^@]+}}@_Z3bari
// CHECK1-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[S:%.*]] = alloca [[STRUCT_S1:%.*]], align 8
// CHECK1-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK1-NEXT: store i32 0, i32* [[A]], align 4
// CHECK1-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK1-NEXT: [[CALL:%.*]] = call noundef signext i32 @_ZN2S12r1Ei(%struct.S1* noundef [[S]], i32 noundef signext [[TMP0]])
// CHECK1-NEXT: [[TMP1:%.*]] = load i32, i32* [[A]], align 4
// CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CALL]]
// CHECK1-NEXT: store i32 [[ADD]], i32* [[A]], align 4
// CHECK1-NEXT: [[TMP2:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK1-NEXT: [[CALL1:%.*]] = call noundef signext i32 @_ZL7fstatici(i32 noundef signext [[TMP2]])
// CHECK1-NEXT: [[TMP3:%.*]] = load i32, i32* [[A]], align 4
// CHECK1-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP3]], [[CALL1]]
// CHECK1-NEXT: store i32 [[ADD2]], i32* [[A]], align 4
// CHECK1-NEXT: [[TMP4:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK1-NEXT: [[CALL3:%.*]] = call noundef signext i32 @_Z9ftemplateIiET_i(i32 noundef signext [[TMP4]])
// CHECK1-NEXT: [[TMP5:%.*]] = load i32, i32* [[A]], align 4
// CHECK1-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP5]], [[CALL3]]
// CHECK1-NEXT: store i32 [[ADD4]], i32* [[A]], align 4
// CHECK1-NEXT: [[TMP6:%.*]] = load i32, i32* [[A]], align 4
// CHECK1-NEXT: ret i32 [[TMP6]]
//
//
// CHECK1-LABEL: define {{[^@]+}}@_ZN2S12r1Ei
// CHECK1-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef signext [[N:%.*]]) #[[ATTR0]] comdat align 2 {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK1-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[B:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK1-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x i8*], align 8
// CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x i8*], align 8
// CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x i8*], align 8
// CHECK1-NEXT: [[DOTCAPTURE_EXPR_5:%.*]] = alloca i8, align 1
// CHECK1-NEXT: [[DOTCAPTURE_EXPR__CASTED9:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS14:%.*]] = alloca [2 x i8*], align 8
// CHECK1-NEXT: [[DOTOFFLOAD_PTRS15:%.*]] = alloca [2 x i8*], align 8
// CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS16:%.*]] = alloca [2 x i8*], align 8
// CHECK1-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK1-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK1-NEXT: [[THIS1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK1-NEXT: store i32 1, i32* [[B]], align 4
// CHECK1-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 3
// CHECK1-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK1-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK1-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[B_CASTED]] to i32*
// CHECK1-NEXT: store i32 [[TMP1]], i32* [[CONV]], align 4
// CHECK1-NEXT: [[TMP2:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK1-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK1-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK1-NEXT: [[CONV2:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK1-NEXT: [[FROMBOOL3:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK1-NEXT: store i8 [[FROMBOOL3]], i8* [[CONV2]], align 1
// CHECK1-NEXT: [[TMP4:%.*]] = load i64, i64* [[DOTCAPTURE_EXPR__CASTED]], align 8
// CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP6:%.*]] = bitcast i8** [[TMP5]] to %struct.S1**
// CHECK1-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP6]], align 8
// CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to double**
// CHECK1-NEXT: store double* [[A]], double** [[TMP8]], align 8
// CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK1-NEXT: store i8* null, i8** [[TMP9]], align 8
// CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK1-NEXT: [[TMP11:%.*]] = bitcast i8** [[TMP10]] to i64*
// CHECK1-NEXT: store i64 [[TMP2]], i64* [[TMP11]], align 8
// CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK1-NEXT: [[TMP13:%.*]] = bitcast i8** [[TMP12]] to i64*
// CHECK1-NEXT: store i64 [[TMP2]], i64* [[TMP13]], align 8
// CHECK1-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
// CHECK1-NEXT: store i8* null, i8** [[TMP14]], align 8
// CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
// CHECK1-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i64*
// CHECK1-NEXT: store i64 [[TMP4]], i64* [[TMP16]], align 8
// CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 2
// CHECK1-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i64*
// CHECK1-NEXT: store i64 [[TMP4]], i64* [[TMP18]], align 8
// CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
// CHECK1-NEXT: store i8* null, i8** [[TMP19]], align 8
// CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP22:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK1-NEXT: [[TOBOOL4:%.*]] = trunc i8 [[TMP22]] to i1
// CHECK1-NEXT: [[TMP23:%.*]] = select i1 [[TOBOOL4]], i32 0, i32 1
// CHECK1-NEXT: [[TMP24:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1:[0-9]+]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121.region_id, i32 3, i8** [[TMP20]], i8** [[TMP21]], i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_sizes, i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_maptypes, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP23]])
// CHECK1-NEXT: [[TMP25:%.*]] = icmp ne i32 [[TMP24]], 0
// CHECK1-NEXT: br i1 [[TMP25]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK1: omp_offload.failed:
// CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121(%struct.S1* [[THIS1]], i64 [[TMP2]], i64 [[TMP4]]) #[[ATTR3:[0-9]+]]
// CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK1: omp_offload.cont:
// CHECK1-NEXT: [[TMP26:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK1-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[TMP26]], 5
// CHECK1-NEXT: [[FROMBOOL7:%.*]] = zext i1 [[CMP6]] to i8
// CHECK1-NEXT: store i8 [[FROMBOOL7]], i8* [[DOTCAPTURE_EXPR_5]], align 1
// CHECK1-NEXT: [[TMP27:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_5]], align 1
// CHECK1-NEXT: [[TOBOOL8:%.*]] = trunc i8 [[TMP27]] to i1
// CHECK1-NEXT: [[CONV10:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__CASTED9]] to i8*
// CHECK1-NEXT: [[FROMBOOL11:%.*]] = zext i1 [[TOBOOL8]] to i8
// CHECK1-NEXT: store i8 [[FROMBOOL11]], i8* [[CONV10]], align 1
// CHECK1-NEXT: [[TMP28:%.*]] = load i64, i64* [[DOTCAPTURE_EXPR__CASTED9]], align 8
// CHECK1-NEXT: [[TMP29:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK1-NEXT: [[CMP12:%.*]] = icmp sgt i32 [[TMP29]], 4
// CHECK1-NEXT: br i1 [[CMP12]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK1: omp_if.then:
// CHECK1-NEXT: [[A13:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK1-NEXT: [[TMP30:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS14]], i32 0, i32 0
// CHECK1-NEXT: [[TMP31:%.*]] = bitcast i8** [[TMP30]] to %struct.S1**
// CHECK1-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP31]], align 8
// CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS15]], i32 0, i32 0
// CHECK1-NEXT: [[TMP33:%.*]] = bitcast i8** [[TMP32]] to double**
// CHECK1-NEXT: store double* [[A13]], double** [[TMP33]], align 8
// CHECK1-NEXT: [[TMP34:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS16]], i64 0, i64 0
// CHECK1-NEXT: store i8* null, i8** [[TMP34]], align 8
// CHECK1-NEXT: [[TMP35:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS14]], i32 0, i32 1
// CHECK1-NEXT: [[TMP36:%.*]] = bitcast i8** [[TMP35]] to i64*
// CHECK1-NEXT: store i64 [[TMP28]], i64* [[TMP36]], align 8
// CHECK1-NEXT: [[TMP37:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS15]], i32 0, i32 1
// CHECK1-NEXT: [[TMP38:%.*]] = bitcast i8** [[TMP37]] to i64*
// CHECK1-NEXT: store i64 [[TMP28]], i64* [[TMP38]], align 8
// CHECK1-NEXT: [[TMP39:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS16]], i64 0, i64 1
// CHECK1-NEXT: store i8* null, i8** [[TMP39]], align 8
// CHECK1-NEXT: [[TMP40:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS14]], i32 0, i32 0
// CHECK1-NEXT: [[TMP41:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS15]], i32 0, i32 0
// CHECK1-NEXT: [[TMP42:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_5]], align 1
// CHECK1-NEXT: [[TOBOOL17:%.*]] = trunc i8 [[TMP42]] to i1
// CHECK1-NEXT: [[TMP43:%.*]] = select i1 [[TOBOOL17]], i32 0, i32 1
// CHECK1-NEXT: [[TMP44:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126.region_id, i32 2, i8** [[TMP40]], i8** [[TMP41]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.2, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.3, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP43]])
// CHECK1-NEXT: [[TMP45:%.*]] = icmp ne i32 [[TMP44]], 0
// CHECK1-NEXT: br i1 [[TMP45]], label [[OMP_OFFLOAD_FAILED18:%.*]], label [[OMP_OFFLOAD_CONT19:%.*]]
// CHECK1: omp_offload.failed18:
// CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i64 [[TMP28]]) #[[ATTR3]]
// CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT19]]
// CHECK1: omp_offload.cont19:
// CHECK1-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK1: omp_if.else:
// CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i64 [[TMP28]]) #[[ATTR3]]
// CHECK1-NEXT: br label [[OMP_IF_END]]
// CHECK1: omp_if.end:
// CHECK1-NEXT: [[A20:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK1-NEXT: [[TMP46:%.*]] = load double, double* [[A20]], align 8
// CHECK1-NEXT: [[CONV21:%.*]] = fptosi double [[TMP46]] to i32
// CHECK1-NEXT: ret i32 [[CONV21]]
//
//
// CHECK1-LABEL: define {{[^@]+}}@_ZL7fstatici
// CHECK1-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK1-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 8
// CHECK1-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK1-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 1
// CHECK1-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK1-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK1-NEXT: [[TMP1:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK1-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK1-NEXT: [[FROMBOOL1:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK1-NEXT: store i8 [[FROMBOOL1]], i8* [[CONV]], align 1
// CHECK1-NEXT: [[TMP2:%.*]] = load i64, i64* [[DOTCAPTURE_EXPR__CASTED]], align 8
// CHECK1-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK1-NEXT: [[TOBOOL2:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK1-NEXT: br i1 [[TOBOOL2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK1: omp_if.then:
// CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i64*
// CHECK1-NEXT: store i64 [[TMP2]], i64* [[TMP5]], align 8
// CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP7:%.*]] = bitcast i8** [[TMP6]] to i64*
// CHECK1-NEXT: store i64 [[TMP2]], i64* [[TMP7]], align 8
// CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK1-NEXT: store i8* null, i8** [[TMP8]], align 8
// CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP11:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK1-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP11]] to i1
// CHECK1-NEXT: [[TMP12:%.*]] = select i1 [[TOBOOL3]], i32 0, i32 1
// CHECK1-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104.region_id, i32 1, i8** [[TMP9]], i8** [[TMP10]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.5, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.6, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP12]])
// CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
// CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK1: omp_offload.failed:
// CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i64 [[TMP2]]) #[[ATTR3]]
// CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK1: omp_offload.cont:
// CHECK1-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK1: omp_if.else:
// CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i64 [[TMP2]]) #[[ATTR3]]
// CHECK1-NEXT: br label [[OMP_IF_END]]
// CHECK1: omp_if.end:
// CHECK1-NEXT: [[TMP15:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK1-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP15]], 2
// CHECK1-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[SUB]], 2
// CHECK1-NEXT: br i1 [[CMP4]], label [[OMP_IF_THEN5:%.*]], label [[OMP_IF_ELSE8:%.*]]
// CHECK1: omp_if.then5:
// CHECK1-NEXT: [[TMP16:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108.region_id, i32 0, i8** null, i8** null, i64* null, i64* null, i8** null, i8** null, i32 1, i32 0)
// CHECK1-NEXT: [[TMP17:%.*]] = icmp ne i32 [[TMP16]], 0
// CHECK1-NEXT: br i1 [[TMP17]], label [[OMP_OFFLOAD_FAILED6:%.*]], label [[OMP_OFFLOAD_CONT7:%.*]]
// CHECK1: omp_offload.failed6:
// CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT7]]
// CHECK1: omp_offload.cont7:
// CHECK1-NEXT: br label [[OMP_IF_END9:%.*]]
// CHECK1: omp_if.else8:
// CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK1-NEXT: br label [[OMP_IF_END9]]
// CHECK1: omp_if.end9:
// CHECK1-NEXT: [[TMP18:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP18]], 1
// CHECK1-NEXT: ret i32 [[ADD]]
//
//
// CHECK1-LABEL: define {{[^@]+}}@_Z9ftemplateIiET_i
// CHECK1-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0]] comdat {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 8
// CHECK1-NEXT: [[B:%.*]] = alloca i16, align 2
// CHECK1-NEXT: [[A_CASTED1:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS4:%.*]] = alloca [2 x i8*], align 8
// CHECK1-NEXT: [[DOTOFFLOAD_PTRS5:%.*]] = alloca [2 x i8*], align 8
// CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS6:%.*]] = alloca [2 x i8*], align 8
// CHECK1-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK1-NEXT: store i32 0, i32* [[A]], align 4
// CHECK1-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK1-NEXT: store i32 [[TMP0]], i32* [[CONV]], align 4
// CHECK1-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i64*
// CHECK1-NEXT: store i64 [[TMP1]], i64* [[TMP3]], align 8
// CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i64*
// CHECK1-NEXT: store i64 [[TMP1]], i64* [[TMP5]], align 8
// CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK1-NEXT: store i8* null, i8** [[TMP6]], align 8
// CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK1-NEXT: [[TMP9:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87.region_id, i32 1, i8** [[TMP7]], i8** [[TMP8]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.9, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.10, i32 0, i32 0), i8** null, i8** null, i32 1, i32 1)
// CHECK1-NEXT: [[TMP10:%.*]] = icmp ne i32 [[TMP9]], 0
// CHECK1-NEXT: br i1 [[TMP10]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK1: omp_offload.failed:
// CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87(i64 [[TMP1]]) #[[ATTR3]]
// CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK1: omp_offload.cont:
// CHECK1-NEXT: store i16 1, i16* [[B]], align 2
// CHECK1-NEXT: [[TMP11:%.*]] = load i32, i32* [[A]], align 4
// CHECK1-NEXT: [[CONV2:%.*]] = bitcast i64* [[A_CASTED1]] to i32*
// CHECK1-NEXT: store i32 [[TMP11]], i32* [[CONV2]], align 4
// CHECK1-NEXT: [[TMP12:%.*]] = load i64, i64* [[A_CASTED1]], align 8
// CHECK1-NEXT: [[TMP13:%.*]] = load i16, i16* [[B]], align 2
// CHECK1-NEXT: [[CONV3:%.*]] = bitcast i64* [[B_CASTED]] to i16*
// CHECK1-NEXT: store i16 [[TMP13]], i16* [[CONV3]], align 2
// CHECK1-NEXT: [[TMP14:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 0
// CHECK1-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i64*
// CHECK1-NEXT: store i64 [[TMP12]], i64* [[TMP16]], align 8
// CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS5]], i32 0, i32 0
// CHECK1-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i64*
// CHECK1-NEXT: store i64 [[TMP12]], i64* [[TMP18]], align 8
// CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS6]], i64 0, i64 0
// CHECK1-NEXT: store i8* null, i8** [[TMP19]], align 8
// CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 1
// CHECK1-NEXT: [[TMP21:%.*]] = bitcast i8** [[TMP20]] to i64*
// CHECK1-NEXT: store i64 [[TMP14]], i64* [[TMP21]], align 8
// CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS5]], i32 0, i32 1
// CHECK1-NEXT: [[TMP23:%.*]] = bitcast i8** [[TMP22]] to i64*
// CHECK1-NEXT: store i64 [[TMP14]], i64* [[TMP23]], align 8
// CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS6]], i64 0, i64 1
// CHECK1-NEXT: store i8* null, i8** [[TMP24]], align 8
// CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 0
// CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS5]], i32 0, i32 0
// CHECK1-NEXT: [[TMP27:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93.region_id, i32 2, i8** [[TMP25]], i8** [[TMP26]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.12, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.13, i32 0, i32 0), i8** null, i8** null, i32 1, i32 0)
// CHECK1-NEXT: [[TMP28:%.*]] = icmp ne i32 [[TMP27]], 0
// CHECK1-NEXT: br i1 [[TMP28]], label [[OMP_OFFLOAD_FAILED7:%.*]], label [[OMP_OFFLOAD_CONT8:%.*]]
// CHECK1: omp_offload.failed7:
// CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93(i64 [[TMP12]], i64 [[TMP14]]) #[[ATTR3]]
// CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT8]]
// CHECK1: omp_offload.cont8:
// CHECK1-NEXT: [[TMP29:%.*]] = load i32, i32* [[A]], align 4
// CHECK1-NEXT: ret i32 [[TMP29]]
//
//
// CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK1-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK1-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK1-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK1-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK1-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK1-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK1-NEXT: [[CONV1:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK1-NEXT: [[TMP2:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK1-NEXT: [[CONV2:%.*]] = bitcast i64* [[B_CASTED]] to i32*
// CHECK1-NEXT: store i32 [[TMP2]], i32* [[CONV2]], align 4
// CHECK1-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK1-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV1]], align 1
// CHECK1-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK1-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK1: omp_if.then:
// CHECK1-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i64)* @.omp_outlined. to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i64 [[TMP3]])
// CHECK1-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK1: omp_if.else:
// CHECK1-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK1-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK1-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK1-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i64 [[TMP3]]) #[[ATTR3]]
// CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK1-NEXT: br label [[OMP_IF_END]]
// CHECK1: omp_if.end:
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK1-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]]) #[[ATTR2:[0-9]+]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK1-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK1-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK1-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK1-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK1-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK1-NEXT: [[CONV1:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK1-NEXT: [[ADD:%.*]] = fadd double [[CONV1]], 1.500000e+00
// CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK1-NEXT: store double [[ADD]], double* [[A]], align 8
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK1-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK1-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK1-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK1-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK1-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK1-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK1-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK1-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK1: omp_if.then:
// CHECK1-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..1 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK1-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK1: omp_if.else:
// CHECK1-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK1-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK1-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK1-NEXT: call void @.omp_outlined..1(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR3]]
// CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK1-NEXT: br label [[OMP_IF_END]]
// CHECK1: omp_if.end:
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK1-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR2]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK1-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK1-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK1-NEXT: store double 2.500000e+00, double* [[A]], align 8
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK1-SAME: (i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK1-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK1-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK1-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK1-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK1: omp_if.then:
// CHECK1-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..4 to void (i32*, i32*, ...)*))
// CHECK1-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK1: omp_if.else:
// CHECK1-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK1-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK1-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK1-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR3]]
// CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK1-NEXT: br label [[OMP_IF_END]]
// CHECK1: omp_if.end:
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK1-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK1-SAME: () #[[ATTR1]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..7 to void (i32*, i32*, ...)*))
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@.omp_outlined..7
// CHECK1-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK1-SAME: (i64 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK1-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK1-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK1-NEXT: [[CONV1:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK1-NEXT: store i32 [[TMP1]], i32* [[CONV1]], align 4
// CHECK1-NEXT: [[TMP2:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK1-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK1-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK1-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK1-NEXT: call void @.omp_outlined..8(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i64 [[TMP2]]) #[[ATTR3]]
// CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@.omp_outlined..8
// CHECK1-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]]) #[[ATTR2]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK1-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK1-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK1-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK1-SAME: (i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK1-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK1-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK1-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK1-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK1-NEXT: [[CONV2:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK1-NEXT: store i32 [[TMP0]], i32* [[CONV2]], align 4
// CHECK1-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK1-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK1-NEXT: [[CONV3:%.*]] = bitcast i64* [[B_CASTED]] to i16*
// CHECK1-NEXT: store i16 [[TMP2]], i16* [[CONV3]], align 2
// CHECK1-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK1-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64)* @.omp_outlined..11 to void (i32*, i32*, ...)*), i64 [[TMP1]], i64 [[TMP3]])
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@.omp_outlined..11
// CHECK1-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR2]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK1-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK1-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK1-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK1-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK1-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK1-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK1-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK1-NEXT: [[CONV2:%.*]] = sext i16 [[TMP0]] to i32
// CHECK1-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV2]]
// CHECK1-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK1-NEXT: ret void
//
//
// CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
// CHECK1-SAME: () #[[ATTR4:[0-9]+]] {
// CHECK1-NEXT: entry:
// CHECK1-NEXT: call void @__tgt_register_requires(i64 1)
// CHECK1-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@_Z3bari
// CHECK2-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[S:%.*]] = alloca [[STRUCT_S1:%.*]], align 8
// CHECK2-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK2-NEXT: store i32 0, i32* [[A]], align 4
// CHECK2-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK2-NEXT: [[CALL:%.*]] = call noundef signext i32 @_ZN2S12r1Ei(%struct.S1* noundef [[S]], i32 noundef signext [[TMP0]])
// CHECK2-NEXT: [[TMP1:%.*]] = load i32, i32* [[A]], align 4
// CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CALL]]
// CHECK2-NEXT: store i32 [[ADD]], i32* [[A]], align 4
// CHECK2-NEXT: [[TMP2:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK2-NEXT: [[CALL1:%.*]] = call noundef signext i32 @_ZL7fstatici(i32 noundef signext [[TMP2]])
// CHECK2-NEXT: [[TMP3:%.*]] = load i32, i32* [[A]], align 4
// CHECK2-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP3]], [[CALL1]]
// CHECK2-NEXT: store i32 [[ADD2]], i32* [[A]], align 4
// CHECK2-NEXT: [[TMP4:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK2-NEXT: [[CALL3:%.*]] = call noundef signext i32 @_Z9ftemplateIiET_i(i32 noundef signext [[TMP4]])
// CHECK2-NEXT: [[TMP5:%.*]] = load i32, i32* [[A]], align 4
// CHECK2-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP5]], [[CALL3]]
// CHECK2-NEXT: store i32 [[ADD4]], i32* [[A]], align 4
// CHECK2-NEXT: [[TMP6:%.*]] = load i32, i32* [[A]], align 4
// CHECK2-NEXT: ret i32 [[TMP6]]
//
//
// CHECK2-LABEL: define {{[^@]+}}@_ZN2S12r1Ei
// CHECK2-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef signext [[N:%.*]]) #[[ATTR0]] comdat align 2 {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK2-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[B:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK2-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x i8*], align 8
// CHECK2-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x i8*], align 8
// CHECK2-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x i8*], align 8
// CHECK2-NEXT: [[DOTCAPTURE_EXPR_5:%.*]] = alloca i8, align 1
// CHECK2-NEXT: [[DOTCAPTURE_EXPR__CASTED9:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTOFFLOAD_BASEPTRS14:%.*]] = alloca [2 x i8*], align 8
// CHECK2-NEXT: [[DOTOFFLOAD_PTRS15:%.*]] = alloca [2 x i8*], align 8
// CHECK2-NEXT: [[DOTOFFLOAD_MAPPERS16:%.*]] = alloca [2 x i8*], align 8
// CHECK2-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK2-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK2-NEXT: [[THIS1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK2-NEXT: store i32 1, i32* [[B]], align 4
// CHECK2-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK2-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 3
// CHECK2-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK2-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK2-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[B_CASTED]] to i32*
// CHECK2-NEXT: store i32 [[TMP1]], i32* [[CONV]], align 4
// CHECK2-NEXT: [[TMP2:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK2-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK2-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK2-NEXT: [[CONV2:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK2-NEXT: [[FROMBOOL3:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK2-NEXT: store i8 [[FROMBOOL3]], i8* [[CONV2]], align 1
// CHECK2-NEXT: [[TMP4:%.*]] = load i64, i64* [[DOTCAPTURE_EXPR__CASTED]], align 8
// CHECK2-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK2-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP6:%.*]] = bitcast i8** [[TMP5]] to %struct.S1**
// CHECK2-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP6]], align 8
// CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to double**
// CHECK2-NEXT: store double* [[A]], double** [[TMP8]], align 8
// CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK2-NEXT: store i8* null, i8** [[TMP9]], align 8
// CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK2-NEXT: [[TMP11:%.*]] = bitcast i8** [[TMP10]] to i64*
// CHECK2-NEXT: store i64 [[TMP2]], i64* [[TMP11]], align 8
// CHECK2-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK2-NEXT: [[TMP13:%.*]] = bitcast i8** [[TMP12]] to i64*
// CHECK2-NEXT: store i64 [[TMP2]], i64* [[TMP13]], align 8
// CHECK2-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
// CHECK2-NEXT: store i8* null, i8** [[TMP14]], align 8
// CHECK2-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
// CHECK2-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i64*
// CHECK2-NEXT: store i64 [[TMP4]], i64* [[TMP16]], align 8
// CHECK2-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 2
// CHECK2-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i64*
// CHECK2-NEXT: store i64 [[TMP4]], i64* [[TMP18]], align 8
// CHECK2-NEXT: [[TMP19:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
// CHECK2-NEXT: store i8* null, i8** [[TMP19]], align 8
// CHECK2-NEXT: [[TMP20:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP21:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP22:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK2-NEXT: [[TOBOOL4:%.*]] = trunc i8 [[TMP22]] to i1
// CHECK2-NEXT: [[TMP23:%.*]] = select i1 [[TOBOOL4]], i32 0, i32 1
// CHECK2-NEXT: [[TMP24:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1:[0-9]+]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121.region_id, i32 3, i8** [[TMP20]], i8** [[TMP21]], i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_sizes, i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_maptypes, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP23]])
// CHECK2-NEXT: [[TMP25:%.*]] = icmp ne i32 [[TMP24]], 0
// CHECK2-NEXT: br i1 [[TMP25]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK2: omp_offload.failed:
// CHECK2-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121(%struct.S1* [[THIS1]], i64 [[TMP2]], i64 [[TMP4]]) #[[ATTR3:[0-9]+]]
// CHECK2-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK2: omp_offload.cont:
// CHECK2-NEXT: [[TMP26:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK2-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[TMP26]], 5
// CHECK2-NEXT: [[FROMBOOL7:%.*]] = zext i1 [[CMP6]] to i8
// CHECK2-NEXT: store i8 [[FROMBOOL7]], i8* [[DOTCAPTURE_EXPR_5]], align 1
// CHECK2-NEXT: [[TMP27:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_5]], align 1
// CHECK2-NEXT: [[TOBOOL8:%.*]] = trunc i8 [[TMP27]] to i1
// CHECK2-NEXT: [[CONV10:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__CASTED9]] to i8*
// CHECK2-NEXT: [[FROMBOOL11:%.*]] = zext i1 [[TOBOOL8]] to i8
// CHECK2-NEXT: store i8 [[FROMBOOL11]], i8* [[CONV10]], align 1
// CHECK2-NEXT: [[TMP28:%.*]] = load i64, i64* [[DOTCAPTURE_EXPR__CASTED9]], align 8
// CHECK2-NEXT: [[TMP29:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK2-NEXT: [[CMP12:%.*]] = icmp sgt i32 [[TMP29]], 4
// CHECK2-NEXT: br i1 [[CMP12]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK2: omp_if.then:
// CHECK2-NEXT: [[A13:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK2-NEXT: [[TMP30:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS14]], i32 0, i32 0
// CHECK2-NEXT: [[TMP31:%.*]] = bitcast i8** [[TMP30]] to %struct.S1**
// CHECK2-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP31]], align 8
// CHECK2-NEXT: [[TMP32:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS15]], i32 0, i32 0
// CHECK2-NEXT: [[TMP33:%.*]] = bitcast i8** [[TMP32]] to double**
// CHECK2-NEXT: store double* [[A13]], double** [[TMP33]], align 8
// CHECK2-NEXT: [[TMP34:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS16]], i64 0, i64 0
// CHECK2-NEXT: store i8* null, i8** [[TMP34]], align 8
// CHECK2-NEXT: [[TMP35:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS14]], i32 0, i32 1
// CHECK2-NEXT: [[TMP36:%.*]] = bitcast i8** [[TMP35]] to i64*
// CHECK2-NEXT: store i64 [[TMP28]], i64* [[TMP36]], align 8
// CHECK2-NEXT: [[TMP37:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS15]], i32 0, i32 1
// CHECK2-NEXT: [[TMP38:%.*]] = bitcast i8** [[TMP37]] to i64*
// CHECK2-NEXT: store i64 [[TMP28]], i64* [[TMP38]], align 8
// CHECK2-NEXT: [[TMP39:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS16]], i64 0, i64 1
// CHECK2-NEXT: store i8* null, i8** [[TMP39]], align 8
// CHECK2-NEXT: [[TMP40:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS14]], i32 0, i32 0
// CHECK2-NEXT: [[TMP41:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS15]], i32 0, i32 0
// CHECK2-NEXT: [[TMP42:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_5]], align 1
// CHECK2-NEXT: [[TOBOOL17:%.*]] = trunc i8 [[TMP42]] to i1
// CHECK2-NEXT: [[TMP43:%.*]] = select i1 [[TOBOOL17]], i32 0, i32 1
// CHECK2-NEXT: [[TMP44:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126.region_id, i32 2, i8** [[TMP40]], i8** [[TMP41]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.2, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.3, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP43]])
// CHECK2-NEXT: [[TMP45:%.*]] = icmp ne i32 [[TMP44]], 0
// CHECK2-NEXT: br i1 [[TMP45]], label [[OMP_OFFLOAD_FAILED18:%.*]], label [[OMP_OFFLOAD_CONT19:%.*]]
// CHECK2: omp_offload.failed18:
// CHECK2-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i64 [[TMP28]]) #[[ATTR3]]
// CHECK2-NEXT: br label [[OMP_OFFLOAD_CONT19]]
// CHECK2: omp_offload.cont19:
// CHECK2-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK2: omp_if.else:
// CHECK2-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i64 [[TMP28]]) #[[ATTR3]]
// CHECK2-NEXT: br label [[OMP_IF_END]]
// CHECK2: omp_if.end:
// CHECK2-NEXT: [[A20:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK2-NEXT: [[TMP46:%.*]] = load double, double* [[A20]], align 8
// CHECK2-NEXT: [[CONV21:%.*]] = fptosi double [[TMP46]] to i32
// CHECK2-NEXT: ret i32 [[CONV21]]
//
//
// CHECK2-LABEL: define {{[^@]+}}@_ZL7fstatici
// CHECK2-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK2-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK2-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK2-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 8
// CHECK2-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK2-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK2-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 1
// CHECK2-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK2-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK2-NEXT: [[TMP1:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK2-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK2-NEXT: [[FROMBOOL1:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK2-NEXT: store i8 [[FROMBOOL1]], i8* [[CONV]], align 1
// CHECK2-NEXT: [[TMP2:%.*]] = load i64, i64* [[DOTCAPTURE_EXPR__CASTED]], align 8
// CHECK2-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK2-NEXT: [[TOBOOL2:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK2-NEXT: br i1 [[TOBOOL2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK2: omp_if.then:
// CHECK2-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i64*
// CHECK2-NEXT: store i64 [[TMP2]], i64* [[TMP5]], align 8
// CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP7:%.*]] = bitcast i8** [[TMP6]] to i64*
// CHECK2-NEXT: store i64 [[TMP2]], i64* [[TMP7]], align 8
// CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK2-NEXT: store i8* null, i8** [[TMP8]], align 8
// CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP11:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK2-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP11]] to i1
// CHECK2-NEXT: [[TMP12:%.*]] = select i1 [[TOBOOL3]], i32 0, i32 1
// CHECK2-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104.region_id, i32 1, i8** [[TMP9]], i8** [[TMP10]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.5, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.6, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP12]])
// CHECK2-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
// CHECK2-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK2: omp_offload.failed:
// CHECK2-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i64 [[TMP2]]) #[[ATTR3]]
// CHECK2-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK2: omp_offload.cont:
// CHECK2-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK2: omp_if.else:
// CHECK2-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i64 [[TMP2]]) #[[ATTR3]]
// CHECK2-NEXT: br label [[OMP_IF_END]]
// CHECK2: omp_if.end:
// CHECK2-NEXT: [[TMP15:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK2-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP15]], 2
// CHECK2-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[SUB]], 2
// CHECK2-NEXT: br i1 [[CMP4]], label [[OMP_IF_THEN5:%.*]], label [[OMP_IF_ELSE8:%.*]]
// CHECK2: omp_if.then5:
// CHECK2-NEXT: [[TMP16:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108.region_id, i32 0, i8** null, i8** null, i64* null, i64* null, i8** null, i8** null, i32 1, i32 0)
// CHECK2-NEXT: [[TMP17:%.*]] = icmp ne i32 [[TMP16]], 0
// CHECK2-NEXT: br i1 [[TMP17]], label [[OMP_OFFLOAD_FAILED6:%.*]], label [[OMP_OFFLOAD_CONT7:%.*]]
// CHECK2: omp_offload.failed6:
// CHECK2-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK2-NEXT: br label [[OMP_OFFLOAD_CONT7]]
// CHECK2: omp_offload.cont7:
// CHECK2-NEXT: br label [[OMP_IF_END9:%.*]]
// CHECK2: omp_if.else8:
// CHECK2-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK2-NEXT: br label [[OMP_IF_END9]]
// CHECK2: omp_if.end9:
// CHECK2-NEXT: [[TMP18:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP18]], 1
// CHECK2-NEXT: ret i32 [[ADD]]
//
//
// CHECK2-LABEL: define {{[^@]+}}@_Z9ftemplateIiET_i
// CHECK2-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0]] comdat {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK2-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK2-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 8
// CHECK2-NEXT: [[B:%.*]] = alloca i16, align 2
// CHECK2-NEXT: [[A_CASTED1:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTOFFLOAD_BASEPTRS4:%.*]] = alloca [2 x i8*], align 8
// CHECK2-NEXT: [[DOTOFFLOAD_PTRS5:%.*]] = alloca [2 x i8*], align 8
// CHECK2-NEXT: [[DOTOFFLOAD_MAPPERS6:%.*]] = alloca [2 x i8*], align 8
// CHECK2-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK2-NEXT: store i32 0, i32* [[A]], align 4
// CHECK2-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK2-NEXT: store i32 [[TMP0]], i32* [[CONV]], align 4
// CHECK2-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK2-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i64*
// CHECK2-NEXT: store i64 [[TMP1]], i64* [[TMP3]], align 8
// CHECK2-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i64*
// CHECK2-NEXT: store i64 [[TMP1]], i64* [[TMP5]], align 8
// CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK2-NEXT: store i8* null, i8** [[TMP6]], align 8
// CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK2-NEXT: [[TMP9:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87.region_id, i32 1, i8** [[TMP7]], i8** [[TMP8]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.9, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.10, i32 0, i32 0), i8** null, i8** null, i32 1, i32 1)
// CHECK2-NEXT: [[TMP10:%.*]] = icmp ne i32 [[TMP9]], 0
// CHECK2-NEXT: br i1 [[TMP10]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK2: omp_offload.failed:
// CHECK2-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87(i64 [[TMP1]]) #[[ATTR3]]
// CHECK2-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK2: omp_offload.cont:
// CHECK2-NEXT: store i16 1, i16* [[B]], align 2
// CHECK2-NEXT: [[TMP11:%.*]] = load i32, i32* [[A]], align 4
// CHECK2-NEXT: [[CONV2:%.*]] = bitcast i64* [[A_CASTED1]] to i32*
// CHECK2-NEXT: store i32 [[TMP11]], i32* [[CONV2]], align 4
// CHECK2-NEXT: [[TMP12:%.*]] = load i64, i64* [[A_CASTED1]], align 8
// CHECK2-NEXT: [[TMP13:%.*]] = load i16, i16* [[B]], align 2
// CHECK2-NEXT: [[CONV3:%.*]] = bitcast i64* [[B_CASTED]] to i16*
// CHECK2-NEXT: store i16 [[TMP13]], i16* [[CONV3]], align 2
// CHECK2-NEXT: [[TMP14:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK2-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 0
// CHECK2-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i64*
// CHECK2-NEXT: store i64 [[TMP12]], i64* [[TMP16]], align 8
// CHECK2-NEXT: [[TMP17:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS5]], i32 0, i32 0
// CHECK2-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i64*
// CHECK2-NEXT: store i64 [[TMP12]], i64* [[TMP18]], align 8
// CHECK2-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS6]], i64 0, i64 0
// CHECK2-NEXT: store i8* null, i8** [[TMP19]], align 8
// CHECK2-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 1
// CHECK2-NEXT: [[TMP21:%.*]] = bitcast i8** [[TMP20]] to i64*
// CHECK2-NEXT: store i64 [[TMP14]], i64* [[TMP21]], align 8
// CHECK2-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS5]], i32 0, i32 1
// CHECK2-NEXT: [[TMP23:%.*]] = bitcast i8** [[TMP22]] to i64*
// CHECK2-NEXT: store i64 [[TMP14]], i64* [[TMP23]], align 8
// CHECK2-NEXT: [[TMP24:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS6]], i64 0, i64 1
// CHECK2-NEXT: store i8* null, i8** [[TMP24]], align 8
// CHECK2-NEXT: [[TMP25:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 0
// CHECK2-NEXT: [[TMP26:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS5]], i32 0, i32 0
// CHECK2-NEXT: [[TMP27:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93.region_id, i32 2, i8** [[TMP25]], i8** [[TMP26]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.12, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.13, i32 0, i32 0), i8** null, i8** null, i32 1, i32 0)
// CHECK2-NEXT: [[TMP28:%.*]] = icmp ne i32 [[TMP27]], 0
// CHECK2-NEXT: br i1 [[TMP28]], label [[OMP_OFFLOAD_FAILED7:%.*]], label [[OMP_OFFLOAD_CONT8:%.*]]
// CHECK2: omp_offload.failed7:
// CHECK2-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93(i64 [[TMP12]], i64 [[TMP14]]) #[[ATTR3]]
// CHECK2-NEXT: br label [[OMP_OFFLOAD_CONT8]]
// CHECK2: omp_offload.cont8:
// CHECK2-NEXT: [[TMP29:%.*]] = load i32, i32* [[A]], align 4
// CHECK2-NEXT: ret i32 [[TMP29]]
//
//
// CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK2-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK2-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK2-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK2-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK2-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK2-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK2-NEXT: [[CONV1:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK2-NEXT: [[TMP2:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK2-NEXT: [[CONV2:%.*]] = bitcast i64* [[B_CASTED]] to i32*
// CHECK2-NEXT: store i32 [[TMP2]], i32* [[CONV2]], align 4
// CHECK2-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK2-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV1]], align 1
// CHECK2-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK2-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK2: omp_if.then:
// CHECK2-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i64)* @.omp_outlined. to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i64 [[TMP3]])
// CHECK2-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK2: omp_if.else:
// CHECK2-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK2-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK2-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK2-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i64 [[TMP3]]) #[[ATTR3]]
// CHECK2-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK2-NEXT: br label [[OMP_IF_END]]
// CHECK2: omp_if.end:
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK2-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]]) #[[ATTR2:[0-9]+]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK2-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK2-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK2-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK2-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK2-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK2-NEXT: [[CONV1:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK2-NEXT: [[ADD:%.*]] = fadd double [[CONV1]], 1.500000e+00
// CHECK2-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK2-NEXT: store double [[ADD]], double* [[A]], align 8
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK2-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK2-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK2-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK2-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK2-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK2-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK2-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK2-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK2: omp_if.then:
// CHECK2-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..1 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK2-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK2: omp_if.else:
// CHECK2-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK2-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK2-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK2-NEXT: call void @.omp_outlined..1(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR3]]
// CHECK2-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK2-NEXT: br label [[OMP_IF_END]]
// CHECK2: omp_if.end:
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK2-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR2]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK2-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK2-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK2-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK2-NEXT: store double 2.500000e+00, double* [[A]], align 8
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK2-SAME: (i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK2-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK2-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK2-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK2-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK2: omp_if.then:
// CHECK2-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..4 to void (i32*, i32*, ...)*))
// CHECK2-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK2: omp_if.else:
// CHECK2-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK2-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK2-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK2-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR3]]
// CHECK2-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK2-NEXT: br label [[OMP_IF_END]]
// CHECK2: omp_if.end:
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK2-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK2-SAME: () #[[ATTR1]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..7 to void (i32*, i32*, ...)*))
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..7
// CHECK2-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK2-SAME: (i64 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK2-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK2-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK2-NEXT: [[CONV1:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK2-NEXT: store i32 [[TMP1]], i32* [[CONV1]], align 4
// CHECK2-NEXT: [[TMP2:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK2-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK2-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK2-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK2-NEXT: call void @.omp_outlined..8(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i64 [[TMP2]]) #[[ATTR3]]
// CHECK2-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..8
// CHECK2-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]]) #[[ATTR2]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK2-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK2-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK2-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK2-SAME: (i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK2-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK2-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK2-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK2-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK2-NEXT: [[CONV2:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK2-NEXT: store i32 [[TMP0]], i32* [[CONV2]], align 4
// CHECK2-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK2-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK2-NEXT: [[CONV3:%.*]] = bitcast i64* [[B_CASTED]] to i16*
// CHECK2-NEXT: store i16 [[TMP2]], i16* [[CONV3]], align 2
// CHECK2-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK2-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64)* @.omp_outlined..11 to void (i32*, i32*, ...)*), i64 [[TMP1]], i64 [[TMP3]])
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..11
// CHECK2-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR2]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK2-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK2-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK2-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK2-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK2-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK2-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK2-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK2-NEXT: [[CONV2:%.*]] = sext i16 [[TMP0]] to i32
// CHECK2-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV2]]
// CHECK2-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK2-NEXT: ret void
//
//
// CHECK2-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
// CHECK2-SAME: () #[[ATTR4:[0-9]+]] {
// CHECK2-NEXT: entry:
// CHECK2-NEXT: call void @__tgt_register_requires(i64 1)
// CHECK2-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@_Z3bari
// CHECK3-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[S:%.*]] = alloca [[STRUCT_S1:%.*]], align 4
// CHECK3-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK3-NEXT: store i32 0, i32* [[A]], align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK3-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN2S12r1Ei(%struct.S1* noundef [[S]], i32 noundef [[TMP0]])
// CHECK3-NEXT: [[TMP1:%.*]] = load i32, i32* [[A]], align 4
// CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CALL]]
// CHECK3-NEXT: store i32 [[ADD]], i32* [[A]], align 4
// CHECK3-NEXT: [[TMP2:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK3-NEXT: [[CALL1:%.*]] = call noundef i32 @_ZL7fstatici(i32 noundef [[TMP2]])
// CHECK3-NEXT: [[TMP3:%.*]] = load i32, i32* [[A]], align 4
// CHECK3-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP3]], [[CALL1]]
// CHECK3-NEXT: store i32 [[ADD2]], i32* [[A]], align 4
// CHECK3-NEXT: [[TMP4:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK3-NEXT: [[CALL3:%.*]] = call noundef i32 @_Z9ftemplateIiET_i(i32 noundef [[TMP4]])
// CHECK3-NEXT: [[TMP5:%.*]] = load i32, i32* [[A]], align 4
// CHECK3-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP5]], [[CALL3]]
// CHECK3-NEXT: store i32 [[ADD4]], i32* [[A]], align 4
// CHECK3-NEXT: [[TMP6:%.*]] = load i32, i32* [[A]], align 4
// CHECK3-NEXT: ret i32 [[TMP6]]
//
//
// CHECK3-LABEL: define {{[^@]+}}@_ZN2S12r1Ei
// CHECK3-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[N:%.*]]) #[[ATTR0]] comdat align 2 {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK3-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[B:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK3-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x i8*], align 4
// CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x i8*], align 4
// CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x i8*], align 4
// CHECK3-NEXT: [[DOTCAPTURE_EXPR_4:%.*]] = alloca i8, align 1
// CHECK3-NEXT: [[DOTCAPTURE_EXPR__CASTED8:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS13:%.*]] = alloca [2 x i8*], align 4
// CHECK3-NEXT: [[DOTOFFLOAD_PTRS14:%.*]] = alloca [2 x i8*], align 4
// CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS15:%.*]] = alloca [2 x i8*], align 4
// CHECK3-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK3-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK3-NEXT: [[THIS1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK3-NEXT: store i32 1, i32* [[B]], align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 3
// CHECK3-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK3-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK3-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4
// CHECK3-NEXT: store i32 [[TMP1]], i32* [[B_CASTED]], align 4
// CHECK3-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK3-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK3-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK3-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK3-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK3-NEXT: store i8 [[FROMBOOL2]], i8* [[CONV]], align 1
// CHECK3-NEXT: [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR__CASTED]], align 4
// CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP6:%.*]] = bitcast i8** [[TMP5]] to %struct.S1**
// CHECK3-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP6]], align 4
// CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to double**
// CHECK3-NEXT: store double* [[A]], double** [[TMP8]], align 4
// CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK3-NEXT: store i8* null, i8** [[TMP9]], align 4
// CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK3-NEXT: [[TMP11:%.*]] = bitcast i8** [[TMP10]] to i32*
// CHECK3-NEXT: store i32 [[TMP2]], i32* [[TMP11]], align 4
// CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK3-NEXT: [[TMP13:%.*]] = bitcast i8** [[TMP12]] to i32*
// CHECK3-NEXT: store i32 [[TMP2]], i32* [[TMP13]], align 4
// CHECK3-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
// CHECK3-NEXT: store i8* null, i8** [[TMP14]], align 4
// CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
// CHECK3-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i32*
// CHECK3-NEXT: store i32 [[TMP4]], i32* [[TMP16]], align 4
// CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 2
// CHECK3-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i32*
// CHECK3-NEXT: store i32 [[TMP4]], i32* [[TMP18]], align 4
// CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
// CHECK3-NEXT: store i8* null, i8** [[TMP19]], align 4
// CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP22:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK3-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP22]] to i1
// CHECK3-NEXT: [[TMP23:%.*]] = select i1 [[TOBOOL3]], i32 0, i32 1
// CHECK3-NEXT: [[TMP24:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1:[0-9]+]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121.region_id, i32 3, i8** [[TMP20]], i8** [[TMP21]], i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_sizes, i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_maptypes, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP23]])
// CHECK3-NEXT: [[TMP25:%.*]] = icmp ne i32 [[TMP24]], 0
// CHECK3-NEXT: br i1 [[TMP25]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK3: omp_offload.failed:
// CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121(%struct.S1* [[THIS1]], i32 [[TMP2]], i32 [[TMP4]]) #[[ATTR3:[0-9]+]]
// CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK3: omp_offload.cont:
// CHECK3-NEXT: [[TMP26:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK3-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP26]], 5
// CHECK3-NEXT: [[FROMBOOL6:%.*]] = zext i1 [[CMP5]] to i8
// CHECK3-NEXT: store i8 [[FROMBOOL6]], i8* [[DOTCAPTURE_EXPR_4]], align 1
// CHECK3-NEXT: [[TMP27:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_4]], align 1
// CHECK3-NEXT: [[TOBOOL7:%.*]] = trunc i8 [[TMP27]] to i1
// CHECK3-NEXT: [[CONV9:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__CASTED8]] to i8*
// CHECK3-NEXT: [[FROMBOOL10:%.*]] = zext i1 [[TOBOOL7]] to i8
// CHECK3-NEXT: store i8 [[FROMBOOL10]], i8* [[CONV9]], align 1
// CHECK3-NEXT: [[TMP28:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR__CASTED8]], align 4
// CHECK3-NEXT: [[TMP29:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK3-NEXT: [[CMP11:%.*]] = icmp sgt i32 [[TMP29]], 4
// CHECK3-NEXT: br i1 [[CMP11]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK3: omp_if.then:
// CHECK3-NEXT: [[A12:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK3-NEXT: [[TMP30:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS13]], i32 0, i32 0
// CHECK3-NEXT: [[TMP31:%.*]] = bitcast i8** [[TMP30]] to %struct.S1**
// CHECK3-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP31]], align 4
// CHECK3-NEXT: [[TMP32:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS14]], i32 0, i32 0
// CHECK3-NEXT: [[TMP33:%.*]] = bitcast i8** [[TMP32]] to double**
// CHECK3-NEXT: store double* [[A12]], double** [[TMP33]], align 4
// CHECK3-NEXT: [[TMP34:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS15]], i32 0, i32 0
// CHECK3-NEXT: store i8* null, i8** [[TMP34]], align 4
// CHECK3-NEXT: [[TMP35:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS13]], i32 0, i32 1
// CHECK3-NEXT: [[TMP36:%.*]] = bitcast i8** [[TMP35]] to i32*
// CHECK3-NEXT: store i32 [[TMP28]], i32* [[TMP36]], align 4
// CHECK3-NEXT: [[TMP37:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS14]], i32 0, i32 1
// CHECK3-NEXT: [[TMP38:%.*]] = bitcast i8** [[TMP37]] to i32*
// CHECK3-NEXT: store i32 [[TMP28]], i32* [[TMP38]], align 4
// CHECK3-NEXT: [[TMP39:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS15]], i32 0, i32 1
// CHECK3-NEXT: store i8* null, i8** [[TMP39]], align 4
// CHECK3-NEXT: [[TMP40:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS13]], i32 0, i32 0
// CHECK3-NEXT: [[TMP41:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS14]], i32 0, i32 0
// CHECK3-NEXT: [[TMP42:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_4]], align 1
// CHECK3-NEXT: [[TOBOOL16:%.*]] = trunc i8 [[TMP42]] to i1
// CHECK3-NEXT: [[TMP43:%.*]] = select i1 [[TOBOOL16]], i32 0, i32 1
// CHECK3-NEXT: [[TMP44:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126.region_id, i32 2, i8** [[TMP40]], i8** [[TMP41]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.2, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.3, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP43]])
// CHECK3-NEXT: [[TMP45:%.*]] = icmp ne i32 [[TMP44]], 0
// CHECK3-NEXT: br i1 [[TMP45]], label [[OMP_OFFLOAD_FAILED17:%.*]], label [[OMP_OFFLOAD_CONT18:%.*]]
// CHECK3: omp_offload.failed17:
// CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i32 [[TMP28]]) #[[ATTR3]]
// CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT18]]
// CHECK3: omp_offload.cont18:
// CHECK3-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK3: omp_if.else:
// CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i32 [[TMP28]]) #[[ATTR3]]
// CHECK3-NEXT: br label [[OMP_IF_END]]
// CHECK3: omp_if.end:
// CHECK3-NEXT: [[A19:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK3-NEXT: [[TMP46:%.*]] = load double, double* [[A19]], align 4
// CHECK3-NEXT: [[CONV20:%.*]] = fptosi double [[TMP46]] to i32
// CHECK3-NEXT: ret i32 [[CONV20]]
//
//
// CHECK3-LABEL: define {{[^@]+}}@_ZL7fstatici
// CHECK3-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK3-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 4
// CHECK3-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 1
// CHECK3-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK3-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK3-NEXT: [[TMP1:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK3-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK3-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK3-NEXT: [[FROMBOOL1:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK3-NEXT: store i8 [[FROMBOOL1]], i8* [[CONV]], align 1
// CHECK3-NEXT: [[TMP2:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR__CASTED]], align 4
// CHECK3-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK3-NEXT: [[TOBOOL2:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK3-NEXT: br i1 [[TOBOOL2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK3: omp_if.then:
// CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i32*
// CHECK3-NEXT: store i32 [[TMP2]], i32* [[TMP5]], align 4
// CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP7:%.*]] = bitcast i8** [[TMP6]] to i32*
// CHECK3-NEXT: store i32 [[TMP2]], i32* [[TMP7]], align 4
// CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK3-NEXT: store i8* null, i8** [[TMP8]], align 4
// CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP11:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK3-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP11]] to i1
// CHECK3-NEXT: [[TMP12:%.*]] = select i1 [[TOBOOL3]], i32 0, i32 1
// CHECK3-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104.region_id, i32 1, i8** [[TMP9]], i8** [[TMP10]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.5, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.6, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP12]])
// CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
// CHECK3-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK3: omp_offload.failed:
// CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i32 [[TMP2]]) #[[ATTR3]]
// CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK3: omp_offload.cont:
// CHECK3-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK3: omp_if.else:
// CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i32 [[TMP2]]) #[[ATTR3]]
// CHECK3-NEXT: br label [[OMP_IF_END]]
// CHECK3: omp_if.end:
// CHECK3-NEXT: [[TMP15:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK3-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP15]], 2
// CHECK3-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[SUB]], 2
// CHECK3-NEXT: br i1 [[CMP4]], label [[OMP_IF_THEN5:%.*]], label [[OMP_IF_ELSE8:%.*]]
// CHECK3: omp_if.then5:
// CHECK3-NEXT: [[TMP16:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108.region_id, i32 0, i8** null, i8** null, i64* null, i64* null, i8** null, i8** null, i32 1, i32 0)
// CHECK3-NEXT: [[TMP17:%.*]] = icmp ne i32 [[TMP16]], 0
// CHECK3-NEXT: br i1 [[TMP17]], label [[OMP_OFFLOAD_FAILED6:%.*]], label [[OMP_OFFLOAD_CONT7:%.*]]
// CHECK3: omp_offload.failed6:
// CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT7]]
// CHECK3: omp_offload.cont7:
// CHECK3-NEXT: br label [[OMP_IF_END9:%.*]]
// CHECK3: omp_if.else8:
// CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK3-NEXT: br label [[OMP_IF_END9]]
// CHECK3: omp_if.end9:
// CHECK3-NEXT: [[TMP18:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP18]], 1
// CHECK3-NEXT: ret i32 [[ADD]]
//
//
// CHECK3-LABEL: define {{[^@]+}}@_Z9ftemplateIiET_i
// CHECK3-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0]] comdat {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 4
// CHECK3-NEXT: [[B:%.*]] = alloca i16, align 2
// CHECK3-NEXT: [[A_CASTED1:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS2:%.*]] = alloca [2 x i8*], align 4
// CHECK3-NEXT: [[DOTOFFLOAD_PTRS3:%.*]] = alloca [2 x i8*], align 4
// CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS4:%.*]] = alloca [2 x i8*], align 4
// CHECK3-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK3-NEXT: store i32 0, i32* [[A]], align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4
// CHECK3-NEXT: store i32 [[TMP0]], i32* [[A_CASTED]], align 4
// CHECK3-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32*
// CHECK3-NEXT: store i32 [[TMP1]], i32* [[TMP3]], align 4
// CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i32*
// CHECK3-NEXT: store i32 [[TMP1]], i32* [[TMP5]], align 4
// CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK3-NEXT: store i8* null, i8** [[TMP6]], align 4
// CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK3-NEXT: [[TMP9:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87.region_id, i32 1, i8** [[TMP7]], i8** [[TMP8]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.9, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.10, i32 0, i32 0), i8** null, i8** null, i32 1, i32 1)
// CHECK3-NEXT: [[TMP10:%.*]] = icmp ne i32 [[TMP9]], 0
// CHECK3-NEXT: br i1 [[TMP10]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK3: omp_offload.failed:
// CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87(i32 [[TMP1]]) #[[ATTR3]]
// CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK3: omp_offload.cont:
// CHECK3-NEXT: store i16 1, i16* [[B]], align 2
// CHECK3-NEXT: [[TMP11:%.*]] = load i32, i32* [[A]], align 4
// CHECK3-NEXT: store i32 [[TMP11]], i32* [[A_CASTED1]], align 4
// CHECK3-NEXT: [[TMP12:%.*]] = load i32, i32* [[A_CASTED1]], align 4
// CHECK3-NEXT: [[TMP13:%.*]] = load i16, i16* [[B]], align 2
// CHECK3-NEXT: [[CONV:%.*]] = bitcast i32* [[B_CASTED]] to i16*
// CHECK3-NEXT: store i16 [[TMP13]], i16* [[CONV]], align 2
// CHECK3-NEXT: [[TMP14:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS2]], i32 0, i32 0
// CHECK3-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i32*
// CHECK3-NEXT: store i32 [[TMP12]], i32* [[TMP16]], align 4
// CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS3]], i32 0, i32 0
// CHECK3-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i32*
// CHECK3-NEXT: store i32 [[TMP12]], i32* [[TMP18]], align 4
// CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS4]], i32 0, i32 0
// CHECK3-NEXT: store i8* null, i8** [[TMP19]], align 4
// CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS2]], i32 0, i32 1
// CHECK3-NEXT: [[TMP21:%.*]] = bitcast i8** [[TMP20]] to i32*
// CHECK3-NEXT: store i32 [[TMP14]], i32* [[TMP21]], align 4
// CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS3]], i32 0, i32 1
// CHECK3-NEXT: [[TMP23:%.*]] = bitcast i8** [[TMP22]] to i32*
// CHECK3-NEXT: store i32 [[TMP14]], i32* [[TMP23]], align 4
// CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS4]], i32 0, i32 1
// CHECK3-NEXT: store i8* null, i8** [[TMP24]], align 4
// CHECK3-NEXT: [[TMP25:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS2]], i32 0, i32 0
// CHECK3-NEXT: [[TMP26:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS3]], i32 0, i32 0
// CHECK3-NEXT: [[TMP27:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93.region_id, i32 2, i8** [[TMP25]], i8** [[TMP26]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.12, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.13, i32 0, i32 0), i8** null, i8** null, i32 1, i32 0)
// CHECK3-NEXT: [[TMP28:%.*]] = icmp ne i32 [[TMP27]], 0
// CHECK3-NEXT: br i1 [[TMP28]], label [[OMP_OFFLOAD_FAILED5:%.*]], label [[OMP_OFFLOAD_CONT6:%.*]]
// CHECK3: omp_offload.failed5:
// CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93(i32 [[TMP12]], i32 [[TMP14]]) #[[ATTR3]]
// CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT6]]
// CHECK3: omp_offload.cont6:
// CHECK3-NEXT: [[TMP29:%.*]] = load i32, i32* [[A]], align 4
// CHECK3-NEXT: ret i32 [[TMP29]]
//
//
// CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK3-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK3-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK3-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK3-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK3-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK3-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK3-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK3-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK3-NEXT: store i32 [[TMP2]], i32* [[B_CASTED]], align 4
// CHECK3-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK3-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK3-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK3-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK3: omp_if.then:
// CHECK3-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i32)* @.omp_outlined. to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i32 [[TMP3]])
// CHECK3-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK3: omp_if.else:
// CHECK3-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK3-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK3-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK3-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i32 [[TMP3]]) #[[ATTR3]]
// CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK3-NEXT: br label [[OMP_IF_END]]
// CHECK3: omp_if.end:
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK3-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]]) #[[ATTR2:[0-9]+]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK3-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK3-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK3-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK3-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK3-NEXT: [[TMP1:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK3-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK3-NEXT: [[ADD:%.*]] = fadd double [[CONV]], 1.500000e+00
// CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK3-NEXT: store double [[ADD]], double* [[A]], align 4
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK3-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK3-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK3-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK3-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK3-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK3-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK3-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK3-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK3-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK3: omp_if.then:
// CHECK3-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..1 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK3-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK3: omp_if.else:
// CHECK3-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK3-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK3-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK3-NEXT: call void @.omp_outlined..1(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR3]]
// CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK3-NEXT: br label [[OMP_IF_END]]
// CHECK3: omp_if.end:
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK3-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR2]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK3-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK3-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK3-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK3-NEXT: store double 2.500000e+00, double* [[A]], align 4
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK3-SAME: (i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK3-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK3-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK3-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK3-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK3-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK3: omp_if.then:
// CHECK3-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..4 to void (i32*, i32*, ...)*))
// CHECK3-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK3: omp_if.else:
// CHECK3-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK3-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK3-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK3-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR3]]
// CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK3-NEXT: br label [[OMP_IF_END]]
// CHECK3: omp_if.end:
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK3-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK3-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK3-SAME: () #[[ATTR1]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..7 to void (i32*, i32*, ...)*))
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@.omp_outlined..7
// CHECK3-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK3-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK3-SAME: (i32 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK3-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK3-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK3-NEXT: store i32 [[TMP1]], i32* [[A_CASTED]], align 4
// CHECK3-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK3-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK3-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK3-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK3-NEXT: call void @.omp_outlined..8(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i32 [[TMP2]]) #[[ATTR3]]
// CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@.omp_outlined..8
// CHECK3-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]]) #[[ATTR2]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK3-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK3-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK3-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK3-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK3-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK3-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK3-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK3-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK3-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK3-NEXT: store i32 [[TMP0]], i32* [[A_CASTED]], align 4
// CHECK3-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK3-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK3-NEXT: [[CONV1:%.*]] = bitcast i32* [[B_CASTED]] to i16*
// CHECK3-NEXT: store i16 [[TMP2]], i16* [[CONV1]], align 2
// CHECK3-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK3-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32, i32)* @.omp_outlined..11 to void (i32*, i32*, ...)*), i32 [[TMP1]], i32 [[TMP3]])
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@.omp_outlined..11
// CHECK3-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR2]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK3-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK3-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK3-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK3-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK3-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK3-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK3-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK3-NEXT: [[CONV1:%.*]] = sext i16 [[TMP0]] to i32
// CHECK3-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV1]]
// CHECK3-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK3-NEXT: ret void
//
//
// CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
// CHECK3-SAME: () #[[ATTR4:[0-9]+]] {
// CHECK3-NEXT: entry:
// CHECK3-NEXT: call void @__tgt_register_requires(i64 1)
// CHECK3-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@_Z3bari
// CHECK4-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[S:%.*]] = alloca [[STRUCT_S1:%.*]], align 4
// CHECK4-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK4-NEXT: store i32 0, i32* [[A]], align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK4-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN2S12r1Ei(%struct.S1* noundef [[S]], i32 noundef [[TMP0]])
// CHECK4-NEXT: [[TMP1:%.*]] = load i32, i32* [[A]], align 4
// CHECK4-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CALL]]
// CHECK4-NEXT: store i32 [[ADD]], i32* [[A]], align 4
// CHECK4-NEXT: [[TMP2:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK4-NEXT: [[CALL1:%.*]] = call noundef i32 @_ZL7fstatici(i32 noundef [[TMP2]])
// CHECK4-NEXT: [[TMP3:%.*]] = load i32, i32* [[A]], align 4
// CHECK4-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP3]], [[CALL1]]
// CHECK4-NEXT: store i32 [[ADD2]], i32* [[A]], align 4
// CHECK4-NEXT: [[TMP4:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK4-NEXT: [[CALL3:%.*]] = call noundef i32 @_Z9ftemplateIiET_i(i32 noundef [[TMP4]])
// CHECK4-NEXT: [[TMP5:%.*]] = load i32, i32* [[A]], align 4
// CHECK4-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP5]], [[CALL3]]
// CHECK4-NEXT: store i32 [[ADD4]], i32* [[A]], align 4
// CHECK4-NEXT: [[TMP6:%.*]] = load i32, i32* [[A]], align 4
// CHECK4-NEXT: ret i32 [[TMP6]]
//
//
// CHECK4-LABEL: define {{[^@]+}}@_ZN2S12r1Ei
// CHECK4-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[N:%.*]]) #[[ATTR0]] comdat align 2 {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK4-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[B:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK4-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x i8*], align 4
// CHECK4-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x i8*], align 4
// CHECK4-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x i8*], align 4
// CHECK4-NEXT: [[DOTCAPTURE_EXPR_4:%.*]] = alloca i8, align 1
// CHECK4-NEXT: [[DOTCAPTURE_EXPR__CASTED8:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOFFLOAD_BASEPTRS13:%.*]] = alloca [2 x i8*], align 4
// CHECK4-NEXT: [[DOTOFFLOAD_PTRS14:%.*]] = alloca [2 x i8*], align 4
// CHECK4-NEXT: [[DOTOFFLOAD_MAPPERS15:%.*]] = alloca [2 x i8*], align 4
// CHECK4-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK4-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK4-NEXT: [[THIS1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK4-NEXT: store i32 1, i32* [[B]], align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK4-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 3
// CHECK4-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK4-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK4-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4
// CHECK4-NEXT: store i32 [[TMP1]], i32* [[B_CASTED]], align 4
// CHECK4-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK4-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK4-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK4-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK4-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK4-NEXT: store i8 [[FROMBOOL2]], i8* [[CONV]], align 1
// CHECK4-NEXT: [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR__CASTED]], align 4
// CHECK4-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK4-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP6:%.*]] = bitcast i8** [[TMP5]] to %struct.S1**
// CHECK4-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP6]], align 4
// CHECK4-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to double**
// CHECK4-NEXT: store double* [[A]], double** [[TMP8]], align 4
// CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK4-NEXT: store i8* null, i8** [[TMP9]], align 4
// CHECK4-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK4-NEXT: [[TMP11:%.*]] = bitcast i8** [[TMP10]] to i32*
// CHECK4-NEXT: store i32 [[TMP2]], i32* [[TMP11]], align 4
// CHECK4-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK4-NEXT: [[TMP13:%.*]] = bitcast i8** [[TMP12]] to i32*
// CHECK4-NEXT: store i32 [[TMP2]], i32* [[TMP13]], align 4
// CHECK4-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
// CHECK4-NEXT: store i8* null, i8** [[TMP14]], align 4
// CHECK4-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
// CHECK4-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i32*
// CHECK4-NEXT: store i32 [[TMP4]], i32* [[TMP16]], align 4
// CHECK4-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 2
// CHECK4-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i32*
// CHECK4-NEXT: store i32 [[TMP4]], i32* [[TMP18]], align 4
// CHECK4-NEXT: [[TMP19:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
// CHECK4-NEXT: store i8* null, i8** [[TMP19]], align 4
// CHECK4-NEXT: [[TMP20:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP21:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP22:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK4-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP22]] to i1
// CHECK4-NEXT: [[TMP23:%.*]] = select i1 [[TOBOOL3]], i32 0, i32 1
// CHECK4-NEXT: [[TMP24:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1:[0-9]+]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121.region_id, i32 3, i8** [[TMP20]], i8** [[TMP21]], i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_sizes, i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_maptypes, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP23]])
// CHECK4-NEXT: [[TMP25:%.*]] = icmp ne i32 [[TMP24]], 0
// CHECK4-NEXT: br i1 [[TMP25]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK4: omp_offload.failed:
// CHECK4-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121(%struct.S1* [[THIS1]], i32 [[TMP2]], i32 [[TMP4]]) #[[ATTR3:[0-9]+]]
// CHECK4-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK4: omp_offload.cont:
// CHECK4-NEXT: [[TMP26:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK4-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP26]], 5
// CHECK4-NEXT: [[FROMBOOL6:%.*]] = zext i1 [[CMP5]] to i8
// CHECK4-NEXT: store i8 [[FROMBOOL6]], i8* [[DOTCAPTURE_EXPR_4]], align 1
// CHECK4-NEXT: [[TMP27:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_4]], align 1
// CHECK4-NEXT: [[TOBOOL7:%.*]] = trunc i8 [[TMP27]] to i1
// CHECK4-NEXT: [[CONV9:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__CASTED8]] to i8*
// CHECK4-NEXT: [[FROMBOOL10:%.*]] = zext i1 [[TOBOOL7]] to i8
// CHECK4-NEXT: store i8 [[FROMBOOL10]], i8* [[CONV9]], align 1
// CHECK4-NEXT: [[TMP28:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR__CASTED8]], align 4
// CHECK4-NEXT: [[TMP29:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK4-NEXT: [[CMP11:%.*]] = icmp sgt i32 [[TMP29]], 4
// CHECK4-NEXT: br i1 [[CMP11]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK4: omp_if.then:
// CHECK4-NEXT: [[A12:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK4-NEXT: [[TMP30:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS13]], i32 0, i32 0
// CHECK4-NEXT: [[TMP31:%.*]] = bitcast i8** [[TMP30]] to %struct.S1**
// CHECK4-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP31]], align 4
// CHECK4-NEXT: [[TMP32:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS14]], i32 0, i32 0
// CHECK4-NEXT: [[TMP33:%.*]] = bitcast i8** [[TMP32]] to double**
// CHECK4-NEXT: store double* [[A12]], double** [[TMP33]], align 4
// CHECK4-NEXT: [[TMP34:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS15]], i32 0, i32 0
// CHECK4-NEXT: store i8* null, i8** [[TMP34]], align 4
// CHECK4-NEXT: [[TMP35:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS13]], i32 0, i32 1
// CHECK4-NEXT: [[TMP36:%.*]] = bitcast i8** [[TMP35]] to i32*
// CHECK4-NEXT: store i32 [[TMP28]], i32* [[TMP36]], align 4
// CHECK4-NEXT: [[TMP37:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS14]], i32 0, i32 1
// CHECK4-NEXT: [[TMP38:%.*]] = bitcast i8** [[TMP37]] to i32*
// CHECK4-NEXT: store i32 [[TMP28]], i32* [[TMP38]], align 4
// CHECK4-NEXT: [[TMP39:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS15]], i32 0, i32 1
// CHECK4-NEXT: store i8* null, i8** [[TMP39]], align 4
// CHECK4-NEXT: [[TMP40:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS13]], i32 0, i32 0
// CHECK4-NEXT: [[TMP41:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS14]], i32 0, i32 0
// CHECK4-NEXT: [[TMP42:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_4]], align 1
// CHECK4-NEXT: [[TOBOOL16:%.*]] = trunc i8 [[TMP42]] to i1
// CHECK4-NEXT: [[TMP43:%.*]] = select i1 [[TOBOOL16]], i32 0, i32 1
// CHECK4-NEXT: [[TMP44:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126.region_id, i32 2, i8** [[TMP40]], i8** [[TMP41]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.2, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.3, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP43]])
// CHECK4-NEXT: [[TMP45:%.*]] = icmp ne i32 [[TMP44]], 0
// CHECK4-NEXT: br i1 [[TMP45]], label [[OMP_OFFLOAD_FAILED17:%.*]], label [[OMP_OFFLOAD_CONT18:%.*]]
// CHECK4: omp_offload.failed17:
// CHECK4-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i32 [[TMP28]]) #[[ATTR3]]
// CHECK4-NEXT: br label [[OMP_OFFLOAD_CONT18]]
// CHECK4: omp_offload.cont18:
// CHECK4-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK4: omp_if.else:
// CHECK4-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i32 [[TMP28]]) #[[ATTR3]]
// CHECK4-NEXT: br label [[OMP_IF_END]]
// CHECK4: omp_if.end:
// CHECK4-NEXT: [[A19:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK4-NEXT: [[TMP46:%.*]] = load double, double* [[A19]], align 4
// CHECK4-NEXT: [[CONV20:%.*]] = fptosi double [[TMP46]] to i32
// CHECK4-NEXT: ret i32 [[CONV20]]
//
//
// CHECK4-LABEL: define {{[^@]+}}@_ZL7fstatici
// CHECK4-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK4-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK4-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK4-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 4
// CHECK4-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK4-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 1
// CHECK4-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK4-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK4-NEXT: [[TMP1:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK4-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK4-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK4-NEXT: [[FROMBOOL1:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK4-NEXT: store i8 [[FROMBOOL1]], i8* [[CONV]], align 1
// CHECK4-NEXT: [[TMP2:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR__CASTED]], align 4
// CHECK4-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK4-NEXT: [[TOBOOL2:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK4-NEXT: br i1 [[TOBOOL2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK4: omp_if.then:
// CHECK4-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i32*
// CHECK4-NEXT: store i32 [[TMP2]], i32* [[TMP5]], align 4
// CHECK4-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP7:%.*]] = bitcast i8** [[TMP6]] to i32*
// CHECK4-NEXT: store i32 [[TMP2]], i32* [[TMP7]], align 4
// CHECK4-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK4-NEXT: store i8* null, i8** [[TMP8]], align 4
// CHECK4-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP11:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK4-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP11]] to i1
// CHECK4-NEXT: [[TMP12:%.*]] = select i1 [[TOBOOL3]], i32 0, i32 1
// CHECK4-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104.region_id, i32 1, i8** [[TMP9]], i8** [[TMP10]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.5, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.6, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP12]])
// CHECK4-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
// CHECK4-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK4: omp_offload.failed:
// CHECK4-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i32 [[TMP2]]) #[[ATTR3]]
// CHECK4-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK4: omp_offload.cont:
// CHECK4-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK4: omp_if.else:
// CHECK4-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i32 [[TMP2]]) #[[ATTR3]]
// CHECK4-NEXT: br label [[OMP_IF_END]]
// CHECK4: omp_if.end:
// CHECK4-NEXT: [[TMP15:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK4-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP15]], 2
// CHECK4-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[SUB]], 2
// CHECK4-NEXT: br i1 [[CMP4]], label [[OMP_IF_THEN5:%.*]], label [[OMP_IF_ELSE8:%.*]]
// CHECK4: omp_if.then5:
// CHECK4-NEXT: [[TMP16:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108.region_id, i32 0, i8** null, i8** null, i64* null, i64* null, i8** null, i8** null, i32 1, i32 0)
// CHECK4-NEXT: [[TMP17:%.*]] = icmp ne i32 [[TMP16]], 0
// CHECK4-NEXT: br i1 [[TMP17]], label [[OMP_OFFLOAD_FAILED6:%.*]], label [[OMP_OFFLOAD_CONT7:%.*]]
// CHECK4: omp_offload.failed6:
// CHECK4-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK4-NEXT: br label [[OMP_OFFLOAD_CONT7]]
// CHECK4: omp_offload.cont7:
// CHECK4-NEXT: br label [[OMP_IF_END9:%.*]]
// CHECK4: omp_if.else8:
// CHECK4-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK4-NEXT: br label [[OMP_IF_END9]]
// CHECK4: omp_if.end9:
// CHECK4-NEXT: [[TMP18:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK4-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP18]], 1
// CHECK4-NEXT: ret i32 [[ADD]]
//
//
// CHECK4-LABEL: define {{[^@]+}}@_Z9ftemplateIiET_i
// CHECK4-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0]] comdat {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK4-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK4-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 4
// CHECK4-NEXT: [[B:%.*]] = alloca i16, align 2
// CHECK4-NEXT: [[A_CASTED1:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTOFFLOAD_BASEPTRS2:%.*]] = alloca [2 x i8*], align 4
// CHECK4-NEXT: [[DOTOFFLOAD_PTRS3:%.*]] = alloca [2 x i8*], align 4
// CHECK4-NEXT: [[DOTOFFLOAD_MAPPERS4:%.*]] = alloca [2 x i8*], align 4
// CHECK4-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK4-NEXT: store i32 0, i32* [[A]], align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4
// CHECK4-NEXT: store i32 [[TMP0]], i32* [[A_CASTED]], align 4
// CHECK4-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK4-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32*
// CHECK4-NEXT: store i32 [[TMP1]], i32* [[TMP3]], align 4
// CHECK4-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i32*
// CHECK4-NEXT: store i32 [[TMP1]], i32* [[TMP5]], align 4
// CHECK4-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK4-NEXT: store i8* null, i8** [[TMP6]], align 4
// CHECK4-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK4-NEXT: [[TMP9:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87.region_id, i32 1, i8** [[TMP7]], i8** [[TMP8]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.9, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.10, i32 0, i32 0), i8** null, i8** null, i32 1, i32 1)
// CHECK4-NEXT: [[TMP10:%.*]] = icmp ne i32 [[TMP9]], 0
// CHECK4-NEXT: br i1 [[TMP10]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK4: omp_offload.failed:
// CHECK4-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87(i32 [[TMP1]]) #[[ATTR3]]
// CHECK4-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK4: omp_offload.cont:
// CHECK4-NEXT: store i16 1, i16* [[B]], align 2
// CHECK4-NEXT: [[TMP11:%.*]] = load i32, i32* [[A]], align 4
// CHECK4-NEXT: store i32 [[TMP11]], i32* [[A_CASTED1]], align 4
// CHECK4-NEXT: [[TMP12:%.*]] = load i32, i32* [[A_CASTED1]], align 4
// CHECK4-NEXT: [[TMP13:%.*]] = load i16, i16* [[B]], align 2
// CHECK4-NEXT: [[CONV:%.*]] = bitcast i32* [[B_CASTED]] to i16*
// CHECK4-NEXT: store i16 [[TMP13]], i16* [[CONV]], align 2
// CHECK4-NEXT: [[TMP14:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK4-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS2]], i32 0, i32 0
// CHECK4-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i32*
// CHECK4-NEXT: store i32 [[TMP12]], i32* [[TMP16]], align 4
// CHECK4-NEXT: [[TMP17:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS3]], i32 0, i32 0
// CHECK4-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i32*
// CHECK4-NEXT: store i32 [[TMP12]], i32* [[TMP18]], align 4
// CHECK4-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS4]], i32 0, i32 0
// CHECK4-NEXT: store i8* null, i8** [[TMP19]], align 4
// CHECK4-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS2]], i32 0, i32 1
// CHECK4-NEXT: [[TMP21:%.*]] = bitcast i8** [[TMP20]] to i32*
// CHECK4-NEXT: store i32 [[TMP14]], i32* [[TMP21]], align 4
// CHECK4-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS3]], i32 0, i32 1
// CHECK4-NEXT: [[TMP23:%.*]] = bitcast i8** [[TMP22]] to i32*
// CHECK4-NEXT: store i32 [[TMP14]], i32* [[TMP23]], align 4
// CHECK4-NEXT: [[TMP24:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS4]], i32 0, i32 1
// CHECK4-NEXT: store i8* null, i8** [[TMP24]], align 4
// CHECK4-NEXT: [[TMP25:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS2]], i32 0, i32 0
// CHECK4-NEXT: [[TMP26:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS3]], i32 0, i32 0
// CHECK4-NEXT: [[TMP27:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93.region_id, i32 2, i8** [[TMP25]], i8** [[TMP26]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.12, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.13, i32 0, i32 0), i8** null, i8** null, i32 1, i32 0)
// CHECK4-NEXT: [[TMP28:%.*]] = icmp ne i32 [[TMP27]], 0
// CHECK4-NEXT: br i1 [[TMP28]], label [[OMP_OFFLOAD_FAILED5:%.*]], label [[OMP_OFFLOAD_CONT6:%.*]]
// CHECK4: omp_offload.failed5:
// CHECK4-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93(i32 [[TMP12]], i32 [[TMP14]]) #[[ATTR3]]
// CHECK4-NEXT: br label [[OMP_OFFLOAD_CONT6]]
// CHECK4: omp_offload.cont6:
// CHECK4-NEXT: [[TMP29:%.*]] = load i32, i32* [[A]], align 4
// CHECK4-NEXT: ret i32 [[TMP29]]
//
//
// CHECK4-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK4-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK4-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK4-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK4-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK4-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK4-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK4-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK4-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK4-NEXT: store i32 [[TMP2]], i32* [[B_CASTED]], align 4
// CHECK4-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK4-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK4-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK4-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK4: omp_if.then:
// CHECK4-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i32)* @.omp_outlined. to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i32 [[TMP3]])
// CHECK4-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK4: omp_if.else:
// CHECK4-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK4-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK4-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK4-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i32 [[TMP3]]) #[[ATTR3]]
// CHECK4-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK4-NEXT: br label [[OMP_IF_END]]
// CHECK4: omp_if.end:
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK4-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]]) #[[ATTR2:[0-9]+]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK4-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK4-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK4-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK4-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK4-NEXT: [[TMP1:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK4-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK4-NEXT: [[ADD:%.*]] = fadd double [[CONV]], 1.500000e+00
// CHECK4-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK4-NEXT: store double [[ADD]], double* [[A]], align 4
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK4-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK4-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK4-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK4-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK4-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK4-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK4-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK4-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK4-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK4: omp_if.then:
// CHECK4-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..1 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK4-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK4: omp_if.else:
// CHECK4-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK4-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK4-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK4-NEXT: call void @.omp_outlined..1(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR3]]
// CHECK4-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK4-NEXT: br label [[OMP_IF_END]]
// CHECK4: omp_if.end:
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK4-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR2]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK4-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK4-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK4-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK4-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK4-NEXT: store double 2.500000e+00, double* [[A]], align 4
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK4-SAME: (i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK4-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK4-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK4-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK4-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK4-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK4: omp_if.then:
// CHECK4-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..4 to void (i32*, i32*, ...)*))
// CHECK4-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK4: omp_if.else:
// CHECK4-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK4-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK4-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK4-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR3]]
// CHECK4-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK4-NEXT: br label [[OMP_IF_END]]
// CHECK4: omp_if.end:
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK4-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK4-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK4-SAME: () #[[ATTR1]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..7 to void (i32*, i32*, ...)*))
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@.omp_outlined..7
// CHECK4-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK4-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK4-SAME: (i32 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK4-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK4-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK4-NEXT: store i32 [[TMP1]], i32* [[A_CASTED]], align 4
// CHECK4-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK4-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK4-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK4-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK4-NEXT: call void @.omp_outlined..8(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i32 [[TMP2]]) #[[ATTR3]]
// CHECK4-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@.omp_outlined..8
// CHECK4-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]]) #[[ATTR2]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK4-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK4-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK4-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK4-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK4-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK4-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK4-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK4-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK4-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK4-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK4-NEXT: store i32 [[TMP0]], i32* [[A_CASTED]], align 4
// CHECK4-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK4-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK4-NEXT: [[CONV1:%.*]] = bitcast i32* [[B_CASTED]] to i16*
// CHECK4-NEXT: store i16 [[TMP2]], i16* [[CONV1]], align 2
// CHECK4-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK4-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32, i32)* @.omp_outlined..11 to void (i32*, i32*, ...)*), i32 [[TMP1]], i32 [[TMP3]])
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@.omp_outlined..11
// CHECK4-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR2]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK4-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK4-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK4-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK4-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK4-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK4-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK4-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK4-NEXT: [[CONV1:%.*]] = sext i16 [[TMP0]] to i32
// CHECK4-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK4-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV1]]
// CHECK4-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK4-NEXT: ret void
//
//
// CHECK4-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
// CHECK4-SAME: () #[[ATTR4:[0-9]+]] {
// CHECK4-NEXT: entry:
// CHECK4-NEXT: call void @__tgt_register_requires(i64 1)
// CHECK4-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK9-SAME: (i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK9-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1:[0-9]+]])
// CHECK9-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK9-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK9-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK9-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK9-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK9: omp_if.then:
// CHECK9-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*))
// CHECK9-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK9: omp_if.else:
// CHECK9-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK9-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK9-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK9-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR2:[0-9]+]]
// CHECK9-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK9-NEXT: br label [[OMP_IF_END]]
// CHECK9: omp_if.end:
// CHECK9-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK9-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK9-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK9-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK9-SAME: () #[[ATTR0]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*))
// CHECK9-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK9-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK9-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK9-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK9-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK9-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK9-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK9-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK9-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK9-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK9-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK9-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK9-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK9-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK9-NEXT: [[CONV1:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK9-NEXT: [[TMP2:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK9-NEXT: [[CONV2:%.*]] = bitcast i64* [[B_CASTED]] to i32*
// CHECK9-NEXT: store i32 [[TMP2]], i32* [[CONV2]], align 4
// CHECK9-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK9-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV1]], align 1
// CHECK9-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK9-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK9: omp_if.then:
// CHECK9-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i64)* @.omp_outlined..2 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i64 [[TMP3]])
// CHECK9-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK9: omp_if.else:
// CHECK9-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK9-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK9-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK9-NEXT: call void @.omp_outlined..2(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i64 [[TMP3]]) #[[ATTR2]]
// CHECK9-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK9-NEXT: br label [[OMP_IF_END]]
// CHECK9: omp_if.end:
// CHECK9-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@.omp_outlined..2
// CHECK9-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK9-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK9-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK9-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK9-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK9-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK9-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK9-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK9-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK9-NEXT: [[CONV1:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK9-NEXT: [[ADD:%.*]] = fadd double [[CONV1]], 1.500000e+00
// CHECK9-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK9-NEXT: store double [[ADD]], double* [[A]], align 8
// CHECK9-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK9-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK9-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK9-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK9-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK9-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK9-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK9-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK9-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK9-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK9-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK9: omp_if.then:
// CHECK9-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..3 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK9-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK9: omp_if.else:
// CHECK9-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK9-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK9-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK9-NEXT: call void @.omp_outlined..3(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR2]]
// CHECK9-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK9-NEXT: br label [[OMP_IF_END]]
// CHECK9: omp_if.end:
// CHECK9-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@.omp_outlined..3
// CHECK9-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR1]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK9-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK9-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK9-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK9-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK9-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK9-NEXT: store double 2.500000e+00, double* [[A]], align 8
// CHECK9-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK9-SAME: (i64 noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK9-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK9-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK9-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK9-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK9-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK9-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK9-NEXT: [[CONV1:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK9-NEXT: store i32 [[TMP1]], i32* [[CONV1]], align 4
// CHECK9-NEXT: [[TMP2:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK9-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK9-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK9-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK9-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i64 [[TMP2]]) #[[ATTR2]]
// CHECK9-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK9-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK9-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK9-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK9-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK9-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK9-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK9-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK9-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK9-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK9-SAME: (i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR0]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK9-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK9-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK9-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK9-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK9-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK9-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK9-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK9-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK9-NEXT: [[CONV2:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK9-NEXT: store i32 [[TMP0]], i32* [[CONV2]], align 4
// CHECK9-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK9-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK9-NEXT: [[CONV3:%.*]] = bitcast i64* [[B_CASTED]] to i16*
// CHECK9-NEXT: store i16 [[TMP2]], i16* [[CONV3]], align 2
// CHECK9-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK9-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64)* @.omp_outlined..5 to void (i32*, i32*, ...)*), i64 [[TMP1]], i64 [[TMP3]])
// CHECK9-NEXT: ret void
//
//
// CHECK9-LABEL: define {{[^@]+}}@.omp_outlined..5
// CHECK9-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK9-NEXT: entry:
// CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK9-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK9-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK9-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK9-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK9-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK9-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK9-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK9-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK9-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK9-NEXT: [[CONV2:%.*]] = sext i16 [[TMP0]] to i32
// CHECK9-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV2]]
// CHECK9-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK9-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK10-SAME: (i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK10-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1:[0-9]+]])
// CHECK10-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK10-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK10-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK10-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK10-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK10: omp_if.then:
// CHECK10-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*))
// CHECK10-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK10: omp_if.else:
// CHECK10-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK10-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK10-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK10-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR2:[0-9]+]]
// CHECK10-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK10-NEXT: br label [[OMP_IF_END]]
// CHECK10: omp_if.end:
// CHECK10-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK10-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK10-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK10-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK10-SAME: () #[[ATTR0]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*))
// CHECK10-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK10-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK10-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK10-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK10-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK10-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK10-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK10-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK10-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK10-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK10-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK10-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK10-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK10-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK10-NEXT: [[CONV1:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK10-NEXT: [[TMP2:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK10-NEXT: [[CONV2:%.*]] = bitcast i64* [[B_CASTED]] to i32*
// CHECK10-NEXT: store i32 [[TMP2]], i32* [[CONV2]], align 4
// CHECK10-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK10-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV1]], align 1
// CHECK10-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK10-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK10: omp_if.then:
// CHECK10-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i64)* @.omp_outlined..2 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i64 [[TMP3]])
// CHECK10-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK10: omp_if.else:
// CHECK10-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK10-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK10-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK10-NEXT: call void @.omp_outlined..2(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i64 [[TMP3]]) #[[ATTR2]]
// CHECK10-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK10-NEXT: br label [[OMP_IF_END]]
// CHECK10: omp_if.end:
// CHECK10-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@.omp_outlined..2
// CHECK10-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK10-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK10-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK10-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK10-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK10-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK10-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK10-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK10-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK10-NEXT: [[CONV1:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK10-NEXT: [[ADD:%.*]] = fadd double [[CONV1]], 1.500000e+00
// CHECK10-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK10-NEXT: store double [[ADD]], double* [[A]], align 8
// CHECK10-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK10-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK10-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK10-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK10-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK10-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK10-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK10-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK10-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK10-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK10-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK10: omp_if.then:
// CHECK10-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..3 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK10-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK10: omp_if.else:
// CHECK10-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK10-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK10-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK10-NEXT: call void @.omp_outlined..3(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR2]]
// CHECK10-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK10-NEXT: br label [[OMP_IF_END]]
// CHECK10: omp_if.end:
// CHECK10-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@.omp_outlined..3
// CHECK10-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR1]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK10-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK10-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK10-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK10-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK10-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK10-NEXT: store double 2.500000e+00, double* [[A]], align 8
// CHECK10-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK10-SAME: (i64 noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK10-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK10-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK10-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK10-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK10-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK10-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK10-NEXT: [[CONV1:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK10-NEXT: store i32 [[TMP1]], i32* [[CONV1]], align 4
// CHECK10-NEXT: [[TMP2:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK10-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK10-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK10-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK10-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i64 [[TMP2]]) #[[ATTR2]]
// CHECK10-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK10-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK10-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK10-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK10-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK10-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK10-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK10-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK10-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK10-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK10-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK10-SAME: (i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR0]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK10-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK10-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK10-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK10-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK10-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK10-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK10-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK10-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK10-NEXT: [[CONV2:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK10-NEXT: store i32 [[TMP0]], i32* [[CONV2]], align 4
// CHECK10-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK10-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK10-NEXT: [[CONV3:%.*]] = bitcast i64* [[B_CASTED]] to i16*
// CHECK10-NEXT: store i16 [[TMP2]], i16* [[CONV3]], align 2
// CHECK10-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK10-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64)* @.omp_outlined..5 to void (i32*, i32*, ...)*), i64 [[TMP1]], i64 [[TMP3]])
// CHECK10-NEXT: ret void
//
//
// CHECK10-LABEL: define {{[^@]+}}@.omp_outlined..5
// CHECK10-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK10-NEXT: entry:
// CHECK10-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK10-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK10-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK10-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK10-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK10-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK10-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK10-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK10-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK10-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK10-NEXT: [[CONV2:%.*]] = sext i16 [[TMP0]] to i32
// CHECK10-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK10-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV2]]
// CHECK10-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK10-NEXT: ret void
//
//
// CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK11-SAME: (i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK11-NEXT: entry:
// CHECK11-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1:[0-9]+]])
// CHECK11-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK11-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK11-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK11-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK11-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK11: omp_if.then:
// CHECK11-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*))
// CHECK11-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK11: omp_if.else:
// CHECK11-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK11-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK11-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK11-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR2:[0-9]+]]
// CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK11-NEXT: br label [[OMP_IF_END]]
// CHECK11: omp_if.end:
// CHECK11-NEXT: ret void
//
//
// CHECK11-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK11-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK11-NEXT: entry:
// CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK11-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK11-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK11-NEXT: ret void
//
//
// CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK11-SAME: () #[[ATTR0]] {
// CHECK11-NEXT: entry:
// CHECK11-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*))
// CHECK11-NEXT: ret void
//
//
// CHECK11-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK11-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
// CHECK11-NEXT: entry:
// CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK11-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK11-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK11-NEXT: ret void
//
//
// CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK11-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK11-NEXT: entry:
// CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK11-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK11-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK11-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK11-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK11-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK11-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK11-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK11-NEXT: store i32 [[TMP2]], i32* [[B_CASTED]], align 4
// CHECK11-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK11-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK11-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK11-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK11: omp_if.then:
// CHECK11-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i32)* @.omp_outlined..2 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i32 [[TMP3]])
// CHECK11-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK11: omp_if.else:
// CHECK11-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK11-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK11-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK11-NEXT: call void @.omp_outlined..2(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i32 [[TMP3]]) #[[ATTR2]]
// CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK11-NEXT: br label [[OMP_IF_END]]
// CHECK11: omp_if.end:
// CHECK11-NEXT: ret void
//
//
// CHECK11-LABEL: define {{[^@]+}}@.omp_outlined..2
// CHECK11-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK11-NEXT: entry:
// CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK11-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK11-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK11-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK11-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK11-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK11-NEXT: [[TMP1:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK11-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK11-NEXT: [[ADD:%.*]] = fadd double [[CONV]], 1.500000e+00
// CHECK11-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK11-NEXT: store double [[ADD]], double* [[A]], align 4
// CHECK11-NEXT: ret void
//
//
// CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK11-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK11-NEXT: entry:
// CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK11-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK11-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK11-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK11-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK11-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK11-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK11-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK11-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK11: omp_if.then:
// CHECK11-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..3 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK11-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK11: omp_if.else:
// CHECK11-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK11-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK11-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK11-NEXT: call void @.omp_outlined..3(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR2]]
// CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK11-NEXT: br label [[OMP_IF_END]]
// CHECK11: omp_if.end:
// CHECK11-NEXT: ret void
//
//
// CHECK11-LABEL: define {{[^@]+}}@.omp_outlined..3
// CHECK11-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR1]] {
// CHECK11-NEXT: entry:
// CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK11-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK11-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK11-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK11-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK11-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK11-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK11-NEXT: store double 2.500000e+00, double* [[A]], align 4
// CHECK11-NEXT: ret void
//
//
// CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK11-SAME: (i32 noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK11-NEXT: entry:
// CHECK11-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK11-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK11-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK11-NEXT: store i32 [[TMP1]], i32* [[A_CASTED]], align 4
// CHECK11-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK11-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK11-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK11-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK11-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i32 [[TMP2]]) #[[ATTR2]]
// CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK11-NEXT: ret void
//
//
// CHECK11-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK11-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK11-NEXT: entry:
// CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK11-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK11-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK11-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK11-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK11-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK11-NEXT: ret void
//
//
// CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK11-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR0]] {
// CHECK11-NEXT: entry:
// CHECK11-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK11-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK11-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK11-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK11-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK11-NEXT: store i32 [[TMP0]], i32* [[A_CASTED]], align 4
// CHECK11-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK11-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK11-NEXT: [[CONV1:%.*]] = bitcast i32* [[B_CASTED]] to i16*
// CHECK11-NEXT: store i16 [[TMP2]], i16* [[CONV1]], align 2
// CHECK11-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK11-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32, i32)* @.omp_outlined..5 to void (i32*, i32*, ...)*), i32 [[TMP1]], i32 [[TMP3]])
// CHECK11-NEXT: ret void
//
//
// CHECK11-LABEL: define {{[^@]+}}@.omp_outlined..5
// CHECK11-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK11-NEXT: entry:
// CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK11-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK11-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK11-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK11-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK11-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK11-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK11-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK11-NEXT: [[CONV1:%.*]] = sext i16 [[TMP0]] to i32
// CHECK11-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV1]]
// CHECK11-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK11-NEXT: ret void
//
//
// CHECK12-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK12-SAME: (i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK12-NEXT: entry:
// CHECK12-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1:[0-9]+]])
// CHECK12-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK12-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK12-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK12-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK12-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK12: omp_if.then:
// CHECK12-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*))
// CHECK12-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK12: omp_if.else:
// CHECK12-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK12-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK12-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK12-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR2:[0-9]+]]
// CHECK12-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK12-NEXT: br label [[OMP_IF_END]]
// CHECK12: omp_if.end:
// CHECK12-NEXT: ret void
//
//
// CHECK12-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK12-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK12-NEXT: entry:
// CHECK12-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK12-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK12-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK12-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK12-NEXT: ret void
//
//
// CHECK12-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK12-SAME: () #[[ATTR0]] {
// CHECK12-NEXT: entry:
// CHECK12-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*))
// CHECK12-NEXT: ret void
//
//
// CHECK12-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK12-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
// CHECK12-NEXT: entry:
// CHECK12-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK12-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK12-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK12-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK12-NEXT: ret void
//
//
// CHECK12-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK12-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK12-NEXT: entry:
// CHECK12-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK12-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK12-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK12-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK12-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK12-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK12-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK12-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK12-NEXT: store i32 [[TMP2]], i32* [[B_CASTED]], align 4
// CHECK12-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK12-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK12-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK12-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK12: omp_if.then:
// CHECK12-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i32)* @.omp_outlined..2 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i32 [[TMP3]])
// CHECK12-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK12: omp_if.else:
// CHECK12-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK12-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK12-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK12-NEXT: call void @.omp_outlined..2(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i32 [[TMP3]]) #[[ATTR2]]
// CHECK12-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK12-NEXT: br label [[OMP_IF_END]]
// CHECK12: omp_if.end:
// CHECK12-NEXT: ret void
//
//
// CHECK12-LABEL: define {{[^@]+}}@.omp_outlined..2
// CHECK12-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK12-NEXT: entry:
// CHECK12-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK12-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK12-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK12-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK12-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK12-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK12-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK12-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK12-NEXT: [[TMP1:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK12-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK12-NEXT: [[ADD:%.*]] = fadd double [[CONV]], 1.500000e+00
// CHECK12-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK12-NEXT: store double [[ADD]], double* [[A]], align 4
// CHECK12-NEXT: ret void
//
//
// CHECK12-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK12-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK12-NEXT: entry:
// CHECK12-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK12-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK12-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK12-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK12-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK12-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK12-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK12-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK12-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK12: omp_if.then:
// CHECK12-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..3 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK12-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK12: omp_if.else:
// CHECK12-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK12-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK12-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK12-NEXT: call void @.omp_outlined..3(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR2]]
// CHECK12-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK12-NEXT: br label [[OMP_IF_END]]
// CHECK12: omp_if.end:
// CHECK12-NEXT: ret void
//
//
// CHECK12-LABEL: define {{[^@]+}}@.omp_outlined..3
// CHECK12-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR1]] {
// CHECK12-NEXT: entry:
// CHECK12-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK12-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK12-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK12-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK12-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK12-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK12-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK12-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK12-NEXT: store double 2.500000e+00, double* [[A]], align 4
// CHECK12-NEXT: ret void
//
//
// CHECK12-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK12-SAME: (i32 noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK12-NEXT: entry:
// CHECK12-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK12-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK12-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK12-NEXT: store i32 [[TMP1]], i32* [[A_CASTED]], align 4
// CHECK12-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK12-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK12-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK12-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK12-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i32 [[TMP2]]) #[[ATTR2]]
// CHECK12-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK12-NEXT: ret void
//
//
// CHECK12-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK12-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK12-NEXT: entry:
// CHECK12-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK12-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK12-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK12-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK12-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK12-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK12-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK12-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK12-NEXT: ret void
//
//
// CHECK12-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK12-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR0]] {
// CHECK12-NEXT: entry:
// CHECK12-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK12-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK12-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK12-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK12-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK12-NEXT: store i32 [[TMP0]], i32* [[A_CASTED]], align 4
// CHECK12-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK12-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK12-NEXT: [[CONV1:%.*]] = bitcast i32* [[B_CASTED]] to i16*
// CHECK12-NEXT: store i16 [[TMP2]], i16* [[CONV1]], align 2
// CHECK12-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK12-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32, i32)* @.omp_outlined..5 to void (i32*, i32*, ...)*), i32 [[TMP1]], i32 [[TMP3]])
// CHECK12-NEXT: ret void
//
//
// CHECK12-LABEL: define {{[^@]+}}@.omp_outlined..5
// CHECK12-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK12-NEXT: entry:
// CHECK12-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK12-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK12-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK12-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK12-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK12-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK12-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK12-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK12-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK12-NEXT: [[CONV1:%.*]] = sext i16 [[TMP0]] to i32
// CHECK12-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK12-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV1]]
// CHECK12-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK12-NEXT: ret void
//
//
// CHECK17-LABEL: define {{[^@]+}}@_Z3bari
// CHECK17-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[S:%.*]] = alloca [[STRUCT_S1:%.*]], align 8
// CHECK17-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK17-NEXT: store i32 0, i32* [[A]], align 4
// CHECK17-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK17-NEXT: [[CALL:%.*]] = call noundef signext i32 @_ZN2S12r1Ei(%struct.S1* noundef [[S]], i32 noundef signext [[TMP0]])
// CHECK17-NEXT: [[TMP1:%.*]] = load i32, i32* [[A]], align 4
// CHECK17-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CALL]]
// CHECK17-NEXT: store i32 [[ADD]], i32* [[A]], align 4
// CHECK17-NEXT: [[TMP2:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK17-NEXT: [[CALL1:%.*]] = call noundef signext i32 @_ZL7fstatici(i32 noundef signext [[TMP2]])
// CHECK17-NEXT: [[TMP3:%.*]] = load i32, i32* [[A]], align 4
// CHECK17-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP3]], [[CALL1]]
// CHECK17-NEXT: store i32 [[ADD2]], i32* [[A]], align 4
// CHECK17-NEXT: [[TMP4:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK17-NEXT: [[CALL3:%.*]] = call noundef signext i32 @_Z9ftemplateIiET_i(i32 noundef signext [[TMP4]])
// CHECK17-NEXT: [[TMP5:%.*]] = load i32, i32* [[A]], align 4
// CHECK17-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP5]], [[CALL3]]
// CHECK17-NEXT: store i32 [[ADD4]], i32* [[A]], align 4
// CHECK17-NEXT: [[TMP6:%.*]] = load i32, i32* [[A]], align 4
// CHECK17-NEXT: ret i32 [[TMP6]]
//
//
// CHECK17-LABEL: define {{[^@]+}}@_ZN2S12r1Ei
// CHECK17-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef signext [[N:%.*]]) #[[ATTR0]] comdat align 2 {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK17-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[B:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK17-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x i8*], align 8
// CHECK17-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x i8*], align 8
// CHECK17-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x i8*], align 8
// CHECK17-NEXT: [[DOTCAPTURE_EXPR_5:%.*]] = alloca i8, align 1
// CHECK17-NEXT: [[DOTCAPTURE_EXPR__CASTED9:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[DOTOFFLOAD_BASEPTRS14:%.*]] = alloca [2 x i8*], align 8
// CHECK17-NEXT: [[DOTOFFLOAD_PTRS15:%.*]] = alloca [2 x i8*], align 8
// CHECK17-NEXT: [[DOTOFFLOAD_MAPPERS16:%.*]] = alloca [2 x i8*], align 8
// CHECK17-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK17-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK17-NEXT: [[THIS1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK17-NEXT: store i32 1, i32* [[B]], align 4
// CHECK17-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK17-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 3
// CHECK17-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK17-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK17-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4
// CHECK17-NEXT: [[CONV:%.*]] = bitcast i64* [[B_CASTED]] to i32*
// CHECK17-NEXT: store i32 [[TMP1]], i32* [[CONV]], align 4
// CHECK17-NEXT: [[TMP2:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK17-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK17-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK17-NEXT: [[CONV2:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK17-NEXT: [[FROMBOOL3:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK17-NEXT: store i8 [[FROMBOOL3]], i8* [[CONV2]], align 1
// CHECK17-NEXT: [[TMP4:%.*]] = load i64, i64* [[DOTCAPTURE_EXPR__CASTED]], align 8
// CHECK17-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK17-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK17-NEXT: [[TMP6:%.*]] = bitcast i8** [[TMP5]] to %struct.S1**
// CHECK17-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP6]], align 8
// CHECK17-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK17-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to double**
// CHECK17-NEXT: store double* [[A]], double** [[TMP8]], align 8
// CHECK17-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK17-NEXT: store i8* null, i8** [[TMP9]], align 8
// CHECK17-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK17-NEXT: [[TMP11:%.*]] = bitcast i8** [[TMP10]] to i64*
// CHECK17-NEXT: store i64 [[TMP2]], i64* [[TMP11]], align 8
// CHECK17-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK17-NEXT: [[TMP13:%.*]] = bitcast i8** [[TMP12]] to i64*
// CHECK17-NEXT: store i64 [[TMP2]], i64* [[TMP13]], align 8
// CHECK17-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
// CHECK17-NEXT: store i8* null, i8** [[TMP14]], align 8
// CHECK17-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
// CHECK17-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i64*
// CHECK17-NEXT: store i64 [[TMP4]], i64* [[TMP16]], align 8
// CHECK17-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 2
// CHECK17-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i64*
// CHECK17-NEXT: store i64 [[TMP4]], i64* [[TMP18]], align 8
// CHECK17-NEXT: [[TMP19:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
// CHECK17-NEXT: store i8* null, i8** [[TMP19]], align 8
// CHECK17-NEXT: [[TMP20:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK17-NEXT: [[TMP21:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK17-NEXT: [[TMP22:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK17-NEXT: [[TOBOOL4:%.*]] = trunc i8 [[TMP22]] to i1
// CHECK17-NEXT: [[TMP23:%.*]] = select i1 [[TOBOOL4]], i32 0, i32 1
// CHECK17-NEXT: [[TMP24:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1:[0-9]+]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121.region_id, i32 3, i8** [[TMP20]], i8** [[TMP21]], i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_sizes, i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_maptypes, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP23]])
// CHECK17-NEXT: [[TMP25:%.*]] = icmp ne i32 [[TMP24]], 0
// CHECK17-NEXT: br i1 [[TMP25]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK17: omp_offload.failed:
// CHECK17-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121(%struct.S1* [[THIS1]], i64 [[TMP2]], i64 [[TMP4]]) #[[ATTR3:[0-9]+]]
// CHECK17-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK17: omp_offload.cont:
// CHECK17-NEXT: [[TMP26:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK17-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[TMP26]], 5
// CHECK17-NEXT: [[FROMBOOL7:%.*]] = zext i1 [[CMP6]] to i8
// CHECK17-NEXT: store i8 [[FROMBOOL7]], i8* [[DOTCAPTURE_EXPR_5]], align 1
// CHECK17-NEXT: [[TMP27:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_5]], align 1
// CHECK17-NEXT: [[TOBOOL8:%.*]] = trunc i8 [[TMP27]] to i1
// CHECK17-NEXT: [[CONV10:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__CASTED9]] to i8*
// CHECK17-NEXT: [[FROMBOOL11:%.*]] = zext i1 [[TOBOOL8]] to i8
// CHECK17-NEXT: store i8 [[FROMBOOL11]], i8* [[CONV10]], align 1
// CHECK17-NEXT: [[TMP28:%.*]] = load i64, i64* [[DOTCAPTURE_EXPR__CASTED9]], align 8
// CHECK17-NEXT: [[TMP29:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK17-NEXT: [[CMP12:%.*]] = icmp sgt i32 [[TMP29]], 4
// CHECK17-NEXT: br i1 [[CMP12]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK17: omp_if.then:
// CHECK17-NEXT: [[A13:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK17-NEXT: [[TMP30:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS14]], i32 0, i32 0
// CHECK17-NEXT: [[TMP31:%.*]] = bitcast i8** [[TMP30]] to %struct.S1**
// CHECK17-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP31]], align 8
// CHECK17-NEXT: [[TMP32:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS15]], i32 0, i32 0
// CHECK17-NEXT: [[TMP33:%.*]] = bitcast i8** [[TMP32]] to double**
// CHECK17-NEXT: store double* [[A13]], double** [[TMP33]], align 8
// CHECK17-NEXT: [[TMP34:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS16]], i64 0, i64 0
// CHECK17-NEXT: store i8* null, i8** [[TMP34]], align 8
// CHECK17-NEXT: [[TMP35:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS14]], i32 0, i32 1
// CHECK17-NEXT: [[TMP36:%.*]] = bitcast i8** [[TMP35]] to i64*
// CHECK17-NEXT: store i64 [[TMP28]], i64* [[TMP36]], align 8
// CHECK17-NEXT: [[TMP37:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS15]], i32 0, i32 1
// CHECK17-NEXT: [[TMP38:%.*]] = bitcast i8** [[TMP37]] to i64*
// CHECK17-NEXT: store i64 [[TMP28]], i64* [[TMP38]], align 8
// CHECK17-NEXT: [[TMP39:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS16]], i64 0, i64 1
// CHECK17-NEXT: store i8* null, i8** [[TMP39]], align 8
// CHECK17-NEXT: [[TMP40:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS14]], i32 0, i32 0
// CHECK17-NEXT: [[TMP41:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS15]], i32 0, i32 0
// CHECK17-NEXT: [[TMP42:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_5]], align 1
// CHECK17-NEXT: [[TOBOOL17:%.*]] = trunc i8 [[TMP42]] to i1
// CHECK17-NEXT: [[TMP43:%.*]] = select i1 [[TOBOOL17]], i32 0, i32 1
// CHECK17-NEXT: [[TMP44:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126.region_id, i32 2, i8** [[TMP40]], i8** [[TMP41]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.2, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.3, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP43]])
// CHECK17-NEXT: [[TMP45:%.*]] = icmp ne i32 [[TMP44]], 0
// CHECK17-NEXT: br i1 [[TMP45]], label [[OMP_OFFLOAD_FAILED18:%.*]], label [[OMP_OFFLOAD_CONT19:%.*]]
// CHECK17: omp_offload.failed18:
// CHECK17-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i64 [[TMP28]]) #[[ATTR3]]
// CHECK17-NEXT: br label [[OMP_OFFLOAD_CONT19]]
// CHECK17: omp_offload.cont19:
// CHECK17-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK17: omp_if.else:
// CHECK17-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i64 [[TMP28]]) #[[ATTR3]]
// CHECK17-NEXT: br label [[OMP_IF_END]]
// CHECK17: omp_if.end:
// CHECK17-NEXT: [[A20:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK17-NEXT: [[TMP46:%.*]] = load double, double* [[A20]], align 8
// CHECK17-NEXT: [[CONV21:%.*]] = fptosi double [[TMP46]] to i32
// CHECK17-NEXT: ret i32 [[CONV21]]
//
//
// CHECK17-LABEL: define {{[^@]+}}@_ZL7fstatici
// CHECK17-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK17-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK17-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK17-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 8
// CHECK17-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK17-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK17-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 1
// CHECK17-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK17-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK17-NEXT: [[TMP1:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK17-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK17-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK17-NEXT: [[FROMBOOL1:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK17-NEXT: store i8 [[FROMBOOL1]], i8* [[CONV]], align 1
// CHECK17-NEXT: [[TMP2:%.*]] = load i64, i64* [[DOTCAPTURE_EXPR__CASTED]], align 8
// CHECK17-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK17-NEXT: [[TOBOOL2:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK17-NEXT: br i1 [[TOBOOL2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK17: omp_if.then:
// CHECK17-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK17-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i64*
// CHECK17-NEXT: store i64 [[TMP2]], i64* [[TMP5]], align 8
// CHECK17-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK17-NEXT: [[TMP7:%.*]] = bitcast i8** [[TMP6]] to i64*
// CHECK17-NEXT: store i64 [[TMP2]], i64* [[TMP7]], align 8
// CHECK17-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK17-NEXT: store i8* null, i8** [[TMP8]], align 8
// CHECK17-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK17-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK17-NEXT: [[TMP11:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK17-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP11]] to i1
// CHECK17-NEXT: [[TMP12:%.*]] = select i1 [[TOBOOL3]], i32 0, i32 1
// CHECK17-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104.region_id, i32 1, i8** [[TMP9]], i8** [[TMP10]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.5, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.6, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP12]])
// CHECK17-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
// CHECK17-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK17: omp_offload.failed:
// CHECK17-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i64 [[TMP2]]) #[[ATTR3]]
// CHECK17-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK17: omp_offload.cont:
// CHECK17-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK17: omp_if.else:
// CHECK17-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i64 [[TMP2]]) #[[ATTR3]]
// CHECK17-NEXT: br label [[OMP_IF_END]]
// CHECK17: omp_if.end:
// CHECK17-NEXT: [[TMP15:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK17-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP15]], 2
// CHECK17-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[SUB]], 2
// CHECK17-NEXT: br i1 [[CMP4]], label [[OMP_IF_THEN5:%.*]], label [[OMP_IF_ELSE8:%.*]]
// CHECK17: omp_if.then5:
// CHECK17-NEXT: [[TMP16:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108.region_id, i32 0, i8** null, i8** null, i64* null, i64* null, i8** null, i8** null, i32 1, i32 0)
// CHECK17-NEXT: [[TMP17:%.*]] = icmp ne i32 [[TMP16]], 0
// CHECK17-NEXT: br i1 [[TMP17]], label [[OMP_OFFLOAD_FAILED6:%.*]], label [[OMP_OFFLOAD_CONT7:%.*]]
// CHECK17: omp_offload.failed6:
// CHECK17-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK17-NEXT: br label [[OMP_OFFLOAD_CONT7]]
// CHECK17: omp_offload.cont7:
// CHECK17-NEXT: br label [[OMP_IF_END9:%.*]]
// CHECK17: omp_if.else8:
// CHECK17-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK17-NEXT: br label [[OMP_IF_END9]]
// CHECK17: omp_if.end9:
// CHECK17-NEXT: [[TMP18:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK17-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP18]], 1
// CHECK17-NEXT: ret i32 [[ADD]]
//
//
// CHECK17-LABEL: define {{[^@]+}}@_Z9ftemplateIiET_i
// CHECK17-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0]] comdat {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK17-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK17-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 8
// CHECK17-NEXT: [[B:%.*]] = alloca i16, align 2
// CHECK17-NEXT: [[A_CASTED1:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[DOTOFFLOAD_BASEPTRS4:%.*]] = alloca [2 x i8*], align 8
// CHECK17-NEXT: [[DOTOFFLOAD_PTRS5:%.*]] = alloca [2 x i8*], align 8
// CHECK17-NEXT: [[DOTOFFLOAD_MAPPERS6:%.*]] = alloca [2 x i8*], align 8
// CHECK17-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK17-NEXT: store i32 0, i32* [[A]], align 4
// CHECK17-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4
// CHECK17-NEXT: [[CONV:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK17-NEXT: store i32 [[TMP0]], i32* [[CONV]], align 4
// CHECK17-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK17-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK17-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i64*
// CHECK17-NEXT: store i64 [[TMP1]], i64* [[TMP3]], align 8
// CHECK17-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK17-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i64*
// CHECK17-NEXT: store i64 [[TMP1]], i64* [[TMP5]], align 8
// CHECK17-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK17-NEXT: store i8* null, i8** [[TMP6]], align 8
// CHECK17-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK17-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK17-NEXT: [[TMP9:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87.region_id, i32 1, i8** [[TMP7]], i8** [[TMP8]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.9, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.10, i32 0, i32 0), i8** null, i8** null, i32 1, i32 1)
// CHECK17-NEXT: [[TMP10:%.*]] = icmp ne i32 [[TMP9]], 0
// CHECK17-NEXT: br i1 [[TMP10]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK17: omp_offload.failed:
// CHECK17-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87(i64 [[TMP1]]) #[[ATTR3]]
// CHECK17-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK17: omp_offload.cont:
// CHECK17-NEXT: store i16 1, i16* [[B]], align 2
// CHECK17-NEXT: [[TMP11:%.*]] = load i32, i32* [[A]], align 4
// CHECK17-NEXT: [[CONV2:%.*]] = bitcast i64* [[A_CASTED1]] to i32*
// CHECK17-NEXT: store i32 [[TMP11]], i32* [[CONV2]], align 4
// CHECK17-NEXT: [[TMP12:%.*]] = load i64, i64* [[A_CASTED1]], align 8
// CHECK17-NEXT: [[TMP13:%.*]] = load i16, i16* [[B]], align 2
// CHECK17-NEXT: [[CONV3:%.*]] = bitcast i64* [[B_CASTED]] to i16*
// CHECK17-NEXT: store i16 [[TMP13]], i16* [[CONV3]], align 2
// CHECK17-NEXT: [[TMP14:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK17-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 0
// CHECK17-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i64*
// CHECK17-NEXT: store i64 [[TMP12]], i64* [[TMP16]], align 8
// CHECK17-NEXT: [[TMP17:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS5]], i32 0, i32 0
// CHECK17-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i64*
// CHECK17-NEXT: store i64 [[TMP12]], i64* [[TMP18]], align 8
// CHECK17-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS6]], i64 0, i64 0
// CHECK17-NEXT: store i8* null, i8** [[TMP19]], align 8
// CHECK17-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 1
// CHECK17-NEXT: [[TMP21:%.*]] = bitcast i8** [[TMP20]] to i64*
// CHECK17-NEXT: store i64 [[TMP14]], i64* [[TMP21]], align 8
// CHECK17-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS5]], i32 0, i32 1
// CHECK17-NEXT: [[TMP23:%.*]] = bitcast i8** [[TMP22]] to i64*
// CHECK17-NEXT: store i64 [[TMP14]], i64* [[TMP23]], align 8
// CHECK17-NEXT: [[TMP24:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS6]], i64 0, i64 1
// CHECK17-NEXT: store i8* null, i8** [[TMP24]], align 8
// CHECK17-NEXT: [[TMP25:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 0
// CHECK17-NEXT: [[TMP26:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS5]], i32 0, i32 0
// CHECK17-NEXT: [[TMP27:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93.region_id, i32 2, i8** [[TMP25]], i8** [[TMP26]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.12, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.13, i32 0, i32 0), i8** null, i8** null, i32 1, i32 0)
// CHECK17-NEXT: [[TMP28:%.*]] = icmp ne i32 [[TMP27]], 0
// CHECK17-NEXT: br i1 [[TMP28]], label [[OMP_OFFLOAD_FAILED7:%.*]], label [[OMP_OFFLOAD_CONT8:%.*]]
// CHECK17: omp_offload.failed7:
// CHECK17-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93(i64 [[TMP12]], i64 [[TMP14]]) #[[ATTR3]]
// CHECK17-NEXT: br label [[OMP_OFFLOAD_CONT8]]
// CHECK17: omp_offload.cont8:
// CHECK17-NEXT: [[TMP29:%.*]] = load i32, i32* [[A]], align 4
// CHECK17-NEXT: ret i32 [[TMP29]]
//
//
// CHECK17-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK17-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK17-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK17-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK17-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK17-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK17-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK17-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK17-NEXT: [[CONV1:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK17-NEXT: [[TMP2:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK17-NEXT: [[CONV2:%.*]] = bitcast i64* [[B_CASTED]] to i32*
// CHECK17-NEXT: store i32 [[TMP2]], i32* [[CONV2]], align 4
// CHECK17-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK17-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV1]], align 1
// CHECK17-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK17-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK17: omp_if.then:
// CHECK17-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i64)* @.omp_outlined. to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i64 [[TMP3]])
// CHECK17-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK17: omp_if.else:
// CHECK17-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK17-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK17-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK17-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i64 [[TMP3]]) #[[ATTR3]]
// CHECK17-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK17-NEXT: br label [[OMP_IF_END]]
// CHECK17: omp_if.end:
// CHECK17-NEXT: ret void
//
//
// CHECK17-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK17-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]]) #[[ATTR2:[0-9]+]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK17-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK17-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK17-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK17-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK17-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK17-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK17-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK17-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK17-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK17-NEXT: [[CONV1:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK17-NEXT: [[ADD:%.*]] = fadd double [[CONV1]], 1.500000e+00
// CHECK17-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK17-NEXT: store double [[ADD]], double* [[A]], align 8
// CHECK17-NEXT: ret void
//
//
// CHECK17-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK17-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK17-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK17-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK17-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK17-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK17-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK17-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK17-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK17-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK17: omp_if.then:
// CHECK17-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..1 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK17-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK17: omp_if.else:
// CHECK17-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK17-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK17-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK17-NEXT: call void @.omp_outlined..1(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR3]]
// CHECK17-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK17-NEXT: br label [[OMP_IF_END]]
// CHECK17: omp_if.end:
// CHECK17-NEXT: ret void
//
//
// CHECK17-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK17-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR2]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK17-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK17-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK17-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK17-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK17-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK17-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK17-NEXT: store double 2.500000e+00, double* [[A]], align 8
// CHECK17-NEXT: ret void
//
//
// CHECK17-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK17-SAME: (i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK17-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK17-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK17-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK17-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK17-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK17: omp_if.then:
// CHECK17-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..4 to void (i32*, i32*, ...)*))
// CHECK17-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK17: omp_if.else:
// CHECK17-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK17-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK17-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK17-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR3]]
// CHECK17-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK17-NEXT: br label [[OMP_IF_END]]
// CHECK17: omp_if.end:
// CHECK17-NEXT: ret void
//
//
// CHECK17-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK17-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK17-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK17-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK17-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK17-NEXT: ret void
//
//
// CHECK17-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK17-SAME: () #[[ATTR1]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..7 to void (i32*, i32*, ...)*))
// CHECK17-NEXT: ret void
//
//
// CHECK17-LABEL: define {{[^@]+}}@.omp_outlined..7
// CHECK17-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK17-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK17-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK17-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK17-NEXT: ret void
//
//
// CHECK17-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK17-SAME: (i64 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK17-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK17-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK17-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK17-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK17-NEXT: [[CONV1:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK17-NEXT: store i32 [[TMP1]], i32* [[CONV1]], align 4
// CHECK17-NEXT: [[TMP2:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK17-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK17-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK17-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK17-NEXT: call void @.omp_outlined..8(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i64 [[TMP2]]) #[[ATTR3]]
// CHECK17-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK17-NEXT: ret void
//
//
// CHECK17-LABEL: define {{[^@]+}}@.omp_outlined..8
// CHECK17-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]]) #[[ATTR2]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK17-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK17-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK17-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK17-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK17-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK17-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK17-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK17-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK17-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK17-NEXT: ret void
//
//
// CHECK17-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK17-SAME: (i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK17-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK17-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK17-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK17-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK17-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK17-NEXT: [[CONV2:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK17-NEXT: store i32 [[TMP0]], i32* [[CONV2]], align 4
// CHECK17-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK17-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK17-NEXT: [[CONV3:%.*]] = bitcast i64* [[B_CASTED]] to i16*
// CHECK17-NEXT: store i16 [[TMP2]], i16* [[CONV3]], align 2
// CHECK17-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK17-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64)* @.omp_outlined..11 to void (i32*, i32*, ...)*), i64 [[TMP1]], i64 [[TMP3]])
// CHECK17-NEXT: ret void
//
//
// CHECK17-LABEL: define {{[^@]+}}@.omp_outlined..11
// CHECK17-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR2]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK17-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK17-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK17-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK17-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK17-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK17-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK17-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK17-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK17-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK17-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK17-NEXT: [[CONV2:%.*]] = sext i16 [[TMP0]] to i32
// CHECK17-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK17-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV2]]
// CHECK17-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK17-NEXT: ret void
//
//
// CHECK17-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
// CHECK17-SAME: () #[[ATTR4:[0-9]+]] {
// CHECK17-NEXT: entry:
// CHECK17-NEXT: call void @__tgt_register_requires(i64 1)
// CHECK17-NEXT: ret void
//
//
// CHECK18-LABEL: define {{[^@]+}}@_Z3bari
// CHECK18-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[S:%.*]] = alloca [[STRUCT_S1:%.*]], align 8
// CHECK18-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK18-NEXT: store i32 0, i32* [[A]], align 4
// CHECK18-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK18-NEXT: [[CALL:%.*]] = call noundef signext i32 @_ZN2S12r1Ei(%struct.S1* noundef [[S]], i32 noundef signext [[TMP0]])
// CHECK18-NEXT: [[TMP1:%.*]] = load i32, i32* [[A]], align 4
// CHECK18-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CALL]]
// CHECK18-NEXT: store i32 [[ADD]], i32* [[A]], align 4
// CHECK18-NEXT: [[TMP2:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK18-NEXT: [[CALL1:%.*]] = call noundef signext i32 @_ZL7fstatici(i32 noundef signext [[TMP2]])
// CHECK18-NEXT: [[TMP3:%.*]] = load i32, i32* [[A]], align 4
// CHECK18-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP3]], [[CALL1]]
// CHECK18-NEXT: store i32 [[ADD2]], i32* [[A]], align 4
// CHECK18-NEXT: [[TMP4:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK18-NEXT: [[CALL3:%.*]] = call noundef signext i32 @_Z9ftemplateIiET_i(i32 noundef signext [[TMP4]])
// CHECK18-NEXT: [[TMP5:%.*]] = load i32, i32* [[A]], align 4
// CHECK18-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP5]], [[CALL3]]
// CHECK18-NEXT: store i32 [[ADD4]], i32* [[A]], align 4
// CHECK18-NEXT: [[TMP6:%.*]] = load i32, i32* [[A]], align 4
// CHECK18-NEXT: ret i32 [[TMP6]]
//
//
// CHECK18-LABEL: define {{[^@]+}}@_ZN2S12r1Ei
// CHECK18-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef signext [[N:%.*]]) #[[ATTR0]] comdat align 2 {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK18-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[B:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK18-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x i8*], align 8
// CHECK18-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x i8*], align 8
// CHECK18-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x i8*], align 8
// CHECK18-NEXT: [[DOTCAPTURE_EXPR_5:%.*]] = alloca i8, align 1
// CHECK18-NEXT: [[DOTCAPTURE_EXPR__CASTED9:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[DOTOFFLOAD_BASEPTRS14:%.*]] = alloca [2 x i8*], align 8
// CHECK18-NEXT: [[DOTOFFLOAD_PTRS15:%.*]] = alloca [2 x i8*], align 8
// CHECK18-NEXT: [[DOTOFFLOAD_MAPPERS16:%.*]] = alloca [2 x i8*], align 8
// CHECK18-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK18-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK18-NEXT: [[THIS1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK18-NEXT: store i32 1, i32* [[B]], align 4
// CHECK18-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK18-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 3
// CHECK18-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK18-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK18-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4
// CHECK18-NEXT: [[CONV:%.*]] = bitcast i64* [[B_CASTED]] to i32*
// CHECK18-NEXT: store i32 [[TMP1]], i32* [[CONV]], align 4
// CHECK18-NEXT: [[TMP2:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK18-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK18-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK18-NEXT: [[CONV2:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK18-NEXT: [[FROMBOOL3:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK18-NEXT: store i8 [[FROMBOOL3]], i8* [[CONV2]], align 1
// CHECK18-NEXT: [[TMP4:%.*]] = load i64, i64* [[DOTCAPTURE_EXPR__CASTED]], align 8
// CHECK18-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK18-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK18-NEXT: [[TMP6:%.*]] = bitcast i8** [[TMP5]] to %struct.S1**
// CHECK18-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP6]], align 8
// CHECK18-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK18-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to double**
// CHECK18-NEXT: store double* [[A]], double** [[TMP8]], align 8
// CHECK18-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK18-NEXT: store i8* null, i8** [[TMP9]], align 8
// CHECK18-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK18-NEXT: [[TMP11:%.*]] = bitcast i8** [[TMP10]] to i64*
// CHECK18-NEXT: store i64 [[TMP2]], i64* [[TMP11]], align 8
// CHECK18-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK18-NEXT: [[TMP13:%.*]] = bitcast i8** [[TMP12]] to i64*
// CHECK18-NEXT: store i64 [[TMP2]], i64* [[TMP13]], align 8
// CHECK18-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
// CHECK18-NEXT: store i8* null, i8** [[TMP14]], align 8
// CHECK18-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
// CHECK18-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i64*
// CHECK18-NEXT: store i64 [[TMP4]], i64* [[TMP16]], align 8
// CHECK18-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 2
// CHECK18-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i64*
// CHECK18-NEXT: store i64 [[TMP4]], i64* [[TMP18]], align 8
// CHECK18-NEXT: [[TMP19:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
// CHECK18-NEXT: store i8* null, i8** [[TMP19]], align 8
// CHECK18-NEXT: [[TMP20:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK18-NEXT: [[TMP21:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK18-NEXT: [[TMP22:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK18-NEXT: [[TOBOOL4:%.*]] = trunc i8 [[TMP22]] to i1
// CHECK18-NEXT: [[TMP23:%.*]] = select i1 [[TOBOOL4]], i32 0, i32 1
// CHECK18-NEXT: [[TMP24:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1:[0-9]+]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121.region_id, i32 3, i8** [[TMP20]], i8** [[TMP21]], i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_sizes, i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_maptypes, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP23]])
// CHECK18-NEXT: [[TMP25:%.*]] = icmp ne i32 [[TMP24]], 0
// CHECK18-NEXT: br i1 [[TMP25]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK18: omp_offload.failed:
// CHECK18-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121(%struct.S1* [[THIS1]], i64 [[TMP2]], i64 [[TMP4]]) #[[ATTR3:[0-9]+]]
// CHECK18-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK18: omp_offload.cont:
// CHECK18-NEXT: [[TMP26:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK18-NEXT: [[CMP6:%.*]] = icmp sgt i32 [[TMP26]], 5
// CHECK18-NEXT: [[FROMBOOL7:%.*]] = zext i1 [[CMP6]] to i8
// CHECK18-NEXT: store i8 [[FROMBOOL7]], i8* [[DOTCAPTURE_EXPR_5]], align 1
// CHECK18-NEXT: [[TMP27:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_5]], align 1
// CHECK18-NEXT: [[TOBOOL8:%.*]] = trunc i8 [[TMP27]] to i1
// CHECK18-NEXT: [[CONV10:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__CASTED9]] to i8*
// CHECK18-NEXT: [[FROMBOOL11:%.*]] = zext i1 [[TOBOOL8]] to i8
// CHECK18-NEXT: store i8 [[FROMBOOL11]], i8* [[CONV10]], align 1
// CHECK18-NEXT: [[TMP28:%.*]] = load i64, i64* [[DOTCAPTURE_EXPR__CASTED9]], align 8
// CHECK18-NEXT: [[TMP29:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK18-NEXT: [[CMP12:%.*]] = icmp sgt i32 [[TMP29]], 4
// CHECK18-NEXT: br i1 [[CMP12]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK18: omp_if.then:
// CHECK18-NEXT: [[A13:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK18-NEXT: [[TMP30:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS14]], i32 0, i32 0
// CHECK18-NEXT: [[TMP31:%.*]] = bitcast i8** [[TMP30]] to %struct.S1**
// CHECK18-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP31]], align 8
// CHECK18-NEXT: [[TMP32:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS15]], i32 0, i32 0
// CHECK18-NEXT: [[TMP33:%.*]] = bitcast i8** [[TMP32]] to double**
// CHECK18-NEXT: store double* [[A13]], double** [[TMP33]], align 8
// CHECK18-NEXT: [[TMP34:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS16]], i64 0, i64 0
// CHECK18-NEXT: store i8* null, i8** [[TMP34]], align 8
// CHECK18-NEXT: [[TMP35:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS14]], i32 0, i32 1
// CHECK18-NEXT: [[TMP36:%.*]] = bitcast i8** [[TMP35]] to i64*
// CHECK18-NEXT: store i64 [[TMP28]], i64* [[TMP36]], align 8
// CHECK18-NEXT: [[TMP37:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS15]], i32 0, i32 1
// CHECK18-NEXT: [[TMP38:%.*]] = bitcast i8** [[TMP37]] to i64*
// CHECK18-NEXT: store i64 [[TMP28]], i64* [[TMP38]], align 8
// CHECK18-NEXT: [[TMP39:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS16]], i64 0, i64 1
// CHECK18-NEXT: store i8* null, i8** [[TMP39]], align 8
// CHECK18-NEXT: [[TMP40:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS14]], i32 0, i32 0
// CHECK18-NEXT: [[TMP41:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS15]], i32 0, i32 0
// CHECK18-NEXT: [[TMP42:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_5]], align 1
// CHECK18-NEXT: [[TOBOOL17:%.*]] = trunc i8 [[TMP42]] to i1
// CHECK18-NEXT: [[TMP43:%.*]] = select i1 [[TOBOOL17]], i32 0, i32 1
// CHECK18-NEXT: [[TMP44:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126.region_id, i32 2, i8** [[TMP40]], i8** [[TMP41]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.2, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.3, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP43]])
// CHECK18-NEXT: [[TMP45:%.*]] = icmp ne i32 [[TMP44]], 0
// CHECK18-NEXT: br i1 [[TMP45]], label [[OMP_OFFLOAD_FAILED18:%.*]], label [[OMP_OFFLOAD_CONT19:%.*]]
// CHECK18: omp_offload.failed18:
// CHECK18-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i64 [[TMP28]]) #[[ATTR3]]
// CHECK18-NEXT: br label [[OMP_OFFLOAD_CONT19]]
// CHECK18: omp_offload.cont19:
// CHECK18-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK18: omp_if.else:
// CHECK18-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i64 [[TMP28]]) #[[ATTR3]]
// CHECK18-NEXT: br label [[OMP_IF_END]]
// CHECK18: omp_if.end:
// CHECK18-NEXT: [[A20:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK18-NEXT: [[TMP46:%.*]] = load double, double* [[A20]], align 8
// CHECK18-NEXT: [[CONV21:%.*]] = fptosi double [[TMP46]] to i32
// CHECK18-NEXT: ret i32 [[CONV21]]
//
//
// CHECK18-LABEL: define {{[^@]+}}@_ZL7fstatici
// CHECK18-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK18-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK18-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK18-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 8
// CHECK18-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK18-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK18-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 1
// CHECK18-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK18-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK18-NEXT: [[TMP1:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK18-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK18-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK18-NEXT: [[FROMBOOL1:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK18-NEXT: store i8 [[FROMBOOL1]], i8* [[CONV]], align 1
// CHECK18-NEXT: [[TMP2:%.*]] = load i64, i64* [[DOTCAPTURE_EXPR__CASTED]], align 8
// CHECK18-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK18-NEXT: [[TOBOOL2:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK18-NEXT: br i1 [[TOBOOL2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK18: omp_if.then:
// CHECK18-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK18-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i64*
// CHECK18-NEXT: store i64 [[TMP2]], i64* [[TMP5]], align 8
// CHECK18-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK18-NEXT: [[TMP7:%.*]] = bitcast i8** [[TMP6]] to i64*
// CHECK18-NEXT: store i64 [[TMP2]], i64* [[TMP7]], align 8
// CHECK18-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK18-NEXT: store i8* null, i8** [[TMP8]], align 8
// CHECK18-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK18-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK18-NEXT: [[TMP11:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK18-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP11]] to i1
// CHECK18-NEXT: [[TMP12:%.*]] = select i1 [[TOBOOL3]], i32 0, i32 1
// CHECK18-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104.region_id, i32 1, i8** [[TMP9]], i8** [[TMP10]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.5, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.6, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP12]])
// CHECK18-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
// CHECK18-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK18: omp_offload.failed:
// CHECK18-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i64 [[TMP2]]) #[[ATTR3]]
// CHECK18-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK18: omp_offload.cont:
// CHECK18-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK18: omp_if.else:
// CHECK18-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i64 [[TMP2]]) #[[ATTR3]]
// CHECK18-NEXT: br label [[OMP_IF_END]]
// CHECK18: omp_if.end:
// CHECK18-NEXT: [[TMP15:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK18-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP15]], 2
// CHECK18-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[SUB]], 2
// CHECK18-NEXT: br i1 [[CMP4]], label [[OMP_IF_THEN5:%.*]], label [[OMP_IF_ELSE8:%.*]]
// CHECK18: omp_if.then5:
// CHECK18-NEXT: [[TMP16:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108.region_id, i32 0, i8** null, i8** null, i64* null, i64* null, i8** null, i8** null, i32 1, i32 0)
// CHECK18-NEXT: [[TMP17:%.*]] = icmp ne i32 [[TMP16]], 0
// CHECK18-NEXT: br i1 [[TMP17]], label [[OMP_OFFLOAD_FAILED6:%.*]], label [[OMP_OFFLOAD_CONT7:%.*]]
// CHECK18: omp_offload.failed6:
// CHECK18-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK18-NEXT: br label [[OMP_OFFLOAD_CONT7]]
// CHECK18: omp_offload.cont7:
// CHECK18-NEXT: br label [[OMP_IF_END9:%.*]]
// CHECK18: omp_if.else8:
// CHECK18-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK18-NEXT: br label [[OMP_IF_END9]]
// CHECK18: omp_if.end9:
// CHECK18-NEXT: [[TMP18:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK18-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP18]], 1
// CHECK18-NEXT: ret i32 [[ADD]]
//
//
// CHECK18-LABEL: define {{[^@]+}}@_Z9ftemplateIiET_i
// CHECK18-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0]] comdat {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK18-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 8
// CHECK18-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 8
// CHECK18-NEXT: [[B:%.*]] = alloca i16, align 2
// CHECK18-NEXT: [[A_CASTED1:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[DOTOFFLOAD_BASEPTRS4:%.*]] = alloca [2 x i8*], align 8
// CHECK18-NEXT: [[DOTOFFLOAD_PTRS5:%.*]] = alloca [2 x i8*], align 8
// CHECK18-NEXT: [[DOTOFFLOAD_MAPPERS6:%.*]] = alloca [2 x i8*], align 8
// CHECK18-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK18-NEXT: store i32 0, i32* [[A]], align 4
// CHECK18-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4
// CHECK18-NEXT: [[CONV:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK18-NEXT: store i32 [[TMP0]], i32* [[CONV]], align 4
// CHECK18-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK18-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK18-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i64*
// CHECK18-NEXT: store i64 [[TMP1]], i64* [[TMP3]], align 8
// CHECK18-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK18-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i64*
// CHECK18-NEXT: store i64 [[TMP1]], i64* [[TMP5]], align 8
// CHECK18-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
// CHECK18-NEXT: store i8* null, i8** [[TMP6]], align 8
// CHECK18-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK18-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK18-NEXT: [[TMP9:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87.region_id, i32 1, i8** [[TMP7]], i8** [[TMP8]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.9, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.10, i32 0, i32 0), i8** null, i8** null, i32 1, i32 1)
// CHECK18-NEXT: [[TMP10:%.*]] = icmp ne i32 [[TMP9]], 0
// CHECK18-NEXT: br i1 [[TMP10]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK18: omp_offload.failed:
// CHECK18-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87(i64 [[TMP1]]) #[[ATTR3]]
// CHECK18-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK18: omp_offload.cont:
// CHECK18-NEXT: store i16 1, i16* [[B]], align 2
// CHECK18-NEXT: [[TMP11:%.*]] = load i32, i32* [[A]], align 4
// CHECK18-NEXT: [[CONV2:%.*]] = bitcast i64* [[A_CASTED1]] to i32*
// CHECK18-NEXT: store i32 [[TMP11]], i32* [[CONV2]], align 4
// CHECK18-NEXT: [[TMP12:%.*]] = load i64, i64* [[A_CASTED1]], align 8
// CHECK18-NEXT: [[TMP13:%.*]] = load i16, i16* [[B]], align 2
// CHECK18-NEXT: [[CONV3:%.*]] = bitcast i64* [[B_CASTED]] to i16*
// CHECK18-NEXT: store i16 [[TMP13]], i16* [[CONV3]], align 2
// CHECK18-NEXT: [[TMP14:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK18-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 0
// CHECK18-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i64*
// CHECK18-NEXT: store i64 [[TMP12]], i64* [[TMP16]], align 8
// CHECK18-NEXT: [[TMP17:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS5]], i32 0, i32 0
// CHECK18-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i64*
// CHECK18-NEXT: store i64 [[TMP12]], i64* [[TMP18]], align 8
// CHECK18-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS6]], i64 0, i64 0
// CHECK18-NEXT: store i8* null, i8** [[TMP19]], align 8
// CHECK18-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 1
// CHECK18-NEXT: [[TMP21:%.*]] = bitcast i8** [[TMP20]] to i64*
// CHECK18-NEXT: store i64 [[TMP14]], i64* [[TMP21]], align 8
// CHECK18-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS5]], i32 0, i32 1
// CHECK18-NEXT: [[TMP23:%.*]] = bitcast i8** [[TMP22]] to i64*
// CHECK18-NEXT: store i64 [[TMP14]], i64* [[TMP23]], align 8
// CHECK18-NEXT: [[TMP24:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS6]], i64 0, i64 1
// CHECK18-NEXT: store i8* null, i8** [[TMP24]], align 8
// CHECK18-NEXT: [[TMP25:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 0
// CHECK18-NEXT: [[TMP26:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS5]], i32 0, i32 0
// CHECK18-NEXT: [[TMP27:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93.region_id, i32 2, i8** [[TMP25]], i8** [[TMP26]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.12, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.13, i32 0, i32 0), i8** null, i8** null, i32 1, i32 0)
// CHECK18-NEXT: [[TMP28:%.*]] = icmp ne i32 [[TMP27]], 0
// CHECK18-NEXT: br i1 [[TMP28]], label [[OMP_OFFLOAD_FAILED7:%.*]], label [[OMP_OFFLOAD_CONT8:%.*]]
// CHECK18: omp_offload.failed7:
// CHECK18-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93(i64 [[TMP12]], i64 [[TMP14]]) #[[ATTR3]]
// CHECK18-NEXT: br label [[OMP_OFFLOAD_CONT8]]
// CHECK18: omp_offload.cont8:
// CHECK18-NEXT: [[TMP29:%.*]] = load i32, i32* [[A]], align 4
// CHECK18-NEXT: ret i32 [[TMP29]]
//
//
// CHECK18-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK18-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK18-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK18-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK18-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK18-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK18-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK18-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK18-NEXT: [[CONV1:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK18-NEXT: [[TMP2:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK18-NEXT: [[CONV2:%.*]] = bitcast i64* [[B_CASTED]] to i32*
// CHECK18-NEXT: store i32 [[TMP2]], i32* [[CONV2]], align 4
// CHECK18-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK18-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV1]], align 1
// CHECK18-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK18-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK18: omp_if.then:
// CHECK18-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i64)* @.omp_outlined. to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i64 [[TMP3]])
// CHECK18-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK18: omp_if.else:
// CHECK18-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK18-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK18-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK18-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i64 [[TMP3]]) #[[ATTR3]]
// CHECK18-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK18-NEXT: br label [[OMP_IF_END]]
// CHECK18: omp_if.end:
// CHECK18-NEXT: ret void
//
//
// CHECK18-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK18-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]]) #[[ATTR2:[0-9]+]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK18-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK18-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK18-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK18-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK18-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK18-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK18-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK18-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK18-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK18-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK18-NEXT: [[CONV1:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK18-NEXT: [[ADD:%.*]] = fadd double [[CONV1]], 1.500000e+00
// CHECK18-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK18-NEXT: store double [[ADD]], double* [[A]], align 8
// CHECK18-NEXT: ret void
//
//
// CHECK18-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK18-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK18-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK18-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK18-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK18-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK18-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK18-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK18-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK18-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK18: omp_if.then:
// CHECK18-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..1 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK18-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK18: omp_if.else:
// CHECK18-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK18-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK18-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK18-NEXT: call void @.omp_outlined..1(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR3]]
// CHECK18-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK18-NEXT: br label [[OMP_IF_END]]
// CHECK18: omp_if.end:
// CHECK18-NEXT: ret void
//
//
// CHECK18-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK18-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR2]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK18-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK18-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK18-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK18-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK18-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK18-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK18-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK18-NEXT: store double 2.500000e+00, double* [[A]], align 8
// CHECK18-NEXT: ret void
//
//
// CHECK18-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK18-SAME: (i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK18-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK18-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK18-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK18-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK18-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK18: omp_if.then:
// CHECK18-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..4 to void (i32*, i32*, ...)*))
// CHECK18-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK18: omp_if.else:
// CHECK18-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK18-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK18-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK18-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR3]]
// CHECK18-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK18-NEXT: br label [[OMP_IF_END]]
// CHECK18: omp_if.end:
// CHECK18-NEXT: ret void
//
//
// CHECK18-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK18-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK18-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK18-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK18-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK18-NEXT: ret void
//
//
// CHECK18-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK18-SAME: () #[[ATTR1]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..7 to void (i32*, i32*, ...)*))
// CHECK18-NEXT: ret void
//
//
// CHECK18-LABEL: define {{[^@]+}}@.omp_outlined..7
// CHECK18-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK18-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK18-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK18-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK18-NEXT: ret void
//
//
// CHECK18-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK18-SAME: (i64 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK18-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK18-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK18-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK18-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK18-NEXT: [[CONV1:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK18-NEXT: store i32 [[TMP1]], i32* [[CONV1]], align 4
// CHECK18-NEXT: [[TMP2:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK18-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK18-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK18-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK18-NEXT: call void @.omp_outlined..8(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i64 [[TMP2]]) #[[ATTR3]]
// CHECK18-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK18-NEXT: ret void
//
//
// CHECK18-LABEL: define {{[^@]+}}@.omp_outlined..8
// CHECK18-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]]) #[[ATTR2]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK18-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK18-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK18-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK18-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK18-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK18-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK18-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK18-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK18-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK18-NEXT: ret void
//
//
// CHECK18-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK18-SAME: (i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK18-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK18-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK18-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK18-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK18-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK18-NEXT: [[CONV2:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK18-NEXT: store i32 [[TMP0]], i32* [[CONV2]], align 4
// CHECK18-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK18-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK18-NEXT: [[CONV3:%.*]] = bitcast i64* [[B_CASTED]] to i16*
// CHECK18-NEXT: store i16 [[TMP2]], i16* [[CONV3]], align 2
// CHECK18-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK18-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64)* @.omp_outlined..11 to void (i32*, i32*, ...)*), i64 [[TMP1]], i64 [[TMP3]])
// CHECK18-NEXT: ret void
//
//
// CHECK18-LABEL: define {{[^@]+}}@.omp_outlined..11
// CHECK18-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR2]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK18-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK18-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK18-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK18-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK18-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK18-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK18-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK18-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK18-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK18-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK18-NEXT: [[CONV2:%.*]] = sext i16 [[TMP0]] to i32
// CHECK18-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK18-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV2]]
// CHECK18-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK18-NEXT: ret void
//
//
// CHECK18-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
// CHECK18-SAME: () #[[ATTR4:[0-9]+]] {
// CHECK18-NEXT: entry:
// CHECK18-NEXT: call void @__tgt_register_requires(i64 1)
// CHECK18-NEXT: ret void
//
//
// CHECK19-LABEL: define {{[^@]+}}@_Z3bari
// CHECK19-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[S:%.*]] = alloca [[STRUCT_S1:%.*]], align 4
// CHECK19-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK19-NEXT: store i32 0, i32* [[A]], align 4
// CHECK19-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK19-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN2S12r1Ei(%struct.S1* noundef [[S]], i32 noundef [[TMP0]])
// CHECK19-NEXT: [[TMP1:%.*]] = load i32, i32* [[A]], align 4
// CHECK19-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CALL]]
// CHECK19-NEXT: store i32 [[ADD]], i32* [[A]], align 4
// CHECK19-NEXT: [[TMP2:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK19-NEXT: [[CALL1:%.*]] = call noundef i32 @_ZL7fstatici(i32 noundef [[TMP2]])
// CHECK19-NEXT: [[TMP3:%.*]] = load i32, i32* [[A]], align 4
// CHECK19-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP3]], [[CALL1]]
// CHECK19-NEXT: store i32 [[ADD2]], i32* [[A]], align 4
// CHECK19-NEXT: [[TMP4:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK19-NEXT: [[CALL3:%.*]] = call noundef i32 @_Z9ftemplateIiET_i(i32 noundef [[TMP4]])
// CHECK19-NEXT: [[TMP5:%.*]] = load i32, i32* [[A]], align 4
// CHECK19-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP5]], [[CALL3]]
// CHECK19-NEXT: store i32 [[ADD4]], i32* [[A]], align 4
// CHECK19-NEXT: [[TMP6:%.*]] = load i32, i32* [[A]], align 4
// CHECK19-NEXT: ret i32 [[TMP6]]
//
//
// CHECK19-LABEL: define {{[^@]+}}@_ZN2S12r1Ei
// CHECK19-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[N:%.*]]) #[[ATTR0]] comdat align 2 {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK19-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[B:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK19-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x i8*], align 4
// CHECK19-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x i8*], align 4
// CHECK19-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x i8*], align 4
// CHECK19-NEXT: [[DOTCAPTURE_EXPR_4:%.*]] = alloca i8, align 1
// CHECK19-NEXT: [[DOTCAPTURE_EXPR__CASTED8:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTOFFLOAD_BASEPTRS13:%.*]] = alloca [2 x i8*], align 4
// CHECK19-NEXT: [[DOTOFFLOAD_PTRS14:%.*]] = alloca [2 x i8*], align 4
// CHECK19-NEXT: [[DOTOFFLOAD_MAPPERS15:%.*]] = alloca [2 x i8*], align 4
// CHECK19-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK19-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK19-NEXT: [[THIS1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK19-NEXT: store i32 1, i32* [[B]], align 4
// CHECK19-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK19-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 3
// CHECK19-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK19-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK19-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4
// CHECK19-NEXT: store i32 [[TMP1]], i32* [[B_CASTED]], align 4
// CHECK19-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK19-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK19-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK19-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK19-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK19-NEXT: store i8 [[FROMBOOL2]], i8* [[CONV]], align 1
// CHECK19-NEXT: [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR__CASTED]], align 4
// CHECK19-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK19-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK19-NEXT: [[TMP6:%.*]] = bitcast i8** [[TMP5]] to %struct.S1**
// CHECK19-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP6]], align 4
// CHECK19-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK19-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to double**
// CHECK19-NEXT: store double* [[A]], double** [[TMP8]], align 4
// CHECK19-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK19-NEXT: store i8* null, i8** [[TMP9]], align 4
// CHECK19-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK19-NEXT: [[TMP11:%.*]] = bitcast i8** [[TMP10]] to i32*
// CHECK19-NEXT: store i32 [[TMP2]], i32* [[TMP11]], align 4
// CHECK19-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK19-NEXT: [[TMP13:%.*]] = bitcast i8** [[TMP12]] to i32*
// CHECK19-NEXT: store i32 [[TMP2]], i32* [[TMP13]], align 4
// CHECK19-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
// CHECK19-NEXT: store i8* null, i8** [[TMP14]], align 4
// CHECK19-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
// CHECK19-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i32*
// CHECK19-NEXT: store i32 [[TMP4]], i32* [[TMP16]], align 4
// CHECK19-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 2
// CHECK19-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i32*
// CHECK19-NEXT: store i32 [[TMP4]], i32* [[TMP18]], align 4
// CHECK19-NEXT: [[TMP19:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
// CHECK19-NEXT: store i8* null, i8** [[TMP19]], align 4
// CHECK19-NEXT: [[TMP20:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK19-NEXT: [[TMP21:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK19-NEXT: [[TMP22:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK19-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP22]] to i1
// CHECK19-NEXT: [[TMP23:%.*]] = select i1 [[TOBOOL3]], i32 0, i32 1
// CHECK19-NEXT: [[TMP24:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1:[0-9]+]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121.region_id, i32 3, i8** [[TMP20]], i8** [[TMP21]], i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_sizes, i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_maptypes, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP23]])
// CHECK19-NEXT: [[TMP25:%.*]] = icmp ne i32 [[TMP24]], 0
// CHECK19-NEXT: br i1 [[TMP25]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK19: omp_offload.failed:
// CHECK19-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121(%struct.S1* [[THIS1]], i32 [[TMP2]], i32 [[TMP4]]) #[[ATTR3:[0-9]+]]
// CHECK19-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK19: omp_offload.cont:
// CHECK19-NEXT: [[TMP26:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK19-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP26]], 5
// CHECK19-NEXT: [[FROMBOOL6:%.*]] = zext i1 [[CMP5]] to i8
// CHECK19-NEXT: store i8 [[FROMBOOL6]], i8* [[DOTCAPTURE_EXPR_4]], align 1
// CHECK19-NEXT: [[TMP27:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_4]], align 1
// CHECK19-NEXT: [[TOBOOL7:%.*]] = trunc i8 [[TMP27]] to i1
// CHECK19-NEXT: [[CONV9:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__CASTED8]] to i8*
// CHECK19-NEXT: [[FROMBOOL10:%.*]] = zext i1 [[TOBOOL7]] to i8
// CHECK19-NEXT: store i8 [[FROMBOOL10]], i8* [[CONV9]], align 1
// CHECK19-NEXT: [[TMP28:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR__CASTED8]], align 4
// CHECK19-NEXT: [[TMP29:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK19-NEXT: [[CMP11:%.*]] = icmp sgt i32 [[TMP29]], 4
// CHECK19-NEXT: br i1 [[CMP11]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK19: omp_if.then:
// CHECK19-NEXT: [[A12:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK19-NEXT: [[TMP30:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS13]], i32 0, i32 0
// CHECK19-NEXT: [[TMP31:%.*]] = bitcast i8** [[TMP30]] to %struct.S1**
// CHECK19-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP31]], align 4
// CHECK19-NEXT: [[TMP32:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS14]], i32 0, i32 0
// CHECK19-NEXT: [[TMP33:%.*]] = bitcast i8** [[TMP32]] to double**
// CHECK19-NEXT: store double* [[A12]], double** [[TMP33]], align 4
// CHECK19-NEXT: [[TMP34:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS15]], i32 0, i32 0
// CHECK19-NEXT: store i8* null, i8** [[TMP34]], align 4
// CHECK19-NEXT: [[TMP35:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS13]], i32 0, i32 1
// CHECK19-NEXT: [[TMP36:%.*]] = bitcast i8** [[TMP35]] to i32*
// CHECK19-NEXT: store i32 [[TMP28]], i32* [[TMP36]], align 4
// CHECK19-NEXT: [[TMP37:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS14]], i32 0, i32 1
// CHECK19-NEXT: [[TMP38:%.*]] = bitcast i8** [[TMP37]] to i32*
// CHECK19-NEXT: store i32 [[TMP28]], i32* [[TMP38]], align 4
// CHECK19-NEXT: [[TMP39:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS15]], i32 0, i32 1
// CHECK19-NEXT: store i8* null, i8** [[TMP39]], align 4
// CHECK19-NEXT: [[TMP40:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS13]], i32 0, i32 0
// CHECK19-NEXT: [[TMP41:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS14]], i32 0, i32 0
// CHECK19-NEXT: [[TMP42:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_4]], align 1
// CHECK19-NEXT: [[TOBOOL16:%.*]] = trunc i8 [[TMP42]] to i1
// CHECK19-NEXT: [[TMP43:%.*]] = select i1 [[TOBOOL16]], i32 0, i32 1
// CHECK19-NEXT: [[TMP44:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126.region_id, i32 2, i8** [[TMP40]], i8** [[TMP41]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.2, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.3, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP43]])
// CHECK19-NEXT: [[TMP45:%.*]] = icmp ne i32 [[TMP44]], 0
// CHECK19-NEXT: br i1 [[TMP45]], label [[OMP_OFFLOAD_FAILED17:%.*]], label [[OMP_OFFLOAD_CONT18:%.*]]
// CHECK19: omp_offload.failed17:
// CHECK19-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i32 [[TMP28]]) #[[ATTR3]]
// CHECK19-NEXT: br label [[OMP_OFFLOAD_CONT18]]
// CHECK19: omp_offload.cont18:
// CHECK19-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK19: omp_if.else:
// CHECK19-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i32 [[TMP28]]) #[[ATTR3]]
// CHECK19-NEXT: br label [[OMP_IF_END]]
// CHECK19: omp_if.end:
// CHECK19-NEXT: [[A19:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK19-NEXT: [[TMP46:%.*]] = load double, double* [[A19]], align 4
// CHECK19-NEXT: [[CONV20:%.*]] = fptosi double [[TMP46]] to i32
// CHECK19-NEXT: ret i32 [[CONV20]]
//
//
// CHECK19-LABEL: define {{[^@]+}}@_ZL7fstatici
// CHECK19-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK19-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK19-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK19-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 4
// CHECK19-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK19-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK19-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 1
// CHECK19-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK19-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK19-NEXT: [[TMP1:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK19-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK19-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK19-NEXT: [[FROMBOOL1:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK19-NEXT: store i8 [[FROMBOOL1]], i8* [[CONV]], align 1
// CHECK19-NEXT: [[TMP2:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR__CASTED]], align 4
// CHECK19-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK19-NEXT: [[TOBOOL2:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK19-NEXT: br i1 [[TOBOOL2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK19: omp_if.then:
// CHECK19-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK19-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i32*
// CHECK19-NEXT: store i32 [[TMP2]], i32* [[TMP5]], align 4
// CHECK19-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK19-NEXT: [[TMP7:%.*]] = bitcast i8** [[TMP6]] to i32*
// CHECK19-NEXT: store i32 [[TMP2]], i32* [[TMP7]], align 4
// CHECK19-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK19-NEXT: store i8* null, i8** [[TMP8]], align 4
// CHECK19-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK19-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK19-NEXT: [[TMP11:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK19-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP11]] to i1
// CHECK19-NEXT: [[TMP12:%.*]] = select i1 [[TOBOOL3]], i32 0, i32 1
// CHECK19-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104.region_id, i32 1, i8** [[TMP9]], i8** [[TMP10]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.5, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.6, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP12]])
// CHECK19-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
// CHECK19-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK19: omp_offload.failed:
// CHECK19-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i32 [[TMP2]]) #[[ATTR3]]
// CHECK19-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK19: omp_offload.cont:
// CHECK19-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK19: omp_if.else:
// CHECK19-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i32 [[TMP2]]) #[[ATTR3]]
// CHECK19-NEXT: br label [[OMP_IF_END]]
// CHECK19: omp_if.end:
// CHECK19-NEXT: [[TMP15:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK19-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP15]], 2
// CHECK19-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[SUB]], 2
// CHECK19-NEXT: br i1 [[CMP4]], label [[OMP_IF_THEN5:%.*]], label [[OMP_IF_ELSE8:%.*]]
// CHECK19: omp_if.then5:
// CHECK19-NEXT: [[TMP16:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108.region_id, i32 0, i8** null, i8** null, i64* null, i64* null, i8** null, i8** null, i32 1, i32 0)
// CHECK19-NEXT: [[TMP17:%.*]] = icmp ne i32 [[TMP16]], 0
// CHECK19-NEXT: br i1 [[TMP17]], label [[OMP_OFFLOAD_FAILED6:%.*]], label [[OMP_OFFLOAD_CONT7:%.*]]
// CHECK19: omp_offload.failed6:
// CHECK19-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK19-NEXT: br label [[OMP_OFFLOAD_CONT7]]
// CHECK19: omp_offload.cont7:
// CHECK19-NEXT: br label [[OMP_IF_END9:%.*]]
// CHECK19: omp_if.else8:
// CHECK19-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK19-NEXT: br label [[OMP_IF_END9]]
// CHECK19: omp_if.end9:
// CHECK19-NEXT: [[TMP18:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK19-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP18]], 1
// CHECK19-NEXT: ret i32 [[ADD]]
//
//
// CHECK19-LABEL: define {{[^@]+}}@_Z9ftemplateIiET_i
// CHECK19-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0]] comdat {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK19-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK19-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 4
// CHECK19-NEXT: [[B:%.*]] = alloca i16, align 2
// CHECK19-NEXT: [[A_CASTED1:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTOFFLOAD_BASEPTRS2:%.*]] = alloca [2 x i8*], align 4
// CHECK19-NEXT: [[DOTOFFLOAD_PTRS3:%.*]] = alloca [2 x i8*], align 4
// CHECK19-NEXT: [[DOTOFFLOAD_MAPPERS4:%.*]] = alloca [2 x i8*], align 4
// CHECK19-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK19-NEXT: store i32 0, i32* [[A]], align 4
// CHECK19-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4
// CHECK19-NEXT: store i32 [[TMP0]], i32* [[A_CASTED]], align 4
// CHECK19-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK19-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK19-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32*
// CHECK19-NEXT: store i32 [[TMP1]], i32* [[TMP3]], align 4
// CHECK19-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK19-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i32*
// CHECK19-NEXT: store i32 [[TMP1]], i32* [[TMP5]], align 4
// CHECK19-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK19-NEXT: store i8* null, i8** [[TMP6]], align 4
// CHECK19-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK19-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK19-NEXT: [[TMP9:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87.region_id, i32 1, i8** [[TMP7]], i8** [[TMP8]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.9, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.10, i32 0, i32 0), i8** null, i8** null, i32 1, i32 1)
// CHECK19-NEXT: [[TMP10:%.*]] = icmp ne i32 [[TMP9]], 0
// CHECK19-NEXT: br i1 [[TMP10]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK19: omp_offload.failed:
// CHECK19-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87(i32 [[TMP1]]) #[[ATTR3]]
// CHECK19-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK19: omp_offload.cont:
// CHECK19-NEXT: store i16 1, i16* [[B]], align 2
// CHECK19-NEXT: [[TMP11:%.*]] = load i32, i32* [[A]], align 4
// CHECK19-NEXT: store i32 [[TMP11]], i32* [[A_CASTED1]], align 4
// CHECK19-NEXT: [[TMP12:%.*]] = load i32, i32* [[A_CASTED1]], align 4
// CHECK19-NEXT: [[TMP13:%.*]] = load i16, i16* [[B]], align 2
// CHECK19-NEXT: [[CONV:%.*]] = bitcast i32* [[B_CASTED]] to i16*
// CHECK19-NEXT: store i16 [[TMP13]], i16* [[CONV]], align 2
// CHECK19-NEXT: [[TMP14:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK19-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS2]], i32 0, i32 0
// CHECK19-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i32*
// CHECK19-NEXT: store i32 [[TMP12]], i32* [[TMP16]], align 4
// CHECK19-NEXT: [[TMP17:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS3]], i32 0, i32 0
// CHECK19-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i32*
// CHECK19-NEXT: store i32 [[TMP12]], i32* [[TMP18]], align 4
// CHECK19-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS4]], i32 0, i32 0
// CHECK19-NEXT: store i8* null, i8** [[TMP19]], align 4
// CHECK19-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS2]], i32 0, i32 1
// CHECK19-NEXT: [[TMP21:%.*]] = bitcast i8** [[TMP20]] to i32*
// CHECK19-NEXT: store i32 [[TMP14]], i32* [[TMP21]], align 4
// CHECK19-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS3]], i32 0, i32 1
// CHECK19-NEXT: [[TMP23:%.*]] = bitcast i8** [[TMP22]] to i32*
// CHECK19-NEXT: store i32 [[TMP14]], i32* [[TMP23]], align 4
// CHECK19-NEXT: [[TMP24:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS4]], i32 0, i32 1
// CHECK19-NEXT: store i8* null, i8** [[TMP24]], align 4
// CHECK19-NEXT: [[TMP25:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS2]], i32 0, i32 0
// CHECK19-NEXT: [[TMP26:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS3]], i32 0, i32 0
// CHECK19-NEXT: [[TMP27:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93.region_id, i32 2, i8** [[TMP25]], i8** [[TMP26]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.12, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.13, i32 0, i32 0), i8** null, i8** null, i32 1, i32 0)
// CHECK19-NEXT: [[TMP28:%.*]] = icmp ne i32 [[TMP27]], 0
// CHECK19-NEXT: br i1 [[TMP28]], label [[OMP_OFFLOAD_FAILED5:%.*]], label [[OMP_OFFLOAD_CONT6:%.*]]
// CHECK19: omp_offload.failed5:
// CHECK19-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93(i32 [[TMP12]], i32 [[TMP14]]) #[[ATTR3]]
// CHECK19-NEXT: br label [[OMP_OFFLOAD_CONT6]]
// CHECK19: omp_offload.cont6:
// CHECK19-NEXT: [[TMP29:%.*]] = load i32, i32* [[A]], align 4
// CHECK19-NEXT: ret i32 [[TMP29]]
//
//
// CHECK19-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK19-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK19-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK19-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK19-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK19-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK19-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK19-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK19-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK19-NEXT: store i32 [[TMP2]], i32* [[B_CASTED]], align 4
// CHECK19-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK19-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK19-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK19-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK19: omp_if.then:
// CHECK19-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i32)* @.omp_outlined. to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i32 [[TMP3]])
// CHECK19-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK19: omp_if.else:
// CHECK19-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK19-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK19-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK19-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i32 [[TMP3]]) #[[ATTR3]]
// CHECK19-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK19-NEXT: br label [[OMP_IF_END]]
// CHECK19: omp_if.end:
// CHECK19-NEXT: ret void
//
//
// CHECK19-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK19-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]]) #[[ATTR2:[0-9]+]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK19-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK19-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK19-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK19-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK19-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK19-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK19-NEXT: [[TMP1:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK19-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK19-NEXT: [[ADD:%.*]] = fadd double [[CONV]], 1.500000e+00
// CHECK19-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK19-NEXT: store double [[ADD]], double* [[A]], align 4
// CHECK19-NEXT: ret void
//
//
// CHECK19-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK19-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK19-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK19-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK19-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK19-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK19-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK19-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK19-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK19-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK19: omp_if.then:
// CHECK19-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..1 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK19-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK19: omp_if.else:
// CHECK19-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK19-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK19-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK19-NEXT: call void @.omp_outlined..1(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR3]]
// CHECK19-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK19-NEXT: br label [[OMP_IF_END]]
// CHECK19: omp_if.end:
// CHECK19-NEXT: ret void
//
//
// CHECK19-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK19-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR2]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK19-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK19-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK19-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK19-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK19-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK19-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK19-NEXT: store double 2.500000e+00, double* [[A]], align 4
// CHECK19-NEXT: ret void
//
//
// CHECK19-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK19-SAME: (i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK19-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK19-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK19-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK19-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK19-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK19: omp_if.then:
// CHECK19-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..4 to void (i32*, i32*, ...)*))
// CHECK19-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK19: omp_if.else:
// CHECK19-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK19-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK19-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK19-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR3]]
// CHECK19-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK19-NEXT: br label [[OMP_IF_END]]
// CHECK19: omp_if.end:
// CHECK19-NEXT: ret void
//
//
// CHECK19-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK19-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK19-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK19-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK19-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK19-NEXT: ret void
//
//
// CHECK19-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK19-SAME: () #[[ATTR1]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..7 to void (i32*, i32*, ...)*))
// CHECK19-NEXT: ret void
//
//
// CHECK19-LABEL: define {{[^@]+}}@.omp_outlined..7
// CHECK19-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK19-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK19-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK19-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK19-NEXT: ret void
//
//
// CHECK19-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK19-SAME: (i32 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK19-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK19-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK19-NEXT: store i32 [[TMP1]], i32* [[A_CASTED]], align 4
// CHECK19-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK19-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK19-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK19-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK19-NEXT: call void @.omp_outlined..8(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i32 [[TMP2]]) #[[ATTR3]]
// CHECK19-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK19-NEXT: ret void
//
//
// CHECK19-LABEL: define {{[^@]+}}@.omp_outlined..8
// CHECK19-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]]) #[[ATTR2]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK19-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK19-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK19-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK19-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK19-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK19-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK19-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK19-NEXT: ret void
//
//
// CHECK19-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK19-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK19-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK19-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK19-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK19-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK19-NEXT: store i32 [[TMP0]], i32* [[A_CASTED]], align 4
// CHECK19-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK19-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK19-NEXT: [[CONV1:%.*]] = bitcast i32* [[B_CASTED]] to i16*
// CHECK19-NEXT: store i16 [[TMP2]], i16* [[CONV1]], align 2
// CHECK19-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK19-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32, i32)* @.omp_outlined..11 to void (i32*, i32*, ...)*), i32 [[TMP1]], i32 [[TMP3]])
// CHECK19-NEXT: ret void
//
//
// CHECK19-LABEL: define {{[^@]+}}@.omp_outlined..11
// CHECK19-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR2]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK19-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK19-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK19-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK19-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK19-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK19-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK19-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK19-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK19-NEXT: [[CONV1:%.*]] = sext i16 [[TMP0]] to i32
// CHECK19-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK19-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV1]]
// CHECK19-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK19-NEXT: ret void
//
//
// CHECK19-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
// CHECK19-SAME: () #[[ATTR4:[0-9]+]] {
// CHECK19-NEXT: entry:
// CHECK19-NEXT: call void @__tgt_register_requires(i64 1)
// CHECK19-NEXT: ret void
//
//
// CHECK20-LABEL: define {{[^@]+}}@_Z3bari
// CHECK20-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[S:%.*]] = alloca [[STRUCT_S1:%.*]], align 4
// CHECK20-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK20-NEXT: store i32 0, i32* [[A]], align 4
// CHECK20-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK20-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN2S12r1Ei(%struct.S1* noundef [[S]], i32 noundef [[TMP0]])
// CHECK20-NEXT: [[TMP1:%.*]] = load i32, i32* [[A]], align 4
// CHECK20-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CALL]]
// CHECK20-NEXT: store i32 [[ADD]], i32* [[A]], align 4
// CHECK20-NEXT: [[TMP2:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK20-NEXT: [[CALL1:%.*]] = call noundef i32 @_ZL7fstatici(i32 noundef [[TMP2]])
// CHECK20-NEXT: [[TMP3:%.*]] = load i32, i32* [[A]], align 4
// CHECK20-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP3]], [[CALL1]]
// CHECK20-NEXT: store i32 [[ADD2]], i32* [[A]], align 4
// CHECK20-NEXT: [[TMP4:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK20-NEXT: [[CALL3:%.*]] = call noundef i32 @_Z9ftemplateIiET_i(i32 noundef [[TMP4]])
// CHECK20-NEXT: [[TMP5:%.*]] = load i32, i32* [[A]], align 4
// CHECK20-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP5]], [[CALL3]]
// CHECK20-NEXT: store i32 [[ADD4]], i32* [[A]], align 4
// CHECK20-NEXT: [[TMP6:%.*]] = load i32, i32* [[A]], align 4
// CHECK20-NEXT: ret i32 [[TMP6]]
//
//
// CHECK20-LABEL: define {{[^@]+}}@_ZN2S12r1Ei
// CHECK20-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[N:%.*]]) #[[ATTR0]] comdat align 2 {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK20-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[B:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK20-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x i8*], align 4
// CHECK20-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x i8*], align 4
// CHECK20-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x i8*], align 4
// CHECK20-NEXT: [[DOTCAPTURE_EXPR_4:%.*]] = alloca i8, align 1
// CHECK20-NEXT: [[DOTCAPTURE_EXPR__CASTED8:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTOFFLOAD_BASEPTRS13:%.*]] = alloca [2 x i8*], align 4
// CHECK20-NEXT: [[DOTOFFLOAD_PTRS14:%.*]] = alloca [2 x i8*], align 4
// CHECK20-NEXT: [[DOTOFFLOAD_MAPPERS15:%.*]] = alloca [2 x i8*], align 4
// CHECK20-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK20-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK20-NEXT: [[THIS1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK20-NEXT: store i32 1, i32* [[B]], align 4
// CHECK20-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK20-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 3
// CHECK20-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK20-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK20-NEXT: [[TMP1:%.*]] = load i32, i32* [[B]], align 4
// CHECK20-NEXT: store i32 [[TMP1]], i32* [[B_CASTED]], align 4
// CHECK20-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK20-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK20-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK20-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK20-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK20-NEXT: store i8 [[FROMBOOL2]], i8* [[CONV]], align 1
// CHECK20-NEXT: [[TMP4:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR__CASTED]], align 4
// CHECK20-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK20-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK20-NEXT: [[TMP6:%.*]] = bitcast i8** [[TMP5]] to %struct.S1**
// CHECK20-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP6]], align 4
// CHECK20-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK20-NEXT: [[TMP8:%.*]] = bitcast i8** [[TMP7]] to double**
// CHECK20-NEXT: store double* [[A]], double** [[TMP8]], align 4
// CHECK20-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK20-NEXT: store i8* null, i8** [[TMP9]], align 4
// CHECK20-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
// CHECK20-NEXT: [[TMP11:%.*]] = bitcast i8** [[TMP10]] to i32*
// CHECK20-NEXT: store i32 [[TMP2]], i32* [[TMP11]], align 4
// CHECK20-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 1
// CHECK20-NEXT: [[TMP13:%.*]] = bitcast i8** [[TMP12]] to i32*
// CHECK20-NEXT: store i32 [[TMP2]], i32* [[TMP13]], align 4
// CHECK20-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
// CHECK20-NEXT: store i8* null, i8** [[TMP14]], align 4
// CHECK20-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
// CHECK20-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i32*
// CHECK20-NEXT: store i32 [[TMP4]], i32* [[TMP16]], align 4
// CHECK20-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 2
// CHECK20-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i32*
// CHECK20-NEXT: store i32 [[TMP4]], i32* [[TMP18]], align 4
// CHECK20-NEXT: [[TMP19:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
// CHECK20-NEXT: store i8* null, i8** [[TMP19]], align 4
// CHECK20-NEXT: [[TMP20:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK20-NEXT: [[TMP21:%.*]] = getelementptr inbounds [3 x i8*], [3 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK20-NEXT: [[TMP22:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK20-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP22]] to i1
// CHECK20-NEXT: [[TMP23:%.*]] = select i1 [[TOBOOL3]], i32 0, i32 1
// CHECK20-NEXT: [[TMP24:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1:[0-9]+]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121.region_id, i32 3, i8** [[TMP20]], i8** [[TMP21]], i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_sizes, i32 0, i32 0), i64* getelementptr inbounds ([3 x i64], [3 x i64]* @.offload_maptypes, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP23]])
// CHECK20-NEXT: [[TMP25:%.*]] = icmp ne i32 [[TMP24]], 0
// CHECK20-NEXT: br i1 [[TMP25]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK20: omp_offload.failed:
// CHECK20-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121(%struct.S1* [[THIS1]], i32 [[TMP2]], i32 [[TMP4]]) #[[ATTR3:[0-9]+]]
// CHECK20-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK20: omp_offload.cont:
// CHECK20-NEXT: [[TMP26:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK20-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP26]], 5
// CHECK20-NEXT: [[FROMBOOL6:%.*]] = zext i1 [[CMP5]] to i8
// CHECK20-NEXT: store i8 [[FROMBOOL6]], i8* [[DOTCAPTURE_EXPR_4]], align 1
// CHECK20-NEXT: [[TMP27:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_4]], align 1
// CHECK20-NEXT: [[TOBOOL7:%.*]] = trunc i8 [[TMP27]] to i1
// CHECK20-NEXT: [[CONV9:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__CASTED8]] to i8*
// CHECK20-NEXT: [[FROMBOOL10:%.*]] = zext i1 [[TOBOOL7]] to i8
// CHECK20-NEXT: store i8 [[FROMBOOL10]], i8* [[CONV9]], align 1
// CHECK20-NEXT: [[TMP28:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR__CASTED8]], align 4
// CHECK20-NEXT: [[TMP29:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK20-NEXT: [[CMP11:%.*]] = icmp sgt i32 [[TMP29]], 4
// CHECK20-NEXT: br i1 [[CMP11]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK20: omp_if.then:
// CHECK20-NEXT: [[A12:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK20-NEXT: [[TMP30:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS13]], i32 0, i32 0
// CHECK20-NEXT: [[TMP31:%.*]] = bitcast i8** [[TMP30]] to %struct.S1**
// CHECK20-NEXT: store %struct.S1* [[THIS1]], %struct.S1** [[TMP31]], align 4
// CHECK20-NEXT: [[TMP32:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS14]], i32 0, i32 0
// CHECK20-NEXT: [[TMP33:%.*]] = bitcast i8** [[TMP32]] to double**
// CHECK20-NEXT: store double* [[A12]], double** [[TMP33]], align 4
// CHECK20-NEXT: [[TMP34:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS15]], i32 0, i32 0
// CHECK20-NEXT: store i8* null, i8** [[TMP34]], align 4
// CHECK20-NEXT: [[TMP35:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS13]], i32 0, i32 1
// CHECK20-NEXT: [[TMP36:%.*]] = bitcast i8** [[TMP35]] to i32*
// CHECK20-NEXT: store i32 [[TMP28]], i32* [[TMP36]], align 4
// CHECK20-NEXT: [[TMP37:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS14]], i32 0, i32 1
// CHECK20-NEXT: [[TMP38:%.*]] = bitcast i8** [[TMP37]] to i32*
// CHECK20-NEXT: store i32 [[TMP28]], i32* [[TMP38]], align 4
// CHECK20-NEXT: [[TMP39:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS15]], i32 0, i32 1
// CHECK20-NEXT: store i8* null, i8** [[TMP39]], align 4
// CHECK20-NEXT: [[TMP40:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS13]], i32 0, i32 0
// CHECK20-NEXT: [[TMP41:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS14]], i32 0, i32 0
// CHECK20-NEXT: [[TMP42:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_4]], align 1
// CHECK20-NEXT: [[TOBOOL16:%.*]] = trunc i8 [[TMP42]] to i1
// CHECK20-NEXT: [[TMP43:%.*]] = select i1 [[TOBOOL16]], i32 0, i32 1
// CHECK20-NEXT: [[TMP44:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126.region_id, i32 2, i8** [[TMP40]], i8** [[TMP41]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.2, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.3, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP43]])
// CHECK20-NEXT: [[TMP45:%.*]] = icmp ne i32 [[TMP44]], 0
// CHECK20-NEXT: br i1 [[TMP45]], label [[OMP_OFFLOAD_FAILED17:%.*]], label [[OMP_OFFLOAD_CONT18:%.*]]
// CHECK20: omp_offload.failed17:
// CHECK20-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i32 [[TMP28]]) #[[ATTR3]]
// CHECK20-NEXT: br label [[OMP_OFFLOAD_CONT18]]
// CHECK20: omp_offload.cont18:
// CHECK20-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK20: omp_if.else:
// CHECK20-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126(%struct.S1* [[THIS1]], i32 [[TMP28]]) #[[ATTR3]]
// CHECK20-NEXT: br label [[OMP_IF_END]]
// CHECK20: omp_if.end:
// CHECK20-NEXT: [[A19:%.*]] = getelementptr inbounds [[STRUCT_S1]], %struct.S1* [[THIS1]], i32 0, i32 0
// CHECK20-NEXT: [[TMP46:%.*]] = load double, double* [[A19]], align 4
// CHECK20-NEXT: [[CONV20:%.*]] = fptosi double [[TMP46]] to i32
// CHECK20-NEXT: ret i32 [[CONV20]]
//
//
// CHECK20-LABEL: define {{[^@]+}}@_ZL7fstatici
// CHECK20-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
// CHECK20-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK20-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK20-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 4
// CHECK20-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK20-NEXT: [[TMP0:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK20-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP0]], 1
// CHECK20-NEXT: [[FROMBOOL:%.*]] = zext i1 [[CMP]] to i8
// CHECK20-NEXT: store i8 [[FROMBOOL]], i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK20-NEXT: [[TMP1:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK20-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK20-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__CASTED]] to i8*
// CHECK20-NEXT: [[FROMBOOL1:%.*]] = zext i1 [[TOBOOL]] to i8
// CHECK20-NEXT: store i8 [[FROMBOOL1]], i8* [[CONV]], align 1
// CHECK20-NEXT: [[TMP2:%.*]] = load i32, i32* [[DOTCAPTURE_EXPR__CASTED]], align 4
// CHECK20-NEXT: [[TMP3:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK20-NEXT: [[TOBOOL2:%.*]] = trunc i8 [[TMP3]] to i1
// CHECK20-NEXT: br i1 [[TOBOOL2]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK20: omp_if.then:
// CHECK20-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK20-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i32*
// CHECK20-NEXT: store i32 [[TMP2]], i32* [[TMP5]], align 4
// CHECK20-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK20-NEXT: [[TMP7:%.*]] = bitcast i8** [[TMP6]] to i32*
// CHECK20-NEXT: store i32 [[TMP2]], i32* [[TMP7]], align 4
// CHECK20-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK20-NEXT: store i8* null, i8** [[TMP8]], align 4
// CHECK20-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK20-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK20-NEXT: [[TMP11:%.*]] = load i8, i8* [[DOTCAPTURE_EXPR_]], align 1
// CHECK20-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP11]] to i1
// CHECK20-NEXT: [[TMP12:%.*]] = select i1 [[TOBOOL3]], i32 0, i32 1
// CHECK20-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104.region_id, i32 1, i8** [[TMP9]], i8** [[TMP10]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.5, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.6, i32 0, i32 0), i8** null, i8** null, i32 1, i32 [[TMP12]])
// CHECK20-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
// CHECK20-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK20: omp_offload.failed:
// CHECK20-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i32 [[TMP2]]) #[[ATTR3]]
// CHECK20-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK20: omp_offload.cont:
// CHECK20-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK20: omp_if.else:
// CHECK20-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104(i32 [[TMP2]]) #[[ATTR3]]
// CHECK20-NEXT: br label [[OMP_IF_END]]
// CHECK20: omp_if.end:
// CHECK20-NEXT: [[TMP15:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK20-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP15]], 2
// CHECK20-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[SUB]], 2
// CHECK20-NEXT: br i1 [[CMP4]], label [[OMP_IF_THEN5:%.*]], label [[OMP_IF_ELSE8:%.*]]
// CHECK20: omp_if.then5:
// CHECK20-NEXT: [[TMP16:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108.region_id, i32 0, i8** null, i8** null, i64* null, i64* null, i8** null, i8** null, i32 1, i32 0)
// CHECK20-NEXT: [[TMP17:%.*]] = icmp ne i32 [[TMP16]], 0
// CHECK20-NEXT: br i1 [[TMP17]], label [[OMP_OFFLOAD_FAILED6:%.*]], label [[OMP_OFFLOAD_CONT7:%.*]]
// CHECK20: omp_offload.failed6:
// CHECK20-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK20-NEXT: br label [[OMP_OFFLOAD_CONT7]]
// CHECK20: omp_offload.cont7:
// CHECK20-NEXT: br label [[OMP_IF_END9:%.*]]
// CHECK20: omp_if.else8:
// CHECK20-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108() #[[ATTR3]]
// CHECK20-NEXT: br label [[OMP_IF_END9]]
// CHECK20: omp_if.end9:
// CHECK20-NEXT: [[TMP18:%.*]] = load i32, i32* [[N_ADDR]], align 4
// CHECK20-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP18]], 1
// CHECK20-NEXT: ret i32 [[ADD]]
//
//
// CHECK20-LABEL: define {{[^@]+}}@_Z9ftemplateIiET_i
// CHECK20-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0]] comdat {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[A:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK20-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x i8*], align 4
// CHECK20-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x i8*], align 4
// CHECK20-NEXT: [[B:%.*]] = alloca i16, align 2
// CHECK20-NEXT: [[A_CASTED1:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTOFFLOAD_BASEPTRS2:%.*]] = alloca [2 x i8*], align 4
// CHECK20-NEXT: [[DOTOFFLOAD_PTRS3:%.*]] = alloca [2 x i8*], align 4
// CHECK20-NEXT: [[DOTOFFLOAD_MAPPERS4:%.*]] = alloca [2 x i8*], align 4
// CHECK20-NEXT: store i32 [[N]], i32* [[N_ADDR]], align 4
// CHECK20-NEXT: store i32 0, i32* [[A]], align 4
// CHECK20-NEXT: [[TMP0:%.*]] = load i32, i32* [[A]], align 4
// CHECK20-NEXT: store i32 [[TMP0]], i32* [[A_CASTED]], align 4
// CHECK20-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK20-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK20-NEXT: [[TMP3:%.*]] = bitcast i8** [[TMP2]] to i32*
// CHECK20-NEXT: store i32 [[TMP1]], i32* [[TMP3]], align 4
// CHECK20-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK20-NEXT: [[TMP5:%.*]] = bitcast i8** [[TMP4]] to i32*
// CHECK20-NEXT: store i32 [[TMP1]], i32* [[TMP5]], align 4
// CHECK20-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
// CHECK20-NEXT: store i8* null, i8** [[TMP6]], align 4
// CHECK20-NEXT: [[TMP7:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
// CHECK20-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x i8*], [1 x i8*]* [[DOTOFFLOAD_PTRS]], i32 0, i32 0
// CHECK20-NEXT: [[TMP9:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87.region_id, i32 1, i8** [[TMP7]], i8** [[TMP8]], i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_sizes.9, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @.offload_maptypes.10, i32 0, i32 0), i8** null, i8** null, i32 1, i32 1)
// CHECK20-NEXT: [[TMP10:%.*]] = icmp ne i32 [[TMP9]], 0
// CHECK20-NEXT: br i1 [[TMP10]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
// CHECK20: omp_offload.failed:
// CHECK20-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87(i32 [[TMP1]]) #[[ATTR3]]
// CHECK20-NEXT: br label [[OMP_OFFLOAD_CONT]]
// CHECK20: omp_offload.cont:
// CHECK20-NEXT: store i16 1, i16* [[B]], align 2
// CHECK20-NEXT: [[TMP11:%.*]] = load i32, i32* [[A]], align 4
// CHECK20-NEXT: store i32 [[TMP11]], i32* [[A_CASTED1]], align 4
// CHECK20-NEXT: [[TMP12:%.*]] = load i32, i32* [[A_CASTED1]], align 4
// CHECK20-NEXT: [[TMP13:%.*]] = load i16, i16* [[B]], align 2
// CHECK20-NEXT: [[CONV:%.*]] = bitcast i32* [[B_CASTED]] to i16*
// CHECK20-NEXT: store i16 [[TMP13]], i16* [[CONV]], align 2
// CHECK20-NEXT: [[TMP14:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK20-NEXT: [[TMP15:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS2]], i32 0, i32 0
// CHECK20-NEXT: [[TMP16:%.*]] = bitcast i8** [[TMP15]] to i32*
// CHECK20-NEXT: store i32 [[TMP12]], i32* [[TMP16]], align 4
// CHECK20-NEXT: [[TMP17:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS3]], i32 0, i32 0
// CHECK20-NEXT: [[TMP18:%.*]] = bitcast i8** [[TMP17]] to i32*
// CHECK20-NEXT: store i32 [[TMP12]], i32* [[TMP18]], align 4
// CHECK20-NEXT: [[TMP19:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS4]], i32 0, i32 0
// CHECK20-NEXT: store i8* null, i8** [[TMP19]], align 4
// CHECK20-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS2]], i32 0, i32 1
// CHECK20-NEXT: [[TMP21:%.*]] = bitcast i8** [[TMP20]] to i32*
// CHECK20-NEXT: store i32 [[TMP14]], i32* [[TMP21]], align 4
// CHECK20-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS3]], i32 0, i32 1
// CHECK20-NEXT: [[TMP23:%.*]] = bitcast i8** [[TMP22]] to i32*
// CHECK20-NEXT: store i32 [[TMP14]], i32* [[TMP23]], align 4
// CHECK20-NEXT: [[TMP24:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_MAPPERS4]], i32 0, i32 1
// CHECK20-NEXT: store i8* null, i8** [[TMP24]], align 4
// CHECK20-NEXT: [[TMP25:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_BASEPTRS2]], i32 0, i32 0
// CHECK20-NEXT: [[TMP26:%.*]] = getelementptr inbounds [2 x i8*], [2 x i8*]* [[DOTOFFLOAD_PTRS3]], i32 0, i32 0
// CHECK20-NEXT: [[TMP27:%.*]] = call i32 @__tgt_target_teams_mapper(%struct.ident_t* @[[GLOB1]], i64 -1, i8* @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93.region_id, i32 2, i8** [[TMP25]], i8** [[TMP26]], i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_sizes.12, i32 0, i32 0), i64* getelementptr inbounds ([2 x i64], [2 x i64]* @.offload_maptypes.13, i32 0, i32 0), i8** null, i8** null, i32 1, i32 0)
// CHECK20-NEXT: [[TMP28:%.*]] = icmp ne i32 [[TMP27]], 0
// CHECK20-NEXT: br i1 [[TMP28]], label [[OMP_OFFLOAD_FAILED5:%.*]], label [[OMP_OFFLOAD_CONT6:%.*]]
// CHECK20: omp_offload.failed5:
// CHECK20-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93(i32 [[TMP12]], i32 [[TMP14]]) #[[ATTR3]]
// CHECK20-NEXT: br label [[OMP_OFFLOAD_CONT6]]
// CHECK20: omp_offload.cont6:
// CHECK20-NEXT: [[TMP29:%.*]] = load i32, i32* [[A]], align 4
// CHECK20-NEXT: ret i32 [[TMP29]]
//
//
// CHECK20-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK20-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK20-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK20-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK20-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK20-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK20-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK20-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK20-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK20-NEXT: store i32 [[TMP2]], i32* [[B_CASTED]], align 4
// CHECK20-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK20-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK20-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK20-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK20: omp_if.then:
// CHECK20-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i32)* @.omp_outlined. to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i32 [[TMP3]])
// CHECK20-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK20: omp_if.else:
// CHECK20-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK20-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK20-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK20-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i32 [[TMP3]]) #[[ATTR3]]
// CHECK20-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK20-NEXT: br label [[OMP_IF_END]]
// CHECK20: omp_if.end:
// CHECK20-NEXT: ret void
//
//
// CHECK20-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK20-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]]) #[[ATTR2:[0-9]+]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK20-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK20-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK20-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK20-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK20-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK20-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK20-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK20-NEXT: [[TMP1:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK20-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK20-NEXT: [[ADD:%.*]] = fadd double [[CONV]], 1.500000e+00
// CHECK20-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK20-NEXT: store double [[ADD]], double* [[A]], align 4
// CHECK20-NEXT: ret void
//
//
// CHECK20-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK20-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK20-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK20-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK20-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK20-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK20-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK20-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK20-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK20-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK20: omp_if.then:
// CHECK20-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..1 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK20-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK20: omp_if.else:
// CHECK20-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK20-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK20-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK20-NEXT: call void @.omp_outlined..1(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR3]]
// CHECK20-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK20-NEXT: br label [[OMP_IF_END]]
// CHECK20: omp_if.end:
// CHECK20-NEXT: ret void
//
//
// CHECK20-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK20-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR2]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK20-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK20-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK20-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK20-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK20-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK20-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK20-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK20-NEXT: store double 2.500000e+00, double* [[A]], align 4
// CHECK20-NEXT: ret void
//
//
// CHECK20-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK20-SAME: (i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK20-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK20-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK20-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK20-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK20-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK20: omp_if.then:
// CHECK20-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..4 to void (i32*, i32*, ...)*))
// CHECK20-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK20: omp_if.else:
// CHECK20-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK20-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK20-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK20-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR3]]
// CHECK20-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK20-NEXT: br label [[OMP_IF_END]]
// CHECK20: omp_if.end:
// CHECK20-NEXT: ret void
//
//
// CHECK20-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK20-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK20-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK20-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK20-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK20-NEXT: ret void
//
//
// CHECK20-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK20-SAME: () #[[ATTR1]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..7 to void (i32*, i32*, ...)*))
// CHECK20-NEXT: ret void
//
//
// CHECK20-LABEL: define {{[^@]+}}@.omp_outlined..7
// CHECK20-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK20-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK20-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK20-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK20-NEXT: ret void
//
//
// CHECK20-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK20-SAME: (i32 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK20-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK20-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK20-NEXT: store i32 [[TMP1]], i32* [[A_CASTED]], align 4
// CHECK20-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK20-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK20-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK20-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK20-NEXT: call void @.omp_outlined..8(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i32 [[TMP2]]) #[[ATTR3]]
// CHECK20-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK20-NEXT: ret void
//
//
// CHECK20-LABEL: define {{[^@]+}}@.omp_outlined..8
// CHECK20-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]]) #[[ATTR2]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK20-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK20-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK20-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK20-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK20-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK20-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK20-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK20-NEXT: ret void
//
//
// CHECK20-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK20-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK20-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK20-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK20-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK20-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK20-NEXT: store i32 [[TMP0]], i32* [[A_CASTED]], align 4
// CHECK20-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK20-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK20-NEXT: [[CONV1:%.*]] = bitcast i32* [[B_CASTED]] to i16*
// CHECK20-NEXT: store i16 [[TMP2]], i16* [[CONV1]], align 2
// CHECK20-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK20-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32, i32)* @.omp_outlined..11 to void (i32*, i32*, ...)*), i32 [[TMP1]], i32 [[TMP3]])
// CHECK20-NEXT: ret void
//
//
// CHECK20-LABEL: define {{[^@]+}}@.omp_outlined..11
// CHECK20-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR2]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK20-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK20-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK20-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK20-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK20-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK20-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK20-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK20-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK20-NEXT: [[CONV1:%.*]] = sext i16 [[TMP0]] to i32
// CHECK20-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK20-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV1]]
// CHECK20-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK20-NEXT: ret void
//
//
// CHECK20-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
// CHECK20-SAME: () #[[ATTR4:[0-9]+]] {
// CHECK20-NEXT: entry:
// CHECK20-NEXT: call void @__tgt_register_requires(i64 1)
// CHECK20-NEXT: ret void
//
//
// CHECK25-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK25-SAME: (i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK25-NEXT: entry:
// CHECK25-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK25-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK25-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK25-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1:[0-9]+]])
// CHECK25-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK25-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK25-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK25-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK25-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK25: omp_if.then:
// CHECK25-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*))
// CHECK25-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK25: omp_if.else:
// CHECK25-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK25-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK25-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK25-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR2:[0-9]+]]
// CHECK25-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK25-NEXT: br label [[OMP_IF_END]]
// CHECK25: omp_if.end:
// CHECK25-NEXT: ret void
//
//
// CHECK25-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK25-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK25-NEXT: entry:
// CHECK25-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK25-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK25-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK25-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK25-NEXT: ret void
//
//
// CHECK25-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK25-SAME: () #[[ATTR0]] {
// CHECK25-NEXT: entry:
// CHECK25-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*))
// CHECK25-NEXT: ret void
//
//
// CHECK25-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK25-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
// CHECK25-NEXT: entry:
// CHECK25-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK25-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK25-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK25-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK25-NEXT: ret void
//
//
// CHECK25-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK25-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK25-NEXT: entry:
// CHECK25-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK25-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK25-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK25-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK25-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK25-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK25-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK25-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK25-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK25-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK25-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK25-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK25-NEXT: [[CONV1:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK25-NEXT: [[TMP2:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK25-NEXT: [[CONV2:%.*]] = bitcast i64* [[B_CASTED]] to i32*
// CHECK25-NEXT: store i32 [[TMP2]], i32* [[CONV2]], align 4
// CHECK25-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK25-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV1]], align 1
// CHECK25-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK25-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK25: omp_if.then:
// CHECK25-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i64)* @.omp_outlined..2 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i64 [[TMP3]])
// CHECK25-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK25: omp_if.else:
// CHECK25-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK25-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK25-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK25-NEXT: call void @.omp_outlined..2(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i64 [[TMP3]]) #[[ATTR2]]
// CHECK25-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK25-NEXT: br label [[OMP_IF_END]]
// CHECK25: omp_if.end:
// CHECK25-NEXT: ret void
//
//
// CHECK25-LABEL: define {{[^@]+}}@.omp_outlined..2
// CHECK25-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK25-NEXT: entry:
// CHECK25-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK25-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK25-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK25-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK25-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK25-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK25-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK25-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK25-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK25-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK25-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK25-NEXT: [[CONV1:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK25-NEXT: [[ADD:%.*]] = fadd double [[CONV1]], 1.500000e+00
// CHECK25-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK25-NEXT: store double [[ADD]], double* [[A]], align 8
// CHECK25-NEXT: ret void
//
//
// CHECK25-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK25-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK25-NEXT: entry:
// CHECK25-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK25-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK25-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK25-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK25-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK25-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK25-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK25-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK25-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK25-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK25-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK25-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK25: omp_if.then:
// CHECK25-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..3 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK25-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK25: omp_if.else:
// CHECK25-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK25-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK25-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK25-NEXT: call void @.omp_outlined..3(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR2]]
// CHECK25-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK25-NEXT: br label [[OMP_IF_END]]
// CHECK25: omp_if.end:
// CHECK25-NEXT: ret void
//
//
// CHECK25-LABEL: define {{[^@]+}}@.omp_outlined..3
// CHECK25-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR1]] {
// CHECK25-NEXT: entry:
// CHECK25-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK25-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK25-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK25-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK25-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK25-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK25-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK25-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK25-NEXT: store double 2.500000e+00, double* [[A]], align 8
// CHECK25-NEXT: ret void
//
//
// CHECK25-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK25-SAME: (i64 noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK25-NEXT: entry:
// CHECK25-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK25-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK25-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK25-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK25-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK25-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK25-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK25-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK25-NEXT: [[CONV1:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK25-NEXT: store i32 [[TMP1]], i32* [[CONV1]], align 4
// CHECK25-NEXT: [[TMP2:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK25-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK25-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK25-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK25-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i64 [[TMP2]]) #[[ATTR2]]
// CHECK25-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK25-NEXT: ret void
//
//
// CHECK25-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK25-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK25-NEXT: entry:
// CHECK25-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK25-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK25-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK25-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK25-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK25-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK25-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK25-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK25-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK25-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK25-NEXT: ret void
//
//
// CHECK25-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK25-SAME: (i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR0]] {
// CHECK25-NEXT: entry:
// CHECK25-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK25-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK25-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK25-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK25-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK25-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK25-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK25-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK25-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK25-NEXT: [[CONV2:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK25-NEXT: store i32 [[TMP0]], i32* [[CONV2]], align 4
// CHECK25-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK25-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK25-NEXT: [[CONV3:%.*]] = bitcast i64* [[B_CASTED]] to i16*
// CHECK25-NEXT: store i16 [[TMP2]], i16* [[CONV3]], align 2
// CHECK25-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK25-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64)* @.omp_outlined..5 to void (i32*, i32*, ...)*), i64 [[TMP1]], i64 [[TMP3]])
// CHECK25-NEXT: ret void
//
//
// CHECK25-LABEL: define {{[^@]+}}@.omp_outlined..5
// CHECK25-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK25-NEXT: entry:
// CHECK25-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK25-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK25-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK25-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK25-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK25-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK25-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK25-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK25-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK25-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK25-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK25-NEXT: [[CONV2:%.*]] = sext i16 [[TMP0]] to i32
// CHECK25-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK25-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV2]]
// CHECK25-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK25-NEXT: ret void
//
//
// CHECK26-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK26-SAME: (i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK26-NEXT: entry:
// CHECK26-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK26-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK26-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK26-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1:[0-9]+]])
// CHECK26-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK26-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK26-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK26-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK26-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK26: omp_if.then:
// CHECK26-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*))
// CHECK26-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK26: omp_if.else:
// CHECK26-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK26-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK26-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK26-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR2:[0-9]+]]
// CHECK26-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK26-NEXT: br label [[OMP_IF_END]]
// CHECK26: omp_if.end:
// CHECK26-NEXT: ret void
//
//
// CHECK26-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK26-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK26-NEXT: entry:
// CHECK26-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK26-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK26-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK26-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK26-NEXT: ret void
//
//
// CHECK26-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK26-SAME: () #[[ATTR0]] {
// CHECK26-NEXT: entry:
// CHECK26-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*))
// CHECK26-NEXT: ret void
//
//
// CHECK26-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK26-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
// CHECK26-NEXT: entry:
// CHECK26-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK26-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK26-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK26-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK26-NEXT: ret void
//
//
// CHECK26-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK26-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK26-NEXT: entry:
// CHECK26-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK26-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK26-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK26-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK26-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK26-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK26-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK26-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK26-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK26-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK26-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK26-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK26-NEXT: [[CONV1:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK26-NEXT: [[TMP2:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK26-NEXT: [[CONV2:%.*]] = bitcast i64* [[B_CASTED]] to i32*
// CHECK26-NEXT: store i32 [[TMP2]], i32* [[CONV2]], align 4
// CHECK26-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK26-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV1]], align 1
// CHECK26-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK26-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK26: omp_if.then:
// CHECK26-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i64)* @.omp_outlined..2 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i64 [[TMP3]])
// CHECK26-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK26: omp_if.else:
// CHECK26-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK26-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK26-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK26-NEXT: call void @.omp_outlined..2(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i64 [[TMP3]]) #[[ATTR2]]
// CHECK26-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK26-NEXT: br label [[OMP_IF_END]]
// CHECK26: omp_if.end:
// CHECK26-NEXT: ret void
//
//
// CHECK26-LABEL: define {{[^@]+}}@.omp_outlined..2
// CHECK26-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i64 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK26-NEXT: entry:
// CHECK26-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK26-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK26-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK26-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK26-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK26-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK26-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK26-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK26-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK26-NEXT: [[CONV:%.*]] = bitcast i64* [[B_ADDR]] to i32*
// CHECK26-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK26-NEXT: [[CONV1:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK26-NEXT: [[ADD:%.*]] = fadd double [[CONV1]], 1.500000e+00
// CHECK26-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK26-NEXT: store double [[ADD]], double* [[A]], align 8
// CHECK26-NEXT: ret void
//
//
// CHECK26-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK26-SAME: (%struct.S1* noundef [[THIS:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK26-NEXT: entry:
// CHECK26-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK26-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
// CHECK26-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK26-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK26-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK26-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK26-NEXT: store i64 [[DOTCAPTURE_EXPR_]], i64* [[DOTCAPTURE_EXPR__ADDR]], align 8
// CHECK26-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK26-NEXT: [[CONV:%.*]] = bitcast i64* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK26-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK26-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK26-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK26: omp_if.then:
// CHECK26-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..3 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK26-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK26: omp_if.else:
// CHECK26-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK26-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK26-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK26-NEXT: call void @.omp_outlined..3(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR2]]
// CHECK26-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK26-NEXT: br label [[OMP_IF_END]]
// CHECK26: omp_if.end:
// CHECK26-NEXT: ret void
//
//
// CHECK26-LABEL: define {{[^@]+}}@.omp_outlined..3
// CHECK26-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR1]] {
// CHECK26-NEXT: entry:
// CHECK26-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK26-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK26-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 8
// CHECK26-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK26-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK26-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 8
// CHECK26-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 8
// CHECK26-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK26-NEXT: store double 2.500000e+00, double* [[A]], align 8
// CHECK26-NEXT: ret void
//
//
// CHECK26-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK26-SAME: (i64 noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK26-NEXT: entry:
// CHECK26-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK26-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK26-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK26-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK26-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK26-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK26-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK26-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK26-NEXT: [[CONV1:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK26-NEXT: store i32 [[TMP1]], i32* [[CONV1]], align 4
// CHECK26-NEXT: [[TMP2:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK26-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK26-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK26-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK26-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i64 [[TMP2]]) #[[ATTR2]]
// CHECK26-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK26-NEXT: ret void
//
//
// CHECK26-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK26-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK26-NEXT: entry:
// CHECK26-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK26-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK26-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK26-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK26-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK26-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK26-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK26-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK26-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK26-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK26-NEXT: ret void
//
//
// CHECK26-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK26-SAME: (i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR0]] {
// CHECK26-NEXT: entry:
// CHECK26-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK26-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK26-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
// CHECK26-NEXT: [[B_CASTED:%.*]] = alloca i64, align 8
// CHECK26-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK26-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK26-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK26-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK26-NEXT: [[TMP0:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK26-NEXT: [[CONV2:%.*]] = bitcast i64* [[A_CASTED]] to i32*
// CHECK26-NEXT: store i32 [[TMP0]], i32* [[CONV2]], align 4
// CHECK26-NEXT: [[TMP1:%.*]] = load i64, i64* [[A_CASTED]], align 8
// CHECK26-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK26-NEXT: [[CONV3:%.*]] = bitcast i64* [[B_CASTED]] to i16*
// CHECK26-NEXT: store i16 [[TMP2]], i16* [[CONV3]], align 2
// CHECK26-NEXT: [[TMP3:%.*]] = load i64, i64* [[B_CASTED]], align 8
// CHECK26-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i64, i64)* @.omp_outlined..5 to void (i32*, i32*, ...)*), i64 [[TMP1]], i64 [[TMP3]])
// CHECK26-NEXT: ret void
//
//
// CHECK26-LABEL: define {{[^@]+}}@.omp_outlined..5
// CHECK26-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK26-NEXT: entry:
// CHECK26-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK26-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 8
// CHECK26-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
// CHECK26-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
// CHECK26-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 8
// CHECK26-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 8
// CHECK26-NEXT: store i64 [[A]], i64* [[A_ADDR]], align 8
// CHECK26-NEXT: store i64 [[B]], i64* [[B_ADDR]], align 8
// CHECK26-NEXT: [[CONV:%.*]] = bitcast i64* [[A_ADDR]] to i32*
// CHECK26-NEXT: [[CONV1:%.*]] = bitcast i64* [[B_ADDR]] to i16*
// CHECK26-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV1]], align 2
// CHECK26-NEXT: [[CONV2:%.*]] = sext i16 [[TMP0]] to i32
// CHECK26-NEXT: [[TMP1:%.*]] = load i32, i32* [[CONV]], align 4
// CHECK26-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV2]]
// CHECK26-NEXT: store i32 [[ADD]], i32* [[CONV]], align 4
// CHECK26-NEXT: ret void
//
//
// CHECK27-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK27-SAME: (i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK27-NEXT: entry:
// CHECK27-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1:[0-9]+]])
// CHECK27-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK27-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK27-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK27-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK27-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK27: omp_if.then:
// CHECK27-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*))
// CHECK27-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK27: omp_if.else:
// CHECK27-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK27-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK27-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK27-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR2:[0-9]+]]
// CHECK27-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK27-NEXT: br label [[OMP_IF_END]]
// CHECK27: omp_if.end:
// CHECK27-NEXT: ret void
//
//
// CHECK27-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK27-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK27-NEXT: entry:
// CHECK27-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK27-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK27-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK27-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK27-NEXT: ret void
//
//
// CHECK27-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK27-SAME: () #[[ATTR0]] {
// CHECK27-NEXT: entry:
// CHECK27-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*))
// CHECK27-NEXT: ret void
//
//
// CHECK27-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK27-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
// CHECK27-NEXT: entry:
// CHECK27-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK27-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK27-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK27-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK27-NEXT: ret void
//
//
// CHECK27-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK27-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK27-NEXT: entry:
// CHECK27-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK27-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK27-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK27-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK27-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK27-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK27-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK27-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK27-NEXT: store i32 [[TMP2]], i32* [[B_CASTED]], align 4
// CHECK27-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK27-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK27-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK27-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK27: omp_if.then:
// CHECK27-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i32)* @.omp_outlined..2 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i32 [[TMP3]])
// CHECK27-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK27: omp_if.else:
// CHECK27-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK27-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK27-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK27-NEXT: call void @.omp_outlined..2(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i32 [[TMP3]]) #[[ATTR2]]
// CHECK27-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK27-NEXT: br label [[OMP_IF_END]]
// CHECK27: omp_if.end:
// CHECK27-NEXT: ret void
//
//
// CHECK27-LABEL: define {{[^@]+}}@.omp_outlined..2
// CHECK27-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK27-NEXT: entry:
// CHECK27-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK27-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK27-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK27-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK27-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK27-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK27-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK27-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK27-NEXT: [[TMP1:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK27-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK27-NEXT: [[ADD:%.*]] = fadd double [[CONV]], 1.500000e+00
// CHECK27-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK27-NEXT: store double [[ADD]], double* [[A]], align 4
// CHECK27-NEXT: ret void
//
//
// CHECK27-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK27-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK27-NEXT: entry:
// CHECK27-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK27-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK27-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK27-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK27-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK27-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK27-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK27-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK27-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK27: omp_if.then:
// CHECK27-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..3 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK27-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK27: omp_if.else:
// CHECK27-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK27-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK27-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK27-NEXT: call void @.omp_outlined..3(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR2]]
// CHECK27-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK27-NEXT: br label [[OMP_IF_END]]
// CHECK27: omp_if.end:
// CHECK27-NEXT: ret void
//
//
// CHECK27-LABEL: define {{[^@]+}}@.omp_outlined..3
// CHECK27-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR1]] {
// CHECK27-NEXT: entry:
// CHECK27-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK27-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK27-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK27-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK27-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK27-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK27-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK27-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK27-NEXT: store double 2.500000e+00, double* [[A]], align 4
// CHECK27-NEXT: ret void
//
//
// CHECK27-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK27-SAME: (i32 noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK27-NEXT: entry:
// CHECK27-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK27-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK27-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK27-NEXT: store i32 [[TMP1]], i32* [[A_CASTED]], align 4
// CHECK27-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK27-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK27-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK27-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK27-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i32 [[TMP2]]) #[[ATTR2]]
// CHECK27-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK27-NEXT: ret void
//
//
// CHECK27-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK27-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK27-NEXT: entry:
// CHECK27-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK27-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK27-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK27-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK27-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK27-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK27-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK27-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK27-NEXT: ret void
//
//
// CHECK27-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK27-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR0]] {
// CHECK27-NEXT: entry:
// CHECK27-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK27-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK27-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK27-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK27-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK27-NEXT: store i32 [[TMP0]], i32* [[A_CASTED]], align 4
// CHECK27-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK27-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK27-NEXT: [[CONV1:%.*]] = bitcast i32* [[B_CASTED]] to i16*
// CHECK27-NEXT: store i16 [[TMP2]], i16* [[CONV1]], align 2
// CHECK27-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK27-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32, i32)* @.omp_outlined..5 to void (i32*, i32*, ...)*), i32 [[TMP1]], i32 [[TMP3]])
// CHECK27-NEXT: ret void
//
//
// CHECK27-LABEL: define {{[^@]+}}@.omp_outlined..5
// CHECK27-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK27-NEXT: entry:
// CHECK27-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK27-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK27-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK27-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK27-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK27-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK27-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK27-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK27-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK27-NEXT: [[CONV1:%.*]] = sext i16 [[TMP0]] to i32
// CHECK27-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK27-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV1]]
// CHECK27-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK27-NEXT: ret void
//
//
// CHECK28-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l104
// CHECK28-SAME: (i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0:[0-9]+]] {
// CHECK28-NEXT: entry:
// CHECK28-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1:[0-9]+]])
// CHECK28-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK28-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK28-NEXT: [[TMP1:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK28-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP1]] to i1
// CHECK28-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK28: omp_if.then:
// CHECK28-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined. to void (i32*, i32*, ...)*))
// CHECK28-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK28: omp_if.else:
// CHECK28-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK28-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK28-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK28-NEXT: call void @.omp_outlined.(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]]) #[[ATTR2:[0-9]+]]
// CHECK28-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK28-NEXT: br label [[OMP_IF_END]]
// CHECK28: omp_if.end:
// CHECK28-NEXT: ret void
//
//
// CHECK28-LABEL: define {{[^@]+}}@.omp_outlined.
// CHECK28-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1:[0-9]+]] {
// CHECK28-NEXT: entry:
// CHECK28-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK28-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK28-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK28-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK28-NEXT: ret void
//
//
// CHECK28-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZL7fstatici_l108
// CHECK28-SAME: () #[[ATTR0]] {
// CHECK28-NEXT: entry:
// CHECK28-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*))
// CHECK28-NEXT: ret void
//
//
// CHECK28-LABEL: define {{[^@]+}}@.omp_outlined..1
// CHECK28-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
// CHECK28-NEXT: entry:
// CHECK28-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK28-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK28-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK28-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK28-NEXT: ret void
//
//
// CHECK28-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l121
// CHECK28-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK28-NEXT: entry:
// CHECK28-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK28-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK28-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK28-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK28-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK28-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK28-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK28-NEXT: [[TMP2:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK28-NEXT: store i32 [[TMP2]], i32* [[B_CASTED]], align 4
// CHECK28-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK28-NEXT: [[TMP4:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK28-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP4]] to i1
// CHECK28-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK28: omp_if.then:
// CHECK28-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*, i32)* @.omp_outlined..2 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]], i32 [[TMP3]])
// CHECK28-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK28: omp_if.else:
// CHECK28-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK28-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK28-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK28-NEXT: call void @.omp_outlined..2(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]], i32 [[TMP3]]) #[[ATTR2]]
// CHECK28-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK28-NEXT: br label [[OMP_IF_END]]
// CHECK28: omp_if.end:
// CHECK28-NEXT: ret void
//
//
// CHECK28-LABEL: define {{[^@]+}}@.omp_outlined..2
// CHECK28-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK28-NEXT: entry:
// CHECK28-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK28-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK28-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK28-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK28-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK28-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK28-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK28-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK28-NEXT: [[TMP1:%.*]] = load i32, i32* [[B_ADDR]], align 4
// CHECK28-NEXT: [[CONV:%.*]] = sitofp i32 [[TMP1]] to double
// CHECK28-NEXT: [[ADD:%.*]] = fadd double [[CONV]], 1.500000e+00
// CHECK28-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK28-NEXT: store double [[ADD]], double* [[A]], align 4
// CHECK28-NEXT: ret void
//
//
// CHECK28-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2S12r1Ei_l126
// CHECK28-SAME: (%struct.S1* noundef [[THIS:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR0]] {
// CHECK28-NEXT: entry:
// CHECK28-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK28-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK28-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK28-NEXT: store i32 [[DOTCAPTURE_EXPR_]], i32* [[DOTCAPTURE_EXPR__ADDR]], align 4
// CHECK28-NEXT: [[TMP1:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK28-NEXT: [[CONV:%.*]] = bitcast i32* [[DOTCAPTURE_EXPR__ADDR]] to i8*
// CHECK28-NEXT: [[TMP2:%.*]] = load i8, i8* [[CONV]], align 1
// CHECK28-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
// CHECK28-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
// CHECK28: omp_if.then:
// CHECK28-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 1, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, %struct.S1*)* @.omp_outlined..3 to void (i32*, i32*, ...)*), %struct.S1* [[TMP1]])
// CHECK28-NEXT: br label [[OMP_IF_END:%.*]]
// CHECK28: omp_if.else:
// CHECK28-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK28-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK28-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK28-NEXT: call void @.omp_outlined..3(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], %struct.S1* [[TMP1]]) #[[ATTR2]]
// CHECK28-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK28-NEXT: br label [[OMP_IF_END]]
// CHECK28: omp_if.end:
// CHECK28-NEXT: ret void
//
//
// CHECK28-LABEL: define {{[^@]+}}@.omp_outlined..3
// CHECK28-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], %struct.S1* noundef [[THIS:%.*]]) #[[ATTR1]] {
// CHECK28-NEXT: entry:
// CHECK28-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK28-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK28-NEXT: [[THIS_ADDR:%.*]] = alloca %struct.S1*, align 4
// CHECK28-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK28-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK28-NEXT: store %struct.S1* [[THIS]], %struct.S1** [[THIS_ADDR]], align 4
// CHECK28-NEXT: [[TMP0:%.*]] = load %struct.S1*, %struct.S1** [[THIS_ADDR]], align 4
// CHECK28-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S1:%.*]], %struct.S1* [[TMP0]], i32 0, i32 0
// CHECK28-NEXT: store double 2.500000e+00, double* [[A]], align 4
// CHECK28-NEXT: ret void
//
//
// CHECK28-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l87
// CHECK28-SAME: (i32 noundef [[A:%.*]]) #[[ATTR0]] {
// CHECK28-NEXT: entry:
// CHECK28-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @[[GLOB1]])
// CHECK28-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK28-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK28-NEXT: store i32 [[TMP1]], i32* [[A_CASTED]], align 4
// CHECK28-NEXT: [[TMP2:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK28-NEXT: call void @__kmpc_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK28-NEXT: store i32 [[TMP0]], i32* [[DOTTHREADID_TEMP_]], align 4
// CHECK28-NEXT: store i32 0, i32* [[DOTBOUND_ZERO_ADDR]], align 4
// CHECK28-NEXT: call void @.omp_outlined..4(i32* [[DOTTHREADID_TEMP_]], i32* [[DOTBOUND_ZERO_ADDR]], i32 [[TMP2]]) #[[ATTR2]]
// CHECK28-NEXT: call void @__kmpc_end_serialized_parallel(%struct.ident_t* @[[GLOB1]], i32 [[TMP0]])
// CHECK28-NEXT: ret void
//
//
// CHECK28-LABEL: define {{[^@]+}}@.omp_outlined..4
// CHECK28-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]]) #[[ATTR1]] {
// CHECK28-NEXT: entry:
// CHECK28-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK28-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK28-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK28-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK28-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK28-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK28-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 1
// CHECK28-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK28-NEXT: ret void
//
//
// CHECK28-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIiET_i_l93
// CHECK28-SAME: (i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR0]] {
// CHECK28-NEXT: entry:
// CHECK28-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[A_CASTED:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[B_CASTED:%.*]] = alloca i32, align 4
// CHECK28-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK28-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK28-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK28-NEXT: [[TMP0:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK28-NEXT: store i32 [[TMP0]], i32* [[A_CASTED]], align 4
// CHECK28-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_CASTED]], align 4
// CHECK28-NEXT: [[TMP2:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK28-NEXT: [[CONV1:%.*]] = bitcast i32* [[B_CASTED]] to i16*
// CHECK28-NEXT: store i16 [[TMP2]], i16* [[CONV1]], align 2
// CHECK28-NEXT: [[TMP3:%.*]] = load i32, i32* [[B_CASTED]], align 4
// CHECK28-NEXT: call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @[[GLOB1]], i32 2, void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i32, i32)* @.omp_outlined..5 to void (i32*, i32*, ...)*), i32 [[TMP1]], i32 [[TMP3]])
// CHECK28-NEXT: ret void
//
//
// CHECK28-LABEL: define {{[^@]+}}@.omp_outlined..5
// CHECK28-SAME: (i32* noalias noundef [[DOTGLOBAL_TID_:%.*]], i32* noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR1]] {
// CHECK28-NEXT: entry:
// CHECK28-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK28-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca i32*, align 4
// CHECK28-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
// CHECK28-NEXT: store i32* [[DOTGLOBAL_TID_]], i32** [[DOTGLOBAL_TID__ADDR]], align 4
// CHECK28-NEXT: store i32* [[DOTBOUND_TID_]], i32** [[DOTBOUND_TID__ADDR]], align 4
// CHECK28-NEXT: store i32 [[A]], i32* [[A_ADDR]], align 4
// CHECK28-NEXT: store i32 [[B]], i32* [[B_ADDR]], align 4
// CHECK28-NEXT: [[CONV:%.*]] = bitcast i32* [[B_ADDR]] to i16*
// CHECK28-NEXT: [[TMP0:%.*]] = load i16, i16* [[CONV]], align 2
// CHECK28-NEXT: [[CONV1:%.*]] = sext i16 [[TMP0]] to i32
// CHECK28-NEXT: [[TMP1:%.*]] = load i32, i32* [[A_ADDR]], align 4
// CHECK28-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP1]], [[CONV1]]
// CHECK28-NEXT: store i32 [[ADD]], i32* [[A_ADDR]], align 4
// CHECK28-NEXT: ret void
//
| 70.636106
| 442
| 0.598504
|
tkolar23
|
82b02dc70a212e54874c124174f86e9dfd850d41
| 527
|
hpp
|
C++
|
StrSTUN-synthesizer/strstunlib0/include/ComponentIfThenElse.hpp
|
HALOCORE/SynGuar
|
8f7f9ba52e83091ad3def501169fd60d20b28321
|
[
"MIT"
] | 1
|
2021-06-23T05:10:36.000Z
|
2021-06-23T05:10:36.000Z
|
StrSTUN-synthesizer/strstunlib0/include/ComponentIfThenElse.hpp
|
HALOCORE/SynGuar
|
8f7f9ba52e83091ad3def501169fd60d20b28321
|
[
"MIT"
] | null | null | null |
StrSTUN-synthesizer/strstunlib0/include/ComponentIfThenElse.hpp
|
HALOCORE/SynGuar
|
8f7f9ba52e83091ad3def501169fd60d20b28321
|
[
"MIT"
] | null | null | null |
#ifndef COMPONENT_IFTHENELSE
#define COMPONENT_IFTHENELSE
#include "componentbase.hpp"
class ComponentIfThenElse : public ComponentBase {
public:
ComponentIfThenElse(ValType valType);
ValBase* evaluate(std::vector<ValBase*> inputValues, int exampleIndex) override;
static std::vector<std::string> componentIdByValType;
void accept(Visitor* visitor) override;
std::unordered_map<std::string, int> calculateFlags(
std::vector<std::unordered_map<std::string, int>*> inputsFlags) override;
};
#endif
| 31
| 84
| 0.760911
|
HALOCORE
|
a11206ce895cc0bf10bb78f76e154888f6213ff7
| 3,884
|
inl
|
C++
|
ivp/havana/havok/hk_base/array/array.inl
|
DannyParker0001/Kisak-Strike
|
99ed85927336fe3aff2efd9b9382b2b32eb1d05d
|
[
"Unlicense"
] | 252
|
2020-12-16T15:34:43.000Z
|
2022-03-31T23:21:37.000Z
|
ivp/havana/havok/hk_base/array/array.inl
|
DannyParker0001/Kisak-Strike
|
99ed85927336fe3aff2efd9b9382b2b32eb1d05d
|
[
"Unlicense"
] | 23
|
2020-12-20T18:02:54.000Z
|
2022-03-28T16:58:32.000Z
|
ivp/havana/havok/hk_base/array/array.inl
|
DannyParker0001/Kisak-Strike
|
99ed85927336fe3aff2efd9b9382b2b32eb1d05d
|
[
"Unlicense"
] | 42
|
2020-12-19T04:32:33.000Z
|
2022-03-30T06:00:28.000Z
|
hk_Array_Base::hk_Array_Base()
{
}
template <class T>
hk_Array<T>::hk_Array( int initial_size )
{
m_n_elems = 0;
if ( initial_size) {
m_memsize = initial_size;
m_elems = (char *)hk_allocate(T, initial_size, HK_MEMORY_CLASS_ARRAY );
}else{
m_memsize = 0;
m_elems = HK_NULL;
}
}
template <class T>
hk_Array<T>::hk_Array(T* elems, int initial_size)
{
HK_ASSERT( (char *)elems == (char *)(this +1 ));
m_n_elems = 0;
m_elems = (char *)elems;
m_memsize = initial_size;
}
template <class T>
hk_Array<T>::~hk_Array()
{
if (m_elems)
{
HK_ASSERT( get_elems() != (T *)(this+1));
hk_deallocate( T, get_elems(), m_memsize, HK_MEMORY_CLASS_ARRAY );
}
}
template <class T>
hk_array_index hk_Array<T>::add_element_unchecked( T element )
{
HK_ASSERT( m_n_elems < m_memsize );
get_elems()[ m_n_elems ] = element;
return m_n_elems++;
}
template <class T>
hk_array_index hk_Array<T>::add_element( T element )
{
if ( m_n_elems >= m_memsize)
{
grow_mem( sizeof(T) );
}
get_elems()[ m_n_elems ] = element;
return m_n_elems++;
}
#if !defined(_XBOX)
template <class T>
void hk_Array<T>::remove_element( hk_array_index idx,
void (*static_member_func)( T&, hk_Array<T>* , hk_array_store_index ) )
{
m_n_elems --;
if (idx < m_n_elems)
{
(*static_member_func)( get_elems()[ m_n_elems ], this, idx );
get_elems()[idx] = get_elems()[ m_n_elems ];
}
}
#endif
template <class T>
void hk_Array<T>::search_and_remove_element( T& t)
{
int index = index_of(t);
HK_ASSERT(index>=0);
m_n_elems --;
if (index < m_n_elems)
{
get_elems()[index ] = get_elems()[ m_n_elems ];
}
}
template <class T>
void hk_Array<T>::search_and_remove_element_sorted( T& t)
{
int index = index_of(t);
HK_ASSERT(index>=0);
m_n_elems --;
while ( index < m_n_elems ){
get_elems()[index ] = get_elems()[ index+1];
index++;
}
}
template <class T>
T& hk_Array<T>::operator() (int i)
{
return get_elems()[i];
}
template <class T>
const T& hk_Array<T>::operator() (int i) const
{
return get_elems()[i];
}
template <class T>
hk_array_index hk_Array<T>::index_of( T& t)
{
for (int i = m_n_elems-1; i>=0 ;i--)
{
if(get_elems()[i]==t)
{
return i;
}
}
return -1;
}
template <class T>
T& hk_Array<T>::element_at( int i )
{
return get_elems()[i];
}
template <class T>
const T& hk_Array<T>::element_at( int i ) const
{
return get_elems()[i];
}
template <class T>
void hk_Array<T>::remove_all()
{
m_n_elems = 0;
}
template <class T>
void hk_Array<T>::free_elem_array()
{
if ( m_elems && ((char *)m_elems != (char *)(this + 1)))
{
hk_deallocate( char, m_elems, m_memsize * sizeof(T), HK_MEMORY_CLASS_ARRAY );
}
m_n_elems = 0;
m_memsize = 0;
m_elems = HK_NULL;
}
template <class T>
int hk_Array<T>::length()
{
return m_n_elems;
}
template <class T>
int hk_Array<T>::get_capacity()
{
return m_memsize;
}
template <class T>
void hk_Array<T>::reserve(int n)
{
if ( m_memsize < n + m_n_elems)
{
int new_size = m_memsize + m_memsize;
if ( new_size == 0) new_size = 2;
while ( new_size < n + m_n_elems ){
new_size += new_size;
}
grow_mem( sizeof(T), new_size - m_memsize );
}
}
template <class T>
T& hk_Array<T>::get_element( iterator i )
{
return get_elems()[i];
}
template <class T>
hk_bool hk_Array<T>::is_valid( iterator i)
{
return hk_bool(i>=0);
}
template <class T>
typename hk_Array<T>::iterator hk_Array<T>::next(iterator i)
{
return i-1;
}
template <class T>
typename hk_Array<T>::iterator hk_Array<T>::start()
{
return m_n_elems-1;
}
template <class T>
void hk_Array<T>::set( hk_Array<T> &t ) // OS: name to be discussed
{
*this = t;
t.m_n_elems = 0;
t.m_memsize = 0;
t.m_elems = HK_NULL;
}
| 17.654545
| 80
| 0.620494
|
DannyParker0001
|
a113fdc69355cad6cff59b6c9a086956e7dbd639
| 2,459
|
cpp
|
C++
|
src/server/http/Reply.cpp
|
CabooseLang/BoxCar
|
80bca1a2bfcd05dbdf3c5a39bfd2023818d4536d
|
[
"MIT"
] | null | null | null |
src/server/http/Reply.cpp
|
CabooseLang/BoxCar
|
80bca1a2bfcd05dbdf3c5a39bfd2023818d4536d
|
[
"MIT"
] | null | null | null |
src/server/http/Reply.cpp
|
CabooseLang/BoxCar
|
80bca1a2bfcd05dbdf3c5a39bfd2023818d4536d
|
[
"MIT"
] | null | null | null |
#include "Reply.hpp"
#include <string>
#include <numeric>
namespace BoxCar {
namespace Http {
StatusData statusDataSet[] = {
{ "200", "OK" },
{ "201", "Created" },
{ "202", "Accepted" },
{ "204", "No Content" },
{ "300", "Multiple Choices" },
{ "301", "Moved Permanently" },
{ "302", "Moved Temporarily" },
{ "304", "Not Modified" },
{ "400", "Bad Request" },
{ "401", "Unauthorized" },
{ "403", "Forbidden" },
{ "404", "Not Found" },
{ "500", "Internal Server Error" },
{ "501", "Not Implemented" },
{ "502", "Bad Gateway" },
{ "503", "Service Unavailable" },
};
namespace MiscStrings {
const char nameValueSeparator[] = { ':', ' ' };
const char crlf[] = { '\r', '\n' };
}
std::vector<boost::asio::const_buffer>
Reply::toBuffers() {
std::vector<boost::asio::const_buffer> buffers;
// It was worth a shot...
// std::stringstream ss;
// ss << "HTTP/1.0 " << std::to_string(statusDataSet[(int)this->status].code) << " "
// << statusDataSet[(int)this->status].message;
buffers.push_back(boost::asio::buffer("HTTP/1.1 "));
buffers.push_back(boost::asio::buffer(statusDataSet[(int)this->status].code));
buffers.push_back(boost::asio::buffer(" "));
buffers.push_back(boost::asio::buffer(statusDataSet[(int)this->status].message));
buffers.push_back(boost::asio::buffer(MiscStrings::crlf));
for (std::size_t i = 0; i < headers.size(); ++i) {
Header& h = headers[i];
buffers.push_back(boost::asio::buffer(h.name));
buffers.push_back(boost::asio::buffer(MiscStrings::nameValueSeparator));
buffers.push_back(boost::asio::buffer(h.value));
buffers.push_back(boost::asio::buffer(MiscStrings::crlf));
}
buffers.push_back(boost::asio::buffer(MiscStrings::crlf));
buffers.push_back(boost::asio::buffer(content));
return buffers;
}
Reply
Reply::stockReply(StatusType status) {
Reply rep;
rep.status = status;
std::stringstream ss;
ss << "<html><head><title>" << statusDataSet[(int)status].message
<< "</title></head><body><h1>" << statusDataSet[(int)status].code << " "
<< statusDataSet[(int)status].message << "</h1></body></html>";
rep.content = ss.str();
rep.headers.resize(2);
rep.headers[0].name = "Content-Length";
rep.headers[0].value = std::to_string(rep.content.size());
rep.headers[1].name = "Content-Type";
rep.headers[1].value = "text/html";
return rep;
}
}
}
| 29.987805
| 87
| 0.610411
|
CabooseLang
|
a117c15ab541033157d6635b709c369958b3bef4
| 288
|
cpp
|
C++
|
samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_GetRegisteredActivatedServer_Client/CPP/RemotingConfiguration_GetRegisteredActivatedService_shared.cpp
|
BaruaSourav/docs
|
c288ed777de6b091f5e074d3488f7934683f3eb5
|
[
"CC-BY-4.0",
"MIT"
] | 3,294
|
2016-10-30T05:27:20.000Z
|
2022-03-31T15:59:30.000Z
|
samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_GetRegisteredActivatedServer_Client/CPP/RemotingConfiguration_GetRegisteredActivatedService_shared.cpp
|
BaruaSourav/docs
|
c288ed777de6b091f5e074d3488f7934683f3eb5
|
[
"CC-BY-4.0",
"MIT"
] | 16,739
|
2016-10-28T19:41:29.000Z
|
2022-03-31T22:38:48.000Z
|
samples/snippets/cpp/VS_Snippets_Remoting/RemotingConfiguration_GetRegisteredActivatedServer_Client/CPP/RemotingConfiguration_GetRegisteredActivatedService_shared.cpp
|
BaruaSourav/docs
|
c288ed777de6b091f5e074d3488f7934683f3eb5
|
[
"CC-BY-4.0",
"MIT"
] | 6,701
|
2016-10-29T20:56:11.000Z
|
2022-03-31T12:32:26.000Z
|
using namespace System;
public ref class MyServerImpl: public MarshalByRefObject
{
public:
MyServerImpl()
{
Console::WriteLine( "Server Activated..." );
}
String^ MyMethod( String^ name )
{
return String::Format( "The client requests to {0}", name );
}
};
| 18
| 66
| 0.642361
|
BaruaSourav
|
a11af696a8fa3058933df242b304c9ecf0c0d293
| 5,204
|
cpp
|
C++
|
test/pipo-scale-test.cpp
|
Ircam-RnD/pipo
|
30ff8e501fdc07220bb06bf66a58c55b2df1a61f
|
[
"Unlicense",
"BSD-3-Clause"
] | 14
|
2017-08-10T15:45:05.000Z
|
2021-04-10T09:48:54.000Z
|
test/pipo-scale-test.cpp
|
ircam-ismm/pipo
|
30ff8e501fdc07220bb06bf66a58c55b2df1a61f
|
[
"Unlicense",
"BSD-3-Clause"
] | 9
|
2017-07-21T14:58:44.000Z
|
2019-07-26T12:05:09.000Z
|
test/pipo-scale-test.cpp
|
ircam-ismm/pipo
|
30ff8e501fdc07220bb06bf66a58c55b2df1a61f
|
[
"Unlicense",
"BSD-3-Clause"
] | 2
|
2019-03-27T16:05:09.000Z
|
2021-01-17T18:40:51.000Z
|
#include <sstream>
#include <string>
#include <cstddef>
#include <vector>
#include <algorithm>
#include "catch.hpp"
#include "PiPoScale.h"
#include "PiPoTestHost.h"
TEST_CASE ("PiPoScale")
{
PiPoTestHost host;
host.setGraph("scale");
std::vector<PiPoValue> inputFrame;
int check;
PiPoStreamAttributes sa;
sa.maxFrames = 100;
for(double sampleRate = 100.; sampleRate <= 1000.; sampleRate *= 10.)
{
for(unsigned int width = 1; width <= 10; width *= 3)
{
for(unsigned int height = 1; height <= 10; height *= 4)
{
sa.rate = sampleRate;
sa.dims[0] = width;
sa.dims[1] = height;
check = host.setInputStreamAttributes(sa);
REQUIRE (check == 0);
const unsigned int size = width * height;
inputFrame.resize(size);
const std::string setup = (std::stringstream("Setup: ") <<
"sampleRate=" << sampleRate << ", " <<
"width=" << width << ", " <<
"height=" << height).str();
GIVEN (setup)
{
WHEN ("Scaling from [1. ; 2. ] to [3. ; 4.]")
{
host.setAttr("scale.func", "lin");
host.setAttr("scale.inmin", 1.);
host.setAttr("scale.inmax", 2.);
host.setAttr("scale.outmin", 3.);
host.setAttr("scale.outmax", 4.);
std::vector<std::vector<PiPoValue> > values = {
{-1. , 1. },
{ 0. , 2. },
{ 1. , 3. },
{ 2. , 4. },
{ 3. , 5. }
};
for (std::size_t v = 0; v < values.size(); ++v)
{
const PiPoValue inputValue = values[v][0];
const PiPoValue outputExpected = values[v][1];
std::fill(inputFrame.begin(), inputFrame.end(), inputValue);
host.reset(); // clear stored received frames
check = host.frames(0., 1., &inputFrame[0], size, 1);
REQUIRE (check == 0);
for (unsigned int sample = 0; sample < size; ++sample)
{
CHECK (host.receivedFrames[0][sample] == Approx(outputExpected));
}
}
} // Scaling from [1. ; 2. ] to [3. ; 4.]
WHEN ("Scaling from [0. ; 1. ] to [0. ; 127.]")
{
host.setAttr("scale.func", "lin");
host.setAttr("scale.inmin", 0.);
host.setAttr("scale.inmax", 1.);
host.setAttr("scale.outmin", 0.);
host.setAttr("scale.outmax", 127.);
std::vector<std::vector<PiPoValue> > values = {
{-1. , -127. },
{-0.5 , -63.5},
{-0. , 0. },
{ 0. , 0. },
{ 0.1 , 12.7},
{ 0.5 , 63.5},
{ 1. , 127. },
{ 2. , 254. }
};
for(std::size_t v = 0; v < values.size(); ++v)
{
const PiPoValue inputValue = values[v][0];
const PiPoValue outputExpected = values[v][1];
std::fill(inputFrame.begin(), inputFrame.end(), inputValue);
host.reset(); // clear stored received frames
check = host.frames(0., 1., &inputFrame[0], size, 1);
REQUIRE (check == 0);
for(unsigned int sample = 0; sample < size; ++sample)
{
CHECK (host.receivedFrames[0][sample] == Approx(outputExpected));
}
}
} // Scaling from [0. ; 1. ] to [0. ; 127.]
//*
WHEN ("Scaling from [0.5 ; 0.9] to [10. ; 100.] with clipping")
{
host.setAttr("scale.func", "lin");
host.setAttr("scale.inmin", 0.5);
host.setAttr("scale.inmax", 0.9);
host.setAttr("scale.outmin", 10.);
host.setAttr("scale.outmax", 100.);
host.setAttr("scale.clip", true);
std::vector<std::vector<PiPoValue> > values = {
{-1. , 10. },
{ 0. , 10. },
{ 0.5 , 10. },
{ 0.6 , 32.5 },
{ 0.65, 43.75},
{ 0.9 , 100. },
{ 1. , 100. }
};
for(std::size_t v = 0; v < values.size(); ++v)
{
const PiPoValue inputValue = values[v][0];
const PiPoValue outputExpected = values[v][1];
std::fill(inputFrame.begin(), inputFrame.end(), inputValue);
host.reset(); // clear stored received frames
check = host.frames(0., 1., &inputFrame[0], size, 1);
REQUIRE (check == 0);
for(unsigned int sample = 0; sample < size; ++sample)
{
CHECK (host.receivedFrames[0][sample] == Approx(outputExpected));
}
}
} // Scaling from [0.5 ; 0.9] to [10. ; 100.] with clipping
//*/
} // Setup: sample-rate, width, and height
} // height
} // width
} // sampleRate
} // PiPoScale test case
/** EMACS **
* Local variables:
* mode: c++
* c-basic-offset:2
* End:
*/
| 30.97619
| 81
| 0.444658
|
Ircam-RnD
|
a11e6efad663b0a99243bc6a27fdb20bebdd9267
| 9,695
|
cpp
|
C++
|
examples/Collision/Internal/Bullet2CollisionSdk.cpp
|
romance-ii/bullet2
|
18cbc1a62db057de74effb1dfc107bbf421e55d9
|
[
"Zlib"
] | 36
|
2016-06-30T19:12:10.000Z
|
2022-01-10T17:23:22.000Z
|
examples/Collision/Internal/Bullet2CollisionSdk.cpp
|
Acidburn0zzz/bullet3
|
346308120ab66c418d73640721d7e216d6b57915
|
[
"Zlib"
] | 2
|
2015-06-23T04:36:59.000Z
|
2016-01-31T19:36:28.000Z
|
examples/Collision/Internal/Bullet2CollisionSdk.cpp
|
Acidburn0zzz/bullet3
|
346308120ab66c418d73640721d7e216d6b57915
|
[
"Zlib"
] | 21
|
2016-09-28T02:53:57.000Z
|
2022-02-13T11:47:17.000Z
|
#include "Bullet2CollisionSdk.h"
#include "btBulletCollisionCommon.h"
struct Bullet2CollisionSdkInternalData
{
btCollisionConfiguration* m_collisionConfig;
btCollisionDispatcher* m_dispatcher;
btBroadphaseInterface* m_aabbBroadphase;
btCollisionWorld* m_collisionWorld;
Bullet2CollisionSdkInternalData()
:m_aabbBroadphase(0),
m_dispatcher(0),
m_collisionWorld(0)
{
}
};
Bullet2CollisionSdk::Bullet2CollisionSdk()
{
m_internalData = new Bullet2CollisionSdkInternalData;
}
Bullet2CollisionSdk::~Bullet2CollisionSdk()
{
delete m_internalData;
m_internalData = 0;
}
plCollisionWorldHandle Bullet2CollisionSdk::createCollisionWorld(int /*maxNumObjsCapacity*/, int /*maxNumShapesCapacity*/, int /*maxNumPairsCapacity*/)
{
m_internalData->m_collisionConfig = new btDefaultCollisionConfiguration;
m_internalData->m_dispatcher = new btCollisionDispatcher(m_internalData->m_collisionConfig);
m_internalData->m_aabbBroadphase = new btDbvtBroadphase();
m_internalData->m_collisionWorld = new btCollisionWorld(m_internalData->m_dispatcher,
m_internalData->m_aabbBroadphase,
m_internalData->m_collisionConfig);
return (plCollisionWorldHandle) m_internalData->m_collisionWorld;
}
void Bullet2CollisionSdk::deleteCollisionWorld(plCollisionWorldHandle worldHandle)
{
btCollisionWorld* world = (btCollisionWorld*) worldHandle;
btAssert(m_internalData->m_collisionWorld == world);
if (m_internalData->m_collisionWorld == world)
{
delete m_internalData->m_collisionWorld;
m_internalData->m_collisionWorld=0;
delete m_internalData->m_aabbBroadphase;
m_internalData->m_aabbBroadphase=0;
delete m_internalData->m_dispatcher;
m_internalData->m_dispatcher=0;
delete m_internalData->m_collisionConfig;
m_internalData->m_collisionConfig=0;
}
}
plCollisionShapeHandle Bullet2CollisionSdk::createSphereShape(plCollisionWorldHandle /*worldHandle*/, plReal radius)
{
btSphereShape* sphereShape = new btSphereShape(radius);
return (plCollisionShapeHandle) sphereShape;
}
plCollisionShapeHandle Bullet2CollisionSdk::createPlaneShape(plCollisionWorldHandle worldHandle,
plReal planeNormalX,
plReal planeNormalY,
plReal planeNormalZ,
plReal planeConstant)
{
btStaticPlaneShape* planeShape = new btStaticPlaneShape(btVector3(planeNormalX,planeNormalY,planeNormalZ),planeConstant);
return (plCollisionShapeHandle) planeShape;
}
plCollisionShapeHandle Bullet2CollisionSdk::createCapsuleShape(plCollisionWorldHandle worldHandle,
plReal radius,
plReal height,
int capsuleAxis)
{
btCapsuleShape* capsule = 0;
switch (capsuleAxis)
{
case 0:
{
capsule = new btCapsuleShapeX(radius,height);
break;
}
case 1:
{
capsule = new btCapsuleShape(radius,height);
break;
}
case 2:
{
capsule = new btCapsuleShapeZ(radius,height);
break;
}
default:
{
btAssert(0);
}
}
return (plCollisionShapeHandle)capsule;
}
plCollisionShapeHandle Bullet2CollisionSdk::createCompoundShape(plCollisionWorldHandle worldHandle)
{
return (plCollisionShapeHandle) new btCompoundShape();
}
void Bullet2CollisionSdk::addChildShape(plCollisionWorldHandle worldHandle,plCollisionShapeHandle compoundShapeHandle, plCollisionShapeHandle childShapeHandle,plVector3 childPos,plQuaternion childOrn)
{
btCompoundShape* compound = (btCompoundShape*) compoundShapeHandle;
btCollisionShape* childShape = (btCollisionShape*) childShapeHandle;
btTransform localTrans;
localTrans.setOrigin(btVector3(childPos[0],childPos[1],childPos[2]));
localTrans.setRotation(btQuaternion(childOrn[0],childOrn[1],childOrn[2],childOrn[3]));
compound->addChildShape(localTrans,childShape);
}
void Bullet2CollisionSdk::deleteShape(plCollisionWorldHandle /*worldHandle*/, plCollisionShapeHandle shapeHandle)
{
btCollisionShape* shape = (btCollisionShape*) shapeHandle;
delete shape;
}
void Bullet2CollisionSdk::addCollisionObject(plCollisionWorldHandle worldHandle, plCollisionObjectHandle objectHandle)
{
btCollisionWorld* world = (btCollisionWorld*) worldHandle;
btCollisionObject* colObj = (btCollisionObject*) objectHandle;
btAssert(world && colObj);
if (world == m_internalData->m_collisionWorld && colObj)
{
world->addCollisionObject(colObj);
}
}
void Bullet2CollisionSdk::removeCollisionObject(plCollisionWorldHandle worldHandle, plCollisionObjectHandle objectHandle)
{
btCollisionWorld* world = (btCollisionWorld*) worldHandle;
btCollisionObject* colObj = (btCollisionObject*) objectHandle;
btAssert(world && colObj);
if (world == m_internalData->m_collisionWorld && colObj)
{
world->removeCollisionObject(colObj);
}
}
plCollisionObjectHandle Bullet2CollisionSdk::createCollisionObject( plCollisionWorldHandle worldHandle, void* userPointer, int userIndex, plCollisionShapeHandle shapeHandle ,
plVector3 startPosition,plQuaternion startOrientation )
{
btCollisionShape* colShape = (btCollisionShape*) shapeHandle;
btAssert(colShape);
if (colShape)
{
btCollisionObject* colObj= new btCollisionObject;
colObj->setUserIndex(userIndex);
colObj->setUserPointer(userPointer);
colObj->setCollisionShape(colShape);
btTransform tr;
tr.setOrigin(btVector3(startPosition[0],startPosition[1],startPosition[2]));
tr.setRotation(btQuaternion(startOrientation[0],startOrientation[1],startOrientation[2],startOrientation[3]));
colObj->setWorldTransform(tr);
return (plCollisionObjectHandle) colObj;
}
return 0;
}
void Bullet2CollisionSdk::deleteCollisionObject(plCollisionObjectHandle bodyHandle)
{
btCollisionObject* colObj = (btCollisionObject*) bodyHandle;
delete colObj;
}
void Bullet2CollisionSdk::setCollisionObjectTransform(plCollisionWorldHandle /*worldHandle*/, plCollisionObjectHandle bodyHandle,
plVector3 position,plQuaternion orientation )
{
btCollisionObject* colObj = (btCollisionObject*) bodyHandle;
btTransform tr;
tr.setOrigin(btVector3(position[0],position[1],position[2]));
tr.setRotation(btQuaternion(orientation[0],orientation[1],orientation[2],orientation[3]));
colObj->setWorldTransform(tr);
}
struct Bullet2ContactResultCallback : public btCollisionWorld::ContactResultCallback
{
int m_numContacts;
lwContactPoint* m_pointsOut;
int m_pointCapacity;
Bullet2ContactResultCallback(lwContactPoint* pointsOut, int pointCapacity) :
m_numContacts(0),
m_pointsOut(pointsOut),
m_pointCapacity(pointCapacity)
{
}
virtual btScalar addSingleResult(btManifoldPoint& cp, const btCollisionObjectWrapper* colObj0Wrap,int partId0,int index0,const btCollisionObjectWrapper* colObj1Wrap,int partId1,int index1)
{
if (m_numContacts<m_pointCapacity)
{
lwContactPoint& ptOut = m_pointsOut[m_numContacts];
ptOut.m_distance = cp.m_distance1;
ptOut.m_normalOnB[0] = cp.m_normalWorldOnB.getX();
ptOut.m_normalOnB[1] = cp.m_normalWorldOnB.getY();
ptOut.m_normalOnB[2] = cp.m_normalWorldOnB.getZ();
ptOut.m_ptOnAWorld[0] = cp.m_positionWorldOnA[0];
ptOut.m_ptOnAWorld[1] = cp.m_positionWorldOnA[1];
ptOut.m_ptOnAWorld[2] = cp.m_positionWorldOnA[2];
ptOut.m_ptOnBWorld[0] = cp.m_positionWorldOnB[0];
ptOut.m_ptOnBWorld[1] = cp.m_positionWorldOnB[1];
ptOut.m_ptOnBWorld[2] = cp.m_positionWorldOnB[2];
m_numContacts++;
}
return 1.f;
}
};
int Bullet2CollisionSdk::collide(plCollisionWorldHandle worldHandle,plCollisionObjectHandle colA, plCollisionObjectHandle colB,
lwContactPoint* pointsOut, int pointCapacity)
{
btCollisionWorld* world = (btCollisionWorld*) worldHandle;
btCollisionObject* colObjA = (btCollisionObject*) colA;
btCollisionObject* colObjB = (btCollisionObject*) colB;
btAssert(world && colObjA && colObjB);
if (world == m_internalData->m_collisionWorld && colObjA && colObjB)
{
Bullet2ContactResultCallback cb(pointsOut,pointCapacity);
world->contactPairTest(colObjA,colObjB,cb);
return cb.m_numContacts;
}
return 0;
}
static plNearCallback gTmpFilter;
static int gNearCallbackCount = 0;
static plCollisionSdkHandle gCollisionSdk = 0;
static plCollisionWorldHandle gCollisionWorldHandle = 0;
static void* gUserData = 0;
void Bullet2NearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo)
{
btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject;
btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject;
plCollisionObjectHandle obA =(plCollisionObjectHandle) colObj0;
plCollisionObjectHandle obB =(plCollisionObjectHandle) colObj1;
if(gTmpFilter)
{
gTmpFilter(gCollisionSdk,gCollisionWorldHandle, gUserData,obA,obB);
gNearCallbackCount++;
}
}
void Bullet2CollisionSdk::collideWorld( plCollisionWorldHandle worldHandle,
plNearCallback filter, void* userData)
{
btCollisionWorld* world = (btCollisionWorld*) worldHandle;
//chain the near-callback
gTmpFilter = filter;
gNearCallbackCount = 0;
gUserData = userData;
gCollisionSdk = (plCollisionSdkHandle)this;
gCollisionWorldHandle = worldHandle;
m_internalData->m_dispatcher->setNearCallback(Bullet2NearCallback);
world->performDiscreteCollisionDetection();
gTmpFilter = 0;
}
plCollisionSdkHandle Bullet2CollisionSdk::createBullet2SdkHandle()
{
return (plCollisionSdkHandle) new Bullet2CollisionSdk;
}
| 34.749104
| 200
| 0.762455
|
romance-ii
|
a120ed14eb39645597b2791717aa9e34747a3b9a
| 4,866
|
hpp
|
C++
|
inc/cheby2.hpp
|
gcant/pairwise-comparison-BP
|
f995d99440fd37b2850442413672a8e20b9f5b99
|
[
"Apache-2.0"
] | 2
|
2021-10-04T09:48:50.000Z
|
2022-01-13T21:24:43.000Z
|
inc/cheby2.hpp
|
gcant/pairwise-comparison-BP
|
f995d99440fd37b2850442413672a8e20b9f5b99
|
[
"Apache-2.0"
] | null | null | null |
inc/cheby2.hpp
|
gcant/pairwise-comparison-BP
|
f995d99440fd37b2850442413672a8e20b9f5b99
|
[
"Apache-2.0"
] | null | null | null |
#pragma once
#include <valarray>
#include "r2r.hpp"
#define _USE_MATH_DEFINES
#include <cmath>
const int INIT_BY_COEFS = 0;
const int INIT_BY_VALUES = 1;
namespace cheby {
typedef std::valarray<floatT> ArrayXd;
// discrete cosine transform function
r2r::r2r dct2(FFTW_REDFT10);
r2r::r2r dct3(FFTW_REDFT01);
// adapted from numpy
// compute the value of the Chebyshev polynomial with coefficients c,
// evaluated at point x
template <class vec_t>
floatT Chebyshev_value(floatT x, vec_t const &c) {
floatT c0,c1;
if (c.size()==1) {
c0 = c[0];
c1 = 0;
}
else if (c.size()==2) {
c0 = c[0];
c1 = c[1];
}
else {
floatT x2 = x*2.0;
c0 = c[c.size()-2];
c1 = c[c.size()-1];
for (int i=3; i < c.size()+1; ++i){
floatT tmp = c0;
c0 = c[c.size()-i] - c1;
c1 = tmp + c1*x2;
}
}
return c0 + c1*x;
}
// adapted from ChebTools
// compute the coefficients for the integrated Chebyshev polynomial with
// coefficients m_c
// lbnd is the lower bound for the definite integral
// if keep_order, only return coefficients to the same order as m_c
ArrayXd Chebyshev_coef_integrate(ArrayXd const &m_c, floatT lbnd=-1.0,
bool keep_order=false) {
//Eigen::ArrayXd c = Eigen::ArrayXd::Zero(m_c.size()+1);
ArrayXd c(0.0,m_c.size()+1);
c[1] = (2.0*m_c[0] - m_c[2]) / 2.0;
for (int i=2; i<m_c.size()-1; ++i) {
c[i] = (m_c[i - 1] - m_c[i + 1]) / (2.0 * i);
}
for (int i=m_c.size()-1; i<m_c.size()+1; ++i) {
c[i] = (m_c[i - 1]) / (2.0 * i);
}
c[0] = -Chebyshev_value(lbnd,c);
if (keep_order) c = (ArrayXd)c[std::slice(0,m_c.size(),1)];
return c;
}
// compute the Chebyshev coefficients from the values of the function at
// the Chebyshev points, i.e. cos( k pi / N )
ArrayXd Chebyshev_coefs_from_values(ArrayXd const &f) {
// CHANGED
ArrayXd c = dct2(f);
c /= c.size();
c[0] /= 2.0;
return c;
}
ArrayXd ChebPts(int N) {
// CHANGED
ArrayXd pts(0.0,N);
floatT pi_twoN = M_PI / (2.0*N);
for (int k=0; k<N; ++k)
pts[k] = cos( (2.0*k + 1.0) * pi_twoN );
return pts;
}
class Chebyshev {
private:
ArrayXd c; // coefficients
ArrayXd f; // function value at nodes
public:
Chebyshev(int);
Chebyshev(ArrayXd const &, int);
Chebyshev(ArrayXd const &, ArrayXd const &);
floatT value(floatT x) {return Chebyshev_value(x, c);};
void update_coefs(void);
void update_vals(void);
void normalize(floatT);
void positives(floatT);
void set_vals(ArrayXd const &);
void set_coefs(ArrayXd const &);
ArrayXd coefs(void){return c;};
ArrayXd vals(void){return f;};
ArrayXd integral_vals(floatT, bool);
Chebyshev integrate(floatT, bool);
Chebyshev operator-();
void operator/=(floatT);
};
Chebyshev::Chebyshev(int n=4) {
c.resize(n,0.0);
c[0] = 1.0;
f.resize(n,1.0);
}
Chebyshev::Chebyshev(ArrayXd const &a, int init_cond=0) {
if (init_cond == INIT_BY_VALUES) {
f = a;
update_coefs();
}
else {
c = a;
update_vals();
}
}
Chebyshev::Chebyshev(ArrayXd const &c_in, ArrayXd const &f_in) {
c = c_in;
f = f_in;
}
void Chebyshev::update_coefs(void){
// CHANGED
c = dct2(f);
c /= c.size();
c[0] /= 2.0;
}
void Chebyshev::update_vals(void){
// CHANGED
ArrayXd c_transform = c;
c_transform[0] *= 2.0;
f = dct3(c_transform) / 2.0;
}
// rescale so that integral over [-1,1] = 1
void Chebyshev::normalize(floatT value=1.0) {
ArrayXd c_integral = Chebyshev_coef_integrate(c);
floatT Z = value/Chebyshev_value(1.0,c_integral);
c *= Z;
f *= Z;
}
void Chebyshev::positives(floatT value=10e-16) {
ArrayXd f_new = f;
for (int i=0; i<f_new.size(); ++i)
if (f_new[i]<0.0) f_new[i]=value;
f = f_new;
//f = abs(f);
update_coefs();
}
ArrayXd Chebyshev::integral_vals(floatT lbnd=-1.0, bool keep_order=false) {
ArrayXd c_integral = Chebyshev_coef_integrate(c, lbnd, keep_order);
c_integral[0] *= 2.0;
return dct3(c_integral) / 2.0;
}
Chebyshev Chebyshev::integrate(floatT lbnd=-1.0, bool keep_order=false) {
ArrayXd c_integral = Chebyshev_coef_integrate(c, lbnd, keep_order);
Chebyshev ans(c_integral, INIT_BY_COEFS);
return ans;
}
void Chebyshev::set_vals(ArrayXd const &new_vals) {
f = new_vals;
update_coefs();
}
void Chebyshev::set_coefs(ArrayXd const &new_coefs) {
c = new_coefs;
update_vals();
}
Chebyshev Chebyshev::operator-() {
Chebyshev ans(-c,-f);
return ans;
}
void Chebyshev::operator/=(floatT Z) {
c /= Z;
f /= Z;
}
}
| 23.736585
| 77
| 0.581587
|
gcant
|
a1220eecb2b2e7348828cef033077f7451fd5e4b
| 4,592
|
cpp
|
C++
|
tasks/FrameSampler.cpp
|
PhischDotOrg/stm32f4-common
|
4b6b9c436018c89d3668c6ee107e97abb930bae2
|
[
"MIT"
] | 1
|
2022-01-31T01:59:52.000Z
|
2022-01-31T01:59:52.000Z
|
tasks/FrameSampler.cpp
|
PhischDotOrg/stm32-common
|
4b6b9c436018c89d3668c6ee107e97abb930bae2
|
[
"MIT"
] | 5
|
2020-04-13T21:55:12.000Z
|
2020-06-27T17:44:44.000Z
|
tasks/FrameSampler.cpp
|
PhischDotOrg/stm32f4-common
|
4b6b9c436018c89d3668c6ee107e97abb930bae2
|
[
"MIT"
] | null | null | null |
/*-
* $Copyright$
-*/
#include "tasks/FrameSampler.hpp"
#ifndef _FRAMESAMPLER_CPP_aa6ac2c3_3489_4a38_8642_30cdd3943a2a
#define _FRAMESAMPLER_CPP_aa6ac2c3_3489_4a38_8642_30cdd3943a2a
#if defined(__cplusplus)
extern "C" {
#endif /* defined(__cplusplus) */
#include "FreeRTOS/FreeRTOS.h"
#include "FreeRTOS/task.h"
#include "FreeRTOS/queue.h"
#include "FreeRTOS/semphr.h"
#if defined(__cplusplus)
} /* extern "C" */
#endif /* defined(__cplusplus) */
namespace tasks {
/*******************************************************************************
*
******************************************************************************/
template<typename BufferT, size_t N, class TimerChannelT, class AdcT, typename UartT>
FrameSamplerT<BufferT, N, TimerChannelT, AdcT, UartT>::FrameSamplerT(const char * const p_name, const unsigned p_priority,
UartT &p_uart, BufferT (&p_frames)[N], TimerChannelT &p_timerChannel, AdcT &p_adc, const unsigned p_periodMs)
: Task(p_name, p_priority), m_uart(p_uart), m_frames(p_frames), m_timerChannel(p_timerChannel), m_adc(p_adc),
m_current(0), m_periodMs(p_periodMs), m_txQueue(NULL) {
}
/*******************************************************************************
*
******************************************************************************/
template<typename BufferT, size_t N, class TimerChannelT, class AdcT, typename UartT>
FrameSamplerT<BufferT, N, TimerChannelT, AdcT, UartT>::~FrameSamplerT() {
}
/*******************************************************************************
*
******************************************************************************/
template<typename BufferT, size_t N, class TimerChannelT, class AdcT, typename UartT>
void
FrameSamplerT<BufferT, N, TimerChannelT, AdcT, UartT>::run(void) {
this->m_uart.printf("Task '%s' starting...\r\n", this->m_name);
TickType_t lastWakeTime = xTaskGetTickCount();
const TickType_t period = (this->m_periodMs * 1000) / portTICK_RATE_MICROSECONDS;
/* Can't do this in the constructor; FreeRTOS must be running */
for (unsigned i = 0; i < N; i++) {
this->m_frames[i].unlock();
}
/*
* This sets up the timer channel to toggle whenever the counter value reaches
* zero. In effect, this means the timer channel output toggles with double
* the period of the timer overflow.
*/
this->m_timerChannel.setup(0, TimerChannelT::Timer_t::e_TimerViaSTM32F4_OCM_Toggle);
this->m_adc.setupResolution(AdcT::e_AdcResolution_8Bit);
this->m_adc.setupChannel(AdcT::e_AdcChannel_9, AdcT::e_AdcRank_1, AdcT::e_ADC_SampleTime_3Cycles);
this->m_adc.setupExternalTrigger(AdcT::e_AdcTrigger_Timer4_CC4, AdcT::e_AdcTriggerEnable_BothEdges);
this->m_timerChannel.enable();
for (BufferT *buffer = &this->m_frames[0]; ; buffer = &this->m_frames[++this->m_current % N]) {
/*
* This ensures a constant wait time between loop executions. See the
* documentation of vTaskDelayUntil() for details.
*/
if (this->m_periodMs)
vTaskDelayUntil(&lastWakeTime, period);
if (buffer->lock() != 0) {
this->m_uart.printf("%s(): Failed to lock buffer %u. Aborting!\r\n",
this->m_name, this->m_current % N);
break;
};
int rc = this->m_adc.sample(buffer->data(), sizeof(uint16_t), buffer->size(), this->m_periodMs);
if (buffer->unlock() != 0) {
this->m_uart.printf("%s(): Failed to unlock buffer %u. Aborting!\r\n",
this->m_name, this->m_current % N);
break;
}
if (rc == 0) {
/*
* This copies n bytes from &buffer into the queue. The value n is
* configured as sizeof(BufferT*) when the queue was created). So
* basically, this copies the contents of the buffer pointer to the
* queue which, in effect, writes a BufferT * to the queue.
*/
if (xQueueSend(*this->m_txQueue, &buffer, 0) != pdTRUE) {
this->m_uart.printf("%s(): Failed to post buffer %d to queue. Aborting!\r\n",
this->m_name, this->m_current % N);
break;
}
} else {
this->m_uart.printf("%s(): Failed to fill frame buffer with samples!\r\n", this->m_name);
}
};
this->m_timerChannel.disable();
this->m_uart.printf("%s() ended!\r\n", this->m_name);
halt(__FILE__, __LINE__);
}
} /* namespace tasks */
#endif /* _FRAMESAMPLER_CPP_aa6ac2c3_3489_4a38_8642_30cdd3943a2a */
| 38.588235
| 122
| 0.581664
|
PhischDotOrg
|
a123ca6891a64c4a038b934c836d94c815b37648
| 10,156
|
cpp
|
C++
|
libraries/utils/spectra.cpp
|
ChunmingGu/mne-cpp-master
|
36f21b3ab0c65a133027da83fa8e2a652acd1485
|
[
"BSD-3-Clause"
] | null | null | null |
libraries/utils/spectra.cpp
|
ChunmingGu/mne-cpp-master
|
36f21b3ab0c65a133027da83fa8e2a652acd1485
|
[
"BSD-3-Clause"
] | null | null | null |
libraries/utils/spectra.cpp
|
ChunmingGu/mne-cpp-master
|
36f21b3ab0c65a133027da83fa8e2a652acd1485
|
[
"BSD-3-Clause"
] | null | null | null |
//=============================================================================================================
/**
* @file spectra.h
* @author Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>;
* Lorenz Esch <lorenz.esch@tu-ilmenau.de>;
* Matti Hamalainen <msh@nmr.mgh.harvard.edu>
* @version 1.0
* @date January, 2018
*
* @section LICENSE
*
* Copyright (C) 2018, Daniel Strohmeier, Lorenz Esch and Matti Hamalainen. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that
* the following conditions are met:
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * Neither the name of MNE-CPP authors nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*
* @brief Declaration of Spectra class.
*/
//*************************************************************************************************************
//=============================================================================================================
// INCLUDES
//=============================================================================================================
#include "spectra.h"
#include "math.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288
#endif
//*************************************************************************************************************
//=============================================================================================================
// Eigen INCLUDES
//=============================================================================================================
#include <unsupported/Eigen/FFT>
//*************************************************************************************************************
//=============================================================================================================
// USED NAMESPACES
//=============================================================================================================
using namespace UTILSLIB;
using namespace Eigen;
//*************************************************************************************************************
//=============================================================================================================
// DEFINE MEMBER METHODS
//=============================================================================================================
TaperedSpectralData Spectra::computeTaperedSpectra(const Eigen::MatrixXd &matData, const double &dSampFreq,
const QString &sWindowType, int iNfft, bool bZeroPad,
bool bRemoveMean)
{
Eigen::FFT<double> fft;
fft.SetFlag(fft.HalfSpectrum);
//Initialize SpectralData struct
TaperedSpectralData returnData;
int iSignalLength = matData.cols();
returnData.iSignalLength = iSignalLength;
//Remove mean if requested
MatrixXd matInputData = matData;
if (bRemoveMean == true){
for (int n = 0; n < matData.rows(); n++) {
matInputData.row(n).array() -= matInputData.row(n).mean();
}
}
else {
matInputData = matData;
}
returnData.bMeanRemoved = bRemoveMean;
//Compute the tapers
MatrixXd matTapers;
returnData.sMethod = sWindowType;
if (sWindowType == "hanning") {
matTapers = hanningWindow(iSignalLength);
returnData.vecTaperWeights = VectorXcd::Ones(1);
} else if (sWindowType == "ones") {
matTapers = MatrixXd::Ones(1, iSignalLength);
returnData.vecTaperWeights = VectorXcd::Ones(1);
} else {
matTapers = hanningWindow(iSignalLength);
returnData.vecTaperWeights = VectorXcd::Ones(1);
returnData.sMethod = "hanning";
}
returnData.iNumTapers = matTapers.rows();
//Compute the FFT size
if (iNfft < iSignalLength) {
iNfft = iSignalLength;
}
if (bZeroPad == true) {
int b = ceil(log2(2.0 * iNfft - 1));
iNfft = pow(2,b);
}
returnData.iNfft = iNfft;
//Compute FFT frequencies
RowVectorXd vecFreqBins;
if (iNfft % 2 == 0){
vecFreqBins = (dSampFreq / iNfft) * RowVectorXd::LinSpaced(iNfft / 2.0 + 1, 0.0, iNfft / 2.0);
} else {
vecFreqBins = (dSampFreq / iNfft) * RowVectorXd::LinSpaced((iNfft - 1) / 2.0 + 1, 0.0, (iNfft - 1) / 2.0);
}
returnData.vecFreqBins = vecFreqBins;
returnData.dSampFreq = dSampFreq;
//FFT for freq domain returning the half spectrum
RowVectorXcd vecTmpFreq;
MatrixXcd matTmpFreq;
RowVectorXcd vecInputFFT;
for (int k = 0; k < matData.rows(); k++) {
for (int i=0; i < returnData.iNumTapers; i++) {
vecInputFFT = matData.row(k).cwiseProduct(matTapers.row(i));
fft.fwd(vecTmpFreq, vecInputFFT, iNfft);
matTmpFreq.row(i) = vecTmpFreq;
}
returnData.vecData.append(matTmpFreq);
}
return returnData;
}
//*************************************************************************************************************
PsdData Spectra::psdFromTaperedSpectra(const TaperedSpectralData &structSpectral, RowVectorXi vecIndices)
{
//Initialize PsdData struct
PsdData returnData;
returnData.sMethod = structSpectral.sMethod;
//Check whether half spectrum shall be returned
returnData.vecFreqBins = structSpectral.vecFreqBins;
int numFreqBins = returnData.vecFreqBins.cols();
//Compute PSD for each channel in vecIndices (use all if empty)
if (vecIndices.size() == 0) {
vecIndices = RowVectorXi::LinSpaced(structSpectral.vecData.length(), 0, structSpectral.vecData.length() - 1);
}
MatrixXd matPsd = MatrixXd::Zero(vecIndices.cols(),numFreqBins);
VectorXcd vecTaperWeights = structSpectral.vecTaperWeights;
double denom = vecTaperWeights.cwiseAbs2().sum();
for (int i=0; i < vecIndices.cols(); i++) {
//Average over tapers
MatrixXcd matTapSpectra = structSpectral.vecData.at(vecIndices(i));
RowVectorXd psd = (vecTaperWeights.asDiagonal() * matTapSpectra.leftCols(numFreqBins)).cwiseAbs2().colwise().sum() / denom;
//multiply by 2 due to half spectrum
if (returnData.vecFreqBins.maxCoeff() == structSpectral.dSampFreq / 2.0) {
psd = psd.segment(1, numFreqBins - 2) * 2.0;
} else {
psd = psd.segment(1, numFreqBins - 1) * 2.0;
}
matPsd.row(i) = psd;
}
returnData.matPsd = matPsd;
returnData.vecIndices = vecIndices;
return returnData;
}
//*************************************************************************************************************
CsdData Spectra::csdFromTaperedSpectra(const TaperedSpectralData &structSpectral, int iIndexSeed,
RowVectorXi vecIndices)
{
//Initialize PsdData struct
CsdData returnData;
returnData.sMethod = structSpectral.sMethod;
//Check whether half spectrum shall be returned
returnData.vecFreqBins = structSpectral.vecFreqBins.head(structSpectral.iNfft / 2 + 1);
int numFreqBins = returnData.vecFreqBins.cols();
//Compute CSD for each channel in vecIndices (use all if empty)
if (vecIndices.size() == 0) {
vecIndices = RowVectorXi::LinSpaced(structSpectral.vecData.length(), 0, structSpectral.vecData.length() - 1);
}
MatrixXcd matCsd = MatrixXcd::Zero(vecIndices.cols(),numFreqBins);
VectorXcd vecTaperWeights = structSpectral.vecTaperWeights;
MatrixXcd matTapSpectraSeed = structSpectral.vecData.at(iIndexSeed).leftCols(numFreqBins);
double denom = vecTaperWeights.cwiseAbs2().sum(); //We use fix weights (adaptive weights not implemented)
for (int i=0; i < vecIndices.cols(); i++) {
//Average over tapers
MatrixXcd matTapSpectra = structSpectral.vecData.at(vecIndices(i));
RowVectorXcd csd = (vecTaperWeights.asDiagonal() * matTapSpectraSeed).cwiseProduct((vecTaperWeights.asDiagonal() * matTapSpectra).conjugate()).colwise().sum();
//multiply by 2 due to half spectrum
if (returnData.vecFreqBins.maxCoeff() == structSpectral.dSampFreq / 2.0) {
csd = csd.segment(1, numFreqBins - 2) * 2.0;
} else {
csd = csd.segment(1, numFreqBins - 1) * 2.0;
}
matCsd.row(i) = csd / denom;
}
returnData.matCsd = matCsd;
returnData.iIndexSeed = iIndexSeed;
returnData.vecIndices = vecIndices;
return returnData;
}
//*************************************************************************************************************
MatrixXd Spectra::hanningWindow(int iSignalLength)
{
MatrixXd matHann = MatrixXd::Zero(1, iSignalLength);
//Main step of building the hanning window
for (int n = 0; n < iSignalLength; n++) {
matHann(1,n) = 0.5 * (1.0 - cos(2.0 * M_PI * n / (iSignalLength - 1.0)));
}
return matHann;
}
| 42.316667
| 167
| 0.553564
|
ChunmingGu
|
a1241e1c98e56dbb93a647909133edf55e965941
| 2,588
|
hpp
|
C++
|
hull/reflection.hpp
|
loic-yvonnet/convex-hull-
|
9dcb17abea8a0f5de0f3fe114c612b10f96ab422
|
[
"MIT"
] | 1
|
2018-01-25T07:45:08.000Z
|
2018-01-25T07:45:08.000Z
|
hull/reflection.hpp
|
loic-yvonnet/convex-hull-
|
9dcb17abea8a0f5de0f3fe114c612b10f96ab422
|
[
"MIT"
] | null | null | null |
hull/reflection.hpp
|
loic-yvonnet/convex-hull-
|
9dcb17abea8a0f5de0f3fe114c612b10f96ab422
|
[
"MIT"
] | 1
|
2020-10-01T18:42:59.000Z
|
2020-10-01T18:42:59.000Z
|
/**
* Basic reflection facilities
* Reflection is not part of C++14/17. However, C++11/14 introduced decltype
* and auto facilities. These facilities simplify and tidy up the SFINAE-based
* techniques to query and introspect a type at compile-time.
* The following implementation benefits from these facilities.
* References:
* - https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Member_Detector
* - https://stackoverflow.com/questions/257288/is-it-possible-to-write-a-template-to-check-for-a-functions-existence
*/
#ifndef reflection_h
#define reflection_h
#include <type_traits>
#include <utility>
/**
* The HAS_MEMBER macro generates 2 overloads of a template function nested in the
* details::has_member::#member namespace. These functions' overloads have no
* definition since they are never called at runtime. The 1st overload checks
* whether the #member exists in the definition of its template parameter. If so,
* this overload is used for overload resolution. This overload returns true.
* Otherwise, if the #member does not exist in the definition of the template
* parameter, the other overload is used for overload resolution. This second
* overload returns false.
* The HAS_MEMBER macro generates a template structure which inherits from the
* result of the compile-time overload resolution of a call to the above test
* function. Therefore, if the template parameter has the requested member, the
* structure inherits from true_type, and false_type otherwise.
* This is how we query for the existence of a data member within a type T.
*/
#define HAS_MEMBER(member) \
\
namespace details { \
namespace has_member { \
namespace member { \
template <typename T> \
static auto test(int) -> decltype(std::declval<T>().member, std::true_type()); \
\
template <typename> \
static auto test(long) -> std::false_type; \
} \
} \
} \
\
template<class T> \
struct has_member_##member : decltype(details::has_member::member::test<T>(0)) {};
/**
* Exactly the same idea for methods
*/
#define HAS_METHOD(method) \
\
namespace details { \
namespace has_method { \
namespace method { \
template <typename T> \
static auto test(int) -> decltype(std::declval<T>().method(), std::true_type()); \
\
template <typename> \
static auto test(long) -> std::false_type; \
} \
} \
} \
\
template<class T> \
struct has_method_##method : decltype(details::has_method::method::test<T>(0)) {};
#endif
| 36.450704
| 118
| 0.690108
|
loic-yvonnet
|
a126533a1db605f4344eb2d49b433ea075aac254
| 445
|
cc
|
C++
|
src/core/ecs/Component.cc
|
ilariom/wildcat
|
814f054e0cf3ef0def1f6481005ffd3f0ac42d1b
|
[
"MIT"
] | 11
|
2018-11-07T08:54:21.000Z
|
2022-02-20T22:40:47.000Z
|
src/core/ecs/Component.cc
|
ilariom/wildcat
|
814f054e0cf3ef0def1f6481005ffd3f0ac42d1b
|
[
"MIT"
] | null | null | null |
src/core/ecs/Component.cc
|
ilariom/wildcat
|
814f054e0cf3ef0def1f6481005ffd3f0ac42d1b
|
[
"MIT"
] | 1
|
2020-07-24T09:18:48.000Z
|
2020-07-24T09:18:48.000Z
|
#include "Component.h"
namespace wkt {
namespace ecs
{
namespace {
Component::ComponentUniqueID uid = 0;
}
Component::Component() : id(uid++)
{ }
Component::Component(const Component& comp)
{
this->id = uid++;
this->entity = comp.entity;
}
Component& Component::operator=(const Component& comp)
{
this->id = uid++;
this->entity = comp.entity;
return *this;
}
bool Component::unique() const
{
return true;
}
}}
| 13.90625
| 54
| 0.640449
|
ilariom
|
a128d049e083d1e0c9b0114bca94b15e7bb5cd96
| 24,474
|
cpp
|
C++
|
apps/lite_dbproxy/main.cpp
|
cxxjava/CxxDBC
|
01bee98aa407c9e762cf75f63a2c21942968cf0a
|
[
"Apache-2.0"
] | 20
|
2017-09-01T08:56:25.000Z
|
2021-03-18T11:07:38.000Z
|
apps/lite_dbproxy/main.cpp
|
foolishantcat/CxxDBC
|
f0f9e95baad72318e7fe53231aeca2ffa4a8b574
|
[
"Apache-2.0"
] | null | null | null |
apps/lite_dbproxy/main.cpp
|
foolishantcat/CxxDBC
|
f0f9e95baad72318e7fe53231aeca2ffa4a8b574
|
[
"Apache-2.0"
] | 14
|
2017-09-01T12:23:36.000Z
|
2021-09-02T01:06:27.000Z
|
/*
* main.cpp
*
* Created on: 2017-7-17
* Author: cxxjava@163.com
*/
#include "es_main.h"
#include "ENaf.hh"
#include "EUtils.hh"
#include "../../interface/EDBInterface.h"
#include "../../dblib/inc/EDatabase.hh"
using namespace efc::edb;
#define PROXY_VERSION "version 0.2.0"
#define PID_FILE "./DBPROXY.pid"
#define DEFAULT_CONNECT_PORT 6633
#define DEFAULT_CONNECT_SSL_PORT 6643
#define DBLIB_STATIC 0
#define LOG(fmt,...) ESystem::out->printfln(fmt, ##__VA_ARGS__)
extern "C" {
extern efc::edb::EDatabase* makeDatabase(EDBProxyInf* proxy);
typedef efc::edb::EDatabase* (make_database_t)(EDBProxyInf* proxy);
}
static sp<ELogger> wlogger;
static sp<ELogger> slogger;
//=============================================================================
struct VirtualDB: public EObject {
EString alias_dbname;
int connectTimeout;
int socketTimeout;
EString dbType;
EString clientEncoding;
EString database;
EString host;
int port;
EString username;
EString password;
VirtualDB(EString& alias, int ct, int st, EString& dt, EString& ce, EString& db, EString& h, int port, EString& usr, EString& pwd) :
alias_dbname(alias),
connectTimeout(ct),
socketTimeout(st),
dbType(dt),
clientEncoding(ce),
database(db),
host(h),
port(port),
username(usr),
password(pwd) {
}
};
struct QueryUser: public EObject {
EString username;
EString password;
VirtualDB *virdb;
QueryUser(const char* username, const char* password, VirtualDB* vdb):
username(username), password(password), virdb(vdb) {
}
};
class VirtualDBManager: public EObject {
public:
VirtualDBManager(EConfig& conf): conf(conf) {
EConfig* subc = conf.getConfig("DBLIST");
if (!subc) {
throw EIllegalArgumentException(__FILE__, __LINE__, "[DBLIST] is null.");
}
EArray<EString*> usrs = subc->keyNames();
for (int i=0; i<usrs.size(); i++) {
const char* alias_dbname = usrs[i]->c_str();
EString url = subc->getString(alias_dbname);
VirtualDB* vdb = parseUrl(alias_dbname, url.c_str());
if (vdb) {
virdbMap.put(new EString(alias_dbname), vdb);
}
}
}
EHashMap<EString*,VirtualDB*>& getDBMap() {
return virdbMap;
}
VirtualDB* getVirtualDB(EString* alias_dbname) {
return virdbMap.get(alias_dbname);
}
private:
EConfig& conf;
EHashMap<EString*,VirtualDB*> virdbMap;
VirtualDB* parseUrl(EString alias_dbname, const char* url) {
if (!url || !*url) {
throw ENullPointerException(__FILE__, __LINE__);
}
if (eso_strncmp(url, "edbc:", 5) != 0) {
throw EProtocolException(__FILE__, __LINE__, "edbc:");
}
//edbc:[DBTYPE]://host:port/database?connectTimeout=xxx&socketTimeout=xxx&clientEncoding=xxx&username=xxx&password=xxx
EURI uri(url + 5 /*edbc:*/);
EString dbType = uri.getScheme();
EString host = uri.getHost();
int port = uri.getPort();
EString database = uri.getPath();
database = database.substring(1); //index 0 is '/'
int connectTimeout = 30;
int socketTimeout = 30;
EString clientEncoding("utf8");
EString ct = uri.getParameter("connectTimeout");
if (!ct.isEmpty()) {
connectTimeout = EInteger::parseInt(ct.c_str());
}
EString st = uri.getParameter("socketTimeout");
if (!st.isEmpty()) {
socketTimeout = EInteger::parseInt(st.c_str());
}
EString ce = uri.getParameter("clientEncoding");
if (!ce.isEmpty()) {
clientEncoding = ce;
}
if (database.isEmpty() || host.isEmpty() || database.isEmpty()) {
throw EIllegalArgumentException(__FILE__, __LINE__, "url");
}
if (port == -1) {
port = DEFAULT_CONNECT_PORT;
}
EString username = uri.getParameter("username");
EString password = uri.getParameter("password");
return new VirtualDB(alias_dbname, connectTimeout, socketTimeout, dbType,
clientEncoding, database, host, port, username, password);
}
};
class VirtualUserManager: public EObject {
public:
VirtualUserManager(EConfig& conf, VirtualDBManager& dbs): conf(conf), dbs(dbs) {
EConfig* subc = conf.getConfig("USERMAP");
if (!subc) {
throw EIllegalArgumentException(__FILE__, __LINE__, "[USERMAP] is null.");
}
EArray<EString*> usrs = subc->keyNames();
for (int i=0; i<usrs.size(); i++) {
const char* username = usrs[i]->c_str();
EString value = subc->getString(username);
EArray<EString*> ss = EPattern::split(",", value.c_str());
if (ss.size() >= 2) {
userMap.put(new EString(username), new QueryUser(username, ss[1]->c_str(), dbs.getVirtualDB(ss[0])));
}
}
}
EHashMap<EString*,QueryUser*>& getUserMap() {
return userMap;
}
QueryUser* checkUser(const char* username, const char* password, llong timestamp) {
EString u(username);
QueryUser* user = userMap.get(&u);
if (user) {
u.append(user->password).append(timestamp);
byte pw[ES_MD5_DIGEST_LEN] = {0};
es_md5_ctx_t c;
eso_md5_init(&c);
eso_md5_update(&c, (const unsigned char *)u.c_str(), u.length());
eso_md5_final((es_uint8_t*)pw, &c);
if (EString::toHexString(pw, ES_MD5_DIGEST_LEN).equalsIgnoreCase(password)) {
return user;
}
}
return null;
}
private:
EConfig& conf;
VirtualDBManager& dbs;
EHashMap<EString*,QueryUser*> userMap;
};
class DBSoHandleManager: public EObject {
public:
~DBSoHandleManager() {
soCloseAll();
}
DBSoHandleManager(EConfig& conf): conf(conf) {
EConfig* subc = conf.getConfig("DBTYPE");
if (!subc) {
throw EIllegalArgumentException(__FILE__, __LINE__, "[DBTYPE] is null.");
}
}
void soOpenAll() {
es_string_t* path = NULL;
eso_current_workpath(&path);
EString dsopath(path);
eso_mfree(path);
EConfig* subc = conf.getConfig("DBTYPE");
EArray<EString*> bdb = subc->keyNames();
for (int i=0; i<bdb.size(); i++) {
const char* dbtype = bdb[i]->c_str();
boolean on = subc->getBoolean(dbtype, false);
if (on) {
EString dsofile(dsopath);
dsofile.append("/dblib/")
#ifdef __APPLE__
.append("/osx/")
#else //__linux__
.append("/linux/")
#endif
.append(dbtype).append(".so");
es_dso_t* handle = eso_dso_load(dsofile.c_str());
if (!handle) {
throw EFileNotFoundException(__FILE__, __LINE__, dsofile.c_str());
}
#if DBLIB_STATIC
make_database_t* func = (make_database_t*)makeDatabase;
#else
make_database_t* func = (make_database_t*)eso_dso_sym(handle, "makeDatabase");
#endif
if (!func) {
eso_dso_unload(&handle);
throw ERuntimeException(__FILE__, __LINE__, "makeDatabase");
}
SoHandle *sh = new SoHandle();
sh->handle = handle;
sh->func = func;
handles.put(new EString(dbtype), sh);
}
}
}
void soCloseAll() {
sp<EIterator<SoHandle*> > iter = handles.values()->iterator();
while (iter->hasNext()) {
SoHandle* sh = iter->next();
eso_dso_unload(&sh->handle);
}
handles.clear();
}
void testConnectAll() {
ON_FINALLY_NOTHROW(
soCloseAll();
) {
soOpenAll();
LOG("virtual database connecting test...");
VirtualDBManager dbmgr(conf);
EHashMap<EString*,VirtualDB*>& dbmap = dbmgr.getDBMap();
sp<EIterator<VirtualDB*> > iter = dbmap.values()->iterator();
while (iter->hasNext()) {
VirtualDB* vdb = iter->next();
sp<EDatabase> db = getDatabase(vdb->dbType.c_str(), null);
if (db == null) {
continue;
}
boolean r = db->open(vdb->database.c_str(), vdb->host.c_str(),
vdb->port, vdb->username.c_str(),
vdb->password.c_str(), vdb->clientEncoding.c_str(),
vdb->connectTimeout);
if (!r) {
EString msg = EString::formatOf("open database [%s] failed: (%s)",
vdb->alias_dbname.c_str(), db->getErrorMessage().c_str());
throw EException(__FILE__, __LINE__, msg.c_str());
}
LOG("virtual database [%s] connect success.", vdb->alias_dbname.c_str());
}
}}
}
sp<EDatabase> getDatabase(const char* dbtype, EDBProxyInf* proxy) {
EString key(dbtype);
SoHandle *sh = handles.get(&key);
if (!sh) return null;
make_database_t* func = sh->func;
return func(proxy);
}
private:
struct SoHandle: public EObject {
es_dso_t *handle;
make_database_t *func;
};
EConfig& conf;
EHashMap<EString*,SoHandle*> handles;
};
static edb_pkg_head_t read_pkg_head(EInputStream* is) {
edb_pkg_head_t pkg_head;
char *b = (char*)&pkg_head;
int len = sizeof(edb_pkg_head_t);
int n = 0;
while (n < len) {
int count = is->read(b + n, len - n);
if (count < 0)
throw EEOFEXCEPTION;
n += count;
}
//check falg
if (pkg_head.magic != 0xEE) {
throw EIOException(__FILE__, __LINE__, "flag error");
}
//check crc32
ECRC32 crc32;
crc32.update((byte*)&pkg_head, sizeof(pkg_head)-sizeof(pkg_head.crc32));
pkg_head.crc32 = ntohl(pkg_head.crc32);
if (pkg_head.crc32 != crc32.getValue()) {
throw EIOException(__FILE__, __LINE__, "crc32 error");
}
pkg_head.reqid = ntohl(pkg_head.reqid);
pkg_head.pkglen = ntohl(pkg_head.pkglen);
return pkg_head;
}
static void write_pkg_head(EOutputStream* os, int type,
boolean next, int length, uint reqid=0) {
edb_pkg_head_t pkg_head;
memset(&pkg_head, 0, sizeof(pkg_head));
pkg_head.magic = 0xEE;
pkg_head.type = type;
pkg_head.gzip = 0;
pkg_head.next = next ? 1 : 0;
pkg_head.pkglen = htonl(length);
pkg_head.reqid = htonl(reqid);
ECRC32 crc32;
crc32.update((byte*)&pkg_head, sizeof(pkg_head)-sizeof(pkg_head.crc32));
pkg_head.crc32 = htonl(crc32.getValue());
os->write(&pkg_head, sizeof(pkg_head));
}
class PackageInputStream: public EInputStream {
public:
PackageInputStream(EInputStream* cis): cis(cis) {
}
virtual int read(void *b, int len) THROWS(EIOException) {
if (bis == null) {
head = read_pkg_head(cis);
if (head.gzip) {
tis = new EBoundedInputStream(cis, head.pkglen);
bis = new EGZIPInputStream(tis.get());
} else {
bis = new EBoundedInputStream(cis, head.pkglen);
}
}
int r = bis->read(b, len);
if ((r == -1 || r == 0) && head.next) { //next
head = read_pkg_head(cis);
if (head.pkglen > 0) {
if (head.gzip) {
tis = new EBoundedInputStream(cis, head.pkglen);
bis = new EGZIPInputStream(tis.get());
} else {
bis = new EBoundedInputStream(cis, head.pkglen);
}
return bis->read(b, len);
} else {
return -1; //EOF
}
} else {
return r;
}
}
private:
EInputStream* cis;
sp<EInputStream> tis;
sp<EInputStream> bis;
edb_pkg_head_t head;
};
#define MAX_PACKAGE_SIZE 32*1024 //32k
class PackageOutputStream: public EOutputStream {
public:
PackageOutputStream(EOutputStream* cos): cos(cos), buf(MAX_PACKAGE_SIZE + 8192) {
}
virtual void write(const void *b, int len) THROWS(EIOException) {
if (b && len > 0) {
buf.append(b, len);
if (buf.size() >= MAX_PACKAGE_SIZE) {
EByteArrayOutputStream baos;
EGZIPOutputStream gos(&baos);
gos.write(buf.data(), buf.size());
gos.finish();
//write head
write_pkg_head(cos, 1, true, true, baos.size());
//write body
cos->write(baos.data(), baos.size());
//reset buf
buf.clear();
}
} else {
//end stream
if (buf.size() > 0) {
EByteArrayOutputStream baos;
EGZIPOutputStream gos(&baos);
gos.write(buf.data(), buf.size());
gos.finish();
//write head
write_pkg_head(cos, 1, true, false, baos.size());
//write body
cos->write(baos.data(), baos.size());
//reset buf
buf.clear();
} else {
write_pkg_head(cos, 1, false, false, 0);
}
}
}
private:
EOutputStream* cos;
EByteBuffer buf;
};
class DBProxyServer: public ESocketAcceptor, virtual public EDBProxyInf {
public:
~DBProxyServer() {
somgr.soCloseAll();
executors->shutdown();
executors->awaitTermination();
delete executors;
}
DBProxyServer(EConfig& conf) :
conf(conf), somgr(conf), dbmgr(conf), usrmgr(conf, dbmgr) {
somgr.soOpenAll();
executors = EExecutors::newCachedThreadPool();
}
static void onConnection(sp<ESocketSession> session, ESocketAcceptor::Service* service) {
wlogger->trace_("onConnection: service=%s, client=%s", service->toString().c_str(),
session->getRemoteAddress()->getAddress()->getHostAddress().c_str());
DBProxyServer* acceptor = dynamic_cast<DBProxyServer*>(session->getService());
sp<EDatabase> database;
sp<ESocket> socket = session->getSocket();
EInputStream* cis = socket->getInputStream();
EOutputStream* cos = socket->getOutputStream();
while(!session->getService()->isDisposed()) {
//req
EBson req;
try {
edb_pkg_head_t pkg_head = read_pkg_head(cis);
if (pkg_head.type != 0) { //非主请求
wlogger->error("request error.");
break;
}
EBoundedInputStream bis(cis, pkg_head.pkglen);
if (pkg_head.gzip) {
EGZIPInputStream gis(&bis);
EBsonParser bp(&gis);
bp.nextBson(&req);
} else {
EBsonParser bp(&bis);
bp.nextBson(&req);
}
} catch (ESocketTimeoutException& e) {
continue;
} catch (EEOFException& e) {
wlogger->trace("session client closed.");
break;
} catch (EIOException& e) {
wlogger->error("session read error.");
break;
}
//db open.
EString errmsg("unknown error.");
if (req.getInt(EDB_KEY_MSGTYPE) == DB_SQL_DBOPEN) {
database = doDBOpen(session, req, errmsg);
}
if (database == null) {
wlogger->warn(errmsg.c_str());
responseFailed(cos, errmsg);
break;
}
//交由线程池去执行,以免协程阻塞
EFiberChannel<EBson> channel(0);
acceptor->executors->executeX([&database, &req, &channel, cis, cos, socket]() {
//协程时自动切换到非阻塞模式,这里要显示设置到阻塞模式。
ENetWrapper::configureBlocking(socket->getFD(), true);
sp<EBson> rep;
int opt = req.getInt(EDB_KEY_MSGTYPE);
if (opt == DB_SQL_EXECUTE || opt == DB_SQL_UPDATE) {
class BoundedIterator: public EIterator<EInputStream*> {
public:
BoundedIterator(EInputStream* cis): cis(cis) {}
virtual boolean hasNext() {
return true;
}
virtual EInputStream* next() {
iss = new PackageInputStream(cis);
return iss.get();
}
virtual void remove() { }
virtual EInputStream* moveOut() { return null; }
private:
EInputStream* cis;
sp<EInputStream> iss;
};
class BoundedIterable: public EIterable<EInputStream*> {
public:
BoundedIterable(EInputStream* cis): cis(cis) {}
virtual sp<EIterator<EInputStream*> > iterator(int index=0) {
return new BoundedIterator(cis);
}
private:
EInputStream* cis;
};
BoundedIterable bi(cis);
rep = database->processSQL(&req, &bi);
} else if (opt == DB_SQL_LOB_WRITE) {
PackageInputStream pis(cis);
rep = database->processSQL(&req, &pis);
} else if (opt == DB_SQL_LOB_READ) {
PackageOutputStream pos(cos);
rep = database->processSQL(&req, &pos);
} else {
rep = database->processSQL(&req, null);
}
//恢复状态
ENetWrapper::configureBlocking(socket->getFD(), false);
channel.write(rep);
});
//rep
sp<EBson> rep = channel.read();
ES_ASSERT(rep != null);
EByteBuffer buf;
rep->Export(&buf, null, false);
write_pkg_head(cos, 0, false, buf.size());
cos->write(buf.data(), buf.size());
}
if (database != null) {
database->close();
}
wlogger->trace_("Out of Connection.");
}
static sp<EDatabase> doDBOpen(sp<ESocketSession> session, EBson& req, EString& errmsg) {
DBProxyServer* acceptor = dynamic_cast<DBProxyServer*>(session->getService());
EString username = req.getString(EDB_KEY_USERNAME);
QueryUser* user = acceptor->usrmgr.checkUser(
username.c_str(),
req.getString(EDB_KEY_PASSWORD).c_str(),
req.getLLong(EDB_KEY_TIMESTAMP));
if (!user) {
errmsg = "username or password error.";
return null;
}
VirtualDB* vdb = user->virdb;
if (!vdb) {
errmsg = "no database access permission.";
return null;
}
sp<EDatabase> database = acceptor->somgr.getDatabase(vdb->dbType.c_str(), dynamic_cast<EDBProxyInf*>(session->getService()));
//update some field to real data.
req.set(EDB_KEY_HOST, vdb->host.c_str());
req.setInt(EDB_KEY_PORT, vdb->port);
req.set(EDB_KEY_USERNAME, vdb->username.c_str());
req.set(EDB_KEY_PASSWORD, vdb->password.c_str());
return database;
}
static void responseFailed(EOutputStream* cos, EString& errmsg) {
sp<EBson> rep = new EBson();
rep->addInt(EDB_KEY_ERRCODE, ES_FAILURE);
rep->add(EDB_KEY_ERRMSG, errmsg.c_str());
EByteBuffer buf;
rep->Export(&buf, null, false);
write_pkg_head(cos, 0, false, buf.size());
cos->write(buf.data(), buf.size());
}
virtual EString getProxyVersion() {
return PROXY_VERSION;
}
virtual void dumpSQL(const char *oldSql, const char *newSql) {
if (slogger != null && (oldSql || newSql)) {
slogger->log(null, -1, ELogger::LEVEL_INFO, newSql ? newSql : oldSql, null);
}
}
private:
EConfig& conf;
DBSoHandleManager somgr;
VirtualDBManager dbmgr;
VirtualUserManager usrmgr;
EExecutorService* executors;
};
//=============================================================================
/*
* Global Application Object.
*/
class Server;
static Server* g_server = null;
class Server {
public:
Server(): isDaemon(false), dbserver(null) {
}
~Server() {
delete dbserver;
}
public:
#define SERVER_BASEARGS "c:s:dxvh?"
typedef enum {DO_START, DO_RESTART, DO_STOP, DO_KILL, UNKNOWN} action_e;
int Usage(int argc, const char * const *argv) {
/* Copyright information*/
LOG("=====================================");
LOG("| Name: lite_dbproxy, " PROXY_VERSION " |");
LOG("| Author: cxxjava@163.com |");
LOG("| https://github.com/cxxjava |");
LOG("=====================================");
if (argc < 2) {
show_help(argc, argv);
return -1;
}
action = UNKNOWN;
int o;
while (-1 != (o = getopt(argc, (char **)argv, SERVER_BASEARGS))) {
switch(o) {
case 'c':
action = DO_START;
cfgFile = optarg;
break;
case 'd':
isDaemon = true;
break;
case 's':
if (strcmp("restart", optarg) == 0)
action = DO_RESTART;
else if (strcmp("stop", optarg) == 0)
action = DO_STOP;
else if (strcmp("kill", optarg) == 0)
action = DO_KILL;
else {
show_help(argc, argv);
return -1;
}
break;
case 'x':
show_config_sample();
return -1;
case 'v':
LOG("server version: %s\n", PROXY_VERSION);
return -1;
case 'h':
default:
show_help(argc, argv);
return -1;
}
}
if (action == UNKNOWN) {
show_help(argc, argv);
return -1;
}
return 0;
}
void doAction() {
int pid = -1;
if (action != DO_START) {
pid = getPidFromFile();
if (pid == -1) {
throw ERuntimeException(__FILE__, __LINE__, "no pid file.");
}
}
switch (action) {
case DO_RESTART: {
kill(pid, SIGQUIT);
eso_unlink(PID_FILE);
EThread::sleep(100);
}
case DO_START: {
//load config
config.loadFromINI(cfgFile.c_str());
//test db connection
DBSoHandleManager somgr(config);
somgr.testConnectAll();
//start server
if (isDaemon) {
ESystem::detach(true, 0, 0, 0);
}
//store master pid
storePidToFile();
sp<EThread> worker = EThread::executeX([this](){
/*FIXME: 中断将发生在main线程,
*而协程框架暂不能很好的支持信号中断,
*所以这里应避开协程在main线程中执行。
*/
this->startDBProxy();
});
eso_signal(SIGQUIT, sig_stop_worker);
eso_signal(SIGTERM, sig_kill_worker);
worker->join();
break;
}
case DO_STOP:
kill(pid, SIGQUIT);
eso_unlink(PID_FILE);
break;
case DO_KILL:
kill(pid, SIGTERM);
eso_unlink(PID_FILE);
break;
default:
break;
}
}
public:
static void sig_stop_worker(int sig_no) {
g_server->shutdown();
}
static void sig_kill_worker(int sig_no) {
g_server->terminate();
}
void shutdown() {
dbserver->shutdown();
}
void terminate() {
dbserver->dispose();
}
void storePidToFile() {
EFileOutputStream fos(PID_FILE);
EDataOutputStream dos(&fos);
dos.writeInt(eso_os_process_current()); //pid
dos.writeBoolean(isDaemon); //daemon flag
dos.write(cfgFile.c_str());
}
int getPidFromFile() {
EFileInputStream fis(PID_FILE);
EDataInputStream dis(&fis);
int pid = dis.readInt(); //pid
isDaemon = dis.readBoolean();
sp<EString> line = dis.readLine();
cfgFile = line->c_str();
return pid;
}
void startDBProxy() {
if (dbserver) return;
dbserver = new DBProxyServer(config);
EBlacklistFilter blf;
EWhitelistFilter wlf;
EConfig* subconf;
subconf = config.getConfig("BLACKLIST");
if (subconf) {
EArray<EString*> disallows = subconf->keyNames();
for (int i=0; i<disallows.size(); i++) {
blf.block(disallows[i]->c_str());
}
dbserver->getFilterChainBuilder()->addFirst("black", &blf);
}
subconf = config.getConfig("WHITELIST");
if (subconf) {
EArray<EString*> allows = subconf->keyNames();
for (int i=0; i<allows.size(); i++) {
wlf.allow(allows[i]->c_str());
}
dbserver->getFilterChainBuilder()->addFirst("white", &wlf);
}
dbserver->setConnectionHandler(DBProxyServer::onConnection);
dbserver->setMaxConnections(config.getInt("COMMON/max_connections", 10000));
dbserver->setSoTimeout(config.getInt("COMMON/socket_timeout", 3) * 1000);
//ssl
EString ssl_cert = config.getString("COMMON/ssl_cert");
EString ssl_key = config.getString("COMMON/ssl_key");
EArray<EConfig*> confs = config.getConfigs("SERVICE");
for (int i=0; i<confs.size(); i++) {
boolean ssl = confs[i]->getBoolean("ssl_active", false);
int port = confs[i]->getInt("listen_port", ssl ? DEFAULT_CONNECT_SSL_PORT : DEFAULT_CONNECT_PORT);
LOG("listen port: %d", port);
dbserver->bind("0.0.0.0", port, ssl, null, [&ssl_cert, &ssl_key](ESocketAcceptor::Service& service){
if (service.sslActive && !ssl_cert.isEmpty()) {
sp<ESSLServerSocket> sss = dynamic_pointer_cast<ESSLServerSocket>(service.ss);
sss->setSSLParameters(
ssl_cert.c_str(),
ssl_key.c_str(),
null);
}
});
}
dbserver->setReuseAddress(true);
int retry_times = 3;
while (retry_times-- > 0) {
if (retry_times == 0) {
dbserver->listen();
break;
} else {
try {
dbserver->listen();
break;
} catch (EBindException& e) {
//
}
EThread::sleep(100);
}
}
}
private:
EString cfgFile;
action_e action;
boolean isDaemon;
EConfig config;
DBProxyServer* dbserver;
static DBProxyServer* g_dbproxy;
static void show_help(int argc, const char * const *argv)
{
const char *bin = eso_filepath_name_get(argv[0]);
LOG("Usage: %s [-c config_file] [-d]", bin);
LOG(" %s [-s restart|stop|kill]", bin);
LOG(" %s [-x] [-v] [-h] [?]", bin);
LOG("Options:");
LOG(" -c : start with a config file");
LOG(" -d : daemon mode");
LOG(" -s : restart|stop|kill");
LOG(" -x : show cofing sample");
LOG(" -v : show version number");
LOG(" -h : list available command line options");
LOG(" ? : the same '-h'");
}
static void show_config_sample() {
LOG("#dbproxy config sample:");
LOG("[COMMON]");
LOG("#最大连接数");
LOG("max_connections = 100");
LOG("#SO超时时间:秒");
LOG("socket_timeout = 3");
LOG("#SSL证书设置");
LOG("ssl_cert = \"../test/certs/tests-cert.pem\"");
LOG("ssl_key = \"../test/certs/tests-key.pem\"");
LOG("");
LOG("[SERVICE]");
LOG("#服务端口号");
LOG("listen_port = 6633");
LOG("");
LOG("[SERVICE]");
LOG("#服务端口号");
LOG("listen_port = 6643");
LOG("#SSL加密");
LOG("ssl_active = TRUE");
LOG("");
LOG("[WHITELIST]");
LOG("#白名单");
LOG("127.0.0.1");
LOG("");
LOG("[BLACKLIST]");
LOG("#黑名单");
LOG("192.168.0.199");
LOG("");
LOG("[DBTYPE]");
LOG("#支持的数据库类型: 类型=true(开)|false(关)");
LOG("MYSQL=TRUE");
LOG("PGSQL=TRUE");
LOG("");
LOG("[USERMAP]");
LOG("#客户端访问用户列表: 访问用户名=数据库别名,访问密码");
LOG("username=alias_dbname,password");
LOG("");
LOG("[DBLIST]");
LOG("#服务数据库列表: 数据库别名=数据库访问URL");
LOG("alias_dbname = \"edbc:[dbtype]://[host:port]/[database]?connectTimeout=[seconds]&username=[xxx]&password=[xxx]\"");
}
};
//=============================================================================
static int Main(int argc, const char **argv) {
ESystem::init(argc, argv);
ELoggerManager::init("log4e.properties");
wlogger = ELoggerManager::getLogger("work");
slogger = ELoggerManager::getLogger("sql");
try {
Server server;
g_server = &server;
if (server.Usage(argc, argv) != 0) {
return 0;
}
server.doAction();
} catch (EException& e) {
e.printStackTrace();
} catch (...) {
}
ESystem::exit(0);
return 0;
}
//=============================================================================
MAIN_IMPL(testedb_lite_dbproxy) {
return Main(argc, argv);
}
| 25.101538
| 133
| 0.63737
|
cxxjava
|
a12a634cd3878fd141c3010b2f9d56fefb5f0c27
| 15,793
|
cpp
|
C++
|
osquery/filesystem/filesystem.cpp
|
Akhilpakanati/osquery
|
81d8a4aa687f8e9a6c09a0dbcef3722fdc01aa8a
|
[
"BSD-3-Clause"
] | null | null | null |
osquery/filesystem/filesystem.cpp
|
Akhilpakanati/osquery
|
81d8a4aa687f8e9a6c09a0dbcef3722fdc01aa8a
|
[
"BSD-3-Clause"
] | null | null | null |
osquery/filesystem/filesystem.cpp
|
Akhilpakanati/osquery
|
81d8a4aa687f8e9a6c09a0dbcef3722fdc01aa8a
|
[
"BSD-3-Clause"
] | 1
|
2016-09-03T18:08:49.000Z
|
2016-09-03T18:08:49.000Z
|
/*
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#include <sstream>
#include <fcntl.h>
#include <sys/stat.h>
#ifndef WIN32
#include <glob.h>
#include <pwd.h>
#include <sys/time.h>
#endif
#include <boost/algorithm/string.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/operations.hpp>
#include <osquery/core.h>
#include <osquery/filesystem.h>
#include <osquery/logger.h>
#include <osquery/sql.h>
#include <osquery/system.h>
#include "osquery/core/json.h"
#include "osquery/filesystem/fileops.h"
namespace pt = boost::property_tree;
namespace fs = boost::filesystem;
namespace errc = boost::system::errc;
namespace osquery {
FLAG(uint64, read_max, 50 * 1024 * 1024, "Maximum file read size");
FLAG(uint64, read_user_max, 10 * 1024 * 1024, "Maximum non-su read size");
/// See reference #1382 for reasons why someone would allow unsafe.
HIDDEN_FLAG(bool, allow_unsafe, false, "Allow unsafe executable permissions");
/// Disable forensics (atime/mtime preserving) file reads.
HIDDEN_FLAG(bool, disable_forensic, true, "Disable atime/mtime preservation");
static const size_t kMaxRecursiveGlobs = 64;
Status writeTextFile(const fs::path& path,
const std::string& content,
int permissions,
bool force_permissions) {
// Open the file with the request permissions.
PlatformFile output_fd(
path.string(), PF_CREATE_ALWAYS | PF_WRITE | PF_APPEND, permissions);
if (!output_fd.isValid()) {
return Status(1, "Could not create file: " + path.string());
}
// If the file existed with different permissions before our open
// they must be restricted.
if (!platformChmod(path.string(), permissions)) {
// Could not change the file to the requested permissions.
return Status(1, "Failed to change permissions for file: " + path.string());
}
ssize_t bytes = output_fd.write(content.c_str(), content.size());
if (static_cast<size_t>(bytes) != content.size()) {
return Status(1, "Failed to write contents to file: " + path.string());
}
return Status(0, "OK");
}
struct OpenReadableFile {
public:
explicit OpenReadableFile(const fs::path& path, bool blocking = false) {
#ifndef WIN32
dropper_ = DropPrivileges::get();
if (dropper_->dropToParent(path)) {
#endif
int mode = PF_OPEN_EXISTING | PF_READ;
if (!blocking) {
mode |= PF_NONBLOCK;
}
// Open the file descriptor and allow caller to perform error checking.
fd.reset(new PlatformFile(path.string(), mode));
#ifndef WIN32
}
#endif
}
~OpenReadableFile() {}
std::unique_ptr<PlatformFile> fd{nullptr};
#ifndef WIN32
private:
DropPrivilegesRef dropper_{nullptr};
#endif
};
Status readFile(const fs::path& path,
size_t size,
size_t block_size,
bool dry_run,
bool preserve_time,
std::function<void(std::string& buffer, size_t size)> predicate,
bool blocking) {
OpenReadableFile handle(path, blocking);
if (handle.fd == nullptr || !handle.fd->isValid()) {
return Status(1, "Cannot open file for reading: " + path.string());
}
off_t file_size = static_cast<off_t>(handle.fd->size());
if (handle.fd->isSpecialFile() && size > 0) {
file_size = static_cast<off_t>(size);
}
// Apply the max byte-read based on file/link target ownership.
off_t read_max =
static_cast<off_t>((handle.fd->isOwnerRoot().ok())
? FLAGS_read_max
: std::min(FLAGS_read_max, FLAGS_read_user_max));
if (file_size > read_max) {
VLOG(1) << "Cannot read " << path << " size exceeds limit: " << file_size
<< " > " << read_max;
return Status(1, "File exceeds read limits");
}
if (dry_run) {
// The caller is only interested in performing file read checks.
boost::system::error_code ec;
return Status(0, fs::canonical(path, ec).string());
}
PlatformTime times;
handle.fd->getFileTimes(times);
if (file_size == 0) {
off_t total_bytes = 0;
ssize_t part_bytes = 0;
do {
auto part = std::string(4096, '\0');
part_bytes = handle.fd->read(&part[0], block_size);
if (part_bytes > 0) {
total_bytes += static_cast<off_t>(part_bytes);
if (total_bytes >= read_max) {
return Status(1, "File exceeds read limits");
}
// content += part.substr(0, part_bytes);
predicate(part, part_bytes);
}
} while (part_bytes > 0);
} else {
auto content = std::string(file_size, '\0');
handle.fd->read(&content[0], file_size);
predicate(content, file_size);
}
// Attempt to restore the atime and mtime before the file read.
if (preserve_time && !FLAGS_disable_forensic) {
handle.fd->setFileTimes(times);
}
return Status(0, "OK");
}
Status readFile(const fs::path& path,
std::string& content,
size_t size,
bool dry_run,
bool preserve_time,
bool blocking) {
return readFile(path,
size,
4096,
dry_run,
preserve_time,
([&content](std::string& buffer, size_t size) {
if (buffer.size() == size) {
content += std::move(buffer);
} else {
content += buffer.substr(0, size);
}
}),
blocking);
}
Status readFile(const fs::path& path, bool blocking) {
std::string blank;
return readFile(path, blank, 0, true, false, blocking);
}
Status forensicReadFile(const fs::path& path,
std::string& content,
bool blocking) {
return readFile(path, content, 0, false, true, blocking);
}
Status isWritable(const fs::path& path) {
auto path_exists = pathExists(path);
if (!path_exists.ok()) {
return path_exists;
}
if (platformAccess(path.string(), W_OK) == 0) {
return Status(0, "OK");
}
return Status(1, "Path is not writable: " + path.string());
}
Status isReadable(const fs::path& path) {
auto path_exists = pathExists(path);
if (!path_exists.ok()) {
return path_exists;
}
if (platformAccess(path.string(), R_OK) == 0) {
return Status(0, "OK");
}
return Status(1, "Path is not readable: " + path.string());
}
Status pathExists(const fs::path& path) {
boost::system::error_code ec;
if (path.empty()) {
return Status(1, "-1");
}
// A tri-state determination of presence
if (!fs::exists(path, ec) || ec.value() != errc::success) {
return Status(1, ec.message());
}
return Status(0, "1");
}
Status remove(const fs::path& path) {
auto status_code = std::remove(path.string().c_str());
return Status(status_code, "N/A");
}
static void genGlobs(std::string path,
std::vector<std::string>& results,
GlobLimits limits) {
// Use our helped escape/replace for wildcards.
replaceGlobWildcards(path, limits);
// Generate a glob set and recurse for double star.
size_t glob_index = 0;
while (++glob_index < kMaxRecursiveGlobs) {
auto glob_results = platformGlob(path);
for (auto const& result_path : glob_results) {
results.push_back(result_path);
}
// The end state is a non-recursive ending or empty set of matches.
size_t wild = path.rfind("**");
// Allow a trailing slash after the double wild indicator.
if (glob_results.size() == 0 || wild > path.size() ||
wild < path.size() - 3) {
break;
}
path += "/**";
}
// Prune results based on settings/requested glob limitations.
auto end = std::remove_if(results.begin(),
results.end(),
[limits](const std::string& found) {
return !(((found[found.length() - 1] == '/' ||
found[found.length() - 1] == '\\') &&
limits & GLOB_FOLDERS) ||
((found[found.length() - 1] != '/' &&
found[found.length() - 1] != '\\') &&
limits & GLOB_FILES));
});
results.erase(end, results.end());
}
Status resolveFilePattern(const fs::path& fs_path,
std::vector<std::string>& results) {
return resolveFilePattern(fs_path, results, GLOB_ALL);
}
Status resolveFilePattern(const fs::path& fs_path,
std::vector<std::string>& results,
GlobLimits setting) {
genGlobs(fs_path.string(), results, setting);
return Status(0, "OK");
}
fs::path getSystemRoot() {
#ifdef WIN32
char winDirectory[MAX_PATH] = {0};
GetWindowsDirectory(winDirectory, MAX_PATH);
return fs::path(winDirectory);
#else
return fs::path("/");
#endif
}
inline void replaceGlobWildcards(std::string& pattern, GlobLimits limits) {
// Replace SQL-wildcard '%' with globbing wildcard '*'.
if (pattern.find("%") != std::string::npos) {
boost::replace_all(pattern, "%", "*");
}
// Relative paths are a bad idea, but we try to accommodate.
if ((pattern.size() == 0 || ((pattern[0] != '/' && pattern[0] != '\\') &&
(pattern.size() > 3 && pattern[1] != ':' &&
pattern[2] != '\\' && pattern[2] != '/'))) &&
pattern[0] != '~') {
boost::system::error_code ec;
pattern = (fs::current_path(ec) / pattern).make_preferred().string();
}
auto base =
fs::path(pattern.substr(0, pattern.find('*'))).make_preferred().string();
if (base.size() > 0) {
boost::system::error_code ec;
auto canonicalized = ((limits & GLOB_NO_CANON) == 0)
? fs::canonical(base, ec).make_preferred().string()
: base;
if (canonicalized.size() > 0 && canonicalized != base) {
if (isDirectory(canonicalized)) {
// Canonicalized directory paths will not include a trailing '/'.
// However, if the wildcards are applied to files within a directory
// then the missing '/' changes the wildcard meaning.
canonicalized += '/';
}
// We are unable to canonicalize the meaning of post-wildcard limiters.
pattern = fs::path(canonicalized + pattern.substr(base.size()))
.make_preferred()
.string();
}
}
}
inline Status listInAbsoluteDirectory(const fs::path& path,
std::vector<std::string>& results,
GlobLimits limits) {
if (path.filename() == "*" && !pathExists(path.parent_path())) {
return Status(1, "Directory not found: " + path.parent_path().string());
}
if (path.filename() == "*" && !isDirectory(path.parent_path())) {
return Status(1, "Path not a directory: " + path.parent_path().string());
}
genGlobs(path.string(), results, limits);
return Status(0, "OK");
}
Status listFilesInDirectory(const fs::path& path,
std::vector<std::string>& results,
bool recursive) {
return listInAbsoluteDirectory(
(path / ((recursive) ? "**" : "*")), results, GLOB_FILES);
}
Status listDirectoriesInDirectory(const fs::path& path,
std::vector<std::string>& results,
bool recursive) {
return listInAbsoluteDirectory(
(path / ((recursive) ? "**" : "*")), results, GLOB_FOLDERS);
}
Status isDirectory(const fs::path& path) {
boost::system::error_code ec;
if (fs::is_directory(path, ec)) {
return Status(0, "OK");
}
// The success error code is returned for as a failure (undefined error)
// We need to flip that into an error, a success would have falling through
// in the above conditional.
if (ec.value() == errc::success) {
return Status(1, "Path is not a directory: " + path.string());
}
return Status(ec.value(), ec.message());
}
std::set<fs::path> getHomeDirectories() {
std::set<fs::path> results;
auto users = SQL::selectAllFrom("users");
for (const auto& user : users) {
if (user.at("directory").size() > 0) {
results.insert(user.at("directory"));
}
}
return results;
}
bool safePermissions(const std::string& dir,
const std::string& path,
bool executable) {
if (!platformIsFileAccessible(path).ok()) {
// Path was not real, had too may links, or could not be accessed.
return false;
}
if (FLAGS_allow_unsafe) {
return true;
}
Status result = platformIsTmpDir(dir);
if (!result.ok() && result.getCode() < 0) {
// An error has occurred in stat() on dir, most likely because the file path
// does not exist
return false;
} else if (result.ok()) {
// Do not load modules from /tmp-like directories.
return false;
}
PlatformFile fd(path, PF_OPEN_EXISTING | PF_READ);
if (!fd.isValid()) {
return false;
}
result = isDirectory(path);
if (!result.ok() && result.getCode() < 0) {
// Something went wrong when determining the file's directoriness
return false;
} else if (result.ok()) {
// Only load file-like nodes (not directories).
return false;
}
if (fd.isOwnerCurrentUser().ok() || fd.isOwnerRoot().ok()) {
result = fd.isExecutable();
// Otherwise, require matching or root file ownership.
if (executable && (result.getCode() > 0 || !fd.isNonWritable().ok())) {
// Require executable, implies by the owner.
return false;
}
return true;
}
// Do not load modules not owned by the user.
return false;
}
const std::string& osqueryHomeDirectory() {
static std::string homedir;
if (homedir.size() == 0) {
// Try to get the caller's home directory
boost::system::error_code ec;
auto userdir = getHomeDirectory();
if (userdir.is_initialized() && isWritable(*userdir).ok()) {
auto osquery_dir = (fs::path(*userdir) / ".osquery");
if (isWritable(osquery_dir) ||
boost::filesystem::create_directories(osquery_dir, ec)) {
homedir = osquery_dir.make_preferred().string();
return homedir;
}
}
// Fail over to a temporary directory (used for the shell).
auto temp =
fs::temp_directory_path(ec) / fs::unique_path("osquery%%%%%%%%", ec);
homedir = temp.make_preferred().string();
}
return homedir;
}
std::string lsperms(int mode) {
static const char rwx[] = {'0', '1', '2', '3', '4', '5', '6', '7'};
std::string bits;
bits += rwx[(mode >> 9) & 7];
bits += rwx[(mode >> 6) & 7];
bits += rwx[(mode >> 3) & 7];
bits += rwx[(mode >> 0) & 7];
return bits;
}
Status parseJSON(const fs::path& path, pt::ptree& tree) {
std::string json_data;
if (!readFile(path, json_data).ok()) {
return Status(1, "Could not read JSON from file");
}
return parseJSONContent(json_data, tree);
}
Status parseJSONContent(const std::string& content, pt::ptree& tree) {
// Read the extensions data into a JSON blob, then property tree.
try {
std::stringstream json_stream;
json_stream << content;
pt::read_json(json_stream, tree);
} catch (const pt::json_parser::json_parser_error& /* e */) {
return Status(1, "Could not parse JSON from file");
}
return Status(0, "OK");
}
}
| 30.725681
| 80
| 0.594567
|
Akhilpakanati
|
a12c4f90644d22ae5b0d7103605acc08d30292e0
| 7,518
|
hpp
|
C++
|
include/eagine/byteset.hpp
|
matus-chochlik/eagine-core
|
5bc2d6b9b053deb3ce6f44f0956dfccd75db4649
|
[
"BSL-1.0"
] | 1
|
2022-01-25T10:31:51.000Z
|
2022-01-25T10:31:51.000Z
|
include/eagine/byteset.hpp
|
matus-chochlik/eagine-core
|
5bc2d6b9b053deb3ce6f44f0956dfccd75db4649
|
[
"BSL-1.0"
] | null | null | null |
include/eagine/byteset.hpp
|
matus-chochlik/eagine-core
|
5bc2d6b9b053deb3ce6f44f0956dfccd75db4649
|
[
"BSL-1.0"
] | null | null | null |
/// @file
///
/// Copyright Matus Chochlik.
/// Distributed under the Boost Software License, Version 1.0.
/// See accompanying file LICENSE_1_0.txt or copy at
/// http://www.boost.org/LICENSE_1_0.txt
///
#ifndef EAGINE_BYTESET_HPP
#define EAGINE_BYTESET_HPP
#include "memory/block.hpp"
#include "types.hpp"
#include <climits>
#include <type_traits>
#include <utility>
namespace eagine {
/// @brief Class storing a sequence of bytes converting them to and from unsigned integer.
/// @ingroup type_utils
/// @tparam N the size - number of elements - in the byte sequence.
/// @see biteset
template <std::size_t N>
class byteset {
public:
static_assert(N > 0, "byteset size must be greater than zero");
/// @brief Alias for size type.
using size_type = span_size_t;
/// @brief Alias for element value type.
using value_type = byte;
/// @brief Alias for element reference type.
using reference = value_type&;
/// @brief Alias for const reference type.
using const_reference = const value_type&;
/// @brief Alias for pointer to element type.
using pointer = value_type*;
/// @brief Alias for pointer to const element type.
using const_pointer = const value_type*;
/// @brief Alias for iterator type.
using iterator = value_type*;
/// @brief Alias for const iterator type.
using const_iterator = const value_type*;
/// @brief Default constructor.
constexpr byteset() noexcept = default;
/// @brief Construction from a pack of integer values.
template <
typename... B,
typename = std::enable_if_t<
(sizeof...(B) == N) && (sizeof...(B) != 0) &&
std::conjunction_v<std::true_type, std::is_convertible<B, value_type>...>>>
explicit constexpr byteset(const B... b) noexcept
: _bytes{value_type{b}...} {}
template <
std::size_t... I,
typename UInt,
typename =
std::enable_if_t<(sizeof(UInt) >= N) && std::is_integral_v<UInt>>>
constexpr byteset(const std::index_sequence<I...>, const UInt init) noexcept
: _bytes{value_type((init >> (8 * (N - I - 1))) & 0xFFU)...} {}
/// @brief Construiction from unsigned integer that is then split into bytes.
template <
typename UInt,
typename = std::enable_if_t<
(sizeof(UInt) >= N) && std::is_integral_v<UInt> &&
std::is_unsigned_v<UInt>>>
explicit constexpr byteset(const UInt init) noexcept
: byteset(std::make_index_sequence<N>(), init) {}
/// @brief Returns a pointer to the byte sequence start.
/// @see size
auto data() noexcept -> pointer {
return _bytes;
}
/// @brief Returns a const pointer to the byte sequence start.
/// @see size
constexpr auto data() const noexcept -> const_pointer {
return _bytes;
}
/// @brief Returns the count of bytes in the stored sequence.
constexpr auto size() const noexcept -> size_type {
return N;
}
/// @brief Creates a const view over the stored sequence of bytes.
constexpr auto block() const noexcept -> memory::const_block {
return {data(), size()};
}
/// @brief Subscript operator.
constexpr auto operator[](const size_type i) noexcept -> reference {
return _bytes[i];
}
/// @brief Subscript operator.
constexpr auto operator[](const size_type i) const noexcept
-> const_reference {
return _bytes[i];
}
/// @brief Returns the first byte in the sequence.
/// @see back
constexpr auto front() noexcept -> reference {
return _bytes[0];
}
/// @brief Returns the first byte in the sequence.
/// @see back
constexpr auto front() const noexcept -> const_reference {
return _bytes[0];
}
/// @brief Returns the last byte in the sequence.
/// @see front
constexpr auto back() noexcept -> reference {
return _bytes[N - 1];
}
/// @brief Returns the last byte in the sequence.
/// @see front
constexpr auto back() const noexcept -> const_reference {
return _bytes[N - 1];
}
/// @brief Returns an iterator to the start of the byte sequence.
auto begin() noexcept -> iterator {
return _bytes + 0;
}
/// @brief Returns an iterator past the end of the byte sequence.
auto end() noexcept -> iterator {
return _bytes + N;
}
/// @brief Returns a const iterator to the start of the byte sequence.
constexpr auto begin() const noexcept -> const_iterator {
return _bytes + 0;
}
/// @brief Returns a const iterator past the end of the byte sequence.
constexpr auto end() const noexcept -> const_iterator {
return _bytes + N;
}
friend constexpr auto compare(const byteset& a, const byteset& b) noexcept {
return _do_cmp(a, b, std::make_index_sequence<N>{});
}
/// @brief Equality comparison.
friend constexpr auto operator==(
const byteset& a,
const byteset& b) noexcept {
return compare(a, b) == 0;
}
/// @brief Non-equality comparison.
friend constexpr auto operator!=(
const byteset& a,
const byteset& b) noexcept {
return compare(a, b) != 0;
}
/// @brief Less-than comparison.
friend constexpr auto operator<(
const byteset& a,
const byteset& b) noexcept {
return compare(a, b) < 0;
}
/// @brief Less-equal comparison.
friend constexpr auto operator<=(
const byteset& a,
const byteset& b) noexcept {
return compare(a, b) <= 0;
}
/// @brief Greater-than comparison.
friend constexpr auto operator>(
const byteset& a,
const byteset& b) noexcept {
return compare(a, b) > 0;
}
/// @brief Greater-equal comparison.
friend constexpr auto operator>=(
const byteset& a,
const byteset& b) noexcept {
return compare(a, b) >= 0;
}
/// @brief Converts the byte sequence into an unsigned integer value.
template <
typename UInt,
typename = std::enable_if_t<
(sizeof(UInt) >= N) && (
#if __SIZEOF_INT128__
std::is_same_v<UInt, __uint128_t> ||
std::is_same_v<UInt, __int128_t> ||
#endif
std::is_integral_v<UInt>)>>
constexpr auto as(const UInt i = 0) const noexcept {
return _push_back_to(i, 0);
}
private:
value_type _bytes[N]{};
template <typename UInt>
constexpr auto _push_back_to(const UInt state, const std::size_t i)
const noexcept -> UInt {
// NOLINTNEXTLINE(hicpp-signed-bitwise)
return (i < N) ? _push_back_to((state << CHAR_BIT) | _bytes[i], i + 1)
: state;
}
static constexpr auto _cmp_byte(
const value_type a,
const value_type b) noexcept -> int {
return (a == b) ? 0 : (a < b) ? -1 : 1;
}
static constexpr auto _do_cmp(
const byteset&,
const byteset&,
const std::index_sequence<>) noexcept -> int {
return 0;
}
template <std::size_t I, std::size_t... In>
static constexpr auto _do_cmp(
const byteset& a,
const byteset& b,
const std::index_sequence<I, In...>) noexcept -> int {
return (a._bytes[I] == b._bytes[I])
? _do_cmp(a, b, std::index_sequence<In...>{})
: _cmp_byte(a._bytes[I], b._bytes[I]);
}
};
} // namespace eagine
#endif // EAGINE_BYTESET_HPP
| 29.252918
| 90
| 0.608939
|
matus-chochlik
|
a12fb1ad2cb4bfcd06950869f8688408715ac076
| 748
|
cpp
|
C++
|
test/main.cpp
|
Ratstail91/colliders
|
27d64767a9c9ebc4f8520624d3a292941815ac7c
|
[
"Zlib"
] | 1
|
2021-06-22T11:00:04.000Z
|
2021-06-22T11:00:04.000Z
|
test/main.cpp
|
Ratstail91/colliders
|
27d64767a9c9ebc4f8520624d3a292941815ac7c
|
[
"Zlib"
] | null | null | null |
test/main.cpp
|
Ratstail91/colliders
|
27d64767a9c9ebc4f8520624d3a292941815ac7c
|
[
"Zlib"
] | null | null | null |
//test headers
#include "test_compiles.hpp"
#include "test_lines.hpp"
#include "test_circles.hpp"
#include "test_boxes.hpp"
#include "test_points.hpp"
#include "common.hpp"
#include <functional>
#include <iostream>
#include <vector>
const std::vector<std::function<TestResult()>> testVector = {
testCompiles,
testLines,
testCircles,
testBoxes,
testPoints,
};
int main() {
TestResult results;
//run each test in sequence, recording the result
for (auto t : testVector) {
TestResult res = t();
// std::cout << res.observed << "/" << res.expected << std::endl;
results += res;
}
//finally
std::cout << results.observed << "/" << results.expected << " tests passed." << std::endl;
return results.expected - results.observed;
}
| 20.216216
| 92
| 0.685829
|
Ratstail91
|
a12fba24ad6e31e8c2a6e31baca11f1608c4ccfe
| 6,230
|
cpp
|
C++
|
src/config.cpp
|
vargdidnothingwrong/csgo-horker
|
aae6e1094b84ce99fb36e0f4f033172a19cebc1d
|
[
"Apache-2.0"
] | null | null | null |
src/config.cpp
|
vargdidnothingwrong/csgo-horker
|
aae6e1094b84ce99fb36e0f4f033172a19cebc1d
|
[
"Apache-2.0"
] | null | null | null |
src/config.cpp
|
vargdidnothingwrong/csgo-horker
|
aae6e1094b84ce99fb36e0f4f033172a19cebc1d
|
[
"Apache-2.0"
] | null | null | null |
#include "config.h"
#include <fstream>
#include <iostream>
#include "external/inih/INIReader.h"
constexpr char defConfigFile[] = "config.ini";
bool Config::Glow::Enabled = true;
bool Config::Glow::Radar = true;
bool Config::Glow::LegitGlow = false;
bool Config::Glow::GlowAllies = true;
bool Config::Glow::GlowEnemies = true;
bool Config::Glow::GlowOther = false;
bool Config::Glow::GlowWeapons = false;
float Config::Glow::EnemyR = 0.8f;
float Config::Glow::EnemyG = 0.8f;
float Config::Glow::EnemyB = 0.0f;
float Config::Glow::EnemyA = 0.8f;
float Config::Glow::AllyR = 0.0f;
float Config::Glow::AllyG = 0.8f;
float Config::Glow::AllyB = 0.8f;
float Config::Glow::AllyA = 0.8f;
int Config::Visual::Contrast = 0;
bool Config::Visual::DisablePostProcessing = true;
bool Config::Visual::NoFlash = true;
bool Config::AimBot::AimAssist = true;
float Config::AimBot::AimCorrection = 0.4f;
float Config::AimBot::AimFieldOfView = 35.2f;
float Config::AimBot::AimSpeed = 5.0f;
int Config::AimBot::TargetMode = 1;
int Config::AimBot::TargetBone = 8;
bool Config::AimBot::Trigger = true;
bool Config::AimBot::RecoilControl = true;
int Config::AimBot::TriggerDelay = 50;
bool Config::AimBot::UseTriggerKey = true;
std::string Config::AimBot::TriggerKey = "F";
bool Config::AimBot::UseMouseEvents = false;
bool Config::AimBot::AttackTeammate = false;
bool Config::Other::BunnyHop = false;
#define WriteSection(key) \
conf << "[" #key "]" << "\n";
#define WritePair(section, key) \
conf << #key " = " << Config::section::key << "\n";
#define WriteSectionEnd() conf << "\n";
#define WriteComment(msg) conf << "; " << msg << '\n';
void UpdateConfig()
{
std::ofstream conf(defConfigFile);
if (conf.is_open()) {
WriteSection(AimBot);
WriteComment("Enable Aim Assist: 1/0");
WritePair(AimBot, AimAssist);
WriteComment("Aim correction (Higher values reduce jitter w/ UseMouseEvents)");
WritePair(AimBot, AimCorrection);
WriteComment("Aim field of view (float) - Adjustments for TargetMode = 1");
WritePair(AimBot, AimFieldOfView);
WriteComment("Aim smoothing as a floating point (lower looks more legit)");
WritePair(AimBot, AimSpeed);
WriteComment("TargetMode Valid List:");
WriteComment("-- Nearest: 0");
WriteComment("-- Distance based FOV: 1");
WriteComment("-- Angle based FOV: 2");
WritePair(AimBot, TargetMode);
WriteComment("TargetBone Valid List:");
WriteComment("-- Head = 8");
WriteComment("-- Neck = 7");
WriteComment("-- Torso = 3, 4, 5, or 6");
WriteComment("-- Pelvis = 2");
WritePair(AimBot, TargetBone);
WriteComment("Enable recoil control: 1/0");
WritePair(AimBot, RecoilControl);
WriteComment("Enable auto-trigger: 1/0");
WritePair(AimBot, Trigger);
WriteComment("Delay between shots in milliseconds");
WritePair(AimBot, TriggerDelay);
WriteComment("Use trigger key for Aim/Trigger (Recommended on)");
WritePair(AimBot, UseTriggerKey);
WriteComment("Keyboard key to use for Aim/Trigger (Default is F)");
WritePair(AimBot, TriggerKey);
WriteComment("Use mouse events instead of adjusting in-game camera (less accurate)");
WritePair(AimBot, UseMouseEvents);
WriteComment("Also attack teammate");
WritePair(AimBot, AttackTeammate);
WriteSectionEnd();
WriteSection(Glow);
WritePair(Glow, Enabled);
WritePair(Glow, Radar);
WritePair(Glow, LegitGlow);
WritePair(Glow, GlowAllies);
WritePair(Glow, GlowEnemies);
WritePair(Glow, GlowOther);
WritePair(Glow, GlowWeapons);
WritePair(Glow, EnemyR);
WritePair(Glow, EnemyG);
WritePair(Glow, EnemyB);
WritePair(Glow, EnemyA);
WritePair(Glow, AllyR);
WritePair(Glow, AllyG);
WritePair(Glow, AllyB);
WritePair(Glow, AllyA);
WriteSectionEnd();
WriteSection(Visual);
WriteComment("Adjust the contrast/vibrance of textures (Nvidia only for now) Values: -1024 - 1023");
WritePair(Visual, Contrast);
WriteComment("Disable post-processing effects");
WritePair(Visual, DisablePostProcessing);
WriteComment("Disable flashbang visual effect");
WritePair(Visual, NoFlash);
WriteSection(Other);
WriteComment("Enable bunnyhop 1/0");
WritePair(Other, BunnyHop);
conf.close();
}
}
#define RCBOOL(section, key) \
Config::section::key = reader.GetBoolean(#section, #key, Config::section::key);
#define RCSTR(section, key) \
Config::section::key = reader.Get(#section, #key, Config::section::key);
#define RCDBL(section, key) \
Config::section::key = reader.GetReal(#section, #key, Config::section::key);
#define RCINT(section, key) \
Config::section::key = reader.GetInteger(#section, #key, Config::section::key);
bool ReadConfig(const std::string &configFile)
{
INIReader reader(configFile);
if (reader.ParseError() < 0) {
UpdateConfig();
return false;
}
RCBOOL(AimBot, AimAssist);
RCDBL(AimBot, AimCorrection);
RCDBL(AimBot, AimFieldOfView);
RCDBL(AimBot, AimSpeed);
RCINT(AimBot, TargetMode);
RCINT(AimBot, TargetBone);
RCBOOL(AimBot, Trigger);
RCINT(AimBot, TriggerDelay);
RCSTR (AimBot, TriggerKey);
RCBOOL(AimBot, RecoilControl);
RCBOOL(AimBot, UseTriggerKey);
RCBOOL(AimBot, UseMouseEvents);
RCBOOL(AimBot, AttackTeammate);
RCBOOL(Glow, Enabled);
RCBOOL(Glow, Radar);
RCBOOL(Glow, LegitGlow);
RCBOOL(Glow, GlowAllies);
RCBOOL(Glow, GlowEnemies);
RCBOOL(Glow, GlowOther);
RCBOOL(Glow, GlowWeapons);
RCDBL (Glow, EnemyR);
RCDBL (Glow, EnemyG);
RCDBL (Glow, EnemyB);
RCDBL (Glow, EnemyA);
RCDBL (Glow, AllyR);
RCDBL (Glow, AllyG);
RCDBL (Glow, AllyB);
RCDBL (Glow, AllyA);
RCINT(Visual, Contrast);
RCBOOL(Visual, DisablePostProcessing);
RCBOOL(Visual, NoFlash);
RCBOOL(Other, BunnyHop);
UpdateConfig();
return true;
}
| 33.858696
| 108
| 0.647191
|
vargdidnothingwrong
|
a132bbfba3f852de2a07fc4fd8b2aa542635333c
| 34,532
|
cpp
|
C++
|
export/windows/cpp/obj/src/AssetPaths.cpp
|
TinyPlanetStudios/Project-Crash-Land
|
365f196be4212602d32251566f26b53fb70693f6
|
[
"MIT"
] | null | null | null |
export/windows/cpp/obj/src/AssetPaths.cpp
|
TinyPlanetStudios/Project-Crash-Land
|
365f196be4212602d32251566f26b53fb70693f6
|
[
"MIT"
] | null | null | null |
export/windows/cpp/obj/src/AssetPaths.cpp
|
TinyPlanetStudios/Project-Crash-Land
|
365f196be4212602d32251566f26b53fb70693f6
|
[
"MIT"
] | null | null | null |
// Generated by Haxe 3.3.0
#include <hxcpp.h>
#ifndef INCLUDED_AssetPaths
#include <AssetPaths.h>
#endif
void AssetPaths_obj::__construct() { }
Dynamic AssetPaths_obj::__CreateEmpty() { return new AssetPaths_obj; }
hx::ObjectPtr< AssetPaths_obj > AssetPaths_obj::__new()
{
hx::ObjectPtr< AssetPaths_obj > _hx_result = new AssetPaths_obj();
_hx_result->__construct();
return _hx_result;
}
Dynamic AssetPaths_obj::__Create(hx::DynamicArray inArgs)
{
hx::ObjectPtr< AssetPaths_obj > _hx_result = new AssetPaths_obj();
_hx_result->__construct();
return _hx_result;
}
::String AssetPaths_obj::data_goes_here__txt;
::String AssetPaths_obj::Bedroom__xcf;
::String AssetPaths_obj::BedroomCover__png;
::String AssetPaths_obj::BedroomInterior__png;
::String AssetPaths_obj::boombox__png;
::String AssetPaths_obj::codedoor__png;
::String AssetPaths_obj::cover90T1__png;
::String AssetPaths_obj::cover90T2__png;
::String AssetPaths_obj::coverwrench2__png;
::String AssetPaths_obj::coverWrenchT1__png;
::String AssetPaths_obj::empty__png;
::String AssetPaths_obj::fin__png;
::String AssetPaths_obj::fuelCell__png;
::String AssetPaths_obj::FUELCELLBG__png;
::String AssetPaths_obj::images_go_here__txt;
::String AssetPaths_obj::keydoor__png;
::String AssetPaths_obj::keypad__png;
::String AssetPaths_obj::keypad__xcf;
::String AssetPaths_obj::mineCover1__png;
::String AssetPaths_obj::MineCover2__png;
::String AssetPaths_obj::minecover3__png;
::String AssetPaths_obj::minecover4__png;
::String AssetPaths_obj::MineEntrance__xcf;
::String AssetPaths_obj::MineEntranceCover__png;
::String AssetPaths_obj::MineEntranceInterior__png;
::String AssetPaths_obj::MineEntranceInteriorPostDoor__png;
::String AssetPaths_obj::nosecap__png;
::String AssetPaths_obj::openeing__png;
::String AssetPaths_obj::planet__png;
::String AssetPaths_obj::planet__xcf;
::String AssetPaths_obj::planetpuppet__png;
::String AssetPaths_obj::player__png;
::String AssetPaths_obj::rocket__png;
::String AssetPaths_obj::rocketPuppet__png;
::String AssetPaths_obj::rockWall__png;
::String AssetPaths_obj::rung__png;
::String AssetPaths_obj::table__png;
::String AssetPaths_obj::tape__png;
::String AssetPaths_obj::trapdoorbg__png;
::String AssetPaths_obj::use__png;
::String AssetPaths_obj::wrench__png;
::String AssetPaths_obj::music_goes_here__txt;
::String AssetPaths_obj::music__ogg;
::String AssetPaths_obj::get__wav;
::String AssetPaths_obj::gj__wav;
::String AssetPaths_obj::gj2__ogg;
::String AssetPaths_obj::gj2__wav;
::String AssetPaths_obj::hit__wav;
::String AssetPaths_obj::kaboom__ogg;
::String AssetPaths_obj::kaboom__wav;
::String AssetPaths_obj::song_20170423_095337_718__mid;
::String AssetPaths_obj::sounds_go_here__txt;
::String AssetPaths_obj::takeoff__ogg;
::String AssetPaths_obj::takeoff__wav;
::String AssetPaths_obj::tk1__wav;
AssetPaths_obj::AssetPaths_obj()
{
}
#if HXCPP_SCRIPTABLE
static hx::StorageInfo *AssetPaths_obj_sMemberStorageInfo = 0;
static hx::StaticInfo AssetPaths_obj_sStaticStorageInfo[] = {
{hx::fsString,(void *) &AssetPaths_obj::data_goes_here__txt,HX_HCSTRING("data_goes_here__txt","\xec","\x22","\x23","\xe8")},
{hx::fsString,(void *) &AssetPaths_obj::Bedroom__xcf,HX_HCSTRING("Bedroom__xcf","\xbf","\x3c","\x7e","\x33")},
{hx::fsString,(void *) &AssetPaths_obj::BedroomCover__png,HX_HCSTRING("BedroomCover__png","\xce","\xbd","\xc3","\xf1")},
{hx::fsString,(void *) &AssetPaths_obj::BedroomInterior__png,HX_HCSTRING("BedroomInterior__png","\xfd","\x91","\xb0","\x18")},
{hx::fsString,(void *) &AssetPaths_obj::boombox__png,HX_HCSTRING("boombox__png","\xc9","\x5e","\xef","\x16")},
{hx::fsString,(void *) &AssetPaths_obj::codedoor__png,HX_HCSTRING("codedoor__png","\x8e","\x1e","\x90","\x71")},
{hx::fsString,(void *) &AssetPaths_obj::cover90T1__png,HX_HCSTRING("cover90T1__png","\xfe","\x0b","\x93","\x2e")},
{hx::fsString,(void *) &AssetPaths_obj::cover90T2__png,HX_HCSTRING("cover90T2__png","\x5d","\x68","\xee","\x94")},
{hx::fsString,(void *) &AssetPaths_obj::coverwrench2__png,HX_HCSTRING("coverwrench2__png","\x77","\xbf","\xa9","\xf3")},
{hx::fsString,(void *) &AssetPaths_obj::coverWrenchT1__png,HX_HCSTRING("coverWrenchT1__png","\x8c","\x2f","\x02","\x9f")},
{hx::fsString,(void *) &AssetPaths_obj::empty__png,HX_HCSTRING("empty__png","\xdc","\x23","\x57","\xdf")},
{hx::fsString,(void *) &AssetPaths_obj::fin__png,HX_HCSTRING("fin__png","\xde","\x9b","\xda","\xc5")},
{hx::fsString,(void *) &AssetPaths_obj::fuelCell__png,HX_HCSTRING("fuelCell__png","\x51","\x4e","\x3a","\x40")},
{hx::fsString,(void *) &AssetPaths_obj::FUELCELLBG__png,HX_HCSTRING("FUELCELLBG__png","\x8c","\x24","\x0f","\xe9")},
{hx::fsString,(void *) &AssetPaths_obj::images_go_here__txt,HX_HCSTRING("images_go_here__txt","\x70","\x18","\x1f","\x93")},
{hx::fsString,(void *) &AssetPaths_obj::keydoor__png,HX_HCSTRING("keydoor__png","\xdc","\xa7","\xd1","\xf7")},
{hx::fsString,(void *) &AssetPaths_obj::keypad__png,HX_HCSTRING("keypad__png","\xf5","\x7f","\x08","\x24")},
{hx::fsString,(void *) &AssetPaths_obj::keypad__xcf,HX_HCSTRING("keypad__xcf","\x67","\x88","\x0e","\x24")},
{hx::fsString,(void *) &AssetPaths_obj::mineCover1__png,HX_HCSTRING("mineCover1__png","\x5c","\x2a","\x61","\x26")},
{hx::fsString,(void *) &AssetPaths_obj::MineCover2__png,HX_HCSTRING("MineCover2__png","\x9b","\x8e","\x48","\xed")},
{hx::fsString,(void *) &AssetPaths_obj::minecover3__png,HX_HCSTRING("minecover3__png","\x3a","\x4b","\xe5","\x0e")},
{hx::fsString,(void *) &AssetPaths_obj::minecover4__png,HX_HCSTRING("minecover4__png","\x99","\xa7","\x40","\x75")},
{hx::fsString,(void *) &AssetPaths_obj::MineEntrance__xcf,HX_HCSTRING("MineEntrance__xcf","\x12","\x71","\xe2","\xe5")},
{hx::fsString,(void *) &AssetPaths_obj::MineEntranceCover__png,HX_HCSTRING("MineEntranceCover__png","\x9b","\xfc","\x41","\xd3")},
{hx::fsString,(void *) &AssetPaths_obj::MineEntranceInterior__png,HX_HCSTRING("MineEntranceInterior__png","\x50","\xd1","\xad","\x3c")},
{hx::fsString,(void *) &AssetPaths_obj::MineEntranceInteriorPostDoor__png,HX_HCSTRING("MineEntranceInteriorPostDoor__png","\x82","\xaf","\x6e","\xc2")},
{hx::fsString,(void *) &AssetPaths_obj::nosecap__png,HX_HCSTRING("nosecap__png","\x4a","\x2a","\xb2","\x55")},
{hx::fsString,(void *) &AssetPaths_obj::openeing__png,HX_HCSTRING("openeing__png","\xc2","\x5d","\x12","\x28")},
{hx::fsString,(void *) &AssetPaths_obj::planet__png,HX_HCSTRING("planet__png","\xf1","\xc3","\x6e","\xbd")},
{hx::fsString,(void *) &AssetPaths_obj::planet__xcf,HX_HCSTRING("planet__xcf","\x63","\xcc","\x74","\xbd")},
{hx::fsString,(void *) &AssetPaths_obj::planetpuppet__png,HX_HCSTRING("planetpuppet__png","\x7d","\xca","\x14","\x0b")},
{hx::fsString,(void *) &AssetPaths_obj::player__png,HX_HCSTRING("player__png","\x88","\xf2","\xe2","\x65")},
{hx::fsString,(void *) &AssetPaths_obj::rocket__png,HX_HCSTRING("rocket__png","\xb5","\x7d","\x56","\xfa")},
{hx::fsString,(void *) &AssetPaths_obj::rocketPuppet__png,HX_HCSTRING("rocketPuppet__png","\x21","\xc7","\xae","\x2c")},
{hx::fsString,(void *) &AssetPaths_obj::rockWall__png,HX_HCSTRING("rockWall__png","\xda","\xbb","\xce","\xce")},
{hx::fsString,(void *) &AssetPaths_obj::rung__png,HX_HCSTRING("rung__png","\x4d","\xd9","\xbb","\x12")},
{hx::fsString,(void *) &AssetPaths_obj::table__png,HX_HCSTRING("table__png","\xbb","\x12","\xd2","\xd3")},
{hx::fsString,(void *) &AssetPaths_obj::tape__png,HX_HCSTRING("tape__png","\xa7","\xf5","\x21","\xc7")},
{hx::fsString,(void *) &AssetPaths_obj::trapdoorbg__png,HX_HCSTRING("trapdoorbg__png","\x29","\x9d","\x5d","\x17")},
{hx::fsString,(void *) &AssetPaths_obj::use__png,HX_HCSTRING("use__png","\xe2","\xaf","\x6f","\x26")},
{hx::fsString,(void *) &AssetPaths_obj::wrench__png,HX_HCSTRING("wrench__png","\x00","\xe4","\x94","\xf1")},
{hx::fsString,(void *) &AssetPaths_obj::music_goes_here__txt,HX_HCSTRING("music_goes_here__txt","\xd1","\xaa","\xc8","\x0f")},
{hx::fsString,(void *) &AssetPaths_obj::music__ogg,HX_HCSTRING("music__ogg","\x6a","\xae","\x86","\x8f")},
{hx::fsString,(void *) &AssetPaths_obj::get__wav,HX_HCSTRING("get__wav","\xb6","\xa1","\xe0","\xbe")},
{hx::fsString,(void *) &AssetPaths_obj::gj__wav,HX_HCSTRING("gj__wav","\x09","\x09","\x2e","\x0f")},
{hx::fsString,(void *) &AssetPaths_obj::gj2__ogg,HX_HCSTRING("gj2__ogg","\x20","\x16","\x38","\x2b")},
{hx::fsString,(void *) &AssetPaths_obj::gj2__wav,HX_HCSTRING("gj2__wav","\xfd","\x22","\x3e","\x2b")},
{hx::fsString,(void *) &AssetPaths_obj::hit__wav,HX_HCSTRING("hit__wav","\xd9","\xee","\x68","\x9e")},
{hx::fsString,(void *) &AssetPaths_obj::kaboom__ogg,HX_HCSTRING("kaboom__ogg","\xce","\xb4","\x5d","\xd5")},
{hx::fsString,(void *) &AssetPaths_obj::kaboom__wav,HX_HCSTRING("kaboom__wav","\xab","\xc1","\x63","\xd5")},
{hx::fsString,(void *) &AssetPaths_obj::song_20170423_095337_718__mid,HX_HCSTRING("song_20170423_095337_718__mid","\x12","\xe0","\xd0","\x0e")},
{hx::fsString,(void *) &AssetPaths_obj::sounds_go_here__txt,HX_HCSTRING("sounds_go_here__txt","\xe4","\xa8","\xcb","\x02")},
{hx::fsString,(void *) &AssetPaths_obj::takeoff__ogg,HX_HCSTRING("takeoff__ogg","\xa7","\x66","\x67","\x50")},
{hx::fsString,(void *) &AssetPaths_obj::takeoff__wav,HX_HCSTRING("takeoff__wav","\x84","\x73","\x6d","\x50")},
{hx::fsString,(void *) &AssetPaths_obj::tk1__wav,HX_HCSTRING("tk1__wav","\xf2","\x08","\x08","\xd6")},
{ hx::fsUnknown, 0, null()}
};
#endif
static void AssetPaths_obj_sMarkStatics(HX_MARK_PARAMS) {
HX_MARK_MEMBER_NAME(AssetPaths_obj::__mClass,"__mClass");
HX_MARK_MEMBER_NAME(AssetPaths_obj::data_goes_here__txt,"data_goes_here__txt");
HX_MARK_MEMBER_NAME(AssetPaths_obj::Bedroom__xcf,"Bedroom__xcf");
HX_MARK_MEMBER_NAME(AssetPaths_obj::BedroomCover__png,"BedroomCover__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::BedroomInterior__png,"BedroomInterior__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::boombox__png,"boombox__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::codedoor__png,"codedoor__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::cover90T1__png,"cover90T1__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::cover90T2__png,"cover90T2__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::coverwrench2__png,"coverwrench2__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::coverWrenchT1__png,"coverWrenchT1__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::empty__png,"empty__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::fin__png,"fin__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::fuelCell__png,"fuelCell__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::FUELCELLBG__png,"FUELCELLBG__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::images_go_here__txt,"images_go_here__txt");
HX_MARK_MEMBER_NAME(AssetPaths_obj::keydoor__png,"keydoor__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::keypad__png,"keypad__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::keypad__xcf,"keypad__xcf");
HX_MARK_MEMBER_NAME(AssetPaths_obj::mineCover1__png,"mineCover1__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::MineCover2__png,"MineCover2__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::minecover3__png,"minecover3__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::minecover4__png,"minecover4__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::MineEntrance__xcf,"MineEntrance__xcf");
HX_MARK_MEMBER_NAME(AssetPaths_obj::MineEntranceCover__png,"MineEntranceCover__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::MineEntranceInterior__png,"MineEntranceInterior__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::MineEntranceInteriorPostDoor__png,"MineEntranceInteriorPostDoor__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::nosecap__png,"nosecap__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::openeing__png,"openeing__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::planet__png,"planet__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::planet__xcf,"planet__xcf");
HX_MARK_MEMBER_NAME(AssetPaths_obj::planetpuppet__png,"planetpuppet__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::player__png,"player__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::rocket__png,"rocket__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::rocketPuppet__png,"rocketPuppet__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::rockWall__png,"rockWall__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::rung__png,"rung__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::table__png,"table__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::tape__png,"tape__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::trapdoorbg__png,"trapdoorbg__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::use__png,"use__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::wrench__png,"wrench__png");
HX_MARK_MEMBER_NAME(AssetPaths_obj::music_goes_here__txt,"music_goes_here__txt");
HX_MARK_MEMBER_NAME(AssetPaths_obj::music__ogg,"music__ogg");
HX_MARK_MEMBER_NAME(AssetPaths_obj::get__wav,"get__wav");
HX_MARK_MEMBER_NAME(AssetPaths_obj::gj__wav,"gj__wav");
HX_MARK_MEMBER_NAME(AssetPaths_obj::gj2__ogg,"gj2__ogg");
HX_MARK_MEMBER_NAME(AssetPaths_obj::gj2__wav,"gj2__wav");
HX_MARK_MEMBER_NAME(AssetPaths_obj::hit__wav,"hit__wav");
HX_MARK_MEMBER_NAME(AssetPaths_obj::kaboom__ogg,"kaboom__ogg");
HX_MARK_MEMBER_NAME(AssetPaths_obj::kaboom__wav,"kaboom__wav");
HX_MARK_MEMBER_NAME(AssetPaths_obj::song_20170423_095337_718__mid,"song_20170423_095337_718__mid");
HX_MARK_MEMBER_NAME(AssetPaths_obj::sounds_go_here__txt,"sounds_go_here__txt");
HX_MARK_MEMBER_NAME(AssetPaths_obj::takeoff__ogg,"takeoff__ogg");
HX_MARK_MEMBER_NAME(AssetPaths_obj::takeoff__wav,"takeoff__wav");
HX_MARK_MEMBER_NAME(AssetPaths_obj::tk1__wav,"tk1__wav");
};
#ifdef HXCPP_VISIT_ALLOCS
static void AssetPaths_obj_sVisitStatics(HX_VISIT_PARAMS) {
HX_VISIT_MEMBER_NAME(AssetPaths_obj::__mClass,"__mClass");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::data_goes_here__txt,"data_goes_here__txt");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::Bedroom__xcf,"Bedroom__xcf");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::BedroomCover__png,"BedroomCover__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::BedroomInterior__png,"BedroomInterior__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::boombox__png,"boombox__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::codedoor__png,"codedoor__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::cover90T1__png,"cover90T1__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::cover90T2__png,"cover90T2__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::coverwrench2__png,"coverwrench2__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::coverWrenchT1__png,"coverWrenchT1__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::empty__png,"empty__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::fin__png,"fin__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::fuelCell__png,"fuelCell__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::FUELCELLBG__png,"FUELCELLBG__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::images_go_here__txt,"images_go_here__txt");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::keydoor__png,"keydoor__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::keypad__png,"keypad__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::keypad__xcf,"keypad__xcf");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::mineCover1__png,"mineCover1__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::MineCover2__png,"MineCover2__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::minecover3__png,"minecover3__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::minecover4__png,"minecover4__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::MineEntrance__xcf,"MineEntrance__xcf");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::MineEntranceCover__png,"MineEntranceCover__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::MineEntranceInterior__png,"MineEntranceInterior__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::MineEntranceInteriorPostDoor__png,"MineEntranceInteriorPostDoor__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::nosecap__png,"nosecap__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::openeing__png,"openeing__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::planet__png,"planet__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::planet__xcf,"planet__xcf");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::planetpuppet__png,"planetpuppet__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::player__png,"player__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::rocket__png,"rocket__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::rocketPuppet__png,"rocketPuppet__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::rockWall__png,"rockWall__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::rung__png,"rung__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::table__png,"table__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::tape__png,"tape__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::trapdoorbg__png,"trapdoorbg__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::use__png,"use__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::wrench__png,"wrench__png");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::music_goes_here__txt,"music_goes_here__txt");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::music__ogg,"music__ogg");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::get__wav,"get__wav");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::gj__wav,"gj__wav");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::gj2__ogg,"gj2__ogg");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::gj2__wav,"gj2__wav");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::hit__wav,"hit__wav");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::kaboom__ogg,"kaboom__ogg");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::kaboom__wav,"kaboom__wav");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::song_20170423_095337_718__mid,"song_20170423_095337_718__mid");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::sounds_go_here__txt,"sounds_go_here__txt");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::takeoff__ogg,"takeoff__ogg");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::takeoff__wav,"takeoff__wav");
HX_VISIT_MEMBER_NAME(AssetPaths_obj::tk1__wav,"tk1__wav");
};
#endif
hx::Class AssetPaths_obj::__mClass;
static ::String AssetPaths_obj_sStaticFields[] = {
HX_HCSTRING("data_goes_here__txt","\xec","\x22","\x23","\xe8"),
HX_HCSTRING("Bedroom__xcf","\xbf","\x3c","\x7e","\x33"),
HX_HCSTRING("BedroomCover__png","\xce","\xbd","\xc3","\xf1"),
HX_HCSTRING("BedroomInterior__png","\xfd","\x91","\xb0","\x18"),
HX_HCSTRING("boombox__png","\xc9","\x5e","\xef","\x16"),
HX_HCSTRING("codedoor__png","\x8e","\x1e","\x90","\x71"),
HX_HCSTRING("cover90T1__png","\xfe","\x0b","\x93","\x2e"),
HX_HCSTRING("cover90T2__png","\x5d","\x68","\xee","\x94"),
HX_HCSTRING("coverwrench2__png","\x77","\xbf","\xa9","\xf3"),
HX_HCSTRING("coverWrenchT1__png","\x8c","\x2f","\x02","\x9f"),
HX_HCSTRING("empty__png","\xdc","\x23","\x57","\xdf"),
HX_HCSTRING("fin__png","\xde","\x9b","\xda","\xc5"),
HX_HCSTRING("fuelCell__png","\x51","\x4e","\x3a","\x40"),
HX_HCSTRING("FUELCELLBG__png","\x8c","\x24","\x0f","\xe9"),
HX_HCSTRING("images_go_here__txt","\x70","\x18","\x1f","\x93"),
HX_HCSTRING("keydoor__png","\xdc","\xa7","\xd1","\xf7"),
HX_HCSTRING("keypad__png","\xf5","\x7f","\x08","\x24"),
HX_HCSTRING("keypad__xcf","\x67","\x88","\x0e","\x24"),
HX_HCSTRING("mineCover1__png","\x5c","\x2a","\x61","\x26"),
HX_HCSTRING("MineCover2__png","\x9b","\x8e","\x48","\xed"),
HX_HCSTRING("minecover3__png","\x3a","\x4b","\xe5","\x0e"),
HX_HCSTRING("minecover4__png","\x99","\xa7","\x40","\x75"),
HX_HCSTRING("MineEntrance__xcf","\x12","\x71","\xe2","\xe5"),
HX_HCSTRING("MineEntranceCover__png","\x9b","\xfc","\x41","\xd3"),
HX_HCSTRING("MineEntranceInterior__png","\x50","\xd1","\xad","\x3c"),
HX_HCSTRING("MineEntranceInteriorPostDoor__png","\x82","\xaf","\x6e","\xc2"),
HX_HCSTRING("nosecap__png","\x4a","\x2a","\xb2","\x55"),
HX_HCSTRING("openeing__png","\xc2","\x5d","\x12","\x28"),
HX_HCSTRING("planet__png","\xf1","\xc3","\x6e","\xbd"),
HX_HCSTRING("planet__xcf","\x63","\xcc","\x74","\xbd"),
HX_HCSTRING("planetpuppet__png","\x7d","\xca","\x14","\x0b"),
HX_HCSTRING("player__png","\x88","\xf2","\xe2","\x65"),
HX_HCSTRING("rocket__png","\xb5","\x7d","\x56","\xfa"),
HX_HCSTRING("rocketPuppet__png","\x21","\xc7","\xae","\x2c"),
HX_HCSTRING("rockWall__png","\xda","\xbb","\xce","\xce"),
HX_HCSTRING("rung__png","\x4d","\xd9","\xbb","\x12"),
HX_HCSTRING("table__png","\xbb","\x12","\xd2","\xd3"),
HX_HCSTRING("tape__png","\xa7","\xf5","\x21","\xc7"),
HX_HCSTRING("trapdoorbg__png","\x29","\x9d","\x5d","\x17"),
HX_HCSTRING("use__png","\xe2","\xaf","\x6f","\x26"),
HX_HCSTRING("wrench__png","\x00","\xe4","\x94","\xf1"),
HX_HCSTRING("music_goes_here__txt","\xd1","\xaa","\xc8","\x0f"),
HX_HCSTRING("music__ogg","\x6a","\xae","\x86","\x8f"),
HX_HCSTRING("get__wav","\xb6","\xa1","\xe0","\xbe"),
HX_HCSTRING("gj__wav","\x09","\x09","\x2e","\x0f"),
HX_HCSTRING("gj2__ogg","\x20","\x16","\x38","\x2b"),
HX_HCSTRING("gj2__wav","\xfd","\x22","\x3e","\x2b"),
HX_HCSTRING("hit__wav","\xd9","\xee","\x68","\x9e"),
HX_HCSTRING("kaboom__ogg","\xce","\xb4","\x5d","\xd5"),
HX_HCSTRING("kaboom__wav","\xab","\xc1","\x63","\xd5"),
HX_HCSTRING("song_20170423_095337_718__mid","\x12","\xe0","\xd0","\x0e"),
HX_HCSTRING("sounds_go_here__txt","\xe4","\xa8","\xcb","\x02"),
HX_HCSTRING("takeoff__ogg","\xa7","\x66","\x67","\x50"),
HX_HCSTRING("takeoff__wav","\x84","\x73","\x6d","\x50"),
HX_HCSTRING("tk1__wav","\xf2","\x08","\x08","\xd6"),
::String(null())
};
void AssetPaths_obj::__register()
{
hx::Static(__mClass) = new hx::Class_obj();
__mClass->mName = HX_HCSTRING("AssetPaths","\x3e","\x0f","\xe6","\x60");
__mClass->mSuper = &super::__SGetClass();
__mClass->mConstructEmpty = &__CreateEmpty;
__mClass->mConstructArgs = &__Create;
__mClass->mGetStaticField = &hx::Class_obj::GetNoStaticField;
__mClass->mSetStaticField = &hx::Class_obj::SetNoStaticField;
__mClass->mMarkFunc = AssetPaths_obj_sMarkStatics;
__mClass->mStatics = hx::Class_obj::dupFunctions(AssetPaths_obj_sStaticFields);
__mClass->mMembers = hx::Class_obj::dupFunctions(0 /* sMemberFields */);
__mClass->mCanCast = hx::TCanCast< AssetPaths_obj >;
#ifdef HXCPP_VISIT_ALLOCS
__mClass->mVisitFunc = AssetPaths_obj_sVisitStatics;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mMemberStorageInfo = AssetPaths_obj_sMemberStorageInfo;
#endif
#ifdef HXCPP_SCRIPTABLE
__mClass->mStaticStorageInfo = AssetPaths_obj_sStaticStorageInfo;
#endif
hx::_hx_RegisterClass(__mClass->mName, __mClass);
}
void AssetPaths_obj::__boot()
{
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) data_goes_here__txt = HX_("assets/data/data-goes-here.txt",5f,4b,b2,8e);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) Bedroom__xcf = HX_("assets/images/Bedroom.xcf",9e,15,b3,f0);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) BedroomCover__png = HX_("assets/images/BedroomCover.png",41,2a,93,0e);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) BedroomInterior__png = HX_("assets/images/BedroomInterior.png",7c,b2,9c,dd);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) boombox__png = HX_("assets/images/boombox.png",30,c6,97,ba);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) codedoor__png = HX_("assets/images/codedoor.png",01,30,06,c6);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) cover90T1__png = HX_("assets/images/cover90T1.png",db,2d,af,5b);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) cover90T2__png = HX_("assets/images/cover90T2.png",5c,c2,15,ef);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) coverwrench2__png = HX_("assets/images/coverwrench2.png",b8,d0,de,4e);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) coverWrenchT1__png = HX_("assets/images/coverWrenchT1.png",8d,94,e1,a2);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) empty__png = HX_("assets/images/empty.png",3d,1d,8e,98);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) fin__png = HX_("assets/images/fin.png",3b,04,c5,f3);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) fuelCell__png = HX_("assets/images/fuelCell.png",9e,69,8e,6e);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) FUELCELLBG__png = HX_("assets/images/FUELCELLBG.png",83,14,02,1f);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) images_go_here__txt = HX_("assets/images/images-go-here.txt",0d,1d,45,a6);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) keydoor__png = HX_("assets/images/keydoor.png",7d,80,58,a2);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) keypad__png = HX_("assets/images/keypad.png",ba,47,e3,7d);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) keypad__xcf = HX_("assets/images/keypad.xcf",2c,50,e9,7d);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) mineCover1__png = HX_("assets/images/mineCover1.png",b3,b8,9f,eb);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) MineCover2__png = HX_("assets/images/MineCover2.png",54,e1,5b,29);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) minecover3__png = HX_("assets/images/minecover3.png",95,dd,bb,1b);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) minecover4__png = HX_("assets/images/minecover4.png",16,72,22,af);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) MineEntrance__xcf = HX_("assets/images/MineEntrance.xcf",21,48,53,fd);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) MineEntranceCover__png = HX_("assets/images/MineEntranceCover.png",de,fc,bd,76);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) MineEntranceInterior__png = HX_("assets/images/MineEntranceInterior.png",ff,9f,47,a2);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) MineEntranceInteriorPostDoor__png = HX_("assets/images/MineEntranceInteriorPostDoor.png",0d,31,78,df);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) nosecap__png = HX_("assets/images/nosecap.png",cf,a5,98,3c);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) openeing__png = HX_("assets/images/openeing.png",4d,d3,92,0a);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) planet__png = HX_("assets/images/planet.png",3e,97,e2,23);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) planet__xcf = HX_("assets/images/planet.xcf",b0,9f,e8,23);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) planetpuppet__png = HX_("assets/images/planetpuppet.png",72,88,74,5a);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) player__png = HX_("assets/images/player.png",87,88,81,c6);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) rocket__png = HX_("assets/images/rocket.png",fa,41,f0,12);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) rocketPuppet__png = HX_("assets/images/rocketPuppet.png",4e,ec,91,52);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) rockWall__png = HX_("assets/images/rockWall.png",35,c0,65,fc);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) rung__png = HX_("assets/images/rung.png",a2,20,36,a0);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) table__png = HX_("assets/images/table.png",3e,ef,4a,49);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) tape__png = HX_("assets/images/tape.png",88,4d,d7,78);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) trapdoorbg__png = HX_("assets/images/trapdoorbg.png",86,5e,b4,ec);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) use__png = HX_("assets/images/use.png",b7,5c,7d,34);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) wrench__png = HX_("assets/images/wrench.png",0f,6e,d8,86);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) music_goes_here__txt = HX_("assets/music/music-goes-here.txt",6b,32,60,47);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) music__ogg = HX_("assets/music/music.ogg",10,2a,92,80);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) get__wav = HX_("assets/sounds/get.wav",15,0d,5f,07);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) gj__wav = HX_("assets/sounds/gj.wav",c0,f4,4a,58);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) gj2__ogg = HX_("assets/sounds/gj2.ogg",d1,84,af,06);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) gj2__wav = HX_("assets/sounds/gj2.wav",ae,91,b5,06);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) hit__wav = HX_("assets/sounds/hit.wav",52,f5,61,ca);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) kaboom__ogg = HX_("assets/sounds/kaboom.ogg",01,35,25,09);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) kaboom__wav = HX_("assets/sounds/kaboom.wav",de,41,2b,09);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) song_20170423_095337_718__mid = HX_("assets/sounds/song_20170423_095337_718.mid",4f,f2,c1,c2);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) sounds_go_here__txt = HX_("assets/sounds/sounds-go-here.txt",8d,b6,3d,a7);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) takeoff__ogg = HX_("assets/sounds/takeoff.ogg",aa,56,bf,f4);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) takeoff__wav = HX_("assets/sounds/takeoff.wav",87,63,c5,f4);
}
{
HX_STACK_FRAME("AssetPaths","boot",0x7f6e2362,"AssetPaths.boot","flixel/system/macros/FlxAssetPaths.hx",28,0x71054749)
HXLINE( 28) tk1__wav = HX_("assets/sounds/tk1.wav",59,61,41,f6);
}
}
| 54.381102
| 153
| 0.72721
|
TinyPlanetStudios
|
a1351821ca5b25d5cb69a289f71a7dfafdc1ff9c
| 3,879
|
cpp
|
C++
|
src/util/network/peer.cpp
|
EnrikoChavez/opencbdc-tx
|
3f4ebe9fa8296542158ff505b47fd8f277e313dd
|
[
"MIT"
] | 652
|
2022-02-03T19:31:04.000Z
|
2022-03-31T17:45:29.000Z
|
src/util/network/peer.cpp
|
EnrikoChavez/opencbdc-tx
|
3f4ebe9fa8296542158ff505b47fd8f277e313dd
|
[
"MIT"
] | 50
|
2022-02-03T23:16:36.000Z
|
2022-03-31T19:50:19.000Z
|
src/util/network/peer.cpp
|
EnrikoChavez/opencbdc-tx
|
3f4ebe9fa8296542158ff505b47fd8f277e313dd
|
[
"MIT"
] | 116
|
2022-02-03T19:57:26.000Z
|
2022-03-20T17:23:47.000Z
|
// Copyright (c) 2021 MIT Digital Currency Initiative,
// Federal Reserve Bank of Boston
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "peer.hpp"
#include <utility>
namespace cbdc::network {
peer::peer(std::unique_ptr<tcp_socket> sock,
peer::callback_type cb,
bool attempt_reconnect)
: m_sock(std::move(sock)),
m_attempt_reconnect(attempt_reconnect),
m_recv_cb(std::move(cb)) {
do_send();
do_recv();
do_reconnect();
}
peer::~peer() {
shutdown();
}
void peer::send(const std::shared_ptr<cbdc::buffer>& data) {
if(!m_shut_down) {
m_send_queue.push(data);
}
}
void peer::shutdown() {
m_shut_down = true;
m_reconnect_cv.notify_one();
if(m_reconnect_thread.joinable()) {
m_reconnect_thread.join();
}
close();
}
auto peer::connected() const -> bool {
return !m_shut_down && m_running && m_sock->connected();
}
void peer::do_send() {
m_send_thread = std::thread([&]() {
while(m_running) {
std::shared_ptr<cbdc::buffer> pkt;
if(!m_send_queue.pop(pkt)) {
continue;
}
if(pkt) {
const auto result = m_sock->send(*pkt);
if(!result) {
signal_reconnect();
return;
}
}
}
});
}
void peer::do_recv() {
m_recv_thread = std::thread([&]() {
while(m_running) {
auto pkt = std::make_shared<cbdc::buffer>();
if(!m_sock->receive(*pkt)) {
signal_reconnect();
return;
}
m_recv_cb(std::move(pkt));
}
});
}
void peer::do_reconnect() {
m_reconnect_thread = std::thread([&]() {
while(!m_shut_down) {
{
std::unique_lock<std::mutex> l(m_reconnect_mut);
m_reconnect_cv.wait(l, [&]() {
return m_reconnect || m_shut_down;
});
m_reconnect = false;
}
if(m_shut_down) {
break;
}
if(m_attempt_reconnect) {
close();
while(!m_shut_down && !m_sock->reconnect()) {
static constexpr auto retry_delay
= std::chrono::seconds(3);
std::unique_lock<std::mutex> l(m_reconnect_mut);
m_reconnect_cv.wait_for(l, retry_delay, [&]() -> bool {
return m_shut_down;
});
}
if(!m_shut_down) {
m_running = true;
do_send();
do_recv();
}
} else {
m_shut_down = true;
close();
m_send_queue.clear();
return;
}
}
});
}
void peer::close() {
m_running = false;
m_sock->disconnect();
m_send_queue.clear();
if(m_send_thread.joinable()) {
m_send_thread.join();
}
if(m_recv_thread.joinable()) {
m_recv_thread.join();
}
}
void peer::signal_reconnect() {
{
std::lock_guard<std::mutex> l(m_reconnect_mut);
m_reconnect = true;
}
m_reconnect_cv.notify_one();
}
}
| 28.522059
| 79
| 0.433617
|
EnrikoChavez
|
a13647035578bcf7d2416dc123347de77e3582be
| 762
|
cpp
|
C++
|
chap09/Exer09_04.cpp
|
sjbarigye/CPP_Primer
|
d9d31a73a45ca46909bae104804fc9503ab242f2
|
[
"Apache-2.0"
] | 50
|
2016-01-08T14:28:53.000Z
|
2022-01-21T12:55:00.000Z
|
chap09/Exer09_04.cpp
|
sjbarigye/CPP_Primer
|
d9d31a73a45ca46909bae104804fc9503ab242f2
|
[
"Apache-2.0"
] | 2
|
2017-06-05T16:45:20.000Z
|
2021-04-17T13:39:24.000Z
|
chap09/Exer09_04.cpp
|
sjbarigye/CPP_Primer
|
d9d31a73a45ca46909bae104804fc9503ab242f2
|
[
"Apache-2.0"
] | 18
|
2016-08-17T15:23:51.000Z
|
2022-03-26T18:08:43.000Z
|
#include <iostream>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
bool findElement(vector<int>::iterator beg, vector<int>::iterator end, int key);
int main()
{
vector<int> v;
int i, key;
cout << "Input a key:" << endl;
cin >> key;
cout << "Input some integers:" << endl;
while(cin >> i)
{
v.push_back(i);
}
if(findElement(v.begin(), v.end(), key))
cout << key << " is in vector." << endl;
else
cout << key << " is not in vector" << endl;
return 0;
}
bool findElement(vector<int>::iterator beg, vector<int>::iterator end, int key)
{
while(beg != end)
{
if(key == *beg)
return true;
++beg;
}
return false;
}
| 20.052632
| 80
| 0.545932
|
sjbarigye
|
a136930474a93f4bbffcaab201c34ef64792a575
| 882
|
hpp
|
C++
|
SDK/ARKSurvivalEvolved_PrimalItemStructure_CropPlot_Tek_classes.hpp
|
2bite/ARK-SDK
|
c38ca9925309516b2093ad8c3a70ed9489e1d573
|
[
"MIT"
] | 10
|
2020-02-17T19:08:46.000Z
|
2021-07-31T11:07:19.000Z
|
SDK/ARKSurvivalEvolved_PrimalItemStructure_CropPlot_Tek_classes.hpp
|
2bite/ARK-SDK
|
c38ca9925309516b2093ad8c3a70ed9489e1d573
|
[
"MIT"
] | 9
|
2020-02-17T18:15:41.000Z
|
2021-06-06T19:17:34.000Z
|
SDK/ARKSurvivalEvolved_PrimalItemStructure_CropPlot_Tek_classes.hpp
|
2bite/ARK-SDK
|
c38ca9925309516b2093ad8c3a70ed9489e1d573
|
[
"MIT"
] | 3
|
2020-07-22T17:42:07.000Z
|
2021-06-19T17:16:13.000Z
|
#pragma once
// ARKSurvivalEvolved (329.9) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "ARKSurvivalEvolved_PrimalItemStructure_CropPlot_Tek_structs.hpp"
namespace sdk
{
//---------------------------------------------------------------------------
//Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass PrimalItemStructure_CropPlot_Tek.PrimalItemStructure_CropPlot_Tek_C
// 0x0000 (0x0AE0 - 0x0AE0)
class UPrimalItemStructure_CropPlot_Tek_C : public UPrimalItemStructureGeneric_C
{
public:
static UClass* StaticClass()
{
static auto ptr = UObject::FindClass("BlueprintGeneratedClass PrimalItemStructure_CropPlot_Tek.PrimalItemStructure_CropPlot_Tek_C");
return ptr;
}
void ExecuteUbergraph_PrimalItemStructure_CropPlot_Tek(int EntryPoint);
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| 22.615385
| 134
| 0.672336
|
2bite
|
a13ce1e26ae6d6dda59297a021c79415ab518874
| 31,253
|
cpp
|
C++
|
src/mqtt/qmqttclient.cpp
|
aron566/libmqttclient
|
86e249bad6e2b0c27b710878a6f8ec95f6f7146f
|
[
"Apache-2.0"
] | 1
|
2020-09-07T15:45:48.000Z
|
2020-09-07T15:45:48.000Z
|
src/mqtt/qmqttclient.cpp
|
aron566/libmqttclient
|
86e249bad6e2b0c27b710878a6f8ec95f6f7146f
|
[
"Apache-2.0"
] | null | null | null |
src/mqtt/qmqttclient.cpp
|
aron566/libmqttclient
|
86e249bad6e2b0c27b710878a6f8ec95f6f7146f
|
[
"Apache-2.0"
] | null | null | null |
/******************************************************************************
**
** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtMqtt module.
**
** $QT_BEGIN_LICENSE:GPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 or (at your option) any later version
** approved by the KDE Free Qt Foundation. The licenses are as published by
** the Free Software Foundation and appearing in the file LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
******************************************************************************/
#include "qmqttclient.h"
#include "qmqttclient_p.h"
#include <QtCore/QLoggingCategory>
#include <QtCore/QUuid>
#include <QtCore/QtEndian>
QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcMqttClient, "qt.mqtt.client")
/*!
\class QMqttClient
\inmodule QtMqtt
\brief The QMqttClient class represents the central access communicating
with an MQTT broker.
An MQTT client is a program or device that uses MQTT to create a network
connection to an MQTT server, also called a \e broker. The connection
request must contain a unique client identifier. Optionally, it can contain
a Will Topic, Will Message, user name, and password.
Once a connection is created, a client can send messages that other clients
might be interested in receiving, subscribe to request notifications on
topics, unsubscribe to remove a request for notifications, and disconnect
from the broker.
*/
/*!
\property QMqttClient::clientId
\brief This property holds the client's identifier value.
Each client needs to have a unique ID to be able to connect to an MQTT
broker. If no client ID is specified by the user, one will be generated
automatically when a connection is established.
*/
/*!
\property QMqttClient::hostname
\brief This property holds the hostname of the MQTT broker to connect to.
If no transport is specified via setTransport(), the client will instantiate
a socket connection to the specified hostname itself.
*/
/*!
\property QMqttClient::port
\brief This property holds the port to connect to the MQTT broker.
If no transport is specified via setTransport(), the client will instantiate
a socket connection to a host with this port number.
*/
/*!
\property QMqttClient::keepAlive
\brief This property holds the interval at which regular ping messages are
sent to the broker.
Once a connection to a broker is established, the client needs to send
frequent updates to propagate it can still be reached. The interval between
those updates is specified by this property.
The interval is specified in seconds.
If the broker does not respond within a grace period the connection will be
closed.
\sa autoKeepAlive(), requestPing(), pingResponseReceived()
*/
/*!
\property QMqttClient::protocolVersion
\brief This property holds the MQTT standard version to use for connections.
Specifies the version of the standard the client uses for connecting to a
broker. Valid values are:
\list
\li 3: MQTT standard version 3.1.
\li 4: MQTT standard version 3.1.1, often referred to MQTT 4.
\endlist
*/
/*!
\property QMqttClient::state
\brief This property holds the current state of the client.
*/
/*!
\property QMqttClient::error
\brief Specifies the current error of the client.
*/
/*!
\property QMqttClient::username
\brief This property holds the user name for connecting to a broker.
*/
/*!
\property QMqttClient::password
\brief This property holds the password for connecting to a broker.
*/
/*!
\property QMqttClient::cleanSession
\brief This property holds the state after connecting to a broker.
*/
/*!
\property QMqttClient::willTopic
\brief This property holds the Will Topic.
*/
/*!
\property QMqttClient::willMessage
\brief This property holds the payload of a Will Message.
*/
/*!
\property QMqttClient::willQoS
\brief This property holds the level of QoS for sending and storing the
Will Message.
*/
/*!
\property QMqttClient::willRetain
\brief This property holds whether the Will Message should be retained on
the broker for future subscribers to receive.
*/
/*!
\property QMqttClient::autoKeepAlive
\since 5.14
\brief This property holds whether the client will automatically manage
keep alive messages to the server.
If this property is \c true, then the client will automatically send a
ping message to the server at the keepAlive interval.
Otherwise, a user will have to manually invoke requestPing
within the specified interval of the connection. If no ping has been
sent within the interval, the server will disconnect.
The default of this property is \c true.
\sa keepAlive(), requestPing(), serverConnectionProperties(), pingResponseReceived()
*/
/*!
\enum QMqttClient::TransportType
This enum type specifies the connection method to be used to instantiate a
connection to a broker.
\value IODevice
The transport uses a class based on a QIODevice.
\value AbstractSocket
The transport uses a class based on a QAbstractSocket.
\value SecureSocket
The transport uses a class based on a QSslSocket.
*/
/*!
\enum QMqttClient::ClientState
This enum type specifies the states a client can enter.
\value Disconnected
The client is disconnected from the broker.
\value Connecting
A connection request has been made, but the broker has not approved
the connection yet.
\value Connected
The client is connected to the broker.
*/
/*!
\enum QMqttClient::ClientError
This enum type specifies the error state of a client.
\value NoError
No error occurred.
\value InvalidProtocolVersion
The broker does not accept a connection using the specified protocol
version.
\value IdRejected
The client ID is malformed. This might be related to its length.
\value ServerUnavailable
The network connection has been established, but the service is
unavailable on the broker side.
\value BadUsernameOrPassword
The data in the username or password is malformed.
\value NotAuthorized
The client is not authorized to connect.
\value TransportInvalid
The underlying transport caused an error. For example, the connection
might have been interrupted unexpectedly.
\value ProtocolViolation
The client encountered a protocol violation, and therefore closed the
connection.
\value UnknownError
An unknown error occurred.
\value Mqtt5SpecificError
The error is related to MQTT protocol level 5. A reason code might
provide more details.
*/
/*!
\enum QMqttClient::ProtocolVersion
This enum specifies the protocol version of the MQTT standard to use during
communication with a broker.
\value MQTT_3_1
MQTT Standard 3.1
\value MQTT_3_1_1
MQTT Standard 3.1.1, publicly referred to as version 4
\value MQTT_5_0
MQTT Standard 5.0
*/
/*!
\fn QMqttClient::connected()
This signal is emitted when a connection has been established.
*/
/*!
\fn QMqttClient::disconnected()
This signal is emitted when a connection has been closed. A connection may
be closed when disconnectFromHost() is called or when the broker
disconnects.
*/
/*!
\fn QMqttClient::messageReceived(const QByteArray &message, const QMqttTopicName &topic)
This signal is emitted when a new message has been received. The category of
the message is specified by \a topic with the content being \a message.
*/
/*!
\fn QMqttClient::messageStatusChanged(qint32 id, QMqtt::MessageStatus s, const QMqttMessageStatusProperties &properties);
\since 5.12
This signal is emitted when the status for the message identified by \a id
changes. \a s specifies the new status of the message, and
\a properties specify additional properties provided by the server.
*/
/*!
\fn QMqttClient::messageSent(qint32 id)
Indicates that a message that was sent via the publish() function has been
received by the broker. The \a id is the same as returned by \c publish() to
help tracking the status of the message.
*/
/*!
\fn QMqttClient::pingResponseReceived()
This signal is emitted after the broker responds to a requestPing() call or
a keepAlive() ping message, and the connection is still valid.
*/
/*!
\fn QMqttClient::brokerSessionRestored()
This signal is emitted after a client has successfully connected to a broker
with the cleanSession property set to \c false, and the broker has restored
the session.
Sessions can be restored if a client has connected previously using the same
clientId.
*/
/*!
\since 5.12
\fn QMqttClient::authenticationRequested(const QMqttAuthenticationProperties &p)
This signal is emitted after a client invoked QMqttClient::connectToHost or
QMqttClient::connectToHostEncrypted and before the connection is
established. In extended authentication, a broker might request additional
details which need to be provided by invoking QMqttClient::authenticate.
\a p specifies properties provided by the broker.
\note Extended authentication is part of the MQTT 5.0 standard and can
only be used when the client specifies MQTT_5_0 as ProtocolVersion.
\sa authenticationFinished(), authenticate()
*/
/*!
\since 5.12
\fn QMqttClient::authenticationFinished(const QMqttAuthenticationProperties &p)
This signal is emitted after extended authentication has finished. \a p
specifies available details on the authentication process.
After successful authentication QMqttClient::connected is emitted.
\note Extended authentication is part of the MQTT 5.0 standard and can
only be used when the client specifies MQTT_5_0 as ProtocolVersion.
\sa authenticationRequested(), authenticate()
*/
/*
Creates a new MQTT client instance with the specified \a parent.
*/
QMqttClient::QMqttClient(QObject *parent) : QObject(*(new QMqttClientPrivate(this)), parent)
{
Q_D(QMqttClient);
d->m_connection.setClientPrivate(d);
}
/*!
Sets the transport to \a device. A transport can be either a socket type
or derived from QIODevice and is specified by \a transport.
\note The transport can only be exchanged if the MQTT client is in the
\l Disconnected state.
\note Setting a custom transport for a client does not pass over responsibility
on connection management. The transport has to be opened for QIODevice based
transports or connected for socket type transports before calling QMqttClient::connectToHost().
*/
void QMqttClient::setTransport(QIODevice *device, QMqttClient::TransportType transport)
{
Q_D(QMqttClient);
if (d->m_state != Disconnected) {
qCDebug(lcMqttClient) << "Changing transport layer while connected is not possible.";
return;
}
d->m_connection.setTransport(device, transport);
}
/*!
Returns the transport used for communication with the broker.
*/
QIODevice *QMqttClient::transport() const
{
Q_D(const QMqttClient);
return d->m_connection.transport();
}
/*!
Adds a new subscription to receive notifications on \a topic. The parameter
\a qos specifies the level at which security messages are received. For more
information about the available QoS levels, see \l {Quality of Service}.
This function returns a pointer to a \l QMqttSubscription. If the same topic
is subscribed twice, the return value points to the same subscription
instance. The MQTT client is the owner of the subscription.
*/
QMqttSubscription *QMqttClient::subscribe(const QMqttTopicFilter &topic, quint8 qos)
{
return subscribe(topic, QMqttSubscriptionProperties(), qos);
}
/*!
\since 5.12
Adds a new subscription to receive notifications on \a topic. The parameter
\a properties specifies additional subscription properties to be validated
by the broker. The parameter \a qos specifies the level at which security
messages are received. For more information about the available QoS levels,
see \l {Quality of Service}.
This function returns a pointer to a \l QMqttSubscription. If the same topic
is subscribed twice, the return value points to the same subscription
instance. The MQTT client is the owner of the subscription.
\note \a properties will only be passed to the broker when the client
specifies MQTT_5_0 as ProtocolVersion.
*/
QMqttSubscription *QMqttClient::subscribe(const QMqttTopicFilter &topic, const QMqttSubscriptionProperties &properties, quint8 qos)
{
Q_D(QMqttClient);
if (d->m_state != QMqttClient::Connected)
return nullptr;
return d->m_connection.sendControlSubscribe(topic, qos, properties);
}
/*!
Unsubscribes from \a topic. No notifications will be sent to any of the
subscriptions made by calling subscribe().
\note If a client disconnects from a broker without unsubscribing, the
broker will store all messages and publish them on the next reconnect.
*/
void QMqttClient::unsubscribe(const QMqttTopicFilter &topic)
{
unsubscribe(topic, QMqttUnsubscriptionProperties());
}
/*!
\since 5.12
Unsubscribes from \a topic. No notifications will be sent to any of the
subscriptions made by calling subscribe(). \a properties specifies
additional user properties to be passed to the broker.
\note If a client disconnects from a broker without unsubscribing, the
broker will store all messages and publish them on the next reconnect.
\note \a properties will only be passed to the broker when the client
specifies MQTT_5_0 as ProtocolVersion.
*/
void QMqttClient::unsubscribe(const QMqttTopicFilter &topic, const QMqttUnsubscriptionProperties &properties)
{
Q_D(QMqttClient);
d->m_connection.sendControlUnsubscribe(topic, properties);
}
/*!
Publishes a \a message to the broker with the specified \a topic. \a qos
specifies the level of security required for transferring the message.
If \a retain is set to \c true, the message will stay on the broker for
other clients to connect and receive the message.
Returns an ID that is used internally to identify the message.
*/
qint32 QMqttClient::publish(const QMqttTopicName &topic, const QByteArray &message, quint8 qos, bool retain)
{
return publish(topic, QMqttPublishProperties(), message, qos, retain);
}
/*!
\since 5.12
Publishes a \a message to the broker with the specified \a properties and
\a topic. \a qos specifies the level of security required for transferring
the message.
If \a retain is set to \c true, the message will stay on the broker for
other clients to connect and receive the message.
Returns an ID that is used internally to identify the message.
\note \a properties will only be passed to the broker when the client
specifies MQTT_5_0 as ProtocolVersion.
*/
qint32 QMqttClient::publish(const QMqttTopicName &topic, const QMqttPublishProperties &properties,
const QByteArray &message, quint8 qos, bool retain)
{
Q_D(QMqttClient);
if (qos > 2)
return -1;
if (d->m_state != QMqttClient::Connected)
return -1;
return d->m_connection.sendControlPublish(topic, message, qos, retain, properties);
}
/*!
Sends a ping message to the broker and expects a reply.
If the connection is active and \l autoKeepAlive is \c true, then calling this
function will fail as the client is responsible for managing this process.
Using \c requestPing() manually requires a call every time within the \l keepAlive
interval as long as the connection is active.
To check whether the ping is successful, connect to the
\l pingResponseReceived() signal.
Returns \c true if the ping request could be sent.
\sa pingResponseReceived(), autoKeepAlive(), keepAlive()
*/
bool QMqttClient::requestPing()
{
Q_D(QMqttClient);
return d->m_connection.sendControlPingRequest(false);
}
QString QMqttClient::hostname() const
{
Q_D(const QMqttClient);
return d->m_hostname;
}
quint16 QMqttClient::port() const
{
Q_D(const QMqttClient);
return d->m_port;
}
/*!
Initiates a connection to the MQTT broker.
*/
void QMqttClient::connectToHost()
{
connectToHost(false, QString());
}
/*!
\obsolete
Initiates an encrypted connection to the MQTT broker.
\a sslPeerName specifies the peer name to be passed to the socket.
This function has been deprecated. Use
\l QMqttClient::connectToHostEncrypted(const QSslConfiguration &conf) instead.
*/
#ifndef QT_NO_SSL
#if QT_DEPRECATED_SINCE(5, 14)
void QMqttClient::connectToHostEncrypted(const QString &sslPeerName)
{
connectToHost(true, sslPeerName);
}
#endif
/*!
\since 5.14
Initiates an encrypted connection to the MQTT broker.
\a conf specifies the SSL configuration to be used for the connection
*/
void QMqttClient::connectToHostEncrypted(const QSslConfiguration &conf)
{
Q_D(QMqttClient);
d->m_connection.m_sslConfiguration = conf;
connectToHost(true, QString());
}
#endif
void QMqttClient::connectToHost(bool encrypted, const QString &sslPeerName)
{
Q_D(QMqttClient);
if (state() == QMqttClient::Connecting) {
qCDebug(lcMqttClient) << "Connection request currently ongoing.";
return;
}
if (state() == QMqttClient::Connected) {
qCDebug(lcMqttClient) << "Already connected to a broker. Rejecting connection request.";
return;
}
if (!d->m_connection.ensureTransport(encrypted)) {
qCDebug(lcMqttClient) << "Could not ensure connection.";
d->setStateAndError(Disconnected, TransportInvalid);
return;
}
d->m_error = QMqttClient::NoError; // Fresh reconnect, unset error
d->setStateAndError(Connecting);
if (d->m_cleanSession)
d->m_connection.cleanSubscriptions();
if (!d->m_connection.ensureTransportOpen(sslPeerName)) {
qCDebug(lcMqttClient) << "Could not ensure that connection is open.";
d->setStateAndError(Disconnected, TransportInvalid);
return;
}
// Once transport has connected, it will invoke
// QMqttConnection::sendControlConnect to
// handshake with the broker
}
/*!
Disconnects from the MQTT broker.
*/
void QMqttClient::disconnectFromHost()
{
Q_D(QMqttClient);
switch (d->m_connection.internalState()) {
case QMqttConnection::BrokerConnected:
d->m_connection.sendControlDisconnect();
break;
case QMqttConnection::BrokerDisconnected:
break;
case QMqttConnection::BrokerConnecting:
case QMqttConnection::BrokerWaitForConnectAck:
d->m_connection.m_transport->close();
break;
}
}
QMqttClient::ClientState QMqttClient::state() const
{
Q_D(const QMqttClient);
return d->m_state;
}
QString QMqttClient::username() const
{
Q_D(const QMqttClient);
return d->m_username;
}
QString QMqttClient::password() const
{
Q_D(const QMqttClient);
return d->m_password;
}
bool QMqttClient::cleanSession() const
{
Q_D(const QMqttClient);
return d->m_cleanSession;
}
QString QMqttClient::willTopic() const
{
Q_D(const QMqttClient);
return d->m_willTopic;
}
quint8 QMqttClient::willQoS() const
{
Q_D(const QMqttClient);
return d->m_willQoS;
}
QByteArray QMqttClient::willMessage() const
{
Q_D(const QMqttClient);
return d->m_willMessage;
}
bool QMqttClient::willRetain() const
{
Q_D(const QMqttClient);
return d->m_willRetain;
}
bool QMqttClient::autoKeepAlive() const
{
Q_D(const QMqttClient);
return d->m_autoKeepAlive;
}
/*!
\since 5.12
Sets the connection properties to \a prop. \l QMqttConnectionProperties
can be used to ask the server to use a specific feature set. After a
connection request the server response can be obtained by calling
\l QMqttClient::serverConnectionProperties.
\note The connection properties can only be set if the MQTT client is in the
\l Disconnected state.
\note QMqttConnectionProperties can only be used when the client specifies
MQTT_5_0 as ProtocolVersion.
*/
void QMqttClient::setConnectionProperties(const QMqttConnectionProperties &prop)
{
Q_D(QMqttClient);
d->m_connectionProperties = prop;
}
/*!
\since 5.12
Returns the connection properties the client requests to the broker.
\note QMqttConnectionProperties can only be used when the client specifies
MQTT_5_0 as ProtocolVersion.
*/
QMqttConnectionProperties QMqttClient::connectionProperties() const
{
Q_D(const QMqttClient);
return d->m_connectionProperties;
}
/*!
\since 5.12
Sets the last will properties to \a prop. QMqttLastWillProperties allows
to set additional features for the last will message stored at the broker.
\note The connection properties can only be set if the MQTT client is in the
\l Disconnected state.
\note QMqttLastWillProperties can only be used when the client specifies
MQTT_5_0 as ProtocolVersion.
*/
void QMqttClient::setLastWillProperties(const QMqttLastWillProperties &prop)
{
Q_D(QMqttClient);
d->m_lastWillProperties = prop;
}
/*!
\since 5.12
Returns the last will properties.
\note QMqttLastWillProperties can only be used when the client specifies
MQTT_5_0 as ProtocolVersion.
*/
QMqttLastWillProperties QMqttClient::lastWillProperties() const
{
Q_D(const QMqttClient);
return d->m_lastWillProperties;
}
/*!
\since 5.12
Returns the QMqttServerConnectionProperties the broker returned after a
connection attempt.
This can be used to verify that client side connection properties set by
QMqttClient::setConnectionProperties have been accepted by the broker. Also,
in case of a failed connection attempt, it can be used for connection
diagnostics.
\note QMqttServerConnectionProperties can only be used when the client
specifies MQTT_5_0 as ProtocolVersion.
\sa connectionProperties()
*/
QMqttServerConnectionProperties QMqttClient::serverConnectionProperties() const
{
Q_D(const QMqttClient);
return d->m_serverConnectionProperties;
}
/*!
\since 5.12
Sends an authentication request to the broker. \a prop specifies
the required information to fulfill the authentication request.
This function should only be called after a
QMqttClient::authenticationRequested signal has been emitted.
\note Extended authentication is part of the MQTT 5.0 standard and can
only be used when the client specifies MQTT_5_0 as ProtocolVersion.
\sa authenticationRequested(), authenticationFinished()
*/
void QMqttClient::authenticate(const QMqttAuthenticationProperties &prop)
{
Q_D(QMqttClient);
if (protocolVersion() != QMqttClient::MQTT_5_0) {
qCDebug(lcMqttClient) << "Authentication is only supported on protocol level 5.";
return;
}
if (state() == QMqttClient::Disconnected) {
qCDebug(lcMqttClient) << "Cannot send authentication request while disconnected.";
return;
}
d->m_connection.sendControlAuthenticate(prop);
}
QMqttClient::ClientError QMqttClient::error() const
{
Q_D(const QMqttClient);
return d->m_error;
}
QMqttClient::ProtocolVersion QMqttClient::protocolVersion() const
{
Q_D(const QMqttClient);
return d->m_protocolVersion;
}
QString QMqttClient::clientId() const
{
Q_D(const QMqttClient);
return d->m_clientId;
}
quint16 QMqttClient::keepAlive() const
{
Q_D(const QMqttClient);
return d->m_keepAlive;
}
void QMqttClient::setHostname(const QString &hostname)
{
Q_D(QMqttClient);
if (state() != QMqttClient::Disconnected) {
qCDebug(lcMqttClient) << "Changing hostname while connected is not possible.";
return;
}
if (d->m_hostname == hostname)
return;
d->m_hostname = hostname;
emit hostnameChanged(hostname);
}
void QMqttClient::setPort(quint16 port)
{
Q_D(QMqttClient);
if (state() != QMqttClient::Disconnected) {
qCDebug(lcMqttClient) << "Changing port while connected is not possible.";
return;
}
if (d->m_port == port)
return;
d->m_port = port;
emit portChanged(port);
}
void QMqttClient::setClientId(const QString &clientId)
{
Q_D(QMqttClient);
if (state() != QMqttClient::Disconnected) {
qCDebug(lcMqttClient) << "Changing client ID while connected is not possible.";
return;
}
d->setClientId(clientId);
}
void QMqttClient::setKeepAlive(quint16 keepAlive)
{
Q_D(QMqttClient);
if (d->m_keepAlive == keepAlive)
return;
if (state() != QMqttClient::Disconnected) {
qCDebug(lcMqttClient) << "Changing keepAlive while connected is not possible.";
return;
}
d->m_keepAlive = keepAlive;
emit keepAliveChanged(keepAlive);
}
void QMqttClient::setProtocolVersion(ProtocolVersion protocolVersion)
{
Q_D(QMqttClient);
if (state() != QMqttClient::Disconnected) {
qCDebug(lcMqttClient) << "Changing protocol version while connected is not possible.";
return;
}
if (d->m_protocolVersion == protocolVersion)
return;
if (protocolVersion < 3 || protocolVersion > 5)
return;
d->m_protocolVersion = protocolVersion;
emit protocolVersionChanged(protocolVersion);
}
void QMqttClient::setState(ClientState state)
{
Q_D(QMqttClient);
if (d->m_state == state)
return;
d->m_state = state;
emit stateChanged(state);
if (d->m_state == QMqttClient::Disconnected)
emit disconnected();
else if (d->m_state == QMqttClient::Connected)
emit connected();
}
void QMqttClient::setUsername(const QString &username)
{
Q_D(QMqttClient);
if (state() != QMqttClient::Disconnected) {
qCDebug(lcMqttClient) << "Changing username while connected is not possible.";
return;
}
if (d->m_username == username)
return;
d->m_username = username;
emit usernameChanged(username);
}
void QMqttClient::setPassword(const QString &password)
{
Q_D(QMqttClient);
if (state() != QMqttClient::Disconnected) {
qCDebug(lcMqttClient) << "Changing password while connected is not possible.";
return;
}
if (d->m_password == password)
return;
d->m_password = password;
emit passwordChanged(password);
}
void QMqttClient::setCleanSession(bool cleanSession)
{
Q_D(QMqttClient);
if (state() != QMqttClient::Disconnected) {
qCDebug(lcMqttClient) << "Changing clean session while connected is not possible.";
return;
}
if (d->m_cleanSession == cleanSession)
return;
d->m_cleanSession = cleanSession;
emit cleanSessionChanged(cleanSession);
}
void QMqttClient::setWillTopic(const QString &willTopic)
{
Q_D(QMqttClient);
if (state() != QMqttClient::Disconnected) {
qCDebug(lcMqttClient) << "Changing will topic while connected is not possible.";
return;
}
if (d->m_willTopic == willTopic)
return;
d->m_willTopic = willTopic;
emit willTopicChanged(willTopic);
}
void QMqttClient::setWillQoS(quint8 willQoS)
{
Q_D(QMqttClient);
if (state() != QMqttClient::Disconnected) {
qCDebug(lcMqttClient) << "Changing will qos while connected is not possible.";
return;
}
if (d->m_willQoS == willQoS)
return;
d->m_willQoS = willQoS;
emit willQoSChanged(willQoS);
}
void QMqttClient::setWillMessage(const QByteArray &willMessage)
{
Q_D(QMqttClient);
if (state() != QMqttClient::Disconnected) {
qCDebug(lcMqttClient) << "Changing will message while connected is not possible.";
return;
}
if (d->m_willMessage == willMessage)
return;
d->m_willMessage = willMessage;
emit willMessageChanged(willMessage);
}
void QMqttClient::setWillRetain(bool willRetain)
{
Q_D(QMqttClient);
if (state() != QMqttClient::Disconnected) {
qCDebug(lcMqttClient) << "Changing will retain while connected is not possible.";
return;
}
if (d->m_willRetain == willRetain)
return;
d->m_willRetain = willRetain;
emit willRetainChanged(willRetain);
}
void QMqttClient::setAutoKeepAlive(bool autoKeepAlive)
{
Q_D(QMqttClient);
if (state() != QMqttClient::Disconnected) {
qCDebug(lcMqttClient) << "Changing autoKeepAlive while connected is not possible.";
return;
}
if (d->m_autoKeepAlive == autoKeepAlive)
return;
d->m_autoKeepAlive = autoKeepAlive;
emit autoKeepAliveChanged(d->m_autoKeepAlive);
}
void QMqttClient::setError(ClientError e)
{
Q_D(QMqttClient);
if (d->m_error == e)
return;
d->m_error = e;
emit errorChanged(d->m_error);
}
QMqttClientPrivate::QMqttClientPrivate(QMqttClient *c)
: QObjectPrivate()
{
m_client = c;
m_clientId = QUuid::createUuid().toString();
m_clientId.remove(QLatin1Char('{'));
m_clientId.remove(QLatin1Char('}'));
m_clientId.remove(QLatin1Char('-'));
m_clientId.resize(23);
#ifdef QT_BUILD_INTERNAL
// Some test servers require a username token
if (qEnvironmentVariableIsSet("QT_MQTT_TEST_USERNAME"))
m_username = qEnvironmentVariable("QT_MQTT_TEST_USERNAME");
if (qEnvironmentVariableIsSet("QT_MQTT_TEST_PASSWORD"))
m_password = qEnvironmentVariable("QT_MQTT_TEST_PASSWORD");
if (qEnvironmentVariableIsSet("QT_MQTT_TEST_CLIENTID"))
m_clientId = qEnvironmentVariable("QT_MQTT_TEST_CLIENTID");
#endif
}
QMqttClientPrivate::~QMqttClientPrivate()
{
}
void QMqttClientPrivate::setStateAndError(QMqttClient::ClientState s, QMqttClient::ClientError e)
{
Q_Q(QMqttClient);
if (s != m_state)
q->setState(s);
if (e != QMqttClient::NoError && m_error != e)
q->setError(e);
}
void QMqttClientPrivate::setClientId(const QString &id)
{
Q_Q(QMqttClient);
if (m_clientId == id)
return;
m_clientId = id;
emit q->clientIdChanged(id);
}
QT_END_NAMESPACE
| 28.619963
| 131
| 0.707356
|
aron566
|
a140b31ec4a2c81f4898956fed47dec9b9e90ffc
| 186
|
cc
|
C++
|
source/InterceptRoutingPlugin/DynamicBinaryInstrument/helper-arch/helper-x64.cc
|
hyl946/Dobby
|
277de270f93736b22934e591625a0f9cb532415d
|
[
"Apache-2.0"
] | 1
|
2020-07-10T03:31:55.000Z
|
2020-07-10T03:31:55.000Z
|
source/InterceptRoutingPlugin/DynamicBinaryInstrument/helper-arch/helper-x64.cc
|
hyl946/Dobby
|
277de270f93736b22934e591625a0f9cb532415d
|
[
"Apache-2.0"
] | 1
|
2021-02-03T09:29:51.000Z
|
2021-02-03T09:29:51.000Z
|
source/InterceptRoutingPlugin/DynamicBinaryInstrument/helper-arch/helper-x64.cc
|
hyl946/Dobby
|
277de270f93736b22934e591625a0f9cb532415d
|
[
"Apache-2.0"
] | 6
|
2020-06-05T16:56:45.000Z
|
2021-01-19T07:41:45.000Z
|
#include "dobby_internal.h"
void set_routing_bridge_next_hop(RegisterContext *reg_ctx, void *address) {
}
void get_routing_bridge_next_hop(RegisterContext *reg_ctx, void *address) {
}
| 23.25
| 75
| 0.806452
|
hyl946
|
a145bbb4e20d301cee6b19f1100a28ea4ee495bc
| 1,183
|
cpp
|
C++
|
codeforces/1408A.cpp
|
sgrade/cpptest
|
84ade6ec03ea394d4a4489c7559d12b4799c0b62
|
[
"MIT"
] | null | null | null |
codeforces/1408A.cpp
|
sgrade/cpptest
|
84ade6ec03ea394d4a4489c7559d12b4799c0b62
|
[
"MIT"
] | null | null | null |
codeforces/1408A.cpp
|
sgrade/cpptest
|
84ade6ec03ea394d4a4489c7559d12b4799c0b62
|
[
"MIT"
] | null | null | null |
// A. Circle Coloring
#include <iostream>
#include <vector>
using namespace std;
int main(){
int t;
cin >> t;
while (t--){
int n;
cin >> n;
vector<vector<int>> v(3);
int tmp;
for (int i=0; i<3; ++i){
for (int j=0; j<n; ++j){
cin >> tmp;
v[i].push_back(tmp);
}
}
int first = v[0][0];
int prev = v[0][0];
cout << prev << ' ';
for (int i=1; i<n; ++i){
bool flag = false;
for (int j=0; j<3; ++j){
if (v[j][i] != prev && i!=n-1){
cout << v[j][i] << ' ';
prev = v[j][i];
break;
}
if (i==n-1){
for (int k=0; j<3; ++k){
if (v[k][i] != first && v[k][i] != prev){
cout << v[k][i] << ' ';
flag = true;
break;
}
}
}
if (flag) break;
}
}
cout << endl;
}
return 0;
}
| 21.125
| 65
| 0.277261
|
sgrade
|
a146e895466fe67bf0f271bce618c1daeee587c7
| 498
|
cpp
|
C++
|
uva/10550.cpp
|
cosmicray001/Online_judge_Solutions-
|
5dc6f90d3848eb192e6edea8e8c731f41a1761dd
|
[
"MIT"
] | 3
|
2018-01-08T02:52:51.000Z
|
2021-03-03T01:08:44.000Z
|
uva/10550.cpp
|
cosmicray001/Online_judge_Solutions-
|
5dc6f90d3848eb192e6edea8e8c731f41a1761dd
|
[
"MIT"
] | null | null | null |
uva/10550.cpp
|
cosmicray001/Online_judge_Solutions-
|
5dc6f90d3848eb192e6edea8e8c731f41a1761dd
|
[
"MIT"
] | 1
|
2020-08-13T18:07:35.000Z
|
2020-08-13T18:07:35.000Z
|
#include <bits/stdc++.h>
using namespace std;
int main(){
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int i, a, b, c, temp, d;
while(scanf("%d %d %d %d", &i, &a, &b, &c) != EOF && (i || a || b || c)){
d = 1080;
temp = i - a;
if(temp < 0) temp += 40;
d += (temp * 9);
temp = b - a;
if(temp < 0) temp += 40;
d += (temp * 9);
temp = b - c;
if(temp < 0) temp += 40;
d += (temp * 9);
printf("%d\n", d);
}
return 0;
}
| 22.636364
| 75
| 0.435743
|
cosmicray001
|
a147e9e27bbc4f8700d6b25d6103549d03d18e1b
| 2,644
|
hpp
|
C++
|
libs/boost_1_72_0/boost/fusion/algorithm/query/detail/segmented_find_if.hpp
|
henrywarhurst/matrix
|
317a2a7c35c1c7e3730986668ad2270dc19809ef
|
[
"BSD-3-Clause"
] | null | null | null |
libs/boost_1_72_0/boost/fusion/algorithm/query/detail/segmented_find_if.hpp
|
henrywarhurst/matrix
|
317a2a7c35c1c7e3730986668ad2270dc19809ef
|
[
"BSD-3-Clause"
] | null | null | null |
libs/boost_1_72_0/boost/fusion/algorithm/query/detail/segmented_find_if.hpp
|
henrywarhurst/matrix
|
317a2a7c35c1c7e3730986668ad2270dc19809ef
|
[
"BSD-3-Clause"
] | null | null | null |
/*=============================================================================
Copyright (c) 2011 Eric Niebler
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !defined(BOOST_FUSION_SEGMENTED_FIND_IF_HPP_INCLUDED)
#define BOOST_FUSION_SEGMENTED_FIND_IF_HPP_INCLUDED
#include <boost/fusion/algorithm/query/find_if_fwd.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/segmented_fold_until.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
namespace boost {
namespace fusion {
namespace detail {
template <typename Pred> struct segmented_find_if_fun {
template <typename Sequence, typename State, typename Context> struct apply {
typedef typename result_of::find_if<Sequence, Pred>::type iterator_type;
typedef typename result_of::equal_to<
iterator_type, typename result_of::end<Sequence>::type>::type
continue_type;
typedef typename mpl::eval_if<
continue_type, mpl::identity<State>,
result_of::make_segmented_iterator<iterator_type, Context>>::type type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type
call(Sequence &seq, State const &state, Context const &context,
segmented_find_if_fun) {
return call_impl(seq, state, context, continue_type());
}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type
call_impl(Sequence &, State const &state, Context const &, mpl::true_) {
return state;
}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type
call_impl(Sequence &seq, State const &, Context const &context,
mpl::false_) {
return fusion::make_segmented_iterator(fusion::find_if<Pred>(seq),
context);
}
};
};
template <typename Sequence, typename Pred> struct result_of_segmented_find_if {
struct filter {
typedef typename result_of::segmented_fold_until<
Sequence, typename result_of::end<Sequence>::type,
segmented_find_if_fun<Pred>>::type type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence &seq) {
return fusion::segmented_fold_until(seq, fusion::end(seq),
segmented_find_if_fun<Pred>());
}
};
typedef typename filter::type type;
};
} // namespace detail
} // namespace fusion
} // namespace boost
#endif
| 36.722222
| 80
| 0.672466
|
henrywarhurst
|
a14dd253d6f6c1ac77b0acf30583ff9183246b32
| 2,064
|
cpp
|
C++
|
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/compare.pass.cpp
|
K-Wu/libcxx.doc
|
c3c0421b2a9cc003146e847d0b8dd3a37100f39a
|
[
"Apache-2.0"
] | null | null | null |
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/compare.pass.cpp
|
K-Wu/libcxx.doc
|
c3c0421b2a9cc003146e847d0b8dd3a37100f39a
|
[
"Apache-2.0"
] | null | null | null |
test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char/compare.pass.cpp
|
K-Wu/libcxx.doc
|
c3c0421b2a9cc003146e847d0b8dd3a37100f39a
|
[
"Apache-2.0"
] | null | null | null |
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// <string>
// template<> struct char_traits<char>
// static int compare(const char_type* s1, const char_type* s2, size_t n);
// constexpr in C++17
#include <string.hxx>
#include <cassert.hxx>
#include "test_macros.h"
#if TEST_STD_VER > 14
constexpr bool test_constexpr()
{
return std::char_traits<char>::compare("123", "223", 3) < 0
&& std::char_traits<char>::compare("223", "123", 3) > 0
&& std::char_traits<char>::compare("123", "123", 3) == 0;
}
#endif
int main(int, char**)
{
assert(std::char_traits<char>::compare("", "", 0) == 0);
assert(std::char_traits<char>::compare(NULL, NULL, 0) == 0);
assert(std::char_traits<char>::compare("1", "1", 1) == 0);
assert(std::char_traits<char>::compare("1", "2", 1) < 0);
assert(std::char_traits<char>::compare("2", "1", 1) > 0);
assert(std::char_traits<char>::compare("12", "12", 2) == 0);
assert(std::char_traits<char>::compare("12", "13", 2) < 0);
assert(std::char_traits<char>::compare("12", "22", 2) < 0);
assert(std::char_traits<char>::compare("13", "12", 2) > 0);
assert(std::char_traits<char>::compare("22", "12", 2) > 0);
assert(std::char_traits<char>::compare("123", "123", 3) == 0);
assert(std::char_traits<char>::compare("123", "223", 3) < 0);
assert(std::char_traits<char>::compare("123", "133", 3) < 0);
assert(std::char_traits<char>::compare("123", "124", 3) < 0);
assert(std::char_traits<char>::compare("223", "123", 3) > 0);
assert(std::char_traits<char>::compare("133", "123", 3) > 0);
assert(std::char_traits<char>::compare("124", "123", 3) > 0);
#if TEST_STD_VER > 14
static_assert(test_constexpr(), "" );
#endif
return 0;
}
| 34.983051
| 80
| 0.566376
|
K-Wu
|
a14e67ef5005d804ac67c3d7ce1395abce4c20cc
| 25,287
|
hpp
|
C++
|
src/libshell/EnergyHelper_Parametric.hpp
|
mvlab/growth_SM2018
|
3ad411c4f7082e7bffc2ed3ea9bc96b9a51da73a
|
[
"BSD-3-Clause"
] | 8
|
2019-09-05T16:05:59.000Z
|
2021-12-01T10:30:15.000Z
|
src/libshell/EnergyHelper_Parametric.hpp
|
mvlab/growth_SM2018
|
3ad411c4f7082e7bffc2ed3ea9bc96b9a51da73a
|
[
"BSD-3-Clause"
] | 1
|
2021-01-08T17:13:39.000Z
|
2021-01-15T17:11:53.000Z
|
src/libshell/EnergyHelper_Parametric.hpp
|
mvlab/growth_SM2018
|
3ad411c4f7082e7bffc2ed3ea9bc96b9a51da73a
|
[
"BSD-3-Clause"
] | 4
|
2020-04-13T13:01:04.000Z
|
2021-01-09T17:03:02.000Z
|
//
// EnergyHelper_Parametric.hpp
// Elasticity
//
// Created by Wim van Rees on 04/06/16.
// Copyright © 2016 Wim van Rees. All rights reserved.
//
#ifndef EnergyHelper_Parametric_hpp
#define EnergyHelper_Parametric_hpp
#include "common.hpp"
#include "ExtendedTriangleInfo.hpp"
#include "QuadraticForms.hpp"
#include <type_traits> // for std::conditional
struct EnergyHelper_Parametric
{
const Real material_prefac_1, material_prefac_2;
const Eigen::Matrix2d aform_bar;
const Eigen::Matrix2d aform_bar_inv;
const Real area;
EIGEN_MAKE_ALIGNED_OPERATOR_NEW // https://eigen.tuxfamily.org/dox/group__TopicStructHavingEigenMembers.html
EnergyHelper_Parametric(const Material_Isotropic & matprop, const Eigen::Matrix2d & aform_bar):
material_prefac_1(matprop.getStVenantFactor1()),
material_prefac_2(matprop.getStVenantFactor2()),
aform_bar(aform_bar),
aform_bar_inv(aform_bar.inverse()),
area(0.5*std::sqrt(aform_bar.determinant()))
{
}
};
struct StrainData
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW // https://eigen.tuxfamily.org/dox/group__TopicStructHavingEigenMembers.html
Eigen::Matrix2d strain;
};
struct StrainData_WithGradientVerts : StrainData
{
std::array<Eigen::Matrix2d, 3> grad_strain_v0;
std::array<Eigen::Matrix2d, 3> grad_strain_v1;
std::array<Eigen::Matrix2d, 3> grad_strain_v2;
};
struct StrainData_WithGradient : StrainData_WithGradientVerts
{
std::array<Eigen::Matrix2d, 3> grad_strain_v_other_e0;
std::array<Eigen::Matrix2d, 3> grad_strain_v_other_e1;
std::array<Eigen::Matrix2d, 3> grad_strain_v_other_e2;
Eigen::Matrix2d grad_strain_e0, grad_strain_e1, grad_strain_e2;
};
template<bool withGradient>
struct StrainData_Stretching : std::conditional<withGradient, StrainData_WithGradientVerts, StrainData>::type
{
const EnergyHelper_Parametric & helper;
const FirstFundamentalForm<withGradient> & firstFF;
StrainData_Stretching(const EnergyHelper_Parametric & helper_in, const FirstFundamentalForm<withGradient> & firstFF_in):
helper(helper_in),
firstFF(firstFF_in)
{
}
void compute()
{
this->strain = helper.aform_bar_inv * firstFF.form - Eigen::Matrix2d::Identity();
}
template<bool U = withGradient> typename std::enable_if<U, void>::type
compute_grad()
{
for(int d=0;d<3;++d)
{
this->grad_strain_v0[d] = helper.aform_bar_inv * (Eigen::Matrix2d() << firstFF.gradform.gradv0_11(d), firstFF.gradform.gradv0_12(d), firstFF.gradform.gradv0_12(d), firstFF.gradform.gradv0_22(d)).finished();
this->grad_strain_v1[d] = helper.aform_bar_inv * (Eigen::Matrix2d() << firstFF.gradform.gradv1_11(d), firstFF.gradform.gradv1_12(d), firstFF.gradform.gradv1_12(d), firstFF.gradform.gradv1_22(d)).finished();
this->grad_strain_v2[d] = helper.aform_bar_inv * (Eigen::Matrix2d() << firstFF.gradform.gradv2_11(d), firstFF.gradform.gradv2_12(d), firstFF.gradform.gradv2_12(d), firstFF.gradform.gradv2_22(d)).finished();
}
}
};
template<bool withGradient>
struct StrainData_Bending : std::conditional<withGradient, StrainData_WithGradient, StrainData>::type
{
const EnergyHelper_Parametric & helper;
const Eigen::Matrix2d bform_bar;
const SecondFundamentalForm<withGradient> & secondFF;
StrainData_Bending(const EnergyHelper_Parametric & helper_in, const SecondFundamentalForm<withGradient> & secondFF_in):
helper(helper_in),
bform_bar(Eigen::Matrix2d::Constant(0)),
secondFF(secondFF_in)
{
}
StrainData_Bending(const EnergyHelper_Parametric & helper_in, const Eigen::Matrix2d & bform_bar_in, const SecondFundamentalForm<withGradient> & secondFF_in):
helper(helper_in),
bform_bar(bform_bar_in),
secondFF(secondFF_in)
{
}
void compute()
{
this->strain = helper.aform_bar_inv * (secondFF.form - bform_bar);
}
template<bool U = withGradient> typename std::enable_if<U, void>::type
compute_grad()
{
for(int d=0;d<3;++d)
{
this->grad_strain_v0[d] = helper.aform_bar_inv * (Eigen::Matrix2d() << secondFF.gradform.gradv0_11(d), secondFF.gradform.gradv0_12(d), secondFF.gradform.gradv0_12(d), secondFF.gradform.gradv0_22(d)).finished();
this->grad_strain_v1[d] = helper.aform_bar_inv * (Eigen::Matrix2d() << secondFF.gradform.gradv1_11(d), secondFF.gradform.gradv1_12(d), secondFF.gradform.gradv1_12(d), secondFF.gradform.gradv1_22(d)).finished();
this->grad_strain_v2[d] = helper.aform_bar_inv * (Eigen::Matrix2d() << secondFF.gradform.gradv2_11(d), secondFF.gradform.gradv2_12(d), secondFF.gradform.gradv2_12(d), secondFF.gradform.gradv2_22(d)).finished();
this->grad_strain_v_other_e0[d] = helper.aform_bar_inv * (Eigen::Matrix2d() << secondFF.gradform.gradv_other_e0_11(d), secondFF.gradform.gradv_other_e0_12(d), secondFF.gradform.gradv_other_e0_12(d), secondFF.gradform.gradv_other_e0_22(d)).finished();
this->grad_strain_v_other_e1[d] = helper.aform_bar_inv * (Eigen::Matrix2d() << secondFF.gradform.gradv_other_e1_11(d), secondFF.gradform.gradv_other_e1_12(d), secondFF.gradform.gradv_other_e1_12(d), secondFF.gradform.gradv_other_e1_22(d)).finished();
this->grad_strain_v_other_e2[d] = helper.aform_bar_inv * (Eigen::Matrix2d() << secondFF.gradform.gradv_other_e2_11(d), secondFF.gradform.gradv_other_e2_12(d), secondFF.gradform.gradv_other_e2_12(d), secondFF.gradform.gradv_other_e2_22(d)).finished();
}
this->grad_strain_e0 = helper.aform_bar_inv * (Eigen::Matrix2d() << secondFF.gradform.gradphi_e0_11, secondFF.gradform.gradphi_e0_12, secondFF.gradform.gradphi_e0_12, secondFF.gradform.gradphi_e0_22).finished();
this->grad_strain_e1 = helper.aform_bar_inv * (Eigen::Matrix2d() << secondFF.gradform.gradphi_e1_11, secondFF.gradform.gradphi_e1_12, secondFF.gradform.gradphi_e1_12, secondFF.gradform.gradphi_e1_22).finished();
this->grad_strain_e2 = helper.aform_bar_inv * (Eigen::Matrix2d() << secondFF.gradform.gradphi_e2_11, secondFF.gradform.gradphi_e2_12, secondFF.gradform.gradphi_e2_12, secondFF.gradform.gradphi_e2_22).finished();
}
};
struct EnergyNormData
{
const EnergyHelper_Parametric & helper;
Real trace, trace_sq;
EnergyNormData(const EnergyHelper_Parametric & helper_in):
helper(helper_in)
{}
inline Real evaluateMaterialNorm()
{
return (helper.material_prefac_1*trace*trace + helper.material_prefac_2*trace_sq)*helper.area;
}
};
struct EnergyNormData_WithGradient_Verts : EnergyNormData
{
Eigen::Matrix3d grad_trace_v; // col 0 --> v0, col 1 --> v1, col 2 --> v2
Eigen::Matrix3d grad_tracesq_v; // same as above
EIGEN_MAKE_ALIGNED_OPERATOR_NEW // https://eigen.tuxfamily.org/dox/group__TopicStructHavingEigenMembers.html
EnergyNormData_WithGradient_Verts(const EnergyHelper_Parametric & helper_in):
EnergyNormData(helper_in)
{}
inline Eigen::Vector3d evaluateGradMaterialNorm(const int idx)
{
return Eigen::Vector3d((helper.material_prefac_1 * 2.0 * trace * grad_trace_v.col(idx) + helper.material_prefac_2 * grad_tracesq_v.col(idx))*helper.area);
}
};
struct EnergyNormData_WithGradient : EnergyNormData_WithGradient_Verts
{
Eigen::Matrix3d grad_trace_v_other_e; // col 0 --> e0, col 1 --> e1, col 2 --> e2
Eigen::Matrix3d grad_tracesq_v_other_e; // same as above
Eigen::Vector3d grad_trace_e, grad_tracesq_e; // 0 --> e0, 1 --> e1, 2 --> e2
EnergyNormData_WithGradient(const EnergyHelper_Parametric & helper_in):
EnergyNormData_WithGradient_Verts(helper_in)
{}
inline Eigen::Vector3d evaluateGradMaterialNormOther(const int idx)
{
return Eigen::Vector3d((helper.material_prefac_1 * 2.0 * trace * grad_trace_v_other_e.col(idx) + helper.material_prefac_2 * grad_tracesq_v_other_e.col(idx))*helper.area);
}
inline Real evaluateGradMaterialNormPhi(const int idx)
{
return (helper.material_prefac_1 * 2.0 * trace * grad_trace_e(idx) + helper.material_prefac_2 * grad_tracesq_e(idx))*helper.area;
}
};
template<bool withGradient>
struct EnergyNormData_Stretching : std::conditional<withGradient, EnergyNormData_WithGradient_Verts, EnergyNormData>::type
{
typedef typename std::conditional<withGradient, EnergyNormData_WithGradient_Verts, EnergyNormData>::type EnergyNormData_StretchingBase;
StrainData_Stretching<withGradient> & straindata;
EnergyNormData_Stretching(const EnergyHelper_Parametric & helper_in, StrainData_Stretching<withGradient> & straindata_in):
EnergyNormData_StretchingBase(helper_in),
straindata(straindata_in)
{}
void compute()
{
straindata.compute();
this->trace = straindata.strain.trace();
this->trace_sq = (straindata.strain * straindata.strain).trace();
}
template<bool U = withGradient> typename std::enable_if<U, void>::type
compute_grad()
{
straindata.compute_grad();
for(int d=0;d<3;++d)
{
this->grad_trace_v(d,0) = (straindata.grad_strain_v0[d]).trace();
this->grad_trace_v(d,1) = (straindata.grad_strain_v1[d]).trace();
this->grad_trace_v(d,2) = (straindata.grad_strain_v2[d]).trace();
this->grad_tracesq_v(d,0) = (straindata.strain * straindata.grad_strain_v0[d] + straindata.grad_strain_v0[d] * straindata.strain).trace();
this->grad_tracesq_v(d,1) = (straindata.strain * straindata.grad_strain_v1[d] + straindata.grad_strain_v1[d] * straindata.strain).trace();
this->grad_tracesq_v(d,2) = (straindata.strain * straindata.grad_strain_v2[d] + straindata.grad_strain_v2[d] * straindata.strain).trace();
}
}
};
template<bool withGradient>
struct EnergyNormData_Bending : std::conditional<withGradient, EnergyNormData_WithGradient, EnergyNormData>::type
{
typedef typename std::conditional<withGradient, EnergyNormData_WithGradient, EnergyNormData>::type EnergyNormData_BendingBase;
StrainData_Bending<withGradient> & straindata;
EnergyNormData_Bending(const EnergyHelper_Parametric & helper_in, StrainData_Bending<withGradient> & straindata_in):
EnergyNormData_BendingBase(helper_in),
straindata(straindata_in)
{}
void compute()
{
straindata.compute();
this->trace = straindata.strain.trace();
this->trace_sq = (straindata.strain * straindata.strain).trace();
}
template<bool U = withGradient> typename std::enable_if<U, void>::type
compute_grad()
{
straindata.compute_grad();
for(int d=0;d<3;++d)
{
this->grad_trace_v(d,0) = (straindata.grad_strain_v0[d]).trace();
this->grad_trace_v(d,1) = (straindata.grad_strain_v1[d]).trace();
this->grad_trace_v(d,2) = (straindata.grad_strain_v2[d]).trace();
this->grad_tracesq_v(d,0) = (straindata.strain * straindata.grad_strain_v0[d] + straindata.grad_strain_v0[d] * straindata.strain).trace();
this->grad_tracesq_v(d,1) = (straindata.strain * straindata.grad_strain_v1[d] + straindata.grad_strain_v1[d] * straindata.strain).trace();
this->grad_tracesq_v(d,2) = (straindata.strain * straindata.grad_strain_v2[d] + straindata.grad_strain_v2[d] * straindata.strain).trace();
this->grad_trace_v_other_e(d,0) = (straindata.grad_strain_v_other_e0[d]).trace();
this->grad_trace_v_other_e(d,1) = (straindata.grad_strain_v_other_e1[d]).trace();
this->grad_trace_v_other_e(d,2) = (straindata.grad_strain_v_other_e2[d]).trace();
this->grad_tracesq_v_other_e(d,0) = (straindata.strain * straindata.grad_strain_v_other_e0[d] + straindata.grad_strain_v_other_e0[d] * straindata.strain).trace();
this->grad_tracesq_v_other_e(d,1) = (straindata.strain * straindata.grad_strain_v_other_e1[d] + straindata.grad_strain_v_other_e1[d] * straindata.strain).trace();
this->grad_tracesq_v_other_e(d,2) = (straindata.strain * straindata.grad_strain_v_other_e2[d] + straindata.grad_strain_v_other_e2[d] * straindata.strain).trace();
}
this->grad_trace_e(0) = (straindata.grad_strain_e0).trace();
this->grad_trace_e(1) = (straindata.grad_strain_e1).trace();
this->grad_trace_e(2) = (straindata.grad_strain_e2).trace();
this->grad_tracesq_e(0) = (straindata.strain * straindata.grad_strain_e0 + straindata.grad_strain_e0 * straindata.strain).trace();
this->grad_tracesq_e(1) = (straindata.strain * straindata.grad_strain_e1 + straindata.grad_strain_e1 * straindata.strain).trace();
this->grad_tracesq_e(2) = (straindata.strain * straindata.grad_strain_e2 + straindata.grad_strain_e2 * straindata.strain).trace();
}
};
struct EnergyNormData_BilayerBase
{
const EnergyHelper_Parametric & helper;
Real trace_12;
EnergyNormData_BilayerBase(const EnergyHelper_Parametric & helper_in):
helper(helper_in)
{}
};
struct EnergyNormData_BilayerBase_WithGradient : EnergyNormData_BilayerBase
{
Eigen::Matrix3d grad_trace12_v;
Eigen::Matrix3d grad_trace12_v_other_e;
Eigen::Vector3d grad_trace12_e;
EnergyNormData_BilayerBase_WithGradient(const EnergyHelper_Parametric & helper_in):
EnergyNormData_BilayerBase(helper_in)
{}
};
template<bool withGradient>
struct EnergyNormData_Bilayer : std::conditional<withGradient, EnergyNormData_BilayerBase_WithGradient, EnergyNormData_BilayerBase>::type
{
typedef typename std::conditional<withGradient, EnergyNormData_BilayerBase_WithGradient, EnergyNormData_BilayerBase>::type tEnergyNormData_BilayerBase;
const EnergyNormData_Stretching<withGradient> & energydata_stretching;
const EnergyNormData_Bending<withGradient> & energydata_bending;
EnergyNormData_Bilayer(const EnergyHelper_Parametric & helper_in, const EnergyNormData_Stretching<withGradient> & energydata_stretching_in, const EnergyNormData_Bending<withGradient> & energydata_bending_in):
tEnergyNormData_BilayerBase(helper_in),
energydata_stretching(energydata_stretching_in),
energydata_bending(energydata_bending_in)
{}
void compute()
{
const StrainData_Stretching<withGradient> & straindata_stretching = energydata_stretching.straindata;
const StrainData_Bending<withGradient> & straindata_bending = energydata_bending.straindata;
// assume energydata_stretching and energydata_bending have already been computed
this->trace_12 = (straindata_stretching.strain * straindata_bending.strain).trace();
}
template<bool U = withGradient> typename std::enable_if<U, void>::type
compute_grad()
{
const StrainData_Stretching<withGradient> & straindata_stretching = energydata_stretching.straindata;
const StrainData_Bending<withGradient> & straindata_bending = energydata_bending.straindata;
// assume energydata_stretching and energydata_bending have already been computed
for(int d=0;d<3;++d)
{
this->grad_trace12_v(d,0) = (straindata_stretching.strain * straindata_bending.grad_strain_v0[d] + straindata_stretching.grad_strain_v0[d] * straindata_bending.strain).trace();
this->grad_trace12_v(d,1) = (straindata_stretching.strain * straindata_bending.grad_strain_v1[d] + straindata_stretching.grad_strain_v1[d] * straindata_bending.strain).trace();
this->grad_trace12_v(d,2) = (straindata_stretching.strain * straindata_bending.grad_strain_v2[d] + straindata_stretching.grad_strain_v2[d] * straindata_bending.strain).trace();
// no 'other' contribution from straindata_stretching
this->grad_trace12_v_other_e(d,0) = (straindata_stretching.strain * straindata_bending.grad_strain_v_other_e0[d]).trace();
this->grad_trace12_v_other_e(d,1) = (straindata_stretching.strain * straindata_bending.grad_strain_v_other_e1[d]).trace();
this->grad_trace12_v_other_e(d,2) = (straindata_stretching.strain * straindata_bending.grad_strain_v_other_e2[d]).trace();
}
// no 'phi' contribution from straindata_stretching
this->grad_trace12_e(0) = (straindata_stretching.strain * straindata_bending.grad_strain_e0).trace();
this->grad_trace12_e(1) = (straindata_stretching.strain * straindata_bending.grad_strain_e1).trace();
this->grad_trace12_e(2) = (straindata_stretching.strain * straindata_bending.grad_strain_e2).trace();
}
inline Real evaluateMaterialNorm()
{
return (this->helper.material_prefac_1*energydata_stretching.trace*energydata_bending.trace + this->helper.material_prefac_2*this->trace_12)*this->helper.area;
}
template<bool U = withGradient> typename std::enable_if<U, Eigen::Vector3d>::type
evaluateGradMaterialNorm(const int idx)
{
return Eigen::Vector3d((this->helper.material_prefac_1 * (energydata_stretching.trace * energydata_bending.grad_trace_v.col(idx) + energydata_bending.trace * energydata_stretching.grad_trace_v.col(idx)) + this->helper.material_prefac_2 * this->grad_trace12_v.col(idx))*this->helper.area);
}
template<bool U = withGradient> typename std::enable_if<U, Eigen::Vector3d>::type
evaluateGradMaterialNormOther(const int idx)
{
return Eigen::Vector3d((this->helper.material_prefac_1 * energydata_stretching.trace * energydata_bending.grad_trace_v_other_e.col(idx) + this->helper.material_prefac_2 * this->grad_trace12_v_other_e.col(idx))*this->helper.area);
}
template<bool U = withGradient> typename std::enable_if<U, Real>::type
evaluateGradMaterialNormPhi(const int idx)
{
return (this->helper.material_prefac_1 * energydata_stretching.trace * energydata_bending.grad_trace_e(idx) + this->helper.material_prefac_2 * this->grad_trace12_e(idx))*this->helper.area;
}
};
struct SaintVenantEnergyData
{
Real stretching_energy, bending_energy, mixed_energy_ab;
};
struct SaintVenantEnergyData_WithGradient : SaintVenantEnergyData
{
EIGEN_MAKE_ALIGNED_OPERATOR_NEW // https://eigen.tuxfamily.org/dox/group__TopicStructHavingEigenMembers.html
Eigen::Vector3d gradv0_aa, gradv1_aa, gradv2_aa;
Eigen::Vector3d gradv0_bb, gradv1_bb, gradv2_bb;
Eigen::Vector3d gradv_other_e0_bb, gradv_other_e1_bb, gradv_other_e2_bb;
Real gradphi_e0_bb, gradphi_e1_bb, gradphi_e2_bb;
};
struct SaintVenantEnergyData_WithGradient_Bilayer : SaintVenantEnergyData_WithGradient
{
Eigen::Vector3d gradv0_ab, gradv1_ab, gradv2_ab;
Eigen::Vector3d gradv_other_e0_ab, gradv_other_e1_ab, gradv_other_e2_ab;
Real gradphi_e0_ab, gradphi_e1_ab, gradphi_e2_ab;
};
template<bool withGradient, typename tMaterialType, MeshLayer layer>
struct SaintVenantEnergy : std::conditional<withGradient,
typename std::conditional<layer == single, SaintVenantEnergyData_WithGradient, SaintVenantEnergyData_WithGradient_Bilayer>::type, SaintVenantEnergyData>::type
{
};
template<bool withGradient, MeshLayer layer>
struct SaintVenantEnergy<withGradient, Material_Isotropic, layer> : std::conditional<withGradient,
typename std::conditional<layer == single, SaintVenantEnergyData_WithGradient, SaintVenantEnergyData_WithGradient_Bilayer>::type, SaintVenantEnergyData>::type
{
const Real h_aa, h_bb, h_ab;
EnergyHelper_Parametric helper;
FirstFundamentalForm<withGradient> firstFF;
SecondFundamentalForm<withGradient> secondFF;
StrainData_Stretching<withGradient> straindata_stretching;
StrainData_Bending<withGradient> straindata_bending;
EnergyNormData_Stretching<withGradient> energydata_stretching;
EnergyNormData_Bending<withGradient> energydata_bending;
EnergyNormData_Bilayer<withGradient> energydata_bilayer;
static Real compute_h_aa(const Real thickness) // static because it has to be there before class is constructed
{
return (layer == single ? 1.0 : 0.5)*thickness/4.0;
}
static Real compute_h_bb(const Real thickness)
{
return (layer == single ? 1.0 : 0.5)*std::pow(thickness,3)/12;
}
static Real compute_h_ab(const Real thickness)
{
return (layer == single ? 0.0 : (layer == bottom ? +1.0 : -1.0))*std::pow(thickness,2)/8.0;
}
SaintVenantEnergy(const Material_Isotropic & mat_prop_in, const Eigen::Matrix2d & aform_bar_in, const ExtendedTriangleInfo & info_in):
h_aa(compute_h_aa(mat_prop_in.getThickness())),
h_bb(compute_h_bb(mat_prop_in.getThickness())),
h_ab(compute_h_ab(mat_prop_in.getThickness())),
helper(mat_prop_in, aform_bar_in),
firstFF(info_in),
secondFF(info_in),
straindata_stretching(helper, firstFF),
straindata_bending(helper, secondFF),
energydata_stretching(helper, straindata_stretching),
energydata_bending(helper, straindata_bending),
energydata_bilayer(helper, energydata_stretching, energydata_bending)
{}
SaintVenantEnergy(const Material_Isotropic & mat_prop_in, const Eigen::Matrix2d & aform_bar_in, const Eigen::Matrix2d & bform_bar_in, const ExtendedTriangleInfo & info_in):
h_aa(compute_h_aa(mat_prop_in.getThickness())),
h_bb(compute_h_bb(mat_prop_in.getThickness())),
h_ab(compute_h_ab(mat_prop_in.getThickness())),
helper(mat_prop_in, aform_bar_in),
firstFF(info_in),
secondFF(info_in),
straindata_stretching(helper, firstFF),
straindata_bending(helper, bform_bar_in, secondFF),
energydata_stretching(helper, straindata_stretching),
energydata_bending(helper, straindata_bending),
energydata_bilayer(helper, energydata_stretching, energydata_bending)
{}
void compute()
{
// compute the strains
energydata_stretching.compute();
energydata_bending.compute();
if(layer != single) energydata_bilayer.compute();
// evaluate the energy (area factor inside evaluateNorm)
this->stretching_energy = h_aa * energydata_stretching.evaluateMaterialNorm();
this->bending_energy = h_bb * energydata_bending.evaluateMaterialNorm();
if(layer != single) this->mixed_energy_ab = h_ab * energydata_bilayer.evaluateMaterialNorm();
}
// conditional gradient function for single and bilayer
template<bool U = withGradient> typename std::enable_if<U, void>::type
compute_gradients_single()
{
// compute the strain gradients
energydata_stretching.compute_grad();
energydata_bending.compute_grad();
// evaluate
this->gradv0_aa = h_aa * energydata_stretching.evaluateGradMaterialNorm(0);
this->gradv1_aa = h_aa * energydata_stretching.evaluateGradMaterialNorm(1);
this->gradv2_aa = h_aa * energydata_stretching.evaluateGradMaterialNorm(2);
this->gradv0_bb = h_bb * energydata_bending.evaluateGradMaterialNorm(0);
this->gradv1_bb = h_bb * energydata_bending.evaluateGradMaterialNorm(1);
this->gradv2_bb = h_bb * energydata_bending.evaluateGradMaterialNorm(2);
this->gradv_other_e0_bb = h_bb * energydata_bending.evaluateGradMaterialNormOther(0);
this->gradv_other_e1_bb = h_bb * energydata_bending.evaluateGradMaterialNormOther(1);
this->gradv_other_e2_bb = h_bb * energydata_bending.evaluateGradMaterialNormOther(2);
this->gradphi_e0_bb = h_bb * energydata_bending.evaluateGradMaterialNormPhi(0);
this->gradphi_e1_bb = h_bb * energydata_bending.evaluateGradMaterialNormPhi(1);
this->gradphi_e2_bb = h_bb * energydata_bending.evaluateGradMaterialNormPhi(2);
}
// conditional gradient function for single layer only
template<bool U = withGradient, MeshLayer L = layer> typename std::enable_if<U && L==single, void>::type
compute_gradients()
{
compute_gradients_single();
}
// conditional gradient function for bilayer only
template<bool U = withGradient, MeshLayer L = layer> typename std::enable_if<U && L!=single, void>::type
compute_gradients()
{
compute_gradients_single();
energydata_bilayer.compute_grad();
this->gradv0_ab = h_ab * energydata_bilayer.evaluateGradMaterialNorm(0);
this->gradv1_ab = h_ab * energydata_bilayer.evaluateGradMaterialNorm(1);
this->gradv2_ab = h_ab * energydata_bilayer.evaluateGradMaterialNorm(2);
this->gradv_other_e0_ab = h_ab * energydata_bilayer.evaluateGradMaterialNormOther(0);
this->gradv_other_e1_ab = h_ab * energydata_bilayer.evaluateGradMaterialNormOther(1);
this->gradv_other_e2_ab = h_ab * energydata_bilayer.evaluateGradMaterialNormOther(2);
this->gradphi_e0_ab = h_ab * energydata_bilayer.evaluateGradMaterialNormPhi(0);
this->gradphi_e1_ab = h_ab * energydata_bilayer.evaluateGradMaterialNormPhi(1);
this->gradphi_e2_ab = h_ab * energydata_bilayer.evaluateGradMaterialNormPhi(2);
}
};
#endif /* EnergyHelper_Parametric_hpp */
| 46.827778
| 296
| 0.727647
|
mvlab
|
a156c922e7ddebfea139b08235fbcfbc22aedd5a
| 3,999
|
cpp
|
C++
|
datastore/common/objects/Port.cpp
|
mire-all-rashly/netmeld
|
d3ffd0b3d1332654e9c8df871bc7bf0b8cb46fed
|
[
"MIT"
] | null | null | null |
datastore/common/objects/Port.cpp
|
mire-all-rashly/netmeld
|
d3ffd0b3d1332654e9c8df871bc7bf0b8cb46fed
|
[
"MIT"
] | null | null | null |
datastore/common/objects/Port.cpp
|
mire-all-rashly/netmeld
|
d3ffd0b3d1332654e9c8df871bc7bf0b8cb46fed
|
[
"MIT"
] | null | null | null |
// =============================================================================
// Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC
// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
// Government retains certain rights in this software.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// =============================================================================
// Maintained by Sandia National Laboratories <Netmeld@sandia.gov>
// =============================================================================
#include <netmeld/datastore/objects/Port.hpp>
#include <netmeld/core/utils/StringUtilities.hpp>
namespace nmcu = netmeld::core::utils;
namespace netmeld::datastore::objects {
Port::Port()
{}
Port::Port(const IpAddress& _ipAddr) :
ipAddr(_ipAddr)
{}
void
Port::setProtocol(const std::string& _protocol)
{
protocol = nmcu::toLower(_protocol);
}
void
Port::setPort(const int _port)
{
port = _port;
}
void
Port::setState(const std::string& _state)
{
state = nmcu::toLower(_state);
}
void
Port::setReason(const std::string& _reason)
{
reason = nmcu::toLower(_reason);
}
void
Port::setIpAddr(const IpAddress& _ipAddr)
{
ipAddr = _ipAddr;
}
std::string
Port::getIpAddr() const
{
return ipAddr.toString();
}
std::string
Port::getProtocol() const
{
return protocol;
}
int
Port::getPort() const
{
return port;
}
bool
Port::isValid() const
{
bool portIsValid = (port == -1 || (port >= 0 && port <= 65535));
return ipAddr.isValid()
&& !protocol.empty()
&& portIsValid
;
}
void
Port::save(pqxx::transaction_base& t,
const nmco::Uuid& toolRunId, const std::string& deviceId)
{
if (!isValid()) {
LOG_DEBUG << "Port object is not saving: " << toDebugString()
<< std::endl;
return;
}
ipAddr.save(t, toolRunId, deviceId);
t.exec_prepared("insert_raw_port",
toolRunId,
ipAddr.toString(),
protocol,
port,
state,
reason);
}
std::string
Port::toDebugString() const
{
std::ostringstream oss;
oss << "["; // opening bracket
oss << port << ", "
<< protocol << ", "
<< ipAddr.toDebugString() << ", "
<< state << ", "
<< reason;
oss << "]"; // closing bracket
return oss.str();
}
std::partial_ordering
Port::operator<=>(const Port& rhs) const
{
if (auto cmp = port <=> rhs.port; 0 != cmp) {
return cmp;
}
if (auto cmp = protocol <=> rhs.protocol; 0 != cmp) {
return cmp;
}
if (auto cmp = state <=> rhs.state; 0 != cmp) {
return cmp;
}
if (auto cmp = reason <=> rhs.reason; 0 != cmp) {
return cmp;
}
return ipAddr <=> rhs.ipAddr;
}
bool
Port::operator==(const Port& rhs) const
{
return 0 == operator<=>(rhs);
}
}
| 24.99375
| 80
| 0.593648
|
mire-all-rashly
|
a159a2a771f260fd9acf089aaef537386abfbc21
| 830
|
cc
|
C++
|
leetcode/cpp/copy_random_list.cc
|
haonancool/OnlineJudge
|
43e9e7fb30ed1ed80c08ef54d32aaa6ae5652064
|
[
"Apache-2.0"
] | null | null | null |
leetcode/cpp/copy_random_list.cc
|
haonancool/OnlineJudge
|
43e9e7fb30ed1ed80c08ef54d32aaa6ae5652064
|
[
"Apache-2.0"
] | null | null | null |
leetcode/cpp/copy_random_list.cc
|
haonancool/OnlineJudge
|
43e9e7fb30ed1ed80c08ef54d32aaa6ae5652064
|
[
"Apache-2.0"
] | null | null | null |
class Solution {
public:
RandomListNode* copyRandomList(RandomListNode *head) {
if (!head) return 0;
unordered_map<RandomListNode*, RandomListNode*> table;
RandomListNode *ret = new RandomListNode(head->label);
table[head] = ret;
RandomListNode *p = head, *q = ret;
while (p && q) {
if (p->next) {
if (table.find(p->next) != table.end()) {
q->next = table[p->next];
} else {
q->next = new RandomListNode(p->next->label);
table[p->next] = q->next;
}
} else {
q->next = 0;
}
if (p->random) {
if (table.find(p->random) != table.end()) {
q->random = table[p->random];
} else {
q->random = new RandomListNode(p->random->label);
table[p->random] = q->random;
}
} else {
q->random = 0;
}
p = p->next;
q = q->next;
}
return ret;
}
};
| 23.055556
| 56
| 0.556627
|
haonancool
|
a1661b029b0f15548c8263cb81116c609b9b7812
| 717
|
cpp
|
C++
|
src/storage/test/unit/src/model/TemperatureDataModelTest.cpp
|
karz0n/sensority-collector
|
0d71a2855fa7fcff9c11475dbf1832a598421949
|
[
"MIT"
] | null | null | null |
src/storage/test/unit/src/model/TemperatureDataModelTest.cpp
|
karz0n/sensority-collector
|
0d71a2855fa7fcff9c11475dbf1832a598421949
|
[
"MIT"
] | null | null | null |
src/storage/test/unit/src/model/TemperatureDataModelTest.cpp
|
karz0n/sensority-collector
|
0d71a2855fa7fcff9c11475dbf1832a598421949
|
[
"MIT"
] | null | null | null |
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include "storage/model/TemperatureDataModel.hpp"
using namespace testing;
using namespace storage;
static Matcher<TemperatureData>
matchTo(float value, float raw)
{
return AllOf(Field(&TemperatureData::value, FloatEq(value)),
Field(&TemperatureData::raw, FloatEq(raw)));
}
TEST(TemperatureDataModelTest, Parse)
{
const std::string Values{R"([
{"value": 13.5, "raw": 14.7},
{"value": 10.1, "raw": 11.2}
])"};
TemperatureDataModel model;
EXPECT_NO_THROW({ ASSERT_TRUE(model.parse(Values)); });
EXPECT_THAT(model, SizeIs(2));
EXPECT_THAT(model, ElementsAre(matchTo(13.5, 14.7), matchTo(10.1, 11.2)));
}
| 25.607143
| 78
| 0.668061
|
karz0n
|
a1683771a54c5382ba1be4f8b9bba5f123f39aa9
| 20,557
|
cpp
|
C++
|
Tests/UnitTests/ReaderTests/HTKLMFReaderTests.cpp
|
sunkwei/CNTK
|
08691e97707538b110ca71bce4ad06c46d840517
|
[
"Intel"
] | null | null | null |
Tests/UnitTests/ReaderTests/HTKLMFReaderTests.cpp
|
sunkwei/CNTK
|
08691e97707538b110ca71bce4ad06c46d840517
|
[
"Intel"
] | null | null | null |
Tests/UnitTests/ReaderTests/HTKLMFReaderTests.cpp
|
sunkwei/CNTK
|
08691e97707538b110ca71bce4ad06c46d840517
|
[
"Intel"
] | 1
|
2019-10-24T00:35:07.000Z
|
2019-10-24T00:35:07.000Z
|
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.md file in the project root for full license information.
//
#include "stdafx.h"
#include "Common/ReaderTestHelper.h"
using namespace Microsoft::MSR::CNTK;
namespace Microsoft { namespace MSR { namespace CNTK { namespace Test {
// Fixture specific to the AN4 data
struct AN4ReaderFixture : ReaderFixture
{
AN4ReaderFixture()
: ReaderFixture(
"%CNTK_EXTERNAL_TESTDATA_SOURCE_DIRECTORY%/Speech/AN4Corpus/v0",
"This test uses external data that is not part of the CNTK repository. Environment variable CNTK_EXTERNAL_TESTDATA_SOURCE_DIRECTORY must be set to point to the external test data location. \n Refer to the 'Setting up CNTK on Windows' documentation.)")
{
}
};
struct iVectorFixture : ReaderFixture
{
iVectorFixture()
: ReaderFixture(
"%CNTK_EXTERNAL_TESTDATA_SOURCE_DIRECTORY%/iVector",
"This test uses external data that is not part of the CNTK repository. Environment variable CNTK_EXTERNAL_TESTDATA_SOURCE_DIRECTORY must be set to point to the external test data location. \n Refer to the 'Setting up CNTK on Windows' documentation.)")
{
}
};
// Use SpeechReaderFixture for most tests
// Some of them (e.g. 10, will use different data, thus a different fixture)
BOOST_FIXTURE_TEST_SUITE(ReaderTestSuite, AN4ReaderFixture)
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop1)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop1_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop1_5_11_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop1_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop2)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop2_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop2_12_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop2_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop3)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop3_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop3_13_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop3_Output.txt",
"Simple_Test",
"reader",
randomizeAuto, // epoch size - all available
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop4)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop4_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop4_8_14_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop4_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop5)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop5_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop1_5_11_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop5_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop6)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop6_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop6_16_17_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop6_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop7)
{
HelperRunReaderTestWithException<float, std::invalid_argument>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop7_Config.cntk",
"Simple_Test",
"reader");
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop8)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop8_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop4_8_14_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop8_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop9)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop9_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop9_19_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop9_Output.txt",
"Simple_Test",
"reader",
2000,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop10)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop10_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop10_20_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop10_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
2,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop11)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop11_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop1_5_11_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop11_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop12)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop12_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop2_12_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop12_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop13)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop13_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop3_13_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop13_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop14)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop14_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop4_8_14_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop14_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop16)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop16_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop6_16_17_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop16_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop19)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop19_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop9_19_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop19_Output.txt",
"Simple_Test",
"reader",
2000,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop20)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop20_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop10_20_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop20_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
2,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop21_0)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop21_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop21_0_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop21_0_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
2);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop21_1)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop21_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop21_1_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop21_1_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
1,
2);
};
BOOST_AUTO_TEST_CASE(HTKMLFReaderSimpleDataLoop22)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKMLFReaderSimpleDataLoop22_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop22_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop22_Output.txt",
"Simple_Test",
"reader",
5000,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop1)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop1_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop1_5_11_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop1_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop5)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop5_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop1_5_11_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop5_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop11)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop11_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop1_5_11_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop11_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop21_0)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop21_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop21_0_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop21_0_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
2);
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop21_1)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop21_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop21_1_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop21_1_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
1,
2);
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop4)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop4_Config.cntk",
testDataPath() + "/Control/HTKDeserializersSimpleDataLoop4_Control.txt",
testDataPath() + "/Control/HTKDeserializersSimpleDataLoop4_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop8)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop8_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop4_8_14_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop8_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop14)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop14_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop4_8_14_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop14_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop9)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop9_Config.cntk",
testDataPath() + "/Control/HTKDeserializersSimpleDataLoop9_19_Control.txt",
testDataPath() + "/Control/HTKDeserializersSimpleDataLoop9_Output.txt",
"Simple_Test",
"reader",
2000,
500,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop19)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop19_Config.cntk",
testDataPath() + "/Control/HTKDeserializersSimpleDataLoop9_19_Control.txt",
testDataPath() + "/Control/HTKDeserializersSimpleDataLoop19_Output.txt",
"Simple_Test",
"reader",
2000,
500,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop10)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop10_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop10_20_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop10_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
2,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop20)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop20_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop10_20_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop20_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
2,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop3)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop3_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop3_13_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop3_Output.txt",
"Simple_Test",
"reader",
randomizeAuto, // epoch size - all available
1,
2,
1,
0,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKDeserializers_NonExistingScpFile)
{
HelperRunReaderTestWithException<float, std::runtime_error>(
testDataPath() + "/Config/HTKDeserializers_NonExistingScpFile.cntk",
"Simple_Test",
"reader");
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop2)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop2_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop2_12_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop2_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_CASE(HTKDeserializersSimpleDataLoop12)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKDeserializersSimpleDataLoop12_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop2_12_Control.txt",
testDataPath() + "/Control/HTKMLFReaderSimpleDataLoop12_Output.txt",
"Simple_Test",
"reader",
500,
250,
2,
1,
1,
0,
1);
};
BOOST_AUTO_TEST_SUITE_END()
BOOST_FIXTURE_TEST_SUITE(ReaderIVectorTestSuite, iVectorFixture)
BOOST_AUTO_TEST_CASE(HTKNoIVector)
{
auto test = [this](std::vector<std::wstring> additionalParameters)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKMLFReaderNoIVectorSimple_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderNoIVectorSimple_Control.txt",
testDataPath() + "/Control/HTKMLFReaderNoIVectorSimple_Output.txt",
"Simple_Test",
"reader",
400,
30,
1,
1,
1,
0,
1,
false,
false,
true,
additionalParameters);
};
test({});
test({ L"Simple_Test=[reader=[readerType=HTKDeserializers]]" });
};
BOOST_AUTO_TEST_CASE(HTKIVectorFrame)
{
auto test = [this](std::vector<std::wstring> additionalParameters)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKMLFReaderIVectorSimple_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderIVectorSimple_Control.txt",
testDataPath() + "/Control/HTKMLFReaderIVectorSimple_Output.txt",
"Simple_Test",
"reader",
400,
30,
1,
2,
1,
0,
1,
false,
false,
true,
additionalParameters);
};
test({});
test({ L"Simple_Test=[reader=[readerType=HTKDeserializers]]" });
};
BOOST_AUTO_TEST_CASE(HTKIVectorSequence)
{
auto test = [this](std::vector<std::wstring> additionalParameters)
{
HelperRunReaderTest<float>(
testDataPath() + "/Config/HTKMLFReaderIVectorSimple_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderIVectorSequenceSimple_Control.txt",
testDataPath() + "/Control/HTKMLFReaderIVectorSequenceSimple_Output.txt",
"Simple_Test",
"reader",
200,
30,
1,
2,
1,
0,
1,
false,
false,
true,
additionalParameters);
};
test({ L"frameMode=false", L"precision=float" });
test({ L"frameMode=false", L"precision=float", L"Simple_Test=[reader=[readerType=HTKDeserializers]]" });
};
BOOST_AUTO_TEST_CASE(HTKIVectorBptt)
{
auto test = [this](std::vector<std::wstring> additionalParameters)
{
HelperRunReaderTest<double>(
testDataPath() + "/Config/HTKMLFReaderIVectorSimple_Config.cntk",
testDataPath() + "/Control/HTKMLFReaderIVectorBpttSimple_Control.txt",
testDataPath() + "/Control/HTKMLFReaderIVectorBpttSimple_Output.txt",
"Simple_Test",
"reader",
400,
30,
1,
2,
1,
0,
1,
false,
false,
true,
additionalParameters);
};
test({ L"frameMode=false", L"truncated=true" });
test({ L"frameMode=false", L"truncated=true", L"Simple_Test=[reader=[readerType=HTKDeserializers]]" });
};
BOOST_AUTO_TEST_SUITE_END()
}
}}}
| 27.445928
| 265
| 0.620373
|
sunkwei
|
a16838d2d41ace1c21e5d91c4816fe0acc6a2bd5
| 4,562
|
hpp
|
C++
|
examples/pppbayestree/gpstk/PZ90Ellipsoid.hpp
|
shaolinbit/minisam_lib
|
e2e904d1b6753976de1dee102f0b53e778c0f880
|
[
"BSD-3-Clause"
] | 104
|
2019-06-23T14:45:20.000Z
|
2022-03-20T12:45:29.000Z
|
examples/pppbayestree/gpstk/PZ90Ellipsoid.hpp
|
shaolinbit/minisam_lib
|
e2e904d1b6753976de1dee102f0b53e778c0f880
|
[
"BSD-3-Clause"
] | 2
|
2019-06-28T08:23:23.000Z
|
2019-07-17T02:37:08.000Z
|
examples/pppbayestree/gpstk/PZ90Ellipsoid.hpp
|
shaolinbit/minisam_lib
|
e2e904d1b6753976de1dee102f0b53e778c0f880
|
[
"BSD-3-Clause"
] | 28
|
2019-06-23T14:45:19.000Z
|
2022-03-20T12:45:24.000Z
|
#pragma ident "$Id$"
//============================================================================
//
// This file is part of GPSTk, the GPS Toolkit.
//
// The GPSTk is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 2.1 of the License, or
// any later version.
//
// The GPSTk is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with GPSTk; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
//
// Copyright 2004, The University of Texas at Austin
//
//============================================================================
//============================================================================
//
//This software developed by Applied Research Laboratories at the University of
//Texas at Austin, under contract to an agency or agencies within the U.S.
//Department of Defense. The U.S. Government retains all rights to use,
//duplicate, distribute, disclose, or release this software.
//
//Pursuant to DoD Directive 523024
//
// DISTRIBUTION STATEMENT A: This software has been approved for public
// release, distribution is unlimited.
//
//=============================================================================
/**
* @file PZ90Ellipsoid.hpp
* PZ90.02 model of the Ellipsoid (as defined in table 3.2 of ICD-2008, v5.1).
*/
#ifndef GPSTK_PZ90ELLIPSOID_HPP
#define GPSTK_PZ90ELLIPSOID_HPP
#include "EllipsoidModel.hpp"
namespace gpstk
{
/** @addtogroup geodeticgroup */
//@{
class PZ90Ellipsoid : public EllipsoidModel
{
public:
///Defined in table 3.2 of ICD-2008 (v5.1)
/// @return semi-major axis of Earth in meters.
virtual double a() const throw()
{
return 6378136.0;
}
///Defined in table 3.2 of ICD-2008 (v5.1)
/// @return semi-major axis of Earth in km.
virtual double a_km() const throw()
{
return a() / 1000.0;
}
/**
* Defined in table 3.2 of the GLONASS ICD-2008 (v5.1)
* @return inverse o flattening (ellipsoid parameter).
*/
virtual double flatteningInverse() const throw()
{
return 298.25784;
}
/**
* Computed from inverse flattening value as given in table 3.2
* of the GLONASS ICD-2008 (v5.1)
* @return flattening (ellipsoid parameter).
*/
virtual double flattening() const throw()
{
return 3.35280373518e-3;
}
// The eccentricity and eccSquared values were computed from the
// flattening value via the formula:
// ecc2 = 1 - (1 - f)^2 = f*(2.0 - f)
// ecc = sqrt(ecc2)
/// @return eccentricity (ellipsoid parameter).
virtual double eccentricity() const throw()
{
return 8.1819106432923e-2;
}
/// @return eccentricity squared (ellipsoid parameter).
virtual double eccSquared() const throw()
{
return 6.69436617748e-3;
}
///Defined in table 3.2 of ICD-2008 (v5.1)
/// @return angular velocity of Earth in radians/sec.
virtual double angVelocity() const throw()
{
return 7.292115e-5;
}
///Defined in table 3.2 of ICD-2008 (v5.1)
/// @return geocentric gravitational constant in m**3 / s**2
virtual double gm() const throw()
{
return 398600.4418e9;
}
///Defined in table 3.2 of ICD-2008 (v5.1)
/// @return geocentric gravitational constant in km**3 / s**2
virtual double gm_km() const throw()
{
return 398600.4418;
}
///Defined in table 3.2 of ICD-2008 (v5.1)
/// @return Speed of light in m/s.
virtual double c() const throw()
{
return 299792458;
}
///Defined in table 3.2 of ICD-2008 (v5.1)
/// @return Speed of light in km/s
virtual double c_km() const throw()
{
return c()/1000.0;
}
///Defined in table 3.2 of ICD-2008 (v5.1)
/// @return Returns second zonal harmonic of the geopotential.
virtual double j20() const throw()
{
return (-1.08262575e-3);
}
/// Destructor.
virtual ~PZ90Ellipsoid() throw() {};
}; // End of class 'PZ90Ellipsoid'
//@}
} // End of namespace gpstk
#endif // GPSTK_PZ90ELLIPSOID_HPP
| 28.691824
| 79
| 0.599956
|
shaolinbit
|
a16a61bc3a617bf13d2c3e1558797606a51ccfab
| 12,676
|
hpp
|
C++
|
ql/experimental/volatility/noarbsabrinterpolation.hpp
|
elay00/QuantLib
|
922e582a0d59f20d5a4480448546942c64490fda
|
[
"BSD-3-Clause"
] | 1
|
2015-09-21T12:21:33.000Z
|
2015-09-21T12:21:33.000Z
|
ql/experimental/volatility/noarbsabrinterpolation.hpp
|
klausspanderen/quantlib
|
922e582a0d59f20d5a4480448546942c64490fda
|
[
"BSD-3-Clause"
] | 3
|
2022-03-09T16:19:13.000Z
|
2022-03-29T07:33:42.000Z
|
ql/experimental/volatility/noarbsabrinterpolation.hpp
|
idreamsfy/QuantLib
|
d6e44270945d2061364e1b3a8bdb4b4e4cc6bba5
|
[
"BSD-3-Clause"
] | null | null | null |
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2014 Peter Caspers
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it
under the terms of the QuantLib license. You should have received a
copy of the license along with this program; if not, please email
<quantlib-dev@lists.sf.net>. The license is also available online at
<http://quantlib.org/license.shtml>.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
/*! \file noarbsabrinterpolation.hpp
\brief noabr sabr interpolation between discrete points
*/
#ifndef quantlib_noarbsabr_interpolation_hpp
#define quantlib_noarbsabr_interpolation_hpp
#include <ql/experimental/volatility/noarbsabrsmilesection.hpp>
#include <ql/math/interpolations/sabrinterpolation.hpp>
#include <utility>
namespace QuantLib {
namespace detail {
// we can directly use the smile section as the wrapper
typedef NoArbSabrSmileSection NoArbSabrWrapper;
struct NoArbSabrSpecs {
Size dimension() { return 4; }
Real eps() { return 0.000001; }
void defaultValues(std::vector<Real> ¶ms,
std::vector<bool> ¶mIsFixed, const Real &forward,
const Real expiryTime, const std::vector<Real> &addParams) {
SABRSpecs().defaultValues(params, paramIsFixed, forward, expiryTime, addParams);
// check if alpha / beta is admissable, otherwise adjust
// if possible (i.e. not fixed, otherwise an exception will
// be thrown from the model constructor anyway)
Real sigmaI = params[0] * std::pow(forward, params[1] - 1.0);
if (sigmaI < detail::NoArbSabrModel::sigmaI_min) {
if (!paramIsFixed[0])
params[0] = detail::NoArbSabrModel::sigmaI_min * (1.0 + eps()) /
std::pow(forward, params[1] - 1.0);
else {
if (!paramIsFixed[1])
params[1] = 1.0 +
std::log(detail::NoArbSabrModel::sigmaI_min *
(1.0 + eps()) / params[0]) /
std::log(forward);
}
}
if (sigmaI > detail::NoArbSabrModel::sigmaI_max) {
if (!paramIsFixed[0])
params[0] = detail::NoArbSabrModel::sigmaI_max * (1.0 - eps()) /
std::pow(forward, params[1] - 1.0);
else {
if (!paramIsFixed[1])
params[1] = 1.0 +
std::log(detail::NoArbSabrModel::sigmaI_max *
(1.0 - eps()) / params[0]) /
std::log(forward);
}
}
}
void guess(Array &values, const std::vector<bool> ¶mIsFixed,
const Real &forward, const Real expiryTime,
const std::vector<Real> &r, const std::vector<Real> &) {
Size j = 0;
if (!paramIsFixed[1])
values[1] = detail::NoArbSabrModel::beta_min +
(detail::NoArbSabrModel::beta_max -
detail::NoArbSabrModel::beta_min) *
r[j++];
if (!paramIsFixed[0]) {
Real sigmaI = detail::NoArbSabrModel::sigmaI_min +
(detail::NoArbSabrModel::sigmaI_max -
detail::NoArbSabrModel::sigmaI_min) *
r[j++];
sigmaI *= (1.0 - eps());
sigmaI += eps() / 2.0;
values[0] = sigmaI / std::pow(forward, values[1] - 1.0);
}
if (!paramIsFixed[2])
values[2] = detail::NoArbSabrModel::nu_min +
(detail::NoArbSabrModel::nu_max -
detail::NoArbSabrModel::nu_min) *
r[j++];
if (!paramIsFixed[3])
values[3] = detail::NoArbSabrModel::rho_min +
(detail::NoArbSabrModel::rho_max -
detail::NoArbSabrModel::rho_min) *
r[j++];
}
Array inverse(const Array &y, const std::vector<bool> ¶mIsFixed,
const std::vector<Real> ¶ms, const Real forward) {
Array x(4);
x[1] = std::tan((y[1] - detail::NoArbSabrModel::beta_min) /
(detail::NoArbSabrModel::beta_max -
detail::NoArbSabrModel::beta_min) *
M_PI +
M_PI / 2.0);
x[0] = std::tan((y[0] * std::pow(forward, y[1] - 1.0) -
detail::NoArbSabrModel::sigmaI_min) /
(detail::NoArbSabrModel::sigmaI_max -
detail::NoArbSabrModel::sigmaI_min) *
M_PI -
M_PI / 2.0);
x[2] = std::tan((y[2] - detail::NoArbSabrModel::nu_min) /
(detail::NoArbSabrModel::nu_max -
detail::NoArbSabrModel::nu_min) *
M_PI +
M_PI / 2.0);
x[3] = std::tan((y[3] - detail::NoArbSabrModel::rho_min) /
(detail::NoArbSabrModel::rho_max -
detail::NoArbSabrModel::rho_min) *
M_PI +
M_PI / 2.0);
return x;
}
Array direct(const Array &x, const std::vector<bool> ¶mIsFixed,
const std::vector<Real> ¶ms, const Real forward) {
Array y(4);
if (paramIsFixed[1])
y[1] = params[1];
else
y[1] = detail::NoArbSabrModel::beta_min +
(detail::NoArbSabrModel::beta_max -
detail::NoArbSabrModel::beta_min) *
(std::atan(x[1]) + M_PI / 2.0) / M_PI;
// we compute alpha from sigmaI using beta
// if alpha is fixed we have to check if beta is admissable
// and adjust if need be
if (paramIsFixed[0]) {
y[0] = params[0];
Real sigmaI = y[0] * std::pow(forward, y[1] - 1.0);
if (sigmaI < detail::NoArbSabrModel::sigmaI_min) {
y[1] = (1.0 +
std::log(detail::NoArbSabrModel::sigmaI_min *
(1.0 + eps()) / y[0]) /
std::log(forward));
}
if (sigmaI > detail::NoArbSabrModel::sigmaI_max) {
y[1] = (1.0 +
std::log(detail::NoArbSabrModel::sigmaI_max *
(1.0 - eps()) / y[0]) /
std::log(forward));
}
} else {
Real sigmaI = detail::NoArbSabrModel::sigmaI_min +
(detail::NoArbSabrModel::sigmaI_max -
detail::NoArbSabrModel::sigmaI_min) *
(std::atan(x[0]) + M_PI / 2.0) / M_PI;
y[0] = sigmaI / std::pow(forward, y[1] - 1.0);
}
if (paramIsFixed[2])
y[2] = params[2];
else
y[2] = detail::NoArbSabrModel::nu_min +
(detail::NoArbSabrModel::nu_max -
detail::NoArbSabrModel::nu_min) *
(std::atan(x[2]) + M_PI / 2.0) / M_PI;
if (paramIsFixed[3])
y[3] = params[3];
else
y[3] = detail::NoArbSabrModel::rho_min +
(detail::NoArbSabrModel::rho_max -
detail::NoArbSabrModel::rho_min) *
(std::atan(x[3]) + M_PI / 2.0) / M_PI;
return y;
}
Real weight(const Real strike, const Real forward, const Real stdDev,
const std::vector<Real> &addParams) {
return blackFormulaStdDevDerivative(strike, forward, stdDev, 1.0);
}
typedef NoArbSabrWrapper type;
ext::shared_ptr<type> instance(const Time t, const Real &forward,
const std::vector<Real> ¶ms,
const std::vector<Real> &) {
return ext::make_shared<type>(t, forward, params);
}
};
}
//! no arbitrage sabr smile interpolation between discrete volatility points.
class NoArbSabrInterpolation : public Interpolation {
public:
template <class I1, class I2>
NoArbSabrInterpolation(
const I1 &xBegin, // x = strikes
const I1 &xEnd,
const I2 &yBegin, // y = volatilities
Time t, // option expiry
const Real &forward, Real alpha, Real beta, Real nu, Real rho,
bool alphaIsFixed, bool betaIsFixed, bool nuIsFixed, bool rhoIsFixed,
bool vegaWeighted = true,
const ext::shared_ptr<EndCriteria> &endCriteria =
ext::shared_ptr<EndCriteria>(),
const ext::shared_ptr<OptimizationMethod> &optMethod =
ext::shared_ptr<OptimizationMethod>(),
const Real errorAccept = 0.0020, const bool useMaxError = false,
const Size maxGuesses = 50, const Real shift = 0.0) {
QL_REQUIRE(shift==0.0,"NoArbSabrInterpolation for non zero shift not implemented");
impl_ = ext::shared_ptr<Interpolation::Impl>(
new detail::XABRInterpolationImpl<I1, I2, detail::NoArbSabrSpecs>(
xBegin, xEnd, yBegin, t, forward,
{alpha, beta, nu, rho},
{alphaIsFixed, betaIsFixed, nuIsFixed, rhoIsFixed},
vegaWeighted, endCriteria, optMethod, errorAccept, useMaxError,
maxGuesses));
}
Real expiry() const { return coeffs().t_; }
Real forward() const { return coeffs().forward_; }
Real alpha() const { return coeffs().params_[0]; }
Real beta() const { return coeffs().params_[1]; }
Real nu() const { return coeffs().params_[2]; }
Real rho() const { return coeffs().params_[3]; }
Real rmsError() const { return coeffs().error_; }
Real maxError() const { return coeffs().maxError_; }
const std::vector<Real> &interpolationWeights() const {
return coeffs().weights_;
}
EndCriteria::Type endCriteria() { return coeffs().XABREndCriteria_; }
private:
const detail::XABRCoeffHolder<detail::NoArbSabrSpecs>& coeffs() const {
return *dynamic_cast<detail::XABRCoeffHolder<detail::NoArbSabrSpecs>*>(impl_.get());
}
};
//! no arbtrage sabr interpolation factory and traits
class NoArbSabr {
public:
NoArbSabr(Time t,
Real forward,
Real alpha,
Real beta,
Real nu,
Real rho,
bool alphaIsFixed,
bool betaIsFixed,
bool nuIsFixed,
bool rhoIsFixed,
bool vegaWeighted = false,
ext::shared_ptr<EndCriteria> endCriteria = ext::shared_ptr<EndCriteria>(),
ext::shared_ptr<OptimizationMethod> optMethod = ext::shared_ptr<OptimizationMethod>(),
const Real errorAccept = 0.0020,
const bool useMaxError = false,
const Size maxGuesses = 50)
: t_(t), forward_(forward), alpha_(alpha), beta_(beta), nu_(nu), rho_(rho),
alphaIsFixed_(alphaIsFixed), betaIsFixed_(betaIsFixed), nuIsFixed_(nuIsFixed),
rhoIsFixed_(rhoIsFixed), vegaWeighted_(vegaWeighted), endCriteria_(std::move(endCriteria)),
optMethod_(std::move(optMethod)), errorAccept_(errorAccept), useMaxError_(useMaxError),
maxGuesses_(maxGuesses) {}
template <class I1, class I2>
Interpolation interpolate(const I1 &xBegin, const I1 &xEnd,
const I2 &yBegin) const {
return NoArbSabrInterpolation(
xBegin, xEnd, yBegin, t_, forward_, alpha_, beta_, nu_, rho_,
alphaIsFixed_, betaIsFixed_, nuIsFixed_, rhoIsFixed_, vegaWeighted_,
endCriteria_, optMethod_, errorAccept_, useMaxError_, maxGuesses_);
}
static const bool global = true;
private:
Time t_;
Real forward_;
Real alpha_, beta_, nu_, rho_;
bool alphaIsFixed_, betaIsFixed_, nuIsFixed_, rhoIsFixed_;
bool vegaWeighted_;
const ext::shared_ptr<EndCriteria> endCriteria_;
const ext::shared_ptr<OptimizationMethod> optMethod_;
const Real errorAccept_;
const bool useMaxError_;
const Size maxGuesses_;
};
}
#endif
| 43.861592
| 100
| 0.545598
|
elay00
|
a16ab633fcddacd1bd5fa8e422a2f09c8445aea1
| 4,967
|
cpp
|
C++
|
Src/lunaui/launcher/elements/static/textbox.cpp
|
ericblade/luna-sysmgr
|
82d5d7ced4ba21d3802eb2c8ae063236b6562331
|
[
"Apache-2.0"
] | 3
|
2018-11-16T14:51:17.000Z
|
2019-11-21T10:55:24.000Z
|
Src/lunaui/launcher/elements/static/textbox.cpp
|
penk/luna-sysmgr
|
60c7056a734cdb55a718507f3a739839c9d74edf
|
[
"Apache-2.0"
] | 1
|
2021-02-20T13:12:15.000Z
|
2021-02-20T13:12:15.000Z
|
Src/lunaui/launcher/elements/static/textbox.cpp
|
ericblade/luna-sysmgr
|
82d5d7ced4ba21d3802eb2c8ae063236b6562331
|
[
"Apache-2.0"
] | null | null | null |
/* @@@LICENSE
*
* Copyright (c) 2011-2012 Hewlett-Packard Development Company, L.P.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* LICENSE@@@ */
#include "textbox.h"
#include "dimensionsglobal.h"
#include "debugglobal.h"
#include "pixmapobject.h"
#include "iconlayoutsettings.h"
#include <QPainter>
#include <QFont>
#include <QString>
#include <QDebug>
#include "Settings.h"
const char * TextBox::InnerTextPropertyName = "innertext";
QFont TextBox::s_textFont = QFont();
QFont TextBox::staticLabelFontForTextBox()
{
//TODO: specify a proper font
static bool fontInitalized = false;
if (!fontInitalized)
{
//TODO: TEMP: don't hiijack
s_textFont = QFont(QString::fromStdString(Settings::LunaSettings()->fontQuicklaunch));
}
return s_textFont;
}
TextBox::TextBox(PixmapObject * p_backgroundPmo,const QRectF& geom)
: ThingPaintable(geom)
, m_qp_background(p_backgroundPmo)
, m_qp_prerenderedInnerTextPixmap(0)
{
}
TextBox::TextBox(PixmapObject * p_backgroundPmo,const QRectF& geom,const QString& inner_text)
: ThingPaintable(geom)
, m_qp_background(p_backgroundPmo)
, m_qp_prerenderedInnerTextPixmap(0)
{
setInnerText(inner_text);
}
//virtual
TextBox::~TextBox()
{
}
//virtual
void TextBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,QWidget *widget)
{
//DimensionsDebugGlobal::dbgPaintBoundingRect(painter,m_geom,4);
QPen savePen = painter->pen();
painter->setPen(IconLayoutSettings::settings()->reorderablelayout_emptyPageTextFontColor);
m_textLayoutObject.draw(painter,m_innerTextPosICS+m_innerTextGeom.topLeft());
painter->setPen(savePen);
}
//virtual
void TextBox::paintOffscreen(QPainter *painter)
{
}
//virtual
QString TextBox::innerText() const
{
return m_innerText;
}
//virtual
void TextBox::setInnerText(const QString& v)
{
m_innerText = v;
recalculateMaxTextGeomForCurrentGeom();
redoInnerTextLayout();
recalculateInnerTextPosition();
update();
}
//virtual
void TextBox::resetInnerText()
{
//TODO: LOCALIZE:
m_innerText = QString();
m_textLayoutObject.clearLayout();
update();
}
///protected:
//virtual
void TextBox::recalculateMaxTextGeomForCurrentGeom()
{
qint32 width = DimensionsGlobal::roundDown(m_geom.width());
qint32 height = DimensionsGlobal::roundDown(m_geom.height());
width = qMax(2,width - 2 - (width % 2));
height = qMax(2,height - 2 - (height % 2));
m_innerTextMaxGeom = DimensionsGlobal::realRectAroundRealPoint(QSize(width,height)).toRect();
}
//virtual
void TextBox::redoInnerTextLayout()
{
//TODO: somewhat wasteful. If there is no label, should just exit early and leave a layout that will be left unrendered by paint()
m_textLayoutObject.clearLayout();
m_textLayoutObject.setText(m_innerText);
QFont f = staticLabelFontForTextBox();
f.setBold(IconLayoutSettings::settings()->reorderablelayout_emptyPageTextFontEmbolden);
f.setPixelSize(qMax((quint32)4,IconLayoutSettings::settings()->reorderablelayout_emptyPageTextFontSizePx));
m_textLayoutObject.setFont(f);
QTextOption textOpts;
textOpts.setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
textOpts.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
m_textLayoutObject.setTextOption(textOpts);
QFontMetrics fm(staticLabelFontForTextBox());
int leading = fm.leading();
int rise = fm.ascent();
qreal height = 0;
m_textLayoutObject.beginLayout();
while (height < m_innerTextMaxGeom.height()) {
QTextLine line = m_textLayoutObject.createLine();
if (!line.isValid())
break;
line.setLineWidth(m_innerTextMaxGeom.width());
if (m_textLayoutObject.lineCount() > 1)
{
// height += leading;
}
line.setPosition(QPointF(0, height));
height += line.height();
}
height = qMin((quint32)DimensionsGlobal::roundUp(height),(quint32)m_innerTextMaxGeom.height());
height = DimensionsGlobal::roundDown(height) - (DimensionsGlobal::roundDown(height) % 2); //force to an even #
m_textLayoutObject.endLayout();
//TODO: PIXEL-ALIGN
m_innerTextGeom = DimensionsGlobal::realRectAroundRealPoint(QSizeF(m_textLayoutObject.boundingRect().width(),height)).toAlignedRect();
}
//virtual
void TextBox::recalculateInnerTextPosition()
{
m_innerTextPosICS = QPointF(m_geom.center().x(),m_geom.top() - (qreal)m_innerTextGeom.top());
QPointF offset = m_innerTextPosICS + m_innerTextGeom.topLeft() - m_geom.topLeft();
offset += QPointF(DimensionsGlobal::centerRectInRectPixelAlign(m_innerTextMaxGeom,m_innerTextGeom));
m_innerTextPosPntCS = DimensionsGlobal::realPointAsPixelPosition(offset);
}
| 28.877907
| 135
| 0.765855
|
ericblade
|
a16d4485534a013929a9ee2e64f04644f1ce6de2
| 2,377
|
cpp
|
C++
|
src/shape.cpp
|
WeichenLiu/lajolla_public
|
daf1a095feb9b8a4a8c727a012f9d6d9a422ac69
|
[
"MIT"
] | 31
|
2021-12-27T00:45:29.000Z
|
2022-03-21T11:12:24.000Z
|
src/shape.cpp
|
WeichenLiu/lajolla_public
|
daf1a095feb9b8a4a8c727a012f9d6d9a422ac69
|
[
"MIT"
] | 7
|
2022-01-04T03:08:28.000Z
|
2022-03-02T23:26:20.000Z
|
src/shape.cpp
|
WeichenLiu/lajolla_public
|
daf1a095feb9b8a4a8c727a012f9d6d9a422ac69
|
[
"MIT"
] | 14
|
2022-01-02T19:43:18.000Z
|
2022-03-21T06:07:39.000Z
|
#include "shape.h"
#include "intersection.h"
#include "point_and_normal.h"
#include "ray.h"
#include <embree3/rtcore.h>
struct register_embree_op {
uint32_t operator()(const Sphere &sphere) const;
uint32_t operator()(const TriangleMesh &mesh) const;
const RTCDevice &device;
const RTCScene &scene;
};
struct sample_point_on_shape_op {
PointAndNormal operator()(const Sphere &sphere) const;
PointAndNormal operator()(const TriangleMesh &mesh) const;
const Vector3 &ref_point;
const Vector2 &uv; // for selecting a point on a 2D surface
const Real &w; // for selecting triangles
};
struct surface_area_op {
Real operator()(const Sphere &sphere) const;
Real operator()(const TriangleMesh &mesh) const;
};
struct pdf_point_on_shape_op {
Real operator()(const Sphere &sphere) const;
Real operator()(const TriangleMesh &mesh) const;
const PointAndNormal &point_on_shape;
const Vector3 &ref_point;
};
struct init_sampling_dist_op {
void operator()(Sphere &sphere) const;
void operator()(TriangleMesh &mesh) const;
};
struct compute_shading_info_op {
ShadingInfo operator()(const Sphere &sphere) const;
ShadingInfo operator()(const TriangleMesh &mesh) const;
const PathVertex &vertex;
};
#include "shapes/sphere.inl"
#include "shapes/triangle_mesh.inl"
uint32_t register_embree(const Shape &shape, const RTCDevice &device, const RTCScene &scene) {
return std::visit(register_embree_op{device, scene}, shape);
}
PointAndNormal sample_point_on_shape(const Shape &shape,
const Vector3 &ref_point,
const Vector2 &uv,
Real w) {
return std::visit(sample_point_on_shape_op{ref_point, uv, w}, shape);
}
Real pdf_point_on_shape(const Shape &shape,
const PointAndNormal &point_on_shape,
const Vector3 &ref_point) {
return std::visit(pdf_point_on_shape_op{point_on_shape, ref_point}, shape);
}
Real surface_area(const Shape &shape) {
return std::visit(surface_area_op{}, shape);
}
void init_sampling_dist(Shape &shape) {
return std::visit(init_sampling_dist_op{}, shape);
}
ShadingInfo compute_shading_info(const Shape &shape, const PathVertex &vertex) {
return std::visit(compute_shading_info_op{vertex}, shape);
}
| 29.7125
| 94
| 0.692469
|
WeichenLiu
|
a17532fa4518dff2cdc826d26861a6b3c800aeed
| 768
|
cpp
|
C++
|
COOK82B.cpp
|
ss6364/CodeForces-contests
|
40a2ea7fd75d754d9c42c596c5bbfccf8b3ebdc1
|
[
"Unlicense"
] | 2
|
2019-05-06T04:29:05.000Z
|
2019-05-06T09:19:03.000Z
|
COOK82B.cpp
|
ss6364/CodeForces-contests
|
40a2ea7fd75d754d9c42c596c5bbfccf8b3ebdc1
|
[
"Unlicense"
] | null | null | null |
COOK82B.cpp
|
ss6364/CodeForces-contests
|
40a2ea7fd75d754d9c42c596c5bbfccf8b3ebdc1
|
[
"Unlicense"
] | null | null | null |
// https://www.codechef.com/problems/COOK82B
#include<bits/stdc++.h>
using namespace std ;
#define Fors(n) for(int i=1;i<=n;i++)
#define For(n) for(i=0;i<n;i++)
#define ll long long
#define vint(s) vector<int> s
#define pb(x) push_back(x)
#define mpair(x,y) make_pair(x,y)
#define MOD 1000000007
#define mod 100000
ll x=0,y=0,s=0,n=0,i=0;
vint(v);
bool prime[mod] ;
void seive(){
int t ;
For(mod){
prime[i] = 1 ;
}
prime[1]=0 ;
prime[0]=0 ;
for(i=2;i<100000;i++){
if(prime[i]=1){
v.pb(i);
for(j=i*i;j<100000;j+=i){
prime[i] = 0 ;
}
}
}
}
int main(){
cin>>n ;
int a[n];
For(n){
cin>>a[i];
}
For(n){
}
return 0;
}
| 15.058824
| 49
| 0.486979
|
ss6364
|
a17caf5021af396e9934c7b5fab5ed0a2d3c86a7
| 8,826
|
cpp
|
C++
|
lib/webserver/status.cpp
|
mukhin/libwebserver
|
04a72616c2dc6360136123acd4d9295417936102
|
[
"MIT"
] | 1
|
2015-01-04T04:14:43.000Z
|
2015-01-04T04:14:43.000Z
|
lib/webserver/status.cpp
|
mukhin/libwebserver
|
04a72616c2dc6360136123acd4d9295417936102
|
[
"MIT"
] | null | null | null |
lib/webserver/status.cpp
|
mukhin/libwebserver
|
04a72616c2dc6360136123acd4d9295417936102
|
[
"MIT"
] | null | null | null |
// Embedded web-server library
//
// Copyright 2010 LibWebserver Authors. All rights reserved.
#include "status.h"
#include <base/basicmacros.h>
#include <base/string_helpers.h>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <sstream>
namespace webserver {
WebserverStatus::WebserverStatus() :
http_served_(webserver::HTTP_CODES_COUNT, 0),
sustained_rate_position_(0),
attained_rate_position_(0),
latency_position_(0),
sustained_rate_1_(0),
sustained_rate_5_(0),
sustained_rate_15_(0),
max_attained_rate_(0),
attained_rate_1_(0),
attained_rate_5_(0),
attained_rate_15_(0),
latency_1_(0),
latency_5_(0),
latency_15_(0),
total_served_requests_(0)
{
traffic_in_ = 0;
traffic_out_ = 0;
outgoing_rate_ = 0;
fast_latency_sum_ = 0;
fast_latency_count_ = 0;
max_latency_ = 0;
}
WebserverStatus::~WebserverStatus() {
}
void WebserverStatus::IncomingRequest(const size_t length) {
traffic_in_ += length;
}
void WebserverStatus::ServedRequest(const OutgoingHttpMessage::sptr& message) {
http_served_[message->GetResponseCode()]++;
traffic_out_ += message->GetLength();
clocks::HiResTimer* t = message->GetTimer();
if (t) {
t->Mark();
double nanoDifference = static_cast<double>(t->GetDifferenceNanoseconds());
unsigned int latency = static_cast<unsigned int>(t->GetDifferenceSeconds()) * 1000000 +
static_cast<unsigned int>(::round(nanoDifference / 1000));
fast_latency_sum_.fetch_and_add(latency);
++fast_latency_count_;
++outgoing_rate_;
if (latency > max_latency_ && max_attained_rate_ != 0) {
max_latency_ = latency;
}
}
}
uint64_t WebserverStatus::TotalServedRequests() const {
return total_served_requests_;
}
const WebserverStatus::HttpResponseTable& WebserverStatus::GetHttpServed() const {
return http_served_;
}
uint64_t WebserverStatus::GetTrafficIn() const {
return traffic_in_;
}
uint64_t WebserverStatus::GetTrafficOut() const {
return traffic_out_;
}
unsigned int WebserverStatus::SustainedRate1() const {
return sustained_rate_1_;
}
unsigned int WebserverStatus::SustainedRate5() const {
return sustained_rate_5_;
}
unsigned int WebserverStatus::SustainedRate15() const {
return sustained_rate_15_;
}
unsigned int WebserverStatus::AttainedRate1() const {
return attained_rate_1_;
}
unsigned int WebserverStatus::AttainedRate5() const {
return attained_rate_5_;
}
unsigned int WebserverStatus::AttainedRate15() const {
return attained_rate_15_;
}
unsigned int WebserverStatus::MaxAttainedRate() const {
return max_attained_rate_;
}
unsigned int WebserverStatus::MaxLatency() const {
return max_latency_;
}
unsigned int WebserverStatus::Latency1() const {
return latency_1_ > 0 ? latency_1_ : 0;
}
unsigned int WebserverStatus::Latency5() const {
return latency_5_ > 0 ? latency_5_ : 0;
}
unsigned int WebserverStatus::Latency15() const {
return latency_15_ > 0 ? latency_15_ : 0;
}
void WebserverStatus::Run() {
while (!ShouldStop()) {
const unsigned int rate = outgoing_rate_;
outgoing_rate_ -= rate;
max_attained_rate_ = max_attained_rate_ < rate ? rate : max_attained_rate_;
CalculateSustainedRate_(rate);
CalculateAttainedRate_(rate);
CalculateLatency_();
CalculateRequests_();
Wait(1000);
}
}
void WebserverStatus::CalculateSustainedRate_(const unsigned int rate) {
size_t size_1 = 60;
size_t size_5 = 300;
size_t size_15 = 900;
if (sustained_rate_1_history_.size() < 60) {
sustained_rate_1_history_.push_back(rate);
size_1 = sustained_rate_1_history_.size();
}
else {
sustained_rate_1_history_[sustained_rate_position_ % 60] = rate;
}
if (sustained_rate_5_history_.size() < 300) {
sustained_rate_5_history_.push_back(rate);
size_5 = sustained_rate_5_history_.size();
}
else {
sustained_rate_5_history_[sustained_rate_position_ % 300] = rate;
}
if (sustained_rate_15_history_.size() < 900) {
sustained_rate_15_history_.push_back(rate);
size_15 = sustained_rate_15_history_.size();
}
else {
sustained_rate_15_history_[sustained_rate_position_] = rate;
}
if (++sustained_rate_position_ >= 900) {
sustained_rate_position_ = 0;
}
const float acc_rate_1 = static_cast<float>(std::accumulate(sustained_rate_1_history_.begin(), sustained_rate_1_history_.end(), 0));
const float acc_rate_5 = static_cast<float>(std::accumulate(sustained_rate_5_history_.begin(), sustained_rate_5_history_.end(), 0));
const float acc_rate_15 = static_cast<float>(std::accumulate(sustained_rate_15_history_.begin(), sustained_rate_15_history_.end(), 0));
sustained_rate_1_ = static_cast<unsigned int>(acc_rate_1 / static_cast<float>(size_1));
sustained_rate_5_ = static_cast<unsigned int>(acc_rate_5 / static_cast<float>(size_5));
sustained_rate_15_ = static_cast<unsigned int>(acc_rate_15 / static_cast<float>(size_15));
}
void WebserverStatus::CalculateAttainedRate_(const unsigned int rate) {
if (rate == 0) {
return;
}
size_t size_1 = 60;
size_t size_5 = 300;
size_t size_15 = 900;
if (attained_rate_1_history_.size() < 60) {
attained_rate_1_history_.push_back(rate);
size_1 = attained_rate_1_history_.size();
}
else {
attained_rate_1_history_[attained_rate_position_ % 60] = rate;
}
if (attained_rate_5_history_.size() < 300) {
attained_rate_5_history_.push_back(rate);
size_5 = attained_rate_5_history_.size();
}
else {
attained_rate_5_history_[attained_rate_position_ % 300] = rate;
}
if (attained_rate_15_history_.size() < 900) {
attained_rate_15_history_.push_back(rate);
size_15 = attained_rate_15_history_.size();
}
else {
attained_rate_15_history_[attained_rate_position_] = rate;
}
if (++attained_rate_position_ >= 900) {
attained_rate_position_ = 0;
}
const float acc_rate_1 = static_cast<float>(std::accumulate(attained_rate_1_history_.begin(), attained_rate_1_history_.end(), 0));
const float acc_rate_5 = static_cast<float>(std::accumulate(attained_rate_5_history_.begin(), attained_rate_5_history_.end(), 0));
const float acc_rate_15 = static_cast<float>(std::accumulate(attained_rate_15_history_.begin(), attained_rate_15_history_.end(), 0));
attained_rate_1_ = static_cast<unsigned int>(acc_rate_1 / static_cast<float>(size_1));
attained_rate_5_ = static_cast<unsigned int>(acc_rate_5 / static_cast<float>(size_15));
attained_rate_15_ = static_cast<unsigned int>(acc_rate_15 / static_cast<float>(size_15));
}
void WebserverStatus::CalculateLatency_() {
if (fast_latency_sum_ != 0 && fast_latency_count_ != 0) {
float average = static_cast<float>(fast_latency_sum_) / static_cast<float>(fast_latency_count_);
fast_latency_sum_ = 0;
fast_latency_count_ = 0;
if (average > 0) {
size_t size_1 = 60;
size_t size_5 = 300;
size_t size_15 = 900;
if (latency_1_history_.size() < 60) {
latency_1_history_.push_back(average);
size_1 = latency_1_history_.size();
}
else {
latency_1_history_[latency_position_ % 60] = average;
}
if (latency_5_history_.size() < 300) {
latency_5_history_.push_back(average);
size_5 = latency_5_history_.size();
}
else {
latency_5_history_[latency_position_ % 300] = average;
}
if (latency_15_history_.size() < 900) {
latency_15_history_.push_back(average);
size_15 = latency_15_history_.size();
}
else {
latency_15_history_[latency_position_] = average;
}
if (++latency_position_ >= 900) {
latency_position_ = 0;
}
latency_1_ = static_cast<unsigned int>(std::accumulate(latency_1_history_.begin(), latency_1_history_.end(), 0.0) / static_cast<float>(size_1));
latency_5_ = static_cast<unsigned int>(std::accumulate(latency_5_history_.begin(), latency_5_history_.end(), 0.0) / static_cast<float>(size_5));
latency_15_ = static_cast<unsigned int>(std::accumulate(latency_15_history_.begin(), latency_15_history_.end(), 0.0) / static_cast<float>(size_15));
}
}
}
void WebserverStatus::CalculateRequests_() {
total_served_requests_ = 0;
for (HttpResponseTable::const_iterator i = http_served_.begin(); i != http_served_.end(); ++i) {
total_served_requests_ += *i;
}
}
} // namespace webserver
| 28.749186
| 156
| 0.687288
|
mukhin
|
a17cd01dfca1d02b1eaaf1321f8b891c8f6d4ed6
| 4,993
|
tpp
|
C++
|
GA/src/GA/Engine.tpp
|
Kaylier/Genetic-Algorithm
|
7d14ec1558699e8dffec1f8d247cf6d25b4e1982
|
[
"MIT"
] | null | null | null |
GA/src/GA/Engine.tpp
|
Kaylier/Genetic-Algorithm
|
7d14ec1558699e8dffec1f8d247cf6d25b4e1982
|
[
"MIT"
] | null | null | null |
GA/src/GA/Engine.tpp
|
Kaylier/Genetic-Algorithm
|
7d14ec1558699e8dffec1f8d247cf6d25b4e1982
|
[
"MIT"
] | null | null | null |
#include <cassert>
#include <cmath> // sqrt
#include <GA/Engine.h>
template<class Individual>
GA::Engine<Individual>::Engine(Objective<Individual> &objective,
Crossover<Individual> &crossover,
Mutation<Individual> &mutation,
Selection<Individual> &selection) :
objective(objective),
crossover(crossover),
mutation(mutation),
selection(selection),
populationSize(1),
population() {
std::random_device rndDevice;
this->rnd.seed(rndDevice());
}
template<class Individual>
GA::Objective<Individual> &GA::Engine<Individual>::getObjective() const {
return this->objective;
}
template<class Individual>
GA::Crossover<Individual> &GA::Engine<Individual>::getCrossover() const {
return this->crossover;
}
template<class Individual>
GA::Mutation<Individual> &GA::Engine<Individual>::getMutation() const {
return this->mutation;
}
template<class Individual>
GA::Selection<Individual> &GA::Engine<Individual>::getSelection() const {
return this->selection;
}
template<class Individual>
size_t GA::Engine<Individual>::getPopulationSize() const {
return this->populationSize;
}
template<class Individual>
void GA::Engine<Individual>::setObjective(GA::Objective<Individual> &objective) {
this->objective = objective;
}
template<class Individual>
void GA::Engine<Individual>::setCrossover(GA::Crossover<Individual> &crossover) {
this->crossover = crossover;
}
template<class Individual>
void GA::Engine<Individual>::setMutation(GA::Mutation<Individual> &mutation) {
this->mutation = mutation;
}
template<class Individual>
void GA::Engine<Individual>::setSelection(GA::Selection<Individual> &selection) {
this->selection = selection;
}
template<class Individual>
void GA::Engine<Individual>::setPopulationSize(size_t populationSize) {
assert(populationSize != 0);
this->populationSize = populationSize;
}
template<class Individual>
void GA::Engine<Individual>::initialize() {
population.clear();
Individual individual;
for (size_t i = populationSize; i != 0; --i) {
individual.randomize();
population.emplace(objective(individual), individual);
}
}
template<class Individual>
void GA::Engine<Individual>::initialize(size_t populationSize) {
assert(populationSize != 0);
this->setPopulationSize(populationSize);
return this->initialize();
}
template<class Individual>
double GA::Engine<Individual>::step() {
return this->step(1);
}
template<class Individual>
double GA::Engine<Individual>::step(unsigned int numberStep) {
typename Population::iterator it1, it2;
std::uniform_int_distribution<size_t> unif_distrib(0,population.size()*(population.size()+1)/2);
Individual individual;
Population new_population;
for (unsigned int i = numberStep; i != 0; --i) {
new_population = selection(population);
while (new_population.size() < populationSize) {
it1 = population.begin();
it2 = population.begin();
/*
* We choose random parents after the following probability distribution :
* P(i) = (n-i) / (n(n+1)/2)
*/
std::advance(it1, population.size() - std::floor(std::sqrt(1+8*unif_distrib(rnd))-1.5));
std::advance(it2, population.size() - std::floor(std::sqrt(1+8*unif_distrib(rnd))-1.5));
individual = mutation(crossover(it1->second, it2->second));
new_population.emplace(objective(individual), individual);
}
std::swap(new_population, population);
}
return population.cbegin()->first;
}
template<class Individual>
double GA::Engine<Individual>::getScore() const {
return population.cbegin()->first;
}
template<class Individual>
const Individual GA::Engine<Individual>::getBest() const {
return population.cbegin()->second;
}
template<class Individual>
double GA::Engine<Individual>::getMean() const {
return this->getMean(population.size());
}
template<class Individual>
double GA::Engine<Individual>::getMean(size_t count) const {
assert(count <= population.size());
double total = 0.;
auto it = population.cbegin();
for (int i = 0; i < count; ++i) {
total += it->first;
it++;
}
return total / count;
}
template<class Individual>
double GA::Engine<Individual>::getStandardDeviation() const {
return getStandardDeviation(population.size());
}
template<class Individual>
double GA::Engine<Individual>::getStandardDeviation(size_t count) const {
assert(count <= population.size());
double mean = 0.;
double meanOfSquares = 0.;
auto it = population.cbegin();
for (size_t i = 0; i < count; ++i) {
meanOfSquares += it->first * it->first;
mean += it->first;
it++;
}
meanOfSquares /= count;
mean /= count;
return std::sqrt(meanOfSquares - mean*mean);
}
| 29.02907
| 100
| 0.667134
|
Kaylier
|
a1819445da06e968d3cc2ed37345369c644bd4ae
| 24
|
cpp
|
C++
|
tools/databuffer.cpp
|
mihajlo2003petkovic/MeteorDemod
|
d7cbd842d1b31b0985ebb0581689afc7435d0684
|
[
"MIT"
] | 15
|
2020-12-17T17:14:37.000Z
|
2022-03-24T11:09:18.000Z
|
tools/databuffer.cpp
|
mihajlo2003petkovic/MeteorDemod
|
d7cbd842d1b31b0985ebb0581689afc7435d0684
|
[
"MIT"
] | 11
|
2021-01-17T00:40:12.000Z
|
2022-02-02T17:21:07.000Z
|
tools/databuffer.cpp
|
mihajlo2003petkovic/MeteorDemod
|
d7cbd842d1b31b0985ebb0581689afc7435d0684
|
[
"MIT"
] | 5
|
2021-02-08T12:37:57.000Z
|
2022-01-23T09:39:59.000Z
|
#include "databuffer.h"
| 12
| 23
| 0.75
|
mihajlo2003petkovic
|
a182e3162226097ce0bd1dfa369de8ad53ff48b2
| 16,293
|
hpp
|
C++
|
data_compression/L1/include/hw/lz4_compress.hpp
|
KitAway/Vitis_Libraries
|
208ada169cd8ddeac0d26b2568343fab6f968331
|
[
"Apache-2.0"
] | 1
|
2021-06-14T17:02:06.000Z
|
2021-06-14T17:02:06.000Z
|
data_compression/L1/include/hw/lz4_compress.hpp
|
KitAway/Vitis_Libraries
|
208ada169cd8ddeac0d26b2568343fab6f968331
|
[
"Apache-2.0"
] | null | null | null |
data_compression/L1/include/hw/lz4_compress.hpp
|
KitAway/Vitis_Libraries
|
208ada169cd8ddeac0d26b2568343fab6f968331
|
[
"Apache-2.0"
] | null | null | null |
/*
* (c) Copyright 2019 Xilinx, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _XFCOMPRESSION_LZ4_COMPRESS_HPP_
#define _XFCOMPRESSION_LZ4_COMPRESS_HPP_
/**
* @file lz4_compress.hpp
* @brief Header for modules used in LZ4 compression kernel.
*
* This file is part of Vitis Data Compression Library.
*/
#include "hls_stream.h"
#include <ap_int.h>
#include <fstream>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include "lz_compress.hpp"
#include "lz_optional.hpp"
#include "mm2s.hpp"
#include "s2mm.hpp"
#include "stream_downsizer.hpp"
#include "stream_upsizer.hpp"
typedef ap_uint<64> lz4_compressd_dt;
typedef ap_uint<32> compressd_dt;
typedef ap_uint<8> encodedData_t;
const int c_gmemBurstSize = 32;
namespace xf {
namespace compression {
namespace details {
template <int MAX_LIT_COUNT, int PARALLEL_UNITS>
static void lz4CompressPart1(hls::stream<compressd_dt>& inStream,
hls::stream<uint8_t>& lit_outStream,
hls::stream<lz4_compressd_dt>& lenOffset_Stream,
uint32_t input_size,
uint32_t max_lit_limit[PARALLEL_UNITS],
uint32_t index) {
if (input_size == 0) return;
uint8_t match_len = 0;
uint32_t lit_count = 0;
uint32_t lit_count_flag = 0;
compressd_dt nextEncodedValue = inStream.read();
lz4_divide:
for (uint32_t i = 0; i < input_size;) {
#pragma HLS PIPELINE II = 1
compressd_dt tmpEncodedValue = nextEncodedValue;
if (i < (input_size - 1)) nextEncodedValue = inStream.read();
uint8_t tCh = tmpEncodedValue.range(7, 0);
uint8_t tLen = tmpEncodedValue.range(15, 8);
uint16_t tOffset = tmpEncodedValue.range(31, 16);
uint32_t match_offset = tOffset;
if (lit_count >= MAX_LIT_COUNT) {
lit_count_flag = 1;
} else if (tLen) {
uint8_t match_len = tLen - 4; // LZ4 standard
lz4_compressd_dt tmpValue;
tmpValue.range(63, 32) = lit_count;
tmpValue.range(15, 0) = match_len;
tmpValue.range(31, 16) = match_offset;
lenOffset_Stream << tmpValue;
match_len = tLen - 1;
lit_count = 0;
} else {
lit_outStream << tCh;
lit_count++;
}
if (tLen)
i += tLen;
else
i += 1;
}
if (lit_count) {
lz4_compressd_dt tmpValue;
tmpValue.range(63, 32) = lit_count;
if (lit_count == MAX_LIT_COUNT) {
lit_count_flag = 1;
tmpValue.range(15, 0) = 777;
tmpValue.range(31, 16) = 777;
} else {
tmpValue.range(15, 0) = 0;
tmpValue.range(31, 16) = 0;
}
lenOffset_Stream << tmpValue;
}
max_lit_limit[index] = lit_count_flag;
}
static void lz4CompressPart2(hls::stream<uint8_t>& in_lit_inStream,
hls::stream<lz4_compressd_dt>& in_lenOffset_Stream,
hls::stream<ap_uint<8> >& outStream,
hls::stream<bool>& endOfStream,
hls::stream<uint32_t>& compressdSizeStream,
uint32_t input_size) {
// LZ4 Compress STATES
enum lz4CompressStates { WRITE_TOKEN, WRITE_LIT_LEN, WRITE_MATCH_LEN, WRITE_LITERAL, WRITE_OFFSET0, WRITE_OFFSET1 };
uint32_t lit_len = 0;
uint16_t outCntr = 0;
uint32_t compressedSize = 0;
enum lz4CompressStates next_state = WRITE_TOKEN;
uint16_t lit_length = 0;
uint16_t match_length = 0;
uint16_t write_lit_length = 0;
ap_uint<16> match_offset = 0;
bool lit_ending = false;
bool extra_match_len = false;
lz4_compress:
for (uint32_t inIdx = 0; (inIdx < input_size) || (next_state != WRITE_TOKEN);) {
#pragma HLS PIPELINE II = 1
ap_uint<8> outValue;
if (next_state == WRITE_TOKEN) {
lz4_compressd_dt tmpValue = in_lenOffset_Stream.read();
lit_length = tmpValue.range(63, 32);
match_length = tmpValue.range(15, 0);
match_offset = tmpValue.range(31, 16);
inIdx += match_length + lit_length + 4;
if (match_length == 777 && match_offset == 777) {
inIdx = input_size;
lit_ending = true;
}
lit_len = lit_length;
write_lit_length = lit_length;
if (match_offset == 0 && match_length == 0) {
lit_ending = true;
}
if (lit_length >= 15) {
outValue.range(7, 4) = 15;
lit_length -= 15;
next_state = WRITE_LIT_LEN;
} else if (lit_length) {
outValue.range(7, 4) = lit_length;
lit_length = 0;
next_state = WRITE_LITERAL;
} else {
outValue.range(7, 4) = 0;
next_state = WRITE_OFFSET0;
}
if (match_length >= 15) {
outValue.range(3, 0) = 15;
match_length -= 15;
extra_match_len = true;
} else {
outValue.range(3, 0) = match_length;
match_length = 0;
extra_match_len = false;
}
} else if (next_state == WRITE_LIT_LEN) {
if (lit_length >= 255) {
outValue = 255;
lit_length -= 255;
} else {
outValue = lit_length;
next_state = WRITE_LITERAL;
}
} else if (next_state == WRITE_LITERAL) {
outValue = in_lit_inStream.read();
write_lit_length--;
if (write_lit_length == 0) {
if (lit_ending) {
next_state = WRITE_TOKEN;
} else {
next_state = WRITE_OFFSET0;
}
}
} else if (next_state == WRITE_OFFSET0) {
match_offset++; // LZ4 standard
outValue = match_offset.range(7, 0);
next_state = WRITE_OFFSET1;
} else if (next_state == WRITE_OFFSET1) {
outValue = match_offset.range(15, 8);
if (extra_match_len) {
next_state = WRITE_MATCH_LEN;
} else {
next_state = WRITE_TOKEN;
}
} else if (next_state == WRITE_MATCH_LEN) {
if (match_length >= 255) {
outValue = 255;
match_length -= 255;
} else {
outValue = match_length;
next_state = WRITE_TOKEN;
}
}
if (compressedSize < input_size) {
// Limiting compression size not more than input size.
// Host code should ignore such blocks
outStream << outValue;
endOfStream << 0;
compressedSize++;
}
}
compressdSizeStream << compressedSize;
outStream << 0;
endOfStream << 1;
}
} // namespace compression
} // namespace xf
} // namespace details
namespace xf {
namespace compression {
/**
* @brief This is the core compression module which seperates the input stream into two
* output streams, one literal stream and other offset stream, then lz4 encoding is done.
*
* @param inStream Input data stream
* @param outStream Output data stream
* @param max_lit_limit Size for compressed stream
* @param input_size Size of input data
* @param endOfStream Stream indicating that all data is processed or not
* @param compressdSizeStream Gives the compressed size for each 64K block
*
*/
template <int MAX_LIT_COUNT, int PARALLEL_UNITS>
static void lz4Compress(hls::stream<compressd_dt>& inStream,
hls::stream<ap_uint<8> >& outStream,
uint32_t max_lit_limit[PARALLEL_UNITS],
uint32_t input_size,
hls::stream<bool>& endOfStream,
hls::stream<uint32_t>& compressdSizeStream,
uint32_t index) {
hls::stream<uint8_t> lit_outStream("lit_outStream");
hls::stream<lz4_compressd_dt> lenOffset_Stream("lenOffset_Stream");
#pragma HLS STREAM variable = lit_outStream depth = MAX_LIT_COUNT
#pragma HLS STREAM variable = lenOffset_Stream depth = c_gmemBurstSize
#pragma HLS RESOURCE variable = lenOffset_Stream core = FIFO_SRL
#pragma HLS dataflow
details::lz4CompressPart1<MAX_LIT_COUNT, PARALLEL_UNITS>(inStream, lit_outStream, lenOffset_Stream, input_size,
max_lit_limit, index);
details::lz4CompressPart2(lit_outStream, lenOffset_Stream, outStream, endOfStream, compressdSizeStream, input_size);
}
template <class data_t,
int DATAWIDTH = 512,
int BURST_SIZE = 16,
int NUM_BLOCK = 8,
int M_LEN = 6,
int MIN_MAT = 4,
int LZ_MAX_OFFSET_LIM = 65536,
int OFFSET_WIN = 65536,
int MAX_M_LEN = 255,
int MAX_LIT_CNT = 4096,
int MIN_B_SIZE = 128>
void hlsLz4Core(hls::stream<data_t>& inStream,
hls::stream<data_t>& outStream,
hls::stream<bool>& outStreamEos,
hls::stream<uint32_t>& compressedSize,
uint32_t max_lit_limit[NUM_BLOCK],
uint32_t input_size,
uint32_t core_idx) {
hls::stream<xf::compression::compressd_dt> compressdStream("compressdStream");
hls::stream<xf::compression::compressd_dt> bestMatchStream("bestMatchStream");
hls::stream<xf::compression::compressd_dt> boosterStream("boosterStream");
#pragma HLS STREAM variable = compressdStream depth = 8
#pragma HLS STREAM variable = bestMatchStream depth = 8
#pragma HLS STREAM variable = boosterStream depth = 8
#pragma HLS RESOURCE variable = compressdStream core = FIFO_SRL
#pragma HLS RESOURCE variable = boosterStream core = FIFO_SRL
#pragma HLS dataflow
xf::compression::lzCompress<M_LEN, MIN_MAT, LZ_MAX_OFFSET_LIM>(inStream, compressdStream, input_size);
xf::compression::lzBestMatchFilter<M_LEN, OFFSET_WIN>(compressdStream, bestMatchStream, input_size);
xf::compression::lzBooster<MAX_M_LEN>(bestMatchStream, boosterStream, input_size);
xf::compression::lz4Compress<MAX_LIT_CNT, NUM_BLOCK>(boosterStream, outStream, max_lit_limit, input_size,
outStreamEos, compressedSize, core_idx);
}
template <class data_t,
int DATAWIDTH = 512,
int BURST_SIZE = 16,
int NUM_BLOCK = 8,
int M_LEN = 6,
int MIN_MAT = 4,
int LZ_MAX_OFFSET_LIM = 65536,
int OFFSET_WIN = 65536,
int MAX_M_LEN = 255,
int MAX_LIT_CNT = 4096,
int MIN_B_SIZE = 128>
void hlsLz4(const data_t* in,
data_t* out,
const uint32_t input_idx[NUM_BLOCK],
const uint32_t output_idx[NUM_BLOCK],
const uint32_t input_size[NUM_BLOCK],
uint32_t output_size[NUM_BLOCK],
uint32_t max_lit_limit[NUM_BLOCK]) {
hls::stream<encodedData_t> inStream[NUM_BLOCK];
hls::stream<bool> outStreamEos[NUM_BLOCK];
hls::stream<encodedData_t> outStream[NUM_BLOCK];
#pragma HLS STREAM variable = outStreamEos depth = 2
#pragma HLS STREAM variable = inStream depth = c_gmemBurstSize
#pragma HLS STREAM variable = outStream depth = c_gmemBurstSize
#pragma HLS RESOURCE variable = outStreamEos core = FIFO_SRL
#pragma HLS RESOURCE variable = inStream core = FIFO_SRL
#pragma HLS RESOURCE variable = outStream core = FIFO_SRL
hls::stream<uint32_t> compressedSize[NUM_BLOCK];
#pragma HLS dataflow
xf::compression::details::mm2multStreamSize<8, NUM_BLOCK, DATAWIDTH, BURST_SIZE>(in, input_idx, inStream,
input_size);
for (uint8_t i = 0; i < NUM_BLOCK; i++) {
#pragma HLS UNROLL
// lz4Core is instantiated based on the NUM_BLOCK
hlsLz4Core<encodedData_t, DATAWIDTH, BURST_SIZE, NUM_BLOCK>(inStream[i], outStream[i], outStreamEos[i],
compressedSize[i], max_lit_limit, input_size[i], i);
}
xf::compression::details::multStream2MM<8, NUM_BLOCK, DATAWIDTH, BURST_SIZE>(
outStream, outStreamEos, compressedSize, output_idx, out, output_size);
}
template <class data_t,
int DATAWIDTH = 512,
int BURST_SIZE = 16,
int NUM_BLOCK = 8,
int M_LEN = 6,
int MIN_MAT = 4,
int LZ_MAX_OFFSET_LIM = 65536,
int OFFSET_WIN = 65536,
int MAX_M_LEN = 255,
int MAX_LIT_CNT = 4096,
int MIN_B_SIZE = 128>
void lz4CompressMM(const data_t* in, data_t* out, uint32_t* compressd_size, const uint32_t input_size) {
uint32_t block_idx = 0;
uint32_t block_length = 64 * 1024;
uint32_t no_blocks = (input_size - 1) / block_length + 1;
uint32_t max_block_size = 64 * 1024;
uint32_t readBlockSize = 0;
bool small_block[NUM_BLOCK];
uint32_t input_block_size[NUM_BLOCK];
uint32_t input_idx[NUM_BLOCK];
uint32_t output_idx[NUM_BLOCK];
uint32_t output_block_size[NUM_BLOCK];
uint32_t max_lit_limit[NUM_BLOCK];
uint32_t small_block_inSize[NUM_BLOCK];
#pragma HLS ARRAY_PARTITION variable = input_block_size dim = 0 complete
#pragma HLS ARRAY_PARTITION variable = input_idx dim = 0 complete
#pragma HLS ARRAY_PARTITION variable = output_idx dim = 0 complete
#pragma HLS ARRAY_PARTITION variable = output_block_size dim = 0 complete
#pragma HLS ARRAY_PARTITION variable = max_lit_limit dim = 0 complete
// Figure out total blocks & block sizes
for (uint32_t i = 0; i < no_blocks; i += NUM_BLOCK) {
uint32_t nblocks = NUM_BLOCK;
if ((i + NUM_BLOCK) > no_blocks) {
nblocks = no_blocks - i;
}
for (uint32_t j = 0; j < NUM_BLOCK; j++) {
if (j < nblocks) {
uint32_t inBlockSize = block_length;
if (readBlockSize + block_length > input_size) inBlockSize = input_size - readBlockSize;
if (inBlockSize < MIN_B_SIZE) {
small_block[j] = 1;
small_block_inSize[j] = inBlockSize;
input_block_size[j] = 0;
input_idx[j] = 0;
} else {
small_block[j] = 0;
input_block_size[j] = inBlockSize;
readBlockSize += inBlockSize;
input_idx[j] = (i + j) * max_block_size;
output_idx[j] = (i + j) * max_block_size;
}
} else {
input_block_size[j] = 0;
input_idx[j] = 0;
}
output_block_size[j] = 0;
max_lit_limit[j] = 0;
}
// Call for parallel compression
hlsLz4<data_t, DATAWIDTH, BURST_SIZE, NUM_BLOCK>(in, out, input_idx, output_idx, input_block_size,
output_block_size, max_lit_limit);
for (uint32_t k = 0; k < nblocks; k++) {
if (max_lit_limit[k]) {
compressd_size[block_idx] = input_block_size[k];
} else {
compressd_size[block_idx] = output_block_size[k];
}
if (small_block[k] == 1) {
compressd_size[block_idx] = small_block_inSize[k];
}
block_idx++;
}
}
}
} // namespace compression
} // namespace xf
#endif // _XFCOMPRESSION_LZ4_COMPRESS_HPP_
| 37.628176
| 120
| 0.595164
|
KitAway
|
a1851846bfb5782d4de2c1902ce8590d8d87fa45
| 1,078
|
cpp
|
C++
|
aws-cpp-sdk-grafana/source/model/AwsSsoAuthentication.cpp
|
perfectrecall/aws-sdk-cpp
|
fb8cbebf2fd62720b65aeff841ad2950e73d8ebd
|
[
"Apache-2.0"
] | 1
|
2022-02-12T08:09:30.000Z
|
2022-02-12T08:09:30.000Z
|
aws-cpp-sdk-grafana/source/model/AwsSsoAuthentication.cpp
|
perfectrecall/aws-sdk-cpp
|
fb8cbebf2fd62720b65aeff841ad2950e73d8ebd
|
[
"Apache-2.0"
] | 1
|
2022-01-03T23:59:37.000Z
|
2022-01-03T23:59:37.000Z
|
aws-cpp-sdk-grafana/source/model/AwsSsoAuthentication.cpp
|
ravindra-wagh/aws-sdk-cpp
|
7d5ff01b3c3b872f31ca98fb4ce868cd01e97696
|
[
"Apache-2.0"
] | 1
|
2021-11-09T11:58:03.000Z
|
2021-11-09T11:58:03.000Z
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/grafana/model/AwsSsoAuthentication.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
namespace Aws
{
namespace ManagedGrafana
{
namespace Model
{
AwsSsoAuthentication::AwsSsoAuthentication() :
m_ssoClientIdHasBeenSet(false)
{
}
AwsSsoAuthentication::AwsSsoAuthentication(JsonView jsonValue) :
m_ssoClientIdHasBeenSet(false)
{
*this = jsonValue;
}
AwsSsoAuthentication& AwsSsoAuthentication::operator =(JsonView jsonValue)
{
if(jsonValue.ValueExists("ssoClientId"))
{
m_ssoClientId = jsonValue.GetString("ssoClientId");
m_ssoClientIdHasBeenSet = true;
}
return *this;
}
JsonValue AwsSsoAuthentication::Jsonize() const
{
JsonValue payload;
if(m_ssoClientIdHasBeenSet)
{
payload.WithString("ssoClientId", m_ssoClientId);
}
return payload;
}
} // namespace Model
} // namespace ManagedGrafana
} // namespace Aws
| 17.966667
| 74
| 0.74397
|
perfectrecall
|
a186079e4da2710a643d8e100ca6d292be8f63d9
| 492
|
cpp
|
C++
|
huemodule.std/std.cpp
|
HueStudios/HueLang
|
3b89d6d88c6b61cc5cd94017280821d2571338e5
|
[
"MIT"
] | 5
|
2020-06-26T08:54:26.000Z
|
2020-06-26T16:58:17.000Z
|
huemodule.std/std.cpp
|
HueStudios/HueLang
|
3b89d6d88c6b61cc5cd94017280821d2571338e5
|
[
"MIT"
] | 3
|
2020-04-28T14:38:26.000Z
|
2020-05-21T13:41:34.000Z
|
huemodule.std/std.cpp
|
HueStudios/HueLang
|
3b89d6d88c6b61cc5cd94017280821d2571338e5
|
[
"MIT"
] | null | null | null |
#include "std.h"
extern "C" void ModuleEntry(Environment *env) {
cout << "Std library loaded" << endl;
Word helloword = env->definitionTable.TokToWord("hello");
env->AddPrimaryDefinition(helloword, &__hello);
}
void __hello(Environment& env) {
cout << "This word was added by the STD lib" << endl;
for (int i = 0; i < env.valueStack.size(); i++) {
cout << i << " : " << env.definitionTable.GetName(((WordValue*)env.valueStack.c[i])->contained) << endl;
}
}
| 30.75
| 112
| 0.628049
|
HueStudios
|
a18707911d335e2d6166b905c0e01bde5c02763e
| 13,501
|
cpp
|
C++
|
benchmark/testv5.cpp
|
shubhamsingh91/Pinocchio_ss
|
683f6d1ea445cf65e74056f2b18eb65a4151ff0f
|
[
"BSD-2-Clause-FreeBSD"
] | 2
|
2021-06-30T18:01:31.000Z
|
2021-06-30T21:49:06.000Z
|
benchmark/testv5.cpp
|
shubhamsingh91/Pinocchio_ss
|
683f6d1ea445cf65e74056f2b18eb65a4151ff0f
|
[
"BSD-2-Clause-FreeBSD"
] | null | null | null |
benchmark/testv5.cpp
|
shubhamsingh91/Pinocchio_ss
|
683f6d1ea445cf65e74056f2b18eb65a4151ff0f
|
[
"BSD-2-Clause-FreeBSD"
] | null | null | null |
// same as testv4 but saves time values as texts and can run for all cases
// checking some boost options, ABA forward dynamics etc.
#include "pinocchio/algorithm/joint-configuration.hpp"
#include "pinocchio/algorithm/cholesky.hpp"
#include "pinocchio/parsers/urdf.hpp"
#include "pinocchio/parsers/sample-models.hpp"
#include "pinocchio/container/aligned-vector.hpp"
#include "pinocchio/algorithm/azamat.hpp"
#include "pinocchio/algorithm/azamat_v2.hpp"
#include "pinocchio/algorithm/azamat_v3.hpp"
#include "pinocchio/algorithm/azamat_v4.hpp"
#include "pinocchio/utils/timer.hpp"
#include "pinocchio/algorithm/aba-derivatives.hpp"
#include "pinocchio/algorithm/rnea-derivatives.hpp"
#include "pinocchio/algorithm/azamat_v4.hpp"
#include "pinocchio/algorithm/rnea-derivatives-faster.hpp"
#include "pinocchio/algorithm/aba_v2.hpp"
#include <iostream>
#include <fstream>
#include <string>
#include <iostream>
#include <ctime>
//-----------------Running ABA first---- //
using namespace std;
int main(int argc, const char ** argv)
{
using namespace Eigen;
using namespace pinocchio;
PinocchioTicToc timer(PinocchioTicToc::US);
#ifdef NDEBUG
int NBT= 100*1000; // 50000 initially
#else
int NBT = 1;
std::cout << "(the time score in debug mode is not relevant) " << std::endl;
#endif
// std::cout << "Enter NBT" << std::endl;
// cin >> NBT;
Model model;
string str_urdf;
string str_robotname[10];
string str_file_ext;
string robot_name="";
int str_int;
//str_int = 0; // integer to change the str_urdf
cout << "Enter the str_int here" << endl;
cin >> str_int;
str_robotname[0] = "double_pendulum"; // double pendulum
str_robotname[1] = "ur3_robot"; // UR3
str_robotname[2] = "ur5_robot"; // UR5
str_robotname[3] = "ur10_robot"; // UR10
str_robotname[4] = "kuka_peg_lwr"; // kuka
str_robotname[5] = "anymal"; // anymal
str_robotname[6] = "hyq"; // hyq
str_robotname[7] = "baxter_simple"; // baxter
str_robotname[8] = "atlas"; //atlas
str_robotname[9] = "simple_humanoid"; //simple humanoid
robot_name = str_robotname[str_int];
str_file_ext = "/home/ss86299/Desktop/test_pinocchio/pinocchio/models/";
str_urdf.append(str_file_ext);
str_urdf.append(robot_name);
str_urdf.append(".urdf");
std :: string filename = str_urdf;
if(argc>1) filename = argv[1];
bool with_ff = false; // true originally
if ((str_int >4)&&(str_int<11))
{
with_ff = true; // True for anymal and atlas
}
if (str_int==7)
{
with_ff = false; // False for Baxter
}
if(argc>2)
{
const std::string ff_option = argv[2];
if(ff_option == "-no-ff")
with_ff = false;
}
if( filename == "HS")
buildModels::humanoidRandom(model,true);
else
if(with_ff)
pinocchio::urdf::buildModel(filename,JointModelFreeFlyer(),model);
// pinocchio::urdf::buildModel(filename,JointModelRX(),model);
else
pinocchio::urdf::buildModel(filename,model);
cout << "with ff = " << with_ff << "\n \n";
std::cout << "nq = " << model.nq << std::endl;
std::cout << "nv = " << model.nv << std::endl;
cout << "Model is" << robot_name << endl;
//-- opening filename here
string filewrite="";
ofstream file1;
filewrite.append(robot_name);
filewrite.append(".txt");
file1.open(filewrite);
Data data(model);
VectorXd qmax = Eigen::VectorXd::Ones(model.nq);
PINOCCHIO_ALIGNED_STD_VECTOR(VectorXd) qs (NBT);
PINOCCHIO_ALIGNED_STD_VECTOR(VectorXd) qdots (NBT);
PINOCCHIO_ALIGNED_STD_VECTOR(VectorXd) taus (NBT);
PINOCCHIO_ALIGNED_STD_VECTOR(VectorXd) qddots (NBT);
PINOCCHIO_ALIGNED_STD_VECTOR(MatrixXd) tau_mat (NBT);
PINOCCHIO_ALIGNED_STD_VECTOR(MatrixXd) tau_mat_n2n (NBT);
PINOCCHIO_ALIGNED_STD_VECTOR(MatrixXd) tau_mat_n2n_v2 (NBT);
PINOCCHIO_ALIGNED_STD_VECTOR(MatrixXd) tau_mat_n2n_v3 (NBT);
// MatrixXd tau_mat(MatrixXd::Identity(model.nv,model.nv));
// randomizing input data here
std:: cout << "NBT variable is" << NBT << endl;
for(size_t i=0;i<NBT;++i)
{
qs[i] = randomConfiguration(model,-qmax,qmax);
qdots[i] = Eigen::VectorXd::Random(model.nv);
taus[i] = Eigen::VectorXd::Random(model.nv);
qddots[i] = Eigen::VectorXd::Random(model.nv);
tau_mat_n2n[i] = Eigen::MatrixXd::Identity(model.nv,2*model.nv);
tau_mat_n2n_v2[i] = Eigen::MatrixXd::Identity(model.nv,2*model.nv);
tau_mat_n2n_v3[i] = Eigen::MatrixXd::Identity(model.nv,2*model.nv);
}
double time_ABA[9];
//----------------------------------------------------//
// Compute RNEA derivatives here ---------------------//
//----------------------------------------------------//
PINOCCHIO_EIGEN_PLAIN_ROW_MAJOR_TYPE(MatrixXd) drnea_dq(MatrixXd::Zero(model.nv,model.nv));
PINOCCHIO_EIGEN_PLAIN_ROW_MAJOR_TYPE(MatrixXd) drnea_dv(MatrixXd::Zero(model.nv,model.nv));
MatrixXd drnea_da(MatrixXd::Zero(model.nv,model.nv));
timer.tic();
SMOOTH(NBT)
{
computeRNEADerivatives(model,data,qs[_smooth],qdots[_smooth],qddots[_smooth],
drnea_dq,drnea_dv,drnea_da);
}
time_ABA[1] = timer.toc()/NBT; // RNEA timing
std::cout << "RNEA derivatives= \t\t" << time_ABA[1] << std::endl;
// for( int ll=0; ll<model.nv ; ll++)
// {
// std::cout << "tau[i] is" << data.tau[ll] <<std::endl;
// std::cout << "v[i] is" << data.v[ll] <<std::endl;
// std::cout << "a[i] is" << data.a[ll] << std::endl;
// }
//----------------------------------------------------//
// Compute RNEA derivatives faster--------------------//
//----------------------------------------------------//
PINOCCHIO_EIGEN_PLAIN_ROW_MAJOR_TYPE(MatrixXd) drnea2_dq(MatrixXd::Zero(model.nv,model.nv));
PINOCCHIO_EIGEN_PLAIN_ROW_MAJOR_TYPE(MatrixXd) drnea2_dv(MatrixXd::Zero(model.nv,model.nv));
MatrixXd drnea2_da(MatrixXd::Zero(model.nv,model.nv));
timer.tic();
SMOOTH(NBT)
{
computeRNEADerivativesFaster(model,data,qs[_smooth],qdots[_smooth],qddots[_smooth],
drnea2_dq,drnea2_dv,drnea2_da);
}
time_ABA[2] = timer.toc()/NBT; // RNEAF timing
std::cout << "RNEA derivativeF= \t\t" << time_ABA[2] << std::endl;
// for( int ll=0; ll<model.nv ; ll++)
// {
// std::cout << "tau[i] is" << data.tau[ll] <<std::endl;
// std::cout << "v[i] is" << data.v[ll] <<std::endl;
// std::cout << "a[i] is" << data.a[ll] << std::endl;
// }
//-- comparing the RNEA and RNEA F derivatives here
// std::cout << "----------------------------------------------" <<std::endl;
// std::cout << "comparison of RNEA derivatives here" << std::endl;
// std::cout << "difference in dtau_dq is" << (drnea2_dq-drnea_dq).squaredNorm() << std::endl;
// std::cout << "difference in dtau_dqd is" << (drnea2_dv-drnea_dv).squaredNorm() << std::endl;
// std::cout << "----------------------------------------------" <<std::endl;
//-----------------------------------------------------//
//------------- Minv_v2 with AZAmat_v4 here------------//
//-----------------------------------------------------//
tau_mat_n2n_v3[0] << -drnea_dq,-drnea_dv; // concatenating partial wrt q and qdot
timer.tic();
SMOOTH(NBT)
{
computeMinverse_v2(model,data,qs[_smooth],tau_mat_n2n_v3[_smooth]);
}
time_ABA[6] = timer.toc()/NBT; // Minv timing
std::cout << "Minv_v2 =\t\t" << time_ABA[6]<< std::endl;
//-----------------------------------------------------//
//------------- Minv here------------------------------//
//-----------------------------------------------------//
timer.tic();
SMOOTH(NBT)
{
computeMinverse(model,data,qs[_smooth]);
}
time_ABA[0] = timer.toc()/NBT; // Minv timing
std::cout << "Minv =\t\t" << time_ABA[0]<< std::endl;
// std::cout << "Minv =\t\t"; timer.toc(std::cout,NBT);
// Filling the Minv matrix here
for (int ii=0; ii < model.nv ;ii++)
{
for (int jj=0; jj<ii; jj++)
{
if (ii!=jj)
{
data.Minv.coeffRef(ii,jj) = data.Minv.coeffRef(jj,ii);
}
}
}
//-----------------------------------------------------------------//
// FD partials using AZAmat_v3/4 function here---------------------//
//-----------------------------------------------------------------//
// tau_mat_n2n_v3[0] << -drnea_dq,-drnea_dv; // concatenating partial wrt q and qdot
// // std::cout<< "tau_mat_n2n_v3 is" << tau_mat_n2n_v3[0] << std::endl;
// timer.tic();
// SMOOTH(NBT)
// azamat_v4(model,data,qs[_smooth],tau_mat_n2n_v3[_smooth]);
// time_ABA[6] = timer.toc()/NBT;
// std::cout << "IPR using AZA_mat_v4 method is = \t\t" << time_ABA[6] << std::endl;
// std::cout <<"---------------------------------------" << endl;
//----------------------------------------------------//
// Calculate ABA derivatives here
//----------------------------------------------------//
PINOCCHIO_EIGEN_PLAIN_ROW_MAJOR_TYPE(MatrixXd) daba_dq(MatrixXd::Zero(model.nv,model.nv));
PINOCCHIO_EIGEN_PLAIN_ROW_MAJOR_TYPE(MatrixXd) daba_dv(MatrixXd::Zero(model.nv,model.nv));
MatrixXd daba_dtau(MatrixXd::Zero(model.nv,model.nv));
taus[0] = data.tau;
timer.tic();
SMOOTH(NBT)
{
computeABADerivatives(model,data,qs[_smooth],qdots[_smooth],taus[_smooth],
daba_dq,daba_dv,daba_dtau);
}
time_ABA[3] = timer.toc()/NBT; // ABA derivatives timing
// std::cout << "ABA derivatives= \t\t"; timer.toc(std::cout,NBT);
std::cout << "ABA derivatives= \t\t" << time_ABA[3] << endl;
//-----------------------------------------------------------------//
// FD partials using DMM here -------------------------------------//
//-----------------------------------------------------------------//
MatrixXd aba_partial_dq(MatrixXd::Zero(model.nv,model.nv));
MatrixXd aba_partial_dv(MatrixXd::Zero(model.nv,model.nv));
timer.tic();
for (int kk=0; kk<NBT; kk++)
{
aba_partial_dq = -data.Minv*drnea_dq;
aba_partial_dv = -data.Minv*drnea_dv;
}
time_ABA[7] = timer.toc()/NBT; // DMM timing
std::cout << "DMM= \t\t" << time_ABA[7] << std::endl;
//-----------------------------------------------------------------//
// FD partials using AZAmat function here--------------------------//
//-----------------------------------------------------------------//
tau_mat_n2n[0] << -drnea_dq,-drnea_dv; // concatenating partial wrt q and qdot
timer.tic();
SMOOTH(NBT)
azamat(model,data,qs[_smooth],qdots[_smooth],tau_mat_n2n[_smooth]);
time_ABA[4] = timer.toc()/NBT;
// std::cout << "IPR using AZA_mat method is = \t\t" ;timer.toc(std::cout,NBT);
std::cout << "IPR using AZA_mat method is = \t\t" << time_ABA[4] << endl;
// std::cout << "Minvmat_v1 is" << data.Minv_mat_prod << std::endl;
std::cout << "---------------------------------------" << endl;
//---------------------------------------------------//
//---------Comparison of results here----------------//
//---------------------------------------------------//
// MatrixXd diff_daba_dq2(MatrixXd::Zero(model.nv,model.nv));
// MatrixXd diff_daba_dqd2(MatrixXd::Zero(model.nv,model.nv));
// MatrixXd diff_mat1(MatrixXd::Zero(model.nv,2*model.nv));
// MatrixXd diff_daba_dq3(MatrixXd::Zero(model.nv,model.nv));
// MatrixXd diff_daba_dqd3(MatrixXd::Zero(model.nv,model.nv));
// // comparison of ABA derivs with DMM result
// diff_daba_dq3 = daba_dq-aba_partial_dq;
// diff_daba_dqd3 = daba_dv-aba_partial_dv;
// // comparison of ABA derivs with AZAMAT_v4
// diff_daba_dq2 = daba_dq-data.Minv_mat_prod_v3.middleCols(0,model.nv);
// diff_daba_dqd2 = daba_dv-data.Minv_mat_prod_v3.middleCols(model.nv,model.nv);
// diff_mat1 = data.Minv_mat_prod - data.Minv_mat_prod_v3;
// std::cout << "------------------------------" << std::endl;
// std::cout << "Norm of the difference matrix for AZAmat_v4 FD partial wrt q from orig FD partial wrt q is " << diff_daba_dq2.squaredNorm() << std::endl;
// std::cout << "Norm of the difference matrix for AZAmat_v4 FD partial wrt qd from orig FD partial wrt qd is " << diff_daba_dqd2.squaredNorm() << std::endl;
// std::cout << "\n" << endl;
// std::cout << "Norm of difference between mat_v1 and mat_v4 is" << diff_mat1.squaredNorm() << std::endl;
// std::cout << "------------------------------" << std::endl;
// std::cout << "Norm of the difference matrix for DMM FD partial wrt q from orig FD partial wrt q is " << diff_daba_dq3.squaredNorm() << std::endl;
// std::cout << "Norm of the difference matrix for DMM FD partial wrt qd from orig FD partial wrt qd is " << diff_daba_dqd3.squaredNorm() << std::endl;
// std::cout << "\n" << endl;
//--------------------------------------------------//
//----------Writing to file ------------------------//
//--------------------------------------------------//
// Writing all the timings to the file
for (int ii=0; ii<9 ; ii++)
{
file1 << time_ABA[ii] << "\n" << endl;
}
file1.close();
return 0;
}
| 34.617949
| 161
| 0.545663
|
shubhamsingh91
|
a18a3955ba380f57baac4cf7350d64b90aa612bd
| 322
|
cpp
|
C++
|
app/app_camera/app_camera.cpp
|
yjf0602/PiApp
|
58c34b933be77106a57e15204feb340960f7ee94
|
[
"MIT"
] | null | null | null |
app/app_camera/app_camera.cpp
|
yjf0602/PiApp
|
58c34b933be77106a57e15204feb340960f7ee94
|
[
"MIT"
] | null | null | null |
app/app_camera/app_camera.cpp
|
yjf0602/PiApp
|
58c34b933be77106a57e15204feb340960f7ee94
|
[
"MIT"
] | null | null | null |
#include "app_camera.h"
App_Camera::App_Camera()
{
icon_n = cv::imread(APP_CAMERA_ICON_N);
icon_p = cv::imread(APP_CAMERA_ICON_P);
app_name = "Camera";
printf("camera icon: %d*%d\r\n", icon_n.cols, icon_n.rows);
}
App_Camera::~App_Camera()
{
}
void App_Camera::init()
{
}
void App_Camera::run()
{
}
| 12.88
| 63
| 0.649068
|
yjf0602
|
a18a801f26e67cbfdc3e26e2a50c866e66cba1b2
| 3,371
|
cpp
|
C++
|
DemoFramework/FslSimpleUI/Base/source/FslSimpleUI/Base/Control/ValueLabel.cpp
|
alejandrolozano2/OpenGL_DemoFramework
|
5fd85f05c98cc3d0c0a68bac438035df8cabaee7
|
[
"MIT",
"BSD-3-Clause"
] | 3
|
2019-01-19T20:21:24.000Z
|
2021-08-10T02:11:32.000Z
|
DemoFramework/FslSimpleUI/Base/source/FslSimpleUI/Base/Control/ValueLabel.cpp
|
alejandrolozano2/OpenGL_DemoFramework
|
5fd85f05c98cc3d0c0a68bac438035df8cabaee7
|
[
"MIT",
"BSD-3-Clause"
] | null | null | null |
DemoFramework/FslSimpleUI/Base/source/FslSimpleUI/Base/Control/ValueLabel.cpp
|
alejandrolozano2/OpenGL_DemoFramework
|
5fd85f05c98cc3d0c0a68bac438035df8cabaee7
|
[
"MIT",
"BSD-3-Clause"
] | 1
|
2021-08-10T02:11:33.000Z
|
2021-08-10T02:11:33.000Z
|
/****************************************************************************************************************************************************
* Copyright (c) 2015 Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of the Freescale Semiconductor, Inc. nor the names of
* its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************************************************************************************/
#include <FslSimpleUI/Base/Control/ValueLabel.hpp>
#include <FslBase/Exceptions.hpp>
#include <FslBase/Log/Log.hpp>
#include <cassert>
#include <cstdio>
namespace Fsl
{
using namespace std;
namespace UI
{
namespace
{
// -2147483648
// 2147483647
// 000000000011
// 123456789012
const int BUFFER_SIZE = 12;
}
ValueLabel::ValueLabel(const std::shared_ptr<WindowContext>& context)
: LabelBase(context)
{
}
void ValueLabel::SetContent(const int32_t value)
{
if (value != m_content)
{
m_content = value;
// convert to a string
char tmp[BUFFER_SIZE];
#ifdef _WIN32
int charsWritten = sprintf_s(tmp, BUFFER_SIZE, "%d", m_content);
#else
int charsWritten = snprintf(tmp, BUFFER_SIZE, "%d", m_content);
#endif
if (charsWritten < 0 || charsWritten >= BUFFER_SIZE)
throw std::invalid_argument("number conversion failed");
DoSetContent(tmp);
}
}
Vector2 ValueLabel::MeasureRenderedValue(const int32_t value)
{
// convert to a string
char tmp[BUFFER_SIZE];
#ifdef _WIN32
int charsWritten = sprintf_s(tmp, BUFFER_SIZE, "%d", value);
#else
int charsWritten = snprintf(tmp, BUFFER_SIZE, "%d", value);
#endif
if (charsWritten < 0 || charsWritten >= BUFFER_SIZE)
throw std::invalid_argument("number conversion failed");
return DoMeasureRenderedString(tmp);
}
}
}
| 35.114583
| 149
| 0.643726
|
alejandrolozano2
|
a191addd7d3e0e32781fb7b435df1c346baf5f92
| 318
|
cpp
|
C++
|
main.cpp
|
procedural/redgpu_info
|
6c2d07f1d0e418a7de983e0278e3c370954a7eed
|
[
"Apache-2.0"
] | null | null | null |
main.cpp
|
procedural/redgpu_info
|
6c2d07f1d0e418a7de983e0278e3c370954a7eed
|
[
"Apache-2.0"
] | null | null | null |
main.cpp
|
procedural/redgpu_info
|
6c2d07f1d0e418a7de983e0278e3c370954a7eed
|
[
"Apache-2.0"
] | null | null | null |
#ifdef _WIN32
#include "C:/RedGpuSDK/redgpu.h"
#endif
#ifdef __linux__
#include "/opt/RedGpuSDK/redgpu.h"
#endif
#include <stdlib.h> // For malloc, free
int main() {
RedContext context = 0;
redCreateContext(malloc, free, 0, 0, 0, RED_SDK_VERSION_1_0_135, 0, 0, 0, 0, 0, 0, 0, &context, 0, 0, 0, 0);
}
| 24.461538
| 111
| 0.650943
|
procedural
|
084d60ef1459f29bc6ae251359805bcfc4549c95
| 11,448
|
cpp
|
C++
|
symengine/tests/polynomial/test_uratpoly_flint.cpp
|
jmig5776/symengine
|
03babc5c56b047b2fe81ef6f8391d1845e6bb66c
|
[
"MIT"
] | 11
|
2020-02-15T23:54:19.000Z
|
2020-11-28T12:45:45.000Z
|
symengine/tests/polynomial/test_uratpoly_flint.cpp
|
HQSquantumsimulations/symengine
|
95d6af92dc6a759d9320d6bdadfa51d038c81218
|
[
"MIT"
] | 11
|
2015-07-18T04:13:48.000Z
|
2017-06-08T07:05:14.000Z
|
symengine/tests/polynomial/test_uratpoly_flint.cpp
|
HQSquantumsimulations/symengine
|
95d6af92dc6a759d9320d6bdadfa51d038c81218
|
[
"MIT"
] | 1
|
2020-09-10T13:08:39.000Z
|
2020-09-10T13:08:39.000Z
|
#include "catch.hpp"
#include <chrono>
#include <symengine/polys/uintpoly_flint.h>
#include <symengine/polys/uintpoly_piranha.h>
#include <symengine/polys/uratpoly.h>
#include <symengine/polys/uintpoly.h>
#include <symengine/pow.h>
#include <symengine/symengine_exception.h>
#ifdef HAVE_SYMENGINE_PIRANHA
using SymEngine::URatPolyPiranha;
#endif
using SymEngine::SymEngineException;
using SymEngine::URatPolyFlint;
using SymEngine::URatPoly;
using SymEngine::UIntPoly;
using SymEngine::Symbol;
using SymEngine::symbol;
using SymEngine::Pow;
using SymEngine::RCP;
using SymEngine::make_rcp;
using SymEngine::print_stack_on_segfault;
using SymEngine::map_uint_mpq;
using SymEngine::Basic;
using SymEngine::one;
using SymEngine::zero;
using SymEngine::integer;
using SymEngine::rational_class;
using SymEngine::add;
using namespace SymEngine::literals;
using rc = rational_class;
TEST_CASE("Constructor of URatPolyFlint", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const URatPolyFlint> P
= URatPolyFlint::from_dict(x, {{0, rc(1_z, 2_z)}, {2, rc(3_z, 2_z)}});
REQUIRE(P->__str__() == "3/2*x**2 + 1/2");
RCP<const URatPolyFlint> Q
= URatPolyFlint::from_vec(x, {0_q, rc(1_z, 2_z), rc(1_z, 2_z)});
REQUIRE(Q->__str__() == "1/2*x**2 + 1/2*x");
RCP<const URatPolyFlint> S = URatPolyFlint::from_dict(x, {{0, 2_q}});
REQUIRE(S->__str__() == "2");
RCP<const URatPolyFlint> T = URatPolyFlint::from_dict(x, map_uint_mpq{});
REQUIRE(T->__str__() == "0");
}
TEST_CASE("Adding two URatPolyFlint", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const Symbol> y = symbol("y");
RCP<const URatPolyFlint> a = URatPolyFlint::from_dict(
x, {{0, rc(1_z, 2_z)}, {1, rc(2_z, 3_z)}, {2, 1_q}});
RCP<const URatPolyFlint> b
= URatPolyFlint::from_dict(x, {{0, rc(2_z, 3_z)}, {1, 3_q}, {2, 2_q}});
RCP<const Basic> c = add_upoly(*a, *b);
REQUIRE(c->__str__() == "3*x**2 + 11/3*x + 7/6");
RCP<const URatPolyFlint> d
= URatPolyFlint::from_dict(x, {{0, rc(1_z, 2_z)}});
RCP<const Basic> e = add_upoly(*a, *d);
RCP<const Basic> f = add_upoly(*d, *a);
REQUIRE(e->__str__() == "x**2 + 2/3*x + 1");
REQUIRE(f->__str__() == "x**2 + 2/3*x + 1");
RCP<const URatPolyFlint> g = URatPolyFlint::from_dict(
y, {{0, 2_q}, {1, rc(-3_z, 2_z)}, {2, rc(1_z, 4_z)}});
CHECK_THROWS_AS(add_upoly(*a, *g), SymEngineException &);
}
TEST_CASE("Negative of a URatPolyFlint", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const URatPolyFlint> a
= URatPolyFlint::from_dict(x, {{0, rc(-1_z, 2_z)}, {1, 2_q}, {2, 3_q}});
RCP<const URatPolyFlint> b = neg_upoly(*a);
REQUIRE(b->__str__() == "-3*x**2 - 2*x + 1/2");
}
TEST_CASE("Subtracting two URatPolyFlint", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const Symbol> y = symbol("y");
RCP<const URatPolyFlint> a = URatPolyFlint::from_dict(
x, {{0, rc(1_z, 2_z)}, {1, rc(2_z, 3_z)}, {2, 1_q}});
RCP<const URatPolyFlint> b
= URatPolyFlint::from_dict(x, {{0, rc(2_z, 3_z)}, {1, 3_q}, {2, 2_q}});
RCP<const URatPolyFlint> c = URatPolyFlint::from_dict(
x, {{0, 2_q}, {1, rc(-3_z, 2_z)}, {2, rc(1_z, 4_z)}});
RCP<const URatPolyFlint> f = URatPolyFlint::from_dict(y, {{0, 2_q}});
RCP<const Basic> d = sub_upoly(*b, *a);
REQUIRE(d->__str__() == "x**2 + 7/3*x + 1/6");
d = sub_upoly(*c, *a);
REQUIRE(d->__str__() == "-3/4*x**2 - 13/6*x + 3/2");
d = sub_upoly(*a, *c);
REQUIRE(d->__str__() == "3/4*x**2 + 13/6*x - 3/2");
CHECK_THROWS_AS(sub_upoly(*a, *f), SymEngineException &);
}
TEST_CASE("Multiplication of two URatPolyFlint", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const Symbol> y = symbol("y");
RCP<const URatPolyFlint> a = URatPolyFlint::from_dict(
x, {{0, rc(1_z, 2_z)}, {1, rc(2_z, 3_z)}, {2, 1_q}});
RCP<const URatPolyFlint> b
= URatPolyFlint::from_dict(x, {{0, rc(2_z, 3_z)}, {1, 3_q}, {2, 2_q}});
RCP<const URatPolyFlint> e = URatPolyFlint::from_dict(
x, {{0, 2_q}, {1, rc(-3_z, 2_z)}, {2, rc(1_z, 4_z)}});
RCP<const URatPolyFlint> f
= URatPolyFlint::from_dict(x, {{0, 1_q}, {1, rc(1_z, 2_z)}});
RCP<const URatPolyFlint> c = mul_upoly(*a, *a);
RCP<const URatPolyFlint> d = mul_upoly(*a, *b);
RCP<const URatPolyFlint> g = mul_upoly(*e, *e);
RCP<const URatPolyFlint> h = mul_upoly(*e, *f);
RCP<const URatPolyFlint> i = mul_upoly(*f, *f);
REQUIRE(c->__str__() == "x**4 + 4/3*x**3 + 13/9*x**2 + 2/3*x + 1/4");
REQUIRE(d->__str__() == "2*x**4 + 13/3*x**3 + 11/3*x**2 + 35/18*x + 1/3");
REQUIRE(g->__str__() == "1/16*x**4 - 3/4*x**3 + 13/4*x**2 - 6*x + 4");
REQUIRE(h->__str__() == "1/8*x**3 - 1/2*x**2 - 1/2*x + 2");
REQUIRE(i->__str__() == "1/4*x**2 + x + 1");
c = URatPolyFlint::from_dict(x, {{0, rc(-1_z)}});
REQUIRE(mul_upoly(*a, *c)->__str__() == "-x**2 - 2/3*x - 1/2");
REQUIRE(mul_upoly(*c, *a)->__str__() == "-x**2 - 2/3*x - 1/2");
c = URatPolyFlint::from_dict(y, {{0, rc(-1_z)}});
CHECK_THROWS_AS(mul_upoly(*a, *c), SymEngineException &);
}
TEST_CASE("Comparing two URatPolyFlint", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const Symbol> y = symbol("y");
RCP<const URatPolyFlint> P
= URatPolyFlint::from_dict(x, {{0, 1_q}, {1, rc(2_z, 3_z)}});
RCP<const URatPolyFlint> Q
= URatPolyFlint::from_dict(x, {{0, 1_q}, {1, 2_q}, {2, 1_q}});
REQUIRE(P->compare(*Q) == -1);
P = URatPolyFlint::from_dict(x, {{0, 1_q}, {1, 2_q}, {2, 3_q}, {3, 2_q}});
REQUIRE(P->compare(*Q) == 1);
P = URatPolyFlint::from_dict(x, {{0, 1_q}, {1, 2_q}, {2, 1_q}});
REQUIRE(P->compare(*Q) == 0);
P = URatPolyFlint::from_dict(y, {{0, 1_q}, {1, rc(2_z, 3_z)}});
REQUIRE(P->compare(*Q) == -1);
}
TEST_CASE("URatPolyFlint as_symbolic", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const URatPolyFlint> a
= URatPolyFlint::from_dict(x, {{0, rc(1_z, 2_z)}, {1, 2_q}, {2, 1_q}});
REQUIRE(eq(
*a->as_symbolic(),
*add({div(one, integer(2)), mul(integer(2), x), pow(x, integer(2))})));
RCP<const URatPolyFlint> b
= URatPolyFlint::from_dict(x, {{1, rc(3_z, 2_z)}, {2, 2_q}});
REQUIRE(eq(*b->as_symbolic(), *add(mul(x, div(integer(3), integer(2))),
mul(integer(2), pow(x, integer(2))))));
RCP<const URatPolyFlint> c = URatPolyFlint::from_dict(x, map_uint_mpq{});
REQUIRE(eq(*c->as_symbolic(), *zero));
}
TEST_CASE("Evaluation of URatPolyFlint", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const URatPolyFlint> a
= URatPolyFlint::from_dict(x, {{0, 1_q}, {1, rc(2_z, 3_z)}});
RCP<const URatPolyFlint> b = URatPolyFlint::from_dict(
x, {{0, rc(1_z, 2_z)}, {1, rc(2_z, 5_z)}, {2, 1_q}});
REQUIRE(a->eval(2_q) == rc(7_z, 3_z));
REQUIRE(a->eval(10_q) == rc(23_z, 3_z));
REQUIRE(b->eval(-1_q) == rc(11_z, 10_z));
REQUIRE(b->eval(0_q) == rc(1_z, 2_z));
std::vector<rational_class> resa = {rc(7_z, 3_z), rc(5_z, 3_z), 1_q};
std::vector<rational_class> resb
= {rc(53_z, 10_z), rc(19_z, 10_z), rc(1_z, 2_z)};
REQUIRE(a->multieval({2_q, 1_q, 0_q}) == resa);
REQUIRE(b->multieval({2_q, 1_q, 0_q}) == resb);
}
TEST_CASE("Derivative of URatPolyFlint", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const Symbol> y = symbol("y");
RCP<const URatPolyFlint> a = URatPolyFlint::from_dict(
x, {{0, 1_q}, {1, rc(2_z, 3_z)}, {2, rc(1_z, 2_z)}});
RCP<const URatPolyFlint> b
= URatPolyFlint::from_dict(y, {{2, rc(4_z, 3_z)}});
REQUIRE(a->diff(x)->__str__() == "x + 2/3");
REQUIRE(a->diff(y)->__str__() == "0");
REQUIRE(b->diff(y)->__str__() == "8/3*y");
}
TEST_CASE("URatPolyFlint pow", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const URatPolyFlint> a
= URatPolyFlint::from_dict(x, {{0, rc(1_z, 2_z)}, {1, 1_q}});
RCP<const URatPolyFlint> b
= URatPolyFlint::from_dict(x, {{0, 3_q}, {2, rc(3_z, 2_z)}});
RCP<const URatPolyFlint> aaa = pow_upoly(*a, 3);
RCP<const URatPolyFlint> bb = pow_upoly(*b, 2);
REQUIRE(aaa->__str__() == "x**3 + 3/2*x**2 + 3/4*x + 1/8");
REQUIRE(bb->__str__() == "9/4*x**4 + 9*x**2 + 9");
}
TEST_CASE("URatPolyFlint divides", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const URatPolyFlint> a
= URatPolyFlint::from_dict(x, {{0, 1_q}, {1, 1_q}});
RCP<const URatPolyFlint> b = URatPolyFlint::from_dict(x, {{0, 4_q}});
RCP<const URatPolyFlint> c
= URatPolyFlint::from_dict(x, {{0, 8_q}, {1, 8_q}});
RCP<const URatPolyFlint> res;
REQUIRE(divides_upoly(*a, *c, outArg(res)));
REQUIRE(res->__str__() == "8");
REQUIRE(divides_upoly(*b, *c, outArg(res)));
REQUIRE(res->__str__() == "2*x + 2");
REQUIRE(divides_upoly(*b, *a, outArg(res)));
REQUIRE(res->__str__() == "1/4*x + 1/4");
REQUIRE(!divides_upoly(*a, *b, outArg(res)));
}
TEST_CASE("URatPolyFlint gcd", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const URatPolyFlint> a = URatPolyFlint::from_dict(x, {{2, 2_q}});
RCP<const URatPolyFlint> b = URatPolyFlint::from_dict(x, {{1, 3_q}});
RCP<const URatPolyFlint> c
= URatPolyFlint::from_dict(x, {{0, 6_q}, {1, 8_q}, {2, 2_q}});
RCP<const URatPolyFlint> d
= URatPolyFlint::from_dict(x, {{1, 4_q}, {2, 4_q}});
RCP<const URatPolyFlint> ab = gcd_upoly(*a, *b);
RCP<const URatPolyFlint> cd = gcd_upoly(*c, *d);
RCP<const URatPolyFlint> ad = gcd_upoly(*a, *d);
RCP<const URatPolyFlint> bc = gcd_upoly(*b, *c);
REQUIRE(ab->__str__() == "x");
REQUIRE(cd->__str__() == "x + 1");
REQUIRE(ad->__str__() == "x");
REQUIRE(bc->__str__() == "1");
// https://github.com/wbhart/flint2/issues/276
}
TEST_CASE("URatPolyFlint lcm", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const URatPolyFlint> a = URatPolyFlint::from_dict(x, {{2, 6_q}});
RCP<const URatPolyFlint> b = URatPolyFlint::from_dict(x, {{1, 8_q}});
RCP<const URatPolyFlint> c
= URatPolyFlint::from_dict(x, {{0, 8_q}, {1, 8_q}});
RCP<const URatPolyFlint> ab = lcm_upoly(*a, *b);
RCP<const URatPolyFlint> bc = lcm_upoly(*b, *c);
RCP<const URatPolyFlint> ac = lcm_upoly(*a, *c);
REQUIRE(ab->__str__() == "x**2");
REQUIRE(bc->__str__() == "x**2 + x");
REQUIRE(ac->__str__() == "x**3 + x**2");
}
TEST_CASE("URatPolyFlint from_poly symengine", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const UIntPoly> a = UIntPoly::from_dict(x, {{0, 1_z}, {2, 1_z}});
RCP<const URatPolyFlint> b = URatPolyFlint::from_poly(*a);
RCP<const URatPoly> c
= URatPoly::from_dict(x, {{0, rc(1_z, 2_z)}, {2, rc(3_z, 2_z)}});
RCP<const URatPolyFlint> d = URatPolyFlint::from_poly(*c);
REQUIRE(b->__str__() == "x**2 + 1");
REQUIRE(d->__str__() == "3/2*x**2 + 1/2");
}
#ifdef HAVE_SYMENGINE_PIRANHA
TEST_CASE("URatPolyFlint from_poly piranha", "[URatPolyFlint]")
{
RCP<const Symbol> x = symbol("x");
RCP<const URatPolyPiranha> a
= URatPolyPiranha::from_dict(x, {{0, rc(1_z, 2_z)}, {2, rc(3_z, 2_z)}});
RCP<const URatPolyFlint> b = URatPolyFlint::from_poly(*a);
REQUIRE(b->__str__() == "3/2*x**2 + 1/2");
}
#endif
| 36.342857
| 80
| 0.593117
|
jmig5776
|
0853954cb326f342415182b6f9e82f3edbfa08d9
| 1,080
|
cpp
|
C++
|
runtime/helpers/dispatch_info.cpp
|
FelipeMLopez/compute-runtime
|
3e3d2d3b3ac9129b1ee9c4251a2586fef0b300b8
|
[
"MIT"
] | 3
|
2019-09-20T23:26:36.000Z
|
2019-10-03T17:44:12.000Z
|
runtime/helpers/dispatch_info.cpp
|
FelipeMLopez/compute-runtime
|
3e3d2d3b3ac9129b1ee9c4251a2586fef0b300b8
|
[
"MIT"
] | null | null | null |
runtime/helpers/dispatch_info.cpp
|
FelipeMLopez/compute-runtime
|
3e3d2d3b3ac9129b1ee9c4251a2586fef0b300b8
|
[
"MIT"
] | 3
|
2019-05-16T07:22:51.000Z
|
2019-11-11T03:05:32.000Z
|
/*
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/helpers/dispatch_info.h"
#include "runtime/kernel/kernel.h"
namespace NEO {
bool DispatchInfo::usesSlm() const {
return (kernel == nullptr) ? false : kernel->slmTotalSize > 0;
}
bool DispatchInfo::usesStatelessPrintfSurface() const {
return (kernel == nullptr) ? false : (kernel->getKernelInfo().patchInfo.pAllocateStatelessPrintfSurface != nullptr);
}
uint32_t DispatchInfo::getRequiredScratchSize() const {
return (kernel == nullptr) ? 0 : kernel->getScratchSize();
}
uint32_t DispatchInfo::getRequiredPrivateScratchSize() const {
return (kernel == nullptr) ? 0 : kernel->getPrivateScratchSize();
}
Kernel *MultiDispatchInfo::peekMainKernel() const {
if (dispatchInfos.size() == 0) {
return nullptr;
}
return mainKernel ? mainKernel : dispatchInfos.begin()->getKernel();
}
Kernel *MultiDispatchInfo::peekParentKernel() const {
return (mainKernel && mainKernel->isParentKernel) ? mainKernel : nullptr;
}
} // namespace NEO
| 27
| 120
| 0.712037
|
FelipeMLopez
|
085af273d77f94edc1ca0279099a1745e38223b5
| 59,217
|
cpp
|
C++
|
pegasus/src/Pegasus/Server/HTTPAuthenticatorDelegator.cpp
|
maciejkotSW/OpenPegasus
|
cda54c82ef53fd00cd6be98b1d34518b51c823a4
|
[
"MIT"
] | 1
|
2021-11-12T21:28:50.000Z
|
2021-11-12T21:28:50.000Z
|
pegasus/src/Pegasus/Server/HTTPAuthenticatorDelegator.cpp
|
maciejkotSW/OpenPegasus
|
cda54c82ef53fd00cd6be98b1d34518b51c823a4
|
[
"MIT"
] | 39
|
2021-01-18T19:28:41.000Z
|
2022-03-27T20:55:36.000Z
|
pegasus/src/Pegasus/Server/HTTPAuthenticatorDelegator.cpp
|
maciejkotSW/OpenPegasus
|
cda54c82ef53fd00cd6be98b1d34518b51c823a4
|
[
"MIT"
] | 4
|
2021-07-09T12:52:33.000Z
|
2021-12-21T15:05:59.000Z
|
//%LICENSE////////////////////////////////////////////////////////////////
//
// Licensed to The Open Group (TOG) under one or more contributor license
// agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
// this work for additional information regarding copyright ownership.
// Each contributor licenses this file to you under the OpenPegasus Open
// Source License; you may not use this file except in compliance with the
// License.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////
//
//%/////////////////////////////////////////////////////////////////////////////
#include <Pegasus/Common/AuditLogger.h>
#include <Pegasus/Common/Constants.h>
#include <Pegasus/Common/XmlWriter.h>
#include <Pegasus/Common/Thread.h>
#include <Pegasus/Common/MessageLoader.h>
#include <Pegasus/Common/FileSystem.h>
#include <Pegasus/Common/LanguageParser.h>
#include <Pegasus/Config/ConfigManager.h>
#include "HTTPAuthenticatorDelegator.h"
#ifdef PEGASUS_ZOS_SECURITY
// This include file will not be provided in the OpenGroup CVS for now.
// Do NOT try to include it in your compile
# include <Pegasus/Common/safCheckzOS_inline.h>
#endif
#ifdef PEGASUS_OS_ZOS
# include <sys/ps.h>
#endif
PEGASUS_USING_STD;
PEGASUS_NAMESPACE_BEGIN
static const String _HTTP_VERSION_1_0 = "HTTP/1.0";
static const String _HTTP_METHOD_MPOST = "M-POST";
static const String _HTTP_METHOD = "POST";
#ifdef PEGASUS_ENABLE_PROTOCOL_WEB
static const String _HTTP_METHOD_GET = "GET";
static const String _HTTP_METHOD_HEAD = "HEAD";
#endif /* #ifdef PEGASUS_ENABLE_PROTOCOL_WEB */
static const char* _HTTP_HEADER_CIMEXPORT = "CIMExport";
static const char* _HTTP_HEADER_CONNECTION = "Connection";
static const char* _HTTP_HEADER_CIMOPERATION = "CIMOperation";
static const char* _HTTP_HEADER_ACCEPT_LANGUAGE = "Accept-Language";
static const char* _HTTP_HEADER_CONTENT_LANGUAGE = "Content-Language";
static const char* _HTTP_HEADER_AUTHORIZATION = "Authorization";
static const char* _HTTP_HEADER_PEGASUSAUTHORIZATION = "PegasusAuthorization";
static const String _CONFIG_PARAM_ENABLEAUTHENTICATION = "enableAuthentication";
static const char _COOKIE_NAME[] = "PEGASUS_SID";
HTTPAuthenticatorDelegator::HTTPAuthenticatorDelegator(
Uint32 cimOperationMessageQueueId,
Uint32 cimExportMessageQueueId,
CIMRepository* repository)
: Base(PEGASUS_QUEUENAME_HTTPAUTHDELEGATOR),
_cimOperationMessageQueueId(cimOperationMessageQueueId),
_cimExportMessageQueueId(cimExportMessageQueueId),
_wsmanOperationMessageQueueId(PEG_NOT_FOUND),
_rsOperationMessageQueueId(PEG_NOT_FOUND),
#ifdef PEGASUS_ENABLE_PROTOCOL_WEB
_webOperationMessageQueueId(PEG_NOT_FOUND),
#endif
_repository(repository)
{
PEG_METHOD_ENTER(TRC_HTTP,
"HTTPAuthenticatorDelegator::HTTPAuthenticatorDelegator");
_authenticationManager.reset(new AuthenticationManager());
#ifdef PEGASUS_ENABLE_SESSION_COOKIES
_sessions.reset(new HTTPSessionList());
#endif
PEG_METHOD_EXIT();
}
HTTPAuthenticatorDelegator::~HTTPAuthenticatorDelegator()
{
PEG_METHOD_ENTER(TRC_HTTP,
"HTTPAuthenticatorDelegator::~HTTPAuthenticatorDelegator");
PEG_METHOD_EXIT();
}
void HTTPAuthenticatorDelegator::enqueue(Message* message)
{
handleEnqueue(message);
}
void HTTPAuthenticatorDelegator::_sendResponse(
Uint32 queueId,
Buffer& message,
Boolean closeConnect)
{
PEG_METHOD_ENTER(TRC_HTTP,
"HTTPAuthenticatorDelegator::_sendResponse");
MessageQueue* queue = MessageQueue::lookup(queueId);
if (queue)
{
HTTPMessage* httpMessage = new HTTPMessage(message);
httpMessage->dest = queue->getQueueId();
httpMessage->setCloseConnect(closeConnect);
queue->enqueue(httpMessage);
}
PEG_METHOD_EXIT();
}
void HTTPAuthenticatorDelegator::_sendChallenge(
Uint32 queueId,
const String& errorDetail,
const String& authResponse,
Boolean closeConnect)
{
PEG_METHOD_ENTER(TRC_HTTP,
"HTTPAuthenticatorDelegator::_sendChallenge");
//
// build unauthorized (401) response message
//
Buffer message;
XmlWriter::appendUnauthorizedResponseHeader(
message,
errorDetail,
authResponse);
_sendResponse(queueId, message,closeConnect);
PEG_METHOD_EXIT();
}
void HTTPAuthenticatorDelegator::_sendHttpError(
Uint32 queueId,
const String& status,
const String& cimError,
const String& pegasusError,
Boolean closeConnect)
{
PEG_METHOD_ENTER(TRC_HTTP,
"HTTPAuthenticatorDelegator::_sendHttpError");
//
// build error response message
//
Buffer message;
message = XmlWriter::formatHttpErrorRspMessage(
status,
cimError,
pegasusError);
_sendResponse(queueId, message,closeConnect);
PEG_METHOD_EXIT();
}
void HTTPAuthenticatorDelegator::handleEnqueue(Message *message)
{
PEG_METHOD_ENTER(TRC_HTTP,
"HTTPAuthenticatorDelegator::handleEnqueue");
if (!message)
{
PEG_METHOD_EXIT();
return;
}
// Flag indicating whether the message should be deleted after handling.
// This should be set to false by handleHTTPMessage when the message is
// passed as is to another queue.
Boolean deleteMessage = true;
try
{
if (message->getType() == HTTP_MESSAGE)
{
handleHTTPMessage((HTTPMessage*)message, deleteMessage);
}
}
catch (...)
{
if (deleteMessage)
{
PEG_TRACE_CSTRING(TRC_HTTP, Tracer::LEVEL4,
"Exception caught, deleting Message in "
"HTTPAuthenticator::handleEnqueue");
delete message;
}
throw;
}
if (deleteMessage)
{
PEG_TRACE_CSTRING(TRC_HTTP, Tracer::LEVEL4,
"Deleting Message in HTTPAuthenticator::handleEnqueue");
delete message;
}
PEG_METHOD_EXIT();
}
void HTTPAuthenticatorDelegator::handleEnqueue()
{
PEG_METHOD_ENTER(TRC_HTTP,
"HTTPAuthenticatorDelegator::handleEnqueue");
Message* message = dequeue();
if (message)
{
handleEnqueue(message);
}
PEG_METHOD_EXIT();
}
void HTTPAuthenticatorDelegator::handleHTTPMessage(
HTTPMessage* httpMessage,
Boolean& deleteMessage)
{
PEG_METHOD_ENTER(TRC_HTTP,
"HTTPAuthenticatorDelegator::handleHTTPMessage");
PEGASUS_ASSERT(httpMessage->message.size() != 0);
deleteMessage = true;
//
// Save queueId:
//
Uint32 queueId = httpMessage->queueId;
//
// Parse the HTTP message:
//
String startLine;
Array<HTTPHeader> headers;
Uint32 contentLength;
Boolean closeConnect = false;
//
// Process M-POST and POST messages:
//
PEG_TRACE_CSTRING(
TRC_HTTP,
Tracer::LEVEL3,
"HTTPAuthenticatorDelegator - HTTP processing start");
// parse the received HTTPMessage
// parse function will return false if more than PEGASUS_MAXELEMENTS_NUM
// headers were detected in the message
if (!httpMessage->parse(startLine, headers, contentLength))
{
throw TooManyHTTPHeadersException();
}
//
// Check for Connection: Close
//
const char* connectClose;
if (HTTPMessage::lookupHeader(
headers, _HTTP_HEADER_CONNECTION, connectClose, false))
{
if (System::strcasecmp(connectClose, "Close") == 0)
{
PEG_TRACE_CSTRING(TRC_HTTP, Tracer::LEVEL3,
"Header in HTTP Message Contains a Connection: Close");
closeConnect = true;
httpMessage->setCloseConnect(closeConnect);
}
}
//
// Check and set languages
//
AcceptLanguageList acceptLanguages;
ContentLanguageList contentLanguages;
try
{
// Get and validate the Accept-Language header, if set
String acceptLanguageHeader;
if (HTTPMessage::lookupHeader(
headers,
_HTTP_HEADER_ACCEPT_LANGUAGE,
acceptLanguageHeader,
false))
{
acceptLanguages = LanguageParser::parseAcceptLanguageHeader(
acceptLanguageHeader);
httpMessage->acceptLanguagesDecoded = true;
}
// Get and validate the Content-Language header, if set
String contentLanguageHeader;
if (HTTPMessage::lookupHeader(
headers,
_HTTP_HEADER_CONTENT_LANGUAGE,
contentLanguageHeader,
false))
{
contentLanguages = LanguageParser::parseContentLanguageHeader(
contentLanguageHeader);
httpMessage->contentLanguagesDecoded = true;
}
}
catch (Exception& e)
{
// clear any existing languages to force messages to come from the
// root bundle
Thread::clearLanguages();
MessageLoaderParms msgParms(
"Pegasus.Server.HTTPAuthenticatorDelegator.REQUEST_NOT_VALID",
"request-not-valid");
String msg(MessageLoader::getMessage(msgParms));
_sendHttpError(
queueId,
HTTP_STATUS_BADREQUEST,
msg,
e.getMessage(),
closeConnect);
PEG_METHOD_EXIT();
return;
}
Thread::setLanguages(acceptLanguages);
httpMessage->acceptLanguages = acceptLanguages;
httpMessage->contentLanguages = contentLanguages;
//
// Parse the request line:
//
String methodName;
String requestUri;
String httpVersion;
HTTPMessage::parseRequestLine(
startLine, methodName, requestUri, httpVersion);
//
// Set HTTP method for the request
//
HttpMethod httpMethod = HTTP_METHOD__POST;
if (methodName == _HTTP_METHOD_MPOST)
{
httpMethod = HTTP_METHOD_M_POST;
}
#ifdef PEGASUS_ENABLE_PROTOCOL_WEB
else if (methodName == _HTTP_METHOD_GET)
{
httpMethod = HTTP_METHOD_GET;
}
else if (methodName == _HTTP_METHOD_HEAD)
{
httpMethod = HTTP_METHOD_HEAD;
}
#endif
if (httpMethod != HTTP_METHOD__POST && httpMethod != HTTP_METHOD_M_POST
#ifdef PEGASUS_ENABLE_PROTOCOL_WEB
&& httpMethod != HTTP_METHOD_GET && httpMethod != HTTP_METHOD_HEAD
#endif
)
{
//
// M-POST method is not valid with version 1.0
//
_sendHttpError(
queueId,
HTTP_STATUS_NOTIMPLEMENTED,
String::EMPTY,
String::EMPTY,
closeConnect);
PEG_METHOD_EXIT();
return;
}
if ((httpMethod == HTTP_METHOD_M_POST) &&
(httpVersion == _HTTP_VERSION_1_0))
{
//
// M-POST method is not valid with version 1.0
//
_sendHttpError(
queueId,
HTTP_STATUS_BADREQUEST,
String::EMPTY,
String::EMPTY,
closeConnect);
PEG_METHOD_EXIT();
return;
}
PEG_TRACE_CSTRING(
TRC_AUTHENTICATION,
Tracer::LEVEL3,
"HTTPAuthenticatorDelegator - Authentication processing start");
//
// Handle authentication:
//
ConfigManager* configManager = ConfigManager::getInstance();
Boolean enableAuthentication =
ConfigManager::parseBooleanValue(configManager->getCurrentValue(
_CONFIG_PARAM_ENABLEAUTHENTICATION));
AuthenticationStatus authStatus(AUTHSC_UNAUTHORIZED);
if (httpMessage->authInfo->isConnectionAuthenticated())
{
authStatus = AuthenticationStatus(AUTHSC_SUCCESS);
}
if (enableAuthentication)
{
#ifdef PEGASUS_ENABLE_SESSION_COOKIES
// Find cookie and check if we know it
String cookieHdr;
if (!authStatus.isSuccess() && _sessions->cookiesEnabled()
&& httpMessage->lookupHeader(headers, "Cookie", cookieHdr))
{
String userName;
String cookie;
if (httpMessage->parseCookieHeader(cookieHdr, _COOKIE_NAME, cookie)
&& _sessions->isAuthenticated(cookie,
httpMessage->ipAddress, userName))
{
authStatus = AuthenticationStatus(AUTHSC_SUCCESS);
httpMessage->authInfo->setAuthenticatedUser(userName);
httpMessage->authInfo->setAuthType(
AuthenticationInfoRep::AUTH_TYPE_COOKIE);
}
}
#endif
if (authStatus.isSuccess())
{
if (httpMessage->authInfo->getAuthType()==
AuthenticationInfoRep::AUTH_TYPE_SSL)
{
// Get the user name associated with the certificate (using the
// certificate chain, if necessary).
String certUserName;
String issuerName;
String subjectName;
char serialNumber[32];
PEG_TRACE_CSTRING(TRC_HTTP, Tracer::LEVEL3,
"Client was authenticated via trusted SSL certificate.");
String trustStore =
configManager->getCurrentValue("sslTrustStore");
if (FileSystem::isDirectory(
ConfigManager::getHomedPath(trustStore)))
{
PEG_TRACE_CSTRING(TRC_HTTP, Tracer::LEVEL4,
"Truststore is a directory, lookup username");
// Get the client certificate chain to determine the
// correct username mapping. Starting with the peer
// certificate, work your way up the chain towards the
// root certificate until a match is found in the
// repository.
Array<SSLCertificateInfo*> clientCertificateChain =
httpMessage->authInfo->getClientCertificateChain();
SSLCertificateInfo* clientCertificate = NULL;
PEG_TRACE((TRC_HTTP, Tracer::LEVEL4,
"Client certificate chain length: %d.",
clientCertificateChain.size()));
Uint32 loopCount = clientCertificateChain.size() - 1;
for (Uint32 i = 0; i <= loopCount ; i++)
{
clientCertificate = clientCertificateChain[i];
if (clientCertificate == NULL)
{
MessageLoaderParms msgParms(
"Pegasus.Server.HTTPAuthenticatorDelegator."
"BAD_CERTIFICATE",
"The certificate used for authentication is "
"not valid.");
_sendHttpError(
queueId,
HTTP_STATUS_UNAUTHORIZED,
String::EMPTY,
MessageLoader::getMessage(msgParms),
closeConnect);
PEG_METHOD_EXIT();
return;
}
PEG_TRACE((TRC_HTTP, Tracer::LEVEL4,
"Certificate toString %s",
(const char*)
clientCertificate->toString().getCString()));
// Get certificate properties
issuerName = clientCertificate->getIssuerName();
sprintf(serialNumber, "%lu",
(unsigned long)
clientCertificate->getSerialNumber());
subjectName = clientCertificate->getSubjectName();
//
// The truststore type key property is deprecated. To
// retain backward compatibility, add the truststore
// type property to the key bindings and set it to
// cimserver truststore.
//
// Construct the corresponding PG_SSLCertificate
// instance
Array<CIMKeyBinding> keyBindings;
keyBindings.append(CIMKeyBinding(
"IssuerName", issuerName, CIMKeyBinding::STRING));
keyBindings.append(CIMKeyBinding(
"SerialNumber",
serialNumber,
CIMKeyBinding::STRING));
keyBindings.append(CIMKeyBinding("TruststoreType",
PG_SSLCERTIFICATE_TSTYPE_VALUE_SERVER));
CIMObjectPath cimObjectPath(
"localhost",
PEGASUS_NAMESPACENAME_CERTIFICATE,
PEGASUS_CLASSNAME_CERTIFICATE,
keyBindings);
PEG_TRACE((TRC_HTTP, Tracer::LEVEL4,
"Client Certificate COP: %s",
(const char*)
cimObjectPath.toString().getCString()));
CIMInstance cimInstance;
CIMValue value;
Uint32 pos;
String userName;
// Attempt to get the username registered to the
// certificate
try
{
cimInstance = _repository->getInstance(
PEGASUS_NAMESPACENAME_CERTIFICATE,
cimObjectPath);
pos =
cimInstance.findProperty("RegisteredUserName");
if (pos != PEG_NOT_FOUND &&
!(value = cimInstance.getProperty(pos).
getValue()).isNull())
{
value.get(userName);
//
// If a user name is specified, our search is
// complete
//
if (userName.size())
{
PEG_TRACE((TRC_HTTP, Tracer::LEVEL3,
"User name for certificate is %s",
(const char*)userName.getCString()));
certUserName = userName;
break;
}
// No user name is specified; continue up the
// chain
PEG_TRACE((TRC_HTTP, Tracer::LEVEL4,
"The certificate at level %u has no "
"associated username; moving up the "
"chain",
i));
}
else
{
PEG_TRACE_CSTRING(
TRC_HTTP,
Tracer::LEVEL3,
"HTTPAuthenticatorDelegator - Bailing, no "
"username is registered to this "
"certificate.");
}
}
catch (CIMException& e)
{
// this certificate did not have a registration
// associated with it; continue up the chain
if (e.getCode() == CIM_ERR_NOT_FOUND)
{
PEG_TRACE_CSTRING(TRC_HTTP, Tracer::LEVEL4,
"No registration for this certificate; "
"try next certificate in chain");
continue;
}
else
{
PEG_TRACE((TRC_HTTP,Tracer::LEVEL1,
"HTTPAuthenticatorDelegator- Bailing,the "
"certificate used for authentication "
"is not valid for client IP address "
"%s.",
(const char*)
httpMessage->ipAddress.getCString())
);
MessageLoaderParms msgParms(
"Pegasus.Server.HTTPAuthenticatorDelegator."
"BAD_CERTIFICATE",
"The certificate used for authentication "
"is not valid.");
String msg(MessageLoader::getMessage(msgParms));
_sendHttpError(
queueId,
HTTP_STATUS_UNAUTHORIZED,
String::EMPTY,
msg,
closeConnect);
PEG_METHOD_EXIT();
return;
}
}
catch (...)
{
// This scenario can occur if a certificate cached
// on the server was deleted openssl would not pick
// up the deletion but we would pick it up here
// when we went to look it up in the repository
PEG_TRACE((TRC_HTTP,Tracer::LEVEL1,
"HTTPAuthenticatorDelegator- Bailing,the "
"certificate used for authentication is "
"not valid for client IP address %s.",
(const char*)
httpMessage->ipAddress.getCString()));
MessageLoaderParms msgParms(
"Pegasus.Server.HTTPAuthenticatorDelegator."
"BAD_CERTIFICATE",
"The certificate used for authentication is "
"not valid.");
String msg(MessageLoader::getMessage(msgParms));
_sendHttpError(
queueId,
HTTP_STATUS_UNAUTHORIZED,
String::EMPTY,
msg,
closeConnect);
PEG_METHOD_EXIT();
return;
}
} //end for clientcertificatechain
} //end sslTrustStore directory
else
{
// trustStore is a single CA file, lookup username
// user was already verified as a valid system user during
// server startup
certUserName =
configManager->getCurrentValue("sslTrustStoreUserName");
}
//
// Validate user information
//
if (certUserName == String::EMPTY)
{
PEG_TRACE((TRC_HTTP,Tracer::LEVEL1,
"HTTPAuthenticatorDelegator-No username is registered "
"to this certificate for client IP address %s.",
(const char*)httpMessage->ipAddress.getCString()));
MessageLoaderParms msgParms(
"Pegasus.Server.HTTPAuthenticatorDelegator."
"BAD_CERTIFICATE_USERNAME",
"No username is registered to this certificate.");
_sendHttpError(
queueId,
HTTP_STATUS_UNAUTHORIZED,
String::EMPTY,
MessageLoader::getMessage(msgParms),
closeConnect);
PEG_METHOD_EXIT();
return;
}
authStatus =
_authenticationManager->validateUserForHttpAuth(
certUserName,
httpMessage->authInfo);
if (!authStatus.isSuccess())
{
PEG_AUDIT_LOG(logCertificateBasedUserValidation(
certUserName,
issuerName,
subjectName,
serialNumber,
httpMessage->ipAddress,
false));
MessageLoaderParms msgParms(
"Pegasus.Server.HTTPAuthenticatorDelegator."
"CERTIFICATE_USER_NOT_VALID",
"User '$0' registered to this certificate is not a "
"valid user.",
certUserName);
_sendHttpError(
queueId,
HTTP_STATUS_UNAUTHORIZED,
String::EMPTY,
MessageLoader::getMessage(msgParms),
closeConnect);
PEG_METHOD_EXIT();
return;
}
PEG_AUDIT_LOG(logCertificateBasedUserValidation(
certUserName,
issuerName,
subjectName,
serialNumber,
httpMessage->ipAddress,
true));
httpMessage->authInfo->setAuthenticatedUser(certUserName);
PEG_TRACE((
TRC_HTTP,
Tracer::LEVEL4,
"HTTPAuthenticatorDelegator - The trusted client "
"certificate is registered to %s.",
(const char*) certUserName.getCString()));
} // end AuthenticationInfoRep::AUTH_TYPE_SSL
#ifdef PEGASUS_OS_ZOS
if (httpMessage->authInfo->getAuthType()==
AuthenticationInfoRep::AUTH_TYPE_ZOS_ATTLS)
{
String connectionUserName =
httpMessage->authInfo->getConnectionUser();
// If authenticated user not the connected user
// then check CIMSERV profile.
if (!String::equalNoCase(connectionUserName,
httpMessage->authInfo->getAuthenticatedUser()))
{
#ifdef PEGASUS_ZOS_SECURITY
if ( !CheckProfileCIMSERVclassWBEM(connectionUserName,
__READ_RESOURCE))
{
Logger::put_l(Logger::STANDARD_LOG, ZOS_SECURITY_NAME,
Logger::WARNING,
MessageLoaderParms(
"Pegasus.Server.HTTPAuthenticatorDelegator."
"ATTLS_NOREAD_CIMSERV_ACCESS.PEGASUS_OS_ZOS",
"Request UserID $0 doesn't have READ permission"
" to profile CIMSERV CL(WBEM).",
connectionUserName));
PEG_AUDIT_LOG(logCertificateBasedUserValidation(
connectionUserName,
String::EMPTY,
String::EMPTY,
String::EMPTY,
httpMessage->ipAddress,
false));
_sendHttpError(
queueId,
HTTP_STATUS_UNAUTHORIZED,
String::EMPTY,
String::EMPTY,
closeConnect);
PEG_METHOD_EXIT();
return;
}
#endif
PEG_TRACE((TRC_HTTP, Tracer::LEVEL4,
"Client UserID '%s' was authenticated via AT-TLS.",
(const char*)connectionUserName.getCString()));
httpMessage->authInfo->setAuthenticatedUser(
connectionUserName);
// For audit loging, only the mapping of the client IP to
// the resolved user ID is from interest.
// The SAF facility logs the certificate validation and
// the mapping of certificate subject to a local userID.
PEG_AUDIT_LOG(logCertificateBasedUserValidation(
connectionUserName,
String::EMPTY,
String::EMPTY,
String::EMPTY,
httpMessage->ipAddress,
true));
}// end is authenticated ?
} // end AuthenticationInfoRep::AUTH_TYPE_ZOS_ATTLS
if (httpMessage->authInfo->getAuthType()==
AuthenticationInfoRep::AUTH_TYPE_ZOS_LOCAL_DOMIAN_SOCKET)
{
String connectionUserName =
httpMessage->authInfo->getConnectionUser();
String requestUserName;
String authHeader;
String authHttpType;
String cookie;
// if lookupHeader() is not successfull parseLocalAuthHeader()
// must not be called !!
if ( HTTPMessage::lookupHeader(headers,
_HTTP_HEADER_PEGASUSAUTHORIZATION, authHeader, false)&&
HTTPMessage::parseLocalAuthHeader(authHeader,
authHttpType, requestUserName, cookie))
{
String cimServerUserName = System::getEffectiveUserName();
PEG_TRACE((TRC_HTTP, Tracer::LEVEL4,
"CIM server UserID = '%s', "
"Request UserID = '%s', "
"Local authenticated UserID = '%s'.",
(const char*) cimServerUserName.getCString(),
(const char*) requestUserName.getCString(),
(const char*) connectionUserName.getCString()
));
// if the request name and the user connected to the socket
// are the same, or if the currnet user running the
// cim server and the connected user are the same then
// assign the request user id as authenticated user id.
if( String::equalNoCase(
requestUserName,connectionUserName) ||
String::equalNoCase(
cimServerUserName,connectionUserName))
{
// If the designate new authenticated user, the user of
// the request, is not already the authenticated user
// then set the authenticated user and check CIMSERV.
if (!String::equalNoCase(requestUserName,
httpMessage->authInfo->getAuthenticatedUser()))
{
#ifdef PEGASUS_ZOS_SECURITY
if ( !CheckProfileCIMSERVclassWBEM(requestUserName,
__READ_RESOURCE))
{
Logger::put_l(Logger::STANDARD_LOG,
ZOS_SECURITY_NAME,
Logger::WARNING,
MessageLoaderParms(
"Pegasus.Server.HTTPAuthenticatorDelegator."
"UNIXSOCKET_NOREAD_CIMSERV_ACCESS."
"PEGASUS_OS_ZOS",
"Request UserID $0 doesn't have READ "
"permission to profile "
"CIMSERV CL(WBEM).",
requestUserName));
_sendHttpError(
queueId,
HTTP_STATUS_UNAUTHORIZED,
String::EMPTY,
String::EMPTY,
closeConnect);
PEG_METHOD_EXIT();
return;
}
#endif
// It is not necessary to check remote privileged
// user access for local connections;
// set the flag to "check done"
httpMessage->authInfo->
setRemotePrivilegedUserAccessChecked();
httpMessage->authInfo->setAuthenticatedUser(
requestUserName);
PEG_TRACE((TRC_HTTP, Tracer::LEVEL4,
"New authenticated User = '%s'.",
(const char*)requestUserName.getCString()
));
} // end changed authenticated user
PEG_TRACE((TRC_HTTP, Tracer::LEVEL4,
"User authenticated for request = '%s'.",
(const char*)httpMessage->authInfo->
getAuthenticatedUser().getCString()
));
// Write local authentication audit record.
PEG_AUDIT_LOG(logLocalAuthentication(
requestUserName,true));
} // end select authenticated user
else
{
PEG_AUDIT_LOG(logLocalAuthentication(
requestUserName,false));
PEG_TRACE((TRC_HTTP, Tracer::LEVEL4,
"User '%s' not authorized for request",
(const char*)requestUserName.getCString()));
_sendHttpError(
queueId,
HTTP_STATUS_UNAUTHORIZED,
String::EMPTY,
String::EMPTY,
closeConnect);
PEG_METHOD_EXIT();
return;
}
} // end lookup header
else
{
MessageLoaderParms msgParms(
"Pegasus.Server.HTTPAuthenticatorDelegator."
"AUTHORIZATION_HEADER_ERROR",
"Authorization header error");
String msg(MessageLoader::getMessage(msgParms));
_sendHttpError(
queueId,
HTTP_STATUS_BADREQUEST,
String::EMPTY,
msg,
closeConnect);
PEG_METHOD_EXIT();
return;
}
} // end AuthenticationInfoRep::AUTH_TYPE_ZOS_LOCAL_DOMIAN_SOCKET
#endif
} // end isRequestAuthenticated
else
{ // !isRequestAuthenticated
String authorization;
//
// do Local/Pegasus authentication
//
if (HTTPMessage::lookupHeader(headers,
_HTTP_HEADER_PEGASUSAUTHORIZATION, authorization, false))
{
try
{
//
// Do pegasus/local authentication
//
authStatus =
_authenticationManager->performPegasusAuthentication(
authorization,
httpMessage->authInfo);
if (authStatus.isSuccess())
{
#ifdef PEGASUS_ENABLE_SESSION_COOKIES
_createCookie(httpMessage);
#endif
}
else
{
String authResp;
authResp = _authenticationManager->
getPegasusAuthResponseHeader(
authorization,
httpMessage->authInfo);
if (authResp.size() > 0)
{
if (authStatus.doChallenge())
{
_sendChallenge(
queueId,
authStatus.getErrorDetail(),
authResp,
closeConnect);
}
else
{
_sendHttpError(
queueId,
authStatus.getHttpStatus(),
String::EMPTY,
authStatus.getErrorDetail(),
closeConnect);
}
}
else
{
MessageLoaderParms msgParms(
"Pegasus.Server.HTTPAuthenticatorDelegator."
"AUTHORIZATION_HEADER_ERROR",
"Authorization header error");
String msg(MessageLoader::getMessage(msgParms));
_sendHttpError(
queueId,
HTTP_STATUS_BADREQUEST,
String::EMPTY,
msg,
closeConnect);
}
PEG_METHOD_EXIT();
return;
}
}
catch (const CannotOpenFile&)
{
_sendHttpError(
queueId,
HTTP_STATUS_INTERNALSERVERERROR,
String::EMPTY,
String::EMPTY,
closeConnect);
PEG_METHOD_EXIT();
return;
}
} // end PEGASUS/LOCAL authentication
//
// do HTTP authentication
//
if (HTTPMessage::lookupHeader(
headers, _HTTP_HEADER_AUTHORIZATION,
authorization, false))
{
authStatus =
_authenticationManager->performHttpAuthentication(
authorization,
httpMessage->authInfo);
#ifdef PEGASUS_PAM_SESSION_SECURITY
if (authStatus.isPasswordExpired())
{
// if this is CIM-XML and Password Expired treat as success
// expired password state is already stored in
// AuthenticationInfo
const char* cimOperation;
if (HTTPMessage::lookupHeader(
headers,
_HTTP_HEADER_CIMOPERATION,
cimOperation,
true))
{
authStatus = AuthenticationStatus(true);
}
}
#endif
if (authStatus.isSuccess())
{
#ifdef PEGASUS_ENABLE_SESSION_COOKIES
_createCookie(httpMessage);
#endif
}
else
{
//ATTN: the number of challenges get sent for a
// request on a connection can be pre-set.
#ifdef PEGASUS_NEGOTIATE_AUTHENTICATION
// Kerberos authentication needs access to the
// AuthenticationInfo object for this session in
// order to set up the reference to the
// CIMKerberosSecurityAssociation object for this
// session.
String authResp =
_authenticationManager->getHttpAuthResponseHeader(
httpMessage->authInfo);
#else
String authResp =
_authenticationManager->getHttpAuthResponseHeader();
#endif
if (authResp.size() > 0)
{
if (authStatus.doChallenge())
{
_sendChallenge(
queueId,
authStatus.getErrorDetail(),
authResp,
closeConnect);
}
else
{
_sendHttpError(
queueId,
authStatus.getHttpStatus(),
String::EMPTY,
authStatus.getErrorDetail(),
closeConnect);
}
}
else
{
MessageLoaderParms msgParms(
"Pegasus.Server.HTTPAuthenticatorDelegator."
"AUTHORIZATION_HEADER_ERROR",
"Authorization header error");
String msg(MessageLoader::getMessage(msgParms));
_sendHttpError(
queueId,
HTTP_STATUS_BADREQUEST,
String::EMPTY,
msg,
closeConnect);
}
PEG_METHOD_EXIT();
return;
}
} // End if HTTP Authorization
} //end if (!isRequestAuthenticated)
} //end enableAuthentication
PEG_TRACE_CSTRING(
TRC_AUTHENTICATION,
Tracer::LEVEL3,
"HTTPAuthenticatorDelegator - Authentication processing ended");
if (authStatus.isSuccess() || !enableAuthentication)
{
// Final bastion to ensure the remote privileged user access
// check is done as it should be
// check for remote privileged User Access
if (!httpMessage->authInfo->getRemotePrivilegedUserAccessChecked())
{
// the AuthenticationHandler did not process the
// enableRemotePrivilegedUserAccess check
// time to do it ourselves
String userName = httpMessage->authInfo->getAuthenticatedUser();
if (!AuthenticationManager::isRemotePrivilegedUserAccessAllowed(
userName))
{
// Send client a message that we can't proceed to talk
// to him
// HTTP 401 ?
MessageLoaderParms msgParms(
"Server.CIMOperationRequestAuthorizer."
"REMOTE_NOT_ENABLED",
"Remote privileged user access is not enabled.");
String msg(MessageLoader::getMessage(msgParms));
_sendHttpError(
queueId,
HTTP_STATUS_UNAUTHORIZED,
String::EMPTY,
msg,
closeConnect);
PEG_METHOD_EXIT();
return;
}
httpMessage->authInfo->setRemotePrivilegedUserAccessChecked();
}
//
// Determine the type of this request:
//
// - A "CIMOperation" header indicates a CIM operation request
// - A "CIMExport" header indicates a CIM export request
// - A "/wsman" path in the start message indicates a WS-Man request
// - The requestUri starting with "/cimrs" indicates a CIM-RS request
CString uri = requestUri.getCString();
const char* cimOperation;
if (HTTPMessage::lookupHeader(
headers, _HTTP_HEADER_CIMOPERATION, cimOperation, true))
{
PEG_TRACE((
TRC_HTTP,
Tracer::LEVEL3,
"HTTPAuthenticatorDelegator - CIMOperation: %s",
cimOperation));
MessageQueue* queue =
MessageQueue::lookup(_cimOperationMessageQueueId);
if (queue)
{
httpMessage->dest = queue->getQueueId();
try
{
queue->enqueue(httpMessage);
}
catch (const bad_alloc&)
{
delete httpMessage;
HTTPConnection *httpQueue =
dynamic_cast<HTTPConnection*>(
MessageQueue::lookup(queueId));
if (httpQueue)
{
httpQueue->handleInternalServerError(0, true);
}
PEG_METHOD_EXIT();
deleteMessage = false;
return;
}
deleteMessage = false;
}
}
else if (HTTPMessage::lookupHeader(
headers, _HTTP_HEADER_CIMEXPORT, cimOperation, true))
{
PEG_TRACE((
TRC_AUTHENTICATION,
Tracer::LEVEL3,
"HTTPAuthenticatorDelegator - CIMExport: %s",
cimOperation));
MessageQueue* queue =
MessageQueue::lookup(_cimExportMessageQueueId);
if (queue)
{
httpMessage->dest = queue->getQueueId();
queue->enqueue(httpMessage);
deleteMessage = false;
}
}
else if ((_wsmanOperationMessageQueueId != PEG_NOT_FOUND) &&
((requestUri == "/wsman") ||
((requestUri == "/wsman-anon") && !enableAuthentication)))
{
// Note: DSP0226 R5.3-1 specifies if /wsman is used,
// unauthenticated access should not be allowed. This "should"
// requirement is not implemented here, because it is difficult
// for a client to determine whether enableAuthentication=true.
// DSP0226 R5.3-2 specifies if /wsman-anon is used, authenticated
// access shall not be required. Unauthenticated access is
// currently not allowed if enableAuthentication=true. When
// support for wsmid:Identify is added, it will be necessary to
// respond to that request without requiring authentication,
// regardless of the CIM Server configuration.
MessageQueue* queue =
MessageQueue::lookup(_wsmanOperationMessageQueueId);
if (queue)
{
httpMessage->dest = queue->getQueueId();
try
{
queue->enqueue(httpMessage);
}
catch (const bad_alloc&)
{
delete httpMessage;
HTTPConnection *httpQueue =
dynamic_cast<HTTPConnection*>(
MessageQueue::lookup(queueId));
if (httpQueue)
{
httpQueue->handleInternalServerError(0, true);
}
PEG_METHOD_EXIT();
deleteMessage = false;
return;
}
deleteMessage = false;
}
}
else if (
(_rsOperationMessageQueueId != PEG_NOT_FOUND) &&
(strncmp((const char*)uri, "/cimrs", 6) == 0))
{
MessageQueue* queue = MessageQueue::lookup(
_rsOperationMessageQueueId);
if (queue)
{
httpMessage->dest = queue->getQueueId();
try
{
PEG_TRACE((TRC_HTTP, Tracer::LEVEL4,
"HTTPAuthenticatorDelegator - "
"CIM-RS request enqueued [%d]",
queue->getQueueId()));
queue->enqueue(httpMessage);
}
catch (const bad_alloc&)
{
delete httpMessage;
_sendHttpError(
queueId,
HTTP_STATUS_REQUEST_TOO_LARGE,
String::EMPTY,
String::EMPTY,
closeConnect);
PEG_METHOD_EXIT();
deleteMessage = false;
return;
}
deleteMessage = false;
}
else
{
PEG_TRACE((TRC_HTTP, Tracer::LEVEL3,
"HTTPAuthenticatorDelegator - "
"Queue not found for URI: %s\n",
(const char*)uri));
}
}
#ifdef PEGASUS_ENABLE_PROTOCOL_WEB
//Unlike Other protocol, Web server is an pegasus extension
//and uses method name to identify it as it we don't have any
//like /cimrs and /wsman yet
//Instead, We deduce operation request to Webserver through it's
//method name GET and HEAD which is HACKISH.
else if ((_webOperationMessageQueueId != PEG_NOT_FOUND) &&
(httpMethod == HTTP_METHOD_GET || httpMethod == HTTP_METHOD_HEAD ))
{
MessageQueue* queue = MessageQueue::lookup(
_webOperationMessageQueueId);
if (queue)
{
httpMessage->dest = queue->getQueueId();
try
{
PEG_TRACE((TRC_HTTP, Tracer::LEVEL4,
"HTTPAuthenticatorDelegator - "
"WebServer request enqueued [%d]",
queue->getQueueId()));
queue->enqueue(httpMessage);
}
catch (const bad_alloc&)
{
delete httpMessage;
HTTPConnection *httpQueue =
dynamic_cast<HTTPConnection*>(
MessageQueue::lookup(queueId));
if (httpQueue)
{
httpQueue->handleInternalServerError(0, true);
}
PEG_METHOD_EXIT();
deleteMessage = false;
return;
}
catch (Exception& e)
{
PEG_TRACE((TRC_HTTP, Tracer::LEVEL4,
"HTTPAuthenticatorDelegator - "
"WebServer has thrown an exception: %s",
(const char*)e.getMessage().getCString()));
delete httpMessage;
_sendHttpError(
queueId,
HTTP_STATUS_INTERNALSERVERERROR,
String::EMPTY,
String::EMPTY,
true);
PEG_METHOD_EXIT();
deleteMessage = false;
return;
}
catch (...)
{
delete httpMessage;
HTTPConnection *httpQueue =
dynamic_cast<HTTPConnection*>(
MessageQueue::lookup(queueId));
if (httpQueue)
{
httpQueue->handleInternalServerError(0, true);
}
PEG_METHOD_EXIT();
deleteMessage = false;
return;
}
deleteMessage = false;
}
else
{
PEG_TRACE((TRC_HTTP, Tracer::LEVEL3,
"HTTPAuthenticatorDelegator - "
"Queue not found for URI: %s\n",
(const char*)requestUri.getCString()));
}
}
#endif /* PEGAUS_ENABLE_PROTOCOL_WEB */
else
{
// We don't recognize this request message type
// The Specification for CIM Operations over HTTP reads:
//
// 3.3.4. CIMOperation
//
// If a CIM Server receives a CIM Operation request without
// this [CIMOperation] header, it MUST NOT process it as if
// it were a CIM Operation Request. The status code
// returned by the CIM Server in response to such a request
// is outside of the scope of this specification.
//
// 3.3.5. CIMExport
//
// If a CIM Listener receives a CIM Export request without
// this [CIMExport] header, it MUST NOT process it. The
// status code returned by the CIM Listener in response to
// such a request is outside of the scope of this
// specification.
//
// The author has chosen to send a 400 Bad Request error, but
// without the CIMError header since this request must not be
// processed as a CIM request.
_sendHttpError(
queueId,
HTTP_STATUS_BADREQUEST,
String::EMPTY,
String::EMPTY,
closeConnect);
PEG_METHOD_EXIT();
return;
} // bad request
} // isRequestAuthenticated and enableAuthentication check
else
{ // client not authenticated; send challenge
#ifdef PEGASUS_NEGOTIATE_AUTHENTICATION
String authResp =
_authenticationManager->getHttpAuthResponseHeader(
httpMessage->authInfo);
#else
String authResp =
_authenticationManager->getHttpAuthResponseHeader();
#endif
if (authResp.size() > 0)
{
if (authStatus.doChallenge())
{
_sendChallenge(
queueId,
authStatus.getErrorDetail(),
authResp,
closeConnect);
}
else
{
_sendHttpError(
queueId,
authStatus.getHttpStatus(),
String::EMPTY,
authStatus.getErrorDetail(),
closeConnect);
}
}
else
{
MessageLoaderParms msgParms(
"Pegasus.Server.HTTPAuthenticatorDelegator."
"AUTHORIZATION_HEADER_ERROR",
"Authorization header error");
String msg(MessageLoader::getMessage(msgParms));
_sendHttpError(
queueId,
HTTP_STATUS_BADREQUEST,
String::EMPTY,
msg,
closeConnect);
}
}
PEG_METHOD_EXIT();
}
#ifdef PEGASUS_ENABLE_SESSION_COOKIES
void HTTPAuthenticatorDelegator::_createCookie(
HTTPMessage *httpMessage)
{
PEG_METHOD_ENTER(TRC_HTTP,
"HTTPAuthenticatorDelegator::_createCookie");
if (!_sessions->cookiesEnabled())
{
PEG_METHOD_EXIT();
return;
}
// The client passed authentication, give it a cookie
String sessionID = _sessions->addNewSession(
httpMessage->authInfo->getAuthenticatedUser(),
httpMessage->ipAddress);
const char attributes[] = ";secure;httpOnly;maxAge=";
ConfigManager *configManager = ConfigManager::getInstance();
String strTimeout = configManager->getCurrentValue("httpSessionTimeout");
String cookie;
cookie.reserveCapacity(sizeof(_COOKIE_NAME) + 1 + sessionID.size()
+ sizeof(attributes) + strTimeout.size() + 1);
cookie.append(_COOKIE_NAME);
cookie.append("=");
cookie.append(sessionID);
cookie.append(attributes);
cookie.append(strTimeout);
// Schedule the cookie to be added in the next response
httpMessage->authInfo->setCookie(cookie);
PEG_METHOD_EXIT();
}
#endif
void HTTPAuthenticatorDelegator::idleTimeCleanup()
{
PEG_METHOD_ENTER(TRC_HTTP, "HTTPAuthenticatorDelegator::idleTimeCleanup");
#ifdef PEGASUS_ENABLE_SESSION_COOKIES
_sessions->clearExpired();
#endif
PEG_METHOD_EXIT();
}
PEGASUS_NAMESPACE_END
| 37.741874
| 80
| 0.480217
|
maciejkotSW
|
0868d450facd44e942b5a8894b8151b4ee39fd12
| 3,169
|
cpp
|
C++
|
src/Player.cpp
|
gabrielahavranova/bomberman-game
|
bf50bbec8d1eb9dd4dfa59873ed50c06f6d7d592
|
[
"MIT"
] | null | null | null |
src/Player.cpp
|
gabrielahavranova/bomberman-game
|
bf50bbec8d1eb9dd4dfa59873ed50c06f6d7d592
|
[
"MIT"
] | null | null | null |
src/Player.cpp
|
gabrielahavranova/bomberman-game
|
bf50bbec8d1eb9dd4dfa59873ed50c06f6d7d592
|
[
"MIT"
] | null | null | null |
#include "./include/Player.h"
class Bomb;
Player::Player() {
player_src_rect = {0, 0, TILE_DIM, TILE_DIM };
player_dest_rect = {0, 0, TILE_DIM, TILE_DIM};
}
void Player::render() {
player_dest_rect.x = pos_coords2D.x;
player_dest_rect.y = pos_coords2D.y;
renderScore();
TextureManager::draw(player_texture, player_src_rect, player_dest_rect);
}
Vector2D Player::getTile2D(const int &x_pos, const int &y_pos) {
Vector2D result;
if (x_pos % 50 < 15) result.x = x_pos / 50;
else result.x = x_pos / 50 + 1;
if (y_pos % 50 < 15) result.y = y_pos / 50;
else result.y = y_pos / 50 + 1;
return result;
}
void Player::plantBomb(Map & map) {
if (bombs_active >= max_bombs ) return;
Vector2D my_tile = getTile2D(pos_coords2D.x, pos_coords2D.y);
//in the case that player wants to plant 2 bombs at the same place
if (!map.isSteppable(my_tile.x, my_tile.y)) return;
bombs_active++;
bomb_queue.emplace(SDL_GetTicks() + 3000);
Bomb(my_tile.y, my_tile.x, bomb_size, map);
}
void Player::update() {
if (!bomb_queue.empty() && bomb_queue.front() <= SDL_GetTicks()) {
bombs_active--;
bomb_queue.pop();
}
}
void Player::death() {
player_texture = dead_player_texture;
score /= 100;
updateScoreLength();
updateScoreTexture();
alive = false;
}
void Player::claimBoost(const char & boost_type) {
int old_score = score;
switch (boost_type) {
case 's':
if (speed < MAX_SPEED) speed++;
else score += 50;
break;
case 'b':
if (bomb_size < MAX_BOMB_SIZE) bomb_size++;
else score += 50;
break;
case 'c':
if (max_bombs < MAX_BOMB_CNT) max_bombs++;
else score += 50;
break;
case 'm':
score += 200;
break;
default:
break;
}
if (old_score != score) updateScoreTexture();
}
void Player::updateScoreLength() {
score_length = static_cast<int>(log10(score)) + 1;
}
void Player::renderScore() {
TextureManager::draw(name_texture, TEXT_SRC_RECT, name_dest_rect);
TextureManager::draw(score_texture, TEXT_SRC_RECT, score_dest_rect);
}
void Player::setNameTexture() {
SDL_Surface * surface = TTF_RenderText_Solid(TextureManager::font, player_name.c_str(), TextureManager::text_color);
name_texture = SDL_CreateTextureFromSurface(TextureManager::renderer, surface);
TextureManager::textures.push_back(name_texture);
SDL_FreeSurface(surface);
updateScoreTexture();
}
void Player::updateScoreTexture() {
updateScoreLength();
std::string str_score = std::to_string(score);
const char * chars_score = str_score.c_str();
SDL_Surface * surface = TTF_RenderText_Solid(TextureManager::font, chars_score, TextureManager::text_color);
score_texture = SDL_CreateTextureFromSurface(TextureManager::renderer, surface);
TextureManager::textures.push_back(score_texture);
score_dest_rect.x = name_dest_rect.x + name_dest_rect.w + TILE_DIM;
score_dest_rect.w = score_length * 30;
SDL_FreeSurface(surface);
}
| 25.97541
| 121
| 0.650363
|
gabrielahavranova
|
086e11a11f63a7e233f43322e35aaa3c8935f6b7
| 1,612
|
cpp
|
C++
|
interpreter/interpreter.cpp
|
wangyouming/DesignPatterns
|
ae3b3934480306bdce4bcbdec92553a688338fc3
|
[
"MIT"
] | 1
|
2019-11-12T09:03:17.000Z
|
2019-11-12T09:03:17.000Z
|
interpreter/interpreter.cpp
|
wangyouming/design_patterns
|
ae3b3934480306bdce4bcbdec92553a688338fc3
|
[
"MIT"
] | null | null | null |
interpreter/interpreter.cpp
|
wangyouming/design_patterns
|
ae3b3934480306bdce4bcbdec92553a688338fc3
|
[
"MIT"
] | null | null | null |
#include <iostream> // std::cout std::endl
#include <map> // std::map
using std::cout;
using std::endl;
using std::string;
class Context {
public:
void set(const string& key, bool value)
{
map_.insert({key, value});
}
bool get(const string& key)
{
return map_[key];
}
private:
std::map<string, bool> map_;
};
class Expression {
public:
virtual ~Expression() = default;
virtual bool interpret(Context*) = 0;
};
class TerminalExpression : public Expression {
public:
explicit TerminalExpression(const string& value)
: value_{value}
{
}
bool interpret(Context* context)
{
return context->get(value_);
}
private:
string value_;
};
class NonterminalExpression : public Expression {
public:
NonterminalExpression(Expression* lhs, Expression* rhs)
: lhs_{lhs}
, rhs_{rhs}
{
}
bool interpret(Context* ctx)
{
return lhs_->interpret(ctx) && rhs_->interpret(ctx);
}
private:
Expression* lhs_;
Expression* rhs_;
};
int main()
{
TerminalExpression ternimal_expression_a{"A"};
TerminalExpression ternimal_expression_b{"B"};
NonterminalExpression nonterminal_expression{&ternimal_expression_a,
&ternimal_expression_b};
Context context;
context.set("A", true);
context.set("B", false);
cout << ternimal_expression_a.interpret(&context) << " "
<< ternimal_expression_b.interpret(&context) << " "
<< nonterminal_expression.interpret(&context) << endl;
}
| 19.901235
| 73
| 0.614764
|
wangyouming
|
0874e429c80093215cb31ed8dac5a23ca3858a6e
| 1,522
|
cpp
|
C++
|
code/tst/engine/gui/visibility.cpp
|
shossjer/fimbulwinter
|
d894e4bddb5d2e6dc31a8112d245c6a1828604e3
|
[
"0BSD"
] | 3
|
2020-04-29T14:55:58.000Z
|
2020-08-20T08:43:24.000Z
|
code/tst/engine/gui/visibility.cpp
|
shossjer/fimbulwinter
|
d894e4bddb5d2e6dc31a8112d245c6a1828604e3
|
[
"0BSD"
] | 1
|
2022-03-12T11:37:46.000Z
|
2022-03-12T20:17:38.000Z
|
code/tst/engine/gui/visibility.cpp
|
shossjer/fimbulwinter
|
d894e4bddb5d2e6dc31a8112d245c6a1828604e3
|
[
"0BSD"
] | null | null | null |
#include "gui_access.hpp"
#include "engine/gui/view_refresh.hpp"
#include "engine/gui/update.hpp"
#include <catch2/catch.hpp>
SCENARIO("Adding view (show) to already updated group.", "[gui][Visibility]")
{
// this test verified a bug when working with tabs.
View group1 = ViewAccess::create_group(
Layout::RELATIVE,
Size{ { Size::FIXED, height_t{ 200 } },{ Size::FIXED, width_t{ 400 } } });
View group2 = ViewAccess::create_group(
Layout::RELATIVE,
Size{ { Size::PARENT },{ Size::PARENT } },
&group1);
ViewUpdater::update(group1, ViewUpdater::content<View::Group>(group1));
ViewUpdater::update(group2, ViewUpdater::content<View::Group>(group2));
ViewUpdater::content<View::Group>(group1).adopt(&group2);
ViewRefresh::refresh(group1);
REQUIRE(!group1.change.any());
REQUIRE(!group2.change.any());
GIVEN("a PARENT size 'child', which is added to the prev. calculated parent.")
{
View child = ViewAccess::create_child(
View::Content{ utility::in_place_type<View::Color> },
Size{ { Size::PARENT },{ Size::PARENT } },
&group2);
// child is "added" to the views.
ViewUpdater::show(child);
REQUIRE(group1.change.any());
REQUIRE(group2.change.any());
REQUIRE(child.size.height == height_t{ 0 });
REQUIRE(child.size.width == width_t{ 0 });
WHEN("the views are refreshed.")
{
ViewRefresh::refresh(group1);
THEN("the child's size should be updated")
{
REQUIRE(child.size.height == height_t{ 200 });
REQUIRE(child.size.width == width_t{ 400 });
}
}
}
}
| 28.185185
| 79
| 0.676741
|
shossjer
|
087508ef1969baea4c597ca48c0715b9050b4d45
| 3,129
|
cpp
|
C++
|
src/pal/src/misc/strutil.cpp
|
CyberSys/coreclr-mono
|
83b2cb83b32faa45b4f790237b5c5e259692294a
|
[
"MIT"
] | 277
|
2015-01-04T20:42:36.000Z
|
2022-03-21T06:52:03.000Z
|
src/pal/src/misc/strutil.cpp
|
CyberSys/coreclr-mono
|
83b2cb83b32faa45b4f790237b5c5e259692294a
|
[
"MIT"
] | 31
|
2015-01-05T08:00:38.000Z
|
2016-01-05T01:18:59.000Z
|
src/pal/src/misc/strutil.cpp
|
CyberSys/coreclr-mono
|
83b2cb83b32faa45b4f790237b5c5e259692294a
|
[
"MIT"
] | 46
|
2015-01-21T00:41:59.000Z
|
2021-03-23T07:00:01.000Z
|
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
/*++
Module Name:
strutil.cpp
Abstract:
Various string-related utility functions
--*/
#include "pal/corunix.hpp"
#include "pal/thread.hpp"
#include "pal/malloc.hpp"
#include "pal/dbgmsg.h"
SET_DEFAULT_DEBUG_CHANNEL(PAL);
using namespace CorUnix;
/*++
Function:
CPalString::CopyString
Copies a CPalString into a new (empty) instance, allocating buffer space
as necessary
Parameters:
pthr -- thread data for calling thread
psSource -- the string to copy from
--*/
PAL_ERROR
CPalString::CopyString(
CPalThread *pthr,
CPalString *psSource
)
{
PAL_ERROR palError = NO_ERROR;
_ASSERTE(NULL != psSource);
_ASSERTE(NULL == m_pwsz);
_ASSERTE(0 == m_dwStringLength);
_ASSERTE(0 == m_dwMaxLength);
if (0 != psSource->GetStringLength())
{
_ASSERTE(psSource->GetMaxLength() > psSource->GetStringLength());
WCHAR *pwsz = reinterpret_cast<WCHAR*>(
InternalMalloc(pthr, psSource->GetMaxLength() * sizeof(WCHAR))
);
if (NULL != pwsz)
{
_ASSERTE(NULL != psSource->GetString());
CopyMemory(
pwsz,
psSource->GetString(),
psSource->GetMaxLength() * sizeof(WCHAR)
);
m_pwsz = pwsz;
m_dwStringLength = psSource->GetStringLength();
m_dwMaxLength = psSource->GetMaxLength();
}
else
{
palError = ERROR_OUTOFMEMORY;
}
}
return palError;
}
/*++
Function:
CPalString::FreeBuffer
Frees the contained string buffer
Parameters:
pthr -- thread data for calling thread
--*/
void
CPalString::FreeBuffer(
CPalThread *pthr
)
{
_ASSERTE(NULL != m_pwsz);
InternalFree(pthr, const_cast<WCHAR*>(m_pwsz));
}
/*++
Function:
InternalWszNameFromSzName
Helper function to convert an ANSI string object name parameter to a
unicode string
Parameters:
pthr -- thread data for calling thread
pszName -- the ANSI string name
pwszName -- on success, receives the converted unicode string
cch -- the size of pwszName, in characters
--*/
PAL_ERROR
CorUnix::InternalWszNameFromSzName(
CPalThread *pthr,
LPCSTR pszName,
LPWSTR pwszName,
DWORD cch
)
{
PAL_ERROR palError = NO_ERROR;
_ASSERTE(NULL != pthr);
_ASSERTE(NULL != pszName);
_ASSERTE(NULL != pwszName);
_ASSERTE(0 < cch);
if (MultiByteToWideChar(CP_ACP, 0, pszName, -1, pwszName, cch) == 0)
{
palError = pthr->GetLastError();
if (ERROR_INSUFFICIENT_BUFFER == palError)
{
ERROR("pszName is larger than cch (%d)!\n", palError);
palError = ERROR_FILENAME_EXCED_RANGE;
}
else
{
ERROR("MultiByteToWideChar failure! (error=%d)\n", palError);
palError = ERROR_INVALID_PARAMETER;
}
}
return palError;
}
| 20.45098
| 102
| 0.612656
|
CyberSys
|
0876b21d67c4098018aa913f8ca45d32be2b96e2
| 11,174
|
cc
|
C++
|
src/openvslam/match/bow_tree.cc
|
Ling-Bao/openvslam
|
8e891482c1950be3bbf1c0565299bc8c6e5d9910
|
[
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | 2
|
2019-06-15T15:25:54.000Z
|
2021-09-22T07:40:12.000Z
|
src/openvslam/match/bow_tree.cc
|
Ling-Bao/openvslam
|
8e891482c1950be3bbf1c0565299bc8c6e5d9910
|
[
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | null | null | null |
src/openvslam/match/bow_tree.cc
|
Ling-Bao/openvslam
|
8e891482c1950be3bbf1c0565299bc8c6e5d9910
|
[
"Apache-2.0",
"BSD-2-Clause",
"MIT"
] | 1
|
2019-10-24T08:42:22.000Z
|
2019-10-24T08:42:22.000Z
|
#include "openvslam/match/bow_tree.h"
#include "openvslam/data/frame.h"
#include "openvslam/data/keyframe.h"
#include "openvslam/data/landmark.h"
#ifdef USE_DBOW2
#include <DBoW2/FeatureVector.h>
#else
#include <fbow/fbow.h>
#endif
namespace openvslam {
namespace match {
unsigned int bow_tree::match_frame_and_keyframe(data::keyframe* keyfrm, data::frame& frm, std::vector<data::landmark*>& matched_lms_in_frm) const {
unsigned int num_matches = 0;
std::array<std::vector<int>, HISTOGRAM_LENGTH> orientation_histogram;
for (auto& bin : orientation_histogram) {
bin.reserve(500);
}
matched_lms_in_frm = std::vector<data::landmark*>(frm.num_keypts_, nullptr);
const auto keyfrm_lms = keyfrm->get_landmarks();
#ifdef USE_DBOW2
DBoW2::FeatureVector::const_iterator keyfrm_itr = keyfrm->bow_feat_vec_.begin();
DBoW2::FeatureVector::const_iterator frm_itr = frm.bow_feat_vec_.begin();
const DBoW2::FeatureVector::const_iterator kryfrm_end = keyfrm->bow_feat_vec_.end();
const DBoW2::FeatureVector::const_iterator frm_end = frm.bow_feat_vec_.end();
#else
fbow::BoWFeatVector::const_iterator keyfrm_itr = keyfrm->bow_feat_vec_.begin();
fbow::BoWFeatVector::const_iterator frm_itr = frm.bow_feat_vec_.begin();
const fbow::BoWFeatVector::const_iterator kryfrm_end = keyfrm->bow_feat_vec_.end();
const fbow::BoWFeatVector::const_iterator frm_end = frm.bow_feat_vec_.end();
#endif
while (keyfrm_itr != kryfrm_end && frm_itr != frm_end) {
// BoW treeのノード番号(first)が一致しているか確認する
if (keyfrm_itr->first == frm_itr->first) {
// BoW treeのノード番号(first)が一致していれば,
// 実際に特徴点index(second)を持ってきて対応しているか確認する
const auto& keyfrm_indices = keyfrm_itr->second;
const auto& frm_indices = frm_itr->second;
for (const auto keyfrm_idx : keyfrm_indices) {
// keyfrm_idxの特徴点と3次元点が対応していない場合はスルーする
auto* lm = keyfrm_lms.at(keyfrm_idx);
if (!lm) {
continue;
}
if (lm->will_be_erased()) {
continue;
}
const auto& keyfrm_desc = keyfrm->descriptors_.row(keyfrm_idx);
unsigned int best_hamm_dist = MAX_HAMMING_DIST;
int best_frm_idx = -1;
unsigned int second_best_hamm_dist = MAX_HAMMING_DIST;
for (const auto frm_idx : frm_indices) {
if (matched_lms_in_frm.at(frm_idx)) {
continue;
}
const auto& frm_desc = frm.descriptors_.row(frm_idx);
const auto hamm_dist = compute_descriptor_distance_32(keyfrm_desc, frm_desc);
if (hamm_dist < best_hamm_dist) {
second_best_hamm_dist = best_hamm_dist;
best_hamm_dist = hamm_dist;
best_frm_idx = frm_idx;
}
else if (hamm_dist < second_best_hamm_dist) {
second_best_hamm_dist = hamm_dist;
}
}
if (HAMMING_DIST_THR_LOW < best_hamm_dist) {
continue;
}
// ratio test
if (lowe_ratio_ * second_best_hamm_dist < static_cast<float>(best_hamm_dist)) {
continue;
}
matched_lms_in_frm.at(best_frm_idx) = lm;
if (check_orientation_) {
const auto& keypt = keyfrm->keypts_.at(keyfrm_idx);
auto delta_angle = keypt.angle - frm.keypts_.at(best_frm_idx).angle;
if (delta_angle < 0.0) {
delta_angle += 360.0;
}
if (360.0 <= delta_angle) {
delta_angle -= 360.0;
}
const auto bin = static_cast<unsigned int>(cvRound(delta_angle * INV_HISTOGRAM_LENGTH));
assert(bin < HISTOGRAM_LENGTH);
orientation_histogram.at(bin).push_back(best_frm_idx);
}
++num_matches;
}
++keyfrm_itr;
++frm_itr;
}
else if (keyfrm_itr->first < frm_itr->first) {
// keyfrm_itrのノード番号のほうが小さいので,ノード番号が合うところまでイテレータkeyfrm_itrをすすめる
keyfrm_itr = keyfrm->bow_feat_vec_.lower_bound(frm_itr->first);
}
else {
// frm_itrのノード番号のほうが小さいので,ノード番号が合うところまでイテレータfrm_itrをすすめる
frm_itr = frm.bow_feat_vec_.lower_bound(keyfrm_itr->first);
}
}
if (check_orientation_) {
const auto bins = index_sort_by_size(orientation_histogram);
// ヒストグラムのbinのうち,ヒストグラムの上位n個に入っているもののみを有効にする
for (unsigned int bin = 0; bin < HISTOGRAM_LENGTH; ++bin) {
const bool is_valid_match = std::any_of(bins.begin(), bins.begin() + NUM_BINS_THR,
[bin](const unsigned int i){ return bin == i; });
if (is_valid_match) {
continue;
}
for (const auto invalid_idx : orientation_histogram.at(bin)) {
matched_lms_in_frm.at(invalid_idx) = nullptr;
--num_matches;
}
}
}
return num_matches;
}
unsigned int bow_tree::match_keyframes(data::keyframe* keyfrm_1, data::keyframe* keyfrm_2, std::vector<data::landmark*>& matched_lms_in_keyfrm_1) const {
unsigned int num_matches = 0;
std::array<std::vector<int>, HISTOGRAM_LENGTH> orientation_histogram;
for (auto& bin : orientation_histogram) {
bin.reserve(500);
}
const auto keyfrm_1_lms = keyfrm_1->get_landmarks();
const auto keyfrm_2_lms = keyfrm_2->get_landmarks();
matched_lms_in_keyfrm_1 = std::vector<data::landmark*>(keyfrm_1_lms.size(), nullptr);
// keyframe2の特徴点のうち,keyfram1の特徴点と対応が取れているものはtrueにする
// NOTE: sizeはkeyframe2の特徴点に一致
std::vector<bool> is_already_matched_in_keyfrm_2(keyfrm_2_lms.size(), false);
#ifdef USE_DBOW2
DBoW2::FeatureVector::const_iterator itr_1 = keyfrm_1->bow_feat_vec_.begin();
DBoW2::FeatureVector::const_iterator itr_2 = keyfrm_2->bow_feat_vec_.begin();
const DBoW2::FeatureVector::const_iterator itr_1_end = keyfrm_1->bow_feat_vec_.end();
const DBoW2::FeatureVector::const_iterator itr_2_end = keyfrm_2->bow_feat_vec_.end();
#else
fbow::BoWFeatVector::const_iterator itr_1 = keyfrm_1->bow_feat_vec_.begin();
fbow::BoWFeatVector::const_iterator itr_2 = keyfrm_2->bow_feat_vec_.begin();
const fbow::BoWFeatVector::const_iterator itr_1_end = keyfrm_1->bow_feat_vec_.end();
const fbow::BoWFeatVector::const_iterator itr_2_end = keyfrm_2->bow_feat_vec_.end();
#endif
while (itr_1 != itr_1_end && itr_2 != itr_2_end) {
// BoW treeのノード番号(first)が一致しているか確認する
if (itr_1->first == itr_2->first) {
// BoW treeのノード番号(first)が一致していれば,
// 実際に特徴点index(second)を持ってきて対応しているか確認する
const auto& keyfrm_1_indices = itr_1->second;
const auto& keyfrm_2_indices = itr_2->second;
for (const auto idx_1 : keyfrm_1_indices) {
// keyfrm_1の特徴点と3次元点が対応していない場合はスルーする
auto* lm_1 = keyfrm_1_lms.at(idx_1);
if (!lm_1) {
continue;
}
if (lm_1->will_be_erased()) {
continue;
}
const auto& desc_1 = keyfrm_1->descriptors_.row(idx_1);
unsigned int best_hamm_dist = MAX_HAMMING_DIST;
int best_idx_2 = -1;
unsigned int second_best_hamm_dist = MAX_HAMMING_DIST;
for (const auto idx_2 : keyfrm_2_indices) {
// keyfrm_2の特徴点と3次元点が対応していない場合はスルーする
auto* lm_2 = keyfrm_2_lms.at(idx_2);
if (!lm_2) {
continue;
}
if (lm_2->will_be_erased()) {
continue;
}
if (is_already_matched_in_keyfrm_2.at(idx_2)) {
continue;
}
const auto& desc_2 = keyfrm_2->descriptors_.row(idx_2);
const auto hamm_dist = compute_descriptor_distance_32(desc_1, desc_2);
if (hamm_dist < best_hamm_dist) {
second_best_hamm_dist = best_hamm_dist;
best_hamm_dist = hamm_dist;
best_idx_2 = idx_2;
}
else if (hamm_dist < second_best_hamm_dist) {
second_best_hamm_dist = hamm_dist;
}
}
if (HAMMING_DIST_THR_LOW < best_hamm_dist) {
continue;
}
// ratio test
if (lowe_ratio_ * second_best_hamm_dist < static_cast<float>(best_hamm_dist)) {
continue;
}
// 対応情報を記録する
// keyframe1のidx_1とkeyframe2のbest_idx_2が対応している
matched_lms_in_keyfrm_1.at(idx_1) = keyfrm_2_lms.at(best_idx_2);
// keyframe2のbest_idx_2はすでにkeyframe1の特徴点と対応している
is_already_matched_in_keyfrm_2.at(best_idx_2) = true;
if (check_orientation_) {
auto delta_angle = keyfrm_1->keypts_.at(idx_1).angle - keyfrm_2->keypts_.at(best_idx_2).angle;
if (delta_angle < 0.0) {
delta_angle += 360.0;
}
if (360.0 <= delta_angle) {
delta_angle -= 360.0;
}
const auto bin = static_cast<unsigned int>(cvRound(delta_angle * INV_HISTOGRAM_LENGTH));
assert(bin < HISTOGRAM_LENGTH);
orientation_histogram.at(bin).push_back(idx_1);
}
num_matches++;
}
++itr_1;
++itr_2;
}
else if (itr_1->first < itr_2->first) {
itr_1 = keyfrm_1->bow_feat_vec_.lower_bound(itr_2->first);
}
else {
itr_2 = keyfrm_2->bow_feat_vec_.lower_bound(itr_1->first);
}
}
if (check_orientation_) {
const auto bins = index_sort_by_size(orientation_histogram);
// ヒストグラムのbinのうち,ヒストグラムの上位n個に入っているもののみを有効にする
for (unsigned int bin = 0; bin < HISTOGRAM_LENGTH; ++bin) {
const bool is_valid_match = std::any_of(bins.begin(), bins.begin() + NUM_BINS_THR,
[bin](const unsigned int i){ return bin == i; });
if (is_valid_match) {
continue;
}
for (const auto invalid_idx : orientation_histogram.at(bin)) {
matched_lms_in_keyfrm_1.at(invalid_idx) = nullptr;
--num_matches;
}
}
}
return num_matches;
}
} // namespace match
} // namespace openvslam
| 38.136519
| 153
| 0.563809
|
Ling-Bao
|
08772ee8d1714875946cd401bc3af2f58a414ec8
| 38,861
|
cpp
|
C++
|
src/protocols/mqtt5/Mqtt5Serialization.cpp
|
mnaveedb/finalmq
|
3c3b2b213fa07bb5427a1364796b19d732890ed2
|
[
"MIT"
] | null | null | null |
src/protocols/mqtt5/Mqtt5Serialization.cpp
|
mnaveedb/finalmq
|
3c3b2b213fa07bb5427a1364796b19d732890ed2
|
[
"MIT"
] | null | null | null |
src/protocols/mqtt5/Mqtt5Serialization.cpp
|
mnaveedb/finalmq
|
3c3b2b213fa07bb5427a1364796b19d732890ed2
|
[
"MIT"
] | null | null | null |
//MIT License
//Copyright (c) 2020 bexoft GmbH (mail@bexoft.de)
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all
//copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//SOFTWARE.
#include "finalmq/protocols/mqtt5/Mqtt5Serialization.h"
#include "finalmq/protocols/mqtt5/Mqtt5Properties.h"
#include "finalmq/variant/VariantValues.h"
namespace finalmq {
static const ssize_t HEADERSIZE = 1;
#define HEADER_Low4bits(header) (((header) >> 0) & 0x0f)
#define HEADER_Dup(header) (((header) >> 3) & 0x01)
#define HEADER_QoS(header) (((header) >> 1) & 0x03)
#define HEADER_Retain(header) (((header) >> 0) & 0x01)
#define HEADER_SetCommand(value) ((static_cast<unsigned int>(value) & 0x0f) << 4)
#define HEADER_SetLow4bits(value) (((value) & 0x0f) << 0)
#define HEADER_SetDup(value) (((value) & 0x01) << 3)
#define HEADER_SetQoS(value) (((value) & 0x03) << 1)
#define HEADER_SetRetain(value) (((value) & 0x01) << 0)
#define CF_UserName(flags) (((flags) >> 7) & 0x01)
#define CF_Password(flags) (((flags) >> 6) & 0x01)
#define CF_WillRetain(flags) (((flags) >> 5) & 0x01)
#define CF_WillQoS(flags) (((flags) >> 3) & 0x03)
#define CF_WillFlag(flags) (((flags) >> 2) & 0x01)
#define CF_CleanStart(flags) (((flags) >> 1) & 0x01)
#define CF_SetUserName(value) (((value) & 0x01) << 7)
#define CF_SetPassword(value) (((value) & 0x01) << 6)
#define CF_SetWillRetain(value) (((value) & 0x01) << 5)
#define CF_SetWillQoS(value) (((value) & 0x03) << 3)
#define CF_SetWillFlag(value) (((value) & 0x01) << 2)
#define CF_SetCleanStart(value) (((value) & 0x01) << 1)
Mqtt5Serialization::Mqtt5Serialization(char* buffer, unsigned int sizeBuffer, unsigned int indexBuffer)
: m_buffer(reinterpret_cast<std::uint8_t*>(buffer))
, m_sizeBuffer(sizeBuffer)
, m_indexBuffer(indexBuffer)
{
}
unsigned int Mqtt5Serialization::getReadIndex() const
{
return m_indexBuffer;
}
bool Mqtt5Serialization::deserializeConnect(Mqtt5ConnectData& data)
{
if (HEADER_Low4bits(m_buffer[0]) != 0)
{
return false;
}
// protocol
bool ok = readString(data.protocol);
if (!ok || data.protocol != "MQTT")
{
return false;
}
// version
ok = read1ByteNumber(data.version);
if (!ok || data.version != 5)
{
return false;
}
// connect flags
unsigned int connectFlags = 0;
ok = read1ByteNumber(connectFlags);
if (!ok)
{
return false;
}
// keep alive
ok = read2ByteNumber(data.keepAlive);
if (!ok)
{
return false;
}
// properties
ok = readProperties(data.properties, data.metainfo);
if (!ok)
{
return false;
}
// client ID
ok = readString(data.clientId);
if (!ok)
{
return false;
}
// will message
if (CF_WillFlag(connectFlags))
{
data.willMessage = std::make_unique<Mqtt5WillMessage>();
// will properties
ok = readProperties(data.willMessage->properties, data.willMessage->metainfo);
if (!ok)
{
return false;
}
// will topic
ok = readString(data.willMessage->topic);
if (!ok)
{
return false;
}
// will payload
ok = readBinary(data.willMessage->payload);
if (!ok)
{
return false;
}
data.willMessage->retain = CF_WillRetain(connectFlags);
data.willMessage->qos = CF_WillQoS(connectFlags);
}
// username
if (CF_UserName(connectFlags))
{
ok = readString(data.username);
if (!ok)
{
return false;
}
}
// password
if (CF_Password(connectFlags))
{
ok = readString(data.password);
if (!ok)
{
return false;
}
}
data.cleanStart = CF_CleanStart(connectFlags);
return ok;
}
unsigned int Mqtt5Serialization::sizeConnect(const Mqtt5ConnectData& data, unsigned int& sizePropPayload, unsigned int& sizePropWillMessage)
{
unsigned int size = 0;
// protocol
size += sizeString("MQTT");
// version (1), connect flags (1), keep alive (2)
size += 1 + 1 + 2;
// properties
size += sizeProperties(data.properties, data.metainfo, sizePropPayload);
// client ID
size += sizeString(data.clientId);
// will message
sizePropWillMessage = 0;
if (data.willMessage)
{
// will properties
size += sizeProperties(data.willMessage->properties, data.willMessage->metainfo, sizePropWillMessage);
// will topic
size += sizeString(data.willMessage->topic);
// will payload
size += sizeBinary(data.willMessage->payload);
}
// username
if (!data.username.empty())
{
size += sizeString(data.username);
}
// password
if (!data.password.empty())
{
size += sizeString(data.password);
}
return size;
}
void Mqtt5Serialization::serializeConnect(const Mqtt5ConnectData& data, unsigned int sizePayload, unsigned int sizePropPayload, unsigned int sizePropWillMessage)
{
unsigned int header = HEADER_SetCommand(Mqtt5Command::COMMAND_CONNECT);
write1ByteNumber(header);
writeVarByteNumber(sizePayload);
// protocol
writeString("MQTT");
// version
write1ByteNumber(5);
// connect flags
unsigned int connectFlags = 0;
if (data.willMessage)
{
connectFlags |= CF_SetWillFlag(1);
connectFlags |= CF_SetWillRetain(data.willMessage->retain ? 1 : 0);
connectFlags |= CF_SetWillQoS(data.willMessage->qos);
}
if (!data.username.empty())
{
connectFlags |= CF_SetUserName(1);
}
if (!data.password.empty())
{
connectFlags |= CF_SetPassword(1);
}
connectFlags |= CF_SetCleanStart(data.cleanStart ? 1 : 0);
write1ByteNumber(connectFlags);
// keep alive
write2ByteNumber(data.keepAlive);
// properties
writeProperties(data.properties, data.metainfo, sizePropPayload);
// client ID
writeString(data.clientId);
// will message
if (data.willMessage)
{
// will properties
writeProperties(data.willMessage->properties, data.willMessage->metainfo, sizePropWillMessage);
// will topic
writeString(data.willMessage->topic);
// will payload
writeBinary(data.willMessage->payload);
}
// username
if (!data.username.empty())
{
writeString(data.username);
}
// password
if (!data.password.empty())
{
writeString(data.password);
}
assert(m_indexBuffer == m_sizeBuffer);
}
#define CAF_SessionPresent(flags) (((flags) & 0x01) >> 0)
#define CAF_SetSessionPresent(value) (((value) & 0x01) << 1)
bool Mqtt5Serialization::deserializeConnAck(Mqtt5ConnAckData& data)
{
if (HEADER_Low4bits(m_buffer[0]) != 0)
{
return false;
}
// connect ack flags
unsigned int connackflags = 0;
bool ok = read1ByteNumber(connackflags);
if (!ok)
{
return false;
}
data.sessionPresent = CAF_SessionPresent(connackflags);
// reason code
ok = read1ByteNumber(data.reasoncode);
if (!ok)
{
return false;
}
// properties
ok = readProperties(data.properties, data.metainfo);
if (!ok)
{
return false;
}
return ok;
}
unsigned int Mqtt5Serialization::sizeConnAck(const Mqtt5ConnAckData& data, unsigned int& sizePropPayload)
{
unsigned int size = 0;
// connect ack flags (1), reason code (1)
size += 1 + 1;
// properties
size += sizeProperties(data.properties, data.metainfo, sizePropPayload);
return size;
}
void Mqtt5Serialization::serializeConnAck(const Mqtt5ConnAckData& data, unsigned int sizePayload, unsigned int sizePropPayload)
{
unsigned int header = HEADER_SetCommand(Mqtt5Command::COMMAND_CONNACK);
write1ByteNumber(header);
writeVarByteNumber(sizePayload);
// connect ack flags
unsigned int connackflags = 0;
connackflags |= CAF_SetSessionPresent(data.sessionPresent);
write1ByteNumber(connackflags);
// reason code
write1ByteNumber(data.reasoncode);
// properties
writeProperties(data.properties, data.metainfo, sizePropPayload);
assert(m_indexBuffer == m_sizeBuffer);
}
bool Mqtt5Serialization::deserializePublish(Mqtt5PublishData& data)
{
data.qos = HEADER_QoS(m_buffer[0]);
data.dup = HEADER_Dup(m_buffer[0]);
data.retain = HEADER_Retain(m_buffer[0]);
// topic name
bool ok = readString(data.topic);
if (!ok)
{
return false;
}
// packet identifier
if (data.qos > 0)
{
ok = read2ByteNumber(data.packetId);
if (!ok)
{
return false;
}
}
// properties
ok = readProperties(data.properties, data.metainfo);
if (!ok)
{
return false;
}
return ok;
}
unsigned int Mqtt5Serialization::sizePublish(const Mqtt5PublishData& data, unsigned int& sizePropPayload)
{
unsigned int size = 0;
// topic name
size += sizeString(data.topic);
// packet identifier
if (data.qos > 0)
{
size += 2;
}
// properties
size += sizeProperties(data.properties, data.metainfo, sizePropPayload);
return size;
}
void Mqtt5Serialization::serializePublish(const Mqtt5PublishData& data, unsigned int sizePayload, unsigned int sizePropPayload, std::uint8_t*& bufferPacketId)
{
bufferPacketId = nullptr;
unsigned int header = 0;
header |= HEADER_SetCommand(Mqtt5Command::COMMAND_PUBLISH);
header |= HEADER_SetQoS(data.qos);
header |= HEADER_SetDup(data.dup);
header |= HEADER_SetRetain(data.retain);
write1ByteNumber(header);
writeVarByteNumber(sizePayload);
// topic name
writeString(data.topic);
// packet identifier
if (data.qos > 0)
{
bufferPacketId = &m_buffer[m_indexBuffer];
write2ByteNumber(data.packetId);
}
// properties
writeProperties(data.properties, data.metainfo, sizePropPayload);
assert(m_indexBuffer == m_sizeBuffer);
}
bool Mqtt5Serialization::deserializePubAck(Mqtt5PubAckData& data, Mqtt5Command command)
{
if (command == Mqtt5Command::COMMAND_PUBREL)
{
if (HEADER_Low4bits(m_buffer[0]) != 0x02)
{
return false;
}
}
else
{
if (HEADER_Low4bits(m_buffer[0]) != 0x00)
{
return false;
}
}
// packet identifier
bool ok = read2ByteNumber(data.packetId);
if (!ok)
{
return false;
}
if (doesFit(1))
{
// reason code
ok = read1ByteNumber(data.reasoncode);
if (!ok)
{
return false;
}
// properties
ok = readProperties(data.properties, data.metainfo);
if (!ok)
{
return false;
}
}
return ok;
}
unsigned int Mqtt5Serialization::sizePubAck(const Mqtt5PubAckData& data, unsigned int& sizePropPayload)
{
unsigned int size = 0;
// packet identifier
size += 2;
if (data.reasoncode != 0 || !data.properties.empty() || !data.metainfo.empty())
{
// reason code
size += 1;
// properties
size += sizeProperties(data.properties, data.metainfo, sizePropPayload);
}
return size;
}
void Mqtt5Serialization::serializePubAck(const Mqtt5PubAckData& data, Mqtt5Command command, unsigned int sizePayload, unsigned int sizePropPayload)
{
unsigned int header = 0;
header |= HEADER_SetCommand(command);
if (command == Mqtt5Command::COMMAND_PUBREL)
{
header |= HEADER_SetLow4bits(0x02);
}
write1ByteNumber(header);
writeVarByteNumber(sizePayload);
// packet identifier
write2ByteNumber(data.packetId);
if (data.reasoncode != 0 || !data.properties.empty() || !data.metainfo.empty())
{
// reason code
write1ByteNumber(data.reasoncode);
// properties
writeProperties(data.properties, data.metainfo, sizePropPayload);
}
assert(m_indexBuffer == m_sizeBuffer);
}
#define SO_RetainHandling(flags) (((flags) >> 4) & 0x03)
#define SO_RetainAsPublished(flags) (((flags) >> 3) & 0x01)
#define SO_NoLocal(flags) (((flags) >> 2) & 0x01)
#define SO_QoS(flags) (((flags) >> 0) & 0x03)
#define SO_SetRetainHandling(value) (((value) & 0x03) << 4)
#define SO_SetRetainAsPublished(value) (((value) & 0x01) << 3)
#define SO_SetNoLocal(value) (((value) & 0x01) << 2)
#define SO_SetQoS(value) (((value) & 0x03) << 0)
bool Mqtt5Serialization::deserializeSubscribe(Mqtt5SubscribeData& data)
{
if (HEADER_Low4bits(m_buffer[0]) != 0x02)
{
return false;
}
// packet identifier
bool ok = read2ByteNumber(data.packetId);
if (!ok)
{
return false;
}
// properties
ok = readProperties(data.properties, data.metainfo);
if (!ok)
{
return false;
}
// at least one subscription must be available
if (!doesFit(1))
{
return false;
}
while (doesFit(1))
{
Mqtt5SubscribeEntry entry;
ok = readString(entry.topic);
if (!ok)
{
return false;
}
unsigned int option = 0;
ok = read1ByteNumber(option);
if (!ok)
{
return false;
}
entry.retainHandling = SO_RetainHandling(option);
entry.retainAsPublished = SO_RetainAsPublished(option);
entry.noLocal = SO_NoLocal(option);
entry.qos = SO_QoS(option);
data.subscriptions.emplace_back(std::move(entry));
}
return ok;
}
unsigned int Mqtt5Serialization::sizeSubscribe(const Mqtt5SubscribeData& data, unsigned int& sizePropPayload)
{
unsigned int size = 0;
// packet identifier
size += 2;
// properties
size += sizeProperties(data.properties, data.metainfo, sizePropPayload);
// at least one subscription must be available
assert(!data.subscriptions.empty());
for (size_t i = 0; i < data.subscriptions.size(); ++i)
{
const Mqtt5SubscribeEntry& entry = data.subscriptions[i];
size += sizeString(entry.topic);
}
// options
size += static_cast<unsigned int>(data.subscriptions.size());
return size;
}
void Mqtt5Serialization::serializeSubscribe(const Mqtt5SubscribeData& data, unsigned int sizePayload, unsigned int sizePropPayload, std::uint8_t*& bufferPacketId)
{
unsigned int header = 0;
header |= HEADER_SetCommand(Mqtt5Command::COMMAND_SUBSCRIBE);
header |= HEADER_SetLow4bits(0x02);
write1ByteNumber(header);
writeVarByteNumber(sizePayload);
// packet identifier
bufferPacketId = &m_buffer[m_indexBuffer];
write2ByteNumber(data.packetId);
// properties
writeProperties(data.properties, data.metainfo, sizePropPayload);
// at least one subscription must be available
assert(!data.subscriptions.empty());
for (size_t i = 0; i < data.subscriptions.size(); ++i)
{
const Mqtt5SubscribeEntry& entry = data.subscriptions[i];
writeString(entry.topic);
unsigned int option = 0;
option |= SO_SetRetainHandling(entry.retainHandling);
option |= SO_SetRetainAsPublished(entry.retainAsPublished);
option |= SO_SetNoLocal(entry.noLocal);
option |= SO_SetQoS(entry.qos);
write1ByteNumber(option);
}
assert(m_indexBuffer == m_sizeBuffer);
}
bool Mqtt5Serialization::deserializeSubAck(Mqtt5SubAckData& data)
{
if (HEADER_Low4bits(m_buffer[0]) != 0x00)
{
return false;
}
// packet identifier
bool ok = read2ByteNumber(data.packetId);
if (!ok)
{
return false;
}
// properties
ok = readProperties(data.properties, data.metainfo);
if (!ok)
{
return false;
}
// at least one ack must be available
if (!doesFit(1))
{
return false;
}
while (doesFit(1))
{
unsigned int reasoncode = 0x80;
ok = read1ByteNumber(reasoncode);
if (!ok)
{
return false;
}
data.reasoncodes.push_back(reasoncode);
}
return ok;
}
unsigned int Mqtt5Serialization::sizeSubAck(const Mqtt5SubAckData& data, unsigned int& sizePropPayload)
{
unsigned int size = 0;
// packet identifier
size += 2;
// properties
size += sizeProperties(data.properties, data.metainfo, sizePropPayload);
// at least one ack must be available
assert(!data.reasoncodes.empty());
size += static_cast<unsigned int>(data.reasoncodes.size());
return size;
}
void Mqtt5Serialization::serializeSubAck(const Mqtt5SubAckData& data, Mqtt5Command command, unsigned int sizePayload, unsigned int sizePropPayload)
{
unsigned int header = HEADER_SetCommand(command);
write1ByteNumber(header);
writeVarByteNumber(sizePayload);
// packet identifier
write2ByteNumber(data.packetId);
// properties
writeProperties(data.properties, data.metainfo, sizePropPayload);
// at least one ack must be available
assert(!data.reasoncodes.empty());
for (size_t i = 0; i < data.reasoncodes.size(); ++i)
{
unsigned int reasoncode = data.reasoncodes[i];
write1ByteNumber(reasoncode);
}
assert(m_indexBuffer == m_sizeBuffer);
}
bool Mqtt5Serialization::deserializeUnsubscribe(Mqtt5UnsubscribeData& data)
{
if (HEADER_Low4bits(m_buffer[0]) != 0x02)
{
return false;
}
// packet identifier
bool ok = read2ByteNumber(data.packetId);
if (!ok)
{
return false;
}
// properties
ok = readProperties(data.properties, data.metainfo);
if (!ok)
{
return false;
}
// at least one unsubscription must be available
if (!doesFit(1))
{
return false;
}
while (doesFit(1))
{
std::string topic;
ok = readString(topic);
if (!ok)
{
return false;
}
data.topics.emplace_back(std::move(topic));
}
return ok;
}
unsigned int Mqtt5Serialization::sizeUnsubscribe(const Mqtt5UnsubscribeData& data, unsigned int& sizePropPayload)
{
unsigned int size = 0;
// packet identifier
size += 2;
// properties
size += sizeProperties(data.properties, data.metainfo, sizePropPayload);
// at least one unsubscription must be available
assert(!data.topics.empty());
for (size_t i = 0; i < data.topics.size(); ++i)
{
const std::string& topic = data.topics[i];
size += sizeString(topic);
}
return size;
}
void Mqtt5Serialization::serializeUnsubscribe(const Mqtt5UnsubscribeData& data, unsigned int sizePayload, unsigned int sizePropPayload, std::uint8_t*& bufferPacketId)
{
unsigned int header = 0;
header |= HEADER_SetCommand(Mqtt5Command::COMMAND_UNSUBSCRIBE);
header |= HEADER_SetLow4bits(0x02);
write1ByteNumber(header);
writeVarByteNumber(sizePayload);
// packet identifier
bufferPacketId = &m_buffer[m_indexBuffer];
write2ByteNumber(data.packetId);
// properties
writeProperties(data.properties, data.metainfo, sizePropPayload);
// at least one unsubscription must be available
assert(!data.topics.empty());
for (size_t i = 0; i < data.topics.size(); ++i)
{
const std::string& topic = data.topics[i];
writeString(topic);
}
assert(m_indexBuffer == m_sizeBuffer);
}
void Mqtt5Serialization::serializePingReq()
{
unsigned int header = HEADER_SetCommand(Mqtt5Command::COMMAND_PINGREQ);
write1ByteNumber(header);
writeVarByteNumber(0);
assert(m_indexBuffer == m_sizeBuffer);
}
void Mqtt5Serialization::serializePingResp()
{
unsigned int header = HEADER_SetCommand(Mqtt5Command::COMMAND_PINGRESP);
write1ByteNumber(header);
writeVarByteNumber(0);
assert(m_indexBuffer == m_sizeBuffer);
}
bool Mqtt5Serialization::deserializeDisconnect(Mqtt5DisconnectData& data)
{
if (HEADER_Low4bits(m_buffer[0]) != 0x00)
{
return false;
}
bool ok = true;
if (doesFit(1))
{
// reason code
ok = read1ByteNumber(data.reasoncode);
if (!ok)
{
return false;
}
// properties
ok = readProperties(data.properties, data.metainfo);
if (!ok)
{
return false;
}
}
return ok;
}
unsigned int Mqtt5Serialization::sizeDisconnect(const Mqtt5DisconnectData& data, unsigned int& sizePropPayload)
{
unsigned int size = 0;
if (data.reasoncode != 0 || !data.properties.empty() || !data.metainfo.empty())
{
// reason code
size += 1;
// properties
size += sizeProperties(data.properties, data.metainfo, sizePropPayload);
}
return size;
}
void Mqtt5Serialization::serializeDisconnect(const Mqtt5DisconnectData& data, unsigned int sizePayload, unsigned int sizePropPayload)
{
unsigned int header = HEADER_SetCommand(Mqtt5Command::COMMAND_DISCONNECT);
write1ByteNumber(header);
writeVarByteNumber(sizePayload);
if (data.reasoncode != 0 || !data.properties.empty() || !data.metainfo.empty())
{
// reason code
write1ByteNumber(data.reasoncode);
// properties
writeProperties(data.properties, data.metainfo, sizePropPayload);
}
assert(m_indexBuffer == m_sizeBuffer);
}
bool Mqtt5Serialization::deserializeAuth(Mqtt5AuthData& data)
{
if (HEADER_Low4bits(m_buffer[0]) != 0x00)
{
return false;
}
bool ok = true;
if (doesFit(1))
{
// reason code
ok = read1ByteNumber(data.reasoncode);
if (!ok)
{
return false;
}
// properties
ok = readProperties(data.properties, data.metainfo);
if (!ok)
{
return false;
}
}
return ok;
}
unsigned int Mqtt5Serialization::sizeAuth(const Mqtt5AuthData& data, unsigned int& sizePropPayload)
{
unsigned int size = 0;
if (data.reasoncode != 0 || !data.properties.empty() || !data.metainfo.empty())
{
// reason code
size += 1;
// properties
size += sizeProperties(data.properties, data.metainfo, sizePropPayload);
}
return size;
}
void Mqtt5Serialization::serializeAuth(const Mqtt5AuthData& data, unsigned int sizePayload, unsigned int sizePropPayload)
{
unsigned int header = HEADER_SetCommand(Mqtt5Command::COMMAND_AUTH);
write1ByteNumber(header);
writeVarByteNumber(sizePayload);
if (data.reasoncode != 0 || !data.properties.empty() || !data.metainfo.empty())
{
// reason code
write1ByteNumber(data.reasoncode);
// properties
writeProperties(data.properties, data.metainfo, sizePropPayload);
}
assert(m_indexBuffer == m_sizeBuffer);
}
bool Mqtt5Serialization::doesFit(int size) const
{
bool ok = (m_indexBuffer + size <= m_sizeBuffer);
return ok;
}
bool Mqtt5Serialization::read1ByteNumber(unsigned int& number)
{
if (doesFit(1))
{
unsigned int byte1 = m_buffer[m_indexBuffer];
++m_indexBuffer;
number = byte1;
return true;
}
number = 0;
return false;
}
void Mqtt5Serialization::write1ByteNumber(unsigned int number)
{
assert(m_indexBuffer + 1 <= m_sizeBuffer);
m_buffer[m_indexBuffer] = number & 0xff;
++m_indexBuffer;
}
bool Mqtt5Serialization::read2ByteNumber(unsigned int& number)
{
if (doesFit(2))
{
unsigned int byte1 = m_buffer[m_indexBuffer];
++m_indexBuffer;
unsigned int byte2 = m_buffer[m_indexBuffer];
++m_indexBuffer;
number = (byte1 << 8) | byte2;
return true;
}
number = 0;
return false;
}
void Mqtt5Serialization::write2ByteNumber(unsigned int number)
{
assert(m_indexBuffer + 2 <= m_sizeBuffer);
m_buffer[m_indexBuffer] = (number >> 8) & 0xff;
++m_indexBuffer;
m_buffer[m_indexBuffer] = (number >> 0) & 0xff;
++m_indexBuffer;
}
bool Mqtt5Serialization::read4ByteNumber(unsigned int& number)
{
if (doesFit(4))
{
unsigned int byte1 = m_buffer[m_indexBuffer];
++m_indexBuffer;
unsigned int byte2 = m_buffer[m_indexBuffer];
++m_indexBuffer;
unsigned int byte3 = m_buffer[m_indexBuffer];
++m_indexBuffer;
unsigned int byte4 = m_buffer[m_indexBuffer];
++m_indexBuffer;
number = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4;
return true;
}
number = 0;
return false;
}
void Mqtt5Serialization::write4ByteNumber(unsigned int number)
{
assert(m_indexBuffer + 4 <= m_sizeBuffer);
m_buffer[m_indexBuffer] = (number >> 24) & 0xff;
++m_indexBuffer;
m_buffer[m_indexBuffer] = (number >> 16) & 0xff;
++m_indexBuffer;
m_buffer[m_indexBuffer] = (number >> 8) & 0xff;
++m_indexBuffer;
m_buffer[m_indexBuffer] = (number >> 0) & 0xff;
++m_indexBuffer;
}
bool Mqtt5Serialization::readVarByteNumber(unsigned int& number)
{
bool ok = true;
bool done = false;
int shift = 0;
while (!done && ok)
{
ok = false;
if (m_indexBuffer < m_sizeBuffer && shift <= 21)
{
ok = true;
char data = m_buffer[m_indexBuffer];
++m_indexBuffer;
number |= (data & 0x7f) << shift;
if ((data & 0x80) == 0)
{
done = true;
}
shift += 7;
}
}
return ok;
}
void Mqtt5Serialization::writeVarByteNumber(unsigned int number)
{
assert(number <= 268435455);
do
{
assert(m_indexBuffer + 1 <= m_sizeBuffer);
m_buffer[m_indexBuffer] = number & 0x7f;
number >>= 7;
if (number > 0)
{
m_buffer[m_indexBuffer] |= 0x80;
}
++m_indexBuffer;
} while (number > 0);
}
bool Mqtt5Serialization::readString(std::string& str)
{
unsigned int size = 0;
bool ok = read2ByteNumber(size);
if (ok && doesFit(size))
{
str.insert(0, reinterpret_cast<char*>(&m_buffer[m_indexBuffer]), size);
m_indexBuffer += size;
}
else
{
str.clear();
}
return ok;
}
unsigned int Mqtt5Serialization::sizeString(const std::string& str)
{
assert(str.size() <= 0xffff);
return static_cast<unsigned int>(2 + str.size());
}
void Mqtt5Serialization::writeString(const std::string& str)
{
unsigned int size = static_cast<unsigned int>(str.size());
write2ByteNumber(size);
assert(m_indexBuffer + size <= m_sizeBuffer);
memcpy(&m_buffer[m_indexBuffer], str.data(), str.size());
m_indexBuffer += size;
}
bool Mqtt5Serialization::readStringPair(std::string& key, std::string& value)
{
bool ok = readString(key);
if (!ok)
{
return false;
}
ok = readString(value);
return ok;
}
unsigned int Mqtt5Serialization::sizeStringPair(const std::string& key, const std::string& value)
{
assert(key.size() <= 0xffff);
assert(value.size() <= 0xffff);
return static_cast<unsigned int>(4 + key.size() + value.size());
}
void Mqtt5Serialization::writeStringPair(const std::string& key, const std::string& value)
{
writeString(key);
writeString(value);
}
bool Mqtt5Serialization::readBinary(Bytes& value)
{
unsigned int size = 0;
bool ok = read2ByteNumber(size);
if (ok && doesFit(size))
{
value.insert(value.end(), &m_buffer[m_indexBuffer], &m_buffer[m_indexBuffer + size]);
m_indexBuffer += size;
}
else
{
value.clear();
}
return ok;
}
unsigned int Mqtt5Serialization::sizeBinary(const Bytes& value)
{
assert(value.size() <= 0xffff);
return static_cast<unsigned int>(2 + value.size());
}
void Mqtt5Serialization::writeBinary(const Bytes& value)
{
unsigned int size = static_cast<unsigned int>(value.size());
write2ByteNumber(size);
assert(m_indexBuffer + size <= m_sizeBuffer);
memcpy(&m_buffer[m_indexBuffer], value.data(), size);
m_indexBuffer += size;
}
bool Mqtt5Serialization::readProperties(std::unordered_map<unsigned int, Variant>& properties, std::unordered_map<std::string, std::string>& metainfo)
{
if (!doesFit(1))
{
return true;
}
unsigned int size = 0;
bool ok = readVarByteNumber(size);
if (!ok || !doesFit(size))
{
return false;
}
unsigned int indexEndProperties = m_indexBuffer + size;
bool done = (size == 0);
while (!done && ok)
{
ok = false;
if (m_indexBuffer < indexEndProperties)
{
ok = true;
unsigned int id = 0;
ok = readVarByteNumber(id);
if (!ok)
{
return false;
}
Mqtt5PropertyId propertyId(static_cast<Mqtt5PropertyId::Enum>(id));
if (propertyId == Mqtt5PropertyId::Invalid)
{
return false;
}
Mqtt5Type type = propertyId.getPropertyType();
switch (type)
{
case Mqtt5Type::TypeNone:
ok = false;
break;
case Mqtt5Type::TypeByte:
{
unsigned int value;
ok = read1ByteNumber(value);
if (ok)
{
properties[propertyId] = value;
}
}
break;
case Mqtt5Type::TypeTwoByteInteger:
{
unsigned int value;
ok = read2ByteNumber(value);
if (ok)
{
properties[propertyId] = value;
}
}
break;
case Mqtt5Type::TypeFourByteInteger:
{
unsigned int value;
ok = read4ByteNumber(value);
if (ok)
{
properties[propertyId] = value;
}
}
break;
case Mqtt5Type::TypeVariableByteInteger:
{
unsigned int value = 0;
ok = readVarByteNumber(value);
if (ok)
{
properties[propertyId] = value;
}
}
break;
case Mqtt5Type::TypeUTF8String:
{
std::string value;
ok = readString(value);
if (ok)
{
properties[propertyId] = value;
}
}
break;
case Mqtt5Type::TypeUTF8StringPair:
{
std::string key;
std::string value;
ok = readStringPair(key, value);
if (ok)
{
if (propertyId == Mqtt5PropertyId::UserProperty)
{
metainfo[std::move(key)] = std::move(value);
}
}
}
break;
case Mqtt5Type::TypeBinaryData:
{
Bytes value;
ok = readBinary(value);
if (ok)
{
properties[propertyId] = value;
}
}
break;
case Mqtt5Type::TypeArrayVariableByteInteger:
{
unsigned int value = 0;
ok = readVarByteNumber(value);
if (ok)
{
Variant& property = properties[propertyId];
std::vector<std::uint32_t>* arr = property;
if (arr == nullptr)
{
property = std::vector<std::uint32_t>();
}
arr = property;
assert(arr != nullptr);
arr->push_back(value);
}
}
break;
default:
assert(false);
ok = false;
break;
}
if (m_indexBuffer == indexEndProperties)
{
done = true;
}
}
}
return ok;
}
unsigned int Mqtt5Serialization::sizeProperties(const std::unordered_map<unsigned int, Variant>& properties, const std::unordered_map<std::string, std::string>& metainfo, unsigned int& sizePropertyPayload)
{
sizePropertyPayload = 0;
for (auto it = properties.begin(); it != properties.end(); ++it)
{
unsigned int id = it->first;
const Variant& value = it->second;
Mqtt5PropertyId propertyId(static_cast<Mqtt5PropertyId::Enum>(id));
assert(propertyId != Mqtt5PropertyId::Invalid);
Mqtt5Type type = propertyId.getPropertyType();
switch (type)
{
case Mqtt5Type::TypeNone:
assert(false);
break;
case Mqtt5Type::TypeByte:
sizePropertyPayload += sizeVarByteNumber(id);
sizePropertyPayload += 1;
break;
case Mqtt5Type::TypeTwoByteInteger:
sizePropertyPayload += sizeVarByteNumber(id);
sizePropertyPayload += 2;
break;
case Mqtt5Type::TypeFourByteInteger:
sizePropertyPayload += sizeVarByteNumber(id);
sizePropertyPayload += 4;
break;
case Mqtt5Type::TypeVariableByteInteger:
sizePropertyPayload += sizeVarByteNumber(id);
sizePropertyPayload += sizeVarByteNumber(value);
break;
case Mqtt5Type::TypeUTF8String:
sizePropertyPayload += sizeVarByteNumber(id);
sizePropertyPayload += sizeString(value);
break;
case Mqtt5Type::TypeUTF8StringPair:
assert(false);
break;
case Mqtt5Type::TypeBinaryData:
sizePropertyPayload += sizeVarByteNumber(id);
sizePropertyPayload += sizeBinary(value);
break;
case Mqtt5Type::TypeArrayVariableByteInteger:
{
const std::vector<std::uint32_t>* arr = value;
if (arr != nullptr)
{
for (size_t i = 0; i < arr->size(); ++i)
{
sizePropertyPayload += sizeVarByteNumber(id);
sizePropertyPayload += sizeVarByteNumber(arr->at(i));
}
}
}
break;
default:
assert(false);
break;
}
}
for (auto it = metainfo.begin(); it != metainfo.end(); ++it)
{
const std::string& key = it->first;
const std::string& value = it->second;
sizePropertyPayload += sizeVarByteNumber(Mqtt5PropertyId::UserProperty);
sizePropertyPayload += sizeStringPair(key, value);
}
return (sizeVarByteNumber(sizePropertyPayload) + sizePropertyPayload);
}
void Mqtt5Serialization::writeProperties(const std::unordered_map<unsigned int, Variant>& properties, const std::unordered_map<std::string, std::string>& metainfo, unsigned int sizePropertyPayload)
{
writeVarByteNumber(sizePropertyPayload);
for (auto it = properties.begin(); it != properties.end(); ++it)
{
unsigned int id = it->first;
const Variant& value = it->second;
Mqtt5PropertyId propertyId(static_cast<Mqtt5PropertyId::Enum>(id));
assert(propertyId != Mqtt5PropertyId::Invalid);
Mqtt5Type type = propertyId.getPropertyType();
switch (type)
{
case Mqtt5Type::TypeNone:
assert(false);
break;
case Mqtt5Type::TypeByte:
writeVarByteNumber(id);
write1ByteNumber(value);
break;
case Mqtt5Type::TypeTwoByteInteger:
writeVarByteNumber(id);
write2ByteNumber(value);
break;
case Mqtt5Type::TypeFourByteInteger:
writeVarByteNumber(id);
write4ByteNumber(value);
break;
case Mqtt5Type::TypeVariableByteInteger:
writeVarByteNumber(id);
writeVarByteNumber(value);
break;
case Mqtt5Type::TypeUTF8String:
writeVarByteNumber(id);
writeString(value);
break;
case Mqtt5Type::TypeUTF8StringPair:
assert(false);
break;
case Mqtt5Type::TypeBinaryData:
writeVarByteNumber(id);
writeBinary(value);
break;
case Mqtt5Type::TypeArrayVariableByteInteger:
{
const std::vector<std::uint32_t>* arr = value;
if (arr != nullptr)
{
for (size_t i = 0; i < arr->size(); ++i)
{
writeVarByteNumber(id);
writeVarByteNumber(arr->at(i));
}
}
}
break;
default:
assert(false);
break;
}
}
for (auto it = metainfo.begin(); it != metainfo.end(); ++it)
{
const std::string& key = it->first;
const std::string& value = it->second;
writeVarByteNumber(Mqtt5PropertyId::UserProperty);
writeStringPair(key, value);
}
}
} // namespace finalmq
| 26.204316
| 205
| 0.591158
|
mnaveedb
|
08775931b8cde79d768ba6aada16e089b0127451
| 1,208
|
hpp
|
C++
|
include/Utils.hpp
|
qqwertyui/zipper
|
fa57b23971988fa39cbbf142837bb55458c54e46
|
[
"Apache-2.0"
] | 1
|
2021-05-21T16:20:15.000Z
|
2021-05-21T16:20:15.000Z
|
include/Utils.hpp
|
qqwertyui/zipper
|
fa57b23971988fa39cbbf142837bb55458c54e46
|
[
"Apache-2.0"
] | null | null | null |
include/Utils.hpp
|
qqwertyui/zipper
|
fa57b23971988fa39cbbf142837bb55458c54e46
|
[
"Apache-2.0"
] | null | null | null |
#ifndef UTILS_HPP
#define UTILS_HPP
#include <cstdint>
#include <string>
#include <vector>
#include <memory>
#include <fstream>
#include <cstddef>
class DosTime {
public:
DosTime(uint16_t time, uint16_t date);
uint8_t second;
uint8_t minute;
uint8_t hour;
uint8_t day;
uint8_t month;
uint16_t year;
};
class Data {
public:
std::byte *data;
unsigned int data_size;
Data(std::byte *data, unsigned int data_size);
Data();
};
typedef std::vector<Data *> Data_vector;
class Chunk_manager {
public:
unsigned int elements;
unsigned int total_bytes;
Data_vector entry;
Chunk_manager();
~Chunk_manager();
void add(std::byte *data, unsigned int datasz);
std::byte *to_bytearray();
};
namespace Utils {
/* Returns address of the last occurence of given character in string, alters
* input string */
char *find_last_of(const char *text, const char *delimiter);
std::vector<std::byte> zlib_inflate(Data *input);
std::vector<std::byte> read_file(std::string &filename, std::ifstream::openmode flags = std::ifstream::in);
void write_file(std::string &filename, std::vector<std::byte> &data, std::ofstream::openmode flags = std::ofstream::out);
} // namespace Utils
#endif
| 20.133333
| 121
| 0.716887
|
qqwertyui
|
087e0b5b86587a14bdd714f18829f00733d498e9
| 20,881
|
hpp
|
C++
|
configuration/configurator/schemas/SchemaCommon.hpp
|
miguelvazq/HPCC-Platform
|
22ad8e5fcb59626abfd8febecbdfccb1e9fb0aa5
|
[
"Apache-2.0"
] | null | null | null |
configuration/configurator/schemas/SchemaCommon.hpp
|
miguelvazq/HPCC-Platform
|
22ad8e5fcb59626abfd8febecbdfccb1e9fb0aa5
|
[
"Apache-2.0"
] | null | null | null |
configuration/configurator/schemas/SchemaCommon.hpp
|
miguelvazq/HPCC-Platform
|
22ad8e5fcb59626abfd8febecbdfccb1e9fb0aa5
|
[
"Apache-2.0"
] | null | null | null |
/*##############################################################################
HPCC SYSTEMS software Copyright (C) 2015 HPCC Systems®.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
############################################################################## */
#ifndef _SCHEMA_COMMON_HPP_
#define _SCHEMA_COMMON_HPP_
#include <iostream>
#include "jiface.hpp"
#include "jstring.hpp"
#include "jlib.hpp"
#include "jlog.hpp"
#include "jarray.hpp"
#include "XMLTags.h"
#include "ExceptionStrings.hpp"
#include "build-config.h"
namespace CONFIGURATOR
{
#define MINIMUM_STRICTNESS 0
#define DEFAULT_STRICTNESS 5
#define MAXIMUM_STRICTNESS 10
#define STRICTNESS_LEVEL MINIMUM_STRICTNESS
#define QUICK_OUT(X,Y,Z) quickOut(X,#Y,get##Y(),Z);
#define QUICK_OUT_2(Y) quickOut(cout, #Y, get##Y(), offset);
#define QUICK_OUT_3(X) if (m_p##X != nullptr) m_p##X->dump(cout, offset);
#define QUICK_OUT_ARRAY(X,Z) for (int idx=0; idx < this->length(); idx++) \
{ \
quickOutPad(X,Z+STANDARD_OFFSET_1); \
X << idx+1 << "]" << ::std::endl; \
(this->item(idx)).dump(cout,Z); \
}
#define QUICK_DOC_ARRAY(X) for (int idx=0; idx < this->length(); idx++) \
{ \
(this->item(idx)).getDocumentation(X); \
}
#define LAST_ONLY -1
#define LAST_AND_FIRST -2
#define QUICK_ENV_XPATH(X) for (int idx=0; idx < this->length(); idx++) \
{ \
(this->item(idx)).populateEnvXPath(X.str(), idx+1); \
}
#define QUICK_ENV_XPATH_WITH_INDEX(X,Y) for (int idx=0; idx < this->length(); idx++) \
{ \
(this->item(idx)).populateEnvXPath(X.str(), Y); \
}
#define QUICK_LOAD_ENV_XML(X) assert(X != nullptr); \
for (int idx=0; idx < this->length(); idx++) \
{ \
(this->item(idx)).loadXMLFromEnvXml(X); \
}
#define GETTER(X) virtual const char* get##X() const { return m_str##X.str(); }
#define SETTER(X) virtual void set##X(const char* p) { m_str##X.clear().append(p); }
#define GETTERSETTER(X) protected: StringBuffer m_str##X; public: GETTER(X) SETTER(X) public:
//#define GETTER2(X) virtual const char* get##X() const { return m_str##X.str(); }
//#define SETTER2(X) virtual void set##X(const char* p) { m_str##X.clear().append(p); m_str##X.replace('/','_');}
//#define GETTERSETTER2(X) protected: StringBuffer m_str##X; public: GETTER(X) SETTER2(X) public:
#define GETTERINT(X) virtual const long get##X() const { return m_n##X; }
#define SETTERINT(X) virtual void set##X(long p) { m_n##X = p; } virtual void set##X(const char *p) { assert(p != nullptr); if (p != 0 && *p != 0) m_n##X = atol(p); }
#define GETTERSETTERINT(X) protected: long m_n##X; public: GETTERINT(X) SETTERINT(X) private:
#define SETPARENTNODE(X, Y) if (X!= nullptr && Y != nullptr) X->setParentNode(Y);
//#define DEBUG_MARK_STRDOC strDoc.append(__FILE__).append(":").append(__LINE__).append("\n");
#define DEBUG_MARK_STRDOC
#define DEBUG_MARK_COMMENT(X) X.append("// ").append(__FILE__).append(":").append(__LINE__).append("\n");
#define DEBUG_MARK_COMMENT2(X,Y) X.append("// UIType=").append(Y->getUIType()).append(" ").append(__FILE__).append(":").append(__LINE__).append("\n");
#define DEBUG_MARK_COMMENT_3 quickOutPad(strJSON, offset); strJSON.append("{ \"").append(__FILE__).append("\" : \"").append(__LINE__).append("\"},\n"); QuickOutPad(strJSON, offset);
#define DEBUG_MARK_COMMENT_4 quickOutPad(strJSON, offset); strJSON.append(",{ \"").append(__FILE__).append("\" : \"").append(__LINE__).append("\"},\n"); QuickOutPad(strJSON, offset);
#define DEBUG_MARK_STRJS DEBUG_MARK_COMMENT(strJS)
#define DEBUG_MARK_JSON_1 //DEBUG_MARK_COMMENT_4// DEBUG_MARK_COMMENT(strJSON)
#define DEBUG_MARK_JSON_2 //DEBUG_MARK_COMMENT_3// DEBUG_MARK_COMMENT(strJSON)
#define GETTERTYPE(X) C##X* get##X() const { return m_p##X; }
#define SETTERTYPE(X) void set##X( C##X *p ) { assert(p != nullptr); if (p != nullptr) m_p##X = p; }
#define GETTERSETTERTYPE(X) public: C##X *m_p##X; GETTERTYPE(X) SETTERTYPE(X) private:
#define CHECK_EXCLUSION(X) if(CConfigSchemaHelper::getInstance()->getSchemaMapManager()->isNodeExcluded(X)) return nullptr;
#define IS_EXCLUDED(X) (CConfigSchemaHelper::getInstance()->getSchemaMapManager()->isNodeExcluded(X) ? true : false)
enum NODE_TYPES
{
XSD_ANNOTATION = 0x0,
XSD_APP_INFO,
XSD_ATTRIBUTE,
XSD_ATTRIBUTE_ARRAY,
XSD_ATTRIBUTE_GROUP,
XSD_ATTRIBUTE_GROUP_ARRAY,
XSD_CHOICE,
XSD_COMPLEX_CONTENT,
XSD_COMPLEX_TYPE,
XSD_COMPLEX_TYPE_ARRAY,
XSD_DOCUMENTATION,
XSD_ELEMENT,
XSD_ELEMENT_ARRAY,
XSD_ARRAY_OF_ELEMENT_ARRAYS,
XSD_EXTENSION,
XSD_FIELD,
XSD_FIELD_ARRAY,
XSD_KEY,
XSD_KEY_ARRAY,
XSD_KEYREF,
XSD_KEYREF_ARRAY,
XSD_INCLUDE,
XSD_INCLUDE_ARRAY,
XSD_RESTRICTION,
XSD_SCHEMA,
XSD_SEQUENCE,
XSD_SIMPLE_TYPE,
XSD_SIMPLE_TYPE_ARRAY,
XSD_ENUMERATION,
XSD_ENUMERATION_ARRAY,
XSD_LENGTH,
XSD_FRACTION_DIGITS,
XSD_MAX_EXCLUSIVE,
XSD_MAX_INCLUSIVE,
XSD_MIN_EXCLUSIVE,
XSD_MIN_INCLUSIVE,
XSD_MIN_LENGTH,
XSD_MAX_LENGTH,
XSD_PATTERN,
XSD_SELECTOR,
XSD_SIMPLE_CONTENT,
XSD_TOTAL_DIGITS,
XSD_UNIQUE,
XSD_UNIQUE_ARRAY,
XSD_WHITE_SPACE,
XSD_DT_NORMALIZED_STRING, // keep this as the first DT type for array index purposes
XSD_DT_STRING,
XSD_DT_TOKEN,
XSD_DT_DATE,
XSD_DT_TIME,
XSD_DT_DATE_TIME,
XSD_DT_DECIMAL,
XSD_DT_INT,
XSD_DT_INTEGER,
XSD_DT_LONG,
XSD_DT_NON_NEG_INTEGER,
XSD_DT_NON_POS_INTEGER,
XSD_DT_NEG_INTEGER,
XSD_DT_POS_INTEGER,
XSD_DT_BOOLEAN,
XSD_ERROR
};
static const char* DEFAULT_SCHEMA_DIRECTORY(COMPONENTFILES_DIR "/configxml/");
static const char* XSD_ANNOTATION_STR("Annotation");
static const char* XSD_APP_INFO_STR("AppInfo");
static const char* XSD_ATTRIBUTE_STR("Attribute");
static const char* XSD_ATTRIBUTE_ARRAY_STR("AttributeArray");
static const char* XSD_ATTRIBUTE_GROUP_STR("AttributeGroup");
static const char* XSD_ATTRIBUTE_GROUP_ARRAY_STR("AttributeGroupArray");
static const char* XSD_CHOICE_STR("Choice");
static const char* XSD_COMPLEX_CONTENT_STR("ComplexContent");
static const char* XSD_COMPLEX_TYPE_STR("ComplexType");
static const char* XSD_COMPLEX_TYPE_ARRAY_STR("ComplexTypeArray");
static const char* XSD_DOCUMENTATION_STR("Documentation");
static const char* XSD_ELEMENT_STR("Element");
static const char* XSD_ELEMENT_ARRAY_STR("ElementArray");
static const char* XSD_ARRAY_ELEMENT_ARRAY_STR("ArrayOfElementArrays");
static const char* XSD_ERROR_STR("ERROR");
static const char* XSD_ENUMERATION_STR("Enumeration");
static const char* XSD_ENUMERATION_ARRAY_STR("EnumerationArray");
static const char* XSD_EXTENSION_STR("Extension");
static const char* XSD_FIELD_STR("Field");
static const char* XSD_FIELD_ARRAY_STR("FieldArray");
static const char* XSD_FRACTION_DIGITS_STR("FractionDigits");
static const char* XSD_INCLUDE_STR("Include");
static const char* XSD_INCLUDE_ARRAY_STR("IncludeArray");
static const char* XSD_KEY_STR("Key");
static const char* XSD_KEY_ARRAY_STR("KeyArray");
static const char* XSD_KEYREF_STR("KeyRef");
static const char* XSD_KEYREF_ARRAY_STR("KeyRefArray");
static const char* XSD_LENGTH_STR("Length");
static const char* XSD_MIN_INCLUSIVE_STR("MinInclusive");
static const char* XSD_MAX_INCLUSIVE_STR("MaxInclusive");
static const char* XSD_MIN_EXCLUSIVE_STR("MinExclusive");
static const char* XSD_MAX_EXCLUSIVE_STR("MaxExclusive");
static const char* XSD_MIN_LENGTH_STR("MinLength");
static const char* XSD_MAX_LENGTH_STR("MaxLength");
static const char* XSD_PATTERN_STR("Pattern");
static const char* XSD_RESTRICTION_STR("Restriction");
static const char* XSD_SCHEMA_STR("Schema");
static const char* XSD_SELECTOR_STR("Selector");
static const char* XSD_SEQUENCE_STR("Sequence");
static const char* XSD_SIMPLE_CONTENT_STR("SimpleContent");
static const char* XSD_SIMPLE_TYPE_STR("SimpleType");
static const char* XSD_SIMPLE_TYPE_ARRAY_STR("SimpleTypeArray");
static const char* XSD_TOTAL_DIGITS_STR("TotalDigits");
static const char* XSD_UNIQUE_STR("Unique");
static const char* XSD_UNIQUE_ARRAY_STR("UniqueArray");
static const char* XSD_WHITE_SPACE_STR("WhiteSpace");
static const char* XSD_DT_NORMALIZED_STRING_STR("NormalizedString");
static const char* XSD_DT_STRING_STR("String");
static const char* XSD_DT_TOKEN_STR("Token");
static const char* XSD_DT_DATE_STR("Date");
static const char* XSD_DT_TIME_STR("Time");
static const char* XSD_DT_DATE_TIME_STR("DateTime");
static const char* XSD_DT_DECIMAL_STR("Decimal");
static const char* XSD_DT_INTEGER_STR("Integer");
static const char* XSD_DT_INT_STR("Int");
static const char* XSD_DT_LONG_STR("Long");
static const char* XSD_DT_NON_NEG_INTEGER_STR("NonNegativeInteger");
static const char* XSD_DT_NON_POS_INTEGER_STR("NonPositiveInteger");
static const char* XSD_DT_POS_INTEGER_STR("PositiveInteger");
static const char* XSD_DT_NEG_INTEGER_STR("NegativeInteger");
static const char* XSD_DT_BOOLEAN_STR("Boolean");
static const char* XML_ENV_VALUE_OPTIONAL("optional");
static const char* XML_ENV_VALUE_REQUIRED("required");
static const char* XML_ATTR_DEFAULT("@default");
static const char* XML_ATTR_USE("@use");
static const char* XML_ATTR_MINOCCURS("@minOccurs");
static const char* XML_ATTR_BASE("@base");
static const char* XML_ATTR_XPATH("@xpath");
static const char* XML_ATTR_REFER("@refer");
static const char* TAG_VIEWCHILDNODES("viewChildNodes");
static const char* TAG_VIEWTYPE("viewType");
static const char* TAG_TOOLTIP("tooltip");
static const char* TAG_COLINDEX("colIndex");
static const char* TAG_TITLE("title");
static const char* TAG_WIDTH("width");
static const char* TAG_AUTOGENWIZARD("autogenforwizard");
static const char* TAG_AUTOGENDEFAULTVALUE("autogendefaultvalue");
static const char* TAG_AUTOGENDEFAULTVALUEFORMULTINODE("autogendefaultformultinode");
static const char* TAG_XPATH("xpath");
static const char* TAG_DOC_ID("docid");
static const char* TAG_DOC_USE_LINE_BREAK("docuselinebreak");
static const char* TAG_REQUIRED("required");
static const char* TAG_UNBOUNDED("unbounded");
#define TAG_OPTIONAL "optional"
#define TAG_REQUIRED "required"
#define XML_ATTR_ATTRIBUTEFORMDEFAULT "@attributeFormDefault"
#define XML_ATTR_ELEMENTFORMDEFAULT "@elementFormDefault"
#define XML_ATTR_ID "@id"
#define XML_ATTR_REF "@ref"
#define XML_ATTR_XMLNS_XS "@xmlns:xs"
#define XML_ATTR_SCHEMA_LOCATION "@schemaLocation"
#define XML_ATTR_VALUE "@value"
#define XML_ATTR_OVERRIDE "@overide" // intentionally misspelled
#define XML_ATTR_DEPLOYABLE "@deployable"
static unsigned int STANDARD_OFFSET_1 = 3;
static unsigned int STANDARD_OFFSET_2 = 6;
static unsigned int STANDARD_OFFSET_3 = 9;
static void quickOutPad(::std::ostream& cout, unsigned int offset)
{
while(offset > 0)
{
cout << " ";
offset--;
}
}
static void quickOutPad(::StringBuffer &str, unsigned int offset)
{
while(offset > 0)
{
str.append(" ");
offset--;
}
}
static void quickOutHeader(::std::ostream &cout, const char* pLabel, unsigned int offset = 0)
{
quickOutPad(cout,offset);
cout << "\033[32m-- " << pLabel << " START" << " --" << "\033[0m" << ::std::endl;
}
static void quickOutFooter(::std::ostream &cout, const char* pLabel, unsigned int offset = 0)
{
quickOutPad(cout,offset);
//cout << "<--- FINISH " << pLabel << ::std::endl;
cout << "\033[31m" << "-- " << pLabel << " FINISH" << " --" << "\033[0m" << ::std::endl;
}
static void quickOut(::std::ostream &cout, const char* pLabel, const char* pValue, unsigned int offset = 0)
{
if (pLabel && strlen(pValue) > 0)
{
quickOutPad(cout,offset+STANDARD_OFFSET_2);
cout << "\033[34m" << pLabel << ":\t\033[0m" << "\033[34m'\033[0m" << pValue << "\033[34m'" << "\033[0m" << ::std::endl;
}
}
static void quickOut(::std::ostream &cout, const char* pLabel, int value, unsigned int offset = 0)
{
quickOutPad(cout,offset);
cout << pLabel << ": " << value << ::std::endl;
}
static const char* stripTrailingIndex(StringBuffer& strXPath) // should this replace int CConfigSchemaHelper::stripXPathIndex(StringBuffer &strXPath)?
{
if (strXPath.length() == 0 || strXPath[strXPath.length()-1] != ']')
return strXPath.str();
while (1)
{
if (strXPath[strXPath.length()-1] == '[')
{
strXPath.setLength(strXPath.length()-1);
break;
}
strXPath.setLength(strXPath.length()-1);
}
return strXPath.str();
}
class CXSDNodeBase
{
public:
CXSDNodeBase(CXSDNodeBase* pParentNode = nullptr, NODE_TYPES eNodeType = XSD_ERROR);
virtual ~CXSDNodeBase();
GETTERSETTER(XSDXPath)
GETTERSETTER(EnvXPath)
//GETTERSETTER(EnvValueFromXML)
virtual const char* getEnvValueFromXML() const
{
return m_strEnvValueFromXML;
}
virtual bool setEnvValueFromXML(const char* p)
{
if (p != nullptr)
{
m_strEnvValueFromXML.set(p);
return true;
}
return false;
}
void dumpStdOut() const;
virtual CXSDNodeBase* getParentNode() const
{
return m_pParentNode;
}
virtual const CXSDNodeBase* getConstAncestorNode(unsigned iLevel) const;
virtual const CXSDNodeBase* getConstParentNode() const
{
return m_pParentNode;
}
virtual const CXSDNodeBase* getParentNodeByType(NODE_TYPES eNodeType[], const CXSDNodeBase *pParent = nullptr, int length = 1) const;
virtual const CXSDNodeBase* getParentNodeByType(NODE_TYPES eNodeType, const CXSDNodeBase *pParent = nullptr) const;
virtual const CXSDNodeBase* getNodeByTypeAndNameAscending(NODE_TYPES eNodeType[], const char *pName, int length = 1) const;
virtual const CXSDNodeBase* getNodeByTypeAndNameAscending(NODE_TYPES eNodeType, const char *pName) const
{
if (this->getNodeType() == eNodeType)
return this;
else
return this->getConstParentNode()->getNodeByTypeAndNameAscending(eNodeType, pName);
}
virtual const CXSDNodeBase* getNodeByTypeAndNameDescending(NODE_TYPES eNodeType[], const char *pName, int length = 1) const;
virtual const CXSDNodeBase* getNodeByTypeAndNameDescending(NODE_TYPES eNodeType, const char *pName) const
{
return getNodeByTypeAndNameDescending(&eNodeType, pName);
}
void setParentNode(CXSDNodeBase *pParentNode)
{
if (m_pParentNode == nullptr) // Should only be set once, otherwise it's an external schema and should have parent set
{
m_pParentNode = pParentNode;
}
}
const char* getNodeTypeStr() const
{
return m_pNodeType;
}
virtual NODE_TYPES getNodeType() const
{
return m_eNodeType;
}
virtual void dump(::std::ostream& cout, unsigned int offset = 0) const = 0;
virtual const char* getXML(const char* /*pComponent*/)
{
return nullptr;
}
virtual void getDocumentation(::StringBuffer &strDoc) const = 0;
virtual void populateEnvXPath(::StringBuffer strXPath, unsigned int index = 1)
{
}
virtual void loadXMLFromEnvXml(const ::IPropertyTree *pEnvTree)
{
}
protected:
CXSDNodeBase* m_pParentNode;
::StringBuffer m_strXML;
NODE_TYPES m_eNodeType;
char m_pNodeType[1024];
StringBuffer m_strEnvValueFromXML;
private:
};
class CXSDNode : public CInterface, public CXSDNodeBase
{
public:
IMPLEMENT_IINTERFACE
CXSDNode(CXSDNodeBase *pParentNode, NODE_TYPES pNodeType = XSD_ERROR );
virtual bool checkSelf(NODE_TYPES eNodeType, const char *pName, const char* pCompName) const;
virtual const CXSDNodeBase* getParentNodeByType(NODE_TYPES eNodeType) const;
private:
};
template<class T>
class CXSDNodeWithRestrictions : public CXSDNode
{
public:
CXSDNodeWithRestrictions(CXSDNodeBase* pParentNode, enum NODE_TYPES eNodeType) : CXSDNode::CXSDNode(pParentNode)
{
}
static T* load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSchemaRoot, const char* xpath)
{
assert(pSchemaRoot != nullptr);
if (pSchemaRoot == nullptr)
return nullptr;
T *pT = nullptr;
if (xpath != nullptr && *xpath != 0)
{
::IPropertyTree* pTree = pSchemaRoot->queryPropTree(xpath);
if (pTree == nullptr)
return nullptr;
pT = new T(pParentNode);
const char* pValue = pTree->queryProp(XML_ATTR_VALUE);
if (pValue != nullptr && *pValue != 0)
pT->setValue(pValue);
else
{
assert(!"No Value set");
//TODO: throw? and delete?
}
pT->setXSDXPath(xpath);
}
return pT;
}
void dump(::std::ostream& cout, unsigned int offset) const
{
offset += STANDARD_OFFSET_1;
quickOutHeader(cout, XSD_MIN_INCLUSIVE_STR, offset);
QUICK_OUT(cout, Value, offset);
quickOutFooter(cout, XSD_MIN_INCLUSIVE_STR, offset);
}
virtual void getDocumentation(::StringBuffer &strDoc) const
{
UNIMPLEMENTED;
}
virtual const char* getXML(const char* /*pComponent*/)
{
UNIMPLEMENTED;
return nullptr;
}
virtual void populateEnvXPath(::StringBuffer strXPath, unsigned int index = 1)
{
UNIMPLEMENTED;
}
virtual void loadXMLFromEnvXml(const ::IPropertyTree *pEnvTree)
{
UNIMPLEMENTED;
}
GETTERSETTER(Value)
};
class CXSDNodeWithType : public CXSDNode
{
GETTERSETTER(Type)
public:
CXSDNodeWithType(CXSDNodeBase* pParentNode, enum NODE_TYPES eNodeType) : CXSDNode::CXSDNode(pParentNode, eNodeType), m_pXSDNode(nullptr)
{
}
virtual void loadXMLFromEnvXml(const ::IPropertyTree *pEnvTree)
{
UNIMPLEMENTED_X("Should be implemented in the derived class");
}
void setTypeNode(CXSDNode* pCXSDNode)
{
m_pXSDNode = pCXSDNode;
}
const CXSDNode* getTypeNode() const
{
return m_pXSDNode;
}
protected:
CXSDNode *m_pXSDNode;
};
class CXSDNodeWithBase : public CXSDNode
{
GETTERSETTER(Base)
public:
CXSDNodeWithBase(CXSDNodeBase* pParentNode, enum NODE_TYPES eNodeType) : CXSDNode::CXSDNode(pParentNode, eNodeType), m_pXSDNode(nullptr)
{
}
void setBaseNode(CXSDNodeBase* pCXSDNode)
{
m_pXSDNode = pCXSDNode;
}
const CXSDNodeBase* getBaseNode() const
{
return m_pXSDNode;
}
protected:
CXSDNodeBase *m_pXSDNode;
};
class CXSDBuiltInDataType : public CXSDNode
{
public:
static CXSDBuiltInDataType* create(CXSDNodeBase* pParentNode, const char* pNodeType);
virtual ~CXSDBuiltInDataType();
virtual void loadXMLFromEnvXml(const ::IPropertyTree *pEnvTree);
virtual void dump(::std::ostream& cout, unsigned int offset = 0) const;
virtual void getDocumentation(::StringBuffer &strDoc) const;
virtual bool checkConstraint(const char *pValue) const;
private:
CXSDBuiltInDataType(CXSDNodeBase* pParentNode = nullptr, NODE_TYPES eNodeType = XSD_ERROR);
CXSDBuiltInDataType(CXSDNodeBase* pParentNode, const char* pNodeType);
};
}
#endif // _SCHEMA_COMMON_HPP_
| 34.976549
| 182
| 0.658829
|
miguelvazq
|
08808679455df51fa25983a062e062f79a3e0c71
| 505
|
cpp
|
C++
|
huawei/TwoStackForQueue/TwoStackForQueue/main.cpp
|
RainChang/My_ACM_Exercises
|
36872bdcb49cbb3eebde4bb9c7d154d057775b72
|
[
"Apache-2.0"
] | 1
|
2017-03-16T09:38:48.000Z
|
2017-03-16T09:38:48.000Z
|
huawei/TwoStackForQueue/TwoStackForQueue/main.cpp
|
RainChang/My_ACM_Exercises
|
36872bdcb49cbb3eebde4bb9c7d154d057775b72
|
[
"Apache-2.0"
] | null | null | null |
huawei/TwoStackForQueue/TwoStackForQueue/main.cpp
|
RainChang/My_ACM_Exercises
|
36872bdcb49cbb3eebde4bb9c7d154d057775b72
|
[
"Apache-2.0"
] | null | null | null |
//
// main.cpp
// TwoStackForQueue
//
// Created by Rain on 08/03/2017.
// Copyright © 2017 Rain. All rights reserved.
//
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
using namespace std;
int main(int argc, const char * argv[]) {
// insert code here...
stack<int> s1;
for(int i=0;i<10;i++)
{
s1.push(i);
}
cout<<"input over!"<<endl;
while(!s1.empty())
{
cout<<s1.top()<<" ";
s1.pop();
}
return 0;
}
| 16.290323
| 47
| 0.540594
|
RainChang
|
08898e952d967a66dd06b9b34feb5174261cfeef
| 456
|
cpp
|
C++
|
slicing/src/slicingMethods/SlicingMethod.cpp
|
mattulbrich/llreve
|
68cb958c1c02177fa0db1965a8afd879a97c2fc4
|
[
"BSD-3-Clause"
] | 20
|
2016-08-11T19:51:13.000Z
|
2021-09-02T13:10:58.000Z
|
slicing/src/slicingMethods/SlicingMethod.cpp
|
mattulbrich/llreve
|
68cb958c1c02177fa0db1965a8afd879a97c2fc4
|
[
"BSD-3-Clause"
] | 9
|
2016-08-11T11:59:24.000Z
|
2021-07-16T09:44:28.000Z
|
slicing/src/slicingMethods/SlicingMethod.cpp
|
mattulbrich/llreve
|
68cb958c1c02177fa0db1965a8afd879a97c2fc4
|
[
"BSD-3-Clause"
] | 7
|
2017-08-19T14:42:27.000Z
|
2020-05-20T16:14:13.000Z
|
/*
* This file is part of
* llreve - Automatic regression verification for LLVM programs
*
* Copyright (C) 2016 Karlsruhe Institute of Technology
*
* The system is published under a BSD license.
* See LICENSE (distributed with this file) for details.
*/
#include "SlicingMethod.h"
using namespace std;
using namespace llvm;
SlicingMethod::~SlicingMethod() = default;
shared_ptr<Module> SlicingMethod::getProgram(){
return this->program;
}
| 20.727273
| 66
| 0.736842
|
mattulbrich
|
088f3836c8218a6b0529fad653f40bd9a22ef215
| 7,664
|
cpp
|
C++
|
Server/src/modules/SD3/scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp
|
ZON3DEV/wow-vanilla
|
7b6f03c3e1e7d8dd29a92ba77ed021e5913e5e9f
|
[
"OpenSSL"
] | null | null | null |
Server/src/modules/SD3/scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp
|
ZON3DEV/wow-vanilla
|
7b6f03c3e1e7d8dd29a92ba77ed021e5913e5e9f
|
[
"OpenSSL"
] | null | null | null |
Server/src/modules/SD3/scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp
|
ZON3DEV/wow-vanilla
|
7b6f03c3e1e7d8dd29a92ba77ed021e5913e5e9f
|
[
"OpenSSL"
] | null | null | null |
/* Copyright (C) 2006 - 2013 ScriptDev2 <http://www.scriptdev2.com/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* World of Warcraft, and all World of Warcraft or Warcraft art, images,
* and lore are copyrighted by Blizzard Entertainment, Inc.
*/
/* ScriptData
SDName: Instance_Obsidian_Sanctum
SD%Complete: 80%
SDComment:
SDCategory: Obsidian Sanctum
EndScriptData */
#include "precompiled.h"
#include "obsidian_sanctum.h"
/* Obsidian Sanctum encounters:
0 - Sartharion
*/
struct is_obsidian_sanctum : public InstanceScript
{
is_obsidian_sanctum() : InstanceScript("instance_obsidian_sanctum") {}
class instance_obsidian_sanctum : public ScriptedInstance
{
public:
instance_obsidian_sanctum(Map* pMap) : ScriptedInstance(pMap),
m_uiAliveDragons(0)
{
Initialize();
}
void Initialize() override
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
for (uint8 i = 0; i < MAX_TWILIGHT_DRAGONS; ++i)
{
m_bPortalActive[i] = false;
}
}
void OnCreatureCreate(Creature* pCreature) override
{
switch (pCreature->GetEntry())
{
// The three dragons below set to active state once created.
// We must expect bigger raid to encounter main boss, and then three dragons must be active due to grid differences
case NPC_TENEBRON:
case NPC_SHADRON:
case NPC_VESPERON:
pCreature->SetActiveObjectState(true);
case NPC_SARTHARION:
m_mNpcEntryGuidStore[pCreature->GetEntry()] = pCreature->GetObjectGuid();
break;
case NPC_FIRE_CYCLONE:
m_lFireCycloneGuidList.push_back(pCreature->GetObjectGuid());
break;
}
}
void SetData(uint32 uiType, uint32 uiData) override
{
switch (uiType)
{
case TYPE_SARTHARION_EVENT:
m_auiEncounter[0] = uiData;
if (uiData == IN_PROGRESS)
{
m_sVolcanoBlowFailPlayers.clear();
}
break;
case TYPE_ALIVE_DRAGONS:
m_uiAliveDragons = uiData;
break;
case TYPE_VOLCANO_BLOW_FAILED:
// Insert the players who fail the achiev and haven't been already inserted in the set
if (m_sVolcanoBlowFailPlayers.find(uiData) == m_sVolcanoBlowFailPlayers.end())
{
m_sVolcanoBlowFailPlayers.insert(uiData);
}
break;
case TYPE_DATA_PORTAL_OFF:
case TYPE_DATA_PORTAL_ON:
SetPortalStatus(uint8(uiData), uiType == TYPE_DATA_PORTAL_ON);
return;
default:
break;
}
// No need to save anything here
}
uint32 GetData(uint32 uiType) const override
{
if (uiType == TYPE_SARTHARION_EVENT)
{
return m_auiEncounter[0];
}
if (uiType == TYPE_DATA_PORTAL_STATUS)
{
return uint32(IsActivePortal());
}
return 0;
}
uint64 GetData64(uint32 uiType) const override
{
if (uiType == DATA64_FIRE_CYCLONE)
{
return SelectRandomFireCycloneGuid().GetRawValue();
}
return 0;
}
bool CheckAchievementCriteriaMeet(uint32 uiCriteriaId, Player const* pSource, Unit const* pTarget, uint32 uiMiscValue1 /* = 0*/) const override
{
switch (uiCriteriaId)
{
case ACHIEV_DRAGONS_ALIVE_1_N:
case ACHIEV_DRAGONS_ALIVE_1_H:
return m_uiAliveDragons >= 1;
case ACHIEV_DRAGONS_ALIVE_2_N:
case ACHIEV_DRAGONS_ALIVE_2_H:
return m_uiAliveDragons >= 2;
case ACHIEV_DRAGONS_ALIVE_3_N:
case ACHIEV_DRAGONS_ALIVE_3_H:
return m_uiAliveDragons >= 3;
case ACHIEV_CRIT_VOLCANO_BLOW_N:
case ACHIEV_CRIT_VOLCANO_BLOW_H:
// Return true if not found in the set
return m_sVolcanoBlowFailPlayers.find(pSource->GetGUIDLow()) == m_sVolcanoBlowFailPlayers.end();
default:
return false;
}
}
bool CheckConditionCriteriaMeet(Player const* pPlayer, uint32 uiInstanceConditionId, WorldObject const* pConditionSource, uint32 conditionSourceType) const override
{
switch (uiInstanceConditionId)
{
case INSTANCE_CONDITION_ID_HARD_MODE: // Exactly one dragon alive on event start
case INSTANCE_CONDITION_ID_HARD_MODE_2: // Exactly two dragons alive on event start
case INSTANCE_CONDITION_ID_HARD_MODE_3: // All three dragons alive on event start
return m_uiAliveDragons == uiInstanceConditionId;
}
script_error_log("instance_obsidian_sanctum::CheckConditionCriteriaMeet called with unsupported Id %u. Called with param plr %s, src %s, condition source type %u",
uiInstanceConditionId, pPlayer ? pPlayer->GetGuidStr().c_str() : "nullptr", pConditionSource ? pConditionSource->GetGuidStr().c_str() : "nullptr", conditionSourceType);
return false;
}
private:
void SetPortalStatus(uint8 uiType, bool bStatus) { m_bPortalActive[uiType] = bStatus; }
bool IsActivePortal() const
{
for (uint8 i = 0; i < MAX_TWILIGHT_DRAGONS; ++i)
{
if (m_bPortalActive[i])
{
return true;
}
}
return false;
}
ObjectGuid SelectRandomFireCycloneGuid() const
{
if (m_lFireCycloneGuidList.empty())
{
return ObjectGuid();
}
GuidList::const_iterator iter = m_lFireCycloneGuidList.begin();
advance(iter, urand(0, m_lFireCycloneGuidList.size() - 1));
return *iter;
}
uint32 m_auiEncounter[MAX_ENCOUNTER];
bool m_bPortalActive[MAX_TWILIGHT_DRAGONS];
uint8 m_uiAliveDragons;
std::set<uint32> m_sVolcanoBlowFailPlayers;
GuidList m_lFireCycloneGuidList;
};
InstanceData* GetInstanceData(Map* pMap) override
{
return new instance_obsidian_sanctum(pMap);
}
};
void AddSC_instance_obsidian_sanctum()
{
Script* s;
s = new is_obsidian_sanctum();
s->RegisterSelf();
//pNewScript = new Script;
//pNewScript->Name = "instance_obsidian_sanctum";
//pNewScript->GetInstanceData = GetInstanceData_instance_obsidian_sanctum;
//pNewScript->RegisterSelf();
}
| 33.911504
| 184
| 0.596294
|
ZON3DEV
|
0892b3fc71781977b697a7a2ad44ebf9cc612489
| 1,124
|
cpp
|
C++
|
FrameRateCalculator.cpp
|
jambolo/Misc
|
0b2779c9bb1954294a722bddd51dc2ad5e449a1c
|
[
"MIT"
] | null | null | null |
FrameRateCalculator.cpp
|
jambolo/Misc
|
0b2779c9bb1954294a722bddd51dc2ad5e449a1c
|
[
"MIT"
] | 1
|
2020-04-03T09:49:25.000Z
|
2020-04-03T09:50:29.000Z
|
FrameRateCalculator.cpp
|
jambolo/Misc
|
0b2779c9bb1954294a722bddd51dc2ad5e449a1c
|
[
"MIT"
] | null | null | null |
#include "FrameRateCalculator.h"
#include <chrono>
using namespace std::chrono;
using namespace std::chrono_literals;
FrameRateCalculator::FrameRateCalculator()
: nFrames_(0)
, frameRate_(0.0f)
, averageFrameRate_(0.0f)
{
oldTime_ = oldTime2_ = high_resolution_clock::now();
}
//!
//! @param t Time of current frame
void FrameRateCalculator::update(high_resolution_clock::time_point t)
{
auto dt = t - oldTime_; // Time since previous update
// Update the frame rate value
if (dt > 0s)
frameRate_ = 1.0f / duration<float, seconds::period>(dt).count();
else
frameRate_ = 0.0f;
oldTime_ = t; // Save the current time for next time
// If 1 second has passed, compute the new average FPS value and reset the counters
++nFrames_;
auto dt2 = t - oldTime2_; // Time since previous 1 second update
if (dt2 > 1s)
{
averageFrameRate_ = (float)nFrames_ / duration<float, seconds::period>(dt2).count();
oldTime2_ = t; // Save the current time for next time
nFrames_ = 0; // Reset the frame counter
}
}
| 26.139535
| 92
| 0.647687
|
jambolo
|
0894ceb5bf675d9df94dd225bbbd7c31b102f3f2
| 105,625
|
cpp
|
C++
|
vm/CheckJni.cpp
|
flowcoaster/android_platform_dalvik
|
de43d1017cd6e987a202ac2d977a716f46d429e7
|
[
"Apache-2.0"
] | null | null | null |
vm/CheckJni.cpp
|
flowcoaster/android_platform_dalvik
|
de43d1017cd6e987a202ac2d977a716f46d429e7
|
[
"Apache-2.0"
] | null | null | null |
vm/CheckJni.cpp
|
flowcoaster/android_platform_dalvik
|
de43d1017cd6e987a202ac2d977a716f46d429e7
|
[
"Apache-2.0"
] | null | null | null |
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Support for -Xcheck:jni (the "careful" version of the JNI interfaces).
*
* We want to verify types, make sure class and field IDs are valid, and
* ensure that JNI's semantic expectations are being met. JNI seems to
* be relatively lax when it comes to requirements for permission checks,
* e.g. access to private methods is generally allowed from anywhere.
*/
#include "Dalvik.h"
#include "JniInternal.h"
#include <sys/mman.h>
#include <zlib.h>
/*
* Abort if we are configured to bail out on JNI warnings.
*/
static void abortMaybe() {
if (!gDvmJni.warnOnly) {
dvmDumpThread(dvmThreadSelf(), false);
dvmAbort();
}
}
/*
* ===========================================================================
* JNI call bridge wrapper
* ===========================================================================
*/
/*
* Check the result of a native method call that returns an object reference.
*
* The primary goal here is to verify that native code is returning the
* correct type of object. If it's declared to return a String but actually
* returns a byte array, things will fail in strange ways later on.
*
* This can be a fairly expensive operation, since we have to look up the
* return type class by name in method->clazz' class loader. We take a
* shortcut here and allow the call to succeed if the descriptor strings
* match. This will allow some false-positives when a class is redefined
* by a class loader, but that's rare enough that it doesn't seem worth
* testing for.
*
* At this point, pResult->l has already been converted to an object pointer.
*/
static void checkCallResultCommon(const u4* args, const JValue* pResult,
const Method* method, Thread* self)
{
assert(pResult->l != NULL);
const Object* resultObj = (const Object*) pResult->l;
if (resultObj == kInvalidIndirectRefObject) {
ALOGW("JNI WARNING: invalid reference returned from native code");
const Method* method = dvmGetCurrentJNIMethod();
char* desc = dexProtoCopyMethodDescriptor(&method->prototype);
ALOGW(" in %s.%s:%s", method->clazz->descriptor, method->name, desc);
free(desc);
abortMaybe();
return;
}
ClassObject* objClazz = resultObj->clazz;
/*
* Make sure that pResult->l is an instance of the type this
* method was expected to return.
*/
const char* declType = dexProtoGetReturnType(&method->prototype);
const char* objType = objClazz->descriptor;
if (strcmp(declType, objType) == 0) {
/* names match; ignore class loader issues and allow it */
ALOGV("Check %s.%s: %s io %s (FAST-OK)",
method->clazz->descriptor, method->name, objType, declType);
} else {
/*
* Names didn't match. We need to resolve declType in the context
* of method->clazz->classLoader, and compare the class objects
* for equality.
*
* Since we're returning an instance of declType, it's safe to
* assume that it has been loaded and initialized (or, for the case
* of an array, generated). However, the current class loader may
* not be listed as an initiating loader, so we can't just look for
* it in the loaded-classes list.
*/
ClassObject* declClazz = dvmFindClassNoInit(declType, method->clazz->classLoader);
if (declClazz == NULL) {
ALOGW("JNI WARNING: method declared to return '%s' returned '%s'",
declType, objType);
ALOGW(" failed in %s.%s ('%s' not found)",
method->clazz->descriptor, method->name, declType);
abortMaybe();
return;
}
if (!dvmInstanceof(objClazz, declClazz)) {
ALOGW("JNI WARNING: method declared to return '%s' returned '%s'",
declType, objType);
ALOGW(" failed in %s.%s",
method->clazz->descriptor, method->name);
abortMaybe();
return;
} else {
ALOGV("Check %s.%s: %s io %s (SLOW-OK)",
method->clazz->descriptor, method->name, objType, declType);
}
}
}
/*
* Determine if we need to check the return type coming out of the call.
*
* (We don't simply do this at the top of checkCallResultCommon() because
* this is on the critical path for native method calls.)
*/
static inline bool callNeedsCheck(const u4* args, JValue* pResult,
const Method* method, Thread* self)
{
return (method->shorty[0] == 'L' && !dvmCheckException(self) && pResult->l != NULL);
}
/*
* Check a call into native code.
*/
void dvmCheckCallJNIMethod(u4* args, JValue* pResult,
const Method* method, Thread* self)
{
dvmCallJNIMethod(args, pResult, method, self);
if (callNeedsCheck(args, pResult, method, self)) {
checkCallResultCommon(args, pResult, method, self);
}
}
/*
* ===========================================================================
* JNI function helpers
* ===========================================================================
*/
static inline const JNINativeInterface* baseEnv(JNIEnv* env) {
return ((JNIEnvExt*) env)->baseFuncTable;
}
static inline const JNIInvokeInterface* baseVm(JavaVM* vm) {
return ((JavaVMExt*) vm)->baseFuncTable;
}
class ScopedCheckJniThreadState {
public:
explicit ScopedCheckJniThreadState(JNIEnv* env) {
dvmChangeStatus(NULL, THREAD_RUNNING);
}
~ScopedCheckJniThreadState() {
dvmChangeStatus(NULL, THREAD_NATIVE);
}
private:
// Disallow copy and assignment.
ScopedCheckJniThreadState(const ScopedCheckJniThreadState&);
void operator=(const ScopedCheckJniThreadState&);
};
/*
* Flags passed into ScopedCheck.
*/
#define kFlag_Default 0x0000
#define kFlag_CritBad 0x0000 /* calling while in critical is bad */
#define kFlag_CritOkay 0x0001 /* ...okay */
#define kFlag_CritGet 0x0002 /* this is a critical "get" */
#define kFlag_CritRelease 0x0003 /* this is a critical "release" */
#define kFlag_CritMask 0x0003 /* bit mask to get "crit" value */
#define kFlag_ExcepBad 0x0000 /* raised exceptions are bad */
#define kFlag_ExcepOkay 0x0004 /* ...okay */
#define kFlag_Release 0x0010 /* are we in a non-critical release function? */
#define kFlag_NullableUtf 0x0020 /* are our UTF parameters nullable? */
#define kFlag_Invocation 0x8000 /* Part of the invocation interface (JavaVM*) */
static const char* indirectRefKindName(IndirectRef iref)
{
return indirectRefKindToString(indirectRefKind(iref));
}
class ScopedCheck {
public:
// For JNIEnv* functions.
explicit ScopedCheck(JNIEnv* env, int flags, const char* functionName) {
init(env, flags, functionName, true);
checkThread(flags);
}
// For JavaVM* functions.
explicit ScopedCheck(bool hasMethod, const char* functionName) {
init(NULL, kFlag_Invocation, functionName, hasMethod);
}
/*
* In some circumstances the VM will screen class names, but it doesn't
* for class lookup. When things get bounced through a class loader, they
* can actually get normalized a couple of times; as a result, passing in
* a class name like "java.lang.Thread" instead of "java/lang/Thread" will
* work in some circumstances.
*
* This is incorrect and could cause strange behavior or compatibility
* problems, so we want to screen that out here.
*
* We expect "fully-qualified" class names, like "java/lang/Thread" or
* "[Ljava/lang/Object;".
*/
void checkClassName(const char* className) {
if (!dexIsValidClassName(className, false)) {
ALOGW("JNI WARNING: illegal class name '%s' (%s)", className, mFunctionName);
ALOGW(" (should be formed like 'dalvik/system/DexFile')");
ALOGW(" or '[Ldalvik/system/DexFile;' or '[[B')");
abortMaybe();
}
}
void checkFieldTypeForGet(jfieldID fid, const char* expectedSignature, bool isStatic) {
if (fid == NULL) {
ALOGW("JNI WARNING: null jfieldID");
showLocation();
abortMaybe();
}
bool printWarn = false;
Field* field = (Field*) fid;
const char* actualSignature = field->signature;
if (*expectedSignature == 'L') {
// 'actualSignature' has the exact type.
// We just know we're expecting some kind of reference.
if (*actualSignature != 'L' && *actualSignature != '[') {
printWarn = true;
}
} else if (*actualSignature != *expectedSignature) {
printWarn = true;
}
if (!printWarn && isStatic && !dvmIsStaticField(field)) {
if (isStatic) {
ALOGW("JNI WARNING: accessing non-static field %s as static", field->name);
} else {
ALOGW("JNI WARNING: accessing static field %s as non-static", field->name);
}
printWarn = true;
}
if (printWarn) {
ALOGW("JNI WARNING: %s for field '%s' of expected type %s, got %s",
mFunctionName, field->name, expectedSignature, actualSignature);
showLocation();
abortMaybe();
}
}
/*
* Verify that the field is of the appropriate type. If the field has an
* object type, "jobj" is the object we're trying to assign into it.
*
* Works for both static and instance fields.
*/
void checkFieldTypeForSet(jobject jobj, jfieldID fieldID, PrimitiveType prim, bool isStatic) {
if (fieldID == NULL) {
ALOGW("JNI WARNING: null jfieldID");
showLocation();
abortMaybe();
}
bool printWarn = false;
Field* field = (Field*) fieldID;
if ((field->signature[0] == 'L' || field->signature[0] == '[') && jobj != NULL) {
ScopedCheckJniThreadState ts(mEnv);
Object* obj = dvmDecodeIndirectRef(self(), jobj);
/*
* If jobj is a weak global ref whose referent has been cleared,
* obj will be NULL. Otherwise, obj should always be non-NULL
* and valid.
*/
if (obj != NULL && !dvmIsHeapAddress(obj)) {
ALOGW("JNI WARNING: field operation on invalid %s reference (%p)",
indirectRefKindName(jobj), jobj);
printWarn = true;
} else {
ClassObject* fieldClass = dvmFindLoadedClass(field->signature);
ClassObject* objClass = obj->clazz;
assert(fieldClass != NULL);
assert(objClass != NULL);
if (!dvmInstanceof(objClass, fieldClass)) {
ALOGW("JNI WARNING: set field '%s' expected type %s, got %s",
field->name, field->signature, objClass->descriptor);
printWarn = true;
}
}
} else if (dexGetPrimitiveTypeFromDescriptorChar(field->signature[0]) != prim) {
ALOGW("JNI WARNING: %s for field '%s' expected type %s, got %s",
mFunctionName, field->name, field->signature, primitiveTypeToName(prim));
printWarn = true;
} else if (isStatic && !dvmIsStaticField(field)) {
if (isStatic) {
ALOGW("JNI WARNING: accessing non-static field %s as static", field->name);
} else {
ALOGW("JNI WARNING: accessing static field %s as non-static", field->name);
}
printWarn = true;
}
if (printWarn) {
showLocation();
abortMaybe();
}
}
/*
* Verify that this instance field ID is valid for this object.
*
* Assumes "jobj" has already been validated.
*/
void checkInstanceFieldID(jobject jobj, jfieldID fieldID) {
ScopedCheckJniThreadState ts(mEnv);
Object* obj = dvmDecodeIndirectRef(self(), jobj);
if (!dvmIsHeapAddress(obj)) {
ALOGW("JNI ERROR: field operation on invalid reference (%p)", jobj);
dvmAbort();
}
/*
* Check this class and all of its superclasses for a matching field.
* Don't need to scan interfaces.
*/
ClassObject* clazz = obj->clazz;
while (clazz != NULL) {
if ((InstField*) fieldID >= clazz->ifields &&
(InstField*) fieldID < clazz->ifields + clazz->ifieldCount) {
return;
}
clazz = clazz->super;
}
ALOGW("JNI WARNING: instance fieldID %p not valid for class %s",
fieldID, obj->clazz->descriptor);
showLocation();
abortMaybe();
}
/*
* Verify that the pointer value is non-NULL.
*/
void checkNonNull(const void* ptr) {
if (ptr == NULL) {
ALOGW("JNI WARNING: invalid null pointer (%s)", mFunctionName);
abortMaybe();
}
}
/*
* Verify that the method's return type matches the type of call.
* 'expectedType' will be "L" for all objects, including arrays.
*/
void checkSig(jmethodID methodID, const char* expectedType, bool isStatic) {
const Method* method = (const Method*) methodID;
bool printWarn = false;
if (*expectedType != method->shorty[0]) {
ALOGW("JNI WARNING: expected return type '%s'", expectedType);
printWarn = true;
} else if (isStatic && !dvmIsStaticMethod(method)) {
if (isStatic) {
ALOGW("JNI WARNING: calling non-static method with static call");
} else {
ALOGW("JNI WARNING: calling static method with non-static call");
}
printWarn = true;
}
if (printWarn) {
char* desc = dexProtoCopyMethodDescriptor(&method->prototype);
ALOGW(" calling %s.%s %s", method->clazz->descriptor, method->name, desc);
free(desc);
showLocation();
abortMaybe();
}
}
/*
* Verify that this static field ID is valid for this class.
*
* Assumes "jclazz" has already been validated.
*/
void checkStaticFieldID(jclass jclazz, jfieldID fieldID) {
ScopedCheckJniThreadState ts(mEnv);
ClassObject* clazz = (ClassObject*) dvmDecodeIndirectRef(self(), jclazz);
StaticField* base = &clazz->sfields[0];
int fieldCount = clazz->sfieldCount;
if ((StaticField*) fieldID < base || (StaticField*) fieldID >= base + fieldCount) {
ALOGW("JNI WARNING: static fieldID %p not valid for class %s",
fieldID, clazz->descriptor);
ALOGW(" base=%p count=%d", base, fieldCount);
showLocation();
abortMaybe();
}
}
/*
* Verify that "methodID" is appropriate for "clazz".
*
* A mismatch isn't dangerous, because the jmethodID defines the class. In
* fact, jclazz is unused in the implementation. It's best if we don't
* allow bad code in the system though.
*
* Instances of "jclazz" must be instances of the method's declaring class.
*/
void checkStaticMethod(jclass jclazz, jmethodID methodID) {
ScopedCheckJniThreadState ts(mEnv);
ClassObject* clazz = (ClassObject*) dvmDecodeIndirectRef(self(), jclazz);
const Method* method = (const Method*) methodID;
if (!dvmInstanceof(clazz, method->clazz)) {
ALOGW("JNI WARNING: can't call static %s.%s on class %s",
method->clazz->descriptor, method->name, clazz->descriptor);
showLocation();
// no abort?
}
}
/*
* Verify that "methodID" is appropriate for "jobj".
*
* Make sure the object is an instance of the method's declaring class.
* (Note the methodID might point to a declaration in an interface; this
* will be handled automatically by the instanceof check.)
*/
void checkVirtualMethod(jobject jobj, jmethodID methodID) {
ScopedCheckJniThreadState ts(mEnv);
Object* obj = dvmDecodeIndirectRef(self(), jobj);
const Method* method = (const Method*) methodID;
if (!dvmInstanceof(obj->clazz, method->clazz)) {
ALOGW("JNI WARNING: can't call %s.%s on instance of %s",
method->clazz->descriptor, method->name, obj->clazz->descriptor);
showLocation();
abortMaybe();
}
}
/**
* The format string is a sequence of the following characters,
* and must be followed by arguments of the corresponding types
* in the same order.
*
* Java primitive types:
* B - jbyte
* C - jchar
* D - jdouble
* F - jfloat
* I - jint
* J - jlong
* S - jshort
* Z - jboolean (shown as true and false)
* V - void
*
* Java reference types:
* L - jobject
* a - jarray
* c - jclass
* s - jstring
*
* JNI types:
* b - jboolean (shown as JNI_TRUE and JNI_FALSE)
* f - jfieldID
* m - jmethodID
* p - void*
* r - jint (for release mode arguments)
* t - thread args (for AttachCurrentThread)
* u - const char* (modified UTF-8)
* z - jsize (for lengths; use i if negative values are okay)
* v - JavaVM*
* E - JNIEnv*
* . - no argument; just print "..." (used for varargs JNI calls)
*
* Use the kFlag_NullableUtf flag where 'u' field(s) are nullable.
*/
void check(bool entry, const char* fmt0, ...) {
va_list ap;
bool shouldTrace = false;
const Method* method = NULL;
if ((gDvm.jniTrace || gDvmJni.logThirdPartyJni) && mHasMethod) {
// We need to guard some of the invocation interface's calls: a bad caller might
// use DetachCurrentThread or GetEnv on a thread that's not yet attached.
if ((mFlags & kFlag_Invocation) == 0 || dvmThreadSelf() != NULL) {
method = dvmGetCurrentJNIMethod();
}
}
if (method != NULL) {
// If both "-Xcheck:jni" and "-Xjnitrace:" are enabled, we print trace messages
// when a native method that matches the Xjnitrace argument calls a JNI function
// such as NewByteArray.
if (gDvm.jniTrace && strstr(method->clazz->descriptor, gDvm.jniTrace) != NULL) {
shouldTrace = true;
}
// If -Xjniopts:logThirdPartyJni is on, we want to log any JNI function calls
// made by a third-party native method.
if (gDvmJni.logThirdPartyJni) {
shouldTrace |= method->shouldTrace;
}
}
if (shouldTrace) {
va_start(ap, fmt0);
std::string msg;
for (const char* fmt = fmt0; *fmt;) {
char ch = *fmt++;
if (ch == 'B') { // jbyte
jbyte b = va_arg(ap, int);
if (b >= 0 && b < 10) {
StringAppendF(&msg, "%d", b);
} else {
StringAppendF(&msg, "%#x (%d)", b, b);
}
} else if (ch == 'C') { // jchar
jchar c = va_arg(ap, int);
if (c < 0x7f && c >= ' ') {
StringAppendF(&msg, "U+%x ('%c')", c, c);
} else {
StringAppendF(&msg, "U+%x", c);
}
} else if (ch == 'F' || ch == 'D') { // jfloat, jdouble
StringAppendF(&msg, "%g", va_arg(ap, double));
} else if (ch == 'I' || ch == 'S') { // jint, jshort
StringAppendF(&msg, "%d", va_arg(ap, int));
} else if (ch == 'J') { // jlong
StringAppendF(&msg, "%lld", va_arg(ap, jlong));
} else if (ch == 'Z') { // jboolean
StringAppendF(&msg, "%s", va_arg(ap, int) ? "true" : "false");
} else if (ch == 'V') { // void
msg += "void";
} else if (ch == 'v') { // JavaVM*
JavaVM* vm = va_arg(ap, JavaVM*);
StringAppendF(&msg, "(JavaVM*)%p", vm);
} else if (ch == 'E') { // JNIEnv*
JNIEnv* env = va_arg(ap, JNIEnv*);
StringAppendF(&msg, "(JNIEnv*)%p", env);
} else if (ch == 'L' || ch == 'a' || ch == 's') { // jobject, jarray, jstring
// For logging purposes, these are identical.
jobject o = va_arg(ap, jobject);
if (o == NULL) {
msg += "NULL";
} else {
StringAppendF(&msg, "%p", o);
}
} else if (ch == 'b') { // jboolean (JNI-style)
jboolean b = va_arg(ap, int);
msg += (b ? "JNI_TRUE" : "JNI_FALSE");
} else if (ch == 'c') { // jclass
jclass jc = va_arg(ap, jclass);
Object* c = dvmDecodeIndirectRef(self(), jc);
if (c == NULL) {
msg += "NULL";
} else if (c == kInvalidIndirectRefObject || !dvmIsHeapAddress(c)) {
StringAppendF(&msg, "%p(INVALID)", jc);
} else {
std::string className(dvmHumanReadableType(c));
StringAppendF(&msg, "%s", className.c_str());
if (!entry) {
StringAppendF(&msg, " (%p)", jc);
}
}
} else if (ch == 'f') { // jfieldID
jfieldID fid = va_arg(ap, jfieldID);
std::string name(dvmHumanReadableField((Field*) fid));
StringAppendF(&msg, "%s", name.c_str());
if (!entry) {
StringAppendF(&msg, " (%p)", fid);
}
} else if (ch == 'z') { // non-negative jsize
// You might expect jsize to be size_t, but it's not; it's the same as jint.
// We only treat this specially so we can do the non-negative check.
// TODO: maybe this wasn't worth it?
jint i = va_arg(ap, jint);
StringAppendF(&msg, "%d", i);
} else if (ch == 'm') { // jmethodID
jmethodID mid = va_arg(ap, jmethodID);
std::string name(dvmHumanReadableMethod((Method*) mid, true));
StringAppendF(&msg, "%s", name.c_str());
if (!entry) {
StringAppendF(&msg, " (%p)", mid);
}
} else if (ch == 'p' || ch == 't') { // void* ("pointer" or "thread args")
void* p = va_arg(ap, void*);
if (p == NULL) {
msg += "NULL";
} else {
StringAppendF(&msg, "(void*) %p", p);
}
} else if (ch == 'r') { // jint (release mode)
jint releaseMode = va_arg(ap, jint);
if (releaseMode == 0) {
msg += "0";
} else if (releaseMode == JNI_ABORT) {
msg += "JNI_ABORT";
} else if (releaseMode == JNI_COMMIT) {
msg += "JNI_COMMIT";
} else {
StringAppendF(&msg, "invalid release mode %d", releaseMode);
}
} else if (ch == 'u') { // const char* (modified UTF-8)
const char* utf = va_arg(ap, const char*);
if (utf == NULL) {
msg += "NULL";
} else {
StringAppendF(&msg, "\"%s\"", utf);
}
} else if (ch == '.') {
msg += "...";
} else {
ALOGE("unknown trace format specifier %c", ch);
dvmAbort();
}
if (*fmt) {
StringAppendF(&msg, ", ");
}
}
va_end(ap);
if (entry) {
if (mHasMethod) {
std::string methodName(dvmHumanReadableMethod(method, false));
ALOGI("JNI: %s -> %s(%s)", methodName.c_str(), mFunctionName, msg.c_str());
mIndent = methodName.size() + 1;
} else {
ALOGI("JNI: -> %s(%s)", mFunctionName, msg.c_str());
mIndent = 0;
}
} else {
ALOGI("JNI: %*s<- %s returned %s", mIndent, "", mFunctionName, msg.c_str());
}
}
// We always do the thorough checks on entry, and never on exit...
if (entry) {
va_start(ap, fmt0);
for (const char* fmt = fmt0; *fmt; ++fmt) {
char ch = *fmt;
if (ch == 'a') {
checkArray(va_arg(ap, jarray));
} else if (ch == 'c') {
checkClass(va_arg(ap, jclass));
} else if (ch == 'L') {
checkObject(va_arg(ap, jobject));
} else if (ch == 'r') {
checkReleaseMode(va_arg(ap, jint));
} else if (ch == 's') {
checkString(va_arg(ap, jstring));
} else if (ch == 't') {
checkThreadArgs(va_arg(ap, void*));
} else if (ch == 'u') {
if ((mFlags & kFlag_Release) != 0) {
checkNonNull(va_arg(ap, const char*));
} else {
bool nullable = ((mFlags & kFlag_NullableUtf) != 0);
checkUtfString(va_arg(ap, const char*), nullable);
}
} else if (ch == 'z') {
checkLengthPositive(va_arg(ap, jsize));
} else if (strchr("BCISZbfmpEv", ch) != NULL) {
va_arg(ap, int); // Skip this argument.
} else if (ch == 'D' || ch == 'F') {
va_arg(ap, double); // Skip this argument.
} else if (ch == 'J') {
va_arg(ap, long); // Skip this argument.
} else if (ch == '.') {
} else {
ALOGE("unknown check format specifier %c", ch);
dvmAbort();
}
}
va_end(ap);
}
}
// Only safe after checkThread returns.
Thread* self() {
return ((JNIEnvExt*) mEnv)->self;
}
private:
JNIEnv* mEnv;
const char* mFunctionName;
int mFlags;
bool mHasMethod;
size_t mIndent;
void init(JNIEnv* env, int flags, const char* functionName, bool hasMethod) {
mEnv = env;
mFlags = flags;
// Use +6 to drop the leading "Check_"...
mFunctionName = functionName + 6;
// Set "hasMethod" to true if we have a valid thread with a method pointer.
// We won't have one before attaching a thread, after detaching a thread, or
// after destroying the VM.
mHasMethod = hasMethod;
}
/*
* Verify that "array" is non-NULL and points to an Array object.
*
* Since we're dealing with objects, switch to "running" mode.
*/
void checkArray(jarray jarr) {
if (jarr == NULL) {
ALOGW("JNI WARNING: received null array");
showLocation();
abortMaybe();
return;
}
ScopedCheckJniThreadState ts(mEnv);
bool printWarn = false;
Object* obj = dvmDecodeIndirectRef(self(), jarr);
if (!dvmIsHeapAddress(obj)) {
ALOGW("JNI WARNING: jarray is an invalid %s reference (%p)",
indirectRefKindName(jarr), jarr);
printWarn = true;
} else if (obj->clazz->descriptor[0] != '[') {
ALOGW("JNI WARNING: jarray arg has wrong type (expected array, got %s)",
obj->clazz->descriptor);
printWarn = true;
}
if (printWarn) {
showLocation();
abortMaybe();
}
}
void checkClass(jclass c) {
checkInstance(c, gDvm.classJavaLangClass, "jclass");
}
void checkLengthPositive(jsize length) {
if (length < 0) {
ALOGW("JNI WARNING: negative jsize (%s)", mFunctionName);
abortMaybe();
}
}
/*
* Verify that "jobj" is a valid object, and that it's an object that JNI
* is allowed to know about. We allow NULL references.
*
* Switches to "running" mode before performing checks.
*/
void checkObject(jobject jobj) {
if (jobj == NULL) {
return;
}
ScopedCheckJniThreadState ts(mEnv);
bool printWarn = false;
if (dvmGetJNIRefType(self(), jobj) == JNIInvalidRefType) {
ALOGW("JNI WARNING: %p is not a valid JNI reference", jobj);
printWarn = true;
} else {
Object* obj = dvmDecodeIndirectRef(self(), jobj);
if (obj == kInvalidIndirectRefObject) {
ALOGW("JNI WARNING: native code passing in invalid reference %p", jobj);
printWarn = true;
} else if (obj != NULL && !dvmIsHeapAddress(obj)) {
// TODO: when we remove workAroundAppJniBugs, this should be impossible.
ALOGW("JNI WARNING: native code passing in reference to invalid object %p %p",
jobj, obj);
printWarn = true;
}
}
if (printWarn) {
showLocation();
abortMaybe();
}
}
/*
* Verify that the "mode" argument passed to a primitive array Release
* function is one of the valid values.
*/
void checkReleaseMode(jint mode) {
if (mode != 0 && mode != JNI_COMMIT && mode != JNI_ABORT) {
ALOGW("JNI WARNING: bad value for mode (%d) (%s)", mode, mFunctionName);
abortMaybe();
}
}
void checkString(jstring s) {
checkInstance(s, gDvm.classJavaLangString, "jstring");
}
void checkThreadArgs(void* thread_args) {
JavaVMAttachArgs* args = static_cast<JavaVMAttachArgs*>(thread_args);
if (args != NULL && args->version < JNI_VERSION_1_2) {
ALOGW("JNI WARNING: bad value for JNI version (%d) (%s)", args->version, mFunctionName);
abortMaybe();
}
}
void checkThread(int flags) {
// Get the *correct* JNIEnv by going through our TLS pointer.
JNIEnvExt* threadEnv = dvmGetJNIEnvForThread();
/*
* Verify that the current thread is (a) attached and (b) associated with
* this particular instance of JNIEnv.
*/
bool printWarn = false;
if (threadEnv == NULL) {
ALOGE("JNI ERROR: non-VM thread making JNI calls");
// don't set printWarn -- it'll try to call showLocation()
dvmAbort();
} else if ((JNIEnvExt*) mEnv != threadEnv) {
if (dvmThreadSelf()->threadId != threadEnv->envThreadId) {
ALOGE("JNI: threadEnv != thread->env?");
dvmAbort();
}
ALOGW("JNI WARNING: threadid=%d using env from threadid=%d",
threadEnv->envThreadId, ((JNIEnvExt*) mEnv)->envThreadId);
printWarn = true;
// If we're keeping broken code limping along, we need to suppress the abort...
if (gDvmJni.workAroundAppJniBugs) {
printWarn = false;
}
/* this is a bad idea -- need to throw as we exit, or abort func */
//dvmThrowRuntimeException("invalid use of JNI env ptr");
} else if (((JNIEnvExt*) mEnv)->self != dvmThreadSelf()) {
/* correct JNIEnv*; make sure the "self" pointer is correct */
ALOGE("JNI ERROR: env->self != thread-self (%p vs. %p)",
((JNIEnvExt*) mEnv)->self, dvmThreadSelf());
dvmAbort();
}
/*
* Verify that, if this thread previously made a critical "get" call, we
* do the corresponding "release" call before we try anything else.
*/
switch (flags & kFlag_CritMask) {
case kFlag_CritOkay: // okay to call this method
break;
case kFlag_CritBad: // not okay to call
if (threadEnv->critical) {
ALOGW("JNI WARNING: threadid=%d using JNI after critical get",
threadEnv->envThreadId);
printWarn = true;
}
break;
case kFlag_CritGet: // this is a "get" call
/* don't check here; we allow nested gets */
threadEnv->critical++;
break;
case kFlag_CritRelease: // this is a "release" call
threadEnv->critical--;
if (threadEnv->critical < 0) {
ALOGW("JNI WARNING: threadid=%d called too many crit releases",
threadEnv->envThreadId);
printWarn = true;
}
break;
default:
assert(false);
}
/*
* Verify that, if an exception has been raised, the native code doesn't
* make any JNI calls other than the Exception* methods.
*/
bool printException = false;
if ((flags & kFlag_ExcepOkay) == 0 && dvmCheckException(dvmThreadSelf())) {
ALOGW("JNI WARNING: JNI method called with exception pending");
printWarn = true;
printException = true;
}
if (printWarn) {
showLocation();
}
if (printException) {
ALOGW("Pending exception is:");
dvmLogExceptionStackTrace();
}
if (printWarn) {
abortMaybe();
}
}
/*
* Verify that "bytes" points to valid "modified UTF-8" data.
*/
void checkUtfString(const char* bytes, bool nullable) {
if (bytes == NULL) {
if (!nullable) {
ALOGW("JNI WARNING: non-nullable const char* was NULL");
showLocation();
abortMaybe();
}
return;
}
const char* errorKind = NULL;
u1 utf8 = checkUtfBytes(bytes, &errorKind);
if (errorKind != NULL) {
ALOGW("JNI WARNING: input is not valid Modified UTF-8: illegal %s byte %#x", errorKind, utf8);
ALOGW(" string: '%s'", bytes);
showLocation();
abortMaybe();
}
}
/*
* Verify that "jobj" is a valid non-NULL object reference, and points to
* an instance of expectedClass.
*
* Because we're looking at an object on the GC heap, we have to switch
* to "running" mode before doing the checks.
*/
void checkInstance(jobject jobj, ClassObject* expectedClass, const char* argName) {
if (jobj == NULL) {
ALOGW("JNI WARNING: received null %s", argName);
showLocation();
abortMaybe();
return;
}
ScopedCheckJniThreadState ts(mEnv);
bool printWarn = false;
Object* obj = dvmDecodeIndirectRef(self(), jobj);
if (!dvmIsHeapAddress(obj)) {
ALOGW("JNI WARNING: %s is an invalid %s reference (%p)",
argName, indirectRefKindName(jobj), jobj);
printWarn = true;
} else if (obj->clazz != expectedClass) {
ALOGW("JNI WARNING: %s arg has wrong type (expected %s, got %s)",
argName, expectedClass->descriptor, obj->clazz->descriptor);
printWarn = true;
}
if (printWarn) {
showLocation();
abortMaybe();
}
}
static u1 checkUtfBytes(const char* bytes, const char** errorKind) {
while (*bytes != '\0') {
u1 utf8 = *(bytes++);
// Switch on the high four bits.
switch (utf8 >> 4) {
case 0x00:
case 0x01:
case 0x02:
case 0x03:
case 0x04:
case 0x05:
case 0x06:
case 0x07:
// Bit pattern 0xxx. No need for any extra bytes.
break;
case 0x08:
case 0x09:
case 0x0a:
case 0x0b:
case 0x0f:
/*
* Bit pattern 10xx or 1111, which are illegal start bytes.
* Note: 1111 is valid for normal UTF-8, but not the
* modified UTF-8 used here.
*/
*errorKind = "start";
return utf8;
case 0x0e:
// Bit pattern 1110, so there are two additional bytes.
utf8 = *(bytes++);
if ((utf8 & 0xc0) != 0x80) {
*errorKind = "continuation";
return utf8;
}
// Fall through to take care of the final byte.
case 0x0c:
case 0x0d:
// Bit pattern 110x, so there is one additional byte.
utf8 = *(bytes++);
if ((utf8 & 0xc0) != 0x80) {
*errorKind = "continuation";
return utf8;
}
break;
}
}
return 0;
}
/**
* Returns a human-readable name for the given primitive type.
*/
static const char* primitiveTypeToName(PrimitiveType primType) {
switch (primType) {
case PRIM_VOID: return "void";
case PRIM_BOOLEAN: return "boolean";
case PRIM_BYTE: return "byte";
case PRIM_SHORT: return "short";
case PRIM_CHAR: return "char";
case PRIM_INT: return "int";
case PRIM_LONG: return "long";
case PRIM_FLOAT: return "float";
case PRIM_DOUBLE: return "double";
case PRIM_NOT: return "Object/array";
default: return "???";
}
}
void showLocation() {
const Method* method = dvmGetCurrentJNIMethod();
char* desc = dexProtoCopyMethodDescriptor(&method->prototype);
ALOGW(" in %s.%s:%s (%s)", method->clazz->descriptor, method->name, desc, mFunctionName);
free(desc);
}
// Disallow copy and assignment.
ScopedCheck(const ScopedCheck&);
void operator=(const ScopedCheck&);
};
/*
* ===========================================================================
* Guarded arrays
* ===========================================================================
*/
#define kGuardLen 512 /* must be multiple of 2 */
#define kGuardPattern 0xd5e3 /* uncommon values; d5e3d5e3 invalid addr */
#define kGuardMagic 0xffd5aa96
/* this gets tucked in at the start of the buffer; struct size must be even */
struct GuardedCopy {
u4 magic;
uLong adler;
size_t originalLen;
const void* originalPtr;
/* find the GuardedCopy given the pointer into the "live" data */
static inline const GuardedCopy* fromData(const void* dataBuf) {
return reinterpret_cast<const GuardedCopy*>(actualBuffer(dataBuf));
}
/*
* Create an over-sized buffer to hold the contents of "buf". Copy it in,
* filling in the area around it with guard data.
*
* We use a 16-bit pattern to make a rogue memset less likely to elude us.
*/
static void* create(const void* buf, size_t len, bool modOkay) {
size_t newLen = actualLength(len);
u1* newBuf = debugAlloc(newLen);
/* fill it in with a pattern */
u2* pat = (u2*) newBuf;
for (size_t i = 0; i < newLen / 2; i++) {
*pat++ = kGuardPattern;
}
/* copy the data in; note "len" could be zero */
memcpy(newBuf + kGuardLen / 2, buf, len);
/* if modification is not expected, grab a checksum */
uLong adler = 0;
if (!modOkay) {
adler = adler32(0L, Z_NULL, 0);
adler = adler32(adler, (const Bytef*)buf, len);
*(uLong*)newBuf = adler;
}
GuardedCopy* pExtra = reinterpret_cast<GuardedCopy*>(newBuf);
pExtra->magic = kGuardMagic;
pExtra->adler = adler;
pExtra->originalPtr = buf;
pExtra->originalLen = len;
return newBuf + kGuardLen / 2;
}
/*
* Free up the guard buffer, scrub it, and return the original pointer.
*/
static void* destroy(void* dataBuf) {
const GuardedCopy* pExtra = GuardedCopy::fromData(dataBuf);
void* originalPtr = (void*) pExtra->originalPtr;
size_t len = pExtra->originalLen;
debugFree(dataBuf, len);
return originalPtr;
}
/*
* Verify the guard area and, if "modOkay" is false, that the data itself
* has not been altered.
*
* The caller has already checked that "dataBuf" is non-NULL.
*/
static bool check(const void* dataBuf, bool modOkay) {
static const u4 kMagicCmp = kGuardMagic;
const u1* fullBuf = actualBuffer(dataBuf);
const GuardedCopy* pExtra = GuardedCopy::fromData(dataBuf);
/*
* Before we do anything with "pExtra", check the magic number. We
* do the check with memcmp rather than "==" in case the pointer is
* unaligned. If it points to completely bogus memory we're going
* to crash, but there's no easy way around that.
*/
if (memcmp(&pExtra->magic, &kMagicCmp, 4) != 0) {
u1 buf[4];
memcpy(buf, &pExtra->magic, 4);
ALOGE("JNI: guard magic does not match (found 0x%02x%02x%02x%02x) -- incorrect data pointer %p?",
buf[3], buf[2], buf[1], buf[0], dataBuf); /* assume little endian */
return false;
}
size_t len = pExtra->originalLen;
/* check bottom half of guard; skip over optional checksum storage */
const u2* pat = (u2*) fullBuf;
for (size_t i = sizeof(GuardedCopy) / 2; i < (kGuardLen / 2 - sizeof(GuardedCopy)) / 2; i++) {
if (pat[i] != kGuardPattern) {
ALOGE("JNI: guard pattern(1) disturbed at %p + %d", fullBuf, i*2);
return false;
}
}
int offset = kGuardLen / 2 + len;
if (offset & 0x01) {
/* odd byte; expected value depends on endian-ness of host */
const u2 patSample = kGuardPattern;
if (fullBuf[offset] != ((const u1*) &patSample)[1]) {
ALOGE("JNI: guard pattern disturbed in odd byte after %p (+%d) 0x%02x 0x%02x",
fullBuf, offset, fullBuf[offset], ((const u1*) &patSample)[1]);
return false;
}
offset++;
}
/* check top half of guard */
pat = (u2*) (fullBuf + offset);
for (size_t i = 0; i < kGuardLen / 4; i++) {
if (pat[i] != kGuardPattern) {
ALOGE("JNI: guard pattern(2) disturbed at %p + %d", fullBuf, offset + i*2);
return false;
}
}
/*
* If modification is not expected, verify checksum. Strictly speaking
* this is wrong: if we told the client that we made a copy, there's no
* reason they can't alter the buffer.
*/
if (!modOkay) {
uLong adler = adler32(0L, Z_NULL, 0);
adler = adler32(adler, (const Bytef*)dataBuf, len);
if (pExtra->adler != adler) {
ALOGE("JNI: buffer modified (0x%08lx vs 0x%08lx) at addr %p",
pExtra->adler, adler, dataBuf);
return false;
}
}
return true;
}
private:
static u1* debugAlloc(size_t len) {
void* result = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0);
if (result == MAP_FAILED) {
ALOGE("GuardedCopy::create mmap(%d) failed: %s", len, strerror(errno));
dvmAbort();
}
return reinterpret_cast<u1*>(result);
}
static void debugFree(void* dataBuf, size_t len) {
u1* fullBuf = actualBuffer(dataBuf);
size_t totalByteCount = actualLength(len);
// TODO: we could mprotect instead, and keep the allocation around for a while.
// This would be even more expensive, but it might catch more errors.
// if (mprotect(fullBuf, totalByteCount, PROT_NONE) != 0) {
// ALOGW("mprotect(PROT_NONE) failed: %s", strerror(errno));
// }
if (munmap(fullBuf, totalByteCount) != 0) {
ALOGW("munmap failed: %s", strerror(errno));
dvmAbort();
}
}
static const u1* actualBuffer(const void* dataBuf) {
return reinterpret_cast<const u1*>(dataBuf) - kGuardLen / 2;
}
static u1* actualBuffer(void* dataBuf) {
return reinterpret_cast<u1*>(dataBuf) - kGuardLen / 2;
}
// Underlying length of a user allocation of 'length' bytes.
static size_t actualLength(size_t length) {
return (length + kGuardLen + 1) & ~0x01;
}
};
/*
* Return the width, in bytes, of a primitive type.
*/
static int dvmPrimitiveTypeWidth(PrimitiveType primType) {
switch (primType) {
case PRIM_BOOLEAN: return 1;
case PRIM_BYTE: return 1;
case PRIM_SHORT: return 2;
case PRIM_CHAR: return 2;
case PRIM_INT: return 4;
case PRIM_LONG: return 8;
case PRIM_FLOAT: return 4;
case PRIM_DOUBLE: return 8;
case PRIM_VOID:
default: {
assert(false);
return -1;
}
}
}
/*
* Create a guarded copy of a primitive array. Modifications to the copied
* data are allowed. Returns a pointer to the copied data.
*/
static void* createGuardedPACopy(JNIEnv* env, const jarray jarr, jboolean* isCopy) {
ScopedCheckJniThreadState ts(env);
ArrayObject* arrObj = (ArrayObject*) dvmDecodeIndirectRef(dvmThreadSelf(), jarr);
PrimitiveType primType = arrObj->clazz->elementClass->primitiveType;
int len = arrObj->length * dvmPrimitiveTypeWidth(primType);
void* result = GuardedCopy::create(arrObj->contents, len, true);
if (isCopy != NULL) {
*isCopy = JNI_TRUE;
}
return result;
}
/*
* Perform the array "release" operation, which may or may not copy data
* back into the VM, and may or may not release the underlying storage.
*/
static void* releaseGuardedPACopy(JNIEnv* env, jarray jarr, void* dataBuf, int mode) {
ScopedCheckJniThreadState ts(env);
ArrayObject* arrObj = (ArrayObject*) dvmDecodeIndirectRef(dvmThreadSelf(), jarr);
if (!GuardedCopy::check(dataBuf, true)) {
ALOGE("JNI: failed guarded copy check in releaseGuardedPACopy");
abortMaybe();
return NULL;
}
if (mode != JNI_ABORT) {
size_t len = GuardedCopy::fromData(dataBuf)->originalLen;
memcpy(arrObj->contents, dataBuf, len);
}
u1* result = NULL;
if (mode != JNI_COMMIT) {
result = (u1*) GuardedCopy::destroy(dataBuf);
} else {
result = (u1*) (void*) GuardedCopy::fromData(dataBuf)->originalPtr;
}
/* pointer is to the array contents; back up to the array object */
result -= OFFSETOF_MEMBER(ArrayObject, contents);
return result;
}
/*
* ===========================================================================
* JNI functions
* ===========================================================================
*/
#define CHECK_JNI_ENTRY(flags, types, args...) \
ScopedCheck sc(env, flags, __FUNCTION__); \
sc.check(true, types, args)
#define CHECK_JNI_EXIT(type, exp) ({ \
typeof (exp) _rc = (exp); \
sc.check(false, type, _rc); \
_rc; })
#define CHECK_JNI_EXIT_VOID() \
sc.check(false, "V")
static jint Check_GetVersion(JNIEnv* env) {
CHECK_JNI_ENTRY(kFlag_Default, "E", env);
return CHECK_JNI_EXIT("I", baseEnv(env)->GetVersion(env));
}
static jclass Check_DefineClass(JNIEnv* env, const char* name, jobject loader,
const jbyte* buf, jsize bufLen)
{
CHECK_JNI_ENTRY(kFlag_Default, "EuLpz", env, name, loader, buf, bufLen);
sc.checkClassName(name);
return CHECK_JNI_EXIT("c", baseEnv(env)->DefineClass(env, name, loader, buf, bufLen));
}
static jclass Check_FindClass(JNIEnv* env, const char* name) {
CHECK_JNI_ENTRY(kFlag_Default, "Eu", env, name);
sc.checkClassName(name);
return CHECK_JNI_EXIT("c", baseEnv(env)->FindClass(env, name));
}
static jclass Check_GetSuperclass(JNIEnv* env, jclass clazz) {
CHECK_JNI_ENTRY(kFlag_Default, "Ec", env, clazz);
return CHECK_JNI_EXIT("c", baseEnv(env)->GetSuperclass(env, clazz));
}
static jboolean Check_IsAssignableFrom(JNIEnv* env, jclass clazz1, jclass clazz2) {
CHECK_JNI_ENTRY(kFlag_Default, "Ecc", env, clazz1, clazz2);
return CHECK_JNI_EXIT("b", baseEnv(env)->IsAssignableFrom(env, clazz1, clazz2));
}
static jmethodID Check_FromReflectedMethod(JNIEnv* env, jobject method) {
CHECK_JNI_ENTRY(kFlag_Default, "EL", env, method);
// TODO: check that 'field' is a java.lang.reflect.Method.
return CHECK_JNI_EXIT("m", baseEnv(env)->FromReflectedMethod(env, method));
}
static jfieldID Check_FromReflectedField(JNIEnv* env, jobject field) {
CHECK_JNI_ENTRY(kFlag_Default, "EL", env, field);
// TODO: check that 'field' is a java.lang.reflect.Field.
return CHECK_JNI_EXIT("f", baseEnv(env)->FromReflectedField(env, field));
}
static jobject Check_ToReflectedMethod(JNIEnv* env, jclass cls,
jmethodID methodID, jboolean isStatic)
{
CHECK_JNI_ENTRY(kFlag_Default, "Ecmb", env, cls, methodID, isStatic);
return CHECK_JNI_EXIT("L", baseEnv(env)->ToReflectedMethod(env, cls, methodID, isStatic));
}
static jobject Check_ToReflectedField(JNIEnv* env, jclass cls,
jfieldID fieldID, jboolean isStatic)
{
CHECK_JNI_ENTRY(kFlag_Default, "Ecfb", env, cls, fieldID, isStatic);
return CHECK_JNI_EXIT("L", baseEnv(env)->ToReflectedField(env, cls, fieldID, isStatic));
}
static jint Check_Throw(JNIEnv* env, jthrowable obj) {
CHECK_JNI_ENTRY(kFlag_Default, "EL", env, obj);
// TODO: check that 'obj' is a java.lang.Throwable.
return CHECK_JNI_EXIT("I", baseEnv(env)->Throw(env, obj));
}
static jint Check_ThrowNew(JNIEnv* env, jclass clazz, const char* message) {
CHECK_JNI_ENTRY(kFlag_NullableUtf, "Ecu", env, clazz, message);
return CHECK_JNI_EXIT("I", baseEnv(env)->ThrowNew(env, clazz, message));
}
static jthrowable Check_ExceptionOccurred(JNIEnv* env) {
CHECK_JNI_ENTRY(kFlag_ExcepOkay, "E", env);
return CHECK_JNI_EXIT("L", baseEnv(env)->ExceptionOccurred(env));
}
static void Check_ExceptionDescribe(JNIEnv* env) {
CHECK_JNI_ENTRY(kFlag_ExcepOkay, "E", env);
baseEnv(env)->ExceptionDescribe(env);
CHECK_JNI_EXIT_VOID();
}
static void Check_ExceptionClear(JNIEnv* env) {
CHECK_JNI_ENTRY(kFlag_ExcepOkay, "E", env);
baseEnv(env)->ExceptionClear(env);
CHECK_JNI_EXIT_VOID();
}
static void Check_FatalError(JNIEnv* env, const char* msg) {
CHECK_JNI_ENTRY(kFlag_NullableUtf, "Eu", env, msg);
baseEnv(env)->FatalError(env, msg);
CHECK_JNI_EXIT_VOID();
}
static jint Check_PushLocalFrame(JNIEnv* env, jint capacity) {
CHECK_JNI_ENTRY(kFlag_Default | kFlag_ExcepOkay, "EI", env, capacity);
return CHECK_JNI_EXIT("I", baseEnv(env)->PushLocalFrame(env, capacity));
}
static jobject Check_PopLocalFrame(JNIEnv* env, jobject res) {
CHECK_JNI_ENTRY(kFlag_Default | kFlag_ExcepOkay, "EL", env, res);
return CHECK_JNI_EXIT("L", baseEnv(env)->PopLocalFrame(env, res));
}
static jobject Check_NewGlobalRef(JNIEnv* env, jobject obj) {
CHECK_JNI_ENTRY(kFlag_Default, "EL", env, obj);
return CHECK_JNI_EXIT("L", baseEnv(env)->NewGlobalRef(env, obj));
}
static void Check_DeleteGlobalRef(JNIEnv* env, jobject globalRef) {
CHECK_JNI_ENTRY(kFlag_Default | kFlag_ExcepOkay, "EL", env, globalRef);
if (globalRef != NULL && dvmGetJNIRefType(sc.self(), globalRef) != JNIGlobalRefType) {
ALOGW("JNI WARNING: DeleteGlobalRef on non-global %p (type=%d)",
globalRef, dvmGetJNIRefType(sc.self(), globalRef));
abortMaybe();
} else {
baseEnv(env)->DeleteGlobalRef(env, globalRef);
CHECK_JNI_EXIT_VOID();
}
}
static jobject Check_NewLocalRef(JNIEnv* env, jobject ref) {
CHECK_JNI_ENTRY(kFlag_Default, "EL", env, ref);
return CHECK_JNI_EXIT("L", baseEnv(env)->NewLocalRef(env, ref));
}
static void Check_DeleteLocalRef(JNIEnv* env, jobject localRef) {
CHECK_JNI_ENTRY(kFlag_Default | kFlag_ExcepOkay, "EL", env, localRef);
if (localRef != NULL && dvmGetJNIRefType(sc.self(), localRef) != JNILocalRefType) {
ALOGW("JNI WARNING: DeleteLocalRef on non-local %p (type=%d)",
localRef, dvmGetJNIRefType(sc.self(), localRef));
abortMaybe();
} else {
baseEnv(env)->DeleteLocalRef(env, localRef);
CHECK_JNI_EXIT_VOID();
}
}
static jint Check_EnsureLocalCapacity(JNIEnv *env, jint capacity) {
CHECK_JNI_ENTRY(kFlag_Default, "EI", env, capacity);
return CHECK_JNI_EXIT("I", baseEnv(env)->EnsureLocalCapacity(env, capacity));
}
static jboolean Check_IsSameObject(JNIEnv* env, jobject ref1, jobject ref2) {
CHECK_JNI_ENTRY(kFlag_Default, "ELL", env, ref1, ref2);
return CHECK_JNI_EXIT("b", baseEnv(env)->IsSameObject(env, ref1, ref2));
}
static jobject Check_AllocObject(JNIEnv* env, jclass clazz) {
CHECK_JNI_ENTRY(kFlag_Default, "Ec", env, clazz);
return CHECK_JNI_EXIT("L", baseEnv(env)->AllocObject(env, clazz));
}
static jobject Check_NewObject(JNIEnv* env, jclass clazz, jmethodID methodID, ...) {
CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, clazz, methodID);
va_list args;
va_start(args, methodID);
jobject result = baseEnv(env)->NewObjectV(env, clazz, methodID, args);
va_end(args);
return CHECK_JNI_EXIT("L", result);
}
static jobject Check_NewObjectV(JNIEnv* env, jclass clazz, jmethodID methodID, va_list args) {
CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, clazz, methodID);
return CHECK_JNI_EXIT("L", baseEnv(env)->NewObjectV(env, clazz, methodID, args));
}
static jobject Check_NewObjectA(JNIEnv* env, jclass clazz, jmethodID methodID, jvalue* args) {
CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, clazz, methodID);
return CHECK_JNI_EXIT("L", baseEnv(env)->NewObjectA(env, clazz, methodID, args));
}
static jobject Check_NewTaintedObjectA(JNIEnv* env, jclass clazz, jmethodID methodID, u4 objTaint, jvalue* args, u4* taints) {
CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, clazz, methodID);
return CHECK_JNI_EXIT("L", baseEnv(env)->NewTaintedObjectA(env, clazz, methodID, objTaint, args, taints));
}
static jclass Check_GetObjectClass(JNIEnv* env, jobject obj) {
CHECK_JNI_ENTRY(kFlag_Default, "EL", env, obj);
return CHECK_JNI_EXIT("c", baseEnv(env)->GetObjectClass(env, obj));
}
static jboolean Check_IsInstanceOf(JNIEnv* env, jobject obj, jclass clazz) {
CHECK_JNI_ENTRY(kFlag_Default, "ELc", env, obj, clazz);
return CHECK_JNI_EXIT("b", baseEnv(env)->IsInstanceOf(env, obj, clazz));
}
static jmethodID Check_GetMethodID(JNIEnv* env, jclass clazz, const char* name, const char* sig) {
CHECK_JNI_ENTRY(kFlag_Default, "Ecuu", env, clazz, name, sig);
return CHECK_JNI_EXIT("m", baseEnv(env)->GetMethodID(env, clazz, name, sig));
}
static jfieldID Check_GetFieldID(JNIEnv* env, jclass clazz, const char* name, const char* sig) {
CHECK_JNI_ENTRY(kFlag_Default, "Ecuu", env, clazz, name, sig);
return CHECK_JNI_EXIT("f", baseEnv(env)->GetFieldID(env, clazz, name, sig));
}
static jmethodID Check_GetStaticMethodID(JNIEnv* env, jclass clazz,
const char* name, const char* sig)
{
CHECK_JNI_ENTRY(kFlag_Default, "Ecuu", env, clazz, name, sig);
return CHECK_JNI_EXIT("m", baseEnv(env)->GetStaticMethodID(env, clazz, name, sig));
}
static jfieldID Check_GetStaticFieldID(JNIEnv* env, jclass clazz,
const char* name, const char* sig)
{
CHECK_JNI_ENTRY(kFlag_Default, "Ecuu", env, clazz, name, sig);
return CHECK_JNI_EXIT("f", baseEnv(env)->GetStaticFieldID(env, clazz, name, sig));
}
#define FIELD_ACCESSORS(_ctype, _jname, _ftype, _type) \
static _ctype Check_GetStatic##_jname##Field(JNIEnv* env, jclass clazz, jfieldID fieldID) { \
CHECK_JNI_ENTRY(kFlag_Default, "Ecf", env, clazz, fieldID); \
sc.checkStaticFieldID(clazz, fieldID); \
sc.checkFieldTypeForGet(fieldID, _type, true); \
return CHECK_JNI_EXIT(_type, baseEnv(env)->GetStatic##_jname##Field(env, clazz, fieldID)); \
} \
static _ctype Check_GetStatic##_jname##TaintedField(JNIEnv* env, jclass clazz, jfieldID fieldID, u4* taint) { \
CHECK_JNI_ENTRY(kFlag_Default, "Ecf", env, clazz, fieldID); \
sc.checkStaticFieldID(clazz, fieldID); \
sc.checkFieldTypeForGet(fieldID, _type, true); \
return CHECK_JNI_EXIT(_type, baseEnv(env)->GetStatic##_jname##TaintedField(env, clazz, fieldID, taint)); \
} \
static _ctype Check_Get##_jname##Field(JNIEnv* env, jobject obj, jfieldID fieldID) { \
CHECK_JNI_ENTRY(kFlag_Default, "ELf", env, obj, fieldID); \
sc.checkInstanceFieldID(obj, fieldID); \
sc.checkFieldTypeForGet(fieldID, _type, false); \
return CHECK_JNI_EXIT(_type, baseEnv(env)->Get##_jname##Field(env, obj, fieldID)); \
} \
static void Check_SetStatic##_jname##TaintedField(JNIEnv* env, jclass clazz, jfieldID fieldID, _ctype value, u4 taint) { \
CHECK_JNI_ENTRY(kFlag_Default, "Ecf" _type, env, clazz, fieldID, value); \
sc.checkStaticFieldID(clazz, fieldID); \
/* "value" arg only used when type == ref */ \
sc.checkFieldTypeForSet((jobject)(u4)value, fieldID, _ftype, true); \
baseEnv(env)->SetStatic##_jname##TaintedField(env, clazz, fieldID, value, taint); \
CHECK_JNI_EXIT_VOID(); \
} \
static void Check_SetStatic##_jname##Field(JNIEnv* env, jclass clazz, jfieldID fieldID, _ctype value) { \
CHECK_JNI_ENTRY(kFlag_Default, "Ecf" _type, env, clazz, fieldID, value); \
sc.checkStaticFieldID(clazz, fieldID); \
/* "value" arg only used when type == ref */ \
sc.checkFieldTypeForSet((jobject)(u4)value, fieldID, _ftype, true); \
baseEnv(env)->SetStatic##_jname##Field(env, clazz, fieldID, value); \
CHECK_JNI_EXIT_VOID(); \
} \
static void Check_Set##_jname##Field(JNIEnv* env, jobject obj, jfieldID fieldID, _ctype value) { \
CHECK_JNI_ENTRY(kFlag_Default, "ELf" _type, env, obj, fieldID, value); \
sc.checkInstanceFieldID(obj, fieldID); \
/* "value" arg only used when type == ref */ \
sc.checkFieldTypeForSet((jobject)(u4) value, fieldID, _ftype, false); \
baseEnv(env)->Set##_jname##Field(env, obj, fieldID, value); \
CHECK_JNI_EXIT_VOID(); \
} \
static _ctype Check_Get##_jname##TaintedField(JNIEnv* env, jobject obj, jfieldID fieldID, u4* taint) { \
CHECK_JNI_ENTRY(kFlag_Default, "ELf", env, obj, fieldID); \
sc.checkInstanceFieldID(obj, fieldID); \
sc.checkFieldTypeForGet(fieldID, _type, false); \
return CHECK_JNI_EXIT(_type, baseEnv(env)->Get##_jname##TaintedField(env, obj, fieldID, taint)); \
} \
static void Check_Set##_jname##TaintedField(JNIEnv* env, jobject obj, jfieldID fieldID, _ctype value, u4 taint) { \
CHECK_JNI_ENTRY(kFlag_Default, "ELf" _type, env, obj, fieldID, value); \
sc.checkInstanceFieldID(obj, fieldID); \
/* "value" arg only used when type == ref */ \
sc.checkFieldTypeForSet((jobject)(u4) value, fieldID, _ftype, false); \
baseEnv(env)->Set##_jname##TaintedField(env, obj, fieldID, value, taint); \
CHECK_JNI_EXIT_VOID(); \
}
FIELD_ACCESSORS(jobject, Object, PRIM_NOT, "L");
FIELD_ACCESSORS(jboolean, Boolean, PRIM_BOOLEAN, "Z");
FIELD_ACCESSORS(jbyte, Byte, PRIM_BYTE, "B");
FIELD_ACCESSORS(jchar, Char, PRIM_CHAR, "C");
FIELD_ACCESSORS(jshort, Short, PRIM_SHORT, "S");
FIELD_ACCESSORS(jint, Int, PRIM_INT, "I");
FIELD_ACCESSORS(jlong, Long, PRIM_LONG, "J");
FIELD_ACCESSORS(jfloat, Float, PRIM_FLOAT, "F");
FIELD_ACCESSORS(jdouble, Double, PRIM_DOUBLE, "D");
#define CALL(_ctype, _jname, _retdecl, _retasgn, _retok, _retsig) \
/* Virtual... */ \
static _ctype Check_Call##_jname##Method(JNIEnv* env, jobject obj, \
jmethodID methodID, ...) \
{ \
CHECK_JNI_ENTRY(kFlag_Default, "ELm.", env, obj, methodID); /* TODO: args! */ \
sc.checkSig(methodID, _retsig, false); \
sc.checkVirtualMethod(obj, methodID); \
_retdecl; \
va_list args; \
va_start(args, methodID); \
_retasgn baseEnv(env)->Call##_jname##MethodV(env, obj, methodID, args); \
va_end(args); \
_retok; \
} \
static _ctype Check_Call##_jname##MethodV(JNIEnv* env, jobject obj, \
jmethodID methodID, va_list args) \
{ \
CHECK_JNI_ENTRY(kFlag_Default, "ELm.", env, obj, methodID); /* TODO: args! */ \
sc.checkSig(methodID, _retsig, false); \
sc.checkVirtualMethod(obj, methodID); \
_retdecl; \
_retasgn baseEnv(env)->Call##_jname##MethodV(env, obj, methodID, args); \
_retok; \
} \
static _ctype Check_Call##_jname##MethodA(JNIEnv* env, jobject obj, \
jmethodID methodID, jvalue* args) \
{ \
CHECK_JNI_ENTRY(kFlag_Default, "ELm.", env, obj, methodID); /* TODO: args! */ \
sc.checkSig(methodID, _retsig, false); \
sc.checkVirtualMethod(obj, methodID); \
_retdecl; \
_retasgn baseEnv(env)->Call##_jname##MethodA(env, obj, methodID, args); \
_retok; \
} \
static _ctype Check_Call##_jname##TaintedMethodA(JNIEnv* env, jobject obj, \
u4 objTaint, jmethodID methodID, u4* retTaint, jvalue* args, u4* taints) \
{ \
CHECK_JNI_ENTRY(kFlag_Default, "ELm.", env, obj, methodID); /* TODO: args! */ \
sc.checkSig(methodID, _retsig, false); \
sc.checkVirtualMethod(obj, methodID); \
_retdecl; \
_retasgn baseEnv(env)->Call##_jname##TaintedMethodA(env, obj, objTaint, methodID, retTaint, args, taints); \
_retok; \
} \
/* Non-virtual... */ \
static _ctype Check_CallNonvirtual##_jname##Method(JNIEnv* env, \
jobject obj, jclass clazz, jmethodID methodID, ...) \
{ \
CHECK_JNI_ENTRY(kFlag_Default, "ELcm.", env, obj, clazz, methodID); /* TODO: args! */ \
sc.checkSig(methodID, _retsig, false); \
sc.checkVirtualMethod(obj, methodID); \
_retdecl; \
va_list args; \
va_start(args, methodID); \
_retasgn baseEnv(env)->CallNonvirtual##_jname##MethodV(env, obj, clazz, methodID, args); \
va_end(args); \
_retok; \
} \
static _ctype Check_CallNonvirtual##_jname##MethodV(JNIEnv* env, \
jobject obj, jclass clazz, jmethodID methodID, va_list args) \
{ \
CHECK_JNI_ENTRY(kFlag_Default, "ELcm.", env, obj, clazz, methodID); /* TODO: args! */ \
sc.checkSig(methodID, _retsig, false); \
sc.checkVirtualMethod(obj, methodID); \
_retdecl; \
_retasgn baseEnv(env)->CallNonvirtual##_jname##MethodV(env, obj, clazz, methodID, args); \
_retok; \
} \
static _ctype Check_CallNonvirtual##_jname##MethodA(JNIEnv* env, \
jobject obj, jclass clazz, jmethodID methodID, jvalue* args) \
{ \
CHECK_JNI_ENTRY(kFlag_Default, "ELcm.", env, obj, clazz, methodID); /* TODO: args! */ \
sc.checkSig(methodID, _retsig, false); \
sc.checkVirtualMethod(obj, methodID); \
_retdecl; \
_retasgn baseEnv(env)->CallNonvirtual##_jname##MethodA(env, obj, clazz, methodID, args); \
_retok; \
} \
static _ctype Check_CallNonvirtual##_jname##TaintedMethodA(JNIEnv* env, \
jobject obj, u4 objTaint, jclass clazz, jmethodID methodID, u4* resultTaint, jvalue* args, u4* taints) \
{ \
CHECK_JNI_ENTRY(kFlag_Default, "ELcm.", env, obj, clazz, methodID); /* TODO: args! */ \
sc.checkSig(methodID, _retsig, false); \
sc.checkVirtualMethod(obj, methodID); \
_retdecl; \
_retasgn baseEnv(env)->CallNonvirtual##_jname##TaintedMethodA(env, obj, objTaint, clazz, methodID, resultTaint, args, taints); \
_retok; \
} \
/* Static... */ \
static _ctype Check_CallStatic##_jname##Method(JNIEnv* env, \
jclass clazz, jmethodID methodID, ...) \
{ \
CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, clazz, methodID); /* TODO: args! */ \
sc.checkSig(methodID, _retsig, true); \
sc.checkStaticMethod(clazz, methodID); \
_retdecl; \
va_list args; \
va_start(args, methodID); \
_retasgn baseEnv(env)->CallStatic##_jname##MethodV(env, clazz, methodID, args); \
va_end(args); \
_retok; \
} \
static _ctype Check_CallStatic##_jname##MethodV(JNIEnv* env, \
jclass clazz, jmethodID methodID, va_list args) \
{ \
CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, clazz, methodID); /* TODO: args! */ \
sc.checkSig(methodID, _retsig, true); \
sc.checkStaticMethod(clazz, methodID); \
_retdecl; \
_retasgn baseEnv(env)->CallStatic##_jname##MethodV(env, clazz, methodID, args); \
_retok; \
} \
static _ctype Check_CallStatic##_jname##TaintedMethodA(JNIEnv* env, \
jclass clazz, jmethodID methodID, u4* returnTaint, jvalue* args, u4* taints) \
{ \
CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, clazz, methodID); /* TODO: args! */ \
sc.checkSig(methodID, _retsig, true); \
sc.checkStaticMethod(clazz, methodID); \
_retdecl; \
_retasgn baseEnv(env)->CallStatic##_jname##TaintedMethodA(env, clazz, methodID, returnTaint, args, taints); \
_retok; \
} \
static _ctype Check_CallStatic##_jname##MethodA(JNIEnv* env, \
jclass clazz, jmethodID methodID, jvalue* args) \
{ \
CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, clazz, methodID); /* TODO: args! */ \
sc.checkSig(methodID, _retsig, true); \
sc.checkStaticMethod(clazz, methodID); \
_retdecl; \
_retasgn baseEnv(env)->CallStatic##_jname##MethodA(env, clazz, methodID, args); \
_retok; \
}
#define NON_VOID_RETURN(_retsig, _ctype) return CHECK_JNI_EXIT(_retsig, (_ctype) result)
#define VOID_RETURN CHECK_JNI_EXIT_VOID()
CALL(jobject, Object, Object* result, result=(Object*), NON_VOID_RETURN("L", jobject), "L");
CALL(jboolean, Boolean, jboolean result, result=, NON_VOID_RETURN("Z", jboolean), "Z");
CALL(jbyte, Byte, jbyte result, result=, NON_VOID_RETURN("B", jbyte), "B");
CALL(jchar, Char, jchar result, result=, NON_VOID_RETURN("C", jchar), "C");
CALL(jshort, Short, jshort result, result=, NON_VOID_RETURN("S", jshort), "S");
CALL(jint, Int, jint result, result=, NON_VOID_RETURN("I", jint), "I");
CALL(jlong, Long, jlong result, result=, NON_VOID_RETURN("J", jlong), "J");
CALL(jfloat, Float, jfloat result, result=, NON_VOID_RETURN("F", jfloat), "F");
CALL(jdouble, Double, jdouble result, result=, NON_VOID_RETURN("D", jdouble), "D");
CALL(void, Void, , , VOID_RETURN, "V");
static jstring Check_NewString(JNIEnv* env, const jchar* unicodeChars, jsize len) {
CHECK_JNI_ENTRY(kFlag_Default, "Epz", env, unicodeChars, len);
return CHECK_JNI_EXIT("s", baseEnv(env)->NewString(env, unicodeChars, len));
}
static jsize Check_GetStringLength(JNIEnv* env, jstring string) {
CHECK_JNI_ENTRY(kFlag_CritOkay, "Es", env, string);
return CHECK_JNI_EXIT("I", baseEnv(env)->GetStringLength(env, string));
}
static jsize Check_GetTaintedStringLength(JNIEnv* env, jstring string, u4* taint) {
CHECK_JNI_ENTRY(kFlag_CritOkay, "Es", env, string);
return CHECK_JNI_EXIT("I", baseEnv(env)->GetTaintedStringLength(env, string, taint));
}
static const jchar* Check_GetStringChars(JNIEnv* env, jstring string, jboolean* isCopy) {
CHECK_JNI_ENTRY(kFlag_CritOkay, "Esp", env, string, isCopy);
const jchar* result = baseEnv(env)->GetStringChars(env, string, isCopy);
if (gDvmJni.forceCopy && result != NULL) {
ScopedCheckJniThreadState ts(env);
StringObject* strObj = (StringObject*) dvmDecodeIndirectRef(dvmThreadSelf(), string);
int byteCount = strObj->length() * 2;
result = (const jchar*) GuardedCopy::create(result, byteCount, false);
if (isCopy != NULL) {
*isCopy = JNI_TRUE;
}
}
return CHECK_JNI_EXIT("p", result);
}
static const jchar* Check_GetTaintedStringChars(JNIEnv* env, jstring string, jboolean* isCopy, u4* taint) {
CHECK_JNI_ENTRY(kFlag_CritOkay, "Esp", env, string, isCopy);
const jchar* result = baseEnv(env)->GetTaintedStringChars(env, string, isCopy, taint);
if (gDvmJni.forceCopy && result != NULL) {
ScopedCheckJniThreadState ts(env);
StringObject* strObj = (StringObject*) dvmDecodeIndirectRef(dvmThreadSelf(), string);
int byteCount = strObj->length() * 2;
result = (const jchar*) GuardedCopy::create(result, byteCount, false);
if (isCopy != NULL) {
*isCopy = JNI_TRUE;
}
}
return CHECK_JNI_EXIT("p", result);
}
static void Check_ReleaseStringChars(JNIEnv* env, jstring string, const jchar* chars) {
CHECK_JNI_ENTRY(kFlag_Default | kFlag_ExcepOkay, "Esp", env, string, chars);
sc.checkNonNull(chars);
if (gDvmJni.forceCopy) {
if (!GuardedCopy::check(chars, false)) {
ALOGE("JNI: failed guarded copy check in ReleaseStringChars");
abortMaybe();
return;
}
chars = (const jchar*) GuardedCopy::destroy((jchar*)chars);
}
baseEnv(env)->ReleaseStringChars(env, string, chars);
CHECK_JNI_EXIT_VOID();
}
static void Check_ReleaseTaintedStringChars(JNIEnv* env, jstring string, u4 taint, const jchar* chars) {
CHECK_JNI_ENTRY(kFlag_Default | kFlag_ExcepOkay, "Esp", env, string, chars);
sc.checkNonNull(chars);
if (gDvmJni.forceCopy) {
if (!GuardedCopy::check(chars, false)) {
ALOGE("JNI: failed guarded copy check in ReleaseStringChars");
abortMaybe();
return;
}
chars = (const jchar*) GuardedCopy::destroy((jchar*)chars);
}
baseEnv(env)->ReleaseTaintedStringChars(env, string, taint, chars);
CHECK_JNI_EXIT_VOID();
}
static jstring Check_NewStringUTF(JNIEnv* env, const char* bytes) {
CHECK_JNI_ENTRY(kFlag_NullableUtf, "Eu", env, bytes); // TODO: show pointer and truncate string.
return CHECK_JNI_EXIT("s", baseEnv(env)->NewStringUTF(env, bytes));
}
static jstring Check_NewTaintedStringUTF(JNIEnv* env, const char* bytes, u4 taint) {
CHECK_JNI_ENTRY(kFlag_NullableUtf, "Eu", env, bytes); // TODO: show pointer and truncate string.
return CHECK_JNI_EXIT("s", baseEnv(env)->NewTaintedStringUTF(env, bytes, taint));
}
static jsize Check_GetStringUTFLength(JNIEnv* env, jstring string) {
CHECK_JNI_ENTRY(kFlag_CritOkay, "Es", env, string);
return CHECK_JNI_EXIT("I", baseEnv(env)->GetStringUTFLength(env, string));
}
static const char* Check_GetTaintedStringUTFChars(JNIEnv* env, jstring string, jboolean* isCopy, u4* taint) {
CHECK_JNI_ENTRY(kFlag_CritOkay, "Esp", env, string, isCopy);
const char* result = baseEnv(env)->GetTaintedStringUTFChars(env, string, isCopy, taint);
if (gDvmJni.forceCopy && result != NULL) {
result = (const char*) GuardedCopy::create(result, strlen(result) + 1, false);
if (isCopy != NULL) {
*isCopy = JNI_TRUE;
}
}
return CHECK_JNI_EXIT("u", result); // TODO: show pointer and truncate string.
}
static const char* Check_GetStringUTFChars(JNIEnv* env, jstring string, jboolean* isCopy) {
CHECK_JNI_ENTRY(kFlag_CritOkay, "Esp", env, string, isCopy);
const char* result = baseEnv(env)->GetStringUTFChars(env, string, isCopy);
if (gDvmJni.forceCopy && result != NULL) {
result = (const char*) GuardedCopy::create(result, strlen(result) + 1, false);
if (isCopy != NULL) {
*isCopy = JNI_TRUE;
}
}
return CHECK_JNI_EXIT("u", result); // TODO: show pointer and truncate string.
}
static void Check_ReleaseStringUTFChars(JNIEnv* env, jstring string, const char* utf) {
CHECK_JNI_ENTRY(kFlag_ExcepOkay | kFlag_Release, "Esu", env, string, utf); // TODO: show pointer and truncate string.
if (gDvmJni.forceCopy) {
if (!GuardedCopy::check(utf, false)) {
ALOGE("JNI: failed guarded copy check in ReleaseStringUTFChars");
abortMaybe();
return;
}
utf = (const char*) GuardedCopy::destroy((char*)utf);
}
baseEnv(env)->ReleaseStringUTFChars(env, string, utf);
CHECK_JNI_EXIT_VOID();
}
static void Check_ReleaseTaintedStringUTFChars(JNIEnv* env, jstring string, u4 taint, const char* utf) {
CHECK_JNI_ENTRY(kFlag_ExcepOkay | kFlag_Release, "Esu", env, string, utf); // TODO: show pointer and truncate string.
if (gDvmJni.forceCopy) {
if (!GuardedCopy::check(utf, false)) {
ALOGE("JNI: failed guarded copy check in ReleaseStringUTFChars");
abortMaybe();
return;
}
utf = (const char*) GuardedCopy::destroy((char*)utf);
}
baseEnv(env)->ReleaseTaintedStringUTFChars(env, string, taint, utf);
CHECK_JNI_EXIT_VOID();
}
static jsize Check_GetArrayLength(JNIEnv* env, jarray array) {
CHECK_JNI_ENTRY(kFlag_CritOkay, "Ea", env, array);
return CHECK_JNI_EXIT("I", baseEnv(env)->GetArrayLength(env, array));
}
static jobjectArray Check_NewObjectArray(JNIEnv* env, jsize length,
jclass elementClass, jobject initialElement)
{
CHECK_JNI_ENTRY(kFlag_Default, "EzcL", env, length, elementClass, initialElement);
return CHECK_JNI_EXIT("a", baseEnv(env)->NewObjectArray(env, length, elementClass, initialElement));
}
static jobjectArray Check_NewTaintedObjectArray(JNIEnv* env, jsize length,
jclass elementClass, jobject initialElement, u4 taint)
{
CHECK_JNI_ENTRY(kFlag_Default, "EzcL", env, length, elementClass, initialElement);
return CHECK_JNI_EXIT("a", baseEnv(env)->NewTaintedObjectArray(env, length, elementClass, initialElement, taint));
}
static jobject Check_GetObjectArrayElement(JNIEnv* env, jobjectArray array, jsize index) {
CHECK_JNI_ENTRY(kFlag_Default, "EaI", env, array, index);
return CHECK_JNI_EXIT("L", baseEnv(env)->GetObjectArrayElement(env, array, index));
}
static void Check_SetObjectArrayElement(JNIEnv* env, jobjectArray array, jsize index, jobject value)
{
CHECK_JNI_ENTRY(kFlag_Default, "EaIL", env, array, index, value);
baseEnv(env)->SetObjectArrayElement(env, array, index, value);
CHECK_JNI_EXIT_VOID();
}
static jobject Check_GetTaintedObjectArrayElement(JNIEnv* env, jobjectArray array, jsize index, u4* taint) {
CHECK_JNI_ENTRY(kFlag_Default, "EaI", env, array, index);
return CHECK_JNI_EXIT("L", baseEnv(env)->GetTaintedObjectArrayElement(env, array, index, taint));
}
static void Check_SetTaintedObjectArrayElement(JNIEnv* env, jobjectArray array, jsize index, jobject value, u4 taint)
{
CHECK_JNI_ENTRY(kFlag_Default, "EaIL", env, array, index, value);
baseEnv(env)->SetTaintedObjectArrayElement(env, array, index, value, taint);
CHECK_JNI_EXIT_VOID();
}
#define NEW_PRIMITIVE_ARRAY(_artype, _jname) \
static _artype Check_New##_jname##Array(JNIEnv* env, jsize length) { \
CHECK_JNI_ENTRY(kFlag_Default, "Ez", env, length); \
return CHECK_JNI_EXIT("a", baseEnv(env)->New##_jname##Array(env, length)); \
}
NEW_PRIMITIVE_ARRAY(jbooleanArray, Boolean);
NEW_PRIMITIVE_ARRAY(jbyteArray, Byte);
NEW_PRIMITIVE_ARRAY(jcharArray, Char);
NEW_PRIMITIVE_ARRAY(jshortArray, Short);
NEW_PRIMITIVE_ARRAY(jintArray, Int);
NEW_PRIMITIVE_ARRAY(jlongArray, Long);
NEW_PRIMITIVE_ARRAY(jfloatArray, Float);
NEW_PRIMITIVE_ARRAY(jdoubleArray, Double);
/*
* Hack to allow forcecopy to work with jniGetNonMovableArrayElements.
* The code deliberately uses an invalid sequence of operations, so we
* need to pass it through unmodified. Review that code before making
* any changes here.
*/
#define kNoCopyMagic 0xd5aab57f
#define GET_PRIMITIVE_ARRAY_ELEMENTS(_ctype, _jname) \
static _ctype* Check_Get##_jname##ArrayElements(JNIEnv* env, \
_ctype##Array array, jboolean* isCopy) \
{ \
CHECK_JNI_ENTRY(kFlag_Default, "Eap", env, array, isCopy); \
u4 noCopy = 0; \
if (gDvmJni.forceCopy && isCopy != NULL) { \
/* capture this before the base call tramples on it */ \
noCopy = *(u4*) isCopy; \
} \
_ctype* result = baseEnv(env)->Get##_jname##ArrayElements(env, array, isCopy); \
if (gDvmJni.forceCopy && result != NULL) { \
if (noCopy == kNoCopyMagic) { \
ALOGV("FC: not copying %p %x", array, noCopy); \
} else { \
result = (_ctype*) createGuardedPACopy(env, array, isCopy); \
} \
} \
return CHECK_JNI_EXIT("p", result); \
} \
static _ctype* Check_GetTainted##_jname##ArrayElements(JNIEnv* env, \
_ctype##Array array, jboolean* isCopy, u4* taint) \
{ \
CHECK_JNI_ENTRY(kFlag_Default, "Eap", env, array, isCopy); \
u4 noCopy = 0; \
if (gDvmJni.forceCopy && isCopy != NULL) { \
/* capture this before the base call tramples on it */ \
noCopy = *(u4*) isCopy; \
} \
_ctype* result = baseEnv(env)->GetTainted##_jname##ArrayElements(env, array, isCopy, taint); \
if (gDvmJni.forceCopy && result != NULL) { \
if (noCopy == kNoCopyMagic) { \
ALOGV("FC: not copying %p %x", array, noCopy); \
} else { \
result = (_ctype*) createGuardedPACopy(env, array, isCopy); \
} \
} \
return CHECK_JNI_EXIT("p", result); \
}
#define RELEASE_PRIMITIVE_ARRAY_ELEMENTS(_ctype, _jname) \
static void Check_Release##_jname##ArrayElements(JNIEnv* env, \
_ctype##Array array, _ctype* elems, jint mode) \
{ \
CHECK_JNI_ENTRY(kFlag_Default | kFlag_ExcepOkay, "Eapr", env, array, elems, mode); \
sc.checkNonNull(elems); \
if (gDvmJni.forceCopy) { \
if ((uintptr_t)elems == kNoCopyMagic) { \
ALOGV("FC: not freeing %p", array); \
elems = NULL; /* base JNI call doesn't currently need */ \
} else { \
elems = (_ctype*) releaseGuardedPACopy(env, array, elems, mode); \
} \
} \
baseEnv(env)->Release##_jname##ArrayElements(env, array, elems, mode); \
CHECK_JNI_EXIT_VOID(); \
} \
static void Check_ReleaseTainted##_jname##ArrayElements(JNIEnv* env, \
_ctype##Array array, _ctype* elems, jint mode, u4 taint) \
{ \
CHECK_JNI_ENTRY(kFlag_Default | kFlag_ExcepOkay, "Eapr", env, array, elems, mode); \
sc.checkNonNull(elems); \
if (gDvmJni.forceCopy) { \
if ((uintptr_t)elems == kNoCopyMagic) { \
ALOGV("FC: not freeing %p", array); \
elems = NULL; /* base JNI call doesn't currently need */ \
} else { \
elems = (_ctype*) releaseGuardedPACopy(env, array, elems, mode); \
} \
} \
baseEnv(env)->ReleaseTainted##_jname##ArrayElements(env, array, elems, mode, taint); \
CHECK_JNI_EXIT_VOID(); \
}
#define GET_PRIMITIVE_ARRAY_REGION(_ctype, _jname) \
static void Check_Get##_jname##ArrayRegion(JNIEnv* env, \
_ctype##Array array, jsize start, jsize len, _ctype* buf) { \
CHECK_JNI_ENTRY(kFlag_Default, "EaIIp", env, array, start, len, buf); \
baseEnv(env)->Get##_jname##ArrayRegion(env, array, start, len, buf); \
CHECK_JNI_EXIT_VOID(); \
} \
static void Check_GetTainted##_jname##ArrayRegion(JNIEnv* env, \
_ctype##Array array, jsize start, jsize len, _ctype* buf, u4* taint) { \
CHECK_JNI_ENTRY(kFlag_Default, "EaIIp", env, array, start, len, buf); \
baseEnv(env)->GetTainted##_jname##ArrayRegion(env, array, start, len, buf, taint); \
CHECK_JNI_EXIT_VOID(); \
}
#define SET_PRIMITIVE_ARRAY_REGION(_ctype, _jname) \
static void Check_Set##_jname##ArrayRegion(JNIEnv* env, \
_ctype##Array array, jsize start, jsize len, const _ctype* buf) { \
CHECK_JNI_ENTRY(kFlag_Default, "EaIIp", env, array, start, len, buf); \
baseEnv(env)->Set##_jname##ArrayRegion(env, array, start, len, buf); \
CHECK_JNI_EXIT_VOID(); \
} \
static void Check_SetTainted##_jname##ArrayRegion(JNIEnv* env, \
_ctype##Array array, jsize start, jsize len, const _ctype* buf, u4 taint) { \
CHECK_JNI_ENTRY(kFlag_Default, "EaIIp", env, array, start, len, buf); \
baseEnv(env)->SetTainted##_jname##ArrayRegion(env, array, start, len, buf, taint); \
CHECK_JNI_EXIT_VOID(); \
}
#define PRIMITIVE_ARRAY_FUNCTIONS(_ctype, _jname, _typechar) \
GET_PRIMITIVE_ARRAY_ELEMENTS(_ctype, _jname); \
RELEASE_PRIMITIVE_ARRAY_ELEMENTS(_ctype, _jname); \
GET_PRIMITIVE_ARRAY_REGION(_ctype, _jname); \
SET_PRIMITIVE_ARRAY_REGION(_ctype, _jname);
/* TODO: verify primitive array type matches call type */
PRIMITIVE_ARRAY_FUNCTIONS(jboolean, Boolean, 'Z');
PRIMITIVE_ARRAY_FUNCTIONS(jbyte, Byte, 'B');
PRIMITIVE_ARRAY_FUNCTIONS(jchar, Char, 'C');
PRIMITIVE_ARRAY_FUNCTIONS(jshort, Short, 'S');
PRIMITIVE_ARRAY_FUNCTIONS(jint, Int, 'I');
PRIMITIVE_ARRAY_FUNCTIONS(jlong, Long, 'J');
PRIMITIVE_ARRAY_FUNCTIONS(jfloat, Float, 'F');
PRIMITIVE_ARRAY_FUNCTIONS(jdouble, Double, 'D');
static jint Check_RegisterNatives(JNIEnv* env, jclass clazz, const JNINativeMethod* methods,
jint nMethods)
{
CHECK_JNI_ENTRY(kFlag_Default, "EcpI", env, clazz, methods, nMethods);
return CHECK_JNI_EXIT("I", baseEnv(env)->RegisterNatives(env, clazz, methods, nMethods));
}
static jint Check_RegisterTaintedNatives(JNIEnv* env, jclass clazz, const JNINativeMethod* methods,
jint nMethods)
{
CHECK_JNI_ENTRY(kFlag_Default, "EcpI", env, clazz, methods, nMethods);
return CHECK_JNI_EXIT("I", baseEnv(env)->RegisterTaintedNatives(env, clazz, methods, nMethods));
}
static jint Check_UnregisterNatives(JNIEnv* env, jclass clazz) {
CHECK_JNI_ENTRY(kFlag_Default, "Ec", env, clazz);
return CHECK_JNI_EXIT("I", baseEnv(env)->UnregisterNatives(env, clazz));
}
static jint Check_MonitorEnter(JNIEnv* env, jobject obj) {
CHECK_JNI_ENTRY(kFlag_Default, "EL", env, obj);
return CHECK_JNI_EXIT("I", baseEnv(env)->MonitorEnter(env, obj));
}
static jint Check_MonitorExit(JNIEnv* env, jobject obj) {
CHECK_JNI_ENTRY(kFlag_Default | kFlag_ExcepOkay, "EL", env, obj);
return CHECK_JNI_EXIT("I", baseEnv(env)->MonitorExit(env, obj));
}
static jint Check_GetJavaVM(JNIEnv *env, JavaVM **vm) {
CHECK_JNI_ENTRY(kFlag_Default, "Ep", env, vm);
return CHECK_JNI_EXIT("I", baseEnv(env)->GetJavaVM(env, vm));
}
static void Check_GetStringRegion(JNIEnv* env, jstring str, jsize start, jsize len, jchar* buf) {
CHECK_JNI_ENTRY(kFlag_CritOkay, "EsIIp", env, str, start, len, buf);
baseEnv(env)->GetStringRegion(env, str, start, len, buf);
CHECK_JNI_EXIT_VOID();
}
static void Check_GetTaintedStringRegion(JNIEnv* env, jstring str, jsize start, jsize len, jchar* buf, u4* taint) {
CHECK_JNI_ENTRY(kFlag_CritOkay, "EsIIp", env, str, start, len, buf);
baseEnv(env)->GetTaintedStringRegion(env, str, start, len, buf, taint);
CHECK_JNI_EXIT_VOID();
}
static void Check_GetStringUTFRegion(JNIEnv* env, jstring str, jsize start, jsize len, char* buf) {
CHECK_JNI_ENTRY(kFlag_CritOkay, "EsIIp", env, str, start, len, buf);
baseEnv(env)->GetStringUTFRegion(env, str, start, len, buf);
CHECK_JNI_EXIT_VOID();
}
static void Check_GetTaintedStringUTFRegion(JNIEnv* env, jstring str, jsize start, jsize len, char* buf, u4* taint) {
CHECK_JNI_ENTRY(kFlag_CritOkay, "EsIIp", env, str, start, len, buf);
baseEnv(env)->GetTaintedStringUTFRegion(env, str, start, len, buf, taint);
CHECK_JNI_EXIT_VOID();
}
static void* Check_GetPrimitiveArrayCritical(JNIEnv* env, jarray array, jboolean* isCopy) {
CHECK_JNI_ENTRY(kFlag_CritGet, "Eap", env, array, isCopy);
void* result = baseEnv(env)->GetPrimitiveArrayCritical(env, array, isCopy);
if (gDvmJni.forceCopy && result != NULL) {
result = createGuardedPACopy(env, array, isCopy);
}
return CHECK_JNI_EXIT("p", result);
}
static void* Check_GetTaintedPrimitiveArrayCritical(JNIEnv* env, jarray array, u4* taint, jboolean* isCopy) {
CHECK_JNI_ENTRY(kFlag_CritGet, "Eap", env, array, isCopy);
void* result = baseEnv(env)->GetTaintedPrimitiveArrayCritical(env, array, taint, isCopy);
if (gDvmJni.forceCopy && result != NULL) {
result = createGuardedPACopy(env, array, isCopy);
}
return CHECK_JNI_EXIT("p", result);
}
static void Check_ReleasePrimitiveArrayCritical(JNIEnv* env, jarray array, void* carray, jint mode)
{
CHECK_JNI_ENTRY(kFlag_CritRelease | kFlag_ExcepOkay, "Eapr", env, array, carray, mode);
sc.checkNonNull(carray);
if (gDvmJni.forceCopy) {
carray = releaseGuardedPACopy(env, array, carray, mode);
}
baseEnv(env)->ReleasePrimitiveArrayCritical(env, array, carray, mode);
CHECK_JNI_EXIT_VOID();
}
static void Check_ReleaseTaintedPrimitiveArrayCritical(JNIEnv* env, jarray array, void* carray, u4 taint, jint mode)
{
CHECK_JNI_ENTRY(kFlag_CritRelease | kFlag_ExcepOkay, "Eapr", env, array, carray, mode);
sc.checkNonNull(carray);
if (gDvmJni.forceCopy) {
carray = releaseGuardedPACopy(env, array, carray, mode);
}
baseEnv(env)->ReleaseTaintedPrimitiveArrayCritical(env, array, carray, taint, mode);
CHECK_JNI_EXIT_VOID();
}
static const jchar* Check_GetStringCritical(JNIEnv* env, jstring string, jboolean* isCopy) {
CHECK_JNI_ENTRY(kFlag_CritGet, "Esp", env, string, isCopy);
const jchar* result = baseEnv(env)->GetStringCritical(env, string, isCopy);
if (gDvmJni.forceCopy && result != NULL) {
ScopedCheckJniThreadState ts(env);
StringObject* strObj = (StringObject*) dvmDecodeIndirectRef(dvmThreadSelf(), string);
int byteCount = strObj->length() * 2;
result = (const jchar*) GuardedCopy::create(result, byteCount, false);
if (isCopy != NULL) {
*isCopy = JNI_TRUE;
}
}
return CHECK_JNI_EXIT("p", result);
}
static const jchar* Check_GetTaintedStringCritical(JNIEnv* env, jstring string, u4* taint, jboolean* isCopy) {
CHECK_JNI_ENTRY(kFlag_CritGet, "Esp", env, string, isCopy);
const jchar* result = baseEnv(env)->GetTaintedStringCritical(env, string, taint, isCopy);
if (gDvmJni.forceCopy && result != NULL) {
ScopedCheckJniThreadState ts(env);
StringObject* strObj = (StringObject*) dvmDecodeIndirectRef(dvmThreadSelf(), string);
int byteCount = strObj->length() * 2;
result = (const jchar*) GuardedCopy::create(result, byteCount, false);
if (isCopy != NULL) {
*isCopy = JNI_TRUE;
}
}
return CHECK_JNI_EXIT("p", result);
}
static void Check_ReleaseStringCritical(JNIEnv* env, jstring string, const jchar* carray) {
CHECK_JNI_ENTRY(kFlag_CritRelease | kFlag_ExcepOkay, "Esp", env, string, carray);
sc.checkNonNull(carray);
if (gDvmJni.forceCopy) {
if (!GuardedCopy::check(carray, false)) {
ALOGE("JNI: failed guarded copy check in ReleaseStringCritical");
abortMaybe();
return;
}
carray = (const jchar*) GuardedCopy::destroy((jchar*)carray);
}
baseEnv(env)->ReleaseStringCritical(env, string, carray);
CHECK_JNI_EXIT_VOID();
}
static void Check_ReleaseTaintedStringCritical(JNIEnv* env, jstring string, u4 taint, const jchar* carray) {
CHECK_JNI_ENTRY(kFlag_CritRelease | kFlag_ExcepOkay, "Esp", env, string, carray);
sc.checkNonNull(carray);
if (gDvmJni.forceCopy) {
if (!GuardedCopy::check(carray, false)) {
ALOGE("JNI: failed guarded copy check in ReleaseStringCritical");
abortMaybe();
return;
}
carray = (const jchar*) GuardedCopy::destroy((jchar*)carray);
}
baseEnv(env)->ReleaseTaintedStringCritical(env, string, taint, carray);
CHECK_JNI_EXIT_VOID();
}
static jweak Check_NewWeakGlobalRef(JNIEnv* env, jobject obj) {
CHECK_JNI_ENTRY(kFlag_Default, "EL", env, obj);
return CHECK_JNI_EXIT("L", baseEnv(env)->NewWeakGlobalRef(env, obj));
}
static void Check_DeleteWeakGlobalRef(JNIEnv* env, jweak obj) {
CHECK_JNI_ENTRY(kFlag_Default | kFlag_ExcepOkay, "EL", env, obj);
baseEnv(env)->DeleteWeakGlobalRef(env, obj);
CHECK_JNI_EXIT_VOID();
}
static jboolean Check_ExceptionCheck(JNIEnv* env) {
CHECK_JNI_ENTRY(kFlag_CritOkay | kFlag_ExcepOkay, "E", env);
return CHECK_JNI_EXIT("b", baseEnv(env)->ExceptionCheck(env));
}
static jobjectRefType Check_GetObjectRefType(JNIEnv* env, jobject obj) {
CHECK_JNI_ENTRY(kFlag_Default, "EL", env, obj);
// TODO: proper decoding of jobjectRefType!
return CHECK_JNI_EXIT("I", baseEnv(env)->GetObjectRefType(env, obj));
}
static jobject Check_NewDirectByteBuffer(JNIEnv* env, void* address, jlong capacity) {
CHECK_JNI_ENTRY(kFlag_Default, "EpJ", env, address, capacity);
return CHECK_JNI_EXIT("L", baseEnv(env)->NewDirectByteBuffer(env, address, capacity));
}
static void* Check_GetDirectBufferAddress(JNIEnv* env, jobject buf) {
CHECK_JNI_ENTRY(kFlag_Default, "EL", env, buf);
// TODO: check that 'buf' is a java.nio.Buffer.
return CHECK_JNI_EXIT("p", baseEnv(env)->GetDirectBufferAddress(env, buf));
}
static jlong Check_GetDirectBufferCapacity(JNIEnv* env, jobject buf) {
CHECK_JNI_ENTRY(kFlag_Default, "EL", env, buf);
// TODO: check that 'buf' is a java.nio.Buffer.
return CHECK_JNI_EXIT("J", baseEnv(env)->GetDirectBufferCapacity(env, buf));
}
/*
* ===========================================================================
* JNI invocation functions
* ===========================================================================
*/
static jint Check_DestroyJavaVM(JavaVM* vm) {
ScopedCheck sc(false, __FUNCTION__);
sc.check(true, "v", vm);
return CHECK_JNI_EXIT("I", baseVm(vm)->DestroyJavaVM(vm));
}
static jint Check_AttachCurrentThread(JavaVM* vm, JNIEnv** p_env, void* thr_args) {
ScopedCheck sc(false, __FUNCTION__);
sc.check(true, "vpt", vm, p_env, thr_args);
return CHECK_JNI_EXIT("I", baseVm(vm)->AttachCurrentThread(vm, p_env, thr_args));
}
static jint Check_AttachCurrentThreadAsDaemon(JavaVM* vm, JNIEnv** p_env, void* thr_args) {
ScopedCheck sc(false, __FUNCTION__);
sc.check(true, "vpt", vm, p_env, thr_args);
return CHECK_JNI_EXIT("I", baseVm(vm)->AttachCurrentThreadAsDaemon(vm, p_env, thr_args));
}
static jint Check_DetachCurrentThread(JavaVM* vm) {
ScopedCheck sc(true, __FUNCTION__);
sc.check(true, "v", vm);
return CHECK_JNI_EXIT("I", baseVm(vm)->DetachCurrentThread(vm));
}
static jint Check_GetEnv(JavaVM* vm, void** env, jint version) {
ScopedCheck sc(true, __FUNCTION__);
sc.check(true, "v", vm);
return CHECK_JNI_EXIT("I", baseVm(vm)->GetEnv(vm, env, version));
}
// for wrapper
static const char* Check_GetArrayType(JNIEnv* env, jarray jarr) {
const char* result = baseEnv(env)->GetArrayType(env, jarr);
return result;
}
/*
* ===========================================================================
* Function tables
* ===========================================================================
*/
static const struct JNINativeInterface gCheckNativeInterface = {
NULL,
NULL,
NULL,
NULL,
Check_GetVersion,
Check_DefineClass,
Check_FindClass,
Check_FromReflectedMethod,
Check_FromReflectedField,
Check_ToReflectedMethod,
Check_GetSuperclass,
Check_IsAssignableFrom,
Check_ToReflectedField,
Check_Throw,
Check_ThrowNew,
Check_ExceptionOccurred,
Check_ExceptionDescribe,
Check_ExceptionClear,
Check_FatalError,
Check_PushLocalFrame,
Check_PopLocalFrame,
Check_NewGlobalRef,
Check_DeleteGlobalRef,
Check_DeleteLocalRef,
Check_IsSameObject,
Check_NewLocalRef,
Check_EnsureLocalCapacity,
Check_AllocObject,
Check_NewObject,
Check_NewObjectV,
Check_NewObjectA,
Check_GetObjectClass,
Check_IsInstanceOf,
Check_GetMethodID,
Check_CallObjectMethod,
Check_CallObjectMethodV,
Check_CallObjectMethodA,
Check_CallBooleanMethod,
Check_CallBooleanMethodV,
Check_CallBooleanMethodA,
Check_CallByteMethod,
Check_CallByteMethodV,
Check_CallByteMethodA,
Check_CallCharMethod,
Check_CallCharMethodV,
Check_CallCharMethodA,
Check_CallShortMethod,
Check_CallShortMethodV,
Check_CallShortMethodA,
Check_CallIntMethod,
Check_CallIntMethodV,
Check_CallIntMethodA,
Check_CallLongMethod,
Check_CallLongMethodV,
Check_CallLongMethodA,
Check_CallFloatMethod,
Check_CallFloatMethodV,
Check_CallFloatMethodA,
Check_CallDoubleMethod,
Check_CallDoubleMethodV,
Check_CallDoubleMethodA,
Check_CallVoidMethod,
Check_CallVoidMethodV,
Check_CallVoidMethodA,
Check_CallNonvirtualObjectMethod,
Check_CallNonvirtualObjectMethodV,
Check_CallNonvirtualObjectMethodA,
Check_CallNonvirtualBooleanMethod,
Check_CallNonvirtualBooleanMethodV,
Check_CallNonvirtualBooleanMethodA,
Check_CallNonvirtualByteMethod,
Check_CallNonvirtualByteMethodV,
Check_CallNonvirtualByteMethodA,
Check_CallNonvirtualCharMethod,
Check_CallNonvirtualCharMethodV,
Check_CallNonvirtualCharMethodA,
Check_CallNonvirtualShortMethod,
Check_CallNonvirtualShortMethodV,
Check_CallNonvirtualShortMethodA,
Check_CallNonvirtualIntMethod,
Check_CallNonvirtualIntMethodV,
Check_CallNonvirtualIntMethodA,
Check_CallNonvirtualLongMethod,
Check_CallNonvirtualLongMethodV,
Check_CallNonvirtualLongMethodA,
Check_CallNonvirtualFloatMethod,
Check_CallNonvirtualFloatMethodV,
Check_CallNonvirtualFloatMethodA,
Check_CallNonvirtualDoubleMethod,
Check_CallNonvirtualDoubleMethodV,
Check_CallNonvirtualDoubleMethodA,
Check_CallNonvirtualVoidMethod,
Check_CallNonvirtualVoidMethodV,
Check_CallNonvirtualVoidMethodA,
Check_GetFieldID,
Check_GetObjectField,
Check_GetBooleanField,
Check_GetByteField,
Check_GetCharField,
Check_GetShortField,
Check_GetIntField,
Check_GetLongField,
Check_GetFloatField,
Check_GetDoubleField,
Check_SetObjectField,
Check_SetBooleanField,
Check_SetByteField,
Check_SetCharField,
Check_SetShortField,
Check_SetIntField,
Check_SetLongField,
Check_SetFloatField,
Check_SetDoubleField,
Check_GetStaticMethodID,
Check_CallStaticObjectMethod,
Check_CallStaticObjectMethodV,
Check_CallStaticObjectMethodA,
Check_CallStaticBooleanMethod,
Check_CallStaticBooleanMethodV,
Check_CallStaticBooleanMethodA,
Check_CallStaticByteMethod,
Check_CallStaticByteMethodV,
Check_CallStaticByteMethodA,
Check_CallStaticCharMethod,
Check_CallStaticCharMethodV,
Check_CallStaticCharMethodA,
Check_CallStaticShortMethod,
Check_CallStaticShortMethodV,
Check_CallStaticShortMethodA,
Check_CallStaticIntMethod,
Check_CallStaticIntMethodV,
Check_CallStaticIntMethodA,
Check_CallStaticLongMethod,
Check_CallStaticLongMethodV,
Check_CallStaticLongMethodA,
Check_CallStaticFloatMethod,
Check_CallStaticFloatMethodV,
Check_CallStaticFloatMethodA,
Check_CallStaticDoubleMethod,
Check_CallStaticDoubleMethodV,
Check_CallStaticDoubleMethodA,
Check_CallStaticVoidMethod,
Check_CallStaticVoidMethodV,
Check_CallStaticVoidMethodA,
Check_GetStaticFieldID,
Check_GetStaticObjectField,
Check_GetStaticBooleanField,
Check_GetStaticByteField,
Check_GetStaticCharField,
Check_GetStaticShortField,
Check_GetStaticIntField,
Check_GetStaticLongField,
Check_GetStaticFloatField,
Check_GetStaticDoubleField,
Check_SetStaticObjectField,
Check_SetStaticBooleanField,
Check_SetStaticByteField,
Check_SetStaticCharField,
Check_SetStaticShortField,
Check_SetStaticIntField,
Check_SetStaticLongField,
Check_SetStaticFloatField,
Check_SetStaticDoubleField,
Check_NewString,
Check_GetStringLength,
Check_GetStringChars,
Check_ReleaseStringChars,
Check_NewStringUTF,
Check_GetStringUTFLength,
Check_GetStringUTFChars,
Check_ReleaseStringUTFChars,
Check_GetArrayLength,
Check_NewObjectArray,
Check_GetObjectArrayElement,
Check_SetObjectArrayElement,
Check_NewBooleanArray,
Check_NewByteArray,
Check_NewCharArray,
Check_NewShortArray,
Check_NewIntArray,
Check_NewLongArray,
Check_NewFloatArray,
Check_NewDoubleArray,
Check_GetBooleanArrayElements,
Check_GetByteArrayElements,
Check_GetCharArrayElements,
Check_GetShortArrayElements,
Check_GetIntArrayElements,
Check_GetLongArrayElements,
Check_GetFloatArrayElements,
Check_GetDoubleArrayElements,
Check_ReleaseBooleanArrayElements,
Check_ReleaseByteArrayElements,
Check_ReleaseCharArrayElements,
Check_ReleaseShortArrayElements,
Check_ReleaseIntArrayElements,
Check_ReleaseLongArrayElements,
Check_ReleaseFloatArrayElements,
Check_ReleaseDoubleArrayElements,
Check_GetBooleanArrayRegion,
Check_GetByteArrayRegion,
Check_GetCharArrayRegion,
Check_GetShortArrayRegion,
Check_GetIntArrayRegion,
Check_GetLongArrayRegion,
Check_GetFloatArrayRegion,
Check_GetDoubleArrayRegion,
Check_SetBooleanArrayRegion,
Check_SetByteArrayRegion,
Check_SetCharArrayRegion,
Check_SetShortArrayRegion,
Check_SetIntArrayRegion,
Check_SetLongArrayRegion,
Check_SetFloatArrayRegion,
Check_SetDoubleArrayRegion,
Check_RegisterNatives,
Check_UnregisterNatives,
Check_MonitorEnter,
Check_MonitorExit,
Check_GetJavaVM,
Check_GetStringRegion,
Check_GetStringUTFRegion,
Check_GetPrimitiveArrayCritical,
Check_ReleasePrimitiveArrayCritical,
Check_GetStringCritical,
Check_ReleaseStringCritical,
Check_NewWeakGlobalRef,
Check_DeleteWeakGlobalRef,
Check_ExceptionCheck,
Check_NewDirectByteBuffer,
Check_GetDirectBufferAddress,
Check_GetDirectBufferCapacity,
Check_GetObjectRefType,
Check_GetArrayType,
Check_NewTaintedObjectA,
Check_CallObjectTaintedMethodA,
Check_CallBooleanTaintedMethodA,
Check_CallByteTaintedMethodA,
Check_CallCharTaintedMethodA,
Check_CallShortTaintedMethodA,
Check_CallIntTaintedMethodA,
Check_CallLongTaintedMethodA,
Check_CallFloatTaintedMethodA,
Check_CallDoubleTaintedMethodA,
Check_CallVoidTaintedMethodA,
Check_CallNonvirtualObjectTaintedMethodA,
Check_CallNonvirtualBooleanTaintedMethodA,
Check_CallNonvirtualByteTaintedMethodA,
Check_CallNonvirtualCharTaintedMethodA,
Check_CallNonvirtualShortTaintedMethodA,
Check_CallNonvirtualIntTaintedMethodA,
Check_CallNonvirtualLongTaintedMethodA,
Check_CallNonvirtualFloatTaintedMethodA,
Check_CallNonvirtualDoubleTaintedMethodA,
Check_CallNonvirtualVoidTaintedMethodA,
Check_GetObjectTaintedField,
Check_GetBooleanTaintedField,
Check_GetByteTaintedField,
Check_GetCharTaintedField,
Check_GetShortTaintedField,
Check_GetIntTaintedField,
Check_GetLongTaintedField,
Check_GetFloatTaintedField,
Check_GetDoubleTaintedField,
Check_SetObjectTaintedField,
Check_SetBooleanTaintedField,
Check_SetByteTaintedField,
Check_SetCharTaintedField,
Check_SetShortTaintedField,
Check_SetIntTaintedField,
Check_SetLongTaintedField,
Check_SetFloatTaintedField,
Check_SetDoubleTaintedField,
Check_CallStaticObjectTaintedMethodA,
Check_CallStaticBooleanTaintedMethodA,
Check_CallStaticByteTaintedMethodA,
Check_CallStaticCharTaintedMethodA,
Check_CallStaticShortTaintedMethodA,
Check_CallStaticIntTaintedMethodA,
Check_CallStaticLongTaintedMethodA,
Check_CallStaticFloatTaintedMethodA,
Check_CallStaticDoubleTaintedMethodA,
Check_CallStaticVoidTaintedMethodA,
Check_GetStaticObjectTaintedField,
Check_GetStaticBooleanTaintedField,
Check_GetStaticByteTaintedField,
Check_GetStaticCharTaintedField,
Check_GetStaticShortTaintedField,
Check_GetStaticIntTaintedField,
Check_GetStaticLongTaintedField,
Check_GetStaticFloatTaintedField,
Check_GetStaticDoubleTaintedField,
Check_SetStaticObjectTaintedField,
Check_SetStaticBooleanTaintedField,
Check_SetStaticByteTaintedField,
Check_SetStaticCharTaintedField,
Check_SetStaticShortTaintedField,
Check_SetStaticIntTaintedField,
Check_SetStaticLongTaintedField,
Check_SetStaticFloatTaintedField,
Check_SetStaticDoubleTaintedField,
Check_GetTaintedStringLength,
Check_GetTaintedStringChars,
Check_ReleaseTaintedStringChars,
Check_NewTaintedStringUTF,
Check_GetTaintedStringUTFChars,
Check_ReleaseTaintedStringUTFChars,
Check_NewTaintedObjectArray,
Check_GetTaintedObjectArrayElement,
Check_SetTaintedObjectArrayElement,
Check_GetTaintedBooleanArrayElements,
Check_GetTaintedByteArrayElements,
Check_GetTaintedCharArrayElements,
Check_GetTaintedShortArrayElements,
Check_GetTaintedIntArrayElements,
Check_GetTaintedLongArrayElements,
Check_GetTaintedFloatArrayElements,
Check_GetTaintedDoubleArrayElements,
Check_ReleaseTaintedBooleanArrayElements,
Check_ReleaseTaintedByteArrayElements,
Check_ReleaseTaintedCharArrayElements,
Check_ReleaseTaintedShortArrayElements,
Check_ReleaseTaintedIntArrayElements,
Check_ReleaseTaintedLongArrayElements,
Check_ReleaseTaintedFloatArrayElements,
Check_ReleaseTaintedDoubleArrayElements,
Check_GetTaintedBooleanArrayRegion,
Check_GetTaintedByteArrayRegion,
Check_GetTaintedCharArrayRegion,
Check_GetTaintedShortArrayRegion,
Check_GetTaintedIntArrayRegion,
Check_GetTaintedLongArrayRegion,
Check_GetTaintedFloatArrayRegion,
Check_GetTaintedDoubleArrayRegion,
Check_SetTaintedBooleanArrayRegion,
Check_SetTaintedByteArrayRegion,
Check_SetTaintedCharArrayRegion,
Check_SetTaintedShortArrayRegion,
Check_SetTaintedIntArrayRegion,
Check_SetTaintedLongArrayRegion,
Check_SetTaintedFloatArrayRegion,
Check_SetTaintedDoubleArrayRegion,
Check_GetTaintedStringRegion,
Check_GetTaintedStringUTFRegion,
Check_GetTaintedPrimitiveArrayCritical,
Check_ReleaseTaintedPrimitiveArrayCritical,
Check_GetTaintedStringCritical,
Check_ReleaseTaintedStringCritical,
Check_RegisterTaintedNatives
};
static const struct JNIInvokeInterface gCheckInvokeInterface = {
NULL,
NULL,
NULL,
Check_DestroyJavaVM,
Check_AttachCurrentThread,
Check_DetachCurrentThread,
Check_GetEnv,
Check_AttachCurrentThreadAsDaemon,
};
/*
* Replace the normal table with the checked table.
*/
void dvmUseCheckedJniEnv(JNIEnvExt* pEnv) {
assert(pEnv->funcTable != &gCheckNativeInterface);
pEnv->baseFuncTable = pEnv->funcTable;
pEnv->funcTable = &gCheckNativeInterface;
}
/*
* Replace the normal table with the checked table.
*/
void dvmUseCheckedJniVm(JavaVMExt* pVm) {
assert(pVm->funcTable != &gCheckInvokeInterface);
pVm->baseFuncTable = pVm->funcTable;
pVm->funcTable = &gCheckInvokeInterface;
}
| 38.14554
| 136
| 0.620507
|
flowcoaster
|
089b34e456829d7729aff86f2842f6c178dd98c9
| 12,040
|
cpp
|
C++
|
src/RTL/Component/Importing/CIFXInternetReadBufferX.cpp
|
alemuntoni/u3d
|
7907b907464a2db53dac03fdc137dcb46d447513
|
[
"Apache-2.0"
] | 44
|
2016-05-06T00:47:11.000Z
|
2022-02-11T06:51:37.000Z
|
src/RTL/Component/Importing/CIFXInternetReadBufferX.cpp
|
alemuntoni/u3d
|
7907b907464a2db53dac03fdc137dcb46d447513
|
[
"Apache-2.0"
] | 3
|
2016-06-27T12:37:31.000Z
|
2021-03-24T12:39:48.000Z
|
src/RTL/Component/Importing/CIFXInternetReadBufferX.cpp
|
alemuntoni/u3d
|
7907b907464a2db53dac03fdc137dcb46d447513
|
[
"Apache-2.0"
] | 15
|
2016-02-28T11:08:30.000Z
|
2021-06-01T03:32:01.000Z
|
//***************************************************************************
//
// Copyright (c) 2000 - 2006 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//***************************************************************************
/**
@file CIFXInternetReadBufferX.cpp
Implementation of the CIFXInternetReadBufferX class which implements the
IFXReadBuffer, IFXReadBufferX and IFXStdio interfaces.
*/
#include "CIFXInternetReadBufferX.h"
#include "IFXImportingCIDs.h"
#include "IFXCheckX.h"
#include "IFXMemory.h"
#include "IFXScheduler.h"
#include "IFXOSSocket.h"
const U32 BUFFER_BLOCK_SIZE = 65536;
const U32 INTERNET_READ_TASK_PRIORITY = 4;
// Factory function.
IFXRESULT IFXAPI_CALLTYPE CIFXInternetReadBufferX_Factory(
IFXREFIID interfaceId, void** ppInterface)
{
IFXRESULT rc = IFX_OK;
if (ppInterface)
{
// Create the CIFXInternetReadBufferX component.
CIFXInternetReadBufferX *pComponent = new CIFXInternetReadBufferX;
if (pComponent)
{
// Perform a temporary AddRef for our usage of the component.
pComponent->AddRef();
// Attempt to obtain a pointer to the requested interface.
rc = pComponent->QueryInterface(interfaceId, ppInterface);
// Perform a Release since our usage of the component is now
// complete. Note: If the QI fails, this will cause the
// component to be destroyed.
pComponent->Release();
}
else
{
rc = IFX_E_OUT_OF_MEMORY;
}
}
else
{
rc = IFX_E_INVALID_POINTER;
}
return rc;
}
CIFXInternetReadBufferX::CIFXInternetReadBufferX() :
IFXDEFINEMEMBER(m_pReadingCallback),
IFXDEFINEMEMBER(m_pReadBuffer)
{
m_refCount = 0;
m_readPosition = 0;
m_readTaskHandle = IFXTASK_HANDLE_INVALID;
m_pReadBuffer = NULL;
}
CIFXInternetReadBufferX::~CIFXInternetReadBufferX()
{
Close();
}
// IFXUnknown
U32 CIFXInternetReadBufferX::AddRef( void )
{
return ++m_refCount;
}
U32 CIFXInternetReadBufferX::Release( void )
{
if (1 == m_refCount) {
delete this;
return 0;
}
return --m_refCount;
}
IFXRESULT CIFXInternetReadBufferX::QueryInterface(
IFXREFIID interfaceId, void** ppInterface )
{
IFXRESULT rc = IFX_OK;
if (ppInterface)
{
if (interfaceId == IID_IFXReadBufferX)
{
*ppInterface = ( IFXReadBufferX* ) this;
}
else if ( interfaceId == IID_IFXStdio )
{
*ppInterface = ( IFXStdio* )this;
}
else if ( interfaceId == IID_IFXInet )
{
*ppInterface = ( IFXInet* )this;
}
else if ( interfaceId == IID_IFXReadBuffer )
{
*ppInterface = ( IFXReadBuffer* )this;
}
else if ( interfaceId == IID_IFXUnknown )
{
*ppInterface = ( IFXUnknown* )this;
}
else if ( interfaceId == IID_IFXTask )
{
*ppInterface = ( IFXTask* )this;
}
else
{
*ppInterface = NULL;
rc = IFX_E_UNSUPPORTED;
}
if( IFXSUCCESS( rc ) )
AddRef();
}
else
{
rc = IFX_E_INVALID_POINTER;
}
return rc;
}
// IFXReadBuffer
IFXRESULT CIFXInternetReadBufferX::Read( U8* pBytes, U64 position, U32 count )
{
IFXRESULT rc = IFX_OK;
try
{
// Check the input pointer and file pointer
if(NULL == pBytes)
{
IFXCHECKX(IFX_E_INVALID_POINTER);
}
// Note the check for the file pointer (m_hFile) is done in GetTotalSizeX
ReadX(pBytes,position,count,rc);
if(IFX_W_END_OF_FILE == rc)
{
rc = IFX_E_END_OF_FILE; // Convert end of file warning to an error
}
}
catch(IFXException& rException)
{
rc = rException.GetIFXResult();
}
return rc;
}
void CIFXInternetReadBufferX::ReadX(
U8* pBytes, U64 position, U32 count,
IFXRESULT& rWarningCode )
{
rWarningCode = IFX_OK;
U32 bytesRead = 0;
// Check the input pointer and file pointer
if (NULL == pBytes)
{
IFXCHECKX(IFX_E_INVALID_POINTER);
}
if (m_readPosition != position)
IFXCHECKX(IFX_E_IO);
// Read the data
IFXRESULT result = m_session.Read( pBytes, count, &bytesRead );
if (IFX_OK == result)
{
m_readPosition += bytesRead;
}
else
{
// Check for end of file
if (IFX_W_FINISHED == result)
{
m_readPosition += bytesRead;
rWarningCode = IFX_W_END_OF_FILE;
}
else
IFXCHECKX( result );
}
}
IFXRESULT CIFXInternetReadBufferX::GetTotalSize( U64* pCount )
{
IFXRESULT rc = IFX_OK;
try
{
// Check the input pointer
if (NULL == pCount)
{
IFXCHECKX(IFX_E_INVALID_POINTER);
}
// Note the check for the file pointer (m_hFile) is done in GetTotalSizeX
GetTotalSizeX(*pCount);
}
catch(IFXException& rException)
{
rc = rException.GetIFXResult();
}
return rc;
}
void CIFXInternetReadBufferX::GetTotalSizeX( U64& rCount )
{
GetAvailableSizeX(rCount);
}
IFXRESULT CIFXInternetReadBufferX::GetAvailableSize( U64* pCount )
{
IFXRESULT rc = IFX_OK;
try
{
// Check the input pointer and file pointer
if(NULL == pCount)
{
IFXCHECKX(IFX_E_INVALID_POINTER);
}
// Note the check for the file pointer (m_hFile) is done in GetAvailableSizeX
GetAvailableSizeX(*pCount);
}
catch (IFXException& rException)
{
rc = rException.GetIFXResult();
}
return rc;
}
void CIFXInternetReadBufferX::GetAvailableSizeX( U64& rCount )
{
// For InternetReadBufferX, available size and total size are the same.
/// @todo Get file size for CIFXInternetReadBufferX is not implemented
//IFXInternetQueryDataAvailable(m_hFile, &rCount);
}
// IFXStdio
IFXRESULT CIFXInternetReadBufferX::Open(const IFXCHAR *pUrl)
{
IFXRESULT rc = IFX_OK;
try
{
m_session.OpenX( pUrl );
m_readPosition = 0;
}
catch (IFXException& rException)
{
rc = rException.GetIFXResult();
}
return rc;
}
IFXRESULT CIFXInternetReadBufferX::Close()
{
IFXRESULT result = IFX_OK;
result = m_session.Close();
return result;
}
// IFXInet
/// @todo complete CIFXInternetReadBufferX::GetConnectTimeout
IFXRESULT CIFXInternetReadBufferX::GetConnectTimeout(U32& rConnectTimeout)
{
IFXRESULT rc = IFX_E_UNSUPPORTED;
return rc;
}
/// @todo complete CIFXInternetReadBufferX::SetConnectTimeout
IFXRESULT CIFXInternetReadBufferX::SetConnectTimeout(const U32 connectTimeout)
{
IFXRESULT rc = IFX_E_UNSUPPORTED;
return rc;
}
IFXRESULT CIFXInternetReadBufferX::GetSendTimeout(U32& rSendTimeout)
{
IFXRESULT rc = IFX_OK;
U32 buffer;
I32 buflen = sizeof(buffer);
rc = m_session.GetOptions( IFXOSSOCKET_SEND_TIMEOUT, (I8*)&buffer, &buflen );
if( IFXSUCCESS( rc ) )
rSendTimeout = buffer;
return rc;
}
IFXRESULT CIFXInternetReadBufferX::SetSendTimeout(const U32 sendTimeout)
{
IFXRESULT rc = IFX_OK;
const I8* buffer = (const I8*)&sendTimeout;
U32 buflen = sizeof(sendTimeout);
rc = m_session.SetOptions( IFXOSSOCKET_SEND_TIMEOUT, buffer, buflen );
return rc;
}
IFXRESULT CIFXInternetReadBufferX::GetReceiveTimeout(U32& rReceiveTimeout)
{
IFXRESULT rc = IFX_OK;
U32 buffer;
I32 buflen = sizeof(buffer);
rc = m_session.GetOptions( IFXOSSOCKET_RECEIVE_TIMEOUT, (I8*)&buffer, &buflen );
if( IFXSUCCESS( rc ) )
rReceiveTimeout = buffer;
return rc;
}
IFXRESULT CIFXInternetReadBufferX::SetReceiveTimeout(const U32 receiveTimeout)
{
IFXRESULT rc = IFX_OK;
const I8* pBuffer = (const I8*)&receiveTimeout;
U32 buflen = sizeof(receiveTimeout);
rc = m_session.SetOptions( IFXOSSOCKET_RECEIVE_TIMEOUT, pBuffer, buflen );
return rc;
}
IFXRESULT CIFXInternetReadBufferX::InitiateRead(
IFXCoreServices* pCoreServices,
IFXReadingCallback* pReadingCallback)
{
IFXRESULT rc = IFX_OK;
if (IFXSUCCESS(rc) && (NULL == pReadingCallback)) rc = IFX_E_INVALID_POINTER;
m_pCoreServices = pCoreServices;
IFXRELEASE(m_pReadingCallback);
m_pReadingCallback = pReadingCallback;
m_pReadingCallback->AddRef();
m_pReadingCallback->GetURLCount(m_URLs);
m_currentURL = 0;
IFXDECLARELOCAL(IFXScheduler, pScheduler);
if (IFXSUCCESS(rc))
rc = m_pCoreServices->GetScheduler(IID_IFXScheduler, (void**)&pScheduler);
IFXDECLARELOCAL(IFXSystemManager, pSysMgr);
if (IFXSUCCESS(rc))
rc = pScheduler->GetSystemManager(&pSysMgr);
IFXDECLARELOCAL(IFXTask, pReadTask);
if (IFXSUCCESS(rc))
rc = this->QueryInterface(IID_IFXTask, (void**) &pReadTask);
if (IFXSUCCESS(rc))
{
rc = pSysMgr->RegisterTask(
pReadTask, INTERNET_READ_TASK_PRIORITY,
NULL, &m_readTaskHandle);
}
return rc;
}
IFXRESULT CIFXInternetReadBufferX::Execute(IFXTaskData* pTaskData)
{
IFXRESULT rc = IFX_OK;
if (m_currentURL < m_URLs)
{
U8* pFile = NULL;
U64 totalSize = 0;
if (m_pReadBuffer == NULL)
{
IFXString sURL;
rc = m_pReadingCallback->GetURL(m_currentURL, sURL);
if(IFXSUCCESS( rc ))
{
IFXDECLARELOCAL(IFXStdio, pStdio);
U32 tmp = 0;
totalSize = 0;
if (IFXSUCCESS(sURL.FindSubstring(L"://", &tmp)))
rc = this->QueryInterface(IID_IFXReadBuffer, (void**)&m_pReadBuffer);
else
{
rc = IFXCreateComponent(
CID_IFXStdioReadBuffer,
IID_IFXReadBuffer,
(void**)&m_pReadBuffer);
totalSize = 1;
}
if (IFXSUCCESS(rc))
rc = m_pReadBuffer->QueryInterface(IID_IFXStdio, (void**)&pStdio);
if (IFXSUCCESS(rc))
rc = pStdio->Open( (IFXCHAR*)sURL.Raw() );
if (IFXFAILURE(rc))
{
// try another URL
IFXRELEASE(m_pReadBuffer);
m_currentURL++;
}
}
}
if (IFXSUCCESS(rc))
{
if (0 != totalSize) // local file
{
m_pReadBuffer->GetTotalSize(&totalSize);
pFile = (U8*)IFXAllocate( (size_t)totalSize );
if (NULL != pFile )
{
rc = m_pReadBuffer->Read( pFile, 0, (U32)totalSize );
}
else
{
rc = IFX_E_OUT_OF_MEMORY;
}
if( IFXSUCCESS( rc) )
{
rc = IFX_W_END_OF_FILE;
}
}
else
{
U64 readSize = 0;
U64 currentSize = 0;
while (IFX_OK == rc)
{
currentSize += BUFFER_BLOCK_SIZE;
readSize = m_readPosition;
pFile = (U8*)IFXReallocate( pFile, (size_t)currentSize );
if (pFile != NULL)
{
rc = m_pReadBuffer->Read(
pFile+readSize,
readSize,
BUFFER_BLOCK_SIZE );
}
else
{
rc = IFX_E_OUT_OF_MEMORY;
break;
}
}
if (rc == IFX_E_END_OF_FILE)
{
totalSize = m_readPosition;
pFile = (U8*)IFXReallocate(pFile, (size_t)totalSize);
rc = IFX_W_END_OF_FILE;
}
}
if (rc == IFX_W_END_OF_FILE)
{
IFXDECLARELOCAL(IFXStdio, pStdio);
rc = m_pReadBuffer->QueryInterface(IID_IFXStdio, (void**)&pStdio);
if (IFXSUCCESS(rc))
pStdio->Close();
IFXRELEASE(m_pReadBuffer);
/**
@todo Dangerous pass of pFile buffer allocated here. It will be
deallocated in CIFXImageTools.
*/
m_pReadingCallback->AcceptSuccess(m_currentURL, pFile, (U32)totalSize);
pFile = NULL; // deleting is left to the m_pReadingCallback
totalSize = 0;
IFXDECLARELOCAL(IFXScheduler, pScheduler);
m_pCoreServices->GetScheduler(IID_IFXScheduler, (void**)&pScheduler);
IFXDECLARELOCAL(IFXSystemManager, pSysMgr);
pScheduler->GetSystemManager(&pSysMgr);
pSysMgr->UnregisterTask(m_readTaskHandle);
m_readTaskHandle = IFXTASK_HANDLE_INVALID;
}
}
}
else
{
m_pReadingCallback->AcceptFailure(IFX_E_CANNOT_FIND);
IFXDECLARELOCAL(IFXScheduler, pScheduler);
m_pCoreServices->GetScheduler(IID_IFXScheduler, (void**)&pScheduler);
IFXDECLARELOCAL(IFXSystemManager, pSysMgr);
pScheduler->GetSystemManager(&pSysMgr);
pSysMgr->UnregisterTask(m_readTaskHandle);
m_readTaskHandle = IFXTASK_HANDLE_INVALID;
}
// If one of the URL in the URL list is not valid this is okay, try another one
if (rc == IFX_E_INVALID_FILE)
rc = IFX_OK;
return rc;
}
| 21.385435
| 81
| 0.684551
|
alemuntoni
|
089bc39c3595d84a74de45116f1380f4ba67c094
| 3,340
|
cpp
|
C++
|
src/visual-scripting/processors/logical/gates/XorProcessor.cpp
|
inexorgame/entity-system
|
230a6f116fb02caeace79bc9b32f17fe08687c36
|
[
"MIT"
] | 19
|
2018-10-11T09:19:48.000Z
|
2020-04-19T16:36:58.000Z
|
src/visual-scripting/processors/logical/gates/XorProcessor.cpp
|
inexorgame-obsolete/entity-system-inactive
|
230a6f116fb02caeace79bc9b32f17fe08687c36
|
[
"MIT"
] | 132
|
2018-07-28T12:30:54.000Z
|
2020-04-25T23:05:33.000Z
|
src/visual-scripting/processors/logical/gates/XorProcessor.cpp
|
inexorgame-obsolete/entity-system-inactive
|
230a6f116fb02caeace79bc9b32f17fe08687c36
|
[
"MIT"
] | 3
|
2019-03-02T16:19:23.000Z
|
2020-02-18T05:15:29.000Z
|
#include "XorProcessor.hpp"
#include <type-system/types/logical/gates/Xor.hpp>
#include <utility>
namespace inexor::visual_scripting {
using namespace inexor::entity_system;
using namespace inexor::entity_system::type_system;
using Xor = entity_system::type_system::Xor;
using EntityTypePtrOpt = std::optional<EntityTypePtr>;
using EntityAttributeInstancePtrOptional = std::optional<std::shared_ptr<EntityAttributeInstance>>;
XorProcessor::XorProcessor(EntityTypeManagerPtr entity_type_manager, EntityInstanceManagerPtr entity_instance_manager, LogManagerPtr log_manager)
: Processor(), LifeCycleComponent(), entity_type_manager(std::move(entity_type_manager)), entity_instance_manager(std::move(entity_instance_manager)), log_manager(std::move(log_manager))
{
}
XorProcessor::~XorProcessor() = default;
void XorProcessor::init()
{
log_manager->register_logger(LOGGER_NAME);
init_processor();
}
void XorProcessor::init_processor()
{
EntityTypePtrOpt o_ent_type = entity_type_manager->get_entity_type(Xor::TYPE_NAME);
if (o_ent_type.has_value()) {
this->entity_type = o_ent_type.value();
entity_instance_manager->register_on_created(this->entity_type->get_GUID(), shared_from_this());
entity_instance_manager->register_on_deleted(this->entity_type->get_GUID(), shared_from_this());
} else {
spdlog::get(LOGGER_NAME)->error("Failed to initialize processor {}: Entity type does not exist", Xor::TYPE_NAME);
}
}
std::string XorProcessor::get_component_name()
{
return "XorProcessor";
}
void XorProcessor::on_entity_instance_created(EntityInstancePtr entity_instance)
{
make_signals(entity_instance);
}
void XorProcessor::on_entity_instance_deleted(const xg::Guid &type_GUID, const xg::Guid &inst_GUID)
{
// Disconnect observers with execution method
// Delete observer for each input atttribute of the entity instance
// TODO: remove / clear signal
// signals[inst_GUID].clear
}
void XorProcessor::make_signals(const EntityInstancePtr &entity_instance)
{
spdlog::get(LOGGER_NAME)->debug("Initializing processor XOR for newly created entity instance {} of type {}", entity_instance->get_GUID().str(), entity_instance->get_entity_type()->get_type_name());
auto o_xor_input_1 = entity_instance->get_attribute_instance(Xor::INPUT_1);
auto o_xor_input_2 = entity_instance->get_attribute_instance(Xor::INPUT_2);
auto o_xor_result = entity_instance->get_attribute_instance(Xor::RESULT);
if (o_xor_input_1.has_value() && o_xor_input_2.has_value() && o_xor_result.has_value())
{
signals[entity_instance->get_GUID()] =
MakeSignal(With(o_xor_input_1.value()->value, o_xor_input_2.value()->value), [](DataValue xor_input_1, DataValue xor_input_2) { return DataValue(std::get<DataType::BOOL>(xor_input_1) ^ std::get<DataType::BOOL>(xor_input_2)); });
o_xor_result.value()->value = signals[entity_instance->get_GUID()];
} else
{
spdlog::get(LOGGER_NAME)
->error("Failed to initialize processor signals for entity instance {} of type {}: Missing one of these attributes: {} {} {}", entity_instance->get_GUID().str(), entity_instance->get_entity_type()->get_type_name(),
Xor::INPUT_1, Xor::INPUT_2, Xor::RESULT);
}
}
} // namespace inexor::visual_scripting
| 41.75
| 240
| 0.746108
|
inexorgame
|
089e0e7e7e56b1fb1d345ab36f0527b92210a877
| 287
|
cpp
|
C++
|
pointers/pointer6.cpp
|
manish1822510059/cpp-program
|
03ec133857daf81163c621d4d54244409a94a200
|
[
"Apache-2.0"
] | 1
|
2021-04-04T15:47:36.000Z
|
2021-04-04T15:47:36.000Z
|
pointers/pointer6.cpp
|
manish1822510059/cpp-program
|
03ec133857daf81163c621d4d54244409a94a200
|
[
"Apache-2.0"
] | null | null | null |
pointers/pointer6.cpp
|
manish1822510059/cpp-program
|
03ec133857daf81163c621d4d54244409a94a200
|
[
"Apache-2.0"
] | null | null | null |
#include<iostream>
using namespace std;
int sum(int *a,int size){
int ans=0;
for(int i=0;i< size;i++)
{
ans+=a[i];
}
return ans;
}
int main(){
int a[10]={1,2,3,4,5,3,22,66,44,4};
cout<<sizeof(a)<<endl;
cout<<sum(a+2,3)<<endl;
}
| 13.045455
| 36
| 0.484321
|
manish1822510059
|
08a5be3c183f278f696ea14de23bd5c64a885845
| 2,203
|
hpp
|
C++
|
src/actor/context/Context.hpp
|
SpeedXer/Nebula
|
62f55ab2f45f7e95580b800ef351da9b3073becf
|
[
"MIT"
] | null | null | null |
src/actor/context/Context.hpp
|
SpeedXer/Nebula
|
62f55ab2f45f7e95580b800ef351da9b3073becf
|
[
"MIT"
] | 1
|
2019-12-31T01:10:26.000Z
|
2019-12-31T01:10:26.000Z
|
src/actor/context/Context.hpp
|
wincsb/Nebula
|
70a7baf24d17ae59a0f2788af45887fc2b1092df
|
[
"Apache-2.0"
] | null | null | null |
/*******************************************************************************
* Project: Nebula
* @file Context.hpp
* @brief
* @author Bwar
* @date: 2019年2月16日
* @note
* Modify history:
******************************************************************************/
#ifndef SRC_ACTOR_CONTEXT_HPP_
#define SRC_ACTOR_CONTEXT_HPP_
#include "actor/DynamicCreator.hpp"
#include "actor/Actor.hpp"
namespace neb
{
class ActorBuilder;
/**
* @brief Actor上下文信息
* @note Actor上下文信息用于保存Actor(主要是Step,也可用于Session)运行
* 过程中的上下信息存储和数据共享。
* Context由Actor(可以是Cmd、Module、Step、Chain)创建,并由创建者
* Actor和传递使用者Actor之间共享,框架不登记和持有;当没有一个Actor持有
* Context时,std::shared_ptr<Context>引用计数为0将自动回收。
* 比如Cmd收到一个消息,后续需要若干个Step才完成全部操作,在最后一个
* Step中给请求方发送响应,那么最后一个Step需要获取Cmd当时收到的请求上下
* 文,而最后一个Step可能不是Cmd所创建的,一种实现方式是将上下文信息顺着
* Step链条赋值传递(因为前面的Step执行完毕可能会被销毁,不能用引用传递)
* 下去,这样会导致多次内存拷贝。Context的存在是为了减少这种不必要的复制,
* Context由框架管理,Step只需传递Context的引用。
* 从Context基类派生出业务自己的Context类可以用于Step间自定义数据的共
* 享(当然,Session类也可以达到同样目的,区别在于GetSession()需要传入
* SessionId才能获取到Session,GetContext()则不需要传参即可获取)。什么时
* 候用Context?建议是同一个Chain(共同完成一个操作的Step执行链)的上
* 下文信息和数据共享用Context,其他情况用Session。
*/
class Context: public Actor
{
public:
Context();
Context(std::shared_ptr<SocketChannel> pChannel);
Context(const Context&) = delete;
Context& operator=(const Context&) = delete;
virtual ~Context();
/**
* @brief 动态处理链上下文操作完成
* @note 一次客户端请求可能需要若干步骤(Step)才能完成,当处理完成时,
* 对于预定义的静态请求处理链,通常会由最后一个步骤(Step)给客户端发响
* 应,响应信息通常来自于各步骤存储于Context的数据。然而,对于通过配置
* 完成的动态请求处理链,最后一个步骤通常是未知的,如果想要由最后一个步
* 骤发送响应,那么无论处理链有多少个步骤,都需要固定最后一个步骤,这是
* 不合理的,配置动态处理链的时候也容易出错。因此,在Context中引入一个
* Done()方法,把给客户端的响应放在Done()方法里,系统在处理链调度完最后
* 一个节点处理完成时调用Done()方法将整个动态处理链的响应结果发给客户端,
* 那样动态处理链的Block节点顺序只跟链的业务逻辑相关,而无需固定最后一个
* 步骤。注意,该方法只适用于配置的动态处理链,预定义的静态处理链无需实
* 现此方法,所以该方法是实现为空的方法而非纯虚方法。
*/
virtual void Done()
{
}
std::shared_ptr<SocketChannel> GetChannel()
{
return(m_pChannel);
}
private:
std::shared_ptr<SocketChannel> m_pChannel;
friend class ActorBuilder;
};
} /* namespace neb */
#endif /* SRC_ACTOR_CONTEXT_HPP_ */
| 27.5375
| 80
| 0.679074
|
SpeedXer
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.