	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_em28xx_write_regs_req          ## -- Begin function em28xx_write_regs_req
	.p2align	4, 0x90
_em28xx_write_regs_req:                 ## @em28xx_write_regs_req
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $r8d killed $r8d def $r8
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	24(%rdi), %edi
	callq	_interface_to_usbdev
	movq	%rax, %r13
	xorl	%ebx, %ebx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	cmpq	$0, 16(%r14)
	je	LBB0_2
## %bb.1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_2:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movl	%r12d, -68(%rbp)                ## 4-byte Spill
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	testl	%ebx, %ebx
	jle	LBB0_7
## %bb.3:
	movq	_URB_MAX_CTRL_SIZE@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	jl	LBB0_7
## %bb.4:
	leaq	8(%r14), %rdi
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	movl	%eax, %r12d
	callq	_mutex_lock
	movl	12(%r14), %edi
	movq	%r13, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rax
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_USB_RECIP_DEVICE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movl	12(%r14), %eax
	movq	_HZ@GOTPCREL(%rip), %rdx
	movq	%rbx, %r13
	movl	(%rdx), %ebx
	subq	$8, %rsp
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
	movl	%r12d, %esi
	movl	%r15d, %edx
	xorl	%r8d, %r8d
	movl	-68(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %r9d
	pushq	%rbx
	pushq	%r13
	pushq	%rax
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %ebx
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_USB_DIR_OUT@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_USB_RECIP_DEVICE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	%r12d, %r10d
	sarl	$8, %r10d
	movl	%r13d, %r14d
	shrl	$8, %r14d
	movzbl	%r12b, %r11d
	movzbl	%r13b, %r13d
	testl	%ebx, %ebx
	js	LBB0_10
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	xorl	%eax, %eax
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	pushq	%r14
	pushq	%r13
	pushq	%r10
	pushq	%r11
	callq	_em28xx_regdbg
	addq	$48, %rsp
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.6:
	callq	_msleep
	jmp	LBB0_9
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_8:
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	subq	$8, %rsp
	leaq	L_.str(%rip), %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	xorl	%eax, %eax
	pushq	%rbx
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	pushq	%r14
	pushq	%r13
	pushq	%r10
	pushq	%r11
	callq	_em28xx_regdbg
	addq	$64, %rsp
	movl	%ebx, %edi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_usb_translate_errors           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_URB_MAX_CTRL_SIZE,4,2          ## @URB_MAX_CTRL_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.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	_HZ,4,2                         ## @HZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(pipe 0x%08x): OUT:  %02x %02x %02x %02x %02x %02x %02x %02x >>> %*ph  failed with error %i\n"

L_.str.1:                               ## @.str.1
	.asciz	"(pipe 0x%08x): OUT:  %02x %02x %02x %02x %02x %02x %02x %02x >>> %*ph\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_em28xx_write_regs_req          ; -- Begin function em28xx_write_regs_req
	.p2align	2
_em28xx_write_regs_req:                 ; @em28xx_write_regs_req
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x21, x4
	mov	x22, x3
	mov	x24, x2
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0, #24]
	bl	_interface_to_usbdev
	mov	x25, x0
	mov	w1, #0
	bl	_usb_sndctrlpipe
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_8
LBB0_2:
	cmp	w21, #1
	b.lt	LBB0_7
; %bb.3:
Lloh2:
	adrp	x8, _URB_MAX_CTRL_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _URB_MAX_CTRL_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, w21
	b.lt	LBB0_7
; %bb.4:
	mov	x23, x0
	add	x26, x20, #8
	mov	x0, x26
	bl	_mutex_lock
	ldr	w0, [x20, #12]
	mov	x1, x22
	mov	x2, x21
	bl	_memcpy
Lloh5:
	adrp	x8, _USB_DIR_OUT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _USB_DIR_OUT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x28, _USB_TYPE_VENDOR@GOTPAGE
Lloh9:
	ldr	x28, [x28, _USB_TYPE_VENDOR@GOTPAGEOFF]
	ldr	w9, [x28]
	orr	w8, w9, w8
Lloh10:
	adrp	x27, _USB_RECIP_DEVICE@GOTPAGE
Lloh11:
	ldr	x27, [x27, _USB_RECIP_DEVICE@GOTPAGEOFF]
	ldr	w9, [x27]
	orr	w3, w8, w9
	ldr	w6, [x20, #12]
Lloh12:
	adrp	x8, _HZ@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	str	w8, [sp]
	mov	x0, x25
	mov	x1, x23
	mov	x2, x19
	mov	w4, #0
	mov	x5, x24
	mov	x7, x21
	bl	_usb_control_msg
	mov	x25, x0
	mov	x0, x26
	bl	_mutex_unlock
Lloh15:
	adrp	x8, _USB_DIR_OUT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _USB_DIR_OUT@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	w9, [x28]
	orr	w8, w9, w8
	ldr	w9, [x27]
	orr	w2, w8, w9
	and	w6, w24, #0xff
	asr	w7, w24, #8
	and	w8, w21, #0xff
	lsr	w9, w21, #8
	tbnz	w25, #31, LBB0_10
; %bb.5:
	str	x22, [sp, #16]
	stp	w9, w21, [sp, #4]
	str	w8, [sp]
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x23
	mov	x3, x19
	mov	w4, #0
	mov	w5, #0
	bl	_em28xx_regdbg
	ldr	x0, [x20]
	cbz	x0, LBB0_9
; %bb.6:
	bl	_msleep
	b	LBB0_9
LBB0_7:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_9:
	mov	x0, x25
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_10:
	stp	x22, x25, [sp, #16]
	stp	w9, w21, [sp, #4]
	str	w8, [sp]
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	mov	x3, x19
	mov	w4, #0
	mov	w5, #0
	bl	_em28xx_regdbg
	mov	x0, x25
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_usb_translate_errors
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_URB_MAX_CTRL_SIZE,4,2          ; @URB_MAX_CTRL_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.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	_HZ,4,2                         ; @HZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(pipe 0x%08x): OUT:  %02x %02x %02x %02x %02x %02x %02x %02x >>> %*ph  failed with error %i\n"

l_.str.1:                               ; @.str.1
	.asciz	"(pipe 0x%08x): OUT:  %02x %02x %02x %02x %02x %02x %02x %02x >>> %*ph\n"

.subsections_via_symbols
