	.file	"extr_mcpwm.c_mcpwm_set_duty_type.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	mcpwm_set_duty_type
	.type	mcpwm_set_duty_type, @function
mcpwm_set_duty_type:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rcx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdx
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	edx, DWORD PTR ESP_ERR_INVALID_ARG[rip]
	mov	esi, DWORD PTR MCPWM_UNIT_NUM_ERROR[rip]
	cmp	QWORD PTR MCPWM_UNIT_MAX[rip], rdi
	seta	dil
	movzx	edi, dil
	call	MCPWM_CHECK@PLT
	mov	edx, DWORD PTR ESP_ERR_INVALID_ARG[rip]
	mov	esi, DWORD PTR MCPWM_TIMER_ERROR[rip]
	xor	edi, edi
	cmp	QWORD PTR MCPWM_TIMER_MAX[rip], rbp
	seta	dil
	call	MCPWM_CHECK@PLT
	mov	edx, DWORD PTR ESP_ERR_INVALID_ARG[rip]
	mov	esi, DWORD PTR MCPWM_OP_ERROR[rip]
	xor	edi, edi
	cmp	QWORD PTR MCPWM_OPR_MAX[rip], rbx
	seta	dil
	call	MCPWM_CHECK@PLT
	mov	edx, DWORD PTR ESP_ERR_INVALID_ARG[rip]
	mov	esi, DWORD PTR MCPWM_DUTY_TYPE_ERROR[rip]
	xor	edi, edi
	cmp	QWORD PTR MCPWM_DUTY_MODE_MAX[rip], r12
	setg	dil
	call	MCPWM_CHECK@PLT
	lea	rdi, mcpwm_spinlock[rip]
	call	portENTER_CRITICAL@PLT
	cmp	QWORD PTR MCPWM_OPR_A[rip], rbx
	je	.L21
	cmp	QWORD PTR MCPWM_OPR_B[rip], rbx
	je	.L22
