	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__glfwPlatformGetJoystickButtons ## -- Begin function _glfwPlatformGetJoystickButtons
	.p2align	4, 0x90
__glfwPlatformGetJoystickButtons:       ## @_glfwPlatformGetJoystickButtons
	.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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movl	%edi, %r15d
	movq	__glfw@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edi, %rdi
	movq	(%rax,%rdi,8), %r14
	leaq	-48(%rbp), %rsi
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$16, %edx
	callq	__glfw_joyGetDevCaps
	movq	_JOYERR_NOERROR@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_8
## %bb.1:
	movl	$24, -72(%rbp)
	movq	_JOY_RETURNBUTTONS@GOTPCREL(%rip), %rax
	movq	_JOY_RETURNPOV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, -68(%rbp)
	leaq	-72(%rbp), %rsi
	movl	%r15d, %edi
	callq	__glfw_joyGetPosEx
	cmpq	(%r12), %rax
	jne	LBB0_8
## %bb.2:
	movl	(%rbx), %eax
	cmpl	-40(%rbp), %eax
	jge	LBB0_9
## %bb.3:
	movq	_GLFW_PRESS@GOTPCREL(%rip), %rcx
	movq	_GLFW_RELEASE@GOTPCREL(%rip), %rdi
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	movzbl	(%rsi), %edx
	cltq
	movb	%dl, (%r14,%rax)
	movl	(%rbx), %eax
	incl	%eax
	movl	%eax, (%rbx)
	cmpl	-40(%rbp), %eax
	jge	LBB0_9
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp), %rsi
	btq	%rax, %rsi
	movq	%rcx, %rsi
	jb	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%rdi, %rsi
	jmp	LBB0_4
LBB0_8:
	xorl	%r14d, %r14d
LBB0_14:
	movq	%r14, %rax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	-48(%rbp), %ecx
	movq	_JOYCAPS_HASPOV@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_14
## %bb.10:
	movq	_JOYCAPS_POV4DIR@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_14
## %bb.11:
	movl	-56(%rbp), %edx
	leal	-40500(%rdx), %esi
	movl	$8, %ecx
	cmpl	$-44999, %esi                   ## imm = 0xFFFF5039
	jb	LBB0_13
## %bb.12:
	movslq	%edx, %rcx
	imulq	$1954687339, %rcx, %rcx         ## imm = 0x7482296B
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$43, %rcx
	addl	%edx, %ecx
LBB0_13:
	movslq	%ecx, %rcx
	movl	$380, %edx                      ## imm = 0x17C
	btq	%rcx, %rdx
	movq	_GLFW_PRESS@GOTPCREL(%rip), %r8
	movq	_GLFW_RELEASE@GOTPCREL(%rip), %rsi
	movq	%rsi, %rdi
	cmovaeq	%r8, %rdi
	movb	(%rdi), %dl
	leal	1(%rax), %edi
	movl	%edi, (%rbx)
	cltq
	leaq	-4(%rcx), %rdi
	cmpq	$-3, %rdi
	movq	%rsi, %rdi
	cmovaeq	%r8, %rdi
	movb	%dl, (%r14,%rax)
	movb	(%rdi), %al
	movslq	(%rbx), %rdx
	leal	1(%rdx), %edi
	movl	%edi, (%rbx)
	movb	%al, (%r14,%rdx)
	leaq	-6(%rcx), %rax
	cmpq	$-3, %rax
	movq	%rsi, %rax
	cmovaeq	%r8, %rax
	movb	(%rax), %al
	movslq	(%rbx), %rdx
	leal	1(%rdx), %edi
	movl	%edi, (%rbx)
	movb	%al, (%r14,%rdx)
	addq	$-8, %rcx
	cmpq	$-3, %rcx
	cmovaeq	%r8, %rsi
	movb	(%rsi), %al
	movslq	(%rbx), %rcx
	leal	1(%rcx), %edx
	movl	%edx, (%rbx)
	movb	%al, (%r14,%rcx)
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	__glfw,8,3                      ## @_glfw
	.comm	_JOYERR_NOERROR,8,3             ## @JOYERR_NOERROR
	.comm	_JOY_RETURNBUTTONS,4,2          ## @JOY_RETURNBUTTONS
	.comm	_JOY_RETURNPOV,4,2              ## @JOY_RETURNPOV
	.comm	_GLFW_PRESS,1,0                 ## @GLFW_PRESS
	.comm	_GLFW_RELEASE,1,0               ## @GLFW_RELEASE
	.comm	_JOYCAPS_HASPOV,4,2             ## @JOYCAPS_HASPOV
	.comm	_JOYCAPS_POV4DIR,4,2            ## @JOYCAPS_POV4DIR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	__glfwPlatformGetJoystickButtons ; -- Begin function _glfwPlatformGetJoystickButtons
	.p2align	2
