	.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
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_kmalloc
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	(%r12), %ebx
	xorl	%r13d, %r13d
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	movq	_BCM5974_WELLSPRING_MODE_READ_REQUEST_ID@GOTPCREL(%rip), %rdx
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rsi
	movq	_USB_TYPE_CLASS@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	orl	(%rsi), %ecx
	movl	(%rdx), %edx
	movq	_USB_RECIP_INTERFACE@GOTPCREL(%rip), %rsi
	orl	(%rsi), %ecx
	movq	_BCM5974_WELLSPRING_MODE_REQUEST_VALUE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r8d
	movq	_BCM5974_WELLSPRING_MODE_REQUEST_INDEX@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r9d
	subq	$8, %rsp
	movl	%ebx, %edi
	movl	%eax, %esi
	pushq	$5000                           ## imm = 0x1388
	pushq	$8
	pushq	%r14
	callq	_usb_control_msg
	addq	$32, %rsp
	cmpl	$8, %eax
	jne	LBB0_5
## %bb.2:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_6
## %bb.3:
	movq	_BCM5974_WELLSPRING_MODE_NORMAL_VALUE@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	jmp	LBB0_11
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_10
LBB0_6:
	movq	_BCM5974_WELLSPRING_MODE_VENDOR_VALUE@GOTPCREL(%rip), %rax
LBB0_7:
	movb	(%rax), %al
	movb	%al, (%r14)
	movl	(%r12), %ebx
	xorl	%r13d, %r13d
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	_BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rsi
	movl	(%r15), %ecx
	orl	(%rsi), %ecx
	movq	_USB_RECIP_INTERFACE@GOTPCREL(%rip), %rsi
	orl	(%rsi), %ecx
	movq	_BCM5974_WELLSPRING_MODE_REQUEST_VALUE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r8d
	movq	_BCM5974_WELLSPRING_MODE_REQUEST_INDEX@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r9d
	subq	$8, %rsp
	movl	%ebx, %edi
	movl	%eax, %esi
	pushq	$5000                           ## imm = 0x1388
	pushq	$8
	pushq	%r14
	callq	_usb_control_msg
	addq	$32, %rsp
	cmpl	$8, %eax
	jne	LBB0_9
## %bb.8:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	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_12
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
LBB0_10:
	callq	_err
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_11:
	subl	(%rax), %r13d
LBB0_12:
	movq	%r14, %rdi
	callq	_kfree
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bcm5974: out of memory"

	.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
	.comm	_BCM5974_WELLSPRING_MODE_REQUEST_VALUE,4,2 ## @BCM5974_WELLSPRING_MODE_REQUEST_VALUE
	.comm	_BCM5974_WELLSPRING_MODE_REQUEST_INDEX,4,2 ## @BCM5974_WELLSPRING_MODE_REQUEST_INDEX
L_.str.1:                               ## @.str.1
	.asciz	"bcm5974: could not read from device"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_BCM5974_WELLSPRING_MODE_VENDOR_VALUE,1,0 ## @BCM5974_WELLSPRING_MODE_VENDOR_VALUE
	.comm	_BCM5974_WELLSPRING_MODE_NORMAL_VALUE,1,0 ## @BCM5974_WELLSPRING_MODE_NORMAL_VALUE
	.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	"bcm5974: could not write to device"

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, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #8
	bl	_kmalloc
	mov	x19, x0
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w22, [x21]
	mov	x0, x22
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	mov	x1, x0
Lloh3:
	adrp	x8, _BCM5974_WELLSPRING_MODE_READ_REQUEST_ID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BCM5974_WELLSPRING_MODE_READ_REQUEST_ID@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _USB_DIR_IN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _USB_DIR_IN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x23, _USB_TYPE_CLASS@GOTPAGE
