	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __wpad_calc_data
___wpad_calc_data:                      ## @__wpad_calc_data
	.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	%rdx, %r13
	movq	(%rdi), %rax
	movq	_WPAD_ERR_NONE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_12
## %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	leaq	84(%rdi), %r12
	movl	136(%rsi), %eax
	movl	%eax, 136(%rdi)
	movl	132(%rsi), %eax
	movl	%eax, 132(%rdi)
	movups	116(%rsi), %xmm0
	movups	%xmm0, 116(%rdi)
	movups	100(%rsi), %xmm0
	movups	%xmm0, 100(%rdi)
	movups	84(%rsi), %xmm0
	movups	%xmm0, 84(%rdi)
	movl	8(%rdi), %eax
	movq	_WPAD_DATA_ACCEL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
## %bb.2:
	leaq	144(%rbx), %r15
	movq	%r13, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_calculate_orientation
	leaq	140(%rbx), %rdx
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_calculate_gforce
	movl	8(%rbx), %eax
LBB0_3:
	movq	_WPAD_DATA_IR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:
	leaq	88(%rbx), %rdi
	movq	%r12, %rsi
	callq	_interpret_ir_data
	movl	8(%rbx), %eax
LBB0_5:
	movq	_WPAD_DATA_EXPANSION@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.6:
	movl	16(%rbx), %eax
	cmpl	$129, %eax
	je	LBB0_9
## %bb.7:
	cmpl	$128, %eax
	jne	LBB0_11
## %bb.8:
	movl	72(%r14), %eax
	leaq	56(%rbx), %r15
	leaq	72(%rbx), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, 72(%rbx)
	leaq	76(%rbx), %rdi
	movl	76(%rbx), %edx
	movl	80(%rbx), %esi
	callq	_calc_joystick_state
	leaq	68(%rbx), %r12
	leaq	64(%rbx), %r13
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_calculate_orientation
	leaq	60(%rbx), %rdx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_calculate_gforce
	jmp	LBB0_10
LBB0_12:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movslq	52(%rbx), %rax
	imulq	$-2078209981, %rax, %rcx        ## imm = 0x84210843
	shrq	$32, %rcx
	addl	%eax, %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	sarl	$4, %ecx
	addl	%eax, %ecx
	movl	%ecx, 20(%rbx)
	movslq	48(%rbx), %rax
	imulq	$-2078209981, %rax, %rcx        ## imm = 0x84210843
	shrq	$32, %rcx
	addl	%eax, %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	sarl	$4, %ecx
	addl	%eax, %ecx
	movl	%ecx, 24(%rbx)
	leaq	40(%rbx), %rdi
	movl	40(%rbx), %edx
	movl	44(%rbx), %esi
	callq	_calc_joystick_state
	leaq	32(%rbx), %rdi
	movl	32(%rbx), %edx
	movl	36(%rbx), %esi
	callq	_calc_joystick_state
	leaq	28(%rbx), %r15
LBB0_10:
	movl	(%r15), %eax
	shll	$16, %eax
	orl	%eax, 12(%rbx)
LBB0_11:
	movl	$152, %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memcpy                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_WPAD_ERR_NONE,8,3              ## @WPAD_ERR_NONE
	.comm	_WPAD_DATA_ACCEL,4,2            ## @WPAD_DATA_ACCEL
	.comm	_WPAD_DATA_IR,4,2               ## @WPAD_DATA_IR
	.comm	_WPAD_DATA_EXPANSION,4,2        ## @WPAD_DATA_EXPANSION
	.no_dead_strip	___wpad_calc_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __wpad_calc_data
