	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pagesetup_set_devmode
_pagesetup_set_devmode:                 ## @pagesetup_set_devmode
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r15
	cmpq	$0, 8(%rdi)
	je	LBB0_2
## %bb.1:
	movq	(%r12), %rbx
	addq	8(%r12), %rbx
	xorl	%r14d, %r14d
	jmp	LBB0_3
LBB0_2:
	movq	%r12, %rdi
	callq	_convert_to_devmodeA
	movq	%rax, %r12
	movq	(%rax), %rbx
	addq	8(%rax), %rbx
	movq	%rax, %r14
LBB0_3:
	movq	(%r15), %rax
	movl	(%rax), %edi
	movq	_GMEM_MOVEABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	testl	%edi, %edi
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rsi
	callq	_GlobalReAlloc
	jmp	LBB0_6
LBB0_5:
	movl	%edx, %edi
	movq	%rbx, %rsi
	callq	_GlobalAlloc
LBB0_6:
	movq	(%r15), %rcx
	movl	%eax, (%rcx)
	movl	%eax, %edi
	callq	_GlobalLock
	movq	%rax, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_memcpy
	movq	(%r15), %rax
	movl	(%rax), %edi
	callq	_GlobalUnlock
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r14, %rdx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HeapFree                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GMEM_MOVEABLE,4,2              ## @GMEM_MOVEABLE
	.no_dead_strip	_pagesetup_set_devmode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pagesetup_set_devmode
_pagesetup_set_devmode:                 ; @pagesetup_set_devmode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x20, #0
	ldp	x9, x8, [x21]
	add	x22, x9, x8
	b	LBB0_3
LBB0_2:
	mov	x0, x21
	bl	_convert_to_devmodeA
	mov	x21, x0
	ldp	x9, x8, [x0]
	add	x22, x9, x8
	mov	x20, x0
LBB0_3:
	ldr	x8, [x19]
	ldr	w0, [x8]
Lloh0:
	adrp	x8, _GMEM_MOVEABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GMEM_MOVEABLE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	cbz	w0, LBB0_5
; %bb.4:
	mov	x1, x22
	bl	_GlobalReAlloc
	b	LBB0_6
LBB0_5:
	mov	x0, x2
	mov	x1, x22
	bl	_GlobalAlloc
LBB0_6:
	ldr	x8, [x19]
	str	w0, [x8]
	bl	_GlobalLock
	mov	x1, x21
	mov	x2, x22
	bl	_memcpy
	ldr	x8, [x19]
	ldr	w0, [x8]
	bl	_GlobalUnlock
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_HeapFree
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_GMEM_MOVEABLE,4,2              ; @GMEM_MOVEABLE
	.no_dead_strip	_pagesetup_set_devmode
.subsections_via_symbols
