	.file	"extr_rec_layer_d1.c_dtls1_buffer_record.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	dtls1_buffer_record
	.type	dtls1_buffer_record, @function
dtls1_buffer_record:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xor	r13d, r13d
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	edi, DWORD PTR [rsi]
	call	pqueue_size@PLT
	cmp	eax, 99
	jle	.L16
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	mov	edi, 40
	call	OPENSSL_malloc@PLT
	mov	rdi, r14
	mov	rsi, rax
	mov	r12, rax
	call	pitem_new@PLT
	mov	r14, rax
	test	r12, r12
	je	.L13
	test	rax, rax
	je	.L13
	mov	rax, QWORD PTR 16[rbp]
	lea	r13, 4[rbp]
	mov	edx, 4
	mov	rdi, r12
	mov	rsi, r13
	mov	QWORD PTR 32[r12], rax
	mov	rax, QWORD PTR 8[rbp]
	mov	QWORD PTR 24[r12], rax
	call	memcpy@PLT
	lea	rdi, 16[r12]
	mov	edx, 4
	mov	rsi, rbp
	call	memcpy@PLT
	mov	QWORD PTR [r14], r12
	mov	rdi, rbp
	call	SSL_get_rbio@PLT
	mov	edi, eax
	call	BIO_dgram_is_sctp@PLT
	test	rax, rax
	jne	.L17
.L6:
	mov	QWORD PTR 16[rbp], 0
	xor	esi, esi
	mov	edx, 4
	mov	rdi, r13
	mov	QWORD PTR 8[rbp], 0
	call	memset@PLT
	xor	esi, esi
	mov	rdi, rbp
	mov	edx, 4
	call	memset@PLT
	mov	rdi, rbp
	call	ssl3_setup_buffers@PLT
	test	eax, eax
	je	.L18
	mov	edi, DWORD PTR [rbx]
	mov	rsi, r14
	mov	r13d, 1
	call	pqueue_insert@PLT
	test	rax, rax
	jne	.L1
	mov	rdi, QWORD PTR [r12]
	call	OPENSSL_free@PLT
	mov	rdi, r12
	call	OPENSSL_free@PLT
	mov	rdi, r14
	call	pitem_free@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rdi, r12
	mov	r13d, -1
	call	OPENSSL_free@PLT
	mov	rdi, r14
	call	pitem_free@PLT
	mov	ecx, DWORD PTR ERR_R_INTERNAL_ERROR[rip]
	mov	edx, DWORD PTR SSL_F_DTLS1_BUFFER_RECORD[rip]
	mov	rdi, rbp
	mov	esi, DWORD PTR SSL_AD_INTERNAL_ERROR[rip]
	call	SSLfatal@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rdi, QWORD PTR [r12]
	mov	r13d, -1
	call	OPENSSL_free@PLT
	mov	rdi, r12
	call	OPENSSL_free@PLT
	mov	rdi, r14
	call	pitem_free@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	mov	rdi, rbp
	call	SSL_get_state@PLT
	cmp	rax, QWORD PTR TLS_ST_SR_FINISHED[rip]
	je	.L8
	mov	rdi, rbp
	call	SSL_get_state@PLT
	cmp	rax, QWORD PTR TLS_ST_CR_FINISHED[rip]
	jne	.L6
.L8:
	mov	r15d, DWORD PTR BIO_CTRL_DGRAM_SCTP_GET_RCVINFO[rip]
	mov	rdi, rbp
	call	SSL_get_rbio@PLT
	lea	rcx, 8[r12]
	mov	edx, 4
	mov	edi, eax
	mov	esi, r15d
	call	BIO_ctrl@PLT
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	dtls1_buffer_record, .-dtls1_buffer_record
	.comm	TLS_ST_SR_FINISHED,8,8
	.comm	TLS_ST_CR_FINISHED,8,8
	.comm	SSL_F_DTLS1_BUFFER_RECORD,4,4
	.comm	SSL_AD_INTERNAL_ERROR,4,4
	.comm	ERR_R_INTERNAL_ERROR,4,4
	.comm	BIO_CTRL_DGRAM_SCTP_GET_RCVINFO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_rec_layer_d1.c_dtls1_buffer_record.c"
	.text
	.align	2
	.global	dtls1_buffer_record
	.syntax unified
	.arm
	.fpu softvfp
	.type	dtls1_buffer_record, %function
