	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hidpad_nesusb_packet_handler
_hidpad_nesusb_packet_handler:          ## @hidpad_nesusb_packet_handler
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.1:
	movq	%rdi, %r14
	movq	(%rdi), %rdi
	callq	_memcpy
	movl	$0, 8(%r14)
	movq	(%r14), %rcx
	movl	24(%rcx), %eax
	shll	$8, %eax
	orl	28(%rcx), %eax
	xorl	%r8d, %r8d
	leaq	_hidpad_nesusb_packet_handler.button_mapping(%rip), %rsi
	xorl	%edi, %edi
	xorl	%edx, %edx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rdx
	addq	$4, %rsi
	cmpq	$16, %rdx
	je	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	leaq	-6(%rdx), %rcx
	cmpq	$6, %rcx
	jb	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movzbl	(%rsi), %ecx
	movl	$1, %ebx
	shll	%cl, %ebx
	btl	%edx, %eax
	cmovael	%r8d, %ebx
	orl	%ebx, %edi
	movl	%edi, 8(%r14)
	jmp	LBB0_4
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @hidpad_nesusb_packet_handler.button_mapping
_hidpad_nesusb_packet_handler.button_mapping:
	.long	134                             ## 0x86
	.long	132                             ## 0x84
	.long	135                             ## 0x87
	.long	133                             ## 0x85
	.long	131                             ## 0x83
	.long	130                             ## 0x82
	.long	138                             ## 0x8a
	.long	138                             ## 0x8a
	.long	138                             ## 0x8a
	.long	138                             ## 0x8a
	.long	138                             ## 0x8a
	.long	138                             ## 0x8a
	.long	136                             ## 0x88
	.long	137                             ## 0x89
	.long	128                             ## 0x80
	.long	129                             ## 0x81
	.long	0                               ## 0x0

	.no_dead_strip	_hidpad_nesusb_packet_handler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hidpad_nesusb_packet_handler
_hidpad_nesusb_packet_handler:          ; @hidpad_nesusb_packet_handler
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	ldr	x0, [x0]
	bl	_memcpy
	mov	w8, #0
	mov	x9, #0
	str	wzr, [x19, #8]
	ldr	x10, [x19]
	ldp	w10, w11, [x10, #24]
	orr	w10, w11, w10, lsl #8
Lloh0:
	adrp	x11, _hidpad_nesusb_packet_handler.button_mapping@PAGE
Lloh1:
	add	x11, x11, _hidpad_nesusb_packet_handler.button_mapping@PAGEOFF
	mov	w12, #1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x9, x9, #1
	cmp	x9, #16
	b.eq	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	sub	x13, x9, #6
	cmp	x13, #6
	b.lo	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w13, [x11, x9, lsl #2]
	lsl	w13, w12, w13
	lsr	w14, w10, w9
	sbfx	w14, w14, #0, #1
	and	w13, w14, w13
	orr	w8, w13, w8
	str	w8, [x19, #8]
	b	LBB0_2
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @hidpad_nesusb_packet_handler.button_mapping
_hidpad_nesusb_packet_handler.button_mapping:
	.long	134                             ; 0x86
	.long	132                             ; 0x84
	.long	135                             ; 0x87
	.long	133                             ; 0x85
	.long	131                             ; 0x83
	.long	130                             ; 0x82
	.long	138                             ; 0x8a
	.long	138                             ; 0x8a
	.long	138                             ; 0x8a
	.long	138                             ; 0x8a
	.long	138                             ; 0x8a
	.long	138                             ; 0x8a
	.long	136                             ; 0x88
	.long	137                             ; 0x89
	.long	128                             ; 0x80
	.long	129                             ; 0x81
	.long	0                               ; 0x0

	.no_dead_strip	_hidpad_nesusb_packet_handler
.subsections_via_symbols
