	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_queue_event                    ## -- Begin function queue_event
	.p2align	4, 0x90
_queue_event:                           ## @queue_event
	.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
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r12
	movq	%rdx, %r13
	movl	%esi, %ebx
	callq	_impl_from_IDirectInputDevice8A
	movq	%rax, %r15
	leaq	56(%rax), %rdi
	movl	%ebx, %esi
	callq	_id_to_offset
	movl	%eax, %r14d
	movq	48(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_SetEvent
LBB0_2:
	xorl	%eax, %eax
	callq	_GetDesktopWindow
	movq	_WM_WINE_NOTIFY_ACTIVITY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_PostMessageW
	movl	(%r15), %r8d
	testl	%r8d, %r8d
	je	LBB0_13
## %bb.3:
	cmpq	$0, 40(%r15)
	jne	LBB0_13
## %bb.4:
	testl	%r14d, %r14d
	js	LBB0_13
## %bb.5:
	movl	4(%r15), %ecx
	leal	1(%rcx), %eax
	cltd
	idivl	%r8d
	cmpl	8(%r15), %edx
	jne	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 40(%r15)
	jmp	LBB0_13
LBB0_7:
	movl	%edx, %ebx
	leaq	L_.str.1(%rip), %rdi
	movq	%r13, %rsi
	movl	%r14d, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_TRACE
	movq	32(%r15), %rax
	movslq	4(%r15), %rcx
	shlq	$5, %rcx
	movl	%r14d, (%rax,%rcx)
	movq	%r13, 24(%rax,%rcx)
	movq	%r12, 16(%rax,%rcx)
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, 8(%rax,%rcx)
	movq	16(%r15), %rcx
	testq	%rcx, %rcx
	jle	LBB0_12
## %bb.8:
	movq	24(%r15), %rax
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r14d, (%rax,%rdx,8)
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	LBB0_9
	jmp	LBB0_12
LBB0_10:
	movl	%ebx, %r12d
	movl	%edx, %ebx
	shlq	$3, %rbx
	movl	4(%rax,%rbx), %edx
	leaq	L_.str.2(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_TRACE
	movq	24(%r15), %rax
	movq	32(%r15), %rcx
	movl	4(%rax,%rbx), %eax
	movl	%r12d, %ebx
	movslq	4(%r15), %rdx
	shlq	$5, %rdx
	movl	%eax, 4(%rcx,%rdx)
LBB0_12:
	movl	%ebx, 4(%r15)
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WM_WINE_NOTIFY_ACTIVITY,4,2    ## @WM_WINE_NOTIFY_ACTIVITY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" queue overflowed\n"

	.comm	_TRUE,8,3                       ## @TRUE
L_.str.1:                               ## @.str.1
	.asciz	" queueing %d at offset %d (queue head %d / size %d)\n"

L_.str.2:                               ## @.str.2
	.asciz	"Offset %d mapped to uAppData %lu\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_queue_event                    ; -- Begin function queue_event
	.p2align	2
_queue_event:                           ; @queue_event
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x20, x1
	bl	_impl_from_IDirectInputDevice8A
	mov	x19, x0
	add	x0, x0, #56
	mov	x1, x20
	bl	_id_to_offset
	mov	x20, x0
	ldr	x0, [x19, #48]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_SetEvent
LBB0_2:
	bl	_GetDesktopWindow
Lloh0:
	adrp	x8, _WM_WINE_NOTIFY_ACTIVITY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WM_WINE_NOTIFY_ACTIVITY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	mov	w3, #0
	bl	_PostMessageW
	ldr	w8, [x19]
	cbz	w8, LBB0_13
; %bb.3:
	ldr	x9, [x19, #40]
	cbnz	x9, LBB0_13
; %bb.4:
	tbnz	w20, #31, LBB0_13
; %bb.5:
	ldp	w9, w10, [x19, #4]
	add	w11, w9, #1
	sdiv	w12, w11, w8
	msub	w24, w12, w8, w11
	cmp	w24, w10
	b.ne	LBB0_7
; %bb.6:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
Lloh5:
	adrp	x8, _TRUE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	str	x8, [x19, #40]
	b	LBB0_13
LBB0_7:
	stp	x9, x8, [sp, #16]
	stp	x23, x20, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	ldr	x8, [x19, #32]
	ldrsw	x9, [x19, #4]
	add	x8, x8, x9, lsl #5
	str	w20, [x8]
	stp	x22, x23, [x8, #16]
	str	x21, [x8, #8]
	ldr	x8, [x19, #16]
	cmp	x8, #1
	b.lt	LBB0_12
; %bb.8:
	mov	x10, #0
	ldr	x9, [x19, #24]
	mov	x11, x9
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11]
	cmp	w12, w20
	b.eq	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x10, x10, #1
	add	x11, x11, #8
	cmp	x8, x10
	b.ne	LBB0_9
	b	LBB0_12
LBB0_11:
	ubfiz	x21, x10, #3, #32
	add	x8, x9, x21
	ldr	w8, [x8, #4]
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	stp	x20, x8, [sp]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_TRACE
	ldp	x8, x9, [x19, #24]
	add	x8, x8, x21
	ldr	w8, [x8, #4]
	ldrsw	x10, [x19, #4]
	add	x9, x9, x10, lsl #5
	str	w8, [x9, #4]
LBB0_12:
	str	w24, [x19, #4]
LBB0_13:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_WM_WINE_NOTIFY_ACTIVITY,4,2    ; @WM_WINE_NOTIFY_ACTIVITY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" queue overflowed\n"

	.comm	_TRUE,8,3                       ; @TRUE
l_.str.1:                               ; @.str.1
	.asciz	" queueing %d at offset %d (queue head %d / size %d)\n"

l_.str.2:                               ; @.str.2
	.asciz	"Offset %d mapped to uAppData %lu\n"

.subsections_via_symbols
