	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm5974_wellspring_mode
_bcm5974_wellspring_mode:               ## @bcm5974_wellspring_mode
	.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	16(%rdi), %rax
	movq	_TYPE3@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.1:
	movl	%esi, %r12d
	movq	%rdi, %rbx
	movl	24(%rdi), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movl	8(%rbx), %r13d
	xorl	%r15d, %r15d
	movl	%r13d, %edi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rdx
	movq	_USB_TYPE_CLASS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rdx), %ecx
	movq	_BCM5974_WELLSPRING_MODE_READ_REQUEST_ID@GOTPCREL(%rip), %rdx
	movq	_USB_RECIP_INTERFACE@GOTPCREL(%rip), %rsi
	orl	(%rsi), %ecx
	movl	(%rdx), %edx
	movl	48(%rbx), %r8d
	movl	24(%rbx), %r10d
	movl	44(%rbx), %r9d
	subq	$8, %rsp
	movl	%r13d, %edi
	movl	%eax, %esi
	pushq	$5000                           ## imm = 0x1388
	pushq	%r10
	pushq	%r14
	callq	_usb_control_msg
	addq	$32, %rsp
	cmpl	24(%rbx), %eax
	jne	LBB0_6
## %bb.3:
	cmpl	$1, %r12d
	movq	%rbx, %rax
	adcq	$40, %rax
	movb	(%rax), %al
	movq	32(%rbx), %rcx
	movb	%al, (%r14,%rcx)
	movl	8(%rbx), %r13d
	xorl	%r15d, %r15d
	movl	%r13d, %edi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	_BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID@GOTPCREL(%rip), %rdx
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rsi
	movq	_USB_TYPE_CLASS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rsi), %ecx
	movq	_USB_RECIP_INTERFACE@GOTPCREL(%rip), %rsi
	orl	(%rsi), %ecx
	movl	(%rdx), %edx
	movl	48(%rbx), %r8d
	movl	24(%rbx), %r10d
	movl	44(%rbx), %r9d
	subq	$8, %rsp
	movl	%r13d, %edi
	movl	%eax, %esi
	pushq	$5000                           ## imm = 0x1388
	pushq	%r10
	pushq	%r14
	callq	_usb_control_msg
	addq	$32, %rsp
	cmpl	24(%rbx), %eax
	jne	LBB0_7
