Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compiled to machine code vs compiled to assembly
exl.o: file format elf32-avr
Disassembly of section .text:
00000000 <main>:
0: 0f 93 push r16
2: 1f 93 push r17
4: cf 93 push r28
6: df 93 push r29
8: 8d b7 in r24, 0x3d ; 61
a: 9e b7 in r25, 0x3e ; 62
c: 8f 8f std Y+31, r24 ; 0x1f
e: 98 a3 std Y+32, r25 ; 0x20
10: 0e 94 00 00 call 0 ; 0x0 <main>
14: 80 e0 ldi r24, 0x00 ; 0
16: 90 e0 ldi r25, 0x00 ; 0
18: 21 e0 ldi r18, 0x01 ; 1
1a: 30 e0 ldi r19, 0x00 ; 0
1c: 2d 8f std Y+29, r18 ; 0x1d
1e: 3e 8f std Y+30, r19 ; 0x1e
20: 8b 8f std Y+27, r24 ; 0x1b
22: 9c 8f std Y+28, r25 ; 0x1c
24: 01 c0 rjmp .+2 ; 0x28 <LBB0_1+0x2>
00000026 <LBB0_1>:
26: 8b 8d ldd r24, Y+27 ; 0x1b
28: 9c 8d ldd r25, Y+28 ; 0x1c
2a: 2d 8d ldd r18, Y+29 ; 0x1d
2c: 3e 8d ldd r19, Y+30 ; 0x1e
2e: ed b7 in r30, 0x3d ; 61
30: fe b7 in r31, 0x3e ; 62
32: 32 97 sbiw r30, 0x02 ; 2
34: ee 7f andi r30, 0xFE ; 254
36: ff 7f andi r31, 0xFF ; 255
38: 0f b6 in r0, 0x3f ; 63
3a: f8 94 cli
3c: fe bf out 0x3e, r31 ; 62
3e: 0f be out 0x3f, r0 ; 63
40: ed bf out 0x3d, r30 ; 61
42: af 01 movw r20, r30
44: 68 ee ldi r22, 0xE8 ; 232
46: 73 e0 ldi r23, 0x03 ; 3
48: 60 83 st Z, r22
4a: 71 83 std Z+1, r23 ; 0x01
4c: 60 e0 ldi r22, 0x00 ; 0
4e: 70 e0 ldi r23, 0x00 ; 0
50: e1 e0 ldi r30, 0x01 ; 1
52: f0 e0 ldi r31, 0x00 ; 0
54: 26 17 cp r18, r22
56: 37 07 cpc r19, r23
58: 89 8f std Y+25, r24 ; 0x19
5a: 9a 8f std Y+26, r25 ; 0x1a
5c: 2f 8b std Y+23, r18 ; 0x17
5e: 38 8f std Y+24, r19 ; 0x18
60: 4d 8b std Y+21, r20 ; 0x15
62: 5e 8b std Y+22, r21 ; 0x16
64: 6b 8b std Y+19, r22 ; 0x13
66: 7c 8b std Y+20, r23 ; 0x14
68: e9 8b std Y+17, r30 ; 0x11
6a: fa 8b std Y+18, r31 ; 0x12
6c: 05 f0 brhs .+0 ; 0x6e <LBB0_1+0x48>
6e: 8b 89 ldd r24, Y+19 ; 0x13
70: 9c 89 ldd r25, Y+20 ; 0x14
72: 89 8b std Y+17, r24 ; 0x11
74: 9a 8b std Y+18, r25 ; 0x12
00000076 <LBB0_3>:
76: 89 89 ldd r24, Y+17 ; 0x11
78: 9a 89 ldd r25, Y+18 ; 0x12
7a: 28 2f mov r18, r24
7c: 8f 89 ldd r24, Y+23 ; 0x17
7e: 98 8d ldd r25, Y+24 ; 0x18
80: 4b 89 ldd r20, Y+19 ; 0x13
82: 5c 89 ldd r21, Y+20 ; 0x14
84: 84 17 cp r24, r20
86: 95 07 cpc r25, r21
88: 28 8b std Y+16, r18 ; 0x10
8a: 07 f4 brid .+0 ; 0x8c <LBB0_3+0x16>
8c: 01 c0 rjmp .+2 ; 0x90 <LBB0_4+0x2>
0000008e <LBB0_4>:
8e: 80 e0 ldi r24, 0x00 ; 0
90: 6f ef ldi r22, 0xFF ; 255
92: 0e 94 00 00 call 0 ; 0x0 <main>
96: 06 c0 rjmp .+12 ; 0xa4 <LBB0_6+0x2>
00000098 <LBB0_5>:
98: 81 e0 ldi r24, 0x01 ; 1
9a: 6f ef ldi r22, 0xFF ; 255
9c: 0e 94 00 00 call 0 ; 0x0 <main>
a0: 01 c0 rjmp .+2 ; 0xa4 <LBB0_6+0x2>
000000a2 <LBB0_6>:
a2: 8d b7 in r24, 0x3d ; 61
a4: 9e b7 in r25, 0x3e ; 62
a6: 02 97 sbiw r24, 0x02 ; 2
a8: 8e 7f andi r24, 0xFE ; 254
aa: 9f 7f andi r25, 0xFF ; 255
ac: 0f b6 in r0, 0x3f ; 63
ae: f8 94 cli
b0: 9e bf out 0x3e, r25 ; 62
b2: 0f be out 0x3f, r0 ; 63
b4: 8d bf out 0x3d, r24 ; 61
b6: 28 ec ldi r18, 0xC8 ; 200
b8: 30 e0 ldi r19, 0x00 ; 0
ba: fc 01 movw r30, r24
bc: 20 83 st Z, r18
be: 31 83 std Z+1, r19 ; 0x01
c0: 80 e0 ldi r24, 0x00 ; 0
c2: 90 e0 ldi r25, 0x00 ; 0
c4: b9 01 movw r22, r18
c6: 8e 87 std Y+14, r24 ; 0x0e
c8: 9f 87 std Y+15, r25 ; 0x0f
ca: 0e 94 00 00 call 0 ; 0x0 <main>
ce: 89 8d ldd r24, Y+25 ; 0x19
d0: 9a 8d ldd r25, Y+26 ; 0x1a
d2: 88 53 subi r24, 0x38 ; 56
d4: 9f 4f sbci r25, 0xFF ; 255
d6: 40 e0 ldi r20, 0x00 ; 0
d8: 8c 87 std Y+12, r24 ; 0x0c
da: 9d 87 std Y+13, r25 ; 0x0d
dc: 84 2f mov r24, r20
de: 64 2f mov r22, r20
e0: 4b 87 std Y+11, r20 ; 0x0b
e2: 0e 94 00 00 call 0 ; 0x0 <main>
e6: 81 e0 ldi r24, 0x01 ; 1
e8: 6b 85 ldd r22, Y+11 ; 0x0b
ea: 0e 94 00 00 call 0 ; 0x0 <main>
ee: 2d 89 ldd r18, Y+21 ; 0x15
f0: 3e 89 ldd r19, Y+22 ; 0x16
f2: f9 01 movw r30, r18
f4: a0 81 ld r26, Z
f6: b1 81 ldd r27, Z+1 ; 0x01
f8: 88 89 ldd r24, Y+16 ; 0x10
fa: e8 2f mov r30, r24
fc: e1 70 andi r30, 0x01 ; 1
fe: f0 70 andi r31, 0x00 ; 0
100: c1 e0 ldi r28, 0x01 ; 1
102: d0 e0 ldi r29, 0x00 ; 0
104: 0e 85 ldd r16, Y+14 ; 0x0e
106: 1f 85 ldd r17, Y+15 ; 0x0f
108: e0 17 cp r30, r16
10a: f1 07 cpc r31, r17
10c: a9 87 std Y+9, r26 ; 0x09
10e: ba 87 std Y+10, r27 ; 0x0a
110: cf 83 std Y+7, r28 ; 0x07
112: d8 87 std Y+8, r29 ; 0x08
114: 05 f4 brhc .+0 ; 0x116 <LBB0_6+0x74>
116: 8e 85 ldd r24, Y+14 ; 0x0e
118: 9f 85 ldd r25, Y+15 ; 0x0f
11a: 8f 83 std Y+7, r24 ; 0x07
11c: 98 87 std Y+8, r25 ; 0x08
0000011e <LBB0_8>:
11e: 8f 81 ldd r24, Y+7 ; 0x07
120: 98 85 ldd r25, Y+8 ; 0x08
122: 29 85 ldd r18, Y+9 ; 0x09
124: 3a 85 ldd r19, Y+10 ; 0x0a
126: 4c 85 ldd r20, Y+12 ; 0x0c
128: 5d 85 ldd r21, Y+13 ; 0x0d
12a: 24 17 cp r18, r20
12c: 35 07 cpc r19, r21
12e: 8d 83 std Y+5, r24 ; 0x05
130: 9e 83 std Y+6, r25 ; 0x06
132: 05 f0 brhs .+0 ; 0x134 <LBB0_8+0x16>
134: 8f 89 ldd r24, Y+23 ; 0x17
136: 98 8d ldd r25, Y+24 ; 0x18
138: 8d 83 std Y+5, r24 ; 0x05
13a: 9e 83 std Y+6, r25 ; 0x06
0000013c <LBB0_10>:
13c: 8d 81 ldd r24, Y+5 ; 0x05
13e: 9e 81 ldd r25, Y+6 ; 0x06
140: 29 85 ldd r18, Y+9 ; 0x09
142: 3a 85 ldd r19, Y+10 ; 0x0a
144: 4c 85 ldd r20, Y+12 ; 0x0c
146: 5d 85 ldd r21, Y+13 ; 0x0d
148: 24 17 cp r18, r20
14a: 35 07 cpc r19, r21
14c: 6e 85 ldd r22, Y+14 ; 0x0e
14e: 7f 85 ldd r23, Y+15 ; 0x0f
150: 8b 83 std Y+3, r24 ; 0x03
152: 9c 83 std Y+4, r25 ; 0x04
154: 69 83 std Y+1, r22 ; 0x01
156: 7a 83 std Y+2, r23 ; 0x02
158: 05 f0 brhs .+0 ; 0x15a <LBB0_10+0x1e>
15a: 8c 85 ldd r24, Y+12 ; 0x0c
15c: 9d 85 ldd r25, Y+13 ; 0x0d
15e: 89 83 std Y+1, r24 ; 0x01
160: 9a 83 std Y+2, r25 ; 0x02
00000162 <LBB0_12>:
162: 89 81 ldd r24, Y+1 ; 0x01
164: 9a 81 ldd r25, Y+2 ; 0x02
166: 2b 81 ldd r18, Y+3 ; 0x03
168: 3c 81 ldd r19, Y+4 ; 0x04
16a: 2d 8f std Y+29, r18 ; 0x1d
16c: 3e 8f std Y+30, r19 ; 0x1e
16e: 8b 8f std Y+27, r24 ; 0x1b
170: 9c 8f std Y+28, r25 ; 0x1c
172: 5a c0 rjmp .+180 ; 0x228 <LBB0_12+0xc6>
.text
.file "/home/dylan/Desktop/exl.ll"
.globl main
.align 2
.type main,@function
main: ; @main
; BB#0: ; %entry
push r16
push r17
push r28
push r29
in r24, 61
in r25, 62
std Y+31, r24 ; 2-byte Folded Spill
std Y+32, r25 ; 2-byte Folded Spill
call init
ldi r24, 0
ldi r25, 0
ldi r18, 1
ldi r19, 0
std Y+29, r18 ; 2-byte Folded Spill
std Y+30, r19 ; 2-byte Folded Spill
std Y+27, r24 ; 2-byte Folded Spill
std Y+28, r25 ; 2-byte Folded Spill
rjmp LBB0_1
LBB0_1: ; %while_body
; =>This Inner Loop Header: Depth=1
ldd r24, Y+27 ; 2-byte Folded Reload
ldd r25, Y+28 ; 2-byte Folded Reload
ldd r18, Y+29 ; 2-byte Folded Reload
ldd r19, Y+30 ; 2-byte Folded Reload
in r30, 61
in r31, 62
sbiw r30, 2
andi r30, 254
andi r31, 255
in r0, 63
cli
out 62, r31
out 63, r0
out 61, r30
movw r20, r30
ldi r22, 232
ldi r23, 3
st Z, r22
std Z+1, r23
ldi r22, 0
ldi r23, 0
ldi r30, 1
ldi r31, 0
cp r18, r22
cpc r19, r23
std Y+25, r24 ; 2-byte Folded Spill
std Y+26, r25 ; 2-byte Folded Spill
std Y+23, r18 ; 2-byte Folded Spill
std Y+24, r19 ; 2-byte Folded Spill
std Y+21, r20 ; 2-byte Folded Spill
std Y+22, r21 ; 2-byte Folded Spill
std Y+19, r22 ; 2-byte Folded Spill
std Y+20, r23 ; 2-byte Folded Spill
std Y+17, r30 ; 2-byte Folded Spill
std Y+18, r31 ; 2-byte Folded Spill
breq LBB0_3
; BB#2: ; %while_body
; in Loop: Header=BB0_1 Depth=1
ldd r24, Y+19 ; 2-byte Folded Reload
ldd r25, Y+20 ; 2-byte Folded Reload
std Y+17, r24 ; 2-byte Folded Spill
std Y+18, r25 ; 2-byte Folded Spill
LBB0_3: ; %while_body
; in Loop: Header=BB0_1 Depth=1
ldd r24, Y+17 ; 2-byte Folded Reload
ldd r25, Y+18 ; 2-byte Folded Reload
mov r18, r24
ldd r24, Y+23 ; 2-byte Folded Reload
ldd r25, Y+24 ; 2-byte Folded Reload
ldd r20, Y+19 ; 2-byte Folded Reload
ldd r21, Y+20 ; 2-byte Folded Reload
cp r24, r20
cpc r25, r21
std Y+16, r18 ; 1-byte Folded Spill
brne LBB0_5
rjmp LBB0_4
LBB0_4: ; %if_then
; in Loop: Header=BB0_1 Depth=1
ldi r24, 0
ldi r22, -1
call digitalWrite
rjmp LBB0_6
LBB0_5: ; %if_else
; in Loop: Header=BB0_1 Depth=1
ldi r24, 1
ldi r22, -1
call digitalWrite
rjmp LBB0_6
LBB0_6: ; %if_cont
; in Loop: Header=BB0_1 Depth=1
in r24, 61
in r25, 62
sbiw r24, 2
andi r24, 254
andi r25, 255
in r0, 63
cli
out 62, r25
out 63, r0
out 61, r24
ldi r18, 200
ldi r19, 0
movw r30, r24
st Z, r18
std Z+1, r19
ldi r24, 0
ldi r25, 0
movw r22, r18
std Y+14, r24 ; 2-byte Folded Spill
std Y+15, r25 ; 2-byte Folded Spill
call delay
ldd r24, Y+25 ; 2-byte Folded Reload
ldd r25, Y+26 ; 2-byte Folded Reload
subi r24, 56
sbci r25, 255
ldi r20, 0
std Y+12, r24 ; 2-byte Folded Spill
std Y+13, r25 ; 2-byte Folded Spill
mov r24, r20
mov r22, r20
std Y+11, r20 ; 1-byte Folded Spill
call digitalWrite
ldi r24, 1
ldd r22, Y+11 ; 1-byte Folded Reload
call digitalWrite
ldd r18, Y+21 ; 2-byte Folded Reload
ldd r19, Y+22 ; 2-byte Folded Reload
movw r30, r18
ld r26, Z
ldd r27, Z+1
; implicit-def: R31R30
ldd r24, Y+16 ; 1-byte Folded Reload
mov r30, r24
andi r30, 1
andi r31, 0
ldi r28, 1
ldi r29, 0
ldd r16, Y+14 ; 2-byte Folded Reload
ldd r17, Y+15 ; 2-byte Folded Reload
cp r30, r16
cpc r31, r17
std Y+9, r26 ; 2-byte Folded Spill
std Y+10, r27 ; 2-byte Folded Spill
std Y+7, r28 ; 2-byte Folded Spill
std Y+8, r29 ; 2-byte Folded Spill
brne LBB0_8
; BB#7: ; %if_cont
; in Loop: Header=BB0_1 Depth=1
ldd r24, Y+14 ; 2-byte Folded Reload
ldd r25, Y+15 ; 2-byte Folded Reload
std Y+7, r24 ; 2-byte Folded Spill
std Y+8, r25 ; 2-byte Folded Spill
LBB0_8: ; %if_cont
; in Loop: Header=BB0_1 Depth=1
ldd r24, Y+7 ; 2-byte Folded Reload
ldd r25, Y+8 ; 2-byte Folded Reload
ldd r18, Y+9 ; 2-byte Folded Reload
ldd r19, Y+10 ; 2-byte Folded Reload
ldd r20, Y+12 ; 2-byte Folded Reload
ldd r21, Y+13 ; 2-byte Folded Reload
cp r18, r20
cpc r19, r21
std Y+5, r24 ; 2-byte Folded Spill
std Y+6, r25 ; 2-byte Folded Spill
brlt LBB0_10
; BB#9: ; %if_cont
; in Loop: Header=BB0_1 Depth=1
ldd r24, Y+23 ; 2-byte Folded Reload
ldd r25, Y+24 ; 2-byte Folded Reload
std Y+5, r24 ; 2-byte Folded Spill
std Y+6, r25 ; 2-byte Folded Spill
LBB0_10: ; %if_cont
; in Loop: Header=BB0_1 Depth=1
ldd r24, Y+5 ; 2-byte Folded Reload
ldd r25, Y+6 ; 2-byte Folded Reload
ldd r18, Y+9 ; 2-byte Folded Reload
ldd r19, Y+10 ; 2-byte Folded Reload
ldd r20, Y+12 ; 2-byte Folded Reload
ldd r21, Y+13 ; 2-byte Folded Reload
cp r18, r20
cpc r19, r21
ldd r22, Y+14 ; 2-byte Folded Reload
ldd r23, Y+15 ; 2-byte Folded Reload
std Y+3, r24 ; 2-byte Folded Spill
std Y+4, r25 ; 2-byte Folded Spill
std Y+1, r22 ; 2-byte Folded Spill
std Y+2, r23 ; 2-byte Folded Spill
brlt LBB0_12
; BB#11: ; %if_cont
; in Loop: Header=BB0_1 Depth=1
ldd r24, Y+12 ; 2-byte Folded Reload
ldd r25, Y+13 ; 2-byte Folded Reload
std Y+1, r24 ; 2-byte Folded Spill
std Y+2, r25 ; 2-byte Folded Spill
LBB0_12: ; %if_cont
; in Loop: Header=BB0_1 Depth=1
ldd r24, Y+1 ; 2-byte Folded Reload
ldd r25, Y+2 ; 2-byte Folded Reload
ldd r18, Y+3 ; 2-byte Folded Reload
ldd r19, Y+4 ; 2-byte Folded Reload
std Y+29, r18 ; 2-byte Folded Spill
std Y+30, r19 ; 2-byte Folded Spill
std Y+27, r24 ; 2-byte Folded Spill
std Y+28, r25 ; 2-byte Folded Spill
rjmp LBB0_1
.Lfunc_end0:
.size main, .Lfunc_end0-main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment