name
stringlengths
1
473k
code
stringlengths
7
647k
asm
stringlengths
4
3.39M
file
stringlengths
8
196
ffgtcp
int ffgtcp(fitsfile *infptr, /* input FITS file pointer */ fitsfile *outfptr, /* output FITS file pointer */ int cpopt, /* code specifying copy options: OPT_GCP_GPT (0) ==> copy only grouping table OPT_GCP_ALL (2) ==> recusrively copy members and their members (if groups) */ int *status) /* return status code */ /* copy a grouping table, and optionally all its members, to a new FITS file. If the cpopt is set to OPT_GCP_GPT (copy grouping table only) then the existing members have their GRPIDn and GRPLCn keywords updated to reflect the existance of the new group, since they now belong to another group. If cpopt is set to OPT_GCP_ALL (copy grouping table and members recursively) then the original members are not updated; the new grouping table is modified to include only the copied member HDUs and not the original members. Note that the recursive version of this function, ffgtcpr(), is called to perform the group table copy. In the case of cpopt == OPT_GCP_GPT ffgtcpr() does not actually use recursion. */ { int i; HDUtracker HDU; if(*status != 0) return(*status); /* make sure infptr and outfptr are not the same pointer */ if(infptr == outfptr) *status = IDENTICAL_POINTERS; else { /* initialize the HDUtracker struct */ HDU.nHDU = 0; *status = fftsad(infptr,&HDU,NULL,NULL); /* call the recursive form of this function to copy the grouping table. If the cpopt is OPT_GCP_GPT then there is actually no recursion performed */ *status = ffgtcpr(infptr,outfptr,cpopt,&HDU,status); /* free memory allocated for the HDUtracker struct */ for(i = 0; i < HDU.nHDU; ++i) { free(HDU.filename[i]); free(HDU.newFilename[i]); } } return(*status); }
movl (%rcx), %eax testl %eax, %eax je 0x7470f retq pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x5dd0, %rsp # imm = 0x5DD0 movq %rcx, %rbx movq %rsi, %r14 movq %rdi, %r15 cmpq %rsi, %rdi je 0x74790 movl %edx, %ebp leaq 0x8(%rsp), %r12 movl $0x0, (%r12) movq %r15, %rdi movq %r12, %rsi xorl %edx, %edx xorl %ecx, %ecx callq 0x73ff9 movl %eax, (%rbx) movq %r15, %rdi movq %r14, %rsi movl %ebp, %edx movq %r12, %rcx movq %rbx, %r8 callq 0x747ab movl %eax, (%rbx) movslq (%r12), %r14 testq %r14, %r14 jle 0x7479b xorl %r15d, %r15d movq 0x10(%rsp,%r15,8), %rdi callq 0x6260 movq 0x2ef0(%rsp,%r15,8), %rdi callq 0x6260 incq %r15 cmpq %r15, %r14 jne 0x7476d movl (%rbx), %eax jmp 0x7479b movl $0x15c, (%rbx) # imm = 0x15C movl $0x15c, %eax # imm = 0x15C addq $0x5dd0, %rsp # imm = 0x5DD0 popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/group.c
ffgtcm
int ffgtcm(fitsfile *gfptr, /* FITS file pointer to grouping table */ int cmopt, /* code specifying compact options OPT_CMT_MBR (1) ==> compact only direct members (if groups) OPT_CMT_MBR_DEL (11) ==> (1) + delete all compacted groups */ int *status) /* return status code */ /* "Compact" a group pointed to by the FITS file pointer gfptr. This is achieved by flattening the tree structure of a group and its (grouping table) members. All members HDUs of a grouping table which is itself a member of the grouping table gfptr are added to gfptr. Optionally, the grouping tables which are "compacted" are deleted. If the grouping table contains no members that are themselves grouping tables then this function performs a NOOP. */ { long i; long nmembers = 0; char keyvalue[FLEN_VALUE]; char comment[FLEN_COMMENT]; fitsfile *mfptr = NULL; if(*status != 0) return(*status); do { if(cmopt != OPT_CMT_MBR && cmopt != OPT_CMT_MBR_DEL) { *status = BAD_OPTION; ffpmsg("Invalid value for cmopt parameter specified (ffgtcm)"); continue; } /* reteive the number of grouping table members */ *status = fits_get_num_members(gfptr,&nmembers,status); /* loop over all the grouping table members; if the member is a grouping table then merge its members with the parent grouping table */ for(i = 1; i <= nmembers && *status == 0; ++i) { *status = fits_open_member(gfptr,i,&mfptr,status); if(*status != 0) continue; *status = fits_read_key_str(mfptr,"EXTNAME",keyvalue,comment,status); /* if no EXTNAME keyword then cannot be a grouping table */ if(*status == KEY_NO_EXIST) { *status = 0; continue; } prepare_keyvalue(keyvalue); if(*status != 0) continue; /* if EXTNAME == "GROUPING" then process member as grouping table */ if(fits_strcasecmp(keyvalue,"GROUPING") == 0) { /* merge the member (grouping table) into the grouping table */ *status = fits_merge_groups(mfptr,gfptr,OPT_MRG_COPY,status); *status = fits_close_file(mfptr,status); mfptr = NULL; /* remove the member from the grouping table now that all of its members have been transferred; if cmopt is set to OPT_CMT_MBR_DEL then remove and delete the member */ if(cmopt == OPT_CMT_MBR) *status = fits_remove_member(gfptr,i,OPT_RM_ENTRY,status); else *status = fits_remove_member(gfptr,i,OPT_RM_MBR,status); } else { /* not a grouping table; just close the opened member */ *status = fits_close_file(mfptr,status); mfptr = NULL; } } }while(0); return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xc8, %rsp movl %esi, 0x14(%rsp) xorl %eax, %eax movq %rax, 0x18(%rsp) movq %rax, 0x8(%rsp) movl (%rdx), %r13d testl %r13d, %r13d je 0x76685 movl %r13d, %eax addq $0xc8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rdx, %rbx movq %rdi, %r14 movl 0x14(%rsp), %eax cmpl $0x1, %eax je 0x7669d cmpl $0xb, %eax jne 0x767c9 leaq 0x18(%rsp), %r15 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx callq 0x7379e movl %eax, %r13d movl %eax, (%rbx) cmpq $0x0, (%r15) jle 0x76670 xorl %r15d, %r15d leaq 0x8(%rsp), %rbp testl %r13d, %r13d jne 0x76670 incq %r15 movq %r14, %rdi movq %r15, %rsi movq %rbp, %rdx movq %rbx, %rcx callq 0x74ecf movl %eax, (%rbx) testl %eax, %eax je 0x766ea movl %eax, %r13d jmp 0x767b9 movq 0x8(%rsp), %rdi leaq 0x5518c(%rip), %rsi # 0xcb882 leaq 0x20(%rsp), %r12 movq %r12, %rdx leaq 0x70(%rsp), %rcx movq %rbx, %r8 callq 0x6dd0a movl %eax, (%rbx) cmpl $0xca, %eax jne 0x76722 movl $0x0, (%rbx) xorl %r13d, %r13d jmp 0x767b9 movl %eax, %r13d movq %r12, %rdi callq 0x767e3 testl %r13d, %r13d jne 0x767b9 movq %r12, %rdi leaq 0x62dbd(%rip), %rsi # 0xd94fd callq 0x43694 movq 0x8(%rsp), %rdi testl %eax, %eax je 0x76766 movq %rbx, %rsi callq 0xd6de movl %eax, %r13d movl %eax, (%rbx) movq $0x0, 0x8(%rsp) jmp 0x767b9 movq %r14, %rsi xorl %edx, %edx movq %rbx, %rcx callq 0x74de2 movl %eax, (%rbx) movq 0x8(%rsp), %rdi movq %rbx, %rsi callq 0xd6de movl %eax, (%rbx) movq $0x0, 0x8(%rsp) cmpl $0x1, 0x14(%rsp) jne 0x767a1 movq %r14, %rdi movq %r15, %rsi movl $0x1, %edx jmp 0x767ac movq %r14, %rdi movq %r15, %rsi movl $0x2, %edx movq %rbx, %rcx callq 0x7383f movl %eax, %r13d movl %eax, (%rbx) cmpq 0x18(%rsp), %r15 jl 0x766c3 jmp 0x76670 movl $0x15b, (%rbx) # imm = 0x15B leaq 0x62da2(%rip), %rdi # 0xd9578 callq 0x37264 movl (%rbx), %r13d jmp 0x76670
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/group.c
ffgmng
int ffgmng(fitsfile *mfptr, /* FITS file pointer to member HDU */ long *ngroups, /* total number of groups linked to HDU */ int *status) /* return status code */ /* return the number of groups to which a HDU belongs, as defined by the number of GRPIDn/GRPLCn keyword records that appear in the HDU header. The fitsfile pointer mfptr must be positioned with the member HDU as the CHDU. Each time this function is called, the indicies of the GRPIDn/GRPLCn keywords are checked to make sure they are continuous (ie no gaps) and are re-enumerated to eliminate gaps if gaps are found to be present. */ { int offset; int index; int newIndex; int i; long grpid; char *inclist[] = {"GRPID#"}; char keyword[FLEN_KEYWORD]; char newKeyword[FLEN_KEYWORD]; char card[FLEN_CARD]; char comment[FLEN_COMMENT]; char *tkeyvalue; if(*status != 0) return(*status); *ngroups = 0; /* reset the member HDU keyword counter to the beginning */ *status = ffgrec(mfptr,0,card,status); /* search for the number of GRPIDn keywords in the member HDU header and count them with the ngroups variable */ while(*status == 0) { /* read the next GRPIDn keyword in the series */ *status = fits_find_nextkey(mfptr,inclist,1,NULL,0,card,status); if(*status != 0) continue; ++(*ngroups); } if(*status == KEY_NO_EXIST) *status = 0; /* read each GRPIDn/GRPLCn keyword and adjust their index values so that there are no gaps in the index count */ for(index = 1, offset = 0, i = 1; i <= *ngroups && *status == 0; ++index) { snprintf(keyword,FLEN_KEYWORD,"GRPID%d",index); /* try to read the next GRPIDn keyword in the series */ *status = fits_read_key_lng(mfptr,keyword,&grpid,card,status); /* if not found then increment the offset counter and continue */ if(*status == KEY_NO_EXIST) { *status = 0; ++offset; } else { /* increment the number_keys_found counter and see if the index of the keyword needs to be updated */ ++i; if(offset > 0) { /* compute the new index for the GRPIDn/GRPLCn keywords */ newIndex = index - offset; /* update the GRPIDn keyword index */ snprintf(newKeyword,FLEN_KEYWORD,"GRPID%d",newIndex); fits_modify_name(mfptr,keyword,newKeyword,status); /* If present, update the GRPLCn keyword index */ snprintf(keyword,FLEN_KEYWORD,"GRPLC%d",index); snprintf(newKeyword,FLEN_KEYWORD,"GRPLC%d",newIndex); /* SPR 1738 */ *status = fits_read_key_longstr(mfptr,keyword,&tkeyvalue,comment, status); if (0 == *status) { fits_delete_key(mfptr,keyword,status); fits_insert_key_longstr(mfptr,newKeyword,tkeyvalue,comment,status); fits_write_key_longwarn(mfptr,status); free(tkeyvalue); } if(*status == KEY_NO_EXIST) *status = 0; } } } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x178, %rsp # imm = 0x178 leaq 0x62f7f(%rip), %rax # 0xd996f movq %rax, 0x20(%rsp) movl (%rdx), %eax testl %eax, %eax je 0x76a0d addq $0x178, %rsp # imm = 0x178 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rdx, %rbx movq %rdi, %r15 movq %rsi, 0x10(%rsp) movq $0x0, (%rsi) leaq 0x120(%rsp), %r12 xorl %esi, %esi movq %r12, %rdx movq %rbx, %rcx callq 0x6e07a movl %eax, (%rbx) leaq 0x20(%rsp), %r13 testl %eax, %eax jne 0x76a6b movq %rbx, (%rsp) movq %r15, %rdi movq %r13, %rsi movl $0x1, %edx xorl %ecx, %ecx xorl %r8d, %r8d movq %r12, %r9 callq 0x6d432 movl %eax, (%rbx) testl %eax, %eax jne 0x76a3b movq 0x10(%rsp), %rcx incq (%rcx) jmp 0x76a3b cmpl $0xca, %eax jne 0x76a7a movl $0x0, (%rbx) xorl %eax, %eax movq 0x10(%rsp), %r12 cmpq $0x0, (%r12) jle 0x769fb movl $0x1, %r14d movl $0x1, %ebp movl $0x0, 0xc(%rsp) testl %eax, %eax jne 0x769fb movl $0x4b, %esi leaq 0x80(%rsp), %r13 movq %r13, %rdi leaq 0x631d3(%rip), %rdx # 0xd9c8f movl %ebp, %ecx xorl %eax, %eax callq 0x60b0 movq %r15, %rdi movq %r13, %rsi leaq 0x28(%rsp), %rdx leaq 0x120(%rsp), %rcx movq %rbx, %r8 callq 0x6ec9d movl %eax, (%rbx) cmpl $0xca, %eax jne 0x76afa movl $0x0, (%rbx) incl 0xc(%rsp) xorl %eax, %eax jmp 0x76bfe incl %r14d movl 0xc(%rsp), %ecx testl %ecx, %ecx jle 0x76bfe movl %r14d, 0x8(%rsp) movl %ebp, %r12d subl %ecx, %r12d movl $0x4b, %esi leaq 0x30(%rsp), %r14 movq %r14, %rdi leaq 0x63167(%rip), %rdx # 0xd9c8f movl %r12d, %ecx xorl %eax, %eax callq 0x60b0 movq %r15, %rdi leaq 0x80(%rsp), %r13 movq %r13, %rsi movq %r14, %rdx movq %rbx, %rcx callq 0x95bc2 movl $0x4b, %esi movq %r13, %rdi leaq 0x62b1e(%rip), %r14 # 0xd9678 movq %r14, %rdx movl %ebp, %ecx xorl %eax, %eax callq 0x60b0 movl $0x4b, %esi leaq 0x30(%rsp), %rdi movq %r14, %rdx movl %r12d, %ecx xorl %eax, %eax callq 0x60b0 movq %r15, %rdi movq %r13, %rsi leaq 0x18(%rsp), %rdx leaq 0xd0(%rsp), %rcx movq %rbx, %r8 callq 0x6e65a movl %eax, (%rbx) testl %eax, %eax jne 0x76be5 movq %r15, %rdi leaq 0x80(%rsp), %rsi movq %rbx, %rdx callq 0x95db8 movq 0x18(%rsp), %rdx movq %r15, %rdi leaq 0x30(%rsp), %rsi leaq 0xd0(%rsp), %rcx movq %rbx, %r8 callq 0x9623f movq %r15, %rdi movq %rbx, %rsi callq 0xafc9e movq 0x18(%rsp), %rdi callq 0x6260 movl (%rbx), %eax cmpl $0xca, %eax movq 0x10(%rsp), %r12 jne 0x76bf9 movl $0x0, (%rbx) xorl %eax, %eax movl 0x8(%rsp), %r14d incl %ebp movslq %r14d, %rcx cmpq %rcx, (%r12) jge 0x76a9d jmp 0x769fb
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/group.c
fits_url2path
int fits_url2path(char *inpath, /* input file path string */ char *outpath, /* output file path string */ int *status) /* convert a Unix-style URL into a platform dependent directory path. Note that this process is platform dependent. This function supports Unix, MSDOS/WIN32, VMS and Macintosh platforms. Each platform dependent code segment is conditionally compiled depending upon the setting of the appropriate C preprocesser macros. */ { char buff[FLEN_FILENAME]; int absolute; #if defined(MSDOS) || defined(__WIN32__) || defined(WIN32) char *tmpStr, *saveptr; #elif defined(VMS) || defined(vms) || defined(__vms) int i; char *tmpStr, *saveptr; #elif defined(macintosh) char *tmpStr, *saveptr; #endif if(*status != 0) return(*status); /* make a copy of the inpath so that we can manipulate it */ strcpy(buff,inpath); /* convert any encoded characters to their unencoded values */ *status = fits_unencode_url(inpath,buff,status); /* see if the URL is given as absolute w.r.t. the "local" file system */ if(buff[0] == '/') absolute = 1; else absolute = 0; #if defined(WINNT) || defined(__WINNT__) /* Microsoft Windows NT case. We create output paths of the form //disk/path/filename All path segments but the last may be null, so that a single file name is the simplist case. */ if(absolute) { strcpy(outpath,"/"); strcat(outpath,buff); } else { strcpy(outpath,buff); } #elif defined(MSDOS) || defined(__WIN32__) || defined(WIN32) /* MSDOS or Microsoft windows/NT case. The output path will be of the form disk:\path\filename All path segments but the last may be null, so that a single file name is the simplist case. */ /* separate the URL into tokens at each slash '/' and process until all tokens have been examined */ for(tmpStr = ffstrtok(buff,"/",&saveptr), outpath[0] = 0; tmpStr != NULL; tmpStr = ffstrtok(NULL,"/",&saveptr)) { strcat(outpath,tmpStr); /* if the absolute flag is set then process the token as a disk specification; else just process it as a directory path or filename */ if(absolute) { strcat(outpath,":\\"); absolute = 0; } else strcat(outpath,"\\"); } /* remove the last "\" from the outpath, it does not belong there */ outpath[strlen(outpath)-1] = 0; #elif defined(VMS) || defined(vms) || defined(__vms) /* VMS case. The output path will be of the form: node::disk:[path]filename.ext;version Any part of the file path may be missing execpt filename.ext, so that in the simplist case a single file name/extension is given. if the path is specified as relative starting with "./" then the first part of the VMS path is "[.". If the path is relative and does not start with "./" (e.g., "a/b/c") then the VMS path is constructed as "[a.b.c]" */ /* separate the URL into tokens at each slash '/' and process until all tokens have been examined */ for(tmpStr = ffstrtok(buff,"/",&saveptr), outpath[0] = 0; tmpStr != NULL; tmpStr = ffstrtok(NULL,"/",&saveptr)) { if(fits_strcasecmp(tmpStr,"FILE:") == 0) { /* the next token should contain the DECnet machine name */ tmpStr = ffstrtok(NULL,"/",&saveptr); if(tmpStr == NULL) continue; strcat(outpath,tmpStr); strcat(outpath,"::"); /* set the absolute flag to true for the next token */ absolute = 1; } else if(strcmp(tmpStr,"..") == 0) { /* replace all Unix-like ".." with VMS "-" */ if(strlen(outpath) == 0) strcat(outpath,"["); strcat(outpath,"-."); } else if(strcmp(tmpStr,".") == 0 && strlen(outpath) == 0) { /* must indicate a relative path specifier */ strcat(outpath,"[."); } else if(strchr(tmpStr,'.') != NULL) { /* must be up to the file name; turn the last "." path separator into a "]" and then add the file name to the outpath */ i = strlen(outpath); if(i > 0 && outpath[i-1] == '.') outpath[i-1] = ']'; strcat(outpath,tmpStr); } else { /* process the token as a a directory path segement */ if(absolute) { /* treat the token as a disk specifier */ absolute = 0; strcat(outpath,tmpStr); strcat(outpath,":["); } else if(strlen(outpath) == 0) { /* treat the token as the first directory path specifier */ strcat(outpath,"["); strcat(outpath,tmpStr); strcat(outpath,"."); } else { /* treat the token as an imtermediate path specifier */ strcat(outpath,tmpStr); strcat(outpath,"."); } } } #elif defined(macintosh) /* MacOS case. The output path will be of the form disk:path:filename All path segments but the last may be null, so that a single file name is the simplist case. */ /* separate the URL into tokens at each slash '/' and process until all tokens have been examined */ for(tmpStr = ffstrtok(buff,"/",&saveptr), outpath[0] = 0; tmpStr != NULL; tmpStr = ffstrtok(NULL,"/",&saveptr)) { strcat(outpath,tmpStr); strcat(outpath,":"); } /* remove the last ":" from the outpath, it does not belong there */ outpath[strlen(outpath)-1] = 0; #else /* Default Unix case. Nothing special to do here */ strcpy(outpath,buff); #endif return(*status); }
movl (%rdx), %eax testl %eax, %eax je 0x77199 retq pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x408, %rsp # imm = 0x408 movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 movq %rsp, %r12 movq %r12, %rdi movq %r15, %rsi callq 0x6460 movq %r15, %rdi movq %r12, %rsi movq %rbx, %rdx callq 0x79115 movl %eax, (%rbx) movq %r14, %rdi movq %r12, %rsi callq 0x6460 movl (%rbx), %eax addq $0x408, %rsp # imm = 0x408 popq %rbx popq %r12 popq %r14 popq %r15 retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/group.c
fits_get_cwd
int fits_get_cwd(char *cwd, /* IO current working directory string */ int *status) /* retrieve the string containing the current working directory absolute path in Unix-like URL standard notation. It is assumed that the CWD string has a size of at least FLEN_FILENAME. Note that this process is platform dependent. This function supports Unix, MSDOS/WIN32, VMS and Macintosh platforms. Each platform dependent code segment is conditionally compiled depending upon the setting of the appropriate C preprocesser macros. */ { char buff[FLEN_FILENAME]; if(*status != 0) return(*status); #if defined(macintosh) /* MacOS case. Currently unknown !!!! */ *buff = 0; #else /* Good old getcwd() seems to work with all other platforms */ if (!getcwd(buff,FLEN_FILENAME)) { cwd[0]=0; ffpmsg("Path and file name too long (fits_get_cwd)"); return (*status=URL_PARSE_ERROR); } #endif /* convert the cwd string to a URL standard path string */ fits_path2url(buff,FLEN_FILENAME,cwd,status); return(*status); }
movl (%rsi), %eax testl %eax, %eax je 0x77b76 retq pushq %r14 pushq %rbx subq $0x408, %rsp # imm = 0x408 movq %rsi, %rbx movq %rdi, %r14 movq %rsp, %rdi movl $0x401, %esi # imm = 0x401 callq 0x6430 testq %rax, %rax je 0x77baf movq %rsp, %rdi movl $0x401, %esi # imm = 0x401 movq %r14, %rdx movq %rbx, %rcx callq 0x78848 movl (%rbx), %eax jmp 0x77bca movb $0x0, (%r14) leaq 0x624f2(%rip), %rdi # 0xda0ac callq 0x37264 movl $0x7d, (%rbx) movl $0x7d, %eax addq $0x408, %rsp # imm = 0x408 popq %rbx popq %r14 retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/group.c
fits_encode_url
int fits_encode_url(char *inpath, /* I URL to be encoded */ int maxlength, /* I max number of chars that may be copied to outpath, including terminating NULL. */ char *outpath, /* O output encoded URL */ int *status) /* encode all URL "unsafe" and "reserved" characters using the "%XX" convention, where XX stand for the two hexidecimal digits of the encode character's ASCII code. Note that the outpath length, as specified by the maxlength argument, should be at least as large as inpath and preferably larger (to hold any characters that need encoding). If more than maxlength chars are required for outpath, including the terminating NULL, outpath will be set to size 0 and an error status will be returned. This function was adopted from code in the libwww.a library available via the W3 consortium <URL: http://www.w3.org> */ { unsigned char a; char *p; char *q; char *hex = "0123456789ABCDEF"; int iout=0; unsigned const char isAcceptable[96] = {/* 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xA 0xB 0xC 0xD 0xE 0xF */ 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xF,0xE,0x0,0xF,0xF,0xC, /* 2x !"#$%&'()*+,-./ */ 0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0x8,0x0,0x0,0x0,0x0,0x0, /* 3x 0123456789:;<=>? */ 0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF, /* 4x @ABCDEFGHIJKLMNO */ 0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0x0,0x0,0x0,0x0,0xF, /* 5X PQRSTUVWXYZ[\]^_ */ 0x0,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF, /* 6x `abcdefghijklmno */ 0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0xF,0x0,0x0,0x0,0x0,0x0 /* 7X pqrstuvwxyz{\}~DEL */ }; if(*status != 0) return(*status); /* loop over all characters in inpath until '\0' is encountered */ for(q = outpath, p = inpath; *p && (iout < maxlength-1) ; p++) { a = (unsigned char)*p; /* if the charcter requires encoding then process it */ if(!( a>=32 && a<128 && (isAcceptable[a-32]))) { if (iout+2 < maxlength-1) { /* add a '%' character to the outpath */ *q++ = HEX_ESCAPE; /* add the most significant ASCII code hex value */ *q++ = hex[a >> 4]; /* add the least significant ASCII code hex value */ *q++ = hex[a & 15]; iout += 3; } else { ffpmsg("URL input is too long to encode (fits_encode_url)"); *status = URL_PARSE_ERROR; outpath[0] = 0; return (*status); } } /* else just copy the character as is */ else { *q++ = *p; iout++; } } /* null terminate the outpath string */ if (*p && (iout == maxlength-1)) { ffpmsg("URL input is too long to encode (fits_encode_url)"); *status = URL_PARSE_ERROR; outpath[0] = 0; return (*status); } *q++ = 0; return(*status); }
movl (%rcx), %eax testl %eax, %eax je 0x79038 retq pushq %r14 pushq %rbx pushq %rax movq %rcx, %rbx movq %rdx, %r14 leal -0x1(%rsi), %eax movb (%rdi), %r9b testb %r9b, %r9b setne %r10b sete %cl cmpl $0x2, %esi setl %sil xorl %edx, %edx orb %cl, %sil movq %r14, %rcx jne 0x790e7 incq %rdi xorl %edx, %edx leaq 0x603ad(%rip), %rsi # 0xd9420 leaq 0x612c8(%rip), %r8 # 0xda342 movq %r14, %rcx movzbl %r9b, %r10d cmpb $0x20, %r10b jl 0x790a0 leal -0x20(%r10), %r11d cmpb $0x0, (%r11,%rsi) je 0x790a0 movb %r9b, (%rcx) incq %rcx movl $0x1, %r9d jmp 0x790d1 leal 0x2(%rdx), %r9d cmpl %eax, %r9d jge 0x790f3 movb $0x25, (%rcx) movl %r10d, %r9d shrl $0x4, %r9d movb (%r9,%r8), %r9b movb %r9b, 0x1(%rcx) andl $0xf, %r10d movb (%r10,%r8), %r9b movb %r9b, 0x2(%rcx) addq $0x3, %rcx movl $0x3, %r9d addl %r9d, %edx movb (%rdi), %r9b testb %r9b, %r9b setne %r10b je 0x790e7 incq %rdi cmpl %eax, %edx jl 0x7907d cmpl %eax, %edx sete %al andb %r10b, %al cmpb $0x1, %al jne 0x79108 leaq 0x61259(%rip), %rdi # 0xda353 callq 0x37264 movl $0x7d, (%rbx) movq %r14, %rcx movb $0x0, (%rcx) movl (%rbx), %eax addq $0x8, %rsp popq %rbx popq %r14 retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/group.c
ngp_delete_extver_tab
int ngp_delete_extver_tab(void) { int i; if ((NULL == ngp_extver_tab) && (ngp_extver_tab_size > 0)) return(NGP_BAD_ARG); if ((NULL != ngp_extver_tab) && (ngp_extver_tab_size <= 0)) return(NGP_BAD_ARG); if ((NULL == ngp_extver_tab) && (0 == ngp_extver_tab_size)) return(NGP_OK); for (i=0; i<ngp_extver_tab_size; i++) { if (NULL != ngp_extver_tab[i].extname) { ngp_free(ngp_extver_tab[i].extname); ngp_extver_tab[i].extname = NULL; } ngp_extver_tab[i].version = 0; } ngp_free(ngp_extver_tab); ngp_extver_tab = NULL; ngp_extver_tab_size = 0; return(NGP_OK); }
pushq %r15 pushq %r14 pushq %rbx movq 0x18680e(%rip), %rdi # 0x1ffcf0 testq %rdi, %rdi sete %cl movl 0x1867fa(%rip), %eax # 0x1ffce8 testl %eax, %eax setg %dl movl $0x170, %ebx # imm = 0x170 testb %dl, %cl jne 0x79587 testq %rdi, %rdi setne %cl testl %eax, %eax setle %dl testb %dl, %cl jne 0x79587 testq %rdi, %rdi sete %cl testl %eax, %eax sete %dl xorl %ebx, %ebx testb %dl, %cl jne 0x79587 testl %eax, %eax jle 0x7956d xorl %r14d, %r14d xorl %r15d, %r15d movq (%rdi,%r14), %rax testq %rax, %rax je 0x79551 movq %rax, %rdi callq 0x6260 movq 0x1867ae(%rip), %rax # 0x1ffcf0 movq $0x0, (%rax,%r14) movq 0x18679f(%rip), %rdi # 0x1ffcf0 movl $0x0, 0x8(%rdi,%r14) incq %r15 movslq 0x186784(%rip), %rax # 0x1ffce8 addq $0x10, %r14 cmpq %rax, %r15 jl 0x7952a callq 0x6260 movq $0x0, 0x186773(%rip) # 0x1ffcf0 movl $0x0, 0x186761(%rip) # 0x1ffce8 movl %ebx, %eax popq %rbx popq %r14 popq %r15 retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/grparser.c
ngp_free_line
int ngp_free_line(void) { if (NULL != ngp_curline.line) { ngp_free(ngp_curline.line); ngp_curline.line = NULL; ngp_curline.name = NULL; ngp_curline.value = NULL; ngp_curline.comment = NULL; ngp_curline.type = NGP_TTYPE_UNKNOWN; ngp_curline.format = NGP_FORMAT_OK; ngp_curline.flags = 0; } return(NGP_OK); }
movq 0x18659a(%rip), %rdi # 0x1ffc80 testq %rdi, %rdi je 0x7970d pushq %rax callq 0x6260 xorps %xmm0, %xmm0 movups %xmm0, 0x186591(%rip) # 0x1ffc8c movups %xmm0, 0x18657e(%rip) # 0x1ffc80 movups %xmm0, 0x186597(%rip) # 0x1ffca0 addq $0x8, %rsp xorl %eax, %eax retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/grparser.c
ngp_read_line
int ngp_read_line(int ignore_blank_lines) { int r, nc, savec; unsigned k; if (ngp_inclevel <= 0) /* do some sanity checking first */ { ngp_keyidx = NGP_TOKEN_EOF; /* no parents, so report error */ return(NGP_OK); } if (ngp_inclevel > NGP_MAX_INCLUDE) return(NGP_INC_NESTING); if (NULL == ngp_fp[ngp_inclevel - 1]) return(NGP_NUL_PTR); for (;;) { switch (r = ngp_read_line_buffered(ngp_fp[ngp_inclevel - 1])) { case NGP_EOF: ngp_inclevel--; /* end of file, revert to parent */ if (ngp_fp[ngp_inclevel]) /* we can close old file */ fclose(ngp_fp[ngp_inclevel]); ngp_fp[ngp_inclevel] = NULL; if (ngp_inclevel <= 0) { ngp_keyidx = NGP_TOKEN_EOF; /* no parents, so report error */ return(NGP_OK); } continue; case NGP_OK: if (ngp_curline.flags & NGP_LINE_REREAD) return(r); break; default: return(r); } switch (ngp_curline.line[0]) { case 0: if (0 == ignore_blank_lines) break; /* ignore empty lines if told so */ case '#': continue; /* ignore comment lines */ } r = ngp_extract_tokens(&ngp_curline); /* analyse line, extract tokens and comment */ if (NGP_OK != r) return(r); if (NULL == ngp_curline.name) continue; /* skip lines consisting only of whitespaces */ for (k = 0; k < strlen(ngp_curline.name); k++) { if ((ngp_curline.name[k] >= 'a') && (ngp_curline.name[k] <= 'z')) ngp_curline.name[k] += 'A' - 'a'; /* force keyword to be upper case */ if (k == 7) break; /* only first 8 chars are required to be upper case */ } for (k=0;; k++) /* find index of keyword in keyword table */ { if (NGP_TOKEN_UNKNOWN == ngp_tkdef[k].code) break; if (0 == strcmp(ngp_curline.name, ngp_tkdef[k].name)) break; } ngp_keyidx = ngp_tkdef[k].code; /* save this index, grammar parser will need this */ if (NGP_TOKEN_INCLUDE == ngp_keyidx) /* if this is \INCLUDE keyword, try to include file */ { if (NGP_OK != (r = ngp_include_file(ngp_curline.value))) return(r); continue; /* and read next line */ } ngp_linkey.type = NGP_TTYPE_UNKNOWN; /* now, get the keyword type, it's a long story ... */ if (NULL != ngp_curline.value) /* if no value given signal it */ { if (NGP_TTYPE_STRING == ngp_curline.type) /* string type test */ { ngp_linkey.type = NGP_TTYPE_STRING; ngp_linkey.value.s = ngp_curline.value; } if (NGP_TTYPE_UNKNOWN == ngp_linkey.type) /* bool type test */ { if ((!fits_strcasecmp("T", ngp_curline.value)) || (!fits_strcasecmp("F", ngp_curline.value))) { ngp_linkey.type = NGP_TTYPE_BOOL; ngp_linkey.value.b = (fits_strcasecmp("T", ngp_curline.value) ? 0 : 1); } } if (NGP_TTYPE_UNKNOWN == ngp_linkey.type) /* complex type test */ { if (2 == sscanf(ngp_curline.value, "(%lg,%lg)%n", &(ngp_linkey.value.c.re), &(ngp_linkey.value.c.im), &nc)) { if ((' ' == ngp_curline.value[nc]) || ('\t' == ngp_curline.value[nc]) || ('\n' == ngp_curline.value[nc]) || (0 == ngp_curline.value[nc])) { ngp_linkey.type = NGP_TTYPE_COMPLEX; } } } if (NGP_TTYPE_UNKNOWN == ngp_linkey.type) /* real type test */ { if (strchr(ngp_curline.value, '.') && (1 == sscanf(ngp_curline.value, "%lg%n", &(ngp_linkey.value.d), &nc))) { if ('D' == ngp_curline.value[nc]) { /* test if template used a 'D' rather than an 'E' as the exponent character (added by WDP in 12/2010) */ savec = nc; ngp_curline.value[nc] = 'E'; sscanf(ngp_curline.value, "%lg%n", &(ngp_linkey.value.d), &nc); if ((' ' == ngp_curline.value[nc]) || ('\t' == ngp_curline.value[nc]) || ('\n' == ngp_curline.value[nc]) || (0 == ngp_curline.value[nc])) { ngp_linkey.type = NGP_TTYPE_REAL; } else { /* no, this is not a real value */ ngp_curline.value[savec] = 'D'; /* restore the original D character */ } } else { if ((' ' == ngp_curline.value[nc]) || ('\t' == ngp_curline.value[nc]) || ('\n' == ngp_curline.value[nc]) || (0 == ngp_curline.value[nc])) { ngp_linkey.type = NGP_TTYPE_REAL; } } } } if (NGP_TTYPE_UNKNOWN == ngp_linkey.type) /* integer type test */ { if (1 == sscanf(ngp_curline.value, "%d%n", &(ngp_linkey.value.i), &nc)) { if ((' ' == ngp_curline.value[nc]) || ('\t' == ngp_curline.value[nc]) || ('\n' == ngp_curline.value[nc]) || (0 == ngp_curline.value[nc])) { ngp_linkey.type = NGP_TTYPE_INT; } } } if (NGP_TTYPE_UNKNOWN == ngp_linkey.type) /* force string type */ { ngp_linkey.type = NGP_TTYPE_STRING; ngp_linkey.value.s = ngp_curline.value; } } else { if (NGP_TTYPE_RAW == ngp_curline.type) ngp_linkey.type = NGP_TTYPE_RAW; else ngp_linkey.type = NGP_TTYPE_NULL; } if (NULL != ngp_curline.comment) { strncpy(ngp_linkey.comment, ngp_curline.comment, NGP_MAX_COMMENT); /* store comment */ ngp_linkey.comment[NGP_MAX_COMMENT - 1] = 0; } else { ngp_linkey.comment[0] = 0; } strncpy(ngp_linkey.name, ngp_curline.name, NGP_MAX_NAME); /* and keyword's name */ ngp_linkey.name[NGP_MAX_NAME - 1] = 0; if (strlen(ngp_linkey.name) > FLEN_KEYWORD) /* WDP: 20-Jun-2002: mod to support HIERARCH */ { return(NGP_BAD_ARG); /* cfitsio does not allow names > 8 chars */ } return(NGP_OK); /* we have valid non empty line, so return success */ } }
movl 0x185f24(%rip), %ecx # 0x1ffce0 testl %ecx, %ecx jle 0x79f72 movl $0x16d, %eax # imm = 0x16D cmpl $0xa, %ecx ja 0x79f7e pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax leal -0x1(%rcx), %eax leaq 0x185f19(%rip), %r12 # 0x1ffd00 cmpq $0x0, (%r12,%rax,8) je 0x79f7f movl %edi, %ebx leaq 0x185e85(%rip), %r14 # 0x1ffc80 leaq 0x8555e(%rip), %r13 # 0xff360 movslq %ecx, %rax movq -0x8(%r12,%rax,8), %rdi callq 0x79741 testl %eax, %eax je 0x79e5e cmpl $0x16f, %eax # imm = 0x16F jne 0x7a123 movslq 0x185ebb(%rip), %rcx # 0x1ffce0 leaq -0x1(%rcx), %rax movl %eax, 0x185eb1(%rip) # 0x1ffce0 movq -0x8(%r12,%rcx,8), %rdi movl %eax, %ecx testq %rdi, %rdi je 0x79e49 callq 0x64c0 movl 0x185e9a(%rip), %ecx # 0x1ffce0 movslq %ecx, %rax movq $0x0, (%r12,%rax,8) testl %ecx, %ecx jg 0x79f67 jmp 0x79fe2 testb $0x1, 0x185e47(%rip) # 0x1ffcac jne 0x79fec movq 0x185e0e(%rip), %rax # 0x1ffc80 movzbl (%rax), %eax cmpl $0x23, %eax je 0x79f67 testl %eax, %eax jne 0x79e8a testl %ebx, %ebx jne 0x79f67 movq %r14, %rdi callq 0x7983a testl %eax, %eax jne 0x7a123 movq 0x185de7(%rip), %r15 # 0x1ffc88 testq %r15, %r15 je 0x79f67 cmpb $0x0, (%r15) je 0x79ee1 xorl %ebp, %ebp movb (%r15,%rbp), %al leal -0x61(%rax), %ecx cmpb $0x19, %cl ja 0x79ec4 addb $-0x20, %al movb %al, (%r15,%rbp) cmpq $0x7, %rbp je 0x79ee1 incq %rbp movq 0x185db4(%rip), %r15 # 0x1ffc88 movq %r15, %rdi callq 0x6280 cmpq %rbp, %rax ja 0x79eb2 movl 0x85481(%rip), %ebp # 0xff368 cmpl $-0x1, %ebp je 0x79f89 movl %ebx, %r12d movq %r14, %rbx movq 0x185d8b(%rip), %r15 # 0x1ffc88 movq 0x8545c(%rip), %rsi # 0xff360 movq %r15, %rdi callq 0x6420 testl %eax, %eax je 0x79f3c movl $0x1, %r14d movl %r14d, %eax shlq $0x4, %rax movl 0x8(%rax,%r13), %ebp cmpl $-0x1, %ebp je 0x79f89 addq %r13, %rax movq (%rax), %rsi movq %r15, %rdi callq 0x6420 incl %r14d testl %eax, %eax jne 0x79f16 movl %ebp, 0x8540e(%rip) # 0xff350 testl %ebp, %ebp jne 0x79f93 movq 0x185d43(%rip), %rdi # 0x1ffc90 callq 0x79baf testl %eax, %eax movq %rbx, %r14 movl %r12d, %ebx leaq 0x185d9f(%rip), %r12 # 0x1ffd00 jne 0x7a123 movl 0x185d73(%rip), %ecx # 0x1ffce0 jmp 0x79e02 movl $0x5, 0x853d4(%rip) # 0xff350 xorl %eax, %eax retq movl $0x16a, %eax # imm = 0x16A jmp 0x7a123 movl $0xffffffff, 0x853bd(%rip) # imm = 0xFFFFFFFF movl $0x0, 0x18619b(%rip) # 0x200138 movq 0x185cec(%rip), %rsi # 0x1ffc90 movl 0x185cee(%rip), %eax # 0x1ffc98 testq %rsi, %rsi je 0x79fca cmpl $0x2, %eax jne 0x79ff3 movl $0x2, 0x18617a(%rip) # 0x200138 movq %rsi, 0x1861c3(%rip) # 0x200188 jmp 0x7a0be cmpl $0x7, %eax jne 0x7a0b4 movl $0x7, 0x18615b(%rip) # 0x200138 jmp 0x7a0be movl $0x5, 0x85364(%rip) # 0xff350 xorl %eax, %eax jmp 0x7a123 leaq 0x6308b(%rip), %rdi # 0xdd085 callq 0x43694 testl %eax, %eax je 0x7a01a movq 0x185c86(%rip), %rsi # 0x1ffc90 leaq 0x6113b(%rip), %rdi # 0xdb14c callq 0x43694 testl %eax, %eax jne 0x7a040 movl $0x1, 0x186114(%rip) # 0x200138 movq 0x185c65(%rip), %rsi # 0x1ffc90 leaq 0x63053(%rip), %rdi # 0xdd085 callq 0x43694 testl %eax, %eax sete 0x186148(%rip) # 0x200188 cmpl $0x0, 0x1860f1(%rip) # 0x200138 jne 0x7a0be movq 0x185c40(%rip), %rdi # 0x1ffc90 leaq 0x603e8(%rip), %rsi # 0xda43f leaq 0x18612a(%rip), %rdx # 0x200188 leaq 0x18612b(%rip), %rcx # 0x200190 leaq 0x4(%rsp), %r8 xorl %eax, %eax callq 0x6140 cmpl $0x2, %eax jne 0x7a132 movq 0x185c0f(%rip), %rax # 0x1ffc90 movslq 0x4(%rsp), %rcx movzbl (%rax,%rcx), %eax cmpq $0x20, %rax ja 0x7a132 movabsq $0x100000601, %rcx # imm = 0x100000601 btq %rax, %rcx jae 0x7a132 movl $0x5, 0x186086(%rip) # 0x200138 jmp 0x7a0be movl $0x6, 0x18607a(%rip) # 0x200138 movq 0x185bdb(%rip), %rsi # 0x1ffca0 testq %rsi, %rsi je 0x7a0e4 leaq 0x1860c7(%rip), %rdi # 0x200198 movl $0x50, %edx callq 0x64e0 movb $0x0, 0x186105(%rip) # 0x2001e7 jmp 0x7a0eb movb $0x0, 0x1860ad(%rip) # 0x200198 movq 0x185b96(%rip), %rsi # 0x1ffc88 leaq 0x186043(%rip), %rbx # 0x20013c movl $0x4b, %edx movq %rbx, %rdi callq 0x64e0 movb $0x0, 0x186079(%rip) # 0x200186 movq %rbx, %rdi callq 0x6280 xorl %ecx, %ecx cmpq $0x4c, %rax movl $0x170, %eax # imm = 0x170 cmovbl %ecx, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq cmpl $0x0, 0x185fff(%rip) # 0x200138 jne 0x7a0be movq 0x185b4e(%rip), %rbx # 0x1ffc90 movq %rbx, %rdi movl $0x2e, %esi callq 0x63c0 testq %rax, %rax je 0x7a20d leaq 0x602ec(%rip), %rsi # 0xda44b leaq 0x186022(%rip), %rdx # 0x200188 leaq 0x4(%rsp), %rcx movq %rbx, %rdi xorl %eax, %eax callq 0x6140 cmpl $0x1, %eax jne 0x7a20d movq 0x185b0b(%rip), %rcx # 0x1ffc90 movslq 0x4(%rsp), %r14 movzbl (%rcx,%r14), %eax cmpl $0x1f, %eax jg 0x7a1a2 leal -0x9(%rax), %ecx cmpl $0x2, %ecx jb 0x7a1f9 testl %eax, %eax je 0x7a1f9 jmp 0x7a20d cmpl $0x20, %eax je 0x7a1f9 cmpl $0x44, %eax jne 0x7a20d movb $0x45, (%rcx,%r14) movq 0x185ad8(%rip), %rdi # 0x1ffc90 leaq 0x6028c(%rip), %rsi # 0xda44b leaq 0x185fc2(%rip), %rdx # 0x200188 leaq 0x4(%rsp), %rbx movq %rbx, %rcx xorl %eax, %eax callq 0x6140 movq 0x185ab4(%rip), %rax # 0x1ffc90 movslq (%rbx), %rcx movzbl (%rax,%rcx), %ecx cmpq $0x20, %rcx ja 0x7a208 movabsq $0x100000601, %rdx # imm = 0x100000601 btq %rcx, %rdx jae 0x7a208 movl $0x4, 0x185f35(%rip) # 0x200138 jmp 0x7a0be movb $0x44, (%rax,%r14) cmpl $0x0, 0x185f24(%rip) # 0x200138 jne 0x7a0be movq 0x185a6f(%rip), %rdi # 0x1ffc90 leaq 0x60229(%rip), %rsi # 0xda451 leaq 0x185f59(%rip), %rdx # 0x200188 leaq 0x4(%rsp), %rcx xorl %eax, %eax callq 0x6140 cmpl $0x1, %eax jne 0x7a275 movq 0x185a49(%rip), %rax # 0x1ffc90 movslq 0x4(%rsp), %rcx movzbl (%rax,%rcx), %eax cmpq $0x20, %rax ja 0x7a275 movabsq $0x100000601, %rcx # imm = 0x100000601 btq %rax, %rcx jae 0x7a275 movl $0x3, 0x185ec8(%rip) # 0x200138 jmp 0x7a0be cmpl $0x0, 0x185ebc(%rip) # 0x200138 jne 0x7a0be movl $0x2, 0x185eac(%rip) # 0x200138 movq 0x1859fd(%rip), %rax # 0x1ffc90 movq %rax, 0x185eee(%rip) # 0x200188 jmp 0x7a0be
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/grparser.c
ngp_hdu_insert_token
int ngp_hdu_insert_token(NGP_HDU *ngph, NGP_TOKEN *newtok) { NGP_TOKEN *tkp; if (NULL == ngph) return(NGP_NUL_PTR); if (NULL == newtok) return(NGP_NUL_PTR); if (0 == ngph->tokcnt) tkp = (NGP_TOKEN *)ngp_alloc((ngph->tokcnt + 1) * sizeof(NGP_TOKEN)); else tkp = (NGP_TOKEN *)ngp_realloc(ngph->tok, (ngph->tokcnt + 1) * sizeof(NGP_TOKEN)); if (NULL == tkp) return(NGP_NO_MEMORY); ngph->tok = tkp; ngph->tok[ngph->tokcnt] = *newtok; if (NGP_TTYPE_STRING == newtok->type) { if (NULL != newtok->value.s) { ngph->tok[ngph->tokcnt].value.s = (char *)ngp_alloc(1 + strlen(newtok->value.s)); if (NULL == ngph->tok[ngph->tokcnt].value.s) return(NGP_NO_MEMORY); strcpy(ngph->tok[ngph->tokcnt].value.s, newtok->value.s); } } ngph->tokcnt++; return(NGP_OK); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax testq %rdi, %rdi sete %al testq %rsi, %rsi sete %cl orb %al, %cl movl $0x16a, %ebp # imm = 0x16A jne 0x7a79b movq %rsi, %r14 movq %rdi, %rbx movslq (%rdi), %rax testq %rax, %rax je 0x7a728 movq 0x8(%rbx), %rdi imulq $0xb0, %rax, %rsi addq $0xb0, %rsi callq 0x6658 jmp 0x7a732 movl $0xb0, %edi callq 0x61a0 movq %rax, %r15 movl $0x168, %ebp # imm = 0x168 testq %rax, %rax je 0x7a79b movq %r15, 0x8(%rbx) movslq (%rbx), %r12 imulq $0xb0, %r12, %r13 leaq (%r15,%r13), %rdi movl $0xb0, %edx movq %r14, %rsi callq 0x65c0 cmpl $0x2, (%r14) jne 0x7a793 movq 0x50(%r14), %r14 testq %r14, %r14 je 0x7a793 movq %r14, %rdi callq 0x6280 leaq 0x1(%rax), %rdi callq 0x61a0 movq %rax, 0x50(%r15,%r13) testq %rax, %rax je 0x7a79b movq %rax, %rdi movq %r14, %rsi callq 0x6460 incl %r12d movl %r12d, (%rbx) xorl %ebp, %ebp movl %ebp, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/grparser.c
ngp_read_group
int ngp_read_group(fitsfile *ff, char *grpname, int parent_hn) { int r, exitflg, l, my_hn, tmp0, incrementor_index; char grnm[NGP_MAX_STRING]; /* keyword holding group name */ char incrementor_name[NGP_MAX_STRING]; NGP_HDU ngph; incrementor_name[0] = 0; /* signal no keyword+'#' found yet */ incrementor_index = 6; /* first 6 cols are used by group */ ngp_grplevel++; if (NGP_OK != (r = ngp_hdu_init(&ngph))) return(r); r = NGP_OK; if (NGP_OK != (r = fits_create_group(ff, grpname, GT_ID_ALL_URI, &r))) return(r); fits_get_hdu_num(ff, &my_hn); if (parent_hn > 0) { fits_movabs_hdu(ff, parent_hn, &tmp0, &r); /* link us to parent */ fits_add_group_member(ff, NULL, my_hn, &r); fits_movabs_hdu(ff, my_hn, &tmp0, &r); if (NGP_OK != r) return(r); } for (exitflg = 0; 0 == exitflg;) { if (NGP_OK != (r = ngp_read_line(0))) break; /* EOF always means error here */ switch (ngp_keyidx) { case NGP_TOKEN_SIMPLE: case NGP_TOKEN_EOF: r = NGP_TOKEN_NOT_EXPECT; break; case NGP_TOKEN_END: ngp_grplevel--; exitflg = 1; break; case NGP_TOKEN_GROUP: if (NGP_TTYPE_STRING == ngp_linkey.type) { strncpy(grnm, ngp_linkey.value.s, NGP_MAX_STRING); } else { snprintf(grnm, NGP_MAX_STRING,"DEFAULT_GROUP_%d", master_grp_idx++); } grnm[NGP_MAX_STRING - 1] = 0; r = ngp_read_group(ff, grnm, my_hn); break; /* we can have many subsequent GROUP defs */ case NGP_TOKEN_XTENSION: r = ngp_unread_line(); if (NGP_OK != r) break; r = ngp_read_xtension(ff, my_hn, 0); break; /* we can have many subsequent HDU defs */ default: l = strlen(ngp_linkey.name); if ((l >= 2) && (l <= 6)) { if ('#' == ngp_linkey.name[l - 1]) { if (0 == incrementor_name[0]) { memcpy(incrementor_name, ngp_linkey.name, l - 1); incrementor_name[l - 1] = 0; } if (((l - 1) == (int)strlen(incrementor_name)) && (0 == memcmp(incrementor_name, ngp_linkey.name, l - 1))) { incrementor_index++; } snprintf(ngp_linkey.name + l - 1, NGP_MAX_NAME-l+1,"%d", incrementor_index); } } r = ngp_hdu_insert_token(&ngph, &ngp_linkey); break; /* here we can add keyword */ } if (NGP_OK != r) break; } fits_movabs_hdu(ff, my_hn, &tmp0, &r); /* back to our HDU */ if (NGP_OK == r) /* create additional columns, if requested */ r = ngp_append_columns(ff, &ngph, 6); if (NGP_OK == r) /* and write keywords */ r = ngp_keyword_all_write(&ngph, ff, NGP_NON_SYSTEM_ONLY); if (NGP_OK != r) /* delete group in case of error */ { tmp0 = 0; fits_remove_group(ff, OPT_RM_GPT, &tmp0); } ngp_hdu_clear(&ngph); /* we are done with this HDU, so delete it */ return(r); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xc8, %rsp movl %edx, %ebp movq %rdi, %rbx movb $0x0, 0x20(%rsp) incl 0x184d01(%rip) # 0x1ffce4 movq $0x0, 0x18(%rsp) xorl %eax, %eax movl %eax, 0x10(%rsp) movq %rsp, %r14 movl %eax, (%r14) xorl %edx, %edx movq %r14, %rcx callq 0x72814 movl %eax, (%r14) testl %eax, %eax jne 0x7b2ec leaq 0x4(%rsp), %rsi movq %rbx, %rdi callq 0x3becc testl %ebp, %ebp jle 0x7b064 leaq 0xc(%rsp), %r14 movq %rsp, %r15 movq %rbx, %rdi movl %ebp, %esi movq %r14, %rdx movq %r15, %rcx callq 0x37f5e movl 0x4(%rsp), %edx movq %rbx, %rdi xorl %esi, %esi movq %r15, %rcx callq 0x757b0 movl 0x4(%rsp), %esi movq %rbx, %rdi movq %r14, %rdx movq %r15, %rcx callq 0x37f5e movl (%r15), %eax testl %eax, %eax jne 0x7b2ec movl $0x6, 0x8(%rsp) leaq 0x1850c9(%rip), %r14 # 0x20013c leaq 0x10(%rsp), %r12 leaq 0x5f36d(%rip), %rbp # 0xda3ec leaq 0x70(%rsp), %r15 xorl %edi, %edi callq 0x79db6 movl %eax, (%rsp) testl %eax, %eax jne 0x7b27e movl 0x842b4(%rip), %eax # 0xff350 decl %eax cmpl $0x4, %eax ja 0x7b0d3 movslq (%rbp,%rax,4), %rax addq %rbp, %rax jmpq *%rax cmpl $0x2, 0x185084(%rip) # 0x200138 jne 0x7b1c2 movq 0x1850c7(%rip), %rsi # 0x200188 movl $0x50, %edx movq %r15, %rdi callq 0x64e0 jmp 0x7b1e7 movq %r14, %rdi callq 0x6280 movq %rax, %r13 addl $-0x2, %eax cmpl $0x4, %eax ja 0x7b242 movq %r15, %rbp movq %r14, %r15 leal -0x1(%r13), %r14d leaq 0x18503d(%rip), %rax # 0x200138 cmpb $0x23, 0x4(%r14,%rax) jne 0x7b235 cmpb $0x0, 0x20(%rsp) leaq 0x20(%rsp), %rdi jne 0x7b129 movq %r15, %rsi movq %r14, %rdx callq 0x65c0 leaq 0x20(%rsp), %rdi movb $0x0, 0x20(%rsp,%r14) movq %rdi, %r12 callq 0x6280 cmpl %eax, %r14d jne 0x7b200 movq %r12, %rdi movq %r15, %rsi movq %r14, %rdx callq 0x6340 cmpl $0x1, %eax movl 0x8(%rsp), %ecx adcl $0x0, %ecx jmp 0x7b204 cmpq $0x0, 0x184b21(%rip) # 0x1ffc80 je 0x7b26f cmpq $0x0, 0x184b43(%rip) # 0x1ffcb0 jne 0x7b276 movups 0x184b26(%rip), %xmm0 # 0x1ffca0 movups %xmm0, 0x184b4f(%rip) # 0x1ffcd0 movups 0x184b08(%rip), %xmm0 # 0x1ffc90 movups %xmm0, 0x184b31(%rip) # 0x1ffcc0 movups 0x184aea(%rip), %xmm0 # 0x1ffc80 movups %xmm0, 0x184b13(%rip) # 0x1ffcb0 movq $0x0, 0x184ad8(%rip) # 0x1ffc80 movl $0x0, (%rsp) movl 0x4(%rsp), %esi movq %rbx, %rdi xorl %edx, %edx callq 0x7a959 jmp 0x7b251 movl 0x841f8(%rip), %ecx # 0xff3c0 leal 0x1(%rcx), %eax movl %eax, 0x841ef(%rip) # 0xff3c0 movl $0x50, %esi movq %r15, %rdi leaq 0x5f2be(%rip), %rdx # 0xda49e xorl %eax, %eax callq 0x60b0 movb $0x0, 0xbf(%rsp) movl 0x4(%rsp), %edx movq %rbx, %rdi movq %r15, %rsi callq 0x7afc2 jmp 0x7b251 movl 0x8(%rsp), %ecx leaq 0x10(%rsp), %r12 movl %r13d, %eax leaq 0x184f25(%rip), %rdx # 0x200138 leaq (%rax,%rdx), %rdi addq $0x3, %rdi movl $0x4c, %esi subl %r13d, %esi leaq 0x541f8(%rip), %rdx # 0xcf422 movl %ecx, 0x8(%rsp) xorl %eax, %eax callq 0x60b0 movq %r15, %r14 movq %rbp, %r15 leaq 0x5f1aa(%rip), %rbp # 0xda3ec movq %r12, %rdi leaq 0x184eec(%rip), %rsi # 0x200138 callq 0x7a6dd movl %eax, (%rsp) testl %eax, %eax je 0x7b084 jmp 0x7b27e movl $0x171, (%rsp) # imm = 0x171 jmp 0x7b27e decl 0x184a77(%rip) # 0x1ffce4 jmp 0x7b27e movl $0x16b, %eax # imm = 0x16B jmp 0x7b27b movl $0x16c, %eax # imm = 0x16C movl %eax, (%rsp) movl 0x4(%rsp), %esi leaq 0xc(%rsp), %rdx movq %rsp, %r14 movq %rbx, %rdi movq %r14, %rcx callq 0x37f5e cmpl $0x0, (%r14) jne 0x7b2ca leaq 0x10(%rsp), %rsi movq %rbx, %rdi movl $0x6, %edx callq 0x7a7ac movl %eax, (%rsp) testl %eax, %eax jne 0x7b2ca leaq 0x10(%rsp), %rdi movq %rbx, %rsi xorl %edx, %edx callq 0x7a3a1 movl %eax, (%rsp) testl %eax, %eax je 0x7b2df leaq 0xc(%rsp), %rdx movl $0x0, (%rdx) movq %rbx, %rdi xorl %esi, %esi callq 0x73685 leaq 0x10(%rsp), %rdi callq 0x7a65d movl (%rsp), %eax addq $0xc8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/grparser.c
fits_rebin_wcsd
int fits_rebin_wcsd( fitsfile *fptr, /* I - pointer to table to be binned */ int naxis, /* I - number of axes in the histogram image */ double *amin, /* I - first pixel include in each axis */ double *binsize, /* I - binning factor for each axis */ int *status) { /* Update the WCS keywords that define the location of the reference */ /* pixel, and the pixel size, along each axis. */ int ii, jj, tstatus, reset ; char keyname[FLEN_KEYWORD], svalue[FLEN_VALUE]; double dvalue; if (*status > 0) return(*status); for (ii = 0; ii < naxis; ii++) { reset = 0; /* flag to reset the reference pixel */ tstatus = 0; ffkeyn("CRVAL", ii + 1, keyname, &tstatus); /* get previous (pre-binning) value */ ffgky(fptr, TDOUBLE, keyname, &dvalue, NULL, &tstatus); if (!tstatus && dvalue == 1.0) { reset = 1; } tstatus = 0; /* CRPIXn - update location of the ref. pix. in the binned image */ ffkeyn("CRPIX", ii + 1, keyname, &tstatus); /* get previous (pre-binning) value */ ffgky(fptr, TDOUBLE, keyname, &dvalue, NULL, &tstatus); if (!tstatus) { if (dvalue != 1.0) reset = 0; /* updated value to give pixel location after binning */ dvalue = (dvalue - amin[ii]) / ((double) binsize[ii]) + .5; fits_modify_key_dbl(fptr, keyname, dvalue, -14, NULL, &tstatus); } else { reset = 0; } /* CDELTn - update unit size of pixels */ tstatus = 0; ffkeyn("CDELT", ii + 1, keyname, &tstatus); /* get previous (pre-binning) value */ ffgky(fptr, TDOUBLE, keyname, &dvalue, NULL, &tstatus); if (!tstatus) { if (dvalue != 1.0) reset = 0; /* updated to give post-binning value */ dvalue = dvalue * binsize[ii]; fits_modify_key_dbl(fptr, keyname, dvalue, -14, NULL, &tstatus); } else { /* no CDELTn keyword, so look for a CDij keywords */ reset = 0; for (jj = 0; jj < naxis; jj++) { tstatus = 0; ffkeyn("CD", jj + 1, svalue, &tstatus); strcat(svalue,"_"); ffkeyn(svalue, ii + 1, keyname, &tstatus); /* get previous (pre-binning) value */ ffgky(fptr, TDOUBLE, keyname, &dvalue, NULL, &tstatus); if (!tstatus) { /* updated to give post-binning value */ dvalue = dvalue * binsize[ii]; fits_modify_key_dbl(fptr, keyname, dvalue, -14, NULL, &tstatus); } } } if (reset) { /* the original CRPIX, CRVAL, and CDELT keywords were all = 1.0 */ /* In this special case, reset the reference pixel to be the */ /* first pixel in the array (instead of possibly far off the array) */ dvalue = 1.0; ffkeyn("CRPIX", ii + 1, keyname, &tstatus); fits_modify_key_dbl(fptr, keyname, dvalue, -14, NULL, &tstatus); ffkeyn("CRVAL", ii + 1, keyname, &tstatus); dvalue = amin[ii] + (binsize[ii] / 2.0); fits_modify_key_dbl(fptr, keyname, dvalue, -14, NULL, &tstatus); } } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x108, %rsp # imm = 0x108 movq %rcx, 0x18(%rsp) movq %rdx, 0x30(%rsp) movl (%r8), %eax testl %eax, %eax setg %cl testl %esi, %esi setle %dl orb %cl, %dl jne 0x7dc7b movq %rdi, %r13 movq %r8, 0x38(%rsp) movl %esi, %eax movq %rax, 0x40(%rsp) negl %esi movq %rsi, 0x48(%rsp) leaq 0xb0(%rsp), %rbx leaq 0xc(%rsp), %r15 leaq 0x60(%rsp), %r14 xorl %ebp, %ebp xorl %eax, %eax movl %eax, 0xc(%rsp) movq %rbp, 0x20(%rsp) incq %rbp leaq 0x5d1b1(%rip), %rdi # 0xdab55 movl %ebp, %esi movq %rbx, %rdx movq %r15, %rcx callq 0x380c3 movq %r13, %rdi movl $0x52, %esi movq %rbx, %rdx leaq 0x10(%rsp), %r12 movq %r12, %rcx xorl %r8d, %r8d movq %r15, %r9 callq 0x6da65 movl 0xc(%rsp), %eax movl %eax, 0x2c(%rsp) movsd 0x10(%rsp), %xmm0 movapd %xmm0, 0x50(%rsp) xorl %eax, %eax movl %eax, 0xc(%rsp) leaq 0x4eeb5(%rip), %rdi # 0xcc8a5 movl %ebp, %esi movq %rbx, %rdx movq %r15, %rcx callq 0x380c3 movq %r13, %rdi movl $0x52, %esi movq %rbx, %rdx movq %r12, %rcx xorl %r8d, %r8d movq %r15, %r9 callq 0x6da65 movb $0x1, %r12b xorl %eax, %eax cmpl %eax, 0xc(%rsp) jne 0x7da93 cmpl $0x0, 0x2c(%rsp) setne %al movsd 0x10(%rsp), %xmm0 movsd 0x4b649(%rip), %xmm2 # 0xc9080 movapd 0x50(%rsp), %xmm3 cmpneqpd %xmm2, %xmm3 movapd %xmm0, %xmm1 cmpneqpd %xmm2, %xmm1 orpd %xmm3, %xmm1 movd %xmm1, %r12d orb %al, %r12b movq 0x30(%rsp), %rax movq 0x20(%rsp), %rcx subsd (%rax,%rcx,8), %xmm0 movq 0x18(%rsp), %rax divsd (%rax,%rcx,8), %xmm0 addsd 0x56098(%rip), %xmm0 # 0xd3b10 movsd %xmm0, 0x10(%rsp) movq %r13, %rdi movq %rbx, %rsi movl $0xfffffff2, %edx # imm = 0xFFFFFFF2 xorl %ecx, %ecx movq %r15, %r8 callq 0x9510e movl $0x0, 0xc(%rsp) leaq 0x4ee09(%rip), %rdi # 0xcc8ab movl %ebp, %esi movq %rbx, %rdx movq %r15, %rcx callq 0x380c3 movq %r13, %rdi movl $0x52, %esi movq %rbx, %rdx leaq 0x10(%rsp), %rcx xorl %r8d, %r8d movq %r15, %r9 callq 0x6da65 cmpl $0x0, 0xc(%rsp) je 0x7db89 movl $0x1, %r12d movl $0x0, 0xc(%rsp) leaq 0x5d194(%rip), %rdi # 0xdac7e movl %r12d, %esi movq %r14, %rdx movq %r15, %rcx callq 0x380c3 movq %r14, %rdi callq 0x6280 movw $0x5f, 0x60(%rsp,%rax) movq %r14, %rdi movl %ebp, %esi movq %rbx, %rdx movq %r15, %rcx callq 0x380c3 movq %r13, %rdi movl $0x52, %esi movq %rbx, %rdx leaq 0x10(%rsp), %rcx xorl %r8d, %r8d movq %r15, %r9 callq 0x6da65 cmpl $0x0, 0xc(%rsp) jne 0x7db69 movsd 0x10(%rsp), %xmm0 movq 0x18(%rsp), %rax movq 0x20(%rsp), %rcx mulsd (%rax,%rcx,8), %xmm0 movsd %xmm0, 0x10(%rsp) movq %r13, %rdi movq %rbx, %rsi movl $0xfffffff2, %edx # imm = 0xFFFFFFF2 xorl %ecx, %ecx movq %r15, %r8 callq 0x9510e movq 0x48(%rsp), %rax addl %r12d, %eax incl %eax movl %r12d, %ecx incl %ecx movl %ecx, %r12d cmpl $0x1, %eax jne 0x7dadb jmp 0x7dc69 movsd 0x10(%rsp), %xmm0 ucomisd 0x4b4e9(%rip), %xmm0 # 0xc9080 setp %al movl %r12d, %ecx setne %r12b orb %al, %r12b orb %cl, %r12b movq 0x18(%rsp), %rax movq 0x20(%rsp), %rcx mulsd (%rax,%rcx,8), %xmm0 movsd %xmm0, 0x10(%rsp) movq %r13, %rdi movq %rbx, %rsi movl $0xfffffff2, %edx # imm = 0xFFFFFFF2 xorl %ecx, %ecx movq %r15, %r8 callq 0x9510e testb $0x1, %r12b jne 0x7dc69 movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000 movq %rax, 0x10(%rsp) leaq 0x4ecb4(%rip), %rdi # 0xcc8a5 movl %ebp, %esi movq %rbx, %rdx movq %r15, %rcx callq 0x380c3 movsd 0x10(%rsp), %xmm0 movq %r13, %rdi movq %rbx, %rsi movl $0xfffffff2, %edx # imm = 0xFFFFFFF2 xorl %ecx, %ecx movq %r15, %r8 callq 0x9510e leaq 0x5cf35(%rip), %rdi # 0xdab55 movl %ebp, %esi movq %rbx, %rdx movq %r15, %rcx callq 0x380c3 movq 0x18(%rsp), %rax movq 0x20(%rsp), %rcx movsd (%rax,%rcx,8), %xmm0 mulsd 0x55ecc(%rip), %xmm0 # 0xd3b10 movq 0x30(%rsp), %rax addsd (%rax,%rcx,8), %xmm0 movsd %xmm0, 0x10(%rsp) movq %r13, %rdi movq %rbx, %rsi movl $0xfffffff2, %edx # imm = 0xFFFFFFF2 xorl %ecx, %ecx movq %r15, %r8 callq 0x9510e cmpq 0x40(%rsp), %rbp jne 0x7d98f movq 0x38(%rsp), %rax movl (%rax), %eax addq $0x108, %rsp # imm = 0x108 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/histo.c
ffhist3
fitsfile *ffhist3(fitsfile *fptr, /* I - ptr to table with X and Y cols*/ char *outfile, /* I - name for the output histogram file */ int imagetype, /* I - datatype for image: TINT, TSHORT, etc */ int naxis, /* I - number of axes in the histogram image */ char colname[4][FLEN_VALUE], /* I - column names */ double *minin, /* I - minimum histogram value, for each axis */ double *maxin, /* I - maximum histogram value, for each axis */ double *binsizein, /* I - bin size along each axis */ char minname[4][FLEN_VALUE], /* I - optional keywords for min */ char maxname[4][FLEN_VALUE], /* I - optional keywords for max */ char binname[4][FLEN_VALUE], /* I - optional keywords for binsize */ double weightin, /* I - binning weighting factor */ char wtcol[FLEN_VALUE], /* I - optional keyword or col for weight*/ int recip, /* I - use reciprocal of the weight? */ char *selectrow, /* I - optional array (length = no. of */ /* rows in the table). If the element is true */ /* then the corresponding row of the table will*/ /* be included in the histogram, otherwise the */ /* row will be skipped. Ingnored if *selectrow*/ /* is equal to NULL. */ int *status) { fitsfile *histptr; int bitpix, colnum[4], wtcolnum; long haxes[4]; double amin[4], amax[4], binsize[4], weight; if (*status > 0) return(NULL); if (naxis > 4) { ffpmsg("histogram has more than 4 dimensions"); *status = BAD_DIMEN; return(NULL); } /* reset position to the correct HDU if necessary */ if ((fptr)->HDUposition != ((fptr)->Fptr)->curhdu) ffmahd(fptr, ((fptr)->HDUposition) + 1, NULL, status); if (imagetype == TBYTE) bitpix = BYTE_IMG; else if (imagetype == TSHORT) bitpix = SHORT_IMG; else if (imagetype == TINT) bitpix = LONG_IMG; else if (imagetype == TFLOAT) bitpix = FLOAT_IMG; else if (imagetype == TDOUBLE) bitpix = DOUBLE_IMG; else{ *status = BAD_DATATYPE; return(NULL); } /* Calculate the binning parameters: */ /* columm numbers, axes length, min values, max values, and binsizes. */ if (fits_calc_binningd( fptr, naxis, colname, minin, maxin, binsizein, minname, maxname, binname, colnum, haxes, amin, amax, binsize, status) > 0) { ffpmsg("failed to determine binning parameters"); return(NULL); } /* get the histogramming weighting factor, if any */ if (*wtcol) { /* first, look for a keyword with the weight value */ if (fits_read_key(fptr, TDOUBLE, wtcol, &weight, NULL, status) ) { /* not a keyword, so look for column with this name */ *status = 0; /* get the column number in the table */ if (ffgcno(fptr, CASEINSEN, wtcol, &wtcolnum, status) > 0) { ffpmsg( "keyword or column for histogram weights doesn't exist: "); ffpmsg(wtcol); return(NULL); } weight = DOUBLENULLVALUE; } } else weight = (double) weightin; if (weight <= 0. && weight != DOUBLENULLVALUE) { ffpmsg("Illegal histogramming weighting factor <= 0."); *status = URL_PARSE_ERROR; return(NULL); } if (recip && weight != DOUBLENULLVALUE) /* take reciprocal of weight */ weight = (double) (1.0 / weight); /* size of histogram is now known, so create temp output file */ if (fits_create_file(&histptr, outfile, status) > 0) { ffpmsg("failed to create temp output file for histogram"); return(NULL); } /* create output FITS image HDU */ if (ffcrim(histptr, bitpix, naxis, haxes, status) > 0) { ffpmsg("failed to create output histogram FITS image"); return(NULL); } /* copy header keywords, converting pixel list WCS keywords to image WCS */ if (fits_copy_pixlist2image(fptr, histptr, 9, naxis, colnum, status) > 0) { ffpmsg("failed to copy pixel list keywords to new histogram header"); return(NULL); } /* if the table columns have no WCS keywords, then write default keywords */ fits_write_keys_histo(fptr, histptr, naxis, colnum, status); /* update the WCS keywords for the ref. pixel location, and pixel size */ fits_rebin_wcsd(histptr, naxis, amin, binsize, status); /* now compute the output image by binning the column values */ if (fits_make_histd(fptr, histptr, bitpix, naxis, haxes, colnum, amin, amax, binsize, weight, wtcolnum, recip, selectrow, status) > 0) { ffpmsg("failed to calculate new histogram values"); return(NULL); } return(histptr); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xb8, %rsp movl %ecx, %ebp movq 0x130(%rsp), %rcx cmpl $0x0, (%rcx) jg 0x7e90a cmpl $0x5, %ebp jl 0x7e81d leaq 0x5bfab(%rip), %rdi # 0xda7b5 movq %rcx, %rbx callq 0x37264 movl $0x140, (%rbx) # imm = 0x140 jmp 0x7e90a movq %r9, %r13 movq %r8, %r15 movl %edx, %ebx movq %rsi, %r12 movq %rdi, %r14 movl (%rdi), %esi movq 0x8(%rdi), %rax cmpl 0x54(%rax), %esi movsd %xmm0, 0x18(%rsp) je 0x7e848 incl %esi movq %r14, %rdi xorl %edx, %edx callq 0x37f5e cmpl $0x1e, %ebx jle 0x7e867 cmpl $0x1f, %ebx je 0x7e881 cmpl $0x2a, %ebx je 0x7e888 cmpl $0x52, %ebx jne 0x7e992 movl $0xffffffc0, %eax # imm = 0xFFFFFFC0 jmp 0x7e88d movl $0x8, %eax cmpl $0xb, %ebx je 0x7e88d cmpl $0x15, %ebx jne 0x7e992 movl $0x10, %eax jmp 0x7e88d movl $0x20, %eax jmp 0x7e88d movl $0xffffffe0, %eax # imm = 0xFFFFFFE0 movl %eax, 0x10(%rsp) movq 0xf0(%rsp), %r9 xorl %eax, %eax leaq 0x70(%rsp), %r11 leaq 0x90(%rsp), %rbx leaq 0x50(%rsp), %r10 movq %r14, %rdi movl %ebp, %esi movq %r15, %rdx xorl %ecx, %ecx movq %r13, %r8 pushq 0x130(%rsp) pushq %rax pushq %r11 pushq %rbx leaq 0x50(%rsp), %r11 pushq %r11 pushq %r10 pushq %rax leaq 0x58(%rsp), %rax pushq %rax pushq 0x150(%rsp) pushq 0x150(%rsp) pushq 0x150(%rsp) pushq 0x150(%rsp) callq 0x7c936 addq $0x60, %rsp testl %eax, %eax jle 0x7e91e leaq 0x5bed5(%rip), %rdi # 0xda7da callq 0x37264 xorl %eax, %eax addq $0xb8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl 0x120(%rsp), %r13d movq 0x118(%rsp), %rbx cmpb $0x0, (%rbx) je 0x7e9a5 leaq 0x8(%rsp), %rcx movq %r14, %rdi movl $0x52, %esi movq %rbx, %rdx xorl %r8d, %r8d movq 0x130(%rsp), %r15 movq %r15, %r9 callq 0x6da65 testl %eax, %eax je 0x7e9b3 movl $0x0, (%r15) leaq 0x14(%rsp), %rcx movq %r14, %rdi xorl %esi, %esi movq %rbx, %rdx movq %r15, %r8 callq 0x3ac2d testl %eax, %eax jle 0x7ea13 leaq 0x5be7c(%rip), %rdi # 0xda801 callq 0x37264 movq %rbx, %rdi jmp 0x7e905 movq 0x130(%rsp), %rax movl $0x19a, (%rax) # imm = 0x19A jmp 0x7e90a movsd 0x18(%rsp), %xmm1 movsd %xmm1, 0x8(%rsp) jmp 0x7e9b9 movsd 0x8(%rsp), %xmm1 xorpd %xmm0, %xmm0 ucomisd %xmm1, %xmm0 jb 0x7e9ee ucomisd 0x4c8a5(%rip), %xmm1 # 0xcb270 jne 0x7e9cf jnp 0x7e9ee leaq 0x5bece(%rip), %rdi # 0xda8a4 callq 0x37264 movq 0x130(%rsp), %rax movl $0x7d, (%rax) jmp 0x7e90a testl %r13d, %r13d je 0x7ea22 ucomisd 0x4c875(%rip), %xmm1 # 0xcb270 jne 0x7e9ff jnp 0x7ea22 movsd 0x4a679(%rip), %xmm0 # 0xc9080 divsd %xmm1, %xmm0 movsd %xmm0, 0x8(%rsp) jmp 0x7ea22 movabsq $-0x4757c1d7a1454b49, %rax # imm = 0xB8A83E285EBAB4B7 movq %rax, 0x8(%rsp) movq %rsp, %rdi movq %r12, %rsi movq 0x130(%rsp), %r12 movq %r12, %rdx callq 0x10ed0 testl %eax, %eax jle 0x7ea48 leaq 0x5be8e(%rip), %rdi # 0xda8d1 jmp 0x7e905 movq (%rsp), %rdi leaq 0x50(%rsp), %rcx movl 0x10(%rsp), %esi movl %ebp, %edx movq %r12, %r8 callq 0xad1e8 testl %eax, %eax jle 0x7ea6f leaq 0x5be97(%rip), %rdi # 0xda901 jmp 0x7e905 movq (%rsp), %rsi leaq 0x20(%rsp), %r15 movq %r14, %rdi movl $0x9, %edx movl %ebp, %ecx movq %r15, %r8 movq %r12, %r9 callq 0x396a8 testl %eax, %eax jle 0x7ea9d leaq 0x5be96(%rip), %rdi # 0xda92e jmp 0x7e905 movq (%rsp), %rsi subq $0x8, %rsp movq %r14, %rdi movl %ebp, %edx movq %r15, %rcx xorl %r8d, %r8d xorl %r9d, %r9d pushq %r12 callq 0x7d5f9 addq $0x10, %rsp movq (%rsp), %rdi movl %ebp, %esi leaq 0x30(%rsp), %rdx leaq 0x70(%rsp), %rbx movq %rbx, %rcx movq %r12, %r8 callq 0x7d935 movq (%rsp), %rsi movsd 0x8(%rsp), %xmm0 movl 0x14(%rsp), %eax leaq 0x50(%rsp), %r9 movq %r14, %rdi xorl %edx, %edx movl 0x10(%rsp), %ecx movl %ebp, %r8d pushq %r12 pushq 0x130(%rsp) pushq %r13 movl $0x0, %r10d pushq %r10 pushq %rax pushq %rbx leaq 0xc0(%rsp), %rax pushq %rax leaq 0x68(%rsp), %rax pushq %rax pushq %r10 pushq %r15 callq 0x7dc8d addq $0x50, %rsp testl %eax, %eax jle 0x7eb39 leaq 0x5be35(%rip), %rdi # 0xda969 jmp 0x7e905 movq (%rsp), %rax jmp 0x7e90c
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/histo.c
ffwritehisto
int ffwritehisto(long totaln, long pixoffset, long firstn, long nvalues, int narrays, iteratorCol *imagepars, void *userPointer) /* Interator work function that writes out the histogram. The histogram values are calculated by another work function, ffcalchisto. This work function only gets called once, and totaln = nvalues. */ { iteratorCol *colpars; int ii, status = 0, ncols; long rows_per_loop = 0, offset = 0; histType *histData; histData = (histType *)userPointer; /* store pointer to the histogram array, and initialize to zero */ switch( histData->himagetype ) { case TBYTE: histData->hist.b = (char * ) fits_iter_get_array(imagepars); break; case TSHORT: histData->hist.i = (short * ) fits_iter_get_array(imagepars); break; case TINT: histData->hist.j = (int * ) fits_iter_get_array(imagepars); break; case TFLOAT: histData->hist.r = (float * ) fits_iter_get_array(imagepars); break; case TDOUBLE: histData->hist.d = (double *) fits_iter_get_array(imagepars); break; } /* call iterator function to calc the histogram pixel values */ /* must lock this call in multithreaded environoments because */ /* the ffcalchist work routine uses static vaiables that would */ /* get clobbered if multiple threads were running at the same time */ fits_iterate_data(histData->numIterCols, histData->iterCols, offset, rows_per_loop, ffcalchist, (void*)histData, &status); return(status); }
pushq %r14 pushq %rbx subq $0x18, %rsp movq 0x30(%rsp), %rbx movl $0x0, 0x14(%rsp) movl 0x24(%rbx), %eax leal -0x15(%rax), %ecx cmpl $0x3d, %ecx ja 0x80491 movabsq $0x2000000000200401, %rdx # imm = 0x2000000000200401 btq %rcx, %rdx jb 0x80496 cmpl $0xb, %eax jne 0x804a1 movq %r9, %rdi callq 0x98c52 movq %rax, (%rbx) movl 0x114(%rbx), %edi movq 0x118(%rbx), %rsi leaq 0x14(%rsp), %r14 movq %r14, (%rsp) leaq 0x56c(%rip), %r8 # 0x80a2a xorl %edx, %edx xorl %ecx, %ecx movq %rbx, %r9 callq 0x98c76 movl (%r14), %eax addq $0x18, %rsp popq %rbx popq %r14 retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/histo.c
fits_get_expr_minmax
int fits_get_expr_minmax(fitsfile *fptr, char *expr, double *datamin, double *datamax, int *datatype, int *status) /* Simple utility routine to compute the min and max value in an expression */ { parseInfo Info; ParseData lParse; struct histo_minmax_workfn_struct minmaxWorkFn; int naxis, constant, typecode, newNullKwd=0; long nelem, naxes[MAXDIMS], repeat, width, nrows; int col_cnt, colNo; Node *result; char card[81], tform[16], nullKwd[9], tdimKwd[9]; double double_nulval = DOUBLENULLVALUE; if( *status ) return( *status ); memset(&minmaxWorkFn, 0, sizeof(minmaxWorkFn)); memset(&Info, 0, sizeof(Info)); memset(&lParse, 0, sizeof(lParse)); if (datatype) *datatype = 0; ffgky(fptr, TLONG, "NAXIS2", &nrows, NULL, status); /* no. of rows */ if( ffiprs( fptr, 0, expr, MAXDIMS, &Info.datatype, &nelem, &naxis, naxes, &lParse, status ) ) { ffcprs(&lParse); return( *status ); } if (datatype) *datatype = Info.datatype; if( nelem<0 ) { /* Constant already computed */ result = lParse.Nodes + lParse.resultNode; switch( Info.datatype ) { case TDOUBLE: *datamin = *datamax = result->value.data.dbl; break; case TLONG: *datamin = *datamax = (double) result->value.data.lng; break; case TLOGICAL:*datamin = *datamax = (double) ((result->value.data.log == 1)?1:0); break; case TBIT: *datamin = *datamax = (double) ((result->value.data.str[0])?1:0); break; } ffcprs(&lParse); return( *status ); } Info.parseData = &lParse; /* Add a temporary column which contains the expression value */ if ( fits_parser_set_temporary_col( &lParse, &Info, nrows, &double_nulval, status) ) { ffcprs(&lParse); return( *status ); } /* Initialize the work function computing min/max */ minmaxWorkFn.Info = &Info; minmaxWorkFn.datamin = minmaxWorkFn.datamax = DOUBLENULLVALUE; minmaxWorkFn.ntotal = minmaxWorkFn.ngood = 0; if( ffiter( lParse.nCols, lParse.colData, 0, 0, histo_minmax_expr_workfn, (void*)&minmaxWorkFn, status ) == -1 ) *status = 0; /* -1 indicates exitted without error before end... OK */ if (datamin) *datamin = minmaxWorkFn.datamin; if (datamax) *datamax = minmaxWorkFn.datamax; ffcprs(&lParse); return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1f8, %rsp # imm = 0x1F8 movabsq $-0x4757c1d7a1454b49, %rax # imm = 0xB8A83E285EBAB4B7 movq %rax, 0x10(%rsp) movl (%r9), %eax testl %eax, %eax jne 0x806b4 movq %r9, %rbx movq %r8, %r12 movq %rdx, %r15 movq %rsi, %rbp movq %rdi, %r14 movq %rcx, 0x8(%rsp) leaq 0x58(%rsp), %rdi movl $0x90, %edx xorl %esi, %esi callq 0x6090 leaq 0xe8(%rsp), %r13 movl $0xe8, %edx movq %r13, %rdi xorl %esi, %esi callq 0x6090 testq %r12, %r12 je 0x8064f movl $0x0, (%r12) leaq 0x5bfd3(%rip), %rdx # 0xdc629 leaq 0x18(%rsp), %rcx movq %r14, %rdi movl $0x29, %esi xorl %r8d, %r8d movq %rbx, %r9 callq 0x6da65 leaq 0x1d0(%rsp), %rax leaq 0x2c(%rsp), %r10 leaq 0x58(%rsp), %r8 leaq 0x20(%rsp), %r9 movq %r14, %rdi xorl %esi, %esi movq %rbp, %rdx movl $0x5, %ecx pushq %rbx pushq %r13 pushq %rax pushq %r10 callq 0x20b15 addq $0x20, %rsp testl %eax, %eax je 0x806c6 leaq 0xe8(%rsp), %rdi callq 0x20f38 movl (%rbx), %eax addq $0x1f8, %rsp # imm = 0x1F8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq testq %r12, %r12 je 0x806d3 movl 0x58(%rsp), %eax movl %eax, (%r12) cmpq $0x0, 0x20(%rsp) js 0x80789 leaq 0x58(%rsp), %r14 movq %r13, 0x28(%r14) movq 0x18(%rsp), %rdx leaq 0x10(%rsp), %rcx movq %r13, %rdi movq %r14, %rsi movq %rbx, %r8 callq 0x25498 testl %eax, %eax jne 0x806a5 leaq 0x30(%rsp), %r9 movq %r14, (%r9) movapd 0x59dcc(%rip), %xmm0 # 0xda4e0 movupd %xmm0, 0x8(%r9) xorpd %xmm0, %xmm0 movupd %xmm0, 0x18(%r9) movl 0x148(%rsp), %edi movq 0x188(%rsp), %rsi subq $0x8, %rsp leaq 0x214(%rip), %r8 # 0x80952 xorl %edx, %edx xorl %ecx, %ecx pushq %rbx callq 0x98c76 addq $0x10, %rsp cmpl $-0x1, %eax jne 0x80757 movl $0x0, (%rbx) testq %r15, %r15 movq 0x8(%rsp), %rax je 0x8076c movsd 0x38(%rsp), %xmm0 movsd %xmm0, (%r15) testq %rax, %rax je 0x806a5 movsd 0x40(%rsp), %xmm0 movq 0x8(%rsp), %rax movsd %xmm0, (%rax) jmp 0x806a5 movslq 0x130(%rsp), %rax leaq (%rax,%rax,2), %rax shlq $0x7, %rax addq 0x120(%rsp), %rax movl 0x58(%rsp), %ecx cmpl $0x28, %ecx jg 0x807c7 cmpl $0x1, %ecx je 0x807df cmpl $0xe, %ecx jne 0x806a5 cmpb $0x1, 0x80(%rax) je 0x807e8 xorpd %xmm0, %xmm0 jmp 0x807fb cmpl $0x29, %ecx je 0x807f2 cmpl $0x52, %ecx jne 0x806a5 movsd 0x80(%rax), %xmm0 jmp 0x807fb cmpb $0x0, 0x80(%rax) je 0x807c1 movsd 0x48890(%rip), %xmm0 # 0xc9080 jmp 0x807fb cvtsi2sdq 0x80(%rax), %xmm0 movq 0x8(%rsp), %rax movsd %xmm0, (%rax) movsd %xmm0, (%r15) jmp 0x806a5
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/histo.c
fits_make_hist
int fits_make_hist(fitsfile *fptr, /* IO - pointer to table with X and Y cols; */ fitsfile *histptr, /* I - pointer to output FITS image */ int bitpix, /* I - datatype for image: 16, 32, -32, etc */ int naxis, /* I - number of axes in the histogram image */ long *naxes, /* I - size of axes in the histogram image */ int *colnum, /* I - column numbers (array length = naxis) */ float *amin, /* I - minimum histogram value, for each axis */ float *amax, /* I - maximum histogram value, for each axis */ float *binsize, /* I - bin size along each axis */ float weight, /* I - binning weighting factor */ int wtcolnum, /* I - optional keyword or col for weight*/ int recip, /* I - use reciprocal of the weight? */ char *selectrow, /* I - optional array (length = no. of */ /* rows in the table). If the element is true */ /* then the corresponding row of the table will*/ /* be included in the histogram, otherwise the */ /* row will be skipped. Ingnored if *selectrow*/ /* is equal to NULL. */ int *status) { double amind[4], amaxd[4], binsized[4], weightd; /* Copy single precision values into double precision */ if (*status == 0) { int i, naxis1 = 4; if (naxis < naxis1) naxis1 = naxis; for (i=0; i<naxis1; i++) { amind[i] = (double) amin[i]; amaxd[i] = (double) amax[i]; binsized[i] = (double) binsize[i]; } weightd = (double) weight; fits_make_histd(fptr, histptr, bitpix, naxis, naxes, colnum, amind, amaxd, binsized, weight, wtcolnum, recip, selectrow, status); } return (*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp movq 0xd0(%rsp), %rbx movl (%rbx), %eax testl %eax, %eax jne 0x80943 movq %r9, %r10 movq %r8, %r9 movl %ecx, %r8d movl %edx, %ecx movq 0xc8(%rsp), %r14 movl 0xc0(%rsp), %r11d movl 0xb8(%rsp), %eax testl %r8d, %r8d jle 0x80911 movq 0xb0(%rsp), %rdx movq 0xa8(%rsp), %r15 movq 0xa0(%rsp), %r12 cmpl $0x4, %r8d movl $0x4, %r13d cmovbl %r8d, %r13d xorl %ebp, %ebp xorps %xmm1, %xmm1 cvtss2sd (%r12,%rbp,4), %xmm1 movsd %xmm1, 0x40(%rsp,%rbp,8) xorps %xmm1, %xmm1 cvtss2sd (%r15,%rbp,4), %xmm1 movsd %xmm1, 0x20(%rsp,%rbp,8) xorps %xmm1, %xmm1 cvtss2sd (%rdx,%rbp,4), %xmm1 movsd %xmm1, (%rsp,%rbp,8) incq %rbp cmpq %rbp, %r13 jne 0x808de cvtss2sd %xmm0, %xmm0 xorl %r15d, %r15d movq %rsp, %r12 leaq 0x20(%rsp), %r13 leaq 0x40(%rsp), %rbp xorl %edx, %edx pushq %rbx pushq %r14 pushq %r11 pushq %r15 pushq %rax pushq %r12 pushq %r13 pushq %rbp pushq %r15 pushq %r10 callq 0x7dc8d addq $0x50, %rsp movl (%rbx), %eax addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/histo.c
fits_set_compression_type
int fits_set_compression_type(fitsfile *fptr, /* I - FITS file pointer */ int ctype, /* image compression type code; */ /* allowed values: RICE_1, GZIP_1, GZIP_2, PLIO_1, */ /* HCOMPRESS_1, BZIP2_1, and NOCOMPRESS */ int *status) /* IO - error status */ { /* This routine specifies the image compression algorithm that should be used when writing a FITS image. The image is divided into tiles, and each tile is compressed and stored in a row of at variable length binary table column. */ if (ctype != RICE_1 && ctype != GZIP_1 && ctype != GZIP_2 && ctype != PLIO_1 && ctype != HCOMPRESS_1 && ctype != BZIP2_1 && ctype != NOCOMPRESS && ctype != 0) { ffpmsg("unknown compression algorithm (fits_set_compression_type)"); *status = DATA_COMPRESSION_ERR; } else { (fptr->Fptr)->request_compress_type = ctype; } return(*status); }
pushq %rbx movq %rdx, %rbx leal 0x1(%rsi), %eax cmpl $0x34, %eax ja 0x810e0 movabsq $0x10040100c01003, %rcx # imm = 0x10040100C01003 btq %rax, %rcx jae 0x810e0 movq 0x8(%rdi), %rax movl %esi, 0x3e8(%rax) movl (%rbx), %eax popq %rbx retq leaq 0x59da2(%rip), %rdi # 0xdae89 callq 0x37264 movl $0x19d, (%rbx) # imm = 0x19D movl $0x19d, %eax # imm = 0x19D jmp 0x810de
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
fits_set_quantize_method
int fits_set_quantize_method(fitsfile *fptr, /* I - FITS file pointer */ int method, /* quantization method */ int *status) /* IO - error status */ { /* This routine specifies what type of dithering (randomization) should be performed when quantizing floating point images to integer prior to compression. A value of -1 means do no dithering. A value of 0 means use the default SUBTRACTIVE_DITHER_1 (which is equivalent to dither = 1). A value of 2 means use SUBTRACTIVE_DITHER_2. */ if (method < -1 || method > 2) { ffpmsg("illegal dithering value (fits_set_quantize_method)"); *status = DATA_COMPRESSION_ERR; } else { if (method == 0) method = 1; (fptr->Fptr)->request_quantize_method = method; } return(*status); }
pushq %rbx movq %rdx, %rbx leal -0x3(%rsi), %eax cmpl $-0x5, %eax ja 0x81187 leaq 0x59d84(%rip), %rdi # 0xdaef9 callq 0x37264 movl $0x19d, (%rbx) # imm = 0x19D movl $0x19d, %eax # imm = 0x19D jmp 0x81199 cmpl $0x1, %esi adcl $0x0, %esi movq 0x8(%rdi), %rax movl %esi, 0x424(%rax) movl (%rbx), %eax popq %rbx retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
fits_set_noise_bits
int fits_set_noise_bits(fitsfile *fptr, /* I - FITS file pointer */ int noisebits, /* noise_bits parameter value */ /* (default = 4) */ int *status) /* IO - error status */ { /* ******************************************************************** ******************************************************************** THIS ROUTINE IS PROVIDED ONLY FOR BACKWARDS COMPATIBILITY; ALL NEW SOFTWARE SHOULD CALL fits_set_quantize_level INSTEAD ******************************************************************** ******************************************************************** This routine specifies the value of the noice_bits parameter that should be used when compressing floating point images. The image is divided into tiles, and each tile is compressed and stored in a row of at variable length binary table column. Feb 2008: the "noisebits" parameter has been replaced with the more general "quantize level" parameter. */ float qlevel; if (noisebits < 1 || noisebits > 16) { *status = DATA_COMPRESSION_ERR; ffpmsg("illegal number of noise bits (fits_set_noise_bits)"); return(*status); } qlevel = (float) pow (2., (double)noisebits); fits_set_quantize_level(fptr, qlevel, status); return(*status); }
pushq %r14 pushq %rbx pushq %rax movq %rdx, %rbx leal -0x11(%rsi), %eax cmpl $-0x11, %eax ja 0x8125d movl $0x19d, (%rbx) # imm = 0x19D leaq 0x59d0a(%rip), %rdi # 0xdaf60 callq 0x37264 jmp 0x81292 movq %rdi, %r14 cvtsi2sd %esi, %xmm0 callq 0x6380 cvtsd2ss %xmm0, %xmm0 movq 0x8(%r14), %rax xorps %xmm1, %xmm1 cmpeqss %xmm0, %xmm1 movss 0x59aef(%rip), %xmm2 # 0xdad70 andps %xmm1, %xmm2 andnps %xmm0, %xmm1 orps %xmm2, %xmm1 movss %xmm1, 0x420(%rax) movl (%rbx), %eax addq $0x8, %rsp popq %rbx popq %r14 retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
fits_get_compression_type
int fits_get_compression_type(fitsfile *fptr, /* I - FITS file pointer */ int *ctype, /* image compression type code; */ /* allowed values: */ /* RICE_1, GZIP_1, GZIP_2, PLIO_1, HCOMPRESS_1, BZIP2_1 */ int *status) /* IO - error status */ { /* This routine returns the image compression algorithm that should be used when writing a FITS image. The image is divided into tiles, and each tile is compressed and stored in a row of at variable length binary table column. */ *ctype = (fptr->Fptr)->request_compress_type; if (*ctype != RICE_1 && *ctype != GZIP_1 && *ctype != GZIP_2 && *ctype != PLIO_1 && *ctype != HCOMPRESS_1 && *ctype != BZIP2_1 && *ctype != NOCOMPRESS && *ctype != 0 ) { ffpmsg("unknown compression algorithm (fits_get_compression_type)"); *status = DATA_COMPRESSION_ERR; } return(*status); }
pushq %rbx movq %rdx, %rbx movq 0x8(%rdi), %rax movl 0x3e8(%rax), %eax movl %eax, (%rsi) incl %eax cmpl $0x34, %eax ja 0x812fd movabsq $0x10040100c01003, %rcx # imm = 0x10040100C01003 btq %rax, %rcx jae 0x812fd movl (%rbx), %eax popq %rbx retq leaq 0x59c8f(%rip), %rdi # 0xdaf93 callq 0x37264 movl $0x19d, (%rbx) # imm = 0x19D jmp 0x812f9
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
fits_unset_compression_request
int fits_unset_compression_request( fitsfile *fptr, int *status) { int ii; (fptr->Fptr)->request_compress_type = 0; (fptr->Fptr)->request_quantize_level = 0; (fptr->Fptr)->request_quantize_method = 0; (fptr->Fptr)->request_dither_seed = 0; (fptr->Fptr)->request_hcomp_scale = 0; (fptr->Fptr)->request_lossy_int_compress = 0; (fptr->Fptr)->request_huge_hdu = 0; for (ii = 0; ii < MAX_COMPRESS_DIM; ii++) { (fptr->Fptr)->request_tilesize[ii] = 0; } return(*status); }
movq 0x8(%rdi), %rax movl $0x0, 0x3e8(%rax) xorps %xmm0, %xmm0 movups %xmm0, 0x3f0(%rax) movups %xmm0, 0x400(%rax) movups %xmm0, 0x410(%rax) movups %xmm0, 0x420(%rax) movq $0x0, 0x430(%rax) movl (%rsi), %eax retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
fits_img_compress
int fits_img_compress(fitsfile *infptr, /* pointer to image to be compressed */ fitsfile *outfptr, /* empty HDU for output compressed image */ int *status) /* IO - error status */ /* This routine initializes the output table, copies all the keywords, and loops through the input image, compressing the data and writing the compressed tiles to the output table. This is a high level routine that is called by the fpack and funpack FITS compression utilities. */ { int bitpix, naxis; long naxes[MAX_COMPRESS_DIM]; /* int c1, c2, c3; */ if (*status > 0) return(*status); /* get datatype and size of input image */ if (fits_get_img_param(infptr, MAX_COMPRESS_DIM, &bitpix, &naxis, naxes, status) > 0) return(*status); if (naxis < 1 || naxis > MAX_COMPRESS_DIM) { ffpmsg("Image cannot be compressed: NAXIS out of range"); return(*status = BAD_NAXIS); } /* create a new empty HDU in the output file now, before setting the */ /* compression preferences. This HDU will become a binary table that */ /* contains the compressed image. If necessary, create a dummy primary */ /* array, which much precede the binary table extension. */ ffcrhd(outfptr, status); /* this does nothing if the output file is empty */ if ((outfptr->Fptr)->curhdu == 0) /* have to create dummy primary array */ { ffcrim(outfptr, 16, 0, NULL, status); ffcrhd(outfptr, status); } else { /* unset any compress parameter preferences that may have been set when closing the previous HDU in the output file */ fits_unset_compression_param(outfptr, status); } /* set any compress parameter preferences as given in the input file */ fits_set_compression_pref(infptr, outfptr, status); /* special case: the quantization level is not given by a keyword in */ /* the HDU header, so we have to explicitly copy the requested value */ /* to the actual value */ /* do this in imcomp_get_compressed_image_par, instead if ( (outfptr->Fptr)->request_quantize_level != 0.) (outfptr->Fptr)->quantize_level = (outfptr->Fptr)->request_quantize_level; */ /* if requested, treat integer images same as a float image. */ /* Then the pixels will be quantized (lossy algorithm) to achieve */ /* higher amounts of compression than with lossless algorithms */ if ( (outfptr->Fptr)->request_lossy_int_compress != 0 && bitpix > 0) bitpix = FLOAT_IMG; /* compress integer images as if float */ /* initialize output table */ if (imcomp_init_table(outfptr, bitpix, naxis, naxes, 0, status) > 0) return (*status); /* Copy the image header keywords to the table header. */ if (imcomp_copy_img2comp(infptr, outfptr, status) > 0) return (*status); /* turn off any intensity scaling (defined by BSCALE and BZERO */ /* keywords) so that unscaled values will be read by CFITSIO */ /* (except if quantizing an int image, same as a float image) */ if ( (outfptr->Fptr)->request_lossy_int_compress == 0 && bitpix > 0) ffpscl(infptr, 1.0, 0.0, status); /* force a rescan of the output file keywords, so that */ /* the compression parameters will be copied to the internal */ /* fitsfile structure used by CFITSIO */ ffrdef(outfptr, status); /* turn off any intensity scaling (defined by BSCALE and BZERO */ /* keywords) so that unscaled values will be written by CFITSIO */ /* (except if quantizing an int image, same as a float image) */ if ( (outfptr->Fptr)->request_lossy_int_compress == 0 && bitpix > 0) ffpscl(outfptr, 1.0, 0.0, status); /* Read each image tile, compress, and write to a table row. */ imcomp_compress_image (infptr, outfptr, status); /* force another rescan of the output file keywords, to */ /* update PCOUNT and TFORMn = '1PB(iii)' keyword values. */ ffrdef(outfptr, status); /* unset any previously set compress parameter preferences */ fits_unset_compression_request(outfptr, status); /* fits_get_case(&c1, &c2, &c3); printf("c1, c2, c3 = %d, %d, %d\n", c1, c2, c3); */ return (*status); }
movl (%rdx), %eax testl %eax, %eax jle 0x819ae retq pushq %r15 pushq %r14 pushq %rbx subq $0x40, %rsp movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 leaq 0x8(%rsp), %rdx leaq 0xc(%rsp), %rcx leaq 0x10(%rsp), %r8 movl $0x6, %esi movq %rbx, %r9 callq 0x41189 testl %eax, %eax jle 0x819ec movl (%rbx), %eax addq $0x40, %rsp popq %rbx popq %r14 popq %r15 retq movl 0xc(%rsp), %eax addl $-0x7, %eax cmpl $-0x7, %eax ja 0x81a11 leaq 0x5978f(%rip), %rdi # 0xdb18e callq 0x37264 movl $0xd4, (%rbx) movl $0xd4, %eax jmp 0x819e2 movq %r14, %rdi movq %rbx, %rsi callq 0x40fde movq 0x8(%r14), %rax cmpl $0x0, 0x54(%rax) je 0x81a51 movl $0x0, 0x524(%rax) xorps %xmm0, %xmm0 movups %xmm0, 0x43c(%rax) movups %xmm0, 0x44c(%rax) movups %xmm0, 0x45c(%rax) movups %xmm0, 0x46c(%rax) jmp 0x81a70 movq %r14, %rdi movl $0x10, %esi xorl %edx, %edx xorl %ecx, %ecx movq %rbx, %r8 callq 0xad1e8 movq %r14, %rdi movq %rbx, %rsi callq 0x40fde movq %r15, %rdi movq %r14, %rsi movq %rbx, %rdx callq 0x813bd movq 0x8(%r14), %rax cmpl $0x0, 0x42c(%rax) setne %al movl 0x8(%rsp), %esi testl %esi, %esi setg %cl andb %al, %cl cmpb $0x1, %cl jne 0x81aa9 movl $0xffffffe0, 0x8(%rsp) # imm = 0xFFFFFFE0 movl $0xffffffe0, %esi # imm = 0xFFFFFFE0 movl 0xc(%rsp), %edx leaq 0x10(%rsp), %rcx movq %r14, %rdi xorl %r8d, %r8d movq %rbx, %r9 callq 0x81b93 testl %eax, %eax jg 0x819e0 movq %r15, %rdi movq %r14, %rsi movq %rbx, %rdx callq 0x82a69 testl %eax, %eax jg 0x819e0 movq 0x8(%r14), %rax cmpl $0x0, 0x42c(%rax) jne 0x81b08 cmpl $0x0, 0x8(%rsp) jle 0x81b08 movsd 0x47586(%rip), %xmm0 # 0xc9080 xorps %xmm1, %xmm1 movq %r15, %rdi movq %rbx, %rsi callq 0xbc17c movq %r14, %rdi movq %rbx, %rsi callq 0x3af49 movq 0x8(%r14), %rax cmpl $0x0, 0x42c(%rax) jne 0x81b3d cmpl $0x0, 0x8(%rsp) jle 0x81b3d movsd 0x47551(%rip), %xmm0 # 0xc9080 xorps %xmm1, %xmm1 movq %r14, %rdi movq %rbx, %rsi callq 0xbc17c movq %r15, %rdi movq %r14, %rsi movq %rbx, %rdx callq 0x82d49 movq %r14, %rdi movq %rbx, %rsi callq 0x3af49 movq 0x8(%r14), %rax movl $0x0, 0x3e8(%rax) xorps %xmm0, %xmm0 movups %xmm0, 0x420(%rax) movups %xmm0, 0x410(%rax) movups %xmm0, 0x400(%rax) movups %xmm0, 0x3f0(%rax) movq $0x0, 0x430(%rax) jmp 0x819e0
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_init_table
int imcomp_init_table(fitsfile *outfptr, int inbitpix, int naxis, long *naxes, int writebitpix, /* write the ZBITPIX, ZNAXIS, and ZNAXES keyword? */ int *status) /* create a BINTABLE extension for the output compressed image. */ { char keyname[FLEN_KEYWORD], zcmptype[12]; int ii, remain, ndiv, addToDim, ncols, bitpix; long nrows; char *ttype[] = {"COMPRESSED_DATA", "ZSCALE", "ZZERO"}; char *tform[3]; char tf0[4], tf1[4], tf2[4]; char *tunit[] = {"\0", "\0", "\0" }; char comm[FLEN_COMMENT]; long actual_tilesize[MAX_COMPRESS_DIM]; /* Actual size to use for tiles */ int is_primary=0; /* Is this attempting to write to the primary? */ int nQualifyDims=0; /* For Hcompress, number of image dimensions with required pixels. */ int noHigherDims=1; /* Set to true if all tile dims other than x are size 1. */ int firstDim=-1, secondDim=-1; /* Indices of first and second tiles dimensions with width > 1 */ if (*status > 0) return(*status); /* check for special case of losslessly compressing floating point */ /* images. Only compression algorithm that supports this is GZIP */ if ( (inbitpix < 0) && ((outfptr->Fptr)->request_quantize_level == NO_QUANTIZE) ) { if (((outfptr->Fptr)->request_compress_type != GZIP_1) && ((outfptr->Fptr)->request_compress_type != GZIP_2)) { ffpmsg("Lossless compression of floating point images must use GZIP (imcomp_init_table)"); return(*status = DATA_COMPRESSION_ERR); } } /* set default compression parameter values, if undefined */ if ( (outfptr->Fptr)->request_compress_type == 0) { /* use RICE_1 by default */ (outfptr->Fptr)->request_compress_type = RICE_1; } if (inbitpix < 0 && (outfptr->Fptr)->request_quantize_level != NO_QUANTIZE) { /* set defaults for quantizing floating point images */ if ( (outfptr->Fptr)->request_quantize_method == 0) { /* set default dithering method */ (outfptr->Fptr)->request_quantize_method = SUBTRACTIVE_DITHER_1; } if ( (outfptr->Fptr)->request_quantize_level == 0) { if ((outfptr->Fptr)->request_quantize_method == NO_DITHER) { /* must use finer quantization if no dithering is done */ (outfptr->Fptr)->request_quantize_level = 16; } else { (outfptr->Fptr)->request_quantize_level = 4; } } } /* special case: the quantization level is not given by a keyword in */ /* the HDU header, so we have to explicitly copy the requested value */ /* to the actual value */ /* do this in imcomp_get_compressed_image_par, instead if ( (outfptr->Fptr)->request_quantize_level != 0.) (outfptr->Fptr)->quantize_level = (outfptr->Fptr)->request_quantize_level; */ /* test for the 2 special cases that represent unsigned integers */ if (inbitpix == USHORT_IMG) bitpix = SHORT_IMG; else if (inbitpix == ULONG_IMG) bitpix = LONG_IMG; else if (inbitpix == SBYTE_IMG) bitpix = BYTE_IMG; else bitpix = inbitpix; /* reset default tile dimensions too if required */ memcpy(actual_tilesize, outfptr->Fptr->request_tilesize, MAX_COMPRESS_DIM * sizeof(long)); if ((outfptr->Fptr)->request_compress_type == HCOMPRESS_1) { /* Tiles must ultimately have 2 (and only 2) dimensions, each with at least 4 pixels. First catch the case where the image itself won't allow this. */ if (naxis < 2 ) { ffpmsg("Hcompress cannot be used with 1-dimensional images (imcomp_init_table)"); return(*status = DATA_COMPRESSION_ERR); } for (ii=0; ii<naxis; ii++) { if (naxes[ii] >= 4) ++nQualifyDims; } if (nQualifyDims < 2) { ffpmsg("Hcompress minimum image dimension is 4 pixels (imcomp_init_table)"); return(*status = DATA_COMPRESSION_ERR); } /* Handle 2 special cases for backwards compatibility. 1) If both X and Y tile dims are set to full size, ignore any other requested dimensions and just set their sizes to 1. 2) If X is full size and all the rest are size 1, attempt to find a reasonable size for Y. All other 1-D tile specifications will be rejected. */ for (ii=1; ii<naxis; ++ii) if (actual_tilesize[ii] != 0 && actual_tilesize[ii] != 1) { noHigherDims = 0; break; } if ((actual_tilesize[0] <= 0) && (actual_tilesize[1] == -1) ){ /* compress the whole image as a single tile */ actual_tilesize[0] = naxes[0]; actual_tilesize[1] = naxes[1]; for (ii = 2; ii < naxis; ii++) { /* set all higher tile dimensions = 1 */ actual_tilesize[ii] = 1; } } else if ((actual_tilesize[0] <= 0) && noHigherDims) { /* The Hcompress algorithm is inherently 2D in nature, so the row by row tiling that is used for other compression algorithms is not appropriate. If the image has less than 30 rows, then the entire image will be compressed as a single tile. Otherwise the tiles will consist of 16 rows of the image. This keeps the tiles to a reasonable size, and it also includes enough rows to allow good compression efficiency. If the last tile of the image happens to contain less than 4 rows, then find another tile size with between 14 and 30 rows (preferably even), so that the last tile has at least 4 rows */ /* 1st tile dimension is the row length of the image */ actual_tilesize[0] = naxes[0]; if (naxes[1] <= 30) { /* use whole image if it is small */ actual_tilesize[1] = naxes[1]; } else { /* look for another good tile dimension */ if (naxes[1] % 16 == 0 || naxes[1] % 16 > 3) { actual_tilesize[1] = 16; } else if (naxes[1] % 24 == 0 || naxes[1] % 24 > 3) { actual_tilesize[1] = 24; } else if (naxes[1] % 20 == 0 || naxes[1] % 20 > 3) { actual_tilesize[1] = 20; } else if (naxes[1] % 30 == 0 || naxes[1] % 30 > 3) { actual_tilesize[1] = 30; } else if (naxes[1] % 28 == 0 || naxes[1] % 28 > 3) { actual_tilesize[1] = 28; } else if (naxes[1] % 26 == 0 || naxes[1] % 26 > 3) { actual_tilesize[1] = 26; } else if (naxes[1] % 22 == 0 || naxes[1] % 22 > 3) { actual_tilesize[1] = 22; } else if (naxes[1] % 18 == 0 || naxes[1] % 18 > 3) { actual_tilesize[1] = 18; } else if (naxes[1] % 14 == 0 || naxes[1] % 14 > 3) { actual_tilesize[1] = 14; } else { actual_tilesize[1] = 17; } } } else { if (actual_tilesize[0] <= 0) actual_tilesize[0] = naxes[0]; for (ii=1; ii<naxis; ++ii) { if (actual_tilesize[ii] < 0) actual_tilesize[ii] = naxes[ii]; else if (actual_tilesize[ii] == 0) actual_tilesize[ii] = 1; } } for (ii=0; ii<naxis; ++ii) { if (actual_tilesize[ii] > 1) { if (firstDim < 0) firstDim = ii; else if (secondDim < 0) secondDim = ii; else { ffpmsg("Hcompress tiles can only have 2 dimensions (imcomp_init_table)"); return(*status = DATA_COMPRESSION_ERR); } } } if (firstDim < 0 || secondDim < 0) { ffpmsg("Hcompress tiles must have 2 dimensions (imcomp_init_table)"); return(*status = DATA_COMPRESSION_ERR); } if (actual_tilesize[firstDim] < 4 || actual_tilesize[secondDim] < 4) { ffpmsg("Hcompress minimum tile dimension is 4 pixels (imcomp_init_table)"); return (*status = DATA_COMPRESSION_ERR); } /* check if requested tile size causes the last tile to to have less than 4 pixels */ remain = naxes[firstDim] % (actual_tilesize[firstDim]); /* 1st dimension */ if (remain > 0 && remain < 4) { ndiv = naxes[firstDim]/actual_tilesize[firstDim]; /* integer truncation is intentional */ addToDim = ceil((double)remain/ndiv); (actual_tilesize[firstDim]) += addToDim; /* increase tile size */ remain = naxes[firstDim] % (actual_tilesize[firstDim]); if (remain > 0 && remain < 4) { ffpmsg("Last tile along 1st dimension has less than 4 pixels (imcomp_init_table)"); return(*status = DATA_COMPRESSION_ERR); } } remain = naxes[secondDim] % (actual_tilesize[secondDim]); /* 2nd dimension */ if (remain > 0 && remain < 4) { ndiv = naxes[secondDim]/actual_tilesize[secondDim]; /* integer truncation is intentional */ addToDim = ceil((double)remain/ndiv); (actual_tilesize[secondDim]) += addToDim; /* increase tile size */ remain = naxes[secondDim] % (actual_tilesize[secondDim]); if (remain > 0 && remain < 4) { ffpmsg("Last tile along 2nd dimension has less than 4 pixels (imcomp_init_table)"); return(*status = DATA_COMPRESSION_ERR); } } } /* end, if HCOMPRESS_1 */ for (ii = 0; ii < naxis; ii++) { if (ii == 0) { /* first axis is different */ if (actual_tilesize[ii] <= 0) { actual_tilesize[ii] = naxes[ii]; } } else { if (actual_tilesize[ii] < 0) { actual_tilesize[ii] = naxes[ii]; /* negative value maean use whole length */ } else if (actual_tilesize[ii] == 0) { actual_tilesize[ii] = 1; /* zero value means use default value = 1 */ } } } /* ---- set up array of TFORM strings -------------------------------*/ if ( (outfptr->Fptr)->request_huge_hdu != 0) { strcpy(tf0, "1QB"); } else { strcpy(tf0, "1PB"); } strcpy(tf1, "1D"); strcpy(tf2, "1D"); tform[0] = tf0; tform[1] = tf1; tform[2] = tf2; /* calculate number of rows in output table */ nrows = 1; for (ii = 0; ii < naxis; ii++) { nrows = nrows * ((naxes[ii] - 1)/ (actual_tilesize[ii]) + 1); } /* determine the default number of columns in the output table */ if (bitpix < 0 && (outfptr->Fptr)->request_quantize_level != NO_QUANTIZE) ncols = 3; /* quantized and scaled floating point image */ else ncols = 1; /* default table has just one 'COMPRESSED_DATA' column */ if ((outfptr->Fptr)->request_compress_type == RICE_1) { strcpy(zcmptype, "RICE_1"); } else if ((outfptr->Fptr)->request_compress_type == GZIP_1) { strcpy(zcmptype, "GZIP_1"); } else if ((outfptr->Fptr)->request_compress_type == GZIP_2) { strcpy(zcmptype, "GZIP_2"); } else if ((outfptr->Fptr)->request_compress_type == BZIP2_1) { strcpy(zcmptype, "BZIP2_1"); } else if ((outfptr->Fptr)->request_compress_type == PLIO_1) { strcpy(zcmptype, "PLIO_1"); /* the PLIO compression algorithm outputs short integers, not bytes */ if ( (outfptr->Fptr)->request_huge_hdu != 0) { strcpy(tform[0], "1QI"); } else { strcpy(tform[0], "1PI"); } } else if ((outfptr->Fptr)->request_compress_type == HCOMPRESS_1) { strcpy(zcmptype, "HCOMPRESS_1"); } else if ((outfptr->Fptr)->request_compress_type == NOCOMPRESS) { strcpy(zcmptype, "NOCOMPRESS"); } else { ffpmsg("unknown compression type (imcomp_init_table)"); return(*status = DATA_COMPRESSION_ERR); } /* If attempting to write compressed image to primary, the call to ffcrtb will increment Fptr->curhdu to 1. Therefore we need to test now for setting is_primary */ is_primary = (outfptr->Fptr->curhdu == 0); /* create the bintable extension to contain the compressed image */ ffcrtb(outfptr, BINARY_TBL, nrows, ncols, ttype, tform, tunit, 0, status); /* Add standard header keywords. */ ffpkyl (outfptr, "ZIMAGE", 1, "extension contains compressed image", status); if (writebitpix) { /* write the keywords defining the datatype and dimensions of */ /* the uncompressed image. If not, these keywords will be */ /* copied later from the input uncompressed image */ if (is_primary) ffpkyl (outfptr, "ZSIMPLE", 1, "file does conform to FITS standard", status); ffpkyj (outfptr, "ZBITPIX", bitpix, "data type of original image", status); ffpkyj (outfptr, "ZNAXIS", naxis, "dimension of original image", status); for (ii = 0; ii < naxis; ii++) { snprintf (keyname, FLEN_KEYWORD,"ZNAXIS%d", ii+1); ffpkyj (outfptr, keyname, naxes[ii], "length of original image axis", status); } } for (ii = 0; ii < naxis; ii++) { snprintf (keyname, FLEN_KEYWORD,"ZTILE%d", ii+1); ffpkyj (outfptr, keyname, actual_tilesize[ii], "size of tiles to be compressed", status); } if (bitpix < 0) { if ((outfptr->Fptr)->request_quantize_level == NO_QUANTIZE) { ffpkys(outfptr, "ZQUANTIZ", "NONE", "Lossless compression without quantization", status); } else { /* Unless dithering has been specifically turned off by setting */ /* request_quantize_method = -1, use dithering by default */ /* when quantizing floating point images. */ if ( (outfptr->Fptr)->request_quantize_method == 0) (outfptr->Fptr)->request_quantize_method = SUBTRACTIVE_DITHER_1; /* HCompress must not use SUBTRACTIVE_DITHER_2. If user is requesting this, assign SUBTRACTIVE_DITHER_1 instead. */ if ((outfptr->Fptr)->request_quantize_method == SUBTRACTIVE_DITHER_2 && !(strcmp(zcmptype,"HCOMPRESS_1"))) { (outfptr->Fptr)->request_quantize_method = SUBTRACTIVE_DITHER_1; fprintf(stderr,"Warning: CFITSIO does not allow subtractive_dither_2 when using Hcompress algorithm.\nWill use subtractive_dither_1 instead.\n"); } if ((outfptr->Fptr)->request_quantize_method == SUBTRACTIVE_DITHER_1) { ffpkys(outfptr, "ZQUANTIZ", "SUBTRACTIVE_DITHER_1", "Pixel Quantization Algorithm", status); /* also write the associated ZDITHER0 keyword with a default value */ /* which may get updated later. */ ffpky(outfptr, TINT, "ZDITHER0", &((outfptr->Fptr)->request_dither_seed), "dithering offset when quantizing floats", status); } else if ((outfptr->Fptr)->request_quantize_method == SUBTRACTIVE_DITHER_2) { ffpkys(outfptr, "ZQUANTIZ", "SUBTRACTIVE_DITHER_2", "Pixel Quantization Algorithm", status); /* also write the associated ZDITHER0 keyword with a default value */ /* which may get updated later. */ ffpky(outfptr, TINT, "ZDITHER0", &((outfptr->Fptr)->request_dither_seed), "dithering offset when quantizing floats", status); if (!strcmp(zcmptype, "RICE_1")) { /* when using this new dithering method, change the compression type */ /* to an alias, so that old versions of funpack will not be able to */ /* created a corrupted uncompressed image. */ /* ******* can remove this cludge after about June 2015, after most old versions of fpack are gone */ strcpy(zcmptype, "RICE_ONE"); } } else if ((outfptr->Fptr)->request_quantize_method == NO_DITHER) { ffpkys(outfptr, "ZQUANTIZ", "NO_DITHER", "No dithering during quantization", status); } } } ffpkys (outfptr, "ZCMPTYPE", zcmptype, "compression algorithm", status); /* write any algorithm-specific keywords */ if ((outfptr->Fptr)->request_compress_type == RICE_1) { ffpkys (outfptr, "ZNAME1", "BLOCKSIZE", "compression block size", status); /* for now at least, the block size is always 32 */ ffpkyj (outfptr, "ZVAL1", 32, "pixels per block", status); ffpkys (outfptr, "ZNAME2", "BYTEPIX", "bytes per pixel (1, 2, 4, or 8)", status); if (bitpix == BYTE_IMG) ffpkyj (outfptr, "ZVAL2", 1, "bytes per pixel (1, 2, 4, or 8)", status); else if (bitpix == SHORT_IMG) ffpkyj (outfptr, "ZVAL2", 2, "bytes per pixel (1, 2, 4, or 8)", status); else ffpkyj (outfptr, "ZVAL2", 4, "bytes per pixel (1, 2, 4, or 8)", status); } else if ((outfptr->Fptr)->request_compress_type == HCOMPRESS_1) { ffpkys (outfptr, "ZNAME1", "SCALE", "HCOMPRESS scale factor", status); ffpkye (outfptr, "ZVAL1", (outfptr->Fptr)->request_hcomp_scale, 7, "HCOMPRESS scale factor", status); ffpkys (outfptr, "ZNAME2", "SMOOTH", "HCOMPRESS smooth option", status); ffpkyj (outfptr, "ZVAL2", (long) (outfptr->Fptr)->request_hcomp_smooth, "HCOMPRESS smooth option", status); } /* Write the BSCALE and BZERO keywords, if an unsigned integer image */ if (inbitpix == USHORT_IMG) { strcpy(comm, "offset data range to that of unsigned short"); ffpkyg(outfptr, "BZERO", 32768., 0, comm, status); strcpy(comm, "default scaling factor"); ffpkyg(outfptr, "BSCALE", 1.0, 0, comm, status); } else if (inbitpix == SBYTE_IMG) { strcpy(comm, "offset data range to that of signed byte"); ffpkyg(outfptr, "BZERO", -128., 0, comm, status); strcpy(comm, "default scaling factor"); ffpkyg(outfptr, "BSCALE", 1.0, 0, comm, status); } else if (inbitpix == ULONG_IMG) { strcpy(comm, "offset data range to that of unsigned long"); ffpkyg(outfptr, "BZERO", 2147483648., 0, comm, status); strcpy(comm, "default scaling factor"); ffpkyg(outfptr, "BSCALE", 1.0, 0, comm, status); } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x198, %rsp # imm = 0x198 movq 0x7cda5(%rip), %rax # 0xfe950 movq %rax, 0x130(%rsp) movaps 0x7cd86(%rip), %xmm0 # 0xfe940 movaps %xmm0, 0x120(%rsp) movq 0x7cda7(%rip), %rax # 0xfe970 movq %rax, 0x110(%rsp) movaps 0x7cd88(%rip), %xmm0 # 0xfe960 movaps %xmm0, 0x100(%rsp) movl (%r9), %eax testl %eax, %eax jg 0x82909 movq %r9, %r12 movl %r8d, %r13d movl %edx, %r10d movq %rdi, %r15 movq 0x8(%rdi), %r14 testl %esi, %esi js 0x81c3c movl 0x3e8(%r14), %ebp testl %ebp, %ebp jne 0x81c1a movl $0xb, 0x3e8(%r14) movl $0xb, %ebp testl %esi, %esi js 0x81c6b cmpl $0xa, %esi je 0x81cad cmpl $0x14, %esi je 0x81ca3 cmpl $0x28, %esi jne 0x81cdd movl $0x20, %ebx jmp 0x81cb2 movss 0x420(%r14), %xmm0 ucomiss 0x59124(%rip), %xmm0 # 0xdad70 jne 0x81bff jp 0x81bff movl 0x3e8(%r14), %eax addl $-0x15, %eax cmpl $0x2, %eax jb 0x81bff leaq 0x59564(%rip), %rdi # 0xdb1ca jmp 0x8242b movss 0x420(%r14), %xmm0 ucomiss 0x590f5(%rip), %xmm0 # 0xdad70 jne 0x81c7f jnp 0x81cdd movl 0x424(%r14), %eax testl %eax, %eax je 0x81cb7 xorps %xmm1, %xmm1 ucomiss %xmm1, %xmm0 jne 0x81cdd jp 0x81cdd cmpl $-0x1, %eax jne 0x81ccc movss 0x590d7(%rip), %xmm0 # 0xdad78 jmp 0x81cd4 movl $0x10, %ebx movb $0x1, %r11b jmp 0x81ce2 movl $0x8, %ebx xorl %r11d, %r11d jmp 0x81ce2 movl $0x1, 0x424(%r14) xorps %xmm1, %xmm1 ucomiss %xmm1, %xmm0 jne 0x81cdd jp 0x81cdd movss 0x590a8(%rip), %xmm0 # 0xdad7c movss %xmm0, 0x420(%r14) xorl %r11d, %r11d movl %esi, %ebx movdqu 0x3f0(%r14), %xmm0 movdqu 0x400(%r14), %xmm1 movdqu 0x410(%r14), %xmm2 movdqa %xmm2, 0x60(%rsp) movdqa %xmm1, 0x50(%rsp) movdqa %xmm0, 0x40(%rsp) cmpl $0x29, %ebp movq %rcx, 0x28(%rsp) jne 0x8224a cmpl $0x2, %r10d jge 0x81d2f leaq 0x594f0(%rip), %rdi # 0xdb21a jmp 0x8242b movq %rcx, %rdi movl %r10d, %r8d xorl %eax, %eax xorl %ecx, %ecx xorl %edx, %edx cmpq $0x4, (%rdi,%rax,8) setge %dl addl %edx, %ecx incq %rax cmpq %rax, %r8 jne 0x81d39 cmpl $0x2, %ecx jae 0x81d5e leaq 0x59508(%rip), %rdi # 0xdb261 jmp 0x8242b cmpq $0x1, 0x48(%rsp) ja 0x81d87 movl $0x2, %ecx movq %rcx, %rax cmpq %rcx, %r8 je 0x81d7f leaq 0x1(%rax), %rcx cmpq $0x2, 0x40(%rsp,%rax,8) jb 0x81d6b cmpq %r8, %rax setae %al jmp 0x81d89 xorl %eax, %eax movq 0x40(%rsp), %rcx testq %rcx, %rcx jg 0x81e62 cmpq $-0x1, 0x48(%rsp) jne 0x81e62 movq 0x28(%rsp), %rax movdqu (%rax), %xmm0 movdqa %xmm0, 0x40(%rsp) cmpl $0x2, %r10d je 0x8209d cmpl $0x4, %r10d movl $0x3, %ecx cmovgel %r10d, %ecx leaq -0x1(%rcx), %rax andq $-0x2, %rax addq $-0x3, %rcx movq %rcx, %xmm0 pshufd $0x44, %xmm0, %xmm0 # xmm0 = xmm0[0,1,0,1] xorl %ecx, %ecx movdqa 0x47247(%rip), %xmm1 # 0xc9030 movdqa 0x4724f(%rip), %xmm2 # 0xc9040 pxor %xmm2, %xmm0 pcmpeqd %xmm3, %xmm3 movq %rcx, %xmm4 pshufd $0x44, %xmm4, %xmm4 # xmm4 = xmm4[0,1,0,1] por %xmm1, %xmm4 pxor %xmm2, %xmm4 movdqa %xmm4, %xmm5 pcmpgtd %xmm0, %xmm5 pcmpeqd %xmm0, %xmm4 pshufd $0xf5, %xmm4, %xmm6 # xmm6 = xmm4[1,1,3,3] pand %xmm5, %xmm6 pshufd $0xf5, %xmm5, %xmm4 # xmm4 = xmm5[1,1,3,3] por %xmm6, %xmm4 movd %xmm4, %edx notl %edx testb $0x1, %dl je 0x81e3d movq $0x1, 0x50(%rsp,%rcx,8) pxor %xmm3, %xmm4 pextrw $0x4, %xmm4, %edx testb $0x1, %dl je 0x81e54 movq $0x1, 0x58(%rsp,%rcx,8) addq $0x2, %rcx cmpq %rcx, %rax jne 0x81df9 jmp 0x8209d testq %rcx, %rcx setg %dl xorb $0x1, %al orb %dl, %al jne 0x81e8d movq 0x28(%rsp), %rcx movq (%rcx), %rax movq %rax, 0x40(%rsp) movq 0x8(%rcx), %rcx cmpq $0x1f, %rcx jge 0x81ed0 movq %rcx, %rax jmp 0x82098 testq %rcx, %rcx jg 0x81e9f movq 0x28(%rsp), %rax movq (%rax), %rax movq %rax, 0x40(%rsp) movl $0x1, %eax cmpq $0x0, 0x40(%rsp,%rax,8) js 0x81eb5 jne 0x81ec3 movl $0x1, %ecx jmp 0x81ebe movq 0x28(%rsp), %rcx movq (%rcx,%rax,8), %rcx movq %rcx, 0x40(%rsp,%rax,8) incq %rax cmpq %rax, %r8 jne 0x81ea4 jmp 0x8209d movl %ecx, %edx andl $0xf, %edx addq $-0x4, %rdx movl $0x10, %eax cmpq $-0x3, %rdx jb 0x82098 movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB movq %rcx, %rax mulq %rdx shrq %rdx andq $-0x8, %rdx leaq (%rdx,%rdx,2), %rax negq %rax leaq (%rcx,%rax), %rdx addq $-0x4, %rdx movl $0x18, %eax cmpq $-0x3, %rdx jb 0x82098 movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD movq %rcx, %rax mulq %rdx shrq $0x2, %rdx andq $-0x4, %rdx leaq (%rdx,%rdx,4), %rax negq %rax leaq (%rcx,%rax), %rdx addq $-0x4, %rdx movl $0x14, %eax cmpq $-0x3, %rdx jb 0x82098 movabsq $-0x7777777777777777, %rdx # imm = 0x8888888888888889 movq %rcx, %rax mulq %rdx shrq $0x4, %rdx movq %rdx, %rax shlq $0x5, %rax addq %rdx, %rdx subq %rax, %rdx addq %rcx, %rdx addq $-0x4, %rdx movl $0x1e, %eax cmpq $-0x3, %rdx jb 0x82098 movq %rcx, %rax shrq $0x2, %rax movabsq $0x4924924924924925, %rdi # imm = 0x4924924924924925 mulq %rdi shrq %rdx leaq (%rdx,%rdx,8), %rax leaq (%rax,%rax,2), %rax addq %rdx, %rax negq %rax leaq (%rcx,%rax), %rdx addq $-0x4, %rdx movl $0x1c, %eax cmpq $-0x3, %rdx jb 0x82098 movabsq $0x4ec4ec4ec4ec4ec5, %rdx # imm = 0x4EC4EC4EC4EC4EC5 movq %rcx, %rax mulq %rdx shrq $0x3, %rdx leaq (%rdx,%rdx,4), %rax leaq (%rax,%rax,4), %rax addq %rdx, %rax negq %rax leaq (%rcx,%rax), %rdx addq $-0x4, %rdx movl $0x1a, %eax cmpq $-0x3, %rdx jb 0x82098 movabsq $0x2e8ba2e8ba2e8ba3, %rdx # imm = 0x2E8BA2E8BA2E8BA3 movq %rcx, %rax mulq %rdx shrq $0x2, %rdx leaq (%rdx,%rdx,4), %rax leaq (%rdx,%rax,4), %rax addq %rdx, %rax negq %rax leaq (%rcx,%rax), %rdx addq $-0x4, %rdx movl $0x16, %eax cmpq $-0x3, %rdx jb 0x82098 movabsq $-0x1c71c71c71c71c71, %rdx # imm = 0xE38E38E38E38E38F movq %rcx, %rax mulq %rdx shrq $0x3, %rdx andq $-0x2, %rdx leaq (%rdx,%rdx,8), %rax negq %rax leaq (%rcx,%rax), %rdx addq $-0x4, %rdx movl $0x12, %eax cmpq $-0x3, %rdx jb 0x82098 movq %rcx, %rax shrq %rax mulq %rdi shrq %rdx movq %rdx, %rax shlq $0x4, %rax addq %rdx, %rdx subq %rax, %rdx leaq (%rcx,%rdx), %rax addq $-0x4, %rax xorl %ecx, %ecx cmpq $-0x3, %rax setae %cl leaq (%rcx,%rcx,2), %rax addq $0xe, %rax movq %rax, 0x48(%rsp) movl $0xffffffff, %eax # imm = 0xFFFFFFFF xorl %ecx, %ecx movl $0xffffffff, %edx # imm = 0xFFFFFFFF cmpq $0x2, 0x40(%rsp,%rcx,8) jl 0x820bf testl %edx, %edx js 0x820bd testl %eax, %eax jns 0x82107 movl %ecx, %eax jmp 0x820bf movl %ecx, %edx incq %rcx cmpq %rcx, %r8 jne 0x820a9 movl %edx, %ecx orl %eax, %ecx jns 0x820d9 leaq 0x5920e(%rip), %rdi # 0xdb2e2 jmp 0x8242b movl %ebx, 0x8(%rsp) movq %r15, %rbx movl %edx, %edx movq 0x40(%rsp,%rdx,8), %r15 cmpq $0x4, %r15 jl 0x820fb movl %eax, %r8d movq 0x40(%rsp,%r8,8), %r9 cmpq $0x3, %r9 jg 0x82113 leaq 0x5921b(%rip), %rdi # 0xdb31d jmp 0x8242b leaq 0x59195(%rip), %rdi # 0xdb2a3 jmp 0x8242b movq 0x28(%rsp), %rcx movq (%rcx,%rdx,8), %rax movq %rax, 0x80(%rsp) movq %rdx, 0x78(%rsp) cqto idivq %r15 leal -0x1(%rdx), %edi cmpl $0x2, %edi ja 0x821b0 movq %r8, 0x30(%rsp) movl %r10d, 0x14(%rsp) movl %r11d, 0x10(%rsp) movl %esi, 0xc(%rsp) xorps %xmm0, %xmm0 cvtsi2sd %edx, %xmm0 xorps %xmm1, %xmm1 cvtsi2sd %eax, %xmm1 divsd %xmm1, %xmm0 callq 0x60d0 cvttsd2si %xmm0, %eax cltq addq %rax, %r15 movq 0x78(%rsp), %rax movq %r15, 0x40(%rsp,%rax,8) movq 0x80(%rsp), %rax cqto idivq %r15 decl %edx cmpl $0x3, %edx jae 0x82193 leaq 0x591d0(%rip), %rdi # 0xdb35e jmp 0x8242b movq 0x30(%rsp), %r8 movq 0x40(%rsp,%r8,8), %r9 movl 0xc(%rsp), %esi movl 0x10(%rsp), %r11d movl 0x14(%rsp), %r10d movq 0x28(%rsp), %rcx movq (%rcx,%r8,8), %rax movq %rax, 0x80(%rsp) cqto idivq %r9 leal -0x1(%rdx), %edi cmpl $0x2, %edi movq %rbx, %r15 movl 0x8(%rsp), %ebx ja 0x8224a xorps %xmm0, %xmm0 cvtsi2sd %edx, %xmm0 xorps %xmm1, %xmm1 cvtsi2sd %eax, %xmm1 divsd %xmm1, %xmm0 movl %esi, 0xc(%rsp) movl %r11d, %ebx movl %r10d, 0x14(%rsp) movq %r8, 0x30(%rsp) movq %r9, 0x78(%rsp) callq 0x60d0 movq 0x28(%rsp), %rcx movl 0x14(%rsp), %r10d movl %ebx, %r11d movl 0x8(%rsp), %ebx movl 0xc(%rsp), %esi cvttsd2si %xmm0, %eax cltq movq 0x78(%rsp), %rdi addq %rax, %rdi movq 0x30(%rsp), %rax movq %rdi, 0x40(%rsp,%rax,8) movq 0x80(%rsp), %rax cqto idivq %rdi decl %edx cmpl $0x2, %edx ja 0x8224a leaq 0x59162(%rip), %rdi # 0xdb3a7 jmp 0x8242b movq 0x40(%rsp), %rax testl %r10d, %r10d jle 0x8228e movl %r10d, %r8d xorl %edx, %edx testq %rdx, %rdx je 0x82273 cmpq $0x0, 0x40(%rsp,%rdx,8) js 0x8227d jne 0x82286 movq $0x1, 0x40(%rsp,%rdx,8) jmp 0x82286 testq %rax, %rax jg 0x82286 movq (%rcx), %rax jmp 0x82286 movq (%rcx,%rdx,8), %rdi movq %rdi, 0x40(%rsp,%rdx,8) incq %rdx cmpq %rdx, %r8 jne 0x82259 movq %rax, 0x40(%rsp) movl 0x430(%r14), %r9d xorl %eax, %eax testl %r9d, %r9d setne %al shll $0x8, %eax orl $0x425031, %eax # imm = 0x425031 xorl %ecx, %ecx leaq 0x3c(%rsp), %rdx movl %eax, (%rdx) movw $0x4431, %ax # imm = 0x4431 leaq 0x8c(%rsp), %rdi movw %ax, (%rdi) movb %cl, 0x2(%rdi) leaq 0x88(%rsp), %r8 movw %ax, (%r8) movb %cl, 0x2(%r8) movq %rdx, 0x90(%rsp) movq %rdi, 0x98(%rsp) movq %r8, 0xa0(%rsp) testl %r10d, %r10d movl %r10d, 0x14(%rsp) jle 0x82326 movl %r10d, %ecx movl $0x1, %r10d xorl %edi, %edi movq 0x28(%rsp), %r8 movq (%r8,%rdi,8), %rax decq %rax cqto idivq 0x40(%rsp,%rdi,8) incq %rax imulq %rax, %r10 incq %rdi cmpq %rdi, %rcx jne 0x82307 jmp 0x8232c movl $0x1, %r10d testl %ebx, %ebx js 0x82337 movl $0x1, %ecx jmp 0x82350 movss 0x420(%r14), %xmm0 movl $0x3, %ecx ucomiss 0x58a24(%rip), %xmm0 # 0xdad70 jne 0x82350 jnp 0x82330 cmpl $0x15, %ebp jle 0x8239f cmpl $0x28, %ebp jg 0x823cc cmpl $0x16, %ebp je 0x82442 cmpl $0x1f, %ebp jne 0x82424 movl $0x315f4f, 0x1b(%rsp) # imm = 0x315F4F movl $0x4f494c50, 0x18(%rsp) # imm = 0x4F494C50 testl %r9d, %r9d movl %esi, 0xc(%rsp) movl %r11d, 0x10(%rsp) movl %ebx, 0x8(%rsp) je 0x824a6 movl $0x495131, 0x3c(%rsp) # imm = 0x495131 jmp 0x824ae cmpl $-0x1, %ebp je 0x823fb cmpl $0xb, %ebp je 0x82487 cmpl $0x15, %ebp jne 0x82424 movl %ebx, 0x8(%rsp) movl %r11d, 0x10(%rsp) movl %esi, 0xc(%rsp) movl $0x315f50, 0x1b(%rsp) # imm = 0x315F50 jmp 0x82457 cmpl $0x29, %ebp je 0x82461 cmpl $0x33, %ebp jne 0x82424 movl %ebx, 0x8(%rsp) movl %r11d, 0x10(%rsp) movl %esi, 0xc(%rsp) movabsq $0x315f3250495a42, %rax # imm = 0x315F3250495A42 movq %rax, 0x18(%rsp) jmp 0x824ae movl %ebx, 0x8(%rsp) movl %r11d, 0x10(%rsp) movl %esi, 0xc(%rsp) movabsq $0x4552504d4f434f4e, %rax # imm = 0x4552504D4F434F4E movq %rax, 0x18(%rsp) movl $0x535345, 0x1f(%rsp) # imm = 0x535345 jmp 0x824ae leaq 0x58fd8(%rip), %rdi # 0xdb403 callq 0x37264 movl $0x19d, (%r12) # imm = 0x19D movl $0x19d, %eax # imm = 0x19D jmp 0x82909 movl %ebx, 0x8(%rsp) movl %r11d, 0x10(%rsp) movl %esi, 0xc(%rsp) movl $0x325f50, 0x1b(%rsp) # imm = 0x325F50 movl $0x50495a47, 0x18(%rsp) # imm = 0x50495A47 jmp 0x824ae movl %ebx, 0x8(%rsp) movl %r11d, 0x10(%rsp) movl %esi, 0xc(%rsp) movabsq $0x534552504d4f4348, %rax # imm = 0x534552504D4F4348 movq %rax, 0x18(%rsp) movl $0x315f53, 0x20(%rsp) # imm = 0x315F53 jmp 0x824ae movl %ebx, 0x8(%rsp) movl %r11d, 0x10(%rsp) movl %esi, 0xc(%rsp) movl $0x315f45, 0x1b(%rsp) # imm = 0x315F45 movl $0x45434952, 0x18(%rsp) # imm = 0x45434952 jmp 0x824ae movl $0x495031, 0x3c(%rsp) # imm = 0x495031 movl 0x54(%r14), %ebp subq $0x8, %rsp leaq 0x108(%rsp), %rax leaq 0x128(%rsp), %r8 leaq 0x98(%rsp), %r9 movq %r15, %rdi movl $0x2, %esi movq %r10, %rdx pushq %r12 pushq $0x0 pushq %rax callq 0xadaa2 addq $0x20, %rsp leaq 0x54588(%rip), %rsi # 0xd6a76 leaq 0x58f3b(%rip), %rcx # 0xdb430 movq %r15, %rdi movl $0x1, %edx movq %r12, %r8 callq 0xaf0c1 testl %r13d, %r13d movq %r12, %rbx je 0x825d1 testl %ebp, %ebp jne 0x82533 leaq 0x58f38(%rip), %rsi # 0xdb454 leaq 0x4cd81(%rip), %rcx # 0xcf2a4 movq %r15, %rdi movl $0x1, %edx movq %rbx, %r8 callq 0xaf0c1 movslq 0x8(%rsp), %rdx leaq 0x54e68(%rip), %rsi # 0xd73a7 leaq 0x58f16(%rip), %rcx # 0xdb45c movq %r15, %rdi movq %rbx, %r8 callq 0xaefe0 movl 0x14(%rsp), %ebp movslq %ebp, %rdx leaq 0x58f19(%rip), %rsi # 0xdb478 leaq 0x58f19(%rip), %rcx # 0xdb47f movq %r15, %rdi movq %rbx, %r8 callq 0xaefe0 testl %ebp, %ebp jle 0x82625 movl %ebp, %eax movq %rax, 0x30(%rsp) leaq 0x140(%rsp), %rbp xorl %r14d, %r14d movq 0x28(%rsp), %r13 leaq 0x1(%r14), %r12 movl $0x4b, %esi movq %rbp, %rdi leaq 0x58ef8(%rip), %rdx # 0xdb49b movl %r12d, %ecx xorl %eax, %eax callq 0x60b0 movq (%r13,%r14,8), %rdx movq %r15, %rdi movq %rbp, %rsi leaq 0x58ee5(%rip), %rcx # 0xdb4a4 movq %rbx, %r8 callq 0xaefe0 movq %r12, %r14 cmpq %r12, 0x30(%rsp) jne 0x82590 movl 0x14(%rsp), %eax testl %eax, %eax jle 0x82625 movl %eax, %r13d leaq 0x140(%rsp), %r12 xorl %ebp, %ebp leaq 0x1(%rbp), %r14 movl $0x4b, %esi movq %r12, %rdi leaq 0x58ec9(%rip), %rdx # 0xdb4c2 movl %r14d, %ecx xorl %eax, %eax callq 0x60b0 movq 0x40(%rsp,%rbp,8), %rdx movq %r15, %rdi movq %r12, %rsi leaq 0x58eb5(%rip), %rcx # 0xdb4ca movq %rbx, %r8 callq 0xaefe0 movq %r14, %rbp cmpq %r14, %r13 jne 0x825e6 cmpl $0x0, 0x8(%rsp) jns 0x8266b movq 0x8(%r15), %rax movss 0x420(%rax), %xmm0 ucomiss 0x58731(%rip), %xmm0 # 0xdad70 jne 0x827b7 jp 0x827b7 leaq 0x58e97(%rip), %rsi # 0xdb4e9 leaq 0x589d8(%rip), %rdx # 0xdb031 leaq 0x58e92(%rip), %rcx # 0xdb4f2 movq %r15, %rdi movq %rbx, %r8 callq 0xaef6f leaq 0x46c06(%rip), %rsi # 0xc9278 leaq 0x59585(%rip), %rcx # 0xdbbfe leaq 0x18(%rsp), %rdx movq %r15, %rdi movq %rbx, %r8 callq 0xaef6f movq 0x8(%r15), %rax movl 0x3e8(%rax), %eax cmpl $0x29, %eax je 0x82731 cmpl $0xb, %eax jne 0x827f4 leaq 0x58f99(%rip), %rsi # 0xdb645 leaq 0x58f99(%rip), %rdx # 0xdb64c leaq 0x58f9c(%rip), %rcx # 0xdb656 movq %r15, %rdi movq %rbx, %r8 callq 0xaef6f leaq 0x58fa1(%rip), %rsi # 0xdb66d leaq 0x58fa0(%rip), %rcx # 0xdb673 movl $0x20, %edx movq %r15, %rdi movq %rbx, %r8 callq 0xaefe0 leaq 0x58f9a(%rip), %rsi # 0xdb684 leaq 0x58f9a(%rip), %rdx # 0xdb68b leaq 0x58f9b(%rip), %rcx # 0xdb693 movq %r15, %rdi movq %rbx, %r8 callq 0xaef6f movl 0x8(%rsp), %eax leaq 0x58fa5(%rip), %rsi # 0xdb6b3 leaq 0x58f7e(%rip), %rcx # 0xdb693 cmpl $0x10, %eax je 0x827dd cmpl $0x8, %eax jne 0x827e4 movl $0x1, %edx jmp 0x827e9 leaq 0x58f0d(%rip), %rsi # 0xdb645 leaq 0x47073(%rip), %rdx # 0xc97b2 leaq 0x58f73(%rip), %r14 # 0xdb6b9 movq %r15, %rdi movq %r14, %rcx movq %rbx, %r8 callq 0xaef6f movq 0x8(%r15), %rax movss 0x434(%rax), %xmm0 leaq 0x58f06(%rip), %rsi # 0xdb66d movq %r15, %rdi movl $0x7, %edx movq %r14, %rcx movq %rbx, %r8 callq 0xaf194 leaq 0x58f03(%rip), %rsi # 0xdb684 leaq 0x58f48(%rip), %rdx # 0xdb6d0 leaq 0x58f48(%rip), %r14 # 0xdb6d7 movq %r15, %rdi movq %r14, %rcx movq %rbx, %r8 callq 0xaef6f movq 0x8(%r15), %rax movslq 0x438(%rax), %rdx leaq 0x58f04(%rip), %rsi # 0xdb6b3 movq %r15, %rdi movq %r14, %rcx jmp 0x827ec movl 0x424(%rax), %ecx cmpl $0x2, %ecx je 0x8291b testl %ecx, %ecx jne 0x82972 movl $0x1, 0x424(%rax) jmp 0x82989 movl $0x2, %edx jmp 0x827e9 movl $0x4, %edx movq %r15, %rdi movq %rbx, %r8 callq 0xaefe0 cmpb $0x0, 0x10(%rsp) je 0x82832 movups 0x4bab7(%rip), %xmm0 # 0xce2b9 movups %xmm0, 0xcc(%rsp) movups 0x4ba9c(%rip), %xmm0 # 0xce2ad movaps %xmm0, 0xc0(%rsp) movups 0x4ba7d(%rip), %xmm0 # 0xce29d movaps %xmm0, 0xb0(%rsp) movsd 0x4b9d0(%rip), %xmm0 # 0xce200 jmp 0x828b0 movl 0xc(%rsp), %eax cmpl $0x28, %eax je 0x8287b cmpl $0xa, %eax jne 0x82907 movups 0x4bb09(%rip), %xmm0 # 0xce354 movups %xmm0, 0xc9(%rsp) movups 0x4baf1(%rip), %xmm0 # 0xce34b movaps %xmm0, 0xc0(%rsp) movups 0x4bad2(%rip), %xmm0 # 0xce33b movaps %xmm0, 0xb0(%rsp) movsd 0x4b977(%rip), %xmm0 # 0xce1f0 jmp 0x828b0 movups 0x4ba79(%rip), %xmm0 # 0xce2fb movups %xmm0, 0xcb(%rsp) movups 0x4ba5f(%rip), %xmm0 # 0xce2f0 movaps %xmm0, 0xc0(%rsp) movups 0x4ba40(%rip), %xmm0 # 0xce2e0 movaps %xmm0, 0xb0(%rsp) movsd 0x4b948(%rip), %xmm0 # 0xce1f8 leaq 0x4987b(%rip), %rsi # 0xcc132 leaq 0xb0(%rsp), %r14 movq %r15, %rdi xorl %edx, %edx movq %r14, %rcx movq %rbx, %r8 callq 0xaf051 movabsq $0x726f7463616620, %rax # imm = 0x726F7463616620 movq %rax, 0xf(%r14) movups 0x4b9e5(%rip), %xmm0 # 0xce2c9 movaps %xmm0, (%r14) leaq 0x46ec2(%rip), %rsi # 0xc97b1 movsd 0x46789(%rip), %xmm0 # 0xc9080 movq %r15, %rdi xorl %edx, %edx movq %r14, %rcx movq %rbx, %r8 callq 0xaf051 movl (%rbx), %eax addq $0x198, %rsp # imm = 0x198 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movabsq $0x534552504d4f4348, %rcx # imm = 0x534552504D4F4348 xorq 0x18(%rsp), %rcx movl 0x20(%rsp), %edx xorq $0x315f53, %rdx # imm = 0x315F53 orq %rcx, %rdx jne 0x829d5 movl $0x1, 0x424(%rax) movq 0x7c679(%rip), %rax # 0xfefc8 movq (%rax), %rcx leaq 0x58bc3(%rip), %rdi # 0xdb51c movl $0x7c, %esi movl $0x1, %edx callq 0x6530 movq 0x8(%r15), %rax movl 0x424(%rax), %ecx cmpl $-0x1, %ecx je 0x82a4f cmpl $0x2, %ecx je 0x829d5 cmpl $0x1, %ecx jne 0x8266b leaq 0x58b59(%rip), %rsi # 0xdb4e9 leaq 0x58c02(%rip), %rdx # 0xdb599 leaq 0x58c10(%rip), %rcx # 0xdb5ae movq %r15, %rdi movq %rbx, %r8 callq 0xaef6f movl $0x428, %ecx # imm = 0x428 addq 0x8(%r15), %rcx leaq 0x58c12(%rip), %rdx # 0xdb5cb leaq 0x58c14(%rip), %r8 # 0xdb5d4 movq %r15, %rdi movl $0x1f, %esi movq %rbx, %r9 callq 0xaedbe jmp 0x8266b leaq 0x58b0d(%rip), %rsi # 0xdb4e9 leaq 0x58c19(%rip), %rdx # 0xdb5fc leaq 0x58bc4(%rip), %rcx # 0xdb5ae movq %r15, %rdi movq %rbx, %r8 callq 0xaef6f movl $0x428, %ecx # imm = 0x428 addq 0x8(%r15), %rcx leaq 0x58bc6(%rip), %rdx # 0xdb5cb leaq 0x58bc8(%rip), %r8 # 0xdb5d4 movq %r15, %rdi movl $0x1f, %esi movq %rbx, %r9 callq 0xaedbe movl $0x45434952, %eax # imm = 0x45434952 xorl 0x18(%rsp), %eax movl $0x315f45, %ecx # imm = 0x315F45 xorl 0x1b(%rsp), %ecx orl %eax, %ecx jne 0x8266b movabsq $0x454e4f5f45434952, %rax # imm = 0x454E4F5F45434952 movq %rax, 0x18(%rsp) movb $0x0, 0x20(%rsp) jmp 0x8266b leaq 0x58a93(%rip), %rsi # 0xdb4e9 leaq 0x58bbd(%rip), %rdx # 0xdb61a leaq 0x58bc0(%rip), %rcx # 0xdb624 jmp 0x82660
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_compress_image
int imcomp_compress_image (fitsfile *infptr, fitsfile *outfptr, int *status) /* This routine does the following: - reads an image one tile at a time - if it is a float or double image, then it tries to quantize the pixels into scaled integers. - it then compressess the integer pixels, or if the it was not possible to quantize the floating point pixels, then it losslessly compresses them with gzip - writes the compressed byte stream to the output FITS file */ { double *tiledata; int anynul, gotnulls = 0, datatype; long ii, row; int naxis; double dummy = 0., dblnull = DOUBLENULLVALUE; float fltnull = FLOATNULLVALUE; long maxtilelen, tilelen, incre[] = {1, 1, 1, 1, 1, 1}; long naxes[MAX_COMPRESS_DIM], fpixel[MAX_COMPRESS_DIM]; long lpixel[MAX_COMPRESS_DIM], tile[MAX_COMPRESS_DIM]; long tilesize[MAX_COMPRESS_DIM]; long i0, i1, i2, i3, i4, i5, trowsize, ntrows; char card[FLEN_CARD]; if (*status > 0) return(*status); maxtilelen = (outfptr->Fptr)->maxtilelen; /* Allocate buffer to hold 1 tile of data; size depends on which compression algorithm is used: Rice and GZIP will compress byte, short, or int arrays without conversion. PLIO requires 4-byte int values, so byte and short arrays must be converted to int. HCompress internally converts byte or short values to ints, and converts int values to 8-byte longlong integers. */ if ((outfptr->Fptr)->zbitpix == FLOAT_IMG) { datatype = TFLOAT; if ( (outfptr->Fptr)->compress_type == HCOMPRESS_1) { /* need twice as much scratch space (8 bytes per pixel) */ tiledata = (double*) malloc (maxtilelen * 2 *sizeof (float)); } else { tiledata = (double*) malloc (maxtilelen * sizeof (float)); } } else if ((outfptr->Fptr)->zbitpix == DOUBLE_IMG) { datatype = TDOUBLE; tiledata = (double*) malloc (maxtilelen * sizeof (double)); } else if ((outfptr->Fptr)->zbitpix == SHORT_IMG) { datatype = TSHORT; if ( (outfptr->Fptr)->compress_type == RICE_1 || (outfptr->Fptr)->compress_type == GZIP_1 || (outfptr->Fptr)->compress_type == GZIP_2 || (outfptr->Fptr)->compress_type == BZIP2_1 || (outfptr->Fptr)->compress_type == NOCOMPRESS) { /* only need buffer of I*2 pixels for gzip, bzip2, and Rice */ tiledata = (double*) malloc (maxtilelen * sizeof (short)); } else { /* need buffer of I*4 pixels for Hcompress and PLIO */ tiledata = (double*) malloc (maxtilelen * sizeof (int)); } } else if ((outfptr->Fptr)->zbitpix == BYTE_IMG) { datatype = TBYTE; if ( (outfptr->Fptr)->compress_type == RICE_1 || (outfptr->Fptr)->compress_type == BZIP2_1 || (outfptr->Fptr)->compress_type == GZIP_1 || (outfptr->Fptr)->compress_type == GZIP_2) { /* only need buffer of I*1 pixels for gzip, bzip2, and Rice */ tiledata = (double*) malloc (maxtilelen); } else { /* need buffer of I*4 pixels for Hcompress and PLIO */ tiledata = (double*) malloc (maxtilelen * sizeof (int)); } } else if ((outfptr->Fptr)->zbitpix == LONG_IMG) { datatype = TINT; if ( (outfptr->Fptr)->compress_type == HCOMPRESS_1) { /* need twice as much scratch space (8 bytes per pixel) */ tiledata = (double*) malloc (maxtilelen * 2 * sizeof (int)); } else { /* only need buffer of I*4 pixels for gzip, bzip2, Rice, and PLIO */ tiledata = (double*) malloc (maxtilelen * sizeof (int)); } } else { ffpmsg("Bad image datatype. (imcomp_compress_image)"); return (*status = MEMORY_ALLOCATION); } if (tiledata == NULL) { ffpmsg("Out of memory. (imcomp_compress_image)"); return (*status = MEMORY_ALLOCATION); } /* calculate size of tile in each dimension */ naxis = (outfptr->Fptr)->zndim; for (ii = 0; ii < MAX_COMPRESS_DIM; ii++) { if (ii < naxis) { naxes[ii] = (outfptr->Fptr)->znaxis[ii]; tilesize[ii] = (outfptr->Fptr)->tilesize[ii]; } else { naxes[ii] = 1; tilesize[ii] = 1; } } row = 1; /* set up big loop over up to 6 dimensions */ for (i5 = 1; i5 <= naxes[5]; i5 += tilesize[5]) { fpixel[5] = i5; lpixel[5] = minvalue(i5 + tilesize[5] - 1, naxes[5]); tile[5] = lpixel[5] - fpixel[5] + 1; for (i4 = 1; i4 <= naxes[4]; i4 += tilesize[4]) { fpixel[4] = i4; lpixel[4] = minvalue(i4 + tilesize[4] - 1, naxes[4]); tile[4] = lpixel[4] - fpixel[4] + 1; for (i3 = 1; i3 <= naxes[3]; i3 += tilesize[3]) { fpixel[3] = i3; lpixel[3] = minvalue(i3 + tilesize[3] - 1, naxes[3]); tile[3] = lpixel[3] - fpixel[3] + 1; for (i2 = 1; i2 <= naxes[2]; i2 += tilesize[2]) { fpixel[2] = i2; lpixel[2] = minvalue(i2 + tilesize[2] - 1, naxes[2]); tile[2] = lpixel[2] - fpixel[2] + 1; for (i1 = 1; i1 <= naxes[1]; i1 += tilesize[1]) { fpixel[1] = i1; lpixel[1] = minvalue(i1 + tilesize[1] - 1, naxes[1]); tile[1] = lpixel[1] - fpixel[1] + 1; for (i0 = 1; i0 <= naxes[0]; i0 += tilesize[0]) { fpixel[0] = i0; lpixel[0] = minvalue(i0 + tilesize[0] - 1, naxes[0]); tile[0] = lpixel[0] - fpixel[0] + 1; /* number of pixels in this tile */ tilelen = tile[0]; for (ii = 1; ii < naxis; ii++) { tilelen *= tile[ii]; } /* read next tile of data from image */ anynul = 0; if (datatype == TFLOAT) { ffgsve(infptr, 1, naxis, naxes, fpixel, lpixel, incre, FLOATNULLVALUE, (float *) tiledata, &anynul, status); } else if (datatype == TDOUBLE) { ffgsvd(infptr, 1, naxis, naxes, fpixel, lpixel, incre, DOUBLENULLVALUE, tiledata, &anynul, status); } else if (datatype == TINT) { ffgsvk(infptr, 1, naxis, naxes, fpixel, lpixel, incre, 0, (int *) tiledata, &anynul, status); } else if (datatype == TSHORT) { ffgsvi(infptr, 1, naxis, naxes, fpixel, lpixel, incre, 0, (short *) tiledata, &anynul, status); } else if (datatype == TBYTE) { ffgsvb(infptr, 1, naxis, naxes, fpixel, lpixel, incre, 0, (unsigned char *) tiledata, &anynul, status); } else { ffpmsg("Error bad datatype of image tile to compress"); free(tiledata); return (*status); } /* now compress the tile, and write to row of binary table */ /* NOTE: we don't have to worry about the presence of null values in the array if it is an integer array: the null value is simply encoded in the compressed array just like any other pixel value. If it is a floating point array, then we need to check for null only if the anynul parameter returned a true value when reading the tile */ /* Collapse sizes of higher dimension tiles into 2 dimensional equivalents needed by the quantizing algorithms for floating point types */ fits_calc_tile_rows(lpixel, fpixel, naxis, &trowsize, &ntrows, status); if (anynul && datatype == TFLOAT) { imcomp_compress_tile(outfptr, row, datatype, tiledata, tilelen, trowsize, ntrows, 1, &fltnull, status); } else if (anynul && datatype == TDOUBLE) { imcomp_compress_tile(outfptr, row, datatype, tiledata, tilelen, trowsize, ntrows, 1, &dblnull, status); } else { imcomp_compress_tile(outfptr, row, datatype, tiledata, tilelen, trowsize, ntrows, 0, &dummy, status); } /* set flag if we found any null values */ if (anynul) gotnulls = 1; /* check for any error in the previous operations */ if (*status > 0) { ffpmsg("Error writing compressed image to table"); free(tiledata); return (*status); } row++; } } } } } } free (tiledata); /* finished with this buffer */ /* insert ZBLANK keyword if necessary; only for TFLOAT or TDOUBLE images */ if (gotnulls) { ffgcrd(outfptr, "ZCMPTYPE", card, status); ffikyj(outfptr, "ZBLANK", COMPRESS_NULL_VALUE, "null value in the compressed integer array", status); } return (*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x238, %rsp # imm = 0x238 movq $0x0, 0x148(%rsp) movabsq $-0x4757c1d7a1454b49, %rax # imm = 0xB8A83E285EBAB4B7 movq %rax, 0x140(%rsp) movl $0x8541f136, 0x4c(%rsp) # imm = 0x8541F136 movl $0x1, %eax movq %rax, 0x150(%rsp) movq %rax, 0x158(%rsp) movq %rax, 0x160(%rsp) movq %rax, 0x168(%rsp) movq %rax, 0x170(%rsp) movq %rax, 0x178(%rsp) movl (%rdx), %r12d testl %r12d, %r12d jg 0x8355c movq %rsi, %r14 movq %rdi, %r13 movq 0x8(%rsi), %rbx movq 0x4c8(%rbx), %rdi movl 0x48c(%rbx), %ebp cmpl $-0x20, %ebp jne 0x82def cmpl $0x29, 0x43c(%rbx) jne 0x82e58 movq %rdx, %r15 shlq $0x3, %rdi jmp 0x82e5f cmpl $0xf, %ebp jg 0x83512 cmpl $-0x40, %ebp je 0x83571 cmpl $0x8, %ebp jne 0x83541 movq %rdx, %r15 movl 0x43c(%rbx), %eax movl $0xb, 0x10(%rsp) movb $0x1, %cl movl %ecx, 0xc(%rsp) cmpq $0x33, %rax ja 0x835fc movabsq $0x8000000600800, %rcx # imm = 0x8000000600800 btq %rax, %rcx jae 0x835fc movl $0x0, (%rsp) movl $0x0, 0x8(%rsp) movl $0x0, 0x4(%rsp) jmp 0x82e86 movq %rdx, %r15 shlq $0x2, %rdi movl $0x2a, 0x10(%rsp) movl $0x0, (%rsp) movl $0x0, 0x8(%rsp) movl $0x0, 0x4(%rsp) movl $0x0, 0xc(%rsp) callq 0x61a0 movq %rax, 0x18(%rsp) testq %rax, %rax je 0x834e2 movl %ebp, 0x2c(%rsp) movq %r13, 0x20(%rsp) movslq 0x490(%rbx), %r13 movl %r13d, %ebp xorl %eax, %eax movl $0x1, %ecx movl $0x1, %edx cmpq %r13, %rax jge 0x82ecd movq 0x440(%rbx,%rax,8), %rdx movq 0x498(%rbx,%rax,8), %rcx movq %rcx, 0x50(%rsp,%rax,8) movq %rdx, 0x180(%rsp,%rax,8) incq %rax cmpq $0x6, %rax jne 0x82eae movq 0x78(%rsp), %rcx testq %rcx, %rcx jle 0x83535 movq %r14, 0x30(%rsp) movq 0x1a8(%rsp), %rdi movq 0x1a0(%rsp), %rax movq %rax, 0x108(%rsp) movq 0x198(%rsp), %rax movq %rax, 0x110(%rsp) movq 0x190(%rsp), %rax movq %rax, 0x118(%rsp) movq 0x180(%rsp), %rax movq %rax, 0x130(%rsp) movq 0x188(%rsp), %rax movq %rax, 0x120(%rsp) movq $0x0, 0x40(%rsp) leaq 0x50(%rsp), %rax movq 0x20(%rax), %rax movl $0x1, %r8d movl $0x1, %edx movq %rdx, 0x38(%rsp) movq %rdi, 0xe0(%rsp) movq %r8, %rdx movq %r8, 0xd8(%rsp) addq %rdi, %r8 cmpq %rcx, %r8 leaq -0x1(%rdi,%rdx), %rsi cmovgq %rcx, %rsi movq %rsi, 0xa8(%rsp) subq %rdx, %rsi incq %rsi movq %rsi, 0x1d8(%rsp) testq %rax, %rax jle 0x83483 movq %r8, 0xe8(%rsp) movl $0x1, %edx movq 0x68(%rsp), %rcx movq %rdx, 0xd0(%rsp) movq 0x108(%rsp), %rsi leaq (%rsi,%rdx), %rdi movq %rdi, 0xf0(%rsp) cmpq %rax, %rdi leaq -0x1(%rsi,%rdx), %rsi cmovgq %rax, %rsi movq %rsi, 0xa0(%rsp) subq %rdx, %rsi incq %rsi movq %rsi, 0x1d0(%rsp) testq %rcx, %rcx jle 0x8345d movl $0x1, %edx movq 0x60(%rsp), %rax movq %rdx, 0xc8(%rsp) movq 0x110(%rsp), %rsi leaq (%rsi,%rdx), %rdi movq %rdi, 0xf8(%rsp) cmpq %rcx, %rdi leaq -0x1(%rsi,%rdx), %rsi cmovgq %rcx, %rsi movq %rsi, 0x98(%rsp) subq %rdx, %rsi incq %rsi movq %rsi, 0x1c8(%rsp) testq %rax, %rax jle 0x83447 movl $0x1, %edx movq 0x58(%rsp), %rcx movq %rdx, 0xc0(%rsp) movq 0x118(%rsp), %rsi leaq (%rsi,%rdx), %rdi movq %rdi, 0x100(%rsp) cmpq %rax, %rdi leaq -0x1(%rsi,%rdx), %rsi cmovgq %rax, %rsi movq %rsi, 0x90(%rsp) subq %rdx, %rsi incq %rsi movq %rsi, 0x1c0(%rsp) testq %rcx, %rcx jle 0x83431 movl $0x1, %edx movq 0x50(%rsp), %rax movq %rdx, 0xb8(%rsp) movq 0x120(%rsp), %rsi leaq (%rsi,%rdx), %rdi movq %rdi, 0x128(%rsp) cmpq %rcx, %rdi leaq -0x1(%rsi,%rdx), %rsi cmovgq %rcx, %rsi movq %rsi, 0x88(%rsp) subq %rdx, %rsi incq %rsi movq %rsi, 0x1b8(%rsp) testq %rax, %rax jle 0x8341b movl $0x1, %ecx movq 0x130(%rsp), %rdx leaq (%rdx,%rcx), %rsi cmpq %rax, %rsi leaq -0x1(%rdx,%rcx), %r12 cmovgq %rax, %r12 movq %r12, 0x80(%rsp) subq %rcx, %r12 incq %r12 movq %rcx, 0xb0(%rsp) cmpl $0x2, %ebp jl 0x8314b movl $0x1, %eax imulq 0x1b0(%rsp,%rax,8), %r12 incq %rax cmpq %rax, %r13 jne 0x8313a movl $0x0, 0x14(%rsp) cmpl $-0x20, 0x2c(%rsp) movq %rsi, 0x138(%rsp) jne 0x831a7 movq 0x20(%rsp), %rdi movl $0x1, %esi movl %ebp, %edx leaq 0x50(%rsp), %rcx leaq 0xb0(%rsp), %r8 leaq 0x80(%rsp), %r9 movss 0x45f31(%rip), %xmm0 # 0xc90bc pushq %r15 leaq 0x1c(%rsp), %rax pushq %rax pushq 0x28(%rsp) leaq 0x168(%rsp), %rax pushq %rax callq 0x4c866 jmp 0x831f1 cmpb $0x0, (%rsp) je 0x831fa movq 0x20(%rsp), %rdi movl $0x1, %esi movl %r13d, %edx leaq 0x50(%rsp), %rcx leaq 0xb0(%rsp), %r8 leaq 0x80(%rsp), %r9 movsd 0x48099(%rip), %xmm0 # 0xcb270 pushq %r15 leaq 0x1c(%rsp), %rax pushq %rax pushq 0x28(%rsp) leaq 0x168(%rsp), %rax pushq %rax callq 0x49ab2 addq $0x20, %rsp jmp 0x832e2 cmpb $0x0, 0x8(%rsp) je 0x83247 subq $0x8, %rsp movq 0x28(%rsp), %rdi movl $0x1, %esi movl %ebp, %edx leaq 0x58(%rsp), %rcx leaq 0xb8(%rsp), %r8 leaq 0x88(%rsp), %r9 pushq %r15 leaq 0x24(%rsp), %rax pushq %rax pushq 0x30(%rsp) pushq $0x0 leaq 0x178(%rsp), %rax pushq %rax callq 0x58c06 jmp 0x832de cmpb $0x0, 0x4(%rsp) je 0x83292 subq $0x8, %rsp movq 0x28(%rsp), %rdi movl $0x1, %esi movl %r13d, %edx leaq 0x58(%rsp), %rcx leaq 0xb8(%rsp), %r8 leaq 0x88(%rsp), %r9 pushq %r15 leaq 0x24(%rsp), %rax pushq %rax pushq 0x30(%rsp) pushq $0x0 leaq 0x178(%rsp), %rax pushq %rax callq 0x4f73c jmp 0x832de cmpb $0x0, 0xc(%rsp) je 0x835f0 subq $0x8, %rsp movq 0x28(%rsp), %rdi movl $0x1, %esi movl %ebp, %edx leaq 0x58(%rsp), %rcx leaq 0xb8(%rsp), %r8 leaq 0x88(%rsp), %r9 pushq %r15 leaq 0x24(%rsp), %rax pushq %rax pushq 0x30(%rsp) pushq $0x0 leaq 0x178(%rsp), %rax pushq %rax callq 0x4695b addq $0x30, %rsp cmpl $0x0, (%r15) movl $0x1, %edx cmoveq %rdx, %r14 cmoveq %rdx, %rbx jne 0x83338 testl %r13d, %r13d jle 0x83338 movl $0x1, %ebx xorl %r14d, %r14d xorl %eax, %eax movq 0x80(%rsp,%rax,8), %rcx subq 0xb0(%rsp,%rax,8), %rcx jle 0x83328 incq %rcx testq %r14, %r14 cmoveq %rcx, %r14 cmoveq %rdx, %rcx imulq %rcx, %rbx incq %rax cmpq %rax, %rbp jne 0x83304 cmpq $0x1, %r14 adcq $0x0, %r14 cmpl $-0x20, 0x2c(%rsp) setne %cl movl 0x14(%rsp), %eax testl %eax, %eax sete %dl orb %cl, %dl jne 0x83370 movq 0x30(%rsp), %rdi movq 0x38(%rsp), %rsi movl $0x2a, %edx movq 0x18(%rsp), %rcx movq %r12, %r8 movq %r14, %r9 pushq %r15 leaq 0x54(%rsp), %rax jmp 0x833a3 testl %eax, %eax sete %al movl (%rsp), %ecx xorb $0x1, %cl orb %al, %cl jne 0x833a8 movq 0x30(%rsp), %rdi movq 0x38(%rsp), %rsi movl $0x52, %edx movq 0x18(%rsp), %rcx movq %r12, %r8 movq %r14, %r9 pushq %r15 leaq 0x148(%rsp), %rax pushq %rax pushq $0x1 jmp 0x833ce movq 0x30(%rsp), %rdi movq 0x38(%rsp), %rsi movl 0x10(%rsp), %edx movq 0x18(%rsp), %rcx movq %r12, %r8 movq %r14, %r9 pushq %r15 leaq 0x150(%rsp), %rax pushq %rax pushq $0x0 pushq %rbx callq 0x836bb addq $0x20, %rsp movl (%r15), %r12d testl %r12d, %r12d jg 0x834f7 cmpl $0x0, 0x14(%rsp) movq 0x40(%rsp), %rax movl $0x1, %ecx cmovnel %ecx, %eax movq %rax, 0x40(%rsp) incq 0x38(%rsp) movq 0x50(%rsp), %rax movq 0x138(%rsp), %rcx cmpq %rax, %rcx jle 0x83102 movq 0x58(%rsp), %rcx movq 0x128(%rsp), %rdx cmpq %rcx, %rdx jle 0x830b6 movq 0x60(%rsp), %rax movq 0x100(%rsp), %rdx cmpq %rax, %rdx jle 0x83065 movq 0x68(%rsp), %rcx movq 0xf8(%rsp), %rdx cmpq %rcx, %rdx jle 0x83014 movq 0x70(%rsp), %rax movq 0xf0(%rsp), %rdx cmpq %rax, %rdx jle 0x82fc3 movq 0x78(%rsp), %rcx movq 0xe0(%rsp), %rdi movq 0xe8(%rsp), %r8 cmpq %rcx, %r8 jle 0x82f78 movq 0x18(%rsp), %rdi callq 0x6260 cmpl $0x0, 0x40(%rsp) je 0x8355c leaq 0x45dd0(%rip), %rsi # 0xc9278 leaq 0x1e0(%rsp), %rdx movq 0x30(%rsp), %r14 movq %r14, %rdi movq %r15, %rcx callq 0x6d586 leaq 0x582d0(%rip), %rsi # 0xdb797 leaq 0x582d0(%rip), %rcx # 0xdb79e movq %r14, %rdi movq $-0x7fffffff, %rdx # imm = 0x80000001 movq %r15, %r8 callq 0x96521 jmp 0x8350d leaq 0x58232(%rip), %rdi # 0xdb71b callq 0x37264 movl $0x71, (%r15) jmp 0x83556 leaq 0x58271(%rip), %rdi # 0xdb76f callq 0x37264 movq 0x18(%rsp), %rdi callq 0x6260 movl (%r15), %r12d jmp 0x8355c cmpl $0x10, %ebp je 0x8358a cmpl $0x20, %ebp jne 0x83541 cmpl $0x29, 0x43c(%rbx) jne 0x835cf movq %rdx, %r15 shlq $0x3, %rdi jmp 0x835d6 movq 0x18(%rsp), %rdi callq 0x6260 jmp 0x8355c leaq 0x581a7(%rip), %rdi # 0xdb6ef movq %rdx, %rbx callq 0x37264 movl $0x71, (%rbx) movl $0x71, %r12d movl %r12d, %eax addq $0x238, %rsp # imm = 0x238 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rdx, %r15 shlq $0x3, %rdi movl $0x52, 0x10(%rsp) movb $0x1, %al movl %eax, (%rsp) jmp 0x82e6e movl 0x43c(%rbx), %eax incl %eax cmpl $0x34, %eax ja 0x83605 movabsq $0x10000000c01001, %rcx # imm = 0x10000000C01001 btq %rax, %rcx jae 0x83605 movq %rdx, %r15 addq %rdi, %rdi movl $0x15, 0x10(%rsp) movb $0x1, %al movl %eax, 0x4(%rsp) movl $0x0, (%rsp) movl $0x0, 0x8(%rsp) jmp 0x82e7e movq %rdx, %r15 shlq $0x2, %rdi movl $0x1f, 0x10(%rsp) movb $0x1, %al movl %eax, 0x8(%rsp) movl $0x0, (%rsp) jmp 0x82e76 leaq 0x5814b(%rip), %rdi # 0xdb742 jmp 0x834fe shlq $0x2, %rdi jmp 0x82e3f movq %rdx, %r15 shlq $0x2, %rdi jmp 0x835ad
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_calc_max_elem
int imcomp_calc_max_elem (int comptype, int nx, int zbitpix, int blocksize) /* This function returns the maximum number of bytes in a compressed image line. nx = maximum number of pixels in a tile blocksize is only relevant for RICE compression */ { if (comptype == RICE_1) { if (zbitpix == 16) return (sizeof(short) * nx + nx / blocksize + 2 + 4); else return (sizeof(float) * nx + nx / blocksize + 2 + 4); } else if ((comptype == GZIP_1) || (comptype == GZIP_2)) { /* gzip usually compressed by at least a factor of 2 for I*4 images */ /* and somewhat less for I*2 images */ /* If this size turns out to be too small, then the gzip */ /* compression routine will allocate more space as required */ /* to be on the safe size, allocate buffer same size as input */ if (zbitpix == 16) return(nx * 2); else if (zbitpix == 8) return(nx); else return(nx * 4); } else if (comptype == BZIP2_1) { /* To guarantee that the compressed data will fit, allocate an output buffer of size 1% larger than the uncompressed data, plus 600 bytes */ return((int) (nx * 1.01 * zbitpix / 8. + 601.)); } else if (comptype == HCOMPRESS_1) { /* Imperical evidence suggests in the worst case, the compressed stream could be up to 10% larger than the original image. Add 26 byte overhead, only significant for very small tiles Possible improvement: may need to allow a larger size for 32-bit images */ if (zbitpix == 16 || zbitpix == 8) return( (int) (nx * 2.2 + 26)); /* will be compressing 16-bit int array */ else return( (int) (nx * 4.4 + 26)); /* will be compressing 32-bit int array */ } else return(nx * sizeof(int)); }
movl %edx, %r8d cmpl $0xb, %edi jne 0x8362c movl %esi, %eax cltd idivl %ecx cmpl $0x10, %r8d jne 0x83644 leal (%rax,%rsi,2), %esi addl $0x6, %esi jmp 0x836b8 leal -0x15(%rdi), %eax cmpl $0x1, %eax ja 0x8364c cmpl $0x8, %r8d je 0x836b8 cmpl $0x10, %r8d jne 0x83681 addl %esi, %esi jmp 0x836b8 leal (%rax,%rsi,4), %esi addl $0x6, %esi jmp 0x836b8 cmpl $0x29, %edi je 0x83686 cmpl $0x33, %edi jne 0x83681 cvtsi2sd %esi, %xmm0 mulsd 0x576e6(%rip), %xmm0 # 0xdad48 cvtsi2sd %r8d, %xmm1 mulsd %xmm0, %xmm1 mulsd 0x576dd(%rip), %xmm1 # 0xdad50 addsd 0x576dd(%rip), %xmm1 # 0xdad58 cvttsd2si %xmm1, %esi jmp 0x836b8 shll $0x2, %esi jmp 0x836b8 cmpl $0x10, %r8d je 0x83692 cmpl $0x8, %r8d jne 0x836a0 cvtsi2sd %esi, %xmm0 mulsd 0x57692(%rip), %xmm0 # 0xdad30 jmp 0x836ac cvtsi2sd %esi, %xmm0 mulsd 0x57694(%rip), %xmm0 # 0xdad40 addsd 0x57684(%rip), %xmm0 # 0xdad38 cvttsd2si %xmm0, %esi movl %esi, %eax retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_write_nocompress_tile
int imcomp_write_nocompress_tile(fitsfile *outfptr, long row, int datatype, void *tiledata, long tilelen, int nullcheck, void *nullflagval, int *status) { char coltype[4]; /* Write the uncompressed image tile pixels to the tile-compressed image file. */ /* This is a special case when using NOCOMPRESS for diagnostic purposes in fpack. */ /* Currently, this only supports a limited number of data types and */ /* does not fully support null-valued pixels in the image. */ if ((outfptr->Fptr)->cn_uncompressed < 1) { /* uncompressed data column doesn't exist, so append new column to table */ if (datatype == TSHORT) { strcpy(coltype, "1PI"); } else if (datatype == TINT) { strcpy(coltype, "1PJ"); } else if (datatype == TFLOAT) { strcpy(coltype, "1QE"); } else { ffpmsg("NOCOMPRESSION option only supported for int*2, int*4, and float*4 images"); return(*status = DATA_COMPRESSION_ERR); } fits_insert_col(outfptr, 999, "UNCOMPRESSED_DATA", coltype, status); /* create column */ } fits_get_colnum(outfptr, CASEINSEN, "UNCOMPRESSED_DATA", &(outfptr->Fptr)->cn_uncompressed, status); /* save col. num. */ fits_write_col(outfptr, datatype, (outfptr->Fptr)->cn_uncompressed, row, 1, tilelen, tiledata, status); /* write the tile data */ return (*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq %r8, %r15 movq %rcx, %r14 movl %edx, %ebp movq %rsi, %r12 movq %rdi, %r13 movq 0x48(%rsp), %rbx movq 0x8(%rdi), %rcx cmpl $0x0, 0x4dc(%rcx) jg 0x84421 cmpl $0x2a, %ebp je 0x843f9 cmpl $0x1f, %ebp je 0x843ef cmpl $0x15, %ebp jne 0x84474 movl $0x495031, 0x4(%rsp) # imm = 0x495031 jmp 0x84401 movl $0x4a5031, 0x4(%rsp) # imm = 0x4A5031 jmp 0x84401 movl $0x455131, 0x4(%rsp) # imm = 0x455131 leaq 0x5765d(%rip), %rdx # 0xdba65 leaq 0x4(%rsp), %rcx movq %r13, %rdi movl $0x3e7, %esi # imm = 0x3E7 movq %rbx, %r8 callq 0x1af13 movq 0x8(%r13), %rcx addq $0x4dc, %rcx # imm = 0x4DC leaq 0x57636(%rip), %rdx # 0xdba65 movq %r13, %rdi xorl %esi, %esi movq %rbx, %r8 callq 0x3ac2d movq 0x8(%r13), %rax movl 0x4dc(%rax), %edx movl $0x1, %r8d movq %r13, %rdi movl %ebp, %esi movq %r12, %rcx movq %r15, %r9 pushq %rbx pushq %r14 callq 0x98363 addq $0x10, %rsp movl (%rbx), %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x575a1(%rip), %rdi # 0xdba1c callq 0x37264 movl $0x19d, (%rbx) # imm = 0x19D movl $0x19d, %eax # imm = 0x19D jmp 0x84465
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_convert_tile_tushort
int imcomp_convert_tile_tushort( fitsfile *outfptr, void *tiledata, long tilelen, int nullcheck, void *nullflagval, int nullval, int zbitpix, double scale, double zero, int *intlength, int *status) { /* Prepare the input tile array of pixels for compression. */ /* Convert input unsigned integer*2 tile array in place to 4 or 8-byte ints for compression, */ /* If needed, convert 4 or 8-byte ints and do null value substitution. */ /* Note that the calling routine must have allocated the input array big enough */ /* to be able to do this. */ unsigned short *usbuff; short *sbuff; int flagval, *idata; long ii; /* datatype of input array is unsigned short. We only support writing this datatype to a FITS image with BITPIX = 16 and with BZERO = 0 and BSCALE = 32768. */ if (zbitpix != SHORT_IMG || scale != 1.0 || zero != 32768.) { ffpmsg("Implicit datatype conversion is not supported when writing to compressed images"); return(*status = DATA_COMPRESSION_ERR); } usbuff = (unsigned short *) tiledata; sbuff = (short *) tiledata; idata = (int *) tiledata; if ((outfptr->Fptr)->compress_type == RICE_1 || (outfptr->Fptr)->compress_type == GZIP_1 || (outfptr->Fptr)->compress_type == GZIP_2 || (outfptr->Fptr)->compress_type == BZIP2_1) { /* don't have to convert to int if using gzip, bzip2, or Rice compression */ *intlength = 2; /* offset the unsigned value by -32768 to a signed short value. */ /* It is more efficient to do this by just flipping the most significant of the 16 bits */ if (nullcheck == 1) { /* reset pixels equal to flagval to the FITS null value, prior to compression */ flagval = *(unsigned short *) (nullflagval); for (ii = tilelen - 1; ii >= 0; ii--) { if (usbuff[ii] == (unsigned short) flagval) sbuff[ii] = (short) nullval; else usbuff[ii] = (usbuff[ii]) ^ 0x8000; } } else { /* just offset the pixel values by 32768 (by flipping the MSB */ for (ii = tilelen - 1; ii >= 0; ii--) usbuff[ii] = (usbuff[ii]) ^ 0x8000; } } else { /* have to convert to int if using HCOMPRESS or PLIO */ *intlength = 4; if (nullcheck == 1) { /* offset the pixel values by 32768, and */ /* reset pixels equal to flagval to nullval */ flagval = *(unsigned short *) (nullflagval); for (ii = tilelen - 1; ii >= 0; ii--) { if (usbuff[ii] == (unsigned short) flagval) idata[ii] = nullval; else idata[ii] = ((int) usbuff[ii]) - 32768; } } else { /* just do the data type conversion to int */ /* for HCOMPRESS we need to simply subtract 32768 */ /* for PLIO, have to convert usbuff to an I*4 array, in place */ /* usbuff must have been allocated large enough to do this */ if ((outfptr->Fptr)->compress_type == HCOMPRESS_1) { fits_ushort_to_int_inplace(usbuff, tilelen, -32768, status); } else { fits_ushort_to_int_inplace(usbuff, tilelen, 0, status); } } } return(*status); }
pushq %rbx movq 0x20(%rsp), %rbx cmpl $0x10, 0x10(%rsp) jne 0x846a7 ucomisd 0x44a55(%rip), %xmm0 # 0xc9080 jne 0x846a7 jp 0x846a7 ucomisd 0x49bc9(%rip), %xmm1 # 0xce200 jne 0x846a7 jp 0x846a7 movq 0x18(%rsp), %rax movq 0x8(%rdi), %rdi movl 0x43c(%rdi), %r10d cmpq $0x33, %r10 ja 0x846d8 movabsq $0x8000000600800, %r11 # imm = 0x8000000600800 btq %r10, %r11 jae 0x846d8 movl $0x2, (%rax) cmpl $0x1, %ecx jne 0x846c0 testq %rdx, %rdx jle 0x84736 movzwl (%r8), %eax incq %rdx movzwl -0x4(%rsi,%rdx,2), %ecx movl %ecx, %edi xorl $0xffff8000, %edi # imm = 0xFFFF8000 cmpw %ax, %cx cmovel %r9d, %edi movw %di, -0x4(%rsi,%rdx,2) decq %rdx cmpq $0x1, %rdx ja 0x84680 jmp 0x84736 leaq 0x57418(%rip), %rdi # 0xdbac6 callq 0x37264 movl $0x19d, (%rbx) # imm = 0x19D movl $0x19d, %eax # imm = 0x19D jmp 0x84738 testq %rdx, %rdx jle 0x84736 incq %rdx xorb $-0x80, -0x3(%rsi,%rdx,2) decq %rdx cmpq $0x1, %rdx ja 0x846c8 jmp 0x84736 movl $0x4, (%rax) cmpl $0x1, %ecx jne 0x84712 testq %rdx, %rdx jle 0x84736 movzwl (%r8), %eax incq %rdx movzwl -0x4(%rsi,%rdx,2), %ecx movl %ecx, %edi addl $0xffff8000, %edi # imm = 0xFFFF8000 cmpw %ax, %cx cmovel %r9d, %edi movl %edi, -0x8(%rsi,%rdx,4) decq %rdx cmpq $0x1, %rdx ja 0x846ef jmp 0x84736 xorl %eax, %eax cmpl $0x29, 0x43c(%rdi) setne %al shll $0xf, %eax addl $0xffff8000, %eax # imm = 0xFFFF8000 movq %rsi, %rdi movq %rdx, %rsi movl %eax, %edx movq %rbx, %rcx callq 0x8555e movl (%rbx), %eax popq %rbx retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_convert_tile_tbyte
int imcomp_convert_tile_tbyte( fitsfile *outfptr, void *tiledata, long tilelen, int nullcheck, void *nullflagval, int nullval, int zbitpix, double scale, double zero, int *intlength, int *status) { /* Prepare the input tile array of pixels for compression. */ /* Convert input unsigned integer*1 tile array in place to 4 or 8-byte ints for compression, */ /* If needed, convert 4 or 8-byte ints and do null value substitution. */ /* Note that the calling routine must have allocated the input array big enough */ /* to be able to do this. */ int flagval, *idata; long ii; unsigned char *usbbuff; /* datatype of input array is unsigned byte. We only support writing this datatype to a FITS image with BITPIX = 8 and with BZERO = 0 and BSCALE = 1. */ if (zbitpix != BYTE_IMG || scale != 1.0 || zero != 0.) { ffpmsg("Implicit datatype conversion is not supported when writing to compressed images"); return(*status = DATA_COMPRESSION_ERR); } idata = (int *) tiledata; usbbuff = (unsigned char *) tiledata; if ( (outfptr->Fptr)->compress_type == RICE_1 || (outfptr->Fptr)->compress_type == GZIP_1 || (outfptr->Fptr)->compress_type == GZIP_2 || (outfptr->Fptr)->compress_type == BZIP2_1 ) { /* don't have to convert to int if using gzip, bzip2, or Rice compression */ *intlength = 1; if (nullcheck == 1) { /* reset pixels equal to flagval to the FITS null value, prior to compression */ flagval = *(unsigned char *) (nullflagval); if (flagval != nullval) { for (ii = tilelen - 1; ii >= 0; ii--) { if (usbbuff[ii] == (unsigned char) flagval) usbbuff[ii] = (unsigned char) nullval; } } } } else { /* have to convert to int if using HCOMPRESS or PLIO */ *intlength = 4; if (nullcheck == 1) { /* reset pixels equal to flagval to the FITS null value, prior to compression */ flagval = *(unsigned char *) (nullflagval); for (ii = tilelen - 1; ii >= 0; ii--) { if (usbbuff[ii] == (unsigned char) flagval) idata[ii] = nullval; else idata[ii] = (int) usbbuff[ii]; } } else { /* just do the data type conversion to int */ /* have to convert usbbuff to an I*4 array, in place */ /* usbbuff must have been allocated large enough to do this */ fits_ubyte_to_int_inplace(usbbuff, tilelen, status); } } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq 0x50(%rsp), %r12 cmpl $0x8, 0x40(%rsp) jne 0x847dc ucomisd 0x44923(%rip), %xmm0 # 0xc9080 jne 0x847dc jp 0x847dc xorpd %xmm0, %xmm0 ucomisd %xmm0, %xmm1 jne 0x847dc jp 0x847dc movq %rdx, %r14 movq %rsi, %rbx movq 0x48(%rsp), %rax movq 0x8(%rdi), %rdx movl 0x43c(%rdx), %edx cmpq $0x33, %rdx ja 0x847fa movabsq $0x8000000600800, %rsi # imm = 0x8000000600800 btq %rdx, %rsi jae 0x847fa movl $0x1, (%rax) cmpl $0x1, %ecx jne 0x848da movzbl (%r8), %eax cmpl %r9d, %eax sete %cl testq %r14, %r14 setle %dl orb %cl, %dl jne 0x848da incq %r14 cmpb %al, -0x2(%rbx,%r14) jne 0x847ce movb %r9b, -0x2(%rbx,%r14) decq %r14 cmpq $0x1, %r14 ja 0x847c2 jmp 0x848da leaq 0x572e3(%rip), %rdi # 0xdbac6 callq 0x37264 movl $0x19d, (%r12) # imm = 0x19D movl $0x19d, %eax # imm = 0x19D jmp 0x848de movl $0x4, (%rax) cmpl $0x1, %ecx jne 0x84833 testq %r14, %r14 jle 0x848da movb (%r8), %al incq %r14 movzbl -0x2(%rbx,%r14), %ecx cmpb %al, %cl cmovel %r9d, %ecx movl %ecx, -0x8(%rbx,%r14,4) decq %r14 cmpq $0x1, %r14 ja 0x84814 jmp 0x848da cmpl $0x0, (%r12) jg 0x848da movl $0x2710, %r13d # imm = 0x2710 cmpq %r13, %r14 cmovlq %r14, %r13 leaq (,%r13,4), %rdi callq 0x61a0 testq %rax, %rax je 0x848c6 movq %rax, %r15 testq %r14, %r14 jle 0x848bc subq %r13, %r14 xorl %ebp, %ebp leaq (%rbx,%r14), %rax cmpq $0x2, %r13 movl $0x1, %ecx cmovgeq %r13, %rcx xorl %edx, %edx movzbl (%rax,%rdx), %esi movl %esi, (%r15,%rdx,4) incq %rdx cmpq %rdx, %rcx jne 0x8487d leaq (%rbx,%r14,4), %rdi leaq (,%r13,4), %rdx movq %r15, %rsi callq 0x65c0 cmpq $0x2711, %r14 # imm = 0x2711 cmovlq %r14, %r13 leaq -0x2710(%r14), %r14 cmovlq %rbp, %r14 testq %r13, %r13 jg 0x8486a movq %r15, %rdi callq 0x6260 jmp 0x848da leaq 0x58297(%rip), %rdi # 0xdcb64 callq 0x37264 movl $0x71, (%r12) movl (%r12), %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_convert_tile_tint
int imcomp_convert_tile_tint( fitsfile *outfptr, void *tiledata, long tilelen, int nullcheck, void *nullflagval, int nullval, int zbitpix, double scale, double zero, int *intlength, int *status) { /* Prepare the input tile array of pixels for compression. */ /* Convert input integer tile array in place to 4 or 8-byte ints for compression, */ /* If needed, do null value substitution. */ int flagval, *idata; long ii; /* datatype of input array is int. We only support writing this datatype to a FITS image with BITPIX = 32 and with BZERO = 0 and BSCALE = 1. */ if (zbitpix != LONG_IMG || scale != 1.0 || zero != 0.) { ffpmsg("Implicit datatype conversion is not supported when writing to compressed images"); return(*status = DATA_COMPRESSION_ERR); } idata = (int *) tiledata; *intlength = 4; if (nullcheck == 1) { /* no datatype conversion is required for any of the compression algorithms, except possibly for HCOMPRESS (to I*8), which is handled later. Just reset pixels equal to flagval to the FITS null value */ flagval = *(int *) (nullflagval); if (flagval != nullval) { for (ii = tilelen - 1; ii >= 0; ii--) { if (idata[ii] == flagval) idata[ii] = nullval; } } } return(*status); }
pushq %rbx movq 0x20(%rsp), %rbx cmpl $0x20, 0x10(%rsp) jne 0x84b1d ucomisd 0x445b3(%rip), %xmm0 # 0xc9080 jne 0x84b1d jp 0x84b1d xorpd %xmm0, %xmm0 ucomisd %xmm0, %xmm1 jne 0x84b1d jp 0x84b1d movq 0x18(%rsp), %rax movl $0x4, (%rax) cmpl $0x1, %ecx jne 0x84b19 movl (%r8), %eax cmpl %r9d, %eax sete %cl testq %rdx, %rdx setle %dil orb %cl, %dil jne 0x84b19 incq %rdx cmpl %eax, -0x8(%rsi,%rdx,4) jne 0x84b10 movl %r9d, -0x8(%rsi,%rdx,4) decq %rdx cmpq $0x1, %rdx ja 0x84b05 movl (%rbx), %eax jmp 0x84b34 leaq 0x56fa2(%rip), %rdi # 0xdbac6 callq 0x37264 movl $0x19d, (%rbx) # imm = 0x19D movl $0x19d, %eax # imm = 0x19D popq %rbx retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
fits_shuffle_4bytes
static int fits_shuffle_4bytes(char *heap, LONGLONG length, int *status) /* shuffle the bytes in an array of 4-byte integers or floats */ { LONGLONG ii; char *ptr, *cptr, *heapptr; ptr = malloc((size_t) (length * 4)); if (!ptr) { ffpmsg("malloc failed\n"); return(*status); } heapptr = heap; cptr = ptr; for (ii = 0; ii < length; ii++) { *cptr = *heapptr; heapptr++; *(cptr + length) = *heapptr; heapptr++; *(cptr + (length * 2)) = *heapptr; heapptr++; *(cptr + (length * 3)) = *heapptr; heapptr++; cptr++; } memcpy(heap, ptr, (size_t) (length * 4)); free(ptr); return(*status); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rsi, %r12 movq %rdi, %r14 leaq (,%rsi,4), %rbx movq %rbx, %rdi callq 0x61a0 testq %rax, %rax je 0x8528e movq %rax, %r15 testq %r12, %r12 jle 0x8526d leaq (%r12,%r12,2), %rax xorl %ecx, %ecx movq %r14, %rdx movq %r15, %rsi movb (%rdx), %dil movb %dil, (%rsi) movb 0x1(%rdx), %dil movb %dil, (%rsi,%r12) movb 0x2(%rdx), %dil movb %dil, (%rsi,%r12,2) movb 0x3(%rdx), %dil movb %dil, (%rsi,%rax) addq $0x4, %rdx incq %rsi incq %rcx cmpq %rcx, %r12 jne 0x85240 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx callq 0x65c0 movq %r15, %rdi addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 jmp 0x6260 leaq 0x5783b(%rip), %rdi # 0xdcad0 addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 jmp 0x37264
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
fits_int_to_longlong_inplace
static int fits_int_to_longlong_inplace(int *intarray, long length, int *status) /* convert the input array of 32-bit integers into an array of 64-bit integers, in place. This will overwrite the input array with the new longer array starting at the same memory location. Note that aliasing the same memory location with pointers of different datatypes is not allowed in strict ANSI C99, however it is used here for efficency. In principle, one could simply copy the input array in reverse order to the output array, but this only works if the compiler performs the operation in strict order. Certain compiler optimization techniques may vioate this assumption. Therefore, we first copy a section of the input array to a temporary intermediate array, before copying the longer datatype values back to the original array. */ { LONGLONG *longlongarray, *aliasarray; long ii, ntodo, firstelem, nmax = 10000; if (*status > 0) return(*status); ntodo = nmax; if (length < nmax) ntodo = length; firstelem = length - ntodo; /* first element to be converted */ longlongarray = (LONGLONG *) malloc(ntodo * sizeof(LONGLONG)); if (longlongarray == NULL) { ffpmsg("Out of memory. (fits_int_to_longlong_inplace)"); return (*status = MEMORY_ALLOCATION); } aliasarray = (LONGLONG *) intarray; /* alias pointer to the input array */ while (ntodo > 0) { /* do datatype conversion into temp array */ for (ii = 0; ii < ntodo; ii++) { longlongarray[ii] = intarray[ii + firstelem]; } /* copy temp array back to alias */ memcpy(&(aliasarray[firstelem]), longlongarray, ntodo * 8); if (firstelem == 0) { /* we are all done */ ntodo = 0; } else { /* recalculate ntodo and firstelem for next loop */ if (firstelem > nmax) { firstelem -= nmax; } else { ntodo = firstelem; firstelem = 0; } } } free(longlongarray); return(*status); }
pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx cmpl $0x0, (%rdx) jle 0x853d3 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq movq %rdx, %r12 movq %rsi, %r14 movq %rdi, %rbx movl $0x2710, %r13d # imm = 0x2710 cmpq %r13, %rsi cmovlq %rsi, %r13 leaq (,%r13,8), %rdi callq 0x61a0 testq %rax, %rax je 0x8546c movq %rax, %r15 testq %r14, %r14 jle 0x8545b subq %r13, %r14 xorl %r12d, %r12d leaq (%rbx,%r14,4), %rax cmpq $0x2, %r13 movl $0x1, %ecx cmovgeq %r13, %rcx xorl %edx, %edx movslq (%rax,%rdx,4), %rsi movq %rsi, (%r15,%rdx,8) incq %rdx cmpq %rdx, %rcx jne 0x8541c leaq (%rbx,%r14,8), %rdi leaq (,%r13,8), %rdx movq %r15, %rsi callq 0x65c0 cmpq $0x2711, %r14 # imm = 0x2711 cmovlq %r14, %r13 leaq -0x2710(%r14), %r14 cmovlq %r12, %r14 testq %r13, %r13 jg 0x85409 movq %r15, %rdi popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 jmp 0x6260 leaq 0x5766c(%rip), %rdi # 0xdcadf callq 0x37264 movl $0x71, (%r12) jmp 0x853c9
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
fits_short_to_int_inplace
static int fits_short_to_int_inplace(short *shortarray, long length, int shift, int *status) /* convert the input array of 16-bit integers into an array of 32-bit integers, in place. This will overwrite the input array with the new longer array starting at the same memory location. Note that aliasing the same memory location with pointers of different datatypes is not allowed in strict ANSI C99, however it is used here for efficency. In principle, one could simply copy the input array in reverse order to the output array, but this only works if the compiler performs the operation in strict order. Certain compiler optimization techniques may vioate this assumption. Therefore, we first copy a section of the input array to a temporary intermediate array, before copying the longer datatype values back to the original array. */ { int *intarray, *aliasarray; long ii, ntodo, firstelem, nmax = 10000; if (*status > 0) return(*status); ntodo = nmax; if (length < nmax) ntodo = length; firstelem = length - ntodo; /* first element to be converted */ intarray = (int *) malloc(ntodo * sizeof(int)); if (intarray == NULL) { ffpmsg("Out of memory. (fits_short_to_int_inplace)"); return (*status = MEMORY_ALLOCATION); } aliasarray = (int *) shortarray; /* alias pointer to the input array */ while (ntodo > 0) { /* do datatype conversion into temp array */ for (ii = 0; ii < ntodo; ii++) { intarray[ii] = (int)(shortarray[ii + firstelem]) + shift; } /* copy temp array back to alias */ memcpy(&(aliasarray[firstelem]), intarray, ntodo * 4); if (firstelem == 0) { /* we are all done */ ntodo = 0; } else { /* recalculate ntodo and firstelem for next loop */ if (firstelem > nmax) { firstelem -= nmax; } else { ntodo = firstelem; firstelem = 0; } } } free(intarray); return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax cmpl $0x0, (%rcx) jle 0x854a4 addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rcx, %r13 movl %edx, %ebx movq %rsi, %r15 movq %rdi, %r14 movl $0x2710, %ebp # imm = 0x2710 cmpq %rbp, %rsi cmovlq %rsi, %rbp leaq (,%rbp,4), %rdi callq 0x61a0 testq %rax, %rax je 0x85545 movq %rax, %r12 testq %r15, %r15 jle 0x8552f subq %rbp, %r15 xorl %r13d, %r13d leaq (%r14,%r15,2), %rax cmpq $0x2, %rbp movl $0x1, %ecx cmovgeq %rbp, %rcx xorl %edx, %edx movswl (%rax,%rdx,2), %esi addl %ebx, %esi movl %esi, (%r12,%rdx,4) incq %rdx cmpq %rdx, %rcx jne 0x854ee leaq (%r14,%r15,4), %rdi leaq (,%rbp,4), %rdx movq %r12, %rsi callq 0x65c0 cmpq $0x2711, %r15 # imm = 0x2711 cmovlq %r15, %rbp leaq -0x2710(%r15), %r15 cmovlq %r13, %r15 testq %rbp, %rbp jg 0x854db movq %r12, %rdi addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp jmp 0x6260 leaq 0x575c1(%rip), %rdi # 0xdcb0d callq 0x37264 movl $0x71, (%r13) jmp 0x85495
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_nullscalefloats
int imcomp_nullscalefloats( float *fdata, long tilelen, int *idata, double scale, double zero, int nullcheck, float nullflagval, int nullval, int *status) /* do null value substitution of the float array. If array value = nullflagval, then set the output value to FLOATNULLVALUE. Otherwise, inverse scale the integer value. */ { long ii; double dvalue; if (nullcheck == 1) /* must check for null values */ { for (ii=0; ii < tilelen; ii++) { if (fdata[ii] == nullflagval) idata[ii] = nullval; else { dvalue = (fdata[ii] - zero) / scale; if (dvalue < DINT_MIN) { *status = OVERFLOW_ERR; idata[ii] = INT32_MIN; } else if (dvalue > DINT_MAX) { *status = OVERFLOW_ERR; idata[ii] = INT32_MAX; } else { if (dvalue >= 0.) idata[ii] = (int) (dvalue + .5); else idata[ii] = (int) (dvalue - .5); } } } } else /* don't have to worry about null values */ { for (ii=0; ii < tilelen; ii++) { dvalue = (fdata[ii] - zero) / scale; if (dvalue < DINT_MIN) { *status = OVERFLOW_ERR; idata[ii] = INT32_MIN; } else if (dvalue > DINT_MAX) { *status = OVERFLOW_ERR; idata[ii] = INT32_MAX; } else { if (dvalue >= 0.) idata[ii] = (int) (dvalue + .5); else idata[ii] = (int) (dvalue - .5); } } } return(*status); }
cmpl $0x1, %ecx jne 0x856e8 testq %rsi, %rsi jle 0x8576a xorl %eax, %eax movsd 0x52a85(%rip), %xmm3 # 0xd80d8 movsd 0x52a85(%rip), %xmm4 # 0xd80e0 xorpd %xmm5, %xmm5 movsd 0x4e4c9(%rip), %xmm6 # 0xd3b30 movsd 0x4e4a1(%rip), %xmm7 # 0xd3b10 movss (%rdi,%rax,4), %xmm8 ucomiss %xmm2, %xmm8 jne 0x85683 jp 0x85683 movl %r8d, (%rdx,%rax,4) jmp 0x856db cvtss2sd %xmm8, %xmm8 subsd %xmm1, %xmm8 divsd %xmm0, %xmm8 ucomisd %xmm8, %xmm3 jbe 0x856a9 movl $0xfffffff5, (%r9) # imm = 0xFFFFFFF5 movl $0x80000000, (%rdx,%rax,4) # imm = 0x80000000 jmp 0x856db ucomisd %xmm4, %xmm8 jbe 0x856c0 movl $0xfffffff5, (%r9) # imm = 0xFFFFFFF5 movl $0x7fffffff, (%rdx,%rax,4) # imm = 0x7FFFFFFF jmp 0x856db ucomisd %xmm5, %xmm8 jae 0x856ce addsd %xmm6, %xmm8 jmp 0x856d3 addsd %xmm7, %xmm8 cvttsd2si %xmm8, %ecx movl %ecx, (%rdx,%rax,4) incq %rax cmpq %rax, %rsi jne 0x8566f jmp 0x8576a testq %rsi, %rsi jle 0x8576a xorl %eax, %eax movsd 0x529e1(%rip), %xmm2 # 0xd80d8 movsd 0x529e1(%rip), %xmm3 # 0xd80e0 xorpd %xmm4, %xmm4 movsd 0x4e425(%rip), %xmm5 # 0xd3b30 movsd 0x4e3fd(%rip), %xmm6 # 0xd3b10 xorps %xmm7, %xmm7 cvtss2sd (%rdi,%rax,4), %xmm7 subsd %xmm1, %xmm7 divsd %xmm0, %xmm7 ucomisd %xmm7, %xmm2 jbe 0x85737 movl $0xfffffff5, (%r9) # imm = 0xFFFFFFF5 movl $0x80000000, %ecx # imm = 0x80000000 jmp 0x8575f ucomisd %xmm3, %xmm7 jbe 0x8574b movl $0xfffffff5, (%r9) # imm = 0xFFFFFFF5 movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF jmp 0x8575f ucomisd %xmm4, %xmm7 jae 0x85757 addsd %xmm5, %xmm7 jmp 0x8575b addsd %xmm6, %xmm7 cvttsd2si %xmm7, %ecx movl %ecx, (%rdx,%rax,4) incq %rax cmpq %rax, %rsi jne 0x85713 movl (%r9), %eax retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_nullfloats
int imcomp_nullfloats( float *fdata, long tilelen, int *idata, int nullcheck, float nullflagval, int nullval, int *status) /* do null value substitution of the float array. If array value = nullflagval, then set the output value to FLOATNULLVALUE. */ { long ii; double dvalue; if (nullcheck == 1) /* must check for null values */ { for (ii=0; ii < tilelen; ii++) { if (fdata[ii] == nullflagval) idata[ii] = nullval; else { dvalue = fdata[ii]; if (dvalue < DINT_MIN) { *status = OVERFLOW_ERR; idata[ii] = INT32_MIN; } else if (dvalue > DINT_MAX) { *status = OVERFLOW_ERR; idata[ii] = INT32_MAX; } else { if (dvalue >= 0) idata[ii] = (int) (dvalue + .5); else idata[ii] = (int) (dvalue - .5); } } } } else /* don't have to worry about null values */ { for (ii=0; ii < tilelen; ii++) { dvalue = fdata[ii]; if (dvalue < DINT_MIN) { *status = OVERFLOW_ERR; idata[ii] = INT32_MIN; } else if (dvalue > DINT_MAX) { *status = OVERFLOW_ERR; idata[ii] = INT32_MAX; } else { if (dvalue >= 0) idata[ii] = (int) (dvalue + .5); else idata[ii] = (int) (dvalue - .5); } } } return(*status); }
cmpl $0x1, %ecx jne 0x8580a testq %rsi, %rsi jle 0x85886 xorl %eax, %eax movsd 0x5294e(%rip), %xmm1 # 0xd80d8 movsd 0x5294e(%rip), %xmm2 # 0xd80e0 xorps %xmm3, %xmm3 movsd 0x4e393(%rip), %xmm4 # 0xd3b30 movsd 0x4e36b(%rip), %xmm5 # 0xd3b10 movss (%rdi,%rax,4), %xmm7 ucomiss %xmm0, %xmm7 jne 0x857b7 jp 0x857b7 movl %r8d, (%rdx,%rax,4) jmp 0x85800 xorps %xmm6, %xmm6 cvtss2sd %xmm7, %xmm6 ucomisd %xmm6, %xmm1 jbe 0x857d4 movl $0xfffffff5, (%r9) # imm = 0xFFFFFFF5 movl $0x80000000, (%rdx,%rax,4) # imm = 0x80000000 jmp 0x85800 ucomisd %xmm2, %xmm6 jbe 0x857ea movl $0xfffffff5, (%r9) # imm = 0xFFFFFFF5 movl $0x7fffffff, (%rdx,%rax,4) # imm = 0x7FFFFFFF jmp 0x85800 ucomiss %xmm3, %xmm7 jae 0x857f5 addsd %xmm4, %xmm6 jmp 0x857f9 addsd %xmm5, %xmm6 cvttsd2si %xmm6, %ecx movl %ecx, (%rdx,%rax,4) incq %rax cmpq %rax, %rsi jne 0x857a5 jmp 0x85886 testq %rsi, %rsi jle 0x85886 xorl %eax, %eax movsd 0x528bf(%rip), %xmm0 # 0xd80d8 movsd 0x528bf(%rip), %xmm1 # 0xd80e0 xorps %xmm2, %xmm2 movsd 0x4e304(%rip), %xmm3 # 0xd3b30 movsd 0x4e2dc(%rip), %xmm4 # 0xd3b10 movss (%rdi,%rax,4), %xmm6 xorps %xmm5, %xmm5 cvtss2sd %xmm6, %xmm5 ucomisd %xmm5, %xmm0 jbe 0x85854 movl $0xfffffff5, (%r9) # imm = 0xFFFFFFF5 movl $0x80000000, %ecx # imm = 0x80000000 jmp 0x8587b ucomisd %xmm1, %xmm5 jbe 0x85868 movl $0xfffffff5, (%r9) # imm = 0xFFFFFFF5 movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF jmp 0x8587b ucomiss %xmm2, %xmm6 jae 0x85873 addsd %xmm3, %xmm5 jmp 0x85877 addsd %xmm4, %xmm5 cvttsd2si %xmm5, %ecx movl %ecx, (%rdx,%rax,4) incq %rax cmpq %rax, %rsi jne 0x85834 movl (%r9), %eax retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_nullscale
int imcomp_nullscale( int *idata, long tilelen, int nullflagval, int nullval, double scale, double zero, int *status) /* do null value substitution AND scaling of the integer array. If array value = nullflagval, then set the value to nullval. Otherwise, inverse scale the integer value. */ { long ii; double dvalue; for (ii=0; ii < tilelen; ii++) { if (idata[ii] == nullflagval) idata[ii] = nullval; else { dvalue = (idata[ii] - zero) / scale; if (dvalue < DINT_MIN) { *status = OVERFLOW_ERR; idata[ii] = INT32_MIN; } else if (dvalue > DINT_MAX) { *status = OVERFLOW_ERR; idata[ii] = INT32_MAX; } else { if (dvalue >= 0) idata[ii] = (int) (dvalue + .5); else idata[ii] = (int) (dvalue - .5); } } } return(*status); }
testq %rsi, %rsi jle 0x85b60 xorl %eax, %eax movsd 0x525fb(%rip), %xmm2 # 0xd80d8 movsd 0x525fb(%rip), %xmm3 # 0xd80e0 xorpd %xmm4, %xmm4 movsd 0x4e03f(%rip), %xmm5 # 0xd3b30 movsd 0x4e017(%rip), %xmm6 # 0xd3b10 movl (%rdi,%rax,4), %r10d movl %ecx, %r9d cmpl %edx, %r10d je 0x85b54 xorps %xmm7, %xmm7 cvtsi2sd %r10d, %xmm7 subsd %xmm1, %xmm7 divsd %xmm0, %xmm7 ucomisd %xmm7, %xmm2 jbe 0x85b2a movl $0xfffffff5, (%r8) # imm = 0xFFFFFFF5 movl $0x80000000, %r9d # imm = 0x80000000 jmp 0x85b54 ucomisd %xmm3, %xmm7 jbe 0x85b3f movl $0xfffffff5, (%r8) # imm = 0xFFFFFFF5 movl $0x7fffffff, %r9d # imm = 0x7FFFFFFF jmp 0x85b54 ucomisd %xmm4, %xmm7 jae 0x85b4b addsd %xmm5, %xmm7 jmp 0x85b4f addsd %xmm6, %xmm7 cvttsd2si %xmm7, %r9d movl %r9d, (%rdi,%rax,4) incq %rax cmpq %rax, %rsi jne 0x85af9 movl (%r8), %eax retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_nullscalei2
int imcomp_nullscalei2( short *idata, long tilelen, short nullflagval, short nullval, double scale, double zero, int *status) /* do null value substitution AND scaling of the integer array. If array value = nullflagval, then set the value to nullval. Otherwise, inverse scale the integer value. */ { long ii; double dvalue; for (ii=0; ii < tilelen; ii++) { if (idata[ii] == nullflagval) idata[ii] = nullval; else { dvalue = (idata[ii] - zero) / scale; if (dvalue < DSHRT_MIN) { *status = OVERFLOW_ERR; idata[ii] = SHRT_MIN; } else if (dvalue > DSHRT_MAX) { *status = OVERFLOW_ERR; idata[ii] = SHRT_MAX; } else { if (dvalue >= 0) idata[ii] = (int) (dvalue + .5); else idata[ii] = (int) (dvalue - .5); } } } return(*status); }
testq %rsi, %rsi jle 0x85c9d xorl %eax, %eax movsd 0x522bb(%rip), %xmm2 # 0xd7ed0 movsd 0x522bb(%rip), %xmm3 # 0xd7ed8 xorpd %xmm4, %xmm4 movsd 0x4df07(%rip), %xmm5 # 0xd3b30 movsd 0x4dedf(%rip), %xmm6 # 0xd3b10 movzwl (%rdi,%rax,2), %r10d movl %ecx, %r9d cmpw %dx, %r10w je 0x85c90 movswl %r10w, %r9d xorps %xmm7, %xmm7 cvtsi2sd %r9d, %xmm7 subsd %xmm1, %xmm7 divsd %xmm0, %xmm7 ucomisd %xmm7, %xmm2 jbe 0x85c67 movl $0xfffffff5, (%r8) # imm = 0xFFFFFFF5 movw $0x8000, %r9w # imm = 0x8000 jmp 0x85c90 ucomisd %xmm3, %xmm7 jbe 0x85c7b movl $0xfffffff5, (%r8) # imm = 0xFFFFFFF5 movw $0x7fff, %r9w # imm = 0x7FFF jmp 0x85c90 ucomisd %xmm4, %xmm7 jae 0x85c87 addsd %xmm5, %xmm7 jmp 0x85c8b addsd %xmm6, %xmm7 cvttsd2si %xmm7, %r9d movw %r9w, (%rdi,%rax,2) incq %rax cmpq %rax, %rsi jne 0x85c31 movl (%r8), %eax retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_scalevaluesi2
int imcomp_scalevaluesi2( short *idata, long tilelen, double scale, double zero, int *status) /* do inverse scaling the integer values. */ { long ii; double dvalue; for (ii=0; ii < tilelen; ii++) { dvalue = (idata[ii] - zero) / scale; if (dvalue < DSHRT_MIN) { *status = OVERFLOW_ERR; idata[ii] = SHRT_MIN; } else if (dvalue > DSHRT_MAX) { *status = OVERFLOW_ERR; idata[ii] = SHRT_MAX; } else { if (dvalue >= 0) idata[ii] = (int) (dvalue + .5); else idata[ii] = (int) (dvalue - .5); } } return(*status); }
testq %rsi, %rsi jle 0x85d40 xorl %eax, %eax movsd 0x52203(%rip), %xmm2 # 0xd7ed0 movsd 0x52203(%rip), %xmm3 # 0xd7ed8 xorpd %xmm4, %xmm4 movsd 0x4de4f(%rip), %xmm5 # 0xd3b30 movsd 0x4de27(%rip), %xmm6 # 0xd3b10 movswl (%rdi,%rax,2), %ecx xorps %xmm7, %xmm7 cvtsi2sd %ecx, %xmm7 subsd %xmm1, %xmm7 divsd %xmm0, %xmm7 ucomisd %xmm7, %xmm2 jbe 0x85d0e movl $0xfffffff5, (%rdx) # imm = 0xFFFFFFF5 movw $0x8000, %cx # imm = 0x8000 jmp 0x85d34 ucomisd %xmm3, %xmm7 jbe 0x85d20 movl $0xfffffff5, (%rdx) # imm = 0xFFFFFFF5 movw $0x7fff, %cx # imm = 0x7FFF jmp 0x85d34 ucomisd %xmm4, %xmm7 jae 0x85d2c addsd %xmm5, %xmm7 jmp 0x85d30 addsd %xmm6, %xmm7 cvttsd2si %xmm7, %ecx movw %cx, (%rdi,%rax,2) incq %rax cmpq %rax, %rsi jne 0x85ce9 movl (%rdx), %eax retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_merge_overlap
int imcomp_merge_overlap ( char *tile, /* O - multi dimensional array of tile pixels */ int pixlen, /* I - number of bytes in each tile or image pixel */ int ndim, /* I - number of dimension in the tile and image */ long *tfpixel, /* I - first pixel number in each dim. of the tile */ long *tlpixel, /* I - last pixel number in each dim. of the tile */ char *bnullarray, /* I - array of null flags; used if nullcheck = 2 */ char *image, /* I - multi dimensional output image */ long *fpixel, /* I - first pixel number in each dim. of the image */ long *lpixel, /* I - last pixel number in each dim. of the image */ int nullcheck, /* I - 0, 1: do nothing; 2: set nullarray for nulls */ int *status) /* Similar to imcomp_copy_overlap, except it copies the overlapping pixels from the 'image' to the 'tile'. */ { long imgdim[MAX_COMPRESS_DIM]; /* product of preceding dimensions in the */ /* output image, allowing for inc factor */ long tiledim[MAX_COMPRESS_DIM]; /* product of preceding dimensions in the */ /* tile, array; inc factor is not relevant */ long imgfpix[MAX_COMPRESS_DIM]; /* 1st img pix overlapping tile: 0 base, */ /* allowing for inc factor */ long imglpix[MAX_COMPRESS_DIM]; /* last img pix overlapping tile 0 base, */ /* allowing for inc factor */ long tilefpix[MAX_COMPRESS_DIM]; /* 1st tile pix overlapping img 0 base, */ /* allowing for inc factor */ long inc[MAX_COMPRESS_DIM]; /* local copy of input ininc */ long i1, i2, i3, i4; /* offset along each axis of the image */ long it1, it2, it3, it4; long im1, im2, im3, im4; /* offset to image pixel, allowing for inc */ long ipos, tf, tl; long t2, t3, t4; /* offset along each axis of the tile */ long tilepix, imgpix, tilepixbyte, imgpixbyte; int ii, overlap_bytes, overlap_flags; if (*status > 0) return(*status); for (ii = 0; ii < MAX_COMPRESS_DIM; ii++) { /* set default values for higher dimensions */ inc[ii] = 1; imgdim[ii] = 1; tiledim[ii] = 1; imgfpix[ii] = 0; imglpix[ii] = 0; tilefpix[ii] = 0; } /* ------------------------------------------------------------ */ /* calc amount of overlap in each dimension; if there is zero */ /* overlap in any dimension then just return */ /* ------------------------------------------------------------ */ for (ii = 0; ii < ndim; ii++) { if (tlpixel[ii] < fpixel[ii] || tfpixel[ii] > lpixel[ii]) return(*status); /* there are no overlapping pixels */ /* calc dimensions of the output image section */ imgdim[ii] = (lpixel[ii] - fpixel[ii]) / labs(inc[ii]) + 1; if (imgdim[ii] < 1) return(*status = NEG_AXIS); /* calc dimensions of the tile */ tiledim[ii] = tlpixel[ii] - tfpixel[ii] + 1; if (tiledim[ii] < 1) return(*status = NEG_AXIS); if (ii > 0) tiledim[ii] *= tiledim[ii - 1]; /* product of dimensions */ /* first and last pixels in image that overlap with the tile, 0 base */ tf = tfpixel[ii] - 1; tl = tlpixel[ii] - 1; /* skip this plane if it falls in the cracks of the subsampled image */ while ((tf-(fpixel[ii] - 1)) % labs(inc[ii])) { tf++; if (tf > tl) return(*status); /* no overlapping pixels */ } while ((tl-(fpixel[ii] - 1)) % labs(inc[ii])) { tl--; if (tf > tl) return(*status); /* no overlapping pixels */ } imgfpix[ii] = maxvalue((tf - fpixel[ii] +1) / labs(inc[ii]) , 0); imglpix[ii] = minvalue((tl - fpixel[ii] +1) / labs(inc[ii]) , imgdim[ii] - 1); /* first pixel in the tile that overlaps with the image (0 base) */ tilefpix[ii] = maxvalue(fpixel[ii] - tfpixel[ii], 0); while ((tfpixel[ii] + tilefpix[ii] - fpixel[ii]) % labs(inc[ii])) { (tilefpix[ii])++; if (tilefpix[ii] >= tiledim[ii]) return(*status); /* no overlapping pixels */ } /* printf("ii tfpixel, tlpixel %d %d %d \n",ii, tfpixel[ii], tlpixel[ii]); printf("ii, tf, tl, imgfpix,imglpix, tilefpix %d %d %d %d %d %d\n",ii, tf,tl,imgfpix[ii], imglpix[ii],tilefpix[ii]); */ if (ii > 0) imgdim[ii] *= imgdim[ii - 1]; /* product of dimensions */ } /* ---------------------------------------------------------------- */ /* calc number of pixels in each row (first dimension) that overlap */ /* multiply by pixlen to get number of bytes to copy in each loop */ /* ---------------------------------------------------------------- */ if (inc[0] != 1) overlap_flags = 1; /* can only copy 1 pixel at a time */ else overlap_flags = imglpix[0] - imgfpix[0] + 1; /* can copy whole row */ overlap_bytes = overlap_flags * pixlen; /* support up to 5 dimensions for now */ for (i4 = 0, it4=0; i4 <= imglpix[4] - imgfpix[4]; i4++, it4++) { /* increment plane if it falls in the cracks of the subsampled image */ while (ndim > 4 && (tfpixel[4] + tilefpix[4] - fpixel[4] + it4) % labs(inc[4]) != 0) it4++; /* offset to start of hypercube */ if (inc[4] > 0) im4 = (i4 + imgfpix[4]) * imgdim[3]; else im4 = imgdim[4] - (i4 + 1 + imgfpix[4]) * imgdim[3]; t4 = (tilefpix[4] + it4) * tiledim[3]; for (i3 = 0, it3=0; i3 <= imglpix[3] - imgfpix[3]; i3++, it3++) { /* increment plane if it falls in the cracks of the subsampled image */ while (ndim > 3 && (tfpixel[3] + tilefpix[3] - fpixel[3] + it3) % labs(inc[3]) != 0) it3++; /* offset to start of cube */ if (inc[3] > 0) im3 = (i3 + imgfpix[3]) * imgdim[2] + im4; else im3 = imgdim[3] - (i3 + 1 + imgfpix[3]) * imgdim[2] + im4; t3 = (tilefpix[3] + it3) * tiledim[2] + t4; /* loop through planes of the image */ for (i2 = 0, it2=0; i2 <= imglpix[2] - imgfpix[2]; i2++, it2++) { /* incre plane if it falls in the cracks of the subsampled image */ while (ndim > 2 && (tfpixel[2] + tilefpix[2] - fpixel[2] + it2) % labs(inc[2]) != 0) it2++; /* offset to start of plane */ if (inc[2] > 0) im2 = (i2 + imgfpix[2]) * imgdim[1] + im3; else im2 = imgdim[2] - (i2 + 1 + imgfpix[2]) * imgdim[1] + im3; t2 = (tilefpix[2] + it2) * tiledim[1] + t3; /* loop through rows of the image */ for (i1 = 0, it1=0; i1 <= imglpix[1] - imgfpix[1]; i1++, it1++) { /* incre row if it falls in the cracks of the subsampled image */ while (ndim > 1 && (tfpixel[1] + tilefpix[1] - fpixel[1] + it1) % labs(inc[1]) != 0) it1++; /* calc position of first pixel in tile to be copied */ tilepix = tilefpix[0] + (tilefpix[1] + it1) * tiledim[0] + t2; /* offset to start of row */ if (inc[1] > 0) im1 = (i1 + imgfpix[1]) * imgdim[0] + im2; else im1 = imgdim[1] - (i1 + 1 + imgfpix[1]) * imgdim[0] + im2; /* printf("inc = %d %d %d %d\n",inc[0],inc[1],inc[2],inc[3]); printf("im1,im2,im3,im4 = %d %d %d %d\n",im1,im2,im3,im4); */ /* offset to byte within the row */ if (inc[0] > 0) imgpix = imgfpix[0] + im1; else imgpix = imgdim[0] - 1 - imgfpix[0] + im1; /* printf("tilefpix0,1, imgfpix1, it1, inc1, t2= %d %d %d %d %d %d\n", tilefpix[0],tilefpix[1],imgfpix[1],it1,inc[1], t2); printf("i1, it1, tilepix, imgpix %d %d %d %d \n", i1, it1, tilepix, imgpix); */ /* loop over pixels along one row of the image */ for (ipos = imgfpix[0]; ipos <= imglpix[0]; ipos += overlap_flags) { /* convert from image pixel to byte offset */ tilepixbyte = tilepix * pixlen; imgpixbyte = imgpix * pixlen; /* printf(" tilepix, tilepixbyte, imgpix, imgpixbyte= %d %d %d %d\n", tilepix, tilepixbyte, imgpix, imgpixbyte); */ /* copy overlapping row of pixels from image to tile */ memcpy(tile + tilepixbyte, image + imgpixbyte, overlap_bytes); tilepix += (overlap_flags * labs(inc[0])); if (inc[0] > 0) imgpix += overlap_flags; else imgpix -= overlap_flags; } } } } } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x2e8, %rsp # imm = 0x2E8 movq 0x340(%rsp), %rax movl (%rax), %r13d testl %r13d, %r13d jle 0x88fd5 movl %r13d, %eax addq $0x2e8, %rsp # imm = 0x2E8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl %edx, %r9d movq 0x330(%rsp), %rdx xorps %xmm0, %xmm0 movaps %xmm0, 0x240(%rsp) movaps %xmm0, 0x230(%rsp) movaps %xmm0, 0x220(%rsp) movaps %xmm0, 0x1f0(%rsp) movaps %xmm0, 0x200(%rsp) movaps %xmm0, 0x210(%rsp) movaps %xmm0, 0x1c0(%rsp) movaps %xmm0, 0x1d0(%rsp) movaps %xmm0, 0x1e0(%rsp) xorl %eax, %eax movaps 0x4002c(%rip), %xmm0 # 0xc9060 movaps %xmm0, 0x2b0(%rsp,%rax,8) movaps %xmm0, 0x280(%rsp,%rax,8) movaps %xmm0, 0x250(%rsp,%rax,8) addq $0x2, %rax cmpq $0x6, %rax jne 0x89034 testl %r9d, %r9d movq %rcx, 0x18(%rsp) movl %r9d, 0x24(%rsp) movq %rdi, 0x180(%rsp) jle 0x8923a movl %r9d, %eax movq %rax, 0x90(%rsp) xorl %r15d, %r15d movq (%r8,%r15,8), %rdi movq 0x328(%rsp), %rax movq (%rax,%r15,8), %r14 cmpq %r14, %rdi jl 0x88fc0 movq 0x18(%rsp), %rax movq (%rax,%r15,8), %r12 movq (%rdx,%r15,8), %rax cmpq %rax, %r12 jg 0x88fc0 subq %r14, %rax movq 0x2b0(%rsp,%r15,8), %rdx movq %rdx, %rbp negq %rbp cmovsq %rdx, %rbp cqto idivq %rbp leaq 0x1(%rax), %rcx movq %rcx, 0x280(%rsp,%r15,8) testq %rax, %rax js 0x89999 movq %rax, %r9 movq %rdi, %rdx subq %r12, %rdx leaq 0x1(%rdx), %rax movq %rax, 0x250(%rsp,%r15,8) testq %rdx, %rdx js 0x89999 testq %r15, %r15 je 0x89111 imulq 0x248(%rsp,%r15,8), %rax movq %rax, 0x250(%rsp,%r15,8) leaq -0x1(%r12), %rbx leaq -0x1(%rdi), %r11 movq %r12, %r10 subq %r14, %r10 movq %r10, %rax cqto idivq %rbp testq %rdx, %rdx je 0x89141 leaq 0x1(%rbx), %rax incq %r10 cmpq %r11, %rbx movq %rax, %rbx jl 0x89120 jmp 0x88fc0 movq %r14, %r11 negq %r11 leaq (%r11,%rdi), %rax cqto idivq %rbp testq %rdx, %rdx je 0x89162 decq %rdi cmpq %rdi, %rbx jl 0x89147 jmp 0x88fc0 movq %r10, %rax cqto idivq %rbp testq %rax, %rax movl $0x0, %r10d cmovleq %r10, %rax movq %rax, 0x220(%rsp,%r15,8) subq %r14, %rdi movq %rdi, %rax cqto idivq %rbp cmpq %r9, %rax cmovlq %rax, %r9 movq %r9, 0x1f0(%rsp,%r15,8) movq %r14, %rdi subq %r12, %rdi testq %rdi, %rdi cmovleq %r10, %rdi subq %r14, %r12 leaq (%r12,%rdi), %rax cqto idivq %rbp testq %rdx, %rdx je 0x891c9 incq %rdi cmpq 0x250(%rsp,%r15,8), %rdi jl 0x891a9 jmp 0x8998c movq %rdi, 0x1c0(%rsp,%r15,8) testq %r15, %r15 je 0x891e7 imulq 0x278(%rsp,%r15,8), %rcx movq %rcx, 0x280(%rsp,%r15,8) incq %r15 cmpq 0x90(%rsp), %r15 movl 0x24(%rsp), %r9d movq 0x330(%rsp), %rdx jne 0x8907f movq 0x210(%rsp), %rax movq 0x240(%rsp), %r8 cmpq %r8, %rax jl 0x88fc0 movq %r8, 0x28(%rsp) movq 0x1f0(%rsp), %rdi movq 0x220(%rsp), %r10 movq %rax, 0x30(%rsp) jmp 0x89251 xorl %edi, %edi xorl %r10d, %r10d movq $0x0, 0x30(%rsp) movq $0x0, 0x28(%rsp) movl %edi, %edx subl %r10d, %edx incl %edx movq 0x2b0(%rsp), %rax cmpq $0x1, %rax movl $0x1, %ecx cmovel %edx, %ecx movslq %ecx, %r11 imull %esi, %ecx movq 0x2d0(%rsp), %rdx movq %rdx, %rbx negq %rbx movq %rdx, 0xf8(%rsp) cmovsq %rdx, %rbx movq 0x2b8(%rsp), %rdx movq 0x2c8(%rsp), %r14 movq %r14, %r15 negq %r15 movq %r14, 0x120(%rsp) cmovsq %r14, %r15 movq 0x2c0(%rsp), %r14 movq %r14, %r12 negq %r12 movq %r14, 0x150(%rsp) cmovsq %r14, %r12 movq 0x280(%rsp), %r14 movq %rdx, %r13 negq %r13 movq %rdx, 0x1a0(%rsp) cmovsq %rdx, %r13 movq %r10, %rdx notq %rdx movq %r14, 0xc0(%rsp) addq %r14, %rdx movq %r11, %r14 negq %r14 testq %rax, %rax cmovgq %r10, %rdx movq %rdx, 0x178(%rsp) movslq %esi, %rbp cmovgq %r11, %r14 movq 0x1f8(%rsp), %rsi movq 0x228(%rsp), %r8 movq %rsi, 0x140(%rsp) movq %r8, 0x88(%rsp) subq %r8, %rsi incq %rsi movq %rsi, 0x190(%rsp) movq 0x200(%rsp), %rdx movq 0x230(%rsp), %rsi movq %rdx, 0x118(%rsp) movq %rdx, %r8 movq %rsi, 0x78(%rsp) subq %rsi, %r8 incq %r8 movq %r8, 0x138(%rsp) movq 0x208(%rsp), %rdx movq 0x238(%rsp), %rsi movq %rdx, 0xf0(%rsp) movq %rdx, %r8 movq %rsi, 0x68(%rsp) subq %rsi, %r8 incq %r8 movq %r8, 0x110(%rsp) movq 0x28(%rsp), %rdx movq 0x30(%rsp), %rsi subq %rdx, %rsi incq %rsi movq %rsi, 0x30(%rsp) movq %r14, %rsi imulq %rbp, %rsi movq %rax, %r8 negq %r8 cmpq %r8, %rax cmovgq %rax, %r8 movslq %ecx, %rax movq %rax, 0x1b8(%rsp) imulq %r11, %r8 movq %rbp, 0x170(%rsp) imulq %rbp, %r8 movq 0x1e0(%rsp), %rax movq %rax, 0x98(%rsp) movq 0x2a0(%rsp), %rax movq %rax, 0xd8(%rsp) movq 0x298(%rsp), %rax movq %rax, 0x60(%rsp) movq 0x268(%rsp), %rax movq %rax, 0xe8(%rsp) movq 0x1d8(%rsp), %rax movq %rax, 0xa8(%rsp) movq 0x290(%rsp), %rax movq %rax, 0x70(%rsp) movq 0x260(%rsp), %rax movq %rax, 0x100(%rsp) movq 0x1d0(%rsp), %rax movq %rax, 0xb0(%rsp) movq 0x288(%rsp), %rax movq %rax, 0x80(%rsp) movq 0x250(%rsp), %rax movq %rax, 0x168(%rsp) movq 0x258(%rsp), %rax movq %rax, 0x128(%rsp) movq 0x1c0(%rsp), %rax movq %rax, 0xe0(%rsp) movq 0x1c8(%rsp), %rax movq %rax, 0xb8(%rsp) movq $0x0, 0x38(%rsp) movq $0x0, 0x8(%rsp) movq %rbx, 0x160(%rsp) movq %r12, 0x148(%rsp) movq %r13, 0x198(%rsp) movq %r10, 0xc8(%rsp) movq %r15, 0x158(%rsp) movq %rdi, 0x90(%rsp) cmpl $0x5, %r9d jl 0x8952c movq 0x18(%rsp), %rax movq 0x20(%rax), %rcx addq 0x98(%rsp), %rcx movq 0x328(%rsp), %rax subq 0x20(%rax), %rcx movq 0x8(%rsp), %rax movq %rax, %r14 addq %rcx, %rax cqto idivq %rbx movq %r14, %rax incq %rax testq %rdx, %rdx jne 0x89511 decq %rax jmp 0x89531 movq 0x8(%rsp), %rax movq %rax, 0x8(%rsp) cmpq $0x0, 0xf8(%rsp) jle 0x8955e movq 0x28(%rsp), %rax movq 0x38(%rsp), %rcx addq %rcx, %rax imulq 0x60(%rsp), %rax movq %rax, 0xa0(%rsp) jmp 0x89587 movq 0x28(%rsp), %rax movq 0x38(%rsp), %rcx addq %rcx, %rax incq %rax imulq 0x60(%rsp), %rax movq 0xd8(%rsp), %rcx subq %rax, %rcx movq %rcx, 0xa0(%rsp) movq 0x68(%rsp), %rax cmpq %rax, 0xf0(%rsp) jl 0x8995f movq 0x98(%rsp), %rax movq 0x8(%rsp), %rcx addq %rcx, %rax imulq 0xe8(%rsp), %rax addq 0xe0(%rsp), %rax movq %rax, 0x108(%rsp) movq $0x0, 0x40(%rsp) movq $0x0, 0x10(%rsp) cmpl $0x4, %r9d jl 0x89618 movq 0x18(%rsp), %rax movq 0x18(%rax), %rcx addq 0xa8(%rsp), %rcx movq 0x328(%rsp), %rax subq 0x18(%rax), %rcx movq 0x10(%rsp), %rax movq %rax, %r14 addq %rcx, %rax cqto idivq %r15 movq %r14, %rax incq %rax testq %rdx, %rdx jne 0x895fd decq %rax jmp 0x8961d movq 0x10(%rsp), %rax movq %rax, 0x10(%rsp) cmpq $0x0, 0x120(%rsp) jle 0x89647 movq 0x68(%rsp), %rax movq 0x40(%rsp), %rcx addq %rcx, %rax imulq 0x70(%rsp), %rax movq %rax, 0x48(%rsp) jmp 0x8966a movq 0x68(%rsp), %rax movq 0x40(%rsp), %rcx addq %rcx, %rax incq %rax imulq 0x70(%rsp), %rax movq 0x60(%rsp), %rcx subq %rax, %rcx movq %rcx, 0x48(%rsp) movq 0x78(%rsp), %rax cmpq %rax, 0x118(%rsp) jl 0x8993f movq 0x48(%rsp), %rax addq 0xa0(%rsp), %rax movq %rax, 0x48(%rsp) movq 0xa8(%rsp), %rax movq 0x10(%rsp), %rcx addq %rcx, %rax imulq 0x100(%rsp), %rax addq 0x108(%rsp), %rax movq %rax, 0x130(%rsp) movq $0x0, 0x50(%rsp) xorl %r14d, %r14d cmpl $0x3, %r9d jl 0x896fb movq 0x18(%rsp), %rax movq 0x10(%rax), %rcx addq 0xb0(%rsp), %rcx movq 0x328(%rsp), %rax subq 0x10(%rax), %rcx leaq (%rcx,%r14), %rax cqto idivq %r12 incq %r14 testq %rdx, %rdx jne 0x896e7 decq %r14 cmpq $0x0, 0x150(%rsp) jle 0x89723 movq 0x78(%rsp), %rax movq 0x50(%rsp), %rcx addq %rcx, %rax imulq 0x80(%rsp), %rax movq %rax, 0x58(%rsp) jmp 0x89749 movq 0x78(%rsp), %rax movq 0x50(%rsp), %rcx addq %rcx, %rax incq %rax imulq 0x80(%rsp), %rax movq 0x70(%rsp), %rcx subq %rax, %rcx movq %rcx, 0x58(%rsp) movq 0x88(%rsp), %rax cmpq %rax, 0x140(%rsp) jl 0x89909 movq 0x58(%rsp), %rax addq 0x48(%rsp), %rax movq %rax, 0x58(%rsp) movq 0xb0(%rsp), %rax addq %r14, %rax imulq 0x128(%rsp), %rax addq 0x130(%rsp), %rax movq %rax, 0x188(%rsp) xorl %ebx, %ebx xorl %r15d, %r15d movq %r14, 0x1a8(%rsp) cmpl $0x2, %r9d jl 0x897d6 movq 0x18(%rsp), %rax movq 0x8(%rax), %rcx addq 0xb8(%rsp), %rcx movq 0x328(%rsp), %rax subq 0x8(%rax), %rcx leaq (%rcx,%r15), %rax cqto idivq %r13 incq %r15 testq %rdx, %rdx jne 0x897c2 decq %r15 cmpq $0x0, 0x1a0(%rsp) movq %rbx, 0x1b0(%rsp) movq %r15, 0xd0(%rsp) jle 0x89808 movq 0x88(%rsp), %rax leaq (%rax,%rbx), %r12 imulq 0xc0(%rsp), %r12 jmp 0x8982a movq 0x88(%rsp), %rax addq %rbx, %rax incq %rax imulq 0xc0(%rsp), %rax movq 0x80(%rsp), %r12 subq %rax, %r12 cmpq %r10, %rdi jl 0x898c8 movq 0xb8(%rsp), %rax movq 0xd0(%rsp), %rcx leaq (%rax,%rcx), %r13 imulq 0x168(%rsp), %r13 addq 0x188(%rsp), %r13 addq 0x58(%rsp), %r12 addq 0x178(%rsp), %r12 movq 0x170(%rsp), %rax imulq %rax, %r12 addq 0x320(%rsp), %r12 imulq %rax, %r13 addq 0x180(%rsp), %r13 movq 0xc8(%rsp), %r14 movq %r13, %rdi movq %rsi, %rbp movq %r12, %rsi movq 0x1b8(%rsp), %rdx movq %r11, %rbx movq %r8, %r15 callq 0x65c0 movq %r15, %r8 movq %rbp, %rsi movq %rbx, %r11 movq 0x90(%rsp), %rdi addq %rbx, %r14 addq %rbp, %r12 addq %r15, %r13 cmpq %rdi, %r14 jle 0x8988d movq 0x1b0(%rsp), %rbx incq %rbx movq 0xd0(%rsp), %r15 incq %r15 cmpq 0x190(%rsp), %rbx movl 0x24(%rsp), %r9d movq 0xc8(%rsp), %r10 movq 0x198(%rsp), %r13 movq 0x1a8(%rsp), %r14 jne 0x8979f movq 0x50(%rsp), %rcx incq %rcx incq %r14 movq %rcx, 0x50(%rsp) cmpq 0x138(%rsp), %rcx movq 0x160(%rsp), %rbx movq 0x158(%rsp), %r15 movq 0x148(%rsp), %r12 jne 0x896c4 movq 0x40(%rsp), %rcx incq %rcx incq 0x10(%rsp) movq %rcx, 0x40(%rsp) cmpq 0x110(%rsp), %rcx jne 0x895d5 movq 0x38(%rsp), %rcx incq %rcx incq 0x8(%rsp) movq %rcx, 0x38(%rsp) cmpq 0x30(%rsp), %rcx jne 0x894e9 movq 0x340(%rsp), %rax movl (%rax), %r13d jmp 0x88fc0 movq %rdi, 0x1c0(%rsp,%r15,8) jmp 0x88fc0 movq 0x340(%rsp), %rax movl $0x143, (%rax) # imm = 0x143 movl $0x143, %r13d # imm = 0x143 jmp 0x88fc0
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
fits_write_compressed_pixels
int fits_write_compressed_pixels(fitsfile *fptr, /* I - FITS file pointer */ int datatype, /* I - datatype of the array to be written */ LONGLONG fpixel, /* I - 'first pixel to write */ LONGLONG npixel, /* I - number of pixels to write */ int nullcheck, /* I - 0 for no null checking */ /* 1: pixels that are = nullval will be */ /* written with the FITS null pixel value */ /* (floating point arrays only) */ void *array, /* I - array of values to write */ void *nullval, /* I - value used to represent undefined pixels*/ int *status) /* IO - error status */ /* Write a consecutive set of pixels to a compressed image. This routine interpretes the n-dimensional image as a long one-dimensional array. This is actually a rather inconvenient way to write compressed images in general, and could be rather inefficient if the requested pixels to be written are located in many different image compression tiles. The general strategy used here is to write the requested pixels in blocks that correspond to rectangular image sections. */ { int naxis, ii, bytesperpixel; long naxes[MAX_COMPRESS_DIM], nread; LONGLONG tfirst, tlast, last0, last1, dimsize[MAX_COMPRESS_DIM]; long nplane, firstcoord[MAX_COMPRESS_DIM], lastcoord[MAX_COMPRESS_DIM]; char *arrayptr; if (*status > 0) return(*status); arrayptr = (char *) array; /* get size of array pixels, in bytes */ bytesperpixel = ffpxsz(datatype); for (ii = 0; ii < MAX_COMPRESS_DIM; ii++) { naxes[ii] = 1; firstcoord[ii] = 0; lastcoord[ii] = 0; } /* determine the dimensions of the image to be written */ ffgidm(fptr, &naxis, status); ffgisz(fptr, MAX_COMPRESS_DIM, naxes, status); /* calc the cumulative number of pixels in each successive dimension */ dimsize[0] = 1; for (ii = 1; ii < MAX_COMPRESS_DIM; ii++) dimsize[ii] = dimsize[ii - 1] * naxes[ii - 1]; /* determine the coordinate of the first and last pixel in the image */ /* Use zero based indexes here */ tfirst = fpixel - 1; tlast = tfirst + npixel - 1; for (ii = naxis - 1; ii >= 0; ii--) { firstcoord[ii] = (long) (tfirst / dimsize[ii]); lastcoord[ii] = (long) (tlast / dimsize[ii]); tfirst = tfirst - firstcoord[ii] * dimsize[ii]; tlast = tlast - lastcoord[ii] * dimsize[ii]; } /* to simplify things, treat 1-D, 2-D, and 3-D images as separate cases */ if (naxis == 1) { /* Simple: just write the requested range of pixels */ firstcoord[0] = firstcoord[0] + 1; lastcoord[0] = lastcoord[0] + 1; fits_write_compressed_img(fptr, datatype, firstcoord, lastcoord, nullcheck, array, nullval, status); return(*status); } else if (naxis == 2) { nplane = 0; /* write 1st (and only) plane of the image */ fits_write_compressed_img_plane(fptr, datatype, bytesperpixel, nplane, firstcoord, lastcoord, naxes, nullcheck, array, nullval, &nread, status); } else if (naxis == 3) { /* test for special case: writing an integral number of planes */ if (firstcoord[0] == 0 && firstcoord[1] == 0 && lastcoord[0] == naxes[0] - 1 && lastcoord[1] == naxes[1] - 1) { for (ii = 0; ii < MAX_COMPRESS_DIM; ii++) { /* convert from zero base to 1 base */ (firstcoord[ii])++; (lastcoord[ii])++; } /* we can write the contiguous block of pixels in one go */ fits_write_compressed_img(fptr, datatype, firstcoord, lastcoord, nullcheck, array, nullval, status); return(*status); } /* save last coordinate in temporary variables */ last0 = lastcoord[0]; last1 = lastcoord[1]; if (firstcoord[2] < lastcoord[2]) { /* we will write up to the last pixel in all but the last plane */ lastcoord[0] = naxes[0] - 1; lastcoord[1] = naxes[1] - 1; } /* write one plane of the cube at a time, for simplicity */ for (nplane = firstcoord[2]; nplane <= lastcoord[2]; nplane++) { if (nplane == lastcoord[2]) { lastcoord[0] = (long) last0; lastcoord[1] = (long) last1; } fits_write_compressed_img_plane(fptr, datatype, bytesperpixel, nplane, firstcoord, lastcoord, naxes, nullcheck, arrayptr, nullval, &nread, status); /* for all subsequent planes, we start with the first pixel */ firstcoord[0] = 0; firstcoord[1] = 0; /* increment pointers to next elements to be written */ arrayptr = arrayptr + nread * bytesperpixel; } } else { ffpmsg("only 1D, 2D, or 3D images are currently supported"); return(*status = DATA_COMPRESSION_ERR); } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x108, %rsp # imm = 0x108 movq 0x148(%rsp), %r12 movl (%r12), %eax testl %eax, %eax jg 0x89ce4 movq %r9, %r14 movl %r8d, %r15d movq %rcx, %r13 movq %rdx, %rbx movq %rdi, 0x10(%rsp) movl %esi, 0x8(%rsp) movl %esi, %edi callq 0x3759c movl %eax, 0xc(%rsp) xorps %xmm0, %xmm0 movaps %xmm0, 0x60(%rsp) movaps %xmm0, 0x70(%rsp) movaps %xmm0, 0x80(%rsp) movaps %xmm0, 0x30(%rsp) movaps %xmm0, 0x40(%rsp) movaps %xmm0, 0x50(%rsp) xorl %eax, %eax movdqa 0x3f63b(%rip), %xmm0 # 0xc9060 movdqa %xmm0, 0xa0(%rsp,%rax,8) addq $0x2, %rax cmpq $0x6, %rax jne 0x89a25 leaq 0x1c(%rsp), %rsi movq 0x10(%rsp), %rbp movq %rbp, %rdi movq %r12, %rdx callq 0x41290 leaq 0xa0(%rsp), %rdx movq %rbp, %rdi movq %r12, %rbp movl $0x6, %esi movq %r12, %rcx callq 0x4130e movq $0x1, 0xd0(%rsp) movl $0x1, %eax xorl %ecx, %ecx imulq 0xa0(%rsp,%rcx,8), %rax movq %rax, 0xd8(%rsp,%rcx,8) incq %rcx cmpq $0x5, %rcx jne 0x89a7b movslq 0x1c(%rsp), %rsi testq %rsi, %rsi jle 0x89adf leaq (%rbx,%r13), %rcx addq $-0x2, %rcx decq %rbx leaq 0x1(%rsi), %rdi movq 0xc0(%rsp,%rdi,8), %r8 movq %rbx, %rax cqto idivq %r8 movq %rax, 0x50(%rsp,%rdi,8) movq %rdx, %rbx movq %rcx, %rax cqto idivq %r8 movq %rax, 0x20(%rsp,%rdi,8) decq %rdi movq %rdx, %rcx cmpq $0x1, %rdi ja 0x89aae cmpl $0x3, %esi je 0x89b73 cmpl $0x2, %esi je 0x89b2e cmpl $0x1, %esi jne 0x89bf9 leaq 0x60(%rsp), %rdx incq (%rdx) leaq 0x30(%rsp), %rcx incq (%rcx) movq 0x10(%rsp), %rdi movl 0x8(%rsp), %esi movl %r15d, %r8d movq %r14, %r9 pushq %rbp pushq 0x148(%rsp) callq 0x85d43 addq $0x10, %rsp movl (%rbp), %eax jmp 0x89ce4 leaq 0x28(%rsp), %rax leaq 0x60(%rsp), %r8 leaq 0x30(%rsp), %r9 movq 0x10(%rsp), %rdi movl 0x8(%rsp), %esi movl 0xc(%rsp), %edx xorl %ecx, %ecx movq %rbp, %r12 pushq %rbp pushq %rax pushq 0x150(%rsp) pushq %r14 pushq %r15 leaq 0xc8(%rsp), %rax pushq %rax callq 0x89cf6 addq $0x30, %rsp jmp 0x89ce0 movq 0x68(%rsp), %rax movq 0x30(%rsp), %rcx movq %rcx, 0x20(%rsp) orq 0x60(%rsp), %rax jne 0x89c16 movq 0xa0(%rsp), %rax decq %rax cmpq %rax, 0x20(%rsp) jne 0x89c16 movq 0xa8(%rsp), %rax decq %rax cmpq %rax, 0x38(%rsp) jne 0x89c16 xorl %eax, %eax pcmpeqd %xmm0, %xmm0 movq 0x10(%rsp), %rdi movl 0x8(%rsp), %esi movdqa 0x60(%rsp,%rax,8), %xmm1 psubq %xmm0, %xmm1 movdqa %xmm1, 0x60(%rsp,%rax,8) movdqa 0x30(%rsp,%rax,8), %xmm1 psubq %xmm0, %xmm1 movdqa %xmm1, 0x30(%rsp,%rax,8) addq $0x2, %rax cmpq $0x6, %rax jne 0x89bc0 leaq 0x60(%rsp), %rdx leaq 0x30(%rsp), %rcx jmp 0x89b0f leaq 0x5203c(%rip), %rdi # 0xdbc3c callq 0x37264 movl $0x19d, (%rbp) # imm = 0x19D movl $0x19d, %eax # imm = 0x19D jmp 0x89ce4 movq %r15, 0x98(%rsp) movq %rbp, %r12 movq 0x38(%rsp), %rax movq %rax, 0x90(%rsp) movq 0x40(%rsp), %r13 movq 0x70(%rsp), %rbx cmpq %r13, %rbx jge 0x89c50 pcmpeqd %xmm0, %xmm0 paddq 0xa0(%rsp), %xmm0 movdqa %xmm0, 0x30(%rsp) cmpq %r13, %rbx jg 0x89ce0 movslq 0xc(%rsp), %r15 leaq 0x1(%r13), %rbp cmpq %rbx, %r13 movq 0x10(%rsp), %rdi jne 0x89c83 movq 0x20(%rsp), %rax movq %rax, 0x30(%rsp) movq 0x90(%rsp), %rax movq %rax, 0x38(%rsp) movl 0x8(%rsp), %esi movl 0xc(%rsp), %edx movq %rbx, %rcx leaq 0x60(%rsp), %r8 leaq 0x30(%rsp), %r9 pushq %r12 leaq 0x30(%rsp), %rax pushq %rax pushq 0x150(%rsp) pushq %r14 pushq 0xb8(%rsp) leaq 0xc8(%rsp), %rax pushq %rax callq 0x89cf6 addq $0x30, %rsp pxor %xmm0, %xmm0 movdqa %xmm0, 0x60(%rsp) movq 0x28(%rsp), %rax imulq %r15, %rax addq %rax, %r14 incq %rbx cmpq %rbx, %rbp jne 0x89c62 movl (%r12), %eax addq $0x108, %rsp # imm = 0x108 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
fits_img_decompress
int fits_img_decompress (fitsfile *infptr, /* image (bintable) to uncompress */ fitsfile *outfptr, /* empty HDU for output uncompressed image */ int *status) /* IO - error status */ /* This routine decompresses the whole image and writes it to the output file. */ { int ii, datatype = 0; int nullcheck, anynul; LONGLONG fpixel[MAX_COMPRESS_DIM], lpixel[MAX_COMPRESS_DIM]; long inc[MAX_COMPRESS_DIM]; long imgsize; float *nulladdr, fnulval; double dnulval; if (fits_img_decompress_header(infptr, outfptr, status) > 0) { return (*status); } /* force a rescan of the output header keywords, then reset the scaling */ /* in case the BSCALE and BZERO keywords are present, so that the */ /* decompressed values won't be scaled when written to the output image */ ffrdef(outfptr, status); ffpscl(outfptr, 1.0, 0.0, status); ffpscl(infptr, 1.0, 0.0, status); /* initialize; no null checking is needed for integer images */ nullcheck = 0; nulladdr = &fnulval; /* determine datatype for image */ if ((infptr->Fptr)->zbitpix == BYTE_IMG) { datatype = TBYTE; } else if ((infptr->Fptr)->zbitpix == SHORT_IMG) { datatype = TSHORT; } else if ((infptr->Fptr)->zbitpix == LONG_IMG) { datatype = TINT; } else if ((infptr->Fptr)->zbitpix == FLOAT_IMG) { /* In the case of float images we must check for NaNs */ nullcheck = 1; fnulval = FLOATNULLVALUE; nulladdr = &fnulval; datatype = TFLOAT; } else if ((infptr->Fptr)->zbitpix == DOUBLE_IMG) { /* In the case of double images we must check for NaNs */ nullcheck = 1; dnulval = DOUBLENULLVALUE; nulladdr = (float *) &dnulval; datatype = TDOUBLE; } /* calculate size of the image (in pixels) */ imgsize = 1; for (ii = 0; ii < (infptr->Fptr)->zndim; ii++) { imgsize *= (infptr->Fptr)->znaxis[ii]; fpixel[ii] = 1; /* Set first and last pixel to */ lpixel[ii] = (infptr->Fptr)->znaxis[ii]; /* include the entire image. */ inc[ii] = 1; } /* uncompress the input image and write to output image, one tile at a time */ fits_read_write_compressed_img(infptr, datatype, fpixel, lpixel, inc, nullcheck, nulladdr, &anynul, outfptr, status); return (*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x378, %rsp # imm = 0x378 movq %rdx, %rbp movq %rsi, %r15 movq %rdi, %r14 callq 0x8aa79 testl %eax, %eax jg 0x8a12a leaq 0x25(%rsp), %r12 leaq 0x27(%rsp), %rbx leaq 0x2b(%rsp), %r13 movq %r15, %rdi movq %rbp, %rsi callq 0x3af49 movsd 0x3f118(%rip), %xmm0 # 0xc9080 pxor %xmm1, %xmm1 movq %r15, %rdi movq %rbp, %rsi callq 0xbc17c pxor %xmm1, %xmm1 movq %r14, %rdi movq 0x3f0fa(%rip), %xmm0 # 0xc9080 movq %rbp, %rsi callq 0xbc17c movq 0x8(%r14), %rsi movl 0x48c(%rsi), %eax leaq 0x24(%rsp), %rcx cmpl $0x7, %eax jle 0x89fd4 movl $0x0, 0xc(%rsp) cmpl $0x8, %eax movq %rcx, 0x28(%rsp) movq %rbx, 0x10(%rsp) je 0x8a006 cmpl $0x20, %eax je 0x8a010 cmpl $0x10, %eax jne 0x8a1a3 movq %r14, %rbx movl $0x15, %eax jmp 0x8a056 cmpl $-0x40, %eax je 0x8a01a movq %rbx, 0x10(%rsp) movq %rcx, 0x28(%rsp) cmpl $-0x20, %eax jne 0x8a1a3 movq %r14, %rbx movl $0x8541f136, 0x24(%rsp) # imm = 0x8541F136 movl $0x1, 0xc(%rsp) movl $0x2a, %eax jmp 0x8a056 movq %r14, %rbx movl $0xb, %eax jmp 0x8a056 movq %r14, %rbx movl $0x1f, %eax jmp 0x8a056 movq %r14, %rbx leaq 0x31(%rsp), %r12 leaq 0x33(%rsp), %rax movq %rax, 0x10(%rsp) leaq 0x37(%rsp), %r13 movabsq $-0x4757c1d7a1454b49, %rax # imm = 0xB8A83E285EBAB4B7 movq %rax, -0x7(%r13) leaq 0x30(%rsp), %rax movq %rax, 0x28(%rsp) movl $0x1, 0xc(%rsp) movl $0x52, %eax movq %rax, 0x18(%rsp) movslq 0x490(%rsi), %r14 testq %r14, %r14 jle 0x8a124 addq $0x498, %rsi # imm = 0x498 leaq (,%r14,8), %rdx leaq 0x340(%rsp), %rdi callq 0x65c0 leal 0x1(%r14), %eax decq %r14 movq %r14, %xmm0 pshufd $0x44, %xmm0, %xmm0 # xmm0 = xmm0[0,1,0,1] shrl %eax shlq $0x4, %rax movdqa 0x3ef8a(%rip), %xmm1 # 0xc9030 xorl %ecx, %ecx movdqa 0x3ef90(%rip), %xmm2 # 0xc9040 pxor %xmm2, %xmm0 pcmpeqd %xmm3, %xmm3 movdqa 0x49a10(%rip), %xmm4 # 0xd3ad0 movdqa %xmm1, %xmm5 pxor %xmm2, %xmm5 movdqa %xmm5, %xmm6 pcmpgtd %xmm0, %xmm6 pcmpeqd %xmm0, %xmm5 pshufd $0xf5, %xmm5, %xmm7 # xmm7 = xmm5[1,1,3,3] pand %xmm6, %xmm7 pshufd $0xf5, %xmm6, %xmm5 # xmm5 = xmm6[1,1,3,3] por %xmm7, %xmm5 movd %xmm5, %edx notl %edx testb $0x1, %dl je 0x8a0fd movq $0x1, 0x310(%rsp,%rcx) pxor %xmm3, %xmm5 pextrw $0x4, %xmm5, %edx testb $0x1, %dl je 0x8a117 movq $0x1, 0x318(%rsp,%rcx) paddq %xmm4, %xmm1 addq $0x10, %rcx cmpq %rcx, %rax jne 0x8a0c0 cmpl $0x0, (%rbp) jle 0x8a13f movl (%rbp), %eax addq $0x378, %rsp # imm = 0x378 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rbx, %r14 movq %rbx, %rdi movq %rbp, %rsi callq 0x41127 testl %eax, %eax je 0x8a1bc movq 0x18(%rsp), %rax cmpl $0x27, %eax movq %r15, 0x88(%rsp) jg 0x8a1d4 cmpl $0x1d, %eax movq 0x28(%rsp), %rbx jg 0x8a1fd cmpl $0x14, %eax je 0x8a17f cmpl $0x15, %eax jne 0x8a282 movq 0x8(%r14), %r15 movq 0x4c8(%r15), %rdi addq %rdi, %rdi callq 0x61a0 movq %rax, %r13 cmpb $0x0, (%rbx) jne 0x8a2bb jmp 0x8a2a9 movq %r14, %rbx movq $0x0, 0x18(%rsp) movl $0x0, 0xc(%rsp) jmp 0x8a05b leaq 0x51c10(%rip), %rdi # 0xdbdd3 callq 0x37264 movl $0x19e, (%rbp) # imm = 0x19E jmp 0x8a12a cmpl $0x29, %eax movq 0x28(%rsp), %rbx jg 0x8a209 cmpl $0x28, %eax je 0x8a1ec cmpl $0x29, %eax jne 0x8a282 movq 0x8(%r14), %r15 movq 0x4c8(%r15), %rdi shlq $0x3, %rdi jmp 0x8a262 cmpl $0x1e, %eax je 0x8a253 cmpl $0x1f, %eax je 0x8a253 jmp 0x8a282 cmpl $0x2a, %eax je 0x8a253 cmpl $0x52, %eax jne 0x8a282 movq 0x8(%r14), %r15 movq 0x4c8(%r15), %rdi shlq $0x3, %rdi callq 0x61a0 cmpb $0x0, (%rbx) jne 0x8a24e cmpb $0x0, 0x1(%rbx) jne 0x8a24e cmpb $0x0, 0x2(%rbx) jne 0x8a24e cmpb $0x0, 0x3(%rbx) jne 0x8a24e cmpb $0x0, 0x4(%rbx) jne 0x8a24e cmpb $0x0, 0x5(%rbx) je 0x8aa64 movq %rax, %r13 jmp 0x8a2bb movq 0x8(%r14), %r15 movq 0x4c8(%r15), %rdi shlq $0x2, %rdi callq 0x61a0 movq %rax, %r13 cmpb $0x0, (%rbx) jne 0x8a2bb cmpb $0x0, 0x1(%rbx) jne 0x8a2bb cmpb $0x0, 0x2(%rbx) movq 0x10(%rsp), %r12 jne 0x8a2bb jmp 0x8a2a9 movq 0x18(%rsp), %rax addl $-0xb, %eax cmpl $0x1, %eax ja 0x8aa4c movq 0x8(%r14), %r15 movq 0x4c8(%r15), %rdi callq 0x61a0 movq %rax, %r13 movq %rbx, %r12 xorl %eax, %eax cmpb $0x0, (%r12) movl 0xc(%rsp), %ecx cmovel %eax, %ecx movl %ecx, 0xc(%rsp) testq %r13, %r13 je 0x8aa20 xorl %eax, %eax movdqa 0x3ed92(%rip), %xmm0 # 0xc9060 movdqa %xmm0, 0x250(%rsp,%rax,8) movdqa %xmm0, 0x220(%rsp,%rax,8) movdqa %xmm0, 0x1f0(%rsp,%rax,8) movdqa %xmm0, 0x1c0(%rsp,%rax,8) movdqa %xmm0, 0x280(%rsp,%rax,8) addq $0x2, %rax cmpq $0x6, %rax jne 0x8a2ce movslq 0x490(%r15), %r8 testq %r8, %r8 jle 0x8a3c6 shlq $0x3, %r8 movl $0x1, %r9d xorl %r10d, %r10d movq 0x310(%rsp,%r10), %rdx movq 0x340(%rsp,%r10), %rcx cmpq %rcx, %rdx movq %rcx, %rsi cmovlq %rdx, %rsi movq 0x498(%r15,%r10), %rax movq %rax, 0x250(%rsp,%r10) testq %rsi, %rsi jle 0x8aa38 cmpq %rcx, %rdx cmovgq %rdx, %rcx movq 0x440(%r15,%r10), %r11 movq %r11, 0x220(%rsp,%r10) decq %rax cqto idivq %r11 movq %rax, %rdi incq %rdi decq %rsi movq %rsi, %rax cqto idivq %r11 incq %rax movq %rax, 0x1f0(%rsp,%r10) decq %rcx movq %rcx, %rax cqto idivq %r11 incq %rax cmpq %rdi, %rax cmovgeq %rdi, %rax movq %rax, 0x1c0(%rsp,%r10) movq %r9, 0x280(%rsp,%r10) imulq %rdi, %r9 addq $0x8, %r10 cmpq %r10, %r8 jne 0x8a322 movq %r13, 0x90(%rsp) movq %r14, 0x1a8(%rsp) movq %rbp, 0x10(%rsp) movq 0x218(%rsp), %rsi movq 0x1e8(%rsp), %rax movq %rax, 0xc0(%rsp) cmpq %rax, %rsi movq 0x18(%rsp), %rcx jg 0x8aa09 movl 0x2a8(%rsp), %edx movq 0x210(%rsp), %rdi movl 0x2a0(%rsp), %r8d movq 0x208(%rsp), %r9 movl 0x298(%rsp), %r10d movq 0x200(%rsp), %r11 movl 0x288(%rsp), %ebx movl 0x290(%rsp), %ebp movq 0x1f0(%rsp), %r14 movq 0x1f8(%rsp), %r15 movq 0x1c0(%rsp), %r12 movq 0x220(%rsp), %r13 leal -0x1(%rsi), %eax movl %edx, 0x3c(%rsp) imull %edx, %eax leal -0x1(%rdi), %edx movl %r8d, 0x44(%rsp) imull %r8d, %edx addl %eax, %edx leal -0x1(%r9), %eax movl %r10d, 0x4c(%rsp) imull %r10d, %eax leal -0x1(%r11), %r8d movl %ebp, 0x54(%rsp) imull %ebp, %r8d addl %eax, %r8d movq %r12, 0x180(%rsp) subq %r14, %r12 incq %r12 movq %r12, 0x160(%rsp) addl %edx, %r8d leal -0x1(%r15), %eax movl %ebx, 0x5c(%rsp) imull %ebx, %eax addl %r14d, %eax addl %eax, %r8d movq %r14, %rax imulq %r13, %rax movq %rax, 0x158(%rsp) movq %r14, 0x188(%rsp) leaq -0x1(%r14), %rax movq %r13, 0x1a0(%rsp) imulq %r13, %rax movq %rax, %rdx negq %rdx movq %rdx, 0x148(%rsp) incq %rax movq %rax, 0x150(%rsp) movq 0x248(%rsp), %rax movq %rax, 0xb0(%rsp) movq 0x278(%rsp), %rax movq %rax, 0xa8(%rsp) movq 0x1e0(%rsp), %rax movq %rax, 0x68(%rsp) movq 0x240(%rsp), %rax movq %rax, 0xe0(%rsp) movq 0x270(%rsp), %rax movq %rax, 0xd8(%rsp) movq 0x1d8(%rsp), %rax movq %rax, 0x70(%rsp) movq 0x238(%rsp), %rax movq %rax, 0x108(%rsp) movq 0x268(%rsp), %rax movq %rax, 0x100(%rsp) movq 0x1d0(%rsp), %rax movq %rax, 0x78(%rsp) movq 0x230(%rsp), %rax movq %rax, 0x130(%rsp) movq 0x260(%rsp), %rax movq %rax, 0x128(%rsp) movq 0x1c8(%rsp), %rax movq %rax, 0x80(%rsp) movq 0x228(%rsp), %rax movq %rax, 0x178(%rsp) movq 0x250(%rsp), %rax movq %rax, 0x198(%rsp) movq 0x258(%rsp), %rax movq %rax, 0x170(%rsp) movl $0x1, %r13d movq %rdi, 0xb8(%rsp) movq %r9, 0xe8(%rsp) movq %r11, 0x110(%rsp) movq %r15, 0x138(%rsp) movq %rcx, 0x18(%rsp) leaq -0x1(%rsi), %rax movq 0xb0(%rsp), %rdx imulq %rdx, %rax movq %rsi, 0xc8(%rsp) imulq %rdx, %rsi movq 0xa8(%rsp), %rdx cmpq %rdx, %rsi cmovgeq %rdx, %rsi leaq 0x1(%rax), %rdx movq %rdx, 0x308(%rsp) movq %rsi, 0x2d8(%rsp) cmpq 0x68(%rsp), %rdi movl %r8d, 0x40(%rsp) jg 0x8a9dd subq %rax, %rsi movq %rsi, 0xd0(%rsp) movl %r8d, %ebp leaq -0x1(%rdi), %rax movq 0xe0(%rsp), %rdx imulq %rdx, %rax movq %rdi, 0xf0(%rsp) imulq %rdx, %rdi movq 0xd8(%rsp), %rdx cmpq %rdx, %rdi cmovgeq %rdx, %rdi leaq 0x1(%rax), %rdx movq %rdx, 0x300(%rsp) movq %rdi, 0x2d0(%rsp) cmpq 0x70(%rsp), %r9 movl %ebp, 0x48(%rsp) jg 0x8a9b6 subq %rax, %rdi imulq 0xd0(%rsp), %rdi movq %rdi, 0xf8(%rsp) leaq -0x1(%r9), %rax movq 0x108(%rsp), %rdx imulq %rdx, %rax movq %r9, 0x118(%rsp) imulq %rdx, %r9 movq 0x100(%rsp), %rdx cmpq %rdx, %r9 cmovgeq %rdx, %r9 leaq 0x1(%rax), %rdx movq %rdx, 0x2f8(%rsp) movq %r9, 0x2c8(%rsp) cmpq 0x78(%rsp), %r11 movl %ebp, 0x50(%rsp) jg 0x8a98f subq %rax, %r9 imulq 0xf8(%rsp), %r9 movq %r9, 0x120(%rsp) leaq -0x1(%r11), %rax movq 0x130(%rsp), %rdx imulq %rdx, %rax movq %r11, 0x140(%rsp) imulq %rdx, %r11 movq 0x128(%rsp), %rdx cmpq %rdx, %r11 cmovgeq %rdx, %r11 leaq 0x1(%rax), %rdx movq %rdx, 0x2f0(%rsp) movq %r11, 0x2c0(%rsp) cmpq 0x80(%rsp), %r15 movl %ebp, 0x58(%rsp) jg 0x8a968 subq %rax, %r11 imulq 0x120(%rsp), %r11 movq %r11, 0x168(%rsp) leaq -0x1(%r15), %rax movq 0x178(%rsp), %rdx imulq %rdx, %rax movq %r15, 0x190(%rsp) imulq %rdx, %r15 movq 0x170(%rsp), %rdx cmpq %rdx, %r15 cmovgeq %rdx, %r15 leaq 0x1(%rax), %rdx movq %rdx, 0x2e8(%rsp) movq %r15, 0x2b8(%rsp) movq 0x180(%rsp), %rdx cmpq %rdx, 0x188(%rsp) movl %ebp, 0x60(%rsp) jg 0x8a946 subq %rax, %r15 imulq 0x168(%rsp), %r15 movq 0x150(%rsp), %rsi movq 0x148(%rsp), %rbx movq 0x158(%rsp), %r14 movq 0x160(%rsp), %rdx movq %r15, 0x1b0(%rsp) movq %r13, 0x98(%rsp) movq %rdx, 0xa0(%rsp) movq 0x198(%rsp), %rdx cmpq %r14, %rdx movq %r14, %rax cmovlq %rdx, %rax leaq (%rax,%rbx), %r12 imulq %r15, %r12 movq %rsi, 0x1b8(%rsp) movq %rsi, 0x2e0(%rsp) movq %rax, 0x2b0(%rsp) movq 0x1a8(%rsp), %rdi movl %ebp, %esi movl %r12d, %edx movl 0xc(%rsp), %r8d movq %rcx, %r13 movq 0x28(%rsp), %r9 pushq 0x10(%rsp) leaq 0x6c(%rsp), %rax pushq %rax pushq $0x0 movq 0xa8(%rsp), %r15 pushq %r15 callq 0x867b6 addq $0x20, %rsp cmpl $0x0, 0x64(%rsp) je 0x8a8dc subq $0x8, %rsp movq 0x90(%rsp), %rdi movl %r13d, %esi movq 0xa0(%rsp), %r13 movq %r13, %rdx movq %r12, %rcx movq %r15, %r8 movq 0x30(%rsp), %r9 pushq 0x18(%rsp) callq 0x97f20 addq $0x10, %rsp movq 0x18(%rsp), %rcx jmp 0x8a90f movq 0x88(%rsp), %rdi movl %r13d, %esi leaq 0x2e0(%rsp), %rdx leaq 0x2b0(%rsp), %rcx movq %r15, %r8 movq 0x10(%rsp), %r9 callq 0x980cc movq %r13, %rcx movq 0x98(%rsp), %r13 movq 0xa0(%rsp), %rdx addq %r12, %r13 incl %ebp movq 0x1a0(%rsp), %rax addq %rax, %r14 subq %rax, %rbx movq 0x1b8(%rsp), %rsi addq %rax, %rsi decq %rdx movq 0x1b0(%rsp), %r15 jne 0x8a821 movq 0x190(%rsp), %rdx leaq 0x1(%rdx), %r15 movl 0x60(%rsp), %ebp addl 0x5c(%rsp), %ebp cmpq 0x80(%rsp), %rdx jne 0x8a794 movq 0x140(%rsp), %rdx leaq 0x1(%rdx), %r11 movl 0x58(%rsp), %ebp addl 0x54(%rsp), %ebp cmpq 0x78(%rsp), %rdx movq 0x138(%rsp), %r15 jne 0x8a72f movq 0x118(%rsp), %rdx leaq 0x1(%rdx), %r9 movl 0x50(%rsp), %ebp addl 0x4c(%rsp), %ebp cmpq 0x70(%rsp), %rdx movq 0x110(%rsp), %r11 jne 0x8a6cd movq 0xf0(%rsp), %rdx leaq 0x1(%rdx), %rdi movl 0x48(%rsp), %ebp addl 0x44(%rsp), %ebp cmpq 0x68(%rsp), %rdx movq 0xe8(%rsp), %r9 jne 0x8a66b movq 0xc8(%rsp), %rdx leaq 0x1(%rdx), %rsi movl 0x40(%rsp), %r8d addl 0x3c(%rsp), %r8d cmpq 0xc0(%rsp), %rdx movq 0xb8(%rsp), %rdi jne 0x8a60e movq 0x90(%rsp), %rdi callq 0x6260 movq 0x10(%rsp), %rbp jmp 0x8a12a leaq 0x51413(%rip), %rdi # 0xdbe3a callq 0x37264 movl $0x71, (%rbp) jmp 0x8a12a movq %r13, %rdi callq 0x6260 movl $0x141, (%rbp) # imm = 0x141 jmp 0x8a12a leaq 0x513ba(%rip), %rdi # 0xdbe0d callq 0x37264 movl $0x19a, (%rbp) # imm = 0x19A jmp 0x8a12a cmpb $0x0, 0x6(%rbx) movq %r13, %r12 movq %rax, %r13 jne 0x8a2bb jmp 0x8a2a9
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
fits_img_decompress_header
int fits_img_decompress_header(fitsfile *infptr, /* image (bintable) to uncompress */ fitsfile *outfptr, /* empty HDU for output uncompressed image */ int *status) /* IO - error status */ /* This routine reads the header of the input tile compressed image and converts it to that of a standard uncompress FITS image. */ { int writeprime = 0; int hdupos, inhdupos, numkeys; int nullprime = 0, copyprime = 0, norec = 0, tstatus; char card[FLEN_CARD]; int ii, naxis, bitpix; long naxes[MAX_COMPRESS_DIM]; if (*status > 0) return(*status); else if (*status == -1) { *status = 0; writeprime = 1; } if (!fits_is_compressed_image(infptr, status) ) { ffpmsg("CHDU is not a compressed image (fits_img_decompress)"); return(*status = DATA_DECOMPRESSION_ERR); } /* get information about the state of the output file; does it already */ /* contain any keywords and HDUs? */ fits_get_hdu_num(infptr, &inhdupos); /* Get the current output HDU position */ fits_get_hdu_num(outfptr, &hdupos); /* Get the current output HDU position */ fits_get_hdrspace(outfptr, &numkeys, 0, status); /* Was the input compressed HDU originally the primary array image? */ tstatus = 0; if (!fits_read_card(infptr, "ZSIMPLE", card, &tstatus)) { /* yes, input HDU was a primary array (not an IMAGE extension) */ /* Now determine if we can uncompress it into the primary array of */ /* the output file. This is only possible if the output file */ /* currently only contains a null primary array, with no addition */ /* header keywords and with no following extension in the FITS file. */ if (hdupos == 1) { /* are we positioned at the primary array? */ if (numkeys == 0) { /* primary HDU is completely empty */ nullprime = 1; } else { fits_get_img_param(outfptr, MAX_COMPRESS_DIM, &bitpix, &naxis, naxes, status); if (naxis == 0) { /* is this a null image? */ nullprime = 1; if (inhdupos == 2) /* must be at the first extension */ copyprime = 1; } } } } if (nullprime) { /* We will delete the existing keywords in the null primary array and uncompress the input image into the primary array of the output. Some of these keywords may be added back to the uncompressed image header later. */ for (ii = numkeys; ii > 0; ii--) fits_delete_record(outfptr, ii, status); } else { /* if the ZTENSION keyword doesn't exist, then we have to write the required keywords manually */ tstatus = 0; if (fits_read_card(infptr, "ZTENSION", card, &tstatus)) { /* create an empty output image with the correct dimensions */ if (ffcrim(outfptr, (infptr->Fptr)->zbitpix, (infptr->Fptr)->zndim, (infptr->Fptr)->znaxis, status) > 0) { ffpmsg("error creating output decompressed image HDU"); return (*status); } norec = 1; /* the required keywords have already been written */ } else { /* the input compressed image does have ZTENSION keyword */ if (writeprime) { /* convert the image extension to a primary array */ /* have to write the required keywords manually */ /* create an empty output image with the correct dimensions */ if (ffcrim(outfptr, (infptr->Fptr)->zbitpix, (infptr->Fptr)->zndim, (infptr->Fptr)->znaxis, status) > 0) { ffpmsg("error creating output decompressed image HDU"); return (*status); } norec = 1; /* the required keywords have already been written */ } else { /* write the input compressed image to an image extension */ if (numkeys == 0) { /* the output file is currently completely empty */ /* In this case, the input is a compressed IMAGE extension. */ /* Since the uncompressed output file is currently completely empty, */ /* we need to write a null primary array before uncompressing the */ /* image extension */ ffcrim(outfptr, 8, 0, naxes, status); /* naxes is not used */ /* now create the empty extension to uncompress into */ if (fits_create_hdu(outfptr, status) > 0) { ffpmsg("error creating output decompressed image HDU"); return (*status); } } else { /* just create a new empty extension, then copy all the required */ /* keywords into it. */ fits_create_hdu(outfptr, status); } } } } if (*status > 0) { ffpmsg("error creating output decompressed image HDU"); return (*status); } /* Copy the table header to the image header. */ if (imcomp_copy_comp2img(infptr, outfptr, norec, status) > 0) { ffpmsg("error copying header keywords from compressed image"); } if (copyprime) { /* append any unexpected keywords from the primary array. This includes any keywords except SIMPLE, BITPIX, NAXIS, EXTEND, COMMENT, HISTORY, CHECKSUM, and DATASUM. */ fits_movabs_hdu(infptr, 1, NULL, status); /* move to primary array */ /* do this so that any new keywords get written before any blank keywords that may have been appended by imcomp_copy_comp2img */ fits_set_hdustruc(outfptr, status); if (imcomp_copy_prime2img(infptr, outfptr, status) > 0) { ffpmsg("error copying primary keywords from compressed file"); } fits_movabs_hdu(infptr, 2, NULL, status); /* move back to where we were */ } return (*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xa8, %rsp movl (%rdx), %ebp testl %ebp, %ebp jg 0x8abea movq %rdx, %rbx movq %rsi, %r15 movq %rdi, %r14 cmpl $-0x1, %ebp jne 0x8aaa8 movl $0x0, (%rbx) movq %r14, %rdi movq %rbx, %rsi callq 0x41127 testl %eax, %eax je 0x8ab9d leaq 0x10(%rsp), %rsi movq %r14, %rdi callq 0x3becc leaq 0x14(%rsp), %rsi movq %r15, %rdi callq 0x3becc leaq 0x8(%rsp), %rsi movq %r15, %rdi xorl %edx, %edx movq %rbx, %rcx callq 0x6d014 leaq 0xc(%rsp), %rcx movl $0x0, (%rcx) leaq 0x5095b(%rip), %rsi # 0xdb454 leaq 0x50(%rsp), %rdx movq %r14, %rdi callq 0x6d586 testl %eax, %eax jne 0x8ab4c cmpl $0x1, 0x14(%rsp) jne 0x8ab4c xorl %r12d, %r12d cmpl $0x0, 0x8(%rsp) je 0x8abd4 leaq 0x18(%rsp), %rdx leaq 0x1c(%rsp), %r13 leaq 0x20(%rsp), %r8 movq %r15, %rdi movl $0x6, %esi movq %r13, %rcx movq %rbx, %r9 callq 0x41189 cmpl $0x0, (%r13) je 0x8ac76 leaq 0xc(%rsp), %rcx movl $0x0, (%rcx) leaq 0x51204(%rip), %rsi # 0xdbd62 leaq 0x50(%rsp), %rdx movq %r14, %rdi callq 0x6d586 testl %eax, %eax je 0x8abb6 movq 0x8(%r14), %rcx movl 0x48c(%rcx), %esi movl 0x490(%rcx), %edx addq $0x498, %rcx # imm = 0x498 movq %r15, %rdi movq %rbx, %r8 callq 0xad1e8 testl %eax, %eax jg 0x8abdc movl $0x1, %r12d jmp 0x8abd4 leaq 0x51189(%rip), %rdi # 0xdbd2d callq 0x37264 movl $0x19e, (%rbx) # imm = 0x19E movl $0x19e, %ebp # imm = 0x19E jmp 0x8abea cmpl $-0x1, %ebp je 0x8ab6f cmpl $0x0, 0x8(%rsp) je 0x8acad movq %r15, %rdi movq %rbx, %rsi callq 0x40fde xorl %r12d, %r12d movb $0x1, %bpl cmpl $0x0, (%rbx) jle 0x8abfe leaq 0x510c0(%rip), %rdi # 0xdbca3 callq 0x37264 movl (%rbx), %ebp movl %ebp, %eax addq $0xa8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %r14, %rdi movq %r15, %rsi movl %r12d, %edx movq %rbx, %rcx callq 0x8bd01 testl %eax, %eax jle 0x8ac1f leaq 0x51151(%rip), %rdi # 0xdbd6b callq 0x37264 testb %bpl, %bpl jne 0x8abe8 movq %r14, %rdi movl $0x1, %esi xorl %edx, %edx movq %rbx, %rcx callq 0x37f5e movq %r15, %rdi movq %rbx, %rsi callq 0x3af49 movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx callq 0x8be8d testl %eax, %eax jle 0x8ac5f leaq 0x51145(%rip), %rdi # 0xdbd9f callq 0x37264 movq %r14, %rdi movl $0x2, %esi xorl %edx, %edx movq %rbx, %rcx callq 0x37f5e jmp 0x8abe8 cmpl $0x2, 0x10(%rsp) setne %bpl movl 0x8(%rsp), %r13d testl %r13d, %r13d jle 0x8abd7 movq %r15, %rdi movl %r13d, %esi movq %rbx, %rdx callq 0x959e4 leal -0x1(%r13), %eax cmpl $0x1, %r13d movl %eax, %r13d ja 0x8ac8d jmp 0x8abd7 xorl %r12d, %r12d leaq 0x20(%rsp), %rcx movq %r15, %rdi movl $0x8, %esi xorl %edx, %edx movq %rbx, %r8 callq 0xad1e8 movq %r15, %rdi movq %rbx, %rsi callq 0x40fde testl %eax, %eax jg 0x8abdc jmp 0x8abd4
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_copy_imheader
int imcomp_copy_imheader(fitsfile *infptr, fitsfile *outfptr, int *status) /* This routine reads the header keywords from the input image and copies them to the output image; the manditory structural keywords and the checksum keywords are not copied. If the DATE keyword is copied, then it is updated with the current date and time. */ { int nkeys, ii, keyclass; char card[FLEN_CARD]; /* a header record */ if (*status > 0) return(*status); ffghsp(infptr, &nkeys, NULL, status); /* get number of keywords in image */ for (ii = 5; ii <= nkeys; ii++) /* skip the first 4 keywords */ { ffgrec(infptr, ii, card, status); keyclass = ffgkcl(card); /* Get the type/class of keyword */ /* don't copy structural keywords or checksum keywords */ if ((keyclass <= TYP_CMPRS_KEY) || (keyclass == TYP_CKSUM_KEY)) continue; if (FSTRNCMP(card, "DATE ", 5) == 0) /* write current date */ { ffpdat(outfptr, status); } else if (FSTRNCMP(card, "EXTNAME ", 8) == 0) { /* don't copy default EXTNAME keyword from a compressed image */ if (FSTRNCMP(card, "EXTNAME = 'COMPRESSED_IMAGE'", 28)) { /* if EXTNAME keyword already exists, overwrite it */ /* otherwise append a new EXTNAME keyword */ ffucrd(outfptr, "EXTNAME", card, status); } } else { /* just copy the keyword to the output header */ ffprec (outfptr, card, status); } if (*status > 0) return (*status); } return (*status); }
movl (%rdx), %eax testl %eax, %eax jle 0x8afbd retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 leaq 0xc(%rsp), %r12 movq %r12, %rsi xorl %edx, %edx movq %rbx, %rcx callq 0x6d014 cmpl $0x5, (%r12) jl 0x8b0cc movl $0x4, %ebp leaq 0x10(%rsp), %r12 movl $0x45544144, %r13d # imm = 0x45544144 incl %ebp movq %r15, %rdi movl %ebp, %esi movq %r12, %rdx movq %rbx, %rcx callq 0x6e07a movq %r12, %rdi callq 0x41bd6 cmpl $0x15, %eax setl %cl cmpl $0x64, %eax sete %al orb %cl, %al jne 0x8b0c2 movb 0x10(%rsp), %al cmpb $0x44, %al jne 0x8b057 movl 0x10(%rsp), %eax xorl %r13d, %eax movzbl 0x14(%rsp), %ecx xorl $0x20, %ecx orl %eax, %ecx jne 0x8b0ae movq %r14, %rdi movq %rbx, %rsi callq 0xb0756 jmp 0x8b0bc cmpb $0x45, %al jne 0x8b0ae movabsq $0x20454d414e545845, %rax # imm = 0x20454D414E545845 cmpq %rax, 0x10(%rsp) jne 0x8b0ae movdqu 0x1c(%rsp), %xmm0 pcmpeqb 0x4fd26(%rip), %xmm0 # 0xdada0 movdqa 0x10(%rsp), %xmm1 pcmpeqb 0x4fd28(%rip), %xmm1 # 0xdadb0 pand %xmm0, %xmm1 pmovmskb %xmm1, %eax cmpl $0xffff, %eax # imm = 0xFFFF je 0x8b0bc movq %r14, %rdi leaq 0x407e1(%rip), %rsi # 0xcb882 movq %r12, %rdx movq %rbx, %rcx callq 0x95829 jmp 0x8b0bc movq %r14, %rdi movq %r12, %rsi movq %rbx, %rdx callq 0xaebe4 movl (%rbx), %eax testl %eax, %eax jg 0x8b0ce cmpl 0xc(%rsp), %ebp jl 0x8b001 movl (%rbx), %eax addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
fits_read_compressed_img
int fits_read_compressed_img(fitsfile *fptr, /* I - FITS file pointer */ int datatype, /* I - datatype of the array to be returned */ LONGLONG *infpixel, /* I - 'bottom left corner' of the subsection */ LONGLONG *inlpixel, /* I - 'top right corner' of the subsection */ long *ininc, /* I - increment to be applied in each dimension */ int nullcheck, /* I - 0 for no null checking */ /* 1: set undefined pixels = nullval */ /* 2: set nullarray=1 for undefined pixels */ void *nullval, /* I - value for undefined pixels */ void *array, /* O - array of values that are returned */ char *nullarray, /* O - array of flags = 1 if nullcheck = 2 */ int *anynul, /* O - set to 1 if any values are null; else 0 */ int *status) /* IO - error status */ /* Read a section of a compressed image; Note: lpixel may be larger than the size of the uncompressed image. Only the pixels within the image will be returned. */ { long naxis[MAX_COMPRESS_DIM], tiledim[MAX_COMPRESS_DIM]; long tilesize[MAX_COMPRESS_DIM], thistilesize[MAX_COMPRESS_DIM]; long ftile[MAX_COMPRESS_DIM], ltile[MAX_COMPRESS_DIM]; long tfpixel[MAX_COMPRESS_DIM], tlpixel[MAX_COMPRESS_DIM]; long rowdim[MAX_COMPRESS_DIM], offset[MAX_COMPRESS_DIM],ntemp; long fpixel[MAX_COMPRESS_DIM], lpixel[MAX_COMPRESS_DIM]; long inc[MAX_COMPRESS_DIM]; long i5, i4, i3, i2, i1, i0, irow; int ii, ndim, pixlen, tilenul=0; void *buffer; char *bnullarray = 0; double testnullval = 0.; if (*status > 0) return(*status); if (!fits_is_compressed_image(fptr, status) ) { ffpmsg("CHDU is not a compressed image (fits_read_compressed_img)"); return(*status = DATA_DECOMPRESSION_ERR); } /* get temporary space for uncompressing one image tile */ if (datatype == TSHORT) { buffer = malloc ((fptr->Fptr)->maxtilelen * sizeof (short)); pixlen = sizeof(short); if (nullval) testnullval = *(short *) nullval; } else if (datatype == TINT) { buffer = malloc ((fptr->Fptr)->maxtilelen * sizeof (int)); pixlen = sizeof(int); if (nullval) testnullval = *(int *) nullval; } else if (datatype == TLONG) { buffer = malloc ((fptr->Fptr)->maxtilelen * sizeof (long)); pixlen = sizeof(long); if (nullval) testnullval = *(long *) nullval; } else if (datatype == TFLOAT) { buffer = malloc ((fptr->Fptr)->maxtilelen * sizeof (float)); pixlen = sizeof(float); if (nullval) testnullval = *(float *) nullval; } else if (datatype == TDOUBLE) { buffer = malloc ((fptr->Fptr)->maxtilelen * sizeof (double)); pixlen = sizeof(double); if (nullval) testnullval = *(double *) nullval; } else if (datatype == TUSHORT) { buffer = malloc ((fptr->Fptr)->maxtilelen * sizeof (unsigned short)); pixlen = sizeof(short); if (nullval) testnullval = *(unsigned short *) nullval; } else if (datatype == TUINT) { buffer = malloc ((fptr->Fptr)->maxtilelen * sizeof (unsigned int)); pixlen = sizeof(int); if (nullval) testnullval = *(unsigned int *) nullval; } else if (datatype == TULONG) { buffer = malloc ((fptr->Fptr)->maxtilelen * sizeof (unsigned long)); pixlen = sizeof(long); if (nullval) testnullval = *(unsigned long *) nullval; } else if (datatype == TBYTE || datatype == TSBYTE) { buffer = malloc ((fptr->Fptr)->maxtilelen * sizeof (char)); pixlen = 1; if (nullval) testnullval = *(unsigned char *) nullval; } else { ffpmsg("unsupported datatype for uncompressing image"); return(*status = BAD_DATATYPE); } /* If nullcheck ==1 and nullval == 0, then this means that the */ /* calling routine does not want to check for null pixels in the array */ if (nullcheck == 1 && testnullval == 0.) nullcheck = 0; if (buffer == NULL) { ffpmsg("Out of memory (fits_read_compress_img)"); return (*status = MEMORY_ALLOCATION); } /* allocate memory for a null flag array, if needed */ if (nullcheck == 2) { bnullarray = calloc ((fptr->Fptr)->maxtilelen, sizeof (char)); if (bnullarray == NULL) { ffpmsg("Out of memory (fits_read_compress_img)"); free(buffer); return (*status = MEMORY_ALLOCATION); } } /* initialize all the arrays */ for (ii = 0; ii < MAX_COMPRESS_DIM; ii++) { naxis[ii] = 1; tiledim[ii] = 1; tilesize[ii] = 1; ftile[ii] = 1; ltile[ii] = 1; rowdim[ii] = 1; } ndim = (fptr->Fptr)->zndim; ntemp = 1; for (ii = 0; ii < ndim; ii++) { /* support for mirror-reversed image sections */ if (infpixel[ii] <= inlpixel[ii]) { fpixel[ii] = (long) infpixel[ii]; lpixel[ii] = (long) inlpixel[ii]; inc[ii] = ininc[ii]; } else { fpixel[ii] = (long) inlpixel[ii]; lpixel[ii] = (long) infpixel[ii]; inc[ii] = -ininc[ii]; } /* calc number of tiles in each dimension, and tile containing */ /* the first and last pixel we want to read in each dimension */ naxis[ii] = (fptr->Fptr)->znaxis[ii]; if (fpixel[ii] < 1) { if (nullcheck == 2) { free(bnullarray); } free(buffer); return(*status = BAD_PIX_NUM); } tilesize[ii] = (fptr->Fptr)->tilesize[ii]; tiledim[ii] = (naxis[ii] - 1) / tilesize[ii] + 1; ftile[ii] = (fpixel[ii] - 1) / tilesize[ii] + 1; ltile[ii] = minvalue((lpixel[ii] - 1) / tilesize[ii] + 1, tiledim[ii]); rowdim[ii] = ntemp; /* total tiles in each dimension */ ntemp *= tiledim[ii]; } if (anynul) *anynul = 0; /* initialize */ /* support up to 6 dimensions for now */ /* tfpixel and tlpixel are the first and last image pixels */ /* along each dimension of the compression tile */ for (i5 = ftile[5]; i5 <= ltile[5]; i5++) { tfpixel[5] = (i5 - 1) * tilesize[5] + 1; tlpixel[5] = minvalue(tfpixel[5] + tilesize[5] - 1, naxis[5]); thistilesize[5] = tlpixel[5] - tfpixel[5] + 1; offset[5] = (i5 - 1) * rowdim[5]; for (i4 = ftile[4]; i4 <= ltile[4]; i4++) { tfpixel[4] = (i4 - 1) * tilesize[4] + 1; tlpixel[4] = minvalue(tfpixel[4] + tilesize[4] - 1, naxis[4]); thistilesize[4] = thistilesize[5] * (tlpixel[4] - tfpixel[4] + 1); offset[4] = (i4 - 1) * rowdim[4] + offset[5]; for (i3 = ftile[3]; i3 <= ltile[3]; i3++) { tfpixel[3] = (i3 - 1) * tilesize[3] + 1; tlpixel[3] = minvalue(tfpixel[3] + tilesize[3] - 1, naxis[3]); thistilesize[3] = thistilesize[4] * (tlpixel[3] - tfpixel[3] + 1); offset[3] = (i3 - 1) * rowdim[3] + offset[4]; for (i2 = ftile[2]; i2 <= ltile[2]; i2++) { tfpixel[2] = (i2 - 1) * tilesize[2] + 1; tlpixel[2] = minvalue(tfpixel[2] + tilesize[2] - 1, naxis[2]); thistilesize[2] = thistilesize[3] * (tlpixel[2] - tfpixel[2] + 1); offset[2] = (i2 - 1) * rowdim[2] + offset[3]; for (i1 = ftile[1]; i1 <= ltile[1]; i1++) { tfpixel[1] = (i1 - 1) * tilesize[1] + 1; tlpixel[1] = minvalue(tfpixel[1] + tilesize[1] - 1, naxis[1]); thistilesize[1] = thistilesize[2] * (tlpixel[1] - tfpixel[1] + 1); offset[1] = (i1 - 1) * rowdim[1] + offset[2]; for (i0 = ftile[0]; i0 <= ltile[0]; i0++) { tfpixel[0] = (i0 - 1) * tilesize[0] + 1; tlpixel[0] = minvalue(tfpixel[0] + tilesize[0] - 1, naxis[0]); thistilesize[0] = thistilesize[1] * (tlpixel[0] - tfpixel[0] + 1); /* calculate row of table containing this tile */ irow = i0 + offset[1]; /* printf("row %d, %d %d, %d %d, %d %d; %d\n", irow, tfpixel[0],tlpixel[0],tfpixel[1],tlpixel[1],tfpixel[2],tlpixel[2], thistilesize[0]); */ /* test if there are any intersecting pixels in this tile and the output image */ if (imcomp_test_overlap(ndim, tfpixel, tlpixel, fpixel, lpixel, inc, status)) { /* read and uncompress this row (tile) of the table */ /* also do type conversion and undefined pixel substitution */ /* at this point */ imcomp_decompress_tile(fptr, irow, thistilesize[0], datatype, nullcheck, nullval, buffer, bnullarray, &tilenul, status); if (tilenul && anynul) *anynul = 1; /* there are null pixels */ /* printf(" pixlen=%d, ndim=%d, %d %d %d, %d %d %d, %d %d %d\n", pixlen, ndim, fpixel[0],lpixel[0],inc[0],fpixel[1],lpixel[1],inc[1], fpixel[2],lpixel[2],inc[2]); */ /* copy the intersecting pixels from this tile to the output */ imcomp_copy_overlap(buffer, pixlen, ndim, tfpixel, tlpixel, bnullarray, array, fpixel, lpixel, inc, nullcheck, nullarray, status); } } } } } } } if (nullcheck == 2) { free(bnullarray); } free(buffer); return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x388, %rsp # imm = 0x388 movq 0x3e0(%rsp), %rbx movl $0x0, 0x44(%rsp) movl (%rbx), %eax testl %eax, %eax jle 0x8b116 addq $0x388, %rsp # imm = 0x388 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl %r9d, %r14d movq %r8, %r12 movq %rdx, %rbp movl %esi, %r15d movq %rdi, %r13 movq %rcx, 0x38(%rsp) movq %rbx, %rsi callq 0x41127 testl %eax, %eax je 0x8b1a0 movq %rbp, 0x50(%rsp) movq %r12, 0x8(%rsp) movq 0x3c0(%rsp), %rbp cmpl $0x27, %r15d jg 0x8b1bc cmpl $0x1d, %r15d jg 0x8b214 cmpl $0x14, %r15d je 0x8b2ae cmpl $0x15, %r15d jne 0x8b39d movq 0x8(%r13), %r12 movq 0x4c8(%r12), %rbx leaq (%rbx,%rbx), %rdi callq 0x61a0 movq %rax, 0x18(%rsp) movl $0x2, 0x14(%rsp) testq %rbp, %rbp je 0x8b3da movswl (%rbp), %eax jmp 0x8b3d4 leaq 0x50c2c(%rip), %rdi # 0xdbdd3 callq 0x37264 movl $0x19e, (%rbx) # imm = 0x19E movl $0x19e, %eax # imm = 0x19E jmp 0x8b104 cmpl $0x29, %r15d jg 0x8b261 cmpl $0x28, %r15d je 0x8b2e2 cmpl $0x29, %r15d jne 0x8b39d movq 0x8(%r13), %r12 movq 0x4c8(%r12), %rbx leaq (,%rbx,8), %rdi callq 0x61a0 movq %rax, 0x18(%rsp) movl $0x8, 0x14(%rsp) testq %rbp, %rbp je 0x8b3da cvtsi2sdq (%rbp), %xmm0 jmp 0x8b3de cmpl $0x1e, %r15d je 0x8b336 cmpl $0x1f, %r15d jne 0x8b39d movq 0x8(%r13), %r12 movq 0x4c8(%r12), %rbx leaq (,%rbx,4), %rdi callq 0x61a0 movq %rax, 0x18(%rsp) movl $0x4, 0x14(%rsp) testq %rbp, %rbp je 0x8b3da cvtsi2sdl (%rbp), %xmm0 jmp 0x8b3de cmpl $0x2a, %r15d je 0x8b36b cmpl $0x52, %r15d jne 0x8b39d movq 0x8(%r13), %r12 movq 0x4c8(%r12), %rbx leaq (,%rbx,8), %rdi callq 0x61a0 movq %rax, 0x18(%rsp) movl $0x8, 0x14(%rsp) testq %rbp, %rbp je 0x8b3da movsd (%rbp), %xmm0 jmp 0x8b3de movq 0x8(%r13), %r12 movq 0x4c8(%r12), %rbx leaq (%rbx,%rbx), %rdi callq 0x61a0 movq %rax, 0x18(%rsp) movl $0x2, 0x14(%rsp) testq %rbp, %rbp je 0x8b3da movzwl (%rbp), %eax jmp 0x8b3d4 movq 0x8(%r13), %r12 movq 0x4c8(%r12), %rbx leaq (,%rbx,8), %rdi callq 0x61a0 movq %rax, 0x18(%rsp) movl $0x8, 0x14(%rsp) testq %rbp, %rbp je 0x8b3da movsd (%rbp), %xmm1 unpcklps 0x4c953(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1] subpd 0x4c95b(%rip), %xmm1 # 0xd7c80 movapd %xmm1, %xmm0 unpckhpd %xmm1, %xmm0 # xmm0 = xmm0[1],xmm1[1] addsd %xmm1, %xmm0 jmp 0x8b3de movq 0x8(%r13), %r12 movq 0x4c8(%r12), %rbx leaq (,%rbx,4), %rdi callq 0x61a0 movq %rax, 0x18(%rsp) movl $0x4, 0x14(%rsp) testq %rbp, %rbp je 0x8b3da movl (%rbp), %eax cvtsi2sd %rax, %xmm0 jmp 0x8b3de movq 0x8(%r13), %r12 movq 0x4c8(%r12), %rbx leaq (,%rbx,4), %rdi callq 0x61a0 movq %rax, 0x18(%rsp) movl $0x4, 0x14(%rsp) testq %rbp, %rbp je 0x8b3da cvtss2sd (%rbp), %xmm0 jmp 0x8b3de leal -0xb(%r15), %eax cmpl $0x1, %eax ja 0x8bce5 movq 0x8(%r13), %r12 movq 0x4c8(%r12), %rbx movq %rbx, %rdi callq 0x61a0 movq %rax, 0x18(%rsp) movl $0x1, 0x14(%rsp) testq %rbp, %rbp je 0x8b3da movzbl (%rbp), %eax cvtsi2sd %eax, %xmm0 jmp 0x8b3de xorpd %xmm0, %xmm0 movq 0x8(%rsp), %rbp xorl %eax, %eax xorpd %xmm1, %xmm1 ucomisd %xmm1, %xmm0 cmovnel %r14d, %eax cmovpl %r14d, %eax cmpl $0x1, %r14d cmovnel %r14d, %eax cmpq $0x0, 0x18(%rsp) je 0x8b443 movq %rax, 0x48(%rsp) cmpl $0x2, %eax jne 0x8b467 movl $0x1, %esi movq %rbx, %rdi callq 0x64a0 movq %rax, 0x8(%rsp) testq %rax, %rax movq 0x38(%rsp), %r14 jne 0x8b475 leaq 0x50a08(%rip), %rdi # 0xdbe3a callq 0x37264 movq 0x18(%rsp), %rdi callq 0x6260 jmp 0x8b44f leaq 0x509f0(%rip), %rdi # 0xdbe3a callq 0x37264 movq 0x3e0(%rsp), %rax movl $0x71, (%rax) movl $0x71, %eax jmp 0x8b104 movq $0x0, 0x8(%rsp) movq 0x38(%rsp), %r14 xorl %eax, %eax movapd 0x3dbe1(%rip), %xmm0 # 0xc9060 movq 0x3e0(%rsp), %rbx movapd %xmm0, 0x290(%rsp,%rax,8) movapd %xmm0, 0x260(%rsp,%rax,8) movapd %xmm0, 0x230(%rsp,%rax,8) movapd %xmm0, 0x200(%rsp,%rax,8) movapd %xmm0, 0x2c0(%rsp,%rax,8) addq $0x2, %rax cmpq $0x6, %rax jne 0x8b487 movslq 0x490(%r12), %rcx movq %rcx, 0x38(%rsp) testq %rcx, %rcx jle 0x8b5af movq 0x38(%rsp), %rax leaq (,%rax,8), %r8 movl $0x1, %r9d xorl %r10d, %r10d movq 0x50(%rsp), %rax movq (%rax,%r10), %rax movq (%r14,%r10), %rcx movq (%rbp,%r10), %rdx movq %rdx, %rdi negq %rdi cmpq %rcx, %rax movq %rcx, %rsi cmovlq %rax, %rsi cmovgq %rax, %rcx cmovleq %rdx, %rdi movq %rsi, 0x350(%rsp,%r10) movq %rcx, 0x320(%rsp,%r10) movq %rdi, 0x2f0(%rsp,%r10) movq 0x498(%r12,%r10), %rax movq %rax, 0x290(%rsp,%r10) testq %rsi, %rsi jle 0x8bcba movq 0x440(%r12,%r10), %r11 movq %r11, 0x260(%rsp,%r10) decq %rax cqto idivq %r11 movq %rax, %rdi incq %rdi decq %rsi movq %rsi, %rax cqto idivq %r11 incq %rax movq %rax, 0x230(%rsp,%r10) decq %rcx movq %rcx, %rax cqto idivq %r11 incq %rax cmpq %rdi, %rax cmovgeq %rdi, %rax movq %rax, 0x200(%rsp,%r10) movq %r9, 0x2c0(%rsp,%r10) imulq %rdi, %r9 addq $0x8, %r10 cmpq %r10, %r8 jne 0x8b4ea movq %r13, 0x180(%rsp) movq %r15, 0x188(%rsp) movq 0x3d8(%rsp), %rax testq %rax, %rax je 0x8b5d2 movl $0x0, (%rax) movq 0x258(%rsp), %rdx movq 0x228(%rsp), %rax movq %rax, 0xc8(%rsp) cmpq %rax, %rdx jg 0x8bc90 movl 0x2e8(%rsp), %ecx movq 0x250(%rsp), %rsi movl 0x2e0(%rsp), %edi movq 0x248(%rsp), %r8 movl 0x2d8(%rsp), %r9d movq 0x240(%rsp), %r10 movl 0x2c8(%rsp), %r11d movl 0x2d0(%rsp), %ebx movq 0x230(%rsp), %r14 movq 0x238(%rsp), %r15 movq 0x200(%rsp), %r12 movq 0x260(%rsp), %r13 leal -0x1(%rdx), %eax movl %ecx, 0x5c(%rsp) imull %ecx, %eax movq %rsi, 0x70(%rsp) leal -0x1(%rsi), %ecx movl %edi, 0x60(%rsp) imull %edi, %ecx addl %eax, %ecx movq %r8, 0x88(%rsp) leal -0x1(%r8), %eax movl %r9d, 0x64(%rsp) imull %r9d, %eax movq %r10, 0x98(%rsp) leal -0x1(%r10), %esi movl %ebx, 0x68(%rsp) imull %ebx, %esi addl %eax, %esi movq %r12, 0x168(%rsp) subq %r14, %r12 incq %r12 movq %r12, 0x148(%rsp) addl %ecx, %esi movq %r15, 0xa8(%rsp) leal -0x1(%r15), %eax movl %r11d, 0x6c(%rsp) imull %r11d, %eax addl %r14d, %eax addl %eax, %esi movl %esi, 0x24(%rsp) movq %r14, %rax imulq %r13, %rax movq %rax, 0x140(%rsp) movq %r14, 0x170(%rsp) leaq -0x1(%r14), %rax movq %r13, 0x50(%rsp) imulq %r13, %rax movq %rax, %rcx negq %rcx movq %rcx, 0x130(%rsp) incq %rax movq %rax, 0x138(%rsp) movq 0x288(%rsp), %rax movq %rax, 0xc0(%rsp) movq 0x2b8(%rsp), %rax movq %rax, 0xb8(%rsp) movq 0x220(%rsp), %rax movq %rax, 0x80(%rsp) movq 0x280(%rsp), %rax movq %rax, 0xe0(%rsp) movq 0x2b0(%rsp), %rax movq %rax, 0xd8(%rsp) movq 0x218(%rsp), %rax movq %rax, 0x90(%rsp) movq 0x278(%rsp), %rax movq %rax, 0x100(%rsp) movq 0x2a8(%rsp), %rax movq %rax, 0xf8(%rsp) movq 0x210(%rsp), %rax movq %rax, 0xa0(%rsp) movq 0x270(%rsp), %rax movq %rax, 0x120(%rsp) movq 0x2a0(%rsp), %rax movq %rax, 0x118(%rsp) movq 0x208(%rsp), %rax movq %rax, 0xb0(%rsp) movq 0x268(%rsp), %rax movq %rax, 0x160(%rsp) movq 0x290(%rsp), %rax movq %rax, 0x198(%rsp) movq 0x298(%rsp), %rax movq %rax, 0x158(%rsp) leaq -0x1(%rdx), %rax movq 0xc0(%rsp), %rcx imulq %rcx, %rax movq %rcx, %rsi movq %rdx, 0xd0(%rsp) imulq %rdx, %rsi movq 0xb8(%rsp), %rcx cmpq %rcx, %rsi cmovgeq %rcx, %rsi leaq 0x1(%rax), %rcx movq %rcx, 0x1f8(%rsp) movq %rsi, 0x78(%rsp) movq %rsi, 0x1c8(%rsp) movq 0x80(%rsp), %rcx cmpq %rcx, 0x70(%rsp) jg 0x8bc67 subq %rax, 0x78(%rsp) movl 0x24(%rsp), %eax movl %eax, 0x28(%rsp) movq 0x70(%rsp), %rdx leaq -0x1(%rdx), %rax movq 0xe0(%rsp), %rcx imulq %rcx, %rax movq %rcx, %rsi movq %rdx, 0xe8(%rsp) imulq %rdx, %rsi movq 0xd8(%rsp), %rcx cmpq %rcx, %rsi cmovgeq %rcx, %rsi leaq 0x1(%rax), %rcx movq %rcx, 0x1f0(%rsp) movq %rsi, 0x1c0(%rsp) movq 0x90(%rsp), %rcx cmpq %rcx, 0x88(%rsp) jg 0x8bc3e movq %rsi, %rdx subq %rax, %rdx imulq 0x78(%rsp), %rdx movq %rdx, 0xf0(%rsp) movl 0x28(%rsp), %eax movl %eax, 0x2c(%rsp) movq 0x88(%rsp), %rdx leaq -0x1(%rdx), %rax movq 0x100(%rsp), %rcx imulq %rcx, %rax movq %rcx, %rsi movq %rdx, 0x108(%rsp) imulq %rdx, %rsi movq 0xf8(%rsp), %rcx cmpq %rcx, %rsi cmovgeq %rcx, %rsi leaq 0x1(%rax), %rcx movq %rcx, 0x1e8(%rsp) movq %rsi, 0x1b8(%rsp) movq 0xa0(%rsp), %rcx cmpq %rcx, 0x98(%rsp) jg 0x8bc15 movq %rsi, %rdx subq %rax, %rdx imulq 0xf0(%rsp), %rdx movq %rdx, 0x110(%rsp) movl 0x2c(%rsp), %eax movl %eax, 0x30(%rsp) movq 0x98(%rsp), %rdx leaq -0x1(%rdx), %rax movq 0x120(%rsp), %rcx imulq %rcx, %rax movq %rcx, %rsi movq %rdx, 0x128(%rsp) imulq %rdx, %rsi movq 0x118(%rsp), %rcx cmpq %rcx, %rsi cmovgeq %rcx, %rsi leaq 0x1(%rax), %rcx movq %rcx, 0x1e0(%rsp) movq %rsi, 0x1b0(%rsp) movq 0xb0(%rsp), %rcx cmpq %rcx, 0xa8(%rsp) jg 0x8bbec movq %rsi, %rdx subq %rax, %rdx imulq 0x110(%rsp), %rdx movq %rdx, 0x150(%rsp) movl 0x30(%rsp), %eax movl %eax, 0x34(%rsp) movq 0xa8(%rsp), %rdx leaq -0x1(%rdx), %rax movq 0x160(%rsp), %rcx imulq %rcx, %rax movq %rcx, %rsi movq %rdx, 0x178(%rsp) imulq %rdx, %rsi movq 0x158(%rsp), %rcx cmpq %rcx, %rsi cmovgeq %rcx, %rsi leaq 0x1(%rax), %rcx movq %rcx, 0x1d8(%rsp) movq %rsi, 0x1a8(%rsp) movq 0x168(%rsp), %rcx cmpq %rcx, 0x170(%rsp) jg 0x8bbc3 movq %rsi, %rdx subq %rax, %rdx imulq 0x150(%rsp), %rdx movq %rdx, 0x190(%rsp) movq 0x138(%rsp), %r15 movq 0x130(%rsp), %r12 movq 0x140(%rsp), %r13 movl 0x34(%rsp), %ebp movq 0x148(%rsp), %r14 movq 0x198(%rsp), %rax cmpq %r13, %rax movq %r13, %rbx cmovlq %rax, %rbx movq %r15, 0x1d0(%rsp) movq %rbx, 0x1a0(%rsp) subq $0x8, %rsp movq 0x40(%rsp), %rdi leaq 0x1d8(%rsp), %rsi leaq 0x1a8(%rsp), %rdx leaq 0x358(%rsp), %rcx leaq 0x328(%rsp), %r8 leaq 0x2f8(%rsp), %r9 movq 0x3e8(%rsp), %rax pushq %rax callq 0x8bef6 addq $0x10, %rsp testl %eax, %eax je 0x8bbaa addq %r12, %rbx imull 0x190(%rsp), %ebx movq 0x180(%rsp), %rdi movl %ebp, %esi movl %ebx, %edx movq 0x188(%rsp), %rcx movq 0x48(%rsp), %rbx movl %ebx, %r8d movq 0x3c0(%rsp), %r9 movq 0x3e0(%rsp), %rax pushq %rax leaq 0x4c(%rsp), %rax pushq %rax pushq 0x18(%rsp) pushq 0x30(%rsp) callq 0x867b6 addq $0x20, %rsp movq 0x3d8(%rsp), %rcx testq %rcx, %rcx movq 0x3e0(%rsp), %rax je 0x8bb4f cmpl $0x0, 0x44(%rsp) je 0x8bb4f movl $0x1, (%rcx) subq $0x8, %rsp movq 0x20(%rsp), %rdi movl 0x1c(%rsp), %esi movq 0x40(%rsp), %rdx leaq 0x1d8(%rsp), %rcx leaq 0x1a8(%rsp), %r8 movq 0x10(%rsp), %r9 pushq %rax pushq 0x3e0(%rsp) pushq %rbx leaq 0x310(%rsp), %rax pushq %rax leaq 0x348(%rsp), %rax pushq %rax leaq 0x380(%rsp), %rax pushq %rax pushq 0x400(%rsp) callq 0x8c066 addq $0x40, %rsp incl %ebp movq 0x50(%rsp), %rax addq %rax, %r13 subq %rax, %r12 addq %rax, %r15 decq %r14 jne 0x8ba71 movq 0x178(%rsp), %rdx leaq 0x1(%rdx), %rax movl 0x34(%rsp), %ecx addl 0x6c(%rsp), %ecx movl %ecx, 0x34(%rsp) cmpq 0xb0(%rsp), %rdx movq %rax, %rdx jne 0x8b9de movq 0x128(%rsp), %rdx leaq 0x1(%rdx), %rax movl 0x30(%rsp), %ecx addl 0x68(%rsp), %ecx movl %ecx, 0x30(%rsp) cmpq 0xa0(%rsp), %rdx movq %rax, %rdx jne 0x8b95f movq 0x108(%rsp), %rdx leaq 0x1(%rdx), %rax movl 0x2c(%rsp), %ecx addl 0x64(%rsp), %ecx movl %ecx, 0x2c(%rsp) cmpq 0x90(%rsp), %rdx movq %rax, %rdx jne 0x8b8e0 movq 0xe8(%rsp), %rdx leaq 0x1(%rdx), %rax movl 0x28(%rsp), %ecx addl 0x60(%rsp), %ecx movl %ecx, 0x28(%rsp) cmpq 0x80(%rsp), %rdx movq %rax, %rdx jne 0x8b864 movq 0xd0(%rsp), %rcx leaq 0x1(%rcx), %rax movl 0x24(%rsp), %edx addl 0x5c(%rsp), %edx movl %edx, 0x24(%rsp) cmpq 0xc8(%rsp), %rcx movq %rax, %rdx jne 0x8b7f8 cmpl $0x2, 0x48(%rsp) jne 0x8bca1 movq 0x8(%rsp), %rdi callq 0x6260 movq 0x18(%rsp), %rdi callq 0x6260 movq 0x3e0(%rsp), %rax movl (%rax), %eax jmp 0x8b104 cmpl $0x2, 0x48(%rsp) jne 0x8bccb movq 0x8(%rsp), %rdi callq 0x6260 movq 0x18(%rsp), %rdi callq 0x6260 movl $0x141, (%rbx) # imm = 0x141 movl $0x141, %eax # imm = 0x141 jmp 0x8b104 leaq 0x50121(%rip), %rdi # 0xdbe0d callq 0x37264 movl $0x19a, (%rbx) # imm = 0x19A movl $0x19a, %eax # imm = 0x19A jmp 0x8b104
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_copy_prime2img
int imcomp_copy_prime2img(fitsfile *infptr, fitsfile *outfptr, int *status) /* This routine copies any unexpected keywords from the primary array of the compressed input image into the header of the uncompressed image (which is the primary array of the output file). */ { int nsp; /* keywords that will not be copied */ char *spkeys[][2] = { {"SIMPLE", "-" }, {"BITPIX", "-" }, {"NAXIS", "-" }, {"NAXISm", "-" }, {"PCOUNT", "-" }, {"EXTEND", "-" }, {"GCOUNT", "-" }, {"CHECKSUM","-" }, {"DATASUM", "-" }, {"EXTNAME", "-" }, {"HISTORY", "-" }, {"COMMENT", "-" }, {"*", "+" }}; if (*status > 0) return(*status); nsp = sizeof(spkeys)/sizeof(spkeys[0][0])/2; /* translate and copy the keywords from the input file to the output */ fits_translate_keywords(infptr, outfptr, 1, spkeys, nsp, 0, 0, 0, status); return (*status); }
pushq %r15 pushq %r14 pushq %rbx subq $0xd0, %rsp movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 leaq 0x72da7(%rip), %rsi # 0xfec50 movq %rsp, %rdi movl $0xd0, %edx callq 0x65c0 movl (%rbx), %eax testl %eax, %eax jg 0x8bee9 subq $0x8, %rsp xorl %eax, %eax leaq 0x8(%rsp), %rcx movq %r15, %rdi movq %r14, %rsi movl $0x1, %edx movl $0xd, %r8d xorl %r9d, %r9d pushq %rbx pushq %rax pushq %rax callq 0x39473 addq $0x20, %rsp movl (%rbx), %eax addq $0xd0, %rsp popq %rbx popq %r14 popq %r15 retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_test_overlap
int imcomp_test_overlap ( int ndim, /* I - number of dimension in the tile and image */ long *tfpixel, /* I - first pixel number in each dim. of the tile */ long *tlpixel, /* I - last pixel number in each dim. of the tile */ long *fpixel, /* I - first pixel number in each dim. of the image */ long *lpixel, /* I - last pixel number in each dim. of the image */ long *ininc, /* I - increment to be applied in each image dimen. */ int *status) /* test if there are any intersecting pixels between this tile and the section of the image defined by fixel, lpixel, ininc. */ { long imgdim[MAX_COMPRESS_DIM]; /* product of preceding dimensions in the */ /* output image, allowing for inc factor */ long tiledim[MAX_COMPRESS_DIM]; /* product of preceding dimensions in the */ /* tile, array; inc factor is not relevant */ long imgfpix[MAX_COMPRESS_DIM]; /* 1st img pix overlapping tile: 0 base, */ /* allowing for inc factor */ long imglpix[MAX_COMPRESS_DIM]; /* last img pix overlapping tile 0 base, */ /* allowing for inc factor */ long tilefpix[MAX_COMPRESS_DIM]; /* 1st tile pix overlapping img 0 base, */ /* allowing for inc factor */ long inc[MAX_COMPRESS_DIM]; /* local copy of input ininc */ int ii; long tf, tl; if (*status > 0) return(*status); /* ------------------------------------------------------------ */ /* calc amount of overlap in each dimension; if there is zero */ /* overlap in any dimension then just return */ /* ------------------------------------------------------------ */ for (ii = 0; ii < ndim; ii++) { if (tlpixel[ii] < fpixel[ii] || tfpixel[ii] > lpixel[ii]) return(0); /* there are no overlapping pixels */ inc[ii] = ininc[ii]; /* calc dimensions of the output image section */ imgdim[ii] = (lpixel[ii] - fpixel[ii]) / labs(inc[ii]) + 1; if (imgdim[ii] < 1) { *status = NEG_AXIS; return(0); } /* calc dimensions of the tile */ tiledim[ii] = tlpixel[ii] - tfpixel[ii] + 1; if (tiledim[ii] < 1) { *status = NEG_AXIS; return(0); } if (ii > 0) tiledim[ii] *= tiledim[ii - 1]; /* product of dimensions */ /* first and last pixels in image that overlap with the tile, 0 base */ tf = tfpixel[ii] - 1; tl = tlpixel[ii] - 1; /* skip this plane if it falls in the cracks of the subsampled image */ while ((tf-(fpixel[ii] - 1)) % labs(inc[ii])) { tf++; if (tf > tl) return(0); /* no overlapping pixels */ } while ((tl-(fpixel[ii] - 1)) % labs(inc[ii])) { tl--; if (tf > tl) return(0); /* no overlapping pixels */ } imgfpix[ii] = maxvalue((tf - fpixel[ii] +1) / labs(inc[ii]) , 0); imglpix[ii] = minvalue((tl - fpixel[ii] +1) / labs(inc[ii]) , imgdim[ii] - 1); /* first pixel in the tile that overlaps with the image (0 base) */ tilefpix[ii] = maxvalue(fpixel[ii] - tfpixel[ii], 0); while ((tfpixel[ii] + tilefpix[ii] - fpixel[ii]) % labs(inc[ii])) { (tilefpix[ii])++; if (tilefpix[ii] >= tiledim[ii]) return(0); /* no overlapping pixels */ } if (ii > 0) imgdim[ii] *= imgdim[ii - 1]; /* product of dimensions */ } return(1); /* there appears to be intersecting pixels */ }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movq 0x40(%rsp), %rax movl (%rax), %r11d testl %r11d, %r11d jle 0x8bf20 movl %r11d, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq testl %edi, %edi jle 0x8c04b movl %edi, %eax movq %rax, -0x78(%rsp) xorl %r11d, %r11d xorl %r14d, %r14d movq %r9, -0x68(%rsp) movq %rdx, -0x70(%rsp) movq (%rdx,%r14,8), %rdi movq (%rcx,%r14,8), %rbx cmpq %rbx, %rdi jl 0x8bf0e movq (%rsi,%r14,8), %r10 movq (%r8,%r14,8), %rax cmpq %rax, %r10 jg 0x8bf0e movq (%r9,%r14,8), %rdx subq %rbx, %rax movq %rdx, %r12 negq %r12 cmovsq %rdx, %r12 cqto idivq %r12 leaq 0x1(%rax), %r13 movq %r13, -0x30(%rsp,%r14,8) testq %rax, %rax js 0x8c056 movq %rdi, %rdx subq %r10, %rdx leaq 0x1(%rdx), %rax movq %rax, -0x60(%rsp,%r14,8) testq %rdx, %rdx js 0x8c056 testq %r14, %r14 je 0x8bfa9 imulq -0x68(%rsp,%r14,8), %rax movq %rax, -0x60(%rsp,%r14,8) leaq -0x1(%rdi), %r9 movq %rbx, %rbp negq %rbp movq %r10, %r15 leaq (%r15,%rbp), %rax cqto idivq %r12 testq %rdx, %rdx je 0x8bfd8 leaq 0x1(%r15), %rax decq %r15 cmpq %r9, %r15 movq %rax, %r15 jl 0x8bfb6 jmp 0x8bf0e decq %r15 leaq (%rdi,%rbp), %rax cqto idivq %r12 testq %rdx, %rdx je 0x8bff6 decq %rdi cmpq %rdi, %r15 jl 0x8bfdb jmp 0x8bf0e movq %rbx, %rdi subq %r10, %rdi testq %rdi, %rdi cmovleq %r11, %rdi subq %rbx, %r10 leaq (%r10,%rdi), %rax cqto idivq %r12 testq %rdx, %rdx je 0x8c023 incq %rdi cmpq -0x60(%rsp,%r14,8), %rdi jl 0x8c006 jmp 0x8bf0e testq %r14, %r14 je 0x8c033 imulq -0x38(%rsp,%r14,8), %r13 movq %r13, -0x30(%rsp,%r14,8) incq %r14 cmpq -0x78(%rsp), %r14 movq -0x68(%rsp), %r9 movq -0x70(%rsp), %rdx jne 0x8bf3f movl $0x1, %r11d jmp 0x8bf0e movq 0x40(%rsp), %rax movl $0x143, (%rax) # imm = 0x143 jmp 0x8bf0e
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
imcomp_get_compressed_image_par
int imcomp_get_compressed_image_par(fitsfile *infptr, int *status) /* This routine reads keywords from a BINTABLE extension containing a compressed image. */ { char keyword[FLEN_KEYWORD]; char value[FLEN_VALUE]; int ii, tstatus, tstatus2, doffset, oldFormat=0, colNum=0; long expect_nrows, maxtilelen; if (*status > 0) return(*status); /* Copy relevant header keyword values to structure */ if (ffgky (infptr, TSTRING, "ZCMPTYPE", value, NULL, status) > 0) { ffpmsg("required ZCMPTYPE compression keyword not found in"); ffpmsg(" imcomp_get_compressed_image_par"); return(*status); } (infptr->Fptr)->zcmptype[0] = '\0'; strncat((infptr->Fptr)->zcmptype, value, 11); if (!FSTRCMP(value, "RICE_1") || !FSTRCMP(value, "RICE_ONE") ) (infptr->Fptr)->compress_type = RICE_1; else if (!FSTRCMP(value, "HCOMPRESS_1") ) (infptr->Fptr)->compress_type = HCOMPRESS_1; else if (!FSTRCMP(value, "GZIP_1") ) (infptr->Fptr)->compress_type = GZIP_1; else if (!FSTRCMP(value, "GZIP_2") ) (infptr->Fptr)->compress_type = GZIP_2; else if (!FSTRCMP(value, "BZIP2_1") ) (infptr->Fptr)->compress_type = BZIP2_1; else if (!FSTRCMP(value, "PLIO_1") ) (infptr->Fptr)->compress_type = PLIO_1; else if (!FSTRCMP(value, "NOCOMPRESS") ) (infptr->Fptr)->compress_type = NOCOMPRESS; else { ffpmsg("Unknown image compression type:"); ffpmsg(value); return (*status = DATA_DECOMPRESSION_ERR); } if (ffgky (infptr, TINT, "ZBITPIX", &(infptr->Fptr)->zbitpix, NULL, status) > 0) { ffpmsg("required ZBITPIX compression keyword not found"); return(*status); } /* If ZZERO and ZSCALE columns don't exist for floating-point types, assume there is NO quantization. Treat exactly as if it had ZQUANTIZ='NONE'. This is true regardless of whether or not file has a ZQUANTIZ keyword. */ tstatus=0; tstatus2=0; if ((infptr->Fptr->zbitpix < 0) && (fits_get_colnum(infptr,CASEINSEN,"ZZERO",&colNum,&tstatus) == COL_NOT_FOUND) && (fits_get_colnum(infptr,CASEINSEN,"ZSCALE",&colNum,&tstatus2) == COL_NOT_FOUND)) { (infptr->Fptr)->quantize_level = NO_QUANTIZE; } else { /* get the floating point to integer quantization type, if present. */ /* FITS files produced before 2009 will not have this keyword */ tstatus = 0; if (ffgky(infptr, TSTRING, "ZQUANTIZ", value, NULL, &tstatus) > 0) { (infptr->Fptr)->quantize_method = 0; (infptr->Fptr)->quantize_level = 0; } else { if (!FSTRCMP(value, "NONE") ) { (infptr->Fptr)->quantize_level = NO_QUANTIZE; } else if (!FSTRCMP(value, "SUBTRACTIVE_DITHER_1") ) (infptr->Fptr)->quantize_method = SUBTRACTIVE_DITHER_1; else if (!FSTRCMP(value, "SUBTRACTIVE_DITHER_2") ) (infptr->Fptr)->quantize_method = SUBTRACTIVE_DITHER_2; else if (!FSTRCMP(value, "NO_DITHER") ) (infptr->Fptr)->quantize_method = NO_DITHER; else (infptr->Fptr)->quantize_method = 0; } } /* get the floating point quantization dithering offset, if present. */ /* FITS files produced before October 2009 will not have this keyword */ tstatus = 0; if (ffgky(infptr, TINT, "ZDITHER0", &doffset, NULL, &tstatus) > 0) { /* by default start with 1st element of random sequence */ (infptr->Fptr)->dither_seed = 1; } else { (infptr->Fptr)->dither_seed = doffset; } if (ffgky (infptr,TINT, "ZNAXIS", &(infptr->Fptr)->zndim, NULL, status) > 0) { ffpmsg("required ZNAXIS compression keyword not found"); return(*status); } if ((infptr->Fptr)->zndim < 1) { ffpmsg("Compressed image has no data (ZNAXIS < 1)"); return (*status = BAD_NAXIS); } if ((infptr->Fptr)->zndim > MAX_COMPRESS_DIM) { ffpmsg("Compressed image has too many dimensions"); return(*status = BAD_NAXIS); } expect_nrows = 1; maxtilelen = 1; for (ii = 0; ii < (infptr->Fptr)->zndim; ii++) { /* get image size */ snprintf (keyword, FLEN_KEYWORD,"ZNAXIS%d", ii+1); ffgky (infptr, TLONG,keyword, &(infptr->Fptr)->znaxis[ii],NULL,status); if (*status > 0) { ffpmsg("required ZNAXISn compression keyword not found"); return(*status); } /* get compression tile size */ snprintf (keyword, FLEN_KEYWORD,"ZTILE%d", ii+1); /* set default tile size in case keywords are not present */ if (ii == 0) (infptr->Fptr)->tilesize[0] = (infptr->Fptr)->znaxis[0]; else (infptr->Fptr)->tilesize[ii] = 1; tstatus = 0; ffgky (infptr, TLONG, keyword, &(infptr->Fptr)->tilesize[ii], NULL, &tstatus); if ((infptr->Fptr)->tilesize[ii] == 0) { ffpmsg("invalid ZTILE value = 0 in compressed image"); return (*status = DATA_DECOMPRESSION_ERR); } expect_nrows *= (((infptr->Fptr)->znaxis[ii] - 1) / (infptr->Fptr)->tilesize[ii]+ 1); maxtilelen *= (infptr->Fptr)->tilesize[ii]; } /* check number of rows */ if (expect_nrows != (infptr->Fptr)->numrows) { ffpmsg( "number of table rows != the number of tiles in compressed image"); return (*status = DATA_DECOMPRESSION_ERR); } /* read any algorithm specific parameters */ if ((infptr->Fptr)->compress_type == RICE_1 ) { if (ffgky(infptr, TINT,"ZVAL1", &(infptr->Fptr)->rice_blocksize, NULL, status) > 0) { ffpmsg("required ZVAL1 compression keyword not found"); return(*status); } tstatus = 0; /* First check for very old files, where ZVAL2 wasn't yet designated for bytepix */ if (!ffgky(infptr, TSTRING, "ZNAME2", value, NULL, &tstatus) && !FSTRCMP(value, "NOISEBIT")) { oldFormat = 1; } tstatus = 0; if (oldFormat || ffgky(infptr, TINT,"ZVAL2", &(infptr->Fptr)->rice_bytepix, NULL, &tstatus) > 0) { (infptr->Fptr)->rice_bytepix = 4; /* default value */ } if ((infptr->Fptr)->rice_blocksize < 16 && (infptr->Fptr)->rice_bytepix > 8) { /* values are reversed */ tstatus = (infptr->Fptr)->rice_bytepix; (infptr->Fptr)->rice_bytepix = (infptr->Fptr)->rice_blocksize; (infptr->Fptr)->rice_blocksize = tstatus; } } else if ((infptr->Fptr)->compress_type == HCOMPRESS_1 ) { if (ffgky(infptr, TFLOAT,"ZVAL1", &(infptr->Fptr)->hcomp_scale, NULL, status) > 0) { ffpmsg("required ZVAL1 compression keyword not found"); return(*status); } tstatus = 0; ffgky(infptr, TINT,"ZVAL2", &(infptr->Fptr)->hcomp_smooth, NULL, &tstatus); } /* store number of pixels in each compression tile, */ /* and max size of the compressed tile buffer */ (infptr->Fptr)->maxtilelen = maxtilelen; /* prevent possible divide by zero in imcomp_calc_max_elem */ if ((infptr->Fptr)->compress_type == RICE_1 && (infptr->Fptr)->rice_blocksize == 0) { ffpmsg("Invalid RICE_1 blocksize = 0 (fits_get_compressed_img_par)"); return(*status = DATA_DECOMPRESSION_ERR); } (infptr->Fptr)->maxelem = imcomp_calc_max_elem ((infptr->Fptr)->compress_type, maxtilelen, (infptr->Fptr)->zbitpix, (infptr->Fptr)->rice_blocksize); /* Get Column numbers. */ if (ffgcno(infptr, CASEINSEN, "COMPRESSED_DATA", &(infptr->Fptr)->cn_compressed, status) > 0) { ffpmsg("couldn't find COMPRESSED_DATA column (fits_get_compressed_img_par)"); return(*status = DATA_DECOMPRESSION_ERR); } ffpmrk(); /* put mark on message stack; erase any messages after this */ tstatus = 0; ffgcno(infptr,CASEINSEN, "UNCOMPRESSED_DATA", &(infptr->Fptr)->cn_uncompressed, &tstatus); tstatus = 0; ffgcno(infptr,CASEINSEN, "GZIP_COMPRESSED_DATA", &(infptr->Fptr)->cn_gzip_data, &tstatus); tstatus = 0; if (ffgcno(infptr, CASEINSEN, "ZSCALE", &(infptr->Fptr)->cn_zscale, &tstatus) > 0) { /* CMPSCALE column doesn't exist; see if there is a keyword */ tstatus = 0; if (ffgky(infptr, TDOUBLE, "ZSCALE", &(infptr->Fptr)->zscale, NULL, &tstatus) <= 0) (infptr->Fptr)->cn_zscale = -1; /* flag for a constant ZSCALE */ } tstatus = 0; if (ffgcno(infptr, CASEINSEN, "ZZERO", &(infptr->Fptr)->cn_zzero, &tstatus) > 0) { /* CMPZERO column doesn't exist; see if there is a keyword */ tstatus = 0; if (ffgky(infptr, TDOUBLE, "ZZERO", &(infptr->Fptr)->zzero, NULL, &tstatus) <= 0) (infptr->Fptr)->cn_zzero = -1; /* flag for a constant ZZERO */ } tstatus = 0; if (ffgcno(infptr, CASEINSEN, "ZBLANK", &(infptr->Fptr)->cn_zblank, &tstatus) > 0) { /* ZBLANK column doesn't exist; see if there is a keyword */ tstatus = 0; if (ffgky(infptr, TINT, "ZBLANK", &(infptr->Fptr)->zblank, NULL, &tstatus) <= 0) { (infptr->Fptr)->cn_zblank = -1; /* flag for a constant ZBLANK */ } else { /* ZBLANK keyword doesn't exist; see if there is a BLANK keyword */ tstatus = 0; if (ffgky(infptr, TINT, "BLANK", &(infptr->Fptr)->zblank, NULL, &tstatus) <= 0) (infptr->Fptr)->cn_zblank = -1; /* flag for a constant ZBLANK */ } } /* read the conventional BSCALE and BZERO scaling keywords, if present */ tstatus = 0; if (ffgky (infptr, TDOUBLE, "BSCALE", &(infptr->Fptr)->cn_bscale, NULL, &tstatus) > 0) { (infptr->Fptr)->cn_bscale = 1.0; } tstatus = 0; if (ffgky (infptr, TDOUBLE, "BZERO", &(infptr->Fptr)->cn_bzero, NULL, &tstatus) > 0) { (infptr->Fptr)->cn_bzero = 0.0; (infptr->Fptr)->cn_actual_bzero = 0.0; } else { (infptr->Fptr)->cn_actual_bzero = (infptr->Fptr)->cn_bzero; } /* special case: the quantization level is not given by a keyword in */ /* the HDU header, so we have to explicitly copy the requested value */ /* to the actual value */ if ( (infptr->Fptr)->request_quantize_level != 0.) (infptr->Fptr)->quantize_level = (infptr->Fptr)->request_quantize_level; ffcmrk(); /* clear any spurious error messages, back to the mark */ return (*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xc8, %rsp movl $0x0, 0x4(%rsp) movl (%rsi), %eax testl %eax, %eax jg 0x8d2b7 movq %rsi, %rbx movq %rdi, %r14 leaq 0x3bff4(%rip), %rdx # 0xc9278 leaq 0x10(%rsp), %rcx movl $0x10, %esi xorl %r8d, %r8d movq %rbx, %r9 callq 0x6da65 testl %eax, %eax jle 0x8d2c9 leaq 0x4ebbd(%rip), %rdi # 0xdbe61 callq 0x37264 leaq 0x4ebe4(%rip), %rdi # 0xdbe94 callq 0x37264 movl (%rbx), %eax addq $0xc8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq 0x8(%r14), %rax movb $0x0, 0x480(%rax) movl $0x480, %edi # imm = 0x480 addq 0x8(%r14), %rdi leaq 0x10(%rsp), %r15 movl $0xb, %edx movq %r15, %rsi callq 0x60f0 movzbl (%r15), %eax cmpl $0x47, %eax je 0x8d374 cmpl $0x48, %eax je 0x8d347 cmpl $0x52, %eax jne 0x8d3a8 movl $0x45434952, %ecx # imm = 0x45434952 xorl 0x10(%rsp), %ecx movl $0x315f45, %edx # imm = 0x315F45 xorl 0x13(%rsp), %edx movl $0xb, %eax orl %ecx, %edx je 0x8d408 movabsq $0x454e4f5f45434952, %rcx # imm = 0x454E4F5F45434952 xorq 0x10(%rsp), %rcx movzbl 0x18(%rsp), %edx orq %rcx, %rdx jne 0x8d568 jmp 0x8d408 movabsq $0x534552504d4f4348, %rax # imm = 0x534552504D4F4348 xorq 0x10(%rsp), %rax movl 0x18(%rsp), %ecx xorq $0x315f53, %rcx # imm = 0x315F53 orq %rax, %rcx jne 0x8d568 movl $0x29, %eax jmp 0x8d408 movl $0x50495a47, %eax # imm = 0x50495A47 movl 0x10(%rsp), %ecx xorl %eax, %ecx movl $0x315f50, %edx # imm = 0x315F50 xorl 0x13(%rsp), %edx orl %ecx, %edx je 0x8d403 xorl 0x10(%rsp), %eax movl $0x325f50, %ecx # imm = 0x325F50 xorl 0x13(%rsp), %ecx orl %eax, %ecx jne 0x8d568 movl $0x16, %eax jmp 0x8d408 cmpb $0x42, %al sete %dl movq 0x10(%rsp), %rcx movabsq $0x315f3250495a42, %rax # imm = 0x315F3250495A42 cmpq %rax, %rcx sete %sil movl $0x33, %eax testb %sil, %dl jne 0x8d408 cmpb $0x4e, %cl je 0x8d541 movzbl %cl, %eax cmpl $0x50, %eax jne 0x8d568 movl $0x4f494c50, %eax # imm = 0x4F494C50 xorl 0x10(%rsp), %eax movl $0x315f4f, %ecx # imm = 0x315F4F xorl 0x13(%rsp), %ecx orl %eax, %ecx jne 0x8d568 movl $0x1f, %eax jmp 0x8d408 movl $0x15, %eax movq 0x8(%r14), %rcx movl %eax, 0x43c(%rcx) addq $0x48c, %rcx # imm = 0x48C leaq 0x49f87(%rip), %rdx # 0xd73a7 xorl %r15d, %r15d movq %r14, %rdi movl $0x1f, %esi xorl %r8d, %r8d movq %rbx, %r9 callq 0x6da65 testl %eax, %eax jle 0x8d446 leaq 0x4ea94(%rip), %rdi # 0xdbed5 jmp 0x8d2b0 movl %r15d, (%rsp) movl %r15d, 0xc(%rsp) movq 0x8(%r14), %rax cmpl %r15d, 0x48c(%rax) jns 0x8d4a2 leaq 0x4dd61(%rip), %rdx # 0xdb1c4 leaq 0x4(%rsp), %rcx movq %rsp, %r8 movq %r14, %rdi xorl %esi, %esi callq 0x3ac2d cmpl $0xdb, %eax jne 0x8d4a2 leaq 0x4dd3a(%rip), %rdx # 0xdb1bd leaq 0x4(%rsp), %rcx leaq 0xc(%rsp), %r8 movq %r14, %rdi xorl %esi, %esi callq 0x3ac2d cmpl $0xdb, %eax je 0x8d58e movq %rsp, %r9 movl $0x0, (%r9) leaq 0x4e036(%rip), %rdx # 0xdb4e9 leaq 0x10(%rsp), %rcx movq %r14, %rdi movl $0x10, %esi xorl %r8d, %r8d callq 0x6da65 testl %eax, %eax jle 0x8d4e0 movq 0x8(%r14), %rax movq $0x0, 0x470(%rax) jmp 0x8d627 movzbl 0x10(%rsp), %eax cmpl $0x53, %eax je 0x8d5a1 cmpl $0x4e, %eax jne 0x8d619 movl $0x454e4f4e, %eax # imm = 0x454E4F4E xorl 0x10(%rsp), %eax movzbl 0x14(%rsp), %ecx orl %eax, %ecx je 0x8d58e movabsq $0x45485449445f4f4e, %rax # imm = 0x45485449445F4F4E xorq 0x10(%rsp), %rax movzwl 0x18(%rsp), %ecx xorq $0x52, %rcx orq %rax, %rcx jne 0x8d619 movq 0x8(%r14), %rax movl $0xffffffff, 0x474(%rax) # imm = 0xFFFFFFFF jmp 0x8d627 movabsq $0x4552504d4f434f4e, %rax # imm = 0x4552504D4F434F4E xorq 0x10(%rsp), %rax movabsq $0x53534552504d4f, %rcx # imm = 0x53534552504D4F xorq 0x13(%rsp), %rcx orq %rax, %rcx je 0x8d8a3 leaq 0x4e946(%rip), %rdi # 0xdbeb5 callq 0x37264 leaq 0x10(%rsp), %rdi callq 0x37264 movl $0x19e, (%rbx) # imm = 0x19E movl $0x19e, %eax # imm = 0x19E jmp 0x8d2b7 movq 0x8(%r14), %rax movl $0x461c3c00, 0x470(%rax) # imm = 0x461C3C00 jmp 0x8d627 movdqa 0x10(%rsp), %xmm0 movdqu 0x15(%rsp), %xmm1 pcmpeqb 0x4d80b(%rip), %xmm1 # 0xdadc0 pcmpeqb 0x4d813(%rip), %xmm0 # 0xdadd0 pand %xmm1, %xmm0 pmovmskb %xmm0, %eax cmpl $0xffff, %eax # imm = 0xFFFF je 0x8d8ad movabsq $0x485449445f455649, %rax # imm = 0x485449445F455649 movabsq $0x5443415254425553, %rcx # imm = 0x5443415254425553 movq %rcx, %xmm0 movq %rax, %xmm1 punpcklqdq %xmm1, %xmm0 # xmm0 = xmm0[0],xmm1[0] movdqu 0x15(%rsp), %xmm1 pcmpeqb 0x10(%rsp), %xmm0 pcmpeqb 0x4d7da(%rip), %xmm1 # 0xdade0 pand %xmm0, %xmm1 pmovmskb %xmm1, %eax cmpl $0xffff, %eax # imm = 0xFFFF je 0x8d8d8 movq 0x8(%r14), %rax movl $0x0, 0x474(%rax) movq %rsp, %r9 movl $0x0, (%r9) leaq 0x4df93(%rip), %rdx # 0xdb5cb leaq 0x8(%rsp), %rcx movq %r14, %rdi movl $0x1f, %esi xorl %r8d, %r8d callq 0x6da65 movl $0x1, %edx testl %eax, %eax jg 0x8d65a movl 0x8(%rsp), %edx movq 0x8(%r14), %rcx movl %edx, 0x478(%rcx) addq $0x490, %rcx # imm = 0x490 leaq 0x4de06(%rip), %rdx # 0xdb478 movq %r14, %rdi movl $0x1f, %esi xorl %r8d, %r8d movq %rbx, %r9 callq 0x6da65 testl %eax, %eax jle 0x8d695 leaq 0x4e874(%rip), %rdi # 0xdbf04 jmp 0x8d2b0 movq 0x8(%r14), %rax movl 0x490(%rax), %eax testl %eax, %eax jle 0x8d6b1 cmpl $0x6, %eax jbe 0x8d6cd leaq 0x4e8ad(%rip), %rdi # 0xdbf5c jmp 0x8d6b8 leaq 0x4e87a(%rip), %rdi # 0xdbf32 callq 0x37264 movl $0xd4, (%rbx) movl $0xd4, %eax jmp 0x8d2b7 movl $0x1, %esi movl $0x440, %ebp # imm = 0x440 leaq 0x70(%rsp), %r15 xorl %r13d, %r13d movl $0x1, %edx movq %rdx, 0x60(%rsp) movq %rsi, 0x68(%rsp) leaq 0x1(%r13), %r12 movl $0x4b, %esi movq %r15, %rdi leaq 0x4dd9a(%rip), %rdx # 0xdb49b movl %r12d, %ecx xorl %eax, %eax callq 0x60b0 movq 0x8(%r14), %rax leaq (%rax,%rbp), %rcx addq $0x58, %rcx movq %r14, %rdi movl $0x29, %esi movq %r15, %rdx xorl %r8d, %r8d movq %rbx, %r9 callq 0x6da65 cmpl $0x0, (%rbx) jg 0x8d8c0 movl $0x4b, %esi movq %r15, %rdi leaq 0x4dd7d(%rip), %rdx # 0xdb4c2 movl %r12d, %ecx xorl %eax, %eax callq 0x60b0 movq 0x8(%r14), %rcx testq %r13, %r13 je 0x8d766 movq $0x1, 0x440(%rcx,%r13,8) jmp 0x8d774 movq 0x498(%rcx), %rax movq %rax, 0x440(%rcx) movl $0x0, (%rsp) addq %rbp, %rcx movq %r14, %rdi movl $0x29, %esi leaq 0x70(%rsp), %rdx xorl %r8d, %r8d movq %rsp, %r9 callq 0x6da65 movq 0x8(%r14), %r8 movq 0x440(%r8,%r13,8), %rcx testq %rcx, %rcx je 0x8d8cc movq 0x498(%r8,%r13,8), %rax decq %rax cqto idivq %rcx incq %rax movq 0x60(%rsp), %rdx imulq %rax, %rdx movq 0x68(%rsp), %rsi imulq %rcx, %rsi movslq 0x490(%r8), %rax addq $0x8, %rbp movq %r12, %r13 cmpq %rax, %r12 leaq 0x70(%rsp), %r15 jl 0x8d6e4 cmpq 0x3c0(%r8), %rdx jne 0x8d8eb movl 0x43c(%r8), %eax cmpl $0x29, %eax je 0x8d8f7 cmpl $0xb, %eax jne 0x8d9d5 movq %rsi, %r15 addq $0x51c, %r8 # imm = 0x51C leaq 0x4de4a(%rip), %rdx # 0xdb66d movq %r14, %rdi movl $0x1f, %esi movq %r8, %rcx xorl %r8d, %r8d movq %rbx, %r9 callq 0x6da65 testl %eax, %eax jg 0x8d922 movq %rsp, %r9 movl $0x0, (%r9) leaq 0x4de32(%rip), %rdx # 0xdb684 leaq 0x10(%rsp), %rcx movq %r14, %rdi movl $0x10, %esi xorl %r8d, %r8d callq 0x6da65 testl %eax, %eax jne 0x8d95e cmpb $0x4e, 0x10(%rsp) jne 0x8d95e movabsq $0x5449424553494f4e, %rax # imm = 0x5449424553494F4E xorq 0x10(%rsp), %rax movzbl 0x18(%rsp), %ecx orq %rax, %rcx movl $0x0, (%rsp) jne 0x8d965 jmp 0x8d98c movl $0xffffffff, %eax # imm = 0xFFFFFFFF jmp 0x8d408 movq 0x8(%r14), %rax movl $0x1, 0x474(%rax) jmp 0x8d627 leaq 0x4e6be(%rip), %rdi # 0xdbf85 jmp 0x8d2b0 leaq 0x4e6e1(%rip), %rdi # 0xdbfb4 jmp 0x8d579 movq 0x8(%r14), %rax movl $0x2, 0x474(%rax) jmp 0x8d627 leaq 0x4e6ee(%rip), %rdi # 0xdbfe0 jmp 0x8d579 movq %rsi, %r15 addq $0x524, %r8 # imm = 0x524 leaq 0x4dd65(%rip), %rdx # 0xdb66d movq %r14, %rdi movl $0x2a, %esi movq %r8, %rcx xorl %r8d, %r8d movq %rbx, %r9 callq 0x6da65 testl %eax, %eax jle 0x8d92e leaq 0x4e6f7(%rip), %rdi # 0xdc020 jmp 0x8d2b0 movq %rsp, %r9 movl $0x0, (%r9) movl $0x528, %ecx # imm = 0x528 addq 0x8(%r14), %rcx leaq 0x4dd6b(%rip), %rdx # 0xdb6b3 movq %r14, %rdi movl $0x1f, %esi xorl %r8d, %r8d callq 0x6da65 movq 0x8(%r14), %r8 jmp 0x8d9d2 movl $0x0, (%rsp) movl $0x520, %ecx # imm = 0x520 addq 0x8(%r14), %rcx leaq 0x4dd3e(%rip), %rdx # 0xdb6b3 movq %rsp, %r9 movq %r14, %rdi movl $0x1f, %esi xorl %r8d, %r8d callq 0x6da65 testl %eax, %eax jle 0x8d99d movq 0x8(%r14), %r8 movl $0x4, 0x520(%r8) jmp 0x8d9a1 movq 0x8(%r14), %r8 movl 0x51c(%r8), %eax cmpl $0xf, %eax jg 0x8d9d2 movq %r8, %rdx movl 0x520(%r8), %ecx cmpl $0x9, %ecx jl 0x8dbdf movl %ecx, (%rsp) movq %rdx, %r8 movl %eax, 0x520(%rdx) movl %ecx, 0x51c(%rdx) movq %r15, %rsi movq %rsi, 0x4c8(%r8) movl 0x43c(%r8), %edi movl 0x51c(%r8), %ecx movl %edi, %eax xorl $0xb, %eax orl %ecx, %eax jne 0x8d9ff leaq 0x4e65c(%rip), %rdi # 0xdc056 jmp 0x8d579 movl 0x48c(%r8), %edx movq %r8, %r15 callq 0x8360e cltq movq %rax, 0x4d0(%r15) addq $0x4d8, %r15 # imm = 0x4D8 leaq 0x4e042(%rip), %rdx # 0xdba67 xorl %ebp, %ebp movq %r14, %rdi xorl %esi, %esi movq %r15, %rcx movq %rbx, %r8 callq 0x3ac2d testl %eax, %eax jle 0x8da47 leaq 0x4e650(%rip), %rdi # 0xdc092 jmp 0x8d579 callq 0x37511 movq %rsp, %r15 movl %ebp, (%r15) movl $0x4dc, %ecx # imm = 0x4DC addq 0x8(%r14), %rcx leaq 0x4e003(%rip), %rdx # 0xdba65 movq %r14, %rdi xorl %esi, %esi movq %r15, %r8 callq 0x3ac2d movl %ebp, (%r15) movl $0x4e0, %ecx # imm = 0x4E0 addq 0x8(%r14), %rcx leaq 0x4df55(%rip), %rdx # 0xdb9d7 movq %r14, %rdi xorl %esi, %esi movq %r15, %r8 callq 0x3ac2d movl %ebp, (%r15) movl $0x4e4, %ecx # imm = 0x4E4 addq 0x8(%r14), %rcx leaq 0x4d71b(%rip), %rdx # 0xdb1bd movq %r14, %rdi xorl %esi, %esi movq %r15, %r8 callq 0x3ac2d movq 0x8(%r14), %rcx testl %eax, %eax jle 0x8daf1 movq %rsp, %r9 movl $0x0, (%r9) addq $0x4f0, %rcx # imm = 0x4F0 leaq 0x4d6ee(%rip), %rdx # 0xdb1bd movq %r14, %rdi movl $0x52, %esi xorl %r8d, %r8d callq 0x6da65 movq 0x8(%r14), %rcx testl %eax, %eax jg 0x8daf1 movl $0xffffffff, 0x4e4(%rcx) # imm = 0xFFFFFFFF movq %rsp, %r8 movl $0x0, (%r8) addq $0x4e8, %rcx # imm = 0x4E8 leaq 0x4d6bb(%rip), %rdx # 0xdb1c4 movq %r14, %rdi xorl %esi, %esi callq 0x3ac2d movq 0x8(%r14), %rcx testl %eax, %eax jle 0x8db55 movq %rsp, %r9 movl $0x0, (%r9) addq $0x4f8, %rcx # imm = 0x4F8 leaq 0x4d691(%rip), %rdx # 0xdb1c4 movq %r14, %rdi movl $0x52, %esi xorl %r8d, %r8d callq 0x6da65 movq 0x8(%r14), %rcx testl %eax, %eax jg 0x8db55 movl $0xffffffff, 0x4e8(%rcx) # imm = 0xFFFFFFFF movq %rsp, %r8 movl $0x0, (%r8) addq $0x4ec, %rcx # imm = 0x4EC leaq 0x4dc2a(%rip), %rdx # 0xdb797 movq %r14, %rdi xorl %esi, %esi callq 0x3ac2d movq 0x8(%r14), %rcx testl %eax, %eax jle 0x8dbf8 movq %rsp, %r9 movl $0x0, (%r9) addq $0x518, %rcx # imm = 0x518 leaq 0x4dc00(%rip), %rdx # 0xdb797 movq %r14, %rdi movl $0x1f, %esi xorl %r8d, %r8d callq 0x6da65 testl %eax, %eax jle 0x8dbea movq %rsp, %r9 movl $0x0, (%r9) movl $0x518, %ecx # imm = 0x518 addq 0x8(%r14), %rcx leaq 0x4dbd3(%rip), %rdx # 0xdb798 movq %r14, %rdi movl $0x1f, %esi xorl %r8d, %r8d callq 0x6da65 movq 0x8(%r14), %rcx testl %eax, %eax jg 0x8dbf8 jmp 0x8dbee movq %r15, %rsi movq %rdx, %r8 jmp 0x8d9d5 movq 0x8(%r14), %rcx movl $0xffffffff, 0x4ec(%rcx) # imm = 0xFFFFFFFF movq %rsp, %r9 movl $0x0, (%r9) addq $0x500, %rcx # imm = 0x500 leaq 0x3bba1(%rip), %rdx # 0xc97b1 movq %r14, %rdi movl $0x52, %esi xorl %r8d, %r8d callq 0x6da65 movq 0x8(%r14), %rcx testl %eax, %eax jle 0x8dc39 movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000 movq %rax, 0x500(%rcx) movq %rsp, %r9 movl $0x0, (%r9) movl $0x508, %r15d # imm = 0x508 addq %r15, %rcx leaq 0x3e4df(%rip), %rdx # 0xcc132 movq %r14, %rdi movl $0x52, %esi xorl %r8d, %r8d callq 0x6da65 movq 0x8(%r14), %rcx testl %eax, %eax jle 0x8dc79 addq %rcx, %r15 pxor %xmm0, %xmm0 movdqu %xmm0, (%r15) jmp 0x8dc89 movq 0x508(%rcx), %xmm0 movq %xmm0, 0x510(%rcx) movss 0x420(%rcx), %xmm0 pxor %xmm1, %xmm1 ucomiss %xmm1, %xmm0 jne 0x8dc9c jnp 0x8dca4 movss %xmm0, 0x470(%rcx) callq 0x37567 jmp 0x8d2b5
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
fits_unshuffle_8bytes
static int fits_unshuffle_8bytes(char *heap, LONGLONG length, int *status) /* unshuffle the bytes in an array of 8-byte integers or doubles */ { LONGLONG ii; char *ptr, *cptr, *heapptr; ptr = malloc((size_t) (length * 8)); heapptr = heap + (8 * length) - 1; cptr = ptr + (8 * length) -1; for (ii = 0; ii < length; ii++) { *cptr = *heapptr; cptr--; *cptr = *(heapptr - length); cptr--; *cptr = *(heapptr - (2 * length)); cptr--; *cptr = *(heapptr - (3 * length)); cptr--; *cptr = *(heapptr - (4 * length)); cptr--; *cptr = *(heapptr - (5 * length)); cptr--; *cptr = *(heapptr - (6 * length)); cptr--; *cptr = *(heapptr - (7 * length)); cptr--; heapptr--; } memcpy(heap, ptr, (size_t) (length * 8)); free(ptr); return(*status); }
pushq %r15 pushq %r14 pushq %r12 pushq %rbx pushq %rax movq %rsi, %r12 movq %rdi, %r14 leaq (,%rsi,8), %rbx movq %rbx, %rdi callq 0x61a0 movq %rax, %r15 testq %r12, %r12 jle 0x8de63 leaq (%r15,%rbx), %rax decq %rax negq %r12 leaq (%rbx,%r14), %rcx decq %rcx xorl %edx, %edx leaq (%rcx,%rdx), %rsi movb (%rcx,%rdx), %dil movb %dil, (%rax,%rdx,8) movb (%r12,%rsi), %dil addq %r12, %rsi movb %dil, -0x1(%rax,%rdx,8) movb (%r12,%rsi), %dil addq %r12, %rsi movb %dil, -0x2(%rax,%rdx,8) movb (%r12,%rsi), %dil addq %r12, %rsi movb %dil, -0x3(%rax,%rdx,8) movb (%r12,%rsi), %dil addq %r12, %rsi movb %dil, -0x4(%rax,%rdx,8) movb (%r12,%rsi), %dil addq %r12, %rsi movb %dil, -0x5(%rax,%rdx,8) movb (%r12,%rsi), %dil addq %r12, %rsi movb %dil, -0x6(%rax,%rdx,8) movb (%r12,%rsi), %sil movb %sil, -0x7(%rax,%rdx,8) decq %rdx cmpq %rdx, %r12 jne 0x8ddfe movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx callq 0x65c0 movq %r15, %rdi addq $0x8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 jmp 0x6260
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
unquantize_i2r8
static int unquantize_i2r8(long row, /* tile number = row number in table */ short *input, /* I - array of values to be converted */ long ntodo, /* I - number of elements in the array */ double scale, /* I - FITS TSCALn or BSCALE value */ double zero, /* I - FITS TZEROn or BZERO value */ int dither_method, /* I - dithering method to use */ int nullcheck, /* I - null checking code; 0 = don't check */ /* 1:set null pixels = nullval */ /* 2: if null pixel, set nullarray = 1 */ short tnull, /* I - value of FITS TNULLn keyword if any */ double nullval, /* I - set null pixels, if nullcheck = 1 */ char *nullarray, /* I - bad pixel array, if nullcheck = 2 */ int *anynull, /* O - set to 1 if any pixels are null */ double *output, /* O - array of converted pixels */ int *status) /* IO - error status */ /* Unquantize short integer values into the scaled floating point values */ { long ii; int nextrand, iseed; if (!fits_rand_value) if (fits_init_randoms()) return(MEMORY_ALLOCATION); /* initialize the index to the next random number in the list */ iseed = (int) ((row - 1) % N_RANDOM); nextrand = (int) (fits_rand_value[iseed] * 500); if (nullcheck == 0) /* no null checking required */ { for (ii = 0; ii < ntodo; ii++) { /* if (dither_method == SUBTRACTIVE_DITHER_2 && input[ii] == ZERO_VALUE) output[ii] = 0.0; else */ output[ii] = (double) (((double) input[ii] - fits_rand_value[nextrand] + 0.5) * scale + zero); nextrand++; if (nextrand == N_RANDOM) { iseed++; if (iseed == N_RANDOM) iseed = 0; nextrand = (int) (fits_rand_value[iseed] * 500); } } } else /* must check for null values */ { for (ii = 0; ii < ntodo; ii++) { if (input[ii] == tnull) { *anynull = 1; if (nullcheck == 1) output[ii] = nullval; else nullarray[ii] = 1; } else { /* if (dither_method == SUBTRACTIVE_DITHER_2 && input[ii] == ZERO_VALUE) output[ii] = 0.0; else */ output[ii] = (double) (((double) input[ii] - fits_rand_value[nextrand] + 0.5) * scale + zero); } nextrand++; if (nextrand == N_RANDOM) { iseed++; if (iseed == N_RANDOM) iseed = 0; nextrand = (int) (fits_rand_value[iseed] * 500); } } } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x18, %rsp movq %r9, %r12 movl %r8d, %ebp movl %ecx, %r13d movq %rdx, %rbx movq %rsi, %r14 movq %rdi, %r15 movq 0x171ae7(%rip), %rsi # 0x2001f0 testq %rsi, %rsi je 0x8e819 decq %r15 movabsq $0x346dc5d63886594b, %rcx # imm = 0x346DC5D63886594B movq %r15, %rax imulq %rcx movq %rdx, %rax shrq $0x3f, %rax sarq $0xb, %rdx addq %rax, %rdx imulq $0x2710, %rdx, %rax # imm = 0x2710 subq %rax, %r15 movss (%rsi,%r15,4), %xmm3 mulss 0x4c635(%rip), %xmm3 # 0xdad80 movq 0x58(%rsp), %rax cvttss2si %xmm3, %ecx testl %r13d, %r13d je 0x8e854 testq %rbx, %rbx jle 0x8e8ca movq 0x50(%rsp), %rdx xorl %esi, %esi movss 0x4c60b(%rip), %xmm5 # 0xdad80 movsd 0x45393(%rip), %xmm4 # 0xd3b10 xorl %edi, %edi movzwl (%r14,%rdi,2), %r8d cmpw %bp, %r8w jne 0x8e79d movl $0x1, (%rdx) cmpl $0x1, %r13d jne 0x8e7d3 movsd %xmm2, (%rax,%rdi,8) jmp 0x8e7d8 movswl %r8w, %r8d xorps %xmm6, %xmm6 cvtsi2sd %r8d, %xmm6 movq 0x171a40(%rip), %r8 # 0x2001f0 movslq %ecx, %r9 xorps %xmm3, %xmm3 cvtss2sd (%r8,%r9,4), %xmm3 subsd %xmm3, %xmm6 addsd %xmm4, %xmm6 mulsd %xmm0, %xmm6 addsd %xmm1, %xmm6 movsd %xmm6, (%rax,%rdi,8) jmp 0x8e7d8 movb $0x1, (%r12,%rdi) incl %ecx cmpl $0x2710, %ecx # imm = 0x2710 jne 0x8e808 incl %r15d cmpl $0x2710, %r15d # imm = 0x2710 cmovel %esi, %r15d movq 0x1719f9(%rip), %rcx # 0x2001f0 movslq %r15d, %r8 movss (%rcx,%r8,4), %xmm3 mulss %xmm5, %xmm3 cvttss2si %xmm3, %ecx incq %rdi cmpq %rdi, %rbx jne 0x8e77f jmp 0x8e8ca movsd %xmm1, 0x10(%rsp) movsd %xmm0, 0x8(%rsp) movsd %xmm2, (%rsp) callq 0x80fe8 movsd (%rsp), %xmm2 movsd 0x8(%rsp), %xmm0 movsd 0x10(%rsp), %xmm1 testl %eax, %eax jne 0x8e8ca movq 0x1719a1(%rip), %rsi # 0x2001f0 jmp 0x8e712 testq %rbx, %rbx jle 0x8e8ca xorl %edx, %edx movsd 0x452ad(%rip), %xmm5 # 0xd3b10 movss 0x4c515(%rip), %xmm4 # 0xdad80 xorl %edi, %edi movswl (%r14,%rdi,2), %r8d xorps %xmm2, %xmm2 cvtsi2sd %r8d, %xmm2 movslq %ecx, %rcx xorps %xmm3, %xmm3 cvtss2sd (%rsi,%rcx,4), %xmm3 subsd %xmm3, %xmm2 addsd %xmm5, %xmm2 mulsd %xmm0, %xmm2 addsd %xmm1, %xmm2 movsd %xmm2, (%rax,%rdi,8) incl %ecx cmpl $0x2710, %ecx # imm = 0x2710 jne 0x8e8c2 incl %r15d cmpl $0x2710, %r15d # imm = 0x2710 cmovel %edx, %r15d movslq %r15d, %rcx movss (%rsi,%rcx,4), %xmm2 mulss %xmm4, %xmm2 cvttss2si %xmm2, %ecx incq %rdi cmpq %rdi, %rbx jne 0x8e86d addq $0x18, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/imcompress.c
iraf2mem
int iraf2mem(char *filename, /* name of input file */ char **buffptr, /* O - memory pointer (initially NULL) */ size_t *buffsize, /* O - size of mem buffer, in bytes */ size_t *filesize, /* O - size of FITS file, in bytes */ int *status) /* IO - error status */ /* Driver routine that reads an IRAF image into memory, also converting it into FITS format. */ { char *irafheader; int lenirafhead; *buffptr = NULL; *buffsize = 0; *filesize = 0; /* read IRAF header into dynamically created char array (free it later!) */ irafheader = irafrdhead(filename, &lenirafhead); if (!irafheader) { return(*status = FILE_NOT_OPENED); } /* convert IRAF header to FITS header in memory */ iraftofits(filename, irafheader, lenirafhead, buffptr, buffsize, filesize, status); /* don't need the IRAF header any more */ free(irafheader); if (*status > 0) return(*status); *filesize = (((*filesize - 1) / 2880 ) + 1 ) * 2880; /* multiple of 2880 */ /* append the image data onto the FITS header */ irafrdimage(buffptr, buffsize, filesize, status); return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x268, %rsp # imm = 0x268 movq %r8, %rbp movq %rcx, %rbx movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %r14 xorl %eax, %eax movq %rax, (%rsi) movq %rax, (%rdx) movq %rax, (%rcx) leaq 0xec(%rsp), %rsi callq 0x91f47 testq %rax, %rax je 0x92541 movq %rax, %r13 movq %r14, 0x18(%rsp) movl 0xec(%rsp), %r14d movw $0x4e45, 0x110(%rsp) # imm = 0x4E45 movb $0x44, 0x112(%rsp) movdqa 0x4aaac(%rip), %xmm0 # 0xdcbc0 movdqu %xmm0, 0x113(%rsp) movdqu %xmm0, 0x123(%rsp) movdqu %xmm0, 0x133(%rsp) movdqu %xmm0, 0x143(%rsp) movdqu %xmm0, 0x150(%rsp) movb $0x0, 0x160(%rsp) movq %rax, %rdi callq 0x93bab testl %eax, %eax je 0x9254a movl %eax, %r9d movq %r12, 0x38(%rsp) leal -0x804(%r14), %ecx movq %r14, 0x28(%rsp) leal -0x7fe(%r14), %eax cmpl $0x2, %r9d movq %r15, %r8 setne 0x10(%rsp) movl $0x51, %edx movl $0xa2, %esi cmovel %edx, %esi cmovnel %ecx, %eax cltd idivl %esi leal (%rax,%rax,4), %eax shll $0x4, %eax movl %eax, %ecx addl $0x780, %ecx # imm = 0x780 movslq %ecx, %rcx imulq $-0x49f49f49, %rcx, %rcx # imm = 0xB60B60B7 shrq $0x20, %rcx addl %ecx, %eax addl $0x780, %eax # imm = 0x780 movl %eax, %ecx shrl $0x1f, %ecx sarl $0xb, %eax addl %ecx, %eax imull $0xb40, %eax, %r15d # imm = 0xB40 addl $0x3844, %r15d # imm = 0x3844 movslq %r15d, %rdi movq %r8, 0x100(%rsp) movq %rdi, (%r8) movl $0x1, %esi movl %r9d, %r12d callq 0x64a0 testq %rax, %rax je 0x9257d movq %rax, %r14 movq 0x38(%rsp), %rax movq %r14, (%rax) leaq 0x110(%rsp), %rsi movl $0x50, %edx movq %r14, %rdi callq 0x64e0 leaq 0x60(%rsp), %rdx movw $0x54, (%rdx) leaq 0x434a3(%rip), %rsi # 0xd56c6 movq %r14, %rdi callq 0x93fd8 leaq 0x10(%r13), %rax leaq 0xa(%r13), %rcx cmpl $0x2, %r12d cmoveq %rcx, %rax movb (%rax), %cl xorl %edx, %edx testb %cl, %cl setne %dl movl %edx, 0x175536(%rip) # 0x207780 cmpl $0x1, %r12d je 0x92291 xorl %edx, %edx xorl %esi, %esi testb %cl, %cl sete %dl setne %sil leaq (%rsi,%rsi,2), %rdi leaq (%rdx,%rdx,2), %rdx movzbl 0xe(%r13,%rdx), %r8d movq %r13, %rdx subq %rsi, %rdx movzbl 0x10(%rdx), %edx movzbl 0xf(%rsi,%r13), %esi movzbl 0xe(%r13,%rdi), %edi shll $0x18, %edi shll $0x10, %esi shll $0x8, %edx orl %r8d, %edx orl %esi, %edx orl %edi, %edx leaq 0x3(%rax), %rsi xorl %edi, %edi testb %cl, %cl setne %dil movq %rax, %r8 cmovneq %rsi, %r8 movl %edx, 0x175476(%rip) # 0x207720 cmovneq %rax, %rsi movzbl (%rsi), %edx movq %rax, %rcx subq %rdi, %rcx movzbl 0x2(%rcx), %ecx movzbl 0x1(%rdi,%rax), %esi movzbl (%r8), %eax shll $0x18, %eax shll $0x10, %esi shll $0x8, %ecx orl %edx, %ecx orl %esi, %ecx leal (%rax,%rcx), %edx addl $-0x2, %edx cmpl $0xb, %edx jae 0x92553 movl $0x63f, %esi # imm = 0x63F btl %edx, %esi jae 0x92553 movl %r12d, 0xc(%rsp) movq %rbx, 0x30(%rsp) movq %rbp, 0xe0(%rsp) xorl %eax, %eax movb 0x10(%rsp), %cl movb %cl, %al movq %rax, 0x50(%rsp) addl %eax, %eax leaq 0x12(%rax), %rbp movq %rax, 0x58(%rsp) leaq 0x16(%rax), %rbx movl %edx, %eax leaq 0x4a8c7(%rip), %rcx # 0xdcbec movl (%rcx,%rax,4), %ecx leaq 0x3d0f3(%rip), %rdx # 0xcf422 movl $0x0, 0x10(%rsp) leaq 0x60(%rsp), %r15 movl $0x1e, %esi movq %r15, %rdi xorl %eax, %eax callq 0x60b0 leaq 0x4338e(%rip), %r12 # 0xd56e0 movq %r14, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x93fd8 leaq 0x4ab51(%rip), %rdx # 0xdceb8 movq %r14, %rdi movq %r12, %rsi callq 0x93be7 cmpl $0x1, 0x175407(%rip) # 0x207780 leaq (%r13,%rbp), %rax leaq 0x1(%r13,%rbp), %rcx leaq 0x2(%r13,%rbp), %rdx leaq 0x3(%r13,%rbp), %rsi movq %rax, %rdi cmoveq %rsi, %rdi movq %rcx, %r8 cmoveq %rdx, %r8 cmoveq %rcx, %rdx cmoveq %rax, %rsi movzbl (%rsi), %eax movzbl (%rdx), %ebp movzbl (%r8), %ecx movzbl (%rdi), %edx shll $0x18, %edx shll $0x10, %ecx shll $0x8, %ebp orl %eax, %ebp orl %ecx, %ebp orl %edx, %ebp leaq 0x60(%rsp), %r15 movl $0x1e, %esi movq %r15, %rdi leaq 0x3d04f(%rip), %rdx # 0xcf422 movl %ebp, %ecx xorl %eax, %eax callq 0x60b0 leaq 0x43316(%rip), %r12 # 0xd56f9 movq %r14, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x93fd8 leaq 0x4aad5(%rip), %rdx # 0xdcecd movq %r14, %rdi movq %r12, %rsi callq 0x93be7 cmpl $0x1, 0x175376(%rip) # 0x207780 leaq (%r13,%rbx), %rsi leaq 0x1(%r13,%rbx), %rax leaq 0x2(%r13,%rbx), %rcx leaq 0x3(%r13,%rbx), %rdx movq %rsi, %rbx cmoveq %rdx, %rsi movq %rax, %rdi cmoveq %rcx, %rdi cmoveq %rax, %rcx cmoveq %rbx, %rdx movzbl (%rdx), %eax movzbl (%rcx), %ecx movzbl (%rdi), %edx movzbl (%rsi), %esi shll $0x18, %esi shll $0x10, %edx shll $0x8, %ecx orl %eax, %ecx orl %edx, %ecx orl %esi, %ecx leaq 0x60(%rsp), %r15 movl $0x1e, %esi movq %r15, %rdi leaq 0x3cfbf(%rip), %rdx # 0xcf422 xorl %eax, %eax callq 0x60b0 leaq 0x4a1b0(%rip), %r12 # 0xdc621 movq %r14, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x93fd8 leaq 0x4aa57(%rip), %rdx # 0xdcedd movq %r14, %rdi movq %r12, %rsi callq 0x93be7 cmpl $0x2, %ebp movl %ebp, 0xe8(%rsp) jl 0x925cd xorl %eax, %eax xorl %edx, %edx cmpl $0x1, 0x1752d4(%rip) # 0x207780 setne %al sete %dl leaq (%rdx,%rdx,2), %rsi leaq (%rax,%rax,2), %rax movzbl 0x4(%rbx,%rax), %eax movq %rbx, %rcx subq %rdx, %rcx movzbl 0x6(%rcx), %ecx movzbl 0x5(%rdx,%rbx), %edx movzbl 0x4(%rbx,%rsi), %esi shll $0x18, %esi shll $0x10, %edx shll $0x8, %ecx orl %eax, %ecx orl %edx, %ecx orl %esi, %ecx leaq 0x3cf39(%rip), %rdx # 0xcf422 leaq 0x60(%rsp), %r15 movl $0x1e, %esi movq %r15, %rdi xorl %eax, %eax callq 0x60b0 leaq 0x4a125(%rip), %r12 # 0xdc629 movq %r14, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x93fd8 leaq 0x4a9dd(%rip), %rdx # 0xdcef6 movq %r14, %rdi movq %r12, %rsi callq 0x93be7 cmpl $0x2, %ebp jne 0x925e1 movl $0x0, 0x10(%rsp) leaq 0x190(%r14), %rcx jmp 0x925d4 movl $0x68, (%rbp) jmp 0x925b4 leaq 0x4a8f9(%rip), %rdi # 0xdce4a jmp 0x92576 orl %eax, %ecx leaq 0x4a93d(%rip), %rdx # 0xdce99 leaq 0x210(%rsp), %rbx movl $0x51, %esi movq %rbx, %rdi xorl %eax, %eax callq 0x60b0 movq %rbx, %rdi callq 0x37264 jmp 0x9259b leaq 0x4a8e7(%rip), %rdx # 0xdce6b leaq 0x210(%rsp), %rdi movl $0x51, %esi movl %r15d, %ecx xorl %eax, %eax callq 0x60b0 movq 0x18(%rsp), %rdi callq 0x37264 movl $0x68, (%rbp) movq %r13, %rdi callq 0x6260 movl $0x68, %ebx movl %ebx, %eax addq $0x268, %rsp # imm = 0x268 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x140(%r14), %rcx movl $0x0, 0x20(%rsp) jmp 0x92714 xorl %eax, %eax xorl %edx, %edx cmpl $0x1, 0x175194(%rip) # 0x207780 setne %al sete %dl leaq (%rdx,%rdx,2), %rsi leaq (%rax,%rax,2), %rax movzbl 0x8(%rbx,%rax), %eax movq %rbx, %rcx subq %rdx, %rcx movzbl 0xa(%rcx), %ecx movzbl 0x9(%rdx,%rbx), %edx movzbl 0x8(%rbx,%rsi), %esi shll $0x18, %esi shll $0x10, %edx shll $0x8, %ecx orl %eax, %ecx orl %edx, %ecx orl %esi, %ecx leaq 0x3cdf9(%rip), %rdx # 0xcf422 leaq 0x60(%rsp), %r15 movl $0x1e, %esi movq %r15, %rdi xorl %eax, %eax callq 0x60b0 leaq 0x4a788(%rip), %r12 # 0xdcdcc movq %r14, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x93fd8 leaq 0x4a8b6(%rip), %rdx # 0xdcf0f movq %r14, %rdi movq %r12, %rsi callq 0x93be7 cmpl $0x4, %ebp jb 0x926ff xorl %eax, %eax xorl %edx, %edx cmpl $0x1, 0x175108(%rip) # 0x207780 setne %al sete %dl leaq (%rdx,%rdx,2), %rsi leaq (%rax,%rax,2), %rax movzbl 0xc(%rbx,%rax), %eax movq %rbx, %rcx subq %rdx, %rcx movzbl 0xe(%rcx), %ecx movzbl 0xd(%rdx,%rbx), %edx movzbl 0xc(%rbx,%rsi), %esi shll $0x18, %esi shll $0x10, %edx shll $0x8, %ecx orl %eax, %ecx orl %edx, %ecx orl %esi, %ecx leaq 0x3cd6d(%rip), %rdx # 0xcf422 leaq 0x60(%rsp), %r15 movl $0x1e, %esi movq %r15, %rdi xorl %eax, %eax callq 0x60b0 leaq 0x4a703(%rip), %r12 # 0xdcdd3 movq %r14, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x93fd8 leaq 0x4a843(%rip), %rdx # 0xdcf28 movq %r14, %rdi movq %r12, %rsi callq 0x93be7 leaq 0x230(%r14), %rcx movb $0x1, %al movl %eax, 0x10(%rsp) jmp 0x9270e movl $0x0, 0x10(%rsp) leaq 0x1e0(%r14), %rcx movb $0x1, %al movl %eax, 0x20(%rsp) movq %rcx, 0xf8(%rsp) cmpl $0x2, 0xc(%rsp) jne 0x92737 movq %r13, %rdi movl $0x27e, %esi # imm = 0x27E movl $0x17f, %edx # imm = 0x17F callq 0x93d5a jmp 0x92744 movq %r13, %rdi movl $0x2dc, %esi # imm = 0x2DC callq 0x93dcb movq %rax, %r15 movq 0x50(%rsp), %rax leal 0x32(,%rax,2), %ebx movq %r15, %rdi callq 0x6280 cmpl $0x7, %eax jg 0x9277f cltq leaq (%r15,%rax), %rdi movl $0x7, %edx subl %eax, %edx incq %rdx movl $0x20, %esi callq 0x6090 movb $0x0, 0x8(%r15) leaq 0x43d14(%rip), %r12 # 0xd649a movq %r14, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x93dff leaq 0x4a7a6(%rip), %rdx # 0xdcf41 movq %r14, %rdi movq %r12, %rsi callq 0x93be7 movq %r15, %rdi callq 0x6260 movl %ebx, %ebx cmpl $0x1, 0x174fc9(%rip) # 0x207780 leaq (%r13,%rbx), %r15 leaq 0x1(%r13,%rbx), %rax leaq 0x2(%r13,%rbx), %rcx leaq 0x3(%r13,%rbx), %rdx movq %r15, %rsi cmoveq %rdx, %rsi movq %rax, %rdi cmoveq %rcx, %rdi cmoveq %rax, %rcx cmoveq %r15, %rdx movzbl (%rdx), %eax movzbl (%rcx), %ecx movzbl (%rdi), %edx movzbl (%rsi), %esi shll $0x18, %esi shll $0x10, %edx shll $0x8, %ecx orl %eax, %ecx orl %edx, %ecx orl %esi, %ecx leaq 0x3cc1f(%rip), %rdx # 0xcf422 leaq 0x60(%rsp), %rbp movl $0x1e, %esi movq %rbp, %rdi xorl %eax, %eax callq 0x60b0 leaq 0x4a59e(%rip), %r12 # 0xdcdbc movq %r14, %rdi movq %r12, %rsi movq %rbp, %rdx callq 0x93fd8 leaq 0x4a71e(%rip), %rdx # 0xdcf51 movq %r14, %rdi movq %r12, %rsi callq 0x93be7 cmpl $0x2, 0xe8(%rsp) movq %r15, 0x50(%rsp) jl 0x928e8 xorl %eax, %eax xorl %edx, %edx cmpl $0x1, 0x174f24(%rip) # 0x207780 setne %al sete %dl leaq (%rdx,%rdx,2), %rsi leaq (%rax,%rax,2), %rax movzbl 0x4(%r15,%rax), %eax movq %r15, %rcx subq %rdx, %rcx movzbl 0x6(%rcx), %ecx movzbl 0x5(%rdx,%r15), %edx movzbl 0x4(%r15,%rsi), %esi shll $0x18, %esi shll $0x10, %edx shll $0x8, %ecx orl %eax, %ecx orl %edx, %ecx orl %esi, %ecx leaq 0x3cb86(%rip), %rdx # 0xcf422 leaq 0x60(%rsp), %r15 movl $0x1e, %esi movq %r15, %rdi xorl %eax, %eax callq 0x60b0 leaq 0x4a50d(%rip), %r12 # 0xdcdc4 movq %r14, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x93fd8 leaq 0x4a6a1(%rip), %rdx # 0xdcf6d movq %r14, %rdi movq %r12, %rsi callq 0x93be7 movq 0xf8(%rsp), %rbp addq $0xf0, %rbp jmp 0x928f7 movq 0xf8(%rsp), %rbp addq $0xa0, %rbp cmpb $0x0, 0x20(%rsp) je 0x9299b leaq (%rbx,%r13), %rax addq $0x9, %rax orq $0x8, %rbx leaq (%rbx,%r13), %rcx cmpl $0x1, 0x174e67(%rip) # 0x207780 leaq 0x2(%r13,%rbx), %rdx leaq 0x3(%r13,%rbx), %rsi movq %rcx, %rdi cmoveq %rsi, %rdi movq %rax, %r8 cmoveq %rdx, %r8 cmoveq %rax, %rdx cmovneq %rsi, %rcx movzbl (%rcx), %eax movzbl (%rdx), %ecx movzbl (%r8), %edx movzbl (%rdi), %esi shll $0x18, %esi shll $0x10, %edx shll $0x8, %ecx orl %eax, %ecx orl %edx, %ecx orl %esi, %ecx leaq 0x3cac6(%rip), %rdx # 0xcf422 leaq 0x60(%rsp), %r15 movl $0x1e, %esi movq %r15, %rdi xorl %eax, %eax callq 0x60b0 leaq 0x4a612(%rip), %r12 # 0xdcf89 movq %r14, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x93fd8 leaq 0x4a605(%rip), %rdx # 0xdcf91 movq %r14, %rdi movq %r12, %rsi callq 0x93be7 addq $0x50, %rbp movq 0x50(%rsp), %rdi cmpb $0x0, 0x10(%rsp) je 0x92a32 xorl %eax, %eax xorl %edx, %edx cmpl $0x1, 0x174dca(%rip) # 0x207780 setne %al sete %dl leaq (%rdx,%rdx,2), %rsi leaq (%rax,%rax,2), %rax movzbl 0xc(%rdi,%rax), %eax movq %rdi, %rcx subq %rdx, %rcx movzbl 0xe(%rcx), %ecx movzbl 0xd(%rdx,%rdi), %edx movzbl 0xc(%rdi,%rsi), %esi shll $0x18, %esi shll $0x10, %edx shll $0x8, %ecx orl %eax, %ecx orl %edx, %ecx orl %esi, %ecx leaq 0x3ca2f(%rip), %rdx # 0xcf422 leaq 0x60(%rsp), %r15 movl $0x1e, %esi movq %r15, %rdi xorl %eax, %eax callq 0x60b0 leaq 0x4a59f(%rip), %r12 # 0xdcfad movq %r14, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x93fd8 leaq 0x4a592(%rip), %rdx # 0xdcfb5 movq %r14, %rdi movq %r12, %rsi callq 0x93be7 addq $0x50, %rbp movq 0x58(%rsp), %r12 leaq 0x4a593(%rip), %r15 # 0xdcfd1 movq %r14, %rdi movq %r15, %rsi movq 0x18(%rsp), %rdx callq 0x93dff leaq 0x4a584(%rip), %rdx # 0xdcfd9 movq %r14, %rdi movq %r15, %rsi callq 0x93be7 cmpl $0x2, 0xc(%rsp) jne 0x92a7b movq %r13, %rdi movl $0x7e, %esi movl $0xff, %edx callq 0x93d5a jmp 0x92a88 movq %r13, %rdi movl $0x19c, %esi # imm = 0x19C callq 0x93dcb movq %rax, %r15 cmpb $0x48, (%rax) jne 0x92abe cmpb $0x44, 0x1(%r15) jne 0x92abe cmpb $0x52, 0x2(%r15) jne 0x92abe movq %r15, %rdi movq 0x18(%rsp), %rsi callq 0x93e5f testq %rax, %rax je 0x92abe movq %rax, %rbx movq %r15, %rdi callq 0x6260 movq %rbx, %r15 addq $0x56, %r12 movq %r15, %rdi movl $0x2f, %esi callq 0x63c0 testq %rax, %rax movq %r14, 0x10(%rsp) jne 0x92b0b movq %r15, %rdi movl $0x24, %esi callq 0x63c0 testq %rax, %rax jne 0x92b0b movq %r15, %rdi movq 0x18(%rsp), %rsi callq 0x93e5f testq %rax, %rax je 0x92b0b movq %rax, %r14 movq %r15, %rdi callq 0x6260 movq %r14, %r15 movq %r15, %rdi movl $0x21, %esi callq 0x63c0 leaq 0x1(%rax), %rdx testq %rax, %rax cmoveq %r15, %rdx leaq 0x4a1e4(%rip), %r14 # 0xdcd0e movq 0x10(%rsp), %rbx movq %rbx, %rdi movq %r14, %rsi callq 0x93dff movq %r15, %rdi callq 0x6260 leaq 0x4a4a6(%rip), %rdx # 0xdcfef movq %rbx, %rdi movq %r14, %rsi callq 0x93be7 cmpl $0x1, 0x174c25(%rip) # 0x207780 leaq (%r13,%r12), %rax leaq 0x1(%r13,%r12), %rcx leaq 0x2(%r13,%r12), %rdx leaq 0x3(%r13,%r12), %rsi movq %rax, %rdi cmoveq %rsi, %rdi movq %rcx, %r8 cmoveq %rdx, %r8 cmoveq %rcx, %rdx cmovneq %rsi, %rax movzbl (%rax), %eax movzbl (%rdx), %ecx movzbl (%r8), %edx movzbl (%rdi), %esi shll $0x19, %esi shll $0x11, %edx shll $0x9, %ecx leal (%rcx,%rax,2), %eax orl %edx, %eax leal (%rsi,%rax), %ecx addl $-0x2, %ecx leaq 0x3c875(%rip), %r14 # 0xcf422 leaq 0x60(%rsp), %r15 movl $0x1e, %esi movq %r15, %rdi movq %r14, %rdx xorl %eax, %eax callq 0x60b0 leaq 0x4a14b(%rip), %r12 # 0xdcd16 movq %rbx, %rdi movq %r12, %rsi movq %r15, %rdx callq 0x93fd8 leaq 0x4a424(%rip), %rdx # 0xdd004 movq %rbx, %rdi movq %r12, %rsi callq 0x93be7 leaq 0x60(%rsp), %r15 movl $0x1e, %esi movq %r15, %rdi movq %r14, %rdx movl 0xc(%rsp), %ecx xorl %eax, %eax callq 0x60b0 leaq 0x4a41f(%rip), %r14 # 0xdd02c movq %rbx, %rdi movq %r14, %rsi movq %r15, %rdx callq 0x93fd8 leaq 0x4a411(%rip), %rdx # 0xdd033 movq %rbx, %rdi movq %r14, %rsi callq 0x93be7 cmpl $0x0, 0x174aec(%rip) # 0x207720 je 0x92c42 leaq 0x60(%rsp), %rdx movw $0x54, (%rdx) jmp 0x92c4c leaq 0x60(%rsp), %rdx movw $0x46, (%rdx) leaq 0x4a402(%rip), %rsi # 0xdd055 movq %rbx, %rdi callq 0x93fd8 leaq 0x4a3f3(%rip), %rsi # 0xdd055 leaq 0x4a3f4(%rip), %rdx # 0xdd05d movq %rbx, %rdi callq 0x93be7 movq %rbp, %rdi addq $0x190, %rdi # imm = 0x190 cmpl $0x2, 0xc(%rsp) jne 0x92e03 movdqa 0x49f32(%rip), %xmm0 # 0xdcbc0 movdqa %xmm0, 0xc0(%rsp) movdqa %xmm0, 0xb0(%rsp) movdqa %xmm0, 0xa0(%rsp) movdqa %xmm0, 0x90(%rsp) movdqa %xmm0, 0x80(%rsp) movq 0x28(%rsp), %rbp cmpl $0x7ff, %ebp # imm = 0x7FF jl 0x92f91 xorl %eax, %eax movl $0x7fe, %r14d # imm = 0x7FE movl $0x454a424f, %r15d # imm = 0x454A424F movl $0x20544345, %r12d # imm = 0x20544345 movzbl (%r13,%r14), %ebx cmpl $0xa, %ebx je 0x92d85 testl %ebx, %ebx je 0x92f91 cmpl $0x51, %eax jl 0x92d6f movl 0x80(%rsp), %ecx xorl %r15d, %ecx movl 0x83(%rsp), %edx xorl %r12d, %edx orl %ecx, %edx je 0x92d3a movl $0x50, %edx movq %rdi, %rbp leaq 0x80(%rsp), %rsi callq 0x64e0 movq %rbp, %rdi movq 0x28(%rsp), %rbp addq $0x50, %rdi movl $0x9, %eax movdqa 0x49e7e(%rip), %xmm0 # 0xdcbc0 movdqa %xmm0, 0xc0(%rsp) movdqa %xmm0, 0xb0(%rsp) movdqa %xmm0, 0xa0(%rsp) movdqa %xmm0, 0x90(%rsp) movdqa %xmm0, 0x80(%rsp) leal -0x21(%rbx), %ecx cmpb $0x5d, %cl ja 0x92d81 movslq %eax, %rcx movb %bl, 0x80(%rsp,%rcx) incl %eax jmp 0x92df2 movl $0x50, %edx movq %rdi, %rbx leaq 0x80(%rsp), %rsi callq 0x64e0 movq %rbx, %rdi movl 0x80(%rsp), %eax xorl %r15d, %eax movl 0x83(%rsp), %ecx xorl %r12d, %ecx leaq 0x50(%rbx), %rdx orl %eax, %ecx movdqa 0x49e01(%rip), %xmm0 # 0xdcbc0 movdqa %xmm0, 0x90(%rsp) movdqa %xmm0, 0xa0(%rsp) movdqa %xmm0, 0xb0(%rsp) movdqa %xmm0, 0xc0(%rsp) movdqa %xmm0, 0x80(%rsp) cmovneq %rdx, %rdi xorl %eax, %eax incq %r14 cmpq %r14, %rbp jne 0x92ce0 jmp 0x92f91 movl 0x174977(%rip), %eax # 0x207780 movdqa 0x49daf(%rip), %xmm0 # 0xdcbc0 movdqa %xmm0, 0x80(%rsp) movdqa %xmm0, 0x90(%rsp) movdqa %xmm0, 0xa0(%rsp) movdqa %xmm0, 0xb0(%rsp) movdqa %xmm0, 0xc0(%rsp) movq 0x28(%rsp), %rbp cmpl $0x805, %ebp # imm = 0x805 jl 0x92f91 xorl %ecx, %ecx cmpl $0x1, %eax setne %cl movq %r13, %r14 addq %rcx, %r14 xorl %eax, %eax movl $0x804, %r15d # imm = 0x804 movl $0x20544345, %ebx # imm = 0x20544345 movzbl (%r14,%r15), %r12d cmpl $0xa, %r12d je 0x92f16 testl %r12d, %r12d je 0x92f91 cmpl $0x51, %eax jl 0x92efd movl 0x80(%rsp), %ecx movl $0x454a424f, %edx # imm = 0x454A424F xorl %edx, %ecx movl 0x83(%rsp), %edx xorl %ebx, %edx orl %ecx, %edx je 0x92ec8 movl $0x50, %edx movq %rdi, %rbp leaq 0x80(%rsp), %rsi callq 0x64e0 movq %rbp, %rdi movq 0x28(%rsp), %rbp addq $0x50, %rdi movl $0x9, %eax movdqa 0x49cf0(%rip), %xmm0 # 0xdcbc0 movdqa %xmm0, 0xc0(%rsp) movdqa %xmm0, 0xb0(%rsp) movdqa %xmm0, 0xa0(%rsp) movdqa %xmm0, 0x90(%rsp) movdqa %xmm0, 0x80(%rsp) leal -0x21(%r12), %ecx cmpb $0x5d, %cl ja 0x92f12 movslq %eax, %rcx movb %r12b, 0x80(%rsp,%rcx) incl %eax jmp 0x92f84 movl 0x80(%rsp), %eax movl $0x454a424f, %ecx # imm = 0x454A424F xorl %ecx, %eax movl 0x83(%rsp), %ecx xorl %ebx, %ecx orl %eax, %ecx je 0x92f4d movl $0x50, %edx movq %rdi, %r12 leaq 0x80(%rsp), %rsi callq 0x64e0 movq %r12, %rdi addq $0x50, %rdi movdqa 0x49c6b(%rip), %xmm0 # 0xdcbc0 movdqa %xmm0, 0xc0(%rsp) movdqa %xmm0, 0xb0(%rsp) movdqa %xmm0, 0xa0(%rsp) movdqa %xmm0, 0x90(%rsp) movdqa %xmm0, 0x80(%rsp) xorl %eax, %eax addq $0x2, %r15 cmpl %r15d, %ebp jg 0x92e6a leaq 0x110(%rsp), %r14 movl $0x50, %edx movq %r14, %rsi callq 0x64e0 leaq 0x4913a(%rip), %rsi # 0xdc0e7 movq 0x10(%rsp), %r15 movq %r15, %rdi callq 0x93969 movq %rax, %rbx movq 0x100(%rsp), %rax movq (%rax), %rax movabsq $0x2d82d82d82d82d83, %r12 # imm = 0x2D82D82D82D82D83 mulq %r12 addq $0x50, %rbx shrq $0x9, %rdx imull $0xb40, %edx, %eax # imm = 0xB40 movslq %eax, %rbp addq %r15, %rbp movq %rbx, %rax subq %r15, %rax movq 0x30(%rsp), %rcx movq %rax, (%rcx) movb $0x20, 0x2(%r14) movw $0x2020, (%r14) # imm = 0x2020 cmpq %rbp, %rbx jae 0x93028 leaq 0x110(%rsp), %r15 movl $0x50, %edx movq %rbx, %rdi movq %r15, %rsi callq 0x64e0 addq $0x50, %rbx cmpq %rbp, %rbx jb 0x9300f movq 0xe0(%rsp), %rax movl (%rax), %ebx movq %r13, %rdi callq 0x6260 testl %ebx, %ebx jg 0x925b9 movq 0x30(%rsp), %rcx movq (%rcx), %rax decq %rax mulq %r12 shrq $0x9, %rdx imulq $0xb40, %rdx, %rax # imm = 0xB40 addq $0xb40, %rax # imm = 0xB40 movq %rax, (%rcx) movl $0x1, %eax movl %eax, 0x210(%rsp) movl %eax, 0x60(%rsp) movl %eax, 0x24(%rsp) movl %eax, 0x4c(%rsp) movl %eax, 0xf4(%rsp) movl %eax, 0x48(%rsp) movl $0x0, 0x44(%rsp) movq 0x38(%rsp), %rax movq (%rax), %rbp leaq 0x49c70(%rip), %rsi # 0xdcd0e movq %rbp, %rdi callq 0x936ae testq %rax, %rax je 0x930ef movq %rax, %rbx movq %rax, %rdi callq 0x6280 cmpl $0xfe, %eax jg 0x930cf leaq 0x110(%rsp), %rdi movq %rbx, %rsi callq 0x6460 jmp 0x930ef leaq 0x110(%rsp), %r15 movl $0xfe, %edx movq %r15, %rdi movq %rbx, %rsi callq 0x64e0 movb $0x0, 0xfe(%r15) leaq 0x49c20(%rip), %rsi # 0xdcd16 leaq 0x44(%rsp), %rdx movq %rbp, %rdi callq 0x9361b movq %r14, %rdi movl $0x21, %esi callq 0x63c0 leaq 0x1(%rax), %rdi testq %rax, %rax cmoveq %r14, %rdi leaq 0x3a718(%rip), %rsi # 0xcd83a callq 0x6510 testq %rax, %rax je 0x9318b movq %rax, %r14 movslq 0x44(%rsp), %rbx movl $0x1, %esi movq %rbx, %rdi callq 0x64a0 testq %rax, %rax je 0x931a6 movq %rax, %r15 movl $0x1, %esi movq %rax, %rdi movq %rbx, %rdx movq %r14, %rcx callq 0x63d0 cmpl %eax, %ebx jle 0x931c1 leaq 0x49c10(%rip), %rdx # 0xdcd77 leaq 0x80(%rsp), %rbx movl $0x51, %esi movq %rbx, %rdi movl %eax, %ecx movl $0x400, %r8d # imm = 0x400 xorl %eax, %eax callq 0x60b0 movq %rbx, %rdi jmp 0x93200 leaq 0x49b8b(%rip), %rdi # 0xdcd1d callq 0x37264 leaq 0x110(%rsp), %rdi callq 0x37264 jmp 0x93215 leaq 0x49b99(%rip), %rdi # 0xdcd46 callq 0x37264 leaq 0x110(%rsp), %rdi callq 0x37264 jmp 0x9320d leaq 0x49c42(%rip), %rsi # 0xdce0a movq %r15, %rdi callq 0x93b0c testl %eax, %eax je 0x93232 leaq 0x49c35(%rip), %rsi # 0xdce10 movl $0x5, %edx movq %r15, %rdi callq 0x6190 testl %eax, %eax je 0x93232 leaq 0x49ba9(%rip), %rdi # 0xdcd9c callq 0x37264 leaq 0x110(%rsp), %rdi callq 0x37264 movq %r15, %rdi callq 0x6260 movq %r14, %rdi callq 0x64c0 movq 0xe0(%rsp), %rax movl $0x68, (%rax) movq 0xe0(%rsp), %rax movl (%rax), %ebx jmp 0x925b9 movq %r15, %rdi callq 0x6260 leaq 0x424b8(%rip), %rsi # 0xd56f9 leaq 0x210(%rsp), %rbx movq %rbp, %rdi movq %rbx, %rdx callq 0x9361b leaq 0x493c6(%rip), %rsi # 0xdc621 leaq 0x60(%rsp), %rdx movq %rbp, %rdi callq 0x9361b leaq 0x49b4d(%rip), %rsi # 0xdcdbc leaq 0x48(%rsp), %rdx movq %rbp, %rdi callq 0x9361b movl (%rbx), %ebx cmpl $0x2, %ebx movq %r14, 0x18(%rsp) jl 0x932bc leaq 0x4939a(%rip), %rsi # 0xdc629 leaq 0x24(%rsp), %rdx movq %rbp, %rdi callq 0x9361b leaq 0x49b21(%rip), %rsi # 0xdcdc4 leaq 0x10c(%rsp), %rdx movq %rbp, %rdi callq 0x9361b cmpl $0x2, %ebx jne 0x933d6 movl $0x1, %r14d leaq 0x42417(%rip), %rsi # 0xd56e0 leaq 0xf0(%rsp), %rbx movq %rbp, %rdi movq %rbx, %rdx callq 0x9361b movl (%rbx), %eax movl %eax, %r15d negl %r15d cmovsl %eax, %r15d shrl $0x3, %r15d movl 0x60(%rsp), %ecx movl 0x24(%rsp), %esi movl 0x4c(%rsp), %edi movl %r15d, %r13d imull %ecx, %r13d imull %esi, %r14d imull %edi, %r14d imull %r13d, %r14d movl %r14d, 0x10(%rsp) movslq %r14d, %r8 movq 0x30(%rsp), %rax movq (%rax), %rax addq %r8, %rax decq %rax mulq %r12 shrq $0x9, %rdx imulq $0xb40, %rdx, %rbx # imm = 0xB40 addq $0xb40, %rbx # imm = 0xB40 movq 0x100(%rsp), %r14 cmpq (%r14), %rbx movq 0x38(%rsp), %r12 movq %r8, 0x28(%rsp) jbe 0x9337e movl %edi, 0x58(%rsp) movq (%r12), %rdi movl %esi, 0xc(%rsp) movq %rbx, %rsi movl %ecx, %ebp callq 0x6658 movl %ebp, %ecx movl 0x58(%rsp), %edi movl 0xc(%rsp), %esi movq 0x28(%rsp), %r8 movq %rax, %rbp testq %rax, %rax je 0x93524 movq %rbp, (%r12) movq %rbx, (%r14) movq 0x30(%rsp), %rax addq (%rax), %rbp movq %rbx, (%rax) movl 0x48(%rsp), %eax subl %ecx, %eax movq %rbp, 0x38(%rsp) jne 0x933bd movl $0x1, %esi movq %rbp, %rdi movq %r8, %rdx movq 0x18(%rsp), %rbp movq %rbp, %rcx callq 0x63d0 movq %rax, %r12 jmp 0x9346e cmpl $0x1, %esi sete %cl cmpl $0x2, %edi setge %dl andb %cl, %dl cmpb $0x1, %dl jne 0x9341b movl %edi, 0x24(%rsp) jmp 0x93423 leaq 0x499ef(%rip), %rsi # 0xdcdcc leaq 0x4c(%rsp), %rdx movq %rbp, %rdi callq 0x9361b cmpl $0x4, %ebx movl $0x1, %r14d jb 0x932c2 leaq 0x499d3(%rip), %rsi # 0xdcdd3 leaq 0xf4(%rsp), %rbx movq %rbp, %rdi movq %rbx, %rdx callq 0x9361b movl (%rbx), %r14d jmp 0x932c2 testl %esi, %esi jle 0x93568 imull %r15d, %eax movslq %r13d, %r13 movslq %eax, %r15 xorl %r14d, %r14d movq %rbp, %rbx xorl %r12d, %r12d movq 0x18(%rsp), %rbp movl $0x1, %esi movq %rbx, %rdi movq %r13, %rdx movq %rbp, %rcx callq 0x63d0 addl %eax, %r12d movq %rbp, %rdi movq %r15, %rsi movl $0x1, %edx callq 0x6130 addq %r13, %rbx incl %r14d cmpl 0x24(%rsp), %r14d jl 0x9343b movq %rbp, %rdi callq 0x64c0 movl 0x10(%rsp), %r8d cmpl %r8d, %r12d jge 0x934a9 leaq 0x498f0(%rip), %rdx # 0xdcd77 leaq 0x80(%rsp), %rbx movl $0x51, %esi movq %rbx, %rdi movl %r12d, %ecx xorl %eax, %eax callq 0x60b0 movq %rbx, %rdi jmp 0x93192 cmpl $0x0, 0x174270(%rip) # 0x207720 movq 0x38(%rsp), %rdx movq 0x28(%rsp), %rsi je 0x93223 movl 0xf0(%rsp), %eax addl $0x40, %eax roll $0x1c, %eax cmpl $0x6, %eax ja 0x93223 leaq 0x496f3(%rip), %rcx # 0xdcbd0 movslq (%rcx,%rax,4), %rax addq %rcx, %rax jmpq *%rax cmpl $0x8, %r8d jl 0x93223 addq %rdx, %rsi pxor %xmm0, %xmm0 movq (%rdx), %xmm1 punpcklbw %xmm0, %xmm1 # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7] pshufd $0x4e, %xmm1, %xmm1 # xmm1 = xmm1[2,3,0,1] pshuflw $0x1b, %xmm1, %xmm1 # xmm1 = xmm1[3,2,1,0,4,5,6,7] pshufhw $0x1b, %xmm1, %xmm1 # xmm1 = xmm1[0,1,2,3,7,6,5,4] packuswb %xmm1, %xmm1 movq %xmm1, (%rdx) addq $0x8, %rdx cmpq %rsi, %rdx jb 0x934f7 jmp 0x93223 movq 0x30(%rsp), %rax movl (%rax), %ecx leaq 0x498a8(%rip), %rdx # 0xdcdda leaq 0x80(%rsp), %rbx movl $0x51, %esi movq %rbx, %rdi xorl %eax, %eax callq 0x60b0 movq %rbx, %rdi callq 0x37264 leaq 0x110(%rsp), %rdi callq 0x37264 movq 0x18(%rsp), %rdi jmp 0x93210 xorl %r12d, %r12d movq 0x18(%rsp), %rbp jmp 0x9346e cmpl $0x2, %r8d jl 0x93223 addq %rdx, %rsi rolw $0x8, (%rdx) addq $0x2, %rdx cmpq %rsi, %rdx jb 0x93582 jmp 0x93223 cmpl $0x4, %r8d jl 0x93223 addq %rdx, %rsi pxor %xmm0, %xmm0 movd (%rdx), %xmm1 punpcklbw %xmm0, %xmm1 # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7] pshuflw $0x1b, %xmm1, %xmm1 # xmm1 = xmm1[3,2,1,0,4,5,6,7] packuswb %xmm1, %xmm1 movd %xmm1, (%rdx) addq $0x4, %rdx cmpq %rsi, %rdx jb 0x935a5 jmp 0x93223 cmpl $0x2, %r8d jl 0x93223 addq %rdx, %rsi rolw $0x8, (%rdx) addq $0x2, %rdx cmpq %rsi, %rdx jb 0x935d5 jmp 0x93223 cmpl $0x4, %r8d jl 0x93223 addq %rdx, %rsi pxor %xmm0, %xmm0 movd (%rdx), %xmm1 punpcklbw %xmm0, %xmm1 # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7] pshuflw $0x1b, %xmm1, %xmm1 # xmm1 = xmm1[3,2,1,0,4,5,6,7] packuswb %xmm1, %xmm1 movd %xmm1, (%rdx) addq $0x4, %rdx cmpq %rsi, %rdx jb 0x935f8 jmp 0x93223
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/iraffits.c
irafncmp
static int irafncmp ( char *irafheader, /* IRAF image header from file */ char *teststring, /* C character string to compare */ int nc) /* Number of characters to compate */ { char *line; if ((line = iraf2str (irafheader, nc)) == NULL) return (1); if (strncmp (line, teststring, nc) == 0) { free (line); return (0); } else { free (line); return (1); } }
pushq %rbp pushq %r14 pushq %rbx movq %rsi, %r14 movl $0x5, %esi callq 0x93b53 testq %rax, %rax je 0x93b47 movq %rax, %rbx movl $0x5, %edx movq %rax, %rdi movq %r14, %rsi callq 0x6190 xorl %ebp, %ebp testl %eax, %eax setne %bpl movq %rbx, %rdi callq 0x6260 jmp 0x93b4c movl $0x1, %ebp movl %ebp, %eax popq %rbx popq %r14 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/iraffits.c
iraf2str
static char *iraf2str ( char *irafstring, /* IRAF 2-byte/character string */ int nchar) /* Number of characters in string */ { char *string; int i, j; string = (char *) calloc (nchar+1, 1); if (string == NULL) { ffpmsg("IRAF2STR Cannot allocate memory for string variable"); return (NULL); } /* the chars are in bytes 1, 3, 5, ... if bigendian format (SUN) */ /* else in bytes 0, 2, 4, ... if little endian format (Alpha) */ if (irafstring[0] != 0) j = 0; else j = 1; /* Convert appropriate byte of input to output character */ for (i = 0; i < nchar; i++) { string[i] = irafstring[j]; j = j + 2; } return (string); }
pushq %r15 pushq %r14 pushq %rbx movl %esi, %r15d movq %rdi, %rbx leal 0x1(%r15), %edi movl $0x1, %esi callq 0x64a0 movq %rax, %r14 testq %rax, %rax je 0x93b96 testl %r15d, %r15d jle 0x93ba2 cmpb $0x1, (%rbx) movl %r15d, %eax adcq $0x0, %rbx xorl %ecx, %ecx movb (%rbx,%rcx,2), %dl movb %dl, (%r14,%rcx) incq %rcx cmpq %rcx, %rax jne 0x93b85 jmp 0x93ba2 leaq 0x49279(%rip), %rdi # 0xdce16 callq 0x37264 movq %r14, %rax popq %rbx popq %r14 popq %r15 retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/iraffits.c
hputc
static void hputc (hstring,keyword,value) char *hstring; char *keyword; char *value; /* character string containing the value for variable keyword. trailing and leading blanks are removed. */ { char squot = 39; char line[100]; char newcom[50]; char blank[80]; char *v, *vp, *v1, *v2, *q1, *q2, *c1, *ve; int lkeyword, lcom, lval, lc, i; for (i = 0; i < 80; i++) blank[i] = ' '; /* find length of keyword and value */ lkeyword = strlen (keyword); lval = strlen (value); /* If COMMENT or HISTORY, always add it just before the END */ if (lkeyword == 7 && (strncmp (keyword,"COMMENT",7) == 0 || strncmp (keyword,"HISTORY",7) == 0)) { /* Find end of header */ v1 = ksearch (hstring,"END"); v2 = v1 + 80; /* Move END down one line */ strncpy (v2, v1, 80); /* Insert keyword */ strncpy (v1,keyword,7); /* Pad with spaces */ for (vp = v1+lkeyword; vp < v2; vp++) *vp = ' '; /* Insert comment */ strncpy (v1+9,value,lval); return; } /* Otherwise search for keyword */ else v1 = ksearch (hstring,keyword); /* If parameter is not found, find a place to put it */ if (v1 == NULL) { /* First look for blank lines before END */ v1 = blsearch (hstring, "END"); /* Otherwise, create a space for it at the end of the header */ if (v1 == NULL) { ve = ksearch (hstring,"END"); v1 = ve; v2 = v1 + 80; strncpy (v2, ve, 80); } else v2 = v1 + 80; lcom = 0; newcom[0] = 0; } /* Otherwise, extract the entry for this keyword from the header */ else { strncpy (line, v1, 80); line[80] = 0; v2 = v1 + 80; /* check for quoted value */ q1 = strchr (line, squot); if (q1 != NULL) q2 = strchr (q1+1,squot); else q2 = line; /* extract comment and remove trailing spaces */ c1 = strchr (q2,'/'); if (c1 != NULL) { lcom = 80 - (c1 - line); strncpy (newcom, c1+1, lcom); vp = newcom + lcom - 1; while (vp-- > newcom && *vp == ' ') *vp = 0; lcom = strlen (newcom); } else { newcom[0] = 0; lcom = 0; } } /* Fill new entry with spaces */ for (vp = v1; vp < v2; vp++) *vp = ' '; /* Copy keyword to new entry */ strncpy (v1, keyword, lkeyword); /* Add parameter value in the appropriate place */ vp = v1 + 8; *vp = '='; vp = v1 + 9; *vp = ' '; vp = vp + 1; if (*value == squot) { strncpy (vp, value, lval); if (lval+12 > 31) lc = lval + 12; else lc = 30; } else { vp = v1 + 30 - lval; strncpy (vp, value, lval); lc = 30; } /* Add comment in the appropriate place */ if (lcom > 0) { if (lc+2+lcom > 80) lcom = 78 - lc; vp = v1 + lc + 2; /* Jul 16 1997: was vp = v1 + lc * 2 */ *vp = '/'; vp = vp + 1; strncpy (vp, newcom, lcom); for (v = vp + lcom; v < v2; v++) *v = ' '; } return; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xc8, %rsp movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %r14 movq %rsi, %rdi callq 0x6280 movq %rax, %rbp movq %r15, %rdi callq 0x6280 movq %rax, %rbx cmpl $0x7, %ebp jne 0x94045 leaq 0x3b60e(%rip), %rsi # 0xcf622 movl $0x7, %edx movq %r12, %rdi callq 0x6190 testl %eax, %eax je 0x94104 leaq 0x3b5ea(%rip), %rsi # 0xcf61a movl $0x7, %edx movq %r12, %rdi callq 0x6190 testl %eax, %eax je 0x94104 movq %r14, %rdi movq %r12, %rsi callq 0x93969 testq %rax, %rax movq %rbp, 0x18(%rsp) je 0x9418c movq %rax, %r13 movq %rax, %rbp leaq 0x60(%rsp), %r14 movl $0x50, %edx movq %r14, %rdi movq %r13, %rsi callq 0x64e0 movb $0x0, 0x50(%r14) movq %r14, %rdi movl $0x27, %esi callq 0x63c0 testq %rax, %rax je 0x940a3 incq %rax movq %rax, %rdi movl $0x27, %esi callq 0x63c0 movq %rax, %r14 addq $0x50, %r13 movq %r14, %rdi movl $0x2f, %esi callq 0x63c0 testq %rax, %rax je 0x941b8 movq %r12, (%rsp) leaq 0x60(%rsp), %rcx subl %eax, %ecx incq %rax addl $0x50, %ecx movslq %ecx, %r12 leaq 0x20(%rsp), %r14 movq %r14, %rdi movq %rax, %rsi movq %r12, %rdx callq 0x64e0 leaq (%rsp,%r12), %rax addq $0x1f, %rax cmpq %r14, %rax jbe 0x9417a cmpb $0x20, -0x1(%rax) jne 0x9417a movb $0x0, -0x1(%rax) decq %rax jmp 0x940ec leaq 0x47fdc(%rip), %rsi # 0xdc0e7 movq %r14, %rdi callq 0x93969 movq %rax, %r14 leaq 0x50(%rax), %rdi movl $0x50, %edx movq %rax, %rsi callq 0x64e0 movl $0x7, %edx movq %r14, %rdi movq %r12, %rsi callq 0x64e0 movaps 0x48a82(%rip), %xmm0 # 0xdcbc0 movups %xmm0, 0x7(%r14) movups %xmm0, 0x17(%r14) movups %xmm0, 0x27(%r14) movups %xmm0, 0x37(%r14) movups %xmm0, 0x40(%r14) addq $0x9, %r14 movslq %ebx, %rdx movq %r14, %rdi movq %r15, %rsi addq $0xc8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp jmp 0x64e0 leaq 0x20(%rsp), %rdi callq 0x6280 movq %rax, %r14 jmp 0x942b2 movq %rbx, 0x8(%rsp) xorl %ebx, %ebx movq %r15, 0x10(%rsp) movq %r12, (%rsp) cmpb $0x0, (%r14,%rbx) je 0x941c5 incq %rbx cmpq $0xe100, %rbx # imm = 0xE100 jne 0x9419c leaq 0xe100(%r14), %rbx jmp 0x941d1 movb $0x0, 0x20(%rsp) xorl %r14d, %r14d jmp 0x942b6 testq %rbx, %rbx je 0x9427a addq %r14, %rbx leaq 0x47f0f(%rip), %r12 # 0xdc0e7 movq %r14, %r13 movl %ebx, %edx subl %r13d, %edx movq %r13, %rdi movq %r12, %rsi callq 0x93a5f testq %rax, %rax je 0x9427a movq %rax, %rbp movq %rax, %rcx subq %r14, %rcx movq %rcx, %rax movabsq $0x6666666666666667, %rdx # imm = 0x6666666666666667 imulq %rdx movq %rdx, %rax shrq $0x3f, %rax sarq $0x5, %rdx addq %rax, %rdx shlq $0x4, %rdx leaq (%rdx,%rdx,4), %rax subq %rax, %rcx cmpq $0x8, %rcx jge 0x9423f movb 0x3(%rbp), %al cmpb $0x3d, %al sete %dl addb $-0x21, %al cmpb $0x5e, %al setae %al orb %dl, %al jne 0x94247 incq %rbp movq %rbp, %r13 jmp 0x94271 movq %rbp, %r15 subq %rcx, %r15 testq %rcx, %rcx jle 0x94268 leaq 0x1(%rbp), %rax movq %r15, %rdx cmpb $0x20, (%rdx) cmovneq %rax, %r13 incq %rdx cmpq %rbp, %rdx jb 0x94259 cmpq %r13, %rbp jae 0x94391 cmpq %rbx, %r13 jb 0x941db leaq 0x47e66(%rip), %rsi # 0xdc0e7 movq %r14, %rdi callq 0x93969 movq %rax, %rbp leaq 0x50(%rax), %r13 movl $0x50, %edx movq %r13, %rdi movq %rax, %rsi callq 0x64e0 movb $0x0, 0x20(%rsp) xorl %r14d, %r14d movq 0x10(%rsp), %r15 movq 0x8(%rsp), %rbx movq (%rsp), %r12 movq %r13, %rdx subq %rbp, %rdx movq %rbp, %rdi movl $0x20, %esi callq 0x6090 movslq 0x18(%rsp), %rdx movq %rbp, %rdi movq %r12, %rsi callq 0x64e0 movw $0x203d, 0x8(%rbp) # imm = 0x203D cmpb $0x27, (%r15) movslq %ebx, %rdx jne 0x94304 leaq 0xa(%rbp), %rdi movq %r15, %rsi callq 0x64e0 leal 0xc(%rbx), %ecx cmpl $0x14, %ebx movl $0x1e, %eax cmovgel %ecx, %eax jmp 0x9431b movq %rbp, %rdi subq %rdx, %rdi addq $0x1e, %rdi movq %r15, %rsi callq 0x64e0 movl $0x1e, %eax testl %r14d, %r14d jle 0x9437f leal (%r14,%rax), %ecx addl $0x2, %ecx movl $0x4e, %edx subl %eax, %edx cmpl $0x51, %ecx cmovll %r14d, %edx movl %eax, %r14d leaq (%r14,%rbp), %r15 leaq (%r14,%rbp), %rdi addq $0x3, %rdi movb $0x2f, -0x1(%rdi) movslq %edx, %rbx leaq 0x20(%rsp), %rsi movq %rbx, %rdx callq 0x64e0 leaq (%rbx,%r15), %rdi addq $0x3, %rdi cmpq %r13, %rdi jae 0x9437f addq %rbx, %rbp addq %r14, %rbp subq %rbp, %r13 addq $-0x3, %r13 movl $0x20, %esi movq %r13, %rdx callq 0x6090 addq $0xc8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq cmpq %r14, %r15 je 0x9427a subq %rcx, %rbp addq $0x50, %rbp leaq 0x42e58(%rip), %r12 # 0xd7200 leaq -0xa0(%rbp), %rdi movl $0x8, %edx movq %r12, %rsi callq 0x6190 addq $-0x50, %rbp testl %eax, %eax je 0x943a8 cmpq %r15, %rbp jae 0x9427a leaq 0x50(%rbp), %r13 jmp 0x942a0 nop
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/iraffits.c
ffukyc
int ffukyc(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname,/* I - keyword name */ float *value, /* I - keyword value */ int decim, /* I - no of decimals */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { int tstatus; if (*status > 0) /* inherit input status value if > 0 */ return(*status); tstatus = *status; if (ffmkyc(fptr, keyname, value, decim, comm, status) == KEY_NO_EXIST) { *status = tstatus; ffpkyc(fptr, keyname, value, decim, comm, status); } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl (%r9), %r12d testl %r12d, %r12d jg 0x94811 movq %r9, %rbx movl %ecx, %ebp movq %rdx, %r15 movq %rsi, %r13 movq %rdi, %r14 movq %r8, (%rsp) callq 0x95385 cmpl $0xca, %eax jne 0x9480e movl %r12d, (%rbx) movq %r14, %rdi movq %r13, %rsi movq %r15, %rdx movl %ebp, %ecx movq (%rsp), %r8 movq %rbx, %r9 callq 0xaf274 movl (%rbx), %r12d movl %r12d, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffukyu
int ffukyu(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { int tstatus; if (*status > 0) /* inherit input status value if > 0 */ return(*status); tstatus = *status; if (ffmkyu(fptr, keyname, comm, status) == KEY_NO_EXIST) { *status = tstatus; ffpkyu(fptr, keyname, comm, status); } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx movl (%rcx), %ebp testl %ebp, %ebp jg 0x948be movq %rcx, %rbx movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 callq 0x948c9 cmpl $0xca, %eax jne 0x948bc movl %ebp, (%rbx) movq %r12, %rdi movq %r15, %rsi movq %r14, %rdx movq %rbx, %rcx callq 0xaf4fe movl (%rbx), %ebp movl %ebp, %eax popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffmkys
int ffmkys(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ const char *value, /* I - keyword value */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { /* NOTE: This routine does not support long continued strings */ /* It will correctly overwrite an existing long continued string, */ /* but it will not write a new long string. */ char oldval[FLEN_VALUE], valstring[FLEN_VALUE]; char oldcomm[FLEN_COMMENT]; char card[FLEN_CARD], nextcomm[FLEN_COMMENT]; int len, keypos; if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (ffgkey(fptr, keyname, oldval, oldcomm, status) > 0) return(*status); /* get old comment */ ffs2c(value, valstring, status); /* convert value to a string */ if (!comm || comm[0] == '&') /* preserve the current comment string */ ffmkky(keyname, valstring, oldcomm, card, status); else ffmkky(keyname, valstring, comm, card, status); ffmkey(fptr, card, status); /* overwrite the previous keyword */ keypos = (int) (((((fptr->Fptr)->nextkey) - ((fptr->Fptr)->headstart[(fptr->Fptr)->curhdu])) / 80) + 1); if (*status > 0) return(*status); /* check if old string value was continued over multiple keywords */ ffpmrk(); /* put mark on message stack; erase any messages after this */ ffc2s(oldval, valstring, status); /* remove quotes and trailing spaces */ if (*status == VALUE_UNDEFINED) { ffcmrk(); /* clear any spurious error messages, back to the mark */ *status = 0; } else { len = strlen(valstring); while (len && valstring[len - 1] == '&') /* ampersand is continuation char */ { nextcomm[0]='\0'; ffgcnt(fptr, valstring, nextcomm, status); if (*valstring || strlen(nextcomm)) { ffdrec(fptr, keypos, status); /* delete the continuation */ len = strlen(valstring); } else /* a null valstring indicates no continuation */ len = 0; } } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x198, %rsp # imm = 0x198 movl (%r8), %ebp testl %ebp, %ebp jg 0x94ace movq %r8, %rbx movq %rcx, %r12 movq %rdx, %r14 movq %rsi, %r15 leaq 0xa0(%rsp), %rdx movq %rdi, %rbp leaq 0xf0(%rsp), %r13 movq %r13, %rcx callq 0x6e02a testl %eax, %eax jle 0x949a7 movl (%rbx), %ebp jmp 0x94ace movq %rsp, %rsi movq %r14, %rdi movq %rbx, %rdx callq 0xaf552 testq %r12, %r12 je 0x949cb cmpb $0x26, (%r12) leaq 0xf0(%rsp), %r13 cmovneq %r12, %r13 movq %rsp, %rsi leaq 0x140(%rsp), %r14 movq %r15, %rdi movq %r13, %rdx movq %r14, %rcx movq %rbx, %r8 callq 0x378ab movq %rbp, %r13 movq %rbp, %rdi movq %r14, %rsi movq %rbx, %rdx callq 0x37e41 movq 0x8(%rbp), %rcx movq 0x68(%rcx), %rdx movq 0x80(%rcx), %rax movslq 0x54(%rcx), %rcx subq (%rdx,%rcx,8), %rax movabsq $0x6666666666666667, %rcx # imm = 0x6666666666666667 imulq %rcx movl (%rbx), %ebp testl %ebp, %ebp jg 0x94ace movq %rdx, %r15 callq 0x37511 leaq 0xa0(%rsp), %rdi movq %rsp, %rsi movq %rbx, %rdx callq 0x3c9a1 movl (%rbx), %ebp cmpl $0xcc, %ebp jne 0x94a5a callq 0x37567 movl $0x0, (%rbx) xorl %ebp, %ebp jmp 0x94ace movq %rsp, %rdi callq 0x6280 testl %eax, %eax je 0x94ace movq %r15, %rcx shrq $0x5, %rcx shrq $0x3f, %r15 leal (%rcx,%r15), %ebp incl %ebp movq %rsp, %r15 leaq 0x50(%rsp), %r12 decl %eax cltq cmpb $0x26, (%rsp,%rax) jne 0x949a0 movb $0x0, 0x50(%rsp) movq %r13, %rdi movq %r15, %rsi movq %r12, %rdx movq %rbx, %rcx callq 0x6e894 movb 0x50(%rsp), %al orb (%rsp), %al je 0x949a0 movq %r13, %rdi movl %ebp, %esi movq %rbx, %rdx callq 0x959e4 movq %r15, %rdi callq 0x6280 testl %eax, %eax jne 0x94a7f jmp 0x949a0 movl %ebp, %eax addq $0x198, %rsp # imm = 0x198 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffukls
int ffukls(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ const char *value, /* I - keyword value */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { /* update a long string keyword */ int tstatus; char junk[FLEN_ERRMSG]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); tstatus = *status; if (ffmkls(fptr, keyname, value, comm, status) == KEY_NO_EXIST) { /* since the ffmkls call failed, it wrote a bogus error message */ fits_read_errmsg(junk); /* clear the error message */ *status = tstatus; ffpkls(fptr, keyname, value, comm, status); } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movl (%r8), %ebp testl %ebp, %ebp jg 0x94b32 movq %r8, %rbx movq %rcx, %r14 movq %rdx, %r15 movq %rsi, %r12 movq %rdi, %r13 callq 0x94b43 cmpl $0xca, %eax jne 0x94b30 movq %rsp, %rdi callq 0x3751d movl %ebp, (%rbx) movq %r13, %rdi movq %r12, %rsi movq %r15, %rdx movq %r14, %rcx movq %rbx, %r8 callq 0xaf616 movl (%rbx), %ebp movl %ebp, %eax addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffmkls
int ffmkls( fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - name of keyword to write */ const char *value, /* I - keyword value */ const char *incomm, /* I - keyword comment */ int *status) /* IO - error status */ /* Modify the value and optionally the comment of a long string keyword. This routine supports the HEASARC long string convention and can modify arbitrarily long string keyword values. The value is continued over multiple keywords that have the name COMTINUE without an equal sign in column 9 of the card. This routine also supports simple string keywords which are less than 69 characters in length. This routine is not very efficient, so it should be used sparingly. */ { char valstring[FLEN_VALUE]; char card[FLEN_CARD], tmpkeyname[FLEN_CARD]; char tstring[FLEN_VALUE], *cptr; char *comm=0, *tmplongval=0; int next, remain, nquote, nchar, namelen, contin, tstatus = -1; int nkeys, keypos; int vlen, commlen, tmpvlen, tmpcommlen; if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (!incomm || incomm[0] == '&') /* preserve the old comment string */ { ffghps(fptr, &nkeys, &keypos, status); /* save current position */ if (ffgkcsl(fptr, keyname, &vlen, &commlen, status)) return(*status); /* keyword doesn't exist or is bad format */ tmplongval = (char *)malloc(vlen+1); comm = (char *)malloc(commlen+1); ffgskyc(fptr, keyname, 1, vlen, commlen, tmplongval, &tmpvlen, comm, &tmpcommlen, status); free(tmplongval); /* move back to previous position to ensure that we delete */ /* the right keyword in case there are more than one keyword */ /* with this same name. */ ffgrec(fptr, keypos - 1, card, status); } else { /* copy the input comment string */ commlen = (int)strlen(incomm); if (commlen) { comm = (char *)malloc(commlen+1); strcpy(comm,incomm); } } /* delete the old keyword */ if (ffdkey(fptr, keyname, status) > 0) { if (comm) free(comm); return(*status); /* keyword doesn't exist */ } ffghps(fptr, &nkeys, &keypos, status); /* save current position */ fits_make_longstr_key_util(fptr, keyname, value, comm, keypos, status); if (comm) free(comm); return(*status); }
movl (%r8), %eax testl %eax, %eax jle 0x94b4b retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x88, %rsp movq %r8, %rbx movq %rcx, %rbp movq %rdx, %r14 movq %rsi, %r15 movq %rdi, %r12 testq %rcx, %rcx je 0x94b7a cmpb $0x26, (%rbp) jne 0x94c2d leaq 0x1c(%rsp), %rsi leaq 0xc(%rsp), %rdx movq %r12, %rdi movq %rbx, %rcx callq 0x6d0c5 leaq 0x18(%rsp), %rdx leaq 0x8(%rsp), %rcx movq %r12, %rdi movq %r15, %rsi movq %rbx, %r8 callq 0x6e22e testl %eax, %eax jne 0x94cc6 movq %r14, 0x10(%rsp) movslq 0x18(%rsp), %rbp movq %rbp, %rdi incq %rdi callq 0x61a0 movq %rax, 0x20(%rsp) movslq 0x8(%rsp), %r14 movq %r14, %rdi incq %rdi callq 0x61a0 movq %rax, %r13 leaq 0x28(%rsp), %rax leaq 0x2c(%rsp), %r10 movq %r12, %rdi movq %r15, %rsi movl $0x1, %edx movl %ebp, %ecx movl %r14d, %r8d movq 0x20(%rsp), %r14 movq %r14, %r9 pushq %rbx pushq %rax pushq %r13 pushq %r10 callq 0x6ec59 addq $0x20, %rsp movq %r14, %rdi callq 0x6260 movl 0xc(%rsp), %esi decl %esi leaq 0x30(%rsp), %rdx movq %r12, %rdi movq %rbx, %rcx callq 0x6e07a jmp 0x94c5a movq %rbp, %rdi callq 0x6280 movl %eax, 0x8(%rsp) testl %eax, %eax je 0x94c6e movq %r14, 0x10(%rsp) incl %eax movslq %eax, %rdi callq 0x61a0 movq %rax, %r13 movq %rax, %rdi movq %rbp, %rsi callq 0x6460 movq %r12, %rdi movq %r15, %rsi movq %rbx, %rdx callq 0x95db8 testl %eax, %eax jg 0x94cb9 jmp 0x94c88 movq %r12, %rdi movq %r15, %rsi movq %rbx, %rdx callq 0x95db8 testl %eax, %eax jg 0x94cc6 movq %r14, 0x10(%rsp) xorl %r13d, %r13d leaq 0x1c(%rsp), %rsi leaq 0xc(%rsp), %r14 movq %r12, %rdi movq %r14, %rdx movq %rbx, %rcx callq 0x6d0c5 movl (%r14), %r8d movq %r12, %rdi movq %r15, %rsi movq 0x10(%rsp), %rdx movq %r13, %rcx movq %rbx, %r9 callq 0xaf634 testq %r13, %r13 je 0x94cc6 movq %r13, %rdi callq 0x6260 movl (%rbx), %eax addq $0x88, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffmkyj
int ffmkyj(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ LONGLONG value, /* I - keyword value */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { char valstring[FLEN_VALUE]; char oldcomm[FLEN_COMMENT]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (ffgkey(fptr, keyname, valstring, oldcomm, status) > 0) return(*status); /* get old comment */ ffi2c(value, valstring, status); /* convert value to a string */ if (!comm || comm[0] == '&') /* preserve the current comment string */ ffmkky(keyname, valstring, oldcomm, card, status); else ffmkky(keyname, valstring, comm, card, status); ffmkey(fptr, card, status); return(*status); }
movl (%r8), %eax testl %eax, %eax jle 0x94d7b retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xf8, %rsp movq %r8, %rbx movq %rcx, %r12 movq %rdx, %rbp movq %rsi, %r15 movq %rdi, %r14 movq %rsp, %rdx leaq 0x50(%rsp), %r13 movq %r13, %rcx callq 0x6e02a testl %eax, %eax jg 0x94dfa movq %rsp, %rsi movq %rbp, %rdi movq %rbx, %rdx callq 0xafdf2 testq %r12, %r12 je 0x94dd0 cmpb $0x26, (%r12) leaq 0x50(%rsp), %r13 cmovneq %r12, %r13 movq %rsp, %rsi leaq 0xa0(%rsp), %r12 movq %r15, %rdi movq %r13, %rdx movq %r12, %rcx movq %rbx, %r8 callq 0x378ab movq %r14, %rdi movq %r12, %rsi movq %rbx, %rdx callq 0x37e41 movl (%rbx), %eax addq $0xf8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffukyf
int ffukyf(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname,/* I - keyword name */ float value, /* I - keyword value */ int decim, /* I - no of decimals */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { int tstatus; if (*status > 0) /* inherit input status value if > 0 */ return(*status); tstatus = *status; if (ffmkyf(fptr, keyname, value, decim, comm, status) == KEY_NO_EXIST) { *status = tstatus; ffpkyf(fptr, keyname, value, decim, comm, status); } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl (%r8), %r15d testl %r15d, %r15d jg 0x94efb movq %r8, %rbx movq %rcx, %r14 movl %edx, %ebp movq %rsi, %r12 movq %rdi, %r13 movss %xmm0, 0x4(%rsp) callq 0x94f0d cmpl $0xca, %eax jne 0x94ef8 movl %r15d, (%rbx) movq %r13, %rdi movq %r12, %rsi movss 0x4(%rsp), %xmm0 movl %ebp, %edx movq %r14, %rcx movq %rbx, %r8 callq 0xafe7c movl (%rbx), %r15d movl %r15d, %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffmkyf
int ffmkyf(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ float value, /* I - keyword value */ int decim, /* I - no of decimals */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { char valstring[FLEN_VALUE]; char oldcomm[FLEN_COMMENT]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (ffgkey(fptr, keyname, valstring, oldcomm, status) > 0) return(*status); /* get old comment */ ffr2f(value, decim, valstring, status); /* convert value to a string */ if (!comm || comm[0] == '&') /* preserve the current comment string */ ffmkky(keyname, valstring, oldcomm, card, status); else ffmkky(keyname, valstring, comm, card, status); ffmkey(fptr, card, status); return(*status); }
movl (%r8), %eax testl %eax, %eax jle 0x94f15 retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x108, %rsp # imm = 0x108 movq %r8, %rbx movq %rcx, %r12 movl %edx, %ebp movq %rsi, %r15 movq %rdi, %r14 movss %xmm0, 0xc(%rsp) leaq 0x10(%rsp), %rdx leaq 0x60(%rsp), %r13 movq %r13, %rcx callq 0x6e02a testl %eax, %eax jg 0x94fa4 leaq 0x10(%rsp), %rsi movss 0xc(%rsp), %xmm0 movl %ebp, %edi movq %rbx, %rdx callq 0xafeec testq %r12, %r12 je 0x94f78 cmpb $0x26, (%r12) leaq 0x60(%rsp), %r13 cmovneq %r12, %r13 leaq 0x10(%rsp), %rsi leaq 0xb0(%rsp), %r12 movq %r15, %rdi movq %r13, %rdx movq %r12, %rcx movq %rbx, %r8 callq 0x378ab movq %r14, %rdi movq %r12, %rsi movq %rbx, %rdx callq 0x37e41 movl (%rbx), %eax addq $0x108, %rsp # imm = 0x108 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffmkye
int ffmkye(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ float value, /* I - keyword value */ int decim, /* I - no of decimals */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { char valstring[FLEN_VALUE]; char oldcomm[FLEN_COMMENT]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (ffgkey(fptr, keyname, valstring, oldcomm, status) > 0) return(*status); /* get old comment */ ffr2e(value, decim, valstring, status); /* convert value to a string */ if (!comm || comm[0] == '&') /* preserve the current comment string */ ffmkky(keyname, valstring, oldcomm, card, status); else ffmkky(keyname, valstring, comm, card, status); ffmkey(fptr, card, status); return(*status); }
movl (%r8), %eax testl %eax, %eax jle 0x94fc0 retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x108, %rsp # imm = 0x108 movq %r8, %rbx movq %rcx, %r12 movl %edx, %ebp movq %rsi, %r15 movq %rdi, %r14 movss %xmm0, 0xc(%rsp) leaq 0x10(%rsp), %rdx leaq 0x60(%rsp), %r13 movq %r13, %rcx callq 0x6e02a testl %eax, %eax jg 0x9504f leaq 0x10(%rsp), %rsi movss 0xc(%rsp), %xmm0 movl %ebp, %edi movq %rbx, %rdx callq 0xaff99 testq %r12, %r12 je 0x95023 cmpb $0x26, (%r12) leaq 0x60(%rsp), %r13 cmovneq %r12, %r13 leaq 0x10(%rsp), %rsi leaq 0xb0(%rsp), %r12 movq %r15, %rdi movq %r13, %rdx movq %r12, %rcx movq %rbx, %r8 callq 0x378ab movq %r14, %rdi movq %r12, %rsi movq %rbx, %rdx callq 0x37e41 movl (%rbx), %eax addq $0x108, %rsp # imm = 0x108 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffmkfc
int ffmkfc(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ float *value, /* I - keyword value */ int decim, /* I - no of decimals */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { char valstring[FLEN_VALUE], tmpstring[FLEN_VALUE]; char oldcomm[FLEN_COMMENT]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (ffgkey(fptr, keyname, valstring, oldcomm, status) > 0) return(*status); /* get old comment */ strcpy(valstring, "(" ); ffr2f(value[0], decim, tmpstring, status); /* convert to string */ if (strlen(tmpstring)+3 > FLEN_VALUE-1) { ffpmsg("complex key value too long (ffmkfc)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ", "); ffr2f(value[1], decim, tmpstring, status); /* convert to string */ if (strlen(valstring) + strlen(tmpstring)+1 > FLEN_VALUE-1) { ffpmsg("complex key value too long (ffmkfc)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ")"); if (!comm || comm[0] == '&') /* preserve the current comment string */ ffmkky(keyname, valstring, oldcomm, card, status); else ffmkky(keyname, valstring, comm, card, status); ffmkey(fptr, card, status); return(*status); }
movl (%r9), %eax testl %eax, %eax jle 0x95221 retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x158, %rsp # imm = 0x158 movq %r9, %rbx movl %ecx, %ebp movq %rdx, %r13 movq %rsi, %r15 movq %rdi, %r14 movq %r8, 0x8(%rsp) leaq 0x10(%rsp), %rdx leaq 0xb0(%rsp), %rcx movq %r9, %r8 callq 0x6e02a testl %eax, %eax jle 0x95265 movl (%rbx), %eax jmp 0x9530b movw $0x28, 0x10(%rsp) movss (%r13), %xmm0 leaq 0x60(%rsp), %r12 movl %ebp, %edi movq %r12, %rsi movq %rbx, %rdx callq 0xafeec movq %r12, %rdi callq 0x6280 addq $-0x44, %rax cmpq $-0x48, %rax jbe 0x952f4 leaq 0x10(%rsp), %r12 leaq 0x60(%rsp), %rsi movq %r12, %rdi callq 0x6330 movq %r12, %rdi callq 0x6280 movw $0x202c, 0x10(%rsp,%rax) # imm = 0x202C movb $0x0, 0x12(%rsp,%rax) movss 0x4(%r13), %xmm0 movl %ebp, %edi leaq 0x60(%rsp), %rbp movq %rbp, %rsi movq %rbx, %rdx callq 0xafeec movq %r12, %rdi callq 0x6280 movq %rax, %r13 movq %rbp, %rdi callq 0x6280 addq %r13, %rax addq $-0x46, %rax cmpq $-0x48, %rax ja 0x9531d leaq 0x47e50(%rip), %rdi # 0xdd14b callq 0x37264 movl $0x192, (%rbx) # imm = 0x192 movl $0x192, %eax # imm = 0x192 addq $0x158, %rsp # imm = 0x158 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x10(%rsp), %r13 leaq 0x60(%rsp), %rsi movq %r13, %rdi callq 0x6330 movq %r13, %rdi callq 0x6280 movw $0x29, 0x10(%rsp,%rax) movq 0x8(%rsp), %rax testq %rax, %rax leaq 0xb0(%rsp), %rdx je 0x95357 cmpb $0x26, (%rax) cmovneq %rax, %rdx leaq 0x10(%rsp), %rsi leaq 0x100(%rsp), %r12 movq %r15, %rdi movq %r12, %rcx movq %rbx, %r8 callq 0x378ab movq %r14, %rdi movq %r12, %rsi movq %rbx, %rdx callq 0x37e41 jmp 0x9525e
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffmkyc
int ffmkyc(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ float *value, /* I - keyword value */ int decim, /* I - no of decimals */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { char valstring[FLEN_VALUE], tmpstring[FLEN_VALUE]; char oldcomm[FLEN_COMMENT]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (ffgkey(fptr, keyname, valstring, oldcomm, status) > 0) return(*status); /* get old comment */ strcpy(valstring, "(" ); ffr2e(value[0], decim, tmpstring, status); /* convert to string */ if (strlen(tmpstring)+3 > FLEN_VALUE-1) { ffpmsg("complex key value too long (ffmkyc)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ", "); ffr2e(value[1], decim, tmpstring, status); /* convert to string */ if (strlen(valstring) + strlen(tmpstring)+1 > FLEN_VALUE-1) { ffpmsg("complex key value too long (ffmkyc)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ")"); if (!comm || comm[0] == '&') /* preserve the current comment string */ ffmkky(keyname, valstring, oldcomm, card, status); else ffmkky(keyname, valstring, comm, card, status); ffmkey(fptr, card, status); return(*status); }
movl (%r9), %eax testl %eax, %eax jle 0x9538d retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x158, %rsp # imm = 0x158 movq %r9, %rbx movl %ecx, %ebp movq %rdx, %r13 movq %rsi, %r15 movq %rdi, %r14 movq %r8, 0x8(%rsp) leaq 0x10(%rsp), %rdx leaq 0xb0(%rsp), %rcx movq %r9, %r8 callq 0x6e02a testl %eax, %eax jle 0x953d1 movl (%rbx), %eax jmp 0x95477 movw $0x28, 0x10(%rsp) movss (%r13), %xmm0 leaq 0x60(%rsp), %r12 movl %ebp, %edi movq %r12, %rsi movq %rbx, %rdx callq 0xaff99 movq %r12, %rdi callq 0x6280 addq $-0x44, %rax cmpq $-0x48, %rax jbe 0x95460 leaq 0x10(%rsp), %r12 leaq 0x60(%rsp), %rsi movq %r12, %rdi callq 0x6330 movq %r12, %rdi callq 0x6280 movw $0x202c, 0x10(%rsp,%rax) # imm = 0x202C movb $0x0, 0x12(%rsp,%rax) movss 0x4(%r13), %xmm0 movl %ebp, %edi leaq 0x60(%rsp), %rbp movq %rbp, %rsi movq %rbx, %rdx callq 0xaff99 movq %r12, %rdi callq 0x6280 movq %rax, %r13 movq %rbp, %rdi callq 0x6280 addq %r13, %rax addq $-0x46, %rax cmpq $-0x48, %rax ja 0x95489 leaq 0x47d08(%rip), %rdi # 0xdd16f callq 0x37264 movl $0x192, (%rbx) # imm = 0x192 movl $0x192, %eax # imm = 0x192 addq $0x158, %rsp # imm = 0x158 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x10(%rsp), %r13 leaq 0x60(%rsp), %rsi movq %r13, %rdi callq 0x6330 movq %r13, %rdi callq 0x6280 movw $0x29, 0x10(%rsp,%rax) movq 0x8(%rsp), %rax testq %rax, %rax leaq 0xb0(%rsp), %rdx je 0x954c3 cmpb $0x26, (%rax) cmovneq %rax, %rdx leaq 0x10(%rsp), %rsi leaq 0x100(%rsp), %r12 movq %r15, %rdi movq %r12, %rcx movq %rbx, %r8 callq 0x378ab movq %r14, %rdi movq %r12, %rsi movq %rbx, %rdx callq 0x37e41 jmp 0x953ca
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffmkfm
int ffmkfm(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ double *value, /* I - keyword value */ int decim, /* I - no of decimals */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { char valstring[FLEN_VALUE], tmpstring[FLEN_VALUE]; char oldcomm[FLEN_COMMENT]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (ffgkey(fptr, keyname, valstring, oldcomm, status) > 0) return(*status); /* get old comment */ strcpy(valstring, "(" ); ffd2f(value[0], decim, tmpstring, status); /* convert to string */ if (strlen(tmpstring)+3 > FLEN_VALUE-1) { ffpmsg("complex key value too long (ffmkfm)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ", "); ffd2f(value[1], decim, tmpstring, status); /* convert to string */ if (strlen(valstring) + strlen(tmpstring)+1 > FLEN_VALUE-1) { ffpmsg("complex key value too long (ffmkfm)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ")"); if (!comm || comm[0] == '&') /* preserve the current comment string */ ffmkky(keyname, valstring, oldcomm, card, status); else ffmkky(keyname, valstring, comm, card, status); ffmkey(fptr, card, status); return(*status); }
movl (%r9), %eax testl %eax, %eax jle 0x95559 retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x158, %rsp # imm = 0x158 movq %r9, %rbx movl %ecx, %ebp movq %rdx, %r13 movq %rsi, %r15 movq %rdi, %r14 movq %r8, 0x8(%rsp) leaq 0x10(%rsp), %rdx leaq 0xb0(%rsp), %rcx movq %r9, %r8 callq 0x6e02a testl %eax, %eax jle 0x9559d movl (%rbx), %eax jmp 0x95643 movw $0x28, 0x10(%rsp) movsd (%r13), %xmm0 leaq 0x60(%rsp), %r12 movl %ebp, %edi movq %r12, %rsi movq %rbx, %rdx callq 0xb011c movq %r12, %rdi callq 0x6280 addq $-0x44, %rax cmpq $-0x48, %rax jbe 0x9562c leaq 0x10(%rsp), %r12 leaq 0x60(%rsp), %rsi movq %r12, %rdi callq 0x6330 movq %r12, %rdi callq 0x6280 movw $0x202c, 0x10(%rsp,%rax) # imm = 0x202C movb $0x0, 0x12(%rsp,%rax) movsd 0x8(%r13), %xmm0 movl %ebp, %edi leaq 0x60(%rsp), %rbp movq %rbp, %rsi movq %rbx, %rdx callq 0xb011c movq %r12, %rdi callq 0x6280 movq %rax, %r13 movq %rbp, %rdi callq 0x6280 addq %r13, %rax addq $-0x46, %rax cmpq $-0x48, %rax ja 0x95655 leaq 0x47b60(%rip), %rdi # 0xdd193 callq 0x37264 movl $0x192, (%rbx) # imm = 0x192 movl $0x192, %eax # imm = 0x192 addq $0x158, %rsp # imm = 0x158 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x10(%rsp), %r13 leaq 0x60(%rsp), %rsi movq %r13, %rdi callq 0x6330 movq %r13, %rdi callq 0x6280 movw $0x29, 0x10(%rsp,%rax) movq 0x8(%rsp), %rax testq %rax, %rax leaq 0xb0(%rsp), %rdx je 0x9568f cmpb $0x26, (%rax) cmovneq %rax, %rdx leaq 0x10(%rsp), %rsi leaq 0x100(%rsp), %r12 movq %r15, %rdi movq %r12, %rcx movq %rbx, %r8 callq 0x378ab movq %r14, %rdi movq %r12, %rsi movq %rbx, %rdx callq 0x37e41 jmp 0x95596
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffmkym
int ffmkym(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ double *value, /* I - keyword value */ int decim, /* I - no of decimals */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { char valstring[FLEN_VALUE], tmpstring[FLEN_VALUE]; char oldcomm[FLEN_COMMENT]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (ffgkey(fptr, keyname, valstring, oldcomm, status) > 0) return(*status); /* get old comment */ strcpy(valstring, "(" ); ffd2e(value[0], decim, tmpstring, status); /* convert to string */ if (strlen(tmpstring)+3 > FLEN_VALUE-1) { ffpmsg("complex key value too long (ffmkym)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ", "); ffd2e(value[1], decim, tmpstring, status); /* convert to string */ if (strlen(valstring) + strlen(tmpstring)+1 > FLEN_VALUE-1) { ffpmsg("complex key value too long (ffmkym)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ")"); if (!comm || comm[0] == '&') /* preserve the current comment string */ ffmkky(keyname, valstring, oldcomm, card, status); else ffmkky(keyname, valstring, comm, card, status); ffmkey(fptr, card, status); return(*status); }
movl (%r9), %eax testl %eax, %eax jle 0x956c5 retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x158, %rsp # imm = 0x158 movq %r9, %rbx movl %ecx, %ebp movq %rdx, %r13 movq %rsi, %r15 movq %rdi, %r14 movq %r8, 0x8(%rsp) leaq 0x10(%rsp), %rdx leaq 0xb0(%rsp), %rcx movq %r9, %r8 callq 0x6e02a testl %eax, %eax jle 0x95709 movl (%rbx), %eax jmp 0x957af movw $0x28, 0x10(%rsp) movsd (%r13), %xmm0 leaq 0x60(%rsp), %r12 movl %ebp, %edi movq %r12, %rsi movq %rbx, %rdx callq 0xb01c5 movq %r12, %rdi callq 0x6280 addq $-0x44, %rax cmpq $-0x48, %rax jbe 0x95798 leaq 0x10(%rsp), %r12 leaq 0x60(%rsp), %rsi movq %r12, %rdi callq 0x6330 movq %r12, %rdi callq 0x6280 movw $0x202c, 0x10(%rsp,%rax) # imm = 0x202C movb $0x0, 0x12(%rsp,%rax) movsd 0x8(%r13), %xmm0 movl %ebp, %edi leaq 0x60(%rsp), %rbp movq %rbp, %rsi movq %rbx, %rdx callq 0xb01c5 movq %r12, %rdi callq 0x6280 movq %rax, %r13 movq %rbp, %rdi callq 0x6280 addq %r13, %rax addq $-0x46, %rax cmpq $-0x48, %rax ja 0x957c1 leaq 0x47a18(%rip), %rdi # 0xdd1b7 callq 0x37264 movl $0x192, (%rbx) # imm = 0x192 movl $0x192, %eax # imm = 0x192 addq $0x158, %rsp # imm = 0x158 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq leaq 0x10(%rsp), %r13 leaq 0x60(%rsp), %rsi movq %r13, %rdi callq 0x6330 movq %r13, %rdi callq 0x6280 movw $0x29, 0x10(%rsp,%rax) movq 0x8(%rsp), %rax testq %rax, %rax leaq 0xb0(%rsp), %rdx je 0x957fb cmpb $0x26, (%rax) cmovneq %rax, %rdx leaq 0x10(%rsp), %rsi leaq 0x100(%rsp), %r12 movq %r15, %rdi movq %r12, %rcx movq %rbx, %r8 callq 0x378ab movq %r14, %rdi movq %r12, %rsi movq %rbx, %rdx callq 0x37e41 jmp 0x95702
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffmcrd
int ffmcrd(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ const char *card, /* I - card string value */ int *status) /* IO - error status */ { char tcard[FLEN_CARD], valstring[FLEN_CARD], comm[FLEN_CARD], value[FLEN_CARD]; char nextcomm[FLEN_COMMENT]; int keypos, len; if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (ffgcrd(fptr, keyname, tcard, status) > 0) return(*status); ffmkey(fptr, card, status); /* calc position of keyword in header */ keypos = (int) ((((fptr->Fptr)->nextkey) - ((fptr->Fptr)->headstart[(fptr->Fptr)->curhdu])) / 80) + 1; ffpsvc(tcard, valstring, comm, status); if (*status > 0) /* inherit input status value if > 0 */ return(*status); /* check for string value which may be continued over multiple keywords */ ffpmrk(); /* put mark on message stack; erase any messages after this */ ffc2s(valstring, value, status); /* remove quotes and trailing spaces */ if (*status == VALUE_UNDEFINED) { ffcmrk(); /* clear any spurious error messages, back to the mark */ *status = 0; } else { len = strlen(value); while (len && value[len - 1] == '&') /* ampersand used as continuation char */ { ffgcnt(fptr, value, nextcomm, status); if (*value) { ffdrec(fptr, keypos, status); /* delete the keyword */ len = strlen(value); } else /* a null valstring indicates no continuation */ len = 0; } } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0x1d0, %rsp # imm = 0x1D0 movl (%rcx), %ebp testl %ebp, %ebp jg 0x9599d movq %rcx, %rbx movq %rdx, %r15 movq %rdi, %r14 leaq 0xc0(%rsp), %rdx callq 0x6d586 testl %eax, %eax jle 0x958a4 movl (%rbx), %ebp jmp 0x9599d movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx callq 0x37e41 movq 0x8(%r14), %rcx movq 0x68(%rcx), %rdx movq 0x80(%rcx), %rax movslq 0x54(%rcx), %rcx subq (%rdx,%rcx,8), %rax movabsq $0x6666666666666667, %rcx # imm = 0x6666666666666667 imulq %rcx movq %rdx, %r15 leaq 0xc0(%rsp), %rdi leaq 0x60(%rsp), %rsi leaq 0x170(%rsp), %rdx movq %rbx, %rcx callq 0x381ee movl (%rbx), %ebp testl %ebp, %ebp jg 0x9599d callq 0x37511 leaq 0x60(%rsp), %rdi movq %rsp, %rsi movq %rbx, %rdx callq 0x3c9a1 movl (%rbx), %ebp cmpl $0xcc, %ebp jne 0x9592e callq 0x37567 movl $0x0, (%rbx) xorl %ebp, %ebp jmp 0x9599d movq %rsp, %rdi callq 0x6280 testl %eax, %eax je 0x9599d movq %r15, %rcx shrq $0x5, %rcx shrq $0x3f, %r15 leal (%rcx,%r15), %ebp incl %ebp movq %rsp, %r15 leaq 0x120(%rsp), %r12 decl %eax cltq cmpb $0x26, (%rsp,%rax) jne 0x9589d movq %r14, %rdi movq %r15, %rsi movq %r12, %rdx movq %rbx, %rcx callq 0x6e894 cmpb $0x0, (%rsp) je 0x9589d movq %r14, %rdi movl %ebp, %esi movq %rbx, %rdx callq 0x959e4 movq %r15, %rdi callq 0x6280 testl %eax, %eax jne 0x95956 jmp 0x9589d movl %ebp, %eax addq $0x1d0, %rsp # imm = 0x1D0 popq %rbx popq %r12 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffmnam
int ffmnam(fitsfile *fptr, /* I - FITS file pointer */ const char *oldname,/* I - existing keyword name */ const char *newname,/* I - new name for keyword */ int *status) /* IO - error status */ { char comm[FLEN_COMMENT]; char value[FLEN_VALUE]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (ffgkey(fptr, oldname, value, comm, status) > 0) return(*status); ffmkky(newname, value, comm, card, status); /* construct the card */ ffmkey(fptr, card, status); /* rewrite with new name */ return(*status); }
movl (%rcx), %eax testl %eax, %eax jle 0x95bc9 retq pushq %r15 pushq %r14 pushq %r12 pushq %rbx subq $0xf8, %rsp movq %rcx, %rbx movq %rdx, %r15 movq %rdi, %r14 movq %rsp, %rdx leaq 0x50(%rsp), %rcx movq %rbx, %r8 callq 0x6e02a testl %eax, %eax jg 0x95c20 movq %rsp, %rsi leaq 0x50(%rsp), %rdx leaq 0xa0(%rsp), %r12 movq %r15, %rdi movq %r12, %rcx movq %rbx, %r8 callq 0x378ab movq %r14, %rdi movq %r12, %rsi movq %rbx, %rdx callq 0x37e41 movl (%rbx), %eax addq $0xf8, %rsp popq %rbx popq %r12 popq %r14 popq %r15 retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffpunt
int ffpunt(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname,/* I - keyword name */ const char *unit, /* I - keyword unit string */ int *status) /* IO - error status */ /* Write (put) the units string into the comment field of the existing keyword. This routine uses a FITS convention in which the units are enclosed in square brackets following the '/' comment field delimiter, e.g.: KEYWORD = 12 / [kpc] comment string goes here */ { char oldcomm[FLEN_COMMENT]; char newcomm[FLEN_COMMENT]; char value[FLEN_VALUE]; char card[FLEN_CARD]; char *loc; size_t len; if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (ffgkey(fptr, keyname, value, oldcomm, status) > 0) return(*status); /* copy the units string to the new comment string if not null */ if (*unit) { strcpy(newcomm, "["); strncat(newcomm, unit, 45); /* max allowed length is about 45 chars */ strcat(newcomm, "] "); len = strlen(newcomm); len = FLEN_COMMENT - len - 1; /* amount of space left in the field */ } else { newcomm[0] = '\0'; len = FLEN_COMMENT - 1; } if (oldcomm[0] == '[') /* check for existing units field */ { loc = strchr(oldcomm, ']'); /* look for the closing bracket */ if (loc) { loc++; while (*loc == ' ') /* skip any blank spaces */ loc++; strncat(newcomm, loc, len); /* concat remainder of comment */ } else { strncat(newcomm, oldcomm, len); /* append old comment onto new */ } } else { strncat(newcomm, oldcomm, len); } ffmkky(keyname, value, newcomm, card, status); /* construct the card */ ffmkey(fptr, card, status); /* rewrite with new units string */ return(*status); }
movl (%rcx), %eax testl %eax, %eax jle 0x95cac retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x148, %rsp # imm = 0x148 movq %rcx, %rbx movq %rdx, %r13 movq %rsi, %r15 movq %rdi, %r14 leaq 0xa0(%rsp), %rdx leaq 0x50(%rsp), %r12 movq %r12, %rcx movq %rbx, %r8 callq 0x6e02a testl %eax, %eax jg 0x95da4 cmpb $0x0, (%r13) je 0x95d2f movq %rsp, %rbp movw $0x5b, (%rbp) movl $0x2d, %edx movq %rbp, %rdi movq %r13, %rsi callq 0x60f0 movq %rbp, %rdi callq 0x6280 movw $0x205d, (%rsp,%rax) # imm = 0x205D movb $0x0, 0x2(%rsp,%rax) movq %rbp, %rdi callq 0x6280 movl $0x48, %r13d subq %rax, %r13 jmp 0x95d39 movb $0x0, (%rsp) movl $0x48, %r13d cmpb $0x5b, 0x50(%rsp) jne 0x95d64 leaq 0x50(%rsp), %r12 movq %r12, %rdi movl $0x5d, %esi callq 0x63c0 testq %rax, %rax je 0x95d64 leaq 0x1(%rax), %r12 cmpb $0x20, 0x1(%rax) movq %r12, %rax je 0x95d57 movq %rsp, %rbp movq %rbp, %rdi movq %r12, %rsi movq %r13, %rdx callq 0x60f0 leaq 0xa0(%rsp), %rsi leaq 0xf0(%rsp), %r12 movq %r15, %rdi movq %rbp, %rdx movq %r12, %rcx movq %rbx, %r8 callq 0x378ab movq %r14, %rdi movq %r12, %rsi movq %rbx, %rdx callq 0x37e41 movl (%rbx), %eax addq $0x148, %rsp # imm = 0x148 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffikyu
int ffikyu(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ /* Insert a null-valued keyword and comment into the FITS header. */ { char valstring[FLEN_VALUE]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); strcpy(valstring," "); /* create a dummy value string */ ffmkky(keyname, valstring, comm, card, status); /* construct the keyword*/ ffikey(fptr, card, status); return(*status); }
movl (%rcx), %eax testl %eax, %eax jle 0x95f22 retq pushq %r15 pushq %r14 pushq %rbx subq $0xb0, %rsp movq %rcx, %rbx movq %rdi, %r14 movq %rsp, %rax movw $0x20, (%rax) leaq 0x50(%rsp), %r15 movq %rsi, %rdi movq %rax, %rsi movq %r15, %rcx movq %rbx, %r8 callq 0x378ab movq %r14, %rdi movq %r15, %rsi movq %rbx, %rdx callq 0x95f6f movl (%rbx), %eax addq $0xb0, %rsp popq %rbx popq %r14 popq %r15 retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffikls
int ffikls( fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - name of keyword to write */ const char *value, /* I - keyword value */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ /* Insert a long string keyword. This routine supports the HEASARC long string convention and can insert arbitrarily long string keyword values. The value is continued over multiple keywords that have the name COMTINUE without an equal sign in column 9 of the card. This routine also supports simple string keywords which are less than 69 characters in length. */ { char valstring[FLEN_VALUE]; char card[FLEN_CARD], tmpkeyname[FLEN_CARD]; char tstring[FLEN_VALUE], *cptr; int next, remain, vlen, nquote, nchar, namelen, contin, tstatus = -1; if (*status > 0) /* inherit input status value if > 0 */ return(*status); /* construct the new keyword, and insert into header */ remain = strlen(value); /* number of characters to write out */ next = 0; /* pointer to next character to write */ /* count the number of single quote characters in the string */ nquote = 0; cptr = strchr(value, '\''); /* search for quote character */ while (cptr) /* search for quote character */ { nquote++; /* increment no. of quote characters */ cptr++; /* increment pointer to next character */ cptr = strchr(cptr, '\''); /* search for another quote char */ } strncpy(tmpkeyname, keyname, 80); tmpkeyname[80] = '\0'; cptr = tmpkeyname; while(*cptr == ' ') /* skip over leading spaces in name */ cptr++; /* determine the number of characters that will fit on the line */ /* Note: each quote character is expanded to 2 quotes */ namelen = strlen(cptr); if (namelen <= 8 && (fftkey(cptr, &tstatus) <= 0) ) { /* This a normal 8-character FITS keyword */ nchar = 68 - nquote; /* max of 68 chars fit in a FITS string value */ } else { nchar = 80 - nquote - namelen - 5; } contin = 0; while (remain > 0) { if (nchar > FLEN_VALUE-1) { ffpmsg("longstr keyword value is too long (ffikls)"); return (*status=BAD_KEYCHAR); } strncpy(tstring, &value[next], nchar); /* copy string to temp buff */ tstring[nchar] = '\0'; ffs2c(tstring, valstring, status); /* put quotes around the string */ if (remain > nchar) /* if string is continued, put & as last char */ { vlen = strlen(valstring); nchar -= 1; /* outputting one less character now */ if (valstring[vlen-2] != '\'') valstring[vlen-2] = '&'; /* over write last char with & */ else { /* last char was a pair of single quotes, so over write both */ valstring[vlen-3] = '&'; valstring[vlen-1] = '\0'; } } if (contin) /* This is a CONTINUEd keyword */ { ffmkky("CONTINUE", valstring, comm, card, status); /* make keyword */ strncpy(&card[8], " ", 2); /* overwrite the '=' */ } else { ffmkky(keyname, valstring, comm, card, status); /* make keyword */ } ffikey(fptr, card, status); /* insert the keyword */ contin = 1; remain -= nchar; next += nchar; nchar = 68 - nquote; } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x198, %rsp # imm = 0x198 movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF movq %r8, 0x10(%rsp) movl (%r8), %eax testl %eax, %eax jg 0x96491 movq %rdx, %r14 movq %rsi, %r12 movq %rdi, 0x18(%rsp) movq %rcx, 0x20(%rsp) movq %rdx, %rdi callq 0x6280 movq %rax, %rbp movq %r14, %rdi movl $0x27, %esi callq 0x63c0 testq %rax, %rax movq %r14, 0x38(%rsp) je 0x962b7 xorl %r15d, %r15d incl %r15d incq %rax movq %rax, %rdi movl $0x27, %esi callq 0x63c0 testq %rax, %rax jne 0x9629d jmp 0x962ba xorl %r15d, %r15d leaq 0x140(%rsp), %r14 movl $0x50, %edx movq %r14, %rdi movq %r12, 0x30(%rsp) movq %r12, %rsi callq 0x64e0 movb $0x0, 0x50(%r14) leaq 0x13f(%rsp), %r12 cmpb $0x20, 0x1(%r12) leaq 0x1(%r12), %r12 je 0x962e4 movq %r12, %rdi callq 0x6280 movq %rax, %r14 cmpl $0x8, %r14d jg 0x96317 leaq 0x2c(%rsp), %rsi movq %r12, %rdi callq 0x375fc testl %eax, %eax jle 0x964a3 addl %r15d, %r14d movl $0x4b, %r12d subl %r14d, %r12d testl %ebp, %ebp jle 0x9646c movl $0x44, %eax subl %r15d, %eax movl %eax, 0x28(%rsp) xorl %r13d, %r13d movb $0x1, %al leaq 0x40(%rsp), %r14 cmpl $0x47, %r12d jge 0x96475 movl %eax, 0x8(%rsp) movl %r13d, 0xc(%rsp) movslq %r13d, %rsi addq 0x38(%rsp), %rsi movslq %r12d, %r15 leaq 0xf0(%rsp), %rbx movq %rbx, %rdi movq %r15, %rdx callq 0x64e0 movb $0x0, 0xf0(%rsp,%r15) movq %rbx, %rdi movq 0x10(%rsp), %rdx movq %r14, %rsi callq 0xaf552 cmpl %r12d, %ebp jle 0x963ea movq %r14, %rdi callq 0x6280 decl %r12d shlq $0x20, %rax movabsq $-0x200000000, %rcx # imm = 0xFFFFFFFE00000000 addq %rax, %rcx sarq $0x20, %rcx cmpb $0x27, 0x40(%rsp,%rcx) jne 0x963e5 movabsq $-0x300000000, %rcx # imm = 0xFFFFFFFD00000000 addq %rax, %rcx sarq $0x20, %rcx movb $0x26, 0x40(%rsp,%rcx) movabsq $-0x100000000, %rcx # imm = 0xFFFFFFFF00000000 addq %rcx, %rax sarq $0x20, %rax movb $0x0, 0x40(%rsp,%rax) jmp 0x963ea movb $0x26, 0x40(%rsp,%rcx) movq 0x20(%rsp), %rdx movq 0x18(%rsp), %r15 movl 0xc(%rsp), %r13d movl 0x8(%rsp), %eax testb $0x1, %al je 0x96420 movq 0x30(%rsp), %rdi movq %r14, %rsi leaq 0x90(%rsp), %rbx movq %rbx, %rcx movq 0x10(%rsp), %r8 callq 0x378ab jmp 0x96449 leaq 0x3fe1d(%rip), %rdi # 0xd6244 movq %r14, %rsi leaq 0x90(%rsp), %rbx movq %rbx, %rcx movq 0x10(%rsp), %r8 callq 0x378ab movw $0x2020, 0x98(%rsp) # imm = 0x2020 movq %r15, %rdi movq %rbx, %rsi movq 0x10(%rsp), %rdx callq 0x95f6f addl %r12d, %r13d xorl %eax, %eax subl %r12d, %ebp movl 0x28(%rsp), %r12d jg 0x96341 movq 0x10(%rsp), %rax movl (%rax), %eax jmp 0x96491 leaq 0x46d5f(%rip), %rdi # 0xdd1db callq 0x37264 movq 0x10(%rsp), %rax movl $0xcf, (%rax) movl $0xcf, %eax addq $0x198, %rsp # imm = 0x198 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0x44, %r12d subl %r15d, %r12d jmp 0x96323
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffikyj
int ffikyj(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ LONGLONG value, /* I - keyword value */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { char valstring[FLEN_VALUE]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); ffi2c(value, valstring, status); /* convert to formatted string */ ffmkky(keyname, valstring, comm, card, status); /* construct the keyword*/ ffikey(fptr, card, status); /* write the keyword*/ return(*status); }
movl (%r8), %eax testl %eax, %eax jle 0x96529 retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xa8, %rsp movq %r8, %rbx movq %rcx, %r15 movq %rsi, %r12 movq %rdi, %r14 movq %rsp, %r13 movq %rdx, %rdi movq %r13, %rsi movq %r8, %rdx callq 0xafdf2 leaq 0x50(%rsp), %rbp movq %r12, %rdi movq %r13, %rsi movq %r15, %rdx movq %rbp, %rcx movq %rbx, %r8 callq 0x378ab movq %r14, %rdi movq %rbp, %rsi movq %rbx, %rdx callq 0x95f6f movl (%rbx), %eax addq $0xa8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffikyf
int ffikyf(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ float value, /* I - keyword value */ int decim, /* I - no of decimals */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { char valstring[FLEN_VALUE]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); ffr2f(value, decim, valstring, status); /* convert to formatted string */ ffmkky(keyname, valstring, comm, card, status); /* construct the keyword*/ ffikey(fptr, card, status); /* write the keyword*/ return(*status); }
movl (%r8), %eax testl %eax, %eax jle 0x9659a retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xa8, %rsp movq %r8, %rbx movq %rcx, %r15 movq %rsi, %r12 movq %rdi, %r14 movq %rsp, %r13 movl %edx, %edi movq %r13, %rsi movq %r8, %rdx callq 0xafeec leaq 0x50(%rsp), %rbp movq %r12, %rdi movq %r13, %rsi movq %r15, %rdx movq %rbp, %rcx movq %rbx, %r8 callq 0x378ab movq %r14, %rdi movq %rbp, %rsi movq %rbx, %rdx callq 0x95f6f movl (%rbx), %eax addq $0xa8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffikyd
int ffikyd(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ double value, /* I - keyword value */ int decim, /* I - no of decimals */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { char valstring[FLEN_VALUE]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); ffd2e(value, decim, valstring, status); /* convert to formatted string */ ffmkky(keyname, valstring, comm, card, status); /* construct the keyword*/ ffikey(fptr, card, status); /* write the keyword*/ return(*status); }
movl (%r8), %eax testl %eax, %eax jle 0x966ea retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0xa8, %rsp movq %r8, %rbx movq %rcx, %r15 movq %rsi, %r12 movq %rdi, %r14 movq %rsp, %r13 movl %edx, %edi movq %r13, %rsi movq %r8, %rdx callq 0xb01c5 leaq 0x50(%rsp), %rbp movq %r12, %rdi movq %r13, %rsi movq %r15, %rdx movq %rbp, %rcx movq %rbx, %r8 callq 0x378ab movq %r14, %rdi movq %rbp, %rsi movq %rbx, %rdx callq 0x95f6f movl (%rbx), %eax addq $0xa8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffikfc
int ffikfc(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ float *value, /* I - keyword value */ int decim, /* I - no of decimals */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { char valstring[FLEN_VALUE], tmpstring[FLEN_VALUE]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); strcpy(valstring, "(" ); ffr2f(value[0], decim, tmpstring, status); /* convert to string */ if (strlen(tmpstring)+3 > FLEN_VALUE-1) { ffpmsg("complex key value too long (ffikfc)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ", "); ffr2f(value[1], decim, tmpstring, status); /* convert to string */ if (strlen(valstring) + strlen(tmpstring)+1 > FLEN_VALUE-1) { ffpmsg("complex key value too long (ffikfc)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ")"); ffmkky(keyname, valstring, comm, card, status); /* construct the keyword*/ ffikey(fptr, card, status); /* write the keyword*/ return(*status); }
movl (%r9), %eax testl %eax, %eax jle 0x9675a retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x108, %rsp # imm = 0x108 movq %r9, %rbx movq %r8, %r15 movl %ecx, %ebp movq %rdx, %r13 movq %rsi, %r12 movq %rdi, 0x8(%rsp) movw $0x28, 0x10(%rsp) movss (%rdx), %xmm0 leaq 0x60(%rsp), %r14 movl %ecx, %edi movq %r14, %rsi movq %r9, %rdx callq 0xafeec movq %r14, %rdi callq 0x6280 addq $-0x44, %rax cmpq $-0x48, %rax jbe 0x9680b leaq 0x10(%rsp), %r14 leaq 0x60(%rsp), %rsi movq %r14, %rdi callq 0x6330 movq %r14, %rdi callq 0x6280 movw $0x202c, 0x10(%rsp,%rax) # imm = 0x202C movb $0x0, 0x12(%rsp,%rax) movss 0x4(%r13), %xmm0 movl %ebp, %edi leaq 0x60(%rsp), %r13 movq %r13, %rsi movq %rbx, %rdx callq 0xafeec movq %r14, %rdi callq 0x6280 movq %rax, %r14 movq %r13, %rdi callq 0x6280 addq %r14, %rax addq $-0x46, %rax cmpq $-0x48, %rax ja 0x96824 leaq 0x469f4(%rip), %rdi # 0xdd206 callq 0x37264 movl $0x192, (%rbx) # imm = 0x192 movl $0x192, %eax # imm = 0x192 jmp 0x96873 leaq 0x10(%rsp), %r14 leaq 0x60(%rsp), %rsi movq %r14, %rdi callq 0x6330 movq %r14, %rdi callq 0x6280 movw $0x29, 0x10(%rsp,%rax) leaq 0xb0(%rsp), %r13 movq %r12, %rdi movq %r14, %rsi movq %r15, %rdx movq %r13, %rcx movq %rbx, %r8 callq 0x378ab movq 0x8(%rsp), %rdi movq %r13, %rsi movq %rbx, %rdx callq 0x95f6f movl (%rbx), %eax addq $0x108, %rsp # imm = 0x108 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffikyc
int ffikyc(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ float *value, /* I - keyword value */ int decim, /* I - no of decimals */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { char valstring[FLEN_VALUE], tmpstring[FLEN_VALUE]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); strcpy(valstring, "(" ); ffr2e(value[0], decim, tmpstring, status); /* convert to string */ if (strlen(tmpstring)+3 > FLEN_VALUE-1) { ffpmsg("complex key value too long (ffikyc)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ", "); ffr2e(value[1], decim, tmpstring, status); /* convert to string */ if (strlen(valstring) + strlen(tmpstring)+1 > FLEN_VALUE-1) { ffpmsg("complex key value too long (ffikyc)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ")"); ffmkky(keyname, valstring, comm, card, status); /* construct the keyword*/ ffikey(fptr, card, status); /* write the keyword*/ return(*status); }
movl (%r9), %eax testl %eax, %eax jle 0x9688d retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x108, %rsp # imm = 0x108 movq %r9, %rbx movq %r8, %r15 movl %ecx, %ebp movq %rdx, %r13 movq %rsi, %r12 movq %rdi, 0x8(%rsp) movw $0x28, 0x10(%rsp) movss (%rdx), %xmm0 leaq 0x60(%rsp), %r14 movl %ecx, %edi movq %r14, %rsi movq %r9, %rdx callq 0xaff99 movq %r14, %rdi callq 0x6280 addq $-0x44, %rax cmpq $-0x48, %rax jbe 0x9693e leaq 0x10(%rsp), %r14 leaq 0x60(%rsp), %rsi movq %r14, %rdi callq 0x6330 movq %r14, %rdi callq 0x6280 movw $0x202c, 0x10(%rsp,%rax) # imm = 0x202C movb $0x0, 0x12(%rsp,%rax) movss 0x4(%r13), %xmm0 movl %ebp, %edi leaq 0x60(%rsp), %r13 movq %r13, %rsi movq %rbx, %rdx callq 0xaff99 movq %r14, %rdi callq 0x6280 movq %rax, %r14 movq %r13, %rdi callq 0x6280 addq %r14, %rax addq $-0x46, %rax cmpq $-0x48, %rax ja 0x96957 leaq 0x468e5(%rip), %rdi # 0xdd22a callq 0x37264 movl $0x192, (%rbx) # imm = 0x192 movl $0x192, %eax # imm = 0x192 jmp 0x969a6 leaq 0x10(%rsp), %r14 leaq 0x60(%rsp), %rsi movq %r14, %rdi callq 0x6330 movq %r14, %rdi callq 0x6280 movw $0x29, 0x10(%rsp,%rax) leaq 0xb0(%rsp), %r13 movq %r12, %rdi movq %r14, %rsi movq %r15, %rdx movq %r13, %rcx movq %rbx, %r8 callq 0x378ab movq 0x8(%rsp), %rdi movq %r13, %rsi movq %rbx, %rdx callq 0x95f6f movl (%rbx), %eax addq $0x108, %rsp # imm = 0x108 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffikfm
int ffikfm(fitsfile *fptr, /* I - FITS file pointer */ const char *keyname, /* I - keyword name */ double *value, /* I - keyword value */ int decim, /* I - no of decimals */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ { char valstring[FLEN_VALUE], tmpstring[FLEN_VALUE]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); strcpy(valstring, "(" ); ffd2f(value[0], decim, tmpstring, status); /* convert to string */ if (strlen(tmpstring)+3 > FLEN_VALUE-1) { ffpmsg("complex key value too long (ffikfm)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ", "); ffd2f(value[1], decim, tmpstring, status); /* convert to string */ if (strlen(valstring) + strlen(tmpstring)+1 > FLEN_VALUE-1) { ffpmsg("complex key value too long (ffikfm)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ")"); ffmkky(keyname, valstring, comm, card, status); /* construct the keyword*/ ffikey(fptr, card, status); /* write the keyword*/ return(*status); }
movl (%r9), %eax testl %eax, %eax jle 0x969c0 retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x108, %rsp # imm = 0x108 movq %r9, %rbx movq %r8, %r15 movl %ecx, %ebp movq %rdx, %r13 movq %rsi, %r12 movq %rdi, 0x8(%rsp) movw $0x28, 0x10(%rsp) movsd (%rdx), %xmm0 leaq 0x60(%rsp), %r14 movl %ecx, %edi movq %r14, %rsi movq %r9, %rdx callq 0xb011c movq %r14, %rdi callq 0x6280 addq $-0x44, %rax cmpq $-0x48, %rax jbe 0x96a71 leaq 0x10(%rsp), %r14 leaq 0x60(%rsp), %rsi movq %r14, %rdi callq 0x6330 movq %r14, %rdi callq 0x6280 movw $0x202c, 0x10(%rsp,%rax) # imm = 0x202C movb $0x0, 0x12(%rsp,%rax) movsd 0x8(%r13), %xmm0 movl %ebp, %edi leaq 0x60(%rsp), %r13 movq %r13, %rsi movq %rbx, %rdx callq 0xb011c movq %r14, %rdi callq 0x6280 movq %rax, %r14 movq %r13, %rdi callq 0x6280 addq %r14, %rax addq $-0x46, %rax cmpq $-0x48, %rax ja 0x96a8a leaq 0x467d6(%rip), %rdi # 0xdd24e callq 0x37264 movl $0x192, (%rbx) # imm = 0x192 movl $0x192, %eax # imm = 0x192 jmp 0x96ad9 leaq 0x10(%rsp), %r14 leaq 0x60(%rsp), %rsi movq %r14, %rdi callq 0x6330 movq %r14, %rdi callq 0x6280 movw $0x29, 0x10(%rsp,%rax) leaq 0xb0(%rsp), %r13 movq %r12, %rdi movq %r14, %rsi movq %r15, %rdx movq %r13, %rcx movq %rbx, %r8 callq 0x378ab movq 0x8(%rsp), %rdi movq %r13, %rsi movq %rbx, %rdx callq 0x95f6f movl (%rbx), %eax addq $0x108, %rsp # imm = 0x108 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
ffdstr
int ffdstr(fitsfile *fptr, /* I - FITS file pointer */ const char *string, /* I - keyword name */ int *status) /* IO - error status */ /* delete a specified header keyword containing the input string */ { int keypos, len; char valstring[FLEN_VALUE], comm[FLEN_COMMENT], value[FLEN_VALUE]; char card[FLEN_CARD], message[FLEN_ERRMSG], nextcomm[FLEN_COMMENT]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (ffgstr(fptr, string, card, status) > 0) /* read keyword */ { snprintf(message, FLEN_ERRMSG,"Could not find the %s keyword to delete (ffdkey)", string); ffpmsg(message); return(*status); } /* calc position of keyword in header */ keypos = (int) ((((fptr->Fptr)->nextkey) - ((fptr->Fptr)->headstart[(fptr->Fptr)->curhdu])) / 80); ffdrec(fptr, keypos, status); /* delete the keyword */ /* check for string value which may be continued over multiple keywords */ ffpsvc(card, valstring, comm, status); if (*status > 0) /* inherit input status value if > 0 */ return(*status); /* check for string value which may be continued over multiple keywords */ ffpmrk(); /* put mark on message stack; erase any messages after this */ ffc2s(valstring, value, status); /* remove quotes and trailing spaces */ if (*status == VALUE_UNDEFINED) { ffcmrk(); /* clear any spurious error messages, back to the mark */ *status = 0; } else { len = strlen(value); while (len && value[len - 1] == '&') /* ampersand used as continuation char */ { ffgcnt(fptr, value, nextcomm, status); if (*value) { ffdrec(fptr, keypos, status); /* delete the keyword */ len = strlen(value); } else /* a null valstring indicates no continuation */ len = 0; } } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x1b8, %rsp # imm = 0x1B8 movl (%rdx), %ebp testl %ebp, %ebp jg 0x96db0 movq %rdx, %rbx movq %rsi, %r15 movq %rdi, %r14 leaq 0x100(%rsp), %rdx movq %rbx, %rcx callq 0x6e0d1 testl %eax, %eax jle 0x96cb9 leaq 0x46606(%rip), %rdx # 0xdd296 leaq 0xa0(%rsp), %r14 movl $0x51, %esi movq %r14, %rdi movq %r15, %rcx xorl %eax, %eax callq 0x60b0 movq %r14, %rdi callq 0x37264 movl (%rbx), %ebp jmp 0x96db0 movq 0x8(%r14), %rcx movq 0x68(%rcx), %rdx movq 0x80(%rcx), %rax movslq 0x54(%rcx), %rcx subq (%rdx,%rcx,8), %rax movabsq $0x6666666666666667, %rcx # imm = 0x6666666666666667 imulq %rcx movq %rdx, %r15 movq %rdx, %rax shrq $0x3f, %rax shrq $0x5, %r15 addl %eax, %r15d movq %r14, %rdi movl %r15d, %esi movq %rbx, %rdx callq 0x959e4 leaq 0x100(%rsp), %rdi leaq 0x50(%rsp), %rsi leaq 0xa0(%rsp), %rdx movq %rbx, %rcx callq 0x381ee movl (%rbx), %ebp testl %ebp, %ebp jg 0x96db0 callq 0x37511 leaq 0x50(%rsp), %rdi movq %rsp, %rsi movq %rbx, %rdx callq 0x3c9a1 movl (%rbx), %ebp cmpl $0xcc, %ebp jne 0x96d51 callq 0x37567 movl $0x0, (%rbx) xorl %ebp, %ebp jmp 0x96db0 movq %rsp, %rdi callq 0x6280 testl %eax, %eax je 0x96db0 movq %rsp, %r12 leaq 0x160(%rsp), %r13 decl %eax cltq cmpb $0x26, (%rsp,%rax) jne 0x96cb2 movq %r14, %rdi movq %r12, %rsi movq %r13, %rdx movq %rbx, %rcx callq 0x6e894 cmpb $0x0, (%rsp) je 0x96cb2 movq %r14, %rdi movl %r15d, %esi movq %rbx, %rdx callq 0x959e4 movq %r12, %rdi callq 0x6280 testl %eax, %eax jne 0x96d68 jmp 0x96cb2 movl %ebp, %eax addq $0x1b8, %rsp # imm = 0x1B8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/modkey.c
pl_p2li
int pl_p2li (int *pxsrc, int xs, short *lldst, int npix) /* int *pxsrc; input pixel array */ /* int xs; starting index in pxsrc (?) */ /* short *lldst; encoded line list */ /* int npix; number of pixels to convert */ { /* System generated locals */ int ret_val, i__1, i__2, i__3; /* Local variables */ int zero, v, x1, hi, ip, dv, xe, np, op, iz, nv = 0, pv, nz; /* Parameter adjustments */ --lldst; --pxsrc; /* Function Body */ if (! (npix <= 0)) { goto L110; } ret_val = 0; goto L100; L110: lldst[3] = -100; lldst[2] = 7; lldst[1] = 0; lldst[6] = 0; lldst[7] = 0; xe = xs + npix - 1; op = 8; zero = 0; /* Computing MAX */ i__1 = zero, i__2 = pxsrc[xs]; pv = max(i__1,i__2); x1 = xs; iz = xs; hi = 1; i__1 = xe; for (ip = xs; ip <= i__1; ++ip) { if (! (ip < xe)) { goto L130; } /* Computing MAX */ i__2 = zero, i__3 = pxsrc[ip + 1]; nv = max(i__2,i__3); if (! (nv == pv)) { goto L140; } goto L120; L140: if (! (pv == 0)) { goto L150; } pv = nv; x1 = ip + 1; goto L120; L150: goto L131; L130: if (! (pv == 0)) { goto L160; } x1 = xe + 1; L160: L131: np = ip - x1 + 1; nz = x1 - iz; if (! (pv > 0)) { goto L170; } dv = pv - hi; if (! (dv != 0)) { goto L180; } hi = pv; if (! (abs(dv) > 4095)) { goto L190; } lldst[op] = (short) ((pv & 4095) + 4096); ++op; lldst[op] = (short) (pv / 4096); ++op; goto L191; L190: if (! (dv < 0)) { goto L200; } lldst[op] = (short) (-dv + 12288); goto L201; L200: lldst[op] = (short) (dv + 8192); L201: ++op; if (! (np == 1 && nz == 0)) { goto L210; } v = lldst[op - 1]; lldst[op - 1] = (short) (v | 16384); goto L91; L210: L191: L180: L170: if (! (nz > 0)) { goto L220; } L230: if (! (nz > 0)) { goto L232; } lldst[op] = (short) min(4095,nz); ++op; /* L231: */ nz += -4095; goto L230; L232: if (! (np == 1 && pv > 0)) { goto L240; } lldst[op - 1] = (short) (lldst[op - 1] + 20481); goto L91; L240: L220: L250: if (! (np > 0)) { goto L252; } lldst[op] = (short) (min(4095,np) + 16384); ++op; /* L251: */ np += -4095; goto L250; L252: L91: x1 = ip + 1; iz = x1; pv = nv; L120: ; } /* L121: */ lldst[4] = (short) ((op - 1) % 32768); lldst[5] = (short) ((op - 1) / 32768); ret_val = op - 1; goto L100; L100: return ret_val; }
testl %ecx, %ecx jle 0x97015 pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx movw $0xff9c, 0x4(%rdx) # imm = 0xFF9C movl $0x70000, (%rdx) # imm = 0x70000 xorl %r8d, %r8d movl %r8d, 0xa(%rdx) movl %ecx, %eax addl %esi, %ecx addl %esi, %eax decl %eax movslq %esi, %r15 movq %rdi, -0x10(%rsp) movl -0x4(%rdi,%r15,4), %ebp testl %ebp, %ebp cmovlel %r8d, %ebp cltq movq %rax, -0x8(%rsp) movslq %ecx, %r9 movq %rdx, -0x20(%rsp) leaq -0x2(%rdx), %rax movq %rax, -0x18(%rsp) movl $0x1, %r13d movl $0x8, %r14d movabsq $0x100000000, %r11 # imm = 0x100000000 movl $0xfff, %ebx # imm = 0xFFF xorl %eax, %eax movl %esi, %r12d movl %ecx, %edx cmpq -0x8(%rsp), %r15 jge 0x96e6a leaq 0x1(%r15), %rdi movq -0x10(%rsp), %rax movl (%rax,%r15,4), %eax testl %eax, %eax movl $0x0, %ecx cmovlel %ecx, %eax cmpl %ebp, %eax jne 0x96e72 movl %r12d, %r10d movl %ebp, %eax jmp 0x96f7e testl %ebp, %ebp cmovel %edx, %r12d jmp 0x96e7a testl %ebp, %ebp je 0x96fd6 leal 0x1(%r15), %r10d movl %r12d, %edi subl %esi, %edi testl %ebp, %ebp jle 0x96edd movl %ebp, %ecx subl %r13d, %ecx jne 0x96e93 movl %ebp, %r13d jmp 0x96edd movl %ecx, %r8d negl %r8d cmovsl %ecx, %r8d movslq %r14d, %rsi cmpl $0x1000, %r8d # imm = 0x1000 jb 0x96f91 movl %ebp, %ecx andl $0xfff, %ecx # imm = 0xFFF orl $0x1000, %ecx # imm = 0x1000 movl %edx, %r8d movq -0x20(%rsp), %rdx movw %cx, -0x2(%rdx,%rsi,2) movl %ebp, %ecx shrl $0xc, %ecx movw %cx, (%rdx,%rsi,2) movl %r8d, %edx addl $0x2, %esi movl %ebp, %r13d movl %esi, %r14d testl %edi, %edi jle 0x96f29 movslq %r14d, %rsi movq -0x18(%rsp), %rcx leaq (%rcx,%rsi,2), %r8 shlq $0x20, %rsi addq %r11, %rsi leal -0xfff(%rdi), %ecx incl %r14d cmpl %ebx, %edi cmovael %ebx, %edi movw %di, (%r8) leaq 0x2(%r8), %r8 movl %ecx, %edi ja 0x96ef1 testl %ebp, %ebp jle 0x96f29 cmpl %r15d, %r12d jne 0x96f29 sarq $0x1f, %rsi movq -0x20(%rsp), %rcx addw $0x5001, -0x4(%rcx,%rsi) # imm = 0x5001 jmp 0x96f6f movl %r10d, %ecx subl %r12d, %ecx testl %ecx, %ecx jle 0x96f6f movslq %r14d, %rcx movq -0x18(%rsp), %rsi leaq (%rsi,%rcx,2), %rdi movl %r15d, %esi subl %r12d, %esi addl $0x1000, %esi # imm = 0x1000 addl $0xfffff001, %esi # imm = 0xFFFFF001 cmpl %ebx, %esi movl $0xfff, %ecx # imm = 0xFFF cmovbl %esi, %ecx orl $0x4000, %ecx # imm = 0x4000 movw %cx, (%rdi) addq $0x2, %rdi incl %r14d cmpl %ebx, %esi ja 0x96f4b movl %r13d, %ebp incq %r15 movq %r15, %rdi movl %ebp, %r13d movl %r15d, %esi movq %rdi, %r15 movl %eax, %ebp movl %r10d, %r12d cmpq %r9, %rdi jl 0x96e3e jmp 0x96fdb leal 0x2000(%rcx), %r14d movl $0x3000, %r8d # imm = 0x3000 subl %ecx, %r8d testl %ecx, %ecx cmovnsl %r14d, %r8d movq -0x20(%rsp), %rcx movw %r8w, -0x2(%rcx,%rsi,2) leal 0x1(%rsi), %r14d cmpl %r15d, %r12d jne 0x96e8e testl %edi, %edi jne 0x96e8e orl $0x4000, %r8d # imm = 0x4000 movw %r8w, -0x2(%rcx,%rsi,2) jmp 0x96f72 movl %edi, %r10d jmp 0x96f7e leal -0x1(%r14), %eax leal 0x7ffe(%r14), %ecx testl %eax, %eax cmovnsl %eax, %ecx movl %ecx, %edx andl $0xffff8000, %edx # imm = 0xFFFF8000 negl %edx addl %r14d, %edx decl %edx movq -0x20(%rsp), %rsi movw %dx, 0x6(%rsi) sarl $0xf, %ecx movw %cx, 0x8(%rsi) popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq xorl %eax, %eax retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/pliocomp.c
ffppx
int ffppx( fitsfile *fptr, /* I - FITS file pointer */ int datatype, /* I - datatype of the value */ long *firstpix, /* I - coord of first pixel to write(1 based) */ LONGLONG nelem, /* I - number of values to write */ void *array, /* I - array of values that are written */ int *status) /* IO - error status */ /* Write an array of pixels to the primary array. The datatype of the input array is defined by the 2nd argument. Data conversion and scaling will be performed if necessary (e.g, if the datatype of the FITS array is not the same as the array being written). This routine is simillar to ffppr, except it supports writing to large images with more than 2**31 pixels. */ { int naxis, ii; long group = 1; LONGLONG firstelem, dimsize = 1, naxes[9]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); /* get the size of the image */ ffgidm(fptr, &naxis, status); ffgiszll(fptr, 9, naxes, status); firstelem = 0; for (ii=0; ii < naxis; ii++) { firstelem += ((firstpix[ii] - 1) * dimsize); dimsize *= naxes[ii]; } firstelem++; if (datatype == TBYTE) { ffpprb(fptr, group, firstelem, nelem, (unsigned char *) array, status); } else if (datatype == TSBYTE) { ffpprsb(fptr, group, firstelem, nelem, (signed char *) array, status); } else if (datatype == TUSHORT) { ffpprui(fptr, group, firstelem, nelem, (unsigned short *) array, status); } else if (datatype == TSHORT) { ffppri(fptr, group, firstelem, nelem, (short *) array, status); } else if (datatype == TUINT) { ffppruk(fptr, group, firstelem, nelem, (unsigned int *) array, status); } else if (datatype == TINT) { ffpprk(fptr, group, firstelem, nelem, (int *) array, status); } else if (datatype == TULONG) { ffppruj(fptr, group, firstelem, nelem, (unsigned long *) array, status); } else if (datatype == TLONG) { ffpprj(fptr, group, firstelem, nelem, (long *) array, status); } else if (datatype == TULONGLONG) { ffpprujj(fptr, group, firstelem, nelem, (ULONGLONG *) array, status); } else if (datatype == TLONGLONG) { ffpprjj(fptr, group, firstelem, nelem, (LONGLONG *) array, status); } else if (datatype == TFLOAT) { ffppre(fptr, group, firstelem, nelem, (float *) array, status); } else if (datatype == TDOUBLE) { ffpprd(fptr, group, firstelem, nelem, (double *) array, status); } else *status = BAD_DATATYPE; return(*status); }
movl (%r9), %eax testl %eax, %eax jle 0x97394 retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %r9, %rbx movq %rdx, %r13 movl %esi, %ebp movq %rdi, %r12 movq %rcx, (%rsp) movq %r8, %r15 leaq 0xc(%rsp), %r14 movq %r14, %rsi movq %r9, %rdx callq 0x41290 leaq 0x10(%rsp), %rdx movq %r12, %rdi movl $0x9, %esi movq %rbx, %rcx callq 0x41438 movslq (%r14), %rax testq %rax, %rax jle 0x9740c movl $0x1, %ecx xorl %esi, %esi xorl %edx, %edx movq (%r13,%rsi,8), %rdi decq %rdi imulq %rcx, %rdi addq %rdi, %rdx imulq 0x10(%rsp,%rsi,8), %rcx incq %rsi cmpq %rsi, %rax jne 0x973ea incq %rdx jmp 0x97411 movl $0x1, %edx cmpl $0x27, %ebp movq (%rsp), %rcx jg 0x97452 cmpl $0x14, %ebp jg 0x9748a cmpl $0xb, %ebp je 0x974ec cmpl $0xc, %ebp je 0x97546 cmpl $0x14, %ebp jne 0x9759a movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xa76e4 jmp 0x975a0 cmpl $0x4f, %ebp jg 0x974bd cmpl $0x28, %ebp je 0x97504 cmpl $0x29, %ebp je 0x9755b cmpl $0x2a, %ebp jne 0x9759a movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0x9d598 jmp 0x975a0 cmpl $0x15, %ebp je 0x9751c cmpl $0x1e, %ebp je 0x97570 cmpl $0x1f, %ebp jne 0x9759a movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xa2ffc jmp 0x975a0 cmpl $0x50, %ebp je 0x97531 cmpl $0x51, %ebp je 0x97585 cmpl $0x52, %ebp jne 0x9759a movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0x9bda0 jmp 0x975a0 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0x9a650 jmp 0x975a0 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xa8d3c jmp 0x975a0 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0x9edc8 jmp 0x975a0 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xaa4a0 jmp 0x975a0 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xa54b8 jmp 0x975a0 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xa03f8 jmp 0x975a0 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xabb90 jmp 0x975a0 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xa1a27 jmp 0x975a0 movl $0x19a, (%rbx) # imm = 0x19A movl (%rbx), %eax addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcol.c
ffppxll
int ffppxll( fitsfile *fptr, /* I - FITS file pointer */ int datatype, /* I - datatype of the value */ LONGLONG *firstpix, /* I - coord of first pixel to write(1 based) */ LONGLONG nelem, /* I - number of values to write */ void *array, /* I - array of values that are written */ int *status) /* IO - error status */ /* Write an array of pixels to the primary array. The datatype of the input array is defined by the 2nd argument. Data conversion and scaling will be performed if necessary (e.g, if the datatype of the FITS array is not the same as the array being written). This routine is simillar to ffppr, except it supports writing to large images with more than 2**31 pixels. */ { int naxis, ii; long group = 1; LONGLONG firstelem, dimsize = 1, naxes[9]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); /* get the size of the image */ ffgidm(fptr, &naxis, status); ffgiszll(fptr, 9, naxes, status); firstelem = 0; for (ii=0; ii < naxis; ii++) { firstelem += ((firstpix[ii] - 1) * dimsize); dimsize *= naxes[ii]; } firstelem++; if (datatype == TBYTE) { ffpprb(fptr, group, firstelem, nelem, (unsigned char *) array, status); } else if (datatype == TSBYTE) { ffpprsb(fptr, group, firstelem, nelem, (signed char *) array, status); } else if (datatype == TUSHORT) { ffpprui(fptr, group, firstelem, nelem, (unsigned short *) array, status); } else if (datatype == TSHORT) { ffppri(fptr, group, firstelem, nelem, (short *) array, status); } else if (datatype == TUINT) { ffppruk(fptr, group, firstelem, nelem, (unsigned int *) array, status); } else if (datatype == TINT) { ffpprk(fptr, group, firstelem, nelem, (int *) array, status); } else if (datatype == TULONG) { ffppruj(fptr, group, firstelem, nelem, (unsigned long *) array, status); } else if (datatype == TLONG) { ffpprj(fptr, group, firstelem, nelem, (long *) array, status); } else if (datatype == TULONGLONG) { ffpprujj(fptr, group, firstelem, nelem, (ULONGLONG *) array, status); } else if (datatype == TLONGLONG) { ffpprjj(fptr, group, firstelem, nelem, (LONGLONG *) array, status); } else if (datatype == TFLOAT) { ffppre(fptr, group, firstelem, nelem, (float *) array, status); } else if (datatype == TDOUBLE) { ffpprd(fptr, group, firstelem, nelem, (double *) array, status); } else *status = BAD_DATATYPE; return(*status); }
movl (%r9), %eax testl %eax, %eax jle 0x975b9 retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %r9, %rbx movq %rdx, %r13 movl %esi, %ebp movq %rdi, %r12 movq %rcx, (%rsp) movq %r8, %r15 leaq 0xc(%rsp), %r14 movq %r14, %rsi movq %r9, %rdx callq 0x41290 leaq 0x10(%rsp), %rdx movq %r12, %rdi movl $0x9, %esi movq %rbx, %rcx callq 0x41438 movslq (%r14), %rax testq %rax, %rax jle 0x97631 movl $0x1, %ecx xorl %esi, %esi xorl %edx, %edx movq (%r13,%rsi,8), %rdi decq %rdi imulq %rcx, %rdi addq %rdi, %rdx imulq 0x10(%rsp,%rsi,8), %rcx incq %rsi cmpq %rsi, %rax jne 0x9760f incq %rdx jmp 0x97636 movl $0x1, %edx cmpl $0x27, %ebp movq (%rsp), %rcx jg 0x97677 cmpl $0x14, %ebp jg 0x976af cmpl $0xb, %ebp je 0x97711 cmpl $0xc, %ebp je 0x9776b cmpl $0x14, %ebp jne 0x977bf movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xa76e4 jmp 0x977c5 cmpl $0x4f, %ebp jg 0x976e2 cmpl $0x28, %ebp je 0x97729 cmpl $0x29, %ebp je 0x97780 cmpl $0x2a, %ebp jne 0x977bf movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0x9d598 jmp 0x977c5 cmpl $0x15, %ebp je 0x97741 cmpl $0x1e, %ebp je 0x97795 cmpl $0x1f, %ebp jne 0x977bf movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xa2ffc jmp 0x977c5 cmpl $0x50, %ebp je 0x97756 cmpl $0x51, %ebp je 0x977aa cmpl $0x52, %ebp jne 0x977bf movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0x9bda0 jmp 0x977c5 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0x9a650 jmp 0x977c5 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xa8d3c jmp 0x977c5 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0x9edc8 jmp 0x977c5 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xaa4a0 jmp 0x977c5 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xa54b8 jmp 0x977c5 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xa03f8 jmp 0x977c5 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xabb90 jmp 0x977c5 movl $0x1, %esi movq %r12, %rdi movq %r15, %r8 movq %rbx, %r9 callq 0xa1a27 jmp 0x977c5 movl $0x19a, (%rbx) # imm = 0x19A movl (%rbx), %eax addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcol.c
ffppxnll
int ffppxnll( fitsfile *fptr, /* I - FITS file pointer */ int datatype, /* I - datatype of the value */ LONGLONG *firstpix, /* I - first vector element to write(1 = 1st) */ LONGLONG nelem, /* I - number of values to write */ void *array, /* I - array of values that are written */ void *nulval, /* I - pointer to the null value */ int *status) /* IO - error status */ /* Write an array of values to the primary array. The datatype of the input array is defined by the 2nd argument. Data conversion and scaling will be performed if necessary (e.g, if the datatype of the FITS array is not the same as the array being written). This routine supports writing to large images with more than 2**31 pixels. */ { int naxis, ii; long group = 1; LONGLONG firstelem, dimsize = 1, naxes[9]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (nulval == NULL) /* null value not defined? */ { ffppxll(fptr, datatype, firstpix, nelem, array, status); return(*status); } /* get the size of the image */ ffgidm(fptr, &naxis, status); ffgiszll(fptr, 9, naxes, status); firstelem = 0; for (ii=0; ii < naxis; ii++) { firstelem += ((firstpix[ii] - 1) * dimsize); dimsize *= naxes[ii]; } firstelem++; if (datatype == TBYTE) { ffppnb(fptr, group, firstelem, nelem, (unsigned char *) array, *(unsigned char *) nulval, status); } else if (datatype == TSBYTE) { ffppnsb(fptr, group, firstelem, nelem, (signed char *) array, *(signed char *) nulval, status); } else if (datatype == TUSHORT) { ffppnui(fptr, group, firstelem, nelem, (unsigned short *) array, *(unsigned short *) nulval,status); } else if (datatype == TSHORT) { ffppni(fptr, group, firstelem, nelem, (short *) array, *(short *) nulval, status); } else if (datatype == TUINT) { ffppnuk(fptr, group, firstelem, nelem, (unsigned int *) array, *(unsigned int *) nulval, status); } else if (datatype == TINT) { ffppnk(fptr, group, firstelem, nelem, (int *) array, *(int *) nulval, status); } else if (datatype == TULONG) { ffppnuj(fptr, group, firstelem, nelem, (unsigned long *) array, *(unsigned long *) nulval,status); } else if (datatype == TLONG) { ffppnj(fptr, group, firstelem, nelem, (long *) array, *(long *) nulval, status); } else if (datatype == TULONGLONG) { ffppnujj(fptr, group, firstelem, nelem, (ULONGLONG *) array, *(ULONGLONG *) nulval, status); } else if (datatype == TLONGLONG) { ffppnjj(fptr, group, firstelem, nelem, (LONGLONG *) array, *(LONGLONG *) nulval, status); } else if (datatype == TFLOAT) { ffppne(fptr, group, firstelem, nelem, (float *) array, *(float *) nulval, status); } else if (datatype == TDOUBLE) { ffppnd(fptr, group, firstelem, nelem, (double *) array, *(double *) nulval, status); } else *status = BAD_DATATYPE; return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp movq 0xa0(%rsp), %r14 movl (%r14), %eax testl %eax, %eax jg 0x97b80 movq %r9, %r13 movq %rdx, %rbx movl %esi, %ebp movq %rdi, %r12 testq %r9, %r9 je 0x97b6d movq %rcx, 0x8(%rsp) movq %r8, 0x10(%rsp) leaq 0x1c(%rsp), %r15 movq %r12, %rdi movq %r15, %rsi movq %r14, %rdx callq 0x41290 leaq 0x20(%rsp), %rdx movq %r12, %rdi movl $0x9, %esi movq %r14, %rcx callq 0x41438 movslq (%r15), %rax testq %rax, %rax jle 0x97b8f movl $0x1, %ecx xorl %esi, %esi xorl %edx, %edx movq (%rbx,%rsi,8), %rdi decq %rdi imulq %rcx, %rdi addq %rdi, %rdx imulq 0x20(%rsp,%rsi,8), %rcx incq %rsi cmpq %rsi, %rax jne 0x97b4c incq %rdx jmp 0x97b94 movq %r12, %rdi movl %ebp, %esi movq %rbx, %rdx movq %r14, %r9 callq 0x975b1 movl (%r14), %eax addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0x1, %edx movq 0xa0(%rsp), %r14 cmpl $0x27, %ebp jg 0x97be7 cmpl $0x14, %ebp jg 0x97c2c cmpl $0xb, %ebp je 0x97cab cmpl $0xc, %ebp je 0x97d3d cmpl $0x14, %ebp jne 0x97dce movzwl (%r13), %r9d movq %r14, (%rsp) movl $0x1, %esi movq %r12, %rdi movq 0x8(%rsp), %rcx movq 0x10(%rsp), %r8 callq 0xa7c2e jmp 0x97b7d cmpl $0x4f, %ebp jg 0x97c6b cmpl $0x28, %ebp je 0x97cd0 cmpl $0x29, %ebp je 0x97d62 cmpl $0x2a, %ebp jne 0x97dce movss (%r13), %xmm0 movl $0x1, %esi movq %r12, %rdi movq 0x8(%rsp), %rcx movq 0x10(%rsp), %r8 movq %r14, %r9 callq 0x9db89 jmp 0x97b7d cmpl $0x15, %ebp je 0x97cf4 cmpl $0x1e, %ebp je 0x97d86 cmpl $0x1f, %ebp jne 0x97dce movl (%r13), %r9d movq %r14, (%rsp) movl $0x1, %esi movq %r12, %rdi movq 0x8(%rsp), %rcx movq 0x10(%rsp), %r8 callq 0xa355c jmp 0x97b7d cmpl $0x50, %ebp je 0x97d19 cmpl $0x51, %ebp je 0x97daa cmpl $0x52, %ebp jne 0x97dce movsd (%r13), %xmm0 movl $0x1, %esi movq %r12, %rdi movq 0x8(%rsp), %rcx movq 0x10(%rsp), %r8 movq %r14, %r9 callq 0x9c385 jmp 0x97b7d movzbl (%r13), %r9d movq %r14, (%rsp) movl $0x1, %esi movq %r12, %rdi movq 0x8(%rsp), %rcx movq 0x10(%rsp), %r8 callq 0x9ace3 jmp 0x97b7d movq (%r13), %r9 movq %r14, (%rsp) movl $0x1, %esi movq %r12, %rdi movq 0x8(%rsp), %rcx movq 0x10(%rsp), %r8 callq 0xa9284 jmp 0x97b7d movswl (%r13), %r9d movq %r14, (%rsp) movl $0x1, %esi movq %r12, %rdi movq 0x8(%rsp), %rcx movq 0x10(%rsp), %r8 callq 0x9f328 jmp 0x97b7d movq (%r13), %r9 movq %r14, (%rsp) movl $0x1, %esi movq %r12, %rdi movq 0x8(%rsp), %rcx movq 0x10(%rsp), %r8 callq 0xaa9dc jmp 0x97b7d movsbl (%r13), %r9d movq %r14, (%rsp) movl $0x1, %esi movq %r12, %rdi movq 0x8(%rsp), %rcx movq 0x10(%rsp), %r8 callq 0xa5a5f jmp 0x97b7d movq (%r13), %r9 movq %r14, (%rsp) movl $0x1, %esi movq %r12, %rdi movq 0x8(%rsp), %rcx movq 0x10(%rsp), %r8 callq 0xa0956 jmp 0x97b7d movl (%r13), %r9d movq %r14, (%rsp) movl $0x1, %esi movq %r12, %rdi movq 0x8(%rsp), %rcx movq 0x10(%rsp), %r8 callq 0xac0da jmp 0x97b7d movq (%r13), %r9 movq %r14, (%rsp) movl $0x1, %esi movq %r12, %rdi movq 0x8(%rsp), %rcx movq 0x10(%rsp), %r8 callq 0xa1f79 jmp 0x97b7d movl $0x19a, (%r14) # imm = 0x19A jmp 0x97b7d
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcol.c
ffpss
int ffpss( fitsfile *fptr, /* I - FITS file pointer */ int datatype, /* I - datatype of the value */ long *blc, /* I - 'bottom left corner' of the subsection */ long *trc , /* I - 'top right corner' of the subsection */ void *array, /* I - array of values that are written */ int *status) /* IO - error status */ /* Write a section of values to the primary array. The datatype of the input array is defined by the 2nd argument. Data conversion and scaling will be performed if necessary (e.g, if the datatype of the FITS array is not the same as the array being written). This routine supports writing to large images with more than 2**31 pixels. */ { int naxis; long naxes[9]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); /* get the size of the image */ ffgidm(fptr, &naxis, status); ffgisz(fptr, 9, naxes, status); if (datatype == TBYTE) { ffpssb(fptr, 1, naxis, naxes, blc, trc, (unsigned char *) array, status); } else if (datatype == TSBYTE) { ffpsssb(fptr, 1, naxis, naxes, blc, trc, (signed char *) array, status); } else if (datatype == TUSHORT) { ffpssui(fptr, 1, naxis, naxes, blc, trc, (unsigned short *) array, status); } else if (datatype == TSHORT) { ffpssi(fptr, 1, naxis, naxes, blc, trc, (short *) array, status); } else if (datatype == TUINT) { ffpssuk(fptr, 1, naxis, naxes, blc, trc, (unsigned int *) array, status); } else if (datatype == TINT) { ffpssk(fptr, 1, naxis, naxes, blc, trc, (int *) array, status); } else if (datatype == TULONG) { ffpssuj(fptr, 1, naxis, naxes, blc, trc, (unsigned long *) array, status); } else if (datatype == TLONG) { ffpssj(fptr, 1, naxis, naxes, blc, trc, (long *) array, status); } else if (datatype == TULONGLONG) { ffpssujj(fptr, 1, naxis, naxes, blc, trc, (ULONGLONG *) array, status); } else if (datatype == TLONGLONG) { ffpssjj(fptr, 1, naxis, naxes, blc, trc, (LONGLONG *) array, status); } else if (datatype == TFLOAT) { ffpsse(fptr, 1, naxis, naxes, blc, trc, (float *) array, status); } else if (datatype == TDOUBLE) { ffpssd(fptr, 1, naxis, naxes, blc, trc, (double *) array, status); } else *status = BAD_DATATYPE; return(*status); }
movl (%r9), %eax testl %eax, %eax jle 0x980d4 retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x58, %rsp movq %r9, %rbx movq %r8, %r14 movq %rcx, %r15 movq %rdx, %r12 movl %esi, %ebp movq %rdi, %r13 leaq 0xc(%rsp), %rsi movq %r9, %rdx callq 0x41290 leaq 0x10(%rsp), %rdx movq %r13, %rdi movl $0x9, %esi movq %rbx, %rcx callq 0x4130e cmpl $0x27, %ebp jg 0x98163 cmpl $0x14, %ebp jg 0x981ac cmpl $0xb, %ebp je 0x9822c cmpl $0xc, %ebp je 0x982c0 cmpl $0x14, %ebp jne 0x9835b movslq 0xc(%rsp), %rdx leaq 0x10(%rsp), %rcx movl $0x1, %esi movq %r13, %rdi movq %r12, %r8 movq %r15, %r9 pushq %rbx pushq %r14 callq 0xa826d jmp 0x98346 cmpl $0x4f, %ebp jg 0x981ec cmpl $0x28, %ebp je 0x98251 cmpl $0x29, %ebp je 0x982e2 cmpl $0x2a, %ebp jne 0x9835b movslq 0xc(%rsp), %rdx leaq 0x10(%rsp), %rcx movl $0x1, %esi movq %r13, %rdi movq %r12, %r8 movq %r15, %r9 pushq %rbx pushq %r14 callq 0x9e225 jmp 0x98346 cmpl $0x15, %ebp je 0x98276 cmpl $0x1e, %ebp je 0x98304 cmpl $0x1f, %ebp jne 0x9835b movslq 0xc(%rsp), %rdx leaq 0x10(%rsp), %rcx movl $0x1, %esi movq %r13, %rdi movq %r12, %r8 movq %r15, %r9 pushq %rbx pushq %r14 callq 0xa3b97 jmp 0x98346 cmpl $0x50, %ebp je 0x9829b cmpl $0x51, %ebp je 0x98326 cmpl $0x52, %ebp jne 0x9835b movslq 0xc(%rsp), %rdx leaq 0x10(%rsp), %rcx movl $0x1, %esi movq %r13, %rdi movq %r12, %r8 movq %r15, %r9 pushq %rbx pushq %r14 callq 0x9ca27 jmp 0x98346 movslq 0xc(%rsp), %rdx leaq 0x10(%rsp), %rcx movl $0x1, %esi movq %r13, %rdi movq %r12, %r8 movq %r15, %r9 pushq %rbx pushq %r14 callq 0x9b301 jmp 0x98346 movslq 0xc(%rsp), %rdx leaq 0x10(%rsp), %rcx movl $0x1, %esi movq %r13, %rdi movq %r12, %r8 movq %r15, %r9 pushq %rbx pushq %r14 callq 0xa98be jmp 0x98346 movslq 0xc(%rsp), %rdx leaq 0x10(%rsp), %rcx movl $0x1, %esi movq %r13, %rdi movq %r12, %r8 movq %r15, %r9 pushq %rbx pushq %r14 callq 0x9f967 jmp 0x98346 movslq 0xc(%rsp), %rdx leaq 0x10(%rsp), %rcx movl $0x1, %esi movq %r13, %rdi movq %r12, %r8 movq %r15, %r9 pushq %rbx pushq %r14 callq 0xaafc7 jmp 0x98346 movslq 0xc(%rsp), %rdx leaq 0x10(%rsp), %rcx movl $0x1, %esi movq %r13, %rdi movq %r12, %r8 movq %r15, %r9 pushq %rbx pushq %r14 callq 0xa607d jmp 0x98346 movslq 0xc(%rsp), %rdx leaq 0x10(%rsp), %rcx movl $0x1, %esi movq %r13, %rdi movq %r12, %r8 movq %r15, %r9 pushq %rbx pushq %r14 callq 0xa0f90 jmp 0x98346 movslq 0xc(%rsp), %rdx leaq 0x10(%rsp), %rcx movl $0x1, %esi movq %r13, %rdi movq %r12, %r8 movq %r15, %r9 pushq %rbx pushq %r14 callq 0xac715 jmp 0x98346 movslq 0xc(%rsp), %rdx leaq 0x10(%rsp), %rcx movl $0x1, %esi movq %r13, %rdi movq %r12, %r8 movq %r15, %r9 pushq %rbx pushq %r14 callq 0xa2564 addq $0x10, %rsp movl (%rbx), %eax addq $0x58, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl $0x19a, (%rbx) # imm = 0x19A jmp 0x9834a
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcol.c
ffpcl
int ffpcl( fitsfile *fptr, /* I - FITS file pointer */ int datatype, /* I - datatype of the value */ int colnum, /* I - number of column to write (1 = 1st col) */ LONGLONG firstrow, /* I - first row to write (1 = 1st row) */ LONGLONG firstelem, /* I - first vector element to write (1 = 1st) */ LONGLONG nelem, /* I - number of elements to write */ void *array, /* I - array of values that are written */ int *status) /* IO - error status */ /* Write an array of values to a table column. The datatype of the input array is defined by the 2nd argument. Data conversion and scaling will be performed if necessary (e.g, if the datatype of the FITS column is not the same as the array being written). */ { if (*status > 0) /* inherit input status value if > 0 */ return(*status); if (datatype == TBIT) { ffpclx(fptr, colnum, firstrow, (long) firstelem, (long) nelem, (char *) array, status); } else if (datatype == TBYTE) { ffpclb(fptr, colnum, firstrow, firstelem, nelem, (unsigned char *) array, status); } else if (datatype == TSBYTE) { ffpclsb(fptr, colnum, firstrow, firstelem, nelem, (signed char *) array, status); } else if (datatype == TUSHORT) { ffpclui(fptr, colnum, firstrow, firstelem, nelem, (unsigned short *) array, status); } else if (datatype == TSHORT) { ffpcli(fptr, colnum, firstrow, firstelem, nelem, (short *) array, status); } else if (datatype == TUINT) { ffpcluk(fptr, colnum, firstrow, firstelem, nelem, (unsigned int *) array, status); } else if (datatype == TINT) { ffpclk(fptr, colnum, firstrow, firstelem, nelem, (int *) array, status); } else if (datatype == TULONG) { ffpcluj(fptr, colnum, firstrow, firstelem, nelem, (unsigned long *) array, status); } else if (datatype == TLONG) { ffpclj(fptr, colnum, firstrow, firstelem, nelem, (long *) array, status); } else if (datatype == TULONGLONG) { ffpclujj(fptr, colnum, firstrow, firstelem, nelem, (ULONGLONG *) array, status); } else if (datatype == TLONGLONG) { ffpcljj(fptr, colnum, firstrow, firstelem, nelem, (LONGLONG *) array, status); } else if (datatype == TFLOAT) { ffpcle(fptr, colnum, firstrow, firstelem, nelem, (float *) array, status); } else if (datatype == TDOUBLE) { ffpcld(fptr, colnum, firstrow, firstelem, nelem, (double *) array, status); } else if (datatype == TCOMPLEX) { ffpcle(fptr, colnum, firstrow, (firstelem - 1) * 2 + 1, nelem * 2, (float *) array, status); } else if (datatype == TDBLCOMPLEX) { ffpcld(fptr, colnum, firstrow, (firstelem - 1) * 2 + 1, nelem * 2, (double *) array, status); } else if (datatype == TLOGICAL) { ffpcll(fptr, colnum, firstrow, firstelem, nelem, (char *) array, status); } else if (datatype == TSTRING) { ffpcls(fptr, colnum, firstrow, firstelem, nelem, (char **) array, status); } else *status = BAD_DATATYPE; return(*status); }
pushq %rbx subq $0x10, %rsp movq 0x28(%rsp), %rbx movl (%rbx), %eax testl %eax, %eax jg 0x9859b movq %r9, %r10 movq 0x20(%rsp), %r9 cmpl $0x1e, %esi jle 0x983be cmpl $0x29, %esi jle 0x983ef leal -0x50(%rsi), %eax cmpl $0x3, %eax ja 0x98446 leaq 0x44fc0(%rip), %rsi # 0xdd35c movslq (%rsi,%rax,4), %rax addq %rsi, %rax jmpq *%rax movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx movq %r10, %r8 callq 0xaa51a jmp 0x98599 leal -0xb(%rsi), %eax cmpl $0xa, %eax ja 0x9841f leaq 0x44f63(%rip), %rsi # 0xdd330 movslq (%rsi,%rax,4), %rax addq %rsi, %rax jmpq *%rax movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx movq %r10, %r8 callq 0x9a6d8 jmp 0x98599 cmpl $0x1f, %esi je 0x98473 cmpl $0x28, %esi je 0x9848c cmpl $0x29, %esi jne 0x984a5 movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx movq %r10, %r8 callq 0xa047e jmp 0x98599 cmpl $0x1, %esi je 0x9852a cmpl $0x1e, %esi jne 0x984a5 movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx movq %r10, %r8 callq 0xabc18 jmp 0x98599 cmpl $0x2a, %esi je 0x98540 cmpl $0xa3, %esi jne 0x984a5 leaq -0x1(,%r8,2), %rax addq %r10, %r10 movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %rax, %rcx jmp 0x9855a movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx movq %r10, %r8 callq 0xa3084 jmp 0x98599 movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx movq %r10, %r8 callq 0xa8dc2 jmp 0x98599 movl $0x19a, (%rbx) # imm = 0x19A jmp 0x98599 movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx movq %r10, %r8 callq 0xa4dcc jmp 0x98599 movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx movq %r10, %r8 callq 0xa461c jmp 0x98599 movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx movq %r10, %r8 callq 0xa776c jmp 0x98599 movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx movq %r10, %r8 callq 0xa5540 jmp 0x98599 movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx movq %r10, %r8 callq 0x9ee50 jmp 0x98599 movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx movq %r10, %r8 callq 0xa499b jmp 0x98599 movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx jmp 0x9857b movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx movq %r10, %r8 callq 0x9be26 jmp 0x98599 leaq -0x1(,%r8,2), %rax addq %r10, %r10 movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %rax, %rcx movq %r10, %r8 callq 0x9d620 jmp 0x98599 movq %rbx, (%rsp) movl %edx, %esi movq %rcx, %rdx movq %r8, %rcx movq %r10, %r8 callq 0xa1aa1 movl (%rbx), %eax addq $0x10, %rsp popq %rbx retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcol.c
ffpcln
int ffpcln( fitsfile *fptr, /* I - FITS file pointer */ int ncols, /* I - number of columns to write */ int *datatype, /* I - datatypes of the values */ int *colnum, /* I - columns numbers to write (1 = 1st col) */ LONGLONG firstrow, /* I - first row to write (1 = 1st row) */ LONGLONG nrows, /* I - number of rows to write */ void **array, /* I - array of pointers to values to write */ void **nulval, /* I - array of pointers to values for undefined pixels */ int *status) /* IO - error status */ /* Write arrays of values to NCOLS table columns. This is an optimization to write all columns in one pass through the table. The datatypes of the input arrays are defined by the 3rd argument. Data conversion and scaling will be performed if necessary (e.g, if the datatype of the FITS array is not the same as the array being written). Undefined elements for column i that are equal to *(nulval[i]) are set to the defined null value, unless nulval[i]=0, in which case no checking for undefined values will be performed. */ { LONGLONG ntotrows, ndone, nwrite, currow; long nrowbuf; LONGLONG *repeats = 0; size_t sizes[255] = {0}; int icol; sizes[TBYTE] = sizes[TSBYTE] = sizes[TLOGICAL] = sizeof(char); sizes[TUSHORT] = sizes[TSHORT] = sizeof(short int); sizes[TINT] = sizes[TUINT] = sizeof(int); sizes[TLONG] = sizes[TULONG] = sizeof(long int); sizes[TLONGLONG] = sizes[TULONGLONG] = sizeof(LONGLONG); sizes[TFLOAT] = sizeof(float); sizes[TDOUBLE] = sizeof(double); sizes[TDBLCOMPLEX] = 2*sizeof(double); if (*status > 0) return(*status); if (ncols <= 0) return (*status=0); repeats = malloc(sizeof(LONGLONG)*ncols); if (repeats == 0) return (*status=MEMORY_ALLOCATION); fits_get_num_rowsll(fptr, &ntotrows, status); fits_get_rowsize(fptr, &nrowbuf, status); /* Retrieve column repeats */ for (icol = 0; (icol < ncols) && (icol < 1000); icol++) { int typecode; LONGLONG repeat, width; fits_get_coltypell(fptr, colnum[icol], &typecode, &repeat, &width, status); repeats[icol] = repeat; if (datatype[icol] == TBIT || datatype[icol] == TSTRING || sizes[datatype[icol]] == 0) { ffpmsg("Cannot write to TBIT or TSTRING datatypes (ffpcln)"); *status = BAD_DATATYPE; } if (typecode < 0) { ffpmsg("Cannot write to variable-length data (ffpcln)"); *status = BAD_DIMEN; } if (*status) break; } if (*status) { free(repeats); return *status; } /* Optimize for 1 column */ if (ncols == 1) { fits_write_colnull(fptr, datatype[0], colnum[0], firstrow, 1, nrows*repeats[0], array[0], nulval[0], status); free(repeats); return *status; } /* Scan through file, in chunks of nrowbuf */ currow = firstrow; ndone = 0; while (ndone < nrows) { int icol; nwrite = (nrows-ndone); if (nwrite > nrowbuf) nwrite = nrowbuf; for (icol=0; icol<ncols; icol++) { LONGLONG nelem1 = (nwrite*repeats[icol]); char *array1 = (char *) array[icol] + repeats[icol]*ndone*sizes[datatype[icol]]; fits_write_colnull(fptr, datatype[icol], colnum[icol], ndone+1, 1, nelem1, array1, nulval[icol], status); if (*status) { char errmsg[100]; sprintf(errmsg, "Failed to write column %d data rows %lld-%lld (ffpcln)", colnum[icol], currow, currow+nwrite-1); ffpmsg(errmsg); break; } } if (*status) break; currow += nwrite; ndone += nwrite; } free(repeats); return *status; }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x8c8, %rsp # imm = 0x8C8 movq %r9, 0x18(%rsp) movq %r8, 0x8(%rsp) movq %rcx, 0x20(%rsp) movq %rdx, %rbx movl %esi, %ebp movq %rdi, %r12 movq 0x910(%rsp), %r13 leaq 0xd0(%rsp), %r14 movl $0x7f8, %edx # imm = 0x7F8 movq %r14, %rdi xorl %esi, %esi callq 0x6090 movl $0x1, %eax movq %rax, 0x70(%r14) movq %rax, 0x60(%r14) movq %rax, 0x58(%r14) movl $0x2, %eax movq %rax, 0xa8(%r14) movq %rax, 0xa0(%r14) movl $0x4, %eax movq %rax, 0xf0(%r14) movq %rax, 0xf8(%r14) movl $0x8, %ecx movq %rcx, 0x140(%r14) movq %rcx, 0x148(%r14) movq %rcx, 0x280(%r14) movq %rcx, 0x288(%r14) movq %rax, 0x150(%r14) movq %rcx, 0x290(%r14) movq $0x10, 0x518(%r14) movl (%r13), %r15d testl %r15d, %r15d jle 0x988d9 movl %r15d, %eax addq $0x8c8, %rsp # imm = 0x8C8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq 0x20(%rsp), %r15 testl %ebp, %ebp jle 0x98a2c movl %ebp, %eax movq %rax, 0x40(%rsp) leaq (,%rax,8), %rdi callq 0x61a0 movq %rax, 0x10(%rsp) testq %rax, %rax je 0x98a3c movq %rbx, 0x28(%rsp) leaq 0x58(%rsp), %rsi movq %r12, %rdi movq %r13, %rdx callq 0x3b996 leaq 0x48(%rsp), %rsi movq %r12, %rdi movq %r13, %rdx callq 0xc2bd1 movq %rbp, 0x38(%rsp) leal -0x1(%rbp), %eax movl $0x3e7, %ebx # imm = 0x3E7 cmpl %ebx, %eax cmovbl %eax, %ebx incl %ebx xorl %r14d, %r14d movq %r15, %rbp movl (%rbp,%r14,4), %esi movq %r12, %rdi leaq 0x34(%rsp), %rdx leaq 0x60(%rsp), %rcx leaq 0x50(%rsp), %r8 movq %r13, %r9 callq 0x3b38e movq 0x60(%rsp), %rax movq 0x10(%rsp), %rcx movq %rax, (%rcx,%r14,8) movq 0x28(%rsp), %rax movslq (%rax,%r14,4), %rax cmpq $0x1, %rax je 0x98993 cmpl $0x10, %eax je 0x98993 cmpq $0x0, 0xd0(%rsp,%rax,8) jne 0x989a7 leaq 0x44a8e(%rip), %rdi # 0xdd428 callq 0x37264 movl $0x19a, (%r13) # imm = 0x19A cmpl $0x0, 0x34(%rsp) js 0x98a4f movl (%r13), %r15d testl %r15d, %r15d jne 0x98a69 incq %r14 cmpq %r14, %rbx jne 0x98947 cmpl $0x1, 0x38(%rsp) jne 0x98a78 movq 0x28(%rsp), %rax movl (%rax), %esi movl (%rbp), %edx movq 0x10(%rsp), %rbx movq 0x18(%rsp), %r9 imulq (%rbx), %r9 subq $0x8, %rsp movl $0x1, %r8d movq %r12, %rdi movq 0x10(%rsp), %rcx pushq %r13 movq 0x918(%rsp), %rax pushq (%rax) movq 0x918(%rsp), %rax pushq (%rax) callq 0x985a1 addq $0x20, %rsp movq %rbx, %rdi callq 0x6260 movl (%r13), %r15d jmp 0x988c4 movl $0x0, (%r13) xorl %r15d, %r15d jmp 0x988c4 movl $0x71, (%r13) movl $0x71, %r15d jmp 0x988c4 leaq 0x44a05(%rip), %rdi # 0xdd45b callq 0x37264 movl $0x140, (%r13) # imm = 0x140 movl $0x140, %r15d # imm = 0x140 movq 0x10(%rsp), %rdi callq 0x6260 jmp 0x988c4 xorl %esi, %esi movq 0x18(%rsp), %rcx movq 0x8(%rsp), %rdx movq %rcx, %rax subq %rsi, %rax jle 0x98bad movq %rdx, 0x8(%rsp) movq 0x48(%rsp), %rdx cmpq %rdx, %rax cmovlq %rax, %rdx leaq 0x1(%rsi), %r14 xorl %ebp, %ebp movq 0x10(%rsp), %rax movq (%rax,%rbp,8), %rax movq %rax, %r9 movq %rsi, %rbx imulq %rsi, %rax movq 0x28(%rsp), %rcx movslq (%rcx,%rbp,4), %rsi imulq 0xd0(%rsp,%rsi,8), %rax movq %rdx, %r15 imulq %rdx, %r9 movq 0x900(%rsp), %rcx addq (%rcx,%rbp,8), %rax movq 0x20(%rsp), %rcx movl (%rcx,%rbp,4), %edx subq $0x8, %rsp movl $0x1, %r8d movq %r12, %r13 movq %r12, %rdi movq %r14, %rcx movq 0x918(%rsp), %r12 pushq %r12 movq 0x918(%rsp), %r10 pushq (%r10,%rbp,8) pushq %rax callq 0x985a1 addq $0x20, %rsp cmpl $0x0, (%r12) jne 0x98b47 incq %rbp cmpq %rbp, 0x40(%rsp) movq %r13, %r12 movq %rbx, %rsi movq %r15, %rdx jne 0x98aa7 xorl %r15d, %r15d movq 0x18(%rsp), %rcx movq 0x8(%rsp), %r12 jmp 0x98b93 movq 0x20(%rsp), %r14 movl (%r14,%rbp,4), %edx movq 0x8(%rsp), %r12 leaq (%r12,%r15), %r8 decq %r8 leaq 0x60(%rsp), %r14 movq %r14, %rdi leaq 0x4491e(%rip), %rsi # 0xdd489 movq %r12, %rcx xorl %eax, %eax callq 0x62d0 movq %r14, %rdi callq 0x37264 movq %r15, %rdx movq 0x910(%rsp), %rax movl (%rax), %r15d movq 0x18(%rsp), %rcx movq %rbx, %rsi addq %rdx, %r12 addq %rdx, %rsi testl %r15d, %r15d movq %r12, %rdx movq %r13, %r12 je 0x98a84 jmp 0x98a69 xorl %r15d, %r15d jmp 0x98a69
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcol.c
fits_iter_set_by_name
int fits_iter_set_by_name(iteratorCol *col, /* I - iterator col structure */ fitsfile *fptr, /* I - FITS file pointer */ char *colname, /* I - column name */ int datatype, /* I - column datatype */ int iotype) /* I - InputCol, InputOutputCol, or OutputCol */ /* set all the parameters for an iterator column, by column name */ { col->fptr = fptr; strncpy(col->colname, colname,69); col->colname[69]=0; col->colnum = 0; /* set column number undefined since name is given */ col->datatype = datatype; col->iotype = iotype; return(0); }
pushq %rbp pushq %r14 pushq %rbx movl %r8d, %ebx movl %ecx, %ebp movq %rdx, %rax movq %rdi, %r14 movq %rsi, (%rdi) addq $0xc, %rdi movl $0x45, %edx movq %rax, %rsi callq 0x64e0 movb $0x0, 0x51(%r14) movl $0x0, 0x8(%r14) movl %ebp, 0x54(%r14) movl %ebx, 0x58(%r14) xorl %eax, %eax popq %rbx popq %r14 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcol.c
ffpclb
int ffpclb( fitsfile *fptr, /* I - FITS file pointer */ int colnum, /* I - number of column to write (1 = 1st col) */ LONGLONG firstrow, /* I - first row to write (1 = 1st row) */ LONGLONG firstelem, /* I - first vector element to write (1 = 1st) */ LONGLONG nelem, /* I - number of values to write */ unsigned char *array, /* I - array of values to write */ int *status) /* IO - error status */ /* Write an array of values to a column in the current FITS HDU. The column number may refer to a real column in an ASCII or binary table, or it may refer to a virtual column in a 1 or more grouped FITS primary array. FITSIO treats a primary array as a binary table with 2 vector columns: the first column contains the group parameters (often with length = 0) and the second column contains the array of image pixels. Each row of the table represents a group in the case of multigroup FITS images. The input array of values will be converted to the datatype of the column and will be inverse-scaled by the FITS TSCALn and TZEROn values if necessary. */ { int writemode; int tcode, maxelem2, hdutype, writeraw; long twidth, incre; long ntodo; LONGLONG repeat, startpos, elemnum, wrtptr, rowlen, rownum, remain, next, tnull, maxelem; double scale, zero; char tform[20], cform[20]; char message[FLEN_ERRMSG]; size_t formlen; char snull[20]; /* the FITS null value */ double cbuff[DBUFFSIZE / sizeof(double)]; /* align cbuff on word boundary */ void *buffer; if (*status > 0) /* inherit input status value if > 0 */ return(*status); buffer = cbuff; /*---------------------------------------------------*/ /* Check input and get parameters about the column: */ /*---------------------------------------------------*/ /* IMPORTANT NOTE: that the special case of using this subroutine to write bytes to a character column are handled internally by the call to ffgcprll() below. It will adjust the effective *tcode, repeats, etc, to appear as a TBYTE column. */ writemode = 17; /* Equivalent to writemode = 1 but allow TSTRING -> TBYTE */ if (ffgcprll( fptr, colnum, firstrow, firstelem, nelem, writemode, &scale, &zero, tform, &twidth, &tcode, &maxelem2, &startpos, &elemnum, &incre, &repeat, &rowlen, &hdutype, &tnull, snull, status) > 0) return(*status); maxelem = maxelem2; if (tcode == TSTRING) ffcfmt(tform, cform); /* derive C format for writing strings */ /* if there is no scaling then we can simply write the raw data bytes into the FITS file if the datatype of the FITS column is the same as the input values. Otherwise, we must convert the raw values into the scaled and/or machine dependent format in a temporary buffer that has been allocated for this purpose. */ if (scale == 1. && zero == 0. && tcode == TBYTE) { writeraw = 1; if (nelem < (LONGLONG)INT32_MAX) { maxelem = nelem; } else { maxelem = INT32_MAX; } } else writeraw = 0; /*---------------------------------------------------------------------*/ /* Now write the pixels to the FITS column. */ /* First call the ffXXfYY routine to (1) convert the datatype */ /* if necessary, and (2) scale the values by the FITS TSCALn and */ /* TZEROn linear scaling parameters into a temporary buffer. */ /*---------------------------------------------------------------------*/ remain = nelem; /* remaining number of values to write */ next = 0; /* next element in array to be written */ rownum = 0; /* row number, relative to firstrow */ while (remain) { /* limit the number of pixels to process a one time to the number that will fit in the buffer space or to the number of pixels that remain in the current vector, which ever is smaller. */ ntodo = (long) minvalue(remain, maxelem); ntodo = (long) minvalue(ntodo, (repeat - elemnum)); wrtptr = startpos + ((LONGLONG)rownum * rowlen) + (elemnum * incre); ffmbyt(fptr, wrtptr, IGNORE_EOF, status); /* move to write position */ switch (tcode) { case (TBYTE): if (writeraw) { /* write raw input bytes without conversion */ ffpi1b(fptr, ntodo, incre, &array[next], status); } else { /* convert the raw data before writing to FITS file */ ffi1fi1(&array[next], ntodo, scale, zero, (unsigned char *) buffer, status); ffpi1b(fptr, ntodo, incre, (unsigned char *) buffer, status); } break; case (TLONGLONG): ffi1fi8(&array[next], ntodo, scale, zero, (LONGLONG *) buffer, status); ffpi8b(fptr, ntodo, incre, (long *) buffer, status); break; case (TSHORT): ffi1fi2(&array[next], ntodo, scale, zero, (short *) buffer, status); ffpi2b(fptr, ntodo, incre, (short *) buffer, status); break; case (TLONG): ffi1fi4(&array[next], ntodo, scale, zero, (INT32BIT *) buffer, status); ffpi4b(fptr, ntodo, incre, (INT32BIT *) buffer, status); break; case (TFLOAT): ffi1fr4(&array[next], ntodo, scale, zero, (float *) buffer, status); ffpr4b(fptr, ntodo, incre, (float *) buffer, status); break; case (TDOUBLE): ffi1fr8(&array[next], ntodo, scale, zero, (double *) buffer, status); ffpr8b(fptr, ntodo, incre, (double *) buffer, status); break; case (TSTRING): /* numerical column in an ASCII table */ formlen = strlen(cform); if (strchr(tform,'A')) { /* write raw input bytes without conversion */ /* This case is a hack to let users write a stream */ /* of bytes directly to the 'A' format column */ if (incre == twidth) { ffpbyt(fptr, ntodo, &array[next], status); } else { ffpbytoff(fptr, twidth, ntodo/twidth, incre - twidth, &array[next], status); } break; } else if (hdutype == ASCII_TBL && formlen > 1) { if (cform[formlen-1] == 'f' || cform[formlen-1] == 'E') { ffi1fstr(&array[next], ntodo, scale, zero, cform, twidth, (char *) buffer, status); if (incre == twidth) /* contiguous bytes */ ffpbyt(fptr, ntodo * twidth, buffer, status); else ffpbytoff(fptr, twidth, ntodo, incre - twidth, buffer, status); break; } } /* can't write to string column, so fall thru to default: */ default: /* error trap */ snprintf(message, FLEN_ERRMSG, "Cannot write numbers to column %d which has format %s", colnum,tform); ffpmsg(message); if (hdutype == ASCII_TBL) return(*status = BAD_ATABLE_FORMAT); else return(*status = BAD_BTABLE_FORMAT); } /* End of switch block */ /*-------------------------*/ /* Check for fatal error */ /*-------------------------*/ if (*status > 0) /* test for error during previous write operation */ { snprintf(message,FLEN_ERRMSG, "Error writing elements %.0f thru %.0f of input data array (ffpclb).", (double) (next+1), (double) (next+ntodo)); ffpmsg(message); return(*status); } /*--------------------------------------------*/ /* increment the counters for the next loop */ /*--------------------------------------------*/ remain -= ntodo; if (remain) { next += ntodo; elemnum += ntodo; if (elemnum == repeat) /* completed a row; start on next row */ { elemnum = 0; rownum++; } } } /* End of main while Loop */ /*--------------------------------*/ /* check for numerical overflow */ /*--------------------------------*/ if (*status == OVERFLOW_ERR) { ffpmsg( "Numerical overflow during type conversion while writing FITS data."); *status = NUM_OVERFLOW; } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x71b8, %rsp # imm = 0x71B8 movq 0x71f0(%rsp), %rbx movl (%rbx), %eax testl %eax, %eax jg 0x9a7a0 movq %r8, %r15 movq %rdi, %r12 movq %r9, 0x10(%rsp) subq $0x8, %rsp leaq 0xb8(%rsp), %r13 leaq 0xb0(%rsp), %rbp leaq 0x3c(%rsp), %rax leaq 0x68(%rsp), %r10 leaq 0x60(%rsp), %r11 movl %esi, %r14d movl $0x11, %r9d pushq %rbx pushq %r13 pushq %rbp pushq %rax pushq %r10 pushq %r11 leaq 0x50(%rsp), %rax pushq %rax leaq 0x78(%rsp), %rax pushq %rax leaq 0xb0(%rsp), %rax pushq %rax leaq 0x9c(%rsp), %rax pushq %rax leaq 0x88(%rsp), %rax pushq %rax leaq 0xa0(%rsp), %rax pushq %rax leaq 0xf8(%rsp), %rax pushq %rax leaq 0x90(%rsp), %rax pushq %rax leaq 0xa0(%rsp), %rax pushq %rax callq 0x3e16b addq $0x80, %rsp testl %eax, %eax jle 0x9a7b2 movq 0x71f0(%rsp), %rax movl (%rax), %eax addq $0x71b8, %rsp # imm = 0x71B8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movl %r14d, 0x48(%rsp) movslq 0x4c(%rsp), %rbx movl 0x30(%rsp), %eax cmpl $0x10, %eax jne 0x9a7db leaq 0x90(%rsp), %rdi leaq 0x70(%rsp), %rsi callq 0x3a9ee movl 0x30(%rsp), %eax movsd 0x20(%rsp), %xmm0 movsd 0x2e897(%rip), %xmm1 # 0xc9080 movsd 0x28(%rsp), %xmm2 cmpneqpd %xmm1, %xmm2 xorpd %xmm1, %xmm1 cmpneqpd %xmm0, %xmm1 orpd %xmm2, %xmm1 movd %xmm1, %ecx cmpl $0xb, %eax setne %al orb %cl, %al movl $0x7fffffff, %r14d # imm = 0x7FFFFFFF cmpq %r14, %r15 cmovlq %r15, %r14 movb %al, 0xf(%rsp) testb $0x1, %al cmovneq %rbx, %r14 testq %r15, %r15 movq 0x71f0(%rsp), %r13 je 0x9ac09 movq $0x0, 0x50(%rsp) xorl %ebx, %ebx cmpq %r14, %r15 movq %r14, %rax cmovlq %r15, %rax movq 0x58(%rsp), %rbp movq 0x38(%rsp), %rsi subq %rsi, %rbp cmpq %rbp, %rax cmovlq %rax, %rbp movq 0x60(%rsp), %rax imulq 0x50(%rsp), %rax addq 0x68(%rsp), %rax imulq 0x18(%rsp), %rsi addq %rax, %rsi movq %r12, %rdi movl $0x1, %edx movq %r13, %rcx callq 0xc1ad4 movl 0x30(%rsp), %eax cmpl $0x28, %eax jle 0x9a8fb cmpl $0x50, %eax jg 0x9a966 cmpl $0x29, %eax leaq 0x130(%rsp), %rdx je 0x9a9c8 cmpl $0x2a, %eax jne 0x9ac7a movq 0x10(%rsp), %rax leaq (%rax,%rbx), %rdi movsd 0x28(%rsp), %xmm0 movsd 0x20(%rsp), %xmm1 movq %rbp, %rsi movq 0x71f0(%rsp), %r13 movq %r13, %rcx callq 0x9bb1d movq 0x18(%rsp), %rdx movq %r12, %rdi movq %rbp, %rsi leaq 0x130(%rsp), %rcx movq %r13, %r8 callq 0xc34cd jmp 0x9abd1 cmpl $0xb, %eax je 0x9aa9f cmpl $0x10, %eax leaq 0x130(%rsp), %rdx je 0x9aa48 cmpl $0x15, %eax jne 0x9ac7a movq 0x10(%rsp), %rax leaq (%rax,%rbx), %rdi movsd 0x28(%rsp), %xmm0 movsd 0x20(%rsp), %xmm1 movq %rbp, %rsi movq 0x71f0(%rsp), %r13 movq %r13, %rcx callq 0x9b98b movq 0x18(%rsp), %rdx movq %r12, %rdi movq %rbp, %rsi leaq 0x130(%rsp), %rcx movq %r13, %r8 callq 0xc339c jmp 0x9abd1 cmpl $0x51, %eax leaq 0x130(%rsp), %rdx je 0x9aa08 cmpl $0x52, %eax jne 0x9ac7a movq 0x10(%rsp), %rax leaq (%rax,%rbx), %rdi movsd 0x28(%rsp), %xmm0 movsd 0x20(%rsp), %xmm1 movq %rbp, %rsi movq 0x71f0(%rsp), %r13 movq %r13, %rcx callq 0x9bb88 movq 0x18(%rsp), %rdx movq %r12, %rdi movq %rbp, %rsi leaq 0x130(%rsp), %rcx movq %r13, %r8 callq 0xc3533 jmp 0x9abd1 movq 0x10(%rsp), %rax leaq (%rax,%rbx), %rdi movsd 0x28(%rsp), %xmm0 movsd 0x20(%rsp), %xmm1 movq %rbp, %rsi movq %r13, %rcx callq 0x9ba54 movq 0x18(%rsp), %rdx movq %r12, %rdi movq %rbp, %rsi leaq 0x130(%rsp), %rcx movq %r13, %r8 callq 0xc3401 jmp 0x9abd1 movq 0x10(%rsp), %rax leaq (%rax,%rbx), %rdi movsd 0x28(%rsp), %xmm0 movsd 0x20(%rsp), %xmm1 movq %rbp, %rsi movq %r13, %rcx callq 0x9b872 movq 0x18(%rsp), %rdx movq %r12, %rdi movq %rbp, %rsi leaq 0x130(%rsp), %rcx movq %r13, %r8 callq 0xc3467 jmp 0x9abd1 leaq 0x70(%rsp), %rdi callq 0x6280 movq %rax, %r13 leaq 0x90(%rsp), %rdi movl $0x41, %esi callq 0x63c0 testq %rax, %rax je 0x9ab04 movq 0x18(%rsp), %rcx movq 0x40(%rsp), %rsi subq %rsi, %rcx jne 0x9ab97 movq 0x10(%rsp), %rax leaq (%rax,%rbx), %rdx movq %r12, %rdi movq %rbp, %rsi movq 0x71f0(%rsp), %r13 jmp 0x9ab8d testb $0x1, 0xf(%rsp) je 0x9aae3 movq 0x10(%rsp), %rax leaq (%rax,%rbx), %rdi movsd 0x28(%rsp), %xmm0 movsd 0x20(%rsp), %xmm1 movq %rbp, %rsi leaq 0x130(%rsp), %rdx movq %r13, %rcx callq 0x9b7d8 movq 0x18(%rsp), %rdx movq %r12, %rdi movq %rbp, %rsi leaq 0x130(%rsp), %rcx jmp 0x9aaf7 movq 0x18(%rsp), %rdx movq 0x10(%rsp), %rax leaq (%rax,%rbx), %rcx movq %r12, %rdi movq %rbp, %rsi movq %r13, %r8 callq 0xc3365 jmp 0x9abd1 cmpl $0x1, 0x34(%rsp) leaq 0x130(%rsp), %r8 jne 0x9ac7a cmpq $0x2, %r13 jb 0x9ac7a leaq 0x70(%rsp), %rax movzbl -0x1(%r13,%rax), %eax cmpl $0x66, %eax je 0x9ab3a cmpl $0x45, %eax jne 0x9ac7a movq 0x10(%rsp), %rax leaq (%rax,%rbx), %rdi movsd 0x28(%rsp), %xmm0 movsd 0x20(%rsp), %xmm1 movq 0x40(%rsp), %rcx movq %rbp, %rsi leaq 0x70(%rsp), %rdx movq 0x71f0(%rsp), %r13 movq %r13, %r9 callq 0x9bbef movq 0x18(%rsp), %rsi movq 0x40(%rsp), %rax movq %rsi, %rcx subq %rax, %rcx jne 0x9abb8 imulq %rbp, %rsi movq %r12, %rdi leaq 0x130(%rsp), %rdx movq %r13, %rcx callq 0xc1d35 jmp 0x9abd1 movq %rbp, %rax cqto idivq %rsi movq 0x10(%rsp), %rdx leaq (%rdx,%rbx), %r8 movq %r12, %rdi movq %rax, %rdx movq 0x71f0(%rsp), %r13 jmp 0x9abc9 movq %r12, %rdi movq %rax, %rsi movq %rbp, %rdx leaq 0x130(%rsp), %r8 movq %r13, %r9 callq 0xc22c1 movl (%r13), %eax testl %eax, %eax jg 0x9ac34 subq %rbp, %r15 je 0x9ac0d addq %rbp, %rbx addq 0x38(%rsp), %rbp movq %rbp, 0x38(%rsp) cmpq 0x58(%rsp), %rbp jne 0x9a840 movq $0x0, 0x38(%rsp) incq 0x50(%rsp) jmp 0x9a840 movl (%r13), %eax cmpl $-0xb, %eax jne 0x9a7a0 leaq 0x42c65(%rip), %rdi # 0xdd882 callq 0x37264 movl $0x19c, (%r13) # imm = 0x19C movl $0x19c, %eax # imm = 0x19C jmp 0x9a7a0 leaq 0x1(%rbx), %rax xorps %xmm0, %xmm0 cvtsi2sd %rax, %xmm0 addq %rbx, %rbp xorps %xmm1, %xmm1 cvtsi2sd %rbp, %xmm1 leaq 0x42bec(%rip), %rdx # 0xdd83e leaq 0xd0(%rsp), %r14 movl $0x51, %esi movq %r14, %rdi movb $0x2, %al callq 0x60b0 movq %r14, %rdi callq 0x37264 movl (%r13), %eax jmp 0x9a7a0 leaq 0x42b87(%rip), %rdx # 0xdd808 leaq 0xd0(%rsp), %r14 leaq 0x90(%rsp), %r8 movl $0x51, %esi movq %r14, %rdi movl 0x48(%rsp), %ecx xorl %eax, %eax callq 0x60b0 movq %r14, %rdi callq 0x37264 cmpl $0x1, 0x34(%rsp) jne 0x9accb movq 0x71f0(%rsp), %rax movl $0x137, (%rax) # imm = 0x137 movl $0x137, %eax # imm = 0x137 jmp 0x9a7a0 movq 0x71f0(%rsp), %rax movl $0x138, (%rax) # imm = 0x138 movl $0x138, %eax # imm = 0x138 jmp 0x9a7a0
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcolb.c
ffppnb
int ffppnb( fitsfile *fptr, /* I - FITS file pointer */ long group, /* I - group to write(1 = 1st group) */ LONGLONG firstelem, /* I - first vector element to write(1 = 1st) */ LONGLONG nelem, /* I - number of values to write */ unsigned char *array, /* I - array of values that are written */ unsigned char nulval, /* I - undefined pixel value */ int *status) /* IO - error status */ /* Write an array of values to the primary array. Data conversion and scaling will be performed if necessary (e.g, if the datatype of the FITS array is not the same as the array being written). Any array values that are equal to the value of nulval will be replaced with the null pixel value that is appropriate for this column. */ { long row; unsigned char nullvalue; /* the primary array is represented as a binary table: each group of the primary array is a row in the table, where the first column contains the group parameters and the second column contains the image itself. */ if (fits_is_compressed_image(fptr, status)) { /* this is a compressed image in a binary table */ nullvalue = nulval; /* set local variable */ fits_write_compressed_pixels(fptr, TBYTE, firstelem, nelem, 1, array, &nullvalue, status); return(*status); } row=maxvalue(1,group); ffpcnb(fptr, 2, row, firstelem, nelem, array, nulval, status); return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %r9d, %ebp movq %r8, %r14 movq %rcx, %r15 movq %rdx, %r12 movq %rsi, %rbx movq %rdi, %r13 movq 0x40(%rsp), %rsi callq 0x41127 testl %eax, %eax je 0x9ad3b leaq 0x7(%rsp), %rax movb %bpl, (%rax) movq %r13, %rdi movl $0xb, %esi movq %r12, %rdx movq %r15, %rcx movl $0x1, %r8d movq %r14, %r9 movq 0x40(%rsp), %rbx pushq %rbx pushq %rax callq 0x899b2 jmp 0x9ad69 cmpq $0x2, %rbx movl $0x1, %edx cmovgeq %rbx, %rdx movzbl %bpl, %eax movq %r13, %rdi movl $0x2, %esi movq %r12, %rcx movq %r15, %r8 movq %r14, %r9 movq 0x40(%rsp), %rbx pushq %rbx pushq %rax callq 0x9ad7e addq $0x10, %rsp movl (%rbx), %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcolb.c
ffp3db
int ffp3db(fitsfile *fptr, /* I - FITS file pointer */ long group, /* I - group to write(1 = 1st group) */ LONGLONG ncols, /* I - number of pixels in each row of array */ LONGLONG nrows, /* I - number of rows in each plane of array */ LONGLONG naxis1, /* I - FITS image NAXIS1 value */ LONGLONG naxis2, /* I - FITS image NAXIS2 value */ LONGLONG naxis3, /* I - FITS image NAXIS3 value */ unsigned char *array, /* I - array to be written */ int *status) /* IO - error status */ /* Write an entire 3-D cube of values to the primary array. Data conversion and scaling will be performed if necessary (e.g, if the datatype of the FITS array is not the same as the array being written). */ { long tablerow, ii, jj; LONGLONG nfits, narray; long fpixel[3]= {1,1,1}, lpixel[3]; /* the primary array is represented as a binary table: each group of the primary array is a row in the table, where the first column contains the group parameters and the second column contains the image itself. */ if (fits_is_compressed_image(fptr, status)) { /* this is a compressed image in a binary table */ lpixel[0] = (long) ncols; lpixel[1] = (long) nrows; lpixel[2] = (long) naxis3; fits_write_compressed_img(fptr, TBYTE, fpixel, lpixel, 0, array, NULL, status); return(*status); } tablerow=maxvalue(1,group); if (ncols == naxis1 && nrows == naxis2) /* arrays have same size? */ { /* all the image pixels are contiguous, so write all at once */ ffpclb(fptr, 2, tablerow, 1L, naxis1 * naxis2 * naxis3, array, status); return(*status); } if (ncols < naxis1 || nrows < naxis2) return(*status = BAD_DIMEN); nfits = 1; /* next pixel in FITS image to write to */ narray = 0; /* next pixel in input array to be written */ /* loop over naxis3 planes in the data cube */ for (jj = 0; jj < naxis3; jj++) { /* loop over the naxis2 rows in the FITS image, */ /* writing naxis1 pixels to each row */ for (ii = 0; ii < naxis2; ii++) { if (ffpclb(fptr, 2, tablerow, nfits, naxis1,&array[narray],status) > 0) return(*status); nfits += naxis1; narray += ncols; } narray += (nrows - naxis2) * ncols; } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x68, %rsp movq %r9, 0x10(%rsp) movq %r8, %r14 movq %rcx, %rbp movq %rdx, %r13 movq %rsi, %rbx movq %rdi, %r15 movq 0xb0(%rsp), %r12 movaps 0x4267a(%rip), %xmm0 # 0xdd7f0 movaps %xmm0, 0x30(%rsp) movq $0x1, 0x40(%rsp) movq %r12, %rsi callq 0x41127 testl %eax, %eax je 0x9b1d4 leaq 0x50(%rsp), %rcx movq %r13, (%rcx) movq %rbp, 0x8(%rcx) movq 0xa0(%rsp), %rax movq %rax, 0x10(%rcx) movq %r12, 0x8(%rsp) movq $0x0, (%rsp) leaq 0x30(%rsp), %rdx movq %r15, %rdi movl $0xb, %esi xorl %r8d, %r8d movq 0xa8(%rsp), %r9 callq 0x85d43 jmp 0x9b225 movq 0xa8(%rsp), %r9 cmpq $0x2, %rbx movl $0x1, %edx cmovgeq %rbx, %rdx movq %r13, %rax xorq %r14, %rax movq %rbp, %rcx movq 0x10(%rsp), %rsi xorq %rsi, %rcx orq %rax, %rcx movq %rbp, %r8 jne 0x9b238 imulq %r13, %r8 imulq 0xa0(%rsp), %r8 movq %r12, (%rsp) movl $0x1, %ecx movq %r15, %rdi movl $0x2, %esi callq 0x9a6d8 movl (%r12), %eax addq $0x68, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rsi, %rbp cmpq %r14, %r13 setl %al subq %rsi, %r8 setl %cl orb %al, %cl je 0x9b25a movl $0x140, (%r12) # imm = 0x140 movl $0x140, %eax # imm = 0x140 jmp 0x9b229 cmpq $0x0, 0xa0(%rsp) jle 0x9b2f2 imulq %r13, %r8 movl $0x1, %ebx xorl %r12d, %r12d xorl %eax, %eax movq %r8, 0x18(%rsp) movq %r13, 0x28(%rsp) movq %rax, 0x20(%rsp) testq %rbp, %rbp jle 0x9b2d3 movq 0xa8(%rsp), %rax leaq (%rax,%r12), %r9 movq 0xb0(%rsp), %rax movq %rax, (%rsp) movq %r15, %r13 movq %r15, %rdi movl $0x2, %esi movq %rdx, %r15 movq %rbx, %rcx movq %r14, %r8 callq 0x9a6d8 testl %eax, %eax jg 0x9b2f2 addq %r14, %rbx addq 0x28(%rsp), %r12 decq %rbp movq %r15, %rdx movq %r13, %r15 jne 0x9b28b movq 0x18(%rsp), %r8 addq %r8, %r12 movq 0x20(%rsp), %rax incq %rax cmpq 0xa0(%rsp), %rax movq 0x10(%rsp), %rbp jne 0x9b281 movq 0xb0(%rsp), %rax movl (%rax), %eax jmp 0x9b229
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcolb.c
ffpgpb
int ffpgpb( fitsfile *fptr, /* I - FITS file pointer */ long group, /* I - group to write(1 = 1st group) */ long firstelem, /* I - first vector element to write(1 = 1st) */ long nelem, /* I - number of values to write */ unsigned char *array, /* I - array of values that are written */ int *status) /* IO - error status */ /* Write an array of group parameters to the primary array. Data conversion and scaling will be performed if necessary (e.g, if the datatype of the FITS array is not the same as the array being written). */ { long row; /* the primary array is represented as a binary table: each group of the primary array is a row in the table, where the first column contains the group parameters and the second column contains the image itself. */ row=maxvalue(1,group); ffpclb(fptr, 1L, row, firstelem, nelem, array, status); return(*status); }
pushq %rbx subq $0x10, %rsp movq %r9, %rbx movq %r8, %r9 movq %rcx, %r8 movq %rdx, %rcx cmpq $0x2, %rsi movl $0x1, %edx cmovgeq %rsi, %rdx movq %rbx, (%rsp) movl $0x1, %esi callq 0x9a6d8 movl (%rbx), %eax addq $0x10, %rsp popq %rbx retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcolb.c
ffi1fr4
int ffi1fr4(unsigned char *input, /* I - array of values to be converted */ long ntodo, /* I - number of elements in the array */ double scale, /* I - FITS TSCALn or BSCALE value */ double zero, /* I - FITS TZEROn or BZERO value */ float *output, /* O - output array of converted values */ int *status) /* IO - error status */ /* Copy input to output prior to writing output to a FITS file. Do datatype conversion and scaling if required. */ { long ii; if (scale == 1. && zero == 0.) { for (ii = 0; ii < ntodo; ii++) output[ii] = (float) input[ii]; } else { for (ii = 0; ii < ntodo; ii++) output[ii] = (float) (( ( (double) input[ii] ) - zero) / scale); } return(*status); }
ucomisd 0x2d55b(%rip), %xmm0 # 0xc9080 jne 0x9bb58 jp 0x9bb58 xorpd %xmm2, %xmm2 ucomisd %xmm2, %xmm1 jne 0x9bb58 jp 0x9bb58 testq %rsi, %rsi jle 0x9bb85 xorl %eax, %eax movzbl (%rdi,%rax), %r8d xorps %xmm0, %xmm0 cvtsi2ss %r8d, %xmm0 movss %xmm0, (%rdx,%rax,4) incq %rax cmpq %rax, %rsi jne 0x9bb3c jmp 0x9bb85 testq %rsi, %rsi jle 0x9bb85 xorl %eax, %eax movzbl (%rdi,%rax), %r8d xorps %xmm2, %xmm2 cvtsi2sd %r8d, %xmm2 subsd %xmm1, %xmm2 divsd %xmm0, %xmm2 cvtsd2ss %xmm2, %xmm2 movss %xmm2, (%rdx,%rax,4) incq %rax cmpq %rax, %rsi jne 0x9bb5f movl (%rcx), %eax retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcolb.c
ffpextn
int ffpextn( fitsfile *fptr, /* I - FITS file pointer */ LONGLONG offset, /* I - byte offset from start of extension data */ LONGLONG nelem, /* I - number of elements to write */ void *buffer, /* I - stream of bytes to write */ int *status) /* IO - error status */ /* Write a stream of bytes to the current FITS HDU. This primative routine is mainly for writing non-standard "conforming" extensions and should not be used for standard IMAGE, TABLE or BINTABLE extensions. */ { if (*status > 0) /* inherit input status value if > 0 */ return(*status); /* reset position to the correct HDU if necessary */ if (fptr->HDUposition != (fptr->Fptr)->curhdu) ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); /* rescan header if data structure is undefined */ else if ((fptr->Fptr)->datastart == DATA_UNDEFINED) if ( ffrdef(fptr, status) > 0) return(*status); /* move to write position */ ffmbyt(fptr, (fptr->Fptr)->datastart+ offset, IGNORE_EOF, status); /* write the buffer */ ffpbyt(fptr, nelem, buffer, status); return(*status); }
movl (%r8), %eax testl %eax, %eax jle 0x9bd15 retq pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx movq %r8, %rbx movq %rcx, %r14 movq %rdx, %r15 movq %rsi, %r13 movq %rdi, %r12 movl (%rdi), %esi movq 0x8(%rdi), %rax cmpl 0x54(%rax), %esi jne 0x9bd53 cmpq $-0x1, 0x88(%rax) jne 0x9bd62 movq %r12, %rdi movq %rbx, %rsi callq 0x3af49 testl %eax, %eax jg 0x9bd92 jmp 0x9bd62 incl %esi movq %r12, %rdi xorl %edx, %edx movq %rbx, %rcx callq 0x37f5e movq 0x8(%r12), %rax addq 0x88(%rax), %r13 movq %r12, %rdi movq %r13, %rsi movl $0x1, %edx movq %rbx, %rcx callq 0xc1ad4 movq %r12, %rdi movq %r15, %rsi movq %r14, %rdx movq %rbx, %rcx callq 0xc1d35 movl (%rbx), %eax popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 retq nop
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcolb.c
ffpcld
int ffpcld( fitsfile *fptr, /* I - FITS file pointer */ int colnum, /* I - number of column to write (1 = 1st col) */ LONGLONG firstrow, /* I - first row to write (1 = 1st row) */ LONGLONG firstelem, /* I - first vector element to write (1 = 1st) */ LONGLONG nelem, /* I - number of values to write */ double *array, /* I - array of values to write */ int *status) /* IO - error status */ /* Write an array of values to a column in the current FITS HDU. The column number may refer to a real column in an ASCII or binary table, or it may refer to a virtual column in a 1 or more grouped FITS primary array. FITSIO treats a primary array as a binary table with 2 vector columns: the first column contains the group parameters (often with length = 0) and the second column contains the array of image pixels. Each row of the table represents a group in the case of multigroup FITS images. The input array of values will be converted to the datatype of the column and will be inverse-scaled by the FITS TSCALn and TZEROn values if necessary. */ { int tcode, maxelem2, hdutype, writeraw; long twidth, incre; long ntodo; LONGLONG repeat, startpos, elemnum, wrtptr, rowlen, rownum, remain, next, tnull, maxelem; double scale, zero; char tform[20], cform[20]; char message[FLEN_ERRMSG]; size_t formlen; char snull[20]; /* the FITS null value */ double cbuff[DBUFFSIZE / sizeof(double)]; /* align cbuff on word boundary */ void *buffer; if (*status > 0) /* inherit input status value if > 0 */ return(*status); buffer = cbuff; /*---------------------------------------------------*/ /* Check input and get parameters about the column: */ /*---------------------------------------------------*/ if (ffgcprll( fptr, colnum, firstrow, firstelem, nelem, 1, &scale, &zero, tform, &twidth, &tcode, &maxelem2, &startpos, &elemnum, &incre, &repeat, &rowlen, &hdutype, &tnull, snull, status) > 0) return(*status); maxelem = maxelem2; if (tcode == TSTRING) ffcfmt(tform, cform); /* derive C format for writing strings */ /* if there is no scaling and the native machine format is not byteswapped, then we can simply write the raw data bytes into the FITS file if the datatype of the FITS column is the same as the input values. Otherwise, we must convert the raw values into the scaled and/or machine dependent format in a temporary buffer that has been allocated for this purpose. */ if (scale == 1. && zero == 0. && MACHINE == NATIVE && tcode == TDOUBLE) { writeraw = 1; if (nelem < (LONGLONG)INT32_MAX) { maxelem = nelem; } else { maxelem = INT32_MAX/8; } } else writeraw = 0; /*---------------------------------------------------------------------*/ /* Now write the pixels to the FITS column. */ /* First call the ffXXfYY routine to (1) convert the datatype */ /* if necessary, and (2) scale the values by the FITS TSCALn and */ /* TZEROn linear scaling parameters into a temporary buffer. */ /*---------------------------------------------------------------------*/ remain = nelem; /* remaining number of values to write */ next = 0; /* next element in array to be written */ rownum = 0; /* row number, relative to firstrow */ while (remain) { /* limit the number of pixels to process a one time to the number that will fit in the buffer space or to the number of pixels that remain in the current vector, which ever is smaller. */ ntodo = (long) minvalue(remain, maxelem); ntodo = (long) minvalue(ntodo, (repeat - elemnum)); wrtptr = startpos + ((LONGLONG)rownum * rowlen) + (elemnum * incre); ffmbyt(fptr, wrtptr, IGNORE_EOF, status); /* move to write position */ switch (tcode) { case (TDOUBLE): if (writeraw) { /* write raw input bytes without conversion */ ffpr8b(fptr, ntodo, incre, &array[next], status); } else { /* convert the raw data before writing to FITS file */ ffr8fr8(&array[next], ntodo, scale, zero, (double *) buffer, status); ffpr8b(fptr, ntodo, incre, (double *) buffer, status); } break; case (TLONGLONG): ffr8fi8(&array[next], ntodo, scale, zero, (LONGLONG *) buffer, status); ffpi8b(fptr, ntodo, incre, (long *) buffer, status); break; case (TBYTE): ffr8fi1(&array[next], ntodo, scale, zero, (unsigned char *) buffer, status); ffpi1b(fptr, ntodo, incre, (unsigned char *) buffer, status); break; case (TSHORT): ffr8fi2(&array[next], ntodo, scale, zero, (short *) buffer, status); ffpi2b(fptr, ntodo, incre, (short *) buffer, status); break; case (TLONG): ffr8fi4(&array[next], ntodo, scale, zero, (INT32BIT *) buffer, status); ffpi4b(fptr, ntodo, incre, (INT32BIT *) buffer, status); break; case (TFLOAT): ffr8fr4(&array[next], ntodo, scale, zero, (float *) buffer, status); ffpr4b(fptr, ntodo, incre, (float *) buffer, status); break; case (TSTRING): /* numerical column in an ASCII table */ formlen = strlen(cform); if (hdutype == ASCII_TBL && formlen > 1) { if (cform[formlen-1] == 'f' || cform[formlen-1] == 'E') { ffr8fstr(&array[next], ntodo, scale, zero, cform, twidth, (char *) buffer, status); if (incre == twidth) /* contiguous bytes */ ffpbyt(fptr, ntodo * twidth, buffer, status); else ffpbytoff(fptr, twidth, ntodo, incre - twidth, buffer, status); break; } } /* can't write to string column, so fall thru to default: */ default: /* error trap */ snprintf(message, FLEN_ERRMSG, "Cannot write numbers to column %d which has format %s", colnum,tform); ffpmsg(message); if (hdutype == ASCII_TBL) return(*status = BAD_ATABLE_FORMAT); else return(*status = BAD_BTABLE_FORMAT); } /* End of switch block */ /*-------------------------*/ /* Check for fatal error */ /*-------------------------*/ if (*status > 0) /* test for error during previous write operation */ { snprintf(message,FLEN_ERRMSG, "Error writing elements %.0f thru %.0f of input data array (ffpcld).", (double) (next+1), (double) (next+ntodo)); ffpmsg(message); return(*status); } /*--------------------------------------------*/ /* increment the counters for the next loop */ /*--------------------------------------------*/ remain -= ntodo; if (remain) { next += ntodo; elemnum += ntodo; if (elemnum == repeat) /* completed a row; start on next row */ { elemnum = 0; rownum++; } } } /* End of main while Loop */ /*--------------------------------*/ /* check for numerical overflow */ /*--------------------------------*/ if (*status == OVERFLOW_ERR) { ffpmsg( "Numerical overflow during type conversion while writing FITS data."); *status = NUM_OVERFLOW; } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x71a8, %rsp # imm = 0x71A8 movq 0x71e0(%rsp), %r13 movl (%r13), %eax testl %eax, %eax jg 0x9bee7 movq %r8, %r15 movq %rdi, %r12 movq %r9, 0x8(%rsp) subq $0x8, %rsp leaq 0xa8(%rsp), %rbp leaq 0xa0(%rsp), %rax leaq 0x28(%rsp), %r10 leaq 0x58(%rsp), %r11 leaq 0x48(%rsp), %r14 movl %esi, %ebx movl $0x1, %r9d pushq %r13 pushq %rbp pushq %rax pushq %r10 pushq %r11 pushq %r14 leaq 0x38(%rsp), %rax pushq %rax leaq 0x68(%rsp), %rax pushq %rax leaq 0xa0(%rsp), %rax pushq %rax leaq 0x84(%rsp), %rax pushq %rax leaq 0x7c(%rsp), %rax pushq %rax leaq 0xa8(%rsp), %rax pushq %rax leaq 0xe8(%rsp), %rax pushq %rax leaq 0x80(%rsp), %rax pushq %rax leaq 0x90(%rsp), %rax pushq %rax callq 0x3e16b addq $0x80, %rsp testl %eax, %eax jle 0x9bef9 movl (%r13), %eax addq $0x71a8, %rsp # imm = 0x71A8 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %r13, %r14 movl %ebx, 0x30(%rsp) movslq 0x34(%rsp), %r13 cmpl $0x10, 0x24(%rsp) jne 0x9bf1e leaq 0x80(%rsp), %rdi leaq 0x60(%rsp), %rsi callq 0x3a9ee testq %r15, %r15 movq %r14, %rbx je 0x9c2c1 movq $0x0, 0x38(%rsp) xorl %r14d, %r14d cmpq %r13, %r15 movq %r13, %rax cmovlq %r15, %rax movq 0x40(%rsp), %rbp movq 0x28(%rsp), %rsi subq %rsi, %rbp cmpq %rbp, %rax cmovlq %rax, %rbp movq 0x50(%rsp), %rax imulq 0x38(%rsp), %rax addq 0x58(%rsp), %rax imulq (%rsp), %rsi addq %rax, %rsi movq %r12, %rdi movl $0x1, %edx movq %rbx, %rcx callq 0xc1ad4 movl 0x24(%rsp), %eax cmpl $0x28, %eax jle 0x9bfed cmpl $0x50, %eax jg 0x9c055 cmpl $0x29, %eax leaq 0x120(%rsp), %rdx je 0x9c0c9 cmpl $0x2a, %eax jne 0x9c32c movq 0x8(%rsp), %rax leaq (%rax,%r14,8), %rdi movsd 0x18(%rsp), %xmm0 movsd 0x10(%rsp), %xmm1 movq %rbp, %rsi movq %rbx, %rcx movq %rdx, %rbx callq 0x9d402 movq (%rsp), %rdx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rcx movq 0x71e0(%rsp), %rbx movq %rbx, %r8 callq 0xc34cd jmp 0x9c28b cmpl $0xb, %eax je 0x9c1ea cmpl $0x10, %eax leaq 0x120(%rsp), %rdx je 0x9c150 cmpl $0x15, %eax jne 0x9c32c movq 0x8(%rsp), %rax leaq (%rax,%r14,8), %rdi movsd 0x18(%rsp), %xmm0 movsd 0x10(%rsp), %xmm1 movq %rbp, %rsi movq %rbx, %rcx movq %rdx, %rbx callq 0x9d210 movq (%rsp), %rdx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rcx movq 0x71e0(%rsp), %rbx movq %rbx, %r8 callq 0xc339c jmp 0x9c28b cmpl $0x51, %eax leaq 0x120(%rsp), %rcx je 0x9c10e cmpl $0x52, %eax jne 0x9c32c movq 0x8(%rsp), %rax leaq (%rax,%r14,8), %rsi movsd 0x18(%rsp), %xmm0 movsd 0x10(%rsp), %xmm1 ucomisd 0x2cff4(%rip), %xmm0 # 0xc9080 jne 0x9c239 jp 0x9c239 ucomisd 0x2d000(%rip), %xmm1 # 0xc90a0 jne 0x9c239 jp 0x9c239 leaq (,%rbp,8), %rdx movq %rcx, %rdi callq 0x65c0 leaq 0x120(%rsp), %rcx jmp 0x9c25e movq 0x8(%rsp), %rax leaq (%rax,%r14,8), %rdi movsd 0x18(%rsp), %xmm0 movsd 0x10(%rsp), %xmm1 movq %rbp, %rsi movq %rbx, %rcx movq %rdx, %rbx callq 0x9d308 movq (%rsp), %rdx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rcx movq 0x71e0(%rsp), %rbx movq %rbx, %r8 callq 0xc3401 jmp 0x9c28b movq 0x8(%rsp), %rax leaq (%rax,%r14,8), %rdi movsd 0x18(%rsp), %xmm0 movsd 0x10(%rsp), %xmm1 movq %rbp, %rsi movq %rcx, %rdx movq %rbx, %rcx callq 0x9cfa8 movq (%rsp), %rdx movq %r12, %rdi movq %rbp, %rsi leaq 0x120(%rsp), %rcx movq %rbx, %r8 callq 0xc3467 jmp 0x9c28b leaq 0x60(%rsp), %rdi callq 0x6280 leaq 0x120(%rsp), %r8 cmpl $0x1, 0x20(%rsp) jne 0x9c32c cmpq $0x2, %rax jb 0x9c32c leaq 0x60(%rsp), %rcx movzbl -0x1(%rax,%rcx), %eax cmpl $0x66, %eax je 0x9c18f cmpl $0x45, %eax jne 0x9c32c movq 0x8(%rsp), %rax leaq (%rax,%r14,8), %rdi movsd 0x18(%rsp), %xmm0 movsd 0x10(%rsp), %xmm1 movq 0x48(%rsp), %rcx movq %rbp, %rsi leaq 0x60(%rsp), %rdx movq %rbx, %r9 callq 0x9d460 movq (%rsp), %rsi movq 0x48(%rsp), %rax movq %rsi, %rcx subq %rax, %rcx jne 0x9c272 imulq %rbp, %rsi movq %r12, %rdi leaq 0x120(%rsp), %rdx movq %rbx, %rcx callq 0xc1d35 jmp 0x9c28b movq 0x8(%rsp), %rax leaq (%rax,%r14,8), %rdi movsd 0x18(%rsp), %xmm0 movsd 0x10(%rsp), %xmm1 movq %rbp, %rsi leaq 0x120(%rsp), %rbx movq %rbx, %rdx movq 0x71e0(%rsp), %rcx callq 0x9d13d movq (%rsp), %rdx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %rcx movq 0x71e0(%rsp), %rbx movq %rbx, %r8 callq 0xc3365 jmp 0x9c28b testq %rbp, %rbp jle 0x9c25e xorl %eax, %eax movsd (%rsi,%rax,8), %xmm2 subsd %xmm1, %xmm2 divsd %xmm0, %xmm2 movsd %xmm2, 0x120(%rsp,%rax,8) incq %rax cmpq %rax, %rbp jne 0x9c240 movq (%rsp), %rdx movq %r12, %rdi movq %rbp, %rsi movq %rbx, %r8 callq 0xc3533 jmp 0x9c28b movq %r12, %rdi movq %rax, %rsi movq %rbp, %rdx leaq 0x120(%rsp), %r8 movq %rbx, %r9 callq 0xc22c1 movl (%rbx), %eax testl %eax, %eax jg 0x9c2e8 subq %rbp, %r15 je 0x9c2c3 addq %rbp, %r14 addq 0x28(%rsp), %rbp movq %rbp, 0x28(%rsp) cmpq 0x40(%rsp), %rbp jne 0x9bf36 movq $0x0, 0x28(%rsp) incq 0x38(%rsp) jmp 0x9bf36 movl (%rbx), %eax cmpl $-0xb, %eax jne 0x9bee7 leaq 0x415af(%rip), %rdi # 0xdd882 callq 0x37264 movl $0x19c, (%rbx) # imm = 0x19C movl $0x19c, %eax # imm = 0x19C jmp 0x9bee7 leaq 0x1(%r14), %rax xorps %xmm0, %xmm0 cvtsi2sd %rax, %xmm0 addq %r14, %rbp xorps %xmm1, %xmm1 cvtsi2sd %rbp, %xmm1 leaq 0x415e2(%rip), %rdx # 0xdd8e8 leaq 0xc0(%rsp), %r14 movl $0x51, %esi movq %r14, %rdi movb $0x2, %al callq 0x60b0 movq %r14, %rdi callq 0x37264 movl (%rbx), %eax jmp 0x9bee7 leaq 0x414d5(%rip), %rdx # 0xdd808 leaq 0xc0(%rsp), %r14 leaq 0x80(%rsp), %r8 movl $0x51, %esi movq %r14, %rdi movl 0x30(%rsp), %ecx xorl %eax, %eax callq 0x60b0 movq %r14, %rdi callq 0x37264 cmpl $0x1, 0x20(%rsp) jne 0x9c375 movl $0x137, (%rbx) # imm = 0x137 movl $0x137, %eax # imm = 0x137 jmp 0x9bee7 movl $0x138, (%rbx) # imm = 0x138 movl $0x138, %eax # imm = 0x138 jmp 0x9bee7
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcold.c
ffpcnd
int ffpcnd( fitsfile *fptr, /* I - FITS file pointer */ int colnum, /* I - number of column to write (1 = 1st col) */ LONGLONG firstrow, /* I - first row to write (1 = 1st row) */ LONGLONG firstelem, /* I - first vector element to write (1 = 1st) */ LONGLONG nelem, /* I - number of values to write */ double *array, /* I - array of values to write */ double nulvalue, /* I - value used to flag undefined pixels */ int *status) /* IO - error status */ /* Write an array of elements to the specified column of a table. Any input pixels equal to the value of nulvalue will be replaced by the appropriate null value in the output FITS file. The input array of values will be converted to the datatype of the column and will be inverse-scaled by the FITS TSCALn and TZEROn values if necessary */ { tcolumn *colptr; LONGLONG ngood = 0, nbad = 0, ii; LONGLONG repeat, first, fstelm, fstrow; int tcode, overflow = 0; if (*status > 0) return(*status); /* reset position to the correct HDU if necessary */ if (fptr->HDUposition != (fptr->Fptr)->curhdu) { ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); } else if ((fptr->Fptr)->datastart == DATA_UNDEFINED) { if ( ffrdef(fptr, status) > 0) /* rescan header */ return(*status); } colptr = (fptr->Fptr)->tableptr; /* point to first column */ colptr += (colnum - 1); /* offset to correct column structure */ tcode = colptr->tdatatype; if (tcode > 0) repeat = colptr->trepeat; /* repeat count for this column */ else repeat = firstelem -1 + nelem; /* variable length arrays */ if (abs(tcode) >= TCOMPLEX) { /* treat complex columns as pairs of numbers */ repeat *= 2; } /* if variable length array, first write the whole input vector, then go back and fill in the nulls */ if (tcode < 0) { if (ffpcld(fptr, colnum, firstrow, firstelem, nelem, array, status) > 0) { if (*status == NUM_OVERFLOW) { /* ignore overflows, which are possibly the null pixel values */ /* overflow = 1; */ *status = 0; } else { return(*status); } } } /* absolute element number in the column */ first = (firstrow - 1) * repeat + firstelem; for (ii = 0; ii < nelem; ii++) { if (array[ii] != nulvalue) /* is this a good pixel? */ { if (nbad) /* write previous string of bad pixels */ { fstelm = ii - nbad + first; /* absolute element number */ fstrow = (fstelm - 1) / repeat + 1; /* starting row number */ fstelm = fstelm - (fstrow - 1) * repeat; /* relative number */ /* call ffpcluc, not ffpclu, in case we are writing to a complex ('C') binary table column */ if (ffpcluc(fptr, colnum, fstrow, fstelm, nbad, status) > 0) return(*status); nbad=0; } ngood = ngood +1; /* the consecutive number of good pixels */ } else { if (ngood) /* write previous string of good pixels */ { fstelm = ii - ngood + first; /* absolute element number */ fstrow = (fstelm - 1) / repeat + 1; /* starting row number */ fstelm = fstelm - (fstrow - 1) * repeat; /* relative number */ if (tcode > 0) { /* variable length arrays have already been written */ if (ffpcld(fptr, colnum, fstrow, fstelm, ngood, &array[ii-ngood], status) > 0) { if (*status == NUM_OVERFLOW) { overflow = 1; *status = 0; } else { return(*status); } } } ngood=0; } nbad = nbad +1; /* the consecutive number of bad pixels */ } } /* finished loop; now just write the last set of pixels */ if (ngood) /* write last string of good pixels */ { fstelm = ii - ngood + first; /* absolute element number */ fstrow = (fstelm - 1) / repeat + 1; /* starting row number */ fstelm = fstelm - (fstrow - 1) * repeat; /* relative number */ if (tcode > 0) { /* variable length arrays have already been written */ ffpcld(fptr, colnum, fstrow, fstelm, ngood, &array[ii-ngood], status); } } else if (nbad) /* write last string of bad pixels */ { fstelm = ii - nbad + first; /* absolute element number */ fstrow = (fstelm - 1) / repeat + 1; /* starting row number */ fstelm = fstelm - (fstrow - 1) * repeat; /* relative number */ ffpcluc(fptr, colnum, fstrow, fstelm, nbad, status); } if (*status <= 0) { if (overflow) { *status = NUM_OVERFLOW; } } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x78, %rsp movq 0xb0(%rsp), %rbx movl (%rbx), %eax testl %eax, %eax jg 0x9c812 movl %esi, %ebp movq %rdi, %r15 movq %r9, 0x28(%rsp) movq %rcx, 0x40(%rsp) movq %rdx, %r14 movq %r8, 0x30(%rsp) movl (%rdi), %esi movq 0x8(%rdi), %rax cmpl 0x54(%rax), %esi movsd %xmm0, 0x18(%rsp) jne 0x9c496 cmpq $-0x1, 0x88(%rax) jne 0x9c4ab movq %r15, %rdi movq %rbx, %rsi callq 0x3af49 movsd 0x18(%rsp), %xmm0 testl %eax, %eax jg 0x9c73b jmp 0x9c4ab incl %esi movq %r15, %rdi xorl %edx, %edx movq %rbx, %rcx callq 0x37f5e movsd 0x18(%rsp), %xmm0 movq 0x8(%r15), %rax movq 0x3d0(%rax), %rax movslq %ebp, %rcx leaq (%rcx,%rcx,4), %rcx shlq $0x5, %rcx movl -0x50(%rax,%rcx), %edx testl %edx, %edx movq %rdx, 0x50(%rsp) jle 0x9c4ef addq %rcx, %rax movq -0x48(%rax), %rax cmpl $0x53, %edx setae %cl shlq %cl, %rax movq %rax, 0x10(%rsp) movq 0x30(%rsp), %r13 movq 0x40(%rsp), %r12 jmp 0x9c51c movq 0x30(%rsp), %r13 movq %rdx, %rsi movq 0x40(%rsp), %r12 leaq (%r12,%r13), %rdx decq %rdx leal -0x1(%rsi), %eax cmpl $-0x53, %eax setb %cl shlq %cl, %rdx movq %rdx, 0x10(%rsp) testl %esi, %esi js 0x9c7ab testq %r13, %r13 jle 0x9c73b decq %r14 movq 0x10(%rsp), %rax imulq %rax, %r14 movq %r14, 0x68(%rsp) leaq (%r14,%r12), %rdx negq %rax movq %rax, 0x70(%rsp) movq 0x28(%rsp), %rbx leaq (%rbx,%r13,8), %rsi movq $0x0, 0x20(%rsp) xorl %edi, %edi xorl %r12d, %r12d movq %rdx, 0x58(%rsp) movl %ebp, 0xc(%rsp) movq %r15, 0x38(%rsp) movq %r13, %rbp subq %rdi, %rbp leaq (%rdx,%rdi), %rax movq %rax, 0x48(%rsp) leaq (%rbx,%rdi,8), %r14 movq %rsi, %rbx xorl %r13d, %r13d movq %rdi, 0x60(%rsp) movsd (%r14,%r13,8), %xmm1 ucomisd %xmm0, %xmm1 jne 0x9c597 jnp 0x9c61a testq %r12, %r12 je 0x9c5ff movq 0x48(%rsp), %rax leaq (%rax,%r13), %rcx movq %r12, %rax notq %rax addq %rcx, %rax cqto idivq 0x10(%rsp) movq %rsi, %r15 movq 0x70(%rsp), %rsi imulq %rax, %rsi leaq 0x1(%rax), %rdx subq %r12, %rsi addq %rsi, %rcx movq 0x38(%rsp), %rdi movl 0xc(%rsp), %esi movq %r12, %r8 movq 0xb0(%rsp), %r9 callq 0xa70c7 movq 0x60(%rsp), %rdi movq %r15, %rsi movq 0x58(%rsp), %rdx movsd 0x18(%rsp), %xmm0 testl %eax, %eax jg 0x9c79f incq %r13 addq $-0x8, %rbx movl $0x0, %r12d cmpq %r13, %rbp jne 0x9c585 jmp 0x9c742 cmpl $0x0, 0x50(%rsp) setle %al testq %r13, %r13 sete %cl orb %al, %cl je 0x9c647 movq 0xb0(%rsp), %r14 movl 0xc(%rsp), %ebp movq 0x38(%rsp), %r15 movq 0x28(%rsp), %rbx jmp 0x9c6d6 movq %rsi, 0x48(%rsp) leaq (%rdi,%r13), %rsi subq %r13, %rsi leaq (%rsi,%rdx), %rcx leaq (%rsi,%rdx), %rax decq %rax cqto movq 0x10(%rsp), %rdi idivq %rdi leaq 0x1(%rax), %rdx imulq %rdi, %rax subq %rax, %rcx movq 0x28(%rsp), %rbx leaq (%rbx,%rsi,8), %r9 movq 0xb0(%rsp), %r14 movq %r14, (%rsp) movq 0x38(%rsp), %r15 movq %r15, %rdi movl 0xc(%rsp), %ebp movl %ebp, %esi movq %r13, %r8 callq 0x9be26 movq 0x60(%rsp), %rdi movq 0x48(%rsp), %rsi movq 0x58(%rsp), %rdx movsd 0x18(%rsp), %xmm0 testl %eax, %eax jle 0x9c6d6 movl (%r14), %eax cmpl $0x19c, %eax # imm = 0x19C jne 0x9c812 movl $0x0, (%r14) movl $0x1, %eax movq %rax, 0x20(%rsp) incq %r12 leaq (%rdi,%r13), %rax incq %rax notq %rdi movq 0x30(%rsp), %rcx addq %rcx, %rdi cmpq %r13, %rdi movq %rcx, %r13 movq %rax, %rdi jne 0x9c567 testq %r12, %r12 je 0x9c7ed subq %r12, %r13 leaq (%rdx,%r13), %rcx leaq (%rdx,%r13), %rax decq %rax cqto movq 0x10(%rsp), %rsi idivq %rsi leaq 0x1(%rax), %rdx imulq %rsi, %rax subq %rax, %rcx movq %r15, %rdi movl %ebp, %esi movq %r12, %r8 movq %r14, %r9 callq 0xa70c7 jmp 0x9c7ed movl (%rbx), %eax jmp 0x9c812 cmpl $0x0, 0x50(%rsp) jle 0x9c7e5 movq 0x30(%rsp), %rcx addq 0x40(%rsp), %rcx addq 0x68(%rsp), %rcx movq %r13, %rax notq %rax addq %rcx, %rax cqto movq 0x10(%rsp), %rsi idivq %rsi imulq %rax, %rsi subq %rsi, %rcx subq %r13, %rcx leaq 0x1(%rax), %rdx movq 0xb0(%rsp), %r14 movq %r14, (%rsp) movq 0x38(%rsp), %rdi movl 0xc(%rsp), %esi movq %r13, %r8 movq %rbx, %r9 callq 0x9be26 jmp 0x9c7ed movq 0xb0(%rsp), %rax movl (%rax), %eax jmp 0x9c812 movq %rbx, (%rsp) movq %r15, %rdi movl %ebp, %esi movq %r14, %rdx movq %r12, %rcx movq %r13, %r8 movq 0x28(%rsp), %r9 callq 0x9be26 testl %eax, %eax jle 0x9c821 movl (%rbx), %eax cmpl $0x19c, %eax # imm = 0x19C movsd 0x18(%rsp), %xmm0 jne 0x9c812 movl $0x0, (%rbx) jmp 0x9c51c movq 0xb0(%rsp), %r14 movq 0x20(%rsp), %rax testl %eax, %eax setne %cl movl (%r14), %eax testl %eax, %eax setle %dl andb %cl, %dl cmpb $0x1, %dl jne 0x9c812 movl $0x19c, (%r14) # imm = 0x19C movl $0x19c, %eax # imm = 0x19C addq $0x78, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movsd 0x18(%rsp), %xmm0 jmp 0x9c51c
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcold.c
ffp3di
int ffp3di(fitsfile *fptr, /* I - FITS file pointer */ long group, /* I - group to write(1 = 1st group) */ LONGLONG ncols, /* I - number of pixels in each row of array */ LONGLONG nrows, /* I - number of rows in each plane of array */ LONGLONG naxis1, /* I - FITS image NAXIS1 value */ LONGLONG naxis2, /* I - FITS image NAXIS2 value */ LONGLONG naxis3, /* I - FITS image NAXIS3 value */ short *array, /* I - array to be written */ int *status) /* IO - error status */ /* Write an entire 3-D cube of values to the primary array. Data conversion and scaling will be performed if necessary (e.g, if the datatype of the FITS array is not the same as the array being written). */ { long tablerow, ii, jj; long fpixel[3]= {1,1,1}, lpixel[3]; LONGLONG nfits, narray; /* the primary array is represented as a binary table: each group of the primary array is a row in the table, where the first column contains the group parameters and the second column contains the image itself. */ if (fits_is_compressed_image(fptr, status)) { /* this is a compressed image in a binary table */ lpixel[0] = (long) ncols; lpixel[1] = (long) nrows; lpixel[2] = (long) naxis3; fits_write_compressed_img(fptr, TSHORT, fpixel, lpixel, 0, array, NULL, status); return(*status); } tablerow=maxvalue(1,group); if (ncols == naxis1 && nrows == naxis2) /* arrays have same size? */ { /* all the image pixels are contiguous, so write all at once */ ffpcli(fptr, 2, tablerow, 1L, naxis1 * naxis2 * naxis3, array, status); return(*status); } if (ncols < naxis1 || nrows < naxis2) return(*status = BAD_DIMEN); nfits = 1; /* next pixel in FITS image to write to */ narray = 0; /* next pixel in input array to be written */ /* loop over naxis3 planes in the data cube */ for (jj = 0; jj < naxis3; jj++) { /* loop over the naxis2 rows in the FITS image, */ /* writing naxis1 pixels to each row */ for (ii = 0; ii < naxis2; ii++) { if (ffpcli(fptr, 2, tablerow, nfits, naxis1,&array[narray],status) > 0) return(*status); nfits += naxis1; narray += ncols; } narray += (nrows - naxis2) * ncols; } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x78, %rsp movq %r9, 0x10(%rsp) movq %r8, %r14 movq %rcx, %r15 movq %rdx, %r13 movq %rsi, %rbx movq %rdi, %rbp movq 0xc0(%rsp), %r12 movaps 0x3e1cc(%rip), %xmm0 # 0xdd990 movaps %xmm0, 0x40(%rsp) movq $0x1, 0x50(%rsp) movq %r12, %rsi callq 0x41127 testl %eax, %eax je 0x9f822 leaq 0x60(%rsp), %rcx movq %r13, (%rcx) movq %r15, 0x8(%rcx) movq 0xb0(%rsp), %rax movq %rax, 0x10(%rcx) movq %r12, 0x8(%rsp) movq $0x0, (%rsp) leaq 0x40(%rsp), %rdx movq %rbp, %rdi movl $0x15, %esi xorl %r8d, %r8d movq 0xb8(%rsp), %r9 callq 0x85d43 jmp 0x9f873 movq 0xb8(%rsp), %r9 cmpq $0x2, %rbx movl $0x1, %edx cmovgeq %rbx, %rdx movq %r13, %rax xorq %r14, %rax movq %r15, %rcx movq 0x10(%rsp), %rsi xorq %rsi, %rcx orq %rax, %rcx movq %r15, %r8 jne 0x9f886 imulq %r13, %r8 imulq 0xb0(%rsp), %r8 movq %r12, (%rsp) movl $0x1, %ecx movq %rbp, %rdi movl $0x2, %esi callq 0x9ee50 movl (%r12), %eax addq $0x78, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rsi, %r15 cmpq %r14, %r13 setl %al subq %rsi, %r8 setl %cl orb %al, %cl je 0x9f8a8 movl $0x140, (%r12) # imm = 0x140 movl $0x140, %eax # imm = 0x140 jmp 0x9f877 movq %rbp, 0x38(%rsp) cmpq $0x0, 0xb0(%rsp) jle 0x9f958 movq %r9, %r12 imulq %r13, %r8 leaq (,%r13,2), %rax movq %rax, 0x28(%rsp) movl $0x1, %ebx xorl %ebp, %ebp xorl %eax, %eax movq %r8, 0x18(%rsp) movq %r13, 0x30(%rsp) movq %rax, 0x20(%rsp) testq %r15, %r15 jle 0x9f931 leaq (%r12,%rbp,2), %r12 movq 0xc0(%rsp), %rax movq %rax, (%rsp) movq 0x38(%rsp), %rdi movl $0x2, %esi movq %rdx, %r13 movq %rbx, %rcx movq %r14, %r8 movq %r12, %r9 callq 0x9ee50 testl %eax, %eax jg 0x9f958 addq %r14, %rbx addq 0x30(%rsp), %rbp addq 0x28(%rsp), %r12 decq %r15 movq %r13, %rdx jne 0x9f8f1 movq 0x18(%rsp), %r8 addq %r8, %rbp movq 0x20(%rsp), %rax incq %rax cmpq 0xb0(%rsp), %rax movq 0xb8(%rsp), %r12 movq 0x10(%rsp), %r15 jne 0x9f8e3 movq 0xc0(%rsp), %rax movl (%rax), %eax jmp 0x9f877
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcoli.c
ffppnk
int ffppnk( fitsfile *fptr, /* I - FITS file pointer */ long group, /* I - group to write(1 = 1st group) */ LONGLONG firstelem, /* I - first vector element to write(1 = 1st) */ LONGLONG nelem, /* I - number of values to write */ int *array, /* I - array of values that are written */ int nulval, /* I - undefined pixel value */ int *status) /* IO - error status */ /* Write an array of values to the primary array. Data conversion and scaling will be performed if necessary (e.g, if the datatype of the FITS array is not the same as the array being written). Any array values that are equal to the value of nulval will be replaced with the null pixel value that is appropriate for this column. */ { long row; int nullvalue; /* the primary array is represented as a binary table: each group of the primary array is a row in the table, where the first column contains the group parameters and the second column contains the image itself. */ if (fits_is_compressed_image(fptr, status)) { /* this is a compressed image in a binary table */ nullvalue = nulval; /* set local variable */ fits_write_compressed_pixels(fptr, TINT, firstelem, nelem, 1, array, &nullvalue, status); return(*status); } row=maxvalue(1,group); ffpcnk(fptr, 2, row, firstelem, nelem, array, nulval, status); return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx pushq %rax movl %r9d, %r15d movq %r8, %r14 movq %rcx, %r12 movq %rdx, %r13 movq %rsi, %rbx movq %rdi, %rbp movq 0x40(%rsp), %rsi callq 0x41127 testl %eax, %eax je 0xa35b4 leaq 0x4(%rsp), %rax movl %r15d, (%rax) movq %rbp, %rdi movl $0x1f, %esi movq %r13, %rdx movq %r12, %rcx movl $0x1, %r8d movq %r14, %r9 movq 0x40(%rsp), %rbx pushq %rbx pushq %rax callq 0x899b2 jmp 0xa35df cmpq $0x2, %rbx movl $0x1, %edx cmovgeq %rbx, %rdx movq %rbp, %rdi movl $0x2, %esi movq %r13, %rcx movq %r12, %r8 movq %r14, %r9 movq 0x40(%rsp), %rbx pushq %rbx pushq %r15 callq 0xa35f4 addq $0x10, %rsp movl (%rbx), %eax addq $0x8, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcolk.c
ffp3dk
int ffp3dk(fitsfile *fptr, /* I - FITS file pointer */ long group, /* I - group to write(1 = 1st group) */ LONGLONG ncols, /* I - number of pixels in each row of array */ LONGLONG nrows, /* I - number of rows in each plane of array */ LONGLONG naxis1, /* I - FITS image NAXIS1 value */ LONGLONG naxis2, /* I - FITS image NAXIS2 value */ LONGLONG naxis3, /* I - FITS image NAXIS3 value */ int *array, /* I - array to be written */ int *status) /* IO - error status */ /* Write an entire 3-D cube of values to the primary array. Data conversion and scaling will be performed if necessary (e.g, if the datatype of the FITS array is not the same as the array being written). */ { long tablerow, ii, jj; long fpixel[3]= {1,1,1}, lpixel[3]; LONGLONG nfits, narray; /* the primary array is represented as a binary table: each group of the primary array is a row in the table, where the first column contains the group parameters and the second column contains the image itself. */ if (fits_is_compressed_image(fptr, status)) { /* this is a compressed image in a binary table */ lpixel[0] = (long) ncols; lpixel[1] = (long) nrows; lpixel[2] = (long) naxis3; fits_write_compressed_img(fptr, TINT, fpixel, lpixel, 0, array, NULL, status); return(*status); } tablerow=maxvalue(1,group); if (ncols == naxis1 && nrows == naxis2) /* arrays have same size? */ { /* all the image pixels are contiguous, so write all at once */ ffpclk(fptr, 2, tablerow, 1L, naxis1 * naxis2 * naxis3, array, status); return(*status); } if (ncols < naxis1 || nrows < naxis2) return(*status = BAD_DIMEN); nfits = 1; /* next pixel in FITS image to write to */ narray = 0; /* next pixel in input array to be written */ /* loop over naxis3 planes in the data cube */ for (jj = 0; jj < naxis3; jj++) { /* loop over the naxis2 rows in the FITS image, */ /* writing naxis1 pixels to each row */ for (ii = 0; ii < naxis2; ii++) { if (ffpclk(fptr, 2, tablerow, nfits, naxis1,&array[narray],status) > 0) return(*status); nfits += naxis1; narray += ncols; } narray += (nrows - naxis2) * ncols; } return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x78, %rsp movq %r9, 0x10(%rsp) movq %r8, %r14 movq %rcx, %r15 movq %rdx, %r13 movq %rsi, %rbx movq %rdi, %rbp movq 0xc0(%rsp), %r12 movaps 0x3a09c(%rip), %xmm0 # 0xdda90 movaps %xmm0, 0x40(%rsp) movq $0x1, 0x50(%rsp) movq %r12, %rsi callq 0x41127 testl %eax, %eax je 0xa3a52 leaq 0x60(%rsp), %rcx movq %r13, (%rcx) movq %r15, 0x8(%rcx) movq 0xb0(%rsp), %rax movq %rax, 0x10(%rcx) movq %r12, 0x8(%rsp) movq $0x0, (%rsp) leaq 0x40(%rsp), %rdx movq %rbp, %rdi movl $0x1f, %esi xorl %r8d, %r8d movq 0xb8(%rsp), %r9 callq 0x85d43 jmp 0xa3aa3 movq 0xb8(%rsp), %r9 cmpq $0x2, %rbx movl $0x1, %edx cmovgeq %rbx, %rdx movq %r13, %rax xorq %r14, %rax movq %r15, %rcx movq 0x10(%rsp), %rsi xorq %rsi, %rcx orq %rax, %rcx movq %r15, %r8 jne 0xa3ab6 imulq %r13, %r8 imulq 0xb0(%rsp), %r8 movq %r12, (%rsp) movl $0x1, %ecx movq %rbp, %rdi movl $0x2, %esi callq 0xa3084 movl (%r12), %eax addq $0x78, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq movq %rsi, %r15 cmpq %r14, %r13 setl %al subq %rsi, %r8 setl %cl orb %al, %cl je 0xa3ad8 movl $0x140, (%r12) # imm = 0x140 movl $0x140, %eax # imm = 0x140 jmp 0xa3aa7 movq %rbp, 0x38(%rsp) cmpq $0x0, 0xb0(%rsp) jle 0xa3b88 movq %r9, %r12 imulq %r13, %r8 leaq (,%r13,4), %rax movq %rax, 0x28(%rsp) movl $0x1, %ebx xorl %ebp, %ebp xorl %eax, %eax movq %r8, 0x18(%rsp) movq %r13, 0x30(%rsp) movq %rax, 0x20(%rsp) testq %r15, %r15 jle 0xa3b61 leaq (%r12,%rbp,4), %r12 movq 0xc0(%rsp), %rax movq %rax, (%rsp) movq 0x38(%rsp), %rdi movl $0x2, %esi movq %rdx, %r13 movq %rbx, %rcx movq %r14, %r8 movq %r12, %r9 callq 0xa3084 testl %eax, %eax jg 0xa3b88 addq %r14, %rbx addq 0x30(%rsp), %rbp addq 0x28(%rsp), %r12 decq %r15 movq %r13, %rdx jne 0xa3b21 movq 0x18(%rsp), %r8 addq %r8, %rbp movq 0x20(%rsp), %rax incq %rax cmpq 0xb0(%rsp), %rax movq 0xb8(%rsp), %r12 movq 0x10(%rsp), %r15 jne 0xa3b13 movq 0xc0(%rsp), %rax movl (%rax), %eax jmp 0xa3aa7
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcolk.c
ffintfstr
int ffintfstr(int *input, /* I - array of values to be converted */ long ntodo, /* I - number of elements in the array */ double scale, /* I - FITS TSCALn or BSCALE value */ double zero, /* I - FITS TZEROn or BZERO value */ char *cform, /* I - format for output string values */ long twidth, /* I - width of each field, in chars */ char *output, /* O - output array of converted values */ int *status) /* IO - error status */ /* Copy input to output prior to writing output to a FITS file. Do scaling if required. */ { long ii; double dvalue; char *cptr; cptr = output; if (scale == 1. && zero == 0.) { for (ii = 0; ii < ntodo; ii++) { snprintf(output, DBUFFSIZE, cform, (double) input[ii]); output += twidth; if (*output) /* if this char != \0, then overflow occurred */ *status = OVERFLOW_ERR; } } else { for (ii = 0; ii < ntodo; ii++) { dvalue = (input[ii] - zero) / scale; snprintf(output, DBUFFSIZE, cform, dvalue); output += twidth; if (*output) /* if this char != \0, then overflow occurred */ *status = OVERFLOW_ERR; } } /* replace any commas with periods (e.g., in French locale) */ while ((cptr = strchr(cptr, ','))) *cptr = '.'; return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x28, %rsp movq %r9, 0x10(%rsp) movq %r8, 0x8(%rsp) movq %rcx, %r15 movq %rdx, %r12 movq %rsi, %r13 movq %rdi, %rbp movsd %xmm0, 0x20(%rsp) ucomisd 0x24b4a(%rip), %xmm0 # 0xc9080 jne 0xa4590 jp 0xa4590 xorpd %xmm0, %xmm0 ucomisd %xmm0, %xmm1 jne 0xa4590 jp 0xa4590 testq %r13, %r13 jle 0xa45ea xorl %ebx, %ebx movq 0x8(%rsp), %r14 xorps %xmm0, %xmm0 cvtsi2sdl (%rbp,%rbx,4), %xmm0 movl $0x7080, %esi # imm = 0x7080 movq %r14, %rdi movq %r12, %rdx movb $0x1, %al callq 0x60b0 cmpb $0x0, (%r14,%r15) je 0xa4583 movq 0x10(%rsp), %rax movl $0xfffffff5, (%rax) # imm = 0xFFFFFFF5 addq %r15, %r14 incq %rbx cmpq %rbx, %r13 jne 0xa4556 jmp 0xa45ea testq %r13, %r13 jle 0xa45ea xorl %ebx, %ebx movq 0x8(%rsp), %r14 movsd %xmm1, 0x18(%rsp) xorps %xmm0, %xmm0 cvtsi2sdl (%rbp,%rbx,4), %xmm0 subsd %xmm1, %xmm0 divsd 0x20(%rsp), %xmm0 movl $0x7080, %esi # imm = 0x7080 movq %r14, %rdi movq %r12, %rdx movb $0x1, %al callq 0x60b0 cmpb $0x0, (%r14,%r15) je 0xa45d9 movq 0x10(%rsp), %rax movl $0xfffffff5, (%rax) # imm = 0xFFFFFFF5 addq %r15, %r14 incq %rbx cmpq %rbx, %r13 movsd 0x18(%rsp), %xmm1 jne 0xa45a2 movq 0x8(%rsp), %rdi movl $0x2c, %esi callq 0x63c0 testq %rax, %rax je 0xa4606 movb $0x2e, (%rax) movq %rax, %rdi jmp 0xa45ef movq 0x10(%rsp), %rax movl (%rax), %eax addq $0x28, %rsp popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putcolk.c
ffphtb
int ffphtb(fitsfile *fptr, /* I - FITS file pointer */ LONGLONG naxis1, /* I - width of row in the table */ LONGLONG naxis2, /* I - number of rows in the table */ int tfields, /* I - number of columns in the table */ char **ttype, /* I - name of each column */ long *tbcol, /* I - byte offset in row to each column */ char **tform, /* I - value of TFORMn keyword for each column */ char **tunit, /* I - value of TUNITn keyword for each column */ const char *extnmx, /* I - value of EXTNAME keyword, if any */ int *status) /* IO - error status */ /* Put required Header keywords into the ASCII TaBle: */ { int ii, ncols, gotmem = 0; long rowlen; /* must be 'long' because it is passed to ffgabc */ char tfmt[30], name[FLEN_KEYWORD], comm[FLEN_COMMENT], extnm[FLEN_VALUE]; if (fptr->HDUposition != (fptr->Fptr)->curhdu) ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status); if (*status > 0) return(*status); else if ((fptr->Fptr)->headend != (fptr->Fptr)->headstart[(fptr->Fptr)->curhdu] ) return(*status = HEADER_NOT_EMPTY); else if (naxis1 < 0) return(*status = NEG_WIDTH); else if (naxis2 < 0) return(*status = NEG_ROWS); else if (tfields < 0 || tfields > 999) return(*status = BAD_TFIELDS); extnm[0] = '\0'; if (extnmx) strncat(extnm, extnmx, FLEN_VALUE-1); rowlen = (long) naxis1; if (!tbcol || !tbcol[0] || (!naxis1 && tfields)) /* spacing not defined? */ { /* allocate mem for tbcol; malloc can have problems allocating small */ /* arrays, so allocate at least 20 bytes */ ncols = maxvalue(5, tfields); tbcol = (long *) calloc(ncols, sizeof(long)); if (tbcol) { gotmem = 1; /* calculate width of a row and starting position of each column. */ /* Each column will be separated by 1 blank space */ ffgabc(tfields, tform, 1, &rowlen, tbcol, status); } } ffpkys(fptr, "XTENSION", "TABLE", "ASCII table extension", status); ffpkyj(fptr, "BITPIX", 8, "8-bit ASCII characters", status); ffpkyj(fptr, "NAXIS", 2, "2-dimensional ASCII table", status); ffpkyj(fptr, "NAXIS1", rowlen, "width of table in characters", status); ffpkyj(fptr, "NAXIS2", naxis2, "number of rows in table", status); ffpkyj(fptr, "PCOUNT", 0, "no group parameters (required keyword)", status); ffpkyj(fptr, "GCOUNT", 1, "one data group (required keyword)", status); ffpkyj(fptr, "TFIELDS", tfields, "number of fields in each row", status); for (ii = 0; ii < tfields; ii++) /* loop over every column */ { if ( *(ttype[ii]) ) /* optional TTYPEn keyword */ { snprintf(comm, FLEN_COMMENT,"label for field %3d", ii + 1); ffkeyn("TTYPE", ii + 1, name, status); ffpkys(fptr, name, ttype[ii], comm, status); } if (tbcol[ii] < 1 || tbcol[ii] > rowlen) *status = BAD_TBCOL; snprintf(comm, FLEN_COMMENT,"beginning column of field %3d", ii + 1); ffkeyn("TBCOL", ii + 1, name, status); ffpkyj(fptr, name, tbcol[ii], comm, status); if (strlen(tform[ii]) > 29) { ffpmsg("Error: ASCII table TFORM code is too long (ffphtb)"); *status = BAD_TFORM; break; } strcpy(tfmt, tform[ii]); /* required TFORMn keyword */ ffupch(tfmt); ffkeyn("TFORM", ii + 1, name, status); ffpkys(fptr, name, tfmt, "Fortran-77 format of field", status); if (tunit) { if (tunit[ii] && *(tunit[ii]) ) /* optional TUNITn keyword */ { ffkeyn("TUNIT", ii + 1, name, status); ffpkys(fptr, name, tunit[ii], "physical unit of field", status) ; } } if (*status > 0) break; /* abort loop on error */ } if (extnm[0]) /* optional EXTNAME keyword */ ffpkys(fptr, "EXTNAME", extnm, "name of this ASCII table extension", status); if (*status > 0) ffpmsg("Failed to write ASCII table header keywords (ffphtb)"); if (gotmem) free(tbcol); return(*status); }
pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x148, %rsp # imm = 0x148 movq %r9, %r14 movq %r8, 0x20(%rsp) movl %ecx, %ebp movq %rdx, %r13 movq %rsi, %r12 movq %rdi, %r15 movq 0x198(%rsp), %rbx movl (%rdi), %esi movq 0x8(%rdi), %rax cmpl 0x54(%rax), %esi je 0xae608 incl %esi movq %r15, %rdi xorl %edx, %edx movq %rbx, %rcx callq 0x37f5e movl (%rbx), %eax testl %eax, %eax jg 0xaea44 movq 0x8(%r15), %rax movq 0x68(%rax), %rcx movq 0x70(%rax), %rdx movslq 0x54(%rax), %rax cmpq (%rcx,%rax,8), %rdx jne 0xae64a testq %r12, %r12 js 0xae65a testq %r13, %r13 js 0xae66a cmpl $0x3e8, %ebp # imm = 0x3E8 jb 0xae67a movl $0xd8, (%rbx) movl $0xd8, %eax jmp 0xaea44 movl $0xc9, (%rbx) movl $0xc9, %eax jmp 0xaea44 movl $0xd9, (%rbx) movl $0xd9, %eax jmp 0xaea44 movl $0xda, (%rbx) movl $0xda, %eax jmp 0xaea44 movq 0x190(%rsp), %rsi movb $0x0, 0x30(%rsp) testq %rsi, %rsi je 0xae69b leaq 0x30(%rsp), %rdi movl $0x46, %edx callq 0x60f0 movq %r12, 0x10(%rsp) testq %r14, %r14 je 0xae6bc cmpq $0x0, (%r14) je 0xae6bc testq %r12, %r12 setne %al testl %ebp, %ebp sete %cl movb $0x1, %dl orb %al, %cl jne 0xae701 cmpl $0x6, %ebp movl $0x5, %edi cmovael %ebp, %edi movl $0x8, %esi callq 0x64a0 testq %rax, %rax je 0xae6fc movq %rax, %r14 leaq 0x10(%rsp), %rcx movl %ebp, %edi movq 0x180(%rsp), %rsi movl $0x1, %edx movq %rax, %r8 movq %rbx, %r9 callq 0x3dde1 xorl %edx, %edx jmp 0xae701 movb $0x1, %dl xorl %r14d, %r14d movl %edx, 0x1c(%rsp) movq %r14, 0x8(%rsp) leaq 0x271ab(%rip), %rsi # 0xd58bc leaq 0x280eb(%rip), %rdx # 0xd6803 leaq 0x30346(%rip), %rcx # 0xdea65 movq %r15, %rdi movq %rbx, %r8 callq 0xaef6f leaq 0x26faf(%rip), %rsi # 0xd56e0 leaq 0x301bd(%rip), %rcx # 0xde8f5 movl $0x8, %edx movq %r15, %rdi movq %rbx, %r8 callq 0xaefe0 leaq 0x26faa(%rip), %rsi # 0xd56f9 leaq 0x301b6(%rip), %rcx # 0xde90c movl $0x2, %edx movq %r15, %rdi movq %rbx, %r8 callq 0xaefe0 movq 0x10(%rsp), %rdx leaq 0x2deaf(%rip), %rsi # 0xdc621 leaq 0x301ad(%rip), %rcx # 0xde926 movq %r15, %rdi movq %rbx, %r8 callq 0xaefe0 leaq 0x2de9e(%rip), %rsi # 0xdc629 leaq 0x301b1(%rip), %rcx # 0xde943 movq %r15, %rdi movq %r13, %rdx movq %rbx, %r8 callq 0xaefe0 leaq 0x2d94e(%rip), %rsi # 0xdc0f5 leaq 0x301ad(%rip), %rcx # 0xde95b movq %r15, %rdi xorl %edx, %edx movq %rbx, %r8 callq 0xaefe0 leaq 0x2d93b(%rip), %rsi # 0xdc0fd leaq 0x301b9(%rip), %rcx # 0xde982 movl $0x1, %edx movq %r15, %rdi movq %rbx, %r8 callq 0xaefe0 movl %ebp, %edx leaq 0x200d2(%rip), %rsi # 0xce8b4 leaq 0x301bb(%rip), %rcx # 0xde9a4 movq %r15, %rdi movq %rdx, 0x28(%rsp) movq %rbx, %r8 callq 0xaefe0 xorl %r14d, %r14d movq 0x20(%rsp), %r12 cmpq %r14, 0x28(%rsp) je 0xae9f8 movq %r14, %rbp movq (%r12,%r14,8), %rax cmpb $0x0, (%rax) je 0xae877 leal 0x1(%rbp), %r14d movl $0x49, %esi leaq 0xa0(%rsp), %rbx movq %rbx, %rdi leaq 0x3018e(%rip), %rdx # 0xde9c1 movl %r14d, %ecx xorl %eax, %eax callq 0x60b0 leaq 0x1d820(%rip), %rdi # 0xcc064 movl %r14d, %esi leaq 0xf0(%rsp), %r14 movq %r14, %rdx movq 0x198(%rsp), %r13 movq %r13, %rcx callq 0x380c3 movq (%r12,%rbp,8), %rdx movq %r15, %rdi movq %r14, %rsi movq %rbx, %rcx movq %r13, %r8 callq 0xaef6f movq 0x8(%rsp), %rax movq (%rax,%rbp,8), %rax testq %rax, %rax jle 0xae88c cmpq 0x10(%rsp), %rax jle 0xae89a movq 0x198(%rsp), %rax movl $0xea, (%rax) leaq 0x1(%rbp), %r14 movl $0x49, %esi leaq 0xa0(%rsp), %r12 movq %r12, %rdi leaq 0x30120(%rip), %rdx # 0xde9d5 movl %r14d, %ecx xorl %eax, %eax callq 0x60b0 leaq 0x1ffe8(%rip), %rdi # 0xce8ae movl %r14d, %esi leaq 0xf0(%rsp), %rbx movq %rbx, %rdx movq 0x198(%rsp), %r13 movq %r13, %rcx callq 0x380c3 movq 0x8(%rsp), %rax movq (%rax,%rbp,8), %rdx movq %r15, %rdi movq %rbx, %rsi movq %r12, %rcx movq %r13, %r8 callq 0xaefe0 movq 0x180(%rsp), %rax movq (%rax,%rbp,8), %r12 movq %r12, %rdi callq 0x6280 cmpq $0x1e, %rax jae 0xae9e1 movq %r15, %r13 leaq 0x80(%rsp), %r15 movq %r15, %rdi movq %r12, %rsi callq 0x6460 movq %r15, %rdi callq 0x37871 leaq 0x1ff8b(%rip), %rdi # 0xce8cc movl %r14d, %esi movq %rbx, %rdx movq 0x198(%rsp), %r12 movq %r12, %rcx callq 0x380c3 movq %r13, %rdi movq %rbx, %rsi movq %r15, %rdx movq %r13, %r15 leaq 0x300bc(%rip), %rcx # 0xdea26 movq %r12, %r13 movq %r12, %r8 callq 0xaef6f cmpq $0x0, 0x188(%rsp) je 0xae9cc movq 0x188(%rsp), %rax movq (%rax,%rbp,8), %rax testq %rax, %rax je 0xae9cc cmpb $0x0, (%rax) je 0xae9cc leaq 0x201aa(%rip), %rdi # 0xceb47 movl %r14d, %esi movq %rbx, %rdx movq %r13, %rcx callq 0x380c3 movq 0x188(%rsp), %rax movq (%rax,%rbp,8), %rdx movq %r15, %rdi movq %rbx, %rsi leaq 0x3007d(%rip), %rcx # 0xdea41 movq %r13, %r8 callq 0xaef6f movq %r13, %rbx cmpl $0x0, (%r13) movq 0x20(%rsp), %r12 jle 0xae801 jmp 0xae9f8 leaq 0x3000b(%rip), %rdi # 0xde9f3 callq 0x37264 movl $0x105, (%r13) # imm = 0x105 movq %r13, %rbx cmpb $0x0, 0x30(%rsp) je 0xaea1d leaq 0x1ce7c(%rip), %rsi # 0xcb882 leaq 0x3004b(%rip), %rcx # 0xdea58 leaq 0x30(%rsp), %rdx movq %r15, %rdi movq %rbx, %r8 callq 0xaef6f cmpl $0x0, (%rbx) movq 0x8(%rsp), %r14 jle 0xaea33 leaq 0x3004d(%rip), %rdi # 0xdea7b callq 0x37264 cmpb $0x0, 0x1c(%rsp) jne 0xaea42 movq %r14, %rdi callq 0x6260 movl (%rbx), %eax addq $0x148, %rsp # imm = 0x148 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putkey.c
ffpkyc
int ffpkyc( fitsfile *fptr, /* I - FITS file pointer */ const char *keyname,/* I - name of keyword to write */ float *value, /* I - keyword value (real, imaginary) */ int decim, /* I - number of decimal places to display */ const char *comm, /* I - keyword comment */ int *status) /* IO - error status */ /* Write (put) the keyword, value and comment into the FITS header. Writes an complex float keyword value. Format = (realvalue, imagvalue) */ { char valstring[FLEN_VALUE], tmpstring[FLEN_VALUE]; char card[FLEN_CARD]; if (*status > 0) /* inherit input status value if > 0 */ return(*status); strcpy(valstring, "(" ); ffr2e(value[0], decim, tmpstring, status); /* convert to string */ if (strlen(valstring)+strlen(tmpstring)+2 > FLEN_VALUE-1) { ffpmsg("Error converting complex to string (ffpkyc)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ", "); ffr2e(value[1], decim, tmpstring, status); /* convert to string */ if (strlen(valstring)+strlen(tmpstring)+1 > FLEN_VALUE-1) { ffpmsg("Error converting complex to string (ffpkyc)"); return(*status=BAD_F2C); } strcat(valstring, tmpstring); strcat(valstring, ")"); ffmkky(keyname, valstring, comm, card, status); /* construct the keyword*/ ffprec(fptr, card, status); /* write the keyword*/ return(*status); }
movl (%r9), %eax testl %eax, %eax jle 0xaf27c retq pushq %rbp pushq %r15 pushq %r14 pushq %r13 pushq %r12 pushq %rbx subq $0x108, %rsp # imm = 0x108 movq %r9, %rbx movl %ecx, %ebp movq %rdx, %r13 movq %rsi, %r12 movq %r8, (%rsp) movq %rdi, 0x8(%rsp) leaq 0x10(%rsp), %r14 movw $0x28, (%r14) movss (%rdx), %xmm0 leaq 0x60(%rsp), %r15 movl %ecx, %edi movq %r15, %rsi movq %r9, %rdx callq 0xaff99 movq %r14, %rdi callq 0x6280 movq %rax, %r14 movq %r15, %rdi callq 0x6280 addq %r14, %rax addq $-0x45, %rax cmpq $-0x48, %rax jbe 0xaf33e leaq 0x10(%rsp), %r14 leaq 0x60(%rsp), %r15 movq %r14, %rdi movq %r15, %rsi callq 0x6330 movq %r14, %rdi callq 0x6280 movw $0x202c, 0x10(%rsp,%rax) # imm = 0x202C movb $0x0, 0x12(%rsp,%rax) movss 0x4(%r13), %xmm0 movl %ebp, %edi movq %r15, %rsi movq %rbx, %rdx callq 0xaff99 movq %r14, %rdi callq 0x6280 movq %rax, %r14 movq %r15, %rdi callq 0x6280 addq %r14, %rax addq $-0x46, %rax cmpq $-0x48, %rax ja 0xaf357 leaq 0x2edc3(%rip), %rdi # 0xde108 callq 0x37264 movl $0x192, (%rbx) # imm = 0x192 movl $0x192, %eax # imm = 0x192 jmp 0xaf3a7 leaq 0x10(%rsp), %r14 leaq 0x60(%rsp), %rsi movq %r14, %rdi callq 0x6330 movq %r14, %rdi callq 0x6280 movw $0x29, 0x10(%rsp,%rax) leaq 0xb0(%rsp), %r15 movq %r12, %rdi movq %r14, %rsi movq (%rsp), %rdx movq %r15, %rcx movq %rbx, %r8 callq 0x378ab movq 0x8(%rsp), %rdi movq %r15, %rsi movq %rbx, %rdx callq 0xaebe4 movl (%rbx), %eax addq $0x108, %rsp # imm = 0x108 popq %rbx popq %r12 popq %r13 popq %r14 popq %r15 popq %rbp retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putkey.c
ffu2c
int ffu2c(ULONGLONG ival, /* I - value to be converted to a string */ char *cval, /* O - character string representation of the value */ int *status) /* IO - error status */ /* convert value to a null-terminated formatted string. */ { if (*status > 0) /* inherit input status value if > 0 */ return(*status); cval[0] = '\0'; #if defined(_MSC_VER) /* Microsoft Visual C++ 6.0 uses '%I64d' syntax for 8-byte integers */ if (sprintf(cval, "%I64u", ival) < 0) #elif (USE_LL_SUFFIX == 1) if (sprintf(cval, "%llu", ival) < 0) #else if (sprintf(cval, "%lu", ival) < 0) #endif { ffpmsg("Error in ffu2c converting integer to string"); *status = BAD_I2C; } return(*status); }
pushq %rbx movq %rdx, %rbx movl (%rdx), %eax testl %eax, %eax jg 0xafe7a movq %rdi, %rdx movb $0x0, (%rsi) leaq 0x2eed3(%rip), %rax # 0xded21 movq %rsi, %rdi movq %rax, %rsi xorl %eax, %eax callq 0x62d0 testl %eax, %eax js 0xafe63 movl (%rbx), %eax jmp 0xafe7a leaq 0x2eebc(%rip), %rdi # 0xded26 callq 0x37264 movl $0x191, (%rbx) # imm = 0x191 movl $0x191, %eax # imm = 0x191 popq %rbx retq
/Helioviewer-Project[P]fits2img/support/cfitsio/cfitsio-4.6.2/putkey.c