	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t1_get_board_rev               ## -- Begin function t1_get_board_rev
	.p2align	4, 0x90
_t1_get_board_rev:                      ## @t1_get_board_rev
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %rbx
	movq	(%rsi), %rax
	movq	%rax, (%rdx)
	movq	_CHBT_TERM_FPGA@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%edx, %edx
	cmpq	%rcx, %rax
	setne	%dl
	movl	%edx, 8(%rbx)
	movq	_CHBT_TERM_T1@GOTPCREL(%rip), %rdx
	movl	$-1, %r14d
	cmpq	(%rdx), %rax
	je	LBB0_3
## %bb.1:
	movq	_CHBT_TERM_T2@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	je	LBB0_3
## %bb.2:
	cmpq	%rcx, %rax
	jne	LBB0_8
LBB0_3:
	movq	_A_TP_PC_CONFIG@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	(%rdi), %rax
	movq	%rax, %rdi
	callq	_readl
	movl	%eax, %edi
	callq	_G_TP_PC_REV
	cmpl	$2, %eax
	je	LBB0_4
## %bb.5:
	cmpl	$3, %eax
	jne	LBB0_8
## %bb.6:
	movq	_TERM_T2@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_4:
	movq	_TERM_T1B@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	xorl	%r14d, %r14d
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CHBT_TERM_FPGA,8,3             ## @CHBT_TERM_FPGA
	.comm	_CHBT_TERM_T1,8,3               ## @CHBT_TERM_T1
	.comm	_CHBT_TERM_T2,8,3               ## @CHBT_TERM_T2
	.comm	_A_TP_PC_CONFIG,8,3             ## @A_TP_PC_CONFIG
	.comm	_TERM_T1B,4,2                   ## @TERM_T1B
	.comm	_TERM_T2,4,2                    ## @TERM_T2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t1_get_board_rev               ; -- Begin function t1_get_board_rev
	.p2align	2
_t1_get_board_rev:                      ; @t1_get_board_rev
	.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
	ldr	x8, [x1]
	str	x8, [x2]
Lloh0:
	adrp	x9, _CHBT_TERM_FPGA@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHBT_TERM_FPGA@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w10, ne
	str	w10, [x2, #8]
Lloh3:
	adrp	x10, _CHBT_TERM_T1@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CHBT_TERM_T1@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
Lloh6:
	adrp	x11, _CHBT_TERM_T2@GOTPAGE
Lloh7:
	ldr	x11, [x11, _CHBT_TERM_T2@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x11]
	cmp	x8, x10
	ccmp	x8, x11, #4, ne
	ccmp	x8, x9, #4, ne
	b.ne	LBB0_4
; %bb.1:
	mov	x19, x2
	ldr	x8, [x0]
Lloh9:
	adrp	x9, _A_TP_PC_CONFIG@GOTPAGE
Lloh10:
	ldr	x9, [x9, _A_TP_PC_CONFIG@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	bl	_G_TP_PC_REV
	cmp	w0, #2
	b.eq	LBB0_5
; %bb.2:
	cmp	w0, #3
	b.ne	LBB0_4
; %bb.3:
Lloh12:
	adrp	x8, _TERM_T2@GOTPAGE
Lloh13:
	ldr	x8, [x8, _TERM_T2@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	mov	w0, #-1
	b	LBB0_7
LBB0_5:
Lloh14:
	adrp	x8, _TERM_T1B@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TERM_T1B@GOTPAGEOFF]
LBB0_6:
	mov	w0, #0
	ldr	w8, [x8]
	str	w8, [x19, #12]
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_CHBT_TERM_FPGA,8,3             ; @CHBT_TERM_FPGA
	.comm	_CHBT_TERM_T1,8,3               ; @CHBT_TERM_T1
	.comm	_CHBT_TERM_T2,8,3               ; @CHBT_TERM_T2
	.comm	_A_TP_PC_CONFIG,8,3             ; @A_TP_PC_CONFIG
	.comm	_TERM_T1B,4,2                   ; @TERM_T1B
	.comm	_TERM_T2,4,2                    ; @TERM_T2
.subsections_via_symbols
