// File: /workspace/github_c_makefile_star2_O0/mmayer[P]pcal/src/pcalutil.c
// Function: define_shading
void define_shading (char *orig_shading, char *new_shading, char *dflt_shading)
{
   char *odate, *ndate, *ddate, *ofill, *nfill, *dfill;
   char tmp1[STRSIZ], tmp2[STRSIZ], tmp3[STRSIZ];
   double v;
   
   /* use default date/fill if new _shading is null */
   if (new_shading == NULL || new_shading[0] == '\0') {
      strcpy(orig_shading, dflt_shading);
      return;
   }

   /* split old, new, and default shadings into date/fill components */
   SPLIT(orig_shading, odate, ofill, '/');
   
   new_shading = strcpy(tmp1, new_shading);
   SPLIT(new_shading, ndate, nfill, '/');
   
   dflt_shading = strcpy(tmp2, dflt_shading);
   SPLIT(dflt_shading, ddate, dfill, '/');

   /* replace invalid fields from new shading with default values */
   if (nfill[0] && strchr(nfill, RGB_CHAR) == NULL && ((v = atof(nfill)) <= 0.0 || v > 1.0)) {
      nfill = dfill;
   }
   if (ndate[0] && strchr(ndate, RGB_CHAR) == NULL && ((v = atof(ndate)) <= 0.0 || v > 1.0)) {
      ndate = ddate;
   }
   
   /* replace fields of old shading with specified fields from new */
   
   strcpy(tmp3, ndate[0] ? ndate : odate);
   strcat(tmp3, "/");
   strcat(tmp3, nfill[0] ? nfill : ofill);
   
   strcpy(orig_shading, tmp3);

   return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x310, %rsp            # imm = 0x310
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xb6fa
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xb70c
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5080
jmp 0xba2b
jmp 0xb70e
movq -0x8(%rbp), %rdi
movl $0x2f, %esi
callq 0x5130
movq %rax, -0x2c0(%rbp)
cmpq $0x0, %rax
je 0xb74e
movq -0x2c0(%rbp), %rax
movb $0x0, (%rax)
movq -0x2c0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2c0(%rbp)
movq %rax, -0x2d8(%rbp)
jmp 0xb75e
leaq 0x1a536(%rip), %rax     # 0x25c8b
movq %rax, -0x2d8(%rbp)
jmp 0xb75e
movq -0x2d8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movl $0x2f, %esi
callq 0x5100
movq %rax, -0x2c0(%rbp)
cmpq $0x0, %rax
je 0xb792
movq -0x2c0(%rbp), %rax
movb $0x0, (%rax)
jmp 0xb794
leaq -0x110(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5080
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0x2f, %esi
callq 0x5130
movq %rax, -0x2c8(%rbp)
cmpq $0x0, %rax
je 0xb7e8
movq -0x2c8(%rbp), %rax
movb $0x0, (%rax)
movq -0x2c8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2c8(%rbp)
movq %rax, -0x2e0(%rbp)
jmp 0xb7f8
leaq 0x1a49c(%rip), %rax     # 0x25c8b
movq %rax, -0x2e0(%rbp)
jmp 0xb7f8
movq -0x2e0(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x28(%rbp)
movl $0x2f, %esi
callq 0x5100
movq %rax, -0x2c8(%rbp)
cmpq $0x0, %rax
je 0xb82c
movq -0x2c8(%rbp), %rax
movb $0x0, (%rax)
jmp 0xb82e
leaq -0x1e0(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5080
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2f, %esi
callq 0x5130
movq %rax, -0x2d0(%rbp)
cmpq $0x0, %rax
je 0xb882
movq -0x2d0(%rbp), %rax
movb $0x0, (%rax)
movq -0x2d0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2d0(%rbp)
movq %rax, -0x2e8(%rbp)
jmp 0xb892
leaq 0x1a402(%rip), %rax     # 0x25c8b
movq %rax, -0x2e8(%rbp)
jmp 0xb892
movq -0x2e8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movl $0x2f, %esi
callq 0x5100
movq %rax, -0x2d0(%rbp)
cmpq $0x0, %rax
je 0xb8c6
movq -0x2d0(%rbp), %rax
movb $0x0, (%rax)
jmp 0xb8c8
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xb923
movq -0x40(%rbp), %rdi
movl $0x3a, %esi
callq 0x5100
cmpq $0x0, %rax
jne 0xb923
movq -0x40(%rbp), %rdi
callq 0x50a0
movaps %xmm0, %xmm1
movsd %xmm1, -0x2b8(%rbp)
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jae 0xb91b
movsd -0x2b8(%rbp), %xmm0
movsd 0xf6f3(%rip), %xmm1     # 0x1b008
ucomisd %xmm1, %xmm0
jbe 0xb923
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xb97e
movq -0x28(%rbp), %rdi
movl $0x3a, %esi
callq 0x5100
cmpq $0x0, %rax
jne 0xb97e
movq -0x28(%rbp), %rdi
callq 0x50a0
movaps %xmm0, %xmm1
movsd %xmm1, -0x2b8(%rbp)
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jae 0xb976
movsd -0x2b8(%rbp), %xmm0
movsd 0xf698(%rip), %xmm1     # 0x1b008
ucomisd %xmm1, %xmm0
jbe 0xb97e
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0x2b0(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xb9a5
movq -0x28(%rbp), %rax
movq %rax, -0x2f8(%rbp)
jmp 0xb9b0
movq -0x20(%rbp), %rax
movq %rax, -0x2f8(%rbp)
movq -0x2f0(%rbp), %rdi
movq -0x2f8(%rbp), %rsi
callq 0x5080
leaq -0x2b0(%rbp), %rdi
leaq 0x18c98(%rip), %rsi     # 0x24669
callq 0x5290
leaq -0x2b0(%rbp), %rax
movq %rax, -0x300(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xb9fd
movq -0x40(%rbp), %rax
movq %rax, -0x308(%rbp)
jmp 0xba08
movq -0x38(%rbp), %rax
movq %rax, -0x308(%rbp)
movq -0x300(%rbp), %rdi
movq -0x308(%rbp), %rsi
callq 0x5290
movq -0x8(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x5080
addq $0x310, %rsp            # imm = 0x310
popq %rbp
retq
nopw %cs:(%rax,%rax)