	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_header
_read_header:                           ## @read_header
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	8(%rdi), %rbx
	cmpq	$0, 40(%rbx)
	je	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	callq	_print_al_capture_devices
	movq	_AVERROR_EXIT@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_9
LBB0_2:
	movl	(%rbx), %eax
	movl	32(%rbx), %ecx
	leal	7(%rax), %edx
	testl	%eax, %eax
	cmovnsl	%eax, %edx
	sarl	$3, %edx
	movslq	%edx, %rax
	shlq	$4, %rax
	movslq	4(%rbx), %rdx
	leaq	_read_header.sample_formats(%rip), %rsi
	addq	%rax, %rsi
	movq	-24(%rsi,%rdx,8), %rdx
	movq	%rdx, 24(%rbx)
	movq	(%r12), %rdi
	movq	(%rdi), %rax
	testq	%rax, %rax
	cmoveq	%rax, %rdi
	movl	%ecx, %esi
	callq	_alcCaptureOpenDevice
	movq	%rax, 16(%rbx)
	leaq	-40(%rbp), %rsi
	movq	%rax, %rdi
	callq	_al_get_error
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_3
LBB0_5:
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:
	callq	_alcCaptureCloseDevice
LBB0_7:
	movq	-40(%rbp), %rcx
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.8:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_av_log
	jmp	LBB0_9
LBB0_3:
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_4
## %bb.10:
	movq	%rax, %r15
	movq	%rax, %rdi
	movl	$64, %esi
	movl	$1, %edx
	movl	$1000000, %ecx                  ## imm = 0xF4240
	callq	_avpriv_set_pts_info
	movq	(%r15), %r15
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r15)
	movl	32(%rbx), %eax
	movl	%eax, 8(%r15)
	movq	24(%rbx), %rdi
	callq	_get_al_format_info
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movq	24(%rbx), %rdi
	callq	_get_al_format_info
	movl	4(%rax), %eax
	movl	%eax, 4(%r15)
	movq	24(%rbx), %rdi
	callq	_get_al_format_info
	movl	4(%rax), %edi
	callq	_av_get_bits_per_sample
	movl	%eax, %r15d
	movq	24(%rbx), %rdi
	callq	_get_al_format_info
	imull	(%rax), %r15d
	leal	7(%r15), %eax
	testl	%r15d, %r15d
	cmovnsl	%r15d, %eax
	sarl	$3, %eax
	movl	%eax, 8(%rbx)
	movq	16(%rbx), %rdi
	callq	_alcCaptureStart
LBB0_9:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r14d
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @read_header.sample_formats
_read_header.sample_formats:
	.long	130                             ## 0x82
	.long	128                             ## 0x80
	.space	8
	.long	131                             ## 0x83
	.long	129                             ## 0x81
	.space	8

	.comm	_AVERROR_EXIT,4,2               ## @AVERROR_EXIT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ## @AVMEDIA_TYPE_AUDIO
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot open device: %s\n"

	.no_dead_strip	_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_header
_read_header:                           ; @read_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x21, [x0, #8]
	ldr	x8, [x21, #40]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_print_al_capture_devices
Lloh0:
	adrp	x8, _AVERROR_EXIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVERROR_EXIT@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	b	LBB0_9
LBB0_2:
	ldp	w8, w9, [x21]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	add	w10, w8, #7
	cmp	w8, #0
	csel	w8, w10, w8, lt
	asr	w8, w8, #3
Lloh3:
	adrp	x10, _read_header.sample_formats@PAGE
Lloh4:
	add	x10, x10, _read_header.sample_formats@PAGEOFF
	add	x8, x10, w8, sxtw #4
	add	x8, x8, x9, lsl #3
	ldur	x2, [x8, #-24]
	str	x2, [x21, #24]
	ldr	x8, [x19]
	ldr	x9, [x8]
	cmp	x9, #0
	csel	x0, xzr, x8, eq
	ldr	w1, [x21, #32]
	mov	x3, x1
	bl	_alcCaptureOpenDevice
	str	x0, [x21, #16]
	add	x1, sp, #8
	bl	_al_get_error
	mov	x20, x0
	cbz	w0, LBB0_7
; %bb.3:
	ldr	x0, [x21, #16]
	cbz	x0, LBB0_5
LBB0_4:
	bl	_alcCaptureCloseDevice
LBB0_5:
	ldr	x3, [sp, #8]
	cbz	x3, LBB0_9
; %bb.6:
Lloh5:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
	b	LBB0_9
LBB0_7:
	mov	x0, x19
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_10
; %bb.8:
	mov	x20, x0
	mov	w1, #64
	mov	w2, #1
	mov	w3, #16960
	movk	w3, #15, lsl #16
	bl	_avpriv_set_pts_info
Lloh10:
	adrp	x8, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
	ldr	x19, [x20]
Lloh12:
	ldr	w8, [x8]
	ldr	w9, [x21, #32]
	stp	w9, w8, [x19, #8]
	ldr	x0, [x21, #24]
	bl	_get_al_format_info
	ldr	w8, [x0]
	str	w8, [x19]
	ldr	x0, [x21, #24]
	bl	_get_al_format_info
	ldr	w8, [x0, #4]
	str	w8, [x19, #4]
	ldr	x0, [x21, #24]
	bl	_get_al_format_info
	ldr	w0, [x0, #4]
	bl	_av_get_bits_per_sample
	mov	x19, x0
	ldr	x0, [x21, #24]
	bl	_get_al_format_info
	ldr	w8, [x0]
	mul	w8, w8, w19
	add	w9, w8, #7
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #3
	str	w8, [x21, #8]
	ldr	x0, [x21, #16]
	bl	_alcCaptureStart
	mov	w20, #0
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_10:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x20, x0
	ldr	x0, [x21, #16]
	cbnz	x0, LBB0_4
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @read_header.sample_formats
_read_header.sample_formats:
	.long	130                             ; 0x82
	.long	128                             ; 0x80
	.space	8
	.long	131                             ; 0x83
	.long	129                             ; 0x81
	.space	8

	.comm	_AVERROR_EXIT,4,2               ; @AVERROR_EXIT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ; @AVMEDIA_TYPE_AUDIO
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot open device: %s\n"

	.no_dead_strip	_read_header
.subsections_via_symbols
