Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ARDrone ESC motor pseudocode (with r2dec decompiler, pdd command)
#include <stdint.h>
#include <limits.h>
#define DISABLE_INTERRUPTS __asm(cli)
#define ENABLE_INTERRUPTS __asm(sei)
#define MEM_X ((uint16_t*)((r27 << 8) | r26))
#define MEM_Y ((uint16_t*)((r29 << 8) | r28))
#define MEM_Z ((uint16_t*)((r31 << 8) | r30))
#define READ_FROM_IO(x,y) __asm(in (y), (x))
#define WRITE_TO_IO(x,y) __asm(in (x), (y))
uint8_t rotate_left8 (uint8_t value, uint32_t count) {
const uint8_t mask = (CHAR_BIT * sizeof (value)) - 1;
count &= mask;
return (value << count) | (value >> (-count & mask));
}
uint8_t rotate_right8 (uint8_t value, uint32_t count) {
const uint8_t mask = (CHAR_BIT * sizeof (value)) - 1;
count &= mask;
return (value >> count) | (value << (-count & mask));
}
uint8_t fcn_000019e8 () {
uint16_t value1 = r22 * r18;
r0 = (value1 & 0xFF);
r1 = (value1 >> 8);
r26 = r0;
r27 = r1;
uint16_t value2 = r23 * r19;
r0 = (value2 & 0xFF);
r1 = (value2 >> 8);
r30 = r0;
r31 = r1;
uint16_t value3 = r24 * r18;
r0 = (value3 & 0xFF);
r1 = (value3 >> 8);
r30 += r0;
r31 += r1;
uint16_t value4 = r22 * r20;
r0 = (value4 & 0xFF);
r1 = (value4 >> 8);
r30 += r0;
r31 += r1;
uint16_t value5 = r25 * r18;
r0 = (value5 & 0xFF);
r1 = (value5 >> 8);
r31 += r0;
uint16_t value6 = r24 * r19;
r0 = (value6 & 0xFF);
r1 = (value6 >> 8);
r31 += r0;
uint16_t value7 = r23 * r20;
r0 = (value7 & 0xFF);
r1 = (value7 >> 8);
r31 += r0;
uint16_t value8 = r22 * r21;
r0 = (value8 & 0xFF);
r1 = (value8 >> 8);
r31 += r0;
r25 = 0;
uint16_t value9 = r23 * r18;
r0 = (value9 & 0xFF);
r1 = (value9 >> 8);
r27 += r0;
r30 += r1;
r31 += r25;
uint16_t value10 = r22 * r19;
r0 = (value10 & 0xFF);
r1 = (value10 >> 8);
r27 += r0;
r30 += r1;
r31 += r25;
r22 = r26;
r23 = r27;
r24 = r30;
r25 = r31;
r1 = 0;
return r0;
}
uint8_t fcn_0000005e () {
READ_FROM_IO (0x3d, r28);
READ_FROM_IO (0x3e, r29);
r28 -= 0x08;
r29 -= 0x08;
READ_FROM_IO (0x3f, r0);
DISABLE_INTERRUPTS;
WRITE_TO_IO (0x3e, r29);
WRITE_TO_IO (0x3f, r0);
WRITE_TO_IO (0x3d, r28);
r24 = *(fcn.0000023a);
r18 = r24;
r19 = 0x00;
r20 = 0x00;
r21 = 0x00;
*(MEM_Y + 1) = r18;
*(MEM_Y + 2) = r19;
*(MEM_Y + 3) = r20;
*(MEM_Y + 4) = r21;
r18 = *(0x23b);
r19 = 0x00;
r24 = *(vector.timer2ovf);
r25 = *(0x239);
uint16_t value1 = r18 * r24;
r0 = (value1 & 0xFF);
r1 = (value1 >> 8);
r20 = r0;
r21 = r1;
uint16_t value2 = r18 * r25;
r0 = (value2 & 0xFF);
r1 = (value2 >> 8);
r21 += r0;
uint16_t value3 = r19 * r24;
r0 = (value3 & 0xFF);
r1 = (value3 >> 8);
r21 += r0;
r1 = 0;
r24 = r20;
r25 = r21;
r26 = 0x00;
r27 = 0x00;
*(MEM_Y + 5) = r24;
*(MEM_Y + 6) = r25;
*(MEM_Y + 7) = r26;
*(MEM_Y + 8) = r27;
r22 = *(MEM_Y + 1);
r23 = *(MEM_Y + 2);
r24 = *(MEM_Y + 3);
r25 = *(MEM_Y + 4);
r18 = 0xc0;
r19 = 0xb8;
r20 = 0xa5;
r21 = 0x1d;
(*(void(*)()) 0xfffff9e8) ();
r18 = *(MEM_Y + 5);
r19 = *(MEM_Y + 6);
r20 = *(MEM_Y + 7);
r21 = *(MEM_Y + 8);
(*(void(*)()) 0xfffffa4e) ();
*(0x26b) = r18;
*(0x26c) = r19;
*(0x26d) = r20;
*(0x00000080) = r21;
r24 = r20;
r25 = r21;
r22 = r18;
r23 = r19;
r18 = 0x00;
r19 = 0x18;
r20 = 0x00;
r21 = 0x00;
(*(void(*)()) 0xfffffa4e) ();
*(0x22b) = r18;
*(0x22c) = r19;
*(0x22d) = r20;
*(0x22e) = r21;
r18 = *(0x25c);
r19 = *(0x25d);
r20 = 0x00;
r21 = 0x00;
r22 = *(MEM_Y + 1);
r23 = *(MEM_Y + 2);
r24 = *(MEM_Y + 3);
r25 = *(MEM_Y + 4);
(*(void(*)()) 0xfffff9e8) ();
r18 = 0xc3;
r19 = 0x43;
r20 = 0x00;
r21 = 0x00;
(*(void(*)()) 0xfffff9e8) ();
r18 = *(MEM_Y + 5);
r19 = *(MEM_Y + 6);
r20 = *(MEM_Y + 7);
r21 = *(MEM_Y + 8);
(*(void(*)()) 0xfffffa4e) ();
*(0x26f) = r18;
*(0x270) = r19;
*(0x271) = r20;
*(0x272) = r21;
r24 = 0xff;
*(0x1a2) = r24;
r24 = 0x01;
*(0x1a3) = r24;
r28 += 0x08;
r29 += 0x08;
READ_FROM_IO (0x3f, r0);
DISABLE_INTERRUPTS;
WRITE_TO_IO (0x3e, r29);
WRITE_TO_IO (0x3f, r0);
WRITE_TO_IO (0x3d, r28);
return r0;
}
void fcn_000002ae () {
WRITE_TO_IO (0x08, r1);
return;
}
void fcn_0000027a () {
READ_FROM_IO (0x38, r24);
r24 |= 0x40;
WRITE_TO_IO (0x38, r24);
READ_FROM_IO (0x39, r24);
r24 &= 0xbf;
WRITE_TO_IO (0x39, r24);
return;
}
void fcn_0000048e () {
READ_FROM_IO (0x39, r24);
r24 &= 0xe3;
WRITE_TO_IO (0x39, r24);
WRITE_TO_IO (0x2f, r1);
WRITE_TO_IO (0x2e, r1);
WRITE_TO_IO (0x18, r1);
WRITE_TO_IO (0x12, r1);
WRITE_TO_IO (0x11, r1);
r24 = 0x01;
*(0x22f) = r24;
r3 = 0;
r4 = 0;
r8 = 0;
r5 = 0;
return;
}
void fcn_00000e2e () {
r20 = *(0x220);
r21 = *(0x221);
*(0x21f) = r21;
*(0x21e) = r20;
r18 = r20;
r19 = r21;
r18 <<= 1;
r19 = rotate_left8 (r19, 1);
r18 += r20;
r19 += r21;
r24 = r18;
r25 = r19;
r24 <<= 1;
r25 = rotate_left8 (r25, 1);
r24 <<= 1;
r25 = rotate_left8 (r25, 1);
r24 += r18;
r25 += r19;
r18 = *(0x1a8);
r19 = *(0x1a9);
r24 += r18;
r25 += r19;
__asm (swap r25);
__asm (swap r24);
r24 &= 0x0f;
r24 ^= r25;
r25 &= 0x0f;
r24 ^= r25;
*(0x221) = r25;
*(0x220) = r24;
if ((r20 | (r21 << 8)) >= (r24 | (r25 << 8))) {
r20 -= r24;
r21 -= r25;
*(0x227) = r21;
*(0x226) = r20;
return;
}
r24 -= r20;
r25 -= r21;
*(0x227) = r25;
*(0x226) = r24;
return;
}
uint8_t fcn_000019ca () {
int16_t value1 = r21 * r19;
r0 = (value1 & 0xFF);
r1 = (value1 >> 8);
r24 = r0;
r25 = r1;
uint16_t value2 = r20 * r18;
r0 = (value2 & 0xFF);
r1 = (value2 >> 8);
r22 = r0;
r23 = r1;
uint16_t value3 = r21 * r18;
r0 = (value3 & 0xFF);
r1 = (value3 >> 8);
r23 += r0;
r24 += r1;
r1 = 0;
r25 += r1;
uint16_t value4 = r19 * r20;
r0 = (value4 & 0xFF);
r1 = (value4 >> 8);
r23 += r0;
r24 += r1;
r1 = 0;
r25 += r1;
return r0;
}
void fcn_00000476 () {
r3 = 0;
READ_FROM_IO (0x30, r24);
r24 |= 0x04;
WRITE_TO_IO (0x30, r24);
r24 = 0x38;
WRITE_TO_IO (0x14, r24);
__asm (cbi 0x15, 3);
__asm (sbi 0x15, 4);
__asm (sbi 0x15, 5);
r24 = 0x01;
(*(void(*)()) fcn_000002b2) ();
return;
}
void fcn_00000288 () {
r24 = 0x02;
WRITE_TO_IO (0x0b, r24);
WRITE_TO_IO (0x20, r1);
r24 = 0x08;
WRITE_TO_IO (0x09, r24);
r24 = 0xd8;
WRITE_TO_IO (0x0a, r24);
return;
}
void fcn_00000224 () {
r24 = 0x04;
WRITE_TO_IO (0x33, r24);
r24 = 0x64;
WRITE_TO_IO (0x32, r24);
READ_FROM_IO (0x39, r24);
r24 &= 0xfe;
WRITE_TO_IO (0x39, r24);
READ_FROM_IO (0x38, r24);
r24 |= 0x01;
WRITE_TO_IO (0x38, r24);
return;
}
void fcn_00000946 () {
r24 = *(0x1fc);
if (r24 == 0) {
r24 = *(0x197);
r25 = *(0x198);
r24--;
r25--;
*(0x198) = r25;
*(0x197) = r24;
if ((r24 | (r25 << 8)) == 0) {
__asm (sbi 0x15, 4);
__asm (cbi 0x15, 5);
READ_FROM_IO (0x0a, r24);
r24 &= 0x3f;
WRITE_TO_IO (0x0a, r24);
r24 = *(0x1f9);
if (r24 != 0x02) {
*(0x1f9) = r1;
}
*(0x1d2) = r1;
*(0x1d1) = r1;
READ_FROM_IO (0x0a, r24);
r24 |= 0xc0;
WRITE_TO_IO (0x0a, r24);
*(0x1a9) = r1;
*(0x1a8) = r1;
return;
r24 = *(0x230);
if (r24 >= 0x03) {
r24 = 0x58;
r25 = 0x02;
*(0x198) = r25;
*(0x197) = r24;
label_0:
READ_FROM_IO (0x0a, r24);
r24 &= 0x3f;
WRITE_TO_IO (0x0a, r24);
r24 = *(0x1fa);
r25 = *(0x1fb);
*(0x1a9) = r25;
*(0x1a8) = r24;
READ_FROM_IO (0x0a, r24);
r24 |= 0xc0;
WRITE_TO_IO (0x0a, r24);
(*(void(*)()) fcn_00000e2e) ();
*(0x1fc) = r1;
return;
}
}
}
r24 = 0x1e;
r25 = 0x00;
*(0x198) = r25;
*(0x197) = r24;
goto label_0;
}
void fcn_0000023a () {
r24 = 0xfa;
WRITE_TO_IO (0x24, r24);
*(0x1a0) = r1;
r24 = 0x07;
WRITE_TO_IO (0x25, r24);
WRITE_TO_IO (0x22, r1);
READ_FROM_IO (0x38, r24);
r24 |= 0x40;
WRITE_TO_IO (0x38, r24);
READ_FROM_IO (0x39, r24);
r24 |= 0x40;
WRITE_TO_IO (0x39, r24);
return;
}
void fcn_00000298 () {
READ_FROM_IO (0x30, r24);
r24 |= 0x08;
WRITE_TO_IO (0x30, r24);
r24 = 0x03;
WRITE_TO_IO (0x08, r24);
READ_FROM_IO (0x08, r24);
r24 |= 0x18;
WRITE_TO_IO (0x08, r24);
r24 = 0x02;
WRITE_TO_IO (0x07, r24);
return;
}
void fcn_00000256 () {
r24 = 0x01;
*(0x1a0) = r24;
READ_FROM_IO (0x39, r24);
r24 &= 0xbf;
WRITE_TO_IO (0x39, r24);
r24 = 0x06;
WRITE_TO_IO (0x25, r24);
r24 = 0xff;
WRITE_TO_IO (0x24, r24);
WRITE_TO_IO (0x22, r1);
READ_FROM_IO (0x38, r24);
r24 |= 0x40;
WRITE_TO_IO (0x38, r24);
READ_FROM_IO (0x39, r24);
r24 |= 0x40;
WRITE_TO_IO (0x39, r24);
return;
}
void fcn_00000da2 () {
*(0x209) = r1;
*(0x00000080) = r1;
*(0x20b) = r1;
*(0x20c) = r1;
r24 = 0x20;
*(0x20d) = r24;
*(0x20e) = r1;
*(0x20f) = r1;
*(0x00000080) = r1;
*(0x211) = r1;
*(0x212) = r1;
*(vector.int0) = r1;
*(0x214) = r1;
*(0x215) = r1;
r24 = *(vector.int1);
r25 = *(0x1a7);
r26 = 0x00;
r27 = 0x00;
*(0x216) = r24;
*(0x217) = r25;
*(0x218) = r26;
*(0x219) = r27;
*(0x00000080) = r24;
*(0x21b) = r25;
*(0x21c) = r26;
*(0x21d) = r27;
*(0x21f) = r1;
*(0x21e) = r1;
*(0x221) = r1;
*(0x220) = r1;
r24 = 0xc8;
r25 = 0x00;
*(0x223) = r25;
*(0x222) = r24;
r24 = 0xff;
r25 = 0x01;
*(0x225) = r25;
*(fcn.00000224) = r24;
return;
}
void fcn_000008b0 () {
DISABLE_INTERRUPTS;
r8 = *(0x1ca);
r30 = r24;
r31 = 0x00;
r30 -= 0x3c;
r31 -= 0xfe;
r4 = *(MEM_Z);
ENABLE_INTERRUPTS;
r24 = 0xfe;
do {
} while (r24 == 0x01);
return;
}
void fcn_00001ab6 () {
do {
return;
} while (1);
__asm (brtc 0x1ab4);
r25 = 0xff - r25;
r24 = 0xff - r24;
r23 = 0xff - r23;
r22 = -r22;
r23 -= 0xff;
r24 -= 0xff;
r25 -= 0xff;
return;
}
void fcn_00001aa6 () {
r21 = 0xff - r21;
r20 = 0xff - r20;
r19 = 0xff - r19;
r18 = -r18;
r19 -= 0xff;
r20 -= 0xff;
r21 -= 0xff;
return;
}
void fcn_00001f30 () {
r27 = 0;
r26 = 0;
do {
r27++;
do {
r26++;
} while (r26 == 0);
} while (r27 == 0xa0);
return;
}
void fcn_00001f26 () {
__asm (spm);
}
void fcn_00001f00 () {
r30 += 0x20;
r31 += 0x20;
r30 += 0x20;
r31 += 0x20;
if (r31 == 0x1e) {
if (r30 == 0x00) {
r16 = 0x01;
return;
}
}
r16 = 0x00;
return;
}
uint8_t fcn_00001598 () {
(*(void(*)()) 0x159e) ();
(*(void(*)()) 0x15a0) ();
READ_FROM_IO (0x3d, r28);
READ_FROM_IO (0x3e, r29);
(*(void(*)()) 0x2476) ();
(*(void(*)()) 0x2162) ();
(*(void(*)()) 0x2288) ();
(*(void(*)()) 0x2224) ();
ENABLE_INTERRUPTS;
r24 = 0x01;
*(0x230) = r24;
r10 = 0;
r11 = 0;
r6 = 0;
r7 = 0;
r14 = 0;
r15 = 0;
*(MEM_Y + 2) = r1;
*(MEM_Y + 1) = r1;
r21 = 0x30;
r13 = r21;
r22 = 0x04;
r12 = r22;
r23 = 0x40;
r9 = r23;
do {
label_11:
r24 = *(0x230);
if (r24 == 0) {
}
else {
r2 = 0;
r2++;
do {
r24 = *(0x230);
if (r24 != 0x01) {
goto label_0;
do {
READ_FROM_IO (0x38, r0);
__asm (sbrs r0, 0);
r19 = 0x64;
WRITE_TO_IO (0x32, r19);
READ_FROM_IO (0x38, r24);
r24 |= 0x01;
WRITE_TO_IO (0x38, r24);
(*(void(*)()) fcn_00000946) ();
r24 = *(0x00000080);
if (r16 != 0) {
goto label_1;
}
else {
if (r24 != 0) {
r24 = *(0x19b);
if (r24 == 0) {
goto label_2;
}
else {
label_12:
r24 = *(0x00000080);
if (r24 != 0) {
r24 = *(0x1a8);
r25 = *(0x1a9);
if ((r24 | (r25 << 8)) != 0) {
r24 = *(0x1a1);
if (r24 == 0) {
__asm (sec);
r14 += r1;
r15 += r1;
}
}
}
r31 = 0x65;
}
}
}
(*(void(*)()) 0x205e) ();
r24 = 0x02;
*(0x230) = r24;
*(0x268) = r2;
r24 = 0xff;
*(0x1a2) = r24;
r24 = 0x41;
*(0x1a3) = r24;
r24 = 0x05;
*(0x1ab) = r24;
*(0x22a) = r1;
*(0x1a7) = r1;
*(vector.int1) = r1;
*(0x1a5) = r1;
*(0x00000080) = r1;
(*(void(*)()) 0x24ae) ();
r24 = *(0x00000080);
r24 = *(0x00000080);
goto label_3;
} while (1);
}
} while ((r14 | (r15 << 8)) >= (r31 | (r1 << 8)));
}
r24 = 0x01;
(*(void(*)()) 0x22b2) ();
label_13:
r24 = *(0x240);
r25 = *(0x241);
(*(void(*)()) 0x260a) ();
r24 = 0x00;
(*(void(*)()) fcn_00000854) ();
r24 = 0x01;
(*(void(*)()) fcn_00000854) ();
r18 = *(0x246);
r19 = *(0x247);
*(MEM_Y + 2) = r19;
*(MEM_Y + 1) = r18;
(*(void(*)()) 0x223a) ();
r24 = *(0x242);
r25 = *(0x243);
(*(void(*)()) 0x260a) ();
r24 = 0xf8;
WRITE_TO_IO (0x32, r24);
READ_FROM_IO (0x38, r24);
r24 |= 0x01;
WRITE_TO_IO (0x38, r24);
r14 = 0;
r15 = 0;
r24 = *(0x230);
goto label_0;
if (r24 == 0x01) {
}
label_0:
r20 = 0x03;
r2 = r20;
do {
r24 = *(0x230);
if (r24 != 0x02) {
goto label_4;
}
else {
label_6:
READ_FROM_IO (0x38, r0);
__asm (sbrs r0, 0);
r19 = 0x64;
WRITE_TO_IO (0x32, r19);
READ_FROM_IO (0x38, r24);
r24 |= 0x01;
WRITE_TO_IO (0x38, r24);
(*(void(*)()) fcn_00000946) ();
r22 = *(MEM_Y + 1);
r23 = *(MEM_Y + 2);
r18 = r22;
r19 = r23;
r20 = 0x00;
r21 = 0x00;
r22 = *(0x22b);
r23 = *(0x22c);
r24 = *(0x22d);
r25 = *(0x22e);
(*(void(*)()) 0x1a4e) ();
if ((r18 | (r19 << 8)) != (0xff | (r1 << 8))) {
if ((r18 | (r19 << 8)) >= (0xff | (r1 << 8))) {
goto label_5;
}
else {
r23 = 0xff;
r23 -= r18;
r24 = r23;
label_14:
*(0x231) = r24;
r24 = *(0x00000080);
r25 = *(0x24b);
r30 = *(MEM_Y + 1);
r31 = *(MEM_Y + 2);
r30 += r24;
r31 += r25;
*(MEM_Y + 2) = r31;
*(MEM_Y + 1) = r30;
r24 = *(0x248);
r25 = *(0x249);
}
}
}
} while ((r30 | (r31 << 8)) >= (r24 | (r25 << 8)));
*(0x230) = r2;
(*(void(*)()) 0x2298) ();
r24 = *(0x244);
r25 = *(0x245);
(*(void(*)()) 0x260a) ();
(*(void(*)()) 0x227a) ();
(*(void(*)()) 0x2256) ();
r14 = 0;
r15 = 0;
r24 = *(0x230);
if (r24 == 0x02) {
goto label_6;
}
label_4:
r2 = 0;
r2--;
do {
label_9:
r24 = *(0x230);
if (r24 != 0x03) {
goto label_7;
}
else {
label_15:
READ_FROM_IO (0x38, r0);
__asm (sbrs r0, 0);
r31 = 0xf8;
WRITE_TO_IO (0x32, r31);
READ_FROM_IO (0x38, r24);
r24 |= 0x01;
WRITE_TO_IO (0x38, r24);
(*(void(*)()) fcn_00000946) ();
(*(void(*)()) fcn_00000e98) ();
__asm (sec);
r14 += r1;
r15 += r1;
r18 = 0x01;
r18 = 0x02;
if (r15 >= r18) {
goto label_8;
}
else {
r19 = 0x02;
}
}
} while ((r14 | (r15 << 8)) == (r19 | (r1 << 8)));
(*(void(*)()) fcn_00000da2) ();
goto label_9;
READ_FROM_IO (0x38, r0);
__asm (sbrs r0, 0);
r18 = 0x64;
WRITE_TO_IO (0x32, r18);
READ_FROM_IO (0x38, r24);
r24 |= 0x01;
WRITE_TO_IO (0x38, r24);
(*(void(*)()) fcn_00000946) ();
r24 = *(0x1a8);
r25 = *(0x1a9);
if ((r24 | (r25 << 8)) == 0) {
goto label_10;
}
label_10:
*(0x1a1) = r1;
__asm (cbi 0x15, 3);
*(0x268) = r1;
r24 = 0x01;
*(0x230) = r24;
*(0x1a7) = r1;
*(vector.int1) = r1;
r25 = 0xff;
*(0x1a2) = r25;
*(0x1a3) = r24;
r14 = 0;
r15 = 0;
goto label_11;
label_1:
goto label_12;
r24 = *(0x19c);
goto label_12;
*(0x19c) = r2;
(*(void(*)()) 0x24ae) ();
r24 = *(0x00000080);
r25 = 0x00;
r20 = 0x00;
r21 = 0x00;
do {
r20 -= 0xff;
r21 -= 0xff;
r24 = *(0x00000080);
r25 = 0x00;
r24--;
r25--;
r22 = 0xbc;
r23 = 0x02;
uint16_t value1 = r24 * r22;
r0 = (value1 & 0xFF);
r1 = (value1 >> 8);
r18 = r0;
r19 = r1;
uint16_t value2 = r24 * r23;
r0 = (value2 & 0xFF);
r1 = (value2 >> 8);
r19 += r0;
uint16_t value3 = r25 * r22;
r0 = (value3 & 0xFF);
r1 = (value3 >> 8);
r19 += r0;
r1 = 0;
} while ((r20 | (r21 << 8)) >= (r18 | (r19 << 8)));
r24 = 0x32;
r25 = 0x00;
(*(void(*)()) 0x260a) ();
r18 = 0x90;
r19 = 0x01;
DISABLE_INTERRUPTS;
WRITE_TO_IO (0x11, r13);
WRITE_TO_IO (0x18, r12);
ENABLE_INTERRUPTS;
r24 = 0x3c;
r25 = 0x00;
do {
} while ((r24 | (r25 << 8)) == (0x01 | (0x01 << 8)));
WRITE_TO_IO (0x18, r1);
r24 = 0x8c;
r25 = 0x00;
do {
} while ((r24 | (r25 << 8)) == (0x01 | (0x01 << 8)));
r18 -= 0x01;
r18 = 0x90;
r19 = 0x01;
DISABLE_INTERRUPTS;
WRITE_TO_IO (0x11, r13);
WRITE_TO_IO (0x18, r9);
ENABLE_INTERRUPTS;
r24 = 0x3c;
r25 = 0x00;
do {
} while ((r24 | (r25 << 8)) == (0x01 | (0x01 << 8)));
WRITE_TO_IO (0x18, r1);
r24 = 0x8c;
r25 = 0x00;
do {
} while ((r24 | (r25 << 8)) == (0x01 | (0x01 << 8)));
r18 -= 0x01;
(*(void(*)()) 0x248e) ();
goto label_12;
label_2:
*(0x19b) = r2;
(*(void(*)()) 0x24ae) ();
r18 = *(0x00000080);
r19 = 0x00;
r18 -= 0x01;
r19 -= 0x00;
r30 = 0xbc;
r31 = 0x02;
uint16_t value4 = r18 * r30;
r0 = (value4 & 0xFF);
r1 = (value4 >> 8);
r24 = r0;
r25 = r1;
uint16_t value5 = r18 * r31;
r0 = (value5 & 0xFF);
r1 = (value5 >> 8);
r25 += r0;
uint16_t value6 = r19 * r30;
r0 = (value6 & 0xFF);
r1 = (value6 >> 8);
r25 += r0;
r1 = 0;
r24--;
r25--;
r24 = 0x32;
r25 = 0x00;
(*(void(*)()) 0x260a) ();
r18 = 0xe7;
r19 = 0x03;
r24 = 0x00;
*(MEM_Y + 3) = r18;
*(MEM_Y + 4) = r19;
(*(void(*)()) 0x28b0) ();
(*(void(*)()) 0x2836) ();
r18 = *(MEM_Y + 3);
r19 = *(MEM_Y + 4);
r18 -= 0x01;
r18 = 0xe7;
r19 = 0x03;
r24 = 0x01;
*(MEM_Y + 3) = r18;
*(MEM_Y + 4) = r19;
(*(void(*)()) 0x28b0) ();
(*(void(*)()) 0x2836) ();
r18 = *(MEM_Y + 3);
r19 = *(MEM_Y + 4);
r18 -= 0x01;
(*(void(*)()) 0x248e) ();
goto label_12;
label_3:
r24 = 0x00;
(*(void(*)()) 0x22b2) ();
goto label_13;
label_5:
r24 = 0x00;
goto label_14;
label_8:
r20 = 0x02;
*(0x268) = r20;
*(0x1a2) = r2;
r21 = 0x81;
*(0x1a3) = r21;
r22 = 0x04;
*(0x230) = r22;
r24 = *(0x24e);
r24 >>= 1;
r24 >>= 1;
r24 &= 0x01;
*(0x22a) = r24;
r10 = 0;
r11 = 0;
r6 = 0;
r7 = 0;
r14 = 0;
r15 = 0;
r24 = *(0x230);
goto label_15;
label_7:
r24 = *(0x230);
goto label_16;
} while (1);
label_16:
r19 = 0xf8;
r2 = r19;
do {
READ_FROM_IO (0x38, r0);
__asm (sbrs r0, 0);
WRITE_TO_IO (0x32, r2);
READ_FROM_IO (0x38, r24);
r24 |= 0x01;
WRITE_TO_IO (0x38, r24);
(*(void(*)()) 0x2946) ();
r24 = r14;
r25 = r15;
r24 &= 0x03;
r25 &= 0x00;
if ((r24 | (r25 << 8)) != 0) {
goto label_17;
}
r22 = *(0x1a8);
r23 = *(0x1a9);
r24 = *(0x23c);
r25 = *(0x23d);
uint16_t value7 = r22 * r24;
r0 = (value7 & 0xFF);
r1 = (value7 >> 8);
r10 = r0;
r11 = r1;
uint16_t value8 = r22 * r25;
r0 = (value8 & 0xFF);
r1 = (value8 >> 8);
r11 += r0;
uint16_t value9 = r23 * r24;
r0 = (value9 & 0xFF);
r1 = (value9 >> 8);
r11 += r0;
r1 = 0;
r24 = *(vector.int1);
r25 = *(0x1a7);
r10 -= r24;
r11 -= r25;
r24 = *(0x236);
r25 = *(0x237);
r10 += r24;
r11 += r25;
r24 = r10;
r25 = r11;
(*(void(*)()) fcn_000011ac) ();
r6 = r24;
r7 = r25;
(*(void(*)()) 0x260a) ();
r24 = r14;
r25 = r15;
r24 &= 0x0f;
r25 &= 0x00;
if ((r24 | (r25 << 8)) == 0) {
goto label_18;
}
label_19:
__asm (sec);
r14 += r1;
r15 += r1;
label_20:
r24 = *(0x230);
} while (r24 != 0x04);
goto label_11;
label_17:
(*(void(*)()) fcn_00000e98) ();
r24 = r10;
r25 = r11;
r22 = r6;
r23 = r7;
(*(void(*)()) fcn_0000108a) ();
goto label_19;
label_18:
(*(void(*)()) fcn_00001024) ();
r24 = r6;
r25 = r7;
(*(void(*)()) fcn_00001514) ();
r18 = 0x01;
r14 = r18;
r15 = r1;
goto label_20;
}
void fcn_00001a4e () {
r26 = 0x21;
r1 = r26;
r26 -= r26;
r27 -= r27;
r30 = r26;
r31 = r27;
while (--r1 != 0) {
r26 = rotate_left8 (r26, 1);
r27 = rotate_left8 (r27, 1);
r30 = rotate_left8 (r30, 1);
r31 = rotate_left8 (r31, 1);
if ((((r26 | (r27 << 8)) | (r30 << 8)) | (r31 << 8)) >= (((r18 | (r19 << 8)) | (r20 << 8)) | (r21 << 8))) {
r26 -= r18;
r27 -= r19;
r30 -= r20;
r31 -= r21;
}
r22 = rotate_left8 (r22, 1);
r23 = rotate_left8 (r23, 1);
r24 = rotate_left8 (r24, 1);
r25 = rotate_left8 (r25, 1);
}
r22 = 0xff - r22;
r23 = 0xff - r23;
r24 = 0xff - r24;
r25 = 0xff - r25;
r18 = r22;
r19 = r23;
r20 = r24;
r21 = r25;
r22 = r26;
r23 = r27;
r24 = r30;
r25 = r31;
return;
}
void fcn_00001ac8 () {
r26 = r24;
r27 = r25;
r24 = r22;
r25 = r23;
r30 = r24;
r31 = r25;
do {
__asm (sbic 0x1c, 1);
} while (1);
}
void fcn_000002b2 () {
r25 = *(0x24e);
__asm (swap r25);
r25 &= 0x0f;
r25 += r24;
if ((r25 & (1 << 0)) == 0) {
r24 = 0x04;
}
*(0x1c4) = r24;
if (r16 != 0) {
}
else {
r25 = 0x02;
*(0x1c5) = r25;
*(0x1c6) = r25;
r25 = 0x01;
*(0x1c7) = r25;
*(0x1c8) = r25;
*(0x1c9) = r24;
r24 = 0x80;
*(0x1ca) = r24;
*(0x1cb) = r24;
r24 = 0x20;
*(0x1cc) = r24;
*(0x1cd) = r24;
r24 = 0x10;
*(0x1ce) = r24;
*(0x1cf) = r24;
r18 = 0xa0;
*(0x1be) = r18;
r25 = 0x90;
*(0x1bf) = r25;
r24 = 0x30;
*(0x1c0) = r24;
*(0x1c1) = r18;
*(0x1c2) = r25;
*(0x1c3) = r24;
label_0:
r25 = 0x01;
*(0x1b8) = r25;
r24 = 0x02;
*(0x1b9) = r24;
*(0x1ba) = r1;
*(0x1bb) = r25;
*(0x1bc) = r24;
*(0x1bd) = r1;
r25 = 0x1b;
*(0x1b2) = r25;
r24 = 0x1a;
*(0x1b3) = r24;
*(0x1b4) = r25;
*(0x1b5) = r24;
*(0x1b6) = r25;
*(0x1b7) = r24;
return;
}
r25 = 0x40;
*(0x1c5) = r25;
*(0x1c6) = r25;
r25 = 0x01;
*(0x1c7) = r25;
*(0x1c8) = r25;
*(0x1c9) = r24;
r24 = 0x30;
*(0x1ca) = r24;
*(0x1cb) = r24;
r24 = 0x90;
*(0x1cc) = r24;
*(0x1cd) = r24;
r24 = 0xa0;
*(0x1ce) = r24;
*(0x1cf) = r24;
r24 = 0x20;
*(0x1be) = r24;
r25 = 0x10;
*(0x1bf) = r25;
*(0x1c0) = r25;
r25 = 0x80;
*(0x1c1) = r25;
*(0x1c2) = r25;
*(0x1c3) = r24;
goto label_0;
}
void fcn_00001a26 () {
r26 -= r26;
r27 -= r27;
r21 = 0x11;
while (--r21 != 0) {
r26 = rotate_left8 (r26, 1);
r27 = rotate_left8 (r27, 1);
if ((r26 | (r27 << 8)) >= (r22 | (r23 << 8))) {
r26 -= r22;
r27 -= r23;
}
r24 = rotate_left8 (r24, 1);
r25 = rotate_left8 (r25, 1);
}
r24 = 0xff - r24;
r25 = 0xff - r25;
r22 = r24;
r23 = r25;
r24 = r26;
r25 = r27;
return;
}
void fcn_00000836 () {
if (r16 != 0) {
WRITE_TO_IO (0x18, r1);
WRITE_TO_IO (0x12, r1);
r24 = 0x7f;
do {
label_0:
} while (r24 == 0x01);
return;
}
DISABLE_INTERRUPTS;
r8 = 0;
r4 = 0;
ENABLE_INTERRUPTS;
r24 = 0x7f;
goto label_0;
}
void fcn_0000060a () {
if (r16 != 0) {
DISABLE_INTERRUPTS;
if ((r25 & (1 << 7)) == 0) {
r18 = 0x01;
}
*(0x22f) = r18;
WRITE_TO_IO (0x2b, r25);
WRITE_TO_IO (0x2a, r24);
ENABLE_INTERRUPTS;
return;
}
r18 = r24;
r19 = r25;
r18 -= 0x90;
r19 -= 0xfe;
r20 = 0x02;
if ((r18 | (r19 << 8)) < (0xe1 | (r20 << 8))) {
*(0x19f) = r1;
label_0:
DISABLE_INTERRUPTS;
if ((r25 & (1 << 7)) == 0) {
r18 = 0x01;
}
*(0x22f) = r18;
WRITE_TO_IO (0x29, r25);
WRITE_TO_IO (0x28, r24);
ENABLE_INTERRUPTS;
return;
}
r18 = 0x08;
*(0x19f) = r18;
goto label_0;
}
uint8_t fcn_00001a92 () {
__asm (bst r25, 7);
r0 = r25;
r0 ^= r21;
(*(void(*)()) fcn_00001ab6) ();
if ((r21 & (1 << 7)) == 0) {
(*(void(*)()) fcn_00001a4e) ();
}
(*(void(*)()) fcn_00001ab6) ();
r0 = rotate_left8 (r0, 1);
if ((r21 & (1 << 7)) >= 0) {
(*(void(*)()) 0x1ab4) ();
}
}
void fcn_000008cc () {
r24 = 0x01;
r25 = 0xff;
(*(void(*)()) fcn_0000060a) ();
r24 = 0xff;
*(0x1a2) = r24;
r18 = 0x01;
*(0x1a3) = r18;
r24 = *(0x1a8);
r25 = *(0x1a9);
if ((r24 | (r25 << 8)) != 0) {
__asm (sbi 0x15, 3);
__asm (cbi 0x15, 4);
__asm (cbi 0x15, 5);
r24 = 0x03;
*(0x268) = r24;
*(0x230) = r1;
r24 = *(0x1a3);
r24 |= 0xc0;
*(0x1a3) = r24;
*(0x1a1) = r18;
label_0:
r18 = 0x28;
r19 = 0x00;
do {
r24 = 0xe8;
r25 = 0x03;
do {
} while ((r24 | (r25 << 8)) == (0x01 | (0x01 << 8)));
r18 -= 0x01;
} while (r19 == 0x00);
(*(void(*)()) fcn_000002ae) ();
(*(void(*)()) fcn_0000027a) ();
(*(void(*)()) fcn_0000048e) ();
*(0x1a7) = r1;
*(vector.int1) = r1;
*(0x00000080) = r1;
*(0x1a5) = r1;
return;
}
*(0x268) = r1;
*(0x230) = r18;
r24 = *(0x1a3);
*(0x1a3) = r24;
goto label_0;
}
uint8_t fcn_00000162 () {
r24 = *(0x19a);
if (r24 == 0) {
r24 = 0x01;
*(0x19a) = r24;
WRITE_TO_IO (0x12, r1);
WRITE_TO_IO (0x11, r1);
r24 = 0x47;
WRITE_TO_IO (0x17, r24);
r24 = 0x02;
WRITE_TO_IO (0x18, r24);
r24 = 0x0a;
do {
} while (r24 == 0x01);
READ_FROM_IO (0x10, r24);
r24 &= 0xb0;
if (r24 != 0x01) {
}
else {
r16 = 0x00;
label_4:
WRITE_TO_IO (0x18, r1);
WRITE_TO_IO (0x12, r1);
r24 = 0x8e;
r25 = 0x01;
r22 = 0x01;
r23 = 0x00;
r20 = 0x09;
r21 = 0x00;
(*(void(*)()) 0xfffffac8) ();
r30 = 0x61;
r31 = 0x00;
r24 = 0x00;
while (r18 != r25) {
r24 -= 0xff;
r30 += 0x32;
r31 += 0x32;
if (r24 == 0x06) {
goto label_0;
}
do {
r25 = *(0x190);
r26 = r30;
r27 = r31;
r26--;
r27--;
r18 = *(MEM_X);
r25 = *(0x191);
r18 = *(MEM_Z);
goto label_1;
r24 -= 0xff;
r30 += 0x32;
r31 += 0x32;
} while (r24 == 0x06);
}
}
}
else {
label_0:
r24 = 0x00;
label_1:
if (r16 != 0) {
if (r24 != 0) {
while (r24 != 0x01) {
r25 = 0x00;
label_2:
r18 = 0x32;
r19 = 0x00;
uint16_t value1 = r24 * r18;
r0 = (value1 & 0xFF);
r1 = (value1 >> 8);
r30 = r0;
r31 = r1;
uint16_t value2 = r24 * r19;
r0 = (value2 & 0xFF);
r1 = (value2 >> 8);
r31 += r0;
uint16_t value3 = r25 * r18;
r0 = (value3 & 0xFF);
r1 = (value3 >> 8);
r31 += r0;
r1 = 0;
r26 = 0x32;
r27 = 0x02;
r30 -= 0xa0;
r31 -= 0xff;
r24 = 0x32;
do {
r0 = *(MEM_Z);
uint8_t value0 = r30;
r30 += 1;
r31 = (r30 < value0) ? (r31 + 1) : r31;
*(MEM_X) = r0;
uint8_t value1 = r26;
r26 += 1;
r27 = (r26 < value1) ? (r27 + 1) : r27;
} while (r24 == 0x01);
(*(void(*)()) 0x5e) ();
return r0;
r24 = 0x01;
r25 = 0x00;
goto label_2;
goto label_3;
r24 = 0x03;
*(0x268) = r24;
while (1);
}
}
}
}
r24 = 0x00;
r25 = 0x00;
goto label_2;
label_3:
r16 = 0x01;
goto label_4;
}
uint8_t fcn_000004ae () {
*(0x19d) = r1;
*(0x19e) = r1;
*(0x1b1) = r1;
*(0x1b0) = r1;
*(0x1af) = r1;
*(0x1ae) = r1;
*(0x1ad) = r1;
*(0x1ac) = r1;
WRITE_TO_IO (0x18, r1);
WRITE_TO_IO (0x12, r1);
WRITE_TO_IO (0x11, r1);
r24 = 0x01;
*(0x22f) = r24;
r3 = 0;
r4 = 0;
r8 = 0;
r5 = 0;
r18 = 0x01;
r19 = 0x00;
r0 = *(0x24c);
while (--r0 > 0) {
r18 <<= 1;
r19 = rotate_left8 (r19, 1);
}
r18 -= 0x01;
r19 -= 0x00;
*(0x267) = r19;
*(0x266) = r18;
r24 = *(0x24e);
r24 &= 0x21;
if (r24 == 0x21) {
}
else {
*(0x265) = r1;
*(0x264) = r1;
do {
r24 = r18;
r25 = r19;
r24 <<= 1;
r25 = rotate_left8 (r25, 1);
r24 <<= 1;
r25 = rotate_left8 (r25, 1);
r24 <<= 1;
r25 = rotate_left8 (r25, 1);
r24 += r18;
r25 += r19;
r22 = 0x0a;
r23 = 0x00;
(*(void(*)()) 0x1a26) ();
*(0x26a) = r23;
*(0x269) = r22;
if (r16 != 0) {
r24 = 0xb0;
WRITE_TO_IO (0x11, r24);
r24 = 0x47;
WRITE_TO_IO (0x17, r24);
r24 = *(0x24c);
r25 = *(0x24d);
if ((r24 | (r25 << 8)) == (0x08 | (r1 << 8))) {
goto label_0;
}
else {
if ((r24 | (r25 << 8)) >= (0x09 | (r1 << 8))) {
goto label_1;
}
}
}
if ((r24 | (r25 << 8)) == (0x07 | (r1 << 8))) {
r24 = 0x82;
WRITE_TO_IO (0x2f, r24);
r24 = 0x19;
WRITE_TO_IO (0x2e, r24);
r24 = 0x7f;
r25 = 0x00;
WRITE_TO_IO (0x27, r25);
WRITE_TO_IO (0x26, r24);
}
} while (1);
}
label_2:
WRITE_TO_IO (0x29, r1);
if ((r24 | (r25 << 8)) >= (0x09 | (r1 << 8))) {
WRITE_TO_IO (0x28, r1);
WRITE_TO_IO (0x2b, r1);
WRITE_TO_IO (0x2a, r1);
READ_FROM_IO (0x39, r24);
r24 |= 0x04;
WRITE_TO_IO (0x39, r24);
return r0;
r24 = 0xbc;
WRITE_TO_IO (0x11, r24);
r24 = 0xcf;
WRITE_TO_IO (0x17, r24);
r24 = 0x03;
WRITE_TO_IO (0x2f, r24);
r24 = 0x19;
WRITE_TO_IO (0x2e, r24);
r24 = *(0x266);
r25 = *(0x267);
WRITE_TO_IO (0x2b, r25);
WRITE_TO_IO (0x2a, r24);
WRITE_TO_IO (0x29, r1);
WRITE_TO_IO (0x28, r1);
READ_FROM_IO (0x39, r24);
r24 |= 0x18;
WRITE_TO_IO (0x39, r24);
return r0;
r24 = 0;
r25 = 0;
r24 -= r18;
r25 -= r19;
*(0x265) = r25;
*(0x264) = r24;
}
label_1:
if ((r24 | (r25 << 8)) != (0x09 | (r1 << 8))) {
goto label_2;
}
r24 = 0x83;
WRITE_TO_IO (0x2f, r24);
r24 = 0x09;
WRITE_TO_IO (0x2e, r24);
WRITE_TO_IO (0x29, r1);
WRITE_TO_IO (0x28, r1);
WRITE_TO_IO (0x2b, r1);
WRITE_TO_IO (0x2a, r1);
READ_FROM_IO (0x39, r24);
r24 |= 0x04;
WRITE_TO_IO (0x39, r24);
return r0;
label_0:
r24 = 0x81;
WRITE_TO_IO (0x2f, r24);
r24 = 0x09;
WRITE_TO_IO (0x2e, r24);
WRITE_TO_IO (0x29, r1);
WRITE_TO_IO (0x28, r1);
WRITE_TO_IO (0x2b, r1);
WRITE_TO_IO (0x2a, r1);
READ_FROM_IO (0x39, r24);
r24 |= 0x04;
WRITE_TO_IO (0x39, r24);
return r0;
r24 = 0x82;
WRITE_TO_IO (0x2f, r24);
r24 = 0x09;
WRITE_TO_IO (0x2e, r24);
WRITE_TO_IO (0x29, r1);
WRITE_TO_IO (0x28, r1);
WRITE_TO_IO (0x2b, r1);
WRITE_TO_IO (0x2a, r1);
READ_FROM_IO (0x39, r24);
r24 |= 0x04;
WRITE_TO_IO (0x39, r24);
return r0;
}
void fcn_00000854 () {
r17 = r24;
DISABLE_INTERRUPTS;
if (r16 != 0) {
WRITE_TO_IO (0x18, r1);
WRITE_TO_IO (0x12, r1);
r25 = 0x00;
r30 = r24;
r31 = r25;
r30 -= 0x36;
r31 -= 0xfe;
r18 = *(MEM_Z);
WRITE_TO_IO (0x11, r18);
r24 -= 0x3c;
r25 -= 0xfe;
r30 = r24;
r31 = r25;
r24 = *(MEM_Z);
WRITE_TO_IO (0x18, r24);
ENABLE_INTERRUPTS;
label_0:
r18 = *(0x23e);
r19 = *(0x23f);
if ((r18 | (r19 << 8)) != (r1 | (r1 << 8))) {
do {
r24 = 0xe8;
r25 = 0x03;
do {
} while ((r24 | (r25 << 8)) == (0x01 | (0x01 << 8)));
r18 -= 0x01;
} while (r19 == 0x00);
}
(*(void(*)()) fcn_00000836) ();
return;
}
r25 = 0x00;
r30 = r24;
r31 = r25;
r30 -= 0x36;
r31 -= 0xfe;
r8 = *(MEM_Z);
r24 -= 0x3c;
r25 -= 0xfe;
r30 = r24;
r31 = r25;
r4 = *(MEM_Z);
ENABLE_INTERRUPTS;
goto label_0;
}
void fcn_00000e98 () {
r24 = *(0x1ac);
r12 = *(0x1ad);
r13 = 0;
r12 += r24;
r13 += r1;
r24 = *(0x1ae);
r12 += r24;
r13 += r1;
r24 = *(0x1af);
r12 += r24;
r13 += r1;
r24 = *(0x1b0);
r12 += r24;
r13 += r1;
r24 = *(0x1b1);
r12 += r24;
r13 += r1;
r14 = 0;
r15 = 0;
r24 = *(0x24c);
r24 -= 0x01;
while (--r24 > 0) {
r12 <<= 1;
r13 = rotate_left8 (r13, 1);
r14 = rotate_left8 (r14, 1);
r15 = rotate_left8 (r15, 1);
}
if ((((r12 | (r13 << 8)) | (r14 << 8)) | (r15 << 8)) == (((r1 | (r1 << 8)) | (r1 << 8)) | (r1 << 8))) {
r19 = 0x01;
r12 = r19;
r13 = r1;
r14 = r1;
r15 = r1;
}
r22 = *(0x26b);
r23 = *(0x26c);
r24 = *(0x26d);
r25 = *(0x00000080);
r20 = r14;
r21 = r15;
r18 = r12;
r19 = r13;
(*(void(*)()) fcn_00001a4e) ();
r24 = *(0x00000080);
r25 = *(0x259);
r26 = 0x00;
r27 = 0x00;
if ((((r18 | (r19 << 8)) | (r20 << 8)) | (r21 << 8)) >= (((r24 | (r25 << 8)) | (r26 << 8)) | (r27 << 8))) {
r24 = *(0x25a);
r25 = *(0x25b);
r26 = 0x00;
r27 = 0x00;
if ((((r24 | (r25 << 8)) | (r26 << 8)) | (r27 << 8)) >= (((r18 | (r19 << 8)) | (r20 << 8)) | (r21 << 8))) {
}
else {
r24 = 0x01;
r25 = 0x00;
*(0x1a7) = r25;
*(vector.int1) = r24;
do {
READ_FROM_IO (0x0a, r24);
r24 &= 0x3f;
WRITE_TO_IO (0x0a, r24);
r25 = *(vector.int1);
r24 = *(0x1a7);
*(0x00000080) = r25;
*(0x1a5) = r24;
READ_FROM_IO (0x0a, r24);
r24 |= 0xc0;
WRITE_TO_IO (0x0a, r24);
r12 = *(0x00000080);
r13 = *(0x21b);
r14 = *(0x21c);
r15 = *(0x21d);
*(0x216) = r12;
*(0x217) = r13;
*(0x218) = r14;
*(0x219) = r15;
r26 = r14;
r27 = r15;
r24 = r12;
r25 = r13;
r24 <<= 1;
r25 = rotate_left8 (r25, 1);
r26 = rotate_left8 (r26, 1);
r27 = rotate_left8 (r27, 1);
r24 <<= 1;
r25 = rotate_left8 (r25, 1);
r26 = rotate_left8 (r26, 1);
r27 = rotate_left8 (r27, 1);
r24 <<= 1;
r25 = rotate_left8 (r25, 1);
r26 = rotate_left8 (r26, 1);
r27 = rotate_left8 (r27, 1);
r24 <<= 1;
r25 = rotate_left8 (r25, 1);
r26 = rotate_left8 (r26, 1);
r27 = rotate_left8 (r27, 1);
r24 -= r12;
r25 -= r13;
r26 -= r14;
r27 -= r15;
r20 = *(vector.int1);
r21 = *(0x1a7);
r22 = 0x00;
r23 = 0x00;
r24 += r20;
r25 += r21;
r26 += r22;
r27 += r23;
r18 = 0x04;
do {
r27 >>= 1;
r26 = rotate_right8 (r26, 1);
r25 = rotate_right8 (r25, 1);
r24 = rotate_right8 (r24, 1);
} while (--r18 == 0);
*(0x00000080) = r24;
*(0x21b) = r25;
*(0x21c) = r26;
*(0x21d) = r27;
if ((((r12 | (r13 << 8)) | (r14 << 8)) | (r15 << 8)) < (((r24 | (r25 << 8)) | (r26 << 8)) | (r27 << 8))) {
goto label_0;
}
r12 -= r24;
r13 -= r25;
*(0x229) = r13;
*(0x228) = r12;
return;
*(0x1a7) = r19;
*(vector.int1) = r18;
} while (1);
}
}
label_0:
r24 -= r12;
r25 -= r13;
*(0x229) = r25;
*(0x228) = r24;
return;
}
uint8_t fcn_000011ac () {
READ_FROM_IO (0x3d, r28);
READ_FROM_IO (0x3e, r29);
r28 -= 0x0a;
r29 -= 0x0a;
READ_FROM_IO (0x3f, r0);
DISABLE_INTERRUPTS;
WRITE_TO_IO (0x3e, r29);
WRITE_TO_IO (0x3f, r0);
WRITE_TO_IO (0x3d, r28);
*(MEM_Y + 10) = r23;
*(MEM_Y + 9) = r22;
r18 = *(0x00000080);
r19 = *(0x251);
r20 = 0x00;
r21 = 0x00;
r12 = r24;
r13 = r25;
r14 = 0;
if ((r13 & (1 << 7)) == 0) {
r15 = r14;
}
*(MEM_Y + 1) = r12;
*(MEM_Y + 2) = r13;
*(MEM_Y + 3) = r14;
*(MEM_Y + 4) = r15;
r24 = r14;
r25 = r15;
r22 = r12;
r23 = r13;
(*(void(*)()) fcn_000019e8) ();
*(MEM_Y + 5) = r22;
*(MEM_Y + 6) = r23;
*(MEM_Y + 7) = r24;
*(MEM_Y + 8) = r25;
r24 = *(0x20e);
r25 = *(0x20f);
r26 = *(0x00000080);
r27 = *(0x211);
r6 = *(0x264);
r7 = *(0x265);
r20 = r6;
r21 = r7;
r22 = 0;
if ((r21 & (1 << 7)) == 0) {
r23 = r22;
}
__asm (brge 0x122e);
r12 = *(0x209);
r13 = *(0x00000080);
r14 = *(0x20b);
r15 = *(0x20c);
r10 = *(0x266);
r11 = *(0x267);
do {
label_5:
r19 = 0x41;
r19 = 0x42;
r19 = 0x0f;
r19 = 0x00;
__asm (brge 0x125a);
goto label_0;
r24 = 0x40;
r25 = 0x42;
r26 = 0x0f;
r27 = 0x00;
*(0x209) = r24;
*(0x00000080) = r25;
*(0x20b) = r26;
*(0x20c) = r27;
r31 = 0x40;
r12 = r31;
r31 = 0x42;
r13 = r31;
r31 = 0x0f;
r14 = r31;
r15 = r1;
do {
label_7:
r22 = *(0x252);
r23 = *(0x253);
r24 = 0x00;
r25 = 0x00;
r20 = r14;
r21 = r15;
r18 = r12;
r19 = r13;
(*(void(*)()) 0x19e8) ();
r12 = *(MEM_Y + 5);
r13 = *(MEM_Y + 6);
r14 = *(MEM_Y + 7);
r15 = *(MEM_Y + 8);
r22 += r12;
r23 += r13;
r24 += r14;
r25 += r15;
r18 = *(fcn.00000256);
r19 = *(0x257);
r20 = 0x00;
r21 = 0x00;
(*(void(*)()) 0x1a92) ();
*(MEM_Y + 5) = r18;
*(MEM_Y + 6) = r19;
*(MEM_Y + 7) = r20;
*(MEM_Y + 8) = r21;
r24 = r20;
r25 = r21;
r22 = r18;
r23 = r19;
r18 = 0xd4;
r19 = 0x03;
r20 = 0x00;
r21 = 0x00;
(*(void(*)()) 0x19e8) ();
r12 = r22;
r13 = r23;
r14 = r24;
r15 = r25;
r22 = *(0x212);
r23 = *(vector.int0);
r24 = *(0x214);
r25 = *(0x215);
r18 = 0xfe;
r19 = 0x01;
r20 = 0x00;
r21 = 0x00;
(*(void(*)()) 0x19e8) ();
r26 = r24;
r27 = r25;
r24 = r22;
r25 = r23;
r12 += r24;
r13 += r25;
r14 += r26;
r15 += r27;
r24 = r14;
r25 = r15;
r22 = r12;
r23 = r13;
r18 = 0x00;
r19 = 0x04;
r20 = 0x00;
r21 = 0x00;
(*(void(*)()) 0x1a92) ();
*(MEM_Y + 1) = r18;
*(MEM_Y + 2) = r19;
*(MEM_Y + 3) = r20;
*(MEM_Y + 4) = r21;
*(0x212) = r18;
*(vector.int0) = r19;
*(0x214) = r20;
*(0x215) = r21;
r14 = *(MEM_Y + 9);
r15 = *(MEM_Y + 10);
r24 = r14;
r25 = r15;
r26 = 0;
if ((r25 & (1 << 7)) == 0) {
r27 = r26;
}
if (r16 == 0x01) {
goto label_1;
}
else {
r18 = *(0x232);
if (r18 == 0) {
goto label_2;
}
else {
r12 = *(MEM_Y + 1);
r13 = *(MEM_Y + 2);
r14 = *(MEM_Y + 3);
r15 = *(MEM_Y + 4);
r12 += r24;
r13 += r25;
r14 += r26;
r15 += r27;
*(0x20e) = r12;
*(0x20f) = r13;
*(0x00000080) = r14;
*(0x211) = r15;
label_10:
r24 = r10;
r25 = r11;
r26 = 0x00;
r27 = 0x00;
__asm (brge 0x1366);
goto label_3;
}
else {
label_8:
r24 = r6;
r25 = r7;
r20 = r6;
r21 = r7;
r22 = 0;
if ((r21 & (1 << 7)) == 0) {
r23 = r22;
}
if ((((r12 | (r13 << 8)) | (r14 << 8)) | (r15 << 8)) >= (((r20 | (r21 << 8)) | (r22 << 8)) | (r23 << 8))) {
r24 = r12;
r25 = r13;
}
label_9:
r28 += 0x0a;
r29 += 0x0a;
READ_FROM_IO (0x3f, r0);
DISABLE_INTERRUPTS;
WRITE_TO_IO (0x3e, r29);
WRITE_TO_IO (0x3f, r0);
WRITE_TO_IO (0x3d, r28);
return r0;
r10 = *(0x266);
r11 = *(0x267);
r20 = r10;
r21 = r11;
r22 = 0x00;
r23 = 0x00;
r12 = *(0x209);
r13 = *(0x00000080);
r14 = *(0x20b);
r15 = *(0x20c);
if ((((r24 | (r25 << 8)) | (r26 << 8)) | (r27 << 8)) < (((r20 | (r21 << 8)) | (r22 << 8)) | (r23 << 8))) {
goto label_4;
}
}
}
label_4:
r18 = *(MEM_Y + 1);
r19 = *(MEM_Y + 2);
r20 = *(MEM_Y + 3);
r21 = *(MEM_Y + 4);
r12 += r18;
r13 += r19;
r14 += r20;
r15 += r21;
*(0x209) = r12;
*(0x00000080) = r13;
*(0x20b) = r14;
*(0x20c) = r15;
goto label_5;
label_0:
r20 = 0xc0;
r20 = 0xbd;
r20 = 0xf0;
r20 = 0xff;
goto label_6;
} while (1);
} while (1);
label_6:
r24 = 0xc0;
r25 = 0xbd;
r26 = 0xf0;
r27 = 0xff;
*(0x209) = r24;
*(0x00000080) = r25;
*(0x20b) = r26;
*(0x20c) = r27;
r30 = 0xc0;
r12 = r30;
r30 = 0xbd;
r13 = r30;
r30 = 0xf0;
r14 = r30;
r30 = 0xff;
r15 = r30;
goto label_7;
label_2:
r18 = *(MEM_Y + 9);
r19 = *(MEM_Y + 10);
r20 = r18;
r21 = r19;
(*(void(*)()) fcn_000019ca) ();
r18 = 0xa8;
r19 = 0xfd;
r20 = 0xff;
r21 = 0xff;
(*(void(*)()) fcn_00001a92) ();
r12 = r18;
r13 = r19;
r14 = r20;
r15 = r21;
r18 = *(MEM_Y + 5);
r19 = *(MEM_Y + 6);
r20 = *(MEM_Y + 7);
r21 = *(MEM_Y + 8);
r12 += r18;
r13 += r19;
r14 += r20;
r15 += r21;
r24 = *(MEM_Y + 9);
r25 = *(MEM_Y + 10);
r24 <<= 1;
r25 = rotate_left8 (r25, 1);
r24 <<= 1;
r25 = rotate_left8 (r25, 1);
r24 <<= 1;
r25 = rotate_left8 (r25, 1);
r20 = *(MEM_Y + 9);
r21 = *(MEM_Y + 10);
r24 += r20;
r25 += r21;
r22 = 0x05;
r23 = 0x00;
(*(void(*)()) fcn_00001a26) ();
r24 = r22;
r25 = r23;
r26 = 0x00;
r27 = 0x00;
r12 += r24;
r13 += r25;
r14 += r26;
r15 += r27;
r24 = 0xad;
r25 = 0xff;
r26 = 0xff;
r27 = 0xff;
r12 += r24;
r13 += r25;
r14 += r26;
r15 += r27;
*(0x20e) = r12;
*(0x20f) = r13;
*(0x00000080) = r14;
*(0x211) = r15;
r24 = r10;
r25 = r11;
r26 = 0x00;
r27 = 0x00;
if ((((r24 | (r25 << 8)) | (r26 << 8)) | (r27 << 8)) >= (((r12 | (r13 << 8)) | (r14 << 8)) | (r15 << 8))) {
goto label_8;
}
label_3:
r24 = r10;
r25 = r11;
goto label_9;
label_1:
r18 = r14;
r19 = r15;
r20 = r14;
r21 = r15;
(*(void(*)()) fcn_000019ca) ();
r18 = 0x88;
r19 = 0x13;
r20 = 0x00;
r21 = 0x00;
(*(void(*)()) fcn_00001a92) ();
r12 = r18;
r13 = r19;
r14 = r20;
r15 = r21;
r18 = *(MEM_Y + 1);
r19 = *(MEM_Y + 2);
r20 = *(MEM_Y + 3);
r21 = *(MEM_Y + 4);
r12 += r18;
r13 += r19;
r14 += r20;
r15 += r21;
r24 = *(MEM_Y + 9);
r25 = *(MEM_Y + 10);
r24 <<= 1;
r25 = rotate_left8 (r25, 1);
r22 = 0x05;
r23 = 0x00;
(*(void(*)()) fcn_00001a26) ();
r24 = r22;
r25 = r23;
r26 = 0x00;
r27 = 0x00;
r12 += r24;
r13 += r25;
r14 += r26;
r15 += r27;
r24 = 0xd3;
r25 = 0xff;
r26 = 0xff;
r27 = 0xff;
r12 += r24;
r13 += r25;
r14 += r26;
r15 += r27;
*(0x20e) = r12;
*(0x20f) = r13;
*(0x00000080) = r14;
*(0x211) = r15;
goto label_10;
}
void fcn_0000108a () {
r28 = r24;
r29 = r25;
r10 = r22;
r11 = r23;
r12 = *(0x00000080);
r13 = *(0x21b);
r14 = *(0x21c);
r15 = *(0x21d);
r18 = *(0x260);
r19 = *(0x261);
r20 = 0x00;
r21 = 0x00;
r24 = r14;
r25 = r15;
r22 = r12;
r23 = r13;
(*(void(*)()) fcn_00001a92) ();
r24 = *(0x262);
r25 = *(0x263);
r22 = r18;
r23 = r19;
r22 -= r24;
r23 -= r25;
r24 = r22;
r25 = r23;
r24 <<= 1;
r25 = rotate_left8 (r25, 1);
r18 = *(0x228);
r19 = *(0x229);
if ((r18 | (r19 << 8)) >= (r24 | (r25 << 8))) {
r24 = r14;
r25 = r15;
r22 = r12;
r23 = r13;
r18 = 0xe8;
r19 = 0x03;
r20 = 0x00;
r21 = 0x00;
(*(void(*)()) fcn_00001a92) ();
r24 = r18;
r25 = r19;
r24++;
r25++;
r18 = *(0x226);
r19 = *(0x227);
if ((r18 | (r19 << 8)) < (r24 | (r25 << 8))) {
}
else {
if ((r1 | (r1 << 8)) >= (r28 | (r29 << 8))) {
}
else {
label_3:
r29 >>= 1;
r28 = rotate_right8 (r28, 1);
r28 += 0x04;
r29 += 0x04;
*(0x223) = r29;
*(0x222) = r28;
r24 = *(0x1a8);
r25 = *(0x1a9);
if ((r24 | (r25 << 8)) == 0) {
do {
label_0:
(*(void(*)()) fcn_000008cc) ();
label_1:
return;
r24 = 0x04;
r25 = 0x00;
*(0x223) = r25;
*(0x222) = r24;
label_2:
r24 = *(0x1a8);
r25 = *(0x1a9);
} while ((r24 | (r25 << 8)) != 0);
}
r24 = *(0x24e);
__asm (sbrs r24, 1);
r24 = *(vector.int1);
r25 = *(0x1a7);
r18 = *(0x25a);
r19 = *(0x25b);
goto label_0;
r18 = *(0x00000080);
r19 = *(0x259);
goto label_0;
r24 = *(0x222);
r25 = *(0x223);
goto label_0;
r24 = r10;
r25 = r11;
(*(void(*)()) fcn_0000060a) ();
goto label_1;
r24 = *(0x222);
r25 = *(0x223);
r24--;
r25--;
*(0x223) = r25;
*(0x222) = r24;
goto label_2;
}
}
}
r29 = 0xff - r29;
r28 = -r28;
r29 -= 0xff;
goto label_3;
}
void fcn_00001024 () {
r24 = *(0x24e);
__asm (sbrs r24, 3);
r18 = *(vector.int1);
r19 = *(0x1a7);
r24 = *(0x236);
r25 = *(0x237);
if ((r24 | (r25 << 8)) < (r18 | (r19 << 8))) {
r20 = 0x00;
r21 = 0x00;
r22 = *(0x26f);
r23 = *(0x270);
r24 = *(0x271);
r25 = *(0x272);
(*(void(*)()) fcn_00001a4e) ();
r24 = r18;
r25 = r19;
if ((r18 | (r19 << 8)) != (0xff | (r1 << 8))) {
if ((r18 | (r19 << 8)) < (0xff | (r1 << 8))) {
r24 = 0xff - r24;
DISABLE_INTERRUPTS;
*(0x231) = r24;
ENABLE_INTERRUPTS;
return;
DISABLE_INTERRUPTS;
r24 = 0xff;
*(0x231) = r24;
ENABLE_INTERRUPTS;
return;
}
}
}
r24 = 0xff;
r25 = 0x00;
r24 = 0xff - r24;
DISABLE_INTERRUPTS;
*(0x231) = r24;
ENABLE_INTERRUPTS;
return;
}
void fcn_00001514 () {
r18 = *(0x269);
r19 = *(0x26a);
if ((r18 | (r19 << 8)) < (r24 | (r25 << 8))) {
r24 = *(0x20d);
if (r24 == 0) {
r24 = *(vector.int1);
r25 = *(0x1a7);
r18 = *(0x236);
r19 = *(0x237);
r24 -= r18;
r25 -= r19;
r22 = *(0x23c);
r23 = *(0x23d);
(*(void(*)()) fcn_00001a26) ();
*(0x225) = r23;
*(fcn.00000224) = r22;
r24 = 0xff;
r25 = 0x01;
*(0x225) = r25;
*(fcn.00000224) = r24;
r24 = 0x20;
*(0x20d) = r24;
label_0:
READ_FROM_IO (0x0a, r24);
r24 &= 0x3f;
WRITE_TO_IO (0x0a, r24);
r24 = *(fcn.00000224);
r25 = *(0x225);
*(0x1a2) = r24;
r24 = *(0x268);
__asm (swap r24);
r24 <<= 1;
r24 <<= 1;
r24 &= 0xc0;
r24 |= r25;
*(0x1a3) = r24;
READ_FROM_IO (0x0a, r24);
r24 |= 0xc0;
WRITE_TO_IO (0x0a, r24);
return;
}
}
r24 -= 0x01;
*(0x20d) = r24;
goto label_0;
}
void fcn_00001f14 () {
WRITE_TO_IO (0x0c, r16);
do {
__asm (sbis 0x0b, 5);
} while (1);
}
void fcn_00001f1e () {
do {
__asm (sbis 0x0b, 7);
} while (1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.