	.file	"extr_core.c_pwmchip_add_with_polarity.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	pwmchip_add_with_polarity
	.type	pwmchip_add_with_polarity, @function
pwmchip_add_with_polarity:
.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
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	test	rdi, rdi
	je	.L31
	mov	edx, DWORD PTR 32[rdi]
	mov	rbp, rdi
	test	edx, edx
	je	.L31
	mov	rdi, QWORD PTR 16[rdi]
	test	rdi, rdi
	je	.L31
	mov	eax, DWORD PTR 0[rbp]
	test	eax, eax
	je	.L31
	mov	ebx, esi
	call	pwm_ops_check@PLT
	test	eax, eax
	jne	.L5
	.p2align 4,,10
	.p2align 3
.L31:
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L5:
	.cfi_restore_state
	lea	rdi, pwm_lock[rip]
	call	mutex_lock@PLT
	mov	edi, DWORD PTR 4[rbp]
	mov	esi, DWORD PTR 0[rbp]
	call	alloc_pwms@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L6
	mov	edx, DWORD PTR GFP_KERNEL[rip]
	mov	edi, DWORD PTR 0[rbp]
	mov	esi, 24
	call	kcalloc@PLT
	mov	QWORD PTR 24[rbp], rax
	test	rax, rax
	je	.L33
	mov	edx, DWORD PTR 0[rbp]
	mov	DWORD PTR 4[rbp], r12d
	test	edx, edx
	je	.L9
	xor	r15d, r15d
	lea	r14, pwm_tree[rip]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rax, QWORD PTR 24[rbp]
	mov	r12d, DWORD PTR 4[rbp]
.L12:
	mov	edx, r15d
	lea	esi, [r12+r15]
	lea	rdx, [rdx+rdx*2]
	lea	r13, [rax+rdx*8]
	mov	rax, QWORD PTR 16[rbp]
	mov	QWORD PTR 16[r13], rbp
	mov	rax, QWORD PTR [rax]
	mov	DWORD PTR 0[r13], esi
	mov	DWORD PTR 4[r13], r15d
	mov	DWORD PTR 8[r13], ebx
	test	rax, rax
	je	.L10
	mov	rsi, r13
	lea	rdx, 8[r13]
	mov	rdi, rbp
	call	rax
	mov	esi, DWORD PTR 0[r13]
.L10:
	mov	rdx, r13
	mov	rdi, r14
	add	r15d, 1
	call	radix_tree_insert@PLT
	mov	edx, DWORD PTR 0[rbp]
	cmp	edx, r15d
	ja	.L11
	mov	r12d, DWORD PTR 4[rbp]
.L9:
	mov	edi, DWORD PTR allocated_pwms[rip]
	mov	esi, r12d
	lea	r12, 8[rbp]
	call	bitmap_set@PLT
	mov	rdi, r12
	call	INIT_LIST_HEAD@PLT
	mov	rdi, r12
	lea	rsi, pwm_chips[rip]
	call	list_add@PLT
	mov	edi, DWORD PTR CONFIG_OF[rip]
	call	IS_ENABLED@PLT
	test	rax, rax
	jne	.L13
.L30:
	lea	rdi, pwm_lock[rip]
	call	mutex_unlock@PLT
.L8:
	mov	rdi, rbp
	xor	r12d, r12d
	call	pwmchip_sysfs_export@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rdi, rbp
	call	of_pwmchip_add@PLT
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L6:
	lea	rdi, pwm_lock[rip]
	call	mutex_unlock@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L33:
	mov	ebx, DWORD PTR ENOMEM[rip]
	lea	rdi, pwm_lock[rip]
	mov	r12d, ebx
	neg	r12d
	call	mutex_unlock@PLT
	test	ebx, ebx
	jne	.L1
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	pwmchip_add_with_polarity, .-pwmchip_add_with_polarity
	.comm	pwm_tree,4,4
	.comm	pwm_lock,4,4
	.comm	pwm_chips,4,4
	.comm	allocated_pwms,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.comm	CONFIG_OF,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_core.c_pwmchip_add_with_polarity.c"
	.text
	.align	2
	.global	pwmchip_add_with_polarity
	.syntax unified
	.arm
	.fpu softvfp
	.type	pwmchip_add_with_polarity, %function
