	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function winraw_update_mouse_state
_winraw_update_mouse_state:             ## @winraw_update_mouse_state
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_MOUSE_MOVE_ABSOLUTE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_4
## %bb.1:
	movq	_g_mouse_xy_mapping_ready@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.2:
	movq	_g_view_abs_ratio_x@GOTPCREL(%rip), %rax
	movl	4(%r14), %esi
	movl	8(%r14), %ecx
	imull	(%rax), %esi
	movl	%esi, 4(%r14)
	movq	_g_view_abs_ratio_y@GOTPCREL(%rip), %rax
	imull	(%rax), %ecx
	movl	%ecx, 8(%r14)
	leaq	40(%rbx), %rdi
	subl	(%rbx), %esi
	callq	_InterlockedExchangeAdd
	leaq	36(%rbx), %rdi
	movl	8(%r14), %esi
	subl	4(%rbx), %esi
	callq	_InterlockedExchangeAdd
	movl	4(%r14), %eax
	movl	%eax, (%rbx)
	movl	8(%r14), %eax
	jmp	LBB0_12
LBB0_4:
	movl	4(%r14), %esi
	testl	%esi, %esi
	jne	LBB0_6
## %bb.5:
	cmpl	$0, 8(%r14)
	je	LBB0_13
LBB0_6:
	leaq	40(%rbx), %rdi
	callq	_InterlockedExchangeAdd
	leaq	36(%rbx), %rdi
	movl	8(%r14), %esi
	callq	_InterlockedExchangeAdd
	leaq	-24(%rbp), %rdi
	callq	_GetCursorPos
	testl	%eax, %eax
	je	LBB0_7
## %bb.9:
	xorl	%eax, %eax
	callq	_video_driver_window_get
	leaq	-24(%rbp), %rsi
	movl	%eax, %edi
	callq	_ScreenToClient
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movl	-24(%rbp), %eax
	movl	%eax, (%rbx)
	movl	-20(%rbp), %eax
LBB0_12:
	movl	%eax, 4(%rbx)
	jmp	LBB0_13
LBB0_3:
	xorl	%eax, %eax
	callq	_winraw_init_mouse_xy_mapping
	jmp	LBB0_13
LBB0_7:
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_8
LBB0_10:
	xorl	%eax, %eax
	callq	_GetLastError
	leaq	L_.str.1(%rip), %rdi
LBB0_8:
	movl	%eax, %esi
	callq	_RARCH_WARN
LBB0_13:
	movl	12(%r14), %eax
	movq	_RI_MOUSE_LEFT_BUTTON_DOWN@GOTPCREL(%rip), %rdx
	movl	$1, %ecx
	testl	%eax, (%rdx)
	jne	LBB0_15
## %bb.14:
	movq	_RI_MOUSE_LEFT_BUTTON_UP@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	testl	%eax, (%rdx)
	je	LBB0_16
LBB0_15:
	movl	%ecx, 8(%rbx)
LBB0_16:
	movq	_RI_MOUSE_MIDDLE_BUTTON_DOWN@GOTPCREL(%rip), %rdx
	movl	$1, %ecx
	testl	%eax, (%rdx)
	jne	LBB0_18
## %bb.17:
	movq	_RI_MOUSE_MIDDLE_BUTTON_UP@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	testl	%eax, (%rdx)
	je	LBB0_19
LBB0_18:
	movl	%ecx, 12(%rbx)
LBB0_19:
	movq	_RI_MOUSE_RIGHT_BUTTON_DOWN@GOTPCREL(%rip), %rdx
	movl	$1, %ecx
	testl	%eax, (%rdx)
	jne	LBB0_21
## %bb.20:
	movq	_RI_MOUSE_RIGHT_BUTTON_UP@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	testl	%eax, (%rdx)
	je	LBB0_22
LBB0_21:
	movl	%ecx, 16(%rbx)
LBB0_22:
	movq	_RI_MOUSE_BUTTON_4_DOWN@GOTPCREL(%rip), %rdx
	movl	$1, %ecx
	testl	%eax, (%rdx)
	jne	LBB0_24