___wpad_calc_data:                      ; @__wpad_calc_data
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _WPAD_ERR_NONE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WPAD_ERR_NONE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.1:
	mov	x21, x3
	mov	x19, x1
	mov	x20, x0
	ldur	d0, [x1, #132]
	stur	d0, [x0, #132]
	ldur	q0, [x1, #116]
	stur	q0, [x0, #116]
	ldur	q0, [x1, #100]
	stur	q0, [x0, #100]
	ldur	q0, [x1, #84]
	mov	x22, x0
	str	q0, [x22, #84]!
	ldur	w8, [x22, #-76]
Lloh3:
	adrp	x9, _WPAD_DATA_ACCEL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WPAD_DATA_ACCEL@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	mov	x23, x2
	add	x24, x20, #144
	mov	x0, x2
	mov	x1, x24
	mov	x2, x22
	mov	x3, x21
	bl	_calculate_orientation
	add	x2, x20, #140
	mov	x0, x23
	mov	x1, x24
	bl	_calculate_gforce
	ldr	w8, [x20, #8]
LBB0_3:
Lloh6:
	adrp	x9, _WPAD_DATA_IR@GOTPAGE
Lloh7:
	ldr	x9, [x9, _WPAD_DATA_IR@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	add	x0, x22, #4
	mov	x1, x22
	bl	_interpret_ir_data
	ldr	w8, [x20, #8]
LBB0_5:
Lloh9:
	adrp	x9, _WPAD_DATA_EXPANSION@GOTPAGE
Lloh10:
	ldr	x9, [x9, _WPAD_DATA_EXPANSION@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.6:
	ldr	w8, [x20, #16]
	cmp	w8, #129
	b.eq	LBB0_9
; %bb.7:
	cmp	w8, #128
	b.ne	LBB0_11
; %bb.8:
	ldr	w8, [x19, #72]
	mov	x22, x20
	str	w8, [x22, #72]!
	sub	x25, x22, #16
	ldr	w1, [x22, #8]
	mov	x0, x22
	ldr	w2, [x0, #4]!
	bl	_calc_joystick_state
	sub	x23, x22, #4
	sub	x24, x22, #8
	mov	x0, x23
	mov	x1, x24
	mov	x2, x22
	mov	x3, x21
	bl	_calculate_orientation
	sub	x2, x22, #12
	mov	x0, x23
	mov	x1, x24
	bl	_calculate_gforce
	b	LBB0_10
LBB0_9:
	ldrsw	x8, [x20, #52]
	mov	x9, #-63421
	movk	x9, #33825, lsl #16
	mul	x10, x8, x9
	lsr	x10, x10, #32
	add	w8, w10, w8
	asr	w10, w8, #4
	add	w8, w10, w8, lsr #31
	ldp	w1, w10, [x20, #44]
                                        ; kill: def $w10 killed $w10 def $x10
	sxtw	x10, w10
	mul	x9, x10, x9
	lsr	x9, x9, #32
	add	w9, w9, w10
	asr	w10, w9, #4
	add	w9, w10, w9, lsr #31
	stp	w8, w9, [x20, #20]
	mov	x0, x20
	ldr	w2, [x0, #40]!
	bl	_calc_joystick_state
	mov	x21, x20
	ldp	w2, w1, [x21, #32]!
	mov	x0, x21
	bl	_calc_joystick_state
	sub	x25, x21, #4
LBB0_10:
	ldr	w8, [x25]
	ldr	w9, [x20, #12]
	orr	w8, w9, w8, lsl #16
	str	w8, [x20, #12]
LBB0_11:
	ldp	q0, q1, [x20]
	stp	q0, q1, [x19]
	ldp	q0, q1, [x20, #32]
	ldp	q2, q3, [x20, #64]
	stp	q2, q3, [x19, #64]
	stp	q0, q1, [x19, #32]
	ldp	q0, q1, [x20, #96]
	ldr	q2, [x20, #128]
	ldr	x8, [x20, #144]
	str	x8, [x19, #144]
	stp	q1, q2, [x19, #112]
	str	q0, [x19, #96]
LBB0_12:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_WPAD_ERR_NONE,8,3              ; @WPAD_ERR_NONE
	.comm	_WPAD_DATA_ACCEL,4,2            ; @WPAD_DATA_ACCEL
	.comm	_WPAD_DATA_IR,4,2               ; @WPAD_DATA_IR
	.comm	_WPAD_DATA_EXPANSION,4,2        ; @WPAD_DATA_EXPANSION
	.no_dead_strip	___wpad_calc_data
.subsections_via_symbols
