Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define __FLAG_debug 0
- #include <stddef.h>
- #include <inttypes.h>
- #include <time.h>
- #include <stdbool.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- static uint64_t __staticRandomNumber__;
- static uint64_t __argc;
- static char** __argv;
- struct t0 {uint64_t length; uint64_t capacity; uint64_t initCapacity; uint8_t* array; uint8_t* items; uint64_t* useCounter; bool isString;};
- static inline void p__main0__4__52_0_5();
- static inline void p__free0__0__f__4__19_293_5(struct t0 slice_);
- static inline void p__printLn0__0__f__4__31_821_5(struct t0 a1_);
- static inline struct t0 f__toString0__0__f__5__19_3103_5(struct t0 slice_);
- static inline struct t0 f__toString0__0__f__4__19_3106_5(struct t0 slice_);
- static inline void p__addEq0__0__t__1__f__4__19_38_5(struct t0* slice_, uint8_t newItem_);
- static __attribute__((always_inline)) void p__setStringFlag0__0__t__4__19_2792_5(struct t0* slice_);
- static __attribute__((always_inline)) void p__setItem0__0__t__3__f__1__f__4__19_2831_5(struct t0* slice_, uint64_t index_, uint8_t newItem_);
- static __attribute__((always_inline)) void p__use0__1__f__3__0_0_0(uint8_t a_);
- static inline struct t0 f__clone0__0__f__4__19_110_5(struct t0 slice_);
- static __attribute__((always_inline)) bool f__string2__0__f__4__19_3079_5(struct t0 slice_);
- static __attribute__((always_inline)) bool f__equal0__3__f__3__f__3__43_29_5(uint64_t a_, uint64_t b_);
- static __attribute__((always_inline)) uint64_t f__getTypeNumber0__1__f__4__34_11_5(uint8_t a_);
- static inline void p__copyToFirst0__0__t__0__f__4__19_165_5(struct t0* slice_, struct t0 source_);
- static inline void p__copy0__0__t__3__f__3__f__0__f__4__19_144_5(struct t0* slice_, uint64_t from_, uint64_t to_, struct t0 source_);
- static __attribute__((always_inline)) uint64_t f__getTypeSize0__1__f__4__34_5_5(uint8_t a_);
- static __attribute__((always_inline)) bool f__use2__0__f__4__19_3127_5(struct t0 slice_);
- static __attribute__((always_inline)) bool f__notEqual0__3__f__3__f__3__14_4_5(uint64_t a_, uint64_t b_);
- static __attribute__((always_inline)) bool f__neg0__2__f__4__22_22_5(bool a_);
- static __attribute__((always_inline)) uint64_t f__sub0__3__f__3__f__3__43_65_5(uint64_t a_, uint64_t b_);
- static __attribute__((noinline)) void p__debugMessage0__2__f__0__f__4__24_0_5(bool predicate_, struct t0 message_);
- static inline void p__printLn0__0__f__0__f__4__31_828_5(struct t0 a1_, struct t0 a2_);
- static __attribute__((always_inline)) bool f__greater0__3__f__3__f__3__43_35_5(uint64_t a_, uint64_t b_);
- static __attribute__((always_inline)) uint64_t f__getLength0__0__f__4__19_426_5(struct t0 slice_);
- static __attribute__((always_inline)) uint64_t f__convertTo0__3__f__3__f__8__34_0_5(uint64_t from_, uint64_t to_);
- static __attribute__((always_inline)) struct t0 f__init0__0__f__3__f__4__19_508_5(struct t0 sliceType_, uint64_t numberOfItems_);
- static __attribute__((always_inline)) struct t0 f__dummy0__0__f__3__f__4__19_248_5(struct t0 sliceType_, uint64_t numberOfItems_);
- static __attribute__((always_inline)) bool f__greaterOrEqual0__3__f__3__f__3__43_41_5(uint64_t a_, uint64_t b_);
- static __attribute__((always_inline)) struct t0 f__getFirstN0__0__f__3__f__4__19_344_5(struct t0 slice_, uint64_t n_);
- static __attribute__((always_inline)) struct t0 f__getSlice0__0__f__3__f__3__f__4__19_432_5(struct t0 slice_, uint64_t from_, uint64_t to_);
- static __attribute__((always_inline)) void p__use0__0__f__4__19_3119_5(struct t0 slice_);
- static __attribute__((always_inline)) uint64_t f__add0__3__f__3__f__3__43_15_5(uint64_t a_, uint64_t b_);
- static __attribute__((always_inline)) uint64_t f__mul0__3__f__3__f__3__43_59_5(uint64_t a_, uint64_t b_);
- static __attribute__((always_inline)) uint64_t f__div0__3__f__3__f__3__43_21_5(uint64_t a_, uint64_t b_);
- static __attribute__((always_inline)) bool f__lessOrEqual0__3__f__3__f__3__43_53_5(uint64_t a_, uint64_t b_);
- static __attribute__((always_inline)) uint64_t f__getCapacity0__0__f__4__19_333_5(struct t0 slice_);
- static __attribute__((always_inline)) struct t0 f__getAllExceptLastN0__0__f__3__f__4__19_328_5(struct t0 slice_, uint64_t n_);
- static inline void p__join0__0__t__0__f__0__f__4__19_1259_5(struct t0* slice_, struct t0 js1_, struct t0 js2_);
- static inline void p__addEq0__0__t__0__f__4__19_53_5(struct t0* slice_, struct t0 lastPart_);
- static inline void p__copyToLast0__0__t__0__f__4__19_168_5(struct t0* slice_, struct t0 source_);
- static __attribute__((always_inline)) bool f__less0__3__f__3__f__3__43_47_5(uint64_t a_, uint64_t b_);
- static __attribute__((always_inline)) struct t0 f__toString0__1__f__3__16_80_5(uint8_t a_);
- static __attribute__((always_inline)) uint8_t f__parse_item0__0__f__3__f__4__19_2777_5(struct t0 slice_, uint64_t index_);
- static __attribute__((always_inline)) uint8_t f__getItem0__0__f__3__f__4__19_407_5(struct t0 slice_, uint64_t index_);
- static __attribute__((always_inline)) bool f__parse_haveItem2__0__f__3__f__4__19_2772_5(struct t0 slice_, uint64_t index_);
- static __attribute__((always_inline)) uint64_t f__parse_next0__0__f__3__f__4__19_2787_5(struct t0 slice_, uint64_t index_);
- static __attribute__((always_inline)) uint64_t f__parse_first0__0__f__4__19_2767_5(struct t0 slice_);
- static __attribute__((always_inline)) void p__setFirst0__0__t__1__f__4__19_2826_5(struct t0* slice_, uint8_t newItem_);
- int main(int argc, char** argv) {
- if (sizeof(float) != 4 || sizeof(double) != 8) {
- printf("Only platforms in which the float type has a size of 32 bits and the double type has a size of 64 bits are supported.\n");
- }
- srand(time(NULL) + 17313770734317324529ull);
- __staticRandomNumber__ = rand();
- __argc = argc;
- __argv = argv;
- p__main0__4__52_0_5();
- return 0;
- }
- static inline void p__main0__4__52_0_5() {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- struct t0 a_ = (struct t0){.length = strlen("hello"), .capacity = strlen("hello"), .array = (uint8_t*){0}, .items = (uint8_t*)"hello", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true};
- p__use0__0__f__4__19_3119_5(a_);
- struct t0 b_ = a_;
- p__use0__0__f__4__19_3119_5(a_);
- struct t0 c_ = a_;
- struct t0 const __r0 = b_;
- b_ = (struct t0){.length = strlen("hello 2"), .capacity = strlen("hello 2"), .array = (uint8_t*){0}, .items = (uint8_t*)"hello 2", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true};
- p__free0__0__f__4__19_293_5(__r0);
- p__setFirst0__0__t__1__f__4__19_2826_5(&c_, (uint8_t)'H');
- p__printLn0__0__f__4__31_821_5(a_);
- p__printLn0__0__f__4__31_821_5(b_);
- p__printLn0__0__f__4__31_821_5(c_);
- p__free0__0__f__4__19_293_5(a_);
- p__free0__0__f__4__19_293_5(b_);
- p__free0__0__f__4__19_293_5(c_);
- }
- }
- static inline void p__free0__0__f__4__19_293_5(struct t0 slice_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- bool needToFree_ = false;
- if (slice_.useCounter != (uint64_t*){0}) {
- needToFree_ = *slice_.useCounter < 2;
- (*slice_.useCounter)--;
- }
- {
- if (needToFree_) {
- {
- }
- free(slice_.useCounter);
- free(slice_.array);
- }
- }
- }
- }
- static inline void p__printLn0__0__f__4__31_821_5(struct t0 a1_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- struct t0 const __r0 = f__toString0__0__f__5__19_3103_5(a1_);
- struct t0 const str1_ = __r0;
- printf("%.*s\n", (int)(str1_.length), (char*)(str1_.items));
- p__free0__0__f__4__19_293_5(str1_);
- }
- }
- static inline struct t0 f__toString0__0__f__5__19_3103_5(struct t0 slice_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- struct t0 result_ = (struct t0){0};
- bool const __r0 = f__string2__0__f__4__19_3079_5(slice_);
- struct t0 __r1;
- if (__r0){
- p__use0__0__f__4__19_3119_5(slice_);
- __r1 = slice_;
- } else {
- struct t0 const __r2 = f__toString0__0__f__4__19_3106_5(slice_);
- __r1 = __r2;
- }
- struct t0 const __r3 = result_;
- result_ = __r1;
- p__free0__0__f__4__19_293_5(__r3);
- return result_;
- }
- }
- static inline struct t0 f__toString0__0__f__4__19_3106_5(struct t0 slice_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- struct t0 result_ = (struct t0){0};
- struct t0 const __r0 = result_;
- result_ = (struct t0){.length = strlen("["), .capacity = strlen("["), .array = (uint8_t*){0}, .items = (uint8_t*)"[", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true};
- p__free0__0__f__4__19_293_5(__r0);
- {
- uint64_t const __r1 = f__getLength0__0__f__4__19_426_5(slice_);
- bool const __r2 = f__notEqual0__3__f__3__f__3__14_4_5(__r1, (uint64_t)0ull);
- if (__r2) {
- {
- uint64_t const __r3 = f__parse_first0__0__f__4__19_2767_5(slice_);
- uint64_t __r4 = __r3;
- bool __firstTime = true;
- for (;;){
- if (!__firstTime){
- uint64_t const __r5 = f__parse_next0__0__f__3__f__4__19_2787_5(slice_, __r4);
- __r4 = __r5;
- } else { __firstTime = false;}
- bool const __r6 = f__parse_haveItem2__0__f__3__f__4__19_2772_5(slice_, __r4);
- if (!__r6){break;};
- uint8_t const __r7 = f__parse_item0__0__f__3__f__4__19_2777_5(slice_, __r4);
- uint8_t const item_ = __r7;
- struct t0 const __r8 = f__toString0__1__f__3__16_80_5(__r7);
- p__join0__0__t__0__f__0__f__4__19_1259_5(&result_, __r8, (struct t0){.length = strlen(", "), .capacity = strlen(", "), .array = (uint8_t*){0}, .items = (uint8_t*)", ", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true});
- p__free0__0__f__4__19_293_5(__r8);
- }
- }
- struct t0 const __r9 = f__getAllExceptLastN0__0__f__3__f__4__19_328_5(result_, (uint64_t)2ull);
- struct t0 const __r10 = result_;
- result_ = __r9;
- p__free0__0__f__4__19_293_5(__r10);
- }
- }
- p__addEq0__0__t__1__f__4__19_38_5(&result_, (uint8_t)']');
- return result_;
- }
- }
- static inline void p__addEq0__0__t__1__f__4__19_38_5(struct t0* slice_, uint8_t newItem_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t const __r0 = f__getLength0__0__f__4__19_426_5((*slice_));
- uint64_t const initLength_ = __r0;
- bool const __r1 = f__string2__0__f__4__19_3079_5((*slice_));
- bool const isString_ = __r1;
- {
- uint64_t const __r2 = f__getCapacity0__0__f__4__19_333_5((*slice_));
- bool const __r3 = f__lessOrEqual0__3__f__3__f__3__43_53_5(__r2, initLength_);
- bool __r4 = __r3;
- if (!__r4) {
- bool const __r5 = f__use2__0__f__4__19_3127_5((*slice_));
- __r4 = __r5;
- }
- if (__r4) {
- uint64_t const __r6 = f__div0__3__f__3__f__3__43_21_5(initLength_, (uint64_t)4ull);
- uint64_t const __r7 = f__add0__3__f__3__f__3__43_15_5(initLength_, __r6);
- uint64_t const __r8 = f__div0__3__f__3__f__3__43_21_5(__r7, (uint64_t)64ull);
- uint64_t const __r9 = f__add0__3__f__3__f__3__43_15_5(__r8, (uint64_t)1ull);
- uint64_t const __r10 = f__mul0__3__f__3__f__3__43_59_5(__r9, (uint64_t)64ull);
- struct t0 const __r11 = f__init0__0__f__3__f__4__19_508_5((struct t0){0}, __r10);
- struct t0 newSlice_ = __r11;
- p__copyToFirst0__0__t__0__f__4__19_165_5(&newSlice_, (*slice_));
- uint64_t const __r12 = f__add0__3__f__3__f__3__43_15_5(initLength_, (uint64_t)1ull);
- struct t0 const __r13 = f__getFirstN0__0__f__3__f__4__19_344_5(newSlice_, __r12);
- struct t0 const __r14 = (*slice_);
- *(slice_) = __r13;
- p__free0__0__f__4__19_293_5(__r14);
- p__free0__0__f__4__19_293_5(newSlice_);
- } else {
- slice_->length++;
- }
- }
- p__setItem0__0__t__3__f__1__f__4__19_2831_5(slice_, initLength_, newItem_);
- {
- if (isString_) {
- p__setStringFlag0__0__t__4__19_2792_5(slice_);
- }
- }
- }
- }
- static __attribute__((always_inline)) void p__setStringFlag0__0__t__4__19_2792_5(struct t0* slice_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- slice_->isString = true;
- }
- }
- static __attribute__((always_inline)) void p__setItem0__0__t__3__f__1__f__4__19_2831_5(struct t0* slice_, uint64_t index_, uint8_t newItem_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- {
- #if __FLAG_debug == 1
- uint64_t const __r0 = f__convertTo0__3__f__3__f__8__34_0_5(index_, (uint64_t){0});
- uint64_t const __r1 = f__getLength0__0__f__4__19_426_5((*slice_));
- bool const __r2 = f__greaterOrEqual0__3__f__3__f__3__43_41_5(__r0, __r1);
- p__debugMessage0__2__f__0__f__4__24_0_5(__r2, (struct t0){.length = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 2836. UB - the index is too large."), .capacity = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 2836. UB - the index is too large."), .array = (uint8_t*){0}, .items = (uint8_t*)"File: /opt/cine/modules/standart/Slice.cine, line: 2836. UB - the index is too large.", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true});
- #endif
- }
- {
- bool const __r3 = f__use2__0__f__4__19_3127_5((*slice_));
- if (__r3) {
- struct t0 const __r4 = f__clone0__0__f__4__19_110_5((*slice_));
- struct t0 const __r5 = (*slice_);
- *(slice_) = __r4;
- p__free0__0__f__4__19_293_5(__r5);
- }
- }
- uint8_t oldItem_ = (uint8_t){0};
- oldItem_ = slice_->items[index_];
- slice_->items[index_] = newItem_;
- p__use0__1__f__3__0_0_0(newItem_);
- }
- }
- static __attribute__((always_inline)) void p__use0__1__f__3__0_0_0(uint8_t a_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- }
- }
- static inline struct t0 f__clone0__0__f__4__19_110_5(struct t0 slice_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- struct t0 result_ = (struct t0){0};
- {
- uint64_t const __r0 = f__getLength0__0__f__4__19_426_5(slice_);
- bool const __r1 = f__notEqual0__3__f__3__f__3__14_4_5(__r0, (uint64_t)0ull);
- if (__r1) {
- uint64_t const __r2 = f__getLength0__0__f__4__19_426_5(slice_);
- struct t0 const __r3 = f__init0__0__f__3__f__4__19_508_5((struct t0){0}, __r2);
- struct t0 const __r4 = result_;
- result_ = __r3;
- p__free0__0__f__4__19_293_5(__r4);
- p__copyToFirst0__0__t__0__f__4__19_165_5(&result_, slice_);
- }
- }
- {
- bool const __r5 = f__string2__0__f__4__19_3079_5(slice_);
- if (__r5) {
- p__setStringFlag0__0__t__4__19_2792_5(&result_);
- }
- }
- return result_;
- }
- }
- static __attribute__((always_inline)) bool f__string2__0__f__4__19_3079_5(struct t0 slice_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- bool result_ = (bool){0};
- {
- uint64_t const __r0 = f__getTypeNumber0__1__f__4__34_11_5((uint8_t){0});
- uint64_t const __r1 = f__getTypeNumber0__1__f__4__34_11_5((uint8_t){0});
- bool const __r2 = f__equal0__3__f__3__f__3__43_29_5(__r0, __r1);
- if (__r2) {
- result_ = slice_.isString;
- }
- }
- return result_;
- }
- }
- static __attribute__((always_inline)) bool f__equal0__3__f__3__f__3__43_29_5(uint64_t a_, uint64_t b_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- bool result_ = (bool){0};
- result_ = a_ == b_;
- return result_;
- }
- }
- static __attribute__((always_inline)) uint64_t f__getTypeNumber0__1__f__4__34_11_5(uint8_t a_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t result_ = (uint64_t){0};
- result_ = (uint64_t)1ull;
- return result_;
- }
- }
- static inline void p__copyToFirst0__0__t__0__f__4__19_165_5(struct t0* slice_, struct t0 source_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t const __r0 = f__getLength0__0__f__4__19_426_5(source_);
- p__copy0__0__t__3__f__3__f__0__f__4__19_144_5(slice_, (uint64_t)0ull, __r0, source_);
- }
- }
- static inline void p__copy0__0__t__3__f__3__f__0__f__4__19_144_5(struct t0* slice_, uint64_t from_, uint64_t to_, struct t0 source_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- {
- #if __FLAG_debug == 1
- uint64_t const __r0 = f__convertTo0__3__f__3__f__8__34_0_5(from_, (uint64_t){0});
- uint64_t const __r1 = f__convertTo0__3__f__3__f__8__34_0_5(to_, (uint64_t){0});
- bool const __r2 = f__greater0__3__f__3__f__3__43_35_5(__r0, __r1);
- p__debugMessage0__2__f__0__f__4__24_0_5(__r2, (struct t0){.length = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 150. UB - the first index is greater than the last index."), .capacity = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 150. UB - the first index is greater than the last index."), .array = (uint8_t*){0}, .items = (uint8_t*)"File: /opt/cine/modules/standart/Slice.cine, line: 150. UB - the first index is greater than the last index.", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true});
- uint64_t const __r3 = f__convertTo0__3__f__3__f__8__34_0_5(from_, (uint64_t){0});
- uint64_t const __r4 = f__getLength0__0__f__4__19_426_5((*slice_));
- bool const __r5 = f__greater0__3__f__3__f__3__43_35_5(__r3, __r4);
- p__debugMessage0__2__f__0__f__4__24_0_5(__r5, (struct t0){.length = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 151. UB - the first index is too large."), .capacity = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 151. UB - the first index is too large."), .array = (uint8_t*){0}, .items = (uint8_t*)"File: /opt/cine/modules/standart/Slice.cine, line: 151. UB - the first index is too large.", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true});
- uint64_t const __r6 = f__convertTo0__3__f__3__f__8__34_0_5(to_, (uint64_t){0});
- uint64_t const __r7 = f__getLength0__0__f__4__19_426_5((*slice_));
- bool const __r8 = f__greater0__3__f__3__f__3__43_35_5(__r6, __r7);
- p__debugMessage0__2__f__0__f__4__24_0_5(__r8, (struct t0){.length = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 152. UB - the last index is too large."), .capacity = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 152. UB - the last index is too large."), .array = (uint8_t*){0}, .items = (uint8_t*)"File: /opt/cine/modules/standart/Slice.cine, line: 152. UB - the last index is too large.", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true});
- uint64_t const __r9 = f__convertTo0__3__f__3__f__8__34_0_5(to_, (uint64_t){0});
- uint64_t const __r10 = f__convertTo0__3__f__3__f__8__34_0_5(from_, (uint64_t){0});
- uint64_t const __r11 = f__sub0__3__f__3__f__3__43_65_5(__r9, __r10);
- uint64_t const __r12 = f__getLength0__0__f__4__19_426_5(source_);
- bool const __r13 = f__greater0__3__f__3__f__3__43_35_5(__r11, __r12);
- p__debugMessage0__2__f__0__f__4__24_0_5(__r13, (struct t0){.length = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 153. UB - the source is too short."), .capacity = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 153. UB - the source is too short."), .array = (uint8_t*){0}, .items = (uint8_t*)"File: /opt/cine/modules/standart/Slice.cine, line: 153. UB - the source is too short.", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true});
- #endif
- }
- {
- uint64_t const __r14 = f__sub0__3__f__3__f__3__43_65_5(to_, from_);
- uint64_t const length_ = __r14;
- bool const __r15 = f__notEqual0__3__f__3__f__3__14_4_5(length_, (uint64_t)0ull);
- if (__r15) {
- {
- {
- bool const __r16 = f__use2__0__f__4__19_3127_5((*slice_));
- if (__r16) {
- struct t0 const __r17 = f__clone0__0__f__4__19_110_5((*slice_));
- struct t0 const __r18 = (*slice_);
- *(slice_) = __r17;
- p__free0__0__f__4__19_293_5(__r18);
- }
- }
- uint64_t const __r19 = f__getTypeSize0__1__f__4__34_5_5((uint8_t){0});
- uint64_t const itemSize_ = __r19;
- memcpy(slice_->items + from_, source_.items, length_ * itemSize_);
- }
- }
- }
- }
- }
- static __attribute__((always_inline)) uint64_t f__getTypeSize0__1__f__4__34_5_5(uint8_t a_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t result_ = (uint64_t){0};
- result_ = sizeof(uint8_t);
- return result_;
- }
- }
- static __attribute__((always_inline)) bool f__use2__0__f__4__19_3127_5(struct t0 slice_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- bool result_ = (bool){0};
- if (slice_.useCounter != (uint64_t*){0}) {
- result_ = *slice_.useCounter > 1;
- }
- result_ = result_ || ((void*)slice_.array == (void*){0} && (void*)slice_.items != (void*){0});
- return result_;
- }
- }
- static __attribute__((always_inline)) bool f__notEqual0__3__f__3__f__3__14_4_5(uint64_t a_, uint64_t b_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- bool result_ = (bool){0};
- bool const __r0 = f__equal0__3__f__3__f__3__43_29_5(a_, b_);
- bool const __r1 = f__neg0__2__f__4__22_22_5(__r0);
- result_ = __r1;
- return result_;
- }
- }
- static __attribute__((always_inline)) bool f__neg0__2__f__4__22_22_5(bool a_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- bool result_ = (bool){0};
- result_ = !a_;
- return result_;
- }
- }
- static __attribute__((always_inline)) uint64_t f__sub0__3__f__3__f__3__43_65_5(uint64_t a_, uint64_t b_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t result_ = (uint64_t){0};
- result_ = a_ - b_;
- return result_;
- }
- }
- static __attribute__((noinline)) void p__debugMessage0__2__f__0__f__4__24_0_5(bool predicate_, struct t0 message_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- {
- #if __FLAG_debug == 1
- {
- if (predicate_) {
- p__printLn0__0__f__0__f__4__31_828_5((struct t0){.length = strlen("DEBUG: "), .capacity = strlen("DEBUG: "), .array = (uint8_t*){0}, .items = (uint8_t*)"DEBUG: ", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true}, message_);
- }
- }
- #endif
- }
- }
- }
- static inline void p__printLn0__0__f__0__f__4__31_828_5(struct t0 a1_, struct t0 a2_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- struct t0 const __r0 = f__toString0__0__f__5__19_3103_5(a1_);
- struct t0 const str1_ = __r0;
- struct t0 const __r1 = f__toString0__0__f__5__19_3103_5(a2_);
- struct t0 const str2_ = __r1;
- printf("%.*s%.*s\n", (int)(str1_.length), (char*)(str1_.items), (int)(str2_.length), (char*)(str2_.items));
- p__free0__0__f__4__19_293_5(str1_);
- p__free0__0__f__4__19_293_5(str2_);
- }
- }
- static __attribute__((always_inline)) bool f__greater0__3__f__3__f__3__43_35_5(uint64_t a_, uint64_t b_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- bool result_ = (bool){0};
- result_ = a_ > b_;
- return result_;
- }
- }
- static __attribute__((always_inline)) uint64_t f__getLength0__0__f__4__19_426_5(struct t0 slice_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t result_ = (uint64_t){0};
- result_ = slice_.length;
- return result_;
- }
- }
- static __attribute__((always_inline)) uint64_t f__convertTo0__3__f__3__f__8__34_0_5(uint64_t from_, uint64_t to_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t result_ = (uint64_t){0};
- result_ = from_;
- return result_;
- }
- }
- static __attribute__((always_inline)) struct t0 f__init0__0__f__3__f__4__19_508_5(struct t0 sliceType_, uint64_t numberOfItems_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- struct t0 result_ = (struct t0){0};
- struct t0 const __r0 = f__dummy0__0__f__3__f__4__19_248_5((struct t0){0}, numberOfItems_);
- struct t0 const __r1 = result_;
- result_ = __r0;
- p__free0__0__f__4__19_293_5(__r1);
- result_.length = numberOfItems_;
- return result_;
- }
- }
- static __attribute__((always_inline)) struct t0 f__dummy0__0__f__3__f__4__19_248_5(struct t0 sliceType_, uint64_t numberOfItems_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- struct t0 result_ = (struct t0){0};
- {
- bool const __r0 = f__notEqual0__3__f__3__f__3__14_4_5(numberOfItems_, (uint64_t)0ull);
- if (__r0) {
- result_.array = (uint8_t*)calloc(numberOfItems_, sizeof(uint8_t));
- result_.useCounter = (uint64_t*)(malloc(sizeof(uint64_t)));
- if (__builtin_expect(result_.array == NULL || result_.useCounter == NULL, false)){
- fprintf(stderr, "Not enought memory.\n");
- abort();
- }
- *result_.useCounter = 1;
- result_.items = result_.array;
- result_.capacity = numberOfItems_;
- result_.initCapacity = numberOfItems_;
- }
- }
- return result_;
- }
- }
- static __attribute__((always_inline)) bool f__greaterOrEqual0__3__f__3__f__3__43_41_5(uint64_t a_, uint64_t b_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- bool result_ = (bool){0};
- result_ = a_ >= b_;
- return result_;
- }
- }
- static __attribute__((always_inline)) struct t0 f__getFirstN0__0__f__3__f__4__19_344_5(struct t0 slice_, uint64_t n_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- struct t0 result_ = (struct t0){0};
- struct t0 const __r0 = f__getSlice0__0__f__3__f__3__f__4__19_432_5(slice_, (uint64_t)0ull, n_);
- struct t0 const __r1 = result_;
- result_ = __r0;
- p__free0__0__f__4__19_293_5(__r1);
- return result_;
- }
- }
- static __attribute__((always_inline)) struct t0 f__getSlice0__0__f__3__f__3__f__4__19_432_5(struct t0 slice_, uint64_t from_, uint64_t to_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- struct t0 result_ = (struct t0){0};
- {
- #if __FLAG_debug == 1
- uint64_t const __r0 = f__convertTo0__3__f__3__f__8__34_0_5(from_, (uint64_t){0});
- uint64_t const __r1 = f__convertTo0__3__f__3__f__8__34_0_5(to_, (uint64_t){0});
- bool const __r2 = f__greater0__3__f__3__f__3__43_35_5(__r0, __r1);
- p__debugMessage0__2__f__0__f__4__24_0_5(__r2, (struct t0){.length = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 440. UB - the first index is greater than the last index."), .capacity = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 440. UB - the first index is greater than the last index."), .array = (uint8_t*){0}, .items = (uint8_t*)"File: /opt/cine/modules/standart/Slice.cine, line: 440. UB - the first index is greater than the last index.", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true});
- uint64_t const __r3 = f__convertTo0__3__f__3__f__8__34_0_5(from_, (uint64_t){0});
- uint64_t const __r4 = f__getLength0__0__f__4__19_426_5(slice_);
- bool const __r5 = f__greater0__3__f__3__f__3__43_35_5(__r3, __r4);
- p__debugMessage0__2__f__0__f__4__24_0_5(__r5, (struct t0){.length = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 441. UB - the first index is too large."), .capacity = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 441. UB - the first index is too large."), .array = (uint8_t*){0}, .items = (uint8_t*)"File: /opt/cine/modules/standart/Slice.cine, line: 441. UB - the first index is too large.", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true});
- uint64_t const __r6 = f__convertTo0__3__f__3__f__8__34_0_5(to_, (uint64_t){0});
- uint64_t const __r7 = f__getLength0__0__f__4__19_426_5(slice_);
- bool const __r8 = f__greater0__3__f__3__f__3__43_35_5(__r6, __r7);
- p__debugMessage0__2__f__0__f__4__24_0_5(__r8, (struct t0){.length = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 442. UB - the last index is too large."), .capacity = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 442. UB - the last index is too large."), .array = (uint8_t*){0}, .items = (uint8_t*)"File: /opt/cine/modules/standart/Slice.cine, line: 442. UB - the last index is too large.", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true});
- #endif
- }
- uint64_t const __r9 = f__sub0__3__f__3__f__3__43_65_5(to_, from_);
- uint64_t const newLength_ = __r9;
- {
- bool const __r10 = f__notEqual0__3__f__3__f__3__14_4_5(newLength_, (uint64_t)0ull);
- if (__r10) {
- result_.length = newLength_;
- result_.capacity = slice_.capacity - from_;
- result_.array = slice_.array;
- result_.initCapacity = slice_.initCapacity;
- result_.items = slice_.items + from_;
- result_.useCounter = slice_.useCounter;
- p__use0__0__f__4__19_3119_5(result_);
- }
- }
- {
- bool const __r11 = f__string2__0__f__4__19_3079_5(slice_);
- if (__r11) {
- p__setStringFlag0__0__t__4__19_2792_5(&result_);
- }
- }
- return result_;
- }
- }
- static __attribute__((always_inline)) void p__use0__0__f__4__19_3119_5(struct t0 slice_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- if (slice_.useCounter != (uint64_t*){0}) {
- (*slice_.useCounter)++;
- }
- }
- }
- static __attribute__((always_inline)) uint64_t f__add0__3__f__3__f__3__43_15_5(uint64_t a_, uint64_t b_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t result_ = (uint64_t){0};
- result_ = a_ + b_;
- return result_;
- }
- }
- static __attribute__((always_inline)) uint64_t f__mul0__3__f__3__f__3__43_59_5(uint64_t a_, uint64_t b_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t result_ = (uint64_t){0};
- result_ = a_ * b_;
- return result_;
- }
- }
- static __attribute__((always_inline)) uint64_t f__div0__3__f__3__f__3__43_21_5(uint64_t a_, uint64_t b_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t result_ = (uint64_t){0};
- {
- #if __FLAG_debug == 1
- bool const __r0 = f__equal0__3__f__3__f__3__43_29_5(b_, (uint64_t)0ull);
- p__debugMessage0__2__f__0__f__4__24_0_5(__r0, (struct t0){.length = strlen("File: /opt/cine/modules/standart/BasicNumber.cine, line: 26. UB - division by zero."), .capacity = strlen("File: /opt/cine/modules/standart/BasicNumber.cine, line: 26. UB - division by zero."), .array = (uint8_t*){0}, .items = (uint8_t*)"File: /opt/cine/modules/standart/BasicNumber.cine, line: 26. UB - division by zero.", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true});
- #endif
- }
- result_ = a_ / b_;
- return result_;
- }
- }
- static __attribute__((always_inline)) bool f__lessOrEqual0__3__f__3__f__3__43_53_5(uint64_t a_, uint64_t b_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- bool result_ = (bool){0};
- result_ = a_ <= b_;
- return result_;
- }
- }
- static __attribute__((always_inline)) uint64_t f__getCapacity0__0__f__4__19_333_5(struct t0 slice_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t result_ = (uint64_t){0};
- result_ = slice_.capacity;
- return result_;
- }
- }
- static __attribute__((always_inline)) struct t0 f__getAllExceptLastN0__0__f__3__f__4__19_328_5(struct t0 slice_, uint64_t n_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- struct t0 result_ = (struct t0){0};
- uint64_t const __r0 = f__getLength0__0__f__4__19_426_5(slice_);
- uint64_t const __r1 = f__convertTo0__3__f__3__f__8__34_0_5(n_, (uint64_t){0});
- uint64_t const __r2 = f__sub0__3__f__3__f__3__43_65_5(__r0, __r1);
- struct t0 const __r3 = f__getSlice0__0__f__3__f__3__f__4__19_432_5(slice_, (uint64_t)0ull, __r2);
- struct t0 const __r4 = result_;
- result_ = __r3;
- p__free0__0__f__4__19_293_5(__r4);
- return result_;
- }
- }
- static inline void p__join0__0__t__0__f__0__f__4__19_1259_5(struct t0* slice_, struct t0 js1_, struct t0 js2_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t const __r0 = f__getLength0__0__f__4__19_426_5((*slice_));
- uint64_t const __r1 = f__getLength0__0__f__4__19_426_5(js1_);
- uint64_t const __r2 = f__add0__3__f__3__f__3__43_15_5(__r0, __r1);
- uint64_t const __r3 = f__getLength0__0__f__4__19_426_5(js2_);
- uint64_t const __r4 = f__add0__3__f__3__f__3__43_15_5(__r2, __r3);
- uint64_t const length_ = __r4;
- {
- bool const __r5 = f__use2__0__f__4__19_3127_5((*slice_));
- bool __r6 = __r5;
- if (!__r6) {
- uint64_t const __r7 = f__getCapacity0__0__f__4__19_333_5((*slice_));
- bool const __r8 = f__less0__3__f__3__f__3__43_47_5(__r7, length_);
- __r6 = __r8;
- }
- if (__r6) {
- uint64_t const __r9 = f__div0__3__f__3__f__3__43_21_5(length_, (uint64_t)4ull);
- uint64_t const __r10 = f__add0__3__f__3__f__3__43_15_5(length_, __r9);
- uint64_t const __r11 = f__div0__3__f__3__f__3__43_21_5(__r10, (uint64_t)64ull);
- uint64_t const __r12 = f__add0__3__f__3__f__3__43_15_5(__r11, (uint64_t)1ull);
- uint64_t const __r13 = f__mul0__3__f__3__f__3__43_59_5(__r12, (uint64_t)64ull);
- struct t0 const __r14 = f__dummy0__0__f__3__f__4__19_248_5((struct t0){0}, __r13);
- struct t0 newSlice_ = __r14;
- {
- bool const __r15 = f__string2__0__f__4__19_3079_5((*slice_));
- if (__r15) {
- p__setStringFlag0__0__t__4__19_2792_5(&newSlice_);
- }
- }
- p__addEq0__0__t__0__f__4__19_53_5(&newSlice_, (*slice_));
- p__use0__0__f__4__19_3119_5(newSlice_);
- struct t0 const __r16 = (*slice_);
- *(slice_) = newSlice_;
- p__free0__0__f__4__19_293_5(__r16);
- p__free0__0__f__4__19_293_5(newSlice_);
- }
- }
- p__addEq0__0__t__0__f__4__19_53_5(slice_, js1_);
- p__addEq0__0__t__0__f__4__19_53_5(slice_, js2_);
- }
- }
- static inline void p__addEq0__0__t__0__f__4__19_53_5(struct t0* slice_, struct t0 lastPart_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t const __r0 = f__getLength0__0__f__4__19_426_5((*slice_));
- uint64_t const __r1 = f__getLength0__0__f__4__19_426_5(lastPart_);
- uint64_t const __r2 = f__add0__3__f__3__f__3__43_15_5(__r0, __r1);
- uint64_t const newLength_ = __r2;
- bool const __r3 = f__string2__0__f__4__19_3079_5((*slice_));
- bool const isString_ = __r3;
- {
- uint64_t const __r4 = f__getCapacity0__0__f__4__19_333_5((*slice_));
- bool const __r5 = f__less0__3__f__3__f__3__43_47_5(__r4, newLength_);
- bool __r6 = __r5;
- if (!__r6) {
- bool const __r7 = f__use2__0__f__4__19_3127_5((*slice_));
- __r6 = __r7;
- }
- if (__r6) {
- uint64_t const __r8 = f__div0__3__f__3__f__3__43_21_5(newLength_, (uint64_t)4ull);
- uint64_t const __r9 = f__add0__3__f__3__f__3__43_15_5(newLength_, __r8);
- uint64_t const __r10 = f__div0__3__f__3__f__3__43_21_5(__r9, (uint64_t)64ull);
- uint64_t const __r11 = f__add0__3__f__3__f__3__43_15_5(__r10, (uint64_t)1ull);
- uint64_t const __r12 = f__mul0__3__f__3__f__3__43_59_5(__r11, (uint64_t)64ull);
- struct t0 const __r13 = f__init0__0__f__3__f__4__19_508_5((struct t0){0}, __r12);
- struct t0 newSlice_ = __r13;
- p__copyToFirst0__0__t__0__f__4__19_165_5(&newSlice_, (*slice_));
- struct t0 const __r14 = f__getFirstN0__0__f__3__f__4__19_344_5(newSlice_, newLength_);
- struct t0 const __r15 = (*slice_);
- *(slice_) = __r14;
- p__free0__0__f__4__19_293_5(__r15);
- p__free0__0__f__4__19_293_5(newSlice_);
- } else {
- slice_->length = newLength_;
- }
- }
- p__copyToLast0__0__t__0__f__4__19_168_5(slice_, lastPart_);
- {
- if (isString_) {
- p__setStringFlag0__0__t__4__19_2792_5(slice_);
- }
- }
- }
- }
- static inline void p__copyToLast0__0__t__0__f__4__19_168_5(struct t0* slice_, struct t0 source_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t const __r0 = f__getLength0__0__f__4__19_426_5((*slice_));
- uint64_t const __r1 = f__getLength0__0__f__4__19_426_5(source_);
- uint64_t const __r2 = f__sub0__3__f__3__f__3__43_65_5(__r0, __r1);
- uint64_t const __r3 = f__getLength0__0__f__4__19_426_5((*slice_));
- p__copy0__0__t__3__f__3__f__0__f__4__19_144_5(slice_, __r2, __r3, source_);
- }
- }
- static __attribute__((always_inline)) bool f__less0__3__f__3__f__3__43_47_5(uint64_t a_, uint64_t b_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- bool result_ = (bool){0};
- result_ = a_ < b_;
- return result_;
- }
- }
- static __attribute__((always_inline)) struct t0 f__toString0__1__f__3__16_80_5(uint8_t a_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- struct t0 result_ = (struct t0){0};
- uint64_t const __r0 = f__getTypeSize0__1__f__4__34_5_5((uint8_t){0});
- uint64_t const __r1 = f__mul0__3__f__3__f__3__43_59_5(__r0, (uint64_t)3ull);
- uint64_t const __r2 = f__getTypeSize0__1__f__4__34_5_5((uint8_t){0});
- uint64_t const __r3 = f__div0__3__f__3__f__3__43_21_5(__r2, (uint64_t)2ull);
- uint64_t const __r4 = f__sub0__3__f__3__f__3__43_65_5(__r1, __r3);
- uint64_t length_ = __r4;
- uint64_t index_ = length_;
- uint8_t remain_ = a_;
- char tmpResult[length_];
- for (;;){
- index_--;
- char newChar = remain_ % 10 + 48;
- remain_ /= 10;
- tmpResult[index_] = newChar;
- if (remain_ == 0){
- break;
- }
- }
- length_ -= index_;
- struct t0 const __r5 = f__init0__0__f__3__f__4__19_508_5((struct t0){0}, length_);
- struct t0 const __r6 = result_;
- result_ = __r5;
- p__free0__0__f__4__19_293_5(__r6);
- memcpy(result_.items, tmpResult + index_, length_);
- p__setStringFlag0__0__t__4__19_2792_5(&result_);
- return result_;
- }
- }
- static __attribute__((always_inline)) uint8_t f__parse_item0__0__f__3__f__4__19_2777_5(struct t0 slice_, uint64_t index_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint8_t result_ = (uint8_t){0};
- uint8_t const __r0 = f__getItem0__0__f__3__f__4__19_407_5(slice_, index_);
- result_ = __r0;
- return result_;
- }
- }
- static __attribute__((always_inline)) uint8_t f__getItem0__0__f__3__f__4__19_407_5(struct t0 slice_, uint64_t index_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint8_t result_ = (uint8_t){0};
- {
- #if __FLAG_debug == 1
- uint64_t const __r0 = f__convertTo0__3__f__3__f__8__34_0_5(index_, (uint64_t){0});
- uint64_t const __r1 = f__getLength0__0__f__4__19_426_5(slice_);
- bool const __r2 = f__greaterOrEqual0__3__f__3__f__3__43_41_5(__r0, __r1);
- p__debugMessage0__2__f__0__f__4__24_0_5(__r2, (struct t0){.length = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 412. UB - the index is too large."), .capacity = strlen("File: /opt/cine/modules/standart/Slice.cine, line: 412. UB - the index is too large."), .array = (uint8_t*){0}, .items = (uint8_t*)"File: /opt/cine/modules/standart/Slice.cine, line: 412. UB - the index is too large.", .initCapacity = 0, .useCounter = (uint64_t*){0}, .isString = true});
- #endif
- }
- result_ = slice_.items[index_];
- p__use0__1__f__3__0_0_0(result_);
- return result_;
- }
- }
- static __attribute__((always_inline)) bool f__parse_haveItem2__0__f__3__f__4__19_2772_5(struct t0 slice_, uint64_t index_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- bool result_ = (bool){0};
- uint64_t const __r0 = f__getLength0__0__f__4__19_426_5(slice_);
- bool const __r1 = f__less0__3__f__3__f__3__43_47_5(index_, __r0);
- result_ = __r1;
- return result_;
- }
- }
- static __attribute__((always_inline)) uint64_t f__parse_next0__0__f__3__f__4__19_2787_5(struct t0 slice_, uint64_t index_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t result_ = (uint64_t){0};
- uint64_t const __r0 = f__add0__3__f__3__f__3__43_15_5(index_, (uint64_t)1ull);
- result_ = __r0;
- return result_;
- }
- }
- static __attribute__((always_inline)) uint64_t f__parse_first0__0__f__4__19_2767_5(struct t0 slice_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- uint64_t result_ = (uint64_t){0};
- result_ = (uint64_t)0ull;
- return result_;
- }
- }
- static __attribute__((always_inline)) void p__setFirst0__0__t__1__f__4__19_2826_5(struct t0* slice_, uint8_t newItem_) {
- {
- int __breakCounter = 0;
- int __continueCounter = 0;
- p__setItem0__0__t__3__f__1__f__4__19_2831_5(slice_, (uint64_t)0ull, newItem_);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement