	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gm12u320_misc_request
_gm12u320_misc_request:                 ## @gm12u320_misc_request
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movq	%r8, %r15
	movq	%rcx, %r12
	movq	%rdx, %r13
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	movq	_CMD_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_cmd_misc@GOTPCREL(%rip), %rsi
	callq	_memcpy
	movq	(%rbx), %rax
	movq	%r14, 160(%rax)
	movq	(%rbx), %rax
	movq	%r13, 168(%rax)
	movq	(%rbx), %rax
	movq	%r12, 176(%rax)
	movq	_CMD_SIZE@GOTPCREL(%rip), %r12
	movq	(%rbx), %rax
	movq	%r15, 184(%rax)
	movq	(%rbx), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, 192(%rax)
	movq	(%rbx), %rax
	movq	16(%rbp), %rcx
	movq	%rcx, 200(%rax)
	movl	8(%rbx), %r14d
	movq	_MISC_SND_EPT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_usb_sndbulkpipe
	movq	(%rbx), %rdx
	movl	(%r12), %ecx
	movq	_CMD_TIMEOUT@GOTPCREL(%rip), %r15
	movl	(%r15), %r9d
	leaq	-44(%rbp), %r8
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_usb_bulk_msg
	testl	%eax, %eax
	jne	LBB0_7
## %bb.1:
	movl	-44(%rbp), %ecx
	cmpl	(%r12), %ecx
	jne	LBB0_7
## %bb.2:
	movl	8(%rbx), %r14d
	movq	_MISC_RCV_EPT@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	%r14d, %edi
	callq	_usb_rcvbulkpipe
	movq	(%rbx), %rdx
	movq	_MISC_VALUE_SIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movq	_DATA_TIMEOUT@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r9d
	leaq	-44(%rbp), %r8
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_usb_bulk_msg
	testl	%eax, %eax
	jne	LBB0_11
## %bb.3:
	movl	-44(%rbp), %ecx
	cmpl	(%r13), %ecx
	jne	LBB0_11
## %bb.4:
	movl	8(%rbx), %r14d
	movl	(%r12), %esi
	movl	%r14d, %edi
	callq	_usb_rcvbulkpipe
	movq	(%rbx), %rdx
	movq	_READ_STATUS_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	movl	(%r15), %r9d
	leaq	-44(%rbp), %r8
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_usb_bulk_msg
	movl	%eax, %esi
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movl	-44(%rbp), %ecx
	xorl	%eax, %eax
	cmpl	(%rbx), %ecx
	je	LBB0_10
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_9
LBB0_7:
	leaq	L_.str(%rip), %rdi
LBB0_8:
	movl	%eax, %esi
LBB0_9:
	callq	_GM12U320_ERR
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_cmd_misc,4,2                   ## @cmd_misc
	.comm	_CMD_SIZE,4,2                   ## @CMD_SIZE
	.comm	_MISC_SND_EPT,4,2               ## @MISC_SND_EPT
	.comm	_CMD_TIMEOUT,4,2                ## @CMD_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Misc. req. error %d\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_MISC_RCV_EPT,4,2               ## @MISC_RCV_EPT
	.comm	_MISC_VALUE_SIZE,4,2            ## @MISC_VALUE_SIZE
	.comm	_DATA_TIMEOUT,4,2               ## @DATA_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"Misc. value error %d\n"

	.comm	_READ_STATUS_SIZE,4,2           ## @READ_STATUS_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"Misc. status error %d\n"

	.no_dead_strip	_gm12u320_misc_request
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gm12u320_misc_request
_gm12u320_misc_request:                 ; @gm12u320_misc_request
	.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
	mov	x20, x6
	mov	x21, x5
	mov	x22, x4
	mov	x23, x3
	mov	x24, x2
	mov	x25, x1
	mov	x19, x0
	ldr	x0, [x0]
Lloh0:
	adrp	x26, _CMD_SIZE@GOTPAGE
Lloh1:
	ldr	x26, [x26, _CMD_SIZE@GOTPAGEOFF]
	ldr	w2, [x26]
Lloh2:
	adrp	x1, _cmd_misc@GOTPAGE
