	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_I_ShutdownGraphics             ## -- Begin function I_ShutdownGraphics
	.p2align	4, 0x90
_I_ShutdownGraphics:                    ## @I_ShutdownGraphics
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_X_display@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_X_shminfo@GOTPCREL(%rip), %rbx
	movq	%rbx, %rsi
	callq	_XShmDetach
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_I_Error
LBB0_2:
	movl	4(%rbx), %edi
	callq	_shmdt
	movl	(%rbx), %edi
	movq	_IPC_RMID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_shmctl
	movq	_image@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	$0, (%rax)
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_X_display,4,2                  ## @X_display
	.comm	_X_shminfo,8,2                  ## @X_shminfo
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"XShmDetach() failed in I_ShutdownGraphics()"

	.comm	_IPC_RMID,4,2                   ## @IPC_RMID
	.comm	_image,8,3                      ## @image
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_I_ShutdownGraphics             ; -- Begin function I_ShutdownGraphics
	.p2align	2
_I_ShutdownGraphics:                    ; @I_ShutdownGraphics
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _X_display@GOTPAGE
Lloh1:
	ldr	x8, [x8, _X_display@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x19, _X_shminfo@GOTPAGE
Lloh4:
	ldr	x19, [x19, _X_shminfo@GOTPAGEOFF]
	mov	x1, x19
	bl	_XShmDetach
	cbnz	w0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_I_Error
LBB0_2:
	ldr	w0, [x19, #4]
	bl	_shmdt
	ldr	w0, [x19]
Lloh7:
	adrp	x8, _IPC_RMID@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IPC_RMID@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_shmctl
Lloh10:
	adrp	x8, _image@GOTPAGE
Lloh11:
	ldr	x8, [x8, _image@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	str	xzr, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_X_display,4,2                  ; @X_display
	.comm	_X_shminfo,8,2                  ; @X_shminfo
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"XShmDetach() failed in I_ShutdownGraphics()"

	.comm	_IPC_RMID,4,2                   ; @IPC_RMID
	.comm	_image,8,3                      ; @image
.subsections_via_symbols
