	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pagesetup_change_printer
_pagesetup_change_printer:              ## @pagesetup_change_printer
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movl	%edi, %r14d
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	leaq	-48(%rbp), %rsi
	xorl	%edx, %edx
	callq	_OpenPrinterW
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	-48(%rbp), %edi
	leaq	-44(%rbp), %r12
	movl	$2, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%r12, %r8
	callq	_GetPrinterW
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	-44(%rbp), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, %r13
	movl	-48(%rbp), %edi
	movl	-44(%rbp), %ecx
	movl	$2, %esi
	movq	%rax, %rdx
	movq	%r12, %r8
	callq	_GetPrinterW
	movl	-48(%rbp), %edi
	xorl	%esi, %esi
	movl	$3, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movq	%r12, %r9
	callq	_GetPrinterDriverW
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	-44(%rbp), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, %r15
	movl	-48(%rbp), %edi
	movl	-44(%rbp), %r8d
	xorl	%esi, %esi
	movl	$3, %edx
	movq	%rax, %rcx
	movq	%r12, %r9
	callq	_GetPrinterDriverW
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	-48(%rbp), %edi
	callq	_ClosePrinter
	xorl	%edi, %edi
	xorl	%esi, %esi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_DocumentPropertiesW
	movl	%eax, -44(%rbp)
	cmpl	$-1, %eax
	je	LBB0_5
## %bb.8:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	-44(%rbp), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, %r12
	movq	_DM_OUT_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	xorl	%edi, %edi
	xorl	%esi, %esi
	movl	%r14d, %edx
	movq	%r12, %rcx
	xorl	%r8d, %r8d
	callq	_DocumentPropertiesW
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_pagesetup_set_devmode
	movl	8(%r15), %esi
	movl	(%r13), %ecx
	movl	4(%r13), %edx
	movq	%rbx, %rdi
	callq	_pagesetup_set_devnames
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_9
LBB0_1:
	movl	%r14d, %edi
	callq	_debugstr_w
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_ERR
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	jmp	LBB0_7
LBB0_3:
	movl	4(%r13), %edi
	callq	_debugstr_w
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_6
LBB0_5:
	movl	%r14d, %edi
	callq	_debugstr_w
	leaq	L_.str.2(%rip), %rdi
LBB0_6:
	movl	%eax, %esi
	callq	_ERR
LBB0_7:
	xorl	%r12d, %r12d
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
LBB0_9:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r12, %rdx
	callq	_HeapFree
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r13, %rdx
	callq	_HeapFree
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	%eax, %edi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_HeapFree
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FALSE,4,2                      ## @FALSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't open printer %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"GetPrinterDriverA failed for %s, fix your config!\n"

L_.str.2:                               ## @.str.2
	.asciz	"DocumentProperties fails on %s\n"

	.comm	_DM_OUT_BUFFER,4,2              ## @DM_OUT_BUFFER
	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_pagesetup_change_printer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pagesetup_change_printer
_pagesetup_change_printer:              ; @pagesetup_change_printer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x1
	mov	x23, x0
Lloh0:
	adrp	x8, _FALSE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	add	x1, sp, #12
	mov	x2, #0
	bl	_OpenPrinterW
	cbz	w0, LBB0_4
; %bb.1:
	ldr	w0, [sp, #12]
	add	x4, sp, #8
	mov	w1, #2
	mov	x2, #0
	mov	w3, #0
	bl	_GetPrinterW
	bl	_GetProcessHeap
	ldr	w2, [sp, #8]
	mov	w1, #0
	bl	_HeapAlloc
	mov	x20, x0
	ldp	w3, w0, [sp, #8]
	add	x4, sp, #8
	mov	w1, #2
	mov	x2, x20
	bl	_GetPrinterW
	ldr	w0, [sp, #12]
	add	x5, sp, #8
	mov	x1, #0
	mov	w2, #3
	mov	x3, #0
	mov	w4, #0
	bl	_GetPrinterDriverW
	bl	_GetProcessHeap
	ldr	w2, [sp, #8]
	mov	w1, #0
	bl	_HeapAlloc
	mov	x21, x0
	ldp	w4, w0, [sp, #8]
	add	x5, sp, #8
	mov	x1, #0
	mov	w2, #3
	mov	x3, x21
	bl	_GetPrinterDriverW
	cbz	w0, LBB0_5
; %bb.2:
	ldr	w0, [sp, #12]
	bl	_ClosePrinter
	mov	w0, #0
	mov	w1, #0
	mov	x2, x23
	mov	x3, #0
	mov	x4, #0
	mov	w5, #0
	bl	_DocumentPropertiesW
	str	w0, [sp, #8]
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.3:
	bl	_GetProcessHeap
	ldr	w2, [sp, #8]
	mov	w1, #0
	bl	_HeapAlloc
	mov	x24, x0
Lloh3:
	adrp	x8, _DM_OUT_BUFFER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DM_OUT_BUFFER@GOTPAGEOFF]
Lloh5:
	ldr	w5, [x8]
	mov	w0, #0
	mov	w1, #0
	mov	x2, x23
	mov	x3, x24
	mov	x4, #0
	bl	_DocumentPropertiesW
	mov	x0, x22
	mov	x1, x24
	bl	_pagesetup_set_devmode
	ldr	w1, [x21, #8]
	ldp	w3, w2, [x20]
	mov	x0, x22
	bl	_pagesetup_set_devnames
Lloh6:
	adrp	x8, _TRUE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh8:
	ldr	w19, [x8]
	b	LBB0_9
LBB0_4:
	mov	x0, x23
	bl	_debugstr_w
	mov	x1, x0
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERR
	mov	x20, #0
	mov	x21, #0
	b	LBB0_8
LBB0_5:
	ldr	w0, [x20, #4]
	bl	_debugstr_w
	mov	x1, x0
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_6:
	mov	x0, x23
	bl	_debugstr_w
	mov	x1, x0
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_7:
	bl	_ERR
LBB0_8:
	mov	x24, #0
LBB0_9:
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x24
	bl	_HeapFree
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x20
	bl	_HeapFree
	bl	_GetProcessHeap
	mov	w1, #0
	mov	x2, x21
	bl	_HeapFree
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_FALSE,4,2                      ; @FALSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't open printer %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"GetPrinterDriverA failed for %s, fix your config!\n"

l_.str.2:                               ; @.str.2
	.asciz	"DocumentProperties fails on %s\n"

	.comm	_DM_OUT_BUFFER,4,2              ; @DM_OUT_BUFFER
	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_pagesetup_change_printer
.subsections_via_symbols
