	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function audio_select_and_add_track
_audio_select_and_add_track:            ## @audio_select_and_add_track
	.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
	subq	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	movl	%r8d, %r14d
	movq	%rcx, -144(%rbp)                ## 8-byte Spill
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, -136(%rbp)                ## 8-byte Spill
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_ghb_dict_get_string
	movq	%rax, %rdi
	callq	_ghb_lookup_container_by_name
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_ghb_get_copy_mask
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ghb_array_get
	movq	%rax, %r12
	leaq	L_.str.1(%rip), %rsi
	movq	%rax, %rdi
	callq	_ghb_settings_audio_encoder_codec
	movq	%rbx, -128(%rbp)                ## 8-byte Spill
	movq	%rbx, %rdi
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	%rax, %rsi
	callq	_ghb_select_fallback
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	callq	_ghb_settings_audio_bitrate_rate
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	callq	_ghb_settings_audio_samplerate_rate
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %rdi
	callq	_ghb_settings_mixdown_mix
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	L_.str.5(%rip), %rsi
	movq	%r12, %rdi
	callq	_ghb_dict_get_double
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	L_.str.6(%rip), %rsi
	movq	%r12, %rdi
	callq	_ghb_dict_get_double
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	L_.str.7(%rip), %rsi
	movq	%r12, %rdi
	callq	_ghb_dict_get_bool
	movq	%rax, %r14
	leaq	L_.str.8(%rip), %rsi
	movq	%r12, %rdi
	callq	_ghb_dict_get_double
	movl	%eax, %r12d
	movq	_HB_INVALID_AUDIO_QUALITY@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	-136(%rbp), %rdi                ## 8-byte Reload
	movq	%rdi, %r15
	movq	-144(%rbp), %rsi                ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_ghb_find_audio_track
	testq	%rax, %rax
	js	LBB0_2
## %bb.1:
	movq	%rax, %rbx
	testq	%r14, %r14
	cmovel	%r13d, %r12d
	xorl	%r13d, %r13d
	negq	%r14
	sbbq	%r13, %r13
	orq	-64(%rbp), %r13                 ## 8-byte Folded Reload
	movl	(%r15), %edi
	movq	%rax, %rsi
	callq	_hb_list_audio_config_item
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	movl	(%rcx), %edi
	movl	(%rax), %esi
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	movq	-120(%rbp), %r8                 ## 8-byte Reload
	callq	_ghb_select_audio_codec
	subq	$8, %rsp
	movq	-128(%rbp), %rdi                ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%rax, %rdx
	movl	%r12d, %ecx
	movq	%r13, %r8
	movq	-88(%rbp), %r9                  ## 8-byte Reload
	pushq	-56(%rbp)                       ## 8-byte Folded Reload
	pushq	-72(%rbp)                       ## 8-byte Folded Reload
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	callq	_audio_add_track
	addq	$136, %rsp
	jmp	LBB0_3
LBB0_2:
	xorl	%eax, %eax
	addq	$104, %rsp
LBB0_3:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FileFormat"

L_.str.1:                               ## @.str.1
	.asciz	"AudioEncoder"

L_.str.2:                               ## @.str.2
	.asciz	"AudioBitrate"

L_.str.3:                               ## @.str.3
	.asciz	"AudioSamplerate"

L_.str.4:                               ## @.str.4
	.asciz	"AudioMixdown"

L_.str.5:                               ## @.str.5
	.asciz	"AudioTrackDRCSlider"

L_.str.6:                               ## @.str.6
	.asciz	"AudioTrackGainSlider"

L_.str.7:                               ## @.str.7
	.asciz	"AudioTrackQualityEnable"

