	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_hid_fetch_hid_descriptor
_i2c_hid_fetch_hid_descriptor:          ## @i2c_hid_fetch_hid_descriptor
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %r14
	movl	4(%r14), %edi
	callq	_i2c_hid_get_dmi_i2c_hid_desc_override
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_i2c_hid_dbg
	movl	4(%r14), %edi
	callq	_i2c_hid_get_dmi_i2c_hid_desc_override
	movq	(%rax), %rdi
	movq	%rdi, 4(%rbx)
	shrq	$32, %rdi
LBB0_2:
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_le16_to_cpu
	cmpl	$256, %eax                      ## imm = 0x100
	jne	LBB0_3
## %bb.8:
	movl	4(%rbx), %edi
	callq	_le16_to_cpu
	cmpl	$8, %eax
	jne	LBB0_9
## %bb.11:
	movl	(%rbx), %ecx
	leaq	L_.str.5(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	movl	$8, %edx
	xorl	%eax, %eax
	callq	_i2c_hid_dbg
	jmp	LBB0_12
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_i2c_hid_dbg
	movl	(%rbx), %edx
	movq	_hid_descr_cmd@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	movl	$8, %ecx
	callq	_i2c_hid_command
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_7
LBB0_3:
	movl	8(%rbx), %edi
	callq	_le16_to_cpu
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_10
LBB0_9:
	leaq	L_.str.4(%rip), %rsi
LBB0_10:
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_7:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_12:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	8(%rbx), %edi
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Using a HID descriptor override\n"

L_.str.1:                               ## @.str.1
	.asciz	"Fetching the HID descriptor\n"

	.comm	_hid_descr_cmd,4,2              ## @hid_descr_cmd
L_.str.2:                               ## @.str.2
	.asciz	"hid_descr_cmd failed\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.3:                               ## @.str.3
	.asciz	"unexpected HID descriptor bcdVersion (0x%04hx)\n"

L_.str.4:                               ## @.str.4
	.asciz	"weird size of HID descriptor (%u)\n"

L_.str.5:                               ## @.str.5
	.asciz	"HID Descriptor: %*ph\n"

	.no_dead_strip	_i2c_hid_fetch_hid_descriptor
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_hid_fetch_hid_descriptor
_i2c_hid_fetch_hid_descriptor:          ; @i2c_hid_fetch_hid_descriptor
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	ldr	x19, [x0, #16]
	ldr	w0, [x19, #4]
	bl	_i2c_hid_get_dmi_i2c_hid_desc_override
	cbz	x0, LBB0_5
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_i2c_hid_dbg
	ldr	w0, [x19, #4]
	bl	_i2c_hid_get_dmi_i2c_hid_desc_override
	ldr	x8, [x0]
	stur	x8, [x20, #4]
	lsr	x0, x8, #32
LBB0_2:
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_le16_to_cpu
	cmp	w0, #256
	b.ne	LBB0_7
; %bb.3:
	ldr	w0, [x20, #4]
	bl	_le16_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, #8
	b.ne	LBB0_8
; %bb.4:
	ldr	w8, [x20]
	mov	w9, #8
	stp	x9, x8, [sp]
Lloh2:
	adrp	x1, l_.str.5@PAGE
Lloh3:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	bl	_i2c_hid_dbg
	mov	w0, #0
	b	LBB0_10
LBB0_5:
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_i2c_hid_dbg
	ldr	w2, [x20]
Lloh6:
	adrp	x1, _hid_descr_cmd@GOTPAGE
Lloh7:
	ldr	x1, [x1, _hid_descr_cmd@GOTPAGEOFF]
	mov	x0, x19
	mov	w3, #8
	bl	_i2c_hid_command
	cbz	w0, LBB0_11
; %bb.6:
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_7:
	ldr	w0, [x20, #8]
	bl	_le16_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_9
LBB0_8:
	str	x0, [sp]
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_9:
	mov	x0, x19
	bl	_dev_err
Lloh14:
	adrp	x8, _ENODEV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_11:
	ldr	w0, [x20, #8]
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Using a HID descriptor override\n"

l_.str.1:                               ; @.str.1
	.asciz	"Fetching the HID descriptor\n"

	.comm	_hid_descr_cmd,4,2              ; @hid_descr_cmd
l_.str.2:                               ; @.str.2
	.asciz	"hid_descr_cmd failed\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.3:                               ; @.str.3
	.asciz	"unexpected HID descriptor bcdVersion (0x%04hx)\n"

l_.str.4:                               ; @.str.4
	.asciz	"weird size of HID descriptor (%u)\n"

l_.str.5:                               ; @.str.5
	.asciz	"HID Descriptor: %*ph\n"

	.no_dead_strip	_i2c_hid_fetch_hid_descriptor
.subsections_via_symbols
