	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_port_mediaopt
_set_port_mediaopt:                     ## @set_port_mediaopt
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %r12d
	movq	%rdi, %r15
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_IFMEDIAREQ_NULISTENTRIES@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movl	$-1, %ebx
	cmpl	$2, %r12d
	jl	LBB0_10
## %bb.1:
	leaq	-96(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$32, %esi
	callq	_bzero
	movl	4(%r15), %eax
	movl	%eax, -72(%rbp)
	movq	%r13, -88(%rbp)
	movl	(%r14), %eax
	movl	%eax, -80(%rbp)
	movl	(%r15), %edi
	movq	_IOETHERSWITCHGETPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	_ioctl
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_err
LBB0_3:
	movl	(%r13), %edi
	callq	_IFM_TYPE
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	8(%r14), %rsi
	movl	%eax, %edi
	callq	_get_media_options
	movl	%eax, %ebx
	cmpl	$-1, %eax
	jne	LBB0_5
## %bb.4:
	movq	_EX_USAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r14), %rdx
	leaq	L_.str.1(%rip), %rsi
	callq	_errx
LBB0_5:
	movq	_IFM_HDX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	testl	%ebx, %ecx
	je	LBB0_6
## %bb.7:
	movq	_IFM_FDX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	-96(%rbp), %eax
	notl	%ecx
	andl	%ecx, %ebx
	jmp	LBB0_8
LBB0_6:
	movl	-96(%rbp), %eax
LBB0_8:
	orl	%ebx, %eax
	movl	%eax, -96(%rbp)
	movl	(%r15), %edi
	movq	_IOETHERSWITCHSETPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-96(%rbp), %rdx
	callq	_ioctl
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	_EX_OSERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_err
LBB0_10:
	movq	-64(%rbp), %rsp                 ## 8-byte Reload
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_IFMEDIAREQ_NULISTENTRIES,4,2   ## @IFMEDIAREQ_NULISTENTRIES
	.comm	_IOETHERSWITCHGETPORT,4,2       ## @IOETHERSWITCHGETPORT
	.comm	_EX_OSERR,4,2                   ## @EX_OSERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ioctl(IOETHERSWITCHGETPORT)"

	.comm	_EX_USAGE,4,2                   ## @EX_USAGE
L_.str.1:                               ## @.str.1
	.asciz	"invalid media options \"%s\""

	.comm	_IFM_HDX,4,2                    ## @IFM_HDX
	.comm	_IFM_FDX,4,2                    ## @IFM_FDX
	.comm	_IOETHERSWITCHSETPORT,4,2       ## @IOETHERSWITCHSETPORT
L_.str.2:                               ## @.str.2
	.asciz	"ioctl(IOETHERSWITCHSETPORT)"

	.no_dead_strip	_set_port_mediaopt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_port_mediaopt
_set_port_mediaopt:                     ; @set_port_mediaopt
	.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
	sub	sp, sp, #48
	mov	x20, x2
	mov	x19, x0
	mov	x22, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x23, _IFMEDIAREQ_NULISTENTRIES@GOTPAGE
Lloh4:
	ldr	x23, [x23, _IFMEDIAREQ_NULISTENTRIES@GOTPAGEOFF]
	ldr	w8, [x23]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	cmp	w1, #2
	b.ge	LBB0_2
; %bb.1:
	mov	w0, #-1
	b	LBB0_11
LBB0_2:
	sub	x0, x29, #88
	mov	w1, #32
	bl	_bzero
	stur	x21, [x29, #-80]
	ldr	w8, [x23]
	ldp	w0, w9, [x19]
	stur	w9, [x29, #-64]
	stur	w8, [x29, #-72]
Lloh7:
	adrp	x8, _IOETHERSWITCHGETPORT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IOETHERSWITCHGETPORT@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	sub	x2, x29, #88
	bl	_ioctl
Lloh10:
	adrp	x23, _EX_OSERR@GOTPAGE
Lloh11:
	ldr	x23, [x23, _EX_OSERR@GOTPAGEOFF]
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w0, [x23]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_err
LBB0_4:
	ldr	w0, [x21]
	bl	_IFM_TYPE
	ldr	x1, [x20, #8]
	bl	_get_media_options
	mov	x21, x0
	cmn	w0, #1
	b.ne	LBB0_6
; %bb.5:
Lloh14:
	adrp	x8, _EX_USAGE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EX_USAGE@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldr	x2, [x20, #8]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_errx
LBB0_6:
Lloh19:
	adrp	x8, _IFM_HDX@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IFM_HDX@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x8]
	tst	w9, w21
	b.eq	LBB0_8
; %bb.7:
Lloh22:
	adrp	x8, _IFM_FDX@GOTPAGE
Lloh23:
	ldr	x8, [x8, _IFM_FDX@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	ldur	w10, [x29, #-88]
	bic	w8, w10, w8
	bic	w21, w21, w9
	b	LBB0_9
LBB0_8:
	ldur	w8, [x29, #-88]
LBB0_9:
	orr	w8, w8, w21
	stur	w8, [x29, #-88]
	ldr	w0, [x19]
Lloh25:
	adrp	x8, _IOETHERSWITCHSETPORT@GOTPAGE
Lloh26:
	ldr	x8, [x8, _IOETHERSWITCHSETPORT@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	sub	x2, x29, #88
	bl	_ioctl
	cbz	x0, LBB0_11
; %bb.10:
	ldr	w0, [x23]
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_err
	mov	w0, #0
LBB0_11:
	mov	sp, x22
	ldur	x8, [x29, #-56]
Lloh30:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh31:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	sub	sp, x29, #48
	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_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_IFMEDIAREQ_NULISTENTRIES,4,2   ; @IFMEDIAREQ_NULISTENTRIES
	.comm	_IOETHERSWITCHGETPORT,4,2       ; @IOETHERSWITCHGETPORT
	.comm	_EX_OSERR,4,2                   ; @EX_OSERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ioctl(IOETHERSWITCHGETPORT)"

	.comm	_EX_USAGE,4,2                   ; @EX_USAGE
l_.str.1:                               ; @.str.1
	.asciz	"invalid media options \"%s\""

	.comm	_IFM_HDX,4,2                    ; @IFM_HDX
	.comm	_IFM_FDX,4,2                    ; @IFM_FDX
	.comm	_IOETHERSWITCHSETPORT,4,2       ; @IOETHERSWITCHSETPORT
l_.str.2:                               ; @.str.2
	.asciz	"ioctl(IOETHERSWITCHSETPORT)"

	.no_dead_strip	_set_port_mediaopt
.subsections_via_symbols
