1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| .section __TEXT,__text,regular,pure_instructions
.build_version macos, 15, 0 sdk_version 15, 2
.globl _in_subnet ; -- Begin function in_subnet
.p2align 2
_in_subnet: ; @in_subnet
.cfi_startproc
; %bb.0:
mov w8, #32 ; 32 (max CIDR for IPv4)
sub w1, w8, w1 ; Calculate number of host bits
mvn w8, wzr ; Initialize all bits to 1
lsl w1, w8, w1 ; Create subnet mask by left-shifting ones
and w8, w1, w2 ; Mask the input IP address
cmp w0, w8 ; Compare masked IP with subnet
cset w0, eq ; Return 1 if match, 0 otherwise
ret
.cfi_endproc
; -- End function
.subsections_via_symbols
|