	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ifmedia_getstate               ## -- Begin function ifmedia_getstate
	.p2align	4, 0x90
_ifmedia_getstate:                      ## @ifmedia_getstate
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, _ifmedia_getstate.ifmr(%rip)
	je	LBB0_1
LBB0_16:
	movq	_ifmedia_getstate.ifmr(%rip), %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%edi, %r14d
	movl	$24, %edi
	callq	_malloc
	movq	%rax, _ifmedia_getstate.ifmr(%rip)
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
	movq	_ifmedia_getstate.ifmr(%rip), %rax
LBB0_3:
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	_ifmedia_getstate.ifmr(%rip), %rax
	movl	16(%rax), %edi
	movq	_name@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	$4, %edx
	callq	_strlcpy
	movq	_ifmedia_getstate.ifmr(%rip), %rdx
	movl	$0, (%rdx)
	movq	$0, 8(%rdx)
	movq	_SIOCGIFXMEDIA@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	%r14d, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_ioctl
	movq	%rax, %r15
	testq	%rax, %rax
	jns	LBB0_6
## %bb.4:
	movq	_SIOCGIFMEDIA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	_ifmedia_getstate.ifmr(%rip), %edx
	movl	%r14d, %edi
	callq	_ioctl
	testq	%rax, %rax
	jns	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_6:
	movq	_ifmedia_getstate.ifmr(%rip), %rax
	movl	(%rax), %edi
	testl	%edi, %edi
	jne	LBB0_8
## %bb.7:
	movl	(%rbx), %edx
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	callq	_errx
	movq	_ifmedia_getstate.ifmr(%rip), %rax
	movl	(%rax), %edi
LBB0_8:
	shll	$2, %edi
	callq	_malloc
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_10:
	movq	_ifmedia_getstate.ifmr(%rip), %rdx
	movq	%rbx, 8(%rdx)
	testq	%r15, %r15
	js	LBB0_13
## %bb.11:
	movl	(%r12), %esi
	movl	%r14d, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_ioctl
	testq	%rax, %rax
	jns	LBB0_16
## %bb.12:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_15
LBB0_13:
	movq	_SIOCGIFMEDIA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_ioctl
	testq	%rax, %rax
	jns	LBB0_16
## %bb.14:
	leaq	L_.str.1(%rip), %rsi
LBB0_15:
	movl	$1, %edi
	callq	_err
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_ifmedia_getstate.ifmr,8,3 ## @ifmedia_getstate.ifmr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"malloc"

	.comm	_name,4,2                       ## @name
	.comm	_SIOCGIFXMEDIA,4,2              ## @SIOCGIFXMEDIA
	.comm	_SIOCGIFMEDIA,4,2               ## @SIOCGIFMEDIA
L_.str.1:                               ## @.str.1
	.asciz	"SIOCGIFMEDIA"

L_.str.2:                               ## @.str.2
	.asciz	"%s: no media types?"

L_.str.3:                               ## @.str.3
	.asciz	"SIOCGIFXMEDIA"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ifmedia_getstate               ; -- Begin function ifmedia_getstate
	.p2align	2
_ifmedia_getstate:                      ; @ifmedia_getstate
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	adrp	x22, _ifmedia_getstate.ifmr@PAGE
	ldr	x8, [x22, _ifmedia_getstate.ifmr@PAGEOFF]
	cbz	x8, LBB0_2
LBB0_1:
	ldr	x0, [x22, _ifmedia_getstate.ifmr@PAGEOFF]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x19, x0
	mov	w0, #24
	bl	_malloc
	str	x0, [x22, _ifmedia_getstate.ifmr@PAGEOFF]
	cbnz	x0, LBB0_4
; %bb.3:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
	ldr	x0, [x22, _ifmedia_getstate.ifmr@PAGEOFF]
LBB0_4:
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	ldr	x8, [x22, _ifmedia_getstate.ifmr@PAGEOFF]
	ldr	w0, [x8, #16]
Lloh2:
	adrp	x21, _name@GOTPAGE
Lloh3:
	ldr	x21, [x21, _name@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	w2, #4
	bl	_strlcpy
	ldr	x2, [x22, _ifmedia_getstate.ifmr@PAGEOFF]
	str	wzr, [x2]
	str	xzr, [x2, #8]
Lloh4:
	adrp	x23, _SIOCGIFXMEDIA@GOTPAGE
Lloh5:
	ldr	x23, [x23, _SIOCGIFXMEDIA@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_ioctl
	mov	x20, x0
	tbz	x0, #63, LBB0_7
; %bb.5:
Lloh6:
	adrp	x8, _SIOCGIFMEDIA@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SIOCGIFMEDIA@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	w2, [x22, _ifmedia_getstate.ifmr@PAGEOFF]
	mov	x0, x19
	bl	_ioctl
	tbz	x0, #63, LBB0_7
; %bb.6:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_7:
	ldr	x8, [x22, _ifmedia_getstate.ifmr@PAGEOFF]
	ldr	w8, [x8]
	cbnz	w8, LBB0_9
; %bb.8:
	ldr	w2, [x21]
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_errx
	ldr	x8, [x22, _ifmedia_getstate.ifmr@PAGEOFF]
	ldr	w8, [x8]
LBB0_9:
	lsl	w0, w8, #2
	bl	_malloc
	mov	x21, x0
	cbnz	x0, LBB0_11
; %bb.10:
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_11:
	ldr	x2, [x22, _ifmedia_getstate.ifmr@PAGEOFF]
	str	x21, [x2, #8]
	tbnz	x20, #63, LBB0_14
; %bb.12:
	ldr	w1, [x23]
	mov	x0, x19
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_ioctl
	tbz	x0, #63, LBB0_1
; %bb.13:
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_16
LBB0_14:
Lloh17:
	adrp	x8, _SIOCGIFMEDIA@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SIOCGIFMEDIA@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_ioctl
	tbz	x0, #63, LBB0_1
; %bb.15:
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_16:
	mov	w0, #1
	bl	_err
	b	LBB0_1
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_ifmedia_getstate.ifmr,8,3 ; @ifmedia_getstate.ifmr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"malloc"

	.comm	_name,4,2                       ; @name
	.comm	_SIOCGIFXMEDIA,4,2              ; @SIOCGIFXMEDIA
	.comm	_SIOCGIFMEDIA,4,2               ; @SIOCGIFMEDIA
l_.str.1:                               ; @.str.1
	.asciz	"SIOCGIFMEDIA"

l_.str.2:                               ; @.str.2
	.asciz	"%s: no media types?"

l_.str.3:                               ; @.str.3
	.asciz	"SIOCGIFXMEDIA"

.subsections_via_symbols
