	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DPLAYX_SetConnectionSettingsW  ## -- Begin function DPLAYX_SetConnectionSettingsW
	.p2align	4, 0x90
_DPLAYX_SetConnectionSettingsW:         ## @DPLAYX_SetConnectionSettingsW
	.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
	testq	%rdi, %rdi
	jne	LBB0_2
## %bb.1:
	movq	%rdx, %rbx
	testq	%rdx, %rdx
	je	LBB0_2
## %bb.3:
	movq	%rsi, %r14
	movl	(%rbx), %esi
	cmpl	$4, %esi
	jne	LBB0_4
## %bb.5:
	xorl	%eax, %eax
	callq	_DPLAYX_AcquireSemaphore
	leaq	-24(%rbp), %rsi
	movq	%r14, %rdi
	callq	_DPLAYX_IsAppIdLobbied
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movq	-24(%rbp), %rax
	movl	(%rax), %edi
	callq	_DPLAYX_PrivHeapFree
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, %rdi
	callq	_DPLAYX_SizeOfLobbyDataW
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_DPLAYX_PrivHeapAlloc
	movq	-24(%rbp), %rcx
	movl	%eax, (%rcx)
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_DPLAYX_CopyConnStructW
	xorl	%eax, %eax
	callq	_DPLAYX_ReleaseSemaphore
	movq	_DP_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_2:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_ERR
	movq	_DPERR_INVALIDPARAMS@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_ERR
	movq	_DPERR_INVALIDPARAMS@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	xorl	%eax, %eax
	callq	_DPLAYX_ReleaseSemaphore
	movq	_DPERR_NOTLOBBIED@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid parameters.\n"

	.comm	_DPERR_INVALIDPARAMS,4,2        ## @DPERR_INVALIDPARAMS
L_.str.1:                               ## @.str.1
	.asciz	": old/new DPLCONNECTION type? Size=%u\n"

	.comm	_DPERR_NOTLOBBIED,4,2           ## @DPERR_NOTLOBBIED
	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
	.comm	_DP_OK,4,2                      ## @DP_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DPLAYX_SetConnectionSettingsW  ; -- Begin function DPLAYX_SetConnectionSettingsW
	.p2align	2
_DPLAYX_SetConnectionSettingsW:         ; @DPLAYX_SetConnectionSettingsW
	.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
	cbnz	x0, LBB0_5
; %bb.1:
	mov	x19, x2
	cbz	x2, LBB0_5
; %bb.2:
	ldr	w8, [x19]
	cmp	w8, #4
	b.ne	LBB0_6
; %bb.3:
	mov	x20, x1
	bl	_DPLAYX_AcquireSemaphore
	add	x1, sp, #8
	mov	x0, x20
	bl	_DPLAYX_IsAppIdLobbied
	cbz	w0, LBB0_9
; %bb.4:
	ldr	x8, [sp, #8]
	ldr	w0, [x8]
	bl	_DPLAYX_PrivHeapFree
Lloh0:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_DPLAYX_SizeOfLobbyDataW
	mov	x1, x0
	mov	x0, x20
	bl	_DPLAYX_PrivHeapAlloc
	ldr	x8, [sp, #8]
	str	w0, [x8]
	mov	x1, x19
	bl	_DPLAYX_CopyConnStructW
	bl	_DPLAYX_ReleaseSemaphore
Lloh3:
	adrp	x8, _DP_OK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DP_OK@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
	str	x8, [sp]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_7:
	bl	_ERR
Lloh9:
	adrp	x8, _DPERR_INVALIDPARAMS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DPERR_INVALIDPARAMS@GOTPAGEOFF]
LBB0_8:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_9:
	bl	_DPLAYX_ReleaseSemaphore
Lloh11:
	adrp	x8, _DPERR_NOTLOBBIED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DPERR_NOTLOBBIED@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid parameters.\n"

	.comm	_DPERR_INVALIDPARAMS,4,2        ; @DPERR_INVALIDPARAMS
l_.str.1:                               ; @.str.1
	.asciz	": old/new DPLCONNECTION type? Size=%u\n"

	.comm	_DPERR_NOTLOBBIED,4,2           ; @DPERR_NOTLOBBIED
	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.comm	_DP_OK,4,2                      ; @DP_OK
.subsections_via_symbols
