	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function em28xx_register_snapshot_button
_em28xx_register_snapshot_button:       ## @em28xx_register_snapshot_button
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rdi
	callq	_interface_to_usbdev
	movq	%rax, %r15
	movq	8(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_input_allocate_device
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movl	16(%r14), %esi
	movq	%r15, %rdi
	movl	$4, %edx
	callq	_usb_make_path
	movl	16(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	$4, %edx
	callq	_strlcat
	leaq	L_.str.2(%rip), %rax
	movq	%rax, (%rbx)
	movl	16(%r14), %eax
	movl	%eax, 52(%rbx)
	movq	_EV_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT_MASK
	movl	%eax, %r12d
	movq	_EV_REP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT_MASK
	orl	%r12d, %eax
	movq	8(%rbx), %rcx
	movl	%eax, (%rcx)
	movq	_EM28XX_SNAPSHOT_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	48(%rbx), %esi
	callq	_set_bit
	movq	%rbx, %rsi
	addq	$24, %rsi
	xorps	%xmm0, %xmm0
	movups	%xmm0, 32(%rbx)
	movq	%r15, %rdi
	callq	_usb_to_input_id
	movq	8(%r14), %rax
	movq	%rax, 16(%rbx)
	movq	%rbx, %rdi
	callq	_input_register_device
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r12d
	movq	8(%r14), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
	movq	%rbx, %rdi
	callq	_input_free_device
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_5
LBB0_4:
	movq	%rbx, (%r14)
	xorl	%r12d, %r12d
LBB0_5:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Registering snapshot button...\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"/sbutton"

L_.str.2:                               ## @.str.2
	.asciz	"em28xx snapshot button"

	.comm	_EV_KEY,4,2                     ## @EV_KEY
	.comm	_EV_REP,4,2                     ## @EV_REP
	.comm	_EM28XX_SNAPSHOT_KEY,4,2        ## @EM28XX_SNAPSHOT_KEY
L_.str.3:                               ## @.str.3
	.asciz	"input_register_device failed\n"

	.no_dead_strip	_em28xx_register_snapshot_button
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function em28xx_register_snapshot_button
_em28xx_register_snapshot_button:       ; @em28xx_register_snapshot_button
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	ldr	x0, [x0, #8]
	bl	_interface_to_usbdev
	mov	x21, x0
	ldr	x0, [x19, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	bl	_input_allocate_device
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	w1, [x19, #16]
	mov	x0, x21
	mov	w2, #4
	bl	_usb_make_path
	ldr	w0, [x19, #16]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #4
	bl	_strlcat
Lloh4:
	adrp	x8, l_.str.2@PAGE
Lloh5:
	add	x8, x8, l_.str.2@PAGEOFF
	str	x8, [x20]
	ldr	w8, [x19, #16]
	str	w8, [x20, #52]
Lloh6:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_BIT_MASK
	mov	x22, x0
Lloh9:
	adrp	x8, _EV_REP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EV_REP@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_BIT_MASK
	orr	w8, w0, w22
	ldr	x9, [x20, #8]
	str	w8, [x9]
Lloh12:
	adrp	x8, _EM28XX_SNAPSHOT_KEY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EM28XX_SNAPSHOT_KEY@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	ldr	w1, [x20, #48]
	bl	_set_bit
	add	x1, x20, #24
	stp	xzr, xzr, [x20, #32]
	mov	x0, x21
	bl	_usb_to_input_id
	ldr	x8, [x19, #8]
	str	x8, [x20, #16]
	mov	x0, x20
	bl	_input_register_device
	mov	x21, x0
	cbz	w0, LBB0_4
; %bb.2:
	ldr	x0, [x19, #8]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	mov	x0, x20
	bl	_input_free_device
	b	LBB0_5
LBB0_3:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_5
LBB0_4:
	str	x20, [x19]
LBB0_5:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Registering snapshot button...\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"/sbutton"

l_.str.2:                               ; @.str.2
	.asciz	"em28xx snapshot button"

	.comm	_EV_KEY,4,2                     ; @EV_KEY
	.comm	_EV_REP,4,2                     ; @EV_REP
	.comm	_EM28XX_SNAPSHOT_KEY,4,2        ; @EM28XX_SNAPSHOT_KEY
l_.str.3:                               ; @.str.3
	.asciz	"input_register_device failed\n"

	.no_dead_strip	_em28xx_register_snapshot_button
.subsections_via_symbols