__glfwPlatformGetJoystickButtons:       ; @_glfwPlatformGetJoystickButtons
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, __glfw@GOTPAGE
Lloh1:
	ldr	x8, [x8, __glfw@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x19, [x8, w0, sxtw #3]
	add	x1, sp, #32
	mov	w2, #16
	bl	__glfw_joyGetDevCaps
Lloh3:
	adrp	x22, _JOYERR_NOERROR@GOTPAGE
Lloh4:
	ldr	x22, [x22, _JOYERR_NOERROR@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.1:
	mov	w8, #24
Lloh5:
	adrp	x9, _JOY_RETURNBUTTONS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _JOY_RETURNBUTTONS@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _JOY_RETURNPOV@GOTPAGE
Lloh9:
	ldr	x10, [x10, _JOY_RETURNPOV@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	orr	w9, w10, w9
	stp	w8, w9, [sp, #8]
	add	x1, sp, #8
	mov	x0, x21
	bl	__glfw_joyGetPosEx
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.2:
	ldr	w8, [x20]
	ldr	w9, [sp, #40]
	cmp	w8, w9
	b.ge	LBB0_5
; %bb.3:
Lloh11:
	adrp	x9, _GLFW_PRESS@GOTPAGE
Lloh12:
	ldr	x9, [x9, _GLFW_PRESS@GOTPAGEOFF]
Lloh13:
	adrp	x10, _GLFW_RELEASE@GOTPAGE
Lloh14:
	ldr	x10, [x10, _GLFW_RELEASE@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [sp, #16]
	lsr	x11, x11, x8
	tst	x11, #0x1
	csel	x11, x10, x9, eq
	ldrb	w11, [x11]
	strb	w11, [x19, w8, sxtw]
	ldr	w8, [x20]
	add	w8, w8, #1
	str	w8, [x20]
	ldr	w11, [sp, #40]
	cmp	w8, w11
	b.lt	LBB0_4
LBB0_5:
	ldr	w9, [sp, #32]
Lloh15:
	adrp	x10, _JOYCAPS_HASPOV@GOTPAGE
Lloh16:
	ldr	x10, [x10, _JOYCAPS_HASPOV@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_9
; %bb.6:
Lloh18:
	adrp	x10, _JOYCAPS_POV4DIR@GOTPAGE
Lloh19:
	ldr	x10, [x10, _JOYCAPS_POV4DIR@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_9
; %bb.7:
	ldrsw	x9, [sp, #24]
	mov	w10, #10603
	movk	w10, #29826, lsl #16
	mul	x10, x9, x10
	lsr	x11, x10, #63
	asr	x10, x10, #43
	add	w10, w10, w11
	mov	w11, #-40500
	mov	w12, #-44999
	add	w9, w9, w11
	cmp	w9, w12
	mov	w9, #8
	csel	w9, w9, w10, lo
	mov	w10, #380
	lsr	x10, x10, x9
                                        ; kill: def $w9 killed $w9 killed $x9 def $x9
	sxtw	x9, w9
Lloh21:
	adrp	x11, _GLFW_PRESS@GOTPAGE
Lloh22:
	ldr	x11, [x11, _GLFW_PRESS@GOTPAGEOFF]
Lloh23:
	adrp	x12, _GLFW_RELEASE@GOTPAGE
Lloh24:
	ldr	x12, [x12, _GLFW_RELEASE@GOTPAGEOFF]
	tst	x10, #0x1
	csel	x10, x11, x12, eq
	ldrb	w10, [x10]
	add	w13, w8, #1
	str	w13, [x20]
	strb	w10, [x19, w8, sxtw]
	sub	x8, x9, #4
	cmn	x8, #3
	csel	x8, x12, x11, lo
	ldrb	w8, [x8]
	ldrsw	x10, [x20]
	add	w13, w10, #1
	str	w13, [x20]
	strb	w8, [x19, x10]
	sub	x8, x9, #6
	cmn	x8, #3
	csel	x8, x12, x11, lo
	ldrb	w8, [x8]
	ldrsw	x10, [x20]
	add	w13, w10, #1
	str	w13, [x20]
	strb	w8, [x19, x10]
	sub	x8, x9, #8
	cmn	x8, #3
	csel	x8, x12, x11, lo
	ldrb	w8, [x8]
	ldrsw	x9, [x20]
	add	w10, w9, #1
	str	w10, [x20]
	strb	w8, [x19, x9]
	b	LBB0_9
LBB0_8:
	mov	x19, #0
LBB0_9:
	mov	x0, x19
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	__glfw,8,3                      ; @_glfw
	.comm	_JOYERR_NOERROR,8,3             ; @JOYERR_NOERROR
	.comm	_JOY_RETURNBUTTONS,4,2          ; @JOY_RETURNBUTTONS
	.comm	_JOY_RETURNPOV,4,2              ; @JOY_RETURNPOV
	.comm	_GLFW_PRESS,1,0                 ; @GLFW_PRESS
	.comm	_GLFW_RELEASE,1,0               ; @GLFW_RELEASE
	.comm	_JOYCAPS_HASPOV,4,2             ; @JOYCAPS_HASPOV
	.comm	_JOYCAPS_POV4DIR,4,2            ; @JOYCAPS_POV4DIR
.subsections_via_symbols
