	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_bios_new                  ## -- Begin function nvkm_bios_new
	.p2align	4, 0x90
_nvkm_bios_new:                         ## @nvkm_bios_new
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r15d
	movq	%rdi, %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$80, %edi
	callq	_kzalloc
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%rax, %r14
	addq	$40, %r14
	movq	_nvkm_bios@GOTPCREL(%rip), %rdi
	movq	%r13, %rsi
	movl	%r15d, %edx
	movq	%r14, %rcx
	callq	_nvkm_subdev_ctor
	movq	%r12, %rdi
	callq	_nvbios_shadow
	testl	%eax, %eax
	jne	LBB0_18
## %bb.3:
	leaq	-72(%rbp), %rdx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_nvbios_image
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	movl	-64(%rbp), %eax
	movl	%eax, 76(%r12)
	movl	$1, %ebx
	leaq	-72(%rbp), %r15
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	%r15, %rdx
	callq	_nvbios_image
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	incl	%ebx
	cmpl	$224, -72(%rbp)
	jne	LBB0_5
## %bb.7:
	movl	-68(%rbp), %eax
	movl	%eax, 72(%r12)
LBB0_8:
	movl	64(%r12), %esi
	movl	68(%r12), %edi
	leaq	l_.str(%rip), %rdx
	movl	$5, %ecx
	callq	_nvbios_findstr
	movq	%rax, 48(%r12)
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%r12, %rdi
	callq	_bmp_version
	movl	%eax, %ebx
	sarl	$8, %ebx
	movq	%r12, %rdi
	callq	_bmp_version
	movzbl	%al, %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_nvkm_debug
LBB0_10:
	movl	64(%r12), %esi
	movl	68(%r12), %edi
	leaq	L_.str.2(%rip), %rdx
	movl	$5, %ecx
	callq	_nvbios_findstr
	movq	%rax, 56(%r12)
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_nvkm_debug
LBB0_12:
	leaq	-56(%rbp), %rdx
	movq	%r12, %rdi
	movl	$105, %esi
	callq	_bit_entry
	testl	%eax, %eax
	jne	LBB0_15
## %bb.13:
	cmpl	$4, -56(%rbp)
	jl	LBB0_15
## %bb.14:
	movq	-48(%rbp), %rsi
	addq	$3, %rsi
	movq	%r12, %rdi
	callq	_nvbios_rd08
	movq	%rax, 32(%r12)
	movq	-48(%rbp), %rsi
	addq	$2, %rsi
	movq	%r12, %rdi
	callq	_nvbios_rd08
	movq	%rax, 24(%r12)
	movq	-48(%rbp), %rsi
	incq	%rsi
	movq	%r12, %rdi
	callq	_nvbios_rd08
	movq	%rax, 16(%r12)
	movq	-48(%rbp), %rsi
	movq	%r12, %rdi
	callq	_nvbios_rd08
	movq	%rax, 8(%r12)
	movq	-48(%rbp), %rsi
	addq	$4, %rsi
	movq	%r12, %rdi
	callq	_nvbios_rd08
	movq	%rax, (%r12)
	jmp	LBB0_17
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_18
LBB0_15:
	movq	%r12, %rdi
	callq	_bmp_version
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	movq	48(%r12), %rsi
	addq	$13, %rsi
	movq	%r12, %rdi
	callq	_nvbios_rd08
	movq	%rax, 32(%r12)
	movq	48(%r12), %rsi
	addq	$12, %rsi
	movq	%r12, %rdi
	callq	_nvbios_rd08
	movq	%rax, 24(%r12)
	movq	48(%r12), %rsi
	addq	$11, %rsi
	movq	%r12, %rdi
	callq	_nvbios_rd08
	movq	%rax, 16(%r12)
	movq	48(%r12), %rsi
	addq	$10, %rsi
	movq	%r12, %rdi
	callq	_nvbios_rd08
	movq	%rax, 8(%r12)
LBB0_17:
	movq	32(%r12), %rdx
	movq	24(%r12), %rcx
	movq	16(%r12), %r8
	movq	(%r12), %rax
	movq	8(%r12), %r9
	movq	%rax, (%rsp)
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	callq	_nvkm_info
	xorl	%eax, %eax
LBB0_18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_nvkm_bios,4,2                  ## @nvkm_bios
	.section	__TEXT,__const
l_.str:                                 ## @.str
	.asciz	"\377\177NV\000"

	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"BMP version %x.%x\n"

L_.str.2:                               ## @.str.2
	.asciz	"\377\270BIT"

L_.str.3:                               ## @.str.3
	.asciz	"BIT signature found\n"

L_.str.4:                               ## @.str.4
	.asciz	"version %02x.%02x.%02x.%02x.%02x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_bios_new                  ; -- Begin function nvkm_bios_new
	.p2align	2
