// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/int32_type.c
// Function: prv_pow_const
static subtilis_exp_t *prv_pow_const(subtilis_parser_t *p, subtilis_exp_t *a1,
				     subtilis_exp_t *a2, bool swapped,
				     subtilis_error_t *err)
{
	int32_t accum;
	int32_t i = 0;
	/* a2 must be const */

	switch (a2->type.type) {
	case SUBTILIS_TYPE_CONST_INTEGER:
		if (a2->exp.ir_op.integer == 0) {
			a1->exp.ir_op.integer = 1;
		} else if (a2->exp.ir_op.integer < 0) {
			a1->exp.ir_op.real =
			    pow(a1->exp.ir_op.integer, a2->exp.ir_op.integer);
			a1->type.type = SUBTILIS_TYPE_CONST_REAL;
		} else {
			accum = a1->exp.ir_op.integer;
			for (i = 1; i < a2->exp.ir_op.integer; i++)
				accum *= a1->exp.ir_op.integer;
			a1->exp.ir_op.integer = accum;
		}
		break;
	case SUBTILIS_TYPE_CONST_REAL:
		if (a2->exp.ir_op.real == 0) {
			a1->exp.ir_op.real = 1;
		} else if (a2->exp.ir_op.real != 1) {
			a1->exp.ir_op.real =
			    pow(a1->exp.ir_op.integer, a2->exp.ir_op.real);
			a1->type.type = SUBTILIS_TYPE_CONST_REAL;
		}
		break;
	default:
		subtilis_exp_delete(a1);
		subtilis_exp_delete(a2);
		subtilis_error_set_bad_expression(err, p->l->stream->name,
						  p->l->line);
		return NULL;
	}

	subtilis_exp_delete(a2);
	return a1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %cl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
andb $0x1, %al
movb %al, -0x21(%rbp)
movq %r8, -0x30(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
testl %eax, %eax
je 0x4ef0c
jmp 0x4ee49
movl -0x3c(%rbp), %eax
subl $0x1, %eax
jne 0x4ef8e
jmp 0x4ee57
movq -0x20(%rbp), %rax
cmpl $0x0, 0x148(%rax)
jne 0x4ee77
movq -0x18(%rbp), %rax
movl $0x1, 0x148(%rax)
jmp 0x4ef07
movq -0x20(%rbp), %rax
cmpl $0x0, 0x148(%rax)
jge 0x4eeb9
movq -0x18(%rbp), %rax
cvtsi2sdl 0x148(%rax), %xmm0
movq -0x20(%rbp), %rax
cvtsi2sdl 0x148(%rax), %xmm1
callq 0x120b0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x148(%rax)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
jmp 0x4ef05
movq -0x18(%rbp), %rax
movl 0x148(%rax), %eax
movl %eax, -0x34(%rbp)
movl $0x1, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x148(%rcx), %eax
jge 0x4eef8
movq -0x18(%rbp), %rax
movl 0x148(%rax), %eax
imull -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x4eecd
movl -0x34(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x148(%rax)
jmp 0x4ef07
jmp 0x4efda
movq -0x20(%rbp), %rax
movsd 0x148(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x4ef39
jp 0x4ef39
movq -0x18(%rbp), %rax
movsd 0x5d4c1(%rip), %xmm0    # 0xac3f0
movsd %xmm0, 0x148(%rax)
jmp 0x4ef8c
movq -0x20(%rbp), %rax
movsd 0x148(%rax), %xmm0
movsd 0x5d4a3(%rip), %xmm1    # 0xac3f0
ucomisd %xmm1, %xmm0
jne 0x4ef57
jp 0x4ef57
jmp 0x4ef8a
movq -0x18(%rbp), %rax
cvtsi2sdl 0x148(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd 0x148(%rax), %xmm1
callq 0x120b0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x148(%rax)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
jmp 0x4ef8c
jmp 0x4efda
movq -0x18(%rbp), %rdi
callq 0x36ee0
movq -0x20(%rbp), %rdi
callq 0x36ee0
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %ecx
movl $0x19, %esi
leaq 0x5d4e0(%rip), %r8      # 0xac4a5
movl $0x2ef, %r9d            # imm = 0x2EF
callq 0x15930
movq $0x0, -0x8(%rbp)
jmp 0x4efeb
movq -0x20(%rbp), %rdi
callq 0x36ee0
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)