Lloh3:
	ldr	x1, [x1, _cmd_misc@GOTPAGEOFF]
	bl	_memcpy
	ldr	x8, [x19]
	str	x25, [x8, #160]
	ldr	x8, [x19]
	str	x24, [x8, #168]
	ldr	x8, [x19]
	str	x23, [x8, #176]
	ldr	x8, [x19]
	str	x22, [x8, #184]
	ldr	x8, [x19]
	str	x21, [x8, #192]
	ldr	x8, [x19]
	str	x20, [x8, #200]
	ldr	w20, [x19, #8]
Lloh4:
	adrp	x8, _MISC_SND_EPT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MISC_SND_EPT@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_usb_sndbulkpipe
	mov	x1, x0
	ldr	x2, [x19]
	ldr	w3, [x26]
Lloh7:
	adrp	x21, _CMD_TIMEOUT@GOTPAGE
Lloh8:
	ldr	x21, [x21, _CMD_TIMEOUT@GOTPAGEOFF]
	ldr	w5, [x21]
	add	x4, sp, #12
	mov	x0, x20
	bl	_usb_bulk_msg
	mov	x1, x0
	cbnz	w0, LBB0_7
; %bb.1:
	ldr	w8, [sp, #12]
	ldr	w9, [x26]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.2:
	ldr	w20, [x19, #8]
Lloh9:
	adrp	x22, _MISC_RCV_EPT@GOTPAGE
Lloh10:
	ldr	x22, [x22, _MISC_RCV_EPT@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_usb_rcvbulkpipe
	mov	x1, x0
	ldr	x2, [x19]
Lloh11:
	adrp	x23, _MISC_VALUE_SIZE@GOTPAGE
Lloh12:
	ldr	x23, [x23, _MISC_VALUE_SIZE@GOTPAGEOFF]
	ldr	w3, [x23]
Lloh13:
	adrp	x8, _DATA_TIMEOUT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DATA_TIMEOUT@GOTPAGEOFF]
Lloh15:
	ldr	w5, [x8]
	add	x4, sp, #12
	mov	x0, x20
	bl	_usb_bulk_msg
	mov	x1, x0
	cbnz	w0, LBB0_10
; %bb.3:
	ldr	w8, [sp, #12]
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_10
; %bb.4:
	ldr	w20, [x19, #8]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_usb_rcvbulkpipe
	mov	x1, x0
	ldr	x2, [x19]
Lloh16:
	adrp	x19, _READ_STATUS_SIZE@GOTPAGE
Lloh17:
	ldr	x19, [x19, _READ_STATUS_SIZE@GOTPAGEOFF]
	ldr	w3, [x19]
	ldr	w5, [x21]
	add	x4, sp, #12
	mov	x0, x20
	bl	_usb_bulk_msg
	mov	x1, x0
	cbnz	w0, LBB0_11
; %bb.5:
	ldr	w8, [sp, #12]
	ldr	w9, [x19]
	cmp	w8, w9
	b.ne	LBB0_11
; %bb.6:
	mov	w0, #0
	b	LBB0_9
LBB0_7:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
LBB0_8:
	bl	_GM12U320_ERR
Lloh20:
	adrp	x8, _EIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
LBB0_10:
Lloh23:
	adrp	x0, l_.str.1@PAGE
Lloh24:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_11:
Lloh25:
	adrp	x0, l_.str.2@PAGE
Lloh26:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_8
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_cmd_misc,4,2                   ; @cmd_misc
	.comm	_CMD_SIZE,4,2                   ; @CMD_SIZE
	.comm	_MISC_SND_EPT,4,2               ; @MISC_SND_EPT
	.comm	_CMD_TIMEOUT,4,2                ; @CMD_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Misc. req. error %d\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_MISC_RCV_EPT,4,2               ; @MISC_RCV_EPT
	.comm	_MISC_VALUE_SIZE,4,2            ; @MISC_VALUE_SIZE
	.comm	_DATA_TIMEOUT,4,2               ; @DATA_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"Misc. value error %d\n"

	.comm	_READ_STATUS_SIZE,4,2           ; @READ_STATUS_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"Misc. status error %d\n"

	.no_dead_strip	_gm12u320_misc_request
.subsections_via_symbols
