	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ir_sony_encode
_ir_sony_encode:                        ## @ir_sony_encode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdx, %rbx
	movl	%esi, %r8d
	movq	%rdx, -16(%rbp)
	movq	_RC_PROTO_SONY12@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jne	LBB0_2
## %bb.1:
	movl	%r8d, %eax
	andl	$127, %eax
	shrl	$9, %r8d
	andl	$3968, %r8d                     ## imm = 0xF80
	orl	%eax, %r8d
	movl	$12, %eax
	jmp	LBB0_5
LBB0_2:
	movq	_RC_PROTO_SONY15@GOTPCREL(%rip), %rsi
	movl	%r8d, %eax
	andl	$127, %eax
	movl	%r8d, %edx
	shrl	$9, %edx
	cmpl	%edi, (%rsi)
	jne	LBB0_4
## %bb.3:
	andl	$32640, %edx                    ## imm = 0x7F80
	orl	%eax, %edx
	movl	$15, %eax
	movl	%edx, %r8d
	jmp	LBB0_5
LBB0_4:
	andl	$3968, %edx                     ## imm = 0xF80
	orl	%eax, %edx
	shll	$4, %r8d
	andl	$1044480, %r8d                  ## imm = 0xFF000
	orl	%edx, %r8d
	movl	$20, %eax
LBB0_5:
	movq	_ir_sony_timings@GOTPCREL(%rip), %rdx
	leaq	-16(%rbp), %rdi
	movl	%ecx, %esi
	movl	%eax, %ecx
	callq	_ir_raw_gen_pl
	movq	-16(%rbp), %rcx
	subq	%rbx, %rcx
	shrq	$2, %rcx
	testl	%eax, %eax
	cmovnsl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RC_PROTO_SONY12,4,2            ## @RC_PROTO_SONY12
	.comm	_RC_PROTO_SONY15,4,2            ## @RC_PROTO_SONY15
	.comm	_ir_sony_timings,4,2            ## @ir_sony_timings
	.no_dead_strip	_ir_sony_encode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ir_sony_encode
_ir_sony_encode:                        ; @ir_sony_encode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x8, x3
	mov	x19, x2
	str	x2, [sp, #8]
Lloh0:
	adrp	x9, _RC_PROTO_SONY12@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RC_PROTO_SONY12@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w9, w0
	b.ne	LBB0_2
; %bb.1:
	lsr	w9, w1, #9
	and	w4, w9, #0xf80
	bfxil	w4, w1, #0, #7
	mov	w3, #12
	b	LBB0_3
LBB0_2:
Lloh3:
	adrp	x9, _RC_PROTO_SONY15@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RC_PROTO_SONY15@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	and	w10, w1, #0x7f
	lsr	w11, w1, #9
	and	w12, w11, #0xf80
	orr	w12, w12, w10
	lsr	w13, w1, #8
	bfi	w12, w13, #12, #8
	mov	w13, #20
	and	w11, w11, #0x7f80
	orr	w10, w11, w10
	mov	w11, #15
	cmp	w9, w0
	csel	w4, w12, w10, ne
	csel	w3, w13, w11, ne
LBB0_3:
Lloh6:
	adrp	x2, _ir_sony_timings@GOTPAGE
Lloh7:
	ldr	x2, [x2, _ir_sony_timings@GOTPAGEOFF]
	add	x0, sp, #8
	mov	x1, x8
	bl	_ir_raw_gen_pl
	ldr	x8, [sp, #8]
	sub	x8, x8, x19
	lsr	x8, x8, #2
	cmp	w0, #0
	csel	w0, w0, w8, lt
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_RC_PROTO_SONY12,4,2            ; @RC_PROTO_SONY12
	.comm	_RC_PROTO_SONY15,4,2            ; @RC_PROTO_SONY15
	.comm	_ir_sony_timings,4,2            ; @ir_sony_timings
	.no_dead_strip	_ir_sony_encode
.subsections_via_symbols
