	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function k90_store_macro_mode
_k90_store_macro_mode:                  ## @k90_store_macro_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	%rcx, %r14
	movq	%rdx, %rbx
	movq	%rdi, %r15
	movl	(%rdi), %edi
	callq	_to_usb_interface
	movq	%rax, %rdi
	callq	_interface_to_usbdev
	movq	%rax, %r12
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	$2, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	$2, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_1:
	movq	_K90_MACRO_MODE_SW@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_K90_MACRO_MODE_HW@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %r13d
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	_K90_REQUEST_MACRO_MODE@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), %ebx
	subq	$8, %rsp
	movq	%r12, %rdi
	movl	%eax, %esi
	movl	%r13d, %r8d
	xorl	%r9d, %r9d
	pushq	%rbx
	pushq	$0
	pushq	$0
	callq	_usb_control_msg
	addq	$32, %rsp
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_warn
	jmp	LBB0_7
LBB0_6:
	movl	%r14d, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SW"

	.comm	_K90_MACRO_MODE_SW,4,2          ## @K90_MACRO_MODE_SW
L_.str.1:                               ## @.str.1
	.asciz	"HW"

	.comm	_K90_MACRO_MODE_HW,4,2          ## @K90_MACRO_MODE_HW
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_K90_REQUEST_MACRO_MODE,4,2     ## @K90_REQUEST_MACRO_MODE
	.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
L_.str.2:                               ## @.str.2
	.asciz	"Failed to set macro mode.\n"

	.no_dead_strip	_k90_store_macro_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function k90_store_macro_mode
_k90_store_macro_mode:                  ; @k90_store_macro_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x3
	mov	x22, x2
	mov	x19, x0
	ldr	w0, [x0]
	bl	_to_usb_interface
	bl	_interface_to_usbdev
	mov	x21, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	w2, #2
	bl	_strncmp
	cbz	x0, LBB0_3
; %bb.1:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	w2, #2
	bl	_strncmp
	cbz	x0, LBB0_4
; %bb.2:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
LBB0_3:
Lloh7:
	adrp	x8, _K90_MACRO_MODE_SW@GOTPAGE
Lloh8:
	ldr	x8, [x8, _K90_MACRO_MODE_SW@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh9:
	adrp	x8, _K90_MACRO_MODE_HW@GOTPAGE
Lloh10:
	ldr	x8, [x8, _K90_MACRO_MODE_HW@GOTPAGEOFF]
LBB0_5:
	ldr	w22, [x8]
	mov	x0, x21
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
Lloh11:
	adrp	x8, _K90_REQUEST_MACRO_MODE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _K90_REQUEST_MACRO_MODE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x8, _USB_DIR_OUT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _USB_DIR_OUT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _USB_TYPE_VENDOR@GOTPAGE
Lloh18:
	ldr	x9, [x9, _USB_TYPE_VENDOR@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
Lloh20:
	adrp	x10, _USB_RECIP_DEVICE@GOTPAGE
Lloh21:
	ldr	x10, [x10, _USB_RECIP_DEVICE@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh22:
	ldr	w9, [x10]
	orr	w3, w8, w9
Lloh23:
	adrp	x8, _USB_CTRL_SET_TIMEOUT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _USB_CTRL_SET_TIMEOUT@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	str	w8, [sp]
	mov	x0, x21
	mov	x4, x22
	mov	w5, #0
	mov	x6, #0
	mov	w7, #0
	bl	_usb_control_msg
	cbz	w0, LBB0_7
; %bb.6:
	mov	x21, x0
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
	b	LBB0_8
LBB0_7:
	mov	x21, x20
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SW"

	.comm	_K90_MACRO_MODE_SW,4,2          ; @K90_MACRO_MODE_SW
l_.str.1:                               ; @.str.1
	.asciz	"HW"

	.comm	_K90_MACRO_MODE_HW,4,2          ; @K90_MACRO_MODE_HW
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_K90_REQUEST_MACRO_MODE,4,2     ; @K90_REQUEST_MACRO_MODE
	.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
l_.str.2:                               ; @.str.2
	.asciz	"Failed to set macro mode.\n"

	.no_dead_strip	_k90_store_macro_mode
.subsections_via_symbols
