	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dm_write
_dm_write:                              ## @dm_write
	.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	%rcx, %r14
	movl	%edx, %r15d
	movl	%esi, %edx
	movq	%rdi, %r13
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str(%rip), %rsi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%r15d, %ecx
	callq	_devdbg
	testq	%r14, %r14
	je	LBB0_1
## %bb.2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r12
	movq	%rax, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_memcpy
	jmp	LBB0_5
LBB0_1:
	xorl	%r12d, %r12d
LBB0_5:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	(%r13), %ebx
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	_DM_WRITE_REGS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rsi
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rsi), %ecx
	movq	_USB_RECIP_DEVICE@GOTPCREL(%rip), %rsi
	orl	(%rsi), %ecx
	movq	_USB_CTRL_SET_TIMEOUT@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r10d
	subq	$8, %rsp
	movl	%ebx, %edi
	movl	%eax, %esi
	xorl	%r8d, %r8d
	movl	%r14d, %r9d
	pushq	%r10
	pushq	%r15
	pushq	%r12
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_kfree
	testl	%ebx, %ebx
	js	LBB0_8
## %bb.6:
	cmpl	%r15d, %ebx
	jge	LBB0_8
## %bb.7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_3:
	negl	%ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dm_write() reg=0x%02x, length=%d"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_DM_WRITE_REGS,4,2              ## @DM_WRITE_REGS
	.comm	_USB_DIR_OUT,4,2                ## @USB_DIR_OUT
	.comm	_USB_TYPE_VENDOR,4,2            ## @USB_TYPE_VENDOR
	.comm	_USB_RECIP_DEVICE,4,2           ## @USB_RECIP_DEVICE
	.comm	_USB_CTRL_SET_TIMEOUT,4,2       ## @USB_CTRL_SET_TIMEOUT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_dm_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dm_write
_dm_write:                              ; @dm_write
	.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	x23, x3
	mov	x19, x2
	mov	x20, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	mov	x3, x19
	bl	_devdbg
	cbz	x23, LBB0_3
; %bb.1:
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_kmalloc
	cbz	x0, LBB0_7
; %bb.2:
	mov	x21, x0
	mov	x1, x23
	mov	x2, x19
	bl	_memcpy
	b	LBB0_4
LBB0_3:
	mov	x21, #0
LBB0_4:
	ldr	w22, [x22]
	mov	x0, x22
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
Lloh8:
	adrp	x8, _DM_WRITE_REGS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DM_WRITE_REGS@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
Lloh11:
	adrp	x8, _USB_DIR_OUT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _USB_DIR_OUT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _USB_TYPE_VENDOR@GOTPAGE
Lloh15:
	ldr	x9, [x9, _USB_TYPE_VENDOR@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _USB_RECIP_DEVICE@GOTPAGE
Lloh18:
	ldr	x10, [x10, _USB_RECIP_DEVICE@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh19:
	ldr	w9, [x10]
	orr	w3, w8, w9
Lloh20:
	adrp	x8, _USB_CTRL_SET_TIMEOUT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _USB_CTRL_SET_TIMEOUT@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	str	w8, [sp]
	mov	x0, x22
	mov	w4, #0
	mov	x5, x20
	mov	x6, x21
	mov	x7, x19
	bl	_usb_control_msg
	mov	x20, x0
	mov	x0, x21
	bl	_kfree
	tbnz	w20, #31, LBB0_8
; %bb.5:
	cmp	w20, w19
	b.ge	LBB0_8
; %bb.6:
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_8
LBB0_7:
	neg	w20, w24
LBB0_8:
	mov	x0, x20
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.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	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dm_write() reg=0x%02x, length=%d"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_DM_WRITE_REGS,4,2              ; @DM_WRITE_REGS
	.comm	_USB_DIR_OUT,4,2                ; @USB_DIR_OUT
	.comm	_USB_TYPE_VENDOR,4,2            ; @USB_TYPE_VENDOR
	.comm	_USB_RECIP_DEVICE,4,2           ; @USB_RECIP_DEVICE
	.comm	_USB_CTRL_SET_TIMEOUT,4,2       ; @USB_CTRL_SET_TIMEOUT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_dm_write
.subsections_via_symbols