L_.str.8:                               ## @.str.8
	.asciz	"AudioTrackQuality"

	.comm	_HB_INVALID_AUDIO_QUALITY,4,2   ## @HB_INVALID_AUDIO_QUALITY
	.no_dead_strip	_audio_select_and_add_track
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function audio_select_and_add_track
_audio_select_and_add_track:            ; @audio_select_and_add_track
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x5
	mov	x21, x4
	mov	x24, x3
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ghb_dict_get_string
	bl	_ghb_lookup_container_by_name
	str	x0, [sp, #32]                   ; 8-byte Folded Spill
	mov	x0, x19
	bl	_ghb_get_copy_mask
	str	x0, [sp, #40]                   ; 8-byte Folded Spill
	mov	x0, x22
	mov	x1, x21
	bl	_ghb_array_get
	mov	x28, x0
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_ghb_settings_audio_encoder_codec
	mov	x25, x0
	mov	x0, x19
	mov	x1, x25
	bl	_ghb_select_fallback
	str	x0, [sp, #24]                   ; 8-byte Folded Spill
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x28
	bl	_ghb_settings_audio_bitrate_rate
	mov	x22, x0
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x28
	bl	_ghb_settings_audio_samplerate_rate
	str	x0, [sp, #16]                   ; 8-byte Folded Spill
Lloh8:
	adrp	x1, l_.str.4@PAGE
Lloh9:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x28
	bl	_ghb_settings_mixdown_mix
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
Lloh10:
	adrp	x1, l_.str.5@PAGE
Lloh11:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x28
	bl	_ghb_dict_get_double
	str	w0, [sp, #4]                    ; 4-byte Folded Spill
Lloh12:
	adrp	x1, l_.str.6@PAGE
Lloh13:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x28
	bl	_ghb_dict_get_double
	mov	x26, x0
Lloh14:
	adrp	x1, l_.str.7@PAGE
Lloh15:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x28
	bl	_ghb_dict_get_bool
	mov	x27, x0
Lloh16:
	adrp	x1, l_.str.8@PAGE
Lloh17:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	x0, x28
	bl	_ghb_dict_get_double
	mov	x28, x0
Lloh18:
	adrp	x8, _HB_INVALID_AUDIO_QUALITY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HB_INVALID_AUDIO_QUALITY@GOTPAGEOFF]
Lloh20:
	ldr	w21, [x8]
	mov	x0, x20
	mov	x1, x24
	mov	x2, x23
	bl	_ghb_find_audio_track
	tbnz	x0, #63, LBB0_2
; %bb.1:
	mov	x23, x0
	cmp	x27, #0
	csel	w24, w21, w28, eq
	csinv	x22, x22, xzr, eq
	ldr	w0, [x20]
	mov	x1, x23
	bl	_hb_list_audio_config_item
	ldp	x3, x8, [sp, #24]               ; 16-byte Folded Reload
	ldr	w8, [x8]
	ldr	w1, [x0]
	mov	x0, x8
	mov	x2, x25
	ldr	x4, [sp, #40]                   ; 8-byte Folded Reload
	bl	_ghb_select_audio_codec
	mov	x2, x0
	str	w26, [sp]
	mov	x0, x19
	mov	x1, x23
	mov	x3, x24
	mov	x4, x22
	ldp	x6, x5, [sp, #8]                ; 16-byte Folded Reload
	ldr	w7, [sp, #4]                    ; 4-byte Folded Reload
	bl	_audio_add_track
	b	LBB0_3
LBB0_2:
	mov	x0, #0
LBB0_3:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FileFormat"

l_.str.1:                               ; @.str.1
	.asciz	"AudioEncoder"

l_.str.2:                               ; @.str.2
	.asciz	"AudioBitrate"

l_.str.3:                               ; @.str.3
	.asciz	"AudioSamplerate"

l_.str.4:                               ; @.str.4
	.asciz	"AudioMixdown"

l_.str.5:                               ; @.str.5
	.asciz	"AudioTrackDRCSlider"

l_.str.6:                               ; @.str.6
	.asciz	"AudioTrackGainSlider"

l_.str.7:                               ; @.str.7
	.asciz	"AudioTrackQualityEnable"

l_.str.8:                               ; @.str.8
	.asciz	"AudioTrackQuality"

	.comm	_HB_INVALID_AUDIO_QUALITY,4,2   ; @HB_INVALID_AUDIO_QUALITY
	.no_dead_strip	_audio_select_and_add_track
.subsections_via_symbols
