	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_savage_driver_firstopen        ## -- Begin function savage_driver_firstopen
	.p2align	4, 0x90
_savage_driver_firstopen:               ## @savage_driver_firstopen
	.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	%rdi, %rbx
	movq	8(%rdi), %r14
	movq	(%r14), %rdi
	callq	_S3_SAVAGE3D_SERIES
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_pci_resource_start
	movq	%rax, %r15
	movq	_SAVAGE_FB_SIZE_S3@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	(%rax,%r15), %r13
	movq	_SAVAGE_APERTURE_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	addq	%r15, %r12
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_pci_resource_len
	cmpl	$134217728, %eax                ## imm = 0x8000000
	jne	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	movl	$16777216, %esi                 ## imm = 0x1000000
	callq	_arch_phys_wc_add
	movq	24(%r14), %rcx
	movq	%rax, (%rcx)
	leaq	33554432(%r15), %rdi
	movl	$33554432, %esi                 ## imm = 0x2000000
	callq	_arch_phys_wc_add
	movq	24(%r14), %rcx
	movq	%rax, 8(%rcx)
	movq	%r15, %rdi
	addq	$67108864, %rdi                 ## imm = 0x4000000
	movl	$67108864, %esi                 ## imm = 0x4000000
	callq	_arch_phys_wc_add
	movq	24(%r14), %rcx
	movq	%rax, 16(%rcx)
	jmp	LBB0_4
LBB0_5:
	movq	(%r14), %r12
	movq	_S3_SUPERSAVAGE@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	_S3_SAVAGE2000@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_pci_resource_start
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %edi
	movl	$1, %esi
	callq	_pci_resource_start
	movq	%rax, %r15
	cmpq	%r13, %r12
	je	LBB0_10
## %bb.6:
	cmpq	-56(%rbp), %r12                 ## 8-byte Folded Reload
	je	LBB0_10
## %bb.7:
	movq	_SAVAGE_FB_SIZE_S4@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	_SAVAGE_APERTURE_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	addq	%r15, %r12
	movl	(%rbx), %edi
	movl	$1, %esi
	callq	_pci_resource_len
	cmpl	$134217728, %eax                ## imm = 0x8000000
	jne	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	movl	$134217728, %esi                ## imm = 0x8000000
	callq	_arch_phys_wc_add
	movq	24(%r14), %rcx
	movq	%rax, (%rcx)
	jmp	LBB0_11
LBB0_3:
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_pci_resource_len
	movslq	%eax, %rsi
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_4:
	movq	%r13, %rsi
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_12
LBB0_10:
	movl	(%rbx), %edi
	movl	$1, %esi
	callq	_pci_resource_len
	movslq	%eax, %r13
	movl	(%rbx), %edi
	movl	$2, %esi
	callq	_pci_resource_start
	movq	%rax, %r12
	jmp	LBB0_11
LBB0_9:
	movl	(%rbx), %edi
	movl	$1, %esi
	callq	_pci_resource_len
	movslq	%eax, %rsi
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_11:
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
LBB0_12:
	movq	_SAVAGE_MMIO_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	__DRM_REGISTERS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	__DRM_READ_ONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	16(%r14), %r9
	movq	%rbx, %rdi
	callq	_drm_legacy_addmap
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	movq	__DRM_FRAME_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	__DRM_WRITE_COMBINING@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	12(%r14), %r9
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_drm_legacy_addmap
	testl	%eax, %eax
	je	LBB0_15
