	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ps4_joypad_init
_ps4_joypad_init:                       ## @ps4_joypad_init
	.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	_num_players@GOTPCREL(%rip), %r15
	movl	$0, (%r15)
	xorl	%eax, %eax
	callq	_scePadInit
	leaq	-48(%rbp), %rdi
	callq	_sceUserServiceGetLoginUserIdList
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	testl	%ebx, %ebx
	jne	LBB0_15
## %bb.1:
	movq	_SCE_USER_SERVICE_MAX_LOGIN_USERS@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	je	LBB0_15
## %bb.2:
	movq	_ds_joypad_states@GOTPCREL(%rip), %r12
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	testq	%rcx, %rcx
	je	LBB0_12
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%r13
	movl	(%r14), %eax
	cmpq	%rax, %r13
	jae	LBB0_15
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
                                        ##     Child Loop BB0_11 Depth 2
	movq	-48(%rbp), %rax
	movq	(%rax,%r13,8), %rbx
	leaq	L_.str.1(%rip), %rdi
	movl	%r13d, %esi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_RARCH_LOG
	movq	_SCE_USER_SERVICE_USER_ID_INVALID@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_14
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r15), %ecx
	testl	%ecx, %ecx
	jle	LBB0_16
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	-1(%rcx), %rdx
	movl	%ecx, %eax
	andl	$3, %eax
	cmpq	$3, %rdx
	jae	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%edx, %edx
	jmp	LBB0_9
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	andl	$-4, %ecx
	xorl	%esi, %esi
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r12), %rdi
	movq	%rbx, 8(%rdi,%rsi)
	movq	(%r12), %rdi
	movq	%rbx, 32(%rdi,%rsi)
	movq	(%r12), %rdi
	movq	%rbx, 56(%rdi,%rsi)
	movq	(%r12), %rdi
	movq	%rbx, 80(%rdi,%rsi)
	addq	$4, %rdx
	addq	$96, %rsi
	cmpq	%rdx, %rcx
	jne	LBB0_8
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	shlq	$3, %rdx
	leaq	(%rdx,%rdx,2), %rcx
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r12), %rdx
	movq	%rbx, 8(%rdx,%rcx)
	addq	$24, %rcx
	decq	%rax
	jne	LBB0_11
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_scePadOpen
	movq	(%r12), %rcx
	movslq	(%r15), %rdx
	leaq	(%rdx,%rdx,2), %rdx
	movl	%eax, 16(%rcx,%rdx,8)
	movslq	(%r15), %rax
	leaq	(%rax,%rax,2), %rax
	movl	16(%rcx,%rax,8), %edx
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	movq	(%r12), %rax
	movslq	(%r15), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	cmpl	$0, 16(%rax,%rcx,8)
	jle	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, (%rax,%rcx,8)
	movslq	(%r15), %rsi
	leaq	(%rsi,%rsi,2), %rcx
	movq	%rbx, 8(%rax,%rcx,8)
	leaq	L_.str.3(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	movl	(%r15), %edi
	callq	_ps4_joypad_name
	movq	_ps4_joypad@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	(%r15), %ecx
	movl	%eax, %edi
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_input_autoconfigure_connect
	incl	(%r15)
	jmp	LBB0_14
LBB0_15:
	movl	$1, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_num_players,4,2                ## @num_players
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sceUserServiceGetLoginUserIdList %x "

	.comm	_SCE_USER_SERVICE_MAX_LOGIN_USERS,4,2 ## @SCE_USER_SERVICE_MAX_LOGIN_USERS
L_.str.1:                               ## @.str.1
	.asciz	"USER %d ID %x\n"

	.comm	_SCE_USER_SERVICE_USER_ID_INVALID,8,3 ## @SCE_USER_SERVICE_USER_ID_INVALID
	.comm	_ds_joypad_states,8,3           ## @ds_joypad_states
L_.str.2:                               ## @.str.2
	.asciz	"USER %x HANDLE %x\n"

L_.str.3:                               ## @.str.3
	.asciz	"NEW PAD: num_players %x \n"

	.comm	_ps4_joypad,4,2                 ## @ps4_joypad
	.no_dead_strip	_ps4_joypad_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ps4_joypad_init
_ps4_joypad_init:                       ; @ps4_joypad_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x24, _num_players@GOTPAGE
Lloh1:
	ldr	x24, [x24, _num_players@GOTPAGEOFF]
	str	wzr, [x24]
	bl	_scePadInit
	add	x0, sp, #8
	bl	_sceUserServiceGetLoginUserIdList
	mov	x19, x0
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_RARCH_LOG
	cbnz	w19, LBB0_11
; %bb.1:
Lloh4:
	adrp	x25, _SCE_USER_SERVICE_MAX_LOGIN_USERS@GOTPAGE
Lloh5:
	ldr	x25, [x25, _SCE_USER_SERVICE_MAX_LOGIN_USERS@GOTPAGEOFF]
	ldr	w8, [x25]
	cbz	w8, LBB0_11
; %bb.2:
	mov	x19, #0
Lloh6:
	adrp	x20, l_.str.1@PAGE
Lloh7:
	add	x20, x20, l_.str.1@PAGEOFF
Lloh8:
	adrp	x26, _SCE_USER_SERVICE_USER_ID_INVALID@GOTPAGE
Lloh9:
	ldr	x26, [x26, _SCE_USER_SERVICE_USER_ID_INVALID@GOTPAGEOFF]
Lloh10:
	adrp	x27, _ds_joypad_states@GOTPAGE
Lloh11:
	ldr	x27, [x27, _ds_joypad_states@GOTPAGEOFF]
Lloh12:
	adrp	x21, l_.str.2@PAGE
Lloh13:
	add	x21, x21, l_.str.2@PAGEOFF
	mov	w28, #24
Lloh14:
	adrp	x22, l_.str.3@PAGE
Lloh15:
	add	x22, x22, l_.str.3@PAGEOFF
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	cbz	w9, LBB0_9
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x19, x19, #1
	ldr	w8, [x25]
	cmp	x19, x8
	b.hs	LBB0_11
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	x8, [sp, #8]
	ldr	x23, [x8, x19, lsl #3]
	str	x23, [sp]
	mov	x0, x20
	mov	x1, x19
	bl	_RARCH_LOG
	ldr	x8, [x26]
	cmp	x23, x8
	b.eq	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w9, [x24]
	cmp	w9, #1
	b.lt	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x8, #0
	add	x9, x9, x9, lsl #1
	lsl	x9, x9, #3
LBB0_8:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x10, [x27]
	add	x10, x10, x8
	str	x23, [x10, #8]
	add	x8, x8, #24
	cmp	x9, x8
	b.ne	LBB0_8
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x23
	mov	w1, #0
	mov	w2, #0
	mov	x3, #0
	bl	_scePadOpen
	ldr	x8, [x27]
	ldrsw	x9, [x24]
	madd	x9, x9, x28, x8
	str	w0, [x9, #16]
	ldrsw	x9, [x24]
	madd	x8, x9, x28, x8
	ldr	w8, [x8, #16]
	str	x8, [sp]
	mov	x0, x21
	mov	x1, x23
	bl	_RARCH_LOG
	ldr	x8, [x27]
	ldrsw	x9, [x24]
	madd	x10, x9, x28, x8
	ldr	w10, [x10, #16]
	cmp	w10, #1
	b.lt	LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	mul	x9, x9, x28
	mov	w10, #1
	str	w10, [x8, x9]
	ldrsw	x1, [x24]
	madd	x8, x1, x28, x8
	str	x23, [x8, #8]
	mov	x0, x22
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_RARCH_LOG
	ldr	w0, [x24]
	bl	_ps4_joypad_name
Lloh16:
	adrp	x8, _ps4_joypad@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ps4_joypad@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	ldr	w3, [x24]
	mov	x1, #0
	mov	w4, #0
	mov	w5, #0
	bl	_input_autoconfigure_connect
	ldr	w8, [x24]
	add	w8, w8, #1
	str	w8, [x24]
	b	LBB0_4
LBB0_11:
	mov	w0, #1
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_num_players,4,2                ; @num_players
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sceUserServiceGetLoginUserIdList %x "

	.comm	_SCE_USER_SERVICE_MAX_LOGIN_USERS,4,2 ; @SCE_USER_SERVICE_MAX_LOGIN_USERS
l_.str.1:                               ; @.str.1
	.asciz	"USER %d ID %x\n"

	.comm	_SCE_USER_SERVICE_USER_ID_INVALID,8,3 ; @SCE_USER_SERVICE_USER_ID_INVALID
	.comm	_ds_joypad_states,8,3           ; @ds_joypad_states
l_.str.2:                               ; @.str.2
	.asciz	"USER %x HANDLE %x\n"

l_.str.3:                               ; @.str.3
	.asciz	"NEW PAD: num_players %x \n"

	.comm	_ps4_joypad,4,2                 ; @ps4_joypad
	.no_dead_strip	_ps4_joypad_init
.subsections_via_symbols
