	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function golomb_encode_int
_golomb_encode_int:                     ## @golomb_encode_int
	.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, %r15
	leaq	16(%rdi), %r14
	movl	%esi, %r12d
	subl	(%rdi), %r12d
	movl	%esi, (%rdi)
	xorl	%edi, %edi
	testl	%r12d, %r12d
	setg	%dil
	callq	_assert
	leal	-1(%r12), %ebx
	cmpl	4(%r15), %r12d
	jle	LBB0_1
## %bb.2:
	movl	16(%r15), %eax
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	24(%r15), %rcx
	addl	%eax, (%rcx)
	movl	16(%r15), %eax
	sarl	%eax
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, 16(%r15)
	movl	4(%r15), %ecx
	subl	%ecx, %ebx
	cmpl	%ecx, %ebx
	jl	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	movl	$128, %esi
	callq	_bwrite_append
	movl	$64, %eax
	jmp	LBB0_6
LBB0_1:
	movl	(%r14), %eax
LBB0_7:
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	sarl	%eax
	jmp	LBB0_10
LBB0_8:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_bwrite_append
	movl	$64, %eax
LBB0_10:
	movl	%eax, 16(%r15)
	movl	8(%r15), %ecx
	cmpl	%ecx, %ebx
	jge	LBB0_12
## %bb.11:
	leal	2(,%rbx,4), %ebx
	jmp	LBB0_13
LBB0_12:
	addl	%ebx, %ecx
	leal	(%rcx,%rcx), %ebx
	incl	%ebx
LBB0_13:
	movb	12(%r15), %cl
	shll	%cl, %ebx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_14 Depth=1
	addl	%ebx, %ebx
	sarl	%eax
	movl	%eax, (%r14)
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$-2147483648, %ebx              ## imm = 0x80000000
	je	LBB0_20
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	testl	%eax, %eax
	je	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	testl	%ebx, %ebx
	jns	LBB0_19
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_bwrite_append
	movl	$128, (%r14)
	movl	$128, %eax
	testl	%ebx, %ebx
	jns	LBB0_19
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	24(%r15), %rcx
	addl	%eax, (%rcx)
	movl	16(%r15), %eax
	jmp	LBB0_19
LBB0_20:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_golomb_encode_int
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function golomb_encode_int
_golomb_encode_int:                     ; @golomb_encode_int
	.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	x19, x0
	add	x20, x0, #16
	ldr	w8, [x0]
	sub	w22, w1, w8
	str	w1, [x0]
	cmp	w22, #0
	cset	w0, gt
	bl	_assert
	sub	w21, w22, #1
	ldr	w8, [x19, #4]
	cmp	w22, w8
	b.le	LBB0_6
; %bb.1:
	ldr	w8, [x19, #16]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x19, #24]
	ldr	w10, [x9]
	add	w8, w10, w8
	str	w8, [x9]
	ldr	w8, [x19, #16]
	asr	w8, w8, #1
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	w8, [x19, #16]
	ldr	w9, [x19, #4]
	sub	w21, w21, w9
	cmp	w21, w9
	b.lt	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cbnz	w8, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	mov	w1, #128
	bl	_bwrite_append
	mov	w8, #64
	b	LBB0_3
LBB0_6:
	ldr	w8, [x20]
LBB0_7:
	cbz	w8, LBB0_9
; %bb.8:
	asr	w8, w8, #1
	b	LBB0_10
LBB0_9:
	mov	x0, x20
	mov	w1, #0
	bl	_bwrite_append
	mov	w8, #64
LBB0_10:
	str	w8, [x19, #16]
	ldp	w9, w10, [x19, #8]
	add	w11, w9, w21
	mov	w12, #1
	bfi	w12, w11, #1, #31
	mov	w11, #2
	bfi	w11, w21, #2, #30
	cmp	w21, w9
	csel	w9, w12, w11, ge
	lsl	w21, w9, w10
	mov	w22, #-2147483648
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	lsl	w21, w21, #1
	asr	w8, w8, #1
	str	w8, [x20]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	cmp	w21, w22
	b.eq	LBB0_17
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	cbz	w8, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	tbz	w21, #31, LBB0_11
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x20
	mov	w1, #0
	bl	_bwrite_append
	mov	w8, #128
	str	w8, [x20]
	tbz	w21, #31, LBB0_11
LBB0_16:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	x9, [x19, #24]
	ldr	w10, [x9]
	add	w8, w10, w8
	str	w8, [x9]
	ldr	w8, [x19, #16]
	b	LBB0_11
LBB0_17:
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_golomb_encode_int
.subsections_via_symbols