## %bb.23:
	movq	_RI_MOUSE_BUTTON_4_UP@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	testl	%eax, (%rdx)
	je	LBB0_25
LBB0_24:
	movl	%ecx, 20(%rbx)
LBB0_25:
	movq	_RI_MOUSE_BUTTON_5_DOWN@GOTPCREL(%rip), %rdx
	movl	$1, %ecx
	testl	%eax, (%rdx)
	jne	LBB0_27
## %bb.26:
	movq	_RI_MOUSE_BUTTON_5_UP@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	testl	%eax, (%rdx)
	je	LBB0_28
LBB0_27:
	movl	%ecx, 24(%rbx)
LBB0_28:
	movq	_RI_MOUSE_WHEEL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_34
## %bb.29:
	cmpq	$0, 16(%r14)
	jle	LBB0_31
## %bb.30:
	addq	$32, %rbx
LBB0_33:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_InterlockedExchange
	jmp	LBB0_34
LBB0_31:
	js	LBB0_32
LBB0_34:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_32:
	addq	$28, %rbx
	jmp	LBB0_33
	.cfi_endproc
                                        ## -- End function
	.comm	_MOUSE_MOVE_ABSOLUTE,4,2        ## @MOUSE_MOVE_ABSOLUTE
	.comm	_g_mouse_xy_mapping_ready,8,3   ## @g_mouse_xy_mapping_ready
	.comm	_g_view_abs_ratio_x,4,2         ## @g_view_abs_ratio_x
	.comm	_g_view_abs_ratio_y,4,2         ## @g_view_abs_ratio_y
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[WINRAW]: GetCursorPos failed with error %lu.\n"

L_.str.1:                               ## @.str.1
	.asciz	"[WINRAW]: ScreenToClient failed with error %lu.\n"

	.comm	_RI_MOUSE_LEFT_BUTTON_DOWN,4,2  ## @RI_MOUSE_LEFT_BUTTON_DOWN
	.comm	_RI_MOUSE_LEFT_BUTTON_UP,4,2    ## @RI_MOUSE_LEFT_BUTTON_UP
	.comm	_RI_MOUSE_MIDDLE_BUTTON_DOWN,4,2 ## @RI_MOUSE_MIDDLE_BUTTON_DOWN
	.comm	_RI_MOUSE_MIDDLE_BUTTON_UP,4,2  ## @RI_MOUSE_MIDDLE_BUTTON_UP
	.comm	_RI_MOUSE_RIGHT_BUTTON_DOWN,4,2 ## @RI_MOUSE_RIGHT_BUTTON_DOWN
	.comm	_RI_MOUSE_RIGHT_BUTTON_UP,4,2   ## @RI_MOUSE_RIGHT_BUTTON_UP
	.comm	_RI_MOUSE_BUTTON_4_DOWN,4,2     ## @RI_MOUSE_BUTTON_4_DOWN
	.comm	_RI_MOUSE_BUTTON_4_UP,4,2       ## @RI_MOUSE_BUTTON_4_UP
	.comm	_RI_MOUSE_BUTTON_5_DOWN,4,2     ## @RI_MOUSE_BUTTON_5_DOWN
	.comm	_RI_MOUSE_BUTTON_5_UP,4,2       ## @RI_MOUSE_BUTTON_5_UP
	.comm	_RI_MOUSE_WHEEL,4,2             ## @RI_MOUSE_WHEEL
	.no_dead_strip	_winraw_update_mouse_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function winraw_update_mouse_state
