// File: 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
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movl $0x128, %edi            # imm = 0x128
callq 0x9730
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x77092
jmp 0x77886
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x128, %edx            # imm = 0x128
callq 0x92f0
movq -0x20(%rbp), %rax
movb $0x1, 0xd9(%rax)
movb -0x11(%rbp), %cl
movq -0x20(%rbp), %rax
movb %cl, 0x80(%rax)
movq -0x20(%rbp), %rax
movsbl 0x80(%rax), %eax
cmpl $0x2, %eax
jne 0x77194
xorps %xmm0, %xmm0
movl $0x7, %edi
callq 0x79b60
movsd %xmm0, -0x30(%rbp)
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0x88(%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x90(%rax)
xorps %xmm0, %xmm0
movl $0x7, %edi
callq 0x79b60
movsd %xmm0, -0x40(%rbp)
movl %eax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0x98(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0xa0(%rax)
movsd 0xd05c(%rip), %xmm0     # 0x84190
movl $0x7, %edi
callq 0x79b60
movsd %xmm0, -0x50(%rbp)
movl %eax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, 0xa8(%rax)
movq -0x48(%rbp), %rcx
movq %rcx, 0xb0(%rax)
xorps %xmm0, %xmm0
movl $0x7, %edi
callq 0x79b60
movsd %xmm0, -0x60(%rbp)
movl %eax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, 0xb8(%rax)
movq -0x58(%rbp), %rcx
movq %rcx, 0xc0(%rax)
jmp 0x77252
movq -0x20(%rbp), %rax
movsbl 0x80(%rax), %eax
cmpl $0x3, %eax
jne 0x77250
movsd 0xcf60(%rip), %xmm0     # 0x84110
movl $0x7, %edi
callq 0x79b60
movsd %xmm0, -0x70(%rbp)
movl %eax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movq -0x70(%rbp), %rcx
movq %rcx, 0x88(%rax)
movq -0x68(%rbp), %rcx
movq %rcx, 0x90(%rax)
movsd 0xcf2c(%rip), %xmm0     # 0x84110
movl $0x7, %edi
callq 0x79b60
movsd %xmm0, -0x80(%rbp)
movl %eax, -0x78(%rbp)
movq -0x20(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, 0x98(%rax)
movq -0x78(%rbp), %rcx
movq %rcx, 0xa0(%rax)
movsd 0xcef8(%rip), %xmm0     # 0x84110
movl $0x7, %edi
callq 0x79b60
movsd %xmm0, -0x90(%rbp)
movl %eax, -0x88(%rbp)
movq -0x20(%rbp), %rax
movq -0x90(%rbp), %rcx
movq %rcx, 0xa8(%rax)
movq -0x88(%rbp), %rcx
movq %rcx, 0xb0(%rax)
jmp 0x77252
movq -0x20(%rbp), %rdi
addq $0xe0, %rdi
callq 0x77000
movl $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x77861
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xed27(%rip), %rsi      # 0x85fb6
callq 0x9770
cmpl $0x0, %eax
jne 0x772c5
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
movl $0x3f, %edx
callq 0x92c0
movq -0x20(%rbp), %rax
movb $0x0, 0x3f(%rax)
jmp 0x77851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
callq 0x79b90
cmpl $0x0, %eax
jne 0x7784f
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xea3f(%rip), %rsi      # 0x85d46
callq 0x9770
cmpl $0x0, %eax
jne 0x77350
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xea2b(%rip), %rsi      # 0x85d54
callq 0x9770
cmpl $0x0, %eax
jne 0x77340
movq -0x20(%rbp), %rax
movb $0x1, 0xd9(%rax)
jmp 0x7734b
movq -0x20(%rbp), %rax
movb $0x0, 0xd9(%rax)
jmp 0x7784d
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xea03(%rip), %rsi      # 0x85d66
callq 0x9770
cmpl $0x0, %eax
jne 0x77393
movq -0x20(%rbp), %rdi
addq $0xe0, %rdi
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x7a120
jmp 0x7784b
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe9d2(%rip), %rsi      # 0x85d78
callq 0x9770
cmpl $0x0, %eax
jne 0x773f9
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7a2e0
movsd %xmm0, -0xa0(%rbp)
movl %eax, -0x98(%rbp)
movq -0x20(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq %rcx, 0x88(%rax)
movq -0x98(%rbp), %rcx
movq %rcx, 0x90(%rax)
jmp 0x77849
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe96f(%rip), %rsi      # 0x85d7b
callq 0x9770
cmpl $0x0, %eax
jne 0x7745f
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7a2e0
movsd %xmm0, -0xb0(%rbp)
movl %eax, -0xa8(%rbp)
movq -0x20(%rbp), %rax
movq -0xb0(%rbp), %rcx
movq %rcx, 0x98(%rax)
movq -0xa8(%rbp), %rcx
movq %rcx, 0xa0(%rax)
jmp 0x77847
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xaf6a(%rip), %rsi      # 0x823dc
callq 0x9770
cmpl $0x0, %eax
jne 0x774c5
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7a2e0
movsd %xmm0, -0xc0(%rbp)
movl %eax, -0xb8(%rbp)
movq -0x20(%rbp), %rax
movq -0xc0(%rbp), %rcx
movq %rcx, 0xa8(%rax)
movq -0xb8(%rbp), %rcx
movq %rcx, 0xb0(%rax)
jmp 0x77845
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe8a6(%rip), %rsi      # 0x85d7e
callq 0x9770
cmpl $0x0, %eax
jne 0x7752b
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7a2e0
movsd %xmm0, -0xd0(%rbp)
movl %eax, -0xc8(%rbp)
movq -0x20(%rbp), %rax
movq -0xd0(%rbp), %rcx
movq %rcx, 0xb8(%rax)
movq -0xc8(%rbp), %rcx
movq %rcx, 0xc0(%rax)
jmp 0x77843
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe843(%rip), %rsi      # 0x85d81
callq 0x9770
cmpl $0x0, %eax
jne 0x77591
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7a2e0
movsd %xmm0, -0xe0(%rbp)
movl %eax, -0xd8(%rbp)
movq -0x20(%rbp), %rax
movq -0xe0(%rbp), %rcx
movq %rcx, 0xc8(%rax)
movq -0xd8(%rbp), %rcx
movq %rcx, 0xd0(%rax)
jmp 0x77841
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe7e0(%rip), %rsi      # 0x85d84
callq 0x9770
cmpl $0x0, %eax
jne 0x775f7
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7a2e0
movsd %xmm0, -0xf0(%rbp)
movl %eax, -0xe8(%rbp)
movq -0x20(%rbp), %rax
movq -0xf0(%rbp), %rcx
movq %rcx, 0x88(%rax)
movq -0xe8(%rbp), %rcx
movq %rcx, 0x90(%rax)
jmp 0x7783f
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe77d(%rip), %rsi      # 0x85d87
callq 0x9770
cmpl $0x0, %eax
jne 0x7765d
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7a2e0
movsd %xmm0, -0x100(%rbp)
movl %eax, -0xf8(%rbp)
movq -0x20(%rbp), %rax
movq -0x100(%rbp), %rcx
movq %rcx, 0x98(%rax)
movq -0xf8(%rbp), %rcx
movq %rcx, 0xa0(%rax)
jmp 0x7783d
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe71a(%rip), %rsi      # 0x85d8a
callq 0x9770
cmpl $0x0, %eax
jne 0x776c3
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7a2e0
movsd %xmm0, -0x110(%rbp)
movl %eax, -0x108(%rbp)
movq -0x20(%rbp), %rax
movq -0x110(%rbp), %rcx
movq %rcx, 0xa8(%rax)
movq -0x108(%rbp), %rcx
movq %rcx, 0xb0(%rax)
jmp 0x7783b
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe6b7(%rip), %rsi      # 0x85d8d
callq 0x9770
cmpl $0x0, %eax
jne 0x77729
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7a2e0
movsd %xmm0, -0x120(%rbp)
movl %eax, -0x118(%rbp)
movq -0x20(%rbp), %rax
movq -0x120(%rbp), %rcx
movq %rcx, 0xb8(%rax)
movq -0x118(%rbp), %rcx
movq %rcx, 0xc0(%rax)
jmp 0x77839
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe654(%rip), %rsi      # 0x85d90
callq 0x9770
cmpl $0x0, %eax
jne 0x777db
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe63b(%rip), %rsi      # 0x85d9d
callq 0x9770
cmpl $0x0, %eax
jne 0x77779
movq -0x20(%rbp), %rax
movb $0x0, 0xd8(%rax)
jmp 0x777d9
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe610(%rip), %rsi      # 0x85da1
callq 0x9770
cmpl $0x0, %eax
jne 0x777a8
movq -0x20(%rbp), %rax
movb $0x1, 0xd8(%rax)
jmp 0x777d7
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe5e9(%rip), %rsi      # 0x85da9
callq 0x9770
cmpl $0x0, %eax
jne 0x777d5
movq -0x20(%rbp), %rax
movb $0x2, 0xd8(%rax)
jmp 0x777d7
jmp 0x777d9
jmp 0x77837
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xe5c2(%rip), %rsi      # 0x85db0
callq 0x9770
cmpl $0x0, %eax
jne 0x77835
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x128(%rbp)
movq -0x20(%rbp), %rdi
addq $0x40, %rdi
movq -0x128(%rbp), %rsi
addq $0x1, %rsi
movl $0x3e, %edx
callq 0x92c0
movq -0x20(%rbp), %rax
movb $0x0, 0x7e(%rax)
jmp 0x77837
jmp 0x77839
jmp 0x7783b
jmp 0x7783d
jmp 0x7783f
jmp 0x77841
jmp 0x77843
jmp 0x77845
jmp 0x77847
jmp 0x77849
jmp 0x7784b
jmp 0x7784d
jmp 0x7784f
jmp 0x77851
jmp 0x77853
movl -0x18(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x18(%rbp)
jmp 0x77269
movq -0x8(%rbp), %rax
movq 0xd040(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x120(%rax)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xd040(%rax)
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nop