	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pidff_request_effect_upload
_pidff_request_effect_upload:           ## @pidff_request_effect_upload
	.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
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	40(%rdi), %rax
	movq	(%rax), %rax
	movl	%esi, (%rax)
	movl	8(%rdi), %edi
	movq	32(%r15), %rax
	movq	_PID_CREATE_NEW_EFFECT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %esi
	movq	_HID_REQ_SET_REPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_hid_hw_request
	movl	8(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_hid_dbg
	movq	16(%r15), %rax
	movq	_PID_EFFECT_BLOCK_INDEX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rax
	movl	$0, (%rax)
	movq	24(%r15), %rax
	movq	(%rax), %rax
	movq	$0, (%rax)
	movl	8(%r15), %edi
	callq	_hid_hw_wait
	movl	$60, %ebx
	movq	_HID_REQ_GET_REPORT@GOTPCREL(%rip), %r13
	movq	_PID_BLOCK_LOAD_SUCCESS@GOTPCREL(%rip), %r14
	movq	_PID_BLOCK_LOAD_FULL@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_hid_dbg
	movl	8(%r15), %edi
	movq	32(%r15), %rax
	movq	_PID_BLOCK_LOAD@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %esi
	movl	(%r13), %edx
	callq	_hid_hw_request
	movl	8(%r15), %edi
	callq	_hid_hw_wait
	movq	(%r15), %rax
	movq	24(%r15), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx), %rcx
	movq	(%r14), %rdx
	cmpq	(%rax,%rdx,8), %rcx
	je	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r12), %rdx
	cmpq	(%rax,%rdx,8), %rcx
	je	LBB0_8
## %bb.1:                               ##   in Loop: Header=BB0_2 Depth=1
	decl	%ebx
	jne	LBB0_2
## %bb.12:
	movl	8(%r15), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_hid_err
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_3:
	movl	8(%r15), %edi
	movq	16(%r15), %rax
	movq	_PID_RAM_POOL_AVAILABLE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movl	(%rax), %edx
	jmp	LBB0_6
LBB0_8:
	movl	8(%r15), %edi
	movq	16(%r15), %rax
	movq	_PID_RAM_POOL_AVAILABLE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movl	(%rax), %edx
	jmp	LBB0_11
LBB0_4:
	movl	$-1, %edx
LBB0_6:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_hid_dbg
	jmp	LBB0_14
LBB0_9:
	movl	$-1, %edx
LBB0_11:
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_hid_dbg
	movq	_ENOSPC@GOTPCREL(%rip), %rax
LBB0_13:
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PID_CREATE_NEW_EFFECT,8,3      ## @PID_CREATE_NEW_EFFECT
	.comm	_HID_REQ_SET_REPORT,4,2         ## @HID_REQ_SET_REPORT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"create_new_effect sent, type: %d\n"

	.comm	_PID_EFFECT_BLOCK_INDEX,8,3     ## @PID_EFFECT_BLOCK_INDEX
L_.str.1:                               ## @.str.1
	.asciz	"pid_block_load requested\n"

	.comm	_PID_BLOCK_LOAD,8,3             ## @PID_BLOCK_LOAD
	.comm	_HID_REQ_GET_REPORT,4,2         ## @HID_REQ_GET_REPORT
	.comm	_PID_BLOCK_LOAD_SUCCESS,8,3     ## @PID_BLOCK_LOAD_SUCCESS
L_.str.2:                               ## @.str.2
	.asciz	"device reported free memory: %d bytes\n"

	.comm	_PID_RAM_POOL_AVAILABLE,8,3     ## @PID_RAM_POOL_AVAILABLE
	.comm	_PID_BLOCK_LOAD_FULL,8,3        ## @PID_BLOCK_LOAD_FULL
L_.str.3:                               ## @.str.3
	.asciz	"not enough memory free: %d bytes\n"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