dtls1_buffer_record:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	ldr	r0, [r1]
	mov	r7, r1
	mov	r6, r2
	bl	pqueue_size
	cmp	r0, #99
	ble	.L14
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L14:
	mov	r0, #20
	bl	OPENSSL_malloc
	mov	r5, r0
	mov	r0, r6
	mov	r1, r5
	bl	pitem_new
	cmp	r0, #0
	cmpne	r5, #0
	mov	r8, r0
	beq	.L15
	ldr	r3, [r4, #8]
	ldr	r2, [r4, #12]
	add	r6, r4, #4
	str	r3, [r5, #12]
	mov	r1, r6
	str	r2, [r5, #16]
	mov	r0, r5
	mov	r2, #4
	bl	memcpy
	mov	r2, #4
	mov	r1, r4
	add	r0, r5, #8
	bl	memcpy
	mov	r0, r4
	str	r5, [r8]
	bl	SSL_get_rbio
	bl	BIO_dgram_is_sctp
	cmp	r0, #0
	bne	.L16
.L5:
	mov	r3, #0
	mov	r0, r4
	str	r3, [r4, #12]
	str	r3, [r4, #8]
	strb	r3, [r4, #4]
	strb	r3, [r6, #1]
	strb	r3, [r6, #2]
	strb	r3, [r6, #3]
	strb	r3, [r4]
	strb	r3, [r4, #1]
	strb	r3, [r4, #2]
	strb	r3, [r4, #3]
	bl	ssl3_setup_buffers
	cmp	r0, #0
	beq	.L17
	mov	r1, r8
	ldr	r0, [r7]
	bl	pqueue_insert
	cmp	r0, #0
	beq	.L18
	mov	r0, #1
	pop	{r4, r5, r6, r7, r8, pc}
.L15:
	mov	r0, r5
	bl	OPENSSL_free
	mov	r0, r8
	bl	pitem_free
	ldr	r3, .L19
	ldr	r2, .L19+4
	ldr	r1, .L19+8
	mov	r0, r4
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	bl	SSLfatal
	mvn	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L17:
	ldr	r0, [r5]
	bl	OPENSSL_free
	mov	r0, r5
	bl	OPENSSL_free
	mov	r0, r8
	bl	pitem_free
	mvn	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L16:
	mov	r0, r4
	bl	SSL_get_state
	ldr	r3, .L19+12
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L7
	mov	r0, r4
	bl	SSL_get_state
	ldr	r3, .L19+16
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L5
.L7:
	mov	r0, r4
	bl	SSL_get_rbio
	ldr	r2, .L19+20
	add	r3, r5, #4
	ldr	r1, [r2]
	mov	r2, #4
	bl	BIO_ctrl
	b	.L5
.L18:
	ldr	r0, [r5]
	bl	OPENSSL_free
	mov	r0, r5
	bl	OPENSSL_free
	mov	r0, r8
	bl	pitem_free
	mov	r0, #1
	pop	{r4, r5, r6, r7, r8, pc}
.L20:
	.align	2
.L19:
	.word	ERR_R_INTERNAL_ERROR
	.word	SSL_F_DTLS1_BUFFER_RECORD
	.word	SSL_AD_INTERNAL_ERROR
	.word	TLS_ST_SR_FINISHED
	.word	TLS_ST_CR_FINISHED
	.word	BIO_CTRL_DGRAM_SCTP_GET_RCVINFO
	.size	dtls1_buffer_record, .-dtls1_buffer_record
	.comm	TLS_ST_SR_FINISHED,4,4
	.comm	TLS_ST_CR_FINISHED,4,4
	.comm	SSL_F_DTLS1_BUFFER_RECORD,4,4
	.comm	SSL_AD_INTERNAL_ERROR,4,4
	.comm	ERR_R_INTERNAL_ERROR,4,4
	.comm	BIO_CTRL_DGRAM_SCTP_GET_RCVINFO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
