diff --git a/include/bf_tokenizer.h b/include/bf_tokenizer.h index 603d4a2..e2c7b46 100644 --- a/include/bf_tokenizer.h +++ b/include/bf_tokenizer.h @@ -61,18 +61,15 @@ class tokenizer currentIndex++; } - inline optional_token next() { - if (currentIndex >= tokens.size()) - return {}; + inline const token_t& next() { return tokens[currentIndex++]; } - inline optional_token peek(){ - if (currentIndex >= tokens.size()) - return {}; + inline const token_t& peek(){ return tokens[currentIndex]; } + void print(); void print(size_t index = 0); }; diff --git a/mips.asm b/mips.asm index d3a2812..3cfa3fc 100644 --- a/mips.asm +++ b/mips.asm @@ -17,18 +17,29 @@ setup: move $t0, $v0 bf: lb $t1, ($t0) - bnez $t1, BF_OPEN_96064d4d39533ab4354b246d_18446744073709551615 -BF_CLOSE_96064d4d39533ab4354b246d_18446744073709551615: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 + addi $t1, $t1, 1 sb $t1, ($t0) - addi $t0, $t0, 1 lb $t1, ($t0) addi $t1, $t1, 1 sb $t1, ($t0) + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + beqz $t1, BF_CLOSE_1_0 +BF_OPEN_1_0: addi $t0, $t0, 1 lb $t1, ($t0) addi $t1, $t1, 1 @@ -43,6 +54,13 @@ BF_CLOSE_96064d4d39533ab4354b246d_18446744073709551615: addi $t1, $t1, 1 sb $t1, ($t0) lb $t1, ($t0) + beqz $t1, BF_CLOSE_2_1 +BF_OPEN_2_1: + addi $t0, $t0, 1 + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) addi $t1, $t1, 1 sb $t1, ($t0) addi $t0, $t0, 1 @@ -55,48 +73,6 @@ BF_CLOSE_96064d4d39533ab4354b246d_18446744073709551615: lb $t1, ($t0) addi $t1, $t1, 1 sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_c784f9e0e66032d6a470902e_18446744073709551615 -BF_OPEN_c784f9e0e66032d6a470902e_18446744073709551615: - lb $t1, ($t0) - beqz $t1, BF_CLOSE_f64b1668cb7210c15d0b1457_0 -BF_OPEN_f64b1668cb7210c15d0b1457_0: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_f64b1668cb7210c15d0b1457_0 -BF_CLOSE_f64b1668cb7210c15d0b1457_0: addi $t0, $t0, 1 lb $t1, ($t0) addi $t1, $t1, 1 @@ -107,69 +83,6 @@ BF_CLOSE_f64b1668cb7210c15d0b1457_0: lb $t1, ($t0) addi $t1, $t1, 1 sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_8462ffd64424855532cc34f1_0 -BF_OPEN_8462ffd64424855532cc34f1_0: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_8462ffd64424855532cc34f1_0 -BF_CLOSE_8462ffd64424855532cc34f1_0: - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_c784f9e0e66032d6a470902e_18446744073709551615 -BF_CLOSE_c784f9e0e66032d6a470902e_18446744073709551615: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_e3df4010adf86b95a5d7f832_18446744073709551615 -BF_OPEN_e3df4010adf86b95a5d7f832_18446744073709551615: - lb $t1, ($t0) - beqz $t1, BF_CLOSE_50a61cd4df3d91b17a24907d_0 -BF_OPEN_50a61cd4df3d91b17a24907d_0: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) addi $t0, $t0, 1 lb $t1, ($t0) addi $t1, $t1, 1 @@ -182,16 +95,19 @@ BF_OPEN_50a61cd4df3d91b17a24907d_0: subi $t1, $t1, 1 sb $t1, ($t0) lb $t1, ($t0) - bnez $t1, BF_OPEN_50a61cd4df3d91b17a24907d_0 -BF_CLOSE_50a61cd4df3d91b17a24907d_0: + bnez $t1, BF_OPEN_2_1 +BF_CLOSE_2_1: + addi $t0, $t0, 1 lb $t1, ($t0) addi $t1, $t1, 1 sb $t1, ($t0) + addi $t0, $t0, 1 lb $t1, ($t0) addi $t1, $t1, 1 sb $t1, ($t0) + addi $t0, $t0, 1 lb $t1, ($t0) - addi $t1, $t1, 1 + subi $t1, $t1, 1 sb $t1, ($t0) addi $t0, $t0, 1 addi $t0, $t0, 1 @@ -199,219 +115,92 @@ BF_CLOSE_50a61cd4df3d91b17a24907d_0: addi $t1, $t1, 1 sb $t1, ($t0) lb $t1, ($t0) - beqz $t1, BF_CLOSE_b07f54b520098276cd88af98_0 -BF_OPEN_b07f54b520098276cd88af98_0: + beqz $t1, BF_CLOSE_3_1 +BF_OPEN_3_1: subi $t0, $t0, 1 lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 + bnez $t1, BF_OPEN_3_1 +BF_CLOSE_3_1: subi $t0, $t0, 1 lb $t1, ($t0) subi $t1, $t1, 1 sb $t1, ($t0) lb $t1, ($t0) - bnez $t1, BF_OPEN_b07f54b520098276cd88af98_0 -BF_CLOSE_b07f54b520098276cd88af98_0: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_dca9da1ea4acae704471aa80_0 -BF_OPEN_dca9da1ea4acae704471aa80_0: - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_4ae6967bc19eb523a2c14321_1 -BF_OPEN_4ae6967bc19eb523a2c14321_1: - lb $t1, ($t0) - beqz $t1, BF_CLOSE_98ec6f07048f23263cdce2c8_2 -BF_OPEN_98ec6f07048f23263cdce2c8_2: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_98ec6f07048f23263cdce2c8_2 -BF_CLOSE_98ec6f07048f23263cdce2c8_2: - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_4ae6967bc19eb523a2c14321_1 -BF_CLOSE_4ae6967bc19eb523a2c14321_1: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 + bnez $t1, BF_OPEN_1_0 +BF_CLOSE_1_0: addi $t0, $t0, 1 addi $t0, $t0, 1 + li $v0, 11 + lb $a0, ($t0) + syscall addi $t0, $t0, 1 lb $t1, ($t0) subi $t1, $t1, 1 sb $t1, ($t0) lb $t1, ($t0) - bnez $t1, BF_OPEN_dca9da1ea4acae704471aa80_0 -BF_CLOSE_dca9da1ea4acae704471aa80_0: + subi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + subi $t1, $t1, 1 + sb $t1, ($t0) + li $v0, 11 + lb $a0, ($t0) + syscall + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + li $v0, 11 + lb $a0, ($t0) + syscall + li $v0, 11 + lb $a0, ($t0) + syscall + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + li $v0, 11 + lb $a0, ($t0) + syscall + addi $t0, $t0, 1 + addi $t0, $t0, 1 + li $v0, 11 + lb $a0, ($t0) + syscall subi $t0, $t0, 1 lb $t1, ($t0) subi $t1, $t1, 1 sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_e3df4010adf86b95a5d7f832_18446744073709551615 -BF_CLOSE_e3df4010adf86b95a5d7f832_18446744073709551615: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_a99a4987b2123d147965a06d_18446744073709551615 -BF_OPEN_a99a4987b2123d147965a06d_18446744073709551615: - lb $t1, ($t0) - beqz $t1, BF_CLOSE_91ac166c7af79f2188b21b68_0 -BF_OPEN_91ac166c7af79f2188b21b68_0: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_91ac166c7af79f2188b21b68_0 -BF_CLOSE_91ac166c7af79f2188b21b68_0: + li $v0, 11 + lb $a0, ($t0) + syscall subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_5d775cd53e5b4c902444d895_0 -BF_OPEN_5d775cd53e5b4c902444d895_0: - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_5d775cd53e5b4c902444d895_0 -BF_CLOSE_5d775cd53e5b4c902444d895_0: - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_a99a4987b2123d147965a06d_18446744073709551615 -BF_CLOSE_a99a4987b2123d147965a06d_18446744073709551615: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_8904e378099c118eaada9d20_18446744073709551615 -BF_OPEN_8904e378099c118eaada9d20_18446744073709551615: - lb $t1, ($t0) - beqz $t1, BF_CLOSE_f065c3935d683a06edc665a5_0 -BF_OPEN_f065c3935d683a06edc665a5_0: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) + li $v0, 11 + lb $a0, ($t0) + syscall lb $t1, ($t0) addi $t1, $t1, 1 sb $t1, ($t0) @@ -442,1110 +231,51 @@ BF_OPEN_f065c3935d683a06edc665a5_0: lb $t1, ($t0) subi $t1, $t1, 1 sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_f065c3935d683a06edc665a5_0 -BF_CLOSE_f065c3935d683a06edc665a5_0: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_7570984ef8d7a90e7f03b13f_0 -BF_OPEN_7570984ef8d7a90e7f03b13f_0: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_7570984ef8d7a90e7f03b13f_0 -BF_CLOSE_7570984ef8d7a90e7f03b13f_0: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_531828e37478203582292530_0 -BF_OPEN_531828e37478203582292530_0: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - li $v0, 12 - syscall - sb $v0, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_f72e0db35ea6b87eace3f72c_1 -BF_OPEN_f72e0db35ea6b87eace3f72c_1: - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_f72e0db35ea6b87eace3f72c_1 -BF_CLOSE_f72e0db35ea6b87eace3f72c_1: - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_531828e37478203582292530_0 -BF_CLOSE_531828e37478203582292530_0: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_cb0c9a316dc248b186a4adae_0 -BF_OPEN_cb0c9a316dc248b186a4adae_0: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_e623feb140f800ac96ba161a_1 -BF_OPEN_e623feb140f800ac96ba161a_1: - addi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_d07e99f0bd82568e08012ef4_2 -BF_OPEN_d07e99f0bd82568e08012ef4_2: - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_d07e99f0bd82568e08012ef4_2 -BF_CLOSE_d07e99f0bd82568e08012ef4_2: - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_1bf9422cdc40f10a97e0f880_2 -BF_OPEN_1bf9422cdc40f10a97e0f880_2: - lb $t1, ($t0) - beqz $t1, BF_CLOSE_975d5ba03e87133df76b2c40_3 -BF_OPEN_975d5ba03e87133df76b2c40_3: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_975d5ba03e87133df76b2c40_3 -BF_CLOSE_975d5ba03e87133df76b2c40_3: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_8a6a72606e5a13e632b3167d_3 -BF_OPEN_8a6a72606e5a13e632b3167d_3: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_8a6a72606e5a13e632b3167d_3 -BF_CLOSE_8a6a72606e5a13e632b3167d_3: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_0c3087c2aa3431be4dc9a291_3 -BF_OPEN_0c3087c2aa3431be4dc9a291_3: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_0c3087c2aa3431be4dc9a291_3 -BF_CLOSE_0c3087c2aa3431be4dc9a291_3: - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_1bf9422cdc40f10a97e0f880_2 -BF_CLOSE_1bf9422cdc40f10a97e0f880_2: - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_be970c344518b4838113bd2d_2 -BF_OPEN_be970c344518b4838113bd2d_2: - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_be970c344518b4838113bd2d_2 -BF_CLOSE_be970c344518b4838113bd2d_2: - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_7cbd3778a4fe3d96db5f6d3a_2 -BF_OPEN_7cbd3778a4fe3d96db5f6d3a_2: - lb $t1, ($t0) - beqz $t1, BF_CLOSE_f38a9ce1b14bc63a0a34773c_3 -BF_OPEN_f38a9ce1b14bc63a0a34773c_3: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_f38a9ce1b14bc63a0a34773c_3 -BF_CLOSE_f38a9ce1b14bc63a0a34773c_3: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_7be1608ffa465e1f95c12d60_3 -BF_OPEN_7be1608ffa465e1f95c12d60_3: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_7be1608ffa465e1f95c12d60_3 -BF_CLOSE_7be1608ffa465e1f95c12d60_3: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_7cbd3778a4fe3d96db5f6d3a_2 -BF_CLOSE_7cbd3778a4fe3d96db5f6d3a_2: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_ad1be31d8a35acb798d5dfa7_2 -BF_OPEN_ad1be31d8a35acb798d5dfa7_2: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_ad1be31d8a35acb798d5dfa7_2 -BF_CLOSE_ad1be31d8a35acb798d5dfa7_2: - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_e93d806bda9f89a1b197a59b_2 -BF_OPEN_e93d806bda9f89a1b197a59b_2: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_e93d806bda9f89a1b197a59b_2 -BF_CLOSE_e93d806bda9f89a1b197a59b_2: - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_78ce53a7f6938be98f0d8560_2 -BF_OPEN_78ce53a7f6938be98f0d8560_2: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_78ce53a7f6938be98f0d8560_2 -BF_CLOSE_78ce53a7f6938be98f0d8560_2: - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_b8376336a3ad61ed4978a5ab_2 -BF_OPEN_b8376336a3ad61ed4978a5ab_2: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_b8376336a3ad61ed4978a5ab_2 -BF_CLOSE_b8376336a3ad61ed4978a5ab_2: - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_e623feb140f800ac96ba161a_1 -BF_CLOSE_e623feb140f800ac96ba161a_1: - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_cb0c9a316dc248b186a4adae_0 -BF_CLOSE_cb0c9a316dc248b186a4adae_0: - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_5439ab2c390f42ded5ac5f4f_0 -BF_OPEN_5439ab2c390f42ded5ac5f4f_0: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_da5ba2adeda491e6629f8a93_1 -BF_OPEN_da5ba2adeda491e6629f8a93_1: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_da5ba2adeda491e6629f8a93_1 -BF_CLOSE_da5ba2adeda491e6629f8a93_1: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_80ef2aaac180da7c327abffb_1 -BF_OPEN_80ef2aaac180da7c327abffb_1: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_80ef2aaac180da7c327abffb_1 -BF_CLOSE_80ef2aaac180da7c327abffb_1: - addi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_18cfb026bec2bcd241bf48c4_1 -BF_OPEN_18cfb026bec2bcd241bf48c4_1: - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_9d179819dec02705f74440a0_2 -BF_OPEN_9d179819dec02705f74440a0_2: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_4aa624582085011b305d0b3c_3 -BF_OPEN_4aa624582085011b305d0b3c_3: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_4aa624582085011b305d0b3c_3 -BF_CLOSE_4aa624582085011b305d0b3c_3: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_3f07173ee69d11dfa935564f_3 -BF_OPEN_3f07173ee69d11dfa935564f_3: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_3f07173ee69d11dfa935564f_3 -BF_CLOSE_3f07173ee69d11dfa935564f_3: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_9d179819dec02705f74440a0_2 -BF_CLOSE_9d179819dec02705f74440a0_2: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_f8a3eac35aa203228d3178f8_2 -BF_OPEN_f8a3eac35aa203228d3178f8_2: - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_872c3d3cc0f122187958ad17_3 -BF_OPEN_872c3d3cc0f122187958ad17_3: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_872c3d3cc0f122187958ad17_3 -BF_CLOSE_872c3d3cc0f122187958ad17_3: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_f8a3eac35aa203228d3178f8_2 -BF_CLOSE_f8a3eac35aa203228d3178f8_2: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_6bb3722eb74b171c40257cf6_2 -BF_OPEN_6bb3722eb74b171c40257cf6_2: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_aeffc6fa0e67c47de3a253ad_3 -BF_OPEN_aeffc6fa0e67c47de3a253ad_3: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_aeffc6fa0e67c47de3a253ad_3 -BF_CLOSE_aeffc6fa0e67c47de3a253ad_3: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_6bb3722eb74b171c40257cf6_2 -BF_CLOSE_6bb3722eb74b171c40257cf6_2: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_5719767dec4a57f57a316bc3_2 -BF_OPEN_5719767dec4a57f57a316bc3_2: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_5719767dec4a57f57a316bc3_2 -BF_CLOSE_5719767dec4a57f57a316bc3_2: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_18cfb026bec2bcd241bf48c4_1 -BF_CLOSE_18cfb026bec2bcd241bf48c4_1: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_d9760b6e0a7ba5884fee5563_1 -BF_OPEN_d9760b6e0a7ba5884fee5563_1: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_d9760b6e0a7ba5884fee5563_1 -BF_CLOSE_d9760b6e0a7ba5884fee5563_1: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_8ad801bae2eef812a0509157_1 -BF_OPEN_8ad801bae2eef812a0509157_1: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_766145529b58e9db8b3d42f7_2 -BF_OPEN_766145529b58e9db8b3d42f7_2: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_7faee864e036fe56417555e9_3 -BF_OPEN_7faee864e036fe56417555e9_3: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_7faee864e036fe56417555e9_3 -BF_CLOSE_7faee864e036fe56417555e9_3: - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_b14d8551e06340f17142a494_3 -BF_OPEN_b14d8551e06340f17142a494_3: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_1be265021f521d5c146ea977_4 -BF_OPEN_1be265021f521d5c146ea977_4: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_1be265021f521d5c146ea977_4 -BF_CLOSE_1be265021f521d5c146ea977_4: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_f3c8804f0e689aa4bb23cbca_4 -BF_OPEN_f3c8804f0e689aa4bb23cbca_4: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_f3c8804f0e689aa4bb23cbca_4 -BF_CLOSE_f3c8804f0e689aa4bb23cbca_4: - addi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_b14d8551e06340f17142a494_3 -BF_CLOSE_b14d8551e06340f17142a494_3: - lb $t1, ($t0) - bnez $t1, BF_OPEN_766145529b58e9db8b3d42f7_2 -BF_CLOSE_766145529b58e9db8b3d42f7_2: - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_8d29329e22b64c37659b1b54_2 -BF_OPEN_8d29329e22b64c37659b1b54_2: - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_95832243201b1bc80b79045a_3 -BF_OPEN_95832243201b1bc80b79045a_3: - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_df68fc38dc638e4a873ef4a6_4 -BF_OPEN_df68fc38dc638e4a873ef4a6_4: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_df68fc38dc638e4a873ef4a6_4 -BF_CLOSE_df68fc38dc638e4a873ef4a6_4: - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_02c1c83d59f1cfbfc19536ca_4 -BF_OPEN_02c1c83d59f1cfbfc19536ca_4: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_02c1c83d59f1cfbfc19536ca_4 -BF_CLOSE_02c1c83d59f1cfbfc19536ca_4: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_95832243201b1bc80b79045a_3 -BF_CLOSE_95832243201b1bc80b79045a_3: - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_12c36532b1d325cdb96755d9_3 -BF_OPEN_12c36532b1d325cdb96755d9_3: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_12c36532b1d325cdb96755d9_3 -BF_CLOSE_12c36532b1d325cdb96755d9_3: - lb $t1, ($t0) - bnez $t1, BF_OPEN_8d29329e22b64c37659b1b54_2 -BF_CLOSE_8d29329e22b64c37659b1b54_2: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_d2207095634f8d1fb54c89dd_2 -BF_OPEN_d2207095634f8d1fb54c89dd_2: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_d2207095634f8d1fb54c89dd_2 -BF_CLOSE_d2207095634f8d1fb54c89dd_2: - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_8ad801bae2eef812a0509157_1 -BF_CLOSE_8ad801bae2eef812a0509157_1: - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_4139bfa964c1b2231e8d8f9f_1 -BF_OPEN_4139bfa964c1b2231e8d8f9f_1: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_18d36c80401374ce4a1be20b_2 -BF_OPEN_18d36c80401374ce4a1be20b_2: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_18d36c80401374ce4a1be20b_2 -BF_CLOSE_18d36c80401374ce4a1be20b_2: - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_4139bfa964c1b2231e8d8f9f_1 -BF_CLOSE_4139bfa964c1b2231e8d8f9f_1: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_6691ea42e52a89fc748855be_1 -BF_OPEN_6691ea42e52a89fc748855be_1: - lb $t1, ($t0) - beqz $t1, BF_CLOSE_473e764bd573f6eb7d2d55aa_2 -BF_OPEN_473e764bd573f6eb7d2d55aa_2: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_473e764bd573f6eb7d2d55aa_2 -BF_CLOSE_473e764bd573f6eb7d2d55aa_2: - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_2ea438a263a3c9b9eb33eab0_2 -BF_OPEN_2ea438a263a3c9b9eb33eab0_2: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_0008687cfd7857c51bf44eba_3 -BF_OPEN_0008687cfd7857c51bf44eba_3: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_0008687cfd7857c51bf44eba_3 -BF_CLOSE_0008687cfd7857c51bf44eba_3: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_6d027c3712fa430372b97547_3 -BF_OPEN_6d027c3712fa430372b97547_3: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_6d027c3712fa430372b97547_3 -BF_CLOSE_6d027c3712fa430372b97547_3: - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_2ea438a263a3c9b9eb33eab0_2 -BF_CLOSE_2ea438a263a3c9b9eb33eab0_2: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_4c1ef806ba420be0efb9a923_2 -BF_OPEN_4c1ef806ba420be0efb9a923_2: - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_9fdf192325e5783cc41b5114_3 -BF_OPEN_9fdf192325e5783cc41b5114_3: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_9fdf192325e5783cc41b5114_3 -BF_CLOSE_9fdf192325e5783cc41b5114_3: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_e8df779bf54411ddcedd73e9_3 -BF_OPEN_e8df779bf54411ddcedd73e9_3: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_e8df779bf54411ddcedd73e9_3 -BF_CLOSE_e8df779bf54411ddcedd73e9_3: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_4c1ef806ba420be0efb9a923_2 -BF_CLOSE_4c1ef806ba420be0efb9a923_2: - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_6691ea42e52a89fc748855be_1 -BF_CLOSE_6691ea42e52a89fc748855be_1: - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - subi $t0, $t0, 1 - lb $t1, ($t0) - beqz $t1, BF_CLOSE_fec1fd3ab7ab016a1552e024_1 -BF_OPEN_fec1fd3ab7ab016a1552e024_1: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_afba6ad72f92428f34a02d45_2 -BF_OPEN_afba6ad72f92428f34a02d45_2: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_c9a39424c26f09d483798f17_3 -BF_OPEN_c9a39424c26f09d483798f17_3: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_c117020f39526c2cf7be5e43_4 -BF_OPEN_c117020f39526c2cf7be5e43_4: - subi $t0, $t0, 1 - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - beqz $t1, BF_CLOSE_a1bbf73d7f4f1f1b324e4d9c_5 -BF_OPEN_a1bbf73d7f4f1f1b324e4d9c_5: - lb $t1, ($t0) - subi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_a1bbf73d7f4f1f1b324e4d9c_5 -BF_CLOSE_a1bbf73d7f4f1f1b324e4d9c_5: - lb $t1, ($t0) - bnez $t1, BF_OPEN_c117020f39526c2cf7be5e43_4 -BF_CLOSE_c117020f39526c2cf7be5e43_4: - lb $t1, ($t0) - bnez $t1, BF_OPEN_c9a39424c26f09d483798f17_3 -BF_CLOSE_c9a39424c26f09d483798f17_3: - lb $t1, ($t0) - bnez $t1, BF_OPEN_afba6ad72f92428f34a02d45_2 -BF_CLOSE_afba6ad72f92428f34a02d45_2: - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - subi $t0, $t0, 1 - lb $t1, ($t0) - addi $t1, $t1, 1 - sb $t1, ($t0) - lb $t1, ($t0) - bnez $t1, BF_OPEN_fec1fd3ab7ab016a1552e024_1 -BF_CLOSE_fec1fd3ab7ab016a1552e024_1: - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_5439ab2c390f42ded5ac5f4f_0 -BF_CLOSE_5439ab2c390f42ded5ac5f4f_0: - addi $t0, $t0, 1 - addi $t0, $t0, 1 - lb $t1, ($t0) - bnez $t1, BF_OPEN_8904e378099c118eaada9d20_18446744073709551615 -BF_CLOSE_8904e378099c118eaada9d20_18446744073709551615: - lb $t1, ($t0) - beqz $t1, BF_CLOSE_6318c250706a551487b6e1de_18446744073709551615 -BF_OPEN_6318c250706a551487b6e1de_18446744073709551615: - li $v0, 11 - lb $a0, ($t0) - syscall - li $v0, 11 - lb $a0, ($t0) - syscall - li $v0, 11 - lb $a0, ($t0) - syscall - li $v0, 11 - lb $a0, ($t0) - syscall - li $v0, 12 - syscall - sb $v0, ($t0) - li $v0, 11 - lb $a0, ($t0) - syscall - li $v0, 11 - lb $a0, ($t0) - syscall - li $v0, 11 - lb $a0, ($t0) - syscall - li $v0, 12 - syscall - sb $v0, ($t0) - li $v0, 12 - syscall - sb $v0, ($t0) - li $v0, 11 - lb $a0, ($t0) - syscall li $v0, 11 lb $a0, ($t0) syscall lb $t1, ($t0) subi $t1, $t1, 1 sb $t1, ($t0) - li $v0, 11 - lb $a0, ($t0) - syscall + lb $t1, ($t0) + subi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + subi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + subi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + subi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + subi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + subi $t1, $t1, 1 + sb $t1, ($t0) lb $t1, ($t0) subi $t1, $t1, 1 sb $t1, ($t0) li $v0, 11 lb $a0, ($t0) syscall - li $v0, 11 - lb $a0, ($t0) - syscall + addi $t0, $t0, 1 + addi $t0, $t0, 1 lb $t1, ($t0) - subi $t1, $t1, 1 + addi $t1, $t1, 1 sb $t1, ($t0) li $v0, 11 lb $a0, ($t0) syscall + addi $t0, $t0, 1 + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) + lb $t1, ($t0) + addi $t1, $t1, 1 + sb $t1, ($t0) li $v0, 11 lb $a0, ($t0) syscall - lb $t1, ($t0) - bnez $t1, BF_OPEN_6318c250706a551487b6e1de_18446744073709551615 -BF_CLOSE_6318c250706a551487b6e1de_18446744073709551615: diff --git a/src/bf_mips_codegen.cpp b/src/bf_mips_codegen.cpp index 60a8932..4a664e8 100644 --- a/src/bf_mips_codegen.cpp +++ b/src/bf_mips_codegen.cpp @@ -31,17 +31,18 @@ void codegen(tokenizer& tokenizer, std::ostream& out) { out << preamble; size_t index = 0; + if (!tokenizer.hasNext()) + throw std::runtime_error("You failed to provide valid BF code"); // skip past comments - if (tokenizer.next().value().get().token == bf_token::OPEN) - while (tokens[index].token != bf_token::CLOSE) - index++; + if (tokenizer.next().token == bf_token::OPEN) + while (tokenizer.hasNext() && tokenizer.next().token != bf_token::CLOSE); tokenizer.print(index); size_t sp = 0; - while (index < tokens.size()) + while (tokenizer.hasNext()) { - auto& token = tokens[index++]; + auto& token = tokenizer.next(); uint64_t name = 0; if (token.name.has_value()) name = token.name.value(); diff --git a/src/bf_tokenizer.cpp b/src/bf_tokenizer.cpp index eac0ddc..64aeddc 100644 --- a/src/bf_tokenizer.cpp +++ b/src/bf_tokenizer.cpp @@ -96,7 +96,7 @@ inline void tabulate(signed long long v) void tokenizer::print(size_t index) { - signed long long sp = 1; + signed long long sp = 0; while (index < tokens.size()) { auto& token = tokens[index++]; @@ -147,3 +147,8 @@ void tokenizer::print(size_t index) } } } + +void tokenizer::print() +{ + print(currentIndex); +} diff --git a/src/main.cpp b/src/main.cpp index 5aa1fcc..da12b99 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,10 +5,11 @@ #include #include +#include int main(int argc, const char** argv) { - std::string file{"../life.bf"}; + std::string file{"../helloworld.bf"}; if (argc > 1) file = argv[1]; auto program = blt::fs::loadBrainFuckFile(file); @@ -18,5 +19,7 @@ int main(int argc, const char** argv) tokenizer tokenizer(program); codegen(tokenizer, out); + //interpret_bf(program); + return 0; } \ No newline at end of file