	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function octeon_get_uboot_version
_octeon_get_uboot_version:              ## @octeon_get_uboot_version
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$512, %edi                      ## imm = 0x200
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_17
## %bb.1:
	movq	%rax, %r15
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	$50, %edx
	callq	_octeon_console_send_cmd
	testq	%rax, %rax
	jne	LBB0_18
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_octeon_console_send_cmd
	testq	%rax, %rax
	je	LBB0_3
LBB0_18:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	8(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	movl	$16, %r12d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	addl	%ebx, %r13d
	decl	%r12d
	je	LBB0_10
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movslq	%r13d, %rax
	leaq	(%r15,%rax), %rdx
	movl	$511, %ecx                      ## imm = 0x1FF
	subl	%eax, %ecx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_octeon_console_read
	movl	%eax, %ebx
	testl	%eax, %eax
	jle	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %eax
	movb	$0, (%r15,%rax)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 8(%rax)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_octeon_console_handle_result
	jmp	LBB0_7
LBB0_8:
	jns	LBB0_10
## %bb.9:
	movq	(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%edx, %edx
	movl	%ebx, %ecx
	callq	_dev_err
LBB0_10:
	testl	%r13d, %r13d
	jne	LBB0_13
## %bb.11:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rcx
	cmpb	$0, (%rcx)
	je	LBB0_13
## %bb.12:
	movq	(%r14), %rdi
	leaq	L_.str.3(%rip), %rsi
	xorl	%edx, %edx
	callq	_dev_dbg
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movb	$0, (%rax)
LBB0_13:
	movb	$0, 511(%r15)
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	movq	%rax, %rbx
	leaq	L_.str.5(%rip), %rsi
	movq	%rax, %rdi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movb	$0, -1(%rax)
	movq	(%r14), %rdi
	leaq	L_.str.6(%rip), %rsi
	movq	%rbx, %rdx
	callq	_dev_info
LBB0_16:
	movq	%r15, %rdi
	callq	_kfree
	leaq	L_.str.7(%rip), %rsi
	movq	%r14, %rdi
	movl	$50, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_octeon_console_send_cmd        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"setenv stdout pci\n"

L_.str.1:                               ## @.str.1
	.asciz	"version\n"

L_.str.2:                               ## @.str.2
	.asciz	"Error reading console %u, ret=%d\n"

L_.str.3:                               ## @.str.3
	.asciz	"%u: %s\n"

L_.str.4:                               ## @.str.4
	.asciz	"U-Boot"

L_.str.5:                               ## @.str.5
	.asciz	"mips"

L_.str.6:                               ## @.str.6
	.asciz	"%s\n"

L_.str.7:                               ## @.str.7
	.asciz	"setenv stdout serial\n"

	.comm	_OCTEON_UBOOT_VER_BUF_SIZE,4,2  ## @OCTEON_UBOOT_VER_BUF_SIZE
	.no_dead_strip	_octeon_get_uboot_version
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function octeon_get_uboot_version
_octeon_get_uboot_version:              ; @octeon_get_uboot_version
	.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
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #512
	bl	_kmalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	w2, #50
	bl	_octeon_console_send_cmd
	cbnz	x0, LBB0_3
; %bb.2:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	w2, #1
	bl	_octeon_console_send_cmd
	cbz	x0, LBB0_5
LBB0_3:
	mov	x0, x20
	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	_kfree
LBB0_4:
	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_5:
	mov	w23, #0
	ldr	x22, [x19, #8]
	mov	w24, #16
	mov	w25, #511
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	w23, w21, w23
	subs	w24, w24, #1
	b.eq	LBB0_12
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, x20, w23, sxtw
	sub	w3, w25, w23
	mov	x0, x19
	mov	x1, #0
	bl	_octeon_console_read
	mov	x21, x0
	cmp	w0, #1
	b.lt	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	strb	wzr, [x20, w21, uxtw]
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	mov	x1, #0
	bl	_octeon_console_handle_result
	b	LBB0_6
LBB0_10:
	tbz	w21, #31, LBB0_12
; %bb.11:
	ldr	x0, [x19]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, #0
	mov	x3, x21
	bl	_dev_err
LBB0_12:
	cbnz	w23, LBB0_15
; %bb.13:
	ldr	x3, [x22]
	ldrb	w8, [x3]
	cbz	w8, LBB0_15
; %bb.14:
	ldr	x0, [x19]
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, #0
	bl	_dev_dbg
	ldr	x8, [x22]
	strb	wzr, [x8]
LBB0_15:
	strb	wzr, [x20, #511]
Lloh11:
	adrp	x1, l_.str.4@PAGE
Lloh12:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_strstr
	cbz	x0, LBB0_18
; %bb.16:
	mov	x21, x0
Lloh13:
	adrp	x1, l_.str.5@PAGE
Lloh14:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_18
; %bb.17:
	sturb	wzr, [x0, #-1]
	ldr	x0, [x19]
Lloh15:
	adrp	x1, l_.str.6@PAGE
Lloh16:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x2, x21
	bl	_dev_info
LBB0_18:
	mov	x0, x20
	bl	_kfree
Lloh17:
	adrp	x1, l_.str.7@PAGE
Lloh18:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x19
	mov	w2, #50
	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	_octeon_console_send_cmd
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"setenv stdout pci\n"

l_.str.1:                               ; @.str.1
	.asciz	"version\n"

l_.str.2:                               ; @.str.2
	.asciz	"Error reading console %u, ret=%d\n"

l_.str.3:                               ; @.str.3
	.asciz	"%u: %s\n"

l_.str.4:                               ; @.str.4
	.asciz	"U-Boot"

l_.str.5:                               ; @.str.5
	.asciz	"mips"

l_.str.6:                               ; @.str.6
	.asciz	"%s\n"

l_.str.7:                               ; @.str.7
	.asciz	"setenv stdout serial\n"

	.comm	_OCTEON_UBOOT_VER_BUF_SIZE,4,2  ; @OCTEON_UBOOT_VER_BUF_SIZE
	.no_dead_strip	_octeon_get_uboot_version
.subsections_via_symbols