L_.str.4:                               ## @.str.4
	.asciz	"pid_block_load failed 60 times\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_pidff_request_effect_upload
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pidff_request_effect_upload
_pidff_request_effect_upload:           ; @pidff_request_effect_upload
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
	ldp	x9, x8, [x0, #32]
	ldr	x8, [x8]
	str	w1, [x8]
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x8, _PID_CREATE_NEW_EFFECT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PID_CREATE_NEW_EFFECT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	w1, [x9, x8, lsl #2]
Lloh3:
	adrp	x8, _HID_REQ_SET_REPORT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HID_REQ_SET_REPORT@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_hid_hw_request
	ldr	w0, [x19, #8]
	str	x20, [sp]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_hid_dbg
Lloh8:
	adrp	x8, _PID_EFFECT_BLOCK_INDEX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PID_EFFECT_BLOCK_INDEX@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ldp	x9, x10, [x19, #16]
	ldr	x8, [x9, x8, lsl #3]
	str	wzr, [x8]
	ldr	x8, [x10]
	str	xzr, [x8]
	ldr	w0, [x19, #8]
	bl	_hid_hw_wait
	mov	w21, #60
Lloh11:
	adrp	x22, _PID_BLOCK_LOAD@GOTPAGE
Lloh12:
	ldr	x22, [x22, _PID_BLOCK_LOAD@GOTPAGEOFF]
Lloh13:
	adrp	x23, _HID_REQ_GET_REPORT@GOTPAGE
Lloh14:
	ldr	x23, [x23, _HID_REQ_GET_REPORT@GOTPAGEOFF]
Lloh15:
	adrp	x20, l_.str.1@PAGE
Lloh16:
	add	x20, x20, l_.str.1@PAGEOFF
Lloh17:
	adrp	x24, _PID_BLOCK_LOAD_SUCCESS@GOTPAGE
Lloh18:
	ldr	x24, [x24, _PID_BLOCK_LOAD_SUCCESS@GOTPAGEOFF]
Lloh19:
	adrp	x25, _PID_BLOCK_LOAD_FULL@GOTPAGE
Lloh20:
	ldr	x25, [x25, _PID_BLOCK_LOAD_FULL@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #8]
	mov	x1, x20
	bl	_hid_dbg
	ldr	w0, [x19, #8]
	ldr	x8, [x19, #32]
	ldr	x9, [x22]
	ldr	w1, [x8, x9, lsl #2]
	ldr	w2, [x23]
	bl	_hid_hw_request
	ldr	w0, [x19, #8]
	bl	_hid_hw_wait
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	x9, [x19]
	ldr	x10, [x24]
	ldr	x10, [x9, x10, lsl #3]
	cmp	x8, x10
	b.eq	LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x10, [x25]
	ldr	x9, [x9, x10, lsl #3]
	cmp	x8, x9
	b.eq	LBB0_7
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	subs	w21, w21, #1
	b.ne	LBB0_1
; %bb.4:
	ldr	w0, [x19, #8]
Lloh21:
	adrp	x1, l_.str.4@PAGE
Lloh22:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_hid_err
Lloh23:
	adrp	x8, _EIO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_13
LBB0_5:
	ldr	w0, [x19, #8]
	ldr	x8, [x19, #16]
Lloh25:
	adrp	x9, _PID_RAM_POOL_AVAILABLE@GOTPAGE
Lloh26:
	ldr	x9, [x9, _PID_RAM_POOL_AVAILABLE@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	cbz	x8, LBB0_9
; %bb.6:
	ldr	w8, [x8]
	b	LBB0_10
LBB0_7:
	ldr	w0, [x19, #8]
	ldr	x8, [x19, #16]
Lloh28:
	adrp	x9, _PID_RAM_POOL_AVAILABLE@GOTPAGE
Lloh29:
	ldr	x9, [x9, _PID_RAM_POOL_AVAILABLE@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	cbz	x8, LBB0_11
; %bb.8:
	ldr	w8, [x8]
	b	LBB0_12
LBB0_9:
	mov	w8, #-1
LBB0_10:
	str	x8, [sp]
Lloh31:
	adrp	x1, l_.str.2@PAGE
Lloh32:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_hid_dbg
	mov	w0, #0
	b	LBB0_14
LBB0_11:
	mov	w8, #-1
LBB0_12:
	str	x8, [sp]
Lloh33:
	adrp	x1, l_.str.3@PAGE
Lloh34:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_hid_dbg
Lloh35:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_PID_CREATE_NEW_EFFECT,8,3      ; @PID_CREATE_NEW_EFFECT
	.comm	_HID_REQ_SET_REPORT,4,2         ; @HID_REQ_SET_REPORT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"create_new_effect sent, type: %d\n"

	.comm	_PID_EFFECT_BLOCK_INDEX,8,3     ; @PID_EFFECT_BLOCK_INDEX
l_.str.1:                               ; @.str.1
	.asciz	"pid_block_load requested\n"

	.comm	_PID_BLOCK_LOAD,8,3             ; @PID_BLOCK_LOAD
	.comm	_HID_REQ_GET_REPORT,4,2         ; @HID_REQ_GET_REPORT
	.comm	_PID_BLOCK_LOAD_SUCCESS,8,3     ; @PID_BLOCK_LOAD_SUCCESS
l_.str.2:                               ; @.str.2
	.asciz	"device reported free memory: %d bytes\n"

	.comm	_PID_RAM_POOL_AVAILABLE,8,3     ; @PID_RAM_POOL_AVAILABLE
	.comm	_PID_BLOCK_LOAD_FULL,8,3        ; @PID_BLOCK_LOAD_FULL
l_.str.3:                               ; @.str.3
	.asciz	"not enough memory free: %d bytes\n"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
l_.str.4:                               ; @.str.4
	.asciz	"pid_block_load failed 60 times\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_pidff_request_effect_upload
.subsections_via_symbols