LBB0_14:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	_SAVAGE_APERTURE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	__DRM_FRAME_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	__DRM_WRITE_COMBINING@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	addq	$8, %r14
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r14, %r9
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_drm_legacy_addmap              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SAVAGE_FB_SIZE_S3,8,3          ## @SAVAGE_FB_SIZE_S3
	.comm	_SAVAGE_APERTURE_OFFSET,8,3     ## @SAVAGE_APERTURE_OFFSET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"strange pci_resource_len %08llx\n"

	.comm	_S3_SUPERSAVAGE,8,3             ## @S3_SUPERSAVAGE
	.comm	_S3_SAVAGE2000,8,3              ## @S3_SAVAGE2000
	.comm	_SAVAGE_FB_SIZE_S4,8,3          ## @SAVAGE_FB_SIZE_S4
	.comm	_SAVAGE_MMIO_SIZE,8,3           ## @SAVAGE_MMIO_SIZE
	.comm	__DRM_REGISTERS,4,2             ## @_DRM_REGISTERS
	.comm	__DRM_READ_ONLY,4,2             ## @_DRM_READ_ONLY
	.comm	__DRM_FRAME_BUFFER,4,2          ## @_DRM_FRAME_BUFFER
	.comm	__DRM_WRITE_COMBINING,4,2       ## @_DRM_WRITE_COMBINING
	.comm	_SAVAGE_APERTURE_SIZE,8,3       ## @SAVAGE_APERTURE_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_savage_driver_firstopen        ; -- Begin function savage_driver_firstopen
	.p2align	2
