Skip to content

Instantly share code, notes, and snippets.

@Dirbaio

Dirbaio/wtf.s Secret

Created July 6, 2021 01:00
Show Gist options
  • Save Dirbaio/6a8df22cbf94009d725a28cf63ccd62d to your computer and use it in GitHub Desktop.
Save Dirbaio/6a8df22cbf94009d725a28cf63ccd62d to your computer and use it in GitHub Desktop.
======================================================
WITH CONST GENERICS
======================================================
00000a4c <_ZN5stack19construct_big_thing17hcfd785561be2ea0fE>:
a4c: b580 push {r7, lr}
a4e: 466f mov r7, sp
a50: f44f 5100 mov.w r1, #8192 ; 0x2000
a54: f000 fbd3 bl 11fe <__aeabi_memclr>
a58: bd80 pop {r7, pc}
======================================================
WITH GENERIC_ARRAY
======================================================
00000a4c <_ZN5stack19construct_big_thing17hddec5748d76af1f1E>:
a4c: b5f0 push {r4, r5, r6, r7, lr}
a4e: af03 add r7, sp, #12
a50: f84d 8d04 str.w r8, [sp, #-4]!
a54: f5ad 4dc0 sub.w sp, sp, #24576 ; 0x6000
a58: b082 sub sp, #8
a5a: 4604 mov r4, r0
a5c: f50d 5000 add.w r0, sp, #8192 ; 0x2000
a60: 3004 adds r0, #4
a62: 2100 movs r1, #0
a64: 2200 movs r2, #0
a66: f5b2 5f00 cmp.w r2, #8192 ; 0x2000
a6a: d002 beq.n a72 <_ZN5stack19construct_big_thing17hddec5748d76af1f1E+0x26>
a6c: 5481 strb r1, [r0, r2]
a6e: 3201 adds r2, #1
a70: e7f9 b.n a66 <_ZN5stack19construct_big_thing17hddec5748d76af1f1E+0x1a>
a72: f50d 5100 add.w r1, sp, #8192 ; 0x2000
a76: f44f 5000 mov.w r0, #8192 ; 0x2000
a7a: f242 0204 movw r2, #8196 ; 0x2004
a7e: 6008 str r0, [r1, #0]
a80: a801 add r0, sp, #4
a82: f500 4580 add.w r5, r0, #16384 ; 0x4000
a86: f50d 5100 add.w r1, sp, #8192 ; 0x2000
a8a: 4628 mov r0, r5
a8c: f000 fbd7 bl 123e <__aeabi_memcpy4>
a90: 1d29 adds r1, r5, #4
a92: 466d mov r5, sp
a94: 4628 mov r0, r5
a96: f44f 5200 mov.w r2, #8192 ; 0x2000
a9a: f000 fbd0 bl 123e <__aeabi_memcpy4>
a9e: 4620 mov r0, r4
aa0: 4629 mov r1, r5
aa2: f44f 5200 mov.w r2, #8192 ; 0x2000
aa6: f000 fbc8 bl 123a <__aeabi_memcpy>
aaa: f50d 4dc0 add.w sp, sp, #24576 ; 0x6000
aae: b002 add sp, #8
ab0: f85d 8b04 ldr.w r8, [sp], #4
ab4: bdf0 pop {r4, r5, r6, r7, pc}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment