	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_convert_channel3               ## -- Begin function convert_channel3
	.p2align	4, 0x90
_convert_channel3:                      ## @convert_channel3
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r12d
	movl	%r8d, %r14d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	cmpl	$72, %edx
	jl	LBB0_4
## %bb.1:
	movl	$1, %r13d
	xorl	%r15d, %r15d
	movl	%r12d, %eax
	orl	%r14d, %eax
	je	LBB0_18
## %bb.2:
	cmpl	$12, %r14d
	jne	LBB0_10
## %bb.3:
	movl	$5, %edi
	callq	_BIT
	movl	%eax, %r15d
	movl	%r12d, %edi
	callq	_volume_mod_to_gb_ch3
	movl	%eax, %r14d
	orl	%r15d, %r14d
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	jmp	LBB0_20
LBB0_4:
	movl	%ecx, %r13d
	movl	%edx, %ebx
	addl	$8, %r13d
	andl	$15, %r13d
	cmpl	$12, %r14d
	jne	LBB0_6
## %bb.5:
	movl	$7, %edi
	callq	_BIT
	movl	%eax, %r14d
	orl	%ebx, %r14d
	movl	%r12d, %edi
	callq	_volume_mod_to_gb_ch3
	movl	%eax, %ebx
	shll	$4, %ebx
	orl	%r13d, %ebx
	movl	$2, %r13d
	xorl	%r15d, %r15d
	jmp	LBB0_20
LBB0_6:
	leaq	-52(%rbp), %rax
	movq	%rax, (%rsp)
	leaq	-48(%rbp), %r9
	movl	%edi, %r15d
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	$3, %edx
	movl	%r14d, %ecx
	movl	%r12d, %r8d
	callq	_effect_mod_to_gb
	cmpl	$1, %eax
	jne	LBB0_12
## %bb.7:
	cmpl	$8, -48(%rbp)
	jl	LBB0_17
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r15d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r14d, %ecx
	movl	%r12d, %r8d
	xorl	%eax, %eax
	callq	_printf
	movl	$1, %r13d
	jmp	LBB0_14
LBB0_10:
	leaq	-52(%rbp), %rax
	movq	%rax, (%rsp)
	leaq	-48(%rbp), %r9
	movl	%edi, -56(%rbp)                 ## 4-byte Spill
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	$3, %edx
	movl	%r14d, %ecx
	movl	%r12d, %r8d
	callq	_effect_mod_to_gb
	cmpl	$1, %eax
	jne	LBB0_15
## %bb.11:
	movl	$6, %edi
	callq	_BIT
	movl	%eax, %r14d
	orl	-48(%rbp), %r14d
	movl	$2, %r13d
	movl	-52(%rbp), %ebx
	jmp	LBB0_20
LBB0_12:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r15d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r14d, %ecx
	movl	%r12d, %r8d
	xorl	%eax, %eax
	callq	_printf
	movl	$1, %r13d
	testl	%r14d, %r14d
	jne	LBB0_14
## %bb.13:
	leaq	L_str(%rip), %rdi
	callq	_puts
LBB0_14:
	xorl	%r15d, %r15d
	jmp	LBB0_19
LBB0_15:
	movl	$1, %r13d
	testl	%r14d, %r14d
	je	LBB0_18
## %bb.16:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r14d, %ecx
	movl	%r12d, %r8d
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_19
LBB0_18:
	xorl	%ebx, %ebx
LBB0_19:
	xorl	%r14d, %r14d
LBB0_20:
	leaq	L_.str.3(%rip), %rdi
	callq	_out_write_str
	movl	%r14d, %edi
	callq	_out_write_hex
	cmpl	$2, %r13d
	jb	LBB0_23
## %bb.21:
	leaq	L_.str.4(%rip), %rdi
	callq	_out_write_str
	movl	%ebx, %edi
	callq	_out_write_hex
	cmpl	$2, %r13d
	je	LBB0_23
## %bb.22:
	leaq	L_.str.4(%rip), %rdi
	callq	_out_write_str
	movl	%r15d, %edi
	callq	_out_write_hex
LBB0_23:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movl	$7, %edi
	callq	_BIT
	movl	%eax, %r14d
	orl	%ebx, %r14d
	movl	$7, %edi
	callq	_BIT
	movl	%eax, %ebx
	movl	-48(%rbp), %eax
	shll	$4, %eax
	orl	%r13d, %ebx
	orl	%eax, %ebx
	movl	$3, %r13d
	movl	-52(%rbp), %r15d
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid command at pattern %d, step %d, channel 3: %01X%02X\n"

L_.str.1:                               ## @.str.1
	.asciz	"Invalid command at pattern %d, step %d, channel 3: %01X%02X\nOnly 0-7 allowed in this mode.\n"

L_.str.3:                               ## @.str.3
	.asciz	"0x"

L_.str.4:                               ## @.str.4
	.asciz	",0x"

L_str:                                  ## @str
	.asciz	"Volume must be set when using a note."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_convert_channel3               ; -- Begin function convert_channel3
	.p2align	2
_convert_channel3:                      ; @convert_channel3
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x21, x5
	mov	x22, x4
	mov	x23, x1
	mov	x20, x0
	cmp	w2, #72
	b.lt	LBB0_4
; %bb.1:
	orr	w8, w21, w22
	cbz	w8, LBB0_13
; %bb.2:
	cmp	w22, #12
	b.ne	LBB0_9
; %bb.3:
	mov	w0, #5
	bl	_BIT
	mov	x20, x0
	mov	x0, x21
	bl	_volume_mod_to_gb_ch3
	mov	w19, #0
	mov	w21, #0
	orr	w20, w0, w20
	b	LBB0_14
LBB0_4:
	mov	x24, x2
	add	w8, w3, #8
	and	w19, w8, #0xf
	cmp	w22, #12
	b.ne	LBB0_6
; %bb.5:
	mov	w0, #7
	bl	_BIT
	orr	w20, w0, w24
	mov	x0, x21
	bl	_volume_mod_to_gb_ch3
	mov	w21, #0
	bfi	w19, w0, #4, #28
	mov	w22, #2
	b	LBB0_15
LBB0_6:
	add	x5, sp, #44
	add	x6, sp, #40
	mov	x0, x20
	mov	x1, x23
	mov	w2, #3
	mov	x3, x22
	mov	x4, x21
	bl	_effect_mod_to_gb
	cmp	w0, #1
	b.ne	LBB0_11
; %bb.7:
	ldr	w8, [sp, #44]
	cmp	w8, #8
	b.lt	LBB0_22
; %bb.8:
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	stp	x22, x21, [sp, #16]
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	stp	x20, x23, [sp]
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	b	LBB0_13
LBB0_9:
	add	x5, sp, #44
	add	x6, sp, #40
	mov	x0, x20
	mov	x1, x23
	mov	w2, #3
	mov	x3, x22
	mov	x4, x21
	bl	_effect_mod_to_gb
	cmp	w0, #1
	b.ne	LBB0_19
; %bb.10:
	mov	w0, #6
	bl	_BIT
	ldp	w19, w8, [sp, #40]
	orr	w20, w8, w0
	mov	w22, #2
	mov	w21, #0
	b	LBB0_15
LBB0_11:
	stp	x22, x21, [sp, #16]
	stp	x20, x23, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	cbnz	w22, LBB0_13
; %bb.12:
Lloh4:
	adrp	x0, l_str@PAGE
Lloh5:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
LBB0_13:
	mov	w19, #0
	mov	w21, #0
	mov	w20, #0
LBB0_14:
	mov	w22, #1
LBB0_15:
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_out_write_str
	mov	x0, x20
	bl	_out_write_hex
	cmp	w22, #2
	b.lo	LBB0_18
; %bb.16:
Lloh8:
	adrp	x0, l_.str.4@PAGE
Lloh9:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_out_write_str
	mov	x0, x19
	bl	_out_write_hex
	cmp	w22, #2
	b.eq	LBB0_18
; %bb.17:
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_out_write_str
	mov	x0, x21
	bl	_out_write_hex
LBB0_18:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_19:
	cbz	w22, LBB0_21
; %bb.20:
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	stp	x22, x21, [sp, #16]
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	stp	x20, x23, [sp]
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
LBB0_21:
	mov	w19, #0
	mov	w20, #0
	mov	w22, #1
	mov	w21, #0
	b	LBB0_15
LBB0_22:
	mov	w0, #7
	bl	_BIT
	orr	w20, w0, w24
	mov	w0, #7
	bl	_BIT
	ldp	w21, w8, [sp, #40]
	orr	w9, w0, w19
	orr	w19, w9, w8, lsl #4
	mov	w22, #3
	b	LBB0_15
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid command at pattern %d, step %d, channel 3: %01X%02X\n"

l_.str.1:                               ; @.str.1
	.asciz	"Invalid command at pattern %d, step %d, channel 3: %01X%02X\nOnly 0-7 allowed in this mode.\n"

l_.str.3:                               ; @.str.3
	.asciz	"0x"

l_.str.4:                               ; @.str.4
	.asciz	",0x"

l_str:                                  ; @str
	.asciz	"Volume must be set when using a note."

.subsections_via_symbols
