#include "registers.h"
#include <bits/stdc++.h>
using namespace std;
void compare(int al, int ar, int bl, int br) {
vector<bool> anding(2000, false);
for (int i = al; i < ar; ++i) {
anding[i] = true;
}
append_store(1, anding);
for (int i = al; i < ar; ++i) {
anding[i] = false;
}
for (int i = b;; i < br; ++i) {
anding[i] = true;
}
append_store(2, anding);
append_and(1, 0, 1);
append_and(2, 0, 2);
append_not(3, 1);
append_add(3, 2, 3);
append_not(4, 2);
append_add(4, 1, 4);
append_left(3, 3, 1000);
append_left(4, 4, 1000);
append_and(3, 1, 3);
append_and(4, 2, 4);
}
void construct_instructions(int s, int n, int k, int q) {
vector<bool> anding(2000, false);
if (s == 0) {
compare(0, k, k, k * 2);
append_left(4, 4, k-1);
append_move(0, 4);
append_move(0, 3);
} else {
}
}
Compilation message
registers.cpp: In function 'void compare(int, int, int, int)':
registers.cpp:14:15: error: 'b' was not declared in this scope
14 | for (int i = b;; i < br; ++i) {
| ^
registers.cpp:14:21: warning: for increment expression has no effect [-Wunused-value]
14 | for (int i = b;; i < br; ++i) {
| ~~^~~~
registers.cpp:14:25: error: expected ')' before ';' token
14 | for (int i = b;; i < br; ++i) {
| ~ ^
| )
registers.cpp:14:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
14 | for (int i = b;; i < br; ++i) {
| ^~~
registers.cpp:14:27: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
14 | for (int i = b;; i < br; ++i) {
| ^~
registers.cpp:14:29: error: 'i' was not declared in this scope
14 | for (int i = b;; i < br; ++i) {
| ^