	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mac_hid_mouse_emulate_buttons  ## -- Begin function mac_hid_mouse_emulate_buttons
	.p2align	4, 0x90
_mac_hid_mouse_emulate_buttons:         ## @mac_hid_mouse_emulate_buttons
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	xorl	%eax, %eax
	cmpl	$1, %edi
	jne	LBB0_10
## %bb.1:
	movq	_mouse_emulate_buttons@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	testl	%edi, %edi
	je	LBB0_10
## %bb.2:
	movq	_mouse_button2_keycode@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%esi, %ecx
	je	LBB0_4
## %bb.3:
	movq	_mouse_button3_keycode@GOTPCREL(%rip), %rbx
	cmpl	%esi, (%rbx)
	jne	LBB0_10
LBB0_4:
	cmpl	$1, %edi
	jne	LBB0_9
## %bb.5:
	movq	_emumousebtn@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	cmpl	%esi, %ecx
	jne	LBB0_6
## %bb.7:
	movq	_BTN_MIDDLE@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_9:
	testl	%edx, %edx
	cmovel	%edx, %esi
	movq	_mouse_last_keycode@GOTPCREL(%rip), %rcx
	movl	%esi, (%rcx)
	jmp	LBB0_10
LBB0_6:
	movq	_BTN_RIGHT@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %esi
	callq	_input_report_key
	movl	(%rbx), %edi
	callq	_input_sync
	movl	$1, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mouse_emulate_buttons,4,2      ## @mouse_emulate_buttons
	.comm	_mouse_button2_keycode,4,2      ## @mouse_button2_keycode
	.comm	_mouse_button3_keycode,4,2      ## @mouse_button3_keycode
	.comm	_emumousebtn,4,2                ## @emumousebtn
	.comm	_BTN_MIDDLE,4,2                 ## @BTN_MIDDLE
	.comm	_BTN_RIGHT,4,2                  ## @BTN_RIGHT
	.comm	_mouse_last_keycode,4,2         ## @mouse_last_keycode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mac_hid_mouse_emulate_buttons  ; -- Begin function mac_hid_mouse_emulate_buttons
	.p2align	2
_mac_hid_mouse_emulate_buttons:         ; @mac_hid_mouse_emulate_buttons
	.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
	mov	x8, x0
	mov	w0, #0
	cmp	w8, #1
	b.ne	LBB0_7
; %bb.1:
Lloh0:
	adrp	x8, _mouse_emulate_buttons@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mouse_emulate_buttons@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	cbz	w9, LBB0_7
; %bb.2:
Lloh3:
	adrp	x8, _mouse_button2_keycode@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mouse_button2_keycode@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x10, _mouse_button3_keycode@GOTPAGE
Lloh7:
	ldr	x10, [x10, _mouse_button3_keycode@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	cmp	w8, w1
	ccmp	w10, w1, #4, ne
	b.ne	LBB0_5
; %bb.3:
	cmp	w9, #1
	b.ne	LBB0_6
; %bb.4:
Lloh9:
	adrp	x19, _emumousebtn@GOTPAGE
Lloh10:
	ldr	x19, [x19, _emumousebtn@GOTPAGEOFF]
Lloh11:
	adrp	x9, _BTN_MIDDLE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _BTN_MIDDLE@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh13:
	adrp	x10, _BTN_RIGHT@GOTPAGE
Lloh14:
	ldr	x10, [x10, _BTN_RIGHT@GOTPAGEOFF]
	cmp	w8, w1
	csel	x8, x9, x10, eq
	ldr	w1, [x8]
	bl	_input_report_key
	ldr	w0, [x19]
	bl	_input_sync
	mov	w0, #1
	b	LBB0_7
LBB0_5:
	mov	w0, #0
	b	LBB0_7
LBB0_6:
	mov	w0, #0
	cmp	w2, #0
	csel	w8, wzr, w1, eq
Lloh15:
	adrp	x9, _mouse_last_keycode@GOTPAGE
Lloh16:
	ldr	x9, [x9, _mouse_last_keycode@GOTPAGEOFF]
Lloh17:
	str	w8, [x9]
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_mouse_emulate_buttons,4,2      ; @mouse_emulate_buttons
	.comm	_mouse_button2_keycode,4,2      ; @mouse_button2_keycode
	.comm	_mouse_button3_keycode,4,2      ; @mouse_button3_keycode
	.comm	_emumousebtn,4,2                ; @emumousebtn
	.comm	_BTN_MIDDLE,4,2                 ; @BTN_MIDDLE
	.comm	_BTN_RIGHT,4,2                  ; @BTN_RIGHT
	.comm	_mouse_last_keycode,4,2         ; @mouse_last_keycode
.subsections_via_symbols