_savage_driver_firstopen:               ; @savage_driver_firstopen
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	x24, [x0, #8]
	ldr	x0, [x24]
	bl	_S3_SAVAGE3D_SERIES
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w0, [x19]
	mov	w1, #0
	bl	_pci_resource_start
	mov	x20, x0
Lloh0:
	adrp	x8, _SAVAGE_FB_SIZE_S3@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SAVAGE_FB_SIZE_S3@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
	add	x21, x22, x0
Lloh3:
	adrp	x8, _SAVAGE_APERTURE_OFFSET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SAVAGE_APERTURE_OFFSET@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x23, x8, x0
	ldr	w0, [x19]
	mov	w1, #0
	bl	_pci_resource_len
	mov	w8, #134217728
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.2:
	mov	x0, x20
	mov	w1, #16777216
	bl	_arch_phys_wc_add
	ldr	x8, [x24, #24]
	str	x0, [x8]
	mov	w8, #33554432
	add	x0, x20, x8
	mov	w1, #33554432
	bl	_arch_phys_wc_add
	ldr	x8, [x24, #24]
	str	x0, [x8, #8]
	mov	w8, #67108864
	add	x0, x20, x8
	mov	w1, #67108864
	bl	_arch_phys_wc_add
	ldr	x8, [x24, #24]
	str	x0, [x8, #16]
	b	LBB0_10
LBB0_3:
Lloh6:
	adrp	x8, _S3_SUPERSAVAGE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _S3_SUPERSAVAGE@GOTPAGEOFF]
	ldr	x22, [x24]
Lloh8:
	ldr	x23, [x8]
Lloh9:
	adrp	x8, _S3_SAVAGE2000@GOTPAGE
Lloh10:
	ldr	x8, [x8, _S3_SAVAGE2000@GOTPAGEOFF]
Lloh11:
	ldr	x25, [x8]
	ldr	w0, [x19]
	mov	w1, #0
	bl	_pci_resource_start
	mov	x21, x0
	ldr	w0, [x19]
	mov	w1, #1
	bl	_pci_resource_start
	mov	x20, x0
	cmp	x22, x23
	ccmp	x22, x25, #4, ne
	b.ne	LBB0_6
; %bb.4:
	ldr	w0, [x19]
	mov	w1, #1
	bl	_pci_resource_len
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x22, w0
	ldr	w0, [x19]
	mov	w1, #2
	bl	_pci_resource_start
	mov	x23, x0
	b	LBB0_10
LBB0_5:
	ldr	w0, [x19]
	mov	w1, #0
	b	LBB0_9
LBB0_6:
Lloh12:
	adrp	x8, _SAVAGE_FB_SIZE_S4@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SAVAGE_FB_SIZE_S4@GOTPAGEOFF]
Lloh14:
	ldr	x22, [x8]
Lloh15:
	adrp	x8, _SAVAGE_APERTURE_OFFSET@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SAVAGE_APERTURE_OFFSET@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	add	x23, x8, x20
	ldr	w0, [x19]
	mov	w1, #1
	bl	_pci_resource_len
	mov	w8, #134217728
	cmp	w0, w8
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x20
	mov	w1, #134217728
	bl	_arch_phys_wc_add
	ldr	x8, [x24, #24]
	str	x0, [x8]
	b	LBB0_10
LBB0_8:
	ldr	w0, [x19]
	mov	w1, #1
LBB0_9:
	bl	_pci_resource_len
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x1, w0
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_10:
Lloh20:
	adrp	x8, _SAVAGE_MMIO_SIZE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SAVAGE_MMIO_SIZE@GOTPAGEOFF]
Lloh22:
	adrp	x9, __DRM_REGISTERS@GOTPAGE
Lloh23:
	ldr	x9, [x9, __DRM_REGISTERS@GOTPAGEOFF]
Lloh24:
	ldr	x2, [x8]
Lloh25:
	ldr	w3, [x9]
Lloh26:
	adrp	x8, __DRM_READ_ONLY@GOTPAGE
Lloh27:
	ldr	x8, [x8, __DRM_READ_ONLY@GOTPAGEOFF]
Lloh28:
	ldr	w4, [x8]
	add	x5, x24, #16
	mov	x0, x19
	mov	x1, x21
	bl	_drm_legacy_addmap
	cbnz	w0, LBB0_12
; %bb.11:
Lloh29:
	adrp	x21, __DRM_FRAME_BUFFER@GOTPAGE
Lloh30:
	ldr	x21, [x21, __DRM_FRAME_BUFFER@GOTPAGEOFF]
	ldr	w3, [x21]
Lloh31:
	adrp	x25, __DRM_WRITE_COMBINING@GOTPAGE
Lloh32:
	ldr	x25, [x25, __DRM_WRITE_COMBINING@GOTPAGEOFF]
	ldr	w4, [x25]
	add	x5, x24, #12
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_drm_legacy_addmap
	cbz	w0, LBB0_13
LBB0_12:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_13:
Lloh33:
	adrp	x8, _SAVAGE_APERTURE_SIZE@GOTPAGE
Lloh34:
	ldr	x8, [x8, _SAVAGE_APERTURE_SIZE@GOTPAGEOFF]
Lloh35:
	ldr	x2, [x8]
	ldr	w3, [x21]
	ldr	w4, [x25]
	add	x5, x24, #8
	mov	x0, x19
	mov	x1, x23
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_drm_legacy_addmap
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh24
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_SAVAGE_FB_SIZE_S3,8,3          ; @SAVAGE_FB_SIZE_S3
	.comm	_SAVAGE_APERTURE_OFFSET,8,3     ; @SAVAGE_APERTURE_OFFSET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"strange pci_resource_len %08llx\n"

	.comm	_S3_SUPERSAVAGE,8,3             ; @S3_SUPERSAVAGE
	.comm	_S3_SAVAGE2000,8,3              ; @S3_SAVAGE2000
	.comm	_SAVAGE_FB_SIZE_S4,8,3          ; @SAVAGE_FB_SIZE_S4
	.comm	_SAVAGE_MMIO_SIZE,8,3           ; @SAVAGE_MMIO_SIZE
	.comm	__DRM_REGISTERS,4,2             ; @_DRM_REGISTERS
	.comm	__DRM_READ_ONLY,4,2             ; @_DRM_READ_ONLY
	.comm	__DRM_FRAME_BUFFER,4,2          ; @_DRM_FRAME_BUFFER
	.comm	__DRM_WRITE_COMBINING,4,2       ; @_DRM_WRITE_COMBINING
	.comm	_SAVAGE_APERTURE_SIZE,8,3       ; @SAVAGE_APERTURE_SIZE
.subsections_via_symbols
