1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-10-21 02:24:34 +00:00

Working on buckets

This commit is contained in:
jespergravgaard 2019-07-09 15:03:02 +02:00
parent 80e84f3234
commit bf0d399b2c
5 changed files with 1845 additions and 1879 deletions

View File

@ -100,6 +100,7 @@ const word*[NUM_BUCKETS] BUCKETS; // = malloc(NUM_BUCKETS*sizeof(word*));
// Current index into each bucket. Used while populating the buckets. (After population the end the values will be equal to the bucket sizes)
const byte[NUM_BUCKETS] BUCKET_IDX; // = malloc(NUM_BUCKETS*sizeof(byte));
// Initialize buckets containing indices of chars on the screen with specific distances to the center.
void init_buckets() {
// Init bucket sizes to 0
for(byte i:0..NUM_BUCKETS-1) BUCKET_SIZES[i]=0;
@ -119,15 +120,14 @@ void init_buckets() {
for(word i:0..999) {
byte distance = *dist;
word* bucket = BUCKETS[distance];
byte idx = BUCKET_IDX[distance];
bucket[idx] = dist-SCREEN_DIST;
bucket[BUCKET_IDX[distance]] = dist-SCREEN_DIST;
BUCKET_IDX[distance]++;
*dist++;
}
}
// Populates 1000 bytes (a screen) with values representing the angle to the center.
// Utilizes symmetry around the center
// Utilizes symmetry around the center
void init_angle_screen(byte* screen) {
byte* screen_topline = screen+40*12;
byte *screen_bottomline = screen+40*12;
@ -149,6 +149,7 @@ void init_angle_screen(byte* screen) {
// Populates 1000 bytes (a screen) with values representing the distance to the center.
// The actual value stored is distance*2 to increase precision
// Utilizes symmetry around the center
void init_dist_screen(byte* screen) {
NUM_SQUARES = 0x30;
init_squares();

View File

@ -116,14 +116,13 @@ main: {
dec BORDERCOL
jmp b2
}
// = malloc(NUM_BUCKETS*sizeof(byte));
// Initialize buckets containing indices of chars on the screen with specific distances to the center.
init_buckets: {
.label _5 = $d
.label _9 = $3a
.label _9 = $39
.label dist = 3
.label i1 = 5
.label distance = $37
.label bucket = $38
.label bucket = $37
.label dist_3 = 7
.label i4 = 9
.label dist_5 = 7
@ -197,15 +196,14 @@ init_buckets: {
b5:
ldy #0
lda (dist_5),y
sta distance
tax
txa
asl
tay
lda BUCKETS,y
sta bucket
lda BUCKETS+1,y
sta bucket+1
ldy distance
ldx BUCKET_IDX,y
lda dist_5
sec
sbc #<SCREEN_DIST
@ -213,7 +211,7 @@ init_buckets: {
lda dist_5+1
sbc #>SCREEN_DIST
sta _9+1
txa
lda BUCKET_IDX,x
asl
tay
lda _9
@ -221,7 +219,6 @@ init_buckets: {
iny
lda _9+1
sta (bucket),y
ldx distance
inc BUCKET_IDX,x
inc dist_3
bne !+
@ -259,13 +256,13 @@ malloc: {
rts
}
// Populates 1000 bytes (a screen) with values representing the angle to the center.
// Utilizes symmetry around the center
// Utilizes symmetry around the center
init_angle_screen: {
.label _10 = $1a
.label xw = $3c
.label yw = $3e
.label xw = $3b
.label yw = $3d
.label angle_w = $1a
.label ang_w = $40
.label ang_w = $3f
.label x = $14
.label xb = $15
.label screen_topline = $12
@ -352,7 +349,7 @@ init_angle_screen: {
// Find the atan2(x, y) - which is the angle of the line from (0,0) to (x,y)
// Finding the angle requires a binary search using CORDIC_ITERATIONS_16
// Returns the angle in hex-degrees (0=0, 0x8000=PI, 0x10000=2*PI)
// atan2_16(signed word zeropage($3c) x, signed word zeropage($3e) y)
// atan2_16(signed word zeropage($3b) x, signed word zeropage($3d) y)
atan2_16: {
.label _2 = $16
.label _7 = $18
@ -362,8 +359,8 @@ atan2_16: {
.label xd = $1e
.label yd = $1c
.label return = $1a
.label x = $3c
.label y = $3e
.label x = $3b
.label y = $3d
lda y+1
bmi !b1+
jmp b1
@ -540,10 +537,11 @@ atan2_16: {
}
// Populates 1000 bytes (a screen) with values representing the distance to the center.
// The actual value stored is distance*2 to increase precision
// Utilizes symmetry around the center
init_dist_screen: {
.label yds = $41
.label xds = $43
.label ds = $43
.label yds = $40
.label xds = $42
.label ds = $42
.label x = $25
.label xb = $26
.label screen_topline = $21
@ -638,12 +636,12 @@ init_dist_screen: {
// Find the (integer) square root of a word value
// If the square is not an integer then it returns the largest integer N where N*N <= val
// Uses a table of squares that must be initialized by calling init_squares()
// sqrt(word zeropage($43) val)
// sqrt(word zeropage($42) val)
sqrt: {
.label _1 = $27
.label _3 = $27
.label found = $27
.label val = $43
.label val = $42
lda SQUARES
sta bsearch16u.items
lda SQUARES+1
@ -666,14 +664,14 @@ sqrt: {
// - items - Pointer to the start of the array to search in
// - num - The number of items in the array
// Returns pointer to an entry in the array that matches the search key
// bsearch16u(word zeropage($43) key, word* zeropage($27) items, byte register(X) num)
// bsearch16u(word zeropage($42) key, word* zeropage($27) items, byte register(X) num)
bsearch16u: {
.label _2 = $27
.label pivot = $45
.label result = $47
.label pivot = $44
.label result = $46
.label return = $27
.label items = $27
.label key = $43
.label key = $42
ldx #NUM_SQUARES
b3:
cpx #0
@ -749,8 +747,8 @@ bsearch16u: {
// Uses a table of squares that must be initialized by calling init_squares()
// sqr(byte register(A) val)
sqr: {
.label return = $43
.label return_2 = $41
.label return = $42
.label return_2 = $40
asl
tay
lda (SQUARES),y

View File

@ -113,325 +113,324 @@ init_buckets::@5: scope:[init_buckets] from init_buckets::@4 init_buckets::@5
[62] (byte) init_buckets::distance#0 ← *((byte*) init_buckets::dist#5)
[63] (byte~) init_buckets::$12 ← (byte) init_buckets::distance#0 << (byte) 1
[64] (word*) init_buckets::bucket#0 ← *((const word*[NUM_BUCKETS#0]) BUCKETS#0 + (byte~) init_buckets::$12)
[65] (byte) init_buckets::idx#0 ← *((const byte[NUM_BUCKETS#0]) BUCKET_IDX#0 + (byte) init_buckets::distance#0)
[66] (word~) init_buckets::$9 ← (byte*) init_buckets::dist#5 - (const byte[$3e8]) SCREEN_DIST#0
[67] (byte~) init_buckets::$13 ← (byte) init_buckets::idx#0 << (byte) 1
[68] *((word*) init_buckets::bucket#0 + (byte~) init_buckets::$13) ← (word~) init_buckets::$9
[69] *((const byte[NUM_BUCKETS#0]) BUCKET_IDX#0 + (byte) init_buckets::distance#0) ← ++ *((const byte[NUM_BUCKETS#0]) BUCKET_IDX#0 + (byte) init_buckets::distance#0)
[70] (byte*) init_buckets::dist#3 ← ++ (byte*) init_buckets::dist#5
[71] (word) init_buckets::i4#1 ← ++ (word) init_buckets::i4#2
[72] if((word) init_buckets::i4#1!=(word) $3e8) goto init_buckets::@5
[65] (word~) init_buckets::$9 ← (byte*) init_buckets::dist#5 - (const byte[$3e8]) SCREEN_DIST#0
[66] (byte~) init_buckets::$13 ← *((const byte[NUM_BUCKETS#0]) BUCKET_IDX#0 + (byte) init_buckets::distance#0) << (byte) 1
[67] *((word*) init_buckets::bucket#0 + (byte~) init_buckets::$13) ← (word~) init_buckets::$9
[68] *((const byte[NUM_BUCKETS#0]) BUCKET_IDX#0 + (byte) init_buckets::distance#0) ← ++ *((const byte[NUM_BUCKETS#0]) BUCKET_IDX#0 + (byte) init_buckets::distance#0)
[69] (byte*) init_buckets::dist#3 ← ++ (byte*) init_buckets::dist#5
[70] (word) init_buckets::i4#1 ← ++ (word) init_buckets::i4#2
[71] if((word) init_buckets::i4#1!=(word) $3e8) goto init_buckets::@5
to:init_buckets::@return
init_buckets::@return: scope:[init_buckets] from init_buckets::@5
[73] return
[72] return
to:@return
malloc: scope:[malloc] from init_buckets::@3 init_squares
[74] (word) malloc::size#2 ← phi( init_buckets::@3/(word) malloc::size#1 init_squares/(const byte) NUM_SQUARES#3*(const byte) SIZEOF_WORD )
[74] (byte*) heap_head#13 ← phi( init_buckets::@3/(byte*) heap_head#1 init_squares/(const byte*) HEAP_TOP#0 )
[75] (byte*) malloc::mem#0 ← (byte*) heap_head#13 - (word) malloc::size#2
[76] (byte*) heap_head#1 ← (byte*) malloc::mem#0
[73] (word) malloc::size#2 ← phi( init_buckets::@3/(word) malloc::size#1 init_squares/(const byte) NUM_SQUARES#3*(const byte) SIZEOF_WORD )
[73] (byte*) heap_head#13 ← phi( init_buckets::@3/(byte*) heap_head#1 init_squares/(const byte*) HEAP_TOP#0 )
[74] (byte*) malloc::mem#0 ← (byte*) heap_head#13 - (word) malloc::size#2
[75] (byte*) heap_head#1 ← (byte*) malloc::mem#0
to:malloc::@return
malloc::@return: scope:[malloc] from malloc
[77] return
[76] return
to:@return
init_angle_screen: scope:[init_angle_screen] from main::@12
[78] phi()
[77] phi()
to:init_angle_screen::@1
init_angle_screen::@1: scope:[init_angle_screen] from init_angle_screen init_angle_screen::@3
[79] (byte*) init_angle_screen::screen_topline#5 ← phi( init_angle_screen/(const byte[$3e8]) SCREEN_ANGLE#0+(word)(number) $28*(number) $c init_angle_screen::@3/(byte*) init_angle_screen::screen_topline#1 )
[79] (byte*) init_angle_screen::screen_bottomline#5 ← phi( init_angle_screen/(const byte[$3e8]) SCREEN_ANGLE#0+(word)(number) $28*(number) $c init_angle_screen::@3/(byte*) init_angle_screen::screen_bottomline#1 )
[79] (byte) init_angle_screen::y#4 ← phi( init_angle_screen/(byte) 0 init_angle_screen::@3/(byte) init_angle_screen::y#1 )
[78] (byte*) init_angle_screen::screen_topline#5 ← phi( init_angle_screen/(const byte[$3e8]) SCREEN_ANGLE#0+(word)(number) $28*(number) $c init_angle_screen::@3/(byte*) init_angle_screen::screen_topline#1 )
[78] (byte*) init_angle_screen::screen_bottomline#5 ← phi( init_angle_screen/(const byte[$3e8]) SCREEN_ANGLE#0+(word)(number) $28*(number) $c init_angle_screen::@3/(byte*) init_angle_screen::screen_bottomline#1 )
[78] (byte) init_angle_screen::y#4 ← phi( init_angle_screen/(byte) 0 init_angle_screen::@3/(byte) init_angle_screen::y#1 )
to:init_angle_screen::@2
init_angle_screen::@2: scope:[init_angle_screen] from init_angle_screen::@1 init_angle_screen::@4
[80] (byte) init_angle_screen::xb#2 ← phi( init_angle_screen::@1/(byte) $27 init_angle_screen::@4/(byte) init_angle_screen::xb#1 )
[80] (byte) init_angle_screen::x#2 ← phi( init_angle_screen::@1/(byte) 0 init_angle_screen::@4/(byte) init_angle_screen::x#1 )
[81] (byte~) init_angle_screen::$2 ← (byte) init_angle_screen::x#2 << (byte) 1
[82] (byte~) init_angle_screen::$3 ← (byte) $27 - (byte~) init_angle_screen::$2
[83] (word) init_angle_screen::xw#0 ← (byte~) init_angle_screen::$3 w= (byte) 0
[84] (byte~) init_angle_screen::$6 ← (byte) init_angle_screen::y#4 << (byte) 1
[85] (word) init_angle_screen::yw#0 ← (byte~) init_angle_screen::$6 w= (byte) 0
[86] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0
[87] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0
[88] call atan2_16
[89] (word) atan2_16::return#2 ← (word) atan2_16::return#0
[79] (byte) init_angle_screen::xb#2 ← phi( init_angle_screen::@1/(byte) $27 init_angle_screen::@4/(byte) init_angle_screen::xb#1 )
[79] (byte) init_angle_screen::x#2 ← phi( init_angle_screen::@1/(byte) 0 init_angle_screen::@4/(byte) init_angle_screen::x#1 )
[80] (byte~) init_angle_screen::$2 ← (byte) init_angle_screen::x#2 << (byte) 1
[81] (byte~) init_angle_screen::$3 ← (byte) $27 - (byte~) init_angle_screen::$2
[82] (word) init_angle_screen::xw#0 ← (byte~) init_angle_screen::$3 w= (byte) 0
[83] (byte~) init_angle_screen::$6 ← (byte) init_angle_screen::y#4 << (byte) 1
[84] (word) init_angle_screen::yw#0 ← (byte~) init_angle_screen::$6 w= (byte) 0
[85] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0
[86] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0
[87] call atan2_16
[88] (word) atan2_16::return#2 ← (word) atan2_16::return#0
to:init_angle_screen::@4
init_angle_screen::@4: scope:[init_angle_screen] from init_angle_screen::@2
[90] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2
[91] (word~) init_angle_screen::$10 ← (word) init_angle_screen::angle_w#0 + (byte) $80
[92] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$10
[93] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::xb#2) ← (byte) init_angle_screen::ang_w#0
[94] (byte~) init_angle_screen::$12 ← - (byte) init_angle_screen::ang_w#0
[95] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::xb#2) ← (byte~) init_angle_screen::$12
[96] (byte~) init_angle_screen::$13 ← (byte) $80 + (byte) init_angle_screen::ang_w#0
[97] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$13
[98] (byte~) init_angle_screen::$14 ← (byte) $80 - (byte) init_angle_screen::ang_w#0
[99] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$14
[100] (byte) init_angle_screen::x#1 ← ++ (byte) init_angle_screen::x#2
[101] (byte) init_angle_screen::xb#1 ← -- (byte) init_angle_screen::xb#2
[102] if((byte) init_angle_screen::x#1<(byte) $13+(byte) 1) goto init_angle_screen::@2
[89] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2
[90] (word~) init_angle_screen::$10 ← (word) init_angle_screen::angle_w#0 + (byte) $80
[91] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$10
[92] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::xb#2) ← (byte) init_angle_screen::ang_w#0
[93] (byte~) init_angle_screen::$12 ← - (byte) init_angle_screen::ang_w#0
[94] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::xb#2) ← (byte~) init_angle_screen::$12
[95] (byte~) init_angle_screen::$13 ← (byte) $80 + (byte) init_angle_screen::ang_w#0
[96] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$13
[97] (byte~) init_angle_screen::$14 ← (byte) $80 - (byte) init_angle_screen::ang_w#0
[98] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$14
[99] (byte) init_angle_screen::x#1 ← ++ (byte) init_angle_screen::x#2
[100] (byte) init_angle_screen::xb#1 ← -- (byte) init_angle_screen::xb#2
[101] if((byte) init_angle_screen::x#1<(byte) $13+(byte) 1) goto init_angle_screen::@2
to:init_angle_screen::@3
init_angle_screen::@3: scope:[init_angle_screen] from init_angle_screen::@4
[103] (byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#5 - (byte) $28
[104] (byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#5 + (byte) $28
[105] (byte) init_angle_screen::y#1 ← ++ (byte) init_angle_screen::y#4
[106] if((byte) init_angle_screen::y#1!=(byte) $d) goto init_angle_screen::@1
[102] (byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#5 - (byte) $28
[103] (byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#5 + (byte) $28
[104] (byte) init_angle_screen::y#1 ← ++ (byte) init_angle_screen::y#4
[105] if((byte) init_angle_screen::y#1!=(byte) $d) goto init_angle_screen::@1
to:init_angle_screen::@return
init_angle_screen::@return: scope:[init_angle_screen] from init_angle_screen::@3
[107] return
[106] return
to:@return
atan2_16: scope:[atan2_16] from init_angle_screen::@2
[108] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1
[107] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1
to:atan2_16::@2
atan2_16::@2: scope:[atan2_16] from atan2_16
[109] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0
[108] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0
to:atan2_16::@3
atan2_16::@3: scope:[atan2_16] from atan2_16::@1 atan2_16::@2
[110] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#16 atan2_16::@2/(signed word~) atan2_16::$2 )
[111] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4
[109] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#16 atan2_16::@2/(signed word~) atan2_16::$2 )
[110] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4
to:atan2_16::@5
atan2_16::@5: scope:[atan2_16] from atan2_16::@3
[112] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
[111] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@6: scope:[atan2_16] from atan2_16::@4 atan2_16::@5
[113] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#13 atan2_16::@5/(signed word~) atan2_16::$7 )
[112] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#13 atan2_16::@5/(signed word~) atan2_16::$7 )
to:atan2_16::@10
atan2_16::@10: scope:[atan2_16] from atan2_16::@19 atan2_16::@6
[114] (word) atan2_16::angle#12 ← phi( atan2_16::@19/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[114] (byte) atan2_16::i#2 ← phi( atan2_16::@19/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[114] (signed word) atan2_16::xi#3 ← phi( atan2_16::@19/(signed word) atan2_16::xi#8 atan2_16::@6/(signed word) atan2_16::xi#0 )
[114] (signed word) atan2_16::yi#3 ← phi( atan2_16::@19/(signed word) atan2_16::yi#8 atan2_16::@6/(signed word) atan2_16::yi#0 )
[115] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
[113] (word) atan2_16::angle#12 ← phi( atan2_16::@19/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[113] (byte) atan2_16::i#2 ← phi( atan2_16::@19/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[113] (signed word) atan2_16::xi#3 ← phi( atan2_16::@19/(signed word) atan2_16::xi#8 atan2_16::@6/(signed word) atan2_16::xi#0 )
[113] (signed word) atan2_16::yi#3 ← phi( atan2_16::@19/(signed word) atan2_16::yi#8 atan2_16::@6/(signed word) atan2_16::yi#0 )
[114] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
to:atan2_16::@12
atan2_16::@12: scope:[atan2_16] from atan2_16::@10 atan2_16::@19
[116] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@19/(word) atan2_16::angle#13 )
[117] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[118] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
[115] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@19/(word) atan2_16::angle#13 )
[116] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[117] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
to:atan2_16::@21
atan2_16::@21: scope:[atan2_16] from atan2_16::@12
[119] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
[118] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
to:atan2_16::@7
atan2_16::@7: scope:[atan2_16] from atan2_16::@12 atan2_16::@21
[120] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@21/(word) atan2_16::angle#4 )
[121] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
[119] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@21/(word) atan2_16::angle#4 )
[120] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
to:atan2_16::@9
atan2_16::@9: scope:[atan2_16] from atan2_16::@7
[122] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
[121] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
to:atan2_16::@8
atan2_16::@8: scope:[atan2_16] from atan2_16::@7 atan2_16::@9
[123] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
[122] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
to:atan2_16::@return
atan2_16::@return: scope:[atan2_16] from atan2_16::@8
[124] return
[123] return
to:@return
atan2_16::@11: scope:[atan2_16] from atan2_16::@10
[125] (byte~) atan2_16::shift#5 ← (byte) atan2_16::i#2
[126] (signed word~) atan2_16::xd#10 ← (signed word) atan2_16::xi#3
[127] (signed word~) atan2_16::yd#10 ← (signed word) atan2_16::yi#3
[124] (byte~) atan2_16::shift#5 ← (byte) atan2_16::i#2
[125] (signed word~) atan2_16::xd#10 ← (signed word) atan2_16::xi#3
[126] (signed word~) atan2_16::yd#10 ← (signed word) atan2_16::yi#3
to:atan2_16::@13
atan2_16::@13: scope:[atan2_16] from atan2_16::@11 atan2_16::@14
[128] (signed word) atan2_16::yd#3 ← phi( atan2_16::@11/(signed word~) atan2_16::yd#10 atan2_16::@14/(signed word) atan2_16::yd#1 )
[128] (signed word) atan2_16::xd#3 ← phi( atan2_16::@11/(signed word~) atan2_16::xd#10 atan2_16::@14/(signed word) atan2_16::xd#1 )
[128] (byte) atan2_16::shift#2 ← phi( atan2_16::@11/(byte~) atan2_16::shift#5 atan2_16::@14/(byte) atan2_16::shift#1 )
[129] if((byte) atan2_16::shift#2>=(byte) 2) goto atan2_16::@14
[127] (signed word) atan2_16::yd#3 ← phi( atan2_16::@11/(signed word~) atan2_16::yd#10 atan2_16::@14/(signed word) atan2_16::yd#1 )
[127] (signed word) atan2_16::xd#3 ← phi( atan2_16::@11/(signed word~) atan2_16::xd#10 atan2_16::@14/(signed word) atan2_16::xd#1 )
[127] (byte) atan2_16::shift#2 ← phi( atan2_16::@11/(byte~) atan2_16::shift#5 atan2_16::@14/(byte) atan2_16::shift#1 )
[128] if((byte) atan2_16::shift#2>=(byte) 2) goto atan2_16::@14
to:atan2_16::@15
atan2_16::@15: scope:[atan2_16] from atan2_16::@13
[130] if((byte) 0==(byte) atan2_16::shift#2) goto atan2_16::@17
[129] if((byte) 0==(byte) atan2_16::shift#2) goto atan2_16::@17
to:atan2_16::@16
atan2_16::@16: scope:[atan2_16] from atan2_16::@15
[131] (signed word) atan2_16::xd#2 ← (signed word) atan2_16::xd#3 >> (signed byte) 1
[132] (signed word) atan2_16::yd#2 ← (signed word) atan2_16::yd#3 >> (signed byte) 1
[130] (signed word) atan2_16::xd#2 ← (signed word) atan2_16::xd#3 >> (signed byte) 1
[131] (signed word) atan2_16::yd#2 ← (signed word) atan2_16::yd#3 >> (signed byte) 1
to:atan2_16::@17
atan2_16::@17: scope:[atan2_16] from atan2_16::@15 atan2_16::@16
[133] (signed word) atan2_16::xd#5 ← phi( atan2_16::@15/(signed word) atan2_16::xd#3 atan2_16::@16/(signed word) atan2_16::xd#2 )
[133] (signed word) atan2_16::yd#5 ← phi( atan2_16::@15/(signed word) atan2_16::yd#3 atan2_16::@16/(signed word) atan2_16::yd#2 )
[134] if((signed word) atan2_16::yi#3>=(signed byte) 0) goto atan2_16::@18
[132] (signed word) atan2_16::xd#5 ← phi( atan2_16::@15/(signed word) atan2_16::xd#3 atan2_16::@16/(signed word) atan2_16::xd#2 )
[132] (signed word) atan2_16::yd#5 ← phi( atan2_16::@15/(signed word) atan2_16::yd#3 atan2_16::@16/(signed word) atan2_16::yd#2 )
[133] if((signed word) atan2_16::yi#3>=(signed byte) 0) goto atan2_16::@18
to:atan2_16::@20
atan2_16::@20: scope:[atan2_16] from atan2_16::@17
[135] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#5
[136] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#5
[137] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1
[138] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
[134] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#5
[135] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#5
[136] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1
[137] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
to:atan2_16::@19
atan2_16::@19: scope:[atan2_16] from atan2_16::@18 atan2_16::@20
[139] (signed word) atan2_16::xi#8 ← phi( atan2_16::@18/(signed word) atan2_16::xi#1 atan2_16::@20/(signed word) atan2_16::xi#2 )
[139] (word) atan2_16::angle#13 ← phi( atan2_16::@18/(word) atan2_16::angle#2 atan2_16::@20/(word) atan2_16::angle#3 )
[139] (signed word) atan2_16::yi#8 ← phi( atan2_16::@18/(signed word) atan2_16::yi#1 atan2_16::@20/(signed word) atan2_16::yi#2 )
[140] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[141] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12
[138] (signed word) atan2_16::xi#8 ← phi( atan2_16::@18/(signed word) atan2_16::xi#1 atan2_16::@20/(signed word) atan2_16::xi#2 )
[138] (word) atan2_16::angle#13 ← phi( atan2_16::@18/(word) atan2_16::angle#2 atan2_16::@20/(word) atan2_16::angle#3 )
[138] (signed word) atan2_16::yi#8 ← phi( atan2_16::@18/(signed word) atan2_16::yi#1 atan2_16::@20/(signed word) atan2_16::yi#2 )
[139] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[140] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12
to:atan2_16::@10
atan2_16::@18: scope:[atan2_16] from atan2_16::@17
[142] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#5
[143] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#5
[144] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[145] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
[141] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#5
[142] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#5
[143] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[144] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
to:atan2_16::@19
atan2_16::@14: scope:[atan2_16] from atan2_16::@13
[146] (signed word) atan2_16::xd#1 ← (signed word) atan2_16::xd#3 >> (signed byte) 2
[147] (signed word) atan2_16::yd#1 ← (signed word) atan2_16::yd#3 >> (signed byte) 2
[148] (byte) atan2_16::shift#1 ← (byte) atan2_16::shift#2 - (byte) 2
[145] (signed word) atan2_16::xd#1 ← (signed word) atan2_16::xd#3 >> (signed byte) 2
[146] (signed word) atan2_16::yd#1 ← (signed word) atan2_16::yd#3 >> (signed byte) 2
[147] (byte) atan2_16::shift#1 ← (byte) atan2_16::shift#2 - (byte) 2
to:atan2_16::@13
atan2_16::@4: scope:[atan2_16] from atan2_16::@3
[149] (signed word~) atan2_16::xi#13 ← (signed word) atan2_16::x#0
[148] (signed word~) atan2_16::xi#13 ← (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@1: scope:[atan2_16] from atan2_16
[150] (signed word~) atan2_16::yi#16 ← (signed word) atan2_16::y#0
[149] (signed word~) atan2_16::yi#16 ← (signed word) atan2_16::y#0
to:atan2_16::@3
init_dist_screen: scope:[init_dist_screen] from main
[151] phi()
[152] call init_squares
[150] phi()
[151] call init_squares
to:init_dist_screen::@1
init_dist_screen::@1: scope:[init_dist_screen] from init_dist_screen init_dist_screen::@9
[153] (byte*) init_dist_screen::screen_bottomline#10 ← phi( init_dist_screen::@9/(byte*) init_dist_screen::screen_bottomline#1 init_dist_screen/(const byte[$3e8]) SCREEN_DIST#0+(word)(number) $28*(number) $18 )
[153] (byte*) init_dist_screen::screen_topline#10 ← phi( init_dist_screen::@9/(byte*) init_dist_screen::screen_topline#1 init_dist_screen/(const byte[$3e8]) SCREEN_DIST#0 )
[153] (byte) init_dist_screen::y#10 ← phi( init_dist_screen::@9/(byte) init_dist_screen::y#1 init_dist_screen/(byte) 0 )
[154] (byte) init_dist_screen::y2#0 ← (byte) init_dist_screen::y#10 << (byte) 1
[155] if((byte) init_dist_screen::y2#0>=(byte) $18) goto init_dist_screen::@2
[152] (byte*) init_dist_screen::screen_bottomline#10 ← phi( init_dist_screen::@9/(byte*) init_dist_screen::screen_bottomline#1 init_dist_screen/(const byte[$3e8]) SCREEN_DIST#0+(word)(number) $28*(number) $18 )
[152] (byte*) init_dist_screen::screen_topline#10 ← phi( init_dist_screen::@9/(byte*) init_dist_screen::screen_topline#1 init_dist_screen/(const byte[$3e8]) SCREEN_DIST#0 )
[152] (byte) init_dist_screen::y#10 ← phi( init_dist_screen::@9/(byte) init_dist_screen::y#1 init_dist_screen/(byte) 0 )
[153] (byte) init_dist_screen::y2#0 ← (byte) init_dist_screen::y#10 << (byte) 1
[154] if((byte) init_dist_screen::y2#0>=(byte) $18) goto init_dist_screen::@2
to:init_dist_screen::@3
init_dist_screen::@3: scope:[init_dist_screen] from init_dist_screen::@1
[156] (byte~) init_dist_screen::$5 ← (byte) $18 - (byte) init_dist_screen::y2#0
[155] (byte~) init_dist_screen::$5 ← (byte) $18 - (byte) init_dist_screen::y2#0
to:init_dist_screen::@4
init_dist_screen::@4: scope:[init_dist_screen] from init_dist_screen::@2 init_dist_screen::@3
[157] (byte) init_dist_screen::yd#0 ← phi( init_dist_screen::@2/(byte~) init_dist_screen::$7 init_dist_screen::@3/(byte~) init_dist_screen::$5 )
[158] (byte) sqr::val#0 ← (byte) init_dist_screen::yd#0
[159] call sqr
[160] (word) sqr::return#2 ← (word) sqr::return#0
[156] (byte) init_dist_screen::yd#0 ← phi( init_dist_screen::@2/(byte~) init_dist_screen::$7 init_dist_screen::@3/(byte~) init_dist_screen::$5 )
[157] (byte) sqr::val#0 ← (byte) init_dist_screen::yd#0
[158] call sqr
[159] (word) sqr::return#2 ← (word) sqr::return#0
to:init_dist_screen::@10
init_dist_screen::@10: scope:[init_dist_screen] from init_dist_screen::@4
[161] (word) init_dist_screen::yds#0 ← (word) sqr::return#2
[160] (word) init_dist_screen::yds#0 ← (word) sqr::return#2
to:init_dist_screen::@5
init_dist_screen::@5: scope:[init_dist_screen] from init_dist_screen::@10 init_dist_screen::@12
[162] (byte) init_dist_screen::xb#2 ← phi( init_dist_screen::@10/(byte) $27 init_dist_screen::@12/(byte) init_dist_screen::xb#1 )
[162] (byte) init_dist_screen::x#2 ← phi( init_dist_screen::@10/(byte) 0 init_dist_screen::@12/(byte) init_dist_screen::x#1 )
[163] (byte) init_dist_screen::x2#0 ← (byte) init_dist_screen::x#2 << (byte) 1
[164] if((byte) init_dist_screen::x2#0>=(byte) $27) goto init_dist_screen::@6
[161] (byte) init_dist_screen::xb#2 ← phi( init_dist_screen::@10/(byte) $27 init_dist_screen::@12/(byte) init_dist_screen::xb#1 )
[161] (byte) init_dist_screen::x#2 ← phi( init_dist_screen::@10/(byte) 0 init_dist_screen::@12/(byte) init_dist_screen::x#1 )
[162] (byte) init_dist_screen::x2#0 ← (byte) init_dist_screen::x#2 << (byte) 1
[163] if((byte) init_dist_screen::x2#0>=(byte) $27) goto init_dist_screen::@6
to:init_dist_screen::@7
init_dist_screen::@7: scope:[init_dist_screen] from init_dist_screen::@5
[165] (byte~) init_dist_screen::$13 ← (byte) $27 - (byte) init_dist_screen::x2#0
[164] (byte~) init_dist_screen::$13 ← (byte) $27 - (byte) init_dist_screen::x2#0
to:init_dist_screen::@8
init_dist_screen::@8: scope:[init_dist_screen] from init_dist_screen::@6 init_dist_screen::@7
[166] (byte) init_dist_screen::xd#0 ← phi( init_dist_screen::@6/(byte~) init_dist_screen::$15 init_dist_screen::@7/(byte~) init_dist_screen::$13 )
[167] (byte) sqr::val#1 ← (byte) init_dist_screen::xd#0
[168] call sqr
[169] (word) sqr::return#3 ← (word) sqr::return#0
[165] (byte) init_dist_screen::xd#0 ← phi( init_dist_screen::@6/(byte~) init_dist_screen::$15 init_dist_screen::@7/(byte~) init_dist_screen::$13 )
[166] (byte) sqr::val#1 ← (byte) init_dist_screen::xd#0
[167] call sqr
[168] (word) sqr::return#3 ← (word) sqr::return#0
to:init_dist_screen::@11
init_dist_screen::@11: scope:[init_dist_screen] from init_dist_screen::@8
[170] (word) init_dist_screen::xds#0 ← (word) sqr::return#3
[171] (word) init_dist_screen::ds#0 ← (word) init_dist_screen::xds#0 + (word) init_dist_screen::yds#0
[172] (word) sqrt::val#0 ← (word) init_dist_screen::ds#0
[173] call sqrt
[174] (byte) sqrt::return#2 ← (byte) sqrt::return#0
[169] (word) init_dist_screen::xds#0 ← (word) sqr::return#3
[170] (word) init_dist_screen::ds#0 ← (word) init_dist_screen::xds#0 + (word) init_dist_screen::yds#0
[171] (word) sqrt::val#0 ← (word) init_dist_screen::ds#0
[172] call sqrt
[173] (byte) sqrt::return#2 ← (byte) sqrt::return#0
to:init_dist_screen::@12
init_dist_screen::@12: scope:[init_dist_screen] from init_dist_screen::@11
[175] (byte) init_dist_screen::d#0 ← (byte) sqrt::return#2
[176] *((byte*) init_dist_screen::screen_topline#10 + (byte) init_dist_screen::x#2) ← (byte) init_dist_screen::d#0
[177] *((byte*) init_dist_screen::screen_bottomline#10 + (byte) init_dist_screen::x#2) ← (byte) init_dist_screen::d#0
[178] *((byte*) init_dist_screen::screen_topline#10 + (byte) init_dist_screen::xb#2) ← (byte) init_dist_screen::d#0
[179] *((byte*) init_dist_screen::screen_bottomline#10 + (byte) init_dist_screen::xb#2) ← (byte) init_dist_screen::d#0
[180] (byte) init_dist_screen::x#1 ← ++ (byte) init_dist_screen::x#2
[181] (byte) init_dist_screen::xb#1 ← -- (byte) init_dist_screen::xb#2
[182] if((byte) init_dist_screen::x#1<(byte) $13+(byte) 1) goto init_dist_screen::@5
[174] (byte) init_dist_screen::d#0 ← (byte) sqrt::return#2
[175] *((byte*) init_dist_screen::screen_topline#10 + (byte) init_dist_screen::x#2) ← (byte) init_dist_screen::d#0
[176] *((byte*) init_dist_screen::screen_bottomline#10 + (byte) init_dist_screen::x#2) ← (byte) init_dist_screen::d#0
[177] *((byte*) init_dist_screen::screen_topline#10 + (byte) init_dist_screen::xb#2) ← (byte) init_dist_screen::d#0
[178] *((byte*) init_dist_screen::screen_bottomline#10 + (byte) init_dist_screen::xb#2) ← (byte) init_dist_screen::d#0
[179] (byte) init_dist_screen::x#1 ← ++ (byte) init_dist_screen::x#2
[180] (byte) init_dist_screen::xb#1 ← -- (byte) init_dist_screen::xb#2
[181] if((byte) init_dist_screen::x#1<(byte) $13+(byte) 1) goto init_dist_screen::@5
to:init_dist_screen::@9
init_dist_screen::@9: scope:[init_dist_screen] from init_dist_screen::@12
[183] (byte*) init_dist_screen::screen_topline#1 ← (byte*) init_dist_screen::screen_topline#10 + (byte) $28
[184] (byte*) init_dist_screen::screen_bottomline#1 ← (byte*) init_dist_screen::screen_bottomline#10 - (byte) $28
[185] (byte) init_dist_screen::y#1 ← ++ (byte) init_dist_screen::y#10
[186] if((byte) init_dist_screen::y#1!=(byte) $d) goto init_dist_screen::@1
[182] (byte*) init_dist_screen::screen_topline#1 ← (byte*) init_dist_screen::screen_topline#10 + (byte) $28
[183] (byte*) init_dist_screen::screen_bottomline#1 ← (byte*) init_dist_screen::screen_bottomline#10 - (byte) $28
[184] (byte) init_dist_screen::y#1 ← ++ (byte) init_dist_screen::y#10
[185] if((byte) init_dist_screen::y#1!=(byte) $d) goto init_dist_screen::@1
to:init_dist_screen::@return
init_dist_screen::@return: scope:[init_dist_screen] from init_dist_screen::@9
[187] return
[186] return
to:@return
init_dist_screen::@6: scope:[init_dist_screen] from init_dist_screen::@5
[188] (byte~) init_dist_screen::$15 ← (byte) init_dist_screen::x2#0 - (byte) $27
[187] (byte~) init_dist_screen::$15 ← (byte) init_dist_screen::x2#0 - (byte) $27
to:init_dist_screen::@8
init_dist_screen::@2: scope:[init_dist_screen] from init_dist_screen::@1
[189] (byte~) init_dist_screen::$7 ← (byte) init_dist_screen::y2#0 - (byte) $18
[188] (byte~) init_dist_screen::$7 ← (byte) init_dist_screen::y2#0 - (byte) $18
to:init_dist_screen::@4
sqrt: scope:[sqrt] from init_dist_screen::@11
[190] (word) bsearch16u::key#0 ← (word) sqrt::val#0
[191] (word*) bsearch16u::items#1 ← (word*)(void*) SQUARES#1
[192] call bsearch16u
[193] (word*) bsearch16u::return#3 ← (word*) bsearch16u::return#1
[189] (word) bsearch16u::key#0 ← (word) sqrt::val#0
[190] (word*) bsearch16u::items#1 ← (word*)(void*) SQUARES#1
[191] call bsearch16u
[192] (word*) bsearch16u::return#3 ← (word*) bsearch16u::return#1
to:sqrt::@1
sqrt::@1: scope:[sqrt] from sqrt
[194] (word*) sqrt::found#0 ← (word*) bsearch16u::return#3
[195] (word~) sqrt::$3 ← (word*) sqrt::found#0 - (word*)(void*) SQUARES#1
[196] (word~) sqrt::$1 ← (word~) sqrt::$3 >> (byte) 1
[197] (byte) sqrt::return#0 ← (byte)(word~) sqrt::$1
[193] (word*) sqrt::found#0 ← (word*) bsearch16u::return#3
[194] (word~) sqrt::$3 ← (word*) sqrt::found#0 - (word*)(void*) SQUARES#1
[195] (word~) sqrt::$1 ← (word~) sqrt::$3 >> (byte) 1
[196] (byte) sqrt::return#0 ← (byte)(word~) sqrt::$1
to:sqrt::@return
sqrt::@return: scope:[sqrt] from sqrt::@1
[198] return
[197] return
to:@return
bsearch16u: scope:[bsearch16u] from sqrt
[199] phi()
[198] phi()
to:bsearch16u::@3
bsearch16u::@3: scope:[bsearch16u] from bsearch16u bsearch16u::@7
[200] (word*) bsearch16u::items#2 ← phi( bsearch16u/(word*) bsearch16u::items#1 bsearch16u::@7/(word*) bsearch16u::items#8 )
[200] (byte) bsearch16u::num#3 ← phi( bsearch16u/(const byte) NUM_SQUARES#3 bsearch16u::@7/(byte) bsearch16u::num#0 )
[201] if((byte) bsearch16u::num#3>(byte) 0) goto bsearch16u::@4
[199] (word*) bsearch16u::items#2 ← phi( bsearch16u/(word*) bsearch16u::items#1 bsearch16u::@7/(word*) bsearch16u::items#8 )
[199] (byte) bsearch16u::num#3 ← phi( bsearch16u/(const byte) NUM_SQUARES#3 bsearch16u::@7/(byte) bsearch16u::num#0 )
[200] if((byte) bsearch16u::num#3>(byte) 0) goto bsearch16u::@4
to:bsearch16u::@5
bsearch16u::@5: scope:[bsearch16u] from bsearch16u::@3
[202] if(*((word*) bsearch16u::items#2)<=(word) bsearch16u::key#0) goto bsearch16u::@2
[201] if(*((word*) bsearch16u::items#2)<=(word) bsearch16u::key#0) goto bsearch16u::@2
to:bsearch16u::@1
bsearch16u::@1: scope:[bsearch16u] from bsearch16u::@5
[203] (word*~) bsearch16u::$2 ← (word*) bsearch16u::items#2 - (byte) 1*(const byte) SIZEOF_WORD
[202] (word*~) bsearch16u::$2 ← (word*) bsearch16u::items#2 - (byte) 1*(const byte) SIZEOF_WORD
to:bsearch16u::@2
bsearch16u::@2: scope:[bsearch16u] from bsearch16u::@1 bsearch16u::@5
[204] (word*) bsearch16u::return#2 ← phi( bsearch16u::@5/(word*) bsearch16u::items#2 bsearch16u::@1/(word*~) bsearch16u::$2 )
[203] (word*) bsearch16u::return#2 ← phi( bsearch16u::@5/(word*) bsearch16u::items#2 bsearch16u::@1/(word*~) bsearch16u::$2 )
to:bsearch16u::@return
bsearch16u::@return: scope:[bsearch16u] from bsearch16u::@2 bsearch16u::@8
[205] (word*) bsearch16u::return#1 ← phi( bsearch16u::@8/(word*~) bsearch16u::return#6 bsearch16u::@2/(word*) bsearch16u::return#2 )
[206] return
[204] (word*) bsearch16u::return#1 ← phi( bsearch16u::@8/(word*~) bsearch16u::return#6 bsearch16u::@2/(word*) bsearch16u::return#2 )
[205] return
to:@return
bsearch16u::@4: scope:[bsearch16u] from bsearch16u::@3
[207] (byte~) bsearch16u::$6 ← (byte) bsearch16u::num#3 >> (byte) 1
[208] (byte~) bsearch16u::$16 ← (byte~) bsearch16u::$6 << (byte) 1
[209] (word*) bsearch16u::pivot#0 ← (word*) bsearch16u::items#2 + (byte~) bsearch16u::$16
[210] (signed word) bsearch16u::result#0 ← (signed word)(word) bsearch16u::key#0 - (signed word)*((word*) bsearch16u::pivot#0)
[211] if((signed word) bsearch16u::result#0!=(signed byte) 0) goto bsearch16u::@6
[206] (byte~) bsearch16u::$6 ← (byte) bsearch16u::num#3 >> (byte) 1
[207] (byte~) bsearch16u::$16 ← (byte~) bsearch16u::$6 << (byte) 1
[208] (word*) bsearch16u::pivot#0 ← (word*) bsearch16u::items#2 + (byte~) bsearch16u::$16
[209] (signed word) bsearch16u::result#0 ← (signed word)(word) bsearch16u::key#0 - (signed word)*((word*) bsearch16u::pivot#0)
[210] if((signed word) bsearch16u::result#0!=(signed byte) 0) goto bsearch16u::@6
to:bsearch16u::@8
bsearch16u::@8: scope:[bsearch16u] from bsearch16u::@4
[212] (word*~) bsearch16u::return#6 ← (word*) bsearch16u::pivot#0
[211] (word*~) bsearch16u::return#6 ← (word*) bsearch16u::pivot#0
to:bsearch16u::@return
bsearch16u::@6: scope:[bsearch16u] from bsearch16u::@4
[213] if((signed word) bsearch16u::result#0<=(signed byte) 0) goto bsearch16u::@7
[212] if((signed word) bsearch16u::result#0<=(signed byte) 0) goto bsearch16u::@7
to:bsearch16u::@9
bsearch16u::@9: scope:[bsearch16u] from bsearch16u::@6
[214] (word*) bsearch16u::items#0 ← (word*) bsearch16u::pivot#0 + (byte) 1*(const byte) SIZEOF_WORD
[215] (byte) bsearch16u::num#1 ← -- (byte) bsearch16u::num#3
[213] (word*) bsearch16u::items#0 ← (word*) bsearch16u::pivot#0 + (byte) 1*(const byte) SIZEOF_WORD
[214] (byte) bsearch16u::num#1 ← -- (byte) bsearch16u::num#3
to:bsearch16u::@7
bsearch16u::@7: scope:[bsearch16u] from bsearch16u::@6 bsearch16u::@9
[216] (word*) bsearch16u::items#8 ← phi( bsearch16u::@9/(word*) bsearch16u::items#0 bsearch16u::@6/(word*) bsearch16u::items#2 )
[216] (byte) bsearch16u::num#5 ← phi( bsearch16u::@9/(byte) bsearch16u::num#1 bsearch16u::@6/(byte) bsearch16u::num#3 )
[217] (byte) bsearch16u::num#0 ← (byte) bsearch16u::num#5 >> (byte) 1
[215] (word*) bsearch16u::items#8 ← phi( bsearch16u::@9/(word*) bsearch16u::items#0 bsearch16u::@6/(word*) bsearch16u::items#2 )
[215] (byte) bsearch16u::num#5 ← phi( bsearch16u::@9/(byte) bsearch16u::num#1 bsearch16u::@6/(byte) bsearch16u::num#3 )
[216] (byte) bsearch16u::num#0 ← (byte) bsearch16u::num#5 >> (byte) 1
to:bsearch16u::@3
sqr: scope:[sqr] from init_dist_screen::@4 init_dist_screen::@8
[218] (byte) sqr::val#2 ← phi( init_dist_screen::@4/(byte) sqr::val#0 init_dist_screen::@8/(byte) sqr::val#1 )
[219] (byte~) sqr::$0 ← (byte) sqr::val#2 << (byte) 1
[220] (word) sqr::return#0 ← *((word*)(void*) SQUARES#1 + (byte~) sqr::$0)
[217] (byte) sqr::val#2 ← phi( init_dist_screen::@4/(byte) sqr::val#0 init_dist_screen::@8/(byte) sqr::val#1 )
[218] (byte~) sqr::$0 ← (byte) sqr::val#2 << (byte) 1
[219] (word) sqr::return#0 ← *((word*)(void*) SQUARES#1 + (byte~) sqr::$0)
to:sqr::@return
sqr::@return: scope:[sqr] from sqr
[221] return
[220] return
to:@return
init_squares: scope:[init_squares] from init_dist_screen
[222] phi()
[223] call malloc
[221] phi()
[222] call malloc
to:init_squares::@2
init_squares::@2: scope:[init_squares] from init_squares
[224] (void*) SQUARES#1 ← (void*)(byte*) malloc::mem#0
[225] (word*) init_squares::squares#0 ← (word*)(void*) SQUARES#1
[223] (void*) SQUARES#1 ← (void*)(byte*) malloc::mem#0
[224] (word*) init_squares::squares#0 ← (word*)(void*) SQUARES#1
to:init_squares::@1
init_squares::@1: scope:[init_squares] from init_squares::@1 init_squares::@2
[226] (byte) init_squares::i#2 ← phi( init_squares::@1/(byte) init_squares::i#1 init_squares::@2/(byte) 0 )
[226] (word*) init_squares::squares#2 ← phi( init_squares::@1/(word*) init_squares::squares#1 init_squares::@2/(word*) init_squares::squares#0 )
[226] (word) init_squares::sqr#2 ← phi( init_squares::@1/(word) init_squares::sqr#1 init_squares::@2/(byte) 0 )
[227] *((word*) init_squares::squares#2) ← (word) init_squares::sqr#2
[228] (word*) init_squares::squares#1 ← (word*) init_squares::squares#2 + (const byte) SIZEOF_WORD
[229] (byte~) init_squares::$3 ← (byte) init_squares::i#2 << (byte) 1
[230] (byte~) init_squares::$4 ← (byte~) init_squares::$3 + (byte) 1
[231] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$4
[232] (byte) init_squares::i#1 ← ++ (byte) init_squares::i#2
[233] if((byte) init_squares::i#1!=(const byte) NUM_SQUARES#3-(byte) 1+(byte) 1) goto init_squares::@1
[225] (byte) init_squares::i#2 ← phi( init_squares::@1/(byte) init_squares::i#1 init_squares::@2/(byte) 0 )
[225] (word*) init_squares::squares#2 ← phi( init_squares::@1/(word*) init_squares::squares#1 init_squares::@2/(word*) init_squares::squares#0 )
[225] (word) init_squares::sqr#2 ← phi( init_squares::@1/(word) init_squares::sqr#1 init_squares::@2/(byte) 0 )
[226] *((word*) init_squares::squares#2) ← (word) init_squares::sqr#2
[227] (word*) init_squares::squares#1 ← (word*) init_squares::squares#2 + (const byte) SIZEOF_WORD
[228] (byte~) init_squares::$3 ← (byte) init_squares::i#2 << (byte) 1
[229] (byte~) init_squares::$4 ← (byte~) init_squares::$3 + (byte) 1
[230] (word) init_squares::sqr#1 ← (word) init_squares::sqr#2 + (byte~) init_squares::$4
[231] (byte) init_squares::i#1 ← ++ (byte) init_squares::i#2
[232] if((byte) init_squares::i#1!=(const byte) NUM_SQUARES#3-(byte) 1+(byte) 1) goto init_squares::@1
to:init_squares::@return
init_squares::@return: scope:[init_squares] from init_squares::@1
[234] return
[233] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -80,7 +80,7 @@
(byte) atan2_16::shift#2 reg byte y 8001.25
(byte~) atan2_16::shift#5 reg byte y 667.3333333333334
(signed word) atan2_16::x
(signed word) atan2_16::x#0 x zp ZP_WORD:60 2.8684210526315796
(signed word) atan2_16::x#0 x zp ZP_WORD:59 2.8684210526315796
(signed word) atan2_16::xd
(signed word) atan2_16::xd#1 xd zp ZP_WORD:30 6667.333333333333
(signed word~) atan2_16::xd#10 xd zp ZP_WORD:30 1001.0
@ -95,7 +95,7 @@
(signed word) atan2_16::xi#3 xi zp ZP_WORD:24 267.0666666666667
(signed word) atan2_16::xi#8 xi zp ZP_WORD:24 1001.0
(signed word) atan2_16::y
(signed word) atan2_16::y#0 y zp ZP_WORD:62 2.724999999999999
(signed word) atan2_16::y#0 y zp ZP_WORD:61 2.724999999999999
(signed word) atan2_16::yd
(signed word) atan2_16::yd#1 yd zp ZP_WORD:28 10001.0
(signed word~) atan2_16::yd#10 yd zp ZP_WORD:28 2002.0
@ -129,16 +129,16 @@
(word*) bsearch16u::items#2 items zp ZP_WORD:39 334.5555555555556
(word*) bsearch16u::items#8 items zp ZP_WORD:39 1501.5
(word) bsearch16u::key
(word) bsearch16u::key#0 key zp ZP_WORD:67 0.26666666666666666
(word) bsearch16u::key#0 key zp ZP_WORD:66 0.26666666666666666
(byte) bsearch16u::num
(byte) bsearch16u::num#0 reg byte x 2002.0
(byte) bsearch16u::num#1 reg byte x 2002.0
(byte) bsearch16u::num#3 reg byte x 556.1111111111111
(byte) bsearch16u::num#5 reg byte x 3003.0
(word*) bsearch16u::pivot
(word*) bsearch16u::pivot#0 pivot zp ZP_WORD:69 501.0
(word*) bsearch16u::pivot#0 pivot zp ZP_WORD:68 501.0
(signed word) bsearch16u::result
(signed word) bsearch16u::result#0 result zp ZP_WORD:71 1501.5
(signed word) bsearch16u::result#0 result zp ZP_WORD:70 1501.5
(word*) bsearch16u::return
(word*) bsearch16u::return#1 return zp ZP_WORD:39 2.0
(word*) bsearch16u::return#2 return zp ZP_WORD:39 6.0
@ -161,7 +161,7 @@
(label) init_angle_screen::@4
(label) init_angle_screen::@return
(byte) init_angle_screen::ang_w
(byte) init_angle_screen::ang_w#0 ang_w zp ZP_BYTE:64 84.16666666666666
(byte) init_angle_screen::ang_w#0 ang_w zp ZP_BYTE:63 84.16666666666666
(word) init_angle_screen::angle_w
(word) init_angle_screen::angle_w#0 angle_w zp ZP_WORD:26 202.0
(byte*) init_angle_screen::screen
@ -178,18 +178,18 @@
(byte) init_angle_screen::xb#1 xb zp ZP_BYTE:21 101.0
(byte) init_angle_screen::xb#2 xb zp ZP_BYTE:21 19.238095238095237
(signed word) init_angle_screen::xw
(word) init_angle_screen::xw#0 xw zp ZP_WORD:60 33.666666666666664
(word) init_angle_screen::xw#0 xw zp ZP_WORD:59 33.666666666666664
(byte) init_angle_screen::y
(byte) init_angle_screen::y#1 y zp ZP_BYTE:15 16.5
(byte) init_angle_screen::y#4 y zp ZP_BYTE:15 4.730769230769231
(signed word) init_angle_screen::yw
(word) init_angle_screen::yw#0 yw zp ZP_WORD:62 50.5
(word) init_angle_screen::yw#0 yw zp ZP_WORD:61 50.5
(void()) init_buckets()
(byte~) init_buckets::$11 reg byte a 22.0
(byte~) init_buckets::$12 reg byte a 22.0
(byte~) init_buckets::$13 reg byte a 22.0
(void*~) init_buckets::$5 $5 zp ZP_WORD:13 5.5
(word~) init_buckets::$9 $9 zp ZP_WORD:58 11.0
(word~) init_buckets::$9 $9 zp ZP_WORD:57 11.0
(label) init_buckets::@1
(label) init_buckets::@2
(label) init_buckets::@3
@ -198,14 +198,14 @@
(label) init_buckets::@6
(label) init_buckets::@return
(word*) init_buckets::bucket
(word*) init_buckets::bucket#0 bucket zp ZP_WORD:56 5.5
(word*) init_buckets::bucket#0 bucket zp ZP_WORD:55 7.333333333333333
(byte*) init_buckets::dist
(byte*) init_buckets::dist#1 dist zp ZP_WORD:3 7.333333333333333
(byte*) init_buckets::dist#3 dist#3 zp ZP_WORD:7 7.333333333333333
(byte*) init_buckets::dist#4 dist zp ZP_WORD:3 22.0
(byte*) init_buckets::dist#5 dist#5 zp ZP_WORD:7 4.888888888888889
(byte*) init_buckets::dist#5 dist#5 zp ZP_WORD:7 5.5
(byte) init_buckets::distance
(byte) init_buckets::distance#0 distance zp ZP_BYTE:55 7.857142857142857
(byte) init_buckets::distance#0 reg byte x 9.166666666666666
(byte) init_buckets::i
(byte) init_buckets::i#1 reg byte x 16.5
(byte) init_buckets::i#2 reg byte x 16.5
@ -220,9 +220,7 @@
(byte) init_buckets::i3#2 reg byte x 16.5
(word) init_buckets::i4
(word) init_buckets::i4#1 i4 zp ZP_WORD:9 16.5
(word) init_buckets::i4#2 i4 zp ZP_WORD:9 2.2
(byte) init_buckets::idx
(byte) init_buckets::idx#0 reg byte x 11.0
(word) init_buckets::i4#2 i4 zp ZP_WORD:9 2.4444444444444446
(void()) init_dist_screen((byte*) init_dist_screen::screen)
(byte~) init_dist_screen::$13 reg byte a 202.0
(byte~) init_dist_screen::$15 reg byte a 202.0
@ -244,7 +242,7 @@
(byte) init_dist_screen::d
(byte) init_dist_screen::d#0 reg byte a 126.25
(word) init_dist_screen::ds
(word) init_dist_screen::ds#0 ds zp ZP_WORD:67 202.0
(word) init_dist_screen::ds#0 ds zp ZP_WORD:66 202.0
(byte*) init_dist_screen::screen
(byte*) init_dist_screen::screen_bottomline
(byte*) init_dist_screen::screen_bottomline#1 screen_bottomline zp ZP_WORD:35 7.333333333333333
@ -263,7 +261,7 @@
(byte) init_dist_screen::xd
(byte) init_dist_screen::xd#0 reg byte a 303.0
(word) init_dist_screen::xds
(word) init_dist_screen::xds#0 xds zp ZP_WORD:67 202.0
(word) init_dist_screen::xds#0 xds zp ZP_WORD:66 202.0
(byte) init_dist_screen::y
(byte) init_dist_screen::y#1 y zp ZP_BYTE:32 16.5
(byte) init_dist_screen::y#10 y zp ZP_BYTE:32 0.9705882352941178
@ -272,7 +270,7 @@
(byte) init_dist_screen::yd
(byte) init_dist_screen::yd#0 reg byte a 33.0
(word) init_dist_screen::yds
(word) init_dist_screen::yds#0 yds zp ZP_WORD:65 4.869565217391305
(word) init_dist_screen::yds#0 yds zp ZP_WORD:64 4.869565217391305
(void()) init_squares()
(byte~) init_squares::$3 reg byte a 22.0
(byte~) init_squares::$4 reg byte a 22.0
@ -342,9 +340,9 @@
(byte~) sqr::$0 reg byte a 4.0
(label) sqr::@return
(word) sqr::return
(word) sqr::return#0 return zp ZP_WORD:67 28.5
(word) sqr::return#2 return#2 zp ZP_WORD:65 22.0
(word) sqr::return#3 return zp ZP_WORD:67 202.0
(word) sqr::return#0 return zp ZP_WORD:66 28.5
(word) sqr::return#2 return#2 zp ZP_WORD:64 22.0
(word) sqr::return#3 return zp ZP_WORD:66 202.0
(byte) sqr::val
(byte) sqr::val#0 reg byte a 22.0
(byte) sqr::val#1 reg byte a 202.0
@ -361,7 +359,7 @@
(byte) sqrt::return#2 reg byte a 202.0
(byte) sqrt::sq
(word) sqrt::val
(word) sqrt::val#0 val zp ZP_WORD:67 103.0
(word) sqrt::val#0 val zp ZP_WORD:66 103.0
zp ZP_BYTE:2 [ main::bucket_idx#11 main::bucket_idx#6 main::bucket_idx#1 ]
reg byte x [ main::i#2 main::i#1 ]
@ -411,34 +409,33 @@ zp ZP_WORD:51 [ main::bucket1#0 ]
reg byte a [ main::$18 ]
zp ZP_WORD:53 [ main::sc1#0 ]
reg byte a [ init_buckets::$11 ]
zp ZP_BYTE:55 [ init_buckets::distance#0 ]
reg byte x [ init_buckets::distance#0 ]
reg byte a [ init_buckets::$12 ]
zp ZP_WORD:56 [ init_buckets::bucket#0 ]
reg byte x [ init_buckets::idx#0 ]
zp ZP_WORD:58 [ init_buckets::$9 ]
zp ZP_WORD:55 [ init_buckets::bucket#0 ]
zp ZP_WORD:57 [ init_buckets::$9 ]
reg byte a [ init_buckets::$13 ]
reg byte a [ init_angle_screen::$2 ]
reg byte a [ init_angle_screen::$3 ]
zp ZP_WORD:60 [ init_angle_screen::xw#0 atan2_16::x#0 ]
zp ZP_WORD:59 [ init_angle_screen::xw#0 atan2_16::x#0 ]
reg byte a [ init_angle_screen::$6 ]
zp ZP_WORD:62 [ init_angle_screen::yw#0 atan2_16::y#0 ]
zp ZP_BYTE:64 [ init_angle_screen::ang_w#0 ]
zp ZP_WORD:61 [ init_angle_screen::yw#0 atan2_16::y#0 ]
zp ZP_BYTE:63 [ init_angle_screen::ang_w#0 ]
reg byte a [ init_angle_screen::$12 ]
reg byte a [ init_angle_screen::$13 ]
reg byte a [ init_angle_screen::$14 ]
reg byte a [ atan2_16::$24 ]
reg byte a [ atan2_16::$23 ]
reg byte a [ init_dist_screen::y2#0 ]
zp ZP_WORD:65 [ sqr::return#2 init_dist_screen::yds#0 ]
zp ZP_WORD:64 [ sqr::return#2 init_dist_screen::yds#0 ]
reg byte a [ init_dist_screen::x2#0 ]
zp ZP_WORD:67 [ sqr::return#3 init_dist_screen::xds#0 sqr::return#0 init_dist_screen::ds#0 sqrt::val#0 bsearch16u::key#0 ]
zp ZP_WORD:66 [ sqr::return#3 init_dist_screen::xds#0 sqr::return#0 init_dist_screen::ds#0 sqrt::val#0 bsearch16u::key#0 ]
reg byte a [ sqrt::return#2 ]
reg byte a [ init_dist_screen::d#0 ]
reg byte a [ sqrt::return#0 ]
reg byte a [ bsearch16u::$6 ]
reg byte a [ bsearch16u::$16 ]
zp ZP_WORD:69 [ bsearch16u::pivot#0 ]
zp ZP_WORD:71 [ bsearch16u::result#0 ]
zp ZP_WORD:68 [ bsearch16u::pivot#0 ]
zp ZP_WORD:70 [ bsearch16u::result#0 ]
reg byte a [ sqr::$0 ]
reg byte a [ init_squares::$3 ]
reg byte a [ init_squares::$4 ]