// File: /workspace/github_cpp_makefile_star2_O1/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 $0x128, %edi            # imm = 0x128
callq 0x7580
testq %rax, %rax
je 0x38f19
movq %rax, %r15
movl $0x128, %edx            # imm = 0x128
movq %rax, %rdi
xorl %esi, %esi
callq 0x7270
movb $0x1, 0xd9(%r15)
movb %bpl, 0x80(%r15)
cmpb $0x2, %bpl
jne 0x38b96
xorl %eax, %eax
movq %rax, 0x88(%r15)
movl $0x7, %ecx
movl %ecx, 0x90(%r15)
movq %rax, 0x98(%r15)
movl %ecx, 0xa0(%r15)
movabsq $0x4059000000000000, %rdx # imm = 0x4059000000000000
movq %rdx, 0xa8(%r15)
movl %ecx, 0xb0(%r15)
movq %rax, 0xb8(%r15)
leaq 0xc0(%r15), %rax
jmp 0x38bcf
leaq 0xb0(%r15), %rax
movabsq $0x4049000000000000, %rcx # imm = 0x4049000000000000
movq %rcx, 0x88(%r15)
movl $0x7, %edx
movl %edx, 0x90(%r15)
movq %rcx, 0x98(%r15)
movl %edx, 0xa0(%r15)
movq %rcx, 0xa8(%r15)
movl $0x7, (%rax)
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), %r13
testq %r13, %r13
je 0x38f04
leaq 0xe0(%r15), %rax
movq %rax, 0x10(%rsp)
movq %r15, %rax
addq $0x40, %rax
movq %rax, 0x8(%rsp)
addq $0x10, %r14
leaq 0x82e9(%rip), %rbp      # 0x40f18
leaq 0x8072(%rip), %r12      # 0x40ca8
movq %r13, %rdi
movq %rbp, %rsi
callq 0x7590
movq -0x8(%r14), %rcx
testl %eax, %eax
je 0x38da7
movq %rbx, %rdi
movq %r13, %rsi
movq %rcx, %rdx
callq 0x39851
testl %eax, %eax
jne 0x38dbc
movq -0x10(%r14), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x7590
testl %eax, %eax
je 0x38dd1
movq %r13, %rdi
leaq 0x8044(%rip), %rsi      # 0x40cc8
callq 0x7590
testl %eax, %eax
je 0x38def
movq %r13, %rdi
leaq 0x803f(%rip), %rsi      # 0x40cda
callq 0x7590
testl %eax, %eax
je 0x38dff
movq %r13, %rdi
leaq 0x802b(%rip), %rsi      # 0x40cdd
callq 0x7590
testl %eax, %eax
je 0x38e24
movq %r13, %rdi
leaq 0x46a7(%rip), %rsi      # 0x3d370
callq 0x7590
testl %eax, %eax
je 0x38e42
movq %r13, %rdi
leaq 0x8000(%rip), %rsi      # 0x40ce0
callq 0x7590
testl %eax, %eax
je 0x38e60
movq %r13, %rdi
leaq 0x7fec(%rip), %rsi      # 0x40ce3
callq 0x7590
testl %eax, %eax
je 0x38e7e
movq %r13, %rdi
leaq 0x7fd8(%rip), %rsi      # 0x40ce6
callq 0x7590
testl %eax, %eax
je 0x38dff
movq %r13, %rdi
leaq 0x7fc4(%rip), %rsi      # 0x40ce9
callq 0x7590
testl %eax, %eax
je 0x38e24
movq %r13, %rdi
leaq 0x7fb0(%rip), %rsi      # 0x40cec
callq 0x7590
testl %eax, %eax
je 0x38e42
movq %r13, %rdi
leaq 0x7f9c(%rip), %rsi      # 0x40cef
callq 0x7590
testl %eax, %eax
je 0x38e60
movq %r13, %rdi
leaq 0x7f88(%rip), %rsi      # 0x40cf2
callq 0x7590
testl %eax, %eax
je 0x38e9c
movq %r13, %rdi
leaq 0x7f91(%rip), %rsi      # 0x40d12
callq 0x7590
testl %eax, %eax
jne 0x38dbc
movq -0x8(%r14), %rsi
incq %rsi
movl $0x3e, %edx
movq 0x8(%rsp), %rdi
callq 0x7230
movb $0x0, 0x7e(%r15)
jmp 0x38dbc
movl $0x3f, %edx
movq %r15, %rdi
movq %rcx, %rsi
callq 0x7230
movb $0x0, 0x3f(%r15)
movq (%r14), %r13
addq $0x10, %r14
testq %r13, %r13
jne 0x38c36
jmp 0x38f04
movq -0x8(%r14), %rdi
leaq 0x7eda(%rip), %rsi      # 0x40cb6
callq 0x7590
testl %eax, %eax
je 0x38e1a
movb $0x0, 0xd9(%r15)
jmp 0x38dbc
movq -0x8(%r14), %rsi
movq 0x10(%rsp), %rdi
callq 0x39e85
jmp 0x38dbc
movq -0x8(%r14), %rdi
callq 0x3a344
movsd %xmm0, 0x88(%r15)
movl %eax, 0x90(%r15)
jmp 0x38dbc
movb $0x1, 0xd9(%r15)
jmp 0x38dbc
movq -0x8(%r14), %rdi
callq 0x3a344
movsd %xmm0, 0x98(%r15)
movl %eax, 0xa0(%r15)
jmp 0x38dbc
movq -0x8(%r14), %rdi
callq 0x3a344
movsd %xmm0, 0xa8(%r15)
movl %eax, 0xb0(%r15)
jmp 0x38dbc
movq -0x8(%r14), %rdi
callq 0x3a344
movsd %xmm0, 0xb8(%r15)
movl %eax, 0xc0(%r15)
jmp 0x38dbc
movq -0x8(%r14), %rdi
callq 0x3a344
movsd %xmm0, 0xc8(%r15)
movl %eax, 0xd0(%r15)
jmp 0x38dbc
movq -0x8(%r14), %r13
movq %r13, %rdi
leaq 0x7e55(%rip), %rsi      # 0x40cff
callq 0x7590
testl %eax, %eax
je 0x38eea
movq %r13, %rdi
leaq 0x7e46(%rip), %rsi      # 0x40d03
callq 0x7590
testl %eax, %eax
je 0x38ef7
movq %r13, %rdi
leaq 0x7e3b(%rip), %rsi      # 0x40d0b
callq 0x7590
testl %eax, %eax
jne 0x38dbc
movb $0x2, 0xd8(%r15)
jmp 0x38dbc
movb $0x0, 0xd8(%r15)
jmp 0x38dbc
movb $0x1, 0xd8(%r15)
jmp 0x38dbc
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