	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hdb_lock                       ## -- Begin function hdb_lock
	.p2align	4, 0x90
_hdb_lock:                              ## @hdb_lock
	.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
	movl	%esi, %ebx
	movl	%edi, %r14d
	movq	_HDB_RLOCK@GOTPCREL(%rip), %r12
	cmpl	%esi, (%r12)
	jne	LBB0_1
## %bb.2:
	movq	_LOCK_SH@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_LOCK_EX@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %esi
	movq	_LOCK_NB@GOTPCREL(%rip), %r13
	orl	(%r13), %esi
	movl	%r14d, %edi
	callq	_flock
	xorl	%r15d, %r15d
	testl	%eax, %eax
	je	LBB0_20
## %bb.4:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EWOULDBLOCK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_16
## %bb.5:
	movl	$1, %edi
	callq	_sleep
	cmpl	%ebx, (%r12)
	jne	LBB0_6
## %bb.7:
	movq	_LOCK_SH@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	_LOCK_EX@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %esi
	orl	(%r13), %esi
	movl	%r14d, %edi
	callq	_flock
	testl	%eax, %eax
	je	LBB0_20
## %bb.9:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_EWOULDBLOCK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_16
## %bb.10:
	movl	$1, %edi
	callq	_sleep
	cmpl	%ebx, (%r12)
	jne	LBB0_11
## %bb.12:
	movq	_LOCK_SH@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_11:
	movq	_LOCK_EX@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %esi
	orl	(%r13), %esi
	movl	%r14d, %edi
	callq	_flock
	testl	%eax, %eax
	je	LBB0_20
## %bb.14:
	movq	_errno@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rax
	movq	_EWOULDBLOCK@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_16
## %bb.15:
	movl	$1, %edi
	movq	%rdx, %rbx
	movq	%rsi, %r14
	callq	_sleep
	movq	(%rbx), %rax
	movq	(%r14), %rcx
LBB0_16:
	cmpq	%rcx, %rax
	jne	LBB0_18
## %bb.17:
	movq	_HDB_ERR_DB_INUSE@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_18:
	movq	_HDB_ERR_CANT_LOCK_DB@GOTPCREL(%rip), %rax
LBB0_19:
	movl	(%rax), %r15d
LBB0_20:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HDB_RLOCK,4,2                  ## @HDB_RLOCK
	.comm	_LOCK_SH,4,2                    ## @LOCK_SH
	.comm	_LOCK_EX,4,2                    ## @LOCK_EX
	.comm	_LOCK_NB,4,2                    ## @LOCK_NB
	.comm	_errno,8,3                      ## @errno
	.comm	_EWOULDBLOCK,8,3                ## @EWOULDBLOCK
	.comm	_HDB_ERR_DB_INUSE,4,2           ## @HDB_ERR_DB_INUSE
	.comm	_HDB_ERR_CANT_LOCK_DB,4,2       ## @HDB_ERR_CANT_LOCK_DB
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hdb_lock                       ; -- Begin function hdb_lock
	.p2align	2
_hdb_lock:                              ; @hdb_lock
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _HDB_RLOCK@GOTPAGE
Lloh1:
	ldr	x23, [x23, _HDB_RLOCK@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh2:
	adrp	x24, _LOCK_SH@GOTPAGE
Lloh3:
	ldr	x24, [x24, _LOCK_SH@GOTPAGEOFF]
Lloh4:
	adrp	x25, _LOCK_EX@GOTPAGE
Lloh5:
	ldr	x25, [x25, _LOCK_EX@GOTPAGEOFF]
	cmp	w8, w1
	csel	x8, x24, x25, eq
	ldr	w8, [x8]
Lloh6:
	adrp	x26, _LOCK_NB@GOTPAGE
Lloh7:
	ldr	x26, [x26, _LOCK_NB@GOTPAGEOFF]
	ldr	w9, [x26]
	orr	w1, w8, w9
	bl	_flock
	cbz	w0, LBB0_11
; %bb.1:
Lloh8:
	adrp	x21, _errno@GOTPAGE
Lloh9:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh10:
	adrp	x22, _EWOULDBLOCK@GOTPAGE
Lloh11:
	ldr	x22, [x22, _EWOULDBLOCK@GOTPAGEOFF]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.2:
	mov	w0, #1
	bl	_sleep
	ldr	w8, [x23]
	cmp	w8, w20
	csel	x8, x24, x25, eq
	ldr	w8, [x8]
	ldr	w9, [x26]
	orr	w1, w8, w9
	mov	x0, x19
	bl	_flock
	cbz	w0, LBB0_11
; %bb.3:
	ldr	x8, [x21]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.4:
	mov	w0, #1
	bl	_sleep
	ldr	w8, [x23]
	cmp	w8, w20
	csel	x8, x24, x25, eq
	ldr	w8, [x8]
	ldr	w9, [x26]
	orr	w1, w8, w9
	mov	x0, x19
	bl	_flock
	cbz	w0, LBB0_11
; %bb.5:
	ldr	x8, [x21]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	mov	w0, #1
	bl	_sleep
	ldr	x8, [x21]
	ldr	x9, [x22]
LBB0_7:
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.8:
Lloh12:
	adrp	x8, _HDB_ERR_DB_INUSE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _HDB_ERR_DB_INUSE@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh14:
	adrp	x8, _HDB_ERR_CANT_LOCK_DB@GOTPAGE
Lloh15:
	ldr	x8, [x8, _HDB_ERR_CANT_LOCK_DB@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
LBB0_11:
	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
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_HDB_RLOCK,4,2                  ; @HDB_RLOCK
	.comm	_LOCK_SH,4,2                    ; @LOCK_SH
	.comm	_LOCK_EX,4,2                    ; @LOCK_EX
	.comm	_LOCK_NB,4,2                    ; @LOCK_NB
	.comm	_errno,8,3                      ; @errno
	.comm	_EWOULDBLOCK,8,3                ; @EWOULDBLOCK
	.comm	_HDB_ERR_DB_INUSE,4,2           ; @HDB_ERR_DB_INUSE
	.comm	_HDB_ERR_CANT_LOCK_DB,4,2       ; @HDB_ERR_CANT_LOCK_DB
.subsections_via_symbols