_nvkm_bios_new:                         ; @nvkm_bios_new
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #80
	bl	_kzalloc
	str	x0, [x20]
	cbz	x0, LBB0_14
; %bb.1:
	mov	x19, x0
	add	x20, x0, #40
Lloh3:
	adrp	x0, _nvkm_bios@GOTPAGE
Lloh4:
	ldr	x0, [x0, _nvkm_bios@GOTPAGEOFF]
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	bl	_nvkm_subdev_ctor
	mov	x0, x19
	bl	_nvbios_shadow
	cbnz	w0, LBB0_18
; %bb.2:
	add	x2, sp, #32
	mov	x0, x19
	mov	w1, #0
	bl	_nvbios_image
	cbz	x0, LBB0_7
; %bb.3:
	ldr	w8, [sp, #40]
	str	w8, [x19, #76]
	mov	w21, #1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #32
	mov	x0, x19
	mov	x1, x21
	bl	_nvbios_image
	cbz	x0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w21, w21, #1
	ldr	w8, [sp, #32]
	cmp	w8, #224
	b.ne	LBB0_4
; %bb.6:
	ldr	w8, [sp, #36]
	str	w8, [x19, #72]
LBB0_7:
	ldp	w1, w0, [x19, #64]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	mov	w3, #5
	bl	_nvbios_findstr
	str	x0, [x19, #48]
	cbz	x0, LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_bmp_version
	asr	w21, w0, #8
	mov	x0, x19
	bl	_bmp_version
	and	w8, w0, #0xff
	stp	x21, x8, [sp]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_nvkm_debug
LBB0_9:
	ldp	w1, w0, [x19, #64]
Lloh9:
	adrp	x2, l_.str.2@PAGE
Lloh10:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	w3, #5
	bl	_nvbios_findstr
	str	x0, [x19, #56]
	cbz	x0, LBB0_11
; %bb.10:
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_nvkm_debug
LBB0_11:
	add	x2, sp, #16
	mov	x0, x19
	mov	w1, #105
	bl	_bit_entry
	cbnz	w0, LBB0_15
; %bb.12:
	ldr	w8, [sp, #16]
	cmp	w8, #4
	b.lt	LBB0_15
; %bb.13:
	ldr	x8, [sp, #24]
	add	x1, x8, #3
	mov	x0, x19
	bl	_nvbios_rd08
	str	x0, [x19, #32]
	ldr	x8, [sp, #24]
	add	x1, x8, #2
	mov	x0, x19
	bl	_nvbios_rd08
	str	x0, [x19, #24]
	ldr	x8, [sp, #24]
	add	x1, x8, #1
	mov	x0, x19
	bl	_nvbios_rd08
	str	x0, [x19, #16]
	ldr	x1, [sp, #24]
	mov	x0, x19
	bl	_nvbios_rd08
	str	x0, [x19, #8]
	ldr	x8, [sp, #24]
	add	x1, x8, #4
	mov	x0, x19
	bl	_nvbios_rd08
	str	x0, [x19]
	b	LBB0_17
LBB0_14:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_18
LBB0_15:
	mov	x0, x19
	bl	_bmp_version
	cbz	w0, LBB0_17
; %bb.16:
	ldr	x8, [x19, #48]
	add	x1, x8, #13
	mov	x0, x19
	bl	_nvbios_rd08
	str	x0, [x19, #32]
	ldr	x8, [x19, #48]
	add	x1, x8, #12
	mov	x0, x19
	bl	_nvbios_rd08
	str	x0, [x19, #24]
	ldr	x8, [x19, #48]
	add	x1, x8, #11
	mov	x0, x19
	bl	_nvbios_rd08
	str	x0, [x19, #16]
	ldr	x8, [x19, #48]
	add	x1, x8, #10
	mov	x0, x19
	bl	_nvbios_rd08
	str	x0, [x19, #8]
LBB0_17:
	ldp	x3, x2, [x19, #24]
	ldp	x5, x4, [x19, #8]
	ldr	x6, [x19]
Lloh16:
	adrp	x1, l_.str.4@PAGE
Lloh17:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_nvkm_info
	mov	w0, #0
LBB0_18:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_nvkm_bios,4,2                  ; @nvkm_bios
	.section	__TEXT,__const
l_.str:                                 ; @.str
	.asciz	"\377\177NV\000"

	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"BMP version %x.%x\n"

l_.str.2:                               ; @.str.2
	.asciz	"\377\270BIT"

l_.str.3:                               ; @.str.3
	.asciz	"BIT signature found\n"

l_.str.4:                               ; @.str.4
	.asciz	"version %02x.%02x.%02x.%02x.%02x\n"

.subsections_via_symbols
