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
108
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
67k
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
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
8264f8b049e0fae7aa612395cd07b330e680fc98
420
cpp
C++
cpp/tests/parsing/test_StructParser.cpp
ProkopHapala/SimpleSimulationEngine
240f9b7e85b3a6eda7a27dc15fe3f7b8c08774c5
[ "MIT" ]
26
2016-12-04T04:45:12.000Z
2022-03-24T09:39:28.000Z
cpp/tests/parsing/test_StructParser.cpp
ProkopHapala/SimpleSimulationEngine
240f9b7e85b3a6eda7a27dc15fe3f7b8c08774c5
[ "MIT" ]
null
null
null
cpp/tests/parsing/test_StructParser.cpp
ProkopHapala/SimpleSimulationEngine
240f9b7e85b3a6eda7a27dc15fe3f7b8c08774c5
[ "MIT" ]
2
2019-02-09T12:31:06.000Z
2019-04-28T02:24:50.000Z
#include "StructParser.h" #include "binarySwitch.h" #include "testUtils.h" #include <cstring> using namespace parsing; StructParser parser; char * test_str = "Name1{ x1; x2; x3; Name2{ x3; x4; }; Name3{ x5; x6; }; };"; int main(){ printf( " %s\n", test_str ); printf( " ==== \n" ); parser.parseString( strlen(test_str), test_str ); //parser.parse( 0, 0, -1 ); parser.printItemStruct(); }
16.8
80
0.607143
ProkopHapala
826583e5303f5d05b318262f7889cc39a16520c7
4,355
cc
C++
lib/ui/gfx/util/event_timestamper.cc
PowerOlive/garnet
16b5b38b765195699f41ccb6684cc58dd3512793
[ "BSD-3-Clause" ]
null
null
null
lib/ui/gfx/util/event_timestamper.cc
PowerOlive/garnet
16b5b38b765195699f41ccb6684cc58dd3512793
[ "BSD-3-Clause" ]
null
null
null
lib/ui/gfx/util/event_timestamper.cc
PowerOlive/garnet
16b5b38b765195699f41ccb6684cc58dd3512793
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2017 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "garnet/lib/ui/gfx/util/event_timestamper.h" #include <lib/async/default.h> #include <lib/async/time.h> namespace scenic_impl { namespace gfx { EventTimestamper::EventTimestamper() : main_dispatcher_(async_get_default_dispatcher()), background_loop_(&kAsyncLoopConfigNoAttachToThread), task_([] { zx_thread_set_priority(24 /* HIGH_PRIORITY in LK */); }) { FXL_DCHECK(main_dispatcher_); background_loop_.StartThread(); IncreaseBackgroundThreadPriority(); } EventTimestamper::~EventTimestamper() { background_loop_.Shutdown(); #ifndef NDEBUG FXL_CHECK(watch_count_ == 0); #endif } void EventTimestamper::IncreaseBackgroundThreadPriority() { task_.Post(background_loop_.dispatcher()); } EventTimestamper::Watch::Watch() : waiter_(nullptr), timestamper_(nullptr) {} EventTimestamper::Watch::Watch(EventTimestamper* ts, zx::event event, zx_status_t trigger, Callback callback) : waiter_(new EventTimestamper::Waiter(ts->main_dispatcher_, std::move(event), trigger, std::move(callback))), timestamper_(ts) { FXL_DCHECK(timestamper_); #ifndef NDEBUG ++timestamper_->watch_count_; #endif } EventTimestamper::Watch::Watch(Watch&& rhs) : waiter_(rhs.waiter_), timestamper_(rhs.timestamper_) { rhs.waiter_ = nullptr; rhs.timestamper_ = nullptr; } EventTimestamper::Watch& EventTimestamper::Watch::operator=( EventTimestamper::Watch&& rhs) { FXL_DCHECK(!waiter_ && !timestamper_); waiter_ = rhs.waiter_; timestamper_ = rhs.timestamper_; rhs.waiter_ = nullptr; rhs.timestamper_ = nullptr; return *this; } EventTimestamper::Watch::~Watch() { if (!waiter_) { // Was moved. return; } #ifndef NDEBUG --timestamper_->watch_count_; #endif switch (waiter_->state()) { case Waiter::State::STOPPED: delete waiter_; break; case Waiter::State::STARTED: waiter_->set_state(Waiter::State::ABANDONED); if (ZX_OK == waiter_->wait().Cancel()) { // We successfully cancelled the async::Wait, so we can/must delete the // Waiter ourselves. Otherwise we must not delete it, because it will // delete itself when it sees that it has been abandoned. delete waiter_; } break; case Waiter::State::ABANDONED: FXL_DCHECK(false) << "internal error."; break; } } void EventTimestamper::Watch::Start() { FXL_DCHECK(waiter_) << "invalid Watch (was it std::move()d?)."; FXL_DCHECK(waiter_->state() == Waiter::State::STOPPED) << "illegal to call Start() again before callback has been received."; waiter_->set_state(Waiter::State::STARTED); waiter_->wait().Begin(timestamper_->background_loop_.dispatcher()); } // Return the watched event (or a null handle, if this Watch was moved). const zx::event& EventTimestamper::Watch::event() const { static const zx::event null_handle; return waiter_ ? waiter_->event() : null_handle; } EventTimestamper::Waiter::Waiter(async_dispatcher_t* dispatcher, zx::event event, zx_status_t trigger, Callback callback) : dispatcher_(dispatcher), event_(std::move(event)), callback_(std::move(callback)), wait_(this, event_.get(), trigger) {} EventTimestamper::Waiter::~Waiter() { FXL_DCHECK(state_ == State::STOPPED || state_ == State::ABANDONED); } void EventTimestamper::Waiter::Handle(async_dispatcher_t* dispatcher, async::WaitBase* wait, zx_status_t status, const zx_packet_signal_t* signal) { FXL_DCHECK(dispatcher); zx_time_t now = async_now(dispatcher); async::PostTask(dispatcher_, [now, this] { if (state_ == State::ABANDONED) { // The EventTimestamper::Watch that owned us was destroyed; we must // immediately destroy ourself or our memory will be leaked. delete this; return; } FXL_DCHECK(state_ == State::STARTED) << "internal error."; state_ = State::STOPPED; callback_(now); }); } } // namespace gfx } // namespace scenic_impl
31.557971
80
0.662687
PowerOlive
82659669a8281128038dd9174e12a2f9b354ecad
3,566
cpp
C++
HW1/part1/vectorOP.cpp
banne2266/PP-NCTU-2021
7ae7b82349c51d4237aeff1ff2993d5c99e57a42
[ "MIT" ]
null
null
null
HW1/part1/vectorOP.cpp
banne2266/PP-NCTU-2021
7ae7b82349c51d4237aeff1ff2993d5c99e57a42
[ "MIT" ]
null
null
null
HW1/part1/vectorOP.cpp
banne2266/PP-NCTU-2021
7ae7b82349c51d4237aeff1ff2993d5c99e57a42
[ "MIT" ]
null
null
null
#include "PPintrin.h" // implementation of absSerial(), but it is vectorized using PP intrinsics void absVector(float *values, float *output, int N) { __pp_vec_float x; __pp_vec_float result; __pp_vec_float zero = _pp_vset_float(0.f); __pp_mask maskAll, maskIsNegative, maskIsNotNegative; // Note: Take a careful look at this loop indexing. This example // code is not guaranteed to work when (N % VECTOR_WIDTH) != 0. // Why is that the case? for (int i = 0; i < N; i += VECTOR_WIDTH) { // All ones maskAll = _pp_init_ones(); // All zeros maskIsNegative = _pp_init_ones(0); // Load vector of values from contiguous memory addresses _pp_vload_float(x, values + i, maskAll); // x = values[i]; // Set mask according to predicate _pp_vlt_float(maskIsNegative, x, zero, maskAll); // if (x < 0) { // Execute instruction using mask ("if" clause) _pp_vsub_float(result, zero, x, maskIsNegative); // output[i] = -x; // Inverse maskIsNegative to generate "else" mask maskIsNotNegative = _pp_mask_not(maskIsNegative); // } else { // Execute instruction ("else" clause) _pp_vload_float(result, values + i, maskIsNotNegative); // output[i] = x; } // Write results back to memory _pp_vstore_float(output + i, result, maskAll); } } void clampedExpVector(float *values, int *exponents, float *output, int N) { // // PP STUDENTS TODO: Implement your vectorized version of // clampedExpSerial() here. // // Your solution should work for any value of // N and VECTOR_WIDTH, not just when VECTOR_WIDTH divides N // __pp_vec_float x; __pp_vec_float result; __pp_vec_int exp; __pp_vec_int zeros = _pp_vset_int(0); __pp_vec_int ones = _pp_vset_int(1); __pp_vec_float maxs = _pp_vset_float(EXP_MAX); __pp_mask mask_data, mask_op; for (int i = 0; i < N; i += VECTOR_WIDTH) { if(i + VECTOR_WIDTH < N){ mask_data = _pp_init_ones(); mask_op = _pp_init_ones(); } else{ mask_data = _pp_init_ones(N - i); mask_op = _pp_init_ones(N - i); } _pp_vload_float(x, values + i, mask_data);//load value _pp_vload_int(exp, exponents + i, mask_data);//load exponents _pp_vset_float(result, 1.0, mask_data);//set result to 1's _pp_vgt_int(mask_op, exp, zeros, mask_data); while(_pp_cntbits(mask_op) > 0){ _pp_vmult_float(result, result, x, mask_op);// result = result * x _pp_vsub_int(exp, exp, ones, mask_op);//exp-- _pp_vgt_int(mask_op, exp, zeros, mask_data);//op = (exp > 0) __pp_mask exceed; _pp_vgt_float(exceed, result, maxs, mask_data);//if result > 9.99999 _pp_vset_float(result, EXP_MAX, exceed); //then result = EXP_MAX exceed = _pp_mask_not(exceed); mask_op = _pp_mask_and(mask_op, exceed); } _pp_vstore_float(output + i, result, mask_data); } } // returns the sum of all elements in values // You can assume N is a multiple of VECTOR_WIDTH // You can assume VECTOR_WIDTH is a power of 2 float arraySumVector(float *values, int N) { // // PP STUDENTS TODO: Implement your vectorized version of arraySumSerial here // float result = 0; float dump[VECTOR_WIDTH]; __pp_vec_float x; __pp_mask maskAll = _pp_init_ones(); for (int i = 0; i < N; i += VECTOR_WIDTH) { int n = VECTOR_WIDTH; _pp_vload_float(x, values + i, maskAll); while(n > 1){ _pp_hadd_float(x, x); _pp_interleave_float(x, x); n /= 2; } _pp_vstore_float(dump, x, maskAll); result += dump[0]; } return result; }
29.471074
81
0.664891
banne2266
826669c4de8d44392b5b24d7242d65ff718f4959
1,574
cpp
C++
engine/src/Timer.cpp
irishpatrick/sdl-game
23ff8330fe2aaa765119df40d62e50570f606f07
[ "MIT-0", "MIT" ]
null
null
null
engine/src/Timer.cpp
irishpatrick/sdl-game
23ff8330fe2aaa765119df40d62e50570f606f07
[ "MIT-0", "MIT" ]
null
null
null
engine/src/Timer.cpp
irishpatrick/sdl-game
23ff8330fe2aaa765119df40d62e50570f606f07
[ "MIT-0", "MIT" ]
null
null
null
#include "Timer.hpp" //auto then = std::chrono::high_resolution_clock::now(); //auto now = std::chrono::high_resolution_clock::now(); namespace engine { long Timer::getNanoTime() { auto n = std::chrono::high_resolution_clock::now(); auto duration = n.time_since_epoch(); return (long)std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count(); } float Timer::toSeconds(long t, Unit u) { if (u == NANO) { return (float)(t / 1.0e+9); } else if (u == MILLI) { return (float)(t / 1.0e+3); } return -1.0f; } Timer::Timer() { duration = 0; initial = 0; //then = 0; //now = 0; } Timer::~Timer() { } void Timer::setInterval(long ms) { duration = ms * 1000 * 1000; reset(); } void Timer::reset() { then = std::chrono::high_resolution_clock::now(); } bool Timer::tick() { now = std::chrono::high_resolution_clock::now(); long delta = (long)std::chrono::duration_cast<std::chrono::nanoseconds>(now - then).count(); if (delta >= duration) { then = std::chrono::high_resolution_clock::now(); return true; } return false; } void Timer::start() { reset(); initial = getNanoTime(); } long Timer::getElapsed() { return getNanoTime() - initial; } long Timer::getDelta() { now = std::chrono::high_resolution_clock::now(); long delta = (long)std::chrono::duration_cast<std::chrono::nanoseconds>(now - then).count(); then = std::chrono::high_resolution_clock::now(); return delta; } }
18.738095
95
0.594028
irishpatrick
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
826a140428a06ce38b8bc2d79e3c9a8420e2d928
2,473
cpp
C++
stack_queues/properly_nested.cpp
rcolomina/math_puzzles
74cd1cff01cf1cf06e7d38575ac7b0f2807036e7
[ "MIT" ]
null
null
null
stack_queues/properly_nested.cpp
rcolomina/math_puzzles
74cd1cff01cf1cf06e7d38575ac7b0f2807036e7
[ "MIT" ]
null
null
null
stack_queues/properly_nested.cpp
rcolomina/math_puzzles
74cd1cff01cf1cf06e7d38575ac7b0f2807036e7
[ "MIT" ]
null
null
null
// you can use includes, for example: // #include <algorithm> #include <stack> // you can write to stdout for debugging purposes, e.g. // cout << "this is a debug message" << endl; #include <string> #include <iostream> using namespace std; int iter_solution(string &S) { // write your code in C++14 (g++ 6.2.0) if(S=="") return 1; stack<char> mystack; for(auto it=S.begin();it!=S.end();++it) { // check top of the stack char c=*it; //cout<<"Char "<<c<<endl; if(c=='(' || c=='[' || c=='{') { mystack.push(c); } if(!mystack.empty()) { //cout<<"top "<<mystack.top()<<endl; if((mystack.top()=='(' && c==')') || (mystack.top()=='[' && c==']') || (mystack.top()=='{' && c=='}')) mystack.pop(); } } if(mystack.empty()) return 1; return 0; } int recur_solution(string &S){ if(S.size() == 0) return 1; else { if(S.size() % 2 != 0) return 0; for(auto it=S.begin()+1;it!=S.end()-1;++it) { string s1 = S.substr(*(S.begin())+1,*it); string s2 = S.substr(*it,*(S.end())); if(recur_solution(s1) && recur_solution(s2)) return 1; } char first = S[0]; char last = S[S.size()-1]; auto it1=S.begin(); auto it2=S.end(); string middle; if(it1+1!=it2) middle=middle.substr(*it1+1,*it2-1); if(first==last && recur_solution(S)) return 1; else return 0; } } int main(){ string S="[[]]"; bool nested=iter_solution(S); cout<<"(iter) properly nested:"<<nested<<endl; nested=iter_solution(S); cout<<"(recut) properly nested:"<<nested<<endl; S="[([)]"; nested=iter_solution(S); cout<<"(iter) properly nested:"<<nested<<endl; nested=iter_solution(S); cout<<"(recut) properly nested:"<<nested<<endl; S="[{[]}][[()]]"; nested=iter_solution(S); cout<<"(iter) properly nested:"<<nested<<endl; nested=iter_solution(S); cout<<"(recut) properly nested:"<<nested<<endl; S="[][]"; nested=iter_solution(S); cout<<"(iter) properly nested:"<<nested<<endl; nested=iter_solution(S); cout<<"(recut) properly nested:"<<nested<<endl; }
23.552381
114
0.47594
rcolomina
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
826cb955ffe133752ad8ceeed36036f56026a965
3,524
cpp
C++
lib/Target/Syntax.cpp
bilaleluneis/qpu
4e6fbe8426c9747aa672217c47802abd08ac723b
[ "MIT" ]
null
null
null
lib/Target/Syntax.cpp
bilaleluneis/qpu
4e6fbe8426c9747aa672217c47802abd08ac723b
[ "MIT" ]
null
null
null
lib/Target/Syntax.cpp
bilaleluneis/qpu
4e6fbe8426c9747aa672217c47802abd08ac723b
[ "MIT" ]
null
null
null
#include <assert.h> #include "../Source/Syntax.h" #include "Syntax.h" // ======= // Globals // ======= // Used for fresh label generation static int globalLabelId = 0; // ====================== // Handy syntax functions // ====================== // Determine if instruction is a conditional assignment bool isCondAssign(Instr* instr) { if (instr->tag == LI && instr->LI.cond.tag != ALWAYS) return true; if (instr->tag == ALU && instr->ALU.cond.tag != ALWAYS) return true; return false; } // Generate load-immediate instruction. Instr genLI(Reg dst, int i) { AssignCond always; always.tag = ALWAYS; Instr instr; instr.tag = LI; instr.LI.setFlags = false; instr.LI.cond = always; instr.LI.dest = dst; instr.LI.imm.tag = IMM_INT32; instr.LI.imm.intVal = i; return instr; } // Generate move instruction. Instr genMove(Reg dst, Reg src) { AssignCond always; always.tag = ALWAYS; Instr instr; instr.tag = ALU; instr.ALU.setFlags = false; instr.ALU.cond = always; instr.ALU.dest = dst; instr.ALU.srcA.tag = REG; instr.ALU.srcA.reg = src; instr.ALU.op = A_BOR; instr.ALU.srcB.tag = REG; instr.ALU.srcB.reg = src; return instr; } // Generate bitwise-or instruction. Instr genOR(Reg dst, Reg srcA, Reg srcB) { AssignCond always; always.tag = ALWAYS; Instr instr; instr.tag = ALU; instr.ALU.setFlags = false; instr.ALU.cond = always; instr.ALU.dest = dst; instr.ALU.srcA.tag = REG; instr.ALU.srcA.reg = srcA; instr.ALU.op = A_BOR; instr.ALU.srcB.tag = REG; instr.ALU.srcB.reg = srcB; return instr; } // Generate left-shift instruction. Instr genLShift(Reg dst, Reg srcA, int n) { assert(n >= 0 && n <= 15); AssignCond always; always.tag = ALWAYS; Instr instr; instr.tag = ALU; instr.ALU.setFlags = false; instr.ALU.cond = always; instr.ALU.dest = dst; instr.ALU.srcA.tag = REG; instr.ALU.srcA.reg = srcA; instr.ALU.op = A_SHL; instr.ALU.srcB.tag = IMM; instr.ALU.srcB.smallImm.tag = SMALL_IMM; instr.ALU.srcB.smallImm.val = n; return instr; } // Generate increment instruction. Instr genIncr(Reg dst, Reg srcA, int n) { assert(n >= 0 && n <= 15); AssignCond always; always.tag = ALWAYS; Instr instr; instr.tag = ALU; instr.ALU.setFlags = false; instr.ALU.cond = always; instr.ALU.dest = dst; instr.ALU.srcA.tag = REG; instr.ALU.srcA.reg = srcA; instr.ALU.op = A_ADD; instr.ALU.srcB.tag = IMM; instr.ALU.srcB.smallImm.tag = SMALL_IMM; instr.ALU.srcB.smallImm.val = n; return instr; } // Is last instruction in a basic block? bool isLast(Instr instr) { return instr.tag == BRL || instr.tag == BR || instr.tag == END; } // ========================= // Fresh variable generation // ========================= // Obtain a fresh variable Reg freshReg() { Var v = freshVar(); Reg r; r.tag = REG_A; r.regId = v.id; return r; } // Obtain a fresh label Label freshLabel() { return globalLabelId++; } // Number of fresh labels int getFreshLabelCount() { return globalLabelId; } // Reset fresh label generator void resetFreshLabelGen() { globalLabelId = 0; } // Reset fresh label generator to specified value void resetFreshLabelGen(int val) { globalLabelId = val; }
19.909605
65
0.588536
bilaleluneis
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
826ec84bec20d5c53ba293ffb9f566f8c63a33eb
4,062
hpp
C++
vlc_linux/vlc-3.0.16/modules/gui/skins2/commands/cmd_playlist.hpp
Brook1711/biubiu_Qt6
5c4d22a1d1beef63bc6c7738dce6c477c4642803
[ "MIT" ]
null
null
null
vlc_linux/vlc-3.0.16/modules/gui/skins2/commands/cmd_playlist.hpp
Brook1711/biubiu_Qt6
5c4d22a1d1beef63bc6c7738dce6c477c4642803
[ "MIT" ]
null
null
null
vlc_linux/vlc-3.0.16/modules/gui/skins2/commands/cmd_playlist.hpp
Brook1711/biubiu_Qt6
5c4d22a1d1beef63bc6c7738dce6c477c4642803
[ "MIT" ]
null
null
null
/***************************************************************************** * cmd_playlist.hpp ***************************************************************************** * Copyright (C) 2003 the VideoLAN team * $Id: bbbde615bd0656baa2df9ec6ef98b139be889e93 $ * * Authors: Cyril Deguet <asmax@via.ecp.fr> * Olivier Teulière <ipkiss@via.ecp.fr> * * 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., * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifndef CMD_PLAYLIST_HPP #define CMD_PLAYLIST_HPP #include "cmd_generic.hpp" #include "../utils/var_list.hpp" /// Command to delete the selected items from a list class CmdPlaylistDel: public CmdGeneric { public: CmdPlaylistDel( intf_thread_t *pIntf, VarList &rList ) : CmdGeneric( pIntf ), m_rList( rList ) { } virtual ~CmdPlaylistDel() { } virtual void execute(); virtual std::string getType() const { return "playlist del"; } private: /// List VarList &m_rList; }; /// Command to sort the playlist DEFINE_COMMAND( PlaylistSort, "playlist sort" ) /// Command to jump to the next item DEFINE_COMMAND( PlaylistNext, "playlist next" ) /// Command to jump to the previous item DEFINE_COMMAND( PlaylistPrevious, "playlist previous" ) /// Command to start the playlist DEFINE_COMMAND( PlaylistFirst, "playlist first" ) /// Command to set the random state class CmdPlaylistRandom: public CmdGeneric { public: CmdPlaylistRandom( intf_thread_t *pIntf, bool value ) : CmdGeneric( pIntf ), m_value( value ) { } virtual ~CmdPlaylistRandom() { } virtual void execute(); virtual std::string getType() const { return "playlist random"; } private: /// Random state bool m_value; }; /// Command to set the loop state class CmdPlaylistLoop: public CmdGeneric { public: CmdPlaylistLoop( intf_thread_t *pIntf, bool value ) : CmdGeneric( pIntf ), m_value( value ) { } virtual ~CmdPlaylistLoop() { } virtual void execute(); virtual std::string getType() const { return "playlist loop"; } private: /// Loop state bool m_value; }; /// Command to set the repeat state class CmdPlaylistRepeat: public CmdGeneric { public: CmdPlaylistRepeat( intf_thread_t *pIntf, bool value ) : CmdGeneric( pIntf ), m_value( value ) { } virtual ~CmdPlaylistRepeat() { } virtual void execute(); virtual std::string getType() const { return "playlist repeat"; } private: /// Repeat state bool m_value; }; /// Command to load a playlist class CmdPlaylistLoad: public CmdGeneric { public: CmdPlaylistLoad( intf_thread_t *pIntf, const std::string& rFile ) : CmdGeneric( pIntf ), m_file( rFile ) { } virtual ~CmdPlaylistLoad() { } virtual void execute(); virtual std::string getType() const { return "playlist load"; } private: /// Playlist file to load std::string m_file; }; /// Command to save a playlist class CmdPlaylistSave: public CmdGeneric { public: CmdPlaylistSave( intf_thread_t *pIntf, const std::string& rFile ) : CmdGeneric( pIntf ), m_file( rFile ) { } virtual ~CmdPlaylistSave() { } virtual void execute(); virtual std::string getType() const { return "playlist save"; } private: /// Playlist file to save std::string m_file; }; #endif
28.605634
79
0.643525
Brook1711
826ed5ffe4a5ecb5a88e6ff6cf7fdf2334d9e4a6
2,506
cpp
C++
source/tools/finite/opt-internal/krylov_solution.cpp
DavidAce/DMRG
e465fd903eade1bf6aa74daacd8e2cf02e9e9332
[ "MIT" ]
9
2017-10-31T22:50:28.000Z
2022-03-10T15:45:27.000Z
source/tools/finite/opt-internal/krylov_solution.cpp
DavidAce/DMRG
e465fd903eade1bf6aa74daacd8e2cf02e9e9332
[ "MIT" ]
null
null
null
source/tools/finite/opt-internal/krylov_solution.cpp
DavidAce/DMRG
e465fd903eade1bf6aa74daacd8e2cf02e9e9332
[ "MIT" ]
1
2019-07-16T00:27:56.000Z
2019-07-16T00:27:56.000Z
// // Created by david on 2021-04-17. // #include <tools/finite/opt-internal/opt-internal.h> #include <math/eig/solver.h> #include <math/eig/view.h> #include <tools/finite/opt_mps.h> #include <general/nmspc_tensor_extra.h> #include <tools/finite/measure.h> #include <tensors/class_tensors_finite.h> void tools::finite::opt::internal::krylov_extract_solutions(const opt_mps &initial_mps, const class_tensors_finite &tensors, eig::solver &solver, std::vector<tools::finite::opt::opt_mps> &eigvecs_mps, const std::string &tag, bool converged_only) { if(solver.result.meta.eigvals_found) { auto dims_mps = initial_mps.get_tensor().dimensions(); auto eigvecs = eig::view::get_eigvecs<Scalar>(solver.result, eig::Side::R, converged_only); auto eigvals = eig::view::get_eigvals<double>(solver.result, converged_only); eigvecs_mps.reserve(eigvecs_mps.size() + static_cast<size_t>(eigvals.size())); for(long idx = 0; idx < eigvals.size(); idx++) { // It's important to normalize the eigenvectors - they are not always well normalized when we get them from the eig::solver auto eigvec_i = Textra::TensorCast(eigvecs.col(idx).normalized(), dims_mps); auto overlap = std::abs(initial_mps.get_vector().dot(eigvecs.col(idx))); auto energy = tools::finite::measure::energy(eigvec_i, tensors); auto eigval = energy - initial_mps.get_energy_reduced(); auto variance = tools::finite::measure::energy_variance(eigvec_i, tensors); eigvecs_mps.emplace_back(fmt::format("{:<8} eigenvector {}", tag,idx), eigvec_i, tensors.active_sites, eigval, initial_mps.get_energy_reduced(), variance, overlap, tensors.get_length()); auto & mps = eigvecs_mps.back(); mps.set_time(solver.result.meta.time_total); mps.set_counter(static_cast<size_t>(solver.result.meta.counter)); mps.set_iter(static_cast<size_t>(solver.result.meta.iter)); mps.is_basis_vector = true; mps.validate_candidate(); mps.set_krylov_nev(solver.result.meta.nev_converged); mps.set_krylov_ncv(solver.result.meta.ncv); mps.set_krylov_tol(solver.result.meta.tol); mps.set_krylov_eigval(eigvals(idx)); mps.set_krylov_ritz(solver.result.meta.ritz); mps.set_krylov_shift(solver.result.meta.sigma); } } }
59.666667
156
0.659218
DavidAce
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
8271b7fd23b86dc823cd96e075dbb605a1b58377
3,957
cpp
C++
gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/DMS.cpp
karamach/gtsam
35f9b710163a1d14d8dc4fcf50b8dce6e0bf7e5b
[ "BSD-3-Clause" ]
105
2017-12-02T14:39:49.000Z
2022-02-19T18:20:25.000Z
trunk/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/DMS.cpp
shaolinbit/PPP-BayesTree
6f469775277a1a33447bf4c19603c796c2c63c75
[ "MIT" ]
5
2018-09-04T15:15:59.000Z
2020-09-08T08:51:02.000Z
trunk/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/DMS.cpp
shaolinbit/PPP-BayesTree
6f469775277a1a33447bf4c19603c796c2c63c75
[ "MIT" ]
66
2015-06-01T11:22:38.000Z
2022-02-18T11:03:57.000Z
/** * \file NETGeographicLib/DMS.cpp * \brief Implementation for NETGeographicLib::DMS class * * NETGeographicLib is copyright (c) Scott Heiman (2013) * GeographicLib is Copyright (c) Charles Karney (2010-2012) * <charles@karney.com> and licensed under the MIT/X11 License. * For more information, see * http://geographiclib.sourceforge.net/ **********************************************************************/ #include "stdafx.h" #include "GeographicLib/DMS.hpp" #include "DMS.h" #include "NETGeographicLib.h" using namespace NETGeographicLib; //***************************************************************************** double DMS::Decode( System::String^ dms, [System::Runtime::InteropServices::Out] Flag% ind) { try { GeographicLib::DMS::flag lind; double out = GeographicLib::DMS::Decode( StringConvert::ManagedToUnmanaged(dms), lind ); ind = static_cast<Flag>(lind); return out; } catch ( const std::exception& xcpt ) { throw gcnew GeographicErr( xcpt.what() ); } } //***************************************************************************** double DMS::Decode(System::String^ str) { try { return GeographicLib::DMS::Decode(StringConvert::ManagedToUnmanaged(str)); } catch ( const std::exception& xcpt ) { throw gcnew GeographicErr( xcpt.what() ); } } //***************************************************************************** void DMS::DecodeLatLon(System::String^ dmsa, System::String^ dmsb, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon, bool swaplatlong ) { try { double llat, llon; GeographicLib::DMS::DecodeLatLon( StringConvert::ManagedToUnmanaged( dmsa ), StringConvert::ManagedToUnmanaged( dmsb ), llat, llon, swaplatlong ); lat = llat; lon = llon; } catch ( const std::exception& xcpt ) { throw gcnew GeographicErr( xcpt.what() ); } } //***************************************************************************** double DMS::DecodeAngle(System::String^ angstr) { try { return GeographicLib::DMS::DecodeAngle(StringConvert::ManagedToUnmanaged( angstr )); } catch ( const std::exception& xcpt ) { throw gcnew GeographicErr( xcpt.what() ); } } //***************************************************************************** double DMS::DecodeAzimuth(System::String^ azistr) { try { return GeographicLib::DMS::DecodeAzimuth(StringConvert::ManagedToUnmanaged( azistr )); } catch ( const std::exception& xcpt ) { throw gcnew GeographicErr( xcpt.what() ); } } //***************************************************************************** System::String^ DMS::Encode(double angle, Component trailing, unsigned prec, Flag ind, char dmssep) { try { return StringConvert::UnmanagedToManaged( GeographicLib::DMS::Encode( angle, static_cast<GeographicLib::DMS::component>(trailing), prec, static_cast<GeographicLib::DMS::flag>(ind), dmssep ) ); } catch ( const std::exception& xcpt ) { throw gcnew GeographicErr( xcpt.what() ); } } //***************************************************************************** System::String^ DMS::Encode(double angle, unsigned prec, Flag ind, char dmssep ) { try { return StringConvert::UnmanagedToManaged( GeographicLib::DMS::Encode( angle, prec, static_cast<GeographicLib::DMS::flag>(ind), dmssep ) ); } catch ( const std::exception& xcpt ) { throw gcnew GeographicErr( xcpt.what() ); } }
30.206107
97
0.500379
karamach
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
82746743153d74dd26bdbda4c855d826c3282ff3
3,475
cpp
C++
ThirdParty/poco/Net/src/ICMPPacket.cpp
gregmedlock/roadrunnerwork
11f18f78ef3e381bc59c546a8d5e3ed46d8ab596
[ "Apache-2.0" ]
39
2015-01-23T10:01:31.000Z
2021-06-10T03:01:18.000Z
Windows/PocoNet/src/ICMPPacket.cpp
luckypen/WiEngine
7e80641fe15a77a2fc43db90f15dad6aa2c2860a
[ "MIT" ]
1
2015-04-15T08:07:47.000Z
2015-04-15T08:07:47.000Z
Windows/PocoNet/src/ICMPPacket.cpp
luckypen/WiEngine
7e80641fe15a77a2fc43db90f15dad6aa2c2860a
[ "MIT" ]
20
2015-01-20T07:36:10.000Z
2019-09-15T01:02:19.000Z
// // ICMPPacket.cpp // // $Id: //poco/1.4/Net/src/ICMPPacket.cpp#2 $ // // Library: Net // Package: ICMP // Module: ICMPPacket // // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // Permission is hereby granted, free of charge, to any person or organization // obtaining a copy of the software and accompanying documentation covered by // this license (the "Software") to use, reproduce, display, distribute, // execute, and transmit the Software, and to prepare derivative works of the // Software, and to permit third-parties to whom the Software is furnished to // do so, all subject to the following: // // The copyright notices in the Software and this entire statement, including // the above license grant, this restriction and the following disclaimer, // must be included in all copies of the Software, in whole or in part, and // all derivative works of the Software, unless such copies or derivative // works are solely in the form of machine-executable object code generated by // a source language processor. // // 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, TITLE AND NON-INFRINGEMENT. IN NO EVENT // SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE // FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. // #include "Poco/Net/ICMPPacket.h" #include "Poco/Net/ICMPv4PacketImpl.h" #include "Poco/Net/NetException.h" #include "Poco/Timestamp.h" #include "Poco/Timespan.h" #include "Poco/NumberFormatter.h" #include <sstream> using Poco::InvalidArgumentException; using Poco::NotImplementedException; using Poco::Timestamp; using Poco::Timespan; using Poco::NumberFormatter; using Poco::UInt8; using Poco::UInt16; using Poco::Int32; namespace Poco { namespace Net { ICMPPacket::ICMPPacket(IPAddress::Family family, int dataSize):_pImpl(0) { if (family == IPAddress::IPv4) _pImpl = new ICMPv4PacketImpl(dataSize); #if defined(POCO_HAVE_IPv6) else if (family == IPAddress::IPv6) throw NotImplementedException("ICMPv6 packets not implemented."); #endif else throw InvalidArgumentException("Invalid or unsupported address family passed to ICMPPacket"); } ICMPPacket::~ICMPPacket() { delete _pImpl; } void ICMPPacket::setDataSize(int dataSize) { _pImpl->setDataSize(dataSize); } int ICMPPacket::getDataSize() const { return _pImpl->getDataSize(); } int ICMPPacket::packetSize() const { return _pImpl->packetSize(); } int ICMPPacket::maxPacketSize() const { return _pImpl->maxPacketSize(); } const Poco::UInt8* ICMPPacket::packet() { return _pImpl->packet(); } struct timeval ICMPPacket::time(Poco::UInt8* buffer, int length) const { return _pImpl->time(buffer, length); } bool ICMPPacket::validReplyID(Poco::UInt8* buffer, int length) const { return _pImpl->validReplyID(buffer, length); } std::string ICMPPacket::errorDescription(Poco::UInt8* buffer, int length) { return _pImpl->errorDescription(buffer, length); } std::string ICMPPacket::typeDescription(int typeId) { return _pImpl->typeDescription(typeId); } } } // namespace Poco::Net
26.12782
100
0.723165
gregmedlock
82747f4bed03f1ada5fbdc88414e87fdf93f9110
660
cpp
C++
LeetCode/5178.cpp
LauZyHou/-
66c047fe68409c73a077eae561cf82b081cf8e45
[ "MIT" ]
7
2019-02-25T13:15:00.000Z
2021-12-21T22:08:39.000Z
LeetCode/5178.cpp
LauZyHou/-
66c047fe68409c73a077eae561cf82b081cf8e45
[ "MIT" ]
null
null
null
LeetCode/5178.cpp
LauZyHou/-
66c047fe68409c73a077eae561cf82b081cf8e45
[ "MIT" ]
1
2019-04-03T06:12:46.000Z
2019-04-03T06:12:46.000Z
class Solution { private: int sum = 0;// 顺便求和 bool factorIs4(int n) { if(n<2) return false; int cnt = 0; int p = sqrt(n); // 对于一个平方数不可能是4因数 if(p*p==n) return false; sum = 1+n; for(int i=2;i<=p;i++) { if(n%i==0) { sum += i+n/i; cnt+=2; } if(cnt>2) return false; } return cnt==2; } public: int sumFourDivisors(vector<int>& v) { int ans = 0; for(auto&x:v) { if(factorIs4(x)) ans+=sum; } return ans; } };
20.625
41
0.369697
LauZyHou
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
827e343f8c03deb50ddc62da12dc10b1245055d4
2,514
cpp
C++
src/tests/kits/app/bmessage/MessageDestructTest.cpp
Kirishikesan/haiku
835565c55830f2dab01e6e332cc7e2d9c015b51e
[ "MIT" ]
1,338
2015-01-03T20:06:56.000Z
2022-03-26T13:49:54.000Z
src/tests/kits/app/bmessage/MessageDestructTest.cpp
Kirishikesan/haiku
835565c55830f2dab01e6e332cc7e2d9c015b51e
[ "MIT" ]
15
2015-01-17T22:19:32.000Z
2021-12-20T12:35:00.000Z
src/tests/kits/app/bmessage/MessageDestructTest.cpp
Kirishikesan/haiku
835565c55830f2dab01e6e332cc7e2d9c015b51e
[ "MIT" ]
350
2015-01-08T14:15:27.000Z
2022-03-21T18:14:35.000Z
//------------------------------------------------------------------------------ // MessageDestructTest.cpp // //------------------------------------------------------------------------------ // Standard Includes ----------------------------------------------------------- // System Includes ------------------------------------------------------------- #include <Looper.h> #include <Message.h> #include <Messenger.h> // Project Includes ------------------------------------------------------------ // Local Includes -------------------------------------------------------------- #include "MessageDestructTest.h" // Local Defines --------------------------------------------------------------- // Globals --------------------------------------------------------------------- //------------------------------------------------------------------------------ /** ~BMessage @case no reply to sent message @results B_NO_REPLY reply is received */ class Looper1 : public BLooper { public: Looper1(const char* name) : BLooper(name) {;} void MessageReceived(BMessage* msg) { switch (msg->what) { case '1234': break; case '2345': msg->SendReply('3456'); break; default: BLooper::MessageReceived(msg); } } }; void TMessageDestructTest::MessageDestructTest1() { BLooper* looper1 = new Looper1("looper1"); looper1->Run(); BMessenger msgr(NULL, looper1); BMessage reply; CPPUNIT_ASSERT(msgr.SendMessage('1234', &reply) == B_OK); CPPUNIT_ASSERT(reply.what == B_NO_REPLY); looper1->Lock(); looper1->Quit(); } //------------------------------------------------------------------------------ /** ~BMessage @case Reply is sent to message @result No B_NO_REPLY reply is sent */ void TMessageDestructTest::MessageDestructTest2() { BLooper* looper1 = new Looper1("looper1"); looper1->Run(); BMessenger msgr(NULL, looper1); BMessage reply; CPPUNIT_ASSERT(msgr.SendMessage('2345', &reply) == B_OK); CPPUNIT_ASSERT(reply.what == '3456'); looper1->Lock(); looper1->Quit(); } //------------------------------------------------------------------------------ TestSuite* TMessageDestructTest::Suite() { TestSuite* suite = new TestSuite("BMessage::~BMessage()"); ADD_TEST4(BMessage, suite, TMessageDestructTest, MessageDestructTest1); ADD_TEST4(BMessage, suite, TMessageDestructTest, MessageDestructTest2); return suite; } //------------------------------------------------------------------------------ /* * $Log $ * * $Id $ * */
24.891089
80
0.447892
Kirishikesan
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
82801a1c321161b83a821836a9061f6801fbdb29
3,634
cpp
C++
Borland/CBuilder5/Source/MFC/dlgclr.cpp
TrevorDArcyEvans/DivingMagpieSoftware
7ffcfef653b110e514d5db735d11be0aae9953ec
[ "MIT" ]
1
2021-05-27T10:27:25.000Z
2021-05-27T10:27:25.000Z
Borland/CBuilder5/Source/MFC/dlgclr.cpp
TrevorDArcyEvans/Diving-Magpie-Software
7ffcfef653b110e514d5db735d11be0aae9953ec
[ "MIT" ]
null
null
null
Borland/CBuilder5/Source/MFC/dlgclr.cpp
TrevorDArcyEvans/Diving-Magpie-Software
7ffcfef653b110e514d5db735d11be0aae9953ec
[ "MIT" ]
null
null
null
// This is a part of the Microsoft Foundation Classes C++ library. // Copyright (C) 1992-1998 Microsoft Corporation // All rights reserved. // // This source code is only intended as a supplement to the // Microsoft Foundation Classes Reference and related // electronic documentation provided with the library. // See these sources for detailed information regarding the // Microsoft Foundation Classes product. #include "stdafx.h" #ifdef AFX_AUX_SEG #pragma code_seg(AFX_AUX_SEG) #endif #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif #define new DEBUG_NEW ///////////////////////////////////////////////////////////////////////////// // Choose Color dialog class _AFX_COLOR_STATE : public CNoTrackObject { public: // custom colors are held here and saved between calls COLORREF m_crSavedCustom[16]; _AFX_COLOR_STATE(); }; _AFX_COLOR_STATE::_AFX_COLOR_STATE() { // custom colors are initialized to white for (int i = 0; i < _countof(m_crSavedCustom); i++) m_crSavedCustom[i] = RGB(255, 255, 255); } #ifndef _AFX_NO_GRAYDLG_SUPPORT BEGIN_MESSAGE_MAP(CColorDialog, CCommonDialog) //{{AFX_MSG_MAP(CColorDialog) ON_WM_CTLCOLOR() //}}AFX_MSG_MAP END_MESSAGE_MAP() #endif //!_AFX_NO_GRAYDLG_SUPPORT EXTERN_PROCESS_LOCAL(_AFX_COLOR_STATE, _afxClrState) CColorDialog::CColorDialog(COLORREF clrInit, DWORD dwFlags, CWnd* pParentWnd) : CCommonDialog(pParentWnd) { memset(&m_cc, 0, sizeof(m_cc)); m_nIDHelp = AFX_IDD_COLOR; m_cc.lStructSize = sizeof(m_cc); m_cc.lpCustColors = GetSavedCustomColors(); m_cc.Flags = dwFlags | CC_ENABLEHOOK; if (!afxData.bWin4 && AfxHelpEnabled()) m_cc.Flags |= CC_SHOWHELP; m_cc.lpfnHook = (COMMDLGPROC)_AfxCommDlgProc; if ((m_cc.rgbResult = clrInit) != 0) m_cc.Flags |= CC_RGBINIT; } int CColorDialog::DoModal() { ASSERT_VALID(this); ASSERT(m_cc.Flags & CC_ENABLEHOOK); ASSERT(m_cc.lpfnHook != NULL); // can still be a user hook m_cc.hwndOwner = PreModal(); int nResult = ::ChooseColor(&m_cc); PostModal(); return nResult ? nResult : IDCANCEL; } BOOL CColorDialog::OnColorOK() { ASSERT_VALID(this); // Do not call Default() if you override return FALSE; } void CColorDialog::SetCurrentColor(COLORREF clr) { ASSERT_VALID(this); ASSERT(m_hWnd != NULL); SendMessage(_afxMsgSETRGB, 0, (DWORD)clr); } COLORREF* PASCAL CColorDialog::GetSavedCustomColors() { return &_afxClrState->m_crSavedCustom[0]; } // The color tracker in the COMMDLG.DLL can't handle gray backgrounds, // so we force the default with this override. #ifndef _AFX_NO_GRAYDLG_SUPPORT HBRUSH CColorDialog::OnCtlColor(CDC*, CWnd*, UINT) { return (HBRUSH)Default(); } #endif //!_AFX_NO_GRAYDLG_SUPPORT //////////////////////////////////////////////////////////////////////////// // CColorDialog diagnostics #ifdef _DEBUG void CColorDialog::Dump(CDumpContext& dc) const { CDialog::Dump(dc); dc << "m_cc.hwndOwner = " << (UINT)m_cc.hwndOwner; dc << "\nm_cc.rgbResult = " << (LPVOID)m_cc.rgbResult; dc << "\nm_cc.Flags = " << (LPVOID)m_cc.Flags; dc << "\nm_cc.lpCustColors "; for (int iClr = 0; iClr < 16; iClr++) dc << "\n\t" << (LPVOID)m_cc.lpCustColors[iClr]; if (m_cc.lpfnHook == (COMMDLGPROC)_AfxCommDlgProc) dc << "\nhook function set to standard MFC hook function"; else dc << "\nhook function set to non-standard hook function"; dc << "\n"; } #endif //_DEBUG #ifdef AFX_INIT_SEG #pragma code_seg(AFX_INIT_SEG) #endif IMPLEMENT_DYNAMIC(CColorDialog, CDialog) #pragma warning(disable: 4074) #pragma init_seg(lib) PROCESS_LOCAL(_AFX_COLOR_STATE, _afxClrState) ////////////////////////////////////////////////////////////////////////////
24.389262
77
0.6918
TrevorDArcyEvans
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
828979a264b2981b35a5f3161dc6bcc7b496cbd7
230
cpp
C++
code/mapgenerator/src/SurfaceProperties.cpp
Estevo-Aleixo/dynamicstructures
89992427e2d2029c1a3b83c0c2a1d97b6f1ea86b
[ "ClArtistic" ]
null
null
null
code/mapgenerator/src/SurfaceProperties.cpp
Estevo-Aleixo/dynamicstructures
89992427e2d2029c1a3b83c0c2a1d97b6f1ea86b
[ "ClArtistic" ]
null
null
null
code/mapgenerator/src/SurfaceProperties.cpp
Estevo-Aleixo/dynamicstructures
89992427e2d2029c1a3b83c0c2a1d97b6f1ea86b
[ "ClArtistic" ]
null
null
null
#include "SurfaceProperties.h" SurfaceProperties::SurfaceProperties(void) { mCellSize= 10.0; mType= CELLTYPE::HEXAGON; this->mCellProperties= CellProperties(); } SurfaceProperties::~SurfaceProperties(void) { }
17.692308
44
0.721739
Estevo-Aleixo
828c6a2dc1a6a60d10aeaf6b973a67d500c1a099
250
hpp
C++
src/common/pixel.hpp
quentinguidee/lib-image-cxx
44f4d2d7fdeeb7ed21f6d66760456f5f4fc16157
[ "MIT" ]
5
2022-01-20T17:46:06.000Z
2022-01-21T16:59:39.000Z
src/common/pixel.hpp
quentinguidee/lib-image-cxx
44f4d2d7fdeeb7ed21f6d66760456f5f4fc16157
[ "MIT" ]
2
2022-01-26T09:46:10.000Z
2022-02-24T10:55:37.000Z
src/common/pixel.hpp
quentinguidee/lib-image-cxx
44f4d2d7fdeeb7ed21f6d66760456f5f4fc16157
[ "MIT" ]
1
2022-01-23T10:51:19.000Z
2022-01-23T10:51:19.000Z
#pragma once #include <cstdint> #include <vector> struct Pixel { uint8_t r, g, b, a; Pixel(uint8_t r = 0, uint8_t g = 0, uint8_t b = 0, uint8_t a = 255); bool operator==(const Pixel& rhs) const; }; typedef std::vector<Pixel> Pixels;
15.625
72
0.636
quentinguidee
828ea09d631aab739bc56fd01df70a4db7a8d59d
16,311
cc
C++
PhysicsTools/NanoAOD/plugins/BJetEnergyRegressionVarProducer.cc
nistefan/cmssw
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
[ "Apache-2.0" ]
3
2018-08-24T19:10:26.000Z
2019-02-19T11:45:32.000Z
PhysicsTools/NanoAOD/plugins/BJetEnergyRegressionVarProducer.cc
nistefan/cmssw
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
[ "Apache-2.0" ]
3
2018-08-23T13:40:24.000Z
2019-12-05T21:16:03.000Z
PhysicsTools/NanoAOD/plugins/BJetEnergyRegressionVarProducer.cc
nistefan/cmssw
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
[ "Apache-2.0" ]
5
2018-08-21T16:37:52.000Z
2020-01-09T13:33:17.000Z
// -*- C++ -*- // // Package: PhysicsTools/NanoAOD // Class: BJetEnergyRegressionVarProducer // /**\class BJetEnergyRegressionVarProducer BJetEnergyRegressionVarProducer.cc PhysicsTools/NanoAOD/plugins/BJetEnergyRegressionVarProducer.cc Description: [one line class summary] Implementation: [Notes on implementation] */ // // Original Author: Marco Peruzzi // Created: Tue, 05 Sep 2017 12:24:38 GMT // // // system include files #include <memory> // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/StreamID.h" #include "DataFormats/Math/interface/deltaR.h" #include "DataFormats/PatCandidates/interface/Muon.h" #include "DataFormats/PatCandidates/interface/Electron.h" #include "DataFormats/PatCandidates/interface/Jet.h" #include "DataFormats/VertexReco/interface/Vertex.h" #include "DataFormats/Candidate/interface/VertexCompositePtrCandidate.h" #include "RecoVertex/VertexTools/interface/VertexDistance3D.h" #include "RecoVertex/VertexPrimitives/interface/ConvertToFromReco.h" #include "RecoVertex/VertexPrimitives/interface/VertexState.h" #include <vector> // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/StreamID.h" #include "DataFormats/PatCandidates/interface/Muon.h" #include "DataFormats/PatCandidates/interface/Jet.h" #include "DataFormats/PatCandidates/interface/Electron.h" #include "DataFormats/VertexReco/interface/Vertex.h" #include "DataFormats/Common/interface/View.h" #include "DataFormats/Candidate/interface/VertexCompositePtrCandidate.h" #include "DataFormats/HepMCCandidate/interface/GenParticle.h" #include "PhysicsTools/NanoAOD/interface/MatchingUtils.h" // // class declaration // template <typename T> class BJetEnergyRegressionVarProducer : public edm::global::EDProducer<> { public: explicit BJetEnergyRegressionVarProducer(const edm::ParameterSet &iConfig): srcJet_(consumes<edm::View<pat::Jet>>(iConfig.getParameter<edm::InputTag>("src"))), srcVtx_(consumes<std::vector<reco::Vertex>>(iConfig.getParameter<edm::InputTag>("pvsrc"))), srcSV_(consumes<edm::View<reco::VertexCompositePtrCandidate>>(iConfig.getParameter<edm::InputTag>("svsrc"))), srcGP_(consumes<std::vector<reco::GenParticle>>(iConfig.getParameter<edm::InputTag>("gpsrc"))) { //un prodotto da copiare produces<edm::ValueMap<float>>("leptonPtRel"); produces<edm::ValueMap<float>>("leptonPtRatio"); produces<edm::ValueMap<float>>("leptonPtRelInv");//wrong variable? produces<edm::ValueMap<float>>("leptonPtRelv0"); produces<edm::ValueMap<float>>("leptonPtRatiov0"); produces<edm::ValueMap<float>>("leptonPtRelInvv0");//v0 ~ heppy? produces<edm::ValueMap<float>>("leptonPt"); produces<edm::ValueMap<int>>("leptonPdgId"); produces<edm::ValueMap<float>>("leptonDeltaR"); produces<edm::ValueMap<float>>("leadTrackPt"); produces<edm::ValueMap<float>>("vtxPt"); produces<edm::ValueMap<float>>("vtxMass"); produces<edm::ValueMap<float>>("vtx3dL"); produces<edm::ValueMap<float>>("vtx3deL"); produces<edm::ValueMap<int>>("vtxNtrk"); produces<edm::ValueMap<float>>("ptD"); produces<edm::ValueMap<float>>("genPtwNu"); } ~BJetEnergyRegressionVarProducer() override {}; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; std::tuple<float,float,float> calculatePtRatioRel(edm::Ptr<reco::Candidate> lep, edm::Ptr<pat::Jet> jet) const; std::tuple<float,float,float> calculatePtRatioRelSimple(edm::Ptr<reco::Candidate> lep, edm::Ptr<pat::Jet> jet) const; //old version? // ----------member data --------------------------- edm::EDGetTokenT<edm::View<pat::Jet>> srcJet_; edm::EDGetTokenT<std::vector<reco::Vertex>> srcVtx_; edm::EDGetTokenT<edm::View<reco::VertexCompositePtrCandidate>> srcSV_; edm::EDGetTokenT<std::vector<reco::GenParticle>> srcGP_; }; // // constants, enums and typedefs // // // static data member definitions // // // member functions // // ------------ method called to produce the data ------------ template <typename T> void BJetEnergyRegressionVarProducer<T>::produce(edm::StreamID streamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const{ edm::Handle<edm::View<pat::Jet>> srcJet; iEvent.getByToken(srcJet_, srcJet); edm::Handle<std::vector<reco::Vertex>> srcVtx; iEvent.getByToken(srcVtx_, srcVtx); edm::Handle<edm::View<reco::VertexCompositePtrCandidate>> srcSV; iEvent.getByToken(srcSV_, srcSV); edm::Handle<std::vector<reco::GenParticle>> srcGP; iEvent.getByToken(srcGP_, srcGP); unsigned int nJet = srcJet->size(); // unsigned int nLep = srcLep->size(); std::vector<float> leptonPtRel(nJet,0); std::vector<float> leptonPtRatio(nJet,0); std::vector<float> leptonPtRelInv(nJet,0); std::vector<float> leptonPtRel_v0(nJet,0); std::vector<float> leptonPtRatio_v0(nJet,0); std::vector<float> leptonPtRelInv_v0(nJet,0); std::vector<int> leptonPdgId(nJet,0); std::vector<float> leptonPt(nJet,0); std::vector<float> leptonDeltaR(nJet,0); std::vector<float> leadTrackPt(nJet,0); std::vector<float> vtxPt(nJet,0); std::vector<float> vtxMass(nJet,0); std::vector<float> vtx3dL(nJet,0); std::vector<float> vtx3deL(nJet,0); std::vector<int> vtxNtrk(nJet,0); std::vector<float> ptD(nJet,0); std::vector<float> genPtwNu(nJet,0); const auto & pv = (*srcVtx)[0]; for (unsigned int ij = 0; ij<nJet; ij++){ auto jet = srcJet->ptrAt(ij); if (jet->genJet()!=nullptr){ auto genp4 = jet->genJet()->p4(); auto gep4wNu = genp4; for(const auto & gp : *srcGP){ if((abs(gp.pdgId())==12 || abs(gp.pdgId())==14 || abs(gp.pdgId())==16) && gp.status()==1){ if (reco::deltaR( genp4, gp.p4() )<0.4) { // std::cout<<" from "<<gep4wNu.pt()<<std::endl; gep4wNu=gep4wNu+gp.p4(); // std::cout<<" to "<<gep4wNu.pt()<<std::endl; } } } genPtwNu[ij]=gep4wNu.pt(); } float ptMax=0; float sumWeight=0; float sumPt=0; for(const auto & d : jet->daughterPtrVector()){ sumWeight+=(d->pt())*(d->pt()); sumPt+=d->pt(); if(d->pt()>ptMax) ptMax=d->pt();} leadTrackPt[ij]=ptMax; ptD[ij] = (sumWeight > 0 ? sqrt(sumWeight)/sumPt : 0); //lepton properties float maxLepPt = 0; leptonPtRel[ij]=0; for(const auto & d : jet->daughterPtrVector()){ if(abs(d->pdgId())==11 || abs(d->pdgId())==13){ if(d->pt()<maxLepPt) continue; auto res = calculatePtRatioRel(d,jet); leptonPtRatio[ij] = std::get<0>(res); leptonPtRel[ij] = std::get<1>(res); leptonPtRelInv[ij] = std::get<2>(res); auto res2 = calculatePtRatioRelSimple(d,jet); leptonPtRatio_v0[ij] = std::get<0>(res2); leptonPtRel_v0[ij] = std::get<1>(res2); leptonPtRelInv_v0[ij] = std::get<2>(res2); leptonPdgId[ij] = d->pdgId(); leptonDeltaR[ij]=reco::deltaR( jet->p4(), d->p4() ); leptonPt[ij] = d->pt(); maxLepPt = d->pt(); } } //Fill vertex properties VertexDistance3D vdist; float maxFoundSignificance=0; vtxPt[ij]=0; vtxMass[ij]=0; vtx3dL[ij]=0; vtx3deL[ij]=0; vtxNtrk[ij]=0; for(const auto &sv: *srcSV){ GlobalVector flightDir(sv.vertex().x() - pv.x(), sv.vertex().y() - pv.y(),sv.vertex().z() - pv.z()); GlobalVector jetDir(jet->px(),jet->py(),jet->pz()); if( reco::deltaR2( flightDir, jetDir ) < 0.09 ){ Measurement1D dl= vdist.distance(pv,VertexState(RecoVertex::convertPos(sv.position()),RecoVertex::convertError(sv.error()))); if(dl.significance() > maxFoundSignificance){ maxFoundSignificance=dl.significance(); vtxPt[ij]=sv.pt(); vtxMass[ij]=sv.p4().M(); vtx3dL[ij]=dl.value(); vtx3deL[ij]=dl.error(); vtxNtrk[ij]=sv.numberOfSourceCandidatePtrs(); } } } } std::unique_ptr<edm::ValueMap<float>> leptonPtRelV(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillerRel(*leptonPtRelV); fillerRel.insert(srcJet,leptonPtRel.begin(),leptonPtRel.end()); fillerRel.fill(); iEvent.put(std::move(leptonPtRelV),"leptonPtRel"); std::unique_ptr<edm::ValueMap<float>> leptonPtRatioV(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillerRatio(*leptonPtRatioV); fillerRatio.insert(srcJet,leptonPtRatio.begin(),leptonPtRatio.end()); fillerRatio.fill(); iEvent.put(std::move(leptonPtRatioV),"leptonPtRatio"); std::unique_ptr<edm::ValueMap<float>> leptonPtRelInvV(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillerRelInv(*leptonPtRelInvV); fillerRelInv.insert(srcJet,leptonPtRelInv.begin(),leptonPtRelInv.end()); fillerRelInv.fill(); iEvent.put(std::move(leptonPtRelInvV),"leptonPtRelInv"); std::unique_ptr<edm::ValueMap<float>> leptonPtRelV_v0(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillerRel_v0(*leptonPtRelV_v0); fillerRel_v0.insert(srcJet,leptonPtRel_v0.begin(),leptonPtRel_v0.end()); fillerRel_v0.fill(); iEvent.put(std::move(leptonPtRelV_v0),"leptonPtRelv0"); std::unique_ptr<edm::ValueMap<float>> leptonPtRatioV_v0(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillerRatio_v0(*leptonPtRatioV_v0); fillerRatio_v0.insert(srcJet,leptonPtRatio_v0.begin(),leptonPtRatio_v0.end()); fillerRatio_v0.fill(); iEvent.put(std::move(leptonPtRatioV_v0),"leptonPtRatiov0"); std::unique_ptr<edm::ValueMap<float>> leptonPtRelInvV_v0(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillerRelInv_v0(*leptonPtRelInvV_v0); fillerRelInv_v0.insert(srcJet,leptonPtRelInv_v0.begin(),leptonPtRelInv_v0.end()); fillerRelInv_v0.fill(); iEvent.put(std::move(leptonPtRelInvV_v0),"leptonPtRelInvv0"); std::unique_ptr<edm::ValueMap<float>> leptonPtV(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillerLpt(*leptonPtV); fillerLpt.insert(srcJet,leptonPt.begin(),leptonPt.end()); fillerLpt.fill(); iEvent.put(std::move(leptonPtV),"leptonPt"); std::unique_ptr<edm::ValueMap<float>> leptonDeltaRV(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillerLdR(*leptonDeltaRV); fillerLdR.insert(srcJet,leptonDeltaR.begin(),leptonDeltaR.end()); fillerLdR.fill(); iEvent.put(std::move(leptonDeltaRV),"leptonDeltaR"); std::unique_ptr<edm::ValueMap<int>> leptonPtPdgIdV(new edm::ValueMap<int>()); edm::ValueMap<int>::Filler fillerId(*leptonPtPdgIdV); fillerId.insert(srcJet,leptonPdgId.begin(),leptonPdgId.end()); fillerId.fill(); iEvent.put(std::move(leptonPtPdgIdV),"leptonPdgId"); std::unique_ptr<edm::ValueMap<float>> leadTrackPtV(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillerLT(*leadTrackPtV); fillerLT.insert(srcJet,leadTrackPt.begin(),leadTrackPt.end()); fillerLT.fill(); iEvent.put(std::move(leadTrackPtV),"leadTrackPt"); std::unique_ptr<edm::ValueMap<float>> vtxPtV(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillerVtxPt(*vtxPtV); fillerVtxPt.insert(srcJet,vtxPt.begin(),vtxPt.end()); fillerVtxPt.fill(); iEvent.put(std::move(vtxPtV),"vtxPt"); std::unique_ptr<edm::ValueMap<float>> vtxMassV(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillerVtxMass(*vtxMassV); fillerVtxMass.insert(srcJet,vtxMass.begin(),vtxMass.end()); fillerVtxMass.fill(); iEvent.put(std::move(vtxMassV),"vtxMass"); std::unique_ptr<edm::ValueMap<float>> vtx3dLV(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillerVtx3dL(*vtx3dLV); fillerVtx3dL.insert(srcJet,vtx3dL.begin(),vtx3dL.end()); fillerVtx3dL.fill(); iEvent.put(std::move(vtx3dLV),"vtx3dL"); std::unique_ptr<edm::ValueMap<float>> vtx3deLV(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillerVtx3deL(*vtx3deLV); fillerVtx3deL.insert(srcJet,vtx3deL.begin(),vtx3deL.end()); fillerVtx3deL.fill(); iEvent.put(std::move(vtx3deLV),"vtx3deL"); std::unique_ptr<edm::ValueMap<int>> vtxNtrkV(new edm::ValueMap<int>()); edm::ValueMap<int>::Filler fillerVtxNT(*vtxNtrkV); fillerVtxNT.insert(srcJet,vtxNtrk.begin(),vtxNtrk.end()); fillerVtxNT.fill(); iEvent.put(std::move(vtxNtrkV),"vtxNtrk"); std::unique_ptr<edm::ValueMap<float>> ptDV(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillerPtD(*ptDV); fillerPtD.insert(srcJet,ptD.begin(),ptD.end()); fillerPtD.fill(); iEvent.put(std::move(ptDV),"ptD"); std::unique_ptr<edm::ValueMap<float>> genptV(new edm::ValueMap<float>()); edm::ValueMap<float>::Filler fillergenpt(*genptV); fillergenpt.insert(srcJet,genPtwNu.begin(),genPtwNu.end()); fillergenpt.fill(); iEvent.put(std::move(genptV),"genPtwNu"); } template <typename T> std::tuple<float,float,float> BJetEnergyRegressionVarProducer<T>::calculatePtRatioRel(edm::Ptr<reco::Candidate> lep, edm::Ptr<pat::Jet> jet) const { auto rawp4 = jet->correctedP4("Uncorrected"); auto lepp4 = lep->p4(); if ((rawp4-lepp4).R()<1e-4) return std::tuple<float,float,float>(1.0,0.0,0.0); auto jetp4 = (rawp4 - lepp4*(1.0/jet->jecFactor("L1FastJet")))*(jet->pt()/rawp4.pt())+lepp4; auto ptratio = lepp4.pt()/jetp4.pt(); auto ptrel = lepp4.Vect().Cross((jetp4-lepp4).Vect().Unit()).R(); auto ptrelinv = (jetp4-lepp4).Vect().Cross((lepp4).Vect().Unit()).R(); return std::tuple<float,float,float>(ptratio,ptrel,ptrelinv); } template <typename T> std::tuple<float,float,float> BJetEnergyRegressionVarProducer<T>::calculatePtRatioRelSimple(edm::Ptr<reco::Candidate> lep, edm::Ptr<pat::Jet> jet) const { auto lepp4 = lep->p4(); auto rawp4 = jet->correctedP4("Uncorrected"); if ((rawp4-lepp4).R()<1e-4) return std::tuple<float,float,float>(1.0,0.0,0.0); auto jetp4 = jet->p4();//(rawp4 - lepp4*(1.0/jet->jecFactor("L1FastJet")))*(jet->pt()/rawp4.pt())+lepp4; auto ptratio = lepp4.pt()/jetp4.pt(); auto ptrel = lepp4.Vect().Cross((jetp4).Vect().Unit()).R(); auto ptrelinv = jetp4.Vect().Cross((lepp4).Vect().Unit()).R(); return std::tuple<float,float,float>(ptratio,ptrel,ptrelinv); } // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ template <typename T> void BJetEnergyRegressionVarProducer<T>::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { //The following says we do not know what parameters are allowed so do no validation // Please change this to state exactly what you do use, even if it is no parameters edm::ParameterSetDescription desc; desc.add<edm::InputTag>("src")->setComment("jet input collection"); // desc.add<edm::InputTag>("musrc")->setComment("muons input collection"); // desc.add<edm::InputTag>("elesrc")->setComment("electrons input collection"); desc.add<edm::InputTag>("pvsrc")->setComment("primary vertex input collection"); desc.add<edm::InputTag>("svsrc")->setComment("secondary vertex input collection"); desc.add<edm::InputTag>("gpsrc")->setComment("genparticles for nu recovery"); std::string modname; if (typeid(T) == typeid(pat::Jet)) modname+="Jet"; modname+="RegressionVarProducer"; descriptions.add(modname,desc); } typedef BJetEnergyRegressionVarProducer<pat::Jet> JetRegressionVarProducer; //define this as a plug-in DEFINE_FWK_MODULE(JetRegressionVarProducer);
37.844548
140
0.67807
nistefan
8290e8fb4796d2edb97191a3752487fca81bbf2d
1,268
cpp
C++
src/platform/gba/checkROM.cpp
httpsgithu/OpenLara
380d1373a346fdbfa97ce475b26f6ddcf0a7f79e
[ "BSD-2-Clause" ]
11
2021-12-31T04:43:29.000Z
2022-03-03T19:27:34.000Z
src/platform/gba/checkROM.cpp
httpsgithu/OpenLara
380d1373a346fdbfa97ce475b26f6ddcf0a7f79e
[ "BSD-2-Clause" ]
1
2022-01-16T20:50:14.000Z
2022-01-18T02:23:25.000Z
src/platform/gba/checkROM.cpp
httpsgithu/OpenLara
380d1373a346fdbfa97ce475b26f6ddcf0a7f79e
[ "BSD-2-Clause" ]
1
2022-02-12T14:52:12.000Z
2022-02-12T14:52:12.000Z
#include <tonc.h> #define MEM_CHECK_MAGIC 14021968 #define MEM_CHECK_SIZE 16 const int ROM_MAGIC[MEM_CHECK_SIZE] = { MEM_CHECK_MAGIC + 0, MEM_CHECK_MAGIC + 1, MEM_CHECK_MAGIC + 2, MEM_CHECK_MAGIC + 3, MEM_CHECK_MAGIC + 4, MEM_CHECK_MAGIC + 5, MEM_CHECK_MAGIC + 6, MEM_CHECK_MAGIC + 7, MEM_CHECK_MAGIC + 8, MEM_CHECK_MAGIC + 9, MEM_CHECK_MAGIC + 10, MEM_CHECK_MAGIC + 11, MEM_CHECK_MAGIC + 12, MEM_CHECK_MAGIC + 13, MEM_CHECK_MAGIC + 14, MEM_CHECK_MAGIC + 15, }; EWRAM_CODE bool checkROM(unsigned int mask) { REG_WSCNT = mask; // check sequential read (S) for (int i = 0; i < MEM_CHECK_SIZE; i++) { if (*(volatile int*)&ROM_MAGIC[i] != (MEM_CHECK_MAGIC + i)) { REG_WSCNT = WS_ROM0_N4 | WS_ROM0_S2 | WS_PREFETCH; return false; } } // check non-sequential read (N) for (int i = 0, j = MEM_CHECK_SIZE - 1; i < MEM_CHECK_SIZE; i++, j--) { bool L = *(volatile int*)&ROM_MAGIC[i] == (MEM_CHECK_MAGIC + i); bool R = *(volatile int*)&ROM_MAGIC[j] == (MEM_CHECK_MAGIC + j); if (L && R) continue; REG_WSCNT = WS_ROM0_N4 | WS_ROM0_S2 | WS_PREFETCH; return false; } return true; }
24.384615
73
0.600158
httpsgithu
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
8299484a496014f2b59568cf3d40e850aaa5f300
5,529
hpp
C++
Bevprog/cpp/graphics_src/graphics.hpp
varpeti/Suli
f0309306ed65454f70fbd67c8084aa2c2e085296
[ "Unlicense" ]
1
2020-10-21T09:54:22.000Z
2020-10-21T09:54:22.000Z
Bevprog/cpp/graphics_src/graphics.hpp
varpeti/Suli2
6cd0c98e5d725846116aa29936314e113ae7923e
[ "Unlicense" ]
null
null
null
Bevprog/cpp/graphics_src/graphics.hpp
varpeti/Suli2
6cd0c98e5d725846116aa29936314e113ae7923e
[ "Unlicense" ]
null
null
null
#ifndef GRAPHICS_HPP_INCLUDED #define GRAPHICS_HPP_INCLUDED #include <string> struct SDL_Surface; struct _TTF_Font; namespace genv { /*********** Graphical output device definition ***********/ class canvas { public: canvas(); virtual ~canvas(); canvas(int w, int h); bool open(unsigned width, unsigned height); bool save(const std::string& file) const; void transparent(bool t) {transp=t;} void set_color(int r, int g, int b); bool move_point(int x, int y); void draw_dot(); void draw_line(int x, int y); void draw_box(int x, int y); void draw_text(const std::string& str); void blitfrom(const canvas &c,int x1,int y1, int x2, int y2, int x3, int y3); bool load_font(const std::string& fname, int fontsize = 16, bool antialias=true); void set_antialias(bool antialias) {antialiastext=antialias;} int x() const { return pt_x; } int y() const { return pt_y; } int cascent() const; int cdescent() const; int twidth(const std::string& s) const; virtual void refresh() {} template <typename T> inline void call_with_rel(T meth, int vec_x, int vec_y) { if (vec_x || vec_y) { int dx=vec_x-sgn(vec_x); int dy=vec_y-sgn(vec_y); (this->*meth)(dx, dy); } } protected: template <typename T> inline int sgn(const T& a) { if (a<0) return -1; if (a>0) return 1; return 0; } int pt_x; int pt_y; SDL_Surface* buf; int draw_clr; bool transp; _TTF_Font* font; bool antialiastext; }; // Class of output device (singleton) class groutput : public canvas { public: static groutput& instance(); virtual ~groutput(); void showmouse(bool toggle); void movemouse(int x, int y); bool open(unsigned width, unsigned height, bool fullscreen=false); virtual void refresh(); private: groutput(); }; // Global accessor for the output device instance extern groutput& gout; // Generic operator for applying global manipulators template <typename Op> inline canvas& operator << (canvas& out, Op oper) { oper(out); return out; } // Global manipulators for frequently used operations inline void refresh(canvas& out) { out.refresh(); } inline void dot(canvas& out) { out.draw_dot(); } struct stamp { canvas &c; int x1,y1,x2,y2,x3,y3; stamp(canvas&cc, int sx1, int sy1, int xsize, int ysize, int tx1, int ty1) : c(cc), x1(sx1), y1(sy1),x2(xsize), y2(ysize), x3(tx1), y3(ty1) {} stamp(canvas&cc, int tx1, int ty1) : c(cc), x1(-1), y1(-1),x2(-1), y2(-1), x3(tx1), y3(ty1) {} void operator () (canvas& out) { out.blitfrom(c,x1,y1,x2,y2,x3,y3); } }; struct color { int red, green, blue; color(int r, int g, int b) : red(r), green(g), blue(b) {} void operator () (canvas& out) { out.set_color(red, green, blue); } }; struct move { int vec_x, vec_y; move(int x, int y) : vec_x(x), vec_y(y) {} void operator () (canvas& out) { out.call_with_rel(&canvas::move_point,vec_x, vec_y); } }; struct move_to { int pos_x, pos_y; move_to(unsigned x, unsigned y) : pos_x(x), pos_y(y) {} void operator () (canvas& out) { out.move_point(pos_x - out.x(), pos_y - out.y()); } }; struct line { int vec_x, vec_y; line(int x, int y) : vec_x(x), vec_y(y) {} void operator () (canvas& out) { out.call_with_rel(&canvas::draw_line,vec_x, vec_y); } }; struct line_to { int pos_x, pos_y; line_to(unsigned x, unsigned y) : pos_x(x), pos_y(y) {} void operator () (canvas& out) { out.draw_line(pos_x - out.x(), pos_y - out.y()); } }; struct box { int vec_x, vec_y; box(int x, int y) : vec_x(x), vec_y(y) {} void operator () (canvas& out) { out.call_with_rel(&canvas::draw_box, vec_x, vec_y); } }; struct box_to { int pos_x, pos_y; box_to(unsigned x, unsigned y) : pos_x(x), pos_y(y) {} void operator () (canvas& out) { out.draw_box(pos_x - out.x(), pos_y - out.y()); } }; struct text { std::string str; text(const std::string& s) : str(s) {} text(char c) : str(1, c) {} void operator () (canvas& out) { out.draw_text(str); } }; /*********** Input device definition **********/ // Keycode constants enum keycode_t { key_tab = '\t', key_backspace = '\b', key_enter = '\r', key_escape = '\033', key_space = ' ', key_up = 0x10000, key_down, key_right, key_left, key_insert, key_delete, key_home, key_end, key_pgup, key_pgdn, key_lshift, key_rshift, key_lctrl, key_rctrl, key_lalt, key_ralt, key_lwin, key_rwin, key_menu, key_numl, key_capsl, key_scrl, key_f0 = 0x20000, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_f13, key_f14, key_f15 }; enum button_t { btn_left = 1, btn_middle, btn_right, btn_wheelup, btn_wheeldown }; enum event_type { ev_key = 1, ev_mouse, ev_timer }; // Event descriptor struct event { int keycode; int pos_x, pos_y; int button; int time; int type; }; // Class of input device (singleton) class grinput { public: static grinput& instance(); grinput& wait_event(event&); void timer(int wait); operator const void*() const { if (quit) return 0; else return this; } private: grinput() : quit(false) {} bool quit; }; // Global accessor for the input device instance extern grinput& gin; // Event reader operator inline grinput& operator >> (grinput& inp, event& ev) { return inp.wait_event(ev); } } #endif // GRAPHICS_HPP_INCLUDED
22.941909
86
0.630855
varpeti
82995b9fdd4d855da25fc767e70e9f1a3124346e
135,732
cpp
C++
texture.cpp
graphitemaster/neothyne
101dd7f96e5c62e32e797105d9fb23f975986626
[ "MIT" ]
77
2015-02-07T09:08:35.000Z
2022-03-29T11:36:25.000Z
texture.cpp
graphitemaster/neothyne
101dd7f96e5c62e32e797105d9fb23f975986626
[ "MIT" ]
45
2015-02-23T07:24:27.000Z
2017-01-05T13:39:34.000Z
texture.cpp
graphitemaster/neothyne
101dd7f96e5c62e32e797105d9fb23f975986626
[ "MIT" ]
20
2015-01-03T16:46:25.000Z
2021-09-16T02:44:56.000Z
#include "engine.h" #include "texture.h" #include "c_variable.h" #include "u_zlib.h" #include "u_file.h" #include "u_algorithm.h" #include "u_misc.h" #include "u_traits.h" #include "u_log.h" #include "m_const.h" #include "m_trig.h" #include "m_vec.h" // To render text into textures we use an 8x8 bitmap font static const uint64_t kFont[128] = { 0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000, 0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000, 0x7E7E7E7E7E7E0000,0x0000000000000000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000, 0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000, 0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000, 0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000, 0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000, 0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000,0x7E7E7E7E7E7E0000, 0x0000000000000000,0x0808080800080000,0x2828000000000000,0x00287C287C280000, 0x081E281C0A3C0800,0x6094681629060000,0x1C20201926190000,0x0808000000000000, 0x0810202010080000,0x1008040408100000,0x2A1C3E1C2A000000,0x0008083E08080000, 0x0000000000081000,0x0000003C00000000,0x0000000000080000,0x0204081020400000, 0x1824424224180000,0x08180808081C0000,0x3C420418207E0000,0x3C420418423C0000, 0x081828487C080000,0x7E407C02423C0000,0x3C407C42423C0000,0x7E04081020400000, 0x3C423C42423C0000,0x3C42423E023C0000,0x0000080000080000,0x0000080000081000, 0x0006186018060000,0x00007E007E000000,0x0060180618600000,0x3844041800100000, 0x003C449C945C201C,0x1818243C42420000,0x7844784444780000,0x3844808044380000, 0x7844444444780000,0x7C407840407C0000,0x7C40784040400000,0x3844809C44380000, 0x42427E4242420000,0x3E080808083E0000,0x1C04040444380000,0x4448507048440000, 0x40404040407E0000,0x4163554941410000,0x4262524A46420000,0x1C222222221C0000, 0x7844784040400000,0x1C222222221C0200,0x7844785048440000,0x1C22100C221C0000, 0x7F08080808080000,0x42424242423C0000,0x8142422424180000,0x4141495563410000, 0x4224181824420000,0x4122140808080000,0x7E040810207E0000,0x3820202020380000, 0x4020100804020000,0x3808080808380000,0x1028000000000000,0x00000000007E0000, 0x1008000000000000,0x003C023E463A0000,0x40407C42625C0000,0x00001C20201C0000, 0x02023E42463A0000,0x003C427E403C0000,0x0018103810100000,0x0000344C44340438, 0x2020382424240000,0x0800080808080000,0x0800180808080870,0x20202428302C0000, 0x1010101010180000,0x0000665A42420000,0x00002E3222220000,0x00003C42423C0000, 0x00005C62427C4040,0x00003A46423E0202,0x00002C3220200000,0x001C201804380000, 0x00103C1010180000,0x00002222261A0000,0x0000424224180000,0x000081815A660000, 0x0000422418660000,0x0000422214081060,0x00003C08103C0000,0x1C103030101C0000, 0x0808080808080800,0x38080C0C08380000,0x000000324C000000,0x7E7E7E7E7E7E0000 }; VAR(int, tex_jpg_chroma, "chroma filtering method", 0, 1, 0); VAR(int, tex_jpg_cliplut, "clipping lookup table", 0, 1, 1); VAR(int, tex_tga_compress, "compress TGA", 0, 1, 1); VAR(int, tex_png_compress_quality, "compression quality for PNG", 5, 128, 16); VAR(int, tex_jpg_compress_quality, "compression quality for JPG", 1, 100, 90); #define returnResult(E) \ do { \ m_error = (E); \ return; \ } while (0) struct Decoder { Decoder() : m_error(kSuccess) , m_format(kTexFormatLuminance) , m_width(0) , m_height(0) , m_pitch(0) , m_bpp(0) , m_mips(0) { } enum Result { kSuccess, kInvalid, kUnsupported, kInternalError, kMalformatted, kFinished, }; const char *error() const { switch (m_error) { case kSuccess: return "success"; case kInvalid: return "invalid"; case kUnsupported: return "unsupported"; case kMalformatted: return "malformatted"; default: break; } return "internal error"; } size_t width() const { return m_width; } size_t height() const { return m_height; } size_t pitch() const { return m_pitch; } size_t bpp() const { return m_bpp; } size_t mips() const { return m_mips; } TextureFormat format() const { return m_format; } Result status() const { return m_error; } protected: Result m_error; TextureFormat m_format; size_t m_width; size_t m_height; size_t m_pitch; size_t m_bpp; size_t m_mips; }; /// /// Baseline JPEG decoder /// * Doesn't support progressive or lossless JPEG /// * Doesn't support CMYK, RGB, or any other color-space jpeg, only supports /// 8-bit greyscale or YCbCr. /// /// * Supports chroma subsampling ratio (any POT) /// * Supports restart markers /// /// Decoder itself decodes to either 8-bit greyscale compatible with GL_LUMINANCE8 /// or 24-bit RGB compatible with GL_RGB8. /// struct JPGDecoder : Decoder { static constexpr const char *kMagic = "\xFF\xD8\xFF"; static bool test(const u::vector<unsigned char> &data) { return memcmp(&data[0], kMagic, 3) == 0; } enum ChromaFilter { kBicubic, kPixelRepetition }; JPGDecoder(const u::vector<unsigned char> &data) : m_rstinterval(0) , m_size(0) , m_length(0) , m_mbwidth(0) , m_mbheight(0) , m_mbsizex(0) , m_mbsizey(0) , m_buf(0) , m_bufbits(0) , m_exifLittleEndian(false) , m_coSitedChroma(false) { memset(m_comp, 0, sizeof m_comp); memset(m_vlctab, 0, sizeof m_vlctab); memset(m_qtab, 0, sizeof m_qtab); memset(m_block, 0, sizeof m_block); const ChromaFilter filter = ChromaFilter(tex_jpg_chroma.get()); if (tex_jpg_cliplut.get()) decode<true>(data, filter); else decode<false>(data, filter); switch (m_bpp) { case 1: m_format = kTexFormatLuminance; break; case 3: m_format = kTexFormatRGB; break; case 4: m_format = kTexFormatRGBA; break; default: U_UNREACHABLE(); break; } m_pitch = m_bpp * m_width; } u::vector<unsigned char> data() { if (m_bpp == 1) return u::move(m_comp[0].pixels); return u::move(m_rgb); } private: struct VLCCode { unsigned char bits; unsigned char code; }; struct Component { int cid; int ssx; int ssy; size_t width; size_t height; size_t stride; size_t qtsel; size_t actabsel; size_t dctabsel; size_t dcpred; u::vector<unsigned char> pixels; }; // Separable 2D integer inverse discrete cosine transform // // Input coefficients are assumed to have been multiplied by the appropriate // quantization table. Fixed point computation is used with the number of // bits for the fractional component varying over the intermediate stages. // // For more information on the algorithm, see Z. Wang, "Fast algorithms for // the discrete W transform and the discrete Fourier transform", IEEE Trans. // ASSP, Vol. ASSP- 32, pp. 803-816, Aug. 1984. // // 32-bit integer arithmetic (8-bit coefficients) // Instructions per DCT: // - 11 muls // - 37 adds (if clipping /w branching) // - 29 adds (if clipping /w table) // - 12 branches (if clipping /w table) // - 28 branches (if clipping /w branching) unsigned char clip(const int x) { return (x < 0) ? 0 : ((x > 0xFF) ? 0xFF : (unsigned char)x); } // 2KB clipping table, fits in L1 cache. // operator()(x) is functionally equivalent to clip(x) above static struct IDCTClippingTable { IDCTClippingTable() : read(table + 512) { for (int i = -512; i < 512; i++) read[i] = m::clamp(i, -256, 255); read += 128; } unsigned char operator()(int index) const { return read[index]; } int16_t table[1024]; int16_t *read; } gIDCTClippingTable; // 13-bit fixed point representation of trigonometric constants static constexpr int kW1 = 2841; // 2048*sqrt(2)*cos(1*pi/16) static constexpr int kW2 = 2676; // 2048*sqrt(2)*cos(2*pi/16) static constexpr int kW3 = 2408; // 2048*sqrt(2)*cos(3*pi/16) static constexpr int kW5 = 1609; // 2048*sqrt(2)*cos(5*pi/16) static constexpr int kW6 = 1108; // 2048*sqrt(2)*cos(6*pi/16) static constexpr int kW7 = 565; // 2048*sqrt(2)*cos(7*pi/16) // portable signed left shift #define sls(X, Y) (int)((unsigned int)(X) << (Y)) // row (horizontal) IDCT // // 7 pi i // dst[k] = sum c[i] * src[i] * cos ( -- * ( k + - ) * i ) // i=0 8 2 // // where: c[0] = 128 // c[1..7] = 128*sqrt(2) void rowIDCT(int *U_RESTRICT blk) { int x0, x1, x2, x3, x4, x5, x6, x7, x8; // if all the AC components are zero, the IDCT is trivial. if (!((x1 = sls(blk[4], 11)) | (x2 = blk[6]) | (x3 = blk[2]) | (x4 = blk[1]) | (x5 = blk[7]) | (x6 = blk[5]) | (x7 = blk[3]))) { // short circuit the 1D DCT if the DC component is non-zero int value = sls(blk[0], 3); for (size_t i = 0; i < 8; i++) blk[i] = value; return; } // for proper rounding in fourth stage x0 = sls(blk[0], 11) + 128; // first stage (prescale) x8 = kW7 * (x4 + x5); x4 = x8 + (kW1 - kW7) * x4; x5 = x8 - (kW1 + kW7) * x5; x8 = kW3 * (x6 + x7); x6 = x8 - (kW3 - kW5) * x6; x7 = x8 - (kW3 + kW5) * x7; // second stage x8 = x0 + x1; x0 -= x1; x1 = kW6 * (x3 + x2); x2 = x1 - (kW2 + kW6) * x2; x3 = x1 + (kW2 - kW6) * x3; x1 = x4 + x6; x4 -= x6; x6 = x5 + x7; x5 -= x7; // third stage x7 = x8 + x3; x8 -= x3; x3 = x0 + x2; x0 -= x2; x2 = (181 * (x4 + x5) + 128) >> 8; // (256/sqrt(2) * <clip>) / 256 x4 = (181 * (x4 - x5) + 128) >> 8; // (256/sqrt(2) * <clip>) / 256 // fourth stage blk[0] = (x7 + x1) >> 8; blk[1] = (x3 + x2) >> 8; blk[2] = (x0 + x4) >> 8; blk[3] = (x8 + x6) >> 8; blk[4] = (x8 - x6) >> 8; blk[5] = (x0 - x4) >> 8; blk[6] = (x3 - x2) >> 8; blk[7] = (x7 - x1) >> 8; } // column (vertical) IDCT // // 7 pi i // dst[8*k] = sum c[i] * src[8*i] * cos( -- * ( k + - ) * i ) // i=0 8 2 // where: c[0] = 1/1024 // c[1..7] = (1/1024)*sqrt(2) template <bool ClippingTable> void columnIDCT(const int *U_RESTRICT blk, unsigned char *U_RESTRICT out, int stride) { int x0, x1, x2, x3, x4, x5, x6, x7, x8; // if all AC components are zero, then IDCT is trival. if (!((x1 = sls(blk[8*4], 8)) | (x2 = blk[8*6]) | (x3 = blk[8*2]) | (x4 = blk[8*1]) | (x5 = blk[8*7]) | (x6 = blk[8*5]) | (x7 = blk[8*3]))) { // short circuit the 1D DCT if the DC component is non-zero x1 = clip(((blk[0] + 32) >> 6) + 128); // descale for (x0 = 8; x0; --x0) { *out = (unsigned char)x1; out += stride; } return; } // for proper rounding in fourth stage x0 = sls(blk[0], 8) + 8192; // first stage (prescale) x8 = kW7 * (x4 + x5) + 4; x4 = (x8 + (kW1 - kW7) * x4) >> 3; x5 = (x8 - (kW1 + kW7) * x5) >> 3; x8 = kW3 * (x6 + x7) + 4; x6 = (x8 - (kW3 - kW5) * x6) >> 3; x7 = (x8 - (kW3 + kW5) * x7) >> 3; // second stage x8 = x0 + x1; x0 -= x1; x1 = kW6 * (x3 + x2) + 4; x2 = (x1 - (kW2 + kW6) * x2) >> 3; x3 = (x1 + (kW2 - kW6) * x3) >> 3; x1 = x4 + x6; x4 -= x6; x6 = x5 + x7; x5 -= x7; // third stage x7 = x8 + x3; x8 -= x3; x3 = x0 + x2; x0 -= x2; x2 = (181 * (x4 + x5) + 128) >> 8; // (256/sqrt(2) * <clip>) / 256 x4 = (181 * (x4 - x5) + 128) >> 8; // (256/sqrt(2) * <clip>) / 256 // forth stage if (ClippingTable) { *out = gIDCTClippingTable((x7 + x1) >> 14); out += stride; *out = gIDCTClippingTable((x3 + x2) >> 14); out += stride; *out = gIDCTClippingTable((x0 + x4) >> 14); out += stride; *out = gIDCTClippingTable((x8 + x6) >> 14); out += stride; *out = gIDCTClippingTable((x8 - x6) >> 14); out += stride; *out = gIDCTClippingTable((x0 - x4) >> 14); out += stride; *out = gIDCTClippingTable((x3 - x2) >> 14); out += stride; *out = gIDCTClippingTable((x7 - x1) >> 14); } else { *out = clip(((x7 + x1) >> 14) + 128); out += stride; *out = clip(((x3 + x2) >> 14) + 128); out += stride; *out = clip(((x0 + x4) >> 14) + 128); out += stride; *out = clip(((x8 + x6) >> 14) + 128); out += stride; *out = clip(((x8 - x6) >> 14) + 128); out += stride; *out = clip(((x0 - x4) >> 14) + 128); out += stride; *out = clip(((x3 - x2) >> 14) + 128); out += stride; *out = clip(((x7 - x1) >> 14) + 128); } } int viewBits(int bits) { unsigned char newbyte; if (!bits) return 0; while (m_bufbits < bits) { if (m_size <= 0) { m_buf = sls(m_buf, 8) | 0xFF; m_bufbits += 8; continue; } newbyte = *m_position++; m_size--; m_bufbits += 8; m_buf = sls(m_buf, 8) | newbyte; if (newbyte == 0xFF) { if (m_size) { const unsigned char marker = *m_position++; m_size--; switch (marker) { case 0: break; case 0xD9: m_size = 0; break; default: if ((marker & 0xF8) != 0xD0) m_error = kMalformatted; else { m_buf = sls(m_buf, 8) | marker; m_bufbits += 8; } } } else m_error = kMalformatted; } } return (m_buf >> (m_bufbits - bits)) & ((1 << bits) - 1); } void skipBits(int bits) { if (m_bufbits < bits) viewBits(bits); m_bufbits -= bits; } int getBits(int bits) { int res = viewBits(bits); skipBits(bits); return res; } void alignBits() { m_bufbits &= 0xF8; } void skip(int count) { m_position += count; m_size -= count; m_length -= count; if (m_size < 0) m_error = kMalformatted; } uint16_t decode16(const unsigned char *m_position) { return (m_position[0] << 8) | m_position[1]; } void decodeLength() { if (m_size < 2) returnResult(kMalformatted); m_length = decode16(m_position); if (m_length > m_size) returnResult(kMalformatted); skip(2); } void skipMarker() { decodeLength(); skip(m_length); } void decodeSOF() { int ssxmax = 0; int ssymax = 0; Component *c; decodeLength(); if (m_length < 9) returnResult(kMalformatted); if (m_position[0] != 8) returnResult(kUnsupported); m_height = decode16(m_position + 1); m_width = decode16(m_position + 3); m_bpp = m_position[5]; skip(6); switch (m_bpp) { case 1: case 3: break; default: returnResult(kUnsupported); } if (m_length < int(m_bpp * 3)) returnResult(kMalformatted); size_t i; for (i = 0, c = m_comp; i < m_bpp; ++i, ++c) { c->cid = m_position[0]; if (!(c->ssx = m_position[1] >> 4)) returnResult(kMalformatted); if (c->ssx & (c->ssx - 1)) returnResult(kUnsupported); // non-power of two if (!(c->ssy = m_position[1] & 15)) returnResult(kMalformatted); if (c->ssy & (c->ssy - 1)) returnResult(kUnsupported); // non-power of two if ((c->qtsel = m_position[2]) & 0xFC) returnResult(kMalformatted); skip(3); if (c->ssx > ssxmax) ssxmax = c->ssx; if (c->ssy > ssymax) ssymax = c->ssy; } U_ASSERT(ssxmax); U_ASSERT(ssymax); m_mbsizex = ssxmax << 3; m_mbsizey = ssymax << 3; U_ASSERT(m_mbsizex); U_ASSERT(m_mbsizey); m_mbwidth = (m_width + m_mbsizex - 1) / m_mbsizex; m_mbheight = (m_height + m_mbsizey - 1) / m_mbsizey; for (i = 0, c = m_comp; i < m_bpp; ++i, ++c) { c->width = (m_width * c->ssx + ssxmax - 1) / ssxmax; c->stride = (c->width + 7) & 0x7FFFFFF8; c->height = (m_height * c->ssy + ssymax - 1) / ssymax; c->stride = m_mbwidth * m_mbsizex * c->ssx / ssxmax; if (((c->width < 3) && (c->ssx != ssxmax)) || ((c->height < 3) && (c->ssy != ssymax))) returnResult(kUnsupported); c->pixels.resize(c->stride * (m_mbheight * m_mbsizey * c->ssy / ssymax)); } if (m_bpp == 3) m_rgb.resize(m_width * m_height * m_bpp); skip(m_length); } void decodeDHT() { unsigned char counts[16]; decodeLength(); while (m_length >= 17) { int i = m_position[0]; if (i & 0xEC) returnResult(kMalformatted); if (i & 0x02) returnResult(kUnsupported); i = (i | (i >> 3)) & 3; // combined DC/AC + table identification value for (size_t codelen = 1; codelen <= 16; ++codelen) counts[codelen - 1] = m_position[codelen]; skip(17); VLCCode *vlc = &m_vlctab[i][0]; int remain = 65536; int spread = 65536; for (size_t codelen = 1; codelen <= 16; ++codelen) { spread >>= 1; int currcnt = counts[codelen - 1]; if (!currcnt) continue; if (m_length < currcnt) returnResult(kMalformatted); remain -= currcnt << (16 - codelen); if (remain < 0) returnResult(kMalformatted); for (i = 0; i < currcnt; ++i) { unsigned char code = m_position[i]; for (int j = spread; j; --j) { vlc->bits = (unsigned char) codelen; vlc->code = code; ++vlc; } } skip(currcnt); } while (remain--) { vlc->bits = 0; ++vlc; } } if (m_length) returnResult(kMalformatted); } void decodeDQT() { unsigned char *t; decodeLength(); while (m_length >= 65) { int i = m_position[0]; if (i & 0xFC) returnResult(kMalformatted); t = &m_qtab[i][0]; for (i = 0; i < 64; ++i) t[i] = m_position[i + 1]; skip(65); } if (m_length) returnResult(kMalformatted); } void decodeDRI() { decodeLength(); if (m_length < 2) returnResult(kMalformatted); m_rstinterval = decode16(m_position); skip(m_length); } int getCoding(const VLCCode *const vlc, unsigned char *const code) { int value = viewBits(16); int bits = vlc[value].bits; if (!bits) { m_error = kMalformatted; return 0; } skipBits(bits); value = vlc[value].code; if (code) *code = (unsigned char) value; if (!(bits = value & 15)) return 0; if ((value = getBits(bits)) < (1 << (bits - 1))) value += sls(-1, bits) + 1; return value; } template <bool ClippingTable> void decodeBlock(Component *const c, unsigned char *const out) { unsigned char code = 0; int coef = 0; memset(m_block, 0, sizeof m_block); c->dcpred += getCoding(&m_vlctab[c->dctabsel][0], NULL); m_block[0] = (c->dcpred) * m_qtab[c->qtsel][0]; do { const int value = getCoding(&m_vlctab[c->actabsel][0], &code); if (!code) break; // EOB if (!(code & 0x0F) && (code != 0xF0)) returnResult(kMalformatted); coef += (code >> 4) + 1; if (coef > 63) returnResult(kMalformatted); m_block[(size_t)m_zz[coef]] = value * m_qtab[c->qtsel][coef]; } while (coef < 63); for (coef = 0; coef < 64; coef += 8) rowIDCT(&m_block[coef]); for (coef = 0; coef < 8; ++coef) columnIDCT<ClippingTable>(&m_block[coef], &out[coef], c->stride); } template <bool ClippingTable> void decodeScanlines() { size_t i; size_t rstcount = m_rstinterval; size_t nextrst = 0; Component *c; decodeLength(); if (m_length < int(4 + 2 * m_bpp)) returnResult(kMalformatted); if (m_position[0] != m_bpp) returnResult(kUnsupported); skip(1); for (i = 0, c = m_comp; i < m_bpp; ++i, ++c) { if (m_position[0] != c->cid) returnResult(kMalformatted); if (m_position[1] & 0xEE) returnResult(kMalformatted); c->dctabsel = m_position[1] >> 4; c->actabsel = (m_position[1] & 1) | 2; skip(2); } if (m_position[0] || (m_position[1] != 63) || m_position[2]) returnResult(kUnsupported); skip(m_length); for (int mby = 0; mby < m_mbheight; ++mby) { for (int mbx = 0; mbx < m_mbwidth; ++mbx) { for (i = 0, c = m_comp; i < m_bpp; ++i, ++c) { for (int sby = 0; sby < c->ssy; ++sby) { for (int sbx = 0; sbx < c->ssx; ++sbx) { decodeBlock<ClippingTable>(c, &c->pixels[((mby * c->ssy + sby) * c->stride + mbx * c->ssx + sbx) << 3]); if (m_error) return; } } } if (m_rstinterval && !(--rstcount)) { alignBits(); i = getBits(16); if (((i & 0xFFF8) != 0xFFD0) || ((i & 7) != nextrst)) returnResult(kMalformatted); nextrst = (nextrst + 1) & 7; rstcount = m_rstinterval; for (i = 0; i < 3; ++i) m_comp[i].dcpred = 0; } } } m_error = kFinished; } // http://www.media.mit.edu/pia/Research/deepview/exif.html uint16_t exifRead16(const unsigned char *const data) { if (m_exifLittleEndian) return data[0] | (data[1] << 8); return (data[0] << 8) | data[1]; } uint32_t exifRead32(const unsigned char *const data) { if (m_exifLittleEndian) return data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24); return (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3]; } void decodeExif() { decodeLength(); const unsigned char *pos = m_position; if (m_length < 18) return; size_t size = m_length; skip(size); if (!memcmp(pos, "Exif\0\0II*\0", 10)) m_exifLittleEndian = true; else if (!memcmp(pos, "Exif\0\0MM\0*", 10)) m_exifLittleEndian = false; else returnResult(kMalformatted); uint32_t i = exifRead32(pos + 10) + 6; if ((i < 14) || (i > size - 2)) return; pos += i; size -= i; uint16_t count = exifRead16(pos); i = (size - 2) / 12; if (count > i) return; // read all the Exif information until we find a YCbCrPositioning tag pos += 2; while (count--) { if (exifRead16(pos) == 0x0213 && exifRead16(pos + 2) == 3 && exifRead32(pos + 4) == 1) { m_coSitedChroma = !!(exifRead16(pos + 8) == 2); return; } pos += 12; } } static constexpr int kCF4A = -9; static constexpr int kCF4B = 111; static constexpr int kCF4C = 29; static constexpr int kCF4D = -3; static constexpr int kCF3A = 28; static constexpr int kCF3B = 109; static constexpr int kCF3C = -9; static constexpr int kCF3X = 104; static constexpr int kCF3Y = 27; static constexpr int kCF3Z = -3; static constexpr int kCF2A = 139; static constexpr int kCF2B = -11; template <size_t clipAdd, size_t clipShift> unsigned char clipGen(const size_t x) { return clip((x + clipAdd) >> clipShift); } unsigned char CF(const size_t x) { return clipGen<64, 7>(x); } unsigned char SF(const size_t x) { return clipGen<8, 4>(x); } // bicubic chroma upsampler void upSampleCenteredH(Component *const c) { const size_t xmax = c->width - 3; u::vector<unsigned char> out((c->width * c->height) << 1); unsigned char *lin = &c->pixels[0]; unsigned char *lout = &out[0]; for (size_t y = c->height; y; --y) { lout[0] = CF(kCF2A * lin[0] + kCF2B * lin[1]); lout[1] = CF(kCF3X * lin[0] + kCF3Y * lin[1] + kCF3Z * lin[2]); lout[2] = CF(kCF3A * lin[0] + kCF3B * lin[1] + kCF3C * lin[2]); for (size_t x = 0; x < xmax; ++x) { lout[(x << 1) + 3] = CF(kCF4A * lin[x] + kCF4B * lin[x + 1] + kCF4C * lin[x + 2] + kCF4D * lin[x + 3]); lout[(x << 1) + 4] = CF(kCF4D * lin[x] + kCF4C * lin[x + 1] + kCF4B * lin[x + 2] + kCF4A * lin[x + 3]); } lin += c->stride; lout += c->width << 1; lout[-3] = CF(kCF3A * lin[-1] + kCF3B * lin[-2] + kCF3C * lin[-3]); lout[-2] = CF(kCF3X * lin[-1] + kCF3Y * lin[-2] + kCF3Z * lin[-3]); lout[-1] = CF(kCF2A * lin[-1] + kCF2B * lin[-2]); } c->width <<= 1; c->stride = c->width; c->pixels = u::move(out); } void upSampleCenteredV(Component *const c) { const size_t w = c->width; const size_t s1 = c->stride; const size_t s2 = s1 + s1; u::vector<unsigned char> out((c->width * c->height) << 1); for (size_t x = 0; x < w; ++x) { unsigned char *cin = &c->pixels[x]; unsigned char *cout = &out[x]; *cout = CF(kCF2A * cin[0] + kCF2B * cin[s1]); cout += w; *cout = CF(kCF3X * cin[0] + kCF3Y * cin[s1] + kCF3Z * cin[s2]); cout += w; *cout = CF(kCF3A * cin[0] + kCF3B * cin[s1] + kCF3C * cin[s2]); cout += w; cin += s1; for (size_t y = c->height - 3; y; --y) { *cout = CF(kCF4A * cin[-s1] + kCF4B * cin[0] + kCF4C * cin[s1] + kCF4D * cin[s2]); cout += w; *cout = CF(kCF4D * cin[-s1] + kCF4C * cin[0] + kCF4B * cin[s1] + kCF4A * cin[s2]); cout += w; cin += s1; } cin += s1; *cout = CF(kCF3A * cin[0] + kCF3B * cin[-s1] + kCF3C * cin[-s2]); cout += w; *cout = CF(kCF3X * cin[0] + kCF3Y * cin[-s1] + kCF3Z * cin[-s2]); cout += w; *cout = CF(kCF2A * cin[0] + kCF2B * cin[-s1]); } c->height <<= 1; c->stride = c->width; c->pixels = u::move(out); } void upSampleCositedH(Component *const c) { const size_t xmax = c->width - 1; u::vector<unsigned char> out((c->width * c->height) << 1); unsigned char *lin = &c->pixels[0]; unsigned char *lout = &out[0]; for (size_t y = c->height; y; --y) { lout[0] = lin[0]; lout[1] = SF((lin[0] << 3) + 9 * lin[1] - lin[2]); lout[2] = lin[1]; for (size_t x = 2; x < xmax; ++x) { lout[(x << 1) - 1] = SF(9 * (lin[x - 1] + lin[x]) - (lin[x - 2] + lin[x + 1])); lout[x << 1] = lin[x]; } lin += c->stride; lout += c->width << 1; lout[-3] = SF((lin[-1] << 3) + 9 * lin[-2] - lin[-3]); lout[-2] = lin[-1]; lout[-1] = SF(17 * lin[-1] - lin[-2]); } c->width <<= 1; c->stride = c->width; c->pixels = u::move(out); } void upSampleCositedV(Component *const c) { const size_t w = c->width; const size_t s1 = c->stride; const size_t s2 = s1 + s1; u::vector<unsigned char> out((c->width * c->height) << 1); for (size_t x = 0; x < w; ++x) { unsigned char *cin = &c->pixels[x]; unsigned char *cout = &out[x]; *cout = cin[0]; cout += w; *cout = SF((cin[0] << 3) + 9 * cin[s1] - cin[s2]); cout += w; *cout = cin[s1]; cout += w; cin += s1; for (size_t y = c->height - 3; y; --y) { *cout = SF(9 * (cin[0] + cin[s1]) - (cin[-s1] + cin[s2])); cout += w; *cout = cin[s1]; cout += w; cin += s1; } *cout = SF((cin[s1] << 3) + 9 * cin[0] - cin[-s1]); cout += w; *cout = cin[-s1]; cout += w; *cout = SF(17 * cin[s1] - cin[0]); } c->height <<= 1; c->stride = c->width; c->pixels = u::move(out); } // fast pixel repetition upsampler void upSampleFast(Component *const c) { size_t xshift = 0; size_t yshift = 0; while (c->width < m_width) c->width <<= 1, ++xshift; while (c->height < m_height) c->height <<= 1, ++yshift; u::vector<unsigned char> out(c->width * c->height); unsigned char *lout = &out[0]; for (size_t y = 0; y < c->height; ++y) { const unsigned char *lin = &c->pixels[(y >> yshift) * c->stride]; for (size_t x = 0; x < c->width; ++x) lout[x] = lin[x >> xshift]; lout += c->width; } c->stride = c->width; c->pixels = u::move(out); } void convert(ChromaFilter filter) { size_t i; Component *c; switch (filter) { case kBicubic: for (i = 0, c = m_comp; i < m_bpp; ++i, ++c) { bool w = c->width < m_width; bool h = c->height < m_height; if (m_coSitedChroma) { while (w || h) { if (w) upSampleCositedH(c); if (h) upSampleCositedV(c); w = c->width < m_width; h = c->height < m_height; } } else { while (w || h) { if (w) upSampleCenteredH(c); if (h) upSampleCenteredV(c); w = c->width < m_width; h = c->height < m_height; } } if (c->width < m_width || c->height < m_height) returnResult(kInternalError); } break; case kPixelRepetition: for (i = 0, c = m_comp; i < m_bpp; ++i, ++c) { if (c->width < m_width || c->height < m_height) upSampleFast(c); if (c->width < m_width || c->height < m_height) returnResult(kInternalError); } break; default: U_ASSERT(0 && "unknown chroma filter"); break; } if (m_bpp == 3) { // convert to RGB24 unsigned char *prgb = &m_rgb[0]; const unsigned char *py = &m_comp[0].pixels[0]; const unsigned char *pcb = &m_comp[1].pixels[0]; const unsigned char *pcr = &m_comp[2].pixels[0]; for (size_t yy = m_height; yy; --yy) { for (size_t x = 0; x < m_width; ++x) { const int y = py[x] << 8; const int cb = pcb[x] - 128; const int cr = pcr[x] - 128; *prgb++ = clip((y + 359 * cr + 128) >> 8); *prgb++ = clip((y - 88 * cb - 183 * cr + 128) >> 8); *prgb++ = clip((y + 454 * cb + 128) >> 8); } py += m_comp[0].stride; pcb += m_comp[1].stride; pcr += m_comp[2].stride; } } else if (m_comp[0].width != m_comp[0].stride) { // grayscale -> only remove stride const unsigned char *pin = &m_comp[0].pixels[0] + m_comp[0].stride; unsigned char *pout = &m_comp[0].pixels[0] + m_comp[0].width; for (int y = m_comp[0].height - 1; y; --y) { memcpy(pout, pin, m_comp[0].width); pin += m_comp[0].stride; pout += m_comp[0].width; } m_comp[0].stride = m_comp[0].width; } } template <bool ClippingTable> Result decode(const u::vector<unsigned char> &data, ChromaFilter filter) { m_position = (const unsigned char*)&data[0]; m_size = data.size() & 0x7FFFFFFF; if (m_size < 2) return kInvalid; if (memcmp(m_position, kMagic, 3)) return kInvalid; skip(2); while (!m_error) { if (m_size < 2 || m_position[0] != 0xFF) return kMalformatted; skip(2); switch (m_position[-1]) { case 0xC0: decodeSOF(); break; case 0xC4: decodeDHT(); break; case 0xDB: decodeDQT(); break; case 0xDD: decodeDRI(); break; case 0xDA: decodeScanlines<ClippingTable>(); break; case 0xFE: skipMarker(); break; case 0xE1: decodeExif(); break; default: if ((m_position[-1] & 0xF0) == 0xE0) skipMarker(); else return kUnsupported; } } if (m_error != kFinished) return m_error; m_error = kSuccess; convert(filter); return m_error; } Component m_comp[3]; VLCCode m_vlctab[4][65536]; const unsigned char *m_position; unsigned char m_qtab[4][64]; u::vector<unsigned char> m_rgb; size_t m_rstinterval; int m_size; int m_length; int m_mbwidth; int m_mbheight; int m_mbsizex; int m_mbsizey; int m_buf; int m_bufbits; int m_block[64]; bool m_exifLittleEndian; bool m_coSitedChroma; static const unsigned char m_zz[64]; }; const unsigned char JPGDecoder::m_zz[64] = { 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63 }; JPGDecoder::IDCTClippingTable JPGDecoder::gIDCTClippingTable; /// /// PNG decoder /// /// Supports all the following bitdepths and color types of PNG /// /// | bitDepth | colorType | description | /// | <= 8 | 0 | greyscale (no alpha) | /// | 8 | 2 | RGB24 | /// | <= 8 | 3 | indexed color (palette) | /// | 8 | 4 | greyscale (with alpha) | /// | 8 | 6 | RGBA32 | /// | 16 | 0 | greyscale (no alpha) | /// | 16 | 2 | RGB48 | /// | 16 | 4 | greyscale (with alpha) | /// | 16 | 6 | RGBA64 | /// struct PNGDecoder : Decoder { static constexpr const char *kMagic = "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A"; static bool test(const u::vector<unsigned char> &data) { return memcmp(&data[0], kMagic, 8) == 0; } PNGDecoder(const u::vector<unsigned char> &data) { decode(m_decoded, data); switch (m_bpp) { case 1: m_format = kTexFormatLuminance; break; case 3: m_format = kTexFormatRGB; break; case 4: m_format = kTexFormatRGBA; break; default: U_UNREACHABLE(); break; } m_pitch = m_bpp * m_width; } u::vector<unsigned char> data() { return u::move(m_decoded); } private: friend struct Texture; void decode(u::vector<unsigned char> &out, const u::vector<unsigned char> &invec) { const unsigned char *const in = &invec[0]; readHeader(&in[0], invec.size()); if (m_error) return; bool IEND = false; size_t pos = 33; u::vector<unsigned char> idat; while (!IEND) { if (pos + 8 >= invec.size()) returnResult(kMalformatted); const size_t chunkLength = readWord(&in[pos]); if (chunkLength > INT32_MAX) returnResult(kMalformatted); if (pos + chunkLength >= invec.size()) returnResult(kMalformatted); pos += 4; if (!memcmp(in + pos, "IDAT", 4)) { idat.insert(idat.end(), &in[pos + 4], &in[pos + 4 + chunkLength]); pos += (4 + chunkLength); } else if (!memcmp(in + pos, "IEND", 4)) { pos += 4; IEND = true; } else if (!memcmp(in + pos, "PLTE", 4)) { pos += 4; //go after the 4 letters m_palette.resize(4 * (chunkLength / 3)); if (m_palette.size() > (4 * 256)) returnResult(kMalformatted); for (size_t i = 0; i < m_palette.size(); i += 4) { for (size_t j = 0; j < 3; j++) m_palette[i + j] = in[pos++]; // RGB m_palette[i + 3] = 255; // alpha } } else if (!memcmp(in + pos, "tRNS", 4)) { pos += 4; if (m_colorType == 3) { if (4 * chunkLength > m_palette.size()) returnResult(kMalformatted); for (size_t i = 0; i < chunkLength; i++) m_palette[4 * i + 3] = in[pos++]; } else if (m_colorType == 0) { if (chunkLength != 2) returnResult(kMalformatted); const size_t key = 256 * in[pos] + in[pos + 1]; m_hasChromaKey = 1; m_chromaKeyRed = key; m_chromaKeyGreen = key; m_chromaKeyBlue = key; pos += 2; } else if(m_colorType == 2) { if (chunkLength != 6) returnResult(kMalformatted); m_hasChromaKey = 1; m_chromaKeyRed = 256 * in[pos] + in[pos + 1]; pos += 2; m_chromaKeyGreen = 256 * in[pos] + in[pos + 1]; pos += 2; m_chromaKeyBlue = 256 * in[pos] + in[pos + 1]; pos += 2; } else returnResult(kMalformatted); } else { // unknown critical chunk (5th bit of the first byte of chunk type is 0) if (!(in[pos + 0] & 32)) returnResult(kMalformatted); pos += (chunkLength + 4); } pos += 4; // step over CRC } const size_t bpp = calculateBitsPerPixel(); m_bpp = bpp / 8; u::vector<unsigned char> scanlines(((m_width * (m_height * bpp + 7)) / 8) + m_height); if (!u::zlib::decompress(scanlines, idat)) returnResult(kMalformatted); const size_t bytewidth = (bpp + 7) / 8; const size_t outlength = (m_height * m_width * bpp + 7) / 8; out.resize(outlength); unsigned char *const out_ = outlength ? &out[0] : 0; // no interlace, just filter if (m_interlaceMethod == 0) { size_t linestart = 0; const size_t linelength = (m_width * bpp + 7) / 8; if (bpp >= 8) { for (size_t y = 0; y < m_height; y++) { const size_t filterType = scanlines[linestart]; const unsigned char *const prevline = (y == 0) ? 0 : &out_[(y - 1) * m_width * bytewidth]; unfilterScanline(&out_[linestart - y], &scanlines[linestart + 1], prevline, bytewidth, filterType, linelength); if (m_error) return; linestart += (1 + linelength); } } else { u::vector<unsigned char> templine((m_width * bpp + 7) >> 3); for (size_t y = 0, obp = 0; y < m_height; y++) { const size_t filterType = scanlines[linestart]; const unsigned char *const prevline = (y == 0) ? 0 : &out_[(y - 1) * m_width * bytewidth]; unfilterScanline(&templine[0], &scanlines[linestart + 1], prevline, bytewidth, filterType, linelength); if (m_error) return; for (size_t bp = 0; bp < m_width * bpp;) setBitReversed(obp, out_, readBitReverse(bp, &templine[0])); linestart += (1 + linelength); } } } else { // adam7 interlaced size_t passw[7], *pw = passw; size_t passh[7], *ph = passh; size_t passs[7], *ps = passs; for (const char *x = "\x7\x8\x3\x8\x3\x4\x1\x4\x1\x2\x0\x2\x0\x1"; pw != &passw[7]; x+=2) *pw++ = (m_width + x[0]) / x[1]; for (const char *x = "\x7\x8\x7\x8\x3\x8\x3\x4\x1\x4\x1\x2\x0\x2"; ph != &passh[7]; x+=2) *ph++ = (m_height + x[0]) / x[1]; for (size_t i = 0; i < 6; i++, ps++) ps[1] = *ps + passh[i] * ((!!passw[i]) + (passw[i] * bpp + 7) / 8); u::vector<unsigned char> scanlineo((m_width * bpp + 7) / 8); u::vector<unsigned char> scanlinen((m_width * bpp + 7) / 8); for (size_t i = 0; i < 7; i++) { adam7Pass(out_, &scanlinen[0], &scanlineo[0], &scanlines[passs[i]], m_width, i, passw[i], passh[i], bpp); } } if (m_colorType == 3 || m_colorType == 4) { const u::vector<unsigned char> data = out; // Make a copy to work with if (!convert(out, &data[0])) returnResult(kInternalError); } } bool convert(u::vector<unsigned char> &out, const unsigned char *in) { // This will always produce RGBA32 const size_t numPixels = m_width * m_height; out.resize(numPixels * 4); if (m_bitDepth == 8) { switch(m_colorType) { case 3: // Indexed color for (size_t i = 0; i < numPixels; i++) { if (4u * in[i] >= m_palette.size()) return false; for (size_t c = 0; c < 4; c++) out[4 * i + c] = m_palette[4 * in[i] + c]; // RGB colors from palette } break; case 4: // Greyscale with alpha for (size_t i = 0; i < numPixels; i++) { out[4 * i + 0] = in[2 * i + 0]; out[4 * i + 1] = in[2 * i + 0]; out[4 * i + 2] = in[2 * i + 0]; out[4 * i + 3] = in[2 * i + 1]; } break; } } m_bpp = 4; return true; } void readHeader(const unsigned char* in, size_t inlength) { if (inlength < 29) returnResult(kInvalid); if (memcmp(in, kMagic, 8)) returnResult(kInvalid); if (memcmp(in + 12, "IHDR", 4)) returnResult(kInvalid); m_width = readWord(&in[16]); m_height = readWord(&in[20]); m_bitDepth = in[24]; m_colorType = in[25]; m_compressionMethod = in[26]; // only compression method 0 is allowed in the specification if (in[26] != 0) returnResult(kMalformatted); m_filterMethod = in[27]; // only filter method 0 is allowed in the specification if (in[27] != 0) returnResult(kMalformatted); m_interlaceMethod = in[28]; // only interlace methods 0 and 1 exist in the specification if (in[28] > 1) returnResult(kMalformatted); m_error = validateColor(m_colorType, m_bitDepth); } void unfilterScanline(unsigned char *const recon, const unsigned char *const scanline, const unsigned char *const precon, size_t bytewidth, size_t filterType, size_t length) { switch (filterType) { case 0: for (size_t i = 0; i < length; i++) recon[i] = scanline[i]; break; case 1: for (size_t i = 0; i < bytewidth; i++) recon[i] = scanline[i]; for (size_t i = bytewidth; i < length; i++) recon[i] = scanline[i] + recon[i - bytewidth]; break; case 2: if (precon) for(size_t i = 0; i < length; i++) recon[i] = scanline[i] + precon[i]; else for(size_t i = 0; i < length; i++) recon[i] = scanline[i]; break; case 3: if (precon) { for (size_t i = 0; i < bytewidth; i++) recon[i] = scanline[i] + precon[i] / 2; for (size_t i = bytewidth; i < length; i++) recon[i] = scanline[i] + ((recon[i - bytewidth] + precon[i]) / 2); } else { for (size_t i = 0; i < bytewidth; i++) recon[i] = scanline[i]; for (size_t i = bytewidth; i < length; i++) recon[i] = scanline[i] + recon[i - bytewidth] / 2; } break; case 4: if (precon) { for (size_t i = 0; i < bytewidth; i++) recon[i] = scanline[i] + paethPredictor(0, precon[i], 0); for (size_t i = bytewidth; i < length; i++) recon[i] = scanline[i] + paethPredictor(recon[i - bytewidth], precon[i], precon[i - bytewidth]); } else { for(size_t i = 0; i < bytewidth; i++) recon[i] = scanline[i]; for(size_t i = bytewidth; i < length; i++) recon[i] = scanline[i] + paethPredictor(recon[i - bytewidth], 0, 0); } break; default: returnResult(kMalformatted); } } void adam7Pass(unsigned char *out, unsigned char *linen, unsigned char *lineo, const unsigned char *const in, size_t w, size_t i, size_t passw, size_t passh, size_t bpp) { if (passw == 0) return; const size_t passleft = m_adam7Pattern[i]; const size_t passtop = m_adam7Pattern[i + 7]; const size_t spacex = m_adam7Pattern[i + 14]; const size_t spacey = m_adam7Pattern[i + 21]; const size_t bytewidth = (bpp + 7) / 8; const size_t linelength = 1 + ((bpp * passw + 7) / 8); for (size_t y = 0; y < passh; y++) { const unsigned char filterType = in[y * linelength]; const unsigned char *const prevline = (y == 0) ? 0 : lineo; unfilterScanline(linen, &in[y * linelength + 1], prevline, bytewidth, filterType, (w * bpp + 7) / 8); if (m_error) return; if (bpp >= 8) { for (size_t i = 0; i < passw; i++) for (size_t b = 0; b < bytewidth; b++) // b = current byte of this pixel out[bytewidth * w * (passtop + spacey * y) + bytewidth * (passleft + spacex * i) + b] = linen[bytewidth * i + b]; } else { for (size_t i = 0; i < passw; i++) { size_t obp = bpp * w * (passtop + spacey * y) + bpp * (passleft + spacex * i); size_t bp = i * bpp; for (size_t b = 0; b < bpp; b++) setBitReversed(obp, out, readBitReverse(bp, &linen[0])); } } unsigned char *temp = linen; linen = lineo; lineo = temp; } } size_t readBitReverse(size_t& bitp, const unsigned char *const bits) { const size_t r = (bits[bitp >> 3] >> (7 - (bitp & 0x7))) & 1; bitp++; return r; } size_t readBitsReverse(size_t &bitp, const unsigned char *const bits, size_t nbits) { size_t r = 0; for (size_t i = nbits - 1; i < nbits; i--) r += ((readBitReverse(bitp, bits)) << i); return r; } void setBitReversed(size_t &bitp, unsigned char *const bits, size_t bit) { U_ASSERT(bits); bits[bitp >> 3] |= (bit << (7 - (bitp & 0x7))); bitp++; } uint32_t readWord(const unsigned char *const buffer) { return (buffer[0] << 24) | (buffer[1] << 16) | (buffer[2] << 8) | buffer[3]; } Result validateColor(size_t colorType, size_t bd) { if (colorType == 2 || colorType == 4 || colorType == 6) return (bd != 8 && bd != 16) ? kMalformatted : kSuccess; else if (colorType == 0) return (bd != 1 && bd != 2 && bd != 4 && bd != 8 && bd != 16) ? kMalformatted : kSuccess; else if (colorType == 3) return (bd != 1 && bd != 2 && bd != 4 && bd != 8) ? kMalformatted : kSuccess; return kMalformatted; } size_t calculateBitsPerPixel() const { if (m_colorType == 2) return (3 * m_bitDepth); else if (m_colorType >= 4) return (m_colorType - 2) * m_bitDepth; return m_bitDepth; } // Paeth predicter static unsigned char paethPredictor(short a, short b, short c) { const short p = a + b - c; const short pa = p > a ? (p - a) : (a - p); const short pb = p > b ? (p - b) : (b - p); const short pc = p > c ? (p - c) : (c - p); return (unsigned char)((pa <= pb && pa <= pc) ? a : pb <= pc ? b : c); } protected: size_t m_colorType; size_t m_bitDepth; size_t m_compressionMethod; size_t m_filterMethod; size_t m_interlaceMethod; size_t m_chromaKeyRed; size_t m_chromaKeyGreen; size_t m_chromaKeyBlue; bool m_hasChromaKey; u::vector<unsigned char> m_palette; u::vector<unsigned char> m_decoded; static const size_t m_adam7Pattern[28]; }; // values for the adam7 passes const size_t PNGDecoder::m_adam7Pattern[28] = { 0, 4, 0, 2, 0, 1, 0, 0, 0, 4, 0, 2, 0, 1, 8, 8, 4, 4, 2, 2, 1, 8, 8, 8, 4, 4, 2, 2 }; /// /// TGA decoder /// struct TGADecoder : Decoder { static constexpr const char *kMagic = "TRUEVISION-XFILE"; static bool test(const u::vector<unsigned char> &data) { // Not pretty but required to prevent more involved test from reading // past the end of the buffer. if (data.size() <= sizeof(Header) || data.size() <= 26) return false; // The TGA file format has no magic number. It has an `optional' trailer // section which could contain kMagic. It's always the last 26 bytes of // the file. We test for that as an early optimization, otherwise we have // to do a more involved test. const unsigned char *const trailer = &data[data.size() - 26] + 4 // Skip `extensions offset' field + 4; // Skip `developer area offset' field if (!memcmp(trailer, kMagic, 16)) return true; // We've made it here, time for a more involved process Header h; memcpy(&h, &data[0], sizeof h); // Color type (0, or 1) if (h.colorMapType > 1) return false; // Image type RGB/grey +/- RLE only if (!memchr("\x1\x2\x3\xA\xB\xC", h.imageType, 6)) return false; // Verify dimensions if ((h.width[0] | (h.width[1] << 8)) == 0) return false; if ((h.height[0] | (h.height[1] << 8)) == 0) return false; return true; } TGADecoder(const u::vector<unsigned char> &data) { decode(data); switch (m_bpp) { case 1: m_format = kTexFormatLuminance; break; case 3: m_format = kTexFormatRGB; break; case 4: m_format = kTexFormatRGBA; break; default: U_ASSERT(0 && "unsupported bpp"); break; } m_pitch = m_bpp * m_width; } u::vector<unsigned char> data() { return u::move(m_data); } private: friend struct Texture; void read(unsigned char *dest, size_t size) { memcpy(dest, m_position, size); seek(size); } int get() { return *m_position++; } void seek(size_t where) { m_position += where; } Result decode(const u::vector<unsigned char> &data) { m_position = &data[0]; read((unsigned char *)&m_header, sizeof m_header); seek(m_header.identSize); if (!memchr("\x8\x18\x20", m_header.pixelSize, 3)) return kUnsupported; m_bpp = m_header.pixelSize / 8; m_width = m_header.width[0] | (m_header.width[1] << 8); m_height = m_header.height[0] | (m_header.height[1] << 8); switch (m_header.imageType) { case 1: decodeColor(); break; case 2: decodeImage(); break; case 9: decodeColorRLE(); break; case 10: decodeImageRLE(); break; default: return kUnsupported; } return m_error ? m_error : kSuccess; } void decodeColor() { const size_t colorMapSize = m_header.colorMapSize[0] | (m_header.colorMapSize[1] << 8); if (!memchr("\x8\x18\x20", m_header.colorMapEntrySize, 3)) returnResult(kUnsupported); m_bpp = m_header.colorMapEntrySize / 8; u::vector<unsigned char> colorMap(m_bpp * colorMapSize); read(&colorMap[0], m_bpp * colorMapSize); if (m_bpp >= 3) convert(&colorMap[0], m_bpp * colorMapSize, m_bpp); m_data.resize(m_bpp * m_width * m_height); unsigned char *const indices = &m_data[(m_bpp - 1) * m_width * m_height]; read(indices, m_width * m_height); const unsigned char *src = indices; unsigned char *dst = &m_data[m_bpp * m_width * m_height]; for (size_t i = 0; i < m_height; i++) { dst -= m_bpp * m_width; unsigned char *row = dst; for (size_t j = 0; j < m_width; j++) { memcpy(row, &colorMap[*src++ * m_bpp], m_bpp); row += m_bpp; } } } void decodeImage() { m_data.resize(m_bpp * m_width * m_height); unsigned char *dst = &m_data[m_bpp * m_width * m_height]; for (size_t i = 0; i < m_height; i++) { dst -= m_bpp * m_width; read(dst, m_bpp * m_width); } if (m_bpp >= 3) convert(&m_data[0], m_bpp * m_width * m_height, m_bpp); } void decodeColorRLE() { const size_t colorMapSize = m_header.colorMapSize[0] | (m_header.colorMapSize[1] << 8); if (!memchr("\x8\x18\x20", m_header.colorMapEntrySize, 3)) returnResult(kUnsupported); m_bpp = m_header.colorMapEntrySize / 8; u::vector<unsigned char> colorMap(m_bpp * colorMapSize); read(&colorMap[0], m_bpp * colorMapSize); if (m_bpp >= 3) convert(&colorMap[0], m_bpp * colorMapSize, m_bpp); m_data.resize(m_bpp * m_width * m_height); unsigned char buffer[128]; for (unsigned char *end = &m_data[m_bpp * m_width * m_height], *dst = end - m_bpp * m_width; dst >= &m_data[0]; ) { int c = get(); if (c & 0x80) { const int index = get(); const unsigned char *column = &colorMap[index * m_bpp]; c -= 0x7F; c *= m_bpp; while (c > 0 && dst >= &m_data[0]) { const int n = u::min(c, int(end - dst)); for (const unsigned char *const run = dst + n; dst < run; dst += m_bpp) memcpy(dst, column, m_bpp); c -= n; if (dst >= end) { end -= m_bpp * m_width; dst = end - m_bpp * m_width; } } } else { c += 1; while (c > 0 && dst >= &m_data[0]) { const int n = u::min(c, int(end - dst) / int(m_bpp)); read(buffer, n); for (const unsigned char *src = buffer; src <= &buffer[n]; dst += m_bpp) memcpy(dst, &colorMap[*src++ * m_bpp], m_bpp); c -= n; if (dst >= end) { end -= m_bpp * m_width; dst = end - m_bpp * m_width; } } } } } void decodeImageRLE() { m_data.resize(m_bpp * m_width * m_height); unsigned char buffer[4]; for (unsigned char *end = &m_data[m_bpp * m_width * m_height], *dst = end - m_bpp * m_width; dst >= &m_data[0]; ) { int c = get(); if (c & 0x80) { read(buffer, m_bpp); c -= 0x7F; if (m_bpp >= 3) u::swap(buffer[0], buffer[2]); c *= m_bpp; while (c > 0) { const int n = u::min(c, int(end - dst)); for (const unsigned char *const run = dst + n; dst < run; dst += m_bpp) memcpy(dst, buffer, m_bpp); c -= n; if (dst >= end) { end -= m_bpp * m_width; dst = end - m_bpp * m_width; if (dst < &m_data[0]) break; } } } else { c += 1; c *= m_bpp; while (c > 0) { const int n = u::min(c, int(end - dst)); read(dst, n); if (m_bpp >= 3) convert(dst, n, m_bpp); dst += n; c -= n; if (dst >= end) { end -= m_bpp * m_width; dst = end - m_bpp * m_width; if (dst < &m_data[0]) break; } } } } } void convert(unsigned char *data, size_t length, size_t m_bpp) { for (const unsigned char *const end = &data[length]; data < end; data += m_bpp) u::swap(data[0], data[2]); } struct Header { unsigned char identSize; unsigned char colorMapType; unsigned char imageType; unsigned char colorMapOrigin[2]; unsigned char colorMapSize[2]; unsigned char colorMapEntrySize; unsigned char xorigin[2]; unsigned char yorigin[2]; unsigned char width[2]; unsigned char height[2]; unsigned char pixelSize; unsigned char description; } m_header; const unsigned char *m_position; u::vector<unsigned char> m_data; }; struct DDSDecoder : Decoder { static bool test(const u::vector<unsigned char> &data) { return !memcmp(&data[0], (const void *)"DDS ", 4); } DDSDecoder(const u::vector<unsigned char> &data) { decode(data); } u::vector<unsigned char> data() { return u::move(m_data); } static constexpr uint32_t kDXT1 = u::fourCC<uint32_t>("DXT1"); static constexpr uint32_t kDXT3 = u::fourCC<uint32_t>("DXT3"); static constexpr uint32_t kDXT5 = u::fourCC<uint32_t>("DXT5"); static constexpr uint32_t kBC4U = u::fourCC<uint32_t>("BC4U"); static constexpr uint32_t kBC4S = u::fourCC<uint32_t>("BC4S"); static constexpr uint32_t kBC5U = u::fourCC<uint32_t>("BC5U"); static constexpr uint32_t kBC5S = u::fourCC<uint32_t>("BC5S"); static constexpr uint32_t kATI1 = u::fourCC<uint32_t>("ATI1"); static constexpr uint32_t kATI2 = u::fourCC<uint32_t>("ATI2"); private: void read(unsigned char *dest, size_t size) { memcpy(dest, m_position, size); m_position += size; } void decode(const u::vector<unsigned char> &data) { m_position = &data[0]; unsigned char magic[4]; read(magic, 4); if (memcmp((const void*)magic, (const void*)"DDS ", 4)) returnResult(kInvalid); SurfaceDescriptor surface; read((unsigned char*)&surface, sizeof surface); m_data.resize(data.end() - m_position); read(&m_data[0], m_data.size()); switch (surface.format.fourcc) { case kDXT1: m_format = kTexFormatDXT1; break; case kDXT3: m_format = kTexFormatDXT3; break; case kDXT5: m_format = kTexFormatDXT5; break; case kATI1: m_format = kTexFormatBC4U; break; case kATI2: m_format = kTexFormatBC5U; break; case kBC4U: m_format = kTexFormatBC4U; break; case kBC4S: m_format = kTexFormatBC4S; break; case kBC5U: m_format = kTexFormatBC5U; break; case kBC5S: m_format = kTexFormatBC5S; break; default: returnResult(kUnsupported); } m_width = surface.width; m_height = surface.height; m_mips = surface.mipLevel; m_bpp = surface.pitch / surface.width; } struct PixelFormat { uint32_t size; uint32_t flags; uint32_t fourcc; uint32_t bpp; uint32_t colorMask[4]; }; struct SurfaceDescriptor { uint32_t size; uint32_t flags; uint32_t height; uint32_t width; uint32_t pitch; uint32_t depth; uint32_t mipLevel; uint32_t alphaBitDepth; uint32_t reserved; uint32_t surface; uint32_t dstOverlay[2]; uint32_t dstBlit[2]; uint32_t srcOverlay[2]; uint32_t srcBlit[2]; PixelFormat format; uint32_t caps[4]; uint32_t textureStage; }; const unsigned char *m_position; u::vector<unsigned char> m_data; }; /// /// NetPBM /// /// Supports all of PBM except P7 (PAM) /// struct PNMDecoder : Decoder { static bool test(const u::vector<unsigned char> &data) { return data[0] == 'P' && data[1] >= '1' && data[1] <= '6' && u::isspace(data[2]); } PNMDecoder(const u::vector<unsigned char> &data) { decode(data); } u::vector<unsigned char> data() { return u::move(m_data); } protected: void decode(const u::vector<unsigned char> &data) { // No line can be longer than 70 characters in PBM files unsigned char buffer[70]; const char *string = (const char *)buffer; m_buffer = &data[3]; // Skip "P[1...6]" m_end = &data[data.size()]; #define checkRange() \ do { \ if (ptr > &m_data[m_data.size()]) \ returnResult(kMalformatted); \ } while (0) // Read size if (!next(buffer, sizeof buffer)) returnResult(kMalformatted); m_width = strtol(string, nullptr, 10); if (!next(buffer, sizeof buffer)) returnResult(kMalformatted); m_height = strtol(string, nullptr, 10); // Don't allow files larger than 4096*4096 if (m_width > 4096) returnResult(kUnsupported); if (m_height > 4096) returnResult(kUnsupported); // Calculate scaling factor int max = 0; float scale = 0.0f; if (data[1] != '1' && data[1] != '4') { if (!next(buffer, sizeof buffer)) returnResult(kMalformatted); max = strtol(string, nullptr, 10); if (max < 1 || max > 65535) returnResult(kMalformatted); scale = 255.0f / float(max); } auto readBigEndian16 = [](unsigned char *data) { return size_t(data[1]) | size_t(data[0]) << 8; }; const size_t size = m_width * m_height; m_bpp = (data[1] == '3' || data[1] == '6') ? 3 : 1; m_data.resize(size * m_bpp); unsigned char *ptr = &m_data[0]; if (data[1] >= '1' && data[1] <= '4') { for (size_t j = 0; j < size; ++j) { switch (data[1]) { case '1': if (!next(buffer, sizeof buffer)) returnResult(kMalformatted); *ptr++ = buffer[0] == '1' ? 255 : 0; checkRange(); break; case '2': if (!next(buffer, sizeof buffer)) returnResult(kMalformatted); *ptr++ = strtol(string, nullptr, 10) * scale; checkRange(); break; case '3': for (size_t c = 0; c < 3; c++) { if (!next(buffer, sizeof buffer)) returnResult(kMalformatted); *ptr++ = strtol(string, nullptr, 10) * scale; checkRange(); } break; case '4': if (read(buffer, 1) != 1) returnResult(kMalformatted); for (size_t i = 0; i < 8 && j < size; ++i, ++j) { *ptr++ = (*buffer & (1<<(7-i))) ? 255 : 0; checkRange(); } break; } } } else { switch (data[1]) { case '5': if (max > 255) { for (size_t j = 0; j < size; ++j) { if (read(buffer, 2) != 2) returnResult(kMalformatted); *ptr++ = readBigEndian16(buffer) * scale; checkRange(); } } else { if (!read(ptr, size)) returnResult(kMalformatted); for (size_t j = 0; j < size; ++j) { *ptr++ *= scale; checkRange(); } } break; case '6': if (max > 255) { for (size_t j = 0; j < size; ++j) { for (size_t c = 0; c < 3; c++) { if (read(buffer, 2) != 2) returnResult(kMalformatted); *ptr++ = readBigEndian16(buffer) * scale; checkRange(); } } } else { if (read(ptr, size*3) != int(size*3)) returnResult(kMalformatted); for (size_t j = 0; j < size*3; ++j) { *ptr++ *= scale; checkRange(); } } break; default: returnResult(kUnsupported); break; } } // The pointer should be at the end of memory if everything decoded // successfully if (ptr != &m_data[m_data.size()]) returnResult(kMalformatted); // Figure out the appropriate format switch (m_bpp) { case 1: m_format = kTexFormatLuminance; break; case 3: m_format = kTexFormatRGB; break; default: U_ASSERT(0 && "unsupported bpp"); break; } m_pitch = m_bpp * m_width; returnResult(kSuccess); } int read(unsigned char *const buffer, size_t count) { if (m_buffer >= m_end) return EOF; if (m_buffer + count >= m_end) count = m_end - m_buffer; memcpy(buffer, m_buffer, count); m_buffer += count; return int(count); } bool next(unsigned char *const store, size_t size) { for (int c=0;;) { // Skip space characters while ((c = read(store, 1)) != EOF && u::isspace(*store)) if (c != 1) return false; // Skip comment line if (c == '#') { while ((c = read(store, 1)) != EOF && strchr("\r\n", *store)) if (c != 1) return false; } else { // Read characters until we hit a space size_t i; for (i = 1; i < size && (c = read(store+i, 1)) != EOF && !u::isspace(store[i]); ++i) if (c != 1) return false; store[i < size ? i : size - 1] = '\0'; return true; } } return false; } private: u::vector<unsigned char> m_data; const unsigned char *m_buffer; const unsigned char *m_end; }; /// Trivial PCX image loader (only supports 8-bit indexed or 24-bit RLE RGB) /// (The only sane formats of PCX for this day and age.) struct PCXDecoder : Decoder { PCXDecoder(const u::vector<unsigned char> &data) : m_uncompressed(true) , m_planes(0) , m_bpl(0) { decode(data); } static bool test(const u::vector<unsigned char> &data) { if (data[0] != 0xA) // PCX ID Byte: 0xA return false; if (data[1] > 5) // Only supports version <= 5 return false; if (data[2] > 1) // RLE (0 or 1) return false; // Supported Bytes Per Pixel if (!strchr("\x1\x2\x4\x8", data[3])) return false; return true; } void decode(const u::vector<unsigned char> &data) { // Read the header m_uncompressed = !data[2]; m_bpp = data[3]; // We only support 8-bit indexed and 24-bit RGB if (m_bpp != 8) returnResult(kUnsupported); // We only know about RLE compressed PCX if (m_uncompressed) returnResult(kUnsupported); // Read image window uint16_t x1, y1; uint16_t x2, y2; memcpy(&x1, &data[4], sizeof x1); memcpy(&y1, &data[6], sizeof y1); memcpy(&x2, &data[8], sizeof x2); memcpy(&y2, &data[10], sizeof y2); x1 = u::endianSwap(x1); y1 = u::endianSwap(y1); x2 = u::endianSwap(x2); y2 = u::endianSwap(y2); const int w = (x2 - x1) + 1; const int h = (y2 - y1) + 1; if (w < 1 || h < 1) returnResult(kMalformatted); // Sanity check if (w > 4096 || h > 4096) returnResult(kInvalid); m_width = w; m_height = h; m_planes = data[65]; if (!strchr("\x1\x3", m_planes)) returnResult(kUnsupported); // Bits per line memcpy(&m_bpl, &data[66], 2); if (!loadRLE(&data[128])) returnResult(kMalformatted); } u::vector<unsigned char> data() { return u::move(m_data); } protected: bool loadRLE(const unsigned char *const data) { const unsigned char *current = data; size_t bufferLineLength = m_bpl*m_planes; size_t imageLineLength = m_width*m_planes; u::vector<unsigned char> line(bufferLineLength); m_data.resize((imageLineLength * m_height)+1); for (size_t lineCount = 0; lineCount < m_height; ++lineCount) { size_t linePosition = 0; while (linePosition < bufferLineLength) { // First 2 bits indicate run of next byte value if (*current > 0xC0) { // Remaining 6 bits indicate run length int runLength = *current++ & 0x3F; for (; runLength != 0; runLength--) line[linePosition++] = *current; ++current; } else { line[linePosition++] = *current++; } } if (m_planes == 1) { memcpy(&m_data[lineCount*imageLineLength], &line[0], imageLineLength); m_bpp = 1; m_format = kTexFormatLuminance; } else if (m_planes == 3) { unsigned char *interleave = &m_data[lineCount * imageLineLength]; for (linePosition = 0; linePosition != m_width; ++linePosition, interleave += 3) { interleave[0] = line[linePosition]; interleave[1] = line[linePosition + m_width]; interleave[2] = line[linePosition + m_width*2]; } m_bpp = 3; m_format = kTexFormatRGB; } else { return false; } } m_pitch = m_bpp*m_width; return true; } private: u::vector<unsigned char> m_data; bool m_uncompressed; unsigned char m_planes; // 1 = Indexes, 3 = RGB uint16_t m_bpl; }; /// /// Texture utilities: /// halve (useful for generating mipmaps), shift, scale and reorient. /// template <size_t S> void Texture::halve(unsigned char *U_RESTRICT src, size_t sw, size_t sh, size_t stride, unsigned char *U_RESTRICT dst) { for (unsigned char *yend = src + sh * stride; src < yend;) { for (unsigned char *xend = src + sw * S, *xsrc = src; xsrc < xend; xsrc += 2 * S, dst += S) { for (size_t i = 0; i < S; i++) dst[i] = (size_t(xsrc[i]) + size_t(xsrc[i+S]) + size_t(xsrc[stride+i]) + size_t(xsrc[stride+i+S])) >> 2; } src += 2 * stride; } } template <size_t S> void Texture::shift(unsigned char *U_RESTRICT src, size_t sw, size_t sh, size_t stride, unsigned char *U_RESTRICT dst, size_t dw, size_t dh) { size_t wfrac = sw/dw, hfrac = sh/dh, wshift = 0, hshift = 0; while (dw << wshift < sw) wshift++; while (dh << hshift < sh) hshift++; const size_t tshift = wshift + hshift; for (unsigned char *yend = src + sh * stride; src < yend; ) { for (unsigned char *xend = src + sw * S, *xsrc = src; xsrc < xend; xsrc += wfrac * S, dst += S) { size_t r[S] = {0}; for (unsigned char *ycur = xsrc, *xend = ycur + wfrac * S, *yend = src + hfrac * stride; ycur<yend; ycur += stride, xend += stride) { for (unsigned char *xcur = ycur; xcur < xend; xcur += S) { for (size_t i = 0; i < S; i++) r[i] += xcur[i]; } } for (size_t i = 0; i < S; i++) dst[i] = (r[i]) >> tshift; } src += hfrac*stride; } } template <size_t S> void Texture::scale(unsigned char *U_RESTRICT src, size_t sw, size_t sh, size_t stride, unsigned char *U_RESTRICT dst, size_t dw, size_t dh) { size_t wfrac = (sw << 12U) / dw; size_t hfrac = (sh << 12U) / dh; size_t darea = dw * dh; size_t sarea = sw * sh; int over, under; for (over = 0; (darea >> over) > sarea; over++); for (under = 0; (darea << under) < sarea; under++); size_t cscale = m::clamp(under, over - 12, 12); size_t ascale = m::clamp(12 + under - over, 0, 24); size_t dscale = ascale + 12 - cscale; size_t area = size_t((unsigned long long)darea << ascale) / sarea; dw *= wfrac; dh *= hfrac; for (size_t y = 0; y < dh; y += hfrac) { const size_t yn = y + hfrac - 1; const size_t yi = y >> 12U; const size_t h = (yn >> 12U) - yi; const size_t ylow = ((yn | (-int(h) >> 24)) & 0xFFFU) + 1 - (y & 0xFFFU); const size_t yhigh = (yn & 0xFFFU) + 1; const unsigned char *ysrc = src + yi * stride; for (size_t x = 0; x < dw; x += wfrac, dst += S) { const size_t xn = x + wfrac - 1; const size_t xi = x >> 12U; const size_t w = (xn >> 12U) - xi; const size_t xlow = ((w + 0xFFFU) & 0x1000U) - (x & 0xFFFU); const size_t xhigh = (xn & 0xFFFU) + 1; const unsigned char *xsrc = ysrc + xi * S; const unsigned char *xend = xsrc + w * S; size_t r[S] = {0}; for (const unsigned char *xcur = xsrc + S; xcur < xend; xcur += S) for (size_t i = 0; i < S; i++) r[i] += xcur[i]; for (size_t i = 0; i < S; i++) r[i] = (ylow * (r[i] + ((xsrc[i] * xlow + xend[i] * xhigh) >> 12U))) >> cscale; if (h) { xsrc += stride; xend += stride; for (size_t hcur = h; --hcur; xsrc += stride, xend += stride) { size_t p[S] = {0}; for (const unsigned char *xcur = xsrc + S; xcur < xend; xcur += S) for (size_t i = 0; i < S; i++) p[i] += xcur[i]; for (size_t i = 0; i < S; i++) r[i] += ((p[i] << 12U) + xsrc[i] * xlow + xend[i] * xhigh) >> cscale; } size_t p[S] = {0}; for (const unsigned char *xcur = xsrc + S; xcur < xend; xcur += S) for (size_t i = 0; i < S; i++) p[i] += xcur[i]; for (size_t i = 0; i < S; i++) r[i] += (yhigh * (p[i] + ((xsrc[i] * xlow + xend[i] * xhigh) >> 12U))) >> cscale; } for (size_t i = 0; i < S; i++) dst[i] = (r[i] * area) >> dscale; } } } void Texture::scale(unsigned char *U_RESTRICT src, size_t sw, size_t sh, size_t bpp, size_t pitch, unsigned char *U_RESTRICT dst, size_t dw, size_t dh) { if (sw == dw * 2 && sh == dh * 2) { switch (bpp) { case 1: return halve<1>(src, sw, sh, pitch, dst); case 2: return halve<2>(src, sw, sh, pitch, dst); case 3: return halve<3>(src, sw, sh, pitch, dst); case 4: return halve<4>(src, sw, sh, pitch, dst); } } else if (sw < dw || sh < dh || sw&(sw-1) || sh&(sh-1) || dw&(dw-1) || dh&(dh-1)) { switch (bpp) { case 1: return scale<1>(src, sw, sh, pitch, dst, dw, dh); case 2: return scale<2>(src, sw, sh, pitch, dst, dw, dh); case 3: return scale<3>(src, sw, sh, pitch, dst, dw, dh); case 4: return scale<4>(src, sw, sh, pitch, dst, dw, dh); } } else { switch (bpp) { case 1: return shift<1>(src, sw, sh, pitch, dst, dw, dh); case 2: return shift<2>(src, sw, sh, pitch, dst, dw, dh); case 3: return shift<3>(src, sw, sh, pitch, dst, dw, dh); case 4: return shift<4>(src, sw, sh, pitch, dst, dw, dh); } } } void Texture::reorient(unsigned char *U_RESTRICT src, size_t sw, size_t sh, size_t bpp, size_t stride, unsigned char *U_RESTRICT dst, bool flipx, bool flipy, bool swapxy) { int stridex = swapxy ? bpp * sh : bpp; int stridey = swapxy ? bpp : bpp * sw; if (flipx) dst += (sw - 1) * stridex, stridex = -stridex; if (flipy) dst += (sh - 1) * stridey, stridey = -stridey; unsigned char *srcrow = src; for (size_t i = 0; i < sh; i++) { for (unsigned char *curdst = dst, *src = srcrow, *end = srcrow + sw * bpp; src < end; ) { for (size_t k = 0; k < bpp; k++) curdst[k] = *src++; curdst += stridex; } srcrow += stride; dst += stridey; } } void Texture::flip(int flags) { u::vector<unsigned char> temp(m_data.size()); reorient(&m_data[0], m_width, m_height, m_bpp, m_pitch, &temp[0], flags & kFlipVertical, flags & kFlipHorizontal, false); m_data = u::move(temp); } void Texture::drawString(size_t &line, const char *string) { // Can't render into compressed textures or normal maps if (m_flags & kTexFlagCompressed || m_flags & kTexFlagNormal) return; u::vector<unsigned char> pixelData; size_t c = 0; // Avoid using m_bpp in the glyph's intermediate storage so that we // don't need to heap allocate it. const size_t glyphSize = 8*8*m_bpp; unsigned char glyph[8*8*4]; for (; *string; string++, c++) { memset(glyph, 0, glyphSize); unsigned char *prev = &glyph[8*8*m_bpp-1]; uint64_t n = 1; for (size_t h = 0; h < 8; h++) for (size_t w = 0; w < 8; w++, n += n) for (size_t k = 0; k < m_bpp; k++) *prev-- = (kFont[int(*string)] & n) ? 255 : 0; const size_t size = pixelData.size(); pixelData.resize(size + glyphSize); memcpy(&pixelData[size], glyph, glyphSize); } const size_t size = 8*c*8*m_bpp, offset = pixelData.size(); pixelData.resize(size + offset); for (size_t i = 0; i < c; i++) { unsigned char *s = &pixelData[8*i*8*m_bpp]; unsigned char *d = &pixelData[offset]+i*8*m_bpp; for (size_t h = 0; h < 8; h++, s+=8*m_bpp, d+=8*c*m_bpp) memcpy(d, s, 8*m_bpp); } for (size_t h = 0; h < 8; h++) { unsigned char *s = &pixelData[offset]+8*c*m_bpp*h; unsigned char *d = &m_data[0] + 8*m_pitch*line+m_pitch*h; // No way to render this information into the texture for there is no // available space to do so. if (d+8*c*m_bpp >= &m_data[m_data.size()]) break; memcpy(d, s, 8*c*m_bpp); } line++; // Recalculate hash string u::djbx33a hash(&m_data[0], m_data.size()); m_hashString = hash.hex(); } template <TextureFormat F> void Texture::convert() { if (F == m_format) return; if (F != kTexFormatRG && F != kTexFormatLuminance) { unsigned char *data = &m_data[0]; const size_t length = m_data.size(); // Converts BGR -> RGB or RGB -> BGR, or // BGRA -> RGBA or RGBA -> BGRA for (unsigned char *end = &data[length]; data < end; data += m_bpp) u::swap(data[0], data[2]); } else if (F == kTexFormatRG) { // Eliminate blue and alpha u::vector<unsigned char> rework; rework.reserve(m_width * m_height * 2); const size_t roff = (m_format == kTexFormatBGR || m_format == kTexFormatBGRA) ? 2 : 0; for (size_t i = 0; i < m_data.size(); i += m_bpp) { rework.push_back(m_data[i + roff]); // R rework.push_back(m_data[i + 1]); // G } // Eliminate the memory of the original texture and swap in the new one m_data.destroy(); m_data.swap(rework); m_bpp = 2; m_pitch = m_width * m_bpp; } else if (F == kTexFormatLuminance) { u::vector<unsigned char> rework; rework.reserve(m_width * m_height); // weight sum can be calculated as follows // 0.299 * R + 0.587 * G + 0.114 * B + 0.5 // convert this to integer domain // (2 * R + 5 * G + 1 * B) / 8 // then use the following bitwise calculation // (unsigned char)(((R << 1) + ((G << 2) + G) + B) >> 3) if (m_format == kTexFormatBGR || m_format == kTexFormatBGRA) { // Format is BGR[A] for (size_t i = 0; i < m_data.size(); i+= m_bpp) { const unsigned char R = m_data[i + 2]; const unsigned char G = m_data[i + 1]; const unsigned char B = m_data[i]; rework.push_back((unsigned char)((((R << 1) + ((G << 2) + G) + B)) >> 3)); } } else { // Format is RGB[A] for (size_t i = 0; i < m_data.size(); i+= m_bpp) { const unsigned char R = m_data[i]; const unsigned char G = m_data[i + 1]; const unsigned char B = m_data[i + 2]; rework.push_back((unsigned char)((((R << 1) + ((G << 2) + G) + B)) >> 3)); } } m_data.destroy(); m_data.swap(rework); m_bpp = 1; m_pitch = m_width; } // Update the format m_format = F; } template void Texture::convert<kTexFormatRG>(); template void Texture::convert<kTexFormatRGB>(); template void Texture::convert<kTexFormatRGBA>(); template void Texture::convert<kTexFormatLuminance>(); static inline float textureQualityScale(float quality) { // Add 0.5 to the mantissa then zero it. If the mantissa overflows, let // the carry bit carry into the exponent; thus increasing the exponent. // If the carry happens then the value is rounded up, otherwise it rounds // down. This also works +/- INF as well since INF has zero mantissa. m::floatShape u = { quality }; u.asInt += u::endianSwap(0x00400000u); u.asInt &= u::endianSwap(0xFF800000u); return u.asFloat; } template <typename T> bool Texture::decode(const u::vector<unsigned char> &data, const char *name, float quality) { auto decode = u::unique_ptr<T>(new T(data)); if (decode->status() != Decoder::kSuccess) { u::Log::err("[texture] => failed to decode `%s' %s\n", name, decode->error()); return false; } m_format = decode->format(); m_width = decode->width(); m_height = decode->height(); m_pitch = decode->pitch(); m_bpp = decode->bpp(); m_mips = decode->mips(); m_data = u::move(decode->data()); m_flags |= kTexFlagDisk; if (u::is_same<T, DDSDecoder>::value) { // Don't allow any post-load processes take place on DDS textures m_flags |= kTexFlagCompressed; } else { // Quality will resize the texture accordingly if (quality != 1.0f) { const float f = textureQualityScale(quality); size_t w = m_width * f; size_t h = m_height * f; if (w == 0) w = 1; if (h == 0) h = 1; resize(w, h); } // Premultiply alpha if ((m_flags & kTexFlagPremul) && (m_format == kTexFormatRGBA || m_format == kTexFormatBGRA)) { u::vector<unsigned char> rework; rework.reserve(m_width * m_height * m_bpp); for (size_t i = 0; i < m_data.size(); i += m_bpp) { const unsigned char A = m_data[i + 3]; rework.push_back(m_data[i + 0] * A / 255); rework.push_back(m_data[i + 1] * A / 255); rework.push_back(m_data[i + 2] * A / 255); rework.push_back(A); } m_data.destroy(); m_data.swap(rework); } // Hash the contents as well to generate a hash string u::djbx33a hash(&m_data[0], m_data.size()); m_hashString = hash.hex(); } return true; } void Texture::colorize(uint32_t color) { const uint8_t alpha = color & 0xFF; auto blend = [&alpha](uint32_t a, uint32_t b) { const uint32_t rb1 = ((0x100 - alpha) * (a & 0xFF00FF)) >> 8; const uint32_t rb2 = (alpha * (b & 0xFF00FF)) >> 8; const uint32_t g1 = ((0x100 - alpha) * (a & 0x00FF00)) >> 8; const uint32_t g2 = (alpha * (b & 0x00FF00)) >> 8; return ((rb1 | rb2) & 0xFF00FF) + ((g1 | g2) & 0x00FF00); }; U_ASSERT(m_format == kTexFormatBGR || m_format == kTexFormatBGRA || m_format == kTexFormatRGB || m_format == kTexFormatRGBA); for (size_t i = 0; i < m_data.size(); i += m_bpp) { uint8_t *R = nullptr; uint8_t *B = nullptr; uint8_t *G = &m_data[i+1]; if (m_format == kTexFormatBGR || m_format == kTexFormatBGRA) { R = &m_data[i + 2]; B = &m_data[i + 0]; } else { R = &m_data[i + 0]; B = &m_data[i + 2]; } // input color is RGBA, we need RGB int const uint8_t R_ = color >> 24; const uint8_t G_ = color >> 16; const uint8_t B_ = color >> 8; const uint32_t RGB = blend((*R << 16) | (*G << 8) | *B, (R_ << 16) | (G_ << 8) | B_); *R = (RGB >> 16) & 0xFF; *G = (RGB >> 8) & 0xFF; *B = RGB & 0xFF; } // Hash the contents as well to generate a hash string u::djbx33a hash(&m_data[0], m_data.size()); m_hashString = hash.hex(); } u::optional<u::string> Texture::find(const u::string &infile) { static struct { const char *name; int flag; } tags[] = { { "normal", kTexFlagNormal }, { "grey", kTexFlagGrey }, { "premul", kTexFlagPremul }, { "nocompress", kTexFlagNoCompress } }; u::string file = infile; for (auto beg = file.find('<'); beg != u::string::npos; beg = file.find('<')) { auto end = file.find('>'); if (end == u::string::npos) return u::none; const size_t length = end - beg - 1; for (const auto &it : tags) if (!strncmp(&file[beg+1], it.name, length)) m_flags |= it.flag; file.erase(beg, end+1); } static const char *kExtensions[] = { "png", "jpg", "tga", "dds", "pbm", "ppm", "pgm", "pnm", "pcx" }; size_t bits = 0; for (size_t i = 0; i < sizeof kExtensions / sizeof *kExtensions; i++) if (u::exists(u::format("%s.%s", file, kExtensions[i]))) bits |= (1 << i); if (bits == 0) return u::none; size_t index = 0; while (!(bits & 1)) { bits >>= 1; ++index; } return u::format("%s.%s", file, kExtensions[index]); } bool Texture::load(const u::string &file, float quality) { // Construct a texture from a file auto name = find(neoGamePath() + file); if (!name) return false; const char *fileName = (*name).c_str(); auto load = u::read(fileName, "rb"); if (!load) return false; u::vector<unsigned char> &data = *load; if (JPGDecoder::test(data)) return decode<JPGDecoder>(data, fileName, quality); else if (PNGDecoder::test(data)) return decode<PNGDecoder>(data, fileName, quality); else if (TGADecoder::test(data)) return decode<TGADecoder>(data, fileName, quality); else if (DDSDecoder::test(data)) return decode<DDSDecoder>(data, fileName, quality); else if (PNMDecoder::test(data)) return decode<PNMDecoder>(data, fileName, quality); else if (PCXDecoder::test(data)) return decode<PCXDecoder>(data, fileName, quality); u::Log::err("[texture] => no decoder found for `%s'\n", fileName); return false; } Texture::Texture(const unsigned char *const data, size_t length, size_t width, size_t height, bool normal, TextureFormat format, size_t mips) : m_width(width) , m_height(height) , m_mips(mips) , m_flags(normal ? kTexFlagNormal : 0) , m_format(format) { m_data.resize(length); memcpy(&m_data[0], data, length); switch (format) { case kTexFormatRGB: case kTexFormatBGR: m_bpp = 3; break; case kTexFormatRGBA: case kTexFormatBGRA: m_bpp = 4; break; case kTexFormatRG: m_bpp = 2; break; case kTexFormatLuminance: m_bpp = 1; break; default: // m_bpp and m_pitch get assigned zero here since compressed textures // don't really have them. If a compressed texture is operated on // as if it were not compressed, multiplications by m_bpp or m_pitch // will result in values of zero which will prevent those paths from // running. m_bpp = 0; m_pitch = 0; return; } m_pitch = m_width * m_bpp; } Texture::Texture(Texture &&other) : m_hashString(u::move(other.m_hashString)) , m_data(u::move(other.m_data)) , m_width(other.m_width) , m_height(other.m_height) , m_bpp(other.m_bpp) , m_pitch(other.m_pitch) , m_mips(other.m_mips) , m_flags(other.m_flags) , m_format(other.m_format) { } Texture::Texture(const Texture &other) : m_hashString(other.m_hashString) , m_data(other.m_data) , m_width(other.m_width) , m_height(other.m_height) , m_bpp(other.m_bpp) , m_pitch(other.m_pitch) , m_mips(other.m_mips) , m_flags(other.m_flags) , m_format(other.m_format) { } Texture &Texture::operator=(Texture &&other) { m_hashString = u::move(other.m_hashString); m_data = u::move(other.m_data); m_width = other.m_width; m_height = other.m_height; m_bpp = other.m_bpp; m_pitch = other.m_pitch; m_mips = other.m_mips; m_flags = other.m_flags; m_format = other.m_format; return *this; } void Texture::writeTGA(u::vector<unsigned char> &outData) { TGADecoder::Header hdr; memset(&hdr, 0, sizeof hdr); outData.resize(sizeof hdr); hdr.pixelSize = m_bpp*8; hdr.width[0] = m_width & 0xFF; hdr.width[1] = (m_width >> 8) & 0xFF; hdr.height[0] = m_height & 0xFF; hdr.height[1] = (m_height >> 8) & 0xFF; hdr.imageType = tex_tga_compress ? 10 : 2; memcpy(&outData[0], &hdr, sizeof hdr); outData.reserve(outData.size() * m_width*m_height*3); unsigned char buffer[128*4]; for (size_t i = 0; i < m_height; i++) { unsigned char *src = &m_data[0] + (m_height - i - 1) * m_pitch; for (int remaining = int(m_width); remaining > 0; ) { int raw = 1; if (tex_tga_compress) { int run = 1; for (unsigned char *scan = src; run < u::min(remaining, 128); run++) { scan += m_bpp; if (src[0] != scan[0] || src[1] != scan[1] || src[2] != scan[2] || (m_bpp == 4 && src[3] != scan[3])) break; } if (run > 1) { outData.push_back(0x80 | (run - 1)); for (int i = 2; i >= 0; i--) outData.push_back(src[i]); if (m_bpp == 4) outData.push_back(src[3]); src += run*m_bpp; remaining -= run; if (remaining <= 0) break; } for (const unsigned char *scan = src; raw < u::min(remaining, 128); raw++) { scan += m_bpp; if (src[0] == scan[0] || src[1] == scan[1] || src[2] == scan[2] || (m_bpp != 4 && src[3] == scan[3])) break; } outData.push_back(raw - 1); } else { raw = u::min(remaining, 128); } unsigned char *dst = buffer; for (int j = 0; j < raw; j++) { for (int v = 2; v >= 0; v--) dst[2-v] = src[v]; if (m_bpp == 4) dst[3] = src[3]; dst += m_bpp; src += m_bpp; } for (size_t j = 0; j < raw*m_bpp; j++) outData.push_back(buffer[j]); remaining -= raw; } } } template <typename T> static inline void memput(unsigned char *&store, const T &data) { memcpy(store, &data, sizeof data); store += sizeof data; } void Texture::writeBMP(u::vector<unsigned char> &outData) { struct { char bfType[2]; int32_t bfSize; int32_t bfReserved; int32_t bfDataOffset; int32_t biSize; int32_t biWidth; int32_t biHeight; int16_t biPlanes; int16_t biBitCount; int32_t biCompression; int32_t biSizeImage; int32_t biXPelsPerMeter; int32_t biYPelsPerMeter; int32_t biClrUsed; int32_t biClrImportant; void endianSwap() { bfSize = u::endianSwap(bfSize); bfReserved = u::endianSwap(bfReserved); bfDataOffset = u::endianSwap(bfDataOffset); biSize = u::endianSwap(biSize); biWidth = u::endianSwap(biWidth); biHeight = u::endianSwap(biHeight); biPlanes = u::endianSwap(biPlanes); biBitCount = u::endianSwap(biBitCount); biCompression = u::endianSwap(biCompression); biSizeImage = u::endianSwap(biSizeImage); biXPelsPerMeter = u::endianSwap(biXPelsPerMeter); biYPelsPerMeter = u::endianSwap(biYPelsPerMeter); biClrUsed = u::endianSwap(biClrUsed); biClrImportant = u::endianSwap(biClrImportant); } } bmph; const size_t bytesPerLine = (3 * (m_width + 1) / 4) * 4; const size_t headerSize = 54; const size_t imageSize = bytesPerLine * m_height; const size_t dataSize = headerSize + imageSize; // Populate header memcpy(bmph.bfType, (const void *)"BM", 2); bmph.bfSize = dataSize; bmph.bfReserved = 0; bmph.bfDataOffset = headerSize; bmph.biSize = 40; bmph.biWidth = m_width; bmph.biHeight = m_height; bmph.biPlanes = 1; bmph.biBitCount = 24; bmph.biCompression = 0; bmph.biSizeImage = imageSize; bmph.biXPelsPerMeter = 0; bmph.biYPelsPerMeter = 0; bmph.biClrUsed = 0; bmph.biClrImportant = 0; // line and data buffer u::vector<unsigned char> line(bytesPerLine); outData.resize(dataSize); bmph.endianSwap(); unsigned char *store = &outData[0]; memput(store, bmph.bfType); memput(store, bmph.bfSize); memput(store, bmph.bfReserved); memput(store, bmph.bfDataOffset); memput(store, bmph.biSize); memput(store, bmph.biWidth); memput(store, bmph.biHeight); memput(store, bmph.biPlanes); memput(store, bmph.biBitCount); memput(store, bmph.biCompression); memput(store, bmph.biSizeImage); memput(store, bmph.biXPelsPerMeter); memput(store, bmph.biYPelsPerMeter); memput(store, bmph.biClrUsed); memput(store, bmph.biClrImportant); // Write the bitmap for (int i = int(m_height) - 1; i >= 0; i--) { for (int j = 0; j < int(m_width); j++) { const int ipos = 3 * (m_width * i + j); line[3*j] = m_data[ipos + 2]; line[3*j+1] = m_data[ipos + 1]; line[3*j+2] = m_data[ipos]; } memcpy(store, &line[0], line.size()); store += line.size(); } } void Texture::writePNG(u::vector<unsigned char> &outData) { static constexpr int kMapping[] = { 0, 1, 2, 3, 4 }; static constexpr int kFirstMapping[] = { 0, 1, 0, 5, 6 }; u::vector<unsigned char> filter((m_width*m_bpp+1)*m_height); u::vector<signed char> lineBuffer(m_width*m_bpp); for (size_t j = 0; j < m_height; ++j) { const int *map = j ? kMapping : kFirstMapping; int best = 0; int bestValue = 0x7FFFFFFF; for (int p = 0; p < 2; ++p) { for (int k = p ? best : 0; k < 5; ++k) { const int type = map[k]; int estimate = 0; const unsigned char *const z = &m_data[0] + m_pitch*j; const size_t s = m_bpp*m_width; const size_t b = m_bpp; size_t i = 0; switch (type) { case 0: while (i < s) lineBuffer[i] = z[i], i++; break; case 1: while (i < b) lineBuffer[i] = z[i], i++; while (i < s) lineBuffer[i] = z[i] - z[i-m_bpp], i++; break; case 2: while (i < s) lineBuffer[i] = z[i] - z[i-m_pitch], i++; break; case 3: while (i < b) lineBuffer[i] = z[i] - (z[i-m_pitch]>>1), i++; while (i < s) lineBuffer[i] = z[i] - ((z[i-m_bpp] + z[i-m_pitch])>>1), i++; break; case 4: while (i < b) lineBuffer[i] = (signed char)(z[i] - PNGDecoder::paethPredictor(0, z[i-m_pitch], 0)), i++; while (i < s) lineBuffer[i] = z[i] - PNGDecoder::paethPredictor(z[i-m_bpp], z[i-m_pitch], z[i-m_pitch-m_bpp]), i++; break; case 5: while (i < b) lineBuffer[i] = z[i], i++; while (i < s) lineBuffer[i] = z[i] - (z[i-m_bpp]>>1), i++; break; case 6: while (i < b) lineBuffer[i] = z[i], i++; while (i < s) lineBuffer[i] = z[i] - PNGDecoder::paethPredictor(z[i-m_bpp], 0, 0), i++; break; } if (p) break; for (size_t i = 0; i < m_width*m_bpp; ++i) estimate += abs((signed char)lineBuffer[i]); if (estimate < bestValue) { bestValue = estimate; best = k; } } } // Got filter type filter[j*(m_width*m_bpp+1)] = (unsigned char)best; u::moveMemory(&filter[0]+j*(m_width*m_bpp+1)+1, &lineBuffer[0], m_width*m_bpp); } u::vector<unsigned char> compressed; u::zlib::compress(compressed, filter, tex_png_compress_quality); outData.resize(8+12+13+12+12+compressed.size()); unsigned char *store = &outData[0]; auto write = [&store](uint32_t data) { *store++ = (data >> 24) & 0xFF; *store++ = (data >> 16) & 0xFF; *store++ = (data >> 8) & 0xFF; *store++ = data & 0xFF; }; auto tag = [&store](const char *data) { *store++ = data[0]; *store++ = data[1]; *store++ = data[2]; *store++ = data[3]; }; auto crc = [&write](unsigned char *data, size_t length) { write(u::crc32(data - length - 4, length + 4)); }; // magic + header length memcpy(store, PNGDecoder::kMagic, 8); store += 8; write(13); // write header static constexpr int kType[] = { -1, 0, 4, 2, 6 }; tag("IHDR"); write(m_width); write(m_height); *store++ = 8; *store++ = kType[m_bpp]; *store++ = 0; *store++ = 0; *store++ = 0; crc(store, 13); write(compressed.size()); tag("IDAT"); u::moveMemory(store, &compressed[0], compressed.size()); store += compressed.size(); crc(store, compressed.size()); write(0); tag("IEND"); crc(store, 0); } // writes JPEG baseline (no progressive) // supports luminance, rg, bgr,rgb, bgra,rgba by always outputting YCbCr // fixed huffman tables generated by averaging the common suffix/prefixes for // each Y,Cb,Cr "smear" for a bunch of art assets void Texture::writeJPG(u::vector<unsigned char> &outData) { int quality = tex_jpg_compress_quality; quality = quality < 1 ? 1 : quality > 100 ? 100 : quality; quality = quality < 50 ? 5000 / quality : 200 - quality * 2; static const uint8_t kDLC[] = "\x0\x0\x1\x5\x1\x1\x1\x1\x1\x1\x0\x0\x0\x0\x0\x0\x00"; // dc luma codes static const uint8_t kDCC[] = "\x0\x0\x3\x1\x1\x1\x1\x1\x1\x1\x1\x1\x0\x0\x0\x0\x00"; // dc chroma codes static const uint8_t kALC[] = "\x0\x0\x2\x1\x3\x3\x2\x4\x3\x5\x5\x4\x4\x0\x0\x1\x7d"; // ac luma codes static const uint8_t kACC[] = "\x0\x0\x2\x1\x2\x4\x4\x3\x4\x7\x5\x4\x4\x0\x1\x2\x77"; // ac chroma codes static const uint8_t kZig[] = "\x00\x01\x05\x06\x0e\x0f\x1b\x1c\x02\x04\x07\x0d\x10\x1a\x1d\x2a" // zig zag pattern "\x03\x08\x0c\x11\x19\x1e\x29\x2b\x09\x0b\x12\x18\x1f\x28\x2c\x35" "\x0a\x13\x17\x20\x27\x2d\x34\x36\x14\x16\x21\x26\x2e\x33\x37\x3c" "\x15\x22\x25\x2f\x32\x38\x3b\x3d\x23\x24\x30\x31\x39\x3a\x3e\x3f"; static const uint8_t kYQT[] = "\x10\x0b\x0a\x10\x18\x28\x33\x3d\x0c\x0c\x0e\x13\x1a\x3a\x3c\x37" // y generator "\x0e\x0d\x10\x18\x28\x39\x45\x38\x0e\x11\x16\x1d\x33\x57\x50\x3e" "\x12\x16\x25\x38\x44\x6d\x67\x4d\x18\x23\x37\x40\x51\x68\x71\x5c" "\x31\x40\x4e\x57\x67\x79\x78\x65\x48\x5c\x5f\x62\x70\x64\x67\x63"; static const uint8_t kUQT[] = "\x11\x12\x18\x2f\x63\x63\x63\x63\x12\x15\x1a\x42\x63\x63\x63\x63" // u&v generator "\x18\x1a\x38\x63\x63\x63\x63\x63\x2f\x42\x63\x63\x63\x63\x63\x63" "\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63" "\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63"; static const uint8_t kALV[] = "\x01\x02\x03\x00\x04\x11\x05\x12\x21\x31\x41\x06\x13\x51\x61\x07\x22\x71" // ac luma values "\x14\x32\x81\x91\xa1\x08\x23\x42\xb1\xc1\x15\x52\xd1\xf0\x24\x33\x62\x72" "\x82\x09\x0a\x16\x17\x18\x19\x1a\x25\x26\x27\x28\x29\x2a\x34\x35\x36\x37" "\x38\x39\x3a\x43\x44\x45\x46\x47\x48\x49\x4a\x53\x54\x55\x56\x57\x58\x59" "\x5a\x63\x64\x65\x66\x67\x68\x69\x6a\x73\x74\x75\x76\x77\x78\x79\x7a\x83" "\x84\x85\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a\xa2\xa3" "\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xc2\xc3" "\xc4\xc5\xc6\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xe1\xe2" "\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa"; static const uint8_t kACV[] = "\x00\x01\x02\x03\x11\x04\x05\x21\x31\x06\x12\x41\x51\x07\x61\x71\x13\x22" // ac chroma values "\x32\x81\x08\x14\x42\x91\xa1\xb1\xc1\x09\x23\x33\x52\xf0\x15\x62\x72\xd1" "\x0a\x16\x24\x34\xe1\x25\xf1\x17\x18\x19\x1a\x26\x27\x28\x29\x2a\x35\x36" "\x37\x38\x39\x3a\x43\x44\x45\x46\x47\x48\x49\x4a\x53\x54\x55\x56\x57\x58" "\x59\x5a\x63\x64\x65\x66\x67\x68\x69\x6a\x73\x74\x75\x76\x77\x78\x79\x7a" "\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a" "\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba" "\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda" "\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa"; // fixed huffman tables static const uint16_t kYUDCHT[2][12][2] = { { { 0x0000, 0x0002 }, { 0x0002, 0x0003 }, { 0x0003, 0x0003 }, { 0x0004, 0x0003 }, { 0x0005, 0x0003 }, { 0x0006, 0x0003 }, { 0x000e, 0x0004 }, { 0x001e, 0x0005 }, { 0x003e, 0x0006 }, { 0x007e, 0x0007 }, { 0x00fe, 0x0008 }, { 0x01fe, 0x0009 } }, { { 0x0000, 0x0002 }, { 0x0001, 0x0002 }, { 0x0002, 0x0002 }, { 0x0006, 0x0003 }, { 0x000e, 0x0004 }, { 0x001e, 0x0005 }, { 0x003e, 0x0006 }, { 0x007e, 0x0007 }, { 0x00fe, 0x0008 }, { 0x01fe, 0x0009 }, { 0x03fe, 0x000a }, { 0x07fe, 0x000b } } }; static const uint16_t kYACHT[256][2] = { { 0x000a, 0x0004 }, { 0x0000, 0x0002 }, { 0x0001, 0x0002 }, { 0x0004, 0x0003 }, { 0x000b, 0x0004 }, { 0x001a, 0x0005 }, { 0x0078, 0x0007 }, { 0x00f8, 0x0008 }, { 0x03f6, 0x000a }, { 0xff82, 0x0010 }, { 0xff83, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x000c, 0x0004 }, { 0x001b, 0x0005 }, { 0x0079, 0x0007 }, { 0x01f6, 0x0009 }, { 0x07f6, 0x000b }, { 0xff84, 0x0010 }, { 0xff85, 0x0010 }, { 0xff86, 0x0010 }, { 0xff87, 0x0010 }, { 0xff88, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x001c, 0x0005 }, { 0x00f9, 0x0008 }, { 0x03f7, 0x000a }, { 0x0ff4, 0x000c }, { 0xff89, 0x0010 }, { 0xff8a, 0x0010 }, { 0xff8b, 0x0010 }, { 0xff8c, 0x0010 }, { 0xff8d, 0x0010 }, { 0xff8e, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x003a, 0x0006 }, { 0x01f7, 0x0009 }, { 0x0ff5, 0x000c }, { 0xff8f, 0x0010 }, { 0xff90, 0x0010 }, { 0xff91, 0x0010 }, { 0xff92, 0x0010 }, { 0xff93, 0x0010 }, { 0xff94, 0x0010 }, { 0xff95, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x003b, 0x0006 }, { 0x03f8, 0x000a }, { 0xff96, 0x0010 }, { 0xff97, 0x0010 }, { 0xff98, 0x0010 }, { 0xff99, 0x0010 }, { 0xff9a, 0x0010 }, { 0xff9b, 0x0010 }, { 0xff9c, 0x0010 }, { 0xff9d, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x007a, 0x0007 }, { 0x07f7, 0x000b }, { 0xff9e, 0x0010 }, { 0xff9f, 0x0010 }, { 0xffa0, 0x0010 }, { 0xffa1, 0x0010 }, { 0xffa2, 0x0010 }, { 0xffa3, 0x0010 }, { 0xffa4, 0x0010 }, { 0xffa5, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x007b, 0x0007 }, { 0x0ff6, 0x000c }, { 0xffa6, 0x0010 }, { 0xffa7, 0x0010 }, { 0xffa8, 0x0010 }, { 0xffa9, 0x0010 }, { 0xffaa, 0x0010 }, { 0xffab, 0x0010 }, { 0xffac, 0x0010 }, { 0xffad, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x00fa, 0x0008 }, { 0x0ff7, 0x000c }, { 0xffae, 0x0010 }, { 0xffaf, 0x0010 }, { 0xffb0, 0x0010 }, { 0xffb1, 0x0010 }, { 0xffb2, 0x0010 }, { 0xffb3, 0x0010 }, { 0xffb4, 0x0010 }, { 0xffb5, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x01f8, 0x0009 }, { 0x7fc0, 0x000f }, { 0xffb6, 0x0010 }, { 0xffb7, 0x0010 }, { 0xffb8, 0x0010 }, { 0xffb9, 0x0010 }, { 0xffba, 0x0010 }, { 0xffbb, 0x0010 }, { 0xffbc, 0x0010 }, { 0xffbd, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x01f9, 0x0009 }, { 0xffbe, 0x0010 }, { 0xffbf, 0x0010 }, { 0xffc0, 0x0010 }, { 0xffc1, 0x0010 }, { 0xffc2, 0x0010 }, { 0xffc3, 0x0010 }, { 0xffc4, 0x0010 }, { 0xffc5, 0x0010 }, { 0xffc6, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x01fa, 0x0009 }, { 0xffc7, 0x0010 }, { 0xffc8, 0x0010 }, { 0xffc9, 0x0010 }, { 0xffca, 0x0010 }, { 0xffcb, 0x0010 }, { 0xffcc, 0x0010 }, { 0xffcd, 0x0010 }, { 0xffce, 0x0010 }, { 0xffcf, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x03f9, 0x000a }, { 0xffd0, 0x0010 }, { 0xffd1, 0x0010 }, { 0xffd2, 0x0010 }, { 0xffd3, 0x0010 }, { 0xffd4, 0x0010 }, { 0xffd5, 0x0010 }, { 0xffd6, 0x0010 }, { 0xffd7, 0x0010 }, { 0xffd8, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x03fa, 0x000a }, { 0xffd9, 0x0010 }, { 0xffda, 0x0010 }, { 0xffdb, 0x0010 }, { 0xffdc, 0x0010 }, { 0xffdd, 0x0010 }, { 0xffde, 0x0010 }, { 0xffdf, 0x0010 }, { 0xffe0, 0x0010 }, { 0xffe1, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x07f8, 0x000b }, { 0xffe2, 0x0010 }, { 0xffe3, 0x0010 }, { 0xffe4, 0x0010 }, { 0xffe5, 0x0010 }, { 0xffe6, 0x0010 }, { 0xffe7, 0x0010 }, { 0xffe8, 0x0010 }, { 0xffe9, 0x0010 }, { 0xffea, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0xffeb, 0x0010 }, { 0xffec, 0x0010 }, { 0xffed, 0x0010 }, { 0xffee, 0x0010 }, { 0xffef, 0x0010 }, { 0xfff0, 0x0010 }, { 0xfff1, 0x0010 }, { 0xfff2, 0x0010 }, { 0xfff3, 0x0010 }, { 0xfff4, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x07f9, 0x000b }, { 0xfff5, 0x0010 }, { 0xfff6, 0x0010 }, { 0xfff7, 0x0010 }, { 0xfff8, 0x0010 }, { 0xfff9, 0x0010 }, { 0xfffa, 0x0010 }, { 0xfffb, 0x0010 }, { 0xfffc, 0x0010 }, { 0xfffd, 0x0010 }, { 0xfffe, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 } }; static const uint16_t kUACHT[256][2] = { { 0x0000, 0x0002 }, { 0x0001, 0x0002 }, { 0x0004, 0x0003 }, { 0x000a, 0x0004 }, { 0x0018, 0x0005 }, { 0x0019, 0x0005 }, { 0x0038, 0x0006 }, { 0x0078, 0x0007 }, { 0x01f4, 0x0009 }, { 0x03f6, 0x000a }, { 0x0ff4, 0x000c }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x000b, 0x0004 }, { 0x0039, 0x0006 }, { 0x00f6, 0x0008 }, { 0x01f5, 0x0009 }, { 0x07f6, 0x000b }, { 0x0ff5, 0x000c }, { 0xff88, 0x0010 }, { 0xff89, 0x0010 }, { 0xff8a, 0x0010 }, { 0xff8b, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x001a, 0x0005 }, { 0x00f7, 0x0008 }, { 0x03f7, 0x000a }, { 0x0ff6, 0x000c }, { 0x7fc2, 0x000f }, { 0xff8c, 0x0010 }, { 0xff8d, 0x0010 }, { 0xff8e, 0x0010 }, { 0xff8f, 0x0010 }, { 0xff90, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x001b, 0x0005 }, { 0x00f8, 0x0008 }, { 0x03f8, 0x000a }, { 0x0ff7, 0x000c }, { 0xff91, 0x0010 }, { 0xff92, 0x0010 }, { 0xff93, 0x0010 }, { 0xff94, 0x0010 }, { 0xff95, 0x0010 }, { 0xff96, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x003a, 0x0006 }, { 0x01f6, 0x0009 }, { 0xff97, 0x0010 }, { 0xff98, 0x0010 }, { 0xff99, 0x0010 }, { 0xff9a, 0x0010 }, { 0xff9b, 0x0010 }, { 0xff9c, 0x0010 }, { 0xff9d, 0x0010 }, { 0xff9e, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x003b, 0x0006 }, { 0x03f9, 0x000a }, { 0xff9f, 0x0010 }, { 0xffa0, 0x0010 }, { 0xffa1, 0x0010 }, { 0xffa2, 0x0010 }, { 0xffa3, 0x0010 }, { 0xffa4, 0x0010 }, { 0xffa5, 0x0010 }, { 0xffa6, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0079, 0x0007 }, { 0x07f7, 0x000b }, { 0xffa7, 0x0010 }, { 0xffa8, 0x0010 }, { 0xffa9, 0x0010 }, { 0xffaa, 0x0010 }, { 0xffab, 0x0010 }, { 0xffac, 0x0010 }, { 0xffad, 0x0010 }, { 0xffae, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x007a, 0x0007 }, { 0x07f8, 0x000b }, { 0xffaf, 0x0010 }, { 0xffb0, 0x0010 }, { 0xffb1, 0x0010 }, { 0xffb2, 0x0010 }, { 0xffb3, 0x0010 }, { 0xffb4, 0x0010 }, { 0xffb5, 0x0010 }, { 0xffb6, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x00f9, 0x0008 }, { 0xffb7, 0x0010 }, { 0xffb8, 0x0010 }, { 0xffb9, 0x0010 }, { 0xffba, 0x0010 }, { 0xffbb, 0x0010 }, { 0xffbc, 0x0010 }, { 0xffbd, 0x0010 }, { 0xffbe, 0x0010 }, { 0xffbf, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x01f7, 0x0009 }, { 0xffc0, 0x0010 }, { 0xffc1, 0x0010 }, { 0xffc2, 0x0010 }, { 0xffc3, 0x0010 }, { 0xffc4, 0x0010 }, { 0xffc5, 0x0010 }, { 0xffc6, 0x0010 }, { 0xffc7, 0x0010 }, { 0xffc8, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x01f8, 0x0009 }, { 0xffc9, 0x0010 }, { 0xffca, 0x0010 }, { 0xffcb, 0x0010 }, { 0xffcc, 0x0010 }, { 0xffcd, 0x0010 }, { 0xffce, 0x0010 }, { 0xffcf, 0x0010 }, { 0xffd0, 0x0010 }, { 0xffd1, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x01f9, 0x0009 }, { 0xffd2, 0x0010 }, { 0xffd3, 0x0010 }, { 0xffd4, 0x0010 }, { 0xffd5, 0x0010 }, { 0xffd6, 0x0010 }, { 0xffd7, 0x0010 }, { 0xffd8, 0x0010 }, { 0xffd9, 0x0010 }, { 0xffda, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x01fa, 0x0009 }, { 0xffdb, 0x0010 }, { 0xffdc, 0x0010 }, { 0xffdd, 0x0010 }, { 0xffde, 0x0010 }, { 0xffdf, 0x0010 }, { 0xffe0, 0x0010 }, { 0xffe1, 0x0010 }, { 0xffe2, 0x0010 }, { 0xffe3, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x07f9, 0x000b }, { 0xffe4, 0x0010 }, { 0xffe5, 0x0010 }, { 0xffe6, 0x0010 }, { 0xffe7, 0x0010 }, { 0xffe8, 0x0010 }, { 0xffe9, 0x0010 }, { 0xffea, 0x0010 }, { 0xffeb, 0x0010 }, { 0xffec, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x3fe0, 0x000e }, { 0xffed, 0x0010 }, { 0xffee, 0x0010 }, { 0xffef, 0x0010 }, { 0xfff0, 0x0010 }, { 0xfff1, 0x0010 }, { 0xfff2, 0x0010 }, { 0xfff3, 0x0010 }, { 0xfff4, 0x0010 }, { 0xfff5, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x03fa, 0x000a }, { 0x7fc3, 0x000f }, { 0xfff6, 0x0010 }, { 0xfff7, 0x0010 }, { 0xfff8, 0x0010 }, { 0xfff9, 0x0010 }, { 0xfffa, 0x0010 }, { 0xfffb, 0x0010 }, { 0xfffc, 0x0010 }, { 0xfffd, 0x0010 }, { 0xfffe, 0x0010 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 }, { 0x0000, 0x0000 } }; uint8_t yTable[64]; uint8_t uTable[64]; for (size_t i = 0; i < 64; i++) { yTable[kZig[i]] = m::clamp((kYQT[i] * quality + 50) / 100, 1, 255); uTable[kZig[i]] = m::clamp((kUQT[i] * quality + 50) / 100, 1, 255); } static const float kSample[] = { 1.000000000f * 2.828427125f, 1.387039845f * 2.828427125f, 1.306562965f * 2.828427125f, 1.175875602f * 2.828427125f, 1.000000000f * 2.828427125f, 0.785694958f * 2.828427125f, 0.541196100f * 2.828427125f, 0.275899379f * 2.828427125f }; float fyTable[64]; float fuTable[64]; for (size_t r = 0, k = 0; r < 8; r++) { for (size_t c = 0; c < 8; c++, k++) { fyTable[k] = 1.0f / (yTable[kZig[k]] * kSample[r] * kSample[c]); fuTable[k] = 1.0f / (uTable[kZig[k]] * kSample[r] * kSample[c]); } } auto writeBytes = [&outData](const u::initializer_list<uint8_t> &values) { for (const auto& value : values) outData.push_back(value); }; int bitBuffer = 0; int bitCount = 0; auto writeBits = [&](const uint16_t (&bits)[2]) { bitCount += bits[1]; bitBuffer |= bits[0] << (24 - bitCount); while (bitCount >= 8) { const uint8_t byte = (bitBuffer >> 16) & 255; outData.push_back(byte); if (byte == 255) outData.push_back(0); bitBuffer <<= 8; bitCount -= 8; } }; auto process = [&](float *c, float *table, int dc, const uint16_t (&htdc)[12][2], const uint16_t (&htac)[256][2]) { const uint16_t eob[2] = { htac[0x00][0], htac[0x00][1] }; const uint16_t m16[2] = { htac[0xF0][0], htac[0xF0][1] }; auto calcBits = [](int value, uint16_t (&bits)[2]) { int t = abs(value); int m = value < 0 ? value - 1 : value; bits[1] = 1; while (t >>= 1) bits[1]++; bits[0] = m & ((1 << bits[1]) - 1); }; auto dct = [](float &d0, float &d1, float &d2, float &d3, float &d4, float &d5, float &d6, float &d7) { const float t0 = d0 + d7, t7 = d0 - d7; const float t1 = d1 + d6, t6 = d1 - d6; const float t2 = d2 + d5, t5 = d2 - d5; const float t3 = d3 + d4, t4 = d3 - d4; // event part float t10 = t0 + t3, t13 = t0 - t3; // phase 2 float t11 = t1 + t2, t12 = t1 - t2; d0 = t10 + t11; // phase 3 d4 = t10 - t11; const float z1 = (t12 + t13) * 0.707106781f; // c4 d2 = t13 + z1; // phase 5 d6 = t13 - z1; // odd part t10 = t4 + t5; // phase 2 t11 = t5 + t6; t12 = t6 + t7; const float z5 = (t10 - t12) * 0.382683433f; // c6 const float z2 = t10 * 0.541196100f + z5; // c2-c6 const float z4 = t12 * 1.306562965f + z5; // c2+c6 const float z3 = t11 * 0.707106781f; // c4 const float z11 = t7 + z3; // phase 5 const float z13 = t7 - z3; d5 = z13 + z2; // phase 6 d3 = z13 - z2; d1 = z11 + z4; d7 = z11 - z4; }; dct(c[0], c[0+1], c[0+2], c[0+3], c[0+4], c[0+5], c[0+6], c[0+7]); dct(c[8], c[8+1], c[8+2], c[8+3], c[8+4], c[8+5], c[8+6], c[8+7]); dct(c[16], c[16+1], c[16+2], c[16+3], c[16+4], c[16+5], c[16+6], c[16+7]); dct(c[24], c[24+1], c[24+2], c[24+3], c[24+4], c[24+5], c[24+6], c[24+7]); dct(c[32], c[32+1], c[32+2], c[32+3], c[32+4], c[32+5], c[32+6], c[32+7]); dct(c[40], c[40+1], c[40+2], c[40+3], c[40+4], c[40+5], c[40+6], c[40+7]); dct(c[48], c[48+1], c[48+2], c[48+3], c[48+4], c[48+5], c[48+6], c[48+7]); dct(c[56], c[56+1], c[56+2], c[56+3], c[56+4], c[56+5], c[56+6], c[56+7]); dct(c[0], c[0+8], c[0+16], c[0+24], c[0+32], c[0+40], c[0+48], c[0+56]); dct(c[1], c[1+8], c[1+16], c[1+24], c[1+32], c[1+40], c[1+48], c[1+56]); dct(c[2], c[2+8], c[2+16], c[2+24], c[2+32], c[2+40], c[2+48], c[2+56]); dct(c[3], c[3+8], c[3+16], c[3+24], c[3+32], c[3+40], c[3+48], c[3+56]); dct(c[4], c[4+8], c[4+16], c[4+24], c[4+32], c[4+40], c[4+48], c[4+56]); dct(c[5], c[5+8], c[5+16], c[5+24], c[5+32], c[5+40], c[5+48], c[5+56]); dct(c[6], c[6+8], c[6+16], c[6+24], c[6+32], c[6+40], c[6+48], c[6+56]); dct(c[7], c[7+8], c[7+16], c[7+24], c[7+32], c[7+40], c[7+48], c[7+56]); // quantize the coefficients int du[64]; for (size_t i = 0; i < 64; i++) { const float v = c[i] * table[i]; du[kZig[i]] = v < 0.0f ? m::ceil(v - 0.5f) : m::floor(v + 0.5f); } // encode DC int difference = du[0] - dc; if (difference) { uint16_t bits[2]; calcBits(difference, bits); const uint16_t index = bits[1]; static const uint16_t kZeroBits[2] = { 0, 0 }; writeBits(index < 12 ? (const uint16_t (&)[2])htdc[index] : kZeroBits); writeBits(bits); } else { writeBits(htdc[0]); } // encode ACs int end = 63; for (; end > 0 && !du[end]; --end) ; if (!end) { writeBits(eob); return du[0]; } for (int i = 1; i <= end; i++) { int beg = i; for (; !du[i] && i <= end; i++) ; int zeroes = i - beg; if (zeroes >= 16) { int length = zeroes >> 4; for (int m = 1; m <= length; m++) writeBits(m16); zeroes &= 15; } uint16_t bits[2]; calcBits(du[i], bits); writeBits(htac[(zeroes << 4) + bits[1]]); writeBits(bits); } if (end != 63) writeBits(eob); return du[0]; }; const uint8_t hHi = m_height >> 8; const uint8_t hLo = m_height & 0xFF; const uint8_t wHi = m_width >> 8; const uint8_t wLo = m_width & 0xFF; writeBytes({0xFF, 0xD8}); // SOI writeBytes({0xFF, 0xE0}); // APP0 writeBytes({0x00, 0x10}); // APP0 (length) 16 bytes writeBytes({'J','F','I','F'}); // APP0 (identifier) writeBytes({0x00}); // APP0 (density units) 0 = no units; writeBytes({0x01, 0x01}); // APP0 (Xdensity) 257 writeBytes({0x00, 0x00}); // APP0 (Ydensity) 0 writeBytes({0x01}); // APP0 (Xthumbnail) 1 writeBytes({0x00}); // APP0 (Ythumbnail) 0 writeBytes({0x01, 0x00, 0x00}); // APP0 (thumbnail data) writeBytes({0xFF, 0xDB}); // DQT writeBytes({0x00, 0x84}); // DQT length outData.push_back(0x00); // DQT information (y table) outData.insert(outData.end(), yTable, yTable + sizeof yTable); outData.push_back(0x01); // DQT information (u table) outData.insert(outData.end(), uTable, uTable + sizeof uTable); writeBytes({0xFF, 0xC0}); // SOF0 writeBytes({0x00, 0x11}); // SOF0 (length) 17 bytes writeBytes({0x08}); // SOF0 (data precision) 8 bits writeBytes({hHi, hLo}); // SOF0 (image height) writeBytes({wHi, wLo}); // SOF0 (image width) writeBytes({0x03}); // SOF0 (number of components 3=YCbCr) writeBytes({0x01, 0x11, 0x00}); // SOF0 (component read order for Y) writeBytes({0x02, 0x11, 0x01}); // SOF0 (component read order for Cb) writeBytes({0x03, 0x11, 0x01}); // SOF0 (component read order for Cr) writeBytes({0xFF, 0xC4}); // DHT writeBytes({0x01, 0xA2}); // DHT (length) 41473 bytes outData.push_back(0x00); // DC luma info outData.insert(outData.end(), kDLC + 1, kDLC + sizeof kDLC - 1); for (uint8_t i = 0; i < 12; i++) outData.push_back(i); // dc luma values outData.push_back(0x10); // AC luma info outData.insert(outData.end(), kALC + 1, kALC + sizeof kALC - 1); outData.insert(outData.end(), kALV, kALV + sizeof kALV - 1); outData.push_back(0x01); // DC chroma info outData.insert(outData.end(), kDCC + 1, kDCC + sizeof kDCC - 1); for (uint8_t i = 0; i < 12; i++) outData.push_back(i); // dc chroma values outData.push_back(0x11); // AC chroma info outData.insert(outData.end(), kACC + 1, kACC + sizeof kACC - 1); outData.insert(outData.end(), kACV, kACV + sizeof kACV - 1); writeBytes({0xFF, 0xDA}); // SOS writeBytes({0x00, 0x0C}); // SOS (length) 3072 bytes writeBytes({0x03}); // SOS (components in scan) writeBytes({0x01, 0x00}); // SOS (component table order Y) writeBytes({0x02, 0x11}); // SOS (component table order Cb) writeBytes({0x03, 0x11}); // SOS (component table order Cr) writeBytes({0x00, 0x3F, 0x00}); // SOS (ignored bytes) // encode 8x8 macro blocks int dc[3] = { }; const size_t rOff = m_format == kTexFormatBGRA || m_format == kTexFormatBGR ? 2 : 0; const size_t gOff = m_bpp > 1 ? 1 : 0; const size_t bOff = m_bpp == 1 || rOff == 2 ? 0 : 2; for (size_t y = 0; y < m_height; y += 8) { for (size_t x = 0; x < m_width; x += 8) { float du[3][64]; for (size_t r = y, p = 0; r < y+8; r++) { for (size_t c = x; c < x+8; c++, p++) { size_t m = r*m_width*m_bpp + c*m_bpp; if (r >= m_height) m -= m_width*m_bpp*(r+1 - m_height); if (c >= m_width) m -= m_bpp*(c+1 - m_width); const float R = m_data[m + rOff]; const float G = m_data[m + gOff]; const float B = m_format == kTexFormatRG ? 0.0f : m_data[m + bOff]; du[0][p] = 0.29900f * R + 0.58700f * G + 0.11400f * B - 128.0f; du[1][p] = -0.16874f * R - 0.33126f * G + 0.50000f * B; du[2][p] = 0.50000f * R - 0.41869f * G - 0.08131f * B; } } dc[0] = process(du[0], fyTable, dc[0], kYUDCHT[0], kYACHT); dc[1] = process(du[1], fuTable, dc[1], kYUDCHT[1], kUACHT); dc[2] = process(du[2], fuTable, dc[2], kYUDCHT[1], kUACHT); } } writeBits({0x7F, 0x07}); // bit alignment for EOI marker writeBytes({0xFF, 0xD9}); // EOI } bool Texture::save(const u::string &file, SaveFormat format, float quality) { if (m_data.empty()) return false; if (quality != 1.0f) { const float f = textureQualityScale(quality); size_t w = m_width * f; size_t h = m_height * f; if (w == 0) w = 1; if (h == 0) h = 1; resize(w, h); } static const struct { void (Texture::*function)(u::vector<unsigned char> &out); int format; } kExtensions[] = { { &Texture::writeTGA, kSaveTGA }, { &Texture::writeBMP, kSaveBMP }, { &Texture::writePNG, kSavePNG }, { &Texture::writeJPG, kSaveJPG } }; u::vector<unsigned char> data; for (const auto &it : kExtensions) { if (it.format != format) continue; (this->*it.function)(data); return u::write(data, file + "." + kSaveFormatExtensions[format], "wb"); } return false; } bool Texture::from(const unsigned char *const data, size_t length, size_t width, size_t height, bool normal, TextureFormat format, size_t mips) { *this = u::move(Texture(data, length, width, height, normal, format, mips)); return true; } void Texture::resize(size_t width, size_t height) { u::vector<unsigned char> data(m_bpp * width * height); scale(&m_data[0], m_width, m_height, m_bpp, m_pitch, &data[0], width, height); m_data = u::move(data); m_width = width; m_height = height; m_pitch = m_width * m_bpp; normalize(); } void Texture::normalize() { if (!(flags() & kTexFlagNormal)) return; u::vector<unsigned char> data(m_bpp * m_width * m_height); unsigned char *dst = &data[0]; for (size_t y = 0; y < m_height; y++) { for (size_t x = 0; x < m_width; x++) { m::vec3 normal(0.0f, 0.0f, 255.0f); normal.x += m_data[y*m_pitch + ((x+m_width-1)%m_width)*m_bpp]; normal.x -= m_data[y*m_pitch + ((x+1)%m_width)*m_bpp]; normal.y += m_data[((y+m_height-1)%m_height)*m_pitch + x*m_bpp]; normal.y -= m_data[((y+1)%m_height)*m_pitch + x*m_bpp]; normal.normalize(); *dst++ = (unsigned char)(127.5f + normal.x*127.5f); *dst++ = (unsigned char)(127.5f + normal.y*127.5f); } } m_data = u::move(data); } void Texture::unload() { m_data.destroy(); } const u::string &Texture::hashString() const { return m_hashString; } int Texture::flags() const { return m_flags; } size_t Texture::width() const { return m_width; } size_t Texture::height() const { return m_height; } TextureFormat Texture::format() const { return m_format; } const char *Texture::components() const { switch (m_format) { case kTexFormatRGB: return "RGB"; case kTexFormatRGBA: return "RGBA"; case kTexFormatBGR: return "BGR"; case kTexFormatBGRA: return "BGRA"; case kTexFormatRG: return "RG"; case kTexFormatLuminance: return "Luminance"; case kTexFormatDXT1: return "DXT1"; case kTexFormatDXT3: return "DXT3"; case kTexFormatDXT5: return "DXT5"; case kTexFormatBC4U: return "BC4U/ATI1"; case kTexFormatBC4S: return "BC4S"; case kTexFormatBC5U: return "BC5U/ATI2"; case kTexFormatBC5S: return "BC5S"; } U_UNREACHABLE(); }; size_t Texture::size() const { return m_data.size(); } size_t Texture::bpp() const { return m_bpp; } size_t Texture::mips() const { return m_mips; } size_t Texture::pitch() const { return m_pitch; } const unsigned char *Texture::data() const { return &m_data[0]; }
37.966993
172
0.496677
graphitemaster
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
82a29786e70119e4ed693818209842505d1aaf20
13,068
cpp
C++
eden/fs/inodes/InodeBase.cpp
jmswen/eden
5e0b051703fa946cc77fc43004435ae6b20599a1
[ "BSD-3-Clause" ]
null
null
null
eden/fs/inodes/InodeBase.cpp
jmswen/eden
5e0b051703fa946cc77fc43004435ae6b20599a1
[ "BSD-3-Clause" ]
null
null
null
eden/fs/inodes/InodeBase.cpp
jmswen/eden
5e0b051703fa946cc77fc43004435ae6b20599a1
[ "BSD-3-Clause" ]
null
null
null
/* * Copyright (c) 2016-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 "eden/fs/inodes/InodeBase.h" #include <folly/Likely.h> #include <folly/logging/xlog.h> #include "eden/fs/inodes/EdenMount.h" #include "eden/fs/inodes/InodeMap.h" #include "eden/fs/inodes/InodeTable.h" #include "eden/fs/inodes/ParentInodeInfo.h" #include "eden/fs/inodes/TreeInode.h" #include "eden/fs/utils/Clock.h" using namespace folly; namespace facebook { namespace eden { InodeBase::InodeBase(EdenMount* mount) : ino_{kRootNodeId}, initialMode_{S_IFDIR | 0755}, mount_{mount}, location_{ LocationInfo{nullptr, PathComponentPiece{"", detail::SkipPathSanityCheck()}}} { XLOG(DBG5) << "root inode " << this << " (" << ino_ << ") created for mount " << mount_->getPath(); // The root inode always starts with an implicit reference from FUSE. incFuseRefcount(); mount->getInodeMetadataTable()->populateIfNotSet( ino_, [&] { return mount->getInitialInodeMetadata(S_IFDIR | 0755); }); } InodeBase::InodeBase( InodeNumber ino, mode_t initialMode, const std::optional<InodeTimestamps>& initialTimestamps, TreeInodePtr parent, PathComponentPiece name) : ino_{ino}, initialMode_{initialMode}, mount_{parent->mount_}, location_{LocationInfo{std::move(parent), name}} { // Inode numbers generally shouldn't be 0. // Older versions of glibc have bugs handling files with an inode number of 0 DCHECK(ino_.hasValue()); XLOG(DBG5) << "inode " << this << " (" << ino_ << ") created: " << getLogPath(); mount_->getInodeMetadataTable()->populateIfNotSet(ino_, [&] { auto metadata = mount_->getInitialInodeMetadata(initialMode); if (initialTimestamps) { metadata.timestamps = *initialTimestamps; } return metadata; }); } InodeBase::~InodeBase() { XLOG(DBG5) << "inode " << this << " (" << ino_ << ") destroyed: " << getLogPath(); } // See Dispatcher::getattr folly::Future<Dispatcher::Attr> InodeBase::getattr() { FUSELL_NOT_IMPL(); } folly::Future<folly::Unit> InodeBase::setxattr( folly::StringPiece /*name*/, folly::StringPiece /*value*/, int /*flags*/) { // setxattr is not supported for any type of inode. This instructs the kernel // to automatically fail all future setxattr() syscalls with EOPNOTSUPP. FUSELL_NOT_IMPL(); } folly::Future<folly::Unit> InodeBase::removexattr(folly::StringPiece /*name*/) { // removexattr is not supported for any type of inode. This instructs the // kernel to automatically fail all future removexattr() syscalls with // EOPNOTSUPP. FUSELL_NOT_IMPL(); } folly::Future<folly::Unit> InodeBase::access(int /*mask*/) { // Returning ENOSYS instructs FUSE that access() will always succeed, so does // not need to call back into the FUSE daemon. FUSELL_NOT_IMPL(); } bool InodeBase::isUnlinked() const { auto loc = location_.rlock(); return loc->unlinked; } /** * Helper function for getPath() and getLogPath() * * Populates the names vector with the list of PathComponents from the root * down to this inode. * * This method should not be called on the root inode. The caller is * responsible for checking that before calling getPathHelper(). * * Returns true if the the file exists at the given path, or false if the file * has been unlinked. * * If stopOnUnlinked is true, it breaks immediately when it finds that the file * has been unlinked. The contents of the names vector are then undefined if * the function returns false. * * If stopOnUnlinked is false it continues building the names vector even if * the file is unlinked, which will then contain the path that the file used to * exist at. (This path should be used only for logging purposes at that * point.) */ bool InodeBase::getPathHelper( std::vector<PathComponent>& names, bool stopOnUnlinked) const { TreeInodePtr parent; bool unlinked = false; { auto loc = location_.rlock(); if (loc->unlinked) { if (stopOnUnlinked) { return false; } unlinked = true; } parent = loc->parent; // Our caller should ensure that we are not the root DCHECK(parent); names.push_back(loc->name); } while (true) { // Stop at the root inode. // We check for this based on inode number so we can stop without having to // acquire the root inode's location lock. (Otherwise all path lookups // would have to acquire the root's lock, making it more likely to be // contended.) if (parent->ino_ == kRootNodeId) { // Reverse the names vector, since we built it from bottom to top. std::reverse(names.begin(), names.end()); return !unlinked; } auto loc = parent->location_.rlock(); // In general our parent should not be unlinked if we are not unlinked, // which we checked above. However, we have since released our location // lock, so it's possible (but unlikely) that someone unlinked us and our // parent directories since we checked above. if (UNLIKELY(loc->unlinked)) { if (stopOnUnlinked) { return false; } unlinked = true; } names.push_back(loc->name); parent = loc->parent; DCHECK(parent); } } std::optional<RelativePath> InodeBase::getPath() const { if (ino_ == kRootNodeId) { return RelativePath(); } std::vector<PathComponent> names; if (!getPathHelper(names, true)) { return std::nullopt; } return RelativePath(names); } std::string InodeBase::getLogPath() const { if (ino_ == kRootNodeId) { // We use "<root>" here instead of the empty string to make log messages // more understandable. The empty string would likely be confusing, as it // would appear if the file name were missing. return "<root>"; } std::vector<PathComponent> names; bool unlinked = !getPathHelper(names, false); auto path = RelativePath(names); if (unlinked) { return folly::to<std::string>("<deleted:", path.stringPiece(), ">"); } return std::move(path).value(); } void InodeBase::markUnlinkedAfterLoad() { auto loc = location_.wlock(); DCHECK(!loc->unlinked); loc->unlinked = true; } std::unique_ptr<InodeBase> InodeBase::markUnlinked( TreeInode* parent, PathComponentPiece name, const RenameLock& renameLock) { XLOG(DBG5) << "inode " << this << " unlinked: " << getLogPath(); DCHECK(renameLock.isHeld(mount_)); { auto loc = location_.wlock(); DCHECK(!loc->unlinked); DCHECK_EQ(loc->parent.get(), parent); loc->unlinked = true; } // Grab the inode map lock, and check if we should unload // ourself immediately. auto* inodeMap = getMount()->getInodeMap(); auto inodeMapLock = inodeMap->lockForUnload(); if (isPtrAcquireCountZero() && getFuseRefcount() == 0) { inodeMap->unloadInode(this, parent, name, true, inodeMapLock); // We have to delete ourself now. // Do this by returning a unique_ptr to ourself, so that our caller will // destroy us. This ensures we get destroyed after releasing the InodeMap // lock. Our calling TreeInode should wait to destroy us until they // release their contents lock as well. // // (Technically it should probably be fine even if the caller deletes us // before releasing their contents lock, it just seems safer to wait. // The main area of concern is that deleting us will drop a reference count // on our parent, which could require the code to acquire locks to destroy // our parent. However, we are only ever invoked from unlink(), rmdir(), // or rename() operations which must already be holding a reference on our // parent. Therefore our parent should never be destroyed when our // destructor gets invoked here, so we won't need to acquire our parent's // contents lock in our destructor.) return std::unique_ptr<InodeBase>(this); } // We don't need our caller to delete us, so return null. return nullptr; } void InodeBase::updateLocation( TreeInodePtr newParent, PathComponentPiece newName, const RenameLock& renameLock) { XLOG(DBG5) << "inode " << this << " renamed: " << getLogPath() << " --> " << newParent->getLogPath() << " / \"" << newName << "\""; DCHECK(renameLock.isHeld(mount_)); DCHECK_EQ(mount_, newParent->mount_); auto loc = location_.wlock(); DCHECK(!loc->unlinked); loc->parent = newParent; loc->name = newName.copy(); } void InodeBase::onPtrRefZero() const { // onPtrRefZero() is const since we treat incrementing and decrementing the // pointer refcount as a non-modifying operation. (The refcount is updated // atomically so the operation is thread-safe.) // // However when the last reference goes to zero we destroy the inode object, // which is a modifying operation. Cast ourself back to non-const in this // case. We are guaranteed that no-one else has a reference to us anymore so // this is safe. // // We could perhaps just make incrementPtrRef() and decrementPtrRef() // non-const instead. InodePtr objects always point to non-const InodeBase // objects; we do not currently ever use pointer-to-const InodePtrs. getMount()->getInodeMap()->onInodeUnreferenced( const_cast<InodeBase*>(this), getParentInfo()); } ParentInodeInfo InodeBase::getParentInfo() const { using ParentContentsPtr = folly::Synchronized<TreeInodeState>::LockedPtr; // Grab our parent's contents_ lock. // // We need a retry loop here in case we get renamed or unlinked while trying // to acquire our parent's lock. // // (We could acquire the mount point rename lock first, to ensure that we // can't be renamed during this process. However it seems unlikely that we // would get renamed or unlinked, so retrying seems probably better than // holding a mountpoint-wide lock.) size_t numTries = {0}; while (true) { ++numTries; TreeInodePtr parent; // Get our current parent. { auto loc = location_.rlock(); parent = loc->parent; if (loc->unlinked) { XLOG(DBG6) << "getParentInfo(): unlinked inode detected after " << numTries << " tries"; return ParentInodeInfo{ loc->name, loc->parent, loc->unlinked, ParentContentsPtr{}}; } } if (!parent) { // We are the root inode. DCHECK_EQ(numTries, 1); return ParentInodeInfo{ PathComponentPiece{"", detail::SkipPathSanityCheck()}, nullptr, false, ParentContentsPtr{}}; } // Now grab our parent's contents lock. auto parentContents = parent->getContents().wlock(); // After acquiring our parent's contents lock we have to make sure it is // actually still our parent. If it is we are done and can break out of // this loop. { auto loc = location_.rlock(); if (loc->unlinked) { // This file was unlinked since we checked earlier XLOG(DBG6) << "getParentInfo(): file is newly unlinked on try " << numTries; return ParentInodeInfo{ loc->name, loc->parent, loc->unlinked, ParentContentsPtr{}}; } if (loc->parent == parent) { // Our parent is still the same. We're done. XLOG(DBG6) << "getParentInfo() acquired parent lock after " << numTries << " tries"; return ParentInodeInfo{ loc->name, loc->parent, loc->unlinked, std::move(parentContents)}; } } // Otherwise our parent changed, and we have to retry. parent.reset(); parentContents.unlock(); } } InodeMetadata InodeBase::getMetadataLocked() const { return getMount()->getInodeMetadataTable()->getOrThrow(getNodeId()); } void InodeBase::updateAtime() { // TODO: Is it worth implementing relatime-like logic? auto now = getNow(); getMount()->getInodeMetadataTable()->modifyOrThrow( getNodeId(), [&](auto& metadata) { metadata.timestamps.atime = now; }); } InodeTimestamps InodeBase::updateMtimeAndCtime(timespec now) { return getMount() ->getInodeMetadataTable() ->modifyOrThrow( getNodeId(), [&](auto& record) { record.timestamps.ctime = now; record.timestamps.mtime = now; }) .timestamps; } timespec InodeBase::getNow() const { return getClock().getRealtime(); } const Clock& InodeBase::getClock() const { return getMount()->getClock(); } // Helper function to update Journal used by FileInode and TreeInode. void InodeBase::updateJournal() { auto path = getPath(); if (path.has_value()) { getMount()->getJournal().addDelta(std::make_unique<JournalDelta>( std::move(path.value()), JournalDelta::CHANGED)); } } } // namespace eden } // namespace facebook
33.59383
80
0.666743
jmswen
82a2d7a7827f7d58ab7f185debbb4e37ea2afcfc
11,092
cc
C++
ui/views/test/ui_controls_factory_desktop_aurax11.cc
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
ui/views/test/ui_controls_factory_desktop_aurax11.cc
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
ui/views/test/ui_controls_factory_desktop_aurax11.cc
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ui/views/test/ui_controls_factory_desktop_aurax11.h" #include <utility> #include <vector> #include "base/bind.h" #include "base/location.h" #include "base/logging.h" #include "base/macros.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" #include "ui/aura/client/screen_position_client.h" #include "ui/aura/env.h" #include "ui/aura/test/aura_test_utils.h" #include "ui/aura/test/ui_controls_factory_aura.h" #include "ui/aura/test/x11_event_sender.h" #include "ui/aura/window_event_dispatcher.h" #include "ui/base/test/ui_controls_aura.h" #include "ui/base/x/x11_util.h" #include "ui/compositor/dip_util.h" #include "ui/events/keycodes/keyboard_code_conversion_x.h" #include "ui/events/test/x11_event_waiter.h" #include "ui/gfx/x/x11.h" #include "ui/gfx/x/x11_connection.h" #include "ui/views/test/test_desktop_screen_x11.h" #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" namespace views { namespace test { namespace { using ui_controls::DOWN; using ui_controls::LEFT; using ui_controls::MIDDLE; using ui_controls::MouseButton; using ui_controls::RIGHT; using ui_controls::UIControlsAura; using ui_controls::UP; // Mask of the buttons currently down. unsigned button_down_mask = 0; class UIControlsDesktopX11 : public UIControlsAura { public: UIControlsDesktopX11() : x_display_(gfx::GetXDisplay()), x_root_window_(DefaultRootWindow(x_display_)), x_window_(XCreateWindow(x_display_, x_root_window_, -100, // x -100, // y 10, // width 10, // height 0, // border width CopyFromParent, // depth InputOnly, CopyFromParent, // visual 0, nullptr)) { XStoreName(x_display_, x_window_, "Chromium UIControlsDesktopX11 Window"); } ~UIControlsDesktopX11() override { XDestroyWindow(x_display_, x_window_); } bool SendKeyPress(gfx::NativeWindow window, ui::KeyboardCode key, bool control, bool shift, bool alt, bool command) override { DCHECK(!command); // No command key on Aura return SendKeyPressNotifyWhenDone(window, key, control, shift, alt, command, base::OnceClosure()); } bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, ui::KeyboardCode key, bool control, bool shift, bool alt, bool command, base::OnceClosure closure) override { DCHECK(!command); // No command key on Aura aura::WindowTreeHost* host = window->GetHost(); XEvent xevent; xevent.xkey = {}; xevent.xkey.type = KeyPress; if (control) { SetKeycodeAndSendThenMask(host, &xevent, XK_Control_L, ControlMask); } if (shift) SetKeycodeAndSendThenMask(host, &xevent, XK_Shift_L, ShiftMask); if (alt) SetKeycodeAndSendThenMask(host, &xevent, XK_Alt_L, Mod1Mask); xevent.xkey.keycode = XKeysymToKeycode(x_display_, ui::XKeysymForWindowsKeyCode(key, shift)); aura::test::PostEventToWindowTreeHost(xevent, host); // Send key release events. xevent.xkey.type = KeyRelease; aura::test::PostEventToWindowTreeHost(xevent, host); if (alt) UnmaskAndSetKeycodeThenSend(host, &xevent, Mod1Mask, XK_Alt_L); if (shift) UnmaskAndSetKeycodeThenSend(host, &xevent, ShiftMask, XK_Shift_L); if (control) { UnmaskAndSetKeycodeThenSend(host, &xevent, ControlMask, XK_Control_L); } DCHECK(!xevent.xkey.state); RunClosureAfterAllPendingUIEvents(std::move(closure)); return true; } bool SendMouseMove(int screen_x, int screen_y) override { return SendMouseMoveNotifyWhenDone(screen_x, screen_y, base::OnceClosure()); } bool SendMouseMoveNotifyWhenDone(int screen_x, int screen_y, base::OnceClosure closure) override { gfx::Point screen_location(screen_x, screen_y); gfx::Point root_location = screen_location; aura::Window* root_window = RootWindowForPoint(screen_location); aura::client::ScreenPositionClient* screen_position_client = aura::client::GetScreenPositionClient(root_window); if (screen_position_client) { screen_position_client->ConvertPointFromScreen(root_window, &root_location); } aura::WindowTreeHost* host = root_window->GetHost(); gfx::Point root_current_location = aura::test::QueryLatestMousePositionRequestInHost(host); host->ConvertPixelsToDIP(&root_current_location); auto* screen = views::test::TestDesktopScreenX11::GetInstance(); DCHECK_EQ(screen, display::Screen::GetScreen()); screen->set_cursor_screen_point(gfx::Point(screen_x, screen_y)); if (root_location != root_current_location && button_down_mask == 0) { // Move the cursor because EnterNotify/LeaveNotify are generated with the // current mouse position as a result of XGrabPointer() root_window->MoveCursorTo(root_location); } else { XEvent xevent; xevent.xmotion = {}; XMotionEvent* xmotion = &xevent.xmotion; xmotion->type = MotionNotify; xmotion->x = root_location.x(); xmotion->y = root_location.y(); xmotion->state = button_down_mask; xmotion->same_screen = x11::True; // RootWindow will take care of other necessary fields. aura::test::PostEventToWindowTreeHost(xevent, host); } RunClosureAfterAllPendingUIEvents(std::move(closure)); return true; } bool SendMouseEvents(MouseButton type, int button_state, int accelerator_state) override { return SendMouseEventsNotifyWhenDone( type, button_state, base::OnceClosure(), accelerator_state); } bool SendMouseEventsNotifyWhenDone(MouseButton type, int button_state, base::OnceClosure closure, int accelerator_state) override { XEvent xevent; xevent.xbutton = {}; XButtonEvent* xbutton = &xevent.xbutton; gfx::Point mouse_loc = aura::Env::GetInstance()->last_mouse_location(); aura::Window* root_window = RootWindowForPoint(mouse_loc); aura::client::ScreenPositionClient* screen_position_client = aura::client::GetScreenPositionClient(root_window); if (screen_position_client) screen_position_client->ConvertPointFromScreen(root_window, &mouse_loc); xbutton->x = mouse_loc.x(); xbutton->y = mouse_loc.y(); xbutton->same_screen = x11::True; switch (type) { case LEFT: xbutton->button = Button1; xbutton->state = Button1Mask; break; case MIDDLE: xbutton->button = Button2; xbutton->state = Button2Mask; break; case RIGHT: xbutton->button = Button3; xbutton->state = Button3Mask; break; } // Process the accelerator key state. if (accelerator_state & ui_controls::kShift) xbutton->state |= ShiftMask; if (accelerator_state & ui_controls::kControl) xbutton->state |= ControlMask; if (accelerator_state & ui_controls::kAlt) xbutton->state |= Mod1Mask; if (accelerator_state & ui_controls::kCommand) xbutton->state |= Mod4Mask; // RootWindow will take care of other necessary fields. if (button_state & DOWN) { xevent.xbutton.type = ButtonPress; aura::test::PostEventToWindowTreeHost(xevent, root_window->GetHost()); button_down_mask |= xbutton->state; } if (button_state & UP) { xevent.xbutton.type = ButtonRelease; aura::test::PostEventToWindowTreeHost(xevent, root_window->GetHost()); button_down_mask = (button_down_mask | xbutton->state) ^ xbutton->state; } RunClosureAfterAllPendingUIEvents(std::move(closure)); return true; } bool SendMouseClick(MouseButton type) override { return SendMouseEvents(type, UP | DOWN, ui_controls::kNoAccelerator); } void RunClosureAfterAllPendingUIEvents(base::OnceClosure closure) { if (closure.is_null()) return; ui::XEventWaiter::Create(x_window_, std::move(closure)); } private: aura::Window* RootWindowForPoint(const gfx::Point& point) { // Most interactive_ui_tests run inside of the aura_test_helper // environment. This means that we can't rely on display::Screen and several // other things to work properly. Therefore we hack around this by // iterating across the windows owned DesktopWindowTreeHostLinux since this // doesn't rely on having a DesktopScreenX11. std::vector<aura::Window*> windows = DesktopWindowTreeHostLinux::GetAllOpenWindows(); const auto i = std::find_if(windows.cbegin(), windows.cend(), [point](auto* window) { return window->GetBoundsInScreen().Contains(point) || window->HasCapture(); }); DCHECK(i != windows.cend()) << "Couldn't find RW for " << point.ToString() << " among " << windows.size() << " RWs."; return (*i)->GetRootWindow(); } void SetKeycodeAndSendThenMask(aura::WindowTreeHost* host, XEvent* xevent, KeySym keysym, unsigned int mask) { xevent->xkey.keycode = XKeysymToKeycode(x_display_, keysym); aura::test::PostEventToWindowTreeHost(*xevent, host); xevent->xkey.state |= mask; } void UnmaskAndSetKeycodeThenSend(aura::WindowTreeHost* host, XEvent* xevent, unsigned int mask, KeySym keysym) { xevent->xkey.state ^= mask; xevent->xkey.keycode = XKeysymToKeycode(x_display_, keysym); aura::test::PostEventToWindowTreeHost(*xevent, host); } // Our X11 state. Display* x_display_; ::Window x_root_window_; // Input-only window used for events. ::Window x_window_; DISALLOW_COPY_AND_ASSIGN(UIControlsDesktopX11); }; } // namespace UIControlsAura* CreateUIControlsDesktopAura() { // The constructor of UIControlsDesktopX11 needs X11 connection to be // initialized. gfx::InitializeThreadedX11(); return new UIControlsDesktopX11(); } } // namespace test } // namespace views
37.986301
80
0.63397
sarang-apps
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
82a7324db2494fe3d7f0c8135387fad99d77db4f
9,132
cc
C++
chrome/browser/ui/webui/settings/chromeos/change_picture_handler_unittest.cc
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
14,668
2015-01-01T01:57:10.000Z
2022-03-31T23:33:32.000Z
chrome/browser/ui/webui/settings/chromeos/change_picture_handler_unittest.cc
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
86
2015-10-21T13:02:42.000Z
2022-03-14T07:50:50.000Z
chrome/browser/ui/webui/settings/chromeos/change_picture_handler_unittest.cc
zealoussnow/chromium
fd8a8914ca0183f0add65ae55f04e287543c7d4a
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
5,941
2015-01-02T11:32:21.000Z
2022-03-31T16:35:46.000Z
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/ui/webui/settings/chromeos/change_picture_handler.h" #include <memory> #include "base/files/file_path.h" #include "base/test/metrics/histogram_tester.h" #include "base/values.h" #include "chrome/browser/ash/login/users/avatar/user_image_manager.h" #include "chrome/browser/ash/login/users/default_user_image/default_user_images.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile_manager.h" #include "components/user_manager/scoped_user_manager.h" #include "components/user_manager/user_manager.h" #include "content/public/browser/audio_service.h" #include "content/public/browser/web_contents.h" #include "content/public/test/browser_task_environment.h" #include "content/public/test/test_web_ui.h" #include "services/audio/public/cpp/sounds/sounds_manager.h" #include "testing/gtest/include/gtest/gtest.h" namespace chromeos { namespace settings { class ChangePictureHandlerTest : public testing::Test { public: ChangePictureHandlerTest() : profile_manager_(TestingBrowserProcess::GetGlobal()), user_manager_enabler_(std::make_unique<ash::FakeChromeUserManager>()) {} ~ChangePictureHandlerTest() override = default; void SetUp() override { audio::SoundsManager::Create(content::GetAudioServiceStreamFactoryBinder()); ASSERT_TRUE(profile_manager_.SetUp()); account_id_ = AccountId::FromUserEmail("lala@example.com"); user_manager::User* user = GetFakeUserManager()->AddUser(account_id_); testing_profile_ = profile_manager_.CreateTestingProfile(account_id_.GetUserEmail()); ProfileHelper::Get()->SetUserToProfileMappingForTesting(user, testing_profile_); // Note that user profiles are created after user login in reality. GetFakeUserManager()->LoginUser(account_id_); GetFakeUserManager()->UserLoggedIn(account_id_, user->username_hash(), /*browser_restart=*/false, /*is_child=*/false); web_ui_ = std::make_unique<content::TestWebUI>(); web_contents_ = content::WebContents::Create( content::WebContents::CreateParams(testing_profile_)); web_ui_->set_web_contents(web_contents_.get()); handler_ = std::make_unique<ChangePictureHandler>(); handler_->set_web_ui(web_ui_.get()); handler_->AllowJavascript(); handler_->RegisterMessages(); listener_ = handler_.get(); request_ = handler_.get(); } void TearDown() override { request_ = nullptr; listener_ = nullptr; handler_.reset(); web_contents_.reset(); web_ui_.reset(); GetFakeUserManager()->Shutdown(); testing_profile_ = nullptr; profile_manager_.DeleteAllTestingProfiles(); audio::SoundsManager::Shutdown(); } content::TestWebUI* web_ui() { return web_ui_.get(); } ash::FakeChromeUserManager* GetFakeUserManager() const { return static_cast<ash::FakeChromeUserManager*>( user_manager::UserManager::Get()); } const base::HistogramTester& histogram_tester() const { return histogram_tester_; } void SelectNewDefaultImage(int default_image_index) { base::ListValue args; args.Append(default_user_image::GetDefaultImageUrl(default_image_index)); args.Append("default"); web_ui_->HandleReceivedMessage("selectImage", &args); } void SelectProfileImage() { base::ListValue args; args.Append("empty url"); args.Append("profile"); web_ui_->HandleReceivedMessage("selectImage", &args); } void SelectImageFromFile(const base::FilePath& path, const int index, void* params) { listener_->FileSelected(path, index, params); } void CancelFileSelection() { listener_->FileSelectionCanceled(nullptr); } void OnCameraImageDecoded() { SkBitmap bitmap; bitmap.allocN32Pixels(1, 1); std::vector<unsigned char> data; data.push_back('a'); handler_->user_photo_data_ = base::RefCountedBytes::TakeVector(&data); request_->OnImageDecoded(bitmap); } ash::UserImageManager* GetUserImageManager() { return GetFakeUserManager()->GetUserImageManager(account_id_); } private: content::BrowserTaskEnvironment task_environment_{ content::BrowserTaskEnvironment::REAL_IO_THREAD}; std::unique_ptr<content::TestWebUI> web_ui_; std::unique_ptr<content::WebContents> web_contents_; std::unique_ptr<ChangePictureHandler> handler_; base::HistogramTester histogram_tester_; AccountId account_id_; TestingProfile* testing_profile_; TestingProfileManager profile_manager_; user_manager::ScopedUserManager user_manager_enabler_; ui::SelectFileDialog::Listener* listener_; ImageDecoder::ImageRequest* request_; }; TEST_F(ChangePictureHandlerTest, ShouldSendUmaMetricWhenNewDefaultImageIsSelected) { const int default_image_index = default_user_image::GetRandomDefaultImageIndex(); SelectNewDefaultImage(default_image_index); auto* user_image_manager = GetUserImageManager(); histogram_tester().ExpectBucketCount( ChangePictureHandler::kUserImageChangedHistogramName, user_image_manager->ImageIndexToHistogramIndex(default_image_index), 1); } TEST_F(ChangePictureHandlerTest, ShouldNotSendUmaMetricWhenDefaultImageIsReselected) { const int default_image_index = default_user_image::GetRandomDefaultImageIndex(); auto* user_image_manager = GetUserImageManager(); SelectNewDefaultImage(default_image_index); histogram_tester().ExpectBucketCount( ChangePictureHandler::kUserImageChangedHistogramName, user_image_manager->ImageIndexToHistogramIndex(default_image_index), 1); // Selecting the same default image should not log another impression. SelectNewDefaultImage(default_image_index); histogram_tester().ExpectBucketCount( ChangePictureHandler::kUserImageChangedHistogramName, user_image_manager->ImageIndexToHistogramIndex(default_image_index), 1); } TEST_F(ChangePictureHandlerTest, ShoulSendUmaMetricWhenProfileImageIsSelected) { const int default_image_index = default_user_image::GetRandomDefaultImageIndex(); auto* user_image_manager = GetUserImageManager(); // User selects a new default image. SelectNewDefaultImage(default_image_index); histogram_tester().ExpectBucketCount( ChangePictureHandler::kUserImageChangedHistogramName, user_image_manager->ImageIndexToHistogramIndex(default_image_index), 1); // User selects the profile image. SelectProfileImage(); histogram_tester().ExpectBucketCount( ChangePictureHandler::kUserImageChangedHistogramName, user_image_manager->ImageIndexToHistogramIndex( user_manager::User::USER_IMAGE_PROFILE), 1); } TEST_F(ChangePictureHandlerTest, ShoulNotSendUmaMetricWhenProfileImageIsReselected) { auto* user_image_manager = GetUserImageManager(); // User has profile image by default, thus reselecting profile does not log an // impression SelectProfileImage(); histogram_tester().ExpectBucketCount( ChangePictureHandler::kUserImageChangedHistogramName, user_image_manager->ImageIndexToHistogramIndex( user_manager::User::USER_IMAGE_PROFILE), 0); } TEST_F(ChangePictureHandlerTest, ShouldSendUmaMetricWhenImageIsSelectedFromFile) { auto* user_image_manager = GetUserImageManager(); const base::FilePath base_file_path("/this/is/a/test/directory/Base Name"); const base::FilePath dir_path = base_file_path.AppendASCII("dir1"); const base::FilePath file_path = dir_path.AppendASCII("file1.txt"); const int index = 0; void* params = nullptr; SelectImageFromFile(file_path, index, params); histogram_tester().ExpectBucketCount( ChangePictureHandler::kUserImageChangedHistogramName, user_image_manager->ImageIndexToHistogramIndex( user_manager::User::USER_IMAGE_EXTERNAL), 1); } TEST_F(ChangePictureHandlerTest, ShouldSendUmaMetricWhenCameraImageIsDecoded) { // Camera image is decoded OnCameraImageDecoded(); histogram_tester().ExpectBucketCount( ChangePictureHandler::kUserImageChangedHistogramName, default_user_image::kHistogramImageFromCamera, 1); } TEST_F(ChangePictureHandlerTest, ShouldSelectTheCurrentUserImageIfFileSelectionIsCanceled) { // keep the current call size so we can check what happened after our test // method call. auto number_of_calls_before_cancel = web_ui()->call_data().size(); CancelFileSelection(); // reset back to previous profile image. EXPECT_EQ(web_ui() ->call_data() .at(number_of_calls_before_cancel) ->arg1() ->GetString(), "profile-image-changed"); } } // namespace settings } // namespace chromeos
35.952756
82
0.74551
zealoussnow
82a8eed98bae4851825deb19e8e41177bd1d339f
4,918
cc
C++
chrome/browser/ash/system_extensions/system_extensions_browsertest.cc
chromium/chromium
df46e572c3449a4b108d6e02fbe4f6d24cf98381
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
14,668
2015-01-01T01:57:10.000Z
2022-03-31T23:33:32.000Z
chrome/browser/ash/system_extensions/system_extensions_browsertest.cc
chromium/chromium
df46e572c3449a4b108d6e02fbe4f6d24cf98381
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
86
2015-10-21T13:02:42.000Z
2022-03-14T07:50:50.000Z
chrome/browser/ash/system_extensions/system_extensions_browsertest.cc
chromium/chromium
df46e572c3449a4b108d6e02fbe4f6d24cf98381
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
5,941
2015-01-02T11:32:21.000Z
2022-03-31T16:35:46.000Z
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/path_service.h" #include "base/test/bind.h" #include "base/test/scoped_feature_list.h" #include "base/threading/thread_restrictions.h" #include "chrome/browser/ash/system_extensions/system_extensions_install_manager.h" #include "chrome/browser/ash/system_extensions/system_extensions_provider.h" #include "chrome/browser/ash/system_extensions/system_extensions_provider_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/navigation_entry.h" #include "content/public/common/page_type.h" #include "content/public/test/browser_test.h" namespace { constexpr SystemExtensionId kTestSystemExtensionId = {1, 2, 3, 4}; constexpr char kTestSystemExtensionIndexURL[] = "chrome-untrusted://system-extension-echo-01020304/html/index.html"; constexpr char kTestSystemExtensionWrongURL[] = "chrome-untrusted://system-extension-echo-01020304/html/wrong.html"; constexpr char kTestSystemExtensionEmptyPathURL[] = "chrome-untrusted://system-extension-echo-01020304/"; base::FilePath GetBasicSystemExtensionDir() { base::FilePath test_dir; base::PathService::Get(chrome::DIR_TEST_DATA, &test_dir); return test_dir.Append("system_extensions").Append("basic_system_extension"); } class SystemExtensionsBrowserTest : public InProcessBrowserTest { public: SystemExtensionsBrowserTest() { feature_list_.InitAndEnableFeature(ash::features::kSystemExtensions); } ~SystemExtensionsBrowserTest() override = default; void TestInstalledTestExtensionWorks() { auto* provider = SystemExtensionsProvider::Get(browser()->profile()); auto& install_manager = provider->install_manager(); auto extension_ids = install_manager.GetSystemExtensionIds(); EXPECT_EQ(std::vector<SystemExtensionId>({kTestSystemExtensionId}), extension_ids); EXPECT_TRUE(install_manager.GetSystemExtensionById(kTestSystemExtensionId)); auto* tab = browser()->tab_strip_model()->GetActiveWebContents(); { ASSERT_TRUE(ui_test_utils::NavigateToURL( browser(), GURL(kTestSystemExtensionIndexURL))); EXPECT_EQ(u"SystemExtension", tab->GetTitle()); } { // Check that navigating to non-existing resources doesn't crash the // browser. ASSERT_TRUE(ui_test_utils::NavigateToURL( browser(), GURL(kTestSystemExtensionWrongURL))); content::NavigationEntry* entry = tab->GetController().GetVisibleEntry(); EXPECT_EQ(content::PAGE_TYPE_ERROR, entry->GetPageType()); } { // Check that navigating to a directory, like the root directory, doesn't // crash the browser. ASSERT_TRUE(ui_test_utils::NavigateToURL( browser(), GURL(kTestSystemExtensionEmptyPathURL))); content::NavigationEntry* entry = tab->GetController().GetVisibleEntry(); EXPECT_EQ(content::PAGE_TYPE_ERROR, entry->GetPageType()); } } private: base::test::ScopedFeatureList feature_list_; }; class SystemExtensionsSwitchBrowserTest : public SystemExtensionsBrowserTest { public: ~SystemExtensionsSwitchBrowserTest() override = default; void SetUpCommandLine(base::CommandLine* command_line) override { InProcessBrowserTest::SetUpCommandLine(command_line); command_line->AppendSwitchPath(chromeos::switches::kInstallSystemExtension, GetBasicSystemExtensionDir()); } private: base::test::ScopedFeatureList feature_list_; }; } // namespace IN_PROC_BROWSER_TEST_F(SystemExtensionsBrowserTest, InstallFromDir_Success) { auto* provider = SystemExtensionsProvider::Get(browser()->profile()); auto& install_manager = provider->install_manager(); base::RunLoop run_loop; install_manager.InstallUnpackedExtensionFromDir( GetBasicSystemExtensionDir(), base::BindLambdaForTesting([&](InstallStatusOrSystemExtensionId result) { EXPECT_TRUE(result.ok()); EXPECT_EQ(kTestSystemExtensionId, result.value()); run_loop.Quit(); })); run_loop.Run(); TestInstalledTestExtensionWorks(); } IN_PROC_BROWSER_TEST_F(SystemExtensionsSwitchBrowserTest, ExtensionInstalled) { auto* provider = SystemExtensionsProvider::Get(browser()->profile()); auto& install_manager = provider->install_manager(); base::RunLoop run_loop; install_manager.on_command_line_install_finished().Post( FROM_HERE, run_loop.QuitClosure()); run_loop.Run(); TestInstalledTestExtensionWorks(); }
37.830769
84
0.756202
chromium
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
82aa78a853863a3a7701cdb8390608c965671a52
10,104
hpp
C++
Runtime/MP1/World/CThardus.hpp
jackoalan/urde
413483a996805a870f002324ee46cfc123f4df06
[ "MIT" ]
null
null
null
Runtime/MP1/World/CThardus.hpp
jackoalan/urde
413483a996805a870f002324ee46cfc123f4df06
[ "MIT" ]
null
null
null
Runtime/MP1/World/CThardus.hpp
jackoalan/urde
413483a996805a870f002324ee46cfc123f4df06
[ "MIT" ]
null
null
null
#pragma once #include <Collision/CJointCollisionDescription.hpp> #include "Runtime/World/CPatterned.hpp" #include "Runtime/World/CPathFindSearch.hpp" namespace urde { class CCollisionActorManager; namespace MP1 { class CThardus : public CPatterned { enum class EUpdateMaterialMode { Add, Remove }; class CThardusSomething { TUniqueId x0_ = kInvalidUniqueId; zeus::CVector3f x4_; bool x10_24_ : 1; public: CThardusSomething() : x10_24_(false) {} }; u32 x568_; TUniqueId x56c_ = kInvalidUniqueId; u32 x570_ = 0; std::vector<TUniqueId> x574_waypoints; u32 x5c4_ = 1; bool x5c8_heardPlayer = false; /* NOTE(phil) These two vectors used to vectors of CModelData, They have been converted to vectors of CStaticRes due * to the use of move semantics to prevent deep copies */ std::vector<CStaticRes> x5cc_; std::vector<CStaticRes> x5dc_; s32 x5ec_ = -1; std::unique_ptr<CCollisionActorManager> x5f0_rockColliders; std::unique_ptr<CCollisionActorManager> x5f4_; std::unique_ptr<CCollisionActorManager> x5f8_; TUniqueId x5fc_projectileId = kInvalidUniqueId; CAssetId x600_; CAssetId x604_; CAssetId x608_; TEditorId x60c_projectileEditorId = kInvalidEditorId; std::vector<TUniqueId> x610_destroyableRocks; u32 x624_; u32 x628_; u32 x62c_; CAssetId x630_; std::vector<TUniqueId> x634_nonDestroyableActors; s32 x644_ = -1; u32 x648_currentRock = 0; TUniqueId x64c_fog = kInvalidUniqueId; zeus::CVector2f x650_ = zeus::CVector2f(0.f, 1.f); s32 x658_ = -1; s32 x65c_ = -1; std::vector<TUniqueId> x660_repulsors; bool x688_ = false; bool x689_ = false; u32 x68c_ = 0; float x690_ = 0.f; float x694_; float x698_; float x69c_; float x6a0_; float x6a4_; float x6a8_; float x6ac_; std::vector<bool> x6b0_; /* TODO: Determine real value */ std::vector<TUniqueId> x6c0_rockLights; CAssetId x6d0_; CAssetId x6d4_; CAssetId x6d8_; CAssetId x6dc_; CAssetId x6e0_; CAssetId x6e4_; CAssetId x6e8_; s16 x6ec_; CAssetId x6f0_; u32 x6f4_ = 0; float x6f8_ = 0.3f; std::array<CThardusSomething, 4> x6fc_; zeus::CVector3f x74c_ = zeus::skForward; s32 x758_; s32 x75c_; s32 x760_; zeus::CTransform x764_startTransform; u32 x794_ = 0; std::vector<TUniqueId> x798_; std::vector<TUniqueId> x7a8_timers; float x7b8_ = 0.f; float x7bc_ = 10.f; float x7c0_ = 1.0f; u32 x7c4_ = 0; bool x7c8_ = false; zeus::CVector3f x7cc_; zeus::CVector3f x7d8_; zeus::CVector3f x7e4_; CPathFindSearch x7f0_pathFindSearch; bool x8d4_ = false; zeus::CVector3f x8d8_; zeus::CVector3f x8e4_; bool x8f0_ = false; std::vector<TUniqueId> x8f4_waypoints; CSfxHandle x904_ = 0; bool x908_ = false; bool x909_ = false; std::vector<float> x90c_; TLockedToken<CTexture> x91c_flareTexture; TUniqueId x928_currentRockId; zeus::CVector3f x92c_currentRockPos; bool x938_ = false; bool x939_ = false; bool x93a_ = false; bool x93b_ = false; bool x93c_ = false; bool x93d_ = true; u32 x940_ = 0; float x944_ = 0.3f; u32 x948_; bool x94c_initialized = false; bool x94d_ = false; zeus::CVector3f x950_; bool x95c_doCodeTrigger = false; u8 x95d_ = 0; bool x95e_ = false; void SetState(s32 state, CStateManager& mgr) { x644_ = state; if (state == 2) SendScriptMsgs(EScriptObjectState::Patrol, mgr, EScriptObjectMessage::None); else if (state == 1) SendScriptMsgs(EScriptObjectState::Retreat, mgr, EScriptObjectMessage::None); } void GatherWaypoints(CScriptWaypoint* wp, CStateManager& mgr, rstl::reserved_vector<TUniqueId, 16>& uids); void sub801dec80() { x68c_ = 20000; } void sub801dd4fc(const std::unique_ptr<CCollisionActorManager>& colMgr); void sub801dbf34(float dt, CStateManager& mgr); bool sub801dc2c8() const { return (x610_destroyableRocks.size() - 1) == x648_currentRock; } void _DoSuckState(CStateManager& mgr) { x330_stateMachineState.SetState(mgr, *this, GetStateMachine(), "Suck"sv); } void sub801de9f8(CStateManager& mgr){}; void sub801dd608(CStateManager& mgr); void sub801dcfa4(CStateManager& mgr); void sub80deadc(CStateManager& mgr) { if (x574_waypoints.empty()) { sub801de9f8(mgr); } else { if (sub801dc2c8() || x5c4_ != 0 || x944_ <= 0.f) sub801de9f8(mgr); else x944_ = 0.f; } } void sub801dae2c(CStateManager& mgr, u32 rockIndex); void sub801dc444(CStateManager& mgr, const zeus::CVector3f& pos, CAssetId particle); void sub801dbc5c(CStateManager& mgr, CDestroyableRock* rock); void sub801dbbdc(CStateManager& mgr, CDestroyableRock* rock); void UpdateNonDestroyableCollisionActorMaterials(EUpdateMaterialMode mode, EMaterialTypes mat, CStateManager& mgr); void UpdateExcludeList(const std::unique_ptr<CCollisionActorManager>& colMgr, EUpdateMaterialMode mode, EMaterialTypes mat, CStateManager& mgr); void _SetupCollisionActorMaterials(const std::unique_ptr<CCollisionActorManager>& colMgr, CStateManager& mgr); void _SetupCollisionManagers(CStateManager& mgr); void _BuildSphereJointList(const SSphereJointInfo* arr, size_t count, std::vector<CJointCollisionDescription>& list); void _BuildAABoxJointList(const SAABoxJointInfo* arr, size_t count, std::vector<CJointCollisionDescription>& list); void RenderFlare(const CStateManager& mgr, float t) const; zeus::CVector3f sub801de550(const CStateManager& mgr) const; zeus::CVector3f sub801de434(const CStateManager& mgr) const { return {}; } mutable std::optional<CTexturedQuadFilter> m_flareFilter; public: DEFINE_PATTERNED(Thardus) CThardus(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData, const CActorParameters& actParms, const CPatternedInfo& pInfo, std::vector<CStaticRes> mData1, std::vector<CStaticRes> mData2, CAssetId particle1, CAssetId particle2, CAssetId particle3, float f1, float f2, float f3, float f4, float f5, float f6, CAssetId stateMachine, CAssetId particle4, CAssetId particle5, CAssetId particle6, CAssetId particle7, CAssetId particle8, CAssetId particle9, CAssetId texture, u32 sfxId1, CAssetId particle10, u32 sfxId2, u32 sfxId3, u32 sfxId4); void Think(float dt, CStateManager& mgr) override; void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr) override; void PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) override; void Render(const CStateManager& mgr) const override; bool CanRenderUnsorted(const CStateManager&) const override { return false; } void Touch(CActor& act, CStateManager& mgr) override; zeus::CVector3f GetOrbitPosition(const CStateManager& mgr) const override; zeus::CVector3f GetAimPosition(const CStateManager& mgr, float) const override; zeus::CAABox GetSortingBounds(const CStateManager& mgr) const override; void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt) override; void Patrol(CStateManager& mgr, EStateMsg msg, float arg) override; void Dead(CStateManager& mgr, EStateMsg msg, float arg) override; void PathFind(CStateManager& mgr, EStateMsg msg, float arg) override; void TargetPatrol(CStateManager& mgr, EStateMsg msg, float arg) override; void Generate(CStateManager& mgr, EStateMsg msg, float arg) override; void Attack(CStateManager& mgr, EStateMsg msg, float arg) override; void LoopedAttack(CStateManager& mgr, EStateMsg msg, float arg) override; void DoubleSnap(CStateManager& mgr, EStateMsg msg, float arg) override; void Shuffle(CStateManager& mgr, EStateMsg msg, float arg) override; void GetUp(CStateManager& mgr, EStateMsg msg, float arg) override; void Taunt(CStateManager& mgr, EStateMsg msg, float arg) override; void Suck(CStateManager& mgr, EStateMsg msg, float arg) override; void ProjectileAttack(CStateManager& mgr, EStateMsg msg, float arg) override; void Flinch(CStateManager& mgr, EStateMsg msg, float arg) override; void TelegraphAttack(CStateManager& mgr, EStateMsg msg, float arg) override; void Explode(CStateManager& mgr, EStateMsg msg, float arg) override; void Cover(CStateManager& mgr, EStateMsg msg, float arg) override; void Enraged(CStateManager& mgr, EStateMsg msg, float arg) override; void Growth(CStateManager& mgr, EStateMsg msg, float arg) override; void Faint(CStateManager& mgr, EStateMsg msg, float arg) override; bool PathFound(CStateManager& mgr, float arg) override; bool InRange(CStateManager& mgr, float arg) override; bool PatternOver(CStateManager& mgr, float arg) override; bool HasAttackPattern(CStateManager& mgr, float arg) override { return x5c4_ == 1 && !ShouldMove(mgr, 0.f); } bool AnimOver(CStateManager& mgr, float arg) override; bool InPosition(CStateManager& mgr, float arg) override; bool ShouldTurn(CStateManager& mgr, float arg) override; bool HitSomething(CStateManager& mgr, float arg) override; bool HearPlayer(CStateManager& mgr, float arg) override { return x5c8_heardPlayer; } bool CoverBlown(CStateManager& mgr, float arg) override { return x5c4_ == 2 && !ShouldMove(mgr, 0.f); } bool CoveringFire(CStateManager& mgr, float arg) override { return x5c4_ == 0 && !ShouldMove(mgr, 0.f); } bool AggressionCheck(CStateManager& mgr, float arg) override { return x330_stateMachineState.GetTime() > 0.1f; } bool AttackOver(CStateManager& mgr, float arg) override { return true; } bool ShouldTaunt(CStateManager& mgr, float arg) override { return false; } bool ShouldMove(CStateManager& mgr, float arg) override { return x68c_ < x574_waypoints.size() || x93b_; } bool CodeTrigger(CStateManager& mgr, float arg) override { return x95c_doCodeTrigger; } bool IsDizzy(CStateManager& mgr, float arg) override { return x330_stateMachineState.GetTime() > 4.f; } bool ShouldCallForBackup(CStateManager& mgr, float arg) override { return x330_stateMachineState.GetTime() > .5f; } CPathFindSearch* GetSearchPath() override { return &x7f0_pathFindSearch; } }; } // namespace MP1 } // namespace urde
43.74026
119
0.745051
jackoalan
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
a113e41347e4de24ac55be5477b2399c32d64c75
553
cpp
C++
Material/RobertLafore_Book/Book_SourceCode/Progs/Ch05/Convert.cpp
hpaucar/OOP-C-plus-plus-repo
e1fedd376029996a53d70d452b7738d9c43173c0
[ "MIT" ]
4
2020-12-26T03:17:45.000Z
2022-01-11T05:54:40.000Z
Material/RobertLafore_Book/Book_SourceCode/Progs/Ch05/Convert.cpp
hpaucar/OOP-C-plus-plus-repo
e1fedd376029996a53d70d452b7738d9c43173c0
[ "MIT" ]
null
null
null
Material/RobertLafore_Book/Book_SourceCode/Progs/Ch05/Convert.cpp
hpaucar/OOP-C-plus-plus-repo
e1fedd376029996a53d70d452b7738d9c43173c0
[ "MIT" ]
null
null
null
// convert.cpp // demonstrates return values, converts pounds to kg #include <iostream> using namespace std; float lbstokg(float); //declaration int main() { float lbs, kgs; cout << "\nEnter your weight in pounds: "; cin >> lbs; kgs = lbstokg(lbs); cout << "Your weight in kilograms is " << kgs << endl; return 0; } //-------------------------------------------------------------- // lbstokg() // converts pounds to kilograms float lbstokg(float pounds) { float kilograms = 0.453592 * pounds; return kilograms; }
23.041667
64
0.56962
hpaucar
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
a1145f188a73dd9ca6d253218c9e6a67dbcbef6a
527
cpp
C++
001_GFG/Data-Structures-And-Algorithms-Self-Paced/0010_Linked_List/Practice/To_be_done_0018_Pairwise_swap_of_nodes_in_LinkeList.cpp
Sahil1515/coding
2bd2a2257c8cac5a5c00b37e79bbb68a24e186d4
[ "RSA-MD" ]
null
null
null
001_GFG/Data-Structures-And-Algorithms-Self-Paced/0010_Linked_List/Practice/To_be_done_0018_Pairwise_swap_of_nodes_in_LinkeList.cpp
Sahil1515/coding
2bd2a2257c8cac5a5c00b37e79bbb68a24e186d4
[ "RSA-MD" ]
null
null
null
001_GFG/Data-Structures-And-Algorithms-Self-Paced/0010_Linked_List/Practice/To_be_done_0018_Pairwise_swap_of_nodes_in_LinkeList.cpp
Sahil1515/coding
2bd2a2257c8cac5a5c00b37e79bbb68a24e186d4
[ "RSA-MD" ]
null
null
null
// Approch 1 // Simply swapping the data of the nodes struct Node* pairwise_swap(struct Node* head) { // your code here Node * returnHead=head; if(head==NULL || head->next==NULL) return head; while(head!=NULL && head->next!=NULL) { int temp=head->data; head->data=head->next->data; head->next->data=temp; head=head->next->next; } return returnHead; } Correct Answer.Correct Answer Execution Time:0.09 // Approch 2 // Actually swapping the nodes
16.46875
45
0.607211
Sahil1515
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
a11d1a1c850120786c80f9c4e2238718bc6c7a99
1,356
hpp
C++
ViewReportDlg.hpp
chrisoldwood/TaskTracker
9477a275d46436d14950dea97864136f8bdbf73c
[ "MIT" ]
1
2021-02-05T12:19:27.000Z
2021-02-05T12:19:27.000Z
ViewReportDlg.hpp
chrisoldwood/TaskTracker
9477a275d46436d14950dea97864136f8bdbf73c
[ "MIT" ]
null
null
null
ViewReportDlg.hpp
chrisoldwood/TaskTracker
9477a275d46436d14950dea97864136f8bdbf73c
[ "MIT" ]
null
null
null
/****************************************************************************** ** (C) Chris Oldwood ** ** MODULE: VIEWREPORTDLG.HPP ** COMPONENT: The Application. ** DESCRIPTION: The CViewReportDlg class declaration. ** ******************************************************************************* */ // Check for previous inclusion #ifndef VIEWREPORTDLG_HPP #define VIEWREPORTDLG_HPP #if _MSC_VER > 1000 #pragma once #endif #include <WCL/CommonUI.hpp> // Forward declarations. class CMemStream; /****************************************************************************** ** ** This is the dialog that display the results of a report. ** ******************************************************************************* */ class CViewReportDlg : public CDialog { public: // // Constructors/Destructor. // CViewReportDlg(CMemStream& rTxtStream); protected: // // Members. // CMemStream& m_rTxtStream; CEditBox m_ebReport; CFont m_oFont; // // Message processors. // virtual void OnInitDialog(); virtual void OnDestroy(); // // Control message processors. // void OnFontClicked(); }; /****************************************************************************** ** ** Implementation of inline functions. ** ******************************************************************************* */ #endif //VIEWREPORTDLG_HPP
20.238806
79
0.455752
chrisoldwood
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
a11fcd87525c416af287fa9cfe3907a9e2eea812
9,421
cc
C++
device/bluetooth/bluez/bluetooth_remote_gatt_service_bluez.cc
metux/chromium-deb
3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
device/bluetooth/bluez/bluetooth_remote_gatt_service_bluez.cc
metux/chromium-deb
3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
device/bluetooth/bluez/bluetooth_remote_gatt_service_bluez.cc
metux/chromium-deb
3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include <iterator> #include "base/logging.h" #include "dbus/property.h" #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h" #include "device/bluetooth/bluez/bluetooth_device_bluez.h" #include "device/bluetooth/bluez/bluetooth_gatt_characteristic_bluez.h" #include "device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.h" #include "device/bluetooth/bluez/bluetooth_remote_gatt_descriptor_bluez.h" #include "device/bluetooth/bluez/bluetooth_remote_gatt_service_bluez.h" #include "device/bluetooth/dbus/bluez_dbus_manager.h" namespace bluez { BluetoothRemoteGattServiceBlueZ::BluetoothRemoteGattServiceBlueZ( BluetoothAdapterBlueZ* adapter, BluetoothDeviceBlueZ* device, const dbus::ObjectPath& object_path) : BluetoothGattServiceBlueZ(adapter, object_path), device_(device), weak_ptr_factory_(this) { VLOG(1) << "Creating remote GATT service with identifier: " << object_path.value(); DCHECK(GetAdapter()); bluez::BluezDBusManager::Get()->GetBluetoothGattServiceClient()->AddObserver( this); bluez::BluezDBusManager::Get() ->GetBluetoothGattCharacteristicClient() ->AddObserver(this); // Add all known GATT characteristics. const std::vector<dbus::ObjectPath>& gatt_chars = bluez::BluezDBusManager::Get() ->GetBluetoothGattCharacteristicClient() ->GetCharacteristics(); for (std::vector<dbus::ObjectPath>::const_iterator iter = gatt_chars.begin(); iter != gatt_chars.end(); ++iter) GattCharacteristicAdded(*iter); } BluetoothRemoteGattServiceBlueZ::~BluetoothRemoteGattServiceBlueZ() { bluez::BluezDBusManager::Get() ->GetBluetoothGattServiceClient() ->RemoveObserver(this); bluez::BluezDBusManager::Get() ->GetBluetoothGattCharacteristicClient() ->RemoveObserver(this); // Clean up all the characteristics. Copy the characteristics list here and // clear the original so that when we send GattCharacteristicRemoved(), // GetCharacteristics() returns no characteristics. CharacteristicMap characteristics = characteristics_; characteristics_.clear(); for (CharacteristicMap::iterator iter = characteristics.begin(); iter != characteristics.end(); ++iter) { DCHECK(GetAdapter()); GetAdapter()->NotifyGattCharacteristicRemoved(iter->second); delete iter->second; } } device::BluetoothUUID BluetoothRemoteGattServiceBlueZ::GetUUID() const { bluez::BluetoothGattServiceClient::Properties* properties = bluez::BluezDBusManager::Get() ->GetBluetoothGattServiceClient() ->GetProperties(object_path()); DCHECK(properties); return device::BluetoothUUID(properties->uuid.value()); } bool BluetoothRemoteGattServiceBlueZ::IsPrimary() const { bluez::BluetoothGattServiceClient::Properties* properties = bluez::BluezDBusManager::Get() ->GetBluetoothGattServiceClient() ->GetProperties(object_path()); DCHECK(properties); return properties->primary.value(); } device::BluetoothDevice* BluetoothRemoteGattServiceBlueZ::GetDevice() const { return device_; } std::vector<device::BluetoothRemoteGattCharacteristic*> BluetoothRemoteGattServiceBlueZ::GetCharacteristics() const { std::vector<device::BluetoothRemoteGattCharacteristic*> characteristics; for (CharacteristicMap::const_iterator iter = characteristics_.begin(); iter != characteristics_.end(); ++iter) { characteristics.push_back(iter->second); } return characteristics; } std::vector<device::BluetoothRemoteGattService*> BluetoothRemoteGattServiceBlueZ::GetIncludedServices() const { // TODO(armansito): Return the actual included services here. return std::vector<device::BluetoothRemoteGattService*>(); } device::BluetoothRemoteGattCharacteristic* BluetoothRemoteGattServiceBlueZ::GetCharacteristic( const std::string& identifier) const { CharacteristicMap::const_iterator iter = characteristics_.find(dbus::ObjectPath(identifier)); if (iter == characteristics_.end()) return nullptr; return iter->second; } void BluetoothRemoteGattServiceBlueZ::NotifyServiceChanged() { // Don't send service changed unless we know that all characteristics have // already been discovered. This is to prevent spammy events before sending // out the first Gatt if (!device_->IsGattServicesDiscoveryComplete()) return; DCHECK(GetAdapter()); GetAdapter()->NotifyGattServiceChanged(this); } void BluetoothRemoteGattServiceBlueZ::NotifyDescriptorAddedOrRemoved( BluetoothRemoteGattCharacteristicBlueZ* characteristic, BluetoothRemoteGattDescriptorBlueZ* descriptor, bool added) { DCHECK(characteristic->GetService() == this); DCHECK(descriptor->GetCharacteristic() == characteristic); DCHECK(GetAdapter()); if (added) { GetAdapter()->NotifyGattDescriptorAdded(descriptor); return; } GetAdapter()->NotifyGattDescriptorRemoved(descriptor); } void BluetoothRemoteGattServiceBlueZ::NotifyDescriptorValueChanged( BluetoothRemoteGattCharacteristicBlueZ* characteristic, BluetoothRemoteGattDescriptorBlueZ* descriptor, const std::vector<uint8_t>& value) { DCHECK(characteristic->GetService() == this); DCHECK(descriptor->GetCharacteristic() == characteristic); DCHECK(GetAdapter()); GetAdapter()->NotifyGattDescriptorValueChanged(descriptor, value); } void BluetoothRemoteGattServiceBlueZ::GattServicePropertyChanged( const dbus::ObjectPath& object_path, const std::string& property_name) { if (object_path != this->object_path()) return; VLOG(1) << "Service property changed: \"" << property_name << "\", " << object_path.value(); bluez::BluetoothGattServiceClient::Properties* properties = bluez::BluezDBusManager::Get() ->GetBluetoothGattServiceClient() ->GetProperties(object_path); DCHECK(properties); NotifyServiceChanged(); } void BluetoothRemoteGattServiceBlueZ::GattCharacteristicAdded( const dbus::ObjectPath& object_path) { if (characteristics_.find(object_path) != characteristics_.end()) { VLOG(1) << "Remote GATT characteristic already exists: " << object_path.value(); return; } bluez::BluetoothGattCharacteristicClient::Properties* properties = bluez::BluezDBusManager::Get() ->GetBluetoothGattCharacteristicClient() ->GetProperties(object_path); DCHECK(properties); if (properties->service.value() != this->object_path()) { VLOG(2) << "Remote GATT characteristic does not belong to this service."; return; } VLOG(1) << "Adding new remote GATT characteristic for GATT service: " << GetIdentifier() << ", UUID: " << GetUUID().canonical_value(); BluetoothRemoteGattCharacteristicBlueZ* characteristic = new BluetoothRemoteGattCharacteristicBlueZ(this, object_path); characteristics_[object_path] = characteristic; DCHECK(characteristic->GetIdentifier() == object_path.value()); DCHECK(characteristic->GetUUID().IsValid()); DCHECK(GetAdapter()); GetAdapter()->NotifyGattCharacteristicAdded(characteristic); } void BluetoothRemoteGattServiceBlueZ::GattCharacteristicRemoved( const dbus::ObjectPath& object_path) { CharacteristicMap::iterator iter = characteristics_.find(object_path); if (iter == characteristics_.end()) { VLOG(2) << "Unknown GATT characteristic removed: " << object_path.value(); return; } VLOG(1) << "Removing remote GATT characteristic from service: " << GetIdentifier() << ", UUID: " << GetUUID().canonical_value(); BluetoothRemoteGattCharacteristicBlueZ* characteristic = iter->second; DCHECK(characteristic->object_path() == object_path); characteristics_.erase(iter); DCHECK(GetAdapter()); GetAdapter()->NotifyGattCharacteristicRemoved(characteristic); delete characteristic; } void BluetoothRemoteGattServiceBlueZ::GattCharacteristicPropertyChanged( const dbus::ObjectPath& object_path, const std::string& property_name) { CharacteristicMap::iterator iter = characteristics_.find(object_path); if (iter == characteristics_.end()) { VLOG(3) << "Properties of unknown characteristic changed"; return; } // We may receive a property changed event in certain cases, e.g. when the // characteristic "Flags" property has been updated with values from the // "Characteristic Extended Properties" descriptor. In this case, kick off // a service changed observer event to let observers refresh the // characteristics. bluez::BluetoothGattCharacteristicClient::Properties* properties = bluez::BluezDBusManager::Get() ->GetBluetoothGattCharacteristicClient() ->GetProperties(object_path); DCHECK(properties); DCHECK(GetAdapter()); if (property_name == properties->flags.name()) NotifyServiceChanged(); else if (property_name == properties->value.name()) { DCHECK_GE(iter->second->num_of_characteristic_value_read_in_progress_, 0); if (iter->second->num_of_characteristic_value_read_in_progress_ > 0) { --iter->second->num_of_characteristic_value_read_in_progress_; } else { GetAdapter()->NotifyGattCharacteristicValueChanged( iter->second, properties->value.value()); } } } } // namespace bluez
36.515504
79
0.743127
metux
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
a128a0b7972cd980600f56c7756dbe78a5821637
2,434
cpp
C++
src/day17.cpp
maxnoe/adventofcode2020
eb2a3ea03af02bf951f145f214da6a9221d8fe4f
[ "MIT" ]
null
null
null
src/day17.cpp
maxnoe/adventofcode2020
eb2a3ea03af02bf951f145f214da6a9221d8fe4f
[ "MIT" ]
null
null
null
src/day17.cpp
maxnoe/adventofcode2020
eb2a3ea03af02bf951f145f214da6a9221d8fe4f
[ "MIT" ]
null
null
null
#include <aocmaxnoe2020/aocmaxnoe2020.h> #include <aocmaxnoe2020/day17.h> namespace aocmaxnoe2020 { namespace day17 { bool operator== (const Point3D& lhs, const Point3D& rhs) { return (lhs.x == rhs.x) && (lhs.y == rhs.y) && (lhs.z == rhs.z); } bool operator== (const Point4D& lhs, const Point4D& rhs) { return (lhs.x == rhs.x) && (lhs.y == rhs.y) && (lhs.z == rhs.z) && (lhs.w == rhs.w); } Point3D operator+ (const Point3D& lhs, const Point3D& rhs) { return Point3D{lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z}; } Point3D::Set parse_input(std::string_view s) { Point3D::Set state; int z = 0; auto lines = split_lines(s); for (size_t y = 0; y < lines.size(); y++) { auto line = lines.at(y); for (size_t x = 0; x < line.size(); x++) { if (line.at(x) == '#') { state.emplace(x, -y, z); } } } return state; } template<class Point> void GoL<Point>::do_step() { typename Point::Set checked; for (const auto& p: current) { checked.insert(p); // update living cells size_t neighbors = living_neighbors(p); if (neighbors == 2 || neighbors == 3) { next.insert(p); } for (const auto& neighbor: p.get_neighbors()) { if (checked.contains(neighbor)) continue; size_t neighbors = living_neighbors(neighbor); if (neighbors == 3) { next.insert(neighbor); } checked.insert(neighbor); } } current = next; next.clear(); } template<class Point> size_t GoL<Point>::living_neighbors(const Point &p) { auto neighbor_lives = [this](const auto& neighbor) { return current.contains(neighbor); }; return std::ranges::count_if(p.get_neighbors(), neighbor_lives); } template<class Point> size_t GoL<Point>::living_cells() { return current.size(); } uint64_t part1(const Point3D::Set& state) { GoL<Point3D> game{state}; for (int i = 0; i < 6; ++i) { game.do_step(); } return game.living_cells(); } uint64_t part2(const Point3D::Set& state) { Point4D::Set state4D; state4D.reserve(state.size()); for (const auto& p: state) { state4D.emplace(p.x, p.y, p.z, 0); } GoL<Point4D> game{state4D}; for (int i = 0; i < 6; ++i) { game.do_step(); } return game.living_cells(); } }}
22.962264
88
0.561216
maxnoe
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
a13315eaa4e230848762b0e0b9067678749b24b7
187
cc
C++
codelab/cplusplus/keyword/static.cc
LIZHICHAOUNICORN/Toolkits
db45dac4de14402a21be0c40ba8e87b4faeda1b6
[ "Apache-2.0" ]
null
null
null
codelab/cplusplus/keyword/static.cc
LIZHICHAOUNICORN/Toolkits
db45dac4de14402a21be0c40ba8e87b4faeda1b6
[ "Apache-2.0" ]
null
null
null
codelab/cplusplus/keyword/static.cc
LIZHICHAOUNICORN/Toolkits
db45dac4de14402a21be0c40ba8e87b4faeda1b6
[ "Apache-2.0" ]
null
null
null
#include <iostream> using namespace std; int* fun(int tmp) { static int var = 10; var *= tmp; return &var; } int main() { cout << *fun(5) << endl; return 0; } /* 运行结果: 50 */
9.842105
26
0.561497
LIZHICHAOUNICORN
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
a13c841f70b3d7fbf8a86d0fc9f7a8d34a1d9948
4,683
cpp
C++
plugin/serializer/src/minko/data/HalfEdgeCollection.cpp
undeadinu/minko
9171805751fb3a50c6fcab0b78892cdd4253ee11
[ "BSD-3-Clause" ]
478
2015-01-04T16:59:53.000Z
2022-03-07T20:28:07.000Z
plugin/serializer/src/minko/data/HalfEdgeCollection.cpp
undeadinu/minko
9171805751fb3a50c6fcab0b78892cdd4253ee11
[ "BSD-3-Clause" ]
83
2015-01-15T21:45:06.000Z
2021-11-08T11:01:48.000Z
plugin/serializer/src/minko/data/HalfEdgeCollection.cpp
undeadinu/minko
9171805751fb3a50c6fcab0b78892cdd4253ee11
[ "BSD-3-Clause" ]
175
2015-01-04T03:30:39.000Z
2020-01-27T17:08:14.000Z
/* Copyright (c) 2014 Aerys 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 "minko/data/HalfEdgeCollection.hpp" using namespace minko; using namespace minko::data; HalfEdgeCollection::HalfEdgeCollection(const std::vector<unsigned int>& indices) : _indices(indices) { initialize(); } void HalfEdgeCollection::initialize() { unsigned int id = 0; const auto& data = _indices; HalfEdgeMap map; for (unsigned int i = 0; i < data.size(); i += 3) { const auto t1 = data[i]; const auto t2 = data[i + 1]; const auto t3 = data[i + 2]; HalfEdgePtr he1 = HalfEdge::create(t1, t2, id++); HalfEdgePtr he2 = HalfEdge::create(t2, t3, id++); HalfEdgePtr he3 = HalfEdge::create(t3, t1, id++); _halfEdges.push_back(he1); _halfEdges.push_back(he2); _halfEdges.push_back(he3); HalfEdgePtr halfEdges [3] = {he1, he2, he3}; for (int edgeId = 0; edgeId < 3; ++edgeId) { halfEdges[edgeId]->setFace(he1, he2, he3); halfEdges[edgeId]->next(halfEdges[(edgeId + 1) % 3]); halfEdges[edgeId]->prec(halfEdges[(edgeId - 1) + 3 * (edgeId - 1 < 0 ? 1 : 0)]); } map[std::make_pair(t1, t2)] = he1; map[std::make_pair(t2, t3)] = he2; map[std::make_pair(t3, t1)] = he3; HalfEdgeMap::iterator adjacents [3] = { map.find(std::make_pair(t2, t1)), map.find(std::make_pair(t3, t2)), map.find(std::make_pair(t1, t3)) }; for (int edgeId = 0; edgeId < 3; ++edgeId) { if (adjacents[edgeId] == map.end()) continue; halfEdges[edgeId]->adjacent(adjacents[edgeId]->second); adjacents[edgeId]->second->adjacent(halfEdges[edgeId]); } } //HalfEdgeMap unmarked(map.begin(), map.end()); //computeList(unmarked); } void HalfEdgeCollection::computeList(HalfEdgeMap unmarked) { std::queue<HalfEdgePtr> queue; while (unmarked.begin() != unmarked.end()) { HalfEdgeList currentList; _subMeshesList.push_back(currentList); queue.push(unmarked.begin()->second); do { HalfEdgePtr he = queue.front(); queue.pop(); currentList.push_back(he); he->marked(true); unmarked.erase(std::make_pair(he->startNodeId(), he->endNodeId())); if (he->adjacent() != nullptr && he->adjacent()->marked() == false) { HalfEdgeMap::iterator adjIt = unmarked.find(std::make_pair(he->adjacent()->startNodeId(), he->adjacent()->endNodeId())); unmarked.erase(std::make_pair(he->adjacent()->startNodeId(), he->adjacent()->endNodeId())); queue.push(he->adjacent()); } if (he->next() != nullptr && he->next()->marked() == false) { HalfEdgeMap::iterator adjIt = unmarked.find(std::make_pair(he->next()->startNodeId(), he->next()->endNodeId())); unmarked.erase(std::make_pair(he->next()->startNodeId(), he->next()->endNodeId())); queue.push(he->next()); } if (he->prec() != nullptr && he->prec()->marked() == false) { HalfEdgeMap::iterator adjIt = unmarked.find(std::make_pair(he->prec()->startNodeId(), he->prec()->endNodeId())); unmarked.erase(std::make_pair(he->prec()->startNodeId(), he->prec()->endNodeId())); queue.push(he->prec()); } } while (queue.size() > 0); } // debug std::cout << "Submeshes : " << _subMeshesList.size() << std::endl; }
36.023077
136
0.602178
undeadinu
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
a13d4b97270d1c1ebc09498c33e9183a3c08be1e
6,125
cpp
C++
WatorMap.cpp
Mikescher/SharkSim
66417f8d859379c4d7febfe20de24ca5b40c2350
[ "Unlicense" ]
null
null
null
WatorMap.cpp
Mikescher/SharkSim
66417f8d859379c4d7febfe20de24ca5b40c2350
[ "Unlicense" ]
null
null
null
WatorMap.cpp
Mikescher/SharkSim
66417f8d859379c4d7febfe20de24ca5b40c2350
[ "Unlicense" ]
null
null
null
#include "stdafx.h" #include "WatorMap.h" WatorMap::WatorMap(int width, int height, int fbt, int sbt, int sst, int threadcount) { srand((unsigned int) time(NULL)); m_width = width; m_height = height; m_fishBreedTime = fbt; m_sharkBreedTime = sbt; m_sharkStarveTime = sst; m_currZyklus = 0; createMap(); m_graph_fish = new OGLGraph(width*height, height / 4, 1.8, COLOR_GRAPHFISH, width / 2); m_graph_shark = new OGLGraph(width*height, height / 4, 1.8, COLOR_GRAPHSHARK, width / 2); initThreads(threadcount); } WatorMap::~WatorMap(void) { freeDynamicArray(map); delete m_barrier; delete m_graph_fish; delete m_graph_shark; } int WatorMap::getWidth() { return m_width; } int WatorMap::getHeight() { return m_height; } void WatorMap::createMap() { map = allocateDynamicArray<WatorCell>(m_width, m_height); resetMap(); } void WatorMap::resetMap() { for (int x = 0; x < m_width; x++) { for (int y= 0; y < m_height; y++) { map[x][y].lastModifiedZyklus = 0; map[x][y].eatTime = 0; map[x][y].lifeTime = 0; map[x][y].type = WCT_FREE; if (rand() % 10000 < PERC_FISH) { map[x][y].type = WCT_FISH; map[x][y].lifeTime = rand() % FISH_BREEDTIME; } if (rand() % 10000 < PERC_SHARK) { map[x][y].lifeTime = rand() % SHARK_BREEDTIME; map[x][y].type = WCT_SHARK; } } } } void WatorMap::initThreads(int threads) { m_barrier = new boost::barrier(threads + 1); int thread_height = m_height / threads; int start = 0; int end = 0; for (int i = 0; i < threads; i++) { start = end; end = end + thread_height; if (i+1 == threads) // last end = m_height; boost::thread *t = new boost::thread(&WatorMap::doTick, this, m_barrier, start, end); m_threadlist.push_back(t); } } void WatorMap::doThreadedTick() { m_currZyklus++; m_barrier->wait(); #ifdef SHOW_GRAPH int sharks = 0; int fish = 0; for (int y = 0; y < m_height; y++) { for (int x = 0; x < m_width; x++) { switch(map[x][y].type) { case WCT_FISH: fish++; break; case WCT_SHARK: sharks++; break; } } } m_graph_fish->addValue(fish); m_graph_shark->addValue(sharks); #endif } void WatorMap::doTick(boost::barrier *barrier, int startY, int endY) { for(;;) { for (int y = startY; y < endY; y++) { for (int x = 0; x < m_width; x++) { if (map[x][y].lastModifiedZyklus != m_currZyklus) { map[x][y].lastModifiedZyklus = m_currZyklus; switch(map[x][y].type) { case WCT_FISH: map[x][y].lifeTime = map[x][y].lifeTime + 1; if (map[x][y].lifeTime > m_fishBreedTime) breedFish(x, y); moveFishRandom(x, y); break; case WCT_SHARK: map[x][y].lifeTime++; map[x][y].eatTime++; if (map[x][y].lifeTime > m_sharkBreedTime) breedShark(x, y); if (map[x][y].eatTime > m_sharkStarveTime) { clearCell(x, y); // Starve } else { moveSharkRandom(x, y); } break; } } } } barrier->wait(); } } WatorCell* WatorMap::getCell(int x, int y) { return &map[(x + m_width) % m_width][(y + m_height) % m_height]; } WatorCellType WatorMap::getCellType(int x, int y) { return getCell(x, y)->type; } bool WatorMap::isCellFree(int x, int y) { return map[(x + m_width) % m_width][(y + m_height) % m_height].type == WCT_FREE; } void WatorMap::moveCell(int fx, int fy, int tx, int ty) { WatorCell* from = getCell(fx, fy); WatorCell* to = getCell(tx, ty); to->eatTime = from->eatTime; to->lifeTime = from->lifeTime; to->type = from->type; to->lastModifiedZyklus = from->lastModifiedZyklus; from->eatTime = 0; from->lifeTime = 0; from->type = WCT_FREE; } void WatorMap::clearCell(int x, int y) { WatorCell* c = getCell(x, y); c->eatTime = 0; c->lifeTime = 0; c->type = WCT_FREE; } void WatorMap::moveFishRandom(int x, int y) { int direction = rand() % 4; for (int i = 0; i < 4; i++) { if (isCellFree(x + getXForDirection(direction), y + getYForDirection(direction))) { moveCell(x, y, x + getXForDirection(direction), y + getYForDirection(direction)); return; } direction = (direction+1) % 4; } } void WatorMap::breedFish(int x, int y) { int direction = rand() % 4; for (int i = 0; i < 4; i++) { if (isCellFree(x + getXForDirection(direction), y + getYForDirection(direction))) { WatorCell* newc = getCell(x + getXForDirection(direction), y + getYForDirection(direction)); newc->type = WCT_FISH; newc->lastModifiedZyklus = m_currZyklus; newc->lifeTime = 0; getCell(x, y)->lifeTime = 0; return; } direction = (direction+1) % 4; } } void WatorMap::moveSharkRandom(int x, int y) { // SEARCH 4 FISH int direction = rand() % 4; for (int i = 0; i < 4; i++) { if (getCellType(x + getXForDirection(direction), y + getYForDirection(direction)) == WCT_FISH) { getCell(x, y)->eatTime = 0; moveCell(x, y, x + getXForDirection(direction), y + getYForDirection(direction)); return; } direction = (direction+1) % 4; } // MOVE RANDOM for (int i = 0; i < 4; i++) { if (isCellFree(x + getXForDirection(direction), y + getYForDirection(direction))) { moveCell(x, y, x + getXForDirection(direction), y + getYForDirection(direction)); return; } direction = (direction+1) % 4; } } void WatorMap::breedShark(int x, int y) { int direction = rand() % 4; for (int i = 0; i < 4; i++) { if (getCellType(x + getXForDirection(direction), y + getYForDirection(direction)) != WCT_SHARK) { WatorCell* newc = getCell(x + getXForDirection(direction), y + getYForDirection(direction)); newc->type = WCT_SHARK; newc->lastModifiedZyklus = m_currZyklus; newc->lifeTime = 0; newc->eatTime = 0; getCell(x, y)->lifeTime = 0; return; } direction = (direction+1) % 4; } } int WatorMap::getXForDirection(int direc) { return (direc == 0 || direc == 2) ? (0) : ((direc == 1) ? (1) : (-1)); } int WatorMap::getYForDirection(int direc) { return (direc == 1 || direc == 3) ? (0) : ((direc == 0) ? (1) : (-1)); } void WatorMap::renderGraphs() { #ifdef SHOW_GRAPH m_graph_fish->render(5, m_height / 4 + 5); m_graph_shark->render(5, m_height / 4 + 5); #endif }
22.435897
99
0.624816
Mikescher
a13fca996aad9eade185b247dcbf4950737d3ed7
18,242
cpp
C++
src/modules/graphics/gles2/Context.cpp
binji/love-nacl
827aa23556fe1c4876e37d24aab40795871b8d81
[ "Zlib" ]
15
2015-02-26T07:38:58.000Z
2021-05-29T15:58:38.000Z
src/modules/graphics/gles2/Context.cpp
mcanthony/love-nacl
827aa23556fe1c4876e37d24aab40795871b8d81
[ "Zlib" ]
3
2015-04-20T18:14:30.000Z
2019-08-13T22:32:27.000Z
src/modules/graphics/gles2/Context.cpp
mcanthony/love-nacl
827aa23556fe1c4876e37d24aab40795871b8d81
[ "Zlib" ]
7
2015-10-09T20:36:26.000Z
2017-09-20T01:49:47.000Z
/** * Copyright (c) 2006-2013 LOVE Development Team * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. **/ #include "common/config.h" #include "common/Exception.h" #include "Context.h" #include "Image.h" #include "Shader.h" #include <algorithm> namespace love { namespace graphics { namespace gles2 { Context *Context::current = NULL; Context *getContext() { if (Context::current == NULL) Context::current = new Context; return Context::current; } Context *resetContext() { if (Context::current != NULL) { delete Context::current; Context::current = NULL; } return getContext(); } Context::Context() : shadersSupported(false) , maxAnisotropy(1.0f) { initState(); createDefaultTexture(); } Context::~Context() { if (current == this) current = NULL; } void Context::initCapabilityState() { state.enabledCapabilities.clear(); // getCapability starts tracking the state if the capability isn't in the map yet getCapability(GL_TEXTURE_2D); getCapability(GL_BLEND); getCapability(GL_SCISSOR_TEST); getCapability(GL_STENCIL_TEST); getCapability(GL_SCISSOR_TEST); } void Context::initTextureState() { state.textureUnits.clear(); // Initialize multiple texture unit support, if available if (shadersSupported) { GLint maxtextureunits; glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxtextureunits); state.textureUnits.resize(maxtextureunits, 0); GLenum curgltextureunit; glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint *) &curgltextureunit); state.curTextureUnit = curgltextureunit - GL_TEXTURE0; // Retrieve currently bound textures for each texture unit for (size_t i = 0; i < state.textureUnits.size(); ++i) { glActiveTexture(GL_TEXTURE0 + i); glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *) &state.textureUnits[i]); } glActiveTexture(curgltextureunit); } else { // Multitexturing not supported, so we only have 1 texture unit state.textureUnits.resize(1, 0); state.curTextureUnit = 0; glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *) &state.textureUnits[0]); } } void Context::createDefaultTexture() { // Set the 'default' texture (id 0) as a repeating white pixel. // Otherwise, texture2D inside a shader would return black when drawing graphics primitives, // which would require the creation of different default shaders for untextured primitives vs images. GLuint curtexture = state.textureUnits[state.curTextureUnit]; bindTexture(0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); GLubyte pixel = 255; glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 1, 1, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, &pixel); bindTexture(curtexture); } void Context::initMatrixState() { // Set up transformation matrix stacks while (!modelViewStack.empty()) modelViewStack.pop(); modelViewStack.push(Matrix()); while (!projectionStack.empty()) projectionStack.pop(); projectionStack.push(Matrix()); } void Context::initVertexAttribState() { // set vertex attribute index map state.vertexAttribMap.clear(); // use explicit generic attribute index locations with shaders state.vertexAttribMap[ATTRIB_VERTEX] = 0; state.vertexAttribMap[ATTRIB_COLOR] = 1; state.vertexAttribMap[ATTRIB_TEXCOORD] = 2; // making sure all vertex attributes are disabled is much easier than querying them state.enabledVertexAttribArrays.clear(); useVertexAttribArrays(ATTRIB_NONE); } void Context::initState() { shadersSupported = Shader::isSupported(); initCapabilityState(); initTextureState(); initMatrixState(); initVertexAttribState(); // get blend state glGetIntegerv(GL_BLEND_SRC_RGB, (GLint *) &state.blend.src_rgb); glGetIntegerv(GL_BLEND_SRC_ALPHA, (GLint *) &state.blend.src_a); glGetIntegerv(GL_BLEND_DST_RGB, (GLint *) &state.blend.dst_rgb); glGetIntegerv(GL_BLEND_DST_ALPHA, (GLint *) &state.blend.dst_a); glGetIntegerv(GL_BLEND_EQUATION_RGB, (GLint *) &state.blend.function); // get the current color GLfloat color[4]; glGetVertexAttribfv(state.vertexAttribMap[ATTRIB_COLOR], GL_CURRENT_VERTEX_ATTRIB, color); state.color = Color(color[0] * 255, color[1] * 255, color[2] * 255, color[3] * 255); // get the current clear color glGetFloatv(GL_COLOR_CLEAR_VALUE, color); state.clearColor = Color(color[0] * 255, color[1] * 255, color[2] * 255, color[3] * 255); // get the current point size state.lastShaderPointSize = state.pointSize; // get the maximum point size GLfloat pointsizerange[2]; glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, pointsizerange); state.maxPointSize = pointsizerange[1]; state.lastUsedShader = NULL; // use the currently bound framebuffer as the default glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint *) &state.defaultFramebuffer); // get the maximum anisotropic filtering value maxAnisotropy = 1.0f; } void Context::setupRender() { const Matrix &projectionMatrix = projectionStack.top(); const Matrix &modelViewMatrix = modelViewStack.top(); Shader *shader = Shader::currentShader; bool shaderchanged = shader != state.lastUsedShader; bool mvmatrixchanged = shaderchanged || modelViewMatrix != state.modelViewMatrix; bool pmatrixchanged = shaderchanged || projectionMatrix != state.projectionMatrix; if (shader != NULL) { bool pointsizechanged = shaderchanged || state.pointSize != state.lastShaderPointSize; if (pointsizechanged && shader->hasUniform("PointSize")) { shader->sendFloat("PointSize", 1, (GLfloat *) &state.pointSize, 1); state.lastShaderPointSize = state.pointSize; } // send transformation matrices to the active shader for use when rendering if (mvmatrixchanged && shader->hasUniform("ModelViewMatrix")) shader->sendMatrix("ModelViewMatrix", 4, modelViewMatrix.getElements(), 1); if (pmatrixchanged && shader->hasUniform("ProjectionMatrix")) shader->sendMatrix("ProjectionMatrix", 4, projectionMatrix.getElements(), 1); if ((mvmatrixchanged || pmatrixchanged) && shader->hasUniform("ModelViewProjectionMatrix")) { Matrix mvpMatrix = projectionMatrix * modelViewMatrix; shader->sendMatrix("ModelViewProjectionMatrix", 4, mvpMatrix.getElements(), 1); } // TODO: normal matrix // "transpose of the inverse of the upper leftmost 3x3 of the Model-View Matrix" } if (mvmatrixchanged) state.modelViewMatrix = modelViewMatrix; if (pmatrixchanged) state.projectionMatrix = projectionMatrix; state.lastUsedShader = shader; } bool Context::isCapabilitySupported(GLenum capability) const { // Only a few glEnable / glDisable capabilities are supported in ES2 switch (capability) { case GL_BLEND: case GL_STENCIL_TEST: case GL_SCISSOR_TEST: case GL_DEPTH_TEST: case GL_CULL_FACE: case GL_DITHER: case GL_POLYGON_OFFSET_FILL: case GL_SAMPLE_COVERAGE: case GL_SAMPLE_ALPHA_TO_COVERAGE: return true; default: return false; } } void Context::setCapability(GLenum capability, bool enable) { if (!isCapabilitySupported(capability)) return; // is this capability already set to the state we want? std::map<GLenum, bool>::const_iterator cap = state.enabledCapabilities.find(capability); if (cap != state.enabledCapabilities.end() && cap->second == enable) return; state.enabledCapabilities[capability] = enable; if (enable) glEnable(capability); else glDisable(capability); } bool Context::getCapability(GLenum capability) { // Assume disabled if toggling it isn't supported if (!isCapabilitySupported(capability)) return false; // Return cached enable state for the capability, if we have it std::map<GLenum, bool>::const_iterator cap = state.enabledCapabilities.find(capability); if (cap != state.enabledCapabilities.end()) return cap->second; // Get the current enable state from GL and stick it in the map bool isenabled = glIsEnabled(capability) == GL_TRUE; state.enabledCapabilities[capability] = isenabled; return isenabled; } void Context::setColor(const Color &color) { // glVertexAttrib4Nub(state.vertexAttribMap[ATTRIB_COLOR], color.r, color.g, color.b, color.a); glVertexAttrib4f( state.vertexAttribMap[ATTRIB_COLOR], color.r / 255.0, color.g / 255.0, color.b / 255.0, color.a / 255.0); state.color = color; } const Color &Context::getColor() const { return state.color; } void Context::setClearColor(const Color &color) { glClearColor(color.r / 255.0f, color.g / 255.0f, color.b / 255.0f, color.a / 255.0f); state.clearColor = color; } const Color &Context::getClearColor() const { return state.clearColor; } void Context::setPointSize(float size) { state.pointSize = size; } float Context::getPointSize() const { return state.pointSize; } float Context::getMaxPointSize() const { return state.maxPointSize; } void Context::setMainViewport(GLint x, GLint y, GLsizei width, GLsizei height) { Viewport v(x, y, width, height); if (viewportStack.empty()) viewportStack.push_back(v); else viewportStack[0] = v; if (viewportStack.size() == 1) glViewport(v.x, v.y, v.width, v.height); } void Context::pushViewport(const Context::Viewport &v) { glViewport(v.x, v.y, v.width, v.height); viewportStack.push_back(v); } void Context::pushViewport(GLint x, GLint y, GLsizei width, GLsizei height) { pushViewport(Viewport(x, y, width, height)); } void Context::popViewport() { if (viewportStack.size() == 1) { fprintf(stderr, "popViewport: Trying to pop stack with size==1!\n"); return; } viewportStack.pop_back(); const Viewport& v = getViewport(); glViewport(v.x, v.y, v.width, v.height); } const Context::Viewport &Context::getViewport() const { return viewportStack.back(); } void Context::setBlendState(const Context::BlendState &s) { const BlendState &cur_s = state.blend; if (s.function != cur_s.function) { glBlendEquation(s.function); } if (s.src_rgb != cur_s.src_rgb || s.src_a != cur_s.src_a || s.dst_rgb != cur_s.dst_rgb || s.dst_a != cur_s.dst_a) { if (s.src_rgb == s.src_a && s.dst_rgb == s.dst_a) glBlendFunc(s.src_rgb, s.dst_rgb); else glBlendFuncSeparate(s.src_rgb, s.dst_rgb, s.src_a, s.dst_a); } state.blend = s; } void Context::setBlendState(GLenum function, GLenum source, GLenum destination) { BlendState b = {function, source, destination}; setBlendState(b); } const Context::BlendState &Context::getBlendState() const { return state.blend; } bool Context::isGenericVertexAttrib(unsigned int attrib) const { return true; } GLint Context::getVertexAttribID(unsigned int attrib) const { std::map<unsigned int, GLenum>::const_iterator glattrib = state.vertexAttribMap.find(attrib); if (glattrib == state.vertexAttribMap.end()) return -1; return glattrib->second; } void Context::setVertexAttribArray(unsigned int attrib, bool enable) { if (attrib == ATTRIB_NONE) return; // is this attribute already set to the state we want? std::map<unsigned int, bool>::const_iterator attribenabled = state.enabledVertexAttribArrays.find(attrib); if (attribenabled != state.enabledVertexAttribArrays.end() && attribenabled->second == enable) return; // get the internal OpenGL representation for this attribute, if it exists GLint glattrib = getVertexAttribID(attrib); if (glattrib < 0) return; if (enable) glEnableVertexAttribArray(glattrib); else glDisableVertexAttribArray(glattrib); // save the attribute's state state.enabledVertexAttribArrays[attrib] = enable; } void Context::useVertexAttribArrays(unsigned int attribs) { for (int i = 0; i < 3; i++) { unsigned int attrib = 1u << i; bool enable = (attribs & attrib) != 0; setVertexAttribArray(attrib, enable); } } void Context::vertexAttribPointer(Context::VertexAttribType attrib, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) const { // get the internal OpenGL representation for this attribute, if it exists GLint glattrib = getVertexAttribID(attrib); if (glattrib < 0) return; // TODO: better check for normalization? GLboolean normalize = (type == GL_UNSIGNED_BYTE) ? GL_TRUE : GL_FALSE; glVertexAttribPointer(glattrib, size, type, normalize, stride, pointer); } GLuint Context::getDefaultFramebuffer() const { return state.defaultFramebuffer; } void Context::setActiveTextureUnit(int textureunit) { if (textureunit < 0 || (size_t) textureunit >= state.textureUnits.size()) throw love::Exception("Invalid texture unit index (%d).", textureunit); if (textureunit != state.curTextureUnit) { if (shadersSupported) glActiveTexture(GL_TEXTURE0 + textureunit); else throw love::Exception("Multitexturing not supported."); } state.curTextureUnit = textureunit; } void Context::bindTexture(GLuint texture) { if (texture != state.textureUnits[state.curTextureUnit]) { state.textureUnits[state.curTextureUnit] = texture; glBindTexture(GL_TEXTURE_2D, texture); } } void Context::bindTextureToUnit(GLuint texture, int textureunit, bool restoreprev) { if (textureunit < 0 || (size_t) textureunit >= state.textureUnits.size()) throw love::Exception("Invalid texture unit index."); if (texture != state.textureUnits[textureunit]) { int oldtextureunit = state.curTextureUnit; setActiveTextureUnit(textureunit); state.textureUnits[textureunit] = texture; glBindTexture(GL_TEXTURE_2D, texture); if (restoreprev) setActiveTextureUnit(oldtextureunit); } } void Context::deleteTexture(GLuint texture) { // glDeleteTextures binds textureid 0 to all texture units the deleted texture was bound to int oldtextureunit = state.curTextureUnit; std::vector<GLuint>::iterator it; for (it = state.textureUnits.begin(); it != state.textureUnits.end(); ++it) { int textureUnit = it - state.textureUnits.begin(); if (*it == texture) { setActiveTextureUnit(textureUnit); glBindTexture(GL_TEXTURE_2D, 0); *it = 0; } } setActiveTextureUnit(oldtextureunit); glDeleteTextures(1, &texture); } float Context::setTextureFilter(const graphics::Image::Filter &f) const { GLint gmin, gmag; if (f.mipmap == Image::FILTER_NONE) { if (f.min == Image::FILTER_NEAREST) gmin = GL_NEAREST; else // f.min == Image::FILTER_LINEAR gmin = GL_LINEAR; } else { if (f.min == Image::FILTER_NEAREST && f.mipmap == Image::FILTER_NEAREST) gmin = GL_NEAREST_MIPMAP_NEAREST; else if (f.min == Image::FILTER_NEAREST && f.mipmap == Image::FILTER_LINEAR) gmin = GL_NEAREST_MIPMAP_LINEAR; else if (f.min == Image::FILTER_LINEAR && f.mipmap == Image::FILTER_NEAREST) gmin = GL_LINEAR_MIPMAP_NEAREST; else if (f.min == Image::FILTER_LINEAR && f.mipmap == Image::FILTER_LINEAR) gmin = GL_LINEAR_MIPMAP_LINEAR; else gmin = GL_LINEAR; } switch (f.mag) { case Image::FILTER_NEAREST: gmag = GL_NEAREST; break; case Image::FILTER_LINEAR: default: gmag = GL_LINEAR; break; } glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gmin); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gmag); float anisotropy = 1.0f; #if 0 if (GLEW_EXT_texture_filter_anisotropic) { anisotropy = std::min(std::max(f.anisotropy, 1.0f), maxAnisotropy); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropy); } #endif return anisotropy; } graphics::Image::Filter Context::getTextureFilter() const { GLint gmin, gmag; glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, &gmin); glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, &gmag); Image::Filter f; switch (gmin) { case GL_NEAREST: f.min = Image::FILTER_NEAREST; f.mipmap = Image::FILTER_NONE; break; case GL_NEAREST_MIPMAP_NEAREST: f.min = f.mipmap = Image::FILTER_NEAREST; break; case GL_NEAREST_MIPMAP_LINEAR: f.min = Image::FILTER_NEAREST; f.mipmap = Image::FILTER_LINEAR; break; case GL_LINEAR_MIPMAP_NEAREST: f.min = Image::FILTER_LINEAR; f.mipmap = Image::FILTER_NEAREST; break; case GL_LINEAR_MIPMAP_LINEAR: f.min = f.mipmap = Image::FILTER_LINEAR; break; case GL_LINEAR: default: f.min = Image::FILTER_LINEAR; f.mipmap = Image::FILTER_NONE; break; } switch (gmag) { case GL_NEAREST: f.mag = Image::FILTER_NEAREST; break; case GL_LINEAR: default: f.mag = Image::FILTER_LINEAR; break; } #if 0 if (GLEW_EXT_texture_filter_anisotropic) glGetTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, &f.anisotropy); #endif return f; } void Context::setTextureWrap(const graphics::Image::Wrap &w) const { GLint gs, gt; switch (w.s) { case Image::WRAP_CLAMP: gs = GL_CLAMP_TO_EDGE; break; case Image::WRAP_REPEAT: default: gs = GL_REPEAT; break; } switch (w.t) { case Image::WRAP_CLAMP: gt = GL_CLAMP_TO_EDGE; break; case Image::WRAP_REPEAT: default: gt = GL_REPEAT; break; } glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, gs); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gt); } graphics::Image::Wrap Context::getTextureWrap() const { GLint gs, gt; glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, &gs); glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, &gt); Image::Wrap w; switch (gs) { case GL_CLAMP_TO_EDGE: w.s = Image::WRAP_CLAMP; break; case GL_REPEAT: default: w.s = Image::WRAP_REPEAT; break; } switch (gt) { case GL_CLAMP_TO_EDGE: w.t = Image::WRAP_CLAMP; break; case GL_REPEAT: default: w.t = Image::WRAP_REPEAT; break; } return w; } } // gles2 } // graphics } // love
24.819048
137
0.737474
binji
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
a1440562cbd743f34203d4d5b620adfddc7bcc10
1,860
cpp
C++
libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp
ingve/llvm-project
13a467c8d169fc8caf142240382e9fce82a20e5e
[ "Apache-2.0" ]
1
2021-07-07T08:58:09.000Z
2021-07-07T08:58:09.000Z
libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp
ingve/llvm-project
13a467c8d169fc8caf142240382e9fce82a20e5e
[ "Apache-2.0" ]
null
null
null
libcxx/test/libcxx/containers/unord/non_const_comparator.verify.cpp
ingve/llvm-project
13a467c8d169fc8caf142240382e9fce82a20e5e
[ "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 // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03 // REQUIRES: diagnose-if-support // Test that libc++ generates a warning diagnostic when the container is // provided a non-const callable comparator or a non-const hasher. #include <unordered_set> #include <unordered_map> struct BadHash { template <class T> size_t operator()(T const& t) { return std::hash<T>{}(t); } }; struct BadEqual { template <class T, class U> bool operator()(T const& t, U const& u) { return t == u; } }; int main(int, char**) { static_assert(!std::__invokable<BadEqual const&, int const&, int const&>::value, ""); static_assert(std::__invokable<BadEqual&, int const&, int const&>::value, ""); // expected-warning@unordered_set:* 2 {{the specified comparator type does not provide a viable const call operator}} // expected-warning@unordered_map:* 2 {{the specified comparator type does not provide a viable const call operator}} // expected-warning@unordered_set:* 2 {{the specified hash functor does not provide a viable const call operator}} // expected-warning@unordered_map:* 2 {{the specified hash functor does not provide a viable const call operator}} { using C = std::unordered_set<int, BadHash, BadEqual>; C s; } { using C = std::unordered_multiset<long, BadHash, BadEqual>; C s; } { using C = std::unordered_map<int, int, BadHash, BadEqual>; C s; } { using C = std::unordered_multimap<long, int, BadHash, BadEqual>; C s; } return 0; }
31
119
0.626882
ingve
a14480cb95ee5ec9c5fafb8efc7cc125f7792d87
10,258
hpp
C++
openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/boost/1.69.0-r0/boost_1_69_0/boost/multi_index/detail/index_base.hpp
sotaoverride/backup
ca53a10b72295387ef4948a9289cb78ab70bc449
[ "Apache-2.0" ]
null
null
null
openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/boost/1.69.0-r0/boost_1_69_0/boost/multi_index/detail/index_base.hpp
sotaoverride/backup
ca53a10b72295387ef4948a9289cb78ab70bc449
[ "Apache-2.0" ]
null
null
null
openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/boost/1.69.0-r0/boost_1_69_0/boost/multi_index/detail/index_base.hpp
sotaoverride/backup
ca53a10b72295387ef4948a9289cb78ab70bc449
[ "Apache-2.0" ]
null
null
null
/* Copyright 2003-2017 Joaquin M Lopez Munoz. * 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) * * See http://www.boost.org/libs/multi_index for library home page. */ #ifndef BOOST_MULTI_INDEX_DETAIL_INDEX_BASE_HPP #define BOOST_MULTI_INDEX_DETAIL_INDEX_BASE_HPP #if defined(_MSC_VER) #pragma once #endif #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */ #include <boost/core/addressof.hpp> #include <boost/detail/allocator_utilities.hpp> #include <boost/detail/no_exceptions_support.hpp> #include <boost/detail/workaround.hpp> #include <boost/move/core.hpp> #include <boost/move/utility.hpp> #include <boost/mpl/vector.hpp> #include <boost/multi_index/detail/copy_map.hpp> #include <boost/multi_index/detail/do_not_copy_elements_tag.hpp> #include <boost/multi_index/detail/node_type.hpp> #include <boost/multi_index/detail/vartempl_support.hpp> #include <boost/multi_index_container_fwd.hpp> #include <boost/tuple/tuple.hpp> #include <utility> #if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION) #include <boost/multi_index/detail/index_loader.hpp> #include <boost/multi_index/detail/index_saver.hpp> #endif namespace boost { namespace multi_index { namespace detail { /* The role of this class is threefold: * - tops the linear hierarchy of indices. * - terminates some cascading backbone function calls (insert_, etc.), * - grants access to the backbone functions of the final * multi_index_container class (for access restriction reasons, these * cannot be called directly from the index classes.) */ struct lvalue_tag { }; struct rvalue_tag { }; struct emplaced_tag { }; template <typename Value, typename IndexSpecifierList, typename Allocator> class index_base { protected: typedef index_node_base<Value, Allocator> node_type; typedef typename multi_index_node_type<Value, IndexSpecifierList, Allocator>::type final_node_type; typedef multi_index_container<Value, IndexSpecifierList, Allocator> final_type; typedef tuples::null_type ctor_args_list; typedef typename boost::detail::allocator::rebind_to< Allocator, typename Allocator::value_type>::type final_allocator_type; typedef mpl::vector0<> index_type_list; typedef mpl::vector0<> iterator_type_list; typedef mpl::vector0<> const_iterator_type_list; typedef copy_map<final_node_type, final_allocator_type> copy_map_type; #if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION) typedef index_saver<node_type, final_allocator_type> index_saver_type; typedef index_loader<node_type, final_node_type, final_allocator_type> index_loader_type; #endif private: typedef Value value_type; protected: explicit index_base(const ctor_args_list&, const Allocator&) { } index_base(const index_base<Value, IndexSpecifierList, Allocator>&, do_not_copy_elements_tag) { } void copy_(const index_base<Value, IndexSpecifierList, Allocator>&, const copy_map_type&) { } final_node_type* insert_(const value_type& v, final_node_type*& x, lvalue_tag) { x = final().allocate_node(); BOOST_TRY { boost::detail::allocator::construct(boost::addressof(x->value()), v); } BOOST_CATCH(...) { final().deallocate_node(x); BOOST_RETHROW; } BOOST_CATCH_END return x; } final_node_type* insert_(const value_type& v, final_node_type*& x, rvalue_tag) { x = final().allocate_node(); BOOST_TRY { /* This shoud have used a modified, T&&-compatible version of * boost::detail::allocator::construct, but * <boost/detail/allocator_utilities.hpp> is too old and venerable * to mess with; besides, it is a general internal utility and the * imperfect perfect forwarding emulation of Boost.Move might break * other libs. */ new (boost::addressof(x->value())) value_type(boost::move(const_cast<value_type&>(v))); } BOOST_CATCH(...) { final().deallocate_node(x); BOOST_RETHROW; } BOOST_CATCH_END return x; } final_node_type* insert_(const value_type&, final_node_type*& x, emplaced_tag) { return x; } final_node_type* insert_(const value_type& v, node_type*, final_node_type*& x, lvalue_tag) { return insert_(v, x, lvalue_tag()); } final_node_type* insert_(const value_type& v, node_type*, final_node_type*& x, rvalue_tag) { return insert_(v, x, rvalue_tag()); } final_node_type* insert_(const value_type&, node_type*, final_node_type*& x, emplaced_tag) { return x; } void erase_(node_type* x) { boost::detail::allocator::destroy(boost::addressof(x->value())); } void delete_node_(node_type* x) { boost::detail::allocator::destroy(boost::addressof(x->value())); } void clear_() { } void swap_(index_base<Value, IndexSpecifierList, Allocator>&) { } void swap_elements_(index_base<Value, IndexSpecifierList, Allocator>&) { } bool replace_(const value_type& v, node_type* x, lvalue_tag) { x->value() = v; return true; } bool replace_(const value_type& v, node_type* x, rvalue_tag) { x->value() = boost::move(const_cast<value_type&>(v)); return true; } bool modify_(node_type*) { return true; } bool modify_rollback_(node_type*) { return true; } bool check_rollback_(node_type*) const { return true; } #if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION) /* serialization */ template <typename Archive> void save_(Archive&, const unsigned int, const index_saver_type&) const { } template <typename Archive> void load_(Archive&, const unsigned int, const index_loader_type&) { } #endif #if defined(BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING) /* invariant stuff */ bool invariant_() const { return true; } #endif /* access to backbone memfuns of Final class */ final_type& final() { return *static_cast<final_type*>(this); } const final_type& final() const { return *static_cast<const final_type*>(this); } final_node_type* final_header() const { return final().header(); } bool final_empty_() const { return final().empty_(); } std::size_t final_size_() const { return final().size_(); } std::size_t final_max_size_() const { return final().max_size_(); } std::pair<final_node_type*, bool> final_insert_(const value_type& x) { return final().insert_(x); } std::pair<final_node_type*, bool> final_insert_rv_(const value_type& x) { return final().insert_rv_(x); } template <typename T> std::pair<final_node_type*, bool> final_insert_ref_(const T& t) { return final().insert_ref_(t); } template <typename T> std::pair<final_node_type*, bool> final_insert_ref_(T& t) { return final().insert_ref_(t); } template <BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK> std::pair<final_node_type*, bool> final_emplace_(BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK) { return final().emplace_(BOOST_MULTI_INDEX_FORWARD_PARAM_PACK); } std::pair<final_node_type*, bool> final_insert_(const value_type& x, final_node_type* position) { return final().insert_(x, position); } std::pair<final_node_type*, bool> final_insert_rv_(const value_type& x, final_node_type* position) { return final().insert_rv_(x, position); } template <typename T> std::pair<final_node_type*, bool> final_insert_ref_(const T& t, final_node_type* position) { return final().insert_ref_(t, position); } template <typename T> std::pair<final_node_type*, bool> final_insert_ref_(T& t, final_node_type* position) { return final().insert_ref_(t, position); } template <BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK> std::pair<final_node_type*, bool> final_emplace_hint_(final_node_type* position, BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK) { return final().emplace_hint_(position, BOOST_MULTI_INDEX_FORWARD_PARAM_PACK); } void final_erase_(final_node_type* x) { final().erase_(x); } void final_delete_node_(final_node_type* x) { final().delete_node_(x); } void final_delete_all_nodes_() { final().delete_all_nodes_(); } void final_clear_() { final().clear_(); } void final_swap_(final_type& x) { final().swap_(x); } bool final_replace_(const value_type& k, final_node_type* x) { return final().replace_(k, x); } bool final_replace_rv_(const value_type& k, final_node_type* x) { return final().replace_rv_(k, x); } template <typename Modifier> bool final_modify_(Modifier& mod, final_node_type* x) { return final().modify_(mod, x); } template <typename Modifier, typename Rollback> bool final_modify_(Modifier& mod, Rollback& back, final_node_type* x) { return final().modify_(mod, back, x); } #if defined(BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING) void final_check_invariant_() const { final().check_invariant_(); } #endif }; } // namespace detail } /* namespace multi_index */ } /* namespace boost */ #endif
26.235294
80
0.634822
sotaoverride
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
a148c19d55c4e894123929098ab4e12e1e5cec34
3,273
cpp
C++
codeforces/1286f.cpp
sogapalag/problems
0ea7d65448e1177f8b3f81124a82d187980d659c
[ "MIT" ]
1
2020-04-04T14:56:12.000Z
2020-04-04T14:56:12.000Z
codeforces/1286f.cpp
sogapalag/problems
0ea7d65448e1177f8b3f81124a82d187980d659c
[ "MIT" ]
null
null
null
codeforces/1286f.cpp
sogapalag/problems
0ea7d65448e1177f8b3f81124a82d187980d659c
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> using namespace std; using ll=long long; // O(n 2^n) Yates #define __loop(f) \ for (int i = 0, n = 31-__builtin_clz((int)f.size()), MSK = 1<<n; i < n; i++)\ for (int msk = 0; msk < MSK; msk++)\ if (msk>>i&1) // F=Z(f). F[X] := sum_{S sub X} f[S] template <typename T> inline void fast_subset_zeta_transform(vector<T>& f) { __loop(f) f[msk] += f[msk ^ 1<<i]; } // F=M(f). F[X] := sum_{S sub X} (-1)^|X\S| f[S]. // MZ = ZM = I template <typename T> inline void fast_subset_mobius_transform(vector<T>& f) { __loop(f) f[msk] -= f[msk ^ 1<<i]; } // F=Z'(f). F[X] := sum_{X sub S} f[S] // Z' = rZr. Z = rZ'r template <typename T> inline void fast_superset_zeta_transform(vector<T>& f) { __loop(f) f[msk ^ 1<<i] += f[msk]; } void solve() { int n; cin >> n; vector<ll> a; for (int _ = 0; _ < n; _++) { ll x; cin >> x; if (x != 0) a.push_back(x); } n = a.size(); if (n == 0) { cout << 0; return; } else if (n == 1) { cout << 1; return; } const int MSK = 1<<n; vector<ll> sum(MSK); for (int i = 0; i < n; i++) { sum[1<<i] = a[i]; } fast_subset_zeta_transform(sum); vector<bool> good(MSK); int m = n/2; const int LO = 1<<m; for (int hi = 0; hi < MSK; hi+=LO) { vector<ll> ds; // deltas: {A-B} // exclude 0,hi for (int sub = (hi-1)&hi; sub >= 1; (sub-=1)&=hi) { ds.push_back(sum[sub] - sum[sub^hi]); } sort(ds.begin(), ds.end()); for (int lo = 0; lo < LO; lo++) { int nodes = __builtin_popcount(hi|lo); // N-1 edges, add N-1 parity if ((sum[hi|lo] + nodes-1) % 2 != 0) continue; bool yes = false; for (int sub = lo; sub >= 0; (sub-=1)&=lo) { ll d = sum[sub] - sum[sub^lo]; //// hi sub could be 0 //if (sub != 0 && abs(d - sum[hi]) <= nodes-1) // yes |= true; //// hi sub could be full //if (sub != lo && abs(d + sum[hi]) <= nodes-1) // yes |= true; // hi could be 0. if (sub > 0 && sub < lo+hi && abs(d - sum[hi]) <= nodes -1) yes |= true; if (sub < lo && sub+hi > 0 && abs(d + sum[hi]) <= nodes - 1) yes |= true; // |x+d| <= N-1 auto lb = lower_bound(ds.begin(), ds.end(), -d - (nodes-1)); auto ub = upper_bound(ds.begin(), ds.end(), -d + (nodes-1)); if (lb != ub) yes |= true; if (yes) { good[hi|lo] = true; //cerr << hi << ' ' << lo << endl; break; } if (sub == 0) break; } } } // split set to good sub, one good sub implies we can use N-1<N, vector<int> dp(MSK, 0); for (int msk = 1; msk < MSK; msk++) { for (int sub = msk; sub >= 1; (sub-=1)&=msk) { dp[msk] = max(dp[msk], good[sub] + dp[msk^sub]); } } cout << (n - dp[MSK-1]); } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); solve(); cout << endl; }
30.877358
81
0.425909
sogapalag
a149d26df848627757114316e4aee48387deaa37
3,421
cc
C++
src/entities/filters/particle_emitter_filter.cc
SkyVault/SkyVault
e8bd51049ca94f30bb2da77bd572ef11107bb5c1
[ "MIT" ]
1
2019-12-19T12:20:52.000Z
2019-12-19T12:20:52.000Z
src/entities/filters/particle_emitter_filter.cc
SkyVault/SkyVault
e8bd51049ca94f30bb2da77bd572ef11107bb5c1
[ "MIT" ]
2
2019-01-23T21:18:11.000Z
2019-01-28T17:44:34.000Z
src/entities/filters/particle_emitter_filter.cc
SkyVault/SkyVault
e8bd51049ca94f30bb2da77bd572ef11107bb5c1
[ "MIT" ]
null
null
null
#include "particle_emitter_filter.h" using namespace Interpolation; void ParticleEmitterFilter::Update(const SkyTime& time, Entity* entity) { auto emitter = entity->Get<ParticleEmitter>(); auto body = entity->Get<Body>(); emitter->VelocityBounds = sf::FloatRect(-10, 10, -5, -30); emitter->Radius = 4.0f; emitter->ScalerRange = sf::Vector2f(0.02, 0.2); emitter->MaxTime = 0.02f; emitter->ParticleNumber = sf::Vector2i(2, 6); emitter->Color = sf::Color(255, 150, 0); if (emitter->timer <= 0) { auto number = rand_int(emitter->ParticleNumber.x, emitter->ParticleNumber.y); for (int i = 0; i < number; i++) { // Spawn the particle auto dir = rand_float() * 2 * 3.1415926; auto xpos = cos(dir) * (emitter->Radius * rand_float()); auto ypos = sin(dir) * (emitter->Radius * rand_float()); auto particle = std::unique_ptr<Particle>(new Particle); auto size = emitter->SizeBounds.x + (rand_float() * (emitter->SizeBounds.x + emitter->SizeBounds.y)); particle->Size = sf::Vector2f(size, size); particle->Position = body->Center() + sf::Vector2f(xpos, ypos); particle->StartingLife = particle->Life = emitter->LifeRange.x + (rand_float() * (emitter->LifeRange.x + emitter->LifeRange.y)); auto velX = emitter->VelocityBounds.left + (rand_float() * (emitter->VelocityBounds.top * 2.0f)); auto velY = emitter->VelocityBounds.width + (rand_float() * (emitter->VelocityBounds.height * 2.0f)); particle->Velocity = sf::Vector2f(velX, velY); particle->Color = emitter->Color; particle->TargetColor = sf::Color::White; particle->Scaler = emitter->ScalerRange.x + (rand_float() * (emitter->ScalerRange.y * 2.0f)); particles.push_back(std::move(particle)); } emitter->timer = emitter->MaxTime; } emitter->timer -= time.dt; // Update the particles auto it = particles.begin(); while (it != particles.end()) { (*it)->Position += (*it)->Velocity * time.dt; (*it)->Size *= powf((*it)->Scaler, time.dt); float life_percent = 1 - ((*it)->Life / (*it)->StartingLife); float r = (float)(*it)->Color.r / 255.0f; float g = (float)(*it)->Color.g / 255.0f; float b = (float)(*it)->Color.b / 255.0f; float tr = (float)(*it)->TargetColor.r / 255.0f; float tg = (float)(*it)->TargetColor.g / 255.0f; float tb = (float)(*it)->TargetColor.b / 255.0f; r = LerpPercent(r, tr, life_percent); g = LerpPercent(g, tg, life_percent); b = LerpPercent(b, tb, life_percent); (*it)->Color = sf::Color((int)(r * 255), (int)(g * 255), (int)(b * 255)); if ((*it)->Life <= 0.0f) { it = particles.erase(it); continue; } (*it)->Life -= time.dt; ++it; } } void ParticleEmitterFilter::Render(std::unique_ptr<sf::RenderWindow>& window, Entity* entity) { sf::CircleShape shape; for (const auto& particle : particles) { shape.setPosition(particle->Position); shape.setRadius(particle->Size.x / 2.0f); shape.setFillColor(particle->Color); window->draw(shape); } }
31.971963
95
0.559193
SkyVault
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
a150a6de8e1eb24267244aa6a6ea9d2b30b48315
10,007
cpp
C++
tests/BinTest.cpp
prozum/SPPL
77de5db600a89b84bc8e6e851c9a766cd5203ce2
[ "MIT" ]
4
2016-03-17T19:38:51.000Z
2016-10-30T18:54:17.000Z
tests/BinTest.cpp
prozum/sppl
77de5db600a89b84bc8e6e851c9a766cd5203ce2
[ "MIT" ]
null
null
null
tests/BinTest.cpp
prozum/sppl
77de5db600a89b84bc8e6e851c9a766cd5203ce2
[ "MIT" ]
null
null
null
#include "Test.h" void Test::binEqualTrueTrue() { bool compStatus = compileChecker("bin/binEqualTrueTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("True"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binEqualTrueFalse() { bool compStatus = compileChecker("bin/binEqualTrueFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("False"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binEqualFalseTrue() { bool compStatus = compileChecker("bin/binEqualFalseTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("False"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binEqualFalseFalse() { bool compStatus = compileChecker("bin/binEqualFalseFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("True"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binNotEqualTrueTrue() { bool compStatus = compileChecker("bin/binNotEqualTrueTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("False"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binNotEqualTrueFalse() { bool compStatus = compileChecker("bin/binNotEqualTrueFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("True"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binNotEqualFalseTrue() { bool compStatus = compileChecker("bin/binNotEqualFalseTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("True"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binNotEqualFalseFalse() { bool compStatus = compileChecker("bin/binNotEqualFalseFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("False"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binAndTrueTrue() { bool compStatus = compileChecker("bin/binAndTrueTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("True"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binAndTrueFalse() { bool compStatus = compileChecker("bin/binAndTrueFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("False"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binAndFalseTrue() { bool compStatus = compileChecker("bin/binAndFalseTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("False"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binAndFalseFalse() { bool compStatus = compileChecker("bin/binAndFalseFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("False"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binOrTrueTrue() { bool compStatus = compileChecker("bin/binOrTrueTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("True"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binOrTrueFalse() { bool compStatus = compileChecker("bin/binOrTrueFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("True"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binOrFalseTrue() { bool compStatus = compileChecker("bin/binOrFalseTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("True"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binOrFalseFalse() { bool compStatus = compileChecker("bin/binOrFalseFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("False"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binGrEqTrueTrue() { bool compStatus = compileChecker("bin/binGrEqTrueTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binGrEqTrueFalse() { bool compStatus = compileChecker("bin/binGrEqTrueFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binGrEqFalseTrue() { bool compStatus = compileChecker("bin/binGrEqFalseTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binGrEqFalseFalse() { bool compStatus = compileChecker("bin/binGrEqFalseFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binLeEqTrueTrue() { bool compStatus = compileChecker("bin/binLeEqTrueTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binLeEqTrueFalse() { bool compStatus = compileChecker("bin/binLeEqTrueFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binLeEqFalseTrue() { bool compStatus = compileChecker("bin/binLeEqFalseTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binLeEqFalseFalse() { bool compStatus = compileChecker("bin/binLeEqFalseFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binGreatTrueTrue() { bool compStatus = compileChecker("bin/binGreatTrueTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binGreatTrueFalse() { bool compStatus = compileChecker("bin/binGreatTrueFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binGreatFalseTrue() { bool compStatus = compileChecker("bin/binGreatFalseTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binGreatFalseFalse() { bool compStatus = compileChecker("bin/binGreatFalseFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binLessTrueTrue() { bool compStatus = compileChecker("bin/binLessTrueTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binLessTrueFalse() { bool compStatus = compileChecker("bin/binLessTrueFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binLessFalseTrue() { bool compStatus = compileChecker("bin/binLessFalseTrue.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binLessFalseFalse() { bool compStatus = compileChecker("bin/binLessFalseFalse.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } // VALUES void Test::binEqualIntInt() { bool compStatus = compileChecker("bin/binEqualIntInt.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); } void Test::binNotEqualIntInt() { bool compStatus = compileChecker("bin/binNotEqualIntInt.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); } void Test::binAndIntInt() { bool compStatus = compileChecker("bin/binAndIntInt.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binOrIntInt() { bool compStatus = compileChecker("bin/binOrIntInt.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binGrEqIntInt() { bool compStatus = compileChecker("bin/binGrEqIntInt.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("True"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binLeEqIntInt() { bool compStatus = compileChecker("bin/binLeEqIntInt.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("True"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binGreatIntInt() { bool compStatus = compileChecker("bin/binGreatIntInt.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("False"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binLessIntInt() { bool compStatus = compileChecker("bin/binLessIntInt.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("False"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binEqualFloatFloat() { bool compStatus = compileChecker("bin/binEqualFloatFloat.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("True"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binNotEqualFloatFloat() { bool compStatus = compileChecker("bin/binNotEqualFloatFloat.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("False"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binAndFloatFloat() { bool compStatus = compileChecker("bin/binAndFloatFloat.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binOrFloatFloat() { bool compStatus = compileChecker("bin/binOrFloatFloat.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgSucc, !compStatus); } void Test::binGrEqFloatFloat() { bool compStatus = compileChecker("bin/binGrEqFloatFloat.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("True"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binLeEqFloatFloat() { bool compStatus = compileChecker("bin/binLeEqFloatFloat.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("True"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binGreatFloatFloat() { bool compStatus = compileChecker("bin/binGreatFloatFloat.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("False"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); } void Test::binLessFloatFloat() { bool compStatus = compileChecker("bin/binLessFloatFloat.sppl"); CPPUNIT_ASSERT_MESSAGE(compMsgFail, compStatus); bool execStatus = executeChecker("False"); CPPUNIT_ASSERT_MESSAGE(execMsg, execStatus); }
33.922034
71
0.753972
prozum
a151cd4bf7dc957ea7f0a677fc9ee700e1ecceaf
1,380
cpp
C++
scratch/projects/graphics/xMotionBlur.cpp
tingelst/versor
c831231e5011cfd1f62da8948cff7956d2f6670b
[ "BSD-3-Clause" ]
null
null
null
scratch/projects/graphics/xMotionBlur.cpp
tingelst/versor
c831231e5011cfd1f62da8948cff7956d2f6670b
[ "BSD-3-Clause" ]
null
null
null
scratch/projects/graphics/xMotionBlur.cpp
tingelst/versor
c831231e5011cfd1f62da8948cff7956d2f6670b
[ "BSD-3-Clause" ]
null
null
null
/* * ===================================================================================== * * Filename: xMotionBlur.cpp * * Description: trace of motion using GFX Renderer * * Version: 1.0 * Created: 03/07/2014 15:35:55 * Revision: none * Compiler: gcc * * Author: Pablo Colapinto (), gmail -> wolftype * Organization: * * ===================================================================================== */ #include "vsr_cga3D.h" #include "vsr_GLVimpl.h" using namespace vsr; using namespace vsr::cga3D; struct MyApp : App { Pnt mouse; Lin ray; float time; float amt; MyApp(Window * win ) : App(win){ scene.camera.pos( 0,0,10 ); time = 0; } void initGui(){ gui(amt,"amt",-100,100); } void getMouse(){ auto tv = interface.vd().ray; Vec z (tv[0], tv[1], tv[2] ); auto tm = interface.mouse.projectMid; ray = Round::point( tm[0], tm[1], tm[2] ) ^ z ^ Inf(1); mouse = Round::point( ray, Ori(1) ); } virtual void onDraw(){ getMouse(); } }; MyApp * app; int main(){ GLV glv(0,0); Window * win = new Window(500,500,"Versor",&glv); app = new MyApp( win ); app -> initGui(); glv << *app; Application::run(); return 0; }
17.037037
88
0.438406
tingelst
a155914d3f9bd24f5c15e46cd2e8b78e132f4736
74,068
cpp
C++
src/mame/drivers/mcr3.cpp
Robbbert/messui
49b756e2140d8831bc81335298ee8c5471045e79
[ "BSD-3-Clause" ]
26
2015-03-31T06:25:51.000Z
2021-12-14T09:29:04.000Z
src/mame/drivers/mcr3.cpp
Robbbert/messui
49b756e2140d8831bc81335298ee8c5471045e79
[ "BSD-3-Clause" ]
null
null
null
src/mame/drivers/mcr3.cpp
Robbbert/messui
49b756e2140d8831bc81335298ee8c5471045e79
[ "BSD-3-Clause" ]
10
2015-03-27T05:45:51.000Z
2022-02-04T06:57:36.000Z
// license:BSD-3-Clause // copyright-holders:Aaron Giles /*************************************************************************** Midway MCR-3 system driver by Christopher Kirmse, Aaron Giles Games supported: * Demolition Derby (Monoboard version) (Turbo Cheap Squeak) * Sarge (Turbo Cheap Squeak) * Max RPM (Turbo Cheap Squeak) * Rampage (Sounds Good) * Power Drive (Sounds Good) * Star Guards (Sounds Good) * Spy Hunter (Cheap Squeak Deluxe) * Crater Raider * Turbo Tag (prototype) (Cheap Squeak Deluxe) Known bugs: * Spy Hunter crashes at the end of the boat level * sprite placement on the scrolling games seems a bit off **************************************************************************** Game Hardware Sarge: * Mono Board (A080-91787-C000) * Turbo Cheap Squeak (A080-91779-B000) * MCR/2 Dual Power Amp (A082-90910-F000) Spy Hunter: * MCR/III CPU (A080-91442-J000) * Super Sound I/O (A082-90913-F000) * MCR/III Video Gen (A082-91433-J000) * Cheap Squeak Deluxe (A080-91671-E000) * Absolute Position Board (A080-91649-C000) * Lamp Driver Board (A080-91673-B000) * MCR/2 Dual Power Amp (A082-90910-F000) **************************************************************************** Memory map **************************************************************************** ======================================================================== CPU #1 ======================================================================== 0000-DFFF R xxxxxxxx Program ROM E000-E7FF R/W xxxxxxxx NVRAM E800-E9FF R/W xxxxxxxx Sprite RAM F000-F7FF R/W xxxxxxxx Background video RAM F800-F8FF W xxxxxxxx Palette RAM ======================================================================== 0000 R x-xxxxxx Input ports R x------- Service switch (active low) R --x----- Tilt R ---xxx-- External inputs R ------x- Right coin R -------x Left coin 0000 W xxxxxxxx Data latch OP0 (coin meters, 2 led's and cocktail 'flip') 0001 R xxxxxxxx External inputs 0002 R xxxxxxxx External inputs 0003 R xxxxxxxx DIP switches 0004 R xxxxxxxx External inputs 0004 W xxxxxxxx Data latch OP4 (comm. with external hardware) 0007 R xxxxxxxx Audio status 001C-001F W xxxxxxxx Audio latches 1-4 00E0 W -------- Watchdog reset 00E8 W xxxxxxxx Unknown (written at initialization time) 00F0-00F3 W xxxxxxxx CTC communications ======================================================================== Interrupts: NMI ??? INT generated by CTC ======================================================================== ======================================================================== CPU #2 (Super Sound I/O) ======================================================================== 0000-3FFF R xxxxxxxx Program ROM 8000-83FF R/W xxxxxxxx Program RAM 9000-9003 R xxxxxxxx Audio latches 1-4 A000 W xxxxxxxx AY-8910 #1 control A001 R xxxxxxxx AY-8910 #1 status A002 W xxxxxxxx AY-8910 #1 data B000 W xxxxxxxx AY-8910 #2 control B001 R xxxxxxxx AY-8910 #2 status B002 W xxxxxxxx AY-8910 #2 data C000 W xxxxxxxx Audio status E000 W xxxxxxxx Unknown F000 R xxxxxxxx Audio board switches ======================================================================== Interrupts: NMI ??? INT generated by external circuitry 780 times/second ======================================================================== ***************************************************************************/ #include "emu.h" #include "includes/mcr3.h" #include "machine/nvram.h" #include "speaker.h" #include "spyhunt.lh" #include "turbotag.lh" #define MASTER_CLOCK XTAL(20'000'000) void mcr3_state::mcrmono_control_port_w(uint8_t data) { /* Bit layout is as follows: D7 = n/c D6 = cocktail flip D5 = n/c D4 = n/c D3 = n/c D2 = n/c D1 = n/c D0 = coin meter 1 */ machine().bookkeeping().coin_counter_w(0, (data >> 0) & 1); m_mcr_cocktail_flip = (data >> 6) & 1; } /************************************* * * Demolition Derby (mono) I/O ports * *************************************/ uint8_t mcr3_state::demoderm_ip1_r() { return ioport("MONO.IP1")->read() | (ioport(m_input_mux ? "MONO.IP1.ALT2" : "MONO.IP1.ALT1")->read() << 2); } uint8_t mcr3_state::demoderm_ip2_r() { return ioport("MONO.IP2")->read() | (ioport(m_input_mux ? "MONO.IP2.ALT2" : "MONO.IP2.ALT1")->read() << 2); } void mcr3_state::demoderm_op6_w(uint8_t data) { /* top 2 bits select the input */ if (data & 0x80) m_input_mux = 0; if (data & 0x40) m_input_mux = 1; /* low 5 bits control the turbo CS */ m_turbo_cheap_squeak->write(data); } /************************************* * * Max RPM I/O ports * *************************************/ uint8_t maxrpm_state::maxrpm_ip1_r() { return m_latched_input; } uint8_t maxrpm_state::maxrpm_ip2_r() { /* this is a blatant hack, should really do a better implementation */ static const uint8_t shift_bits[5] = { 0x00, 0x05, 0x06, 0x01, 0x02 }; uint8_t start = ioport("MONO.IP0")->read(); uint8_t shift = ioport("SHIFT")->read(); /* reset on a start */ if (!(start & 0x08)) m_maxrpm_p1_shift = 0; if (!(start & 0x04)) m_maxrpm_p2_shift = 0; /* increment, decrement on falling edge */ if (!(shift & 0x01) && (m_maxrpm_last_shift & 0x01)) { m_maxrpm_p1_shift++; if (m_maxrpm_p1_shift > 4) m_maxrpm_p1_shift = 4; } if (!(shift & 0x02) && (m_maxrpm_last_shift & 0x02)) { m_maxrpm_p1_shift--; if (m_maxrpm_p1_shift < 0) m_maxrpm_p1_shift = 0; } if (!(shift & 0x04) && (m_maxrpm_last_shift & 0x04)) { m_maxrpm_p2_shift++; if (m_maxrpm_p2_shift > 4) m_maxrpm_p2_shift = 4; } if (!(shift & 0x08) && (m_maxrpm_last_shift & 0x08)) { m_maxrpm_p2_shift--; if (m_maxrpm_p2_shift < 0) m_maxrpm_p2_shift = 0; } m_maxrpm_last_shift = shift; return ~((shift_bits[m_maxrpm_p1_shift] << 4) + shift_bits[m_maxrpm_p2_shift]); } void maxrpm_state::maxrpm_op5_w(uint8_t data) { /* latch bits 1-4 as input to the ADC0844 */ m_maxrpm_adc_control = (data >> 1) & 0x0f; /* remaining bits go to standard connections */ mcrmono_control_port_w(data); } void maxrpm_state::maxrpm_op6_w(uint8_t data) { /* Reflective Sensor Control: 4 bits of input from OP5 are routed to a transceiver at U2, and ultimately on to the low 4 I/O pins of the ADC0844. The /EN on the transceiver is directly connected to J2-2. Note that two bits get swapped in the process: OP53 = MA3 and OP54 = MA2. In order to perform a read or a write to the ADC0844, the /RD and /WR signals are directly controlled via J2-8 and J2-7 respectively. The input from the /WR is controlled by enabling the transceiver above to allow the 4 bits of input to flow through. The output from an /RD is controlled by disabling the transceiver and allowing the 8 bits of output to flow through J2-13 through J2-20. These are read via IP1. */ /* bit 7 = /RD (J2-8) on ADC0844 */ /* bit 6 = /WR (J2-7) on ADC0844 */ /* bit 5 = /EN (J2-2) on input latch */ /* when the read is toggled is when the ADC value is latched */ if (!(data & 0x80)) m_latched_input = m_maxrpm_adc->read(); /* when both the write and the enable are low, it's a write to the ADC0844 */ if (!(data & 0x40) && !(data & 0x20)) m_maxrpm_adc->write(bitswap<4>(m_maxrpm_adc_control, 2, 3, 1, 0)); /* low 5 bits control the turbo CS */ m_turbo_cheap_squeak->write(data); } /************************************* * * Rampage I/O ports * *************************************/ uint8_t mcr3_state::rampage_ip4_r() { return ioport("MONO.IP4")->read() | (m_sounds_good->read() << 7); } void mcr3_state::rampage_op6_w(uint8_t data) { /* bit 5 controls reset of the Sounds Good board */ m_sounds_good->reset_write((~data >> 5) & 1); /* low 5 bits go directly to the Sounds Good board */ m_sounds_good->write(data); } /************************************* * * Power Drive I/O ports * *************************************/ uint8_t mcr3_state::powerdrv_ip2_r() { return ioport("MONO.IP2")->read() | (m_sounds_good->read() << 7); } void mcr3_state::powerdrv_op5_w(uint8_t data) { /* Lamp Board: Very simple board with direct lamp controls. Pin J1-10 controls lamp 1. Pin J1-8 controls lamp 2. Pin J1-6 controls lamp 3. */ /* bit 3 -> J1-10 = lamp 1 */ /* bit 2 -> J1-8 = lamp 2 */ /* bit 1 -> J1-6 = lamp 3 */ m_lamps[0] = BIT(data, 3); m_lamps[1] = BIT(data, 2); m_lamps[2] = BIT(data, 1); /* remaining bits go to standard connections */ mcrmono_control_port_w(data); } void mcr3_state::powerdrv_op6_w(uint8_t data) { /* bit 5 controls reset of the Sounds Good board */ m_sounds_good->reset_write((~data >> 5) & 1); /* low 5 bits go directly to the Sounds Good board */ m_sounds_good->write(data); } /************************************* * * Star Guards I/O ports * *************************************/ uint8_t mcr3_state::stargrds_ip0_r() { uint8_t result = ioport("MONO.IP0")->read(); if (m_input_mux) result = (result & ~0x0a) | (ioport("MONO.IP0.ALT")->read() & 0x0a); return (result & ~0x10) | ((m_sounds_good->read() << 4) & 0x10); } void mcr3_state::stargrds_op5_w(uint8_t data) { /* bit 1 controls input muxing on port 0 */ m_input_mux = (data >> 1) & 1; /* bit 2 controls light #0 */ /* bit 3 controls light #1 */ /* bit 4 controls light #2 */ m_lamps[0] = BIT(data, 2); m_lamps[1] = BIT(data, 3); m_lamps[2] = BIT(data, 4); /* remaining bits go to standard connections */ mcrmono_control_port_w(data); } void mcr3_state::stargrds_op6_w(uint8_t data) { /* bit 6 controls reset of the Sounds Good board */ m_sounds_good->reset_write((~data >> 6) & 1); /* unline the other games, the STROBE is in the high bit instead of the low bit */ m_sounds_good->write((data << 1) | (data >> 7)); } /************************************* * * Spy Hunter I/O ports * *************************************/ uint8_t mcrsc_csd_state::spyhunt_ip1_r() { return ioport("ssio:IP1")->read() | (m_cheap_squeak_deluxe->stat_r() << 5); } uint8_t mcrsc_csd_state::spyhunt_ip2_r() { /* multiplexed steering wheel/gas pedal */ return ioport(m_input_mux ? "ssio:IP2.ALT" : "ssio:IP2")->read(); } void mcrsc_csd_state::spyhunt_op4_w(uint8_t data) { /* Spy Hunter uses port 4 for talking to the Cheap Squeak Deluxe */ /* (and for toggling the lamps and muxing the analog inputs) */ /* mux select is in bit 7 */ m_input_mux = (data >> 7) & 1; /* Lamp Driver: A 3-to-8 latching demuxer (MC14099) is connected to the input bits. Three of the inputs (J1-11,10,12) specify which output to write to, and the fourth input (J1-14) is the data value. A fifth input (J1-13) controls the strobe to latch the data value for the demuxer. The eight outputs control 8 lamps through a pair of Darlington drivers (ULN2068B). */ /* bit 5 = STR1 (J1-13) */ if (((m_last_op4 ^ data) & 0x20) && !(data & 0x20)) { /* bit 3 -> J1-14 (DATA) */ /* bit 2 -> J1-11 (A2) */ /* bit 1 -> J1-10 (A1) */ /* bit 0 -> J1-12 (A0) */ m_lamplatch->write_bit(data & 7, BIT(data, 3)); } m_last_op4 = data; /* low 5 bits go to control the Cheap Squeak Deluxe */ m_cheap_squeak_deluxe->sr_w(data & 0x0f); m_cheap_squeak_deluxe->sirq_w(BIT(data, 4)); } /************************************* * * Turbo Tag kludges * *************************************/ uint8_t mcrsc_csd_state::turbotag_ip2_r() { /* multiplexed steering wheel/gas pedal */ if (m_input_mux) return ioport("ssio:IP2.ALT")->read(); return ioport("ssio:IP2")->read() + 5 * (m_screen->frame_number() & 1); } uint8_t mcrsc_csd_state::turbotag_kludge_r() { /* The checksum on the ttprog1.bin ROM seems to be bad by 1 bit */ /* The checksum should come out to $82 but it should be $92 */ /* Unfortunately, the game refuses to start if any bad ROM is */ /* found; to work around this, we catch the checksum byte read */ /* and modify it to what we know we will be getting. */ if (m_maincpu->pcbase() == 0xb29) return 0x82; else return 0x92; } /************************************* * * MCR Monoboard CPU memory handlers * *************************************/ /* address map verified from schematics */ void mcr3_state::mcrmono_map(address_map &map) { map.unmap_value_high(); map(0x0000, 0xdfff).rom(); map(0xe000, 0xe7ff).ram().share("nvram"); map(0xe800, 0xe9ff).ram().share("spriteram"); map(0xea00, 0xebff).ram(); map(0xec00, 0xec7f).mirror(0x0380).w(FUNC(mcr3_state::mcr_paletteram9_w)).share("paletteram"); map(0xf000, 0xf7ff).ram().w(FUNC(mcr3_state::mcr3_videoram_w)).share("videoram"); map(0xf800, 0xffff).rom(); /* schematics show a 2716 @ 2B here, but nobody used it */ } /* I/O map verified from schematics */ void mcr3_state::mcrmono_portmap(address_map &map) { map.unmap_value_high(); map.global_mask(0xff); map(0x00, 0x00).mirror(0x78).portr("MONO.IP0"); map(0x01, 0x01).mirror(0x78).portr("MONO.IP1"); map(0x02, 0x02).mirror(0x78).portr("MONO.IP2"); map(0x03, 0x03).mirror(0x78).portr("MONO.IP3"); map(0x04, 0x04).mirror(0x78).portr("MONO.IP4"); map(0x05, 0x05).mirror(0x78).w(FUNC(mcr3_state::mcrmono_control_port_w)); map(0x07, 0x07).mirror(0x78).w("watchdog", FUNC(watchdog_timer_device::reset_w)); map(0xf0, 0xf3).mirror(0x0c).rw(m_ctc, FUNC(z80ctc_device::read), FUNC(z80ctc_device::write)); } /************************************* * * Spy Hunter main CPU memory handlers * *************************************/ /* address map verified from schematics */ void mcr3_state::spyhunt_map(address_map &map) { map.unmap_value_high(); map(0x0000, 0xdfff).rom(); map(0xe000, 0xe7ff).ram().w(FUNC(mcr3_state::spyhunt_videoram_w)).share("videoram"); map(0xe800, 0xebff).mirror(0x0400).ram().w(FUNC(mcr3_state::spyhunt_alpharam_w)).share("spyhunt_alpha"); map(0xf000, 0xf7ff).ram().share("nvram"); map(0xf800, 0xf9ff).ram().share("spriteram"); map(0xfa00, 0xfa7f).mirror(0x0180).w(FUNC(mcr3_state::mcr_paletteram9_w)).share("paletteram"); } /* upper I/O map determined by PAL; only SSIO ports and scroll registers are verified from schematics */ void mcr3_state::spyhunt_portmap(address_map &map) { map.unmap_value_high(); map.global_mask(0xff); midway_ssio_device::ssio_input_ports(map, "ssio"); map(0x84, 0x86).w(FUNC(mcr3_state::spyhunt_scroll_value_w)); map(0xe0, 0xe0).w("watchdog", FUNC(watchdog_timer_device::reset_w)); map(0xe8, 0xe8).nopw(); map(0xf0, 0xf3).rw(m_ctc, FUNC(z80ctc_device::read), FUNC(z80ctc_device::write)); } /************************************* * * Port definitions * *************************************/ /* verified from wiring diagram, plus DIP switches from manual */ static INPUT_PORTS_START( demoderm ) PORT_START("MONO.IP0") /* J2 1-8 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_SERVICE( 0x20, IP_ACTIVE_LOW ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_TILT ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("MONO.IP1") /* J2 10-13,15-18 */ /* The high 6 bits contain the steering wheel value */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_START("MONO.IP1.ALT1") /* J2 10-13,15-18 */ /* The high 6 bits contain the steering wheel value */ PORT_BIT( 0x3f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1) PORT_START("MONO.IP1.ALT2") /* IN1 (muxed) -- the high 6 bits contain the steering wheel value */ PORT_BIT( 0x3f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(3) PORT_START("MONO.IP2") /* J3 1-8 */ /* The high 6 bits contain the steering wheel value */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_START("MONO.IP2.ALT1") /* J3 1-8 */ /* The high 6 bits contain the steering wheel value */ PORT_BIT( 0x3f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(2) PORT_START("MONO.IP2.ALT2") /* IN2 (muxed) -- the high 6 bits contain the steering wheel value */ PORT_BIT( 0x3f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(4) PORT_START("MONO.IP3") /* DIPSW @ B3 */ PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) ) PORT_DIPSETTING( 0x01, "2P Upright" ) PORT_DIPSETTING( 0x00, "4P Cocktail" ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Difficulty ) ) PORT_DIPSETTING( 0x02, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x00, DEF_STR( Harder ) ) PORT_DIPNAME( 0x04, 0x04, DEF_STR( Free_Play ) ) PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x08, "Reward Screen" ) PORT_DIPSETTING( 0x08, "Expanded" ) PORT_DIPSETTING( 0x00, "Limited" ) PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coinage ) ) PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 2C_2C ) ) PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("MONO.IP4") /* J4 1-7,9 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN4 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) INPUT_PORTS_END /* inputs not verified yet, DIP switches from manual */ static INPUT_PORTS_START( sarge ) PORT_START("MONO.IP0") /* J2 1-8 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT ) PORT_SERVICE( 0x20, IP_ACTIVE_LOW ) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("MONO.IP1") /* J2 10-13,15-18 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_2WAY PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_2WAY PORT_PLAYER(1) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_2WAY PORT_PLAYER(1) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(1) PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_START("MONO.IP2") /* J3 1-8 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_2WAY PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_2WAY PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_2WAY PORT_PLAYER(2) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_2WAY PORT_PLAYER(2) PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_START("MONO.IP3") /* DIPSW @ A13 */ PORT_DIPUNKNOWN( 0x01, 0x01 ) // used, maybe for the "hidden player incentive" easter egg? PORT_DIPUNKNOWN( 0x02, 0x02 ) // " PORT_DIPUNKNOWN( 0x04, 0x04 ) // " PORT_DIPNAME( 0x08, 0x08, DEF_STR( Free_Play ) ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coinage ) ) PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) // PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) // dupe/invalid PORT_DIPUNUSED( 0x40, 0x40 ) PORT_DIPUNUSED( 0x80, 0x80 ) PORT_START("MONO.IP4") /* J4 1-7,9 */ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END /* verified from wiring diagram, plus DIP switches from manual */ static INPUT_PORTS_START( maxrpm ) PORT_START("MONO.IP0") /* J2 1-8 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) PORT_START("MONO.IP1") /* J2 10-13,15-18 */ PORT_BIT( 0xff, 0x30, IPT_PEDAL ) PORT_MINMAX(0x30,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(2) PORT_START("MONO.IP2") /* J3 1-8 */ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_START("MONO.IP3") PORT_DIPNAME( 0x08, 0x08, DEF_STR( Free_Play ) ) PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coinage ) ) PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) // PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) // dupe/invalid PORT_BIT( 0xc7, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("MONO.IP4") /* J4 1-7,9 */ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("MONO.IP1.ALT1") PORT_BIT( 0xff, 0x30, IPT_PEDAL ) PORT_MINMAX(0x30,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1) PORT_START("MONO.IP1.ALT2") PORT_BIT( 0xff, 0x74, IPT_PADDLE ) PORT_MINMAX(0x34,0xb4) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(2) PORT_START("MONO.IP1.ALT3") PORT_BIT( 0xff, 0x74, IPT_PADDLE ) PORT_MINMAX(0x34,0xb4) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1) PORT_START("SHIFT") /* fake for shifting */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_2WAY PORT_PLAYER(1) PORT_NAME("P1 Shift Up") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_2WAY PORT_PLAYER(1) PORT_NAME("P1 Shift Down") PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_2WAY PORT_PLAYER(2) PORT_NAME("P2 Shift Up") PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_2WAY PORT_PLAYER(2) PORT_NAME("P2 Shift Down") PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END /* verified from wiring diagram, plus DIP switches from manual */ static INPUT_PORTS_START( rampage ) PORT_START("MONO.IP0") /* J2 1-8 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT ) PORT_SERVICE( 0x20, IP_ACTIVE_LOW ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("MONO.IP1") /* J2 10-13,15-18 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("MONO.IP2") /* J3 1-8 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("MONO.IP3") PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPSETTING( 0x02, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x03, DEF_STR( Normal ) ) PORT_DIPSETTING( 0x01, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) PORT_DIPNAME( 0x04, 0x04, "Score Option" ) PORT_DIPSETTING( 0x04, "Keep score when continuing" ) PORT_DIPSETTING( 0x00, "Lose score when continuing" ) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Coin_A ) ) PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 1C_1C ) ) PORT_DIPNAME( 0x70, 0x70, DEF_STR( Coin_B ) ) PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x70, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x50, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 1C_4C ) ) PORT_DIPSETTING( 0x30, DEF_STR( 1C_5C ) ) PORT_DIPSETTING( 0x20, DEF_STR( 1C_6C ) ) PORT_DIPNAME( 0x80, 0x80, "Rack Advance (Cheat)" ) PORT_CODE(KEYCODE_F1) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("MONO.IP4") /* J4 1-7,9 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* status from Sounds Good board */ INPUT_PORTS_END /* verified from wiring diagram, plus DIP switches from manual */ static INPUT_PORTS_START( powerdrv ) PORT_START("MONO.IP0") /* J2 1-8 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_TILT ) PORT_SERVICE( 0x20, IP_ACTIVE_LOW ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("MONO.IP1") /* J2 10-13,15-18 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_TOGGLE PORT_PLAYER(1) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_TOGGLE PORT_PLAYER(2) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_START("MONO.IP2") /* J3 1-8 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_TOGGLE PORT_PLAYER(3) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* status from Sounds Good board */ PORT_START("MONO.IP3") PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) ) PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) ) /* PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )*/ PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) ) PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) ) PORT_DIPSETTING( 0x20, DEF_STR( Easy ) ) PORT_DIPSETTING( 0x30, "Factory" ) PORT_DIPSETTING( 0x10, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x40, DEF_STR( On ) ) PORT_DIPNAME( 0x80, 0x80, "Rack Advance (Cheat)" ) PORT_CODE(KEYCODE_F1) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_START("MONO.IP4") /* J4 1-7,9 */ PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END /* verified from wiring diagram, plus DIP switches from manual */ static INPUT_PORTS_START( stargrds ) PORT_START("MONO.IP0") /* J2 1-8 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* status from Sounds Good board */ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) PORT_START("MONO.IP1") /* J2 10-13,15-18 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(1) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(1) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(1) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(1) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(1) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(1) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(1) PORT_START("MONO.IP2") /* J3 1-8 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(2) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(2) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(2) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(2) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(2) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(2) PORT_START("MONO.IP3") PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_DIPNAME( 0x0c, 0x0c, "Energy Units" ) PORT_DIPSETTING( 0x08, "8" ) PORT_DIPSETTING( 0x0c, "10" ) PORT_DIPSETTING( 0x04, "12" ) PORT_DIPSETTING( 0x00, "14" ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_DIPNAME( 0x20, 0x20, DEF_STR( Demo_Sounds ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x20, DEF_STR( On ) ) PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPSETTING( 0x80, DEF_STR( Easy ) ) PORT_DIPSETTING( 0xc0, DEF_STR( Medium ) ) PORT_DIPSETTING( 0x40, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_START("MONO.IP4") /* J4 1-7,9 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(3) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(3) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(3) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(3) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(3) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(3) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(3) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(3) PORT_START("MONO.IP0.ALT") /* IN0 (muxed) */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) /* same as MONO.IN0 */ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) /* same as MONO.IN0 */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START3 ) PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) /* same as MONO.IN0 */ INPUT_PORTS_END /* verified from wiring diagram, plus DIP switches from manual */ static INPUT_PORTS_START( spyhunt ) PORT_START("ssio:IP0") /* J4 1-8 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Gear Shift") PORT_TOGGLE PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) PORT_START("ssio:IP1") /* J4 10-13,15-18 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Left Button / Oil Slick") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Left Trigger / Missiles") PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Center Button / Weapons Van") PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Right Button / Smoke Screen") PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("Right Trigger / Machine Guns") PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* status from CS deluxe, never read */ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("ssio:IP2") /* J5 1-8 */ PORT_BIT( 0xff, 0x30, IPT_PEDAL ) PORT_MINMAX(0x30,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_START("ssio:IP3") /* DIPSW @ B3 */ PORT_DIPNAME( 0x01, 0x01, "Game Timer" ) PORT_DIPSETTING( 0x00, "1:00" ) PORT_DIPSETTING( 0x01, "1:30" ) PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("ssio:IP4") /* J6 1-8 */ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("ssio:DIP") PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("ssio:IP2.ALT") PORT_BIT( 0xff, 0x74, IPT_PADDLE ) PORT_MINMAX(0x34,0xb4) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) INPUT_PORTS_END /* not verified, no manual found */ static INPUT_PORTS_START( crater ) PORT_START("ssio:IP0") /* J4 1-8 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) PORT_START("ssio:IP1") /* J4 10-13,15-18 */ PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_START("ssio:IP2") /* J5 1-8 */ PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_2WAY PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_2WAY PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("ssio:IP3") /* DIPSW @ B3 */ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("ssio:IP4") /* J6 1-8 */ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("ssio:DIP") PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END /* not verified, no manual found */ static INPUT_PORTS_START( turbotag ) PORT_START("ssio:IP0") /* J4 1-8 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Gear Shift") PORT_TOGGLE PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) PORT_START("ssio:IP1") /* J4 10-13,15-18 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Left Button / 1 Player") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Left Trigger") PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Center Button") PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("Right Button / 2 Player") PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Right Trigger") PORT_BIT( 0x60, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* status from CS deluxe, never read */ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("ssio:IP2") /* J5 1-8 */ PORT_BIT( 0xff, 0x3c, IPT_PEDAL ) PORT_MINMAX(60,180) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_START("ssio:IP3") /* DIPSW @ B3 */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("ssio:IP4") /* J6 1-8 */ PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("ssio:DIP") PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("ssio:IP2.ALT") PORT_BIT( 0xff, 0x60, IPT_PADDLE ) PORT_SENSITIVITY(40) PORT_KEYDELTA(10) INPUT_PORTS_END /************************************* * * Graphics definitions * *************************************/ static const uint32_t spyhunt_charlayout_xoffset[64] = { 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, 30, 30, 32, 32, 34, 34, 36, 36, 38, 38, 40, 40, 42, 42, 44, 44, 46, 46, 48, 48, 50, 50, 52, 52, 54, 54, 56, 56, 58, 58, 60, 60, 62, 62 }; static const gfx_layout spyhunt_charlayout = { 64,32, RGN_FRAC(1,2), 4, { RGN_FRAC(1,2), RGN_FRAC(1,2)+1, 0, 1 }, EXTENDED_XOFFS, { 0*32, 0*32, 2*32, 2*32, 4*32, 4*32, 6*32, 6*32, 8*32, 8*32, 10*32, 10*32, 12*32, 12*32, 14*32, 14*32, 16*32, 16*32, 18*32, 18*32, 20*32, 20*32, 22*32, 22*32, 24*32, 24*32, 26*32, 26*32, 28*32, 28*32, 30*32, 30*32 }, 128*8, spyhunt_charlayout_xoffset, nullptr }; static const gfx_layout spyhunt_alphalayout = { 16,16, RGN_FRAC(1,1), 2, { 0, 1 }, { 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14 }, { 0, 0, 2*8, 2*8, 4*8, 4*8, 6*8, 6*8, 8*8, 8*8, 10*8, 10*8, 12*8, 12*8, 14*8, 14*8 }, 16*8 }; static GFXDECODE_START( gfx_mcr3 ) GFXDECODE_SCALE( "gfx1", 0, mcr_bg_layout, 0, 4, 2, 2 ) GFXDECODE_ENTRY( "gfx2", 0, mcr_sprite_layout, 0, 4 ) GFXDECODE_END static GFXDECODE_START( gfx_spyhunt ) GFXDECODE_ENTRY( "gfx1", 0, spyhunt_charlayout, 3*16, 1 ) GFXDECODE_ENTRY( "gfx2", 0, mcr_sprite_layout, 0*16, 4 ) GFXDECODE_ENTRY( "gfx3", 0, spyhunt_alphalayout, 4*16, 1 ) GFXDECODE_END /************************************* * * Machine drivers * *************************************/ /* Core MCR monoboard system with no sound */ void mcr3_state::mcrmono(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, MASTER_CLOCK/4); m_maincpu->set_addrmap(AS_PROGRAM, &mcr3_state::mcrmono_map); m_maincpu->set_addrmap(AS_IO, &mcr3_state::mcrmono_portmap); m_maincpu->set_daisy_config(mcr_daisy_chain); TIMER(config, "scantimer").configure_scanline(FUNC(mcr3_state::mcr_interrupt), "screen", 0, 1); Z80CTC(config, m_ctc, MASTER_CLOCK/4 /* same as "maincpu" */); m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); m_ctc->zc_callback<0>().set(m_ctc, FUNC(z80ctc_device::trg1)); WATCHDOG_TIMER(config, "watchdog").set_vblank_count(m_screen, 16); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); m_screen->set_refresh_hz(30); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); m_screen->set_size(32*16, 30*16); m_screen->set_visarea(0*16, 32*16-1, 0*16, 30*16-1); m_screen->set_screen_update(FUNC(mcr3_state::screen_update_mcr3)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_mcr3); PALETTE(config, m_palette).set_entries(64); } /*************************************/ /* Sarge/Demolition Derby Mono/Max RPM = MCR monoboard with Turbo Cheap Squeak */ void mcr3_state::mono_tcs(machine_config &config) { mcrmono(config); /* basic machine hardware */ MIDWAY_TURBO_CHEAP_SQUEAK(config, m_turbo_cheap_squeak); m_turbo_cheap_squeak->add_route(ALL_OUTPUTS, "lspeaker", 0.8); m_turbo_cheap_squeak->add_route(ALL_OUTPUTS, "rspeaker", 0.8); } void maxrpm_state::maxrpm(machine_config &config) { mono_tcs(config); ADC0844(config, m_maxrpm_adc); m_maxrpm_adc->ch1_callback().set_ioport("MONO.IP1"); m_maxrpm_adc->ch2_callback().set_ioport("MONO.IP1.ALT1"); m_maxrpm_adc->ch3_callback().set_ioport("MONO.IP1.ALT2"); m_maxrpm_adc->ch4_callback().set_ioport("MONO.IP1.ALT3"); } /* Rampage/Power Drive/Star Guards = MCR monoboard with Sounds Good */ void mcr3_state::mono_sg(machine_config &config) { mcrmono(config); /* basic machine hardware */ MIDWAY_SOUNDS_GOOD(config, m_sounds_good); m_sounds_good->add_route(ALL_OUTPUTS, "lspeaker", 0.75); m_sounds_good->add_route(ALL_OUTPUTS, "rspeaker", 0.75); } /*************************************/ /* Core scrolling system with SSIO sound */ void mcr3_state::mcrscroll(machine_config &config) { mcrmono(config); /* basic machine hardware */ MIDWAY_SSIO(config, m_ssio); m_ssio->add_route(0, "lspeaker", 1.0); m_ssio->add_route(1, "rspeaker", 1.0); m_maincpu->set_addrmap(AS_PROGRAM, &mcr3_state::spyhunt_map); m_maincpu->set_addrmap(AS_IO, &mcr3_state::spyhunt_portmap); /* video hardware */ m_screen->set_size(30*16, 30*16); m_screen->set_visarea(0, 30*16-1, 0, 30*16-1); m_screen->set_screen_update(FUNC(mcr3_state::screen_update_spyhunt)); m_gfxdecode->set_info(gfx_spyhunt); subdevice<palette_device>("palette")->set_entries(64 + 4).set_init(FUNC(mcr3_state::spyhunt_palette)); MCFG_VIDEO_START_OVERRIDE(mcr3_state,spyhunt) } /* Spy Hunter = scrolling system with an SSIO and a cheap squeak deluxe */ void mcrsc_csd_state::mcrsc_csd(machine_config &config) { mcrscroll(config); /* basic machine hardware */ MIDWAY_CHEAP_SQUEAK_DELUXE(config, m_cheap_squeak_deluxe); m_cheap_squeak_deluxe->add_route(ALL_OUTPUTS, "lspeaker", 0.8); m_cheap_squeak_deluxe->add_route(ALL_OUTPUTS, "rspeaker", 0.8); CD4099(config, m_lamplatch); // U1 on Lamp Driver Board m_lamplatch->q_out_cb<0>().set_output("lamp0"); m_lamplatch->q_out_cb<1>().set_output("lamp1"); m_lamplatch->q_out_cb<2>().set_output("lamp2"); m_lamplatch->q_out_cb<3>().set_output("lamp3"); m_lamplatch->q_out_cb<4>().set_output("lamp4"); m_lamplatch->q_out_cb<5>().set_output("lamp5"); m_lamplatch->q_out_cb<6>().set_output("lamp6"); m_lamplatch->q_out_cb<7>().set_output("lamp7"); } /************************************* * * ROM definitions * *************************************/ ROM_START( demoderm ) /* Dipswitch selectable 2 player Upright / 4 player Cocktail */ ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "pro0.3b", 0x00000, 0x8000, CRC(2e24527b) SHA1(df8d1129b52ca0f4326c7c7e4f10d81b4ced65b5) ) ROM_LOAD( "pro1.5b", 0x08000, 0x8000, CRC(034c00fc) SHA1(0f0e8f123a34c330021bce76ed7f38bcb2e9af4e) ) ROM_FILL( 0x0e000, 0x2000, 0xff ) /* upper 8k is not mapped on monoboard */ ROM_REGION( 0x10000, "tcs:cpu", 0 ) /* 64k for the Turbo Cheap Squeak */ ROM_LOAD( "tcs_u5.bin", 0x0c000, 0x2000, CRC(eca33b2c) SHA1(938b021ea3b0f23aed7a98a930a58af371a02303) ) ROM_LOAD( "tcs_u4.bin", 0x0e000, 0x2000, CRC(3490289a) SHA1(a9d56ea60bb901267da41ab408f8e1ed3742b0ac) ) ROM_REGION( 0x04000, "gfx1", ROMREGION_INVERT ) ROM_LOAD( "bg0.15a", 0x00000, 0x2000, CRC(a35d13b8) SHA1(18d2d900a787e082ba30c13034ed6c64305a79b4) ) ROM_LOAD( "bg1.14b", 0x02000, 0x2000, CRC(22ca93f3) SHA1(8a907ee6d1fd88d472d868eb47e7ae7d44097e67) ) ROM_REGION( 0x20000, "gfx2", 0 ) ROM_LOAD( "dd_fg-0.a4", 0x00000, 0x4000, CRC(e57a4de6) SHA1(d1b2396a85b984e171d751ef8e1cf970ac4ff9fb) ) ROM_LOAD( "dd_fg-4.a3", 0x04000, 0x4000, CRC(55aa667f) SHA1(d611dbf9e8ef383d02514b0edb9ea36670193bf0) ) ROM_LOAD( "dd_fg-1.a6", 0x08000, 0x4000, CRC(70259651) SHA1(55967aaf2a7617c8f5a199d1e07128d79ce16970) ) ROM_LOAD( "dd_fg-5.a5", 0x0c000, 0x4000, CRC(5fe99007) SHA1(9d640b4715333efdc6300dc353991d6934929399) ) ROM_LOAD( "dd_fg-2.a8", 0x10000, 0x4000, CRC(6cab7b95) SHA1(8faff7458ab5ff2dd096dd78b1449a4096cc6345) ) ROM_LOAD( "dd_fg-6.a7", 0x14000, 0x4000, CRC(abfb9a8b) SHA1(14ab416bc76db25ad97353c9072048c64ec95344) ) ROM_LOAD( "dd_fg-3.a10", 0x18000, 0x4000, CRC(801d9b86) SHA1(5a8c72d1060eea1a3ad67b98aa6eff13f6837af6) ) ROM_LOAD( "dd_fg-7.a9", 0x1c000, 0x4000, CRC(0ec3f60a) SHA1(4176b246b0ea7bce9498c20e12678f16f7173529) ) ROM_END ROM_START( sarge ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "cpu_3b.bin", 0x00000, 0x8000, CRC(da31a58f) SHA1(29b97caf61f8f59042519a6b501cd1d15099dd59) ) ROM_LOAD( "cpu_5b.bin", 0x08000, 0x8000, CRC(6800e746) SHA1(018c2b622b3654530ebc2c299b3f745777163d4b) ) ROM_FILL( 0x0e000, 0x2000, 0xff ) /* upper 8k is not mapped on monoboard */ ROM_REGION( 0x10000, "tcs:cpu", 0 ) /* 64k for the Turbo Cheap Squeak */ ROM_LOAD( "tcs_u5.bin", 0xc000, 0x2000, CRC(a894ef8a) SHA1(7f53927fc185fff8ba1b1747f0d565e089d879e6) ) ROM_LOAD( "tcs_u4.bin", 0xe000, 0x2000, CRC(6ca6faf3) SHA1(4647e633dd11f55a65c3acf81adeb3af93624991) ) ROM_REGION( 0x04000, "gfx1", ROMREGION_INVERT ) ROM_LOAD( "til_15a.bin", 0x00000, 0x2000, CRC(685001b8) SHA1(300abd808efe5b44b022082eebc591c7c255697c) ) ROM_LOAD( "til_14b.bin", 0x02000, 0x2000, CRC(8449eb45) SHA1(6cc43639998d55fe7ffac7e9b091d35ea169e048) ) ROM_REGION( 0x20000, "gfx2", 0 ) ROM_LOAD( "spr_8e.bin", 0x00000, 0x8000, CRC(93fac29d) SHA1(3d144208eca3b5377689e69da4505187a3d20d4f) ) ROM_LOAD( "spr_6e.bin", 0x08000, 0x8000, CRC(7cc6fb28) SHA1(5fe24d5114551b4a4bf303cd612da332555c0f93) ) ROM_LOAD( "spr_5e.bin", 0x10000, 0x8000, CRC(c832375c) SHA1(dfb7782b13e1e959e0ecd5da771cd38962f6952b) ) ROM_LOAD( "spr_4e.bin", 0x18000, 0x8000, CRC(c382267d) SHA1(6b459e9ec7948a529b5308357851a0bede085aef) ) ROM_REGION( 0x0007, "pals", 0) /* PAL's located on the Mono Board (91787) */ ROM_LOAD( "a59a26axlcxhd.13j.bin", 0x0000, 0x0001, NO_DUMP ) /* PLS153N */ ROM_LOAD( "a59a26axlbxhd.2j.bin", 0x0000, 0x0001, NO_DUMP ) /* PLS153N */ ROM_LOAD( "a59a26axlaxhd.3j.bin", 0x0000, 0x0001, NO_DUMP ) /* PLS153N */ ROM_LOAD( "0066-314bx-xxqx.6h.bin", 0x0000, 0x0001, NO_DUMP ) /* Unknown PAL Type */ ROM_LOAD( "0066-316bx-xxqx.5h.bin", 0x0000, 0x0001, NO_DUMP ) /* Unknown PAL Type */ ROM_LOAD( "0066-315bx-xxqx.5g.bin", 0x0000, 0x0001, NO_DUMP ) /* Unknown PAL Type */ ROM_LOAD( "0066-313bx-xxqx.4g.bin", 0x0000, 0x0001, NO_DUMP ) /* Unknown PAL Type */ ROM_END ROM_START( maxrpm ) ROM_REGION( 0x12000, "maincpu", 0 ) ROM_LOAD( "pro.0", 0x00000, 0x8000, CRC(3f9ec35f) SHA1(ebdcf480aee5569af631106cc6478adc26c4ac24) ) ROM_LOAD( "pro.1", 0x08000, 0x8000, CRC(f628bb30) SHA1(0514906b9764a7f02a730a610affea4d42a4510d) ) ROM_FILL( 0x0e000, 0x2000, 0xff ) /* upper 8k is not mapped on monoboard */ ROM_REGION( 0x10000, "tcs:cpu", 0 ) /* 64k for the Turbo Cheap Squeak */ ROM_LOAD( "turbskwk.u5", 0x8000, 0x4000, CRC(55c3b759) SHA1(89d690a007a996e9c7df7b365942e4da755d15d7) ) ROM_LOAD( "turbskwk.u4", 0xc000, 0x4000, CRC(31a2da2e) SHA1(582434b5d6bc8e84f39191976d8aa0ef9245f253) ) ROM_REGION( 0x08000, "gfx1", ROMREGION_INVERT ) ROM_LOAD( "bg-0", 0x00000, 0x4000, CRC(e3fb693a) SHA1(9543c099cae4f56ef09f4e678891c90ef55928ed) ) ROM_LOAD( "bg-1", 0x04000, 0x4000, CRC(50d1db6c) SHA1(5ef669b868edf2d0b7f16879523318e8d6a3f9b3) ) ROM_REGION( 0x20000, "gfx2", 0 ) ROM_LOAD( "fg-0", 0x00000, 0x8000, CRC(1d1435c1) SHA1(6a53ef047bb763ea30d2e8098cb1dd6b337ccf4f) ) ROM_LOAD( "fg-1", 0x08000, 0x8000, CRC(e54b7f2a) SHA1(b95f9d71ec98e60db57ce57006c013e5a521d8ab) ) ROM_LOAD( "fg-2", 0x10000, 0x8000, CRC(38be8505) SHA1(5e01e5e6317dd722d19f23863908ffc5833f22c3) ) ROM_LOAD( "fg-3", 0x18000, 0x8000, CRC(9ae3eb52) SHA1(a96835caece971692790cd7385ab618373eb821f) ) ROM_END ROM_START( rampage ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "pro-0_3b_rev_3_8-27-86.3b", 0x00000, 0x8000, CRC(2f7ca03c) SHA1(1e3a1f213fd67938adf14ea0d04dab687ea8f4ef) ) ROM_LOAD( "pro-1_5b_rev_3_8-27-86.5b", 0x08000, 0x8000, CRC(d89bd9a4) SHA1(3531464ffe49dfaf2755d9e2dc1aea23819b3a5d) ) ROM_FILL( 0x0e000, 0x2000, 0xff ) /* upper 8k is not mapped on monoboard */ ROM_REGION( 0x40000, "sg:cpu", 0 ) /* 256k for the Sounds Good board */ ROM_LOAD16_BYTE( "u-7_rev.2_8-14-86.u7", 0x00000, 0x8000, CRC(cffd7fa5) SHA1(7c5cecce1d428f847fea37d53eb09c6f62055c6f) ) /* these are Revision 2 sound ROMs */ ROM_LOAD16_BYTE( "u-17_rev.2_8-14-86.u17", 0x00001, 0x8000, CRC(e92c596b) SHA1(4e2d87398f2e7b637cbad6cb16d832dfa8f8288c) ) ROM_LOAD16_BYTE( "u-8_rev.2_8-14-86.u8", 0x10000, 0x8000, CRC(11f787e4) SHA1(1fa195bf9169608099d17be5801738a4e17bec3d) ) ROM_LOAD16_BYTE( "u-18_rev.2_8-14-86.u18", 0x10001, 0x8000, CRC(6b8bf5e1) SHA1(aa8c0260dcd19a795bfc23197cd87348a685d20b) ) ROM_REGION( 0x08000, "gfx1", ROMREGION_INVERT ) ROM_LOAD( "bg-0_u15_7-23-86.15a", 0x00000, 0x04000, CRC(c0d8b7a5) SHA1(692219388a3124fb48db7e35c4127b0fe066a289) ) ROM_LOAD( "bg-1_u14_7-23-86.14b", 0x04000, 0x04000, CRC(2f6e3aa1) SHA1(ae86ce90bb6bf660e38c0f91e7ce90d44be82d60) ) ROM_REGION( 0x40000, "gfx2", 0 ) ROM_LOAD( "fg-0_8e_6-30-86.8e", 0x00000, 0x10000, CRC(0974be5d) SHA1(be347faaa345383dc6e5c2b3789c372d6bd25905) ) ROM_LOAD( "fg-1_6e_6-30-86.6e", 0x10000, 0x10000, CRC(8728532b) SHA1(327df92db7e3506b827d497859980cd2de51f45d) ) ROM_LOAD( "fg-2_5e_6-30-86.5e", 0x20000, 0x10000, CRC(9489f714) SHA1(df17a45cdc6a9310856d64f89954be79bbeac12e) ) ROM_LOAD( "fg-3_4e_6-30-86.4e", 0x30000, 0x10000, CRC(81e1de40) SHA1(7e7818792845ec3687b3202eeade60a298ef513e) ) ROM_REGION( 0x0001, "sg:pal", 0 ) /* Sounds Good board pal */ ROM_LOAD( "e36a31axnaxqd.u15.bin", 0x0000, 0x0001, NO_DUMP) /* PAL20L10CNS, called "SG01R0 PAL" with part number "E36-00803-0009" on the schematics */ ROM_END ROM_START( rampage2 ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "pro-0_3b_rev_2_8-4-86.3b", 0x00000, 0x8000, CRC(3f1d0293) SHA1(d68f04b9b3fc377b9e57b823db4e7f9cfedbcf99) ) ROM_LOAD( "pro-1_5b_rev_2_8-4-86.5b", 0x08000, 0x8000, CRC(58523d75) SHA1(5cd512864568ec7793bda0164f21e7d72a7ea817) ) ROM_FILL( 0x0e000, 0x2000, 0xff ) /* upper 8k is not mapped on monoboard */ ROM_REGION( 0x40000, "sg:cpu", 0 ) /* 256k for the Sounds Good board */ ROM_LOAD16_BYTE( "u-7_rev.2_8-14-86.u7", 0x00000, 0x8000, CRC(cffd7fa5) SHA1(7c5cecce1d428f847fea37d53eb09c6f62055c6f) ) /* these are Revision 2 sound ROMs */ ROM_LOAD16_BYTE( "u-17_rev.2_8-14-86.u17", 0x00001, 0x8000, CRC(e92c596b) SHA1(4e2d87398f2e7b637cbad6cb16d832dfa8f8288c) ) ROM_LOAD16_BYTE( "u-8_rev.2_8-14-86.u8", 0x10000, 0x8000, CRC(11f787e4) SHA1(1fa195bf9169608099d17be5801738a4e17bec3d) ) ROM_LOAD16_BYTE( "u-18_rev.2_8-14-86.u18", 0x10001, 0x8000, CRC(6b8bf5e1) SHA1(aa8c0260dcd19a795bfc23197cd87348a685d20b) ) ROM_REGION( 0x08000, "gfx1", ROMREGION_INVERT ) ROM_LOAD( "bg-0_u15_7-23-86.15a", 0x00000, 0x04000, CRC(c0d8b7a5) SHA1(692219388a3124fb48db7e35c4127b0fe066a289) ) ROM_LOAD( "bg-1_u14_7-23-86.14b", 0x04000, 0x04000, CRC(2f6e3aa1) SHA1(ae86ce90bb6bf660e38c0f91e7ce90d44be82d60) ) ROM_REGION( 0x40000, "gfx2", 0 ) ROM_LOAD( "fg-0_8e_6-30-86.8e", 0x00000, 0x10000, CRC(0974be5d) SHA1(be347faaa345383dc6e5c2b3789c372d6bd25905) ) ROM_LOAD( "fg-1_6e_6-30-86.6e", 0x10000, 0x10000, CRC(8728532b) SHA1(327df92db7e3506b827d497859980cd2de51f45d) ) ROM_LOAD( "fg-2_5e_6-30-86.5e", 0x20000, 0x10000, CRC(9489f714) SHA1(df17a45cdc6a9310856d64f89954be79bbeac12e) ) ROM_LOAD( "fg-3_4e_6-30-86.4e", 0x30000, 0x10000, CRC(81e1de40) SHA1(7e7818792845ec3687b3202eeade60a298ef513e) ) ROM_REGION( 0x0001, "sg:pal", 0 ) /* Sounds Good board pal */ ROM_LOAD( "e36a31axnaxqd.u15.bin", 0x0000, 0x0001, NO_DUMP) /* PAL20L10CNS, called "SG01R0 PAL" with part number "E36-00803-0009" on the schematics */ ROM_END ROM_START( powerdrv ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "pdrv3b.bin", 0x00000, 0x8000, CRC(d870b704) SHA1(300d6ff3c92a45f5c4f28c171280174924aecb6c) ) ROM_LOAD( "pdrv5b.bin", 0x08000, 0x8000, CRC(fa0544ad) SHA1(55a9cf8c8648761443e4a5a3b214f4d6236cbaff) ) ROM_FILL( 0x0e000, 0x2000, 0xff ) /* upper 8k is not mapped on monoboard */ ROM_REGION( 0x40000, "sg:cpu", 0 ) /* 256k for the Sounds Good board */ ROM_LOAD16_BYTE( "power_drive_snd_u7.u7", 0x00000, 0x8000, CRC(78713e78) SHA1(11382c024536f743e051ba208ae02d0f5e07cf5e) ) /* Dated 11/21/86 */ ROM_LOAD16_BYTE( "power_drive_snd_u17.u17", 0x00001, 0x8000, CRC(c41de6e4) SHA1(0391afd96ee80dd1d4a34e661e5df1e01fbbd57a) ) ROM_LOAD16_BYTE( "power_drive_snd_u8.u8", 0x10000, 0x8000, CRC(15714036) SHA1(77ca5f703eb7f146e13d9c01f4427f6aaa31df39) ) ROM_LOAD16_BYTE( "power_drive_snd_u18.u18", 0x10001, 0x8000, CRC(cae14c70) SHA1(04e92f1f144cc8ff13a09a3d38aa65ac05c41c0b) ) ROM_REGION( 0x08000, "gfx1", ROMREGION_INVERT ) ROM_LOAD( "pdrv15a.bin", 0x00000, 0x04000, CRC(b858b5a8) SHA1(da622bde13c7156a826d658e176feccf18f33a4b) ) ROM_LOAD( "pdrv14b.bin", 0x04000, 0x04000, CRC(12ee7fc2) SHA1(aca7b20efa8b0e2217691fd8de6adf68a2048331) ) ROM_REGION( 0x40000, "gfx2", 0 ) ROM_LOAD( "pdrv8e.bin", 0x00000, 0x10000, CRC(dd3a2adc) SHA1(0792591eb55603c809d08ee622ecb2c9f5731038) ) ROM_LOAD( "pdrv6e.bin", 0x10000, 0x10000, CRC(1a1f7f81) SHA1(d66ff3ef3855e086e665531aef0e079842c48fcb) ) ROM_LOAD( "pdrv5e.bin", 0x20000, 0x10000, CRC(4cb4780e) SHA1(e1fad431257d9ec5e35175e4dc09d21e36ba1fa0) ) ROM_LOAD( "pdrv4e.bin", 0x30000, 0x10000, CRC(de400335) SHA1(49438bc7c2ba236dcbd4ddc3c985460887dcf110) ) ROM_END ROM_START( stargrds ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "pro-0.3b", 0x00000, 0x8000, CRC(3ad94aa2) SHA1(1e17ac70fddee1f3d0dd71172e15a7a256168a70) ) ROM_LOAD( "pro-1.5b", 0x08000, 0x8000, CRC(dba428b0) SHA1(72efa2f02e95f05a5503ced136fbdf3fcdf57554) ) ROM_FILL( 0x0e000, 0x2000, 0xff ) /* upper 8k is not mapped on monoboard */ ROM_REGION( 0x40000, "sg:cpu", 0 ) /* 256k for the Sounds Good board */ ROM_LOAD16_BYTE( "snd0.u7", 0x00000, 0x8000, CRC(7755a493) SHA1(a888fba45a2a31de5b3082bfc5ccef94dafc4d16) ) ROM_LOAD16_BYTE( "snd1.u17", 0x00001, 0x8000, CRC(d98d14ae) SHA1(51dbb97655ab8a389ca67f0e796ab57894f5bb32) ) ROM_REGION( 0x10000, "gfx1", ROMREGION_INVERT ) ROM_LOAD( "bg-0.15a", 0x00000, 0x08000, CRC(ecfaef3e) SHA1(145b0543552e678ef441e4a20afe80cd21e43cf6) ) ROM_LOAD( "bg-1.14b", 0x08000, 0x08000, CRC(2c75569d) SHA1(13808ff0fdb413a4ac6ddef1422b86c118277899) ) ROM_REGION( 0x40000, "gfx2", 0 ) ROM_LOAD( "fg-0.8e", 0x00000, 0x10000, CRC(22797aaa) SHA1(806ea29f8a43f104d3154322f492e7fa053da751) ) ROM_LOAD( "fg-1.6e", 0x10000, 0x10000, CRC(413fa119) SHA1(cb609db2e6694a5bb563afd6b28c19afe65a8487) ) ROM_LOAD( "fg-2.5e", 0x20000, 0x10000, CRC(7036cfe6) SHA1(7778c5a8bf457ba0c1fa0e17978709e1f7ccb8a5) ) ROM_LOAD( "fg-3.4e", 0x30000, 0x10000, CRC(cc5cc003) SHA1(afe8a0b0542c6f98de9386a07d6586af7de6bdf6) ) ROM_END /* Spy Hunter labels look like this SPY-HUNTER C.P.U. PG3 2/9/84 */ ROM_START( spyhunt ) ROM_REGION( 0x10000, "maincpu", 0 ) // all dated 2-9-84 ROM_LOAD( "spy-hunter_cpu_pg0_2-9-84.6d", 0x0000, 0x2000, CRC(1721b88f) SHA1(c7a641f0c05bd343ebc79e1c1be3a26da5fb77f0) ) ROM_LOAD( "spy-hunter_cpu_pg1_2-9-84.7d", 0x2000, 0x2000, CRC(909d044f) SHA1(67237c3efde568d52e9f8b0d36df726d05a9d9e4) ) ROM_LOAD( "spy-hunter_cpu_pg2_2-9-84.8d", 0x4000, 0x2000, CRC(afeeb8bd) SHA1(fde32863d08a745dfe19f1c1382810eab6aebcec) ) ROM_LOAD( "spy-hunter_cpu_pg3_2-9-84.9d", 0x6000, 0x2000, CRC(5e744381) SHA1(5b75e4f44dfd63d6e35294c606b84231c216e57d) ) ROM_LOAD( "spy-hunter_cpu_pg4_2-9-84.10d", 0x8000, 0x2000, CRC(a3033c15) SHA1(e9811450a7c952561912777d679fe45a6b5a794a) ) ROM_LOAD( "spy-hunter_cpu_pg5_2-9-84.11d", 0xc000, 0x2000, CRC(88aa1e99) SHA1(c173512ed76973d2f86a74380bb7b7c5bb4f5285) ) ROM_CONTINUE( 0xa000, 0x2000 ) ROM_REGION( 0x10000, "ssio:cpu", 0 ) // all dated 11-18-83 ROM_LOAD( "spy-hunter_snd_0_sd_11-18-83.a7", 0x0000, 0x1000, CRC(c95cf31e) SHA1(d1b0e299a27e306ddbc0654fd3a9d981c92afe8c) ) ROM_LOAD( "spy-hunter_snd_1_sd_11-18-83.a8", 0x1000, 0x1000, CRC(12aaa48e) SHA1(c6b835fc45e4484a4d52b682ce015caa242c8b4f) ) ROM_REGION( 0x8000, "csd:cpu", 0 ) /* 32k for the Cheap Squeak Deluxe */ // all dated 11-18-83 ROM_LOAD16_BYTE( "spy-hunter_cs_deluxe_u7_a_11-18-83.u7", 0x00000, 0x2000, CRC(6e689fe7) SHA1(38ad2e9f12b9d389fb2568ebcb32c8bd1ac6879e) ) ROM_LOAD16_BYTE( "spy-hunter_cs_deluxe_u17_b_11-18-83.u17", 0x00001, 0x2000, CRC(0d9ddce6) SHA1(d955c0e67fc78b517cc229601ab4023cc5a644c2) ) ROM_LOAD16_BYTE( "spy-hunter_cs_deluxe_u8_c_11-18-83.u8", 0x04000, 0x2000, CRC(35563cd0) SHA1(5708d374dd56758194c95118f096ea51bf12bf64) ) ROM_LOAD16_BYTE( "spy-hunter_cs_deluxe_u18_d_11-18-83.u18", 0x04001, 0x2000, CRC(63d3f5b1) SHA1(5864a7e9b6bc3d2df6891d40965a7a0efbba6837) ) ROM_REGION( 0x08000, "gfx1", 0 ) // all dated 11-18-83 ROM_LOAD( "spy-hunter_cpu_bg0_11-18-83.3a", 0x00000, 0x2000, CRC(dea34fed) SHA1(cbbb2ba75e087eebdce79a0016118c327c8f0a96) ) ROM_LOAD( "spy-hunter_cpu_bg1_11-18-83.4a", 0x02000, 0x2000, CRC(8f64525f) SHA1(d457d12f31a30deb3b4e5b8189c9414aac1ad701) ) ROM_LOAD( "spy-hunter_cpu_bg2_11-18-83.5a", 0x04000, 0x2000, CRC(ba0fd626) SHA1(f39281feb3fbbbd4234fbb70ee77bab3e1a33e3b) ) ROM_LOAD( "spy-hunter_cpu_bg3_11-18-83.6a", 0x06000, 0x2000, CRC(7b482d61) SHA1(f6a46690f69a7513a7fbacd0199946f600d796dd) ) ROM_REGION( 0x20000, "gfx2", 0 ) // all dated 11-18-83 ROM_LOAD( "spy-hunter_video_1fg_11-18-83.a7", 0x00000, 0x4000, CRC(9fe286ec) SHA1(d72cd7e69ef78e25cf5bc599fb0a7da11bf4657f) ) ROM_LOAD( "spy-hunter_video_0fg_11-18-83.a8", 0x04000, 0x4000, CRC(292c5466) SHA1(5abb9e2cc592adf81f12bf8ebeaf3e2931a7fa6d) ) ROM_LOAD( "spy-hunter_video_3fg_11-18-83.a5", 0x08000, 0x4000, CRC(b894934d) SHA1(e7d6db1635d244d002054dd223a2d0713316ef77) ) ROM_LOAD( "spy-hunter_video_2fg_11-18-83.a6", 0x0c000, 0x4000, CRC(62c8bfa5) SHA1(f245e49c178f846b647d09c32aa97d61333bdd83) ) ROM_LOAD( "spy-hunter_video_5fg_11-18-83.a3", 0x10000, 0x4000, CRC(2d9fbcec) SHA1(d73862b974726fe50bf011ea7977f8229b8a1e24) ) ROM_LOAD( "spy-hunter_video_4fg_11-18-83.a4", 0x14000, 0x4000, CRC(7ca4941b) SHA1(068ecd1e91ecfedba2ae542062f8f51f1329725d) ) ROM_LOAD( "spy-hunter_video_7fg_11-18-83.a1", 0x18000, 0x4000, CRC(940fe17e) SHA1(60d07c10ef5867875d47a4edaa68934e37e2a0aa) ) ROM_LOAD( "spy-hunter_video_6fg_11-18-83.a2", 0x1c000, 0x4000, CRC(8cb8a066) SHA1(5fa88d471ed8fd18244dd21b976c86530f57c8ac) ) ROM_REGION( 0x01000, "gfx3", 0 ) // all dated 11-18-83 ROM_LOAD( "spy-hunter_cpu_alpha-n_11-18-83", 0x00000, 0x1000, CRC(936dc87f) SHA1(cdf73bea82481fbc300ec5a1fbbe8d662007c56b) ) ROM_END ROM_START( spyhuntp ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "sh_mb_2.bin", 0x0000, 0x2000, CRC(df6cd642) SHA1(e695aa3e3dc3b9df87bf2c1bcb75edbdf03fde98) ) ROM_LOAD( "spy-hunter_cpu_pg1_2-9-84.7d", 0x2000, 0x2000, CRC(909d044f) SHA1(67237c3efde568d52e9f8b0d36df726d05a9d9e4) ) ROM_LOAD( "spy-hunter_cpu_pg2_2-9-84.8d", 0x4000, 0x2000, CRC(afeeb8bd) SHA1(fde32863d08a745dfe19f1c1382810eab6aebcec) ) ROM_LOAD( "spy-hunter_cpu_pg3_2-9-84.9d", 0x6000, 0x2000, CRC(5e744381) SHA1(5b75e4f44dfd63d6e35294c606b84231c216e57d) ) ROM_LOAD( "sh_mb_6.bin", 0x8000, 0x2000, CRC(8cbf04d8) SHA1(e45cb36935367e46ea41de0177b3453cd8bdce85) ) ROM_LOAD( "spy-hunter_cpu_pg5_2-9-84.11d", 0xc000, 0x2000, CRC(88aa1e99) SHA1(c173512ed76973d2f86a74380bb7b7c5bb4f5285) ) ROM_CONTINUE( 0xa000, 0x2000 ) ROM_REGION( 0x10000, "ssio:cpu", 0 ) ROM_LOAD( "spy-hunter_snd_0_sd_11-18-83.a7", 0x0000, 0x1000, CRC(c95cf31e) SHA1(d1b0e299a27e306ddbc0654fd3a9d981c92afe8c) ) ROM_LOAD( "spy-hunter_snd_1_sd_11-18-83.a8", 0x1000, 0x1000, CRC(12aaa48e) SHA1(c6b835fc45e4484a4d52b682ce015caa242c8b4f) ) ROM_REGION( 0x8000, "csd:cpu", 0 ) /* 32k for the Cheap Squeak Deluxe */ ROM_LOAD16_BYTE( "spy-hunter_cs_deluxe_u7_a_11-18-83.u7", 0x00000, 0x2000, CRC(6e689fe7) SHA1(38ad2e9f12b9d389fb2568ebcb32c8bd1ac6879e) ) ROM_LOAD16_BYTE( "spy-hunter_cs_deluxe_u17_b_11-18-83.u17", 0x00001, 0x2000, CRC(0d9ddce6) SHA1(d955c0e67fc78b517cc229601ab4023cc5a644c2) ) ROM_LOAD16_BYTE( "spy-hunter_cs_deluxe_u8_c_11-18-83.u8", 0x04000, 0x2000, CRC(35563cd0) SHA1(5708d374dd56758194c95118f096ea51bf12bf64) ) ROM_LOAD16_BYTE( "spy-hunter_cs_deluxe_u18_d_11-18-83.u18", 0x04001, 0x2000, CRC(63d3f5b1) SHA1(5864a7e9b6bc3d2df6891d40965a7a0efbba6837) ) ROM_REGION( 0x08000, "gfx1", 0 ) ROM_LOAD( "spy-hunter_cpu_bg0_11-18-83.3a", 0x00000, 0x2000, CRC(dea34fed) SHA1(cbbb2ba75e087eebdce79a0016118c327c8f0a96) ) ROM_LOAD( "spy-hunter_cpu_bg1_11-18-83.4a", 0x02000, 0x2000, CRC(8f64525f) SHA1(d457d12f31a30deb3b4e5b8189c9414aac1ad701) ) ROM_LOAD( "spy-hunter_cpu_bg2_11-18-83.5a", 0x04000, 0x2000, CRC(ba0fd626) SHA1(f39281feb3fbbbd4234fbb70ee77bab3e1a33e3b) ) ROM_LOAD( "spy-hunter_cpu_bg3_11-18-83.6a", 0x06000, 0x2000, CRC(7b482d61) SHA1(f6a46690f69a7513a7fbacd0199946f600d796dd) ) ROM_REGION( 0x20000, "gfx2", 0 ) ROM_LOAD( "spy-hunter_video_1fg_11-18-83.a7", 0x00000, 0x4000, CRC(9fe286ec) SHA1(d72cd7e69ef78e25cf5bc599fb0a7da11bf4657f) ) ROM_LOAD( "spy-hunter_video_0fg_11-18-83.a8", 0x04000, 0x4000, CRC(292c5466) SHA1(5abb9e2cc592adf81f12bf8ebeaf3e2931a7fa6d) ) ROM_LOAD( "spy-hunter_video_3fg_11-18-83.a5", 0x08000, 0x4000, CRC(b894934d) SHA1(e7d6db1635d244d002054dd223a2d0713316ef77) ) ROM_LOAD( "spy-hunter_video_2fg_11-18-83.a6", 0x0c000, 0x4000, CRC(62c8bfa5) SHA1(f245e49c178f846b647d09c32aa97d61333bdd83) ) ROM_LOAD( "spy-hunter_video_5fg_11-18-83.a3", 0x10000, 0x4000, CRC(2d9fbcec) SHA1(d73862b974726fe50bf011ea7977f8229b8a1e24) ) ROM_LOAD( "spy-hunter_video_4fg_11-18-83.a4", 0x14000, 0x4000, CRC(7ca4941b) SHA1(068ecd1e91ecfedba2ae542062f8f51f1329725d) ) ROM_LOAD( "spy-hunter_video_7fg_11-18-83.a1", 0x18000, 0x4000, CRC(940fe17e) SHA1(60d07c10ef5867875d47a4edaa68934e37e2a0aa) ) ROM_LOAD( "spy-hunter_video_6fg_11-18-83.a2", 0x1c000, 0x4000, CRC(8cb8a066) SHA1(5fa88d471ed8fd18244dd21b976c86530f57c8ac) ) ROM_REGION( 0x01000, "gfx3", 0 ) ROM_LOAD( "sh_mb_1.bin", 0x00000, 0x0800, CRC(5c74c9f0) SHA1(e42789d14e5510d1dcf4a30f6bd40a40ab46f7f3) ) ROM_END ROM_START( crater ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "crcpu.6d", 0x0000, 0x2000, CRC(ad31f127) SHA1(d03506570cd08bcdb39d7c6b9de4f9628c7373e9) ) ROM_LOAD( "crcpu.7d", 0x2000, 0x2000, CRC(3743c78f) SHA1(05605041c7a5ef2a8271cc3dd1aae4c82c8797eb) ) ROM_LOAD( "crcpu.8d", 0x4000, 0x2000, CRC(c95f9088) SHA1(2162c4ef2cc29857b10d64ec9e09ca6d086fa9e7) ) ROM_LOAD( "crcpu.9d", 0x6000, 0x2000, CRC(a03c4b11) SHA1(6a442a0828942dc51dbe0d3f19be855a52c12f39) ) ROM_LOAD( "crcpu.10d", 0x8000, 0x2000, CRC(44ae4cbd) SHA1(2188bf697f1b3fcbb2ad6cbd4d9098e3b8d56a95) ) ROM_REGION( 0x10000, "ssio:cpu", 0 ) ROM_LOAD( "crsnd4.a7", 0x0000, 0x1000, CRC(fd666cb5) SHA1(257174266e264db8ac9af5f2296fd0a22847f85f) ) ROM_LOAD( "crsnd1.a8", 0x1000, 0x1000, CRC(90bf2c4c) SHA1(7adfbf2251b5d46043d614554320e2fe544cc570) ) ROM_LOAD( "crsnd2.a9", 0x2000, 0x1000, CRC(3b8deef1) SHA1(a14186a33a7b5ca07086ce44fb1c8c64900654d0) ) ROM_LOAD( "crsnd3.a10", 0x3000, 0x1000, CRC(05803453) SHA1(1bba85e6494b4f67cea82d61e6cd341337bca998) ) ROM_REGION( 0x08000, "gfx1", 0 ) ROM_LOAD( "crcpu.3a", 0x00000, 0x2000, CRC(9d73504a) SHA1(23633ce43745c12b59916b85ca92a98e889b884e) ) ROM_LOAD( "crcpu.4a", 0x02000, 0x2000, CRC(42a47dff) SHA1(cb936ac7ba3dd740c626a11bd6ee3c87dad4e311) ) ROM_LOAD( "crcpu.5a", 0x04000, 0x2000, CRC(2fe4a6e1) SHA1(329cf9f71b7cbf2a13a05f9cd3397d73c69da893) ) ROM_LOAD( "crcpu.6a", 0x06000, 0x2000, CRC(d0659042) SHA1(8f28155eb2725eaf6d1c410f76a88969541aeef3) ) ROM_REGION( 0x20000, "gfx2", 0 ) ROM_LOAD( "crvid.a4", 0x00000, 0x4000, CRC(579a8e36) SHA1(1053234b82877f0f8d1a2ce745b853899cfbcc22) ) ROM_LOAD( "crvid.a3", 0x04000, 0x4000, CRC(2c2f5b29) SHA1(f7c4caabd116d3f861e70c6740cd058479477da7) ) ROM_LOAD( "crvid.a6", 0x08000, 0x4000, CRC(5bf954e0) SHA1(8ff9549a0b5d7e6ad4671c29bf04bb9c26a995ad) ) ROM_LOAD( "crvid.a5", 0x0c000, 0x4000, CRC(9bdec312) SHA1(3a3b44d4f73aad1f0ab2591be479f8472583f20a) ) ROM_LOAD( "crvid.a8", 0x10000, 0x4000, CRC(4b913498) SHA1(8aa83fd6f60d6176a8781a906ba75c663ac3f3cb) ) ROM_LOAD( "crvid.a7", 0x14000, 0x4000, CRC(9fa307d5) SHA1(ec9ba9c372d62132f02e2a87ed5f602c360755e9) ) ROM_LOAD( "crvid.a10", 0x18000, 0x4000, CRC(7a22d6bc) SHA1(c7f97bdf13d52665e61d83b7a8f1621c6df0dbf2) ) ROM_LOAD( "crvid.a9", 0x1c000, 0x4000, CRC(811f152d) SHA1(f9dee6f95d903a41890fe58bfc0528fecb1d6902) ) ROM_REGION( 0x01000, "gfx3", 0 ) ROM_LOAD( "crcpu.10g", 0x00000, 0x1000, CRC(6fe53c8d) SHA1(ceb04916af42d58f3173e5986756a0db8be11999) ) ROM_END ROM_START( turbotag ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "ttprog0.bin", 0x0000, 0x2000, CRC(6110fd80) SHA1(544d3cd24b047797c2006a9fac499c14140960db) ) ROM_LOAD( "ttprog1.bin", 0x2000, 0x2000, BAD_DUMP CRC(b0505e18) SHA1(b6871484f9a0663a9bcffd58368be5ae7717d29c) ) ROM_LOAD( "ttprog2.bin", 0x4000, 0x2000, CRC(c4141237) SHA1(c1d10da4961e94bd8c2b30a2f9e0cbd8080eb56d) ) ROM_LOAD( "ttprog3.bin", 0x6000, 0x2000, CRC(af294c6e) SHA1(c8573dd046aa2b071bef3bd86a783ee348c8d6eb) ) ROM_LOAD( "ttprog4.bin", 0x8000, 0x2000, CRC(8c5bc1a4) SHA1(c38d7aa2639945e705856cf1449faf51a7c82ff0) ) ROM_LOAD( "ttprog5.bin", 0xa000, 0x2000, CRC(11e62fe4) SHA1(72897702c61486b654e4b4a3f6560c144c862e1f) ) ROM_RELOAD( 0xc000, 0x2000 ) ROM_REGION( 0x10000, "ssio:cpu", ROMREGION_ERASE00 ) ROM_REGION( 0x8000, "csd:cpu", 0 ) /* 32k for the Cheap Squeak Deluxe */ ROM_LOAD16_BYTE( "ttu7.bin", 0x00000, 0x2000, CRC(8ebb3302) SHA1(c516abdae6eea524a6d2a039ed9bd7dff72ab986) ) ROM_LOAD16_BYTE( "ttu17.bin", 0x00001, 0x2000, CRC(605d6c74) SHA1(a6c2bc95cca372fa823ab256c9dd1f92b6ba45fd) ) ROM_LOAD16_BYTE( "ttu8.bin", 0x04000, 0x2000, CRC(6bfcb22a) SHA1(7b895e3ae1e99f195bb32b052f801b58c63a401c) ) ROM_LOAD16_BYTE( "ttu18.bin", 0x04001, 0x2000, CRC(bb25852c) SHA1(7e0346b5e2fc16a87a157c868936978be6145e3e) ) ROM_REGION( 0x08000, "gfx1", 0 ) ROM_LOAD( "ttbg0.bin", 0x00000, 0x2000, CRC(1cd2023f) SHA1(03b4f9d047d4fb3c4889e797e9ffd5edabd8ecff) ) ROM_LOAD( "ttbg1.bin", 0x02000, 0x2000, CRC(784e84cd) SHA1(cf4ddbd4b8dbfaee2f4e05c89355fad30e264641) ) ROM_LOAD( "ttbg2.bin", 0x04000, 0x2000, CRC(da9d47d2) SHA1(5af9222f62d9948ec468fb66a5afb46a00f159c3) ) ROM_LOAD( "ttbg3.bin", 0x06000, 0x2000, CRC(367e06a5) SHA1(24040e29bbe367b497675d155c3e0343399b179b) ) ROM_REGION( 0x20000, "gfx2", 0 ) ROM_LOAD( "ttfg1.bin", 0x00000, 0x4000, CRC(9d7e6ebc) SHA1(96c658091cb12d65e41f8ac5f609eb51857cef82) ) ROM_LOAD( "ttfg0.bin", 0x04000, 0x4000, CRC(ed69e1a8) SHA1(4fc223da52d6df3182ba5ba3db8e793e379030f2) ) ROM_LOAD( "ttfg3.bin", 0x08000, 0x4000, CRC(74e21c1c) SHA1(42ea0c569cd443866b46bcaac2c60d197fcbc2a9) ) ROM_LOAD( "ttfg2.bin", 0x0c000, 0x4000, CRC(037ec6fc) SHA1(7bc0bd95cc673d321de33d17764a06f48109b38e) ) ROM_LOAD( "ttfg5.bin", 0x10000, 0x4000, CRC(8b718879) SHA1(3e8361e4423e6822c09f866a99cf9fc789c99f66) ) ROM_LOAD( "ttfg4.bin", 0x14000, 0x4000, CRC(6fdb0c13) SHA1(b3e140a838f8deaa26dbc86315603fdcef47f157) ) ROM_LOAD( "ttfg7.bin", 0x18000, 0x4000, CRC(212019dc) SHA1(831bb83f6301d9f2f06b31a00ea425b13421b573) ) ROM_LOAD( "ttfg6.bin", 0x1c000, 0x4000, CRC(4094e996) SHA1(f50fa31bc311c16bcd2459668f5a942a1d9de75d) ) ROM_REGION( 0x01000, "gfx3", 0 ) ROM_LOAD( "ttan.bin", 0x00000, 0x1000, CRC(aa0b1471) SHA1(e3dd69f1a14926c6b709d6b19d9e90a1f0867465) ) ROM_END /************************************* * * Driver initialization * *************************************/ void mcr3_state::mcr_common_init() { save_item(NAME(m_input_mux)); save_item(NAME(m_latched_input)); save_item(NAME(m_last_op4)); } void mcr3_state::init_demoderm() { mcr_common_init(); m_maincpu->space(AS_IO).install_read_handler(0x01, 0x01, read8smo_delegate(*this, FUNC(mcr3_state::demoderm_ip1_r))); m_maincpu->space(AS_IO).install_read_handler(0x02, 0x02, read8smo_delegate(*this, FUNC(mcr3_state::demoderm_ip2_r))); m_maincpu->space(AS_IO).install_write_handler(0x06, 0x06, write8smo_delegate(*this, FUNC(mcr3_state::demoderm_op6_w))); } void mcr3_state::init_sarge() { mcr_common_init(); m_maincpu->space(AS_IO).install_write_handler(0x06, 0x06, write8smo_delegate(*m_turbo_cheap_squeak, FUNC(midway_turbo_cheap_squeak_device::write))); } void maxrpm_state::init_maxrpm() { mcr_common_init(); m_maincpu->space(AS_IO).install_read_handler(0x01, 0x01, read8smo_delegate(*this, FUNC(maxrpm_state::maxrpm_ip1_r))); m_maincpu->space(AS_IO).install_read_handler(0x02, 0x02, read8smo_delegate(*this, FUNC(maxrpm_state::maxrpm_ip2_r))); m_maincpu->space(AS_IO).install_write_handler(0x05, 0x05, write8smo_delegate(*this, FUNC(maxrpm_state::maxrpm_op5_w))); m_maincpu->space(AS_IO).install_write_handler(0x06, 0x06, write8smo_delegate(*this, FUNC(maxrpm_state::maxrpm_op6_w))); save_item(NAME(m_maxrpm_adc_control)); save_item(NAME(m_maxrpm_last_shift)); save_item(NAME(m_maxrpm_p1_shift)); save_item(NAME(m_maxrpm_p2_shift)); } void mcr3_state::init_rampage() { mcr_common_init(); m_maincpu->space(AS_IO).install_read_handler(0x04, 0x04, read8smo_delegate(*this, FUNC(mcr3_state::rampage_ip4_r))); m_maincpu->space(AS_IO).install_write_handler(0x06, 0x06, write8smo_delegate(*this, FUNC(mcr3_state::rampage_op6_w))); } void mcr3_state::init_powerdrv() { mcr_common_init(); m_maincpu->space(AS_IO).install_read_handler(0x02, 0x02, read8smo_delegate(*this, FUNC(mcr3_state::powerdrv_ip2_r))); m_maincpu->space(AS_IO).install_write_handler(0x05, 0x05, write8smo_delegate(*this, FUNC(mcr3_state::powerdrv_op5_w))); m_maincpu->space(AS_IO).install_write_handler(0x06, 0x06, write8smo_delegate(*this, FUNC(mcr3_state::powerdrv_op6_w))); } void mcr3_state::init_stargrds() { mcr_common_init(); m_maincpu->space(AS_IO).install_read_handler(0x00, 0x00, read8smo_delegate(*this, FUNC(mcr3_state::stargrds_ip0_r))); m_maincpu->space(AS_IO).install_write_handler(0x05, 0x05, write8smo_delegate(*this, FUNC(mcr3_state::stargrds_op5_w))); m_maincpu->space(AS_IO).install_write_handler(0x06, 0x06, write8smo_delegate(*this, FUNC(mcr3_state::stargrds_op6_w))); } void mcrsc_csd_state::init_spyhunt() { mcr_common_init(); m_ssio->set_custom_input(1, 0x60, *this, FUNC(mcrsc_csd_state::spyhunt_ip1_r)); m_ssio->set_custom_input(2, 0xff, *this, FUNC(mcrsc_csd_state::spyhunt_ip2_r)); m_ssio->set_custom_output(4, 0xff, *this, FUNC(mcrsc_csd_state::spyhunt_op4_w)); m_spyhunt_sprite_color_mask = 0x00; m_spyhunt_scroll_offset = 16; } void mcr3_state::init_crater() { mcr_common_init(); m_spyhunt_sprite_color_mask = 0x03; m_spyhunt_scroll_offset = 96; } void mcrsc_csd_state::init_turbotag() { mcr_common_init(); m_ssio->set_custom_input(1, 0x60, *this, FUNC(mcrsc_csd_state::spyhunt_ip1_r)); m_ssio->set_custom_input(2, 0xff, *this, FUNC(mcrsc_csd_state::turbotag_ip2_r)); m_ssio->set_custom_output(4, 0xff, *this, FUNC(mcrsc_csd_state::spyhunt_op4_w)); m_spyhunt_sprite_color_mask = 0x00; m_spyhunt_scroll_offset = 88; /* the CSD 68k doesn't have any program to execute */ m_cheap_squeak_deluxe->suspend_cpu(); /* kludge for bad ROM read */ m_maincpu->space(AS_PROGRAM).install_read_handler(0x0b53, 0x0b53, read8smo_delegate(*this, FUNC(mcrsc_csd_state::turbotag_kludge_r))); } /************************************* * * Game drivers * *************************************/ /* MCR monoboard games */ GAME( 1984, demoderm, demoderb, mono_tcs, demoderm, mcr3_state, init_demoderm, ROT0, "Bally Midway", "Demolition Derby (MCR-3 Mono Board Version)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, sarge, 0, mono_tcs, sarge, mcr3_state, init_sarge, ROT0, "Bally Midway", "Sarge", MACHINE_SUPPORTS_SAVE ) GAME( 1986, maxrpm, 0, maxrpm, maxrpm, maxrpm_state, init_maxrpm, ROT0, "Bally Midway", "Max RPM (ver 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1986, rampage, 0, mono_sg, rampage, mcr3_state, init_rampage, ROT0, "Bally Midway", "Rampage (Rev 3, 8/27/86)", MACHINE_SUPPORTS_SAVE ) GAME( 1986, rampage2, rampage, mono_sg, rampage, mcr3_state, init_rampage, ROT0, "Bally Midway", "Rampage (Rev 2, 8/4/86)", MACHINE_SUPPORTS_SAVE ) GAME( 1986, powerdrv, 0, mono_sg, powerdrv, mcr3_state, init_powerdrv, ROT0, "Bally Midway", "Power Drive", MACHINE_SUPPORTS_SAVE ) GAME( 1987, stargrds, 0, mono_sg, stargrds, mcr3_state, init_stargrds, ROT0, "Bally Midway", "Star Guards", MACHINE_SUPPORTS_SAVE ) /* MCR scrolling games */ GAMEL( 1983, spyhunt, 0, mcrsc_csd, spyhunt, mcrsc_csd_state, init_spyhunt, ROT90, "Bally Midway", "Spy Hunter", MACHINE_SUPPORTS_SAVE, layout_spyhunt ) GAMEL( 1983, spyhuntp, spyhunt, mcrsc_csd, spyhunt, mcrsc_csd_state, init_spyhunt, ROT90, "Bally Midway (Playtronic license)", "Spy Hunter (Playtronic license)", MACHINE_SUPPORTS_SAVE, layout_spyhunt ) GAME( 1984, crater, 0, mcrscroll, crater, mcr3_state, init_crater, ORIENTATION_FLIP_X, "Bally Midway", "Crater Raider", MACHINE_SUPPORTS_SAVE ) GAMEL( 1985, turbotag, 0, mcrsc_csd, turbotag, mcrsc_csd_state, init_turbotag, ROT90, "Bally Midway", "Turbo Tag (prototype)", MACHINE_SUPPORTS_SAVE, layout_turbotag )
43.905157
204
0.705419
Robbbert
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
a1578f671e32775d55370b773634562d71f84f70
32,222
cpp
C++
native/libs/gui/tests/SurfaceTextureClient_test.cpp
Keneral/aframeworks
af1d0010bfb88751837fb1afc355705bd8a9ad8b
[ "Unlicense" ]
null
null
null
native/libs/gui/tests/SurfaceTextureClient_test.cpp
Keneral/aframeworks
af1d0010bfb88751837fb1afc355705bd8a9ad8b
[ "Unlicense" ]
null
null
null
native/libs/gui/tests/SurfaceTextureClient_test.cpp
Keneral/aframeworks
af1d0010bfb88751837fb1afc355705bd8a9ad8b
[ "Unlicense" ]
null
null
null
/* * Copyright (C) 2011 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. */ #define LOG_TAG "SurfaceTextureClient_test" //#define LOG_NDEBUG 0 #include <EGL/egl.h> #include <GLES2/gl2.h> #include <gtest/gtest.h> #include <gui/GLConsumer.h> #include <gui/Surface.h> #include <system/graphics.h> #include <utils/Log.h> #include <utils/Thread.h> EGLAPI const char* eglQueryStringImplementationANDROID(EGLDisplay dpy, EGLint name); #define CROP_EXT_STR "EGL_ANDROID_image_crop" namespace android { class SurfaceTextureClientTest : public ::testing::Test { protected: SurfaceTextureClientTest(): mEglDisplay(EGL_NO_DISPLAY), mEglSurface(EGL_NO_SURFACE), mEglContext(EGL_NO_CONTEXT), mEglConfig(NULL) { } virtual void SetUp() { const ::testing::TestInfo* const testInfo = ::testing::UnitTest::GetInstance()->current_test_info(); ALOGV("Begin test: %s.%s", testInfo->test_case_name(), testInfo->name()); sp<IGraphicBufferProducer> producer; sp<IGraphicBufferConsumer> consumer; BufferQueue::createBufferQueue(&producer, &consumer); mST = new GLConsumer(consumer, 123, GLConsumer::TEXTURE_EXTERNAL, true, false); mSTC = new Surface(producer); mANW = mSTC; // We need a valid GL context so we can test updateTexImage() // This initializes EGL and create a dummy GL context with a // pbuffer render target. mEglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); ASSERT_EQ(EGL_SUCCESS, eglGetError()); ASSERT_NE(EGL_NO_DISPLAY, mEglDisplay); EGLint majorVersion, minorVersion; EXPECT_TRUE(eglInitialize(mEglDisplay, &majorVersion, &minorVersion)); ASSERT_EQ(EGL_SUCCESS, eglGetError()); EGLConfig myConfig; EGLint numConfigs = 0; EXPECT_TRUE(eglChooseConfig(mEglDisplay, getConfigAttribs(), &myConfig, 1, &numConfigs)); ASSERT_EQ(EGL_SUCCESS, eglGetError()); mEglConfig = myConfig; EGLint pbufferAttribs[] = { EGL_WIDTH, 16, EGL_HEIGHT, 16, EGL_NONE }; mEglSurface = eglCreatePbufferSurface(mEglDisplay, myConfig, pbufferAttribs); ASSERT_EQ(EGL_SUCCESS, eglGetError()); ASSERT_NE(EGL_NO_SURFACE, mEglSurface); mEglContext = eglCreateContext(mEglDisplay, myConfig, EGL_NO_CONTEXT, 0); ASSERT_EQ(EGL_SUCCESS, eglGetError()); ASSERT_NE(EGL_NO_CONTEXT, mEglContext); EXPECT_TRUE(eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext)); ASSERT_EQ(EGL_SUCCESS, eglGetError()); } virtual void TearDown() { mST.clear(); mSTC.clear(); mANW.clear(); eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglDestroyContext(mEglDisplay, mEglContext); eglDestroySurface(mEglDisplay, mEglSurface); eglTerminate(mEglDisplay); const ::testing::TestInfo* const testInfo = ::testing::UnitTest::GetInstance()->current_test_info(); ALOGV("End test: %s.%s", testInfo->test_case_name(), testInfo->name()); } virtual EGLint const* getConfigAttribs() { static EGLint sDefaultConfigAttribs[] = { EGL_SURFACE_TYPE, EGL_PBUFFER_BIT | EGL_WINDOW_BIT, EGL_NONE }; return sDefaultConfigAttribs; } sp<GLConsumer> mST; sp<Surface> mSTC; sp<ANativeWindow> mANW; EGLDisplay mEglDisplay; EGLSurface mEglSurface; EGLContext mEglContext; EGLConfig mEglConfig; }; TEST_F(SurfaceTextureClientTest, GetISurfaceTextureIsNotNull) { sp<IGraphicBufferProducer> ist(mSTC->getIGraphicBufferProducer()); ASSERT_TRUE(ist != NULL); } TEST_F(SurfaceTextureClientTest, QueuesToWindowCompositorIsFalse) { int result = -123; int err = mANW->query(mANW.get(), NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER, &result); EXPECT_EQ(NO_ERROR, err); EXPECT_EQ(0, result); } TEST_F(SurfaceTextureClientTest, ConcreteTypeIsSurfaceTextureClient) { int result = -123; int err = mANW->query(mANW.get(), NATIVE_WINDOW_CONCRETE_TYPE, &result); EXPECT_EQ(NO_ERROR, err); EXPECT_EQ(NATIVE_WINDOW_SURFACE, result); } TEST_F(SurfaceTextureClientTest, EglCreateWindowSurfaceSucceeds) { EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); ASSERT_EQ(EGL_SUCCESS, eglGetError()); ASSERT_NE(EGL_NO_DISPLAY, dpy); EGLint majorVersion; EGLint minorVersion; EXPECT_TRUE(eglInitialize(dpy, &majorVersion, &minorVersion)); ASSERT_EQ(EGL_SUCCESS, eglGetError()); EGLConfig myConfig = {0}; EGLint numConfigs = 0; EGLint configAttribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, EGL_ALPHA_SIZE, 8, EGL_DEPTH_SIZE, 16, EGL_STENCIL_SIZE, 8, EGL_NONE }; EXPECT_TRUE(eglChooseConfig(dpy, configAttribs, &myConfig, 1, &numConfigs)); ASSERT_EQ(EGL_SUCCESS, eglGetError()); EGLSurface eglSurface = eglCreateWindowSurface(dpy, myConfig, mANW.get(), NULL); EXPECT_NE(EGL_NO_SURFACE, eglSurface); EXPECT_EQ(EGL_SUCCESS, eglGetError()); if (eglSurface != EGL_NO_SURFACE) { eglDestroySurface(dpy, eglSurface); } eglTerminate(dpy); } TEST_F(SurfaceTextureClientTest, EglSwapBuffersAbandonErrorIsEglBadSurface) { EGLSurface eglSurface = eglCreateWindowSurface(mEglDisplay, mEglConfig, mANW.get(), NULL); EXPECT_NE(EGL_NO_SURFACE, eglSurface); EXPECT_EQ(EGL_SUCCESS, eglGetError()); EGLBoolean success = eglMakeCurrent(mEglDisplay, eglSurface, eglSurface, mEglContext); EXPECT_TRUE(success); glClear(GL_COLOR_BUFFER_BIT); success = eglSwapBuffers(mEglDisplay, eglSurface); EXPECT_TRUE(success); mST->abandon(); glClear(GL_COLOR_BUFFER_BIT); success = eglSwapBuffers(mEglDisplay, eglSurface); EXPECT_FALSE(success); EXPECT_EQ(EGL_BAD_SURFACE, eglGetError()); success = eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext); ASSERT_TRUE(success); if (eglSurface != EGL_NO_SURFACE) { eglDestroySurface(mEglDisplay, eglSurface); } } TEST_F(SurfaceTextureClientTest, BufferGeometryInvalidSizesFail) { EXPECT_GT(OK, native_window_set_buffers_dimensions(mANW.get(), 0, 8)); EXPECT_GT(OK, native_window_set_buffers_dimensions(mANW.get(), 8, 0)); } TEST_F(SurfaceTextureClientTest, DefaultGeometryValues) { ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ANativeWindowBuffer* buf; ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); EXPECT_EQ(1, buf->width); EXPECT_EQ(1, buf->height); EXPECT_EQ(PIXEL_FORMAT_RGBA_8888, buf->format); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf, -1)); } TEST_F(SurfaceTextureClientTest, BufferGeometryCanBeSet) { ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ANativeWindowBuffer* buf; EXPECT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 16, 8)); EXPECT_EQ(OK, native_window_set_buffers_format(mANW.get(), PIXEL_FORMAT_RGB_565)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); EXPECT_EQ(16, buf->width); EXPECT_EQ(8, buf->height); EXPECT_EQ(PIXEL_FORMAT_RGB_565, buf->format); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf, -1)); } TEST_F(SurfaceTextureClientTest, BufferGeometryDefaultSizeSetFormat) { ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ANativeWindowBuffer* buf; EXPECT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 0, 0)); EXPECT_EQ(OK, native_window_set_buffers_format(mANW.get(), PIXEL_FORMAT_RGB_565)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); EXPECT_EQ(1, buf->width); EXPECT_EQ(1, buf->height); EXPECT_EQ(PIXEL_FORMAT_RGB_565, buf->format); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf, -1)); } TEST_F(SurfaceTextureClientTest, BufferGeometrySetSizeDefaultFormat) { ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ANativeWindowBuffer* buf; EXPECT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 16, 8)); EXPECT_EQ(OK, native_window_set_buffers_format(mANW.get(), 0)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); EXPECT_EQ(16, buf->width); EXPECT_EQ(8, buf->height); EXPECT_EQ(PIXEL_FORMAT_RGBA_8888, buf->format); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf, -1)); } TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeUnset) { ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ANativeWindowBuffer* buf; EXPECT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 16, 8)); EXPECT_EQ(OK, native_window_set_buffers_format(mANW.get(), 0)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); EXPECT_EQ(16, buf->width); EXPECT_EQ(8, buf->height); EXPECT_EQ(PIXEL_FORMAT_RGBA_8888, buf->format); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf, -1)); EXPECT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 0, 0)); EXPECT_EQ(OK, native_window_set_buffers_format(mANW.get(), 0)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); EXPECT_EQ(1, buf->width); EXPECT_EQ(1, buf->height); EXPECT_EQ(PIXEL_FORMAT_RGBA_8888, buf->format); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf, -1)); } TEST_F(SurfaceTextureClientTest, BufferGeometrySizeCanBeChangedWithoutFormat) { ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ANativeWindowBuffer* buf; EXPECT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 0, 0)); EXPECT_EQ(OK, native_window_set_buffers_format(mANW.get(), PIXEL_FORMAT_RGB_565)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); EXPECT_EQ(1, buf->width); EXPECT_EQ(1, buf->height); EXPECT_EQ(PIXEL_FORMAT_RGB_565, buf->format); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf, -1)); EXPECT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 16, 8)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); EXPECT_EQ(16, buf->width); EXPECT_EQ(8, buf->height); EXPECT_EQ(PIXEL_FORMAT_RGB_565, buf->format); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf, -1)); } TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSize) { ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); sp<GLConsumer> st(mST); ANativeWindowBuffer* buf; EXPECT_EQ(OK, st->setDefaultBufferSize(16, 8)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); EXPECT_EQ(16, buf->width); EXPECT_EQ(8, buf->height); EXPECT_EQ(PIXEL_FORMAT_RGBA_8888, buf->format); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf, -1)); } TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSizeAfterDequeue) { ANativeWindowBuffer* buf[2]; ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1])); EXPECT_NE(buf[0], buf[1]); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[0], -1)); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[1], -1)); EXPECT_EQ(OK, mST->setDefaultBufferSize(16, 8)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1])); EXPECT_NE(buf[0], buf[1]); EXPECT_EQ(16, buf[0]->width); EXPECT_EQ(16, buf[1]->width); EXPECT_EQ(8, buf[0]->height); EXPECT_EQ(8, buf[1]->height); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[0], -1)); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[1], -1)); } TEST_F(SurfaceTextureClientTest, SurfaceTextureSetDefaultSizeVsGeometry) { ANativeWindowBuffer* buf[2]; ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4)); EXPECT_EQ(OK, mST->setDefaultBufferSize(16, 8)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1])); EXPECT_NE(buf[0], buf[1]); EXPECT_EQ(16, buf[0]->width); EXPECT_EQ(16, buf[1]->width); EXPECT_EQ(8, buf[0]->height); EXPECT_EQ(8, buf[1]->height); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[0], -1)); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[1], -1)); EXPECT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 12, 24)); EXPECT_EQ(OK, native_window_set_buffers_format(mANW.get(), 0)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1])); EXPECT_NE(buf[0], buf[1]); EXPECT_EQ(12, buf[0]->width); EXPECT_EQ(12, buf[1]->width); EXPECT_EQ(24, buf[0]->height); EXPECT_EQ(24, buf[1]->height); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[0], -1)); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[1], -1)); } TEST_F(SurfaceTextureClientTest, SurfaceTextureTooManyUpdateTexImage) { android_native_buffer_t* buf[3]; ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ASSERT_EQ(OK, mANW->setSwapInterval(mANW.get(), 0)); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0], -1)); EXPECT_EQ(OK, mST->updateTexImage()); EXPECT_EQ(OK, mST->updateTexImage()); ASSERT_EQ(OK, mANW->setSwapInterval(mANW.get(), 1)); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 3)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0], -1)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1])); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[1], -1)); EXPECT_EQ(OK, mST->updateTexImage()); EXPECT_EQ(OK, mST->updateTexImage()); EXPECT_EQ(OK, mST->updateTexImage()); } TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeSlowRetire) { android_native_buffer_t* buf[3]; ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1])); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[2])); EXPECT_NE(buf[0], buf[1]); EXPECT_NE(buf[1], buf[2]); EXPECT_NE(buf[2], buf[0]); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0], -1)); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[1], -1)); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[2], -1)); EXPECT_EQ(OK, mST->updateTexImage()); EXPECT_EQ(mST->getCurrentBuffer().get(), buf[0]); EXPECT_EQ(OK, mST->updateTexImage()); EXPECT_EQ(mST->getCurrentBuffer().get(), buf[1]); EXPECT_EQ(OK, mST->updateTexImage()); EXPECT_EQ(mST->getCurrentBuffer().get(), buf[2]); } TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeFastRetire) { android_native_buffer_t* buf[3]; ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1])); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[2])); EXPECT_NE(buf[0], buf[1]); EXPECT_NE(buf[1], buf[2]); EXPECT_NE(buf[2], buf[0]); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0], -1)); EXPECT_EQ(OK, mST->updateTexImage()); EXPECT_EQ(mST->getCurrentBuffer().get(), buf[0]); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[1], -1)); EXPECT_EQ(OK, mST->updateTexImage()); EXPECT_EQ(mST->getCurrentBuffer().get(), buf[1]); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[2], -1)); EXPECT_EQ(OK, mST->updateTexImage()); EXPECT_EQ(mST->getCurrentBuffer().get(), buf[2]); } TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeDQQR) { android_native_buffer_t* buf[3]; ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 3)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0], -1)); EXPECT_EQ(OK, mST->updateTexImage()); EXPECT_EQ(mST->getCurrentBuffer().get(), buf[0]); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1])); EXPECT_NE(buf[0], buf[1]); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[1], -1)); EXPECT_EQ(OK, mST->updateTexImage()); EXPECT_EQ(mST->getCurrentBuffer().get(), buf[1]); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[2])); EXPECT_NE(buf[1], buf[2]); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[2], -1)); EXPECT_EQ(OK, mST->updateTexImage()); EXPECT_EQ(mST->getCurrentBuffer().get(), buf[2]); } // XXX: We currently have no hardware that properly handles dequeuing the // buffer that is currently bound to the texture. TEST_F(SurfaceTextureClientTest, DISABLED_SurfaceTextureSyncModeDequeueCurrent) { android_native_buffer_t* buf[3]; android_native_buffer_t* firstBuf; ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 3)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &firstBuf)); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), firstBuf, -1)); EXPECT_EQ(OK, mST->updateTexImage()); EXPECT_EQ(mST->getCurrentBuffer().get(), firstBuf); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0], -1)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1])); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[1], -1)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[2])); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[2], -1)); EXPECT_NE(buf[0], buf[1]); EXPECT_NE(buf[1], buf[2]); EXPECT_NE(buf[2], buf[0]); EXPECT_EQ(firstBuf, buf[2]); } TEST_F(SurfaceTextureClientTest, SurfaceTextureSyncModeMinUndequeued) { android_native_buffer_t* buf[3]; ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 3)); // We should be able to dequeue all the buffers before we've queued mANWy. EXPECT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); EXPECT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1])); EXPECT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[2])); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[2], -1)); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[1], -1)); EXPECT_EQ(OK, mST->updateTexImage()); EXPECT_EQ(mST->getCurrentBuffer().get(), buf[1]); EXPECT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[2])); // Once we've queued a buffer, however we should not be able to dequeue more // than (buffer-count - MIN_UNDEQUEUED_BUFFERS), which is 2 in this case. EXPECT_EQ(INVALID_OPERATION, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1])); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[0], -1)); ASSERT_EQ(OK, mANW->cancelBuffer(mANW.get(), buf[2], -1)); } TEST_F(SurfaceTextureClientTest, SetCropCropsCrop) { ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); android_native_rect_t rect = {-2, -13, 40, 18}; native_window_set_crop(mANW.get(), &rect); ASSERT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 4, 4)); android_native_buffer_t* buf; ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf)); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf, -1)); ASSERT_EQ(OK, mST->updateTexImage()); Rect crop = mST->getCurrentCrop(); EXPECT_EQ(0, crop.left); EXPECT_EQ(0, crop.top); EXPECT_EQ(4, crop.right); EXPECT_EQ(4, crop.bottom); } // XXX: This is not expected to pass until the synchronization hacks are removed // from the SurfaceTexture class. TEST_F(SurfaceTextureClientTest, DISABLED_SurfaceTextureSyncModeWaitRetire) { class MyThread : public Thread { sp<GLConsumer> mST; EGLContext ctx; EGLSurface sur; EGLDisplay dpy; bool mBufferRetired; Mutex mLock; virtual bool threadLoop() { eglMakeCurrent(dpy, sur, sur, ctx); usleep(20000); Mutex::Autolock _l(mLock); mST->updateTexImage(); mBufferRetired = true; eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); return false; } public: MyThread(const sp<GLConsumer>& mST) : mST(mST), mBufferRetired(false) { ctx = eglGetCurrentContext(); sur = eglGetCurrentSurface(EGL_DRAW); dpy = eglGetCurrentDisplay(); eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); } ~MyThread() { eglMakeCurrent(dpy, sur, sur, ctx); } void bufferDequeued() { Mutex::Autolock _l(mLock); EXPECT_EQ(true, mBufferRetired); } }; android_native_buffer_t* buf[3]; ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 3)); // dequeue/queue/update so we have a current buffer ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0], -1)); mST->updateTexImage(); MyThread* thread = new MyThread(mST); sp<Thread> threadBase(thread); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0], -1)); thread->run("MyThread"); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[1])); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[1], -1)); //ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[2])); //ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[2], -1)); thread->bufferDequeued(); thread->requestExitAndWait(); } TEST_F(SurfaceTextureClientTest, GetTransformMatrixReturnsVerticalFlip) { android_native_buffer_t* buf[3]; float mtx[16] = {}; ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0], -1)); ASSERT_EQ(OK, mST->updateTexImage()); mST->getTransformMatrix(mtx); EXPECT_EQ(1.f, mtx[0]); EXPECT_EQ(0.f, mtx[1]); EXPECT_EQ(0.f, mtx[2]); EXPECT_EQ(0.f, mtx[3]); EXPECT_EQ(0.f, mtx[4]); EXPECT_EQ(-1.f, mtx[5]); EXPECT_EQ(0.f, mtx[6]); EXPECT_EQ(0.f, mtx[7]); EXPECT_EQ(0.f, mtx[8]); EXPECT_EQ(0.f, mtx[9]); EXPECT_EQ(1.f, mtx[10]); EXPECT_EQ(0.f, mtx[11]); EXPECT_EQ(0.f, mtx[12]); EXPECT_EQ(1.f, mtx[13]); EXPECT_EQ(0.f, mtx[14]); EXPECT_EQ(1.f, mtx[15]); } TEST_F(SurfaceTextureClientTest, GetTransformMatrixSucceedsAfterFreeingBuffers) { android_native_buffer_t* buf[3]; float mtx[16] = {}; ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0], -1)); ASSERT_EQ(OK, mST->updateTexImage()); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 6)); // frees buffers mST->getTransformMatrix(mtx); EXPECT_EQ(1.f, mtx[0]); EXPECT_EQ(0.f, mtx[1]); EXPECT_EQ(0.f, mtx[2]); EXPECT_EQ(0.f, mtx[3]); EXPECT_EQ(0.f, mtx[4]); EXPECT_EQ(-1.f, mtx[5]); EXPECT_EQ(0.f, mtx[6]); EXPECT_EQ(0.f, mtx[7]); EXPECT_EQ(0.f, mtx[8]); EXPECT_EQ(0.f, mtx[9]); EXPECT_EQ(1.f, mtx[10]); EXPECT_EQ(0.f, mtx[11]); EXPECT_EQ(0.f, mtx[12]); EXPECT_EQ(1.f, mtx[13]); EXPECT_EQ(0.f, mtx[14]); EXPECT_EQ(1.f, mtx[15]); } TEST_F(SurfaceTextureClientTest, GetTransformMatrixSucceedsAfterFreeingBuffersWithCrop) { // Query to see if the image crop extension exists EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); const char* exts = eglQueryStringImplementationANDROID(dpy, EGL_EXTENSIONS); size_t cropExtLen = strlen(CROP_EXT_STR); size_t extsLen = strlen(exts); bool equal = !strcmp(CROP_EXT_STR, exts); bool atStart = !strncmp(CROP_EXT_STR " ", exts, cropExtLen+1); bool atEnd = (cropExtLen+1) < extsLen && !strcmp(" " CROP_EXT_STR, exts + extsLen - (cropExtLen+1)); bool inMiddle = strstr(exts, " " CROP_EXT_STR " "); bool hasEglAndroidImageCrop = equal || atStart || atEnd || inMiddle; android_native_buffer_t* buf[3]; float mtx[16] = {}; android_native_rect_t crop; crop.left = 0; crop.top = 0; crop.right = 5; crop.bottom = 5; ASSERT_EQ(OK, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 4)); ASSERT_EQ(OK, native_window_set_buffers_dimensions(mANW.get(), 8, 8)); ASSERT_EQ(OK, native_window_set_buffers_format(mANW.get(), 0)); ASSERT_EQ(OK, native_window_dequeue_buffer_and_wait(mANW.get(), &buf[0])); ASSERT_EQ(OK, native_window_set_crop(mANW.get(), &crop)); ASSERT_EQ(OK, mANW->queueBuffer(mANW.get(), buf[0], -1)); ASSERT_EQ(OK, mST->updateTexImage()); ASSERT_EQ(OK, native_window_set_buffer_count(mANW.get(), 6)); // frees buffers mST->getTransformMatrix(mtx); // If the egl image crop extension is not present, this accounts for the // .5 texel shrink for each edge that's included in the transform matrix // to avoid texturing outside the crop region. Otherwise the crop is not // included in the transform matrix. EXPECT_EQ(hasEglAndroidImageCrop ? 1 : 0.5, mtx[0]); EXPECT_EQ(0.f, mtx[1]); EXPECT_EQ(0.f, mtx[2]); EXPECT_EQ(0.f, mtx[3]); EXPECT_EQ(0.f, mtx[4]); EXPECT_EQ(hasEglAndroidImageCrop ? -1 : -0.5, mtx[5]); EXPECT_EQ(0.f, mtx[6]); EXPECT_EQ(0.f, mtx[7]); EXPECT_EQ(0.f, mtx[8]); EXPECT_EQ(0.f, mtx[9]); EXPECT_EQ(1.f, mtx[10]); EXPECT_EQ(0.f, mtx[11]); EXPECT_EQ(hasEglAndroidImageCrop ? 0 : 0.0625f, mtx[12]); EXPECT_EQ(hasEglAndroidImageCrop ? 1 : 0.5625f, mtx[13]); EXPECT_EQ(0.f, mtx[14]); EXPECT_EQ(1.f, mtx[15]); } // This test verifies that the buffer format can be queried immediately after // it is set. TEST_F(SurfaceTextureClientTest, QueryFormatAfterSettingWorks) { sp<ANativeWindow> anw(mSTC); int fmts[] = { // RGBA_8888 should not come first, as it's the default HAL_PIXEL_FORMAT_RGBX_8888, HAL_PIXEL_FORMAT_RGBA_8888, HAL_PIXEL_FORMAT_RGB_888, HAL_PIXEL_FORMAT_RGB_565, HAL_PIXEL_FORMAT_BGRA_8888, HAL_PIXEL_FORMAT_YV12, }; const int numFmts = (sizeof(fmts) / sizeof(fmts[0])); for (int i = 0; i < numFmts; i++) { int fmt = -1; ASSERT_EQ(OK, native_window_set_buffers_dimensions(anw.get(), 0, 0)); ASSERT_EQ(OK, native_window_set_buffers_format(anw.get(), fmts[i])); ASSERT_EQ(OK, anw->query(anw.get(), NATIVE_WINDOW_FORMAT, &fmt)); EXPECT_EQ(fmts[i], fmt); } } class MultiSurfaceTextureClientTest : public ::testing::Test { public: MultiSurfaceTextureClientTest() : mEglDisplay(EGL_NO_DISPLAY), mEglContext(EGL_NO_CONTEXT) { for (int i = 0; i < NUM_SURFACE_TEXTURES; i++) { mEglSurfaces[i] = EGL_NO_CONTEXT; } } protected: enum { NUM_SURFACE_TEXTURES = 32 }; virtual void SetUp() { mEglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); ASSERT_EQ(EGL_SUCCESS, eglGetError()); ASSERT_NE(EGL_NO_DISPLAY, mEglDisplay); EGLint majorVersion, minorVersion; EXPECT_TRUE(eglInitialize(mEglDisplay, &majorVersion, &minorVersion)); ASSERT_EQ(EGL_SUCCESS, eglGetError()); EGLConfig myConfig; EGLint numConfigs = 0; EGLint configAttribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_NONE }; EXPECT_TRUE(eglChooseConfig(mEglDisplay, configAttribs, &myConfig, 1, &numConfigs)); ASSERT_EQ(EGL_SUCCESS, eglGetError()); mEglContext = eglCreateContext(mEglDisplay, myConfig, EGL_NO_CONTEXT, 0); ASSERT_EQ(EGL_SUCCESS, eglGetError()); ASSERT_NE(EGL_NO_CONTEXT, mEglContext); for (int i = 0; i < NUM_SURFACE_TEXTURES; i++) { sp<IGraphicBufferProducer> producer; sp<IGraphicBufferConsumer> consumer; BufferQueue::createBufferQueue(&producer, &consumer); sp<GLConsumer> st(new GLConsumer(consumer, i, GLConsumer::TEXTURE_EXTERNAL, true, false)); sp<Surface> stc(new Surface(producer)); mEglSurfaces[i] = eglCreateWindowSurface(mEglDisplay, myConfig, static_cast<ANativeWindow*>(stc.get()), NULL); ASSERT_EQ(EGL_SUCCESS, eglGetError()); ASSERT_NE(EGL_NO_SURFACE, mEglSurfaces[i]); } } virtual void TearDown() { eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); for (int i = 0; i < NUM_SURFACE_TEXTURES; i++) { if (mEglSurfaces[i] != EGL_NO_SURFACE) { eglDestroySurface(mEglDisplay, mEglSurfaces[i]); } } if (mEglContext != EGL_NO_CONTEXT) { eglDestroyContext(mEglDisplay, mEglContext); } if (mEglDisplay != EGL_NO_DISPLAY) { eglTerminate(mEglDisplay); } } EGLDisplay mEglDisplay; EGLSurface mEglSurfaces[NUM_SURFACE_TEXTURES]; EGLContext mEglContext; }; // XXX: This test is disabled because it causes a hang on some devices. See bug // 5015672. TEST_F(MultiSurfaceTextureClientTest, DISABLED_MakeCurrentBetweenSurfacesWorks) { for (int iter = 0; iter < 8; iter++) { for (int i = 0; i < NUM_SURFACE_TEXTURES; i++) { eglMakeCurrent(mEglDisplay, mEglSurfaces[i], mEglSurfaces[i], mEglContext); glClear(GL_COLOR_BUFFER_BIT); eglSwapBuffers(mEglDisplay, mEglSurfaces[i]); } } } } // namespace android
39.731196
94
0.684563
Keneral
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
a160359e8a80ef2b49f19807a1cea0e106d9ae27
4,114
cpp
C++
indra/llimage/llimagepng.cpp
humbletim/archived-casviewer
3b51b1baae7e7cebf1c7dca62d9c02751709ee57
[ "Unlicense" ]
null
null
null
indra/llimage/llimagepng.cpp
humbletim/archived-casviewer
3b51b1baae7e7cebf1c7dca62d9c02751709ee57
[ "Unlicense" ]
null
null
null
indra/llimage/llimagepng.cpp
humbletim/archived-casviewer
3b51b1baae7e7cebf1c7dca62d9c02751709ee57
[ "Unlicense" ]
null
null
null
/* * @file llimagepng.cpp * @brief LLImageFormatted glue to encode / decode PNG files. * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. * * This library 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; * version 2.1 of the License only. * * This library 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 this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ #include "linden_common.h" #include "stdtypes.h" #include "llerror.h" #include "llimage.h" #include "llpngwrapper.h" #include "llimagepng.h" // --------------------------------------------------------------------------- // LLImagePNG // --------------------------------------------------------------------------- LLImagePNG::LLImagePNG() : LLImageFormatted(IMG_CODEC_PNG) { } LLImagePNG::~LLImagePNG() { } // Virtual // Parse PNG image information and set the appropriate // width, height and component (channel) information. BOOL LLImagePNG::updateData() { resetLastError(); // Check to make sure that this instance has been initialized with data if (!getData() || (0 == getDataSize())) { setLastError("Uninitialized instance of LLImagePNG"); return FALSE; } // Decode the PNG data and extract sizing information LLPngWrapper pngWrapper; if (!pngWrapper.isValidPng(getData())) { setLastError("LLImagePNG data does not have a valid PNG header!"); return FALSE; } LLPngWrapper::ImageInfo infop; if (! pngWrapper.readPng(getData(), NULL, &infop)) { setLastError(pngWrapper.getErrorMessage()); return FALSE; } setSize(infop.mWidth, infop.mHeight, infop.mComponents); return TRUE; } // Virtual // Decode an in-memory PNG image into the raw RGB or RGBA format // used within SecondLife. BOOL LLImagePNG::decode(LLImageRaw* raw_image, F32 decode_time) { llassert_always(raw_image); resetLastError(); // Check to make sure that this instance has been initialized with data if (!getData() || (0 == getDataSize())) { setLastError("LLImagePNG trying to decode an image with no data!"); return FALSE; } // Decode the PNG data into the raw image LLPngWrapper pngWrapper; if (!pngWrapper.isValidPng(getData())) { setLastError("LLImagePNG data does not have a valid PNG header!"); return FALSE; } if (! pngWrapper.readPng(getData(), raw_image)) { setLastError(pngWrapper.getErrorMessage()); return FALSE; } return TRUE; } // Virtual // Encode the in memory RGB image into PNG format. BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time) { llassert_always(raw_image); resetLastError(); // Image logical size setSize(raw_image->getWidth(), raw_image->getHeight(), raw_image->getComponents()); // Temporary buffer to hold the encoded image. Note: the final image // size should be much smaller due to compression. U32 bufferSize = getWidth() * getHeight() * getComponents() + 1024; U8* tmpWriteBuffer = new U8[ bufferSize ]; // Delegate actual encoding work to wrapper LLPngWrapper pngWrapper; if (! pngWrapper.writePng(raw_image, tmpWriteBuffer)) { setLastError(pngWrapper.getErrorMessage()); delete[] tmpWriteBuffer; return FALSE; } // Resize internal buffer and copy from temp U32 encodedSize = pngWrapper.getFinalSize(); if(allocateData(encodedSize)) memcpy(getData(), tmpWriteBuffer, encodedSize); else LL_WARNS() << "allocateData() falied." << LL_ENDL; delete[] tmpWriteBuffer; return (getData()!=NULL); }
27.426667
84
0.691055
humbletim
a1640cb53b73f2475a43e74512bd14cc875dc32d
11,937
cpp
C++
Source/Source/Common/SO3World/Test/TestProject/KMathTest/KMathStressTest/KMathStressTest.cpp
uvbs/FullSource
07601c5f18d243fb478735b7bdcb8955598b9a90
[ "MIT" ]
2
2018-07-26T07:58:14.000Z
2019-05-31T14:32:18.000Z
Jx3Full/Source/Source/Common/SO3World/Test/TestProject/KMathTest/KMathStressTest/KMathStressTest.cpp
RivenZoo/FullSource
cfd7fd7ad422fd2dae5d657a18839c91ff9521fd
[ "MIT" ]
null
null
null
Jx3Full/Source/Source/Common/SO3World/Test/TestProject/KMathTest/KMathStressTest/KMathStressTest.cpp
RivenZoo/FullSource
cfd7fd7ad422fd2dae5d657a18839c91ff9521fd
[ "MIT" ]
5
2021-02-03T10:25:39.000Z
2022-02-23T07:08:37.000Z
/////////////////////////////////////////////////////////////// // Copyright(c) Kingsoft // // FileName : KMathStressTest // Creator : ChenShiCai // Date : 2008-10-27 // Comment : // /////////////////////////////////////////////////////////////// #include "stdafx.h" #include "KMathStressTest.h" #include "KG_Socket.h" #include <limits.h> #define MAX_X 131072 #define MAX_Y 131072 #define MAX_Z 65536 int KMathStressTest::Init() { int nResult = false; int nRetCode = false; KG_SocketConnector SocketConnector; m_piSocketStream = NULL; m_pGetDistance3_ParaArray = NULL; m_pGetDistance2_ParaArray = NULL; m_pGetDirection_ParaArray = NULL; m_pInRange_Para_ParaArray = NULL; m_pSin_ParaArray = NULL; m_piSocketStream = SocketConnector.ConnectSecurity(SERVER_IP, SERVER_PORT, KSG_ENCODE_DECODE); KG_PROCESS_ERROR(m_piSocketStream); m_pGetDistance3_ParaArray = new g_GetDistance3_Para[KMATH_TEST_ARRAYSIZE]; KG_PROCESS_ERROR(m_pGetDistance3_ParaArray); m_pGetDistance2_ParaArray = new g_GetDistance2_Para[KMATH_TEST_ARRAYSIZE]; KG_PROCESS_ERROR(m_pGetDistance2_ParaArray); m_pGetDirection_ParaArray = new g_GetDirection_Para[KMATH_TEST_ARRAYSIZE]; KG_PROCESS_ERROR(m_pGetDirection_ParaArray); m_pInRange_Para_ParaArray = new g_InRange_Para[KMATH_TEST_ARRAYSIZE]; KG_PROCESS_ERROR(m_pInRange_Para_ParaArray); m_pSin_ParaArray = new g_Sin_Para[KMATH_TEST_ARRAYSIZE]; KG_PROCESS_ERROR(m_pSin_ParaArray); m_pnRandomArray = new int[KMATH_TEST_ARRAYSIZE]; KG_PROCESS_ERROR(m_pnRandomArray); nResult = true; Exit0: if (!nResult) { UnInit(); } return nResult; } void KMathStressTest::UnInit() { KG_DELETE_ARRAY(m_pnRandomArray); KG_DELETE_ARRAY(m_pSin_ParaArray); KG_DELETE_ARRAY(m_pInRange_Para_ParaArray); KG_DELETE_ARRAY(m_pGetDirection_ParaArray); KG_DELETE_ARRAY(m_pGetDistance2_ParaArray); KG_DELETE_ARRAY(m_pGetDistance3_ParaArray); KG_COM_RELEASE(m_piSocketStream); } int KMathStressTest::Run() { int nResult = false; int nRetCode = false; unsigned uGetTickCountBegin = 0; unsigned uGetTickCountEnd = 0; IKG_Buffer *piBuffer = NULL; C2S_COMMAND *pCommand = NULL; Test_Result TestResult; TestResult.nVersion = VERSION; nRetCode = GetPara(); KG_PROCESS_ERROR(nRetCode); //1 uGetTickCountBegin = GetTickCount(); for (int i = 0; i < KMATH_TEST_ARRAYSIZE; ++i) { g_GetDirection_Para *pParaArray = m_pGetDirection_ParaArray + m_pnRandomArray[i]; g_GetDirection(0, 0, pParaArray->nX, pParaArray->nY); } uGetTickCountEnd = GetTickCount(); TestResult.uGetDirectionTime = uGetTickCountEnd - uGetTickCountBegin; //2 uGetTickCountBegin = GetTickCount(); for (int i = 0; i < KMATH_TEST_ARRAYSIZE; ++i) { g_GetDistance2_Para *pParaArray = m_pGetDistance2_ParaArray + m_pnRandomArray[i]; g_GetDistance2(pParaArray->nSourceX, pParaArray->nSourceY, pParaArray->nDestX, pParaArray->nDestY); } uGetTickCountEnd = GetTickCount(); TestResult.uGetDistance2Time = uGetTickCountEnd - uGetTickCountBegin; //3 uGetTickCountBegin = GetTickCount(); for (int i = 0; i < KMATH_TEST_ARRAYSIZE; ++i) { g_GetDistance3_Para *pParaArray = m_pGetDistance3_ParaArray + m_pnRandomArray[i]; g_GetDistance3(pParaArray->nSourceX, pParaArray->nSourceY, pParaArray->nSourceZ, pParaArray->nDestX, pParaArray->nDestY, pParaArray->nDestZ); } uGetTickCountEnd = GetTickCount(); TestResult.uGetDistance3Time = uGetTickCountEnd - uGetTickCountBegin; //4 uGetTickCountBegin = GetTickCount(); for (int i = 0; i < KMATH_TEST_ARRAYSIZE; ++i) { g_InRange_Para *pParaArray = m_pInRange_Para_ParaArray + m_pnRandomArray[i]; g_InRange(pParaArray->nXa, pParaArray->nXb, pParaArray->nZa, pParaArray->nXb, pParaArray->nYb, pParaArray->nZb, pParaArray->nMinRange, pParaArray->nMaxRange); } uGetTickCountEnd = GetTickCount(); TestResult.uInRangeTime = uGetTickCountEnd - uGetTickCountBegin; //5 uGetTickCountBegin = GetTickCount(); for (int i = 0; i < KMATH_TEST_ARRAYSIZE; ++i) { g_Sin_Para *pParaArray = m_pSin_ParaArray + m_pnRandomArray[i]; g_Sin(pParaArray->nDirection); } uGetTickCountEnd = GetTickCount(); TestResult.uSinTime = uGetTickCountEnd - uGetTickCountBegin; piBuffer = KG_MemoryCreateBuffer(sizeof(C2S_COMMAND) + sizeof(TestResult)); KG_PROCESS_ERROR(piBuffer); pCommand = (C2S_COMMAND *)piBuffer->GetData(); ASSERT(pCommand); pCommand->nCommand = CT_Result; pCommand->nNum = 0; memcpy(pCommand->chData, &TestResult, sizeof(TestResult)); nRetCode = m_piSocketStream->Send(piBuffer); KG_PROCESS_ERROR(nRetCode == 1); nResult = true; Exit0: KG_COM_RELEASE(piBuffer); return nResult; } int KMathStressTest::Random_RandomArray(int *nRetData) { int nResult = false; int nRetCode = false; nRetCode = g_Random(KMATH_TEST_ARRAYSIZE); ASSERT(nRetCode > - 1); ASSERT(nRetCode < KMATH_TEST_ARRAYSIZE); *nRetData = nRetCode; nResult = true; //Exit0: return nResult; } int KMathStressTest::Random_SinArray(g_Sin_Para *nRetData) { int nResult = false; int nRetCode = false; nRetData->nDirection = g_Random(INT_MAX); nResult = true; //Exit0: return nResult; } int KMathStressTest::Random_DirectionArray(g_GetDirection_Para *nRetData) { int nResult = false; int nRetCode = false; nRetData->nX = g_Random(MAX_X); nRetData->nY = g_Random(MAX_Y); nResult = true; //Exit0: return nResult; } int KMathStressTest::Random_Distance2Array(g_GetDistance2_Para *nRetData) { int nResult = false; int nRetCode = false; nRetData->nSourceX = g_Random(MAX_X); nRetData->nSourceY = g_Random(MAX_Y); nRetData->nDestX = g_Random(MAX_X); nRetData->nDestY = g_Random(MAX_Y); nResult = true; //Exit0: return nResult; } int KMathStressTest::Random_Distance3Array(g_GetDistance3_Para *nRetData) { int nResult = false; int nRetCode = false; nRetData->nSourceX = g_Random(MAX_X); nRetData->nSourceY = g_Random(MAX_Y); nRetData->nSourceZ = g_Random(MAX_Z); nRetData->nDestX = g_Random(MAX_X); nRetData->nDestY = g_Random(MAX_Y); nRetData->nDestZ = g_Random(MAX_Z); nResult = true; //Exit0: return nResult; } int KMathStressTest::Random_InRangeArray(g_InRange_Para *nRetData) { int nResult = false; int nRetCode = false; nRetData->nXa = g_Random(MAX_X); nRetData->nYa = g_Random(MAX_Y); nRetData->nZa = g_Random(MAX_Z); nRetData->nXb = g_Random(MAX_X); nRetData->nYb = g_Random(MAX_Y); nRetData->nZb = g_Random(MAX_Z); nRetData->nMinRange = 0; nRetData->nMaxRange = g_Random(MAX_X); nResult = true; //Exit0: return nResult; } int KMathStressTest::GetPara() { int nResult = false; int nRetCode = false; for (int i = 0; i < KMATH_TEST_ARRAYSIZE; ++i) { nRetCode = Random_RandomArray(m_pnRandomArray + i); KG_PROCESS_ERROR(nRetCode); nRetCode = Random_SinArray(m_pSin_ParaArray + i); KG_PROCESS_ERROR(nRetCode); nRetCode = Random_DirectionArray(m_pGetDirection_ParaArray + i); KG_PROCESS_ERROR(nRetCode); nRetCode = Random_Distance2Array(m_pGetDistance2_ParaArray + i); KG_PROCESS_ERROR(nRetCode); nRetCode = Random_Distance3Array(m_pGetDistance3_ParaArray + i); KG_PROCESS_ERROR(nRetCode); nRetCode = Random_InRangeArray(m_pInRange_Para_ParaArray + i); KG_PROCESS_ERROR(nRetCode); } nResult = true; Exit0: return nResult; } //int KMathStressTest::GetPara() //{ // int nResult = false; // int nRetCode = false; // // KG_PROCESS_ERROR(m_pSin_ParaArray); // KG_PROCESS_ERROR(m_pInRange_Para_ParaArray); // KG_PROCESS_ERROR(m_pGetDirection_ParaArray); // KG_PROCESS_ERROR(m_pGetDistance2_ParaArray); // KG_PROCESS_ERROR(m_pGetDistance3_ParaArray); // // nRetCode = SendCommand(CT_Random, KMATH_TEST_ARRAYSIZE); // KG_PROCESS_ERROR(nRetCode); // // for (int i = 0; i < KMATH_TEST_ARRAYSIZE; ++i) // { // nRetCode = RecvCommand(CT_Random, i, (m_pnRandomArray + i), sizeof(int)); // KG_PROCESS_ERROR(nRetCode); // KG_PROCESS_ERROR(m_pnRandomArray[i] < KMATH_TEST_ARRAYSIZE); // KG_PROCESS_ERROR(m_pnRandomArray[i] > -1); // // } // // nRetCode = SendCommand(CT_Sin, KMATH_TEST_ARRAYSIZE); // KG_PROCESS_ERROR(nRetCode); // // for (int i = 0; i < KMATH_TEST_ARRAYSIZE; ++i) // { // nRetCode = RecvCommand(CT_Sin, i, (m_pSin_ParaArray + i), sizeof(int)); // KG_PROCESS_ERROR(nRetCode); // } // // // for (int i = 0; i < KMATH_TEST_ARRAYSIZE; ++i) // { // nRetCode = RecvCommand(CT_InRange, i, (m_pInRange_Para_ParaArray + i), sizeof(int)); // KG_PROCESS_ERROR(nRetCode); // } // // nRetCode = SendCommand(CT_GetDirection, KMATH_TEST_ARRAYSIZE); // KG_PROCESS_ERROR(nRetCode); // // for (int i = 0; i < KMATH_TEST_ARRAYSIZE; ++i) // { // nRetCode = RecvCommand(CT_GetDirection, i, (m_pGetDirection_ParaArray + i), sizeof(int)); // KG_PROCESS_ERROR(nRetCode); // } // // nRetCode = SendCommand(CT_GetDistance2, KMATH_TEST_ARRAYSIZE); // KG_PROCESS_ERROR(nRetCode); // // for (int i = 0; i < KMATH_TEST_ARRAYSIZE; ++i) // { // nRetCode = RecvCommand(CT_GetDistance2, i, (m_pGetDistance2_ParaArray + i), sizeof(int)); // KG_PROCESS_ERROR(nRetCode); // } // // nRetCode = SendCommand(CT_GetDistance3, KMATH_TEST_ARRAYSIZE); // KG_PROCESS_ERROR(nRetCode); // // for (int i = 0; i < KMATH_TEST_ARRAYSIZE; ++i) // { // nRetCode = RecvCommand(CT_GetDistance3, i, (m_pGetDistance3_ParaArray + i), sizeof(int)); // KG_PROCESS_ERROR(nRetCode); // } // // nResult = true; //Exit0: // return nResult; //} //int KMathStressTest::RecvCommand(int nCommandType, int nGetCount, void *pvRetData, int nDataSize) //{ // int nResult = false; // int nRetCode = false; // IKG_Buffer *piBuffer = NULL; // S2C_COMMAND *pCommand = NULL; // // KG_PROCESS_ERROR(m_piSocketStream); // // nRetCode = m_piSocketStream->Recv(&piBuffer); // KG_PROCESS_ERROR(nRetCode == 1); // KG_PROCESS_ERROR(piBuffer->GetSize() == (nDataSize + sizeof(S2C_COMMAND))); // // pCommand = (S2C_COMMAND *)piBuffer->GetData(); // ASSERT(pCommand); // // KG_PROCESS_ERROR(pCommand->nCommand == nCommandType); // KG_PROCESS_ERROR(pCommand->nNum == nCommandType); // // memcpy(pvRetData, pCommand->chData, nDataSize); // // nResult = true; //Exit0: // return nResult; //} // //int KMathStressTest::SendCommand(int nCommandType, int nGetCount) //{ // int nResult = false; // int nRetCode = false; // IKG_Buffer *piBuffer = NULL; // C2S_COMMAND *pCommand = NULL; // // KG_PROCESS_ERROR(m_piSocketStream); // // piBuffer = KG_MemoryCreateBuffer(sizeof(C2S_COMMAND)); // KG_PROCESS_ERROR(piBuffer); // // pCommand = (C2S_COMMAND *)piBuffer->GetData(); // ASSERT(pCommand); // // pCommand->nCommand = nCommandType; // pCommand->nNum = nGetCount; // // nRetCode = m_piSocketStream->Send(piBuffer); // KG_PROCESS_ERROR(nRetCode == 1); // // nResult = true; //Exit0: // return nResult; //} //
29.114634
167
0.650582
uvbs