pwmchip_add_with_polarity:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	subs	r4, r0, #0
	beq	.L34
	ldr	r3, [r4, #20]
	cmp	r3, #0
	beq	.L34
	ldr	r0, [r4, #12]
	cmp	r0, #0
	beq	.L34
	ldr	r3, [r4]
	cmp	r3, #0
	beq	.L34
	mov	r7, r1
	bl	pwm_ops_check
	cmp	r0, #0
	bne	.L5
.L34:
	ldr	r3, .L37
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L5:
	ldr	r0, .L37+4
	bl	mutex_lock
	ldr	r1, [r4]
	ldr	r0, [r4, #4]
	bl	alloc_pwms
	subs	r5, r0, #0
	blt	.L6
	ldr	r3, .L37+8
	mov	r1, #16
	ldr	r2, [r3]
	ldr	r0, [r4]
	bl	kcalloc
	cmp	r0, #0
	mov	r9, r0
	str	r0, [r4, #16]
	beq	.L36
	ldr	r2, [r4]
	str	r5, [r4, #4]
	cmp	r2, #0
	beq	.L9
	mov	r8, #0
	ldr	r10, .L37+12
	b	.L12
.L11:
	ldr	r9, [r4, #16]
	ldr	r5, [r4, #4]
.L12:
	ldr	r3, [r4, #12]
	add	r6, r9, r8, lsl #4
	ldr	r3, [r3]
	add	r1, r5, r8
	cmp	r3, #0
	str	r4, [r6, #12]
	str	r1, [r9, r8, lsl #4]
	str	r8, [r6, #4]
	str	r7, [r6, #8]
	beq	.L10
	mov	r1, r6
	mov	r0, r4
	add	r2, r6, #8
	blx	r3
	ldr	r1, [r9, r8, lsl #4]
.L10:
	mov	r2, r6
	mov	r0, r10
	bl	radix_tree_insert
	ldr	r2, [r4]
	add	r8, r8, #1
	cmp	r2, r8
	bhi	.L11
	ldr	r5, [r4, #4]
.L9:
	ldr	r3, .L37+16
	mov	r1, r5
	ldr	r0, [r3]
	add	r5, r4, #8
	bl	bitmap_set
	mov	r0, r5
	bl	INIT_LIST_HEAD
	ldr	r1, .L37+20
	mov	r0, r5
	bl	list_add
	ldr	r3, .L37+24
	ldr	r0, [r3]
	bl	IS_ENABLED
	cmp	r0, #0
	bne	.L13
.L33:
	ldr	r0, .L37+4
	bl	mutex_unlock
.L8:
	mov	r0, r4
	bl	pwmchip_sysfs_export
	mov	r5, #0
	b	.L1
.L13:
	mov	r0, r4
	bl	of_pwmchip_add
	b	.L33
.L6:
	ldr	r0, .L37+4
	bl	mutex_unlock
	b	.L1
.L36:
	ldr	r3, .L37+28
	ldr	r0, .L37+4
	ldr	r5, [r3]
	bl	mutex_unlock
	cmp	r5, #0
	rsb	r5, r5, #0
	bne	.L1
	b	.L8
.L38:
	.align	2
.L37:
	.word	EINVAL
	.word	pwm_lock
	.word	GFP_KERNEL
	.word	pwm_tree
	.word	allocated_pwms
	.word	pwm_chips
	.word	CONFIG_OF
	.word	ENOMEM
	.size	pwmchip_add_with_polarity, .-pwmchip_add_with_polarity
	.comm	pwm_tree,4,4
	.comm	pwm_lock,4,4
	.comm	pwm_chips,4,4
	.comm	allocated_pwms,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.comm	CONFIG_OF,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
