// File: /workspace/github_cpp_makefile_star2_O3/thierry7100[P]CutOptim/include/nanosvg.h
// Function: nsvg__parseGradient(NSVGparser*, char const**, char)
static void nsvg__parseGradient(NSVGparser* p, const char** attr, char type)
{
	int i;
	NSVGgradientData* grad = (NSVGgradientData*)malloc(sizeof(NSVGgradientData));
	if (grad == NULL) return;
	memset(grad, 0, sizeof(NSVGgradientData));
	grad->units = NSVG_OBJECT_SPACE;
	grad->type = type;
	if (grad->type == NSVG_PAINT_LINEAR_GRADIENT) {
		grad->linear.x1 = nsvg__coord(0.0, NSVG_UNITS_PERCENT);
		grad->linear.y1 = nsvg__coord(0.0, NSVG_UNITS_PERCENT);
		grad->linear.x2 = nsvg__coord(100.0, NSVG_UNITS_PERCENT);
		grad->linear.y2 = nsvg__coord(0.0, NSVG_UNITS_PERCENT);
	} else if (grad->type == NSVG_PAINT_RADIAL_GRADIENT) {
		grad->radial.cx = nsvg__coord(50.0, NSVG_UNITS_PERCENT);
		grad->radial.cy = nsvg__coord(50.0, NSVG_UNITS_PERCENT);
		grad->radial.r = nsvg__coord(50.0, NSVG_UNITS_PERCENT);
	}

	nsvg__xformIdentity(grad->xform);

	for (i = 0; attr[i]; i += 2) {
		if (strcmp(attr[i], "id") == 0) {
			strncpy(grad->id, attr[i+1], 63);
			grad->id[63] = '\0';
		} else if (!nsvg__parseAttr(p, attr[i], attr[i + 1])) {
			if (strcmp(attr[i], "gradientUnits") == 0) {
				if (strcmp(attr[i+1], "objectBoundingBox") == 0)
					grad->units = NSVG_OBJECT_SPACE;
				else
					grad->units = NSVG_USER_SPACE;
			} else if (strcmp(attr[i], "gradientTransform") == 0) {
				nsvg__parseTransform(grad->xform, attr[i + 1]);
			} else if (strcmp(attr[i], "cx") == 0) {
				grad->radial.cx = nsvg__parseCoordinateRaw(attr[i + 1]);
			} else if (strcmp(attr[i], "cy") == 0) {
				grad->radial.cy = nsvg__parseCoordinateRaw(attr[i + 1]);
			} else if (strcmp(attr[i], "r") == 0) {
				grad->radial.r = nsvg__parseCoordinateRaw(attr[i + 1]);
			} else if (strcmp(attr[i], "fx") == 0) {
				grad->radial.fx = nsvg__parseCoordinateRaw(attr[i + 1]);
			} else if (strcmp(attr[i], "fy") == 0) {
				grad->radial.fy = nsvg__parseCoordinateRaw(attr[i + 1]);
			} else if (strcmp(attr[i], "x1") == 0) {
				grad->linear.x1 = nsvg__parseCoordinateRaw(attr[i + 1]);
			} else if (strcmp(attr[i], "y1") == 0) {
				grad->linear.y1 = nsvg__parseCoordinateRaw(attr[i + 1]);
			} else if (strcmp(attr[i], "x2") == 0) {
				grad->linear.x2 = nsvg__parseCoordinateRaw(attr[i + 1]);
			} else if (strcmp(attr[i], "y2") == 0) {
				grad->linear.y2 = nsvg__parseCoordinateRaw(attr[i + 1]);
			} else if (strcmp(attr[i], "spreadMethod") == 0) {
				if (strcmp(attr[i+1], "pad") == 0)
					grad->spread = NSVG_SPREAD_PAD;
				else if (strcmp(attr[i+1], "reflect") == 0)
					grad->spread = NSVG_SPREAD_REFLECT;
				else if (strcmp(attr[i+1], "repeat") == 0)
					grad->spread = NSVG_SPREAD_REPEAT;
			} else if (strcmp(attr[i], "xlink:href") == 0) {
				const char *href = attr[i+1];
				strncpy(grad->ref, href+1, 62);
				grad->ref[62] = '\0';
			}
		}
	}

	grad->next = p->gradients;
	p->gradients = grad;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x1, %edi
movl $0x128, %esi            # imm = 0x128
callq 0x72e0
testq %rax, %rax
je 0x381e6
movq %rax, %r15
movb $0x1, 0xd9(%rax)
movb %bpl, 0x80(%rax)
cmpb $0x2, %bpl
jne 0x37e4f
movq $0x0, 0xb8(%r15)
movl $0x7, 0xc0(%r15)
movsd 0x6456(%rip), %xmm0     # 0x3e2a0
xorps %xmm1, %xmm1
jmp 0x37e5a
movsd 0x6229(%rip), %xmm1     # 0x3e080
movaps %xmm1, %xmm0
movsd %xmm1, 0x88(%r15)
movl $0x7, %eax
movl %eax, 0x90(%r15)
movsd %xmm1, 0x98(%r15)
movl %eax, 0xa0(%r15)
movsd %xmm0, 0xa8(%r15)
movl %eax, 0xb0(%r15)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0xe0(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0xe8(%r15)
movq %rax, 0xf8(%r15)
movups %xmm0, 0x100(%r15)
movq (%r14), %rsi
testq %rsi, %rsi
je 0x381d1
leaq 0xe0(%r15), %rax
movq %rax, 0x10(%rsp)
movq %r15, %rax
addq $0x40, %rax
movq %rax, 0x8(%rsp)
addq $0x10, %r14
leaq 0x7e5b(%rip), %rbp      # 0x3fd44
leaq 0x7e74(%rip), %r12      # 0x3fd64
cmpb $0x69, (%rsi)
jne 0x37f05
cmpb $0x64, 0x1(%rsi)
jne 0x37f05
cmpb $0x0, 0x2(%rsi)
je 0x37fc7
movq -0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x38acd
testl %eax, %eax
je 0x37f26
movq (%r14), %rsi
addq $0x10, %r14
testq %rsi, %rsi
jne 0x37ef0
jmp 0x381d1
movq -0x10(%r14), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x75a0
testl %eax, %eax
je 0x37fa2
movq %r13, %rdi
movq %r12, %rsi
callq 0x75a0
testl %eax, %eax
je 0x37fe2
movzbl (%r13), %eax
cmpl $0x71, %eax
jle 0x37ff5
cmpl $0x72, %eax
je 0x3805a
cmpl $0x78, %eax
je 0x38063
cmpl $0x79, %eax
jne 0x380c5
cmpb $0x31, 0x1(%r13)
jne 0x37f87
cmpb $0x0, 0x2(%r13)
je 0x38195
cmpb $0x32, 0x1(%r13)
jne 0x380c5
cmpb $0x0, 0x2(%r13)
jne 0x380c5
jmp 0x381b3
movq -0x8(%r14), %rdi
leaq 0x7da5(%rip), %rsi      # 0x3fd52
callq 0x75a0
testl %eax, %eax
je 0x3804d
movb $0x0, 0xd9(%r15)
jmp 0x37f15
movq -0x8(%r14), %rsi
movl $0x3f, %edx
movq %r15, %rdi
callq 0x7230
movb $0x0, 0x3f(%r15)
jmp 0x37f15
movq -0x8(%r14), %rsi
movq 0x10(%rsp), %rdi
callq 0x390c7
jmp 0x37f15
cmpl $0x63, %eax
je 0x380a1
cmpl $0x66, %eax
jne 0x380c5
cmpb $0x78, 0x1(%r13)
jne 0x38019
cmpb $0x0, 0x2(%r13)
je 0x381b3
cmpb $0x79, 0x1(%r13)
jne 0x380c5
cmpb $0x0, 0x2(%r13)
jne 0x380c5
movq -0x8(%r14), %rdi
callq 0x39560
movsd %xmm0, 0xc8(%r15)
movl %eax, 0xd0(%r15)
jmp 0x37f15
movb $0x1, 0xd9(%r15)
jmp 0x37f15
cmpb $0x0, 0x1(%r13)
jne 0x380c5
jmp 0x38083
cmpb $0x31, 0x1(%r13)
jne 0x38075
cmpb $0x0, 0x2(%r13)
je 0x3816a
cmpb $0x32, 0x1(%r13)
jne 0x380c5
cmpb $0x0, 0x2(%r13)
jne 0x380c5
movq -0x8(%r14), %rdi
callq 0x39560
movsd %xmm0, 0xa8(%r15)
movl %eax, 0xb0(%r15)
jmp 0x37f15
cmpb $0x78, 0x1(%r13)
jne 0x380b3
cmpb $0x0, 0x2(%r13)
je 0x3816a
cmpb $0x79, 0x1(%r13)
jne 0x380c5
cmpb $0x0, 0x2(%r13)
je 0x38195
movq %r13, %rdi
leaq 0x7ca7(%rip), %rsi      # 0x3fd76
callq 0x75a0
testl %eax, %eax
je 0x3810f
movq %r13, %rdi
leaq 0x7cb4(%rip), %rsi      # 0x3fd96
callq 0x75a0
testl %eax, %eax
jne 0x37f15
movq -0x8(%r14), %rsi
incq %rsi
movl $0x3e, %edx
movq 0x8(%rsp), %rdi
callq 0x7230
movb $0x0, 0x7e(%r15)
jmp 0x37f15
movq -0x8(%r14), %r13
movq %r13, %rdi
leaq 0x7c66(%rip), %rsi      # 0x3fd83
callq 0x75a0
testl %eax, %eax
je 0x3815d
movq %r13, %rdi
leaq 0x7c57(%rip), %rsi      # 0x3fd87
callq 0x75a0
testl %eax, %eax
je 0x38188
movq %r13, %rdi
leaq 0x7c4c(%rip), %rsi      # 0x3fd8f
callq 0x75a0
testl %eax, %eax
jne 0x37f15
movb $0x2, 0xd8(%r15)
jmp 0x37f15
movb $0x0, 0xd8(%r15)
jmp 0x37f15
movq -0x8(%r14), %rdi
callq 0x39560
movsd %xmm0, 0x88(%r15)
movl %eax, 0x90(%r15)
jmp 0x37f15
movb $0x1, 0xd8(%r15)
jmp 0x37f15
movq -0x8(%r14), %rdi
callq 0x39560
movsd %xmm0, 0x98(%r15)
movl %eax, 0xa0(%r15)
jmp 0x37f15
movq -0x8(%r14), %rdi
callq 0x39560
movsd %xmm0, 0xb8(%r15)
movl %eax, 0xc0(%r15)
jmp 0x37f15
movq 0xd040(%rbx), %rax
movq %rax, 0x120(%r15)
movq %r15, 0xd040(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq