	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gb_interface_read_and_clear_init_status
_gb_interface_read_and_clear_init_status: ## @gb_interface_read_and_clear_init_status
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %r15
	movq	_GB_INTERFACE_QUIRK_NO_INIT_STATUS@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	andl	(%rdi), %eax
	jne	LBB0_1
## %bb.2:
	movq	_DME_TOSHIBA_GMP_INIT_STATUS@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_DME_T_TST_SRC_INCREMENT@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %r14d
	movl	(%r15), %edi
	movl	4(%rbx), %esi
	movq	_DME_SELECTOR_INDEX_NULL@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	leaq	-44(%rbp), %r8
	movl	%r14d, %edx
	callq	_gb_svc_dme_peer_get
	testl	%eax, %eax
	jne	LBB0_11
## %bb.4:
	movl	-44(%rbp), %ecx
	testl	%ecx, %ecx
	je	LBB0_5
## %bb.6:
	movl	(%rbx), %eax
	movl	%ecx, %esi
	sarl	$24, %esi
	testl	%eax, (%r13)
	movzbl	%cl, %edx
	cmovel	%esi, %edx
	movq	_GB_INTERFACE_QUIRK_NO_CPORT_FEATURES@GOTPCREL(%rip), %rsi
	movq	_GB_INTERFACE_QUIRK_FORCED_DISABLE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	orq	(%rsi), %rcx
	movq	_GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH@GOTPCREL(%rip), %rsi
	orq	(%rsi), %rcx
	movq	_GB_INTERFACE_QUIRK_NO_BUNDLE_ACTIVATE@GOTPCREL(%rip), %rsi
	orq	(%rsi), %rcx
	leal	-129(%rdx), %esi
	cmpl	$2, %esi
	jae	LBB0_7
## %bb.12:
	orl	%ecx, %eax
	jmp	LBB0_10
LBB0_5:
	addq	$8, %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_11
LBB0_7:
	movq	_GB_INTERFACE_QUIRK_NO_PM@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	cmpl	$128, %edx
	jne	LBB0_9
## %bb.8:
	notl	%ecx
	andl	%ecx, %eax
	orl	%eax, %esi
	movl	%esi, %eax
	jmp	LBB0_10
LBB0_9:
	orl	%esi, %ecx
	notl	%ecx
	andl	%ecx, %eax
LBB0_10:
	movl	%eax, (%rbx)
	movl	(%r15), %edi
	movl	4(%rbx), %esi
	movl	(%r12), %ecx
	movl	%r14d, %edx
	xorl	%r8d, %r8d
	callq	_gb_svc_dme_peer_set
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GB_INTERFACE_QUIRK_NO_INIT_STATUS,4,2 ## @GB_INTERFACE_QUIRK_NO_INIT_STATUS
	.comm	_DME_T_TST_SRC_INCREMENT,4,2    ## @DME_T_TST_SRC_INCREMENT
	.comm	_DME_TOSHIBA_GMP_INIT_STATUS,4,2 ## @DME_TOSHIBA_GMP_INIT_STATUS
	.comm	_DME_SELECTOR_INDEX_NULL,4,2    ## @DME_SELECTOR_INDEX_NULL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid init status\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GB_INTERFACE_QUIRK_NO_CPORT_FEATURES,8,3 ## @GB_INTERFACE_QUIRK_NO_CPORT_FEATURES
	.comm	_GB_INTERFACE_QUIRK_FORCED_DISABLE,8,3 ## @GB_INTERFACE_QUIRK_FORCED_DISABLE
	.comm	_GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH,8,3 ## @GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH
	.comm	_GB_INTERFACE_QUIRK_NO_BUNDLE_ACTIVATE,8,3 ## @GB_INTERFACE_QUIRK_NO_BUNDLE_ACTIVATE
	.comm	_GB_INTERFACE_QUIRK_NO_PM,8,3   ## @GB_INTERFACE_QUIRK_NO_PM
	.no_dead_strip	_gb_interface_read_and_clear_init_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gb_interface_read_and_clear_init_status
_gb_interface_read_and_clear_init_status: ; @gb_interface_read_and_clear_init_status
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	ldr	x21, [x0, #16]
Lloh0:
	adrp	x23, _GB_INTERFACE_QUIRK_NO_INIT_STATUS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GB_INTERFACE_QUIRK_NO_INIT_STATUS@GOTPAGEOFF]
Lloh2:
	adrp	x8, _DME_TOSHIBA_GMP_INIT_STATUS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DME_TOSHIBA_GMP_INIT_STATUS@GOTPAGEOFF]
	ldr	w9, [x23]
Lloh4:
	adrp	x10, _DME_T_TST_SRC_INCREMENT@GOTPAGE
Lloh5:
	ldr	x10, [x10, _DME_T_TST_SRC_INCREMENT@GOTPAGEOFF]
	ldp	w11, w1, [x0]
	tst	w9, w11
	csel	x8, x8, x10, eq
	ldr	w20, [x8]
	ldr	w0, [x21]
Lloh6:
	adrp	x22, _DME_SELECTOR_INDEX_NULL@GOTPAGE
Lloh7:
	ldr	x22, [x22, _DME_SELECTOR_INDEX_NULL@GOTPAGEOFF]
	ldr	w3, [x22]
	add	x4, sp, #12
	mov	x2, x20
	bl	_gb_svc_dme_peer_get
	cbnz	w0, LBB0_4
; %bb.1:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_3
; %bb.2:
	ldr	w9, [x23]
	and	w10, w8, #0xff
	asr	w8, w8, #24
	ldp	w11, w1, [x19]
	tst	w9, w11
Lloh8:
	adrp	x9, _GB_INTERFACE_QUIRK_NO_CPORT_FEATURES@GOTPAGE
Lloh9:
	ldr	x9, [x9, _GB_INTERFACE_QUIRK_NO_CPORT_FEATURES@GOTPAGEOFF]
	csel	w8, w8, w10, eq
Lloh10:
	ldr	x9, [x9]
Lloh11:
	adrp	x10, _GB_INTERFACE_QUIRK_FORCED_DISABLE@GOTPAGE
Lloh12:
	ldr	x10, [x10, _GB_INTERFACE_QUIRK_FORCED_DISABLE@GOTPAGEOFF]
Lloh13:
	ldr	x10, [x10]
	orr	x9, x10, x9
Lloh14:
	adrp	x10, _GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH@GOTPAGE
Lloh15:
	ldr	x10, [x10, _GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH@GOTPAGEOFF]
Lloh16:
	ldr	x10, [x10]
	orr	x9, x9, x10
Lloh17:
	adrp	x10, _GB_INTERFACE_QUIRK_NO_BUNDLE_ACTIVATE@GOTPAGE
Lloh18:
	ldr	x10, [x10, _GB_INTERFACE_QUIRK_NO_BUNDLE_ACTIVATE@GOTPAGEOFF]
Lloh19:
	ldr	x10, [x10]
	orr	x9, x9, x10
Lloh20:
	adrp	x10, _GB_INTERFACE_QUIRK_NO_PM@GOTPAGE
Lloh21:
	ldr	x10, [x10, _GB_INTERFACE_QUIRK_NO_PM@GOTPAGEOFF]
Lloh22:
	ldr	x10, [x10]
	bic	w12, w11, w9
	orr	w12, w12, w10
	orr	w10, w9, w10
	orr	w9, w11, w9
	bic	w10, w11, w10
	sub	w11, w8, #129
	cmp	w8, #128
	csel	w8, w12, w10, eq
	cmp	w11, #2
	csel	w8, w9, w8, lo
	str	w8, [x19]
	ldr	w0, [x21]
	ldr	w3, [x22]
	mov	x2, x20
	mov	w4, #0
	bl	_gb_svc_dme_peer_set
	b	LBB0_4
LBB0_3:
	add	x0, x19, #8
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh25:
	adrp	x8, _ENODEV@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_GB_INTERFACE_QUIRK_NO_INIT_STATUS,4,2 ; @GB_INTERFACE_QUIRK_NO_INIT_STATUS
	.comm	_DME_T_TST_SRC_INCREMENT,4,2    ; @DME_T_TST_SRC_INCREMENT
	.comm	_DME_TOSHIBA_GMP_INIT_STATUS,4,2 ; @DME_TOSHIBA_GMP_INIT_STATUS
	.comm	_DME_SELECTOR_INDEX_NULL,4,2    ; @DME_SELECTOR_INDEX_NULL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid init status\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GB_INTERFACE_QUIRK_NO_CPORT_FEATURES,8,3 ; @GB_INTERFACE_QUIRK_NO_CPORT_FEATURES
	.comm	_GB_INTERFACE_QUIRK_FORCED_DISABLE,8,3 ; @GB_INTERFACE_QUIRK_FORCED_DISABLE
	.comm	_GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH,8,3 ; @GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH
	.comm	_GB_INTERFACE_QUIRK_NO_BUNDLE_ACTIVATE,8,3 ; @GB_INTERFACE_QUIRK_NO_BUNDLE_ACTIVATE
	.comm	_GB_INTERFACE_QUIRK_NO_PM,8,3   ; @GB_INTERFACE_QUIRK_NO_PM
	.no_dead_strip	_gb_interface_read_and_clear_init_status
.subsections_via_symbols
