	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setmediainst
_setmediainst:                          ## @setmediainst
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	%edx, %edi
	callq	_ifmedia_getstate
	movq	%rax, %r14
	movq	%r15, %rdi
	callq	_atoi
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_2
## %bb.1:
	movq	_IFM_INST_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jle	LBB0_3
LBB0_2:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	movq	%r15, %rdx
	callq	_errx
LBB0_3:
	movq	_ifr@GOTPCREL(%rip), %r15
	movl	4(%r15), %edi
	movq	_name@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edx
	callq	_strlcpy
	movq	_IFM_IMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	(%r14), %eax
	movq	_IFM_ISHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %ebx
	orl	%eax, %ebx
	movl	%ebx, (%r15)
	movl	%ebx, (%r14)
	movq	_setifmediacallback@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_callback_register              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_IFM_INST_MAX,8,3               ## @IFM_INST_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid media instance: %s"

	.comm	_ifr,8,2                        ## @ifr
	.comm	_name,4,2                       ## @name
	.comm	_IFM_IMASK,4,2                  ## @IFM_IMASK
	.comm	_IFM_ISHIFT,4,2                 ## @IFM_ISHIFT
	.comm	_setifmediacallback,4,2         ## @setifmediacallback
	.no_dead_strip	_setmediainst
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setmediainst
_setmediainst:                          ; @setmediainst
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x0
	mov	x0, x2
	bl	_ifmedia_getstate
	mov	x19, x0
	mov	x0, x21
	bl	_atoi
	mov	x20, x0
	tbnz	w0, #31, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _IFM_INST_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IFM_INST_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w20, w8
	b.le	LBB0_3
LBB0_2:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x21
	bl	_errx
LBB0_3:
Lloh5:
	adrp	x21, _ifr@GOTPAGE
Lloh6:
	ldr	x21, [x21, _ifr@GOTPAGEOFF]
	ldr	w0, [x21, #4]
Lloh7:
	adrp	x8, _name@GOTPAGE
Lloh8:
	ldr	x8, [x8, _name@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w2, #4
	bl	_strlcpy
	ldr	w8, [x19]
Lloh10:
	adrp	x9, _IFM_IMASK@GOTPAGE
Lloh11:
	ldr	x9, [x9, _IFM_IMASK@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	bic	w8, w8, w9
Lloh13:
	adrp	x9, _IFM_ISHIFT@GOTPAGE
Lloh14:
	ldr	x9, [x9, _IFM_ISHIFT@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	lsl	w9, w20, w9
	orr	w8, w9, w8
	str	w8, [x21]
	str	w8, [x19]
Lloh16:
	adrp	x8, _setifmediacallback@GOTPAGE
Lloh17:
	ldr	x8, [x8, _setifmediacallback@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	mov	x1, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_callback_register
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_IFM_INST_MAX,8,3               ; @IFM_INST_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid media instance: %s"

	.comm	_ifr,8,2                        ; @ifr
	.comm	_name,4,2                       ; @name
	.comm	_IFM_IMASK,4,2                  ; @IFM_IMASK
	.comm	_IFM_ISHIFT,4,2                 ; @IFM_ISHIFT
	.comm	_setifmediacallback,4,2         ; @setifmediacallback
	.no_dead_strip	_setmediainst
.subsections_via_symbols