.L16:
	lea	rdi, mcpwm_spinlock[rip]
	call	portEXIT_CRITICAL@PLT
	mov	eax, DWORD PTR ESP_OK[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	mov	rax, QWORD PTR MCPWM[rip]
	lea	rcx, [rbx+rbx*4]
	mov	rsi, QWORD PTR MCPWM_DUTY_MODE_1[rip]
	mov	rax, QWORD PTR [rax+r13*8]
	mov	rdx, QWORD PTR 8[rax]
	mov	rax, QWORD PTR [rax]
	mov	rax, QWORD PTR [rax+rbp*8]
	mov	rdx, QWORD PTR [rdx+rbp*8]
	cmp	rdx, QWORD PTR MCPWM_UP_COUNTER[rip]
	lea	rax, [rax+rcx*8]
	je	.L23
	cmp	rdx, QWORD PTR MCPWM_DOWN_COUNTER[rip]
	je	.L24
	cmp	r12, rsi
	je	.L13
.L14:
	movabs	rbx, 8589934593
	mov	DWORD PTR [rax], 2
	mov	QWORD PTR 16[rax], rbx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L21:
	mov	rax, QWORD PTR MCPWM[rip]
	mov	rsi, QWORD PTR MCPWM_DUTY_MODE_1[rip]
	mov	rax, QWORD PTR [rax+r13*8]
	mov	rcx, QWORD PTR [rax]
	mov	rdx, QWORD PTR 8[rax]
	lea	rax, [rbx+rbx*4]
	mov	rcx, QWORD PTR [rcx+rbp*8]
	mov	rdx, QWORD PTR [rdx+rbp*8]
	cmp	rdx, QWORD PTR MCPWM_UP_COUNTER[rip]
	lea	rax, [rcx+rax*8]
	je	.L25
	cmp	rdx, QWORD PTR MCPWM_DOWN_COUNTER[rip]
	je	.L26
	cmp	r12, rsi
	je	.L27
	cmp	rbx, QWORD PTR MCPWM_OPR_B[rip]
	mov	DWORD PTR 12[rax], 2
	movabs	rcx, 4294967298
	mov	QWORD PTR [rax], rcx
	jne	.L16
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L26:
	cmp	r12, rsi
	je	.L28
	cmp	rbx, QWORD PTR MCPWM_OPR_B[rip]
	mov	QWORD PTR 24[rax], 0
	movabs	rcx, 8589934593
	mov	QWORD PTR 8[rax], rcx
	jne	.L16
.L11:
	mov	DWORD PTR 8[rax], 1
	mov	DWORD PTR 20[rax], 2
	mov	QWORD PTR 24[rax], 0
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L23:
	cmp	r12, rsi
	je	.L5
.L7:
	mov	DWORD PTR [rax], 2
	mov	DWORD PTR 16[rax], 1
	mov	QWORD PTR 32[rax], 0
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L25:
	cmp	r12, rsi
	je	.L29
	cmp	rbx, QWORD PTR MCPWM_OPR_B[rip]
	mov	QWORD PTR 32[rax], 0
	movabs	rcx, 4294967298
	mov	QWORD PTR [rax], rcx
	jne	.L16
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L27:
	cmp	QWORD PTR MCPWM_OPR_B[rip], rbx
	mov	DWORD PTR 12[rax], 1
	movabs	rcx, 8589934593
	mov	QWORD PTR [rax], rcx
	jne	.L16
.L13:
	movabs	rbx, 4294967298
	mov	DWORD PTR [rax], 1
	mov	QWORD PTR 16[rax], rbx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L24:
	cmp	r12, rsi
	jne	.L11
.L10:
	mov	DWORD PTR 8[rax], 2
	mov	DWORD PTR 20[rax], 1
	mov	QWORD PTR 24[rax], 0
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L29:
	cmp	rbx, QWORD PTR MCPWM_OPR_B[rip]
	mov	QWORD PTR 32[rax], 0
	movabs	rcx, 8589934593
	mov	QWORD PTR [rax], rcx
	jne	.L16
.L5:
	mov	DWORD PTR [rax], 1
	mov	DWORD PTR 16[rax], 2
	mov	QWORD PTR 32[rax], 0
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L28:
	cmp	rbx, QWORD PTR MCPWM_OPR_B[rip]
	mov	QWORD PTR 24[rax], 0
	movabs	rcx, 4294967298
	mov	QWORD PTR 8[rax], rcx
	jne	.L16
	jmp	.L10
	.cfi_endproc
.LFE0:
	.size	mcpwm_set_duty_type, .-mcpwm_set_duty_type
	.comm	mcpwm_spinlock,4,4
	.comm	MCPWM_UP_COUNTER,8,8
	.comm	MCPWM_UNIT_NUM_ERROR,4,4
	.comm	MCPWM_UNIT_MAX,8,8
	.comm	MCPWM_TIMER_MAX,8,8
	.comm	MCPWM_TIMER_ERROR,4,4
	.comm	MCPWM_OP_ERROR,4,4
	.comm	MCPWM_OPR_MAX,8,8
	.comm	MCPWM_OPR_B,8,8
	.comm	MCPWM_OPR_A,8,8
	.comm	MCPWM_DUTY_TYPE_ERROR,4,4
	.comm	MCPWM_DUTY_MODE_MAX,8,8
	.comm	MCPWM_DUTY_MODE_1,8,8
	.comm	MCPWM_DOWN_COUNTER,8,8
	.comm	MCPWM,8,8
	.comm	ESP_OK,4,4
	.comm	ESP_ERR_INVALID_ARG,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_mcpwm.c_mcpwm_set_duty_type.c"
	.text
	.align	2
	.global	mcpwm_set_duty_type
	.syntax unified
	.arm
	.fpu softvfp
	.type	mcpwm_set_duty_type, %function
mcpwm_set_duty_type:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r7, r0
	mov	r5, r1
	mov	r4, r2
	mov	r8, r3
	ldr	r3, .L30
	ldr	r6, .L30+4
	ldr	r0, [r3]
	ldr	r3, .L30+8
	cmp	r0, r7
	ldr	r1, [r3]
	movls	r0, #0
	movhi	r0, #1
	ldr	r2, [r6]
	bl	MCPWM_CHECK
	ldr	r2, .L30+12
	ldr	r3, .L30+16
	ldr	r0, [r2]
	ldr	r1, [r3]
	cmp	r0, r5
	movls	r0, #0
	movhi	r0, #1
	ldr	r2, [r6]
	bl	MCPWM_CHECK
	ldr	r2, .L30+20
	ldr	r3, .L30+24
	ldr	r0, [r2]
	ldr	r1, [r3]
	cmp	r0, r4
	movls	r0, #0
	movhi	r0, #1
	ldr	r2, [r6]
	bl	MCPWM_CHECK
	ldr	r2, .L30+28
	ldr	r3, .L30+32
	ldr	r0, [r2]
	ldr	r1, [r3]
	cmp	r0, r8
	movle	r0, #0
	movgt	r0, #1
	ldr	r2, [r6]
	bl	MCPWM_CHECK
	ldr	r0, .L30+36
	bl	portENTER_CRITICAL
	ldr	r3, .L30+40
	ldr	r3, [r3]
	cmp	r3, r4
	beq	.L21
	ldr	r3, .L30+44
	ldr	r0, [r3]
	cmp	r0, r4
	beq	.L22
.L16:
	ldr	r0, .L30+36
	bl	portEXIT_CRITICAL
	ldr	r3, .L30+48
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, pc}
.L22:
	ldr	r3, .L30+52
	ldr	r2, .L30+56
	ldr	r3, [r3]
	ldr	ip, [r2]
	ldr	r3, [r3, r7, lsl #2]
	ldr	r1, [r3, #4]
	ldr	r2, [r3]
	ldr	r3, [r1, r5, lsl #2]
	ldr	r2, [r2, r5, lsl #2]
	ldr	r1, .L30+60
	cmp	r3, ip
	ldr	r1, [r1]
	add	r2, r2, r0, lsl #5
	beq	.L23
	ldr	r0, .L30+64
	ldr	r0, [r0]
	cmp	r3, r0
	beq	.L24
	cmp	r8, r1
	beq	.L13
.L14:
	mov	r3, #2
	mov	r1, #1
	str	r3, [r2]
	str	r3, [r2, #20]
	str	r1, [r2, #16]
	b	.L16
.L21:
	ldr	r2, .L30+52
	ldr	r1, .L30+56
	ldr	r2, [r2]
	ldr	lr, [r1]
	ldr	r2, [r2, r7, lsl #2]
	ldr	ip, .L30+60
	ldr	r1, [r2, #4]
	ldr	r2, [r2]
	ldr	r0, [r1, r5, lsl #2]
	ldr	r1, [r2, r5, lsl #2]
	cmp	r0, lr
	ldr	ip, [ip]
	add	r2, r1, r3, lsl #5
	beq	.L25
	ldr	lr, .L30+64
	ldr	lr, [lr]
	cmp	r0, lr
	beq	.L26
	cmp	r8, ip
	beq	.L27
	mov	r0, #2
	mov	ip, #1
	ldr	lr, .L30+44
	str	r0, [r1, r3, lsl #5]
	ldr	r1, [lr]
	str	r0, [r2, #12]
	cmp	r3, r1
	str	ip, [r2, #4]
	bne	.L16
	b	.L14
.L26:
	cmp	r8, ip
	beq	.L28
	mov	lr, #1
	mov	ip, #2
	mov	r1, #0
	ldr	r0, .L30+44
	str	lr, [r2, #8]
	ldr	r0, [r0]
	str	ip, [r2, #12]
	cmp	r3, r0
	str	r1, [r2, #24]
	bne	.L16
.L11:
	mov	r0, #1
	mov	r1, #2
	mov	r3, #0
	str	r0, [r2, #8]
	str	r1, [r2, #20]
	str	r3, [r2, #24]
	b	.L16
.L23:
	cmp	r8, r1
	beq	.L5
.L7:
	mov	r0, #2
	mov	r1, #1
	mov	r3, #0
	str	r0, [r2]
	str	r1, [r2, #16]
	str	r3, [r2, #28]
	b	.L16
.L25:
	cmp	r8, ip
	beq	.L29
	mov	r4, #2
	mov	ip, #1
	mov	r0, #0
	ldr	lr, .L30+44
	str	r4, [r1, r3, lsl #5]
	ldr	r1, [lr]
	str	ip, [r2, #4]
	cmp	r3, r1
	str	r0, [r2, #28]
	bne	.L16
	b	.L7
.L27:
	mov	r0, #1
	mov	ip, #2
	ldr	lr, .L30+44
	str	r0, [r1, r3, lsl #5]
	ldr	r1, [lr]
	str	r0, [r2, #12]
	cmp	r1, r3
	str	ip, [r2, #4]
	bne	.L16
.L13:
	mov	r3, #1
	mov	r1, #2
	str	r3, [r2]
	str	r3, [r2, #20]
	str	r1, [r2, #16]
	b	.L16
.L24:
	cmp	r8, r1
	bne	.L11
.L10:
	mov	r0, #2
	mov	r1, #1
	mov	r3, #0
	str	r0, [r2, #8]
	str	r1, [r2, #20]
	str	r3, [r2, #24]
	b	.L16
.L29:
	mov	r4, #1
	mov	ip, #2
	mov	r0, #0
	ldr	lr, .L30+44
	str	r4, [r1, r3, lsl #5]
	ldr	r1, [lr]
	str	ip, [r2, #4]
	cmp	r3, r1
	str	r0, [r2, #28]
	bne	.L16
.L5:
	mov	r0, #1
	mov	r1, #2
	mov	r3, #0
	str	r0, [r2]
	str	r1, [r2, #16]
	str	r3, [r2, #28]
	b	.L16
.L28:
	mov	lr, #2
	mov	ip, #1
	mov	r1, #0
	ldr	r0, .L30+44
	str	lr, [r2, #8]
	ldr	r0, [r0]
	str	ip, [r2, #12]
	cmp	r3, r0
	str	r1, [r2, #24]
	bne	.L16
	b	.L10
.L31:
	.align	2
.L30:
	.word	MCPWM_UNIT_MAX
	.word	ESP_ERR_INVALID_ARG
	.word	MCPWM_UNIT_NUM_ERROR
	.word	MCPWM_TIMER_MAX
	.word	MCPWM_TIMER_ERROR
	.word	MCPWM_OPR_MAX
	.word	MCPWM_OP_ERROR
	.word	MCPWM_DUTY_MODE_MAX
	.word	MCPWM_DUTY_TYPE_ERROR
	.word	mcpwm_spinlock
	.word	MCPWM_OPR_A
	.word	MCPWM_OPR_B
	.word	ESP_OK
	.word	MCPWM
	.word	MCPWM_UP_COUNTER
	.word	MCPWM_DUTY_MODE_1
	.word	MCPWM_DOWN_COUNTER
	.size	mcpwm_set_duty_type, .-mcpwm_set_duty_type
	.comm	mcpwm_spinlock,4,4
	.comm	MCPWM_UP_COUNTER,4,4
	.comm	MCPWM_UNIT_NUM_ERROR,4,4
	.comm	MCPWM_UNIT_MAX,4,4
	.comm	MCPWM_TIMER_MAX,4,4
	.comm	MCPWM_TIMER_ERROR,4,4
	.comm	MCPWM_OP_ERROR,4,4
	.comm	MCPWM_OPR_MAX,4,4
	.comm	MCPWM_OPR_B,4,4
	.comm	MCPWM_OPR_A,4,4
	.comm	MCPWM_DUTY_TYPE_ERROR,4,4
	.comm	MCPWM_DUTY_MODE_MAX,4,4
	.comm	MCPWM_DUTY_MODE_1,4,4
	.comm	MCPWM_DOWN_COUNTER,4,4
	.comm	MCPWM,4,4
	.comm	ESP_OK,4,4
	.comm	ESP_ERR_INVALID_ARG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
