	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_bios_shadow_acpi
_nouveau_bios_shadow_acpi:              ## @nouveau_bios_shadow_acpi
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_nv_device
	movq	(%rax), %rdi
	callq	_nouveau_acpi_rom_supported
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	$0, 8(%r14)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	$4096, %edi                     ## imm = 0x1000
	callq	_kmalloc
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_nouveau_acpi_get_bios_chunk
	movq	(%r14), %rdi
	cmpl	$4096, %eax                     ## imm = 0x1000
	jne	LBB0_5
## %bb.4:
	movl	8(%rdi), %eax
	shll	$9, %eax
	movl	%eax, 8(%r14)
LBB0_5:
	callq	_kfree
LBB0_6:
	movl	8(%r14), %edi
	testl	%edi, %edi
	je	LBB0_15
## %bb.7:
	movl	(%rbx), %esi
	callq	_kmalloc
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_15
## %bb.8:
	movl	8(%r14), %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_nouveau_acpi_get_bios_chunk
	movl	8(%r14), %edi
	cmpl	%edi, %eax
	jne	LBB0_11
## %bb.9:
	movq	(%r14), %rdi
	movl	%eax, %esi
	callq	_nvbios_checksum
	testq	%rax, %rax
	je	LBB0_15
## %bb.10:
	movl	8(%r14), %edi
LBB0_11:
	testl	%edi, %edi
	jle	LBB0_15
## %bb.12:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	subl	%r15d, %edi
	movl	$4096, %esi                     ## imm = 0x1000
	callq	_min
	movl	%eax, %ebx
	movq	(%r14), %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_nouveau_acpi_get_bios_chunk
	cmpl	%ebx, %eax
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_14 Depth=1
	addl	%ebx, %r15d
	movl	8(%r14), %edi
	cmpl	%r15d, %edi
	jg	LBB0_14
	jmp	LBB0_15
LBB0_1:
	movq	$0, (%r14)
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.no_dead_strip	_nouveau_bios_shadow_acpi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nouveau_bios_shadow_acpi
_nouveau_bios_shadow_acpi:              ; @nouveau_bios_shadow_acpi
	.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	x19, x0
	bl	_nv_device
	ldr	x0, [x0]
	bl	_nouveau_acpi_rom_supported
	cbz	w0, LBB0_14
; %bb.1:
	str	wzr, [x19, #8]
Lloh0:
	adrp	x20, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x20, [x20, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	w0, #4096
	bl	_kmalloc
	str	x0, [x19]
	cbz	x0, LBB0_5
; %bb.2:
	mov	w1, #0
	mov	w2, #4096
	bl	_nouveau_acpi_get_bios_chunk
	mov	x8, x0
	ldr	x0, [x19]
	cmp	w8, #1, lsl #12                 ; =4096
	b.ne	LBB0_4
; %bb.3:
	ldr	w8, [x0, #8]
	lsl	w8, w8, #9
	str	w8, [x19, #8]
LBB0_4:
	bl	_kfree
LBB0_5:
	ldr	w0, [x19, #8]
	cbz	w0, LBB0_15
; %bb.6:
	ldr	w1, [x20]
	bl	_kmalloc
	str	x0, [x19]
	cbz	x0, LBB0_15
; %bb.7:
	ldr	w2, [x19, #8]
	mov	w1, #0
	bl	_nouveau_acpi_get_bios_chunk
	ldr	w8, [x19, #8]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.8:
	mov	x1, x0
	ldr	x0, [x19]
	bl	_nvbios_checksum
	cbz	x0, LBB0_15
; %bb.9:
	ldr	w8, [x19, #8]
LBB0_10:
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.11:
	mov	w20, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	sub	w0, w8, w20
	mov	w1, #4096
	bl	_min
	mov	x21, x0
	ldr	x0, [x19]
	mov	x1, x20
	mov	x2, x21
	bl	_nouveau_acpi_get_bios_chunk
	cmp	w0, w21
	b.ne	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x19, #8]
	add	w20, w21, w20
	cmp	w8, w20
	b.gt	LBB0_12
	b	LBB0_15
LBB0_14:
	str	xzr, [x19]
LBB0_15:
	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
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.no_dead_strip	_nouveau_bios_shadow_acpi
.subsections_via_symbols
