	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_convert_ip_to_linear           ## -- Begin function convert_ip_to_linear
	.p2align	4, 0x90
_convert_ip_to_linear:                  ## @convert_ip_to_linear
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rsi), %r15
	movzwl	8(%rsi), %ebx
	movq	%rsi, %rdi
	callq	_v8086_mode
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movzwl	%r15w, %eax
	shlq	$4, %rbx
	addq	%rax, %rbx
	movq	%rbx, %r15
	jmp	LBB0_6
LBB0_2:
	movq	_SEGMENT_TI_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	movq	_SEGMENT_LDT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.3:
	movq	(%r14), %rdi
	addq	$8, %rdi
	callq	_mutex_lock
	movq	%rbx, %rax
	shrq	$3, %rax
	movq	(%r14), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setae	%dil
	callq	_unlikely
	movq	$-1, %r12
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	andl	$-8, %ebx
	movq	(%r14), %rax
	movq	16(%rax), %r12
	leaq	(%r12,%rbx,4), %rdi
	callq	_get_desc_base
	cmpl	$0, (%r12,%rbx,4)
	movzwl	%r15w, %r12d
	cmovneq	%r15, %r12
	addq	%rax, %r12
LBB0_5:
	movq	(%r14), %rdi
	addq	$8, %rdi
	callq	_mutex_unlock
	movq	%r12, %r15
LBB0_6:
	movq	%r15, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SEGMENT_TI_MASK,8,3            ## @SEGMENT_TI_MASK
	.comm	_SEGMENT_LDT,8,3                ## @SEGMENT_LDT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_convert_ip_to_linear           ; -- Begin function convert_ip_to_linear
	.p2align	2
_convert_ip_to_linear:                  ; @convert_ip_to_linear
	.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	x20, x0
	ldr	x19, [x1]
	ldrh	w21, [x1, #8]
	mov	x0, x1
	bl	_v8086_mode
	cbz	x0, LBB0_2
; %bb.1:
	lsl	x8, x21, #4
	add	x19, x8, w19, uxth
	b	LBB0_7
LBB0_2:
Lloh0:
	adrp	x8, _SEGMENT_TI_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SEGMENT_TI_MASK@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	and	x8, x8, x21
Lloh3:
	adrp	x9, _SEGMENT_LDT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SEGMENT_LDT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.3:
	ldr	x8, [x20]
	add	x0, x8, #8
	bl	_mutex_lock
	ldr	x8, [x20]
	ldr	x8, [x8]
	cmp	x8, x21, lsr #3
	cset	w0, ls
	bl	_unlikely
	cbz	x0, LBB0_5
; %bb.4:
	mov	x19, #-1
	b	LBB0_6
LBB0_5:
	and	x8, x21, #0xfff8
	ldr	x9, [x20]
	ldr	x9, [x9, #16]
	add	x21, x9, x8, lsl #2
	mov	x0, x21
	bl	_get_desc_base
	ldr	w8, [x21]
	and	x9, x19, #0xffff
	cmp	w8, #0
	csel	x8, x9, x19, eq
	add	x19, x8, x0
LBB0_6:
	ldr	x8, [x20]
	add	x0, x8, #8
	bl	_mutex_unlock
LBB0_7:
	mov	x0, x19
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_SEGMENT_TI_MASK,8,3            ; @SEGMENT_TI_MASK
	.comm	_SEGMENT_LDT,8,3                ; @SEGMENT_LDT
.subsections_via_symbols
