	.file	"955016.c"
	.intel_syntax noprefix
	.text
	.globl	c16rtomb
	.type	c16rtomb, @function
c16rtomb:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	eax, esi
	mov	QWORD PTR -40[rbp], rdx
	mov	WORD PTR -28[rbp], ax
	cmp	QWORD PTR -40[rbp], 0
	jne	.L2
	lea	rax, internal_state.0[rip]
	mov	QWORD PTR -40[rbp], rax
.L2:
	mov	rax, QWORD PTR -40[rbp]
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L3
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L11
	mov	eax, 1
	jmp	.L6
.L3:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jne	.L7
	movzx	eax, WORD PTR -28[rbp]
	sub	eax, 55296
	cmp	eax, 1023
	ja	.L7
	movzx	eax, WORD PTR -28[rbp]
	sub	eax, 55232
	sal	eax, 10
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], edx
	mov	eax, 0
	jmp	.L6
.L7:
	mov	rax, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	je	.L8
	movzx	eax, WORD PTR -28[rbp]
	sub	eax, 56320
	cmp	eax, 1023
	ja	.L12
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, DWORD PTR [rax]
	movzx	eax, WORD PTR -28[rbp]
	add	eax, edx
	sub	eax, 56320
	mov	DWORD PTR -12[rbp], eax
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], 0
	jmp	.L10
.L8:
	movzx	eax, WORD PTR -28[rbp]
	mov	DWORD PTR -12[rbp], eax
.L10:
	mov	ecx, DWORD PTR -12[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	edx, 0
	mov	esi, ecx
	mov	rdi, rax
	call	wcrtomb@PLT
	jmp	.L6
.L11:
	nop
	jmp	.L5
.L12:
	nop
.L5:
	mov	rax, QWORD PTR -8[rbp]
	mov	DWORD PTR [rax], 0
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 84
	mov	rax, -1
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	c16rtomb, .-c16rtomb
	.local	internal_state.0
	.comm	internal_state.0,4,4
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"955016.c"
	.text
	.align	2
	.global	c16rtomb
	.syntax unified
	.arm
	.fpu softvfp
	.type	c16rtomb, %function
c16rtomb:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-16]
	mov	r3, r1
	str	r2, [fp, #-24]
	strh	r3, [fp, #-18]	@ movhi
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L2
	ldr	r3, .L13
	str	r3, [fp, #-24]
.L2:
	ldr	r3, [fp, #-24]
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L3
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L11
	mov	r3, #1
	b	.L6
.L3:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L7
	ldrh	r3, [fp, #-18]
	sub	r3, r3, #55296
	cmp	r3, #1024
	bcs	.L7
	ldrh	r3, [fp, #-18]
	sub	r3, r3, #55040
	sub	r3, r3, #192
	lsl	r3, r3, #10
	mov	r2, r3
	ldr	r3, [fp, #-8]
	str	r2, [r3]
	mov	r3, #0
	b	.L6
.L7:
	ldr	r3, [fp, #-8]
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L8
	ldrh	r3, [fp, #-18]
	sub	r3, r3, #56320
	cmp	r3, #1024
	bcs	.L12
	ldr	r3, [fp, #-8]
	ldr	r2, [r3]
	ldrh	r3, [fp, #-18]
	add	r3, r2, r3
	sub	r3, r3, #56320
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3]
	b	.L10
.L8:
	ldrh	r3, [fp, #-18]
	str	r3, [fp, #-12]
.L10:
	mov	r2, #0
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-16]
	bl	wcrtomb
	mov	r3, r0
	b	.L6
.L11:
	nop
	b	.L5
.L12:
	nop
.L5:
	ldr	r3, [fp, #-8]
	mov	r2, #0
	str	r2, [r3]
	bl	__errno_location
	mov	r3, r0
	mov	r2, #84
	str	r2, [r3]
	mvn	r3, #0
.L6:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	internal_state.4597
	.size	c16rtomb, .-c16rtomb
	.local	internal_state.4597
	.comm	internal_state.4597,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