Lloh10:
	ldr	x23, [x23, _USB_TYPE_CLASS@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w8, w9, w8
Lloh11:
	adrp	x24, _USB_RECIP_INTERFACE@GOTPAGE
Lloh12:
	ldr	x24, [x24, _USB_RECIP_INTERFACE@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w3, w8, w9
Lloh13:
	adrp	x25, _BCM5974_WELLSPRING_MODE_REQUEST_VALUE@GOTPAGE
Lloh14:
	ldr	x25, [x25, _BCM5974_WELLSPRING_MODE_REQUEST_VALUE@GOTPAGEOFF]
	ldr	w4, [x25]
Lloh15:
	adrp	x26, _BCM5974_WELLSPRING_MODE_REQUEST_INDEX@GOTPAGE
Lloh16:
	ldr	x26, [x26, _BCM5974_WELLSPRING_MODE_REQUEST_INDEX@GOTPAGEOFF]
	ldr	w5, [x26]
	mov	w27, #5000
	str	w27, [sp]
	mov	x0, x22
	mov	x6, x19
	mov	w7, #8
	bl	_usb_control_msg
	cmp	w0, #8
	b.ne	LBB0_5
; %bb.2:
Lloh17:
	adrp	x8, _BCM5974_WELLSPRING_MODE_VENDOR_VALUE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BCM5974_WELLSPRING_MODE_VENDOR_VALUE@GOTPAGEOFF]
Lloh19:
	adrp	x9, _BCM5974_WELLSPRING_MODE_NORMAL_VALUE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _BCM5974_WELLSPRING_MODE_NORMAL_VALUE@GOTPAGEOFF]
	cmp	w20, #0
	csel	x8, x9, x8, eq
	ldrb	w8, [x8]
	strb	w8, [x19]
	ldr	w21, [x21]
	mov	x0, x21
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
Lloh21:
	adrp	x8, _BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID@GOTPAGE
Lloh22:
	ldr	x8, [x8, _BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
Lloh24:
	adrp	x8, _USB_DIR_OUT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _USB_DIR_OUT@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	ldr	w9, [x23]
	orr	w8, w9, w8
	ldr	w9, [x24]
	orr	w3, w8, w9
	ldr	w4, [x25]
	ldr	w5, [x26]
	str	w27, [sp]
	mov	x0, x21
	mov	x6, x19
	mov	w7, #8
	bl	_usb_control_msg
	cmp	w0, #8
	b.ne	LBB0_6
; %bb.3:
Lloh27:
	adrp	x8, l_.str.4@PAGE
Lloh28:
	add	x8, x8, l_.str.4@PAGEOFF
Lloh29:
	adrp	x9, l_.str.5@PAGE
Lloh30:
	add	x9, x9, l_.str.5@PAGEOFF
	cmp	w20, #0
	csel	x2, x9, x8, eq
Lloh31:
	adrp	x1, l_.str.3@PAGE
Lloh32:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #2
	bl	_dprintk
	mov	w20, #0
	b	LBB0_9
LBB0_4:
Lloh33:
	adrp	x0, l_.str@PAGE
Lloh34:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
Lloh35:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
Lloh37:
	adrp	x0, l_.str.1@PAGE
Lloh38:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh39:
	adrp	x0, l_.str.2@PAGE
Lloh40:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_7:
	bl	_err
Lloh41:
	adrp	x8, _EIO@GOTPAGE
Lloh42:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	mov	x0, x19
	bl	_kfree
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bcm5974: out of memory"

	.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
	.comm	_BCM5974_WELLSPRING_MODE_REQUEST_VALUE,4,2 ; @BCM5974_WELLSPRING_MODE_REQUEST_VALUE
	.comm	_BCM5974_WELLSPRING_MODE_REQUEST_INDEX,4,2 ; @BCM5974_WELLSPRING_MODE_REQUEST_INDEX
l_.str.1:                               ; @.str.1
	.asciz	"bcm5974: could not read from device"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_BCM5974_WELLSPRING_MODE_VENDOR_VALUE,1,0 ; @BCM5974_WELLSPRING_MODE_VENDOR_VALUE
	.comm	_BCM5974_WELLSPRING_MODE_NORMAL_VALUE,1,0 ; @BCM5974_WELLSPRING_MODE_NORMAL_VALUE
	.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	"bcm5974: could not write to device"

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