## %bb.4:
	testl	%r12d, %r12d
	leaq	L_.str.5(%rip), %rax
	leaq	L_.str.4(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.3(%rip), %rsi
	movl	$2, %edi
	callq	_dprintk
	jmp	LBB0_10
LBB0_5:
	movq	(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	jmp	LBB0_9
LBB0_6:
	movq	(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_8
LBB0_7:
	movq	(%rbx), %rdi
	leaq	L_.str.2(%rip), %rsi
LBB0_8:
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_9:
	subl	(%rax), %r15d
LBB0_10:
	movq	%r14, %rdi
	callq	_kfree
LBB0_11:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TYPE3,8,3                      ## @TYPE3
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"out of memory\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_BCM5974_WELLSPRING_MODE_READ_REQUEST_ID,4,2 ## @BCM5974_WELLSPRING_MODE_READ_REQUEST_ID
	.comm	_USB_DIR_IN,4,2                 ## @USB_DIR_IN
	.comm	_USB_TYPE_CLASS,4,2             ## @USB_TYPE_CLASS
	.comm	_USB_RECIP_INTERFACE,4,2        ## @USB_RECIP_INTERFACE
L_.str.1:                               ## @.str.1
	.asciz	"could not read from device\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID,4,2 ## @BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID
	.comm	_USB_DIR_OUT,4,2                ## @USB_DIR_OUT
L_.str.2:                               ## @.str.2
	.asciz	"could not write to device\n"

L_.str.3:                               ## @.str.3
	.asciz	"bcm5974: switched to %s mode.\n"

L_.str.4:                               ## @.str.4
	.asciz	"wellspring"

L_.str.5:                               ## @.str.5
	.asciz	"normal"

	.no_dead_strip	_bcm5974_wellspring_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm5974_wellspring_mode
_bcm5974_wellspring_mode:               ; @bcm5974_wellspring_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x8, [x0, #16]
Lloh0:
	adrp	x9, _TYPE3@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TYPE3@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_12
LBB0_2:
	mov	x20, x1
	mov	x21, x0
	ldr	w0, [x0, #24]
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_kmalloc
	mov	x19, x0
	cbz	x0, LBB0_6
; %bb.3:
	ldr	w22, [x21, #8]
	mov	x0, x22
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	mov	x1, x0
Lloh6:
	adrp	x8, _BCM5974_WELLSPRING_MODE_READ_REQUEST_ID@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BCM5974_WELLSPRING_MODE_READ_REQUEST_ID@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _USB_DIR_IN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _USB_DIR_IN@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x23, _USB_TYPE_CLASS@GOTPAGE
Lloh13:
	ldr	x23, [x23, _USB_TYPE_CLASS@GOTPAGEOFF]
	ldr	w9, [x23]
Lloh14:
	adrp	x24, _USB_RECIP_INTERFACE@GOTPAGE
Lloh15:
	ldr	x24, [x24, _USB_RECIP_INTERFACE@GOTPAGEOFF]
	orr	w8, w9, w8
	ldr	w9, [x24]
	orr	w3, w8, w9
	ldp	w5, w4, [x21, #44]
	ldr	w7, [x21, #24]
	mov	w25, #5000
	str	w25, [sp]
	mov	x0, x22
	mov	x6, x19
	bl	_usb_control_msg
	ldr	w8, [x21, #24]
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.4:
	cmp	w20, #0
	mov	w8, #40
	cinc	x8, x8, eq
	ldrb	w8, [x21, x8]
	ldr	x9, [x21, #32]
	strb	w8, [x19, x9]
	ldr	w22, [x21, #8]
	mov	x0, x22
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
Lloh16:
	adrp	x8, _BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
Lloh19:
	adrp	x8, _USB_DIR_OUT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _USB_DIR_OUT@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	ldr	w9, [x23]
	orr	w8, w9, w8
	ldr	w9, [x24]
	orr	w3, w8, w9
	ldp	w5, w4, [x21, #44]
	ldr	w7, [x21, #24]
	str	w25, [sp]
	mov	x0, x22
	mov	x6, x19
	bl	_usb_control_msg
	ldr	w8, [x21, #24]
	cmp	w0, w8
	b.ne	LBB0_8
; %bb.5:
Lloh22:
	adrp	x8, l_.str.4@PAGE
Lloh23:
	add	x8, x8, l_.str.4@PAGEOFF
Lloh24:
	adrp	x9, l_.str.5@PAGE
Lloh25:
	add	x9, x9, l_.str.5@PAGEOFF
	cmp	w20, #0
	csel	x2, x9, x8, eq
Lloh26:
	adrp	x1, l_.str.3@PAGE
Lloh27:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #2
	bl	_dprintk
	mov	w20, #0
	b	LBB0_11
LBB0_6:
	ldr	x0, [x21]
Lloh28:
	adrp	x1, l_.str@PAGE
Lloh29:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh30:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_10
LBB0_7:
	ldr	x0, [x21]
Lloh32:
	adrp	x1, l_.str.1@PAGE
Lloh33:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_8:
	ldr	x0, [x21]
Lloh34:
	adrp	x1, l_.str.2@PAGE
Lloh35:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_9:
	bl	_dev_err
Lloh36:
	adrp	x8, _EIO@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_11:
	mov	x0, x19
	bl	_kfree
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_TYPE3,8,3                      ; @TYPE3
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"out of memory\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_BCM5974_WELLSPRING_MODE_READ_REQUEST_ID,4,2 ; @BCM5974_WELLSPRING_MODE_READ_REQUEST_ID
	.comm	_USB_DIR_IN,4,2                 ; @USB_DIR_IN
	.comm	_USB_TYPE_CLASS,4,2             ; @USB_TYPE_CLASS
	.comm	_USB_RECIP_INTERFACE,4,2        ; @USB_RECIP_INTERFACE
l_.str.1:                               ; @.str.1
	.asciz	"could not read from device\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID,4,2 ; @BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID
	.comm	_USB_DIR_OUT,4,2                ; @USB_DIR_OUT
l_.str.2:                               ; @.str.2
	.asciz	"could not write to device\n"

l_.str.3:                               ; @.str.3
	.asciz	"bcm5974: switched to %s mode.\n"

l_.str.4:                               ; @.str.4
	.asciz	"wellspring"

l_.str.5:                               ; @.str.5
	.asciz	"normal"

	.no_dead_strip	_bcm5974_wellspring_mode
.subsections_via_symbols
