	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad_set_categories
_ad_set_categories:                     ## @ad_set_categories
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	(%rdi), %r14d
	movl	%r14d, %r15d
	shrl	$16, %r15d
	xorl	%edi, %edi
	testl	$32768, %r14d                   ## imm = 0x8000
	jne	LBB0_4
## %bb.1:
	testl	%r14d, %r14d
	js	LBB0_4
## %bb.2:
	movzwl	%r14w, %ecx
	movq	_MAX_AD_CATEGORY@GOTPCREL(%rip), %rax
	movswl	(%rax), %eax
	cmpl	%eax, %ecx
	jg	LBB0_4
## %bb.3:
	xorl	%edi, %edi
	cmpl	%eax, %r15d
	setle	%dil
LBB0_4:
	callq	_assert
	movl	4(%rbx), %ebx
	movl	%ebx, %edi
	callq	_ad_is_ancient
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_get_ad_f
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_load_ancient_ad
	shrq	$63, %rax
	xorl	$1, %eax
	movl	%eax, %edi
	callq	_assert
	movw	%r14w, (%rbx)
	movw	%r15w, 2(%rbx)
	movl	$1, %eax
	jmp	LBB0_7
LBB0_5:
	movl	$-1, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_AD_CATEGORY,2,1            ## @MAX_AD_CATEGORY
	.no_dead_strip	_ad_set_categories
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ad_set_categories
_ad_set_categories:                     ; @ad_set_categories
	.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
	mov	x19, x0
	ldr	w20, [x0]
	mov	w8, #-65535
	cmp	w8, w20, lsl #16
	b.gt	LBB0_4
; %bb.1:
	mov	w0, #0
	tbnz	w20, #31, LBB0_5
; %bb.2:
	and	w9, w20, #0xffff
Lloh0:
	adrp	x8, _MAX_AD_CATEGORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_AD_CATEGORY@GOTPAGEOFF]
Lloh2:
	ldrsh	w8, [x8]
	cmp	w9, w8
	b.gt	LBB0_5
; %bb.3:
	lsr	w9, w20, #16
	cmp	w9, w8
	cset	w0, le
	b	LBB0_5
LBB0_4:
	mov	w0, #0
LBB0_5:
	bl	_assert
	ldr	w19, [x19, #4]
	mov	x0, x19
	bl	_ad_is_ancient
	mov	x1, x0
	mov	x0, x19
	bl	_get_ad_f
	cbz	x0, LBB0_7
; %bb.6:
	mov	x19, x0
	bl	_load_ancient_ad
	lsr	x8, x0, #63
	eor	w0, w8, #0x1
	bl	_assert
	str	w20, [x19]
	mov	w0, #1
	b	LBB0_8
LBB0_7:
	mov	w0, #-1
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_AD_CATEGORY,2,1            ; @MAX_AD_CATEGORY
	.no_dead_strip	_ad_set_categories
.subsections_via_symbols