_winraw_update_mouse_state:             ; @winraw_update_mouse_state
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _MOUSE_MOVE_ABSOLUTE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MOUSE_MOVE_ABSOLUTE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _g_mouse_xy_mapping_ready@GOTPAGE
Lloh4:
	ldr	x8, [x8, _g_mouse_xy_mapping_ready@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cbz	x8, LBB0_9
; %bb.2:
Lloh6:
	adrp	x8, _g_view_abs_ratio_x@GOTPAGE
Lloh7:
	ldr	x8, [x8, _g_view_abs_ratio_x@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldp	w9, w10, [x20, #4]
	mul	w8, w9, w8
Lloh9:
	adrp	x9, _g_view_abs_ratio_y@GOTPAGE
Lloh10:
	ldr	x9, [x9, _g_view_abs_ratio_y@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	mul	w9, w10, w9
	stp	w8, w9, [x20, #4]
	add	x0, x19, #40
	ldr	w9, [x19]
	sub	w1, w8, w9
	bl	_InterlockedExchangeAdd
	add	x0, x19, #36
	ldr	w8, [x20, #8]
	ldr	w9, [x19, #4]
	sub	w1, w8, w9
	bl	_InterlockedExchangeAdd
	ldur	d0, [x20, #4]
	b	LBB0_8
LBB0_3:
	ldr	w1, [x20, #4]
	cbnz	w1, LBB0_5
; %bb.4:
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_13
LBB0_5:
	add	x0, x19, #40
	bl	_InterlockedExchangeAdd
	add	x0, x19, #36
	ldr	w1, [x20, #8]
	bl	_InterlockedExchangeAdd
	add	x0, sp, #8
	bl	_GetCursorPos
	cbz	w0, LBB0_10
; %bb.6:
	bl	_video_driver_window_get
	add	x1, sp, #8
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_ScreenToClient
	cbz	w0, LBB0_11
; %bb.7:
	ldr	d0, [sp, #8]
LBB0_8:
	str	d0, [x19]
	b	LBB0_13
LBB0_9:
	bl	_winraw_init_mouse_xy_mapping
	b	LBB0_13
LBB0_10:
	bl	_GetLastError
	mov	x1, x0
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_12
LBB0_11:
	bl	_GetLastError
	mov	x1, x0
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_12:
	bl	_RARCH_WARN
LBB0_13:
	ldr	w8, [x20, #12]
Lloh16:
	adrp	x9, _RI_MOUSE_LEFT_BUTTON_DOWN@GOTPAGE
Lloh17:
	ldr	x9, [x9, _RI_MOUSE_LEFT_BUTTON_DOWN@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.14:
	mov	w9, #1
	b	LBB0_17
LBB0_15:
Lloh19:
	adrp	x9, _RI_MOUSE_LEFT_BUTTON_UP@GOTPAGE
Lloh20:
	ldr	x9, [x9, _RI_MOUSE_LEFT_BUTTON_UP@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.16:
	mov	w9, #0
LBB0_17:
	str	w9, [x19, #8]
LBB0_18:
Lloh22:
	adrp	x9, _RI_MOUSE_MIDDLE_BUTTON_DOWN@GOTPAGE
Lloh23:
	ldr	x9, [x9, _RI_MOUSE_MIDDLE_BUTTON_DOWN@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.19:
	mov	w9, #1
	b	LBB0_22
LBB0_20:
Lloh25:
	adrp	x9, _RI_MOUSE_MIDDLE_BUTTON_UP@GOTPAGE
Lloh26:
	ldr	x9, [x9, _RI_MOUSE_MIDDLE_BUTTON_UP@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_23
; %bb.21:
	mov	w9, #0
LBB0_22:
	str	w9, [x19, #12]
LBB0_23:
Lloh28:
	adrp	x9, _RI_MOUSE_RIGHT_BUTTON_DOWN@GOTPAGE
Lloh29:
	ldr	x9, [x9, _RI_MOUSE_RIGHT_BUTTON_DOWN@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_25
; %bb.24:
	mov	w9, #1
	b	LBB0_27
LBB0_25:
Lloh31:
	adrp	x9, _RI_MOUSE_RIGHT_BUTTON_UP@GOTPAGE
Lloh32:
	ldr	x9, [x9, _RI_MOUSE_RIGHT_BUTTON_UP@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_28
; %bb.26:
	mov	w9, #0
LBB0_27:
	str	w9, [x19, #16]
LBB0_28:
Lloh34:
	adrp	x9, _RI_MOUSE_BUTTON_4_DOWN@GOTPAGE
Lloh35:
	ldr	x9, [x9, _RI_MOUSE_BUTTON_4_DOWN@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_30
; %bb.29:
	mov	w9, #1
	b	LBB0_32
LBB0_30:
Lloh37:
	adrp	x9, _RI_MOUSE_BUTTON_4_UP@GOTPAGE
Lloh38:
	ldr	x9, [x9, _RI_MOUSE_BUTTON_4_UP@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_33
; %bb.31:
	mov	w9, #0
LBB0_32:
	str	w9, [x19, #20]
LBB0_33:
Lloh40:
	adrp	x9, _RI_MOUSE_BUTTON_5_DOWN@GOTPAGE
Lloh41:
	ldr	x9, [x9, _RI_MOUSE_BUTTON_5_DOWN@GOTPAGEOFF]
Lloh42:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_35
; %bb.34:
	mov	w9, #1
	b	LBB0_37
LBB0_35:
Lloh43:
	adrp	x9, _RI_MOUSE_BUTTON_5_UP@GOTPAGE
Lloh44:
	ldr	x9, [x9, _RI_MOUSE_BUTTON_5_UP@GOTPAGEOFF]
Lloh45:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_38
; %bb.36:
	mov	w9, #0
LBB0_37:
	str	w9, [x19, #24]
LBB0_38:
Lloh46:
	adrp	x9, _RI_MOUSE_WHEEL@GOTPAGE
Lloh47:
	ldr	x9, [x9, _RI_MOUSE_WHEEL@GOTPAGEOFF]
Lloh48:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_43
; %bb.39:
	ldr	x8, [x20, #16]
	cmp	x8, #1
	b.lt	LBB0_42
; %bb.40:
	add	x0, x19, #32
LBB0_41:
	mov	w1, #1
	bl	_InterlockedExchange
	b	LBB0_43
LBB0_42:
	tbnz	x8, #63, LBB0_44
LBB0_43:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_44:
	add	x0, x19, #28
	b	LBB0_41
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_MOUSE_MOVE_ABSOLUTE,4,2        ; @MOUSE_MOVE_ABSOLUTE
	.comm	_g_mouse_xy_mapping_ready,8,3   ; @g_mouse_xy_mapping_ready
	.comm	_g_view_abs_ratio_x,4,2         ; @g_view_abs_ratio_x
	.comm	_g_view_abs_ratio_y,4,2         ; @g_view_abs_ratio_y
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[WINRAW]: GetCursorPos failed with error %lu.\n"

l_.str.1:                               ; @.str.1
	.asciz	"[WINRAW]: ScreenToClient failed with error %lu.\n"

	.comm	_RI_MOUSE_LEFT_BUTTON_DOWN,4,2  ; @RI_MOUSE_LEFT_BUTTON_DOWN
	.comm	_RI_MOUSE_LEFT_BUTTON_UP,4,2    ; @RI_MOUSE_LEFT_BUTTON_UP
	.comm	_RI_MOUSE_MIDDLE_BUTTON_DOWN,4,2 ; @RI_MOUSE_MIDDLE_BUTTON_DOWN
	.comm	_RI_MOUSE_MIDDLE_BUTTON_UP,4,2  ; @RI_MOUSE_MIDDLE_BUTTON_UP
	.comm	_RI_MOUSE_RIGHT_BUTTON_DOWN,4,2 ; @RI_MOUSE_RIGHT_BUTTON_DOWN
	.comm	_RI_MOUSE_RIGHT_BUTTON_UP,4,2   ; @RI_MOUSE_RIGHT_BUTTON_UP
	.comm	_RI_MOUSE_BUTTON_4_DOWN,4,2     ; @RI_MOUSE_BUTTON_4_DOWN
	.comm	_RI_MOUSE_BUTTON_4_UP,4,2       ; @RI_MOUSE_BUTTON_4_UP
	.comm	_RI_MOUSE_BUTTON_5_DOWN,4,2     ; @RI_MOUSE_BUTTON_5_DOWN
	.comm	_RI_MOUSE_BUTTON_5_UP,4,2       ; @RI_MOUSE_BUTTON_5_UP
	.comm	_RI_MOUSE_WHEEL,4,2             ; @RI_MOUSE_WHEEL
	.no_dead_strip	_winraw_update_mouse_state
.subsections_via_symbols
