name
stringlengths 1
473k
| code
stringlengths 7
647k
| asm
stringlengths 4
3.39M
| file
stringlengths 8
196
|
---|---|---|---|
embree::ImageT<embree::Col3<unsigned char>>::ImageT(unsigned long, unsigned long, embree::Col3<unsigned char> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) | ImageT (size_t width, size_t height, const T& color, const std::string& name = "")
: Image(width,height,name)
{
data = new T[width*height];
for (size_t i=0; i<width*height; i++) data[i] = color;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq $0x0, 0x8(%rdi)
leaq 0x7c1fc(%rip), %r13 # 0x16b2a0
movq %r13, (%rdi)
movq %rsi, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
addq $0x20, %rdi
leaq 0x30(%rbx), %rbp
movq %rbp, 0x20(%rbx)
movq (%r8), %rsi
movq 0x8(%r8), %rdx
addq %rsi, %rdx
callq 0x621de
leaq 0x7c107(%rip), %rax # 0x16b1d8
movq %rax, (%rbx)
imulq %r12, %r15
movl $0x3, %ecx
movq %r15, %rax
mulq %rcx
movq $-0x1, %rdi
cmovnoq %rax, %rdi
callq 0x14040
movq %rax, 0x40(%rbx)
testq %r15, %r15
je 0xef124
movl $0x2, %eax
movq 0x40(%rbx), %rcx
movb (%r14), %dl
movb %dl, -0x2(%rcx,%rax)
movb 0x1(%r14), %dl
movb %dl, -0x1(%rcx,%rax)
movb 0x2(%r14), %dl
movb %dl, (%rcx,%rax)
addq $0x3, %rax
decq %r15
jne 0xef101
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %r13, (%rbx)
movq 0x20(%rbx), %rdi
cmpq %rbp, %rdi
je 0xef147
callq 0x14760
movq %r14, %rdi
callq 0x14fb0
nop
| /embree[P]embree/tutorials/common/image/image.h |
embree::ImageT<embree::Col3<unsigned char>>::ImageT(unsigned long, unsigned long, embree::Col3<unsigned char>*, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool) | ImageT (size_t width, size_t height, T* color, const bool copy = true, const std::string& name = "", const bool flip_y = false)
: Image(width,height,name)
{
if (copy)
{
data = new T[width*height];
if (flip_y)
{
const T* in = color + (height-1) * width;
T* out = data;
for (size_t y=0; y<height; y++)
{
for (size_t x=0; x<width; x++)
out[x] = in[x];
in -= width;
out += width;
}
}
else
{
for (size_t i=0; i<width*height; i++)
data[i] = color[i];
}
}
else
{
data = color;
}
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq $0x0, 0x8(%rdi)
leaq 0x7c127(%rip), %r13 # 0x16b2a0
movq %r13, (%rdi)
movq %rsi, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
addq $0x20, %rdi
leaq 0x30(%r12), %rax
movq %rax, (%rsp)
movq %rax, 0x20(%r12)
movq (%r9), %rsi
movq 0x8(%r9), %rdx
addq %rsi, %rdx
callq 0x621de
leaq 0x7c02c(%rip), %rax # 0x16b1d8
movq %rax, (%r12)
testl %ebp, %ebp
je 0xef24c
movq %r13, %rbp
movq %r14, %r13
imulq %r15, %r13
movl $0x3, %ecx
movq %r13, %rax
mulq %rcx
movq $-0x1, %rdi
cmovnoq %rax, %rdi
callq 0x14040
movb 0x40(%rsp), %cl
movq %rax, 0x40(%r12)
testb %cl, %cl
je 0xef253
testq %r14, %r14
je 0xef281
leaq -0x1(%r14), %rdx
leaq (%r15,%r15,2), %rcx
imulq %rcx, %rdx
addq %rdx, %rbx
movq %rcx, %rdx
negq %rdx
xorl %esi, %esi
testq %r15, %r15
je 0xef23c
movl $0x2, %edi
movq %r15, %r8
movb -0x2(%rbx,%rdi), %r9b
movb %r9b, -0x2(%rax,%rdi)
movb -0x1(%rbx,%rdi), %r9b
movb %r9b, -0x1(%rax,%rdi)
movb (%rbx,%rdi), %r9b
movb %r9b, (%rax,%rdi)
addq $0x3, %rdi
decq %r8
jne 0xef217
incq %rsi
addq %rcx, %rax
addq %rdx, %rbx
cmpq %r14, %rsi
jne 0xef20a
jmp 0xef281
movq %rbx, 0x40(%r12)
jmp 0xef281
testq %r13, %r13
je 0xef281
movl $0x2, %eax
movq 0x40(%r12), %rcx
movb -0x2(%rbx,%rax), %dl
movb %dl, -0x2(%rcx,%rax)
movb -0x1(%rbx,%rax), %dl
movb %dl, -0x1(%rcx,%rax)
movb (%rbx,%rax), %dl
movb %dl, (%rcx,%rax)
addq $0x3, %rax
decq %r13
jne 0xef25d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rbp, (%r12)
movq 0x20(%r12), %rdi
cmpq (%rsp), %rdi
je 0xef2a7
callq 0x14760
movq %rbx, %rdi
callq 0x14fb0
nop
| /embree[P]embree/tutorials/common/image/image.h |
embree::ImageT<embree::Col3<unsigned char>>::~ImageT() | virtual ~ImageT() {
delete[] data; data = nullptr;
} | pushq %rbx
movq %rdi, %rbx
leaq 0x7bf1d(%rip), %rax # 0x16b1d8
movq %rax, (%rdi)
movq 0x40(%rdi), %rdi
testq %rdi, %rdi
je 0xef2cc
callq 0x14af0
movq $0x0, 0x40(%rbx)
leaq 0x7bfc5(%rip), %rax # 0x16b2a0
movq %rax, (%rbx)
movq 0x20(%rbx), %rdi
addq $0x30, %rbx
cmpq %rbx, %rdi
je 0xef2f1
popq %rbx
jmp 0x14760
popq %rbx
retq
nop
| /embree[P]embree/tutorials/common/image/image.h |
embree::ImageT<embree::Col3<unsigned char>>::set(unsigned long, unsigned long, embree::Color4 const&) | __forceinline void set(size_t x, size_t y, const Color4& c) {
c.set(data[y*width+x]);
} | imulq 0x10(%rdi), %rdx
leaq (%rdx,%rdx,2), %rax
addq 0x40(%rdi), %rax
leaq (%rsi,%rsi,2), %rdx
movaps (%rcx), %xmm0
minps 0x2a92b(%rip), %xmm0 # 0x119ca0
xorps %xmm1, %xmm1
maxps %xmm1, %xmm0
mulps 0x324be(%rip), %xmm0 # 0x121840
cvttss2si %xmm0, %ecx
movb %cl, (%rax,%rdx)
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1 # xmm1 = xmm1[1,1],xmm0[1,1]
cvttss2si %xmm1, %ecx
movb %cl, 0x1(%rax,%rdx)
movhlps %xmm0, %xmm0 # xmm0 = xmm0[1,1]
cvttss2si %xmm0, %ecx
movb %cl, 0x2(%rax,%rdx)
retq
| /embree[P]embree/tutorials/common/image/image.h |
embree::ImageT<embree::Col3<float>>::ImageT(unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) | ImageT (size_t width = 0, size_t height = 0, const std::string& name = "")
: Image(width,height,name)
{
data = new T[width*height];
memset((void*)data,0,width*height*sizeof(T));
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq $0x0, 0x8(%rdi)
leaq 0x7bec7(%rip), %r12 # 0x16b2a0
movq %r12, (%rdi)
movq %rsi, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
addq $0x20, %rdi
leaq 0x30(%rbx), %r13
movq %r13, 0x20(%rbx)
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
addq %rsi, %rdx
callq 0x621de
leaq 0x7be12(%rip), %rax # 0x16b218
movq %rax, (%rbx)
imulq %r15, %r14
movl $0xc, %ecx
movq %r14, %rax
mulq %rcx
movq %rax, %r14
movq $-0x1, %rdi
cmovnoq %rax, %rdi
callq 0x14040
movq %rax, 0x40(%rbx)
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x14470
movq %rax, %r14
movq %r12, (%rbx)
movq 0x20(%rbx), %rdi
cmpq %r13, %rdi
je 0xef459
callq 0x14760
movq %r14, %rdi
callq 0x14fb0
nop
| /embree[P]embree/tutorials/common/image/image.h |
embree::ImageT<embree::Col3<float>>::ImageT(unsigned long, unsigned long, embree::Col3<float>*, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool) | ImageT (size_t width, size_t height, T* color, const bool copy = true, const std::string& name = "", const bool flip_y = false)
: Image(width,height,name)
{
if (copy)
{
data = new T[width*height];
if (flip_y)
{
const T* in = color + (height-1) * width;
T* out = data;
for (size_t y=0; y<height; y++)
{
for (size_t x=0; x<width; x++)
out[x] = in[x];
in -= width;
out += width;
}
}
else
{
for (size_t i=0; i<width*height; i++)
data[i] = color[i];
}
}
else
{
data = color;
}
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq $0x0, 0x8(%rdi)
leaq 0x7bd37(%rip), %r13 # 0x16b2a0
movq %r13, (%rdi)
movq %rsi, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
addq $0x20, %rdi
leaq 0x30(%r12), %rax
movq %rax, (%rsp)
movq %rax, 0x20(%r12)
movq (%r9), %rsi
movq 0x8(%r9), %rdx
addq %rsi, %rdx
callq 0x621de
leaq 0x7bc7c(%rip), %rax # 0x16b218
movq %rax, (%r12)
testl %ebp, %ebp
je 0xef63e
movq %r13, %rbp
movq %r14, %r13
imulq %r15, %r13
movl $0xc, %ecx
movq %r13, %rax
mulq %rcx
movq $-0x1, %rdi
cmovnoq %rax, %rdi
callq 0x14040
movb 0x40(%rsp), %cl
movq %rax, 0x40(%r12)
testb %cl, %cl
je 0xef645
testq %r14, %r14
je 0xef67f
leaq -0x1(%r14), %rdx
leaq (,%r15,4), %rcx
leaq (%rcx,%rcx,2), %rcx
imulq %rcx, %rdx
addq %rdx, %rbx
movq %rcx, %rdx
negq %rdx
xorl %esi, %esi
testq %r15, %r15
je 0xef62e
movl $0x8, %edi
movq %r15, %r8
movsd -0x8(%rbx,%rdi), %xmm0
movsd %xmm0, -0x8(%rax,%rdi)
movss (%rbx,%rdi), %xmm0
movss %xmm0, (%rax,%rdi)
addq $0xc, %rdi
decq %r8
jne 0xef60f
incq %rsi
addq %rcx, %rax
addq %rdx, %rbx
cmpq %r14, %rsi
jne 0xef602
jmp 0xef67f
movq %rbx, 0x40(%r12)
jmp 0xef67f
testq %r13, %r13
je 0xef67f
movl $0x8, %eax
movq 0x40(%r12), %rcx
movss -0x8(%rbx,%rax), %xmm0
movss %xmm0, -0x8(%rcx,%rax)
movss -0x4(%rbx,%rax), %xmm0
movss %xmm0, -0x4(%rcx,%rax)
movss (%rbx,%rax), %xmm0
movss %xmm0, (%rcx,%rax)
addq $0xc, %rax
decq %r13
jne 0xef64f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rbp, (%r12)
movq 0x20(%r12), %rdi
cmpq (%rsp), %rdi
je 0xef6a5
callq 0x14760
movq %rbx, %rdi
callq 0x14fb0
nop
| /embree[P]embree/tutorials/common/image/image.h |
embree::loadPFM(embree::FileName const&) | Ref<Image> loadPFM(const FileName& fileName)
{
/* open file for reading */
std::fstream file;
file.exceptions (std::fstream::failbit | std::fstream::badbit);
file.open (fileName.c_str(), std::fstream::in | std::fstream::binary);
/* read file type */
char cty[2]; file.read(cty,2);
skipSpacesAndComments(file);
std::string type(cty,2);
/* read width, height, and maximum color value */
int width; file >> width;
skipSpacesAndComments(file);
int height; file >> height;
skipSpacesAndComments(file);
float maxColor; file >> maxColor;
if (maxColor > 0) THROW_RUNTIME_ERROR("Big endian PFM files not supported");
float rcpMaxColor = -1.0f/float(maxColor);
file.ignore(); // skip space or return
/* create image and fill with data */
Ref<Image> img = new Image4f(width,height,fileName);
/* image in binary format 16 bit */
if (type == "PF")
{
float rgb[3];
for (ssize_t y=height-1; y>=0; y--) {
for (ssize_t x=0; x<width; x++) {
file.read((char*)rgb,sizeof(rgb));
img->set(x,y,Color4(rgb[0]*rcpMaxColor,rgb[1]*rcpMaxColor,rgb[2]*rcpMaxColor,1.0f));
}
}
}
/* invalid magic value */
else {
THROW_RUNTIME_ERROR("Invalid magic value in PFM file");
}
return img;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp # imm = 0x2A8
movq %rsi, %r15
movq %rdi, 0x18(%rsp)
leaq 0x98(%rsp), %rbx
movq %rbx, %rdi
callq 0x149a0
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rdi
addq $0x98, %rdi
movl $0x5, 0x1c(%rdi)
movl 0x20(%rdi), %esi
callq 0x14f50
movq (%r15), %rsi
leaq 0x98(%rsp), %rdi
movl $0xc, %edx
callq 0x14730
leaq 0x98(%rsp), %rdi
leaq 0xe(%rsp), %rsi
movl $0x2, %edx
callq 0x14a90
leaq 0x98(%rsp), %rdi
callq 0xeffb6
leaq 0x70(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movzwl 0xe(%rsp), %eax
movw %ax, (%rcx)
movq $0x2, -0x8(%rcx)
movb $0x0, 0x2(%rcx)
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x144c0
leaq 0x98(%rsp), %rdi
callq 0xeffb6
leaq 0x98(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x144c0
leaq 0x98(%rsp), %rdi
callq 0xeffb6
leaq 0x98(%rsp), %rdi
leaq 0x14(%rsp), %rsi
callq 0x15220
movss 0x14(%rsp), %xmm1
xorps %xmm0, %xmm0
movss %xmm1, 0x20(%rsp)
ucomiss %xmm0, %xmm1
ja 0xefebd
leaq 0x98(%rsp), %rdi
callq 0x15060
movl $0x48, %edi
callq 0x147e0
movq %rax, %r14
movslq 0x8(%rsp), %rbx
movslq 0x10(%rsp), %r12
leaq 0x50(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x621de
movb $0x1, %bpl
leaq 0x40(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0xf0208
movq 0x18(%rsp), %rax
movq %r14, (%rax)
movq (%r14), %rax
xorl %ebp, %ebp
movq %r14, %rdi
callq *0x10(%rax)
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0xefdb5
callq 0x14760
leaq 0x31b37(%rip), %rsi # 0x1218f3
leaq 0x60(%rsp), %rdi
callq 0x14240
testl %eax, %eax
jne 0xefef1
movl 0x10(%rsp), %r15d
testl %r15d, %r15d
jle 0xefe85
movss 0x29d08(%rip), %xmm0 # 0x119aec
divss 0x20(%rsp), %xmm0
decl %r15d
movl 0x8(%rsp), %eax
movaps %xmm0, 0x20(%rsp)
shufps $0x0, %xmm0, %xmm0 # xmm0 = xmm0[0,0,0,0]
movaps %xmm0, 0x80(%rsp)
leaq 0x98(%rsp), %r12
leaq 0x34(%rsp), %r13
leaq 0x40(%rsp), %rbp
testl %eax, %eax
jle 0xefe79
xorl %ebx, %ebx
movl $0xc, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x14a90
movss 0x34(%rsp), %xmm0
mulss 0x20(%rsp), %xmm0
shufpd $0x2, 0x2a031(%rip), %xmm0 # xmm0 = xmm0[0],mem[1]
movsd 0x38(%rsp), %xmm1
mulps 0x80(%rsp), %xmm1
shufps $0x4c, %xmm1, %xmm0 # xmm0 = xmm0[0,3],xmm1[0,1]
shufps $0x78, %xmm0, %xmm0 # xmm0 = xmm0[0,2,3,1]
movaps %xmm0, 0x40(%rsp)
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %rbp, %rcx
callq *0x28(%rax)
incq %rbx
movslq 0x8(%rsp), %rax
cmpq %rax, %rbx
jl 0xefe1a
leaq -0x1(%r15), %rcx
testq %r15, %r15
movq %rcx, %r15
jg 0xefe14
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xefe99
callq 0x14760
leaq 0x98(%rsp), %rdi
callq 0x141e0
movq 0x18(%rsp), %rax
addq $0x2a8, %rsp # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x143c0
movq %rax, %r14
leaq 0x319ff(%rip), %rsi # 0x1218d0
movq %rax, %rdi
callq 0x14300
movq 0x7c108(%rip), %rsi # 0x16bfe8
movq 0x7c091(%rip), %rdx # 0x16bf78
movq %r14, %rdi
callq 0x14f60
jmp 0xeff23
movl $0x10, %edi
callq 0x143c0
movq %rax, %r15
leaq 0x319f1(%rip), %rsi # 0x1218f6
movq %rax, %rdi
callq 0x14300
movq 0x7c0d4(%rip), %rsi # 0x16bfe8
movq 0x7c05d(%rip), %rdx # 0x16bf78
movq %r15, %rdi
callq 0x14f60
jmp 0xeff79
movq %rax, %rbx
movq %r15, %rdi
callq 0x145f0
jmp 0xeff7c
movq %rax, %rbx
movq %r14, %rdi
callq 0x145f0
jmp 0xeff85
movq %rax, %rbx
jmp 0xeff5d
jmp 0xeff6b
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0xeff58
callq 0x14760
testb %bpl, %bpl
je 0xeff85
movq %r14, %rdi
callq 0x14760
jmp 0xeff85
jmp 0xeff6b
jmp 0xeff6b
movq %rax, %rbx
jmp 0xeff85
jmp 0xeff72
movq %rax, %rbx
jmp 0xeff99
jmp 0xeff79
movq %rax, %rbx
movq (%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xeff99
callq 0x14760
leaq 0x98(%rsp), %rdi
callq 0x141e0
movq %rbx, %rdi
callq 0x14fb0
movq %rax, %rdi
callq 0x34e30
| /embree[P]embree/tutorials/common/image/pfm.cpp |
embree::storePFM(embree::Ref<embree::Image> const&, embree::FileName const&) | void storePFM(const Ref<Image>& img, const FileName& fileName)
{
/* open file for writing */
std::fstream file;
file.exceptions (std::fstream::failbit | std::fstream::badbit);
file.open (fileName.c_str(), std::fstream::out | std::fstream::binary);
/* write file header */
file << "PF" << std::endl;
file << img->width << " " << img->height << std::endl;
file << -1.0f << std::endl;
/* write image */
for (ssize_t y=img->height-1; y>=0; y--) {
for (ssize_t x=0; x<(ssize_t)img->width; x++) {
const Color4 c = img->get(x,y);
file.write((char*)&c,3*sizeof(float));
}
}
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x220, %rsp # imm = 0x220
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x149a0
movq (%r15), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rdi
addq $0x10, %rdi
movl $0x5, 0x1c(%rdi)
movl 0x20(%rdi), %esi
callq 0x14f50
movq (%r14), %rsi
leaq 0x10(%rsp), %rdi
movl $0x14, %edx
callq 0x14730
leaq 0x20(%rsp), %r14
leaq 0x3183c(%rip), %rsi # 0x1218f3
movl $0x2, %edx
movq %r14, %rdi
callq 0x14900
movq 0x20(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x14790
movsbl %al, %esi
movq %r14, %rdi
callq 0x14050
movq %rax, %rdi
callq 0x145a0
movq (%rbx), %rax
movq 0x10(%rax), %rsi
movq %r14, %rdi
callq 0x14590
movq %rax, %r15
leaq 0x2e1da(%rip), %rsi # 0x11e2e0
movl $0x1, %edx
movq %rax, %rdi
callq 0x14900
movq (%rbx), %rax
movq 0x18(%rax), %rsi
movq %r15, %rdi
callq 0x14590
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x14790
movsbl %al, %esi
movq %r15, %rdi
callq 0x14050
movq %rax, %rdi
callq 0x145a0
movsd 0x31774(%rip), %xmm0 # 0x1218c8
movq %r14, %rdi
callq 0x14e50
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x14790
movsbl %al, %esi
movq %r15, %rdi
callq 0x14050
movq %rax, %rdi
callq 0x145a0
movq (%rbx), %rsi
movq 0x18(%rsi), %r15
decq %r15
js 0xf01d6
movq %rsp, %r12
cmpq $0x0, 0x10(%rsi)
jle 0xf01ca
xorl %r13d, %r13d
movq (%rsi), %rax
movq %r12, %rdi
movq %r13, %rdx
movq %r15, %rcx
callq *0x20(%rax)
movl $0xc, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x14b10
incq %r13
movq (%rbx), %rsi
cmpq 0x10(%rsi), %r13
jl 0xf019f
leaq -0x1(%r15), %rax
testq %r15, %r15
movq %rax, %r15
jg 0xf0195
leaq 0x10(%rsp), %rdi
callq 0x141e0
addq $0x220, %rsp # imm = 0x220
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0xf01f3
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x141e0
movq %rbx, %rdi
callq 0x14fb0
| /embree[P]embree/tutorials/common/image/pfm.cpp |
embree::ImageT<embree::Col4<float>>::ImageT(unsigned long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) | ImageT (size_t width = 0, size_t height = 0, const std::string& name = "")
: Image(width,height,name)
{
data = new T[width*height];
memset((void*)data,0,width*height*sizeof(T));
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq $0x0, 0x8(%rdi)
leaq 0x7b077(%rip), %r12 # 0x16b2a0
movq %r12, (%rdi)
movq %rsi, 0x10(%rdi)
movq %rdx, 0x18(%rdi)
addq $0x20, %rdi
leaq 0x30(%rbx), %r13
movq %r13, 0x20(%rbx)
movq (%rcx), %rsi
movq 0x8(%rcx), %rdx
addq %rsi, %rdx
callq 0x621de
leaq 0x7b08a(%rip), %rax # 0x16b2e0
movq %rax, (%rbx)
imulq %r15, %r14
movq %r14, %rax
shrq $0x3c, %rax
shlq $0x4, %r14
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %r14, %rdi
callq 0x14040
movq %rax, 0x40(%rbx)
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x14470
movq %rax, %r14
movq %r12, (%rbx)
movq 0x20(%rbx), %rdi
cmpq %r13, %rdi
je 0xf02a6
callq 0x14760
movq %r14, %rdi
callq 0x14fb0
| /embree[P]embree/tutorials/common/image/image.h |
embree::ImageT<embree::Col4<float>>::~ImageT() | virtual ~ImageT() {
delete[] data; data = nullptr;
} | pushq %rbx
movq %rdi, %rbx
leaq 0x7b027(%rip), %rax # 0x16b2e0
movq %rax, (%rdi)
movq 0x40(%rdi), %rdi
testq %rdi, %rdi
je 0xf02ca
callq 0x14af0
movq $0x0, 0x40(%rbx)
leaq 0x7afc7(%rip), %rax # 0x16b2a0
movq %rax, (%rbx)
movq 0x20(%rbx), %rdi
addq $0x30, %rbx
cmpq %rbx, %rdi
je 0xf02ef
popq %rbx
jmp 0x14760
popq %rbx
retq
nop
| /embree[P]embree/tutorials/common/image/image.h |
embree::loadPPM(embree::FileName const&) | Ref<Image> loadPPM(const FileName& fileName)
{
/* open file for reading */
std::fstream file;
file.exceptions (std::fstream::failbit | std::fstream::badbit);
file.open (fileName.c_str(), std::fstream::in | std::fstream::binary);
/* read file type */
char cty[2]; file.read(cty,2);
skipSpacesAndComments(file);
std::string type(cty,2);
/* read width, height, and maximum color value */
int width; file >> width;
skipSpacesAndComments(file);
int height; file >> height;
skipSpacesAndComments(file);
int maxColor; file >> maxColor;
if (maxColor <= 0) THROW_RUNTIME_ERROR("Invalid maxColor value in PPM file");
float rcpMaxColor = 1.0f/float(maxColor);
file.ignore(); // skip space or return
/* create image and fill with data */
Ref<Image> img = new Image4uc(width,height,fileName);
/* image in text format */
if (type == "P3")
{
int r, g, b;
for (ssize_t y=0; y<height; y++) {
for (ssize_t x=0; x<width; x++) {
file >> r; file >> g; file >> b;
img->set(x,y,Color4(float(r)*rcpMaxColor,float(g)*rcpMaxColor,float(b)*rcpMaxColor,1.0f));
}
}
}
/* image in binary format 8 bit */
else if (type == "P6" && maxColor <= 255)
{
unsigned char rgb[3];
for (ssize_t y=0; y<height; y++) {
for (ssize_t x=0; x<width; x++) {
file.read((char*)rgb,sizeof(rgb));
img->set(x,y,Color4(float(rgb[0])*rcpMaxColor,float(rgb[1])*rcpMaxColor,float(rgb[2])*rcpMaxColor,1.0f));
}
}
}
/* image in binary format 16 bit */
else if (type == "P6" && maxColor <= 65535)
{
unsigned short rgb[3];
for (ssize_t y=0; y<height; y++) {
for (ssize_t x=0; x<width; x++) {
file.read((char*)rgb,sizeof(rgb));
img->set(x,y,Color4(float(rgb[0])*rcpMaxColor,float(rgb[1])*rcpMaxColor,float(rgb[2])*rcpMaxColor,1.0f));
}
}
}
/* invalid magic value */
else {
THROW_RUNTIME_ERROR("Invalid magic value in PPM file");
}
return img;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp # imm = 0x2A8
movq %rsi, %r15
movq %rdi, 0x48(%rsp)
leaq 0x98(%rsp), %rbx
movq %rbx, %rdi
callq 0x149a0
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rdi
addq $0x98, %rdi
movl $0x5, 0x1c(%rdi)
movl 0x20(%rdi), %esi
callq 0x14f50
movq (%r15), %rsi
leaq 0x98(%rsp), %rdi
movl $0xc, %edx
callq 0x14730
leaq 0x98(%rsp), %rdi
leaq 0x1e(%rsp), %rsi
movl $0x2, %edx
callq 0x14a90
leaq 0x98(%rsp), %rdi
callq 0xf08f7
leaq 0x88(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movzwl 0x1e(%rsp), %eax
movw %ax, (%rcx)
movq $0x2, -0x8(%rcx)
movb $0x0, 0x2(%rcx)
leaq 0x98(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x144c0
leaq 0x98(%rsp), %rdi
callq 0xf08f7
leaq 0x98(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x144c0
leaq 0x98(%rsp), %rdi
callq 0xf08f7
leaq 0x98(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x144c0
movl 0x18(%rsp), %ebp
testl %ebp, %ebp
jle 0xf07f3
leaq 0x98(%rsp), %rdi
callq 0x15060
movl $0x48, %edi
callq 0x147e0
movq %rax, %r14
movslq 0xc(%rsp), %rbx
movslq 0x8(%rsp), %r12
leaq 0x60(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0x621de
movb $0x1, %r15b
leaq 0x50(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0xf0bfa
movq 0x48(%rsp), %rax
movq %r14, (%rax)
movq (%r14), %rax
xorl %r15d, %r15d
movq %r14, %rdi
callq *0x10(%rax)
cvtsi2ss %ebp, %xmm1
movss 0x2956e(%rip), %xmm0 # 0x119a40
movaps %xmm0, 0x20(%rsp)
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0xf04f2
movss %xmm1, 0x30(%rsp)
callq 0x14760
movss 0x30(%rsp), %xmm1
movaps 0x20(%rsp), %xmm0
divss %xmm1, %xmm0
movaps %xmm0, 0x20(%rsp)
leaq 0x31458(%rip), %rsi # 0x12195f
leaq 0x78(%rsp), %rdi
callq 0x14240
testl %eax, %eax
je 0xf0604
leaq 0x31442(%rip), %rsi # 0x121962
leaq 0x78(%rsp), %rdi
callq 0x14240
testl %eax, %eax
jne 0xf06d9
cmpl $0xff, 0x18(%rsp)
jg 0xf06d9
movl 0x8(%rsp), %ecx
testl %ecx, %ecx
jle 0xf07b8
movl 0xc(%rsp), %eax
movaps 0x20(%rsp), %xmm0
shufps $0x0, %xmm0, %xmm0 # xmm0 = xmm0[0,0,0,0]
movaps %xmm0, 0x30(%rsp)
xorl %ebx, %ebx
leaq 0x98(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0x50(%rsp), %r13
testl %eax, %eax
jle 0xf05f0
xorl %ebp, %ebp
movl $0x3, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x14a90
movzbl 0x10(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x20(%rsp), %xmm0
shufpd $0x2, 0x298cd(%rip), %xmm0 # xmm0 = xmm0[0],mem[1]
movzwl 0x11(%rsp), %eax
movd %eax, %xmm1
pxor %xmm2, %xmm2
punpcklbw %xmm2, %xmm1 # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3],xmm1[4],xmm2[4],xmm1[5],xmm2[5],xmm1[6],xmm2[6],xmm1[7],xmm2[7]
punpcklwd %xmm2, %xmm1 # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
cvtdq2ps %xmm1, %xmm1
mulps 0x30(%rsp), %xmm1
shufps $0x4c, %xmm1, %xmm0 # xmm0 = xmm0[0,3],xmm1[0,1]
shufps $0x78, %xmm0, %xmm0 # xmm0 = xmm0[0,2,3,1]
movaps %xmm0, 0x50(%rsp)
movq (%r14), %rax
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq *0x28(%rax)
incq %rbp
movslq 0xc(%rsp), %rax
cmpq %rax, %rbp
jl 0xf0578
movl 0x8(%rsp), %ecx
incq %rbx
movslq %ecx, %rdx
cmpq %rdx, %rbx
jl 0xf0572
jmp 0xf07b8
movl 0x8(%rsp), %ecx
testl %ecx, %ecx
jle 0xf07b8
movl 0xc(%rsp), %eax
movaps 0x20(%rsp), %xmm0
shufps $0x0, %xmm0, %xmm0 # xmm0 = xmm0[0,0,0,0]
movaps %xmm0, 0x30(%rsp)
xorl %r15d, %r15d
leaq 0x98(%rsp), %r12
leaq 0x40(%rsp), %rbx
leaq 0x50(%rsp), %r13
testl %eax, %eax
jle 0xf06c5
xorl %ebp, %ebp
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x144c0
movq %r12, %rdi
leaq 0x44(%rsp), %rsi
callq 0x144c0
movq %r12, %rdi
movq %rbx, %rsi
callq 0x144c0
xorps %xmm0, %xmm0
cvtsi2ssl 0x10(%rsp), %xmm0
mulss 0x20(%rsp), %xmm0
shufpd $0x2, 0x297f2(%rip), %xmm0 # xmm0 = xmm0[0],mem[1]
movss 0x40(%rsp), %xmm1
movss 0x44(%rsp), %xmm2
unpcklps %xmm1, %xmm2 # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
cvtdq2ps %xmm2, %xmm1
mulps 0x30(%rsp), %xmm1
shufps $0x4c, %xmm1, %xmm0 # xmm0 = xmm0[0,3],xmm1[0,1]
shufps $0x78, %xmm0, %xmm0 # xmm0 = xmm0[0,2,3,1]
movaps %xmm0, 0x50(%rsp)
movq (%r14), %rax
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq *0x28(%rax)
incq %rbp
movslq 0xc(%rsp), %rax
cmpq %rax, %rbp
jl 0xf0641
movl 0x8(%rsp), %ecx
incq %r15
movslq %ecx, %rdx
cmpq %rdx, %r15
jl 0xf0637
jmp 0xf07b8
leaq 0x31282(%rip), %rsi # 0x121962
leaq 0x78(%rsp), %rdi
callq 0x14240
testl %eax, %eax
jne 0xf0827
cmpl $0xffff, 0x18(%rsp) # imm = 0xFFFF
jg 0xf0827
movl 0x8(%rsp), %ecx
testl %ecx, %ecx
jle 0xf07b8
movl 0xc(%rsp), %eax
movaps 0x20(%rsp), %xmm0
shufps $0x0, %xmm0, %xmm0 # xmm0 = xmm0[0,0,0,0]
movaps %xmm0, 0x30(%rsp)
xorl %ebx, %ebx
leaq 0x98(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0x50(%rsp), %r13
testl %eax, %eax
jle 0xf07a9
xorl %ebp, %ebp
movl $0x6, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x14a90
movzwl 0x10(%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x20(%rsp), %xmm0
shufpd $0x2, 0x2970d(%rip), %xmm0 # xmm0 = xmm0[0],mem[1]
movd 0x12(%rsp), %xmm1
punpcklwd 0x294ff(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1],xmm1[2],mem[2],xmm1[3],mem[3]
cvtdq2ps %xmm1, %xmm1
mulps 0x30(%rsp), %xmm1
shufps $0x4c, %xmm1, %xmm0 # xmm0 = xmm0[0,3],xmm1[0,1]
shufps $0x78, %xmm0, %xmm0 # xmm0 = xmm0[0,2,3,1]
movaps %xmm0, 0x50(%rsp)
movq (%r14), %rax
movq %r14, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq *0x28(%rax)
incq %rbp
movslq 0xc(%rsp), %rax
cmpq %rax, %rbp
jl 0xf0738
movl 0x8(%rsp), %ecx
incq %rbx
movslq %ecx, %rdx
cmpq %rdx, %rbx
jl 0xf0732
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0xf07cf
callq 0x14760
leaq 0x98(%rsp), %rdi
callq 0x141e0
movq 0x48(%rsp), %rax
addq $0x2a8, %rsp # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x143c0
movq %rax, %r14
leaq 0x31135(%rip), %rsi # 0x12193c
movq %rax, %rdi
callq 0x14300
movq 0x7b7d2(%rip), %rsi # 0x16bfe8
movq 0x7b75b(%rip), %rdx # 0x16bf78
movq %r14, %rdi
callq 0x14f60
jmp 0xf0859
movl $0x10, %edi
callq 0x143c0
movq %rax, %r15
leaq 0x3112a(%rip), %rsi # 0x121965
movq %rax, %rdi
callq 0x14300
movq 0x7b79e(%rip), %rsi # 0x16bfe8
movq 0x7b727(%rip), %rdx # 0x16bf78
movq %r15, %rdi
callq 0x14f60
jmp 0xf08b7
movq %rax, %rbx
movq %r15, %rdi
callq 0x145f0
jmp 0xf08ba
movq %rax, %rbx
movq %r14, %rdi
callq 0x145f0
jmp 0xf08c3
movq %rax, %rbx
jmp 0xf0893
jmp 0xf08a1
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0xf088e
callq 0x14760
testb %r15b, %r15b
je 0xf08c3
movq %r14, %rdi
callq 0x14760
jmp 0xf08c3
jmp 0xf08a1
jmp 0xf08a1
movq %rax, %rbx
jmp 0xf08c3
jmp 0xf08a8
movq %rax, %rbx
jmp 0xf08da
jmp 0xf08b7
jmp 0xf08b7
jmp 0xf08b7
jmp 0xf08b7
jmp 0xf08b7
movq %rax, %rbx
movq (%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0xf08da
callq 0x14760
leaq 0x98(%rsp), %rdi
callq 0x141e0
movq %rbx, %rdi
callq 0x14fb0
movq %rax, %rdi
callq 0x34e30
| /embree[P]embree/tutorials/common/image/ppm.cpp |
embree::loadTGA(embree::FileName const&) | Ref<Image> loadTGA(const FileName& fileName)
{
/* open file for reading */
std::fstream file;
file.exceptions (std::fstream::failbit | std::fstream::badbit);
file.open (fileName.c_str(), std::fstream::in | std::fstream::binary);
unsigned char idlength = fread_uchar(file);
if (idlength != 0) THROW_RUNTIME_ERROR("unsupported TGA file");
unsigned char colormaptype = fread_uchar(file);
if (colormaptype != 0) THROW_RUNTIME_ERROR("unsupported TGA file");
unsigned char datatype = fread_uchar(file);
if (datatype != 2) THROW_RUNTIME_ERROR("unsupported TGA file");
unsigned short cmo = fread_ushort(file);
unsigned short cml = fread_ushort(file);
unsigned char cmd = fread_uchar(file);
unsigned short xorg = fread_ushort(file);
unsigned short yorg = fread_ushort(file);
if (cmo != 0 || cml != 0 || cmd != 0 || xorg != 0 || yorg != 0)
THROW_RUNTIME_ERROR("unsupported TGA file");
unsigned short width = fread_ushort(file);
unsigned short height = fread_ushort(file);
unsigned char bits = fread_uchar(file);
if (bits != 3*8) THROW_RUNTIME_ERROR("unsupported TGA file bits per pixel");
unsigned char desc = fread_uchar(file);
if (desc != 0x20) THROW_RUNTIME_ERROR("unsupported TGA file");
/* create image and fill with data */
Ref<Image> img = new Image4f(width,height,fileName);
/* load image data */
for (size_t y=0; y<height; y++) {
for (size_t x=0; x<width; x++) {
const unsigned char b = fread_uchar(file);
const unsigned char g = fread_uchar(file);
const unsigned char r = fread_uchar(file);
img->set(x,y,Color4(r/255.0f,g/255.0f,b/255.0f,1.0f));
}
}
return img;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp # imm = 0x258
movq %rsi, %r14
movq %rdi, 0x40(%rsp)
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0x149a0
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rdi
addq $0x48, %rdi
movl $0x5, 0x1c(%rdi)
movl 0x20(%rdi), %esi
callq 0x14f50
movq (%r14), %rsi
leaq 0x48(%rsp), %rdi
movl $0xc, %edx
callq 0x14730
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
movl $0x1, %edx
callq 0x14a90
cmpb $0x0, (%rsp)
jne 0xf12d1
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
movl $0x1, %edx
callq 0x14a90
cmpb $0x0, (%rsp)
jne 0xf1308
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
movl $0x1, %edx
callq 0x14a90
cmpb $0x2, (%rsp)
jne 0xf133f
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
movl $0x2, %edx
callq 0x14a90
movq %rsp, %rsi
movzwl (%rsi), %ebx
leaq 0x48(%rsp), %rdi
movl $0x2, %edx
callq 0x14a90
movq %rsp, %rsi
movzwl (%rsi), %ebp
leaq 0x48(%rsp), %rdi
movl $0x1, %edx
callq 0x14a90
movq %rsp, %rsi
movb (%rsi), %r15b
leaq 0x48(%rsp), %rdi
movl $0x2, %edx
callq 0x14a90
movq %rsp, %rsi
movzwl (%rsi), %r12d
leaq 0x48(%rsp), %rdi
movl $0x2, %edx
callq 0x14a90
testb %r15b, %r15b
jne 0xf1376
orl %ebx, %ebp
orl %ebp, %r12d
orw (%rsp), %r12w
jne 0xf1376
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
movl $0x2, %edx
callq 0x14a90
movq %rsp, %rsi
movzwl (%rsi), %eax
movq %rax, 0x38(%rsp)
leaq 0x48(%rsp), %rdi
movl $0x2, %edx
callq 0x14a90
movq %rsp, %rsi
movzwl (%rsi), %eax
movq %rax, 0x28(%rsp)
leaq 0x48(%rsp), %rdi
movl $0x1, %edx
callq 0x14a90
cmpb $0x18, (%rsp)
jne 0xf13aa
leaq 0x48(%rsp), %rdi
movq %rsp, %rsi
movl $0x1, %edx
callq 0x14a90
cmpb $0x20, (%rsp)
jne 0xf13de
movl $0x48, %edi
callq 0x147e0
movq %rax, %r15
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
movq %rax, 0x30(%rsp)
callq 0x621de
movb $0x1, %bpl
movq %rsp, %rcx
movq %r15, %rdi
movq 0x38(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0xf0208
movq 0x40(%rsp), %rax
movq %r15, (%rax)
movq (%r15), %rax
xorl %ebp, %ebp
movq %r15, %rdi
callq *0x10(%rax)
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0xf11dc
callq 0x14760
cmpq $0x0, 0x28(%rsp)
je 0xf12b0
xorl %r14d, %r14d
leaq 0x48(%rsp), %rbp
movq %rsp, %rbx
cmpw $0x0, 0x38(%rsp)
je 0xf12a2
xorl %r13d, %r13d
movl $0x1, %edx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x14a90
movb (%rsp), %r12b
movl $0x1, %edx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x14a90
movb (%rsp), %r15b
movl $0x1, %edx
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x14a90
movzbl (%rsp), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x306eb(%rip), %xmm0 # 0x121938
shufpd $0x2, 0x28c1a(%rip), %xmm0 # xmm0 = xmm0[0],mem[1]
movzbl %r12b, %eax
movzbl %r15b, %ecx
movd %ecx, %xmm1
pinsrw $0x2, %eax, %xmm1
cvtdq2ps %xmm1, %xmm1
divps 0x3073f(%rip), %xmm1 # 0x1219b0
shufps $0x4c, %xmm1, %xmm0 # xmm0 = xmm0[0,3],xmm1[0,1]
shufps $0x78, %xmm0, %xmm0 # xmm0 = xmm0[0,2,3,1]
movaps %xmm0, (%rsp)
movq 0x30(%rsp), %r15
movq (%r15), %rax
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq *0x28(%rax)
incq %r13
cmpq %r13, 0x38(%rsp)
jne 0xf1202
incq %r14
cmpq 0x28(%rsp), %r14
jne 0xf11f3
leaq 0x48(%rsp), %rdi
callq 0x141e0
movq 0x40(%rsp), %rax
addq $0x258, %rsp # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x143c0
movq %rax, %r14
leaq 0x306db(%rip), %rsi # 0x1219c0
movq %rax, %rdi
callq 0x14300
movq 0x7acf4(%rip), %rsi # 0x16bfe8
movq 0x7ac7d(%rip), %rdx # 0x16bf78
movq %r14, %rdi
callq 0x14f60
jmp 0xf1410
movl $0x10, %edi
callq 0x143c0
movq %rax, %r14
leaq 0x306a4(%rip), %rsi # 0x1219c0
movq %rax, %rdi
callq 0x14300
movq 0x7acbd(%rip), %rsi # 0x16bfe8
movq 0x7ac46(%rip), %rdx # 0x16bf78
movq %r14, %rdi
callq 0x14f60
jmp 0xf1410
movl $0x10, %edi
callq 0x143c0
movq %rax, %r14
leaq 0x3066d(%rip), %rsi # 0x1219c0
movq %rax, %rdi
callq 0x14300
movq 0x7ac86(%rip), %rsi # 0x16bfe8
movq 0x7ac0f(%rip), %rdx # 0x16bf78
movq %r14, %rdi
callq 0x14f60
jmp 0xf1410
movl $0x10, %edi
callq 0x143c0
movq %rax, %r14
leaq 0x30636(%rip), %rsi # 0x1219c0
movq %rax, %rdi
callq 0x14300
movq 0x7ac4f(%rip), %rsi # 0x16bfe8
movq 0x7abd8(%rip), %rdx # 0x16bf78
movq %r14, %rdi
callq 0x14f60
jmp 0xf1410
movl $0x10, %edi
callq 0x143c0
movq %rax, %r14
leaq 0x30617(%rip), %rsi # 0x1219d5
movq %rax, %rdi
callq 0x14300
movq 0x7ac1b(%rip), %rsi # 0x16bfe8
movq 0x7aba4(%rip), %rdx # 0x16bf78
movq %r14, %rdi
callq 0x14f60
jmp 0xf1410
movl $0x10, %edi
callq 0x143c0
movq %rax, %r14
leaq 0x305ce(%rip), %rsi # 0x1219c0
movq %rax, %rdi
callq 0x14300
movq 0x7abe7(%rip), %rsi # 0x16bfe8
movq 0x7ab70(%rip), %rdx # 0x16bf78
movq %r14, %rdi
callq 0x14f60
jmp 0xf141a
jmp 0xf141a
jmp 0xf141a
jmp 0xf141a
jmp 0xf141a
movq %rax, %rbx
movq %r14, %rdi
callq 0x145f0
jmp 0xf1485
movq %rax, %rbx
jmp 0xf1458
jmp 0xf1466
jmp 0xf1466
jmp 0xf1466
jmp 0xf1466
jmp 0xf1466
jmp 0xf1466
jmp 0xf1466
jmp 0xf1466
jmp 0xf1466
jmp 0xf1466
jmp 0xf1466
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0xf1453
callq 0x14760
testb %bpl, %bpl
je 0xf1485
movq 0x30(%rsp), %rdi
callq 0x14760
jmp 0xf1485
jmp 0xf1466
movq %rax, %rbx
jmp 0xf1485
movq %rax, %rbx
movq 0x30(%rsp), %r15
jmp 0xf147c
jmp 0xf1479
jmp 0xf1479
movq %rax, %rbx
movq (%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
leaq 0x48(%rsp), %rdi
callq 0x141e0
movq %rbx, %rdi
callq 0x14fb0
movq %rax, %rdi
callq 0x34e30
nop
| /embree[P]embree/tutorials/common/image/tga.cpp |
stbi_load_from_file | STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
{
unsigned char *result;
stbi__context s;
stbi__start_file(&s,f);
result = stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp);
if (result) {
// need to 'unget' all the characters in the IO buffer
fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR);
}
return result;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x79e13(%rip), %rax # 0x16b390
leaq 0x40(%rsp), %rcx
movq %rax, -0x18(%rcx)
movups 0x79df3(%rip), %xmm0 # 0x16b380
movups %xmm0, -0x28(%rcx)
movq %rdi, -0x10(%rcx)
movabsq $0x8000000001, %rax # imm = 0x8000000001
movq %rax, -0x8(%rcx)
movl $0x0, 0x80(%rcx)
movq %rcx, 0x98(%rcx)
movq %rcx, 0x88(%rcx)
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0xfd694
movq 0xc8(%r13), %rax
movq %rax, 0xd8(%r13)
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movl %ebp, %r8d
callq 0xf1625
movq %rax, %r14
testq %rax, %rax
je 0xf1610
movl 0xc8(%rsp), %eax
subl 0xd0(%rsp), %eax
movslq %eax, %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x148c0
movq %r14, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi__load_and_postprocess_8bit(stbi__context*, int*, int*, int*, int) | static unsigned char *stbi__load_and_postprocess_8bit(stbi__context *s, int *x, int *y, int *comp, int req_comp)
{
stbi__result_info ri;
void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 8);
if (result == NULL)
return NULL;
// it is the responsibility of the loaders to make sure we get either 8 or 16 bit.
STBI_ASSERT(ri.bits_per_channel == 8 || ri.bits_per_channel == 16);
if (ri.bits_per_channel != 8) {
result = stbi__convert_16_to_8((stbi__uint16 *) result, *x, *y, req_comp == 0 ? *comp : req_comp);
ri.bits_per_channel = 8;
}
// @TODO: move stbi__convert_format to here
if (stbi__vertically_flip_on_load) {
int channels = req_comp ? req_comp : *comp;
stbi__vertical_flip(result, *x, *y, channels * sizeof(stbi_uc));
}
return (unsigned char *) result;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, %ebx
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r15
movl $0x8, (%rsp)
leaq 0x1c(%rsp), %r9
callq 0xf6b49
testq %rax, %rax
je 0xf1669
movq %rax, %rbp
cmpl $0x8, 0x1c(%rsp)
movq %r13, 0x10(%rsp)
jne 0xf1671
movq %rbp, %r13
jmp 0xf16e0
xorl %r13d, %r13d
jmp 0xf1725
movl (%r15), %eax
movl (%r14), %r12d
movl %ebx, %ecx
testl %ebx, %ebx
jne 0xf1681
movl (%r13), %ecx
imull %eax, %r12d
imull %ecx, %r12d
movslq %r12d, %rdi
callq 0x14b30
movq %rax, %r13
testq %rax, %rax
je 0xf16be
testl %r12d, %r12d
jle 0xf16b4
movl %r12d, %eax
xorl %ecx, %ecx
movb 0x1(%rbp,%rcx,2), %dl
movb %dl, (%r13,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0xf16a3
movq %rbp, %rdi
callq 0x149b0
jmp 0xf16d8
movq %fs:0x0, %rax
leaq 0x326d7(%rip), %rcx # 0x123da8
movq %rcx, -0x20(%rax)
movl $0x8, 0x1c(%rsp)
movq %fs:0x0, %rax
cmpl $0x0, -0x14(%rax)
leaq -0x18(%rax), %rax
leaq 0x7b467(%rip), %rcx # 0x16cb68
cmovneq %rax, %rcx
cmpl $0x0, (%rcx)
je 0xf1725
testl %ebx, %ebx
jne 0xf1715
movq 0x10(%rsp), %rax
movl (%rax), %ebx
movl (%r15), %esi
movl (%r14), %edx
movq %r13, %rdi
movl %ebx, %ecx
callq 0xf97bd
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_load_from_file_16 | STBIDEF stbi__uint16 *stbi_load_from_file_16(FILE *f, int *x, int *y, int *comp, int req_comp)
{
stbi__uint16 *result;
stbi__context s;
stbi__start_file(&s,f);
result = stbi__load_and_postprocess_16bit(&s,x,y,comp,req_comp);
if (result) {
// need to 'unget' all the characters in the IO buffer
fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR);
}
return result;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movq 0x79c32(%rip), %rax # 0x16b390
leaq 0x40(%rsp), %rcx
movq %rax, -0x18(%rcx)
movups 0x79c12(%rip), %xmm0 # 0x16b380
movups %xmm0, -0x28(%rcx)
movq %rdi, -0x10(%rcx)
movabsq $0x8000000001, %rax # imm = 0x8000000001
movq %rax, -0x8(%rcx)
movl $0x0, 0x80(%rcx)
movq %rcx, 0x98(%rcx)
movq %rcx, 0x88(%rcx)
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0xfd694
movq 0xc8(%r13), %rax
movq %rax, 0xd8(%r13)
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movl %ebp, %r8d
callq 0xf1806
movq %rax, %r14
testq %rax, %rax
je 0xf17f1
movl 0xc8(%rsp), %eax
subl 0xd0(%rsp), %eax
movslq %eax, %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x148c0
movq %r14, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi__load_and_postprocess_16bit(stbi__context*, int*, int*, int*, int) | static stbi__uint16 *stbi__load_and_postprocess_16bit(stbi__context *s, int *x, int *y, int *comp, int req_comp)
{
stbi__result_info ri;
void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 16);
if (result == NULL)
return NULL;
// it is the responsibility of the loaders to make sure we get either 8 or 16 bit.
STBI_ASSERT(ri.bits_per_channel == 8 || ri.bits_per_channel == 16);
if (ri.bits_per_channel != 16) {
result = stbi__convert_8_to_16((stbi_uc *) result, *x, *y, req_comp == 0 ? *comp : req_comp);
ri.bits_per_channel = 16;
}
// @TODO: move stbi__convert_format16 to here
// @TODO: special case RGB-to-Y (and RGBA-to-YA) for 8-bit-to-16-bit case to keep more precision
if (stbi__vertically_flip_on_load) {
int channels = req_comp ? req_comp : *comp;
stbi__vertical_flip(result, *x, *y, channels * sizeof(stbi__uint16));
}
return (stbi__uint16 *) result;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, %ebx
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r15
movl $0x10, (%rsp)
leaq 0x1c(%rsp), %r9
callq 0xf6b49
testq %rax, %rax
je 0xf184d
movq %rax, %rbp
cmpl $0x10, 0x1c(%rsp)
movq %r13, 0x10(%rsp)
jne 0xf1855
movq %rbp, %r13
jmp 0xf18d1
xorl %r13d, %r13d
jmp 0xf1918
movl (%r15), %eax
movl (%r14), %r12d
movl %ebx, %ecx
testl %ebx, %ebx
jne 0xf1865
movl (%r13), %ecx
imull %eax, %r12d
imull %ecx, %r12d
leal (%r12,%r12), %eax
movslq %eax, %rdi
callq 0x14b30
movq %rax, %r13
testq %rax, %rax
je 0xf18af
testl %r12d, %r12d
jle 0xf18a5
movl %r12d, %eax
xorl %ecx, %ecx
movzbl (%rbp,%rcx), %edx
movl %edx, %esi
shll $0x8, %esi
orl %edx, %esi
movw %si, (%r13,%rcx,2)
incq %rcx
cmpq %rcx, %rax
jne 0xf188b
movq %rbp, %rdi
callq 0x149b0
jmp 0xf18c9
movq %fs:0x0, %rax
leaq 0x324e6(%rip), %rcx # 0x123da8
movq %rcx, -0x20(%rax)
movl $0x10, 0x1c(%rsp)
movq %fs:0x0, %rax
cmpl $0x0, -0x14(%rax)
leaq -0x18(%rax), %rax
leaq 0x7b276(%rip), %rcx # 0x16cb68
cmovneq %rax, %rcx
cmpl $0x0, (%rcx)
je 0xf1918
testl %ebx, %ebx
jne 0xf1906
movq 0x10(%rsp), %rax
movl (%rax), %ebx
movl (%r15), %esi
movl (%r14), %edx
addl %ebx, %ebx
movq %r13, %rdi
movl %ebx, %ecx
callq 0xf97bd
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_load_16_from_memory | STBIDEF stbi_us *stbi_load_16_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *channels_in_file, int desired_channels)
{
stbi__context s;
stbi__start_mem(&s,buffer,len);
return stbi__load_and_postprocess_16bit(&s,x,y,channels_in_file,desired_channels);
} | subq $0xe8, %rsp
leaq 0x8(%rsp), %rax
movq $0x0, 0x10(%rax)
xorl %r10d, %r10d
movl %r10d, 0x30(%rax)
movl %r10d, 0xb8(%rax)
movq %rdi, 0xd0(%rax)
movq %rdi, 0xc0(%rax)
movslq %esi, %rsi
addq %rdi, %rsi
movq %rsi, 0xd8(%rax)
movq %rsi, 0xc8(%rax)
movq %rax, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
movl %r9d, %r8d
callq 0xf1806
addq $0xe8, %rsp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_load_16_from_callbacks | STBIDEF stbi_us *stbi_load_16_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *channels_in_file, int desired_channels)
{
stbi__context s;
stbi__start_callbacks(&s, (stbi_io_callbacks *)clbk, user);
return stbi__load_and_postprocess_16bit(&s,x,y,channels_in_file,desired_channels);
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movl %r9d, %ebx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq 0x10(%rdi), %rax
leaq 0x38(%rsp), %rcx
movq %rax, -0x18(%rcx)
movups (%rdi), %xmm0
movups %xmm0, -0x28(%rcx)
movq %rsi, -0x10(%rcx)
movabsq $0x8000000001, %rax # imm = 0x8000000001
movq %rax, -0x8(%rcx)
movl $0x0, 0x80(%rcx)
movq %rcx, 0x98(%rcx)
movq %rcx, 0x88(%rcx)
movq %rsp, %r13
movq %r13, %rdi
callq 0xfd694
movq 0xc8(%r13), %rax
movq %rax, 0xd8(%r13)
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movl %ebx, %r8d
callq 0xf1806
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_load_from_memory | STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
{
stbi__context s;
stbi__start_mem(&s,buffer,len);
return stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp);
} | subq $0xe8, %rsp
leaq 0x8(%rsp), %rax
movq $0x0, 0x10(%rax)
xorl %r10d, %r10d
movl %r10d, 0x30(%rax)
movl %r10d, 0xb8(%rax)
movq %rdi, 0xd0(%rax)
movq %rdi, 0xc0(%rax)
movslq %esi, %rsi
addq %rdi, %rsi
movq %rsi, 0xd8(%rax)
movq %rsi, 0xc8(%rax)
movq %rax, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
movl %r9d, %r8d
callq 0xf1625
addq $0xe8, %rsp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_load_from_callbacks | STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
{
stbi__context s;
stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
return stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp);
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movl %r9d, %ebx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq 0x10(%rdi), %rax
leaq 0x38(%rsp), %rcx
movq %rax, -0x18(%rcx)
movups (%rdi), %xmm0
movups %xmm0, -0x28(%rcx)
movq %rsi, -0x10(%rcx)
movabsq $0x8000000001, %rax # imm = 0x8000000001
movq %rax, -0x8(%rcx)
movl $0x0, 0x80(%rcx)
movq %rcx, 0x98(%rcx)
movq %rcx, 0x88(%rcx)
movq %rsp, %r13
movq %r13, %rdi
callq 0xfd694
movq 0xc8(%r13), %rax
movq %rax, 0xd8(%r13)
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movl %ebx, %r8d
callq 0xf1625
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_load_gif_from_memory | STBIDEF stbi_uc *stbi_load_gif_from_memory(stbi_uc const *buffer, int len, int **delays, int *x, int *y, int *z, int *comp, int req_comp)
{
unsigned char *result;
stbi__context s;
stbi__start_mem(&s,buffer,len);
result = (unsigned char*) stbi__load_gif_main(&s, delays, x, y, z, comp, req_comp);
if (stbi__vertically_flip_on_load) {
stbi__vertical_flip_slices( result, *x, *y, *z, *comp );
}
return result;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8988, %rsp # imm = 0x8988
movq %r9, %r15
movq %r8, 0x20(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, %rbx
leaq 0x38(%rsp), %rcx
movq $0x0, 0x10(%rcx)
xorl %eax, %eax
movl %eax, 0x30(%rcx)
movl %eax, 0xb8(%rcx)
movq %rdi, 0xd0(%rcx)
movq %rdi, 0xc0(%rcx)
movslq %esi, %rax
addq %rdi, %rax
movq %rax, 0xd8(%rcx)
movq %rax, 0xc8(%rcx)
movq %rcx, %rdi
callq 0xf98af
testl %eax, %eax
je 0xf1e0b
leaq 0x118(%rsp), %rdi
xorl %ebp, %ebp
movl $0x8870, %edx # imm = 0x8870
xorl %esi, %esi
callq 0x14470
testq %rbx, %rbx
je 0xf1c1a
movq $0x0, (%rbx)
movq %rbx, 0x18(%rsp)
leaq 0x118(%rsp), %rsi
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
movq 0x89c0(%rsp), %rdx
xorl %ecx, %ecx
callq 0x1003ba
movq %rax, %r14
cmpq %rbx, %rax
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
movl $0x0, %r13d
jne 0xf1da3
movq %r15, 0x10(%rsp)
movl $0x4, %eax
movq %rax, 0x28(%rsp)
xorl %ebp, %ebp
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x20(%rsp), %r15
movq %r12, 0x8(%rsp)
movl 0x118(%rsp), %eax
movq 0x30(%rsp), %rcx
movl %eax, (%rcx)
movl 0x11c(%rsp), %ebx
movl %ebx, (%r15)
imull %eax, %ebx
leal (,%rbx,4), %r12d
leal 0x1(%rbp), %eax
imull %r12d, %eax
movslq %eax, %rsi
testq %r13, %r13
je 0xf1cea
movq %r13, %rdi
movq %r13, %r15
callq 0x14ec0
testq %rax, %rax
je 0xf1e30
movq %rax, %r13
movq 0x18(%rsp), %r15
testq %r15, %r15
je 0xf1d1e
movq (%r15), %rdi
movq 0x28(%rsp), %rsi
callq 0x14ec0
testq %rax, %rax
je 0xf1e42
movq %rax, (%r15)
jmp 0xf1d1e
movq %rsi, %rdi
callq 0x14b30
testq %rax, %rax
je 0xf1e60
movq %rax, %r13
movq 0x18(%rsp), %r15
testq %r15, %r15
je 0xf1d1e
movq 0x28(%rsp), %rdi
callq 0x14b30
movq %rax, (%r15)
testq %rax, %rax
je 0xf1e42
movslq %r12d, %rdx
movl %ebp, %ecx
imull %r12d, %ecx
movslq %ecx, %rdi
addq %r13, %rdi
movq %r14, %rsi
callq 0x14690
shll $0x3, %ebx
movslq %ebx, %rax
movq %r13, %rcx
subq %rax, %rcx
testq %rbp, %rbp
movq 0x8(%rsp), %r12
cmovneq %rcx, %r12
testq %r15, %r15
je 0xf1d5f
movl 0x8980(%rsp), %eax
movq (%r15), %rcx
movl %eax, (%rcx,%rbp,4)
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
leaq 0x118(%rsp), %rsi
movq 0x89c0(%rsp), %rdx
movq %r12, %rcx
callq 0x1003ba
incq %rbp
cmpq %rbx, %rax
movq 0x20(%rsp), %r15
je 0xf1d9e
movq %rax, %r14
addq $0x4, 0x28(%rsp)
testq %rax, %rax
jne 0xf1c77
movq 0x10(%rsp), %r15
movq %r13, 0x8(%rsp)
movl 0x89c8(%rsp), %ebx
movq 0x120(%rsp), %rdi
callq 0x149b0
movq 0x130(%rsp), %rdi
callq 0x149b0
movq 0x128(%rsp), %rdi
callq 0x149b0
testl $0xfffffffb, %ebx # imm = 0xFFFFFFFB
je 0xf1e06
movl 0x118(%rsp), %ecx
imull %ebp, %ecx
movl 0x11c(%rsp), %r8d
movq 0x8(%rsp), %rdi
movl $0x4, %esi
movl %ebx, %edx
callq 0xfe55c
movq %rax, 0x8(%rsp)
movl %ebp, (%r15)
jmp 0xf1e82
movq %fs:0x0, %rax
leaq 0x3206c(%rip), %rcx # 0x123e8a
movq %rcx, -0x20(%rax)
movq $0x0, 0x8(%rsp)
jmp 0xf1e82
leaq 0x118(%rsp), %rdi
movq %r15, %rsi
movq 0x18(%rsp), %rdx
jmp 0xf1e50
leaq 0x118(%rsp), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x104933
movq $0x0, 0x8(%rsp)
jmp 0xf1e7d
movq $0x0, 0x8(%rsp)
leaq 0x118(%rsp), %rdi
xorl %esi, %esi
movq 0x18(%rsp), %rdx
callq 0x104933
movq 0x10(%rsp), %r15
movq %fs:0x0, %rax
cmpl $0x0, -0x14(%rax)
leaq -0x18(%rax), %rax
leaq 0x7acc5(%rip), %rcx # 0x16cb68
cmovneq %rax, %rcx
cmpl $0x0, (%rcx)
je 0xf1ef5
movl (%r15), %r12d
testl %r12d, %r12d
jle 0xf1ef5
movq 0x30(%rsp), %rax
movl (%rax), %ebx
movq 0x20(%rsp), %rax
movl (%rax), %ebp
movq 0x89c0(%rsp), %rax
movl (%rax), %r14d
movl %ebp, %eax
imull %ebx, %eax
imull %r14d, %eax
movslq %eax, %r13
movq 0x8(%rsp), %r15
movq %r15, %rdi
movl %ebx, %esi
movl %ebp, %edx
movl %r14d, %ecx
callq 0xf97bd
addq %r13, %r15
decl %r12d
jne 0xf1ede
movq 0x8(%rsp), %rax
addq $0x8988, %rsp # imm = 0x8988
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi__loadf_main(stbi__context*, int*, int*, int*, int) | static float *stbi__loadf_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)
{
unsigned char *data;
#ifndef STBI_NO_HDR
if (stbi__hdr_test(s)) {
stbi__result_info ri;
float *hdr_data = stbi__hdr_load(s,x,y,comp,req_comp, &ri);
if (hdr_data)
stbi__float_postprocess(hdr_data,x,y,comp,req_comp);
return hdr_data;
}
#endif
data = stbi__load_and_postprocess_8bit(s, x, y, comp, req_comp);
if (data)
return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp);
return stbi__errpf("unknown image type", "Image not of any known type, or corrupt");
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, %ebx
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r14
callq 0xf236e
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movl %ebx, %r8d
testl %eax, %eax
je 0xf2001
callq 0xfc326
testq %rax, %rax
je 0xf215e
movq %rax, %r15
movq %fs:0x0, %rax
cmpl $0x0, -0x14(%rax)
leaq -0x18(%rax), %rax
leaq 0x7ab95(%rip), %rcx # 0x16cb68
cmovneq %rax, %rcx
cmpl $0x0, (%rcx)
je 0xf2161
testl %ebx, %ebx
jne 0xf1fe8
movl (%r12), %ebx
movl (%rbp), %esi
movl (%r13), %edx
shll $0x2, %ebx
movq %r15, %rdi
movl %ebx, %ecx
callq 0xf97bd
jmp 0xf2161
callq 0xf1625
testq %rax, %rax
je 0xf2127
movq %rax, %r14
movl (%rbp), %eax
movl (%r13), %ebp
testl %ebx, %ebx
jne 0xf2021
movl (%r12), %ebx
movl %eax, %r12d
movl %eax, %edi
movl %ebp, %esi
movl %ebx, %edx
movl $0x4, %ecx
callq 0x103e9b
testq %rax, %rax
je 0xf213c
movq %rax, %r15
movl %ebx, %eax
andl $0x1, %eax
cmpl $0x1, %eax
movl %ebx, %eax
sbbl $0x0, %eax
imull %r12d, %ebp
testl %ebp, %ebp
jle 0xf211d
movl %ebx, (%rsp)
movslq %ebx, %rdx
movl %ebp, %r13d
movl %eax, %ebp
leaq (,%rdx,4), %rcx
movq %rcx, 0x18(%rsp)
movq %r14, %rbx
xorl %r14d, %r14d
movss 0x2f8b9(%rip), %xmm1 # 0x121938
movq %rbx, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %rdx, 0x20(%rsp)
movl %eax, 0x4(%rsp)
testl %eax, %eax
jle 0xf20d4
xorl %r12d, %r12d
movzbl (%rbx,%r12), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss %xmm1, %xmm0
movss 0x7a73f(%rip), %xmm1 # 0x16c7f0
callq 0x14de0
movss 0x2f87a(%rip), %xmm1 # 0x121938
mulss 0x7a72e(%rip), %xmm0 # 0x16c7f4
movss %xmm0, (%r15,%r12,4)
incq %r12
cmpq %r12, %rbp
jne 0xf2099
incq %r14
addq 0x18(%rsp), %r15
movq 0x20(%rsp), %rdx
addq %rdx, %rbx
cmpq %r13, %r14
movl 0x4(%rsp), %eax
jne 0xf2092
testb $0x1, (%rsp)
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r14
jne 0xf211d
cltq
movzbl (%r14,%rax), %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
divss %xmm1, %xmm0
movss %xmm0, (%r15,%rax,4)
addq %rdx, %rax
decq %r13
jne 0xf20ff
movq %r14, %rdi
callq 0x149b0
jmp 0xf2161
movq %fs:0x0, %rax
leaq 0x31b43(%rip), %rcx # 0x123c7d
jmp 0xf2157
movq %r14, %rdi
callq 0x149b0
movq %fs:0x0, %rax
leaq 0x31c51(%rip), %rcx # 0x123da8
movq %rcx, -0x20(%rax)
xorl %r15d, %r15d
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_loadf_from_callbacks | STBIDEF float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
{
stbi__context s;
stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
return stbi__loadf_main(&s,x,y,comp,req_comp);
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movl %r9d, %ebx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq 0x10(%rdi), %rax
leaq 0x38(%rsp), %rcx
movq %rax, -0x18(%rcx)
movups (%rdi), %xmm0
movups %xmm0, -0x28(%rcx)
movq %rsi, -0x10(%rcx)
movabsq $0x8000000001, %rax # imm = 0x8000000001
movq %rax, -0x8(%rcx)
movl $0x0, 0x80(%rcx)
movq %rcx, 0x98(%rcx)
movq %rcx, 0x88(%rcx)
movq %rsp, %r13
movq %r13, %rdi
callq 0xfd694
movq 0xc8(%r13), %rax
movq %rax, 0xd8(%r13)
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movl %ebx, %r8d
callq 0xf1f6c
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_loadf | STBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp)
{
float *result;
FILE *f = stbi__fopen(filename, "rb");
if (!f) return stbi__errpf("can't fopen", "Unable to open file");
result = stbi_loadf_from_file(f,x,y,comp,req_comp);
fclose(f);
return result;
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
leaq 0x2e772(%rip), %rsi # 0x120999
callq 0x14980
testq %rax, %rax
je 0xf2258
movq %rax, %r13
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movl %ebx, %r8d
callq 0xf227e
movq %rax, %rbx
movq %r13, %rdi
callq 0x147c0
movq %rbx, %rax
jmp 0xf2274
movq %fs:0x0, %rax
leaq 0x319dd(%rip), %rcx # 0x123c48
movq %rcx, -0x20(%rax)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_loadf_from_file | STBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
{
stbi__context s;
stbi__start_file(&s,f);
return stbi__loadf_main(&s,x,y,comp,req_comp);
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq 0x790ef(%rip), %rax # 0x16b390
leaq 0x38(%rsp), %rcx
movq %rax, -0x18(%rcx)
movups 0x790cf(%rip), %xmm0 # 0x16b380
movups %xmm0, -0x28(%rcx)
movq %rdi, -0x10(%rcx)
movabsq $0x8000000001, %rax # imm = 0x8000000001
movq %rax, -0x8(%rcx)
movl $0x0, 0x80(%rcx)
movq %rcx, 0x98(%rcx)
movq %rcx, 0x88(%rcx)
movq %rsp, %r13
movq %r13, %rdi
callq 0xfd694
movq 0xc8(%r13), %rax
movq %rax, 0xd8(%r13)
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movl %ebx, %r8d
callq 0xf1f6c
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_is_hdr_from_memory | STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len)
{
#ifndef STBI_NO_HDR
stbi__context s;
stbi__start_mem(&s,buffer,len);
return stbi__hdr_test(&s);
#else
STBI_NOTUSED(buffer);
STBI_NOTUSED(len);
return 0;
#endif
} | subq $0xe8, %rsp
leaq 0x8(%rsp), %rax
movq $0x0, 0x10(%rax)
xorl %ecx, %ecx
movl %ecx, 0x30(%rax)
movl %ecx, 0xb8(%rax)
movq %rdi, 0xd0(%rax)
movq %rdi, 0xc0(%rax)
movslq %esi, %rcx
addq %rdi, %rcx
movq %rcx, 0xd8(%rax)
movq %rcx, 0xc8(%rax)
movq %rax, %rdi
callq 0xf236e
addq $0xe8, %rsp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_is_16_bit_from_file | STBIDEF int stbi_is_16_bit_from_file(FILE *f)
{
int r;
stbi__context s;
long pos = ftell(f);
stbi__start_file(&s, f);
r = stbi__is_16_main(&s);
fseek(f,pos,SEEK_SET);
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
callq 0x14030
movq %rax, %r14
movups 0x77da8(%rip), %xmm0 # 0x16b380
leaq 0x40(%rsp), %rax
movups %xmm0, -0x28(%rax)
movq 0x77da8(%rip), %rcx # 0x16b390
movq %rcx, -0x18(%rax)
movq %rbx, -0x10(%rax)
movabsq $0x8000000001, %rcx # imm = 0x8000000001
movq %rcx, -0x8(%rax)
movl $0x0, 0x80(%rax)
movq %rax, 0x98(%rax)
movq %rax, 0x88(%rax)
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xfd694
movq 0xc8(%r15), %rax
movq %rax, 0xd8(%r15)
movq %r15, %rdi
callq 0xf3658
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x148c0
movl %ebp, %eax
addq $0xe8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi__is_16_main(stbi__context*) | static int stbi__is_16_main(stbi__context *s)
{
#ifndef STBI_NO_PNG
if (stbi__png_is16(s)) return 1;
#endif
#ifndef STBI_NO_PSD
if (stbi__psd_is16(s)) return 1;
#endif
#ifndef STBI_NO_PNM
if (stbi__pnm_is16(s)) return 1;
#endif
return 0;
} | pushq %rbp
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq %rsp, %rdi
movq %rbx, (%rdi)
movl $0x2, %esi
xorl %edx, %edx
callq 0xfd6ee
testl %eax, %eax
je 0xf3688
cmpl $0x10, 0x20(%rsp)
jne 0xf3688
movl $0x1, %eax
jmp 0xf3753
movq (%rsp), %rax
movups 0xd0(%rax), %xmm0
movups %xmm0, 0xc0(%rax)
movq %rbx, %rdi
callq 0xfee3e
movl %eax, %ebp
shll $0x10, %ebp
movq %rbx, %rdi
callq 0xfee3e
orl %ebp, %eax
cmpl $0x38425053, %eax # imm = 0x38425053
jne 0xf372d
movq %rbx, %rdi
callq 0xfee3e
cmpl $0x1, %eax
jne 0xf372d
cmpq $0x0, 0x10(%rbx)
je 0xf36fa
movq 0xc0(%rbx), %rax
movq 0xc8(%rbx), %rdx
movl %edx, %ecx
subl %eax, %ecx
cmpl $0x5, %ecx
jg 0xf3701
movq %rdx, 0xc0(%rbx)
movq 0x28(%rbx), %rdi
movl $0x6, %esi
subl %ecx, %esi
callq *0x18(%rbx)
jmp 0xf370c
movq 0xc0(%rbx), %rax
addq $0x6, %rax
movq %rax, 0xc0(%rbx)
movq %rbx, %rdi
callq 0xfee3e
cmpl $0x10, %eax
ja 0xf372d
movq %rbx, %rdi
callq 0xfee3e
movl %eax, %ecx
movl $0x1, %eax
cmpl $0x10, %ecx
je 0xf3753
movups 0xd0(%rbx), %xmm0
movups %xmm0, 0xc0(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x103c6e
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x10, %ecx
sete %al
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_info_from_memory | STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp)
{
stbi__context s;
stbi__start_mem(&s,buffer,len);
return stbi__info_main(&s,x,y,comp);
} | subq $0xe8, %rsp
leaq 0x8(%rsp), %rax
movq $0x0, 0x10(%rax)
xorl %r9d, %r9d
movl %r9d, 0x30(%rax)
movl %r9d, 0xb8(%rax)
movq %rdi, 0xd0(%rax)
movq %rdi, 0xc0(%rax)
movslq %esi, %rsi
addq %rdi, %rsi
movq %rsi, 0xd8(%rax)
movq %rsi, 0xc8(%rax)
movq %rax, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %rcx
callq 0xf32e6
addq $0xe8, %rsp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_info_from_callbacks | STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp)
{
stbi__context s;
stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user);
return stbi__info_main(&s,x,y,comp);
} | pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq 0x10(%rdi), %rax
leaq 0x40(%rsp), %rcx
movq %rax, -0x18(%rcx)
movups (%rdi), %xmm0
movups %xmm0, -0x28(%rcx)
movq %rsi, -0x10(%rcx)
movabsq $0x8000000001, %rax # imm = 0x8000000001
movq %rax, -0x8(%rcx)
movl $0x0, 0x80(%rcx)
movq %rcx, 0x98(%rcx)
movq %rcx, 0x88(%rcx)
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0xfd694
movq 0xc8(%r12), %rax
movq %rax, 0xd8(%r12)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xf32e6
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_is_16_bit_from_memory | STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len)
{
stbi__context s;
stbi__start_mem(&s,buffer,len);
return stbi__is_16_main(&s);
} | subq $0xe8, %rsp
leaq 0x8(%rsp), %rax
movq $0x0, 0x10(%rax)
xorl %ecx, %ecx
movl %ecx, 0x30(%rax)
movl %ecx, 0xb8(%rax)
movq %rdi, 0xd0(%rax)
movq %rdi, 0xc0(%rax)
movslq %esi, %rcx
addq %rdi, %rcx
movq %rcx, 0xd8(%rax)
movq %rcx, 0xc8(%rax)
movq %rax, %rdi
callq 0xf3658
addq $0xe8, %rsp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi_write_bmp_core(stbi__write_context*, int, int, int, void const*) | static int stbi_write_bmp_core(stbi__write_context *s, int x, int y, int comp, const void *data)
{
if (comp != 4) {
// write RGB bitmap
int pad = (-x*3) & 3;
return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *) data,0,pad,
"11 4 22 4" "4 44 22 444444",
'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header
40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header
} else {
// RGBA bitmaps need a v4 header
// use BI_BITFIELDS mode with 32bpp and alpha mask
// (straight BI_RGB with alpha mask doesn't work in most readers)
return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *)data,1,0,
"11 4 22 4" "4 44 22 444444 4444 4 444 444 444 444",
'B', 'M', 14+108+x*y*4, 0, 0, 14+108, // file header
108, x,y, 1,32, 3,0,0,0,0,0, 0xff0000,0xff00,0xff,0xff000000u, 0, 0,0,0, 0,0,0, 0,0,0, 0,0,0); // bitmap V4 header
}
} | pushq %r15
pushq %r14
pushq %rbx
movq %r8, %r10
movl %ecx, %r9d
movl %esi, %ecx
cmpl $0x4, %r9d
jne 0xf39f5
movl %ecx, %eax
imull %edx, %eax
leal 0x7a(,%rax,4), %r14d
subq $0x8, %rsp
xorl %r11d, %r11d
movl $0x1, %esi
leaq 0x30871(%rip), %rbx # 0x1241f9
movl %edx, %r8d
movl $0x4, %r9d
xorl %eax, %eax
pushq %r11
pushq %r11
pushq %r11
pushq %r11
pushq %r11
pushq %r11
pushq %r11
pushq %r11
pushq %r11
pushq %r11
pushq %r11
pushq %r11
pushq %r11
pushq $-0x1000000 # imm = 0xFF000000
pushq $0xff
pushq $0xff00 # imm = 0xFF00
pushq $0xff0000 # imm = 0xFF0000
pushq %r11
pushq %r11
pushq %r11
pushq %r11
pushq %r11
pushq $0x3
pushq $0x20
pushq %rsi
pushq %rdx
pushq %rcx
pushq $0x6c
pushq $0x7a
pushq %r11
pushq %r11
pushq %r14
pushq $0x4d
pushq $0x42
pushq %rbx
pushq %r11
pushq %rsi
pushq %r10
pushq %rsi
callq 0x105373
addq $0x140, %rsp # imm = 0x140
jmp 0xf3a49
movl %ecx, %esi
andl $0x3, %esi
leal (%rcx,%rcx,2), %r14d
addl %esi, %r14d
imull %edx, %r14d
addl $0x36, %r14d
xorl %ebx, %ebx
movl $0x1, %r11d
leaq 0x307c9(%rip), %r15 # 0x1241e1
movl %edx, %r8d
xorl %eax, %eax
pushq %rbx
pushq %rbx
pushq %rbx
pushq %rbx
pushq %rbx
pushq %rbx
pushq $0x18
pushq %r11
pushq %rdx
pushq %rcx
pushq $0x28
pushq $0x36
pushq %rbx
pushq %rbx
pushq %r14
pushq $0x4d
pushq $0x42
pushq %r15
pushq %rsi
pushq %rbx
pushq %r10
pushq %r11
callq 0x105373
addq $0xb0, %rsp
popq %rbx
popq %r14
popq %r15
retq
| /embree[P]embree/tutorials/common/image/stb_image_write.h |
stbi_write_bmp | STBIWDEF int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *data)
{
stbi__write_context s = { 0 };
if (stbi__start_write_file(&s,filename)) {
int r = stbi_write_bmp_core(&s, x, y, comp, data);
stbi__end_write_file(&s);
return r;
} else
return 0;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r15d
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rsp)
movups %xmm0, 0x38(%rsp)
movups %xmm0, 0x28(%rsp)
movups %xmm0, 0x18(%rsp)
movq $0x0, 0x58(%rsp)
leaq 0x301c7(%rip), %rsi # 0x123c54
callq 0x14980
leaq 0x11d3e(%rip), %rcx # 0x1057d7
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0xf3ace
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
movl %ebp, %ecx
movq %rbx, %r8
callq 0xf3951
movl %eax, %ebx
movq 0x8(%r12), %rdi
callq 0x147c0
jmp 0xf3ad0
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image_write.h |
stbi_write_tga | STBIWDEF int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data)
{
stbi__write_context s = { 0 };
if (stbi__start_write_file(&s,filename)) {
int r = stbi_write_tga_core(&s, x, y, comp, (void *) data);
stbi__end_write_file(&s);
return r;
} else
return 0;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r15d
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rsp)
movups %xmm0, 0x38(%rsp)
movups %xmm0, 0x28(%rsp)
movups %xmm0, 0x18(%rsp)
movq $0x0, 0x58(%rsp)
leaq 0x2fcf6(%rip), %rsi # 0x123c54
callq 0x14980
leaq 0x1186d(%rip), %rcx # 0x1057d7
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0xf3f9f
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
movl %ebp, %ecx
movq %rbx, %r8
callq 0xf3b1f
movl %eax, %ebx
movq 0x8(%r12), %rdi
callq 0x147c0
jmp 0xf3fa1
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image_write.h |
stbi_zlib_compress | STBIWDEF unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality)
{
#ifdef STBIW_ZLIB_COMPRESS
// user provided a zlib compress implementation, use that
return STBIW_ZLIB_COMPRESS(data, data_len, out_len, quality);
#else // use builtin
static unsigned short lengthc[] = { 3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258, 259 };
static unsigned char lengtheb[]= { 0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 };
static unsigned short distc[] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 32768 };
static unsigned char disteb[] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13 };
unsigned int bitbuf=0;
int i,j, bitcount=0;
unsigned char *out = NULL;
unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(unsigned char**));
if (hash_table == NULL)
return NULL;
if (quality < 5) quality = 5;
stbiw__sbpush(out, 0x78); // DEFLATE 32K window
stbiw__sbpush(out, 0x5e); // FLEVEL = 1
stbiw__zlib_add(1,1); // BFINAL = 1
stbiw__zlib_add(1,2); // BTYPE = 1 -- fixed huffman
for (i=0; i < stbiw__ZHASH; ++i)
hash_table[i] = NULL;
i=0;
while (i < data_len-3) {
// hash next 3 bytes of data to be compressed
int h = stbiw__zhash(data+i)&(stbiw__ZHASH-1), best=3;
unsigned char *bestloc = 0;
unsigned char **hlist = hash_table[h];
int n = stbiw__sbcount(hlist);
for (j=0; j < n; ++j) {
if (hlist[j]-data > i-32768) { // if entry lies within window
int d = stbiw__zlib_countm(hlist[j], data+i, data_len-i);
if (d >= best) { best=d; bestloc=hlist[j]; }
}
}
// when hash table entry is too long, delete half the entries
if (hash_table[h] && stbiw__sbn(hash_table[h]) == 2*quality) {
STBIW_MEMMOVE(hash_table[h], hash_table[h]+quality, sizeof(hash_table[h][0])*quality);
stbiw__sbn(hash_table[h]) = quality;
}
stbiw__sbpush(hash_table[h],data+i);
if (bestloc) {
// "lazy matching" - check match at *next* byte, and if it's better, do cur byte as literal
h = stbiw__zhash(data+i+1)&(stbiw__ZHASH-1);
hlist = hash_table[h];
n = stbiw__sbcount(hlist);
for (j=0; j < n; ++j) {
if (hlist[j]-data > i-32767) {
int e = stbiw__zlib_countm(hlist[j], data+i+1, data_len-i-1);
if (e > best) { // if next match is better, bail on current match
bestloc = NULL;
break;
}
}
}
}
if (bestloc) {
int d = (int) (data+i - bestloc); // distance back
STBIW_ASSERT(d <= 32767 && best <= 258);
for (j=0; best > lengthc[j+1]-1; ++j);
stbiw__zlib_huff(j+257);
if (lengtheb[j]) stbiw__zlib_add(best - lengthc[j], lengtheb[j]);
for (j=0; d > distc[j+1]-1; ++j);
stbiw__zlib_add(stbiw__zlib_bitrev(j,5),5);
if (disteb[j]) stbiw__zlib_add(d - distc[j], disteb[j]);
i += best;
} else {
stbiw__zlib_huffb(data[i]);
++i;
}
}
// write out final bytes
for (;i < data_len; ++i)
stbiw__zlib_huffb(data[i]);
stbiw__zlib_huff(256); // end of block
// pad with 0 bits to byte boundary
while (bitcount)
stbiw__zlib_add(0,1);
for (i=0; i < stbiw__ZHASH; ++i)
(void) stbiw__sbfree(hash_table[i]);
STBIW_FREE(hash_table);
// store uncompressed instead if compression was worse
if (stbiw__sbn(out) > data_len + 2 + ((data_len+32766)/32767)*5) {
stbiw__sbn(out) = 2; // truncate to DEFLATE 32K window and FLEVEL = 1
for (j = 0; j < data_len;) {
int blocklen = data_len - j;
if (blocklen > 32767) blocklen = 32767;
stbiw__sbpush(out, data_len - j == blocklen); // BFINAL = ?, BTYPE = 0 -- no compression
stbiw__sbpush(out, STBIW_UCHAR(blocklen)); // LEN
stbiw__sbpush(out, STBIW_UCHAR(blocklen >> 8));
stbiw__sbpush(out, STBIW_UCHAR(~blocklen)); // NLEN
stbiw__sbpush(out, STBIW_UCHAR(~blocklen >> 8));
memcpy(out+stbiw__sbn(out), data+j, blocklen);
stbiw__sbn(out) += blocklen;
j += blocklen;
}
}
{
// compute adler32 on input
unsigned int s1=1, s2=0;
int blocklen = (int) (data_len % 5552);
j=0;
while (j < data_len) {
for (i=0; i < blocklen; ++i) { s1 += data[j+i]; s2 += s1; }
s1 %= 65521; s2 %= 65521;
j += blocklen;
blocklen = 5552;
}
stbiw__sbpush(out, STBIW_UCHAR(s2 >> 8));
stbiw__sbpush(out, STBIW_UCHAR(s2));
stbiw__sbpush(out, STBIW_UCHAR(s1 >> 8));
stbiw__sbpush(out, STBIW_UCHAR(s1));
}
*out_len = stbiw__sbn(out);
// make returned pointer freeable
STBIW_MEMMOVE(stbiw__sbraw(out), out, *out_len);
return (unsigned char *) stbiw__sbraw(out);
#endif // STBIW_ZLIB_COMPRESS
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, 0x10(%rsp)
movq %rdi, %r15
movq $0x0, 0x8(%rsp)
movl $0x20000, %edi # imm = 0x20000
callq 0x14b30
movq %rax, 0x18(%rsp)
testq %rax, %rax
je 0xf4bb0
movq %r14, 0x28(%rsp)
cmpl $0x6, %ebx
movl $0x5, %eax
cmovgel %ebx, %eax
movq %rax, 0x30(%rsp)
leaq 0x8(%rsp), %rbx
movl $0x1, %ebp
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf4efe
movq (%rbx), %rdi
movslq -0x4(%rdi), %rax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rdi)
movb $0x78, (%rdi,%rax)
movl -0x4(%rdi), %eax
leal 0x1(%rax), %ecx
cmpl -0x8(%rdi), %ecx
jl 0xf464e
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl $0x1, %esi
callq 0xf4efe
movq (%rbx), %rdi
movl -0x4(%rdi), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rdi)
cltq
movb $0x5e, (%rdi,%rax)
leaq 0x4(%rsp), %rbx
movl %ebp, (%rbx)
movq %rsp, %r13
movl %ebp, (%r13)
movq %rbx, %rsi
movq %r13, %rdx
callq 0xf4f5c
movl (%r13), %ecx
shll %cl, %ebp
orl %ebp, (%rbx)
addl $0x2, %ecx
movl %ecx, (%r13)
movq %rax, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0xf4f5c
movq %rax, %r12
movq %rax, 0x8(%rsp)
xorl %r14d, %r14d
movl $0x20000, %edx # imm = 0x20000
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x14470
movq 0x10(%rsp), %rax
cmpl $0x4, %eax
jl 0xf4acf
addl $-0x3, %eax
movl %eax, 0x24(%rsp)
movq 0x30(%rsp), %rax
leal (%rax,%rax), %ecx
movl %ecx, 0x20(%rsp)
movl %eax, %eax
movq %rax, 0x48(%rsp)
leaq (,%rax,8), %rax
movq %rax, 0x40(%rsp)
xorl %esi, %esi
movq %r12, 0x50(%rsp)
movslq %esi, %rax
leaq (%r15,%rax), %r13
movzwl (%r15,%rax), %ecx
movzbl 0x2(%r15,%rax), %eax
shll $0x10, %eax
orl %ecx, %eax
leal (,%rax,8), %ecx
xorl %eax, %ecx
movl %ecx, %eax
shrl $0x5, %eax
addl %ecx, %eax
movl %eax, %ecx
shll $0x4, %ecx
xorl %eax, %ecx
movl %ecx, %eax
shrl $0x11, %eax
addl %ecx, %eax
movl %eax, %r12d
shrl $0x6, %r12d
addl %eax, %r12d
andl $0x3fff, %r12d # imm = 0x3FFF
movq 0x18(%rsp), %rax
movq (%rax,%r12,8), %rbx
testq %rbx, %rbx
movq %rsi, 0x38(%rsp)
je 0xf47b6
movslq -0x4(%rbx), %rax
testq %rax, %rax
jle 0xf47c0
leal -0x8000(%rsi), %ecx
movslq %ecx, %rcx
movq 0x10(%rsp), %rdx
subl %esi, %edx
leal -0x1(%rdx), %esi
movl $0x101, %edi # imm = 0x101
cmpl %edi, %esi
cmovael %edi, %esi
incl %esi
movl $0x3, %r14d
xorl %edi, %edi
xorl %ebp, %ebp
movq (%rbx,%rdi,8), %r8
movq %r8, %r9
subq %r15, %r9
cmpq %rcx, %r9
jle 0xf47a7
xorl %r9d, %r9d
testl %edx, %edx
jle 0xf479c
movb (%r8,%r9), %r10b
cmpb (%r13,%r9), %r10b
jne 0xf479c
incq %r9
cmpq %r9, %rsi
jne 0xf4786
movl %esi, %r9d
cmpl %r14d, %r9d
cmovgl %r9d, %r14d
cmovgeq %r8, %rbp
incq %rdi
cmpq %rax, %rdi
jne 0xf4770
testq %rbx, %rbx
jne 0xf47c8
jmp 0xf47f7
movl $0x3, %r14d
xorl %ebp, %ebp
jmp 0xf47f7
movl $0x3, %r14d
xorl %ebp, %ebp
movl -0x4(%rbx), %eax
cmpl 0x20(%rsp), %eax
jne 0xf47ef
movq 0x48(%rsp), %rax
leaq (%rbx,%rax,8), %rsi
movq %rbx, %rdi
movq 0x40(%rsp), %rdx
callq 0x14e90
movq 0x30(%rsp), %rax
movl %eax, -0x4(%rbx)
leal 0x1(%rax), %ecx
cmpl -0x8(%rbx), %ecx
jl 0xf4816
movq 0x18(%rsp), %rax
leaq (%rax,%r12,8), %rbx
movq %rbx, %rdi
movl $0x8, %esi
callq 0xf4efe
movq (%rbx), %rbx
movl -0x4(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rbx)
cltq
movq %r13, (%rbx,%rax,8)
testq %rbp, %rbp
movq 0x50(%rsp), %r12
je 0xf4937
movzwl 0x1(%r13), %eax
movzbl 0x3(%r13), %ecx
shll $0x10, %ecx
orl %eax, %ecx
leal (,%rcx,8), %eax
xorl %ecx, %eax
movl %eax, %ecx
shrl $0x5, %ecx
addl %eax, %ecx
movl %ecx, %eax
shll $0x4, %eax
xorl %ecx, %eax
movl %eax, %ecx
shrl $0x11, %ecx
addl %eax, %ecx
movl %ecx, %eax
shrl $0x6, %eax
addl %ecx, %eax
andl $0x3fff, %eax # imm = 0x3FFF
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0xf48ec
movslq -0x4(%rax), %rcx
testq %rcx, %rcx
jle 0xf48ec
leaq 0x1(%r13), %rdx
movq 0x38(%rsp), %r8
leal -0x7fff(%r8), %esi
movslq %esi, %rsi
notl %r8d
movq 0x10(%rsp), %r9
leal (%r8,%r9), %edi
decl %edi
addl %r9d, %r8d
movl $0x101, %r9d # imm = 0x101
cmpl %r9d, %edi
cmovael %r9d, %edi
incl %edi
xorl %r9d, %r9d
movq (%rax,%r9,8), %r10
movq %r10, %r11
subq %r15, %r11
cmpq %rsi, %r11
jle 0xf48e4
xorl %r11d, %r11d
testl %r8d, %r8d
jle 0xf48df
movb (%r10,%r11), %bl
cmpb (%rdx,%r11), %bl
jne 0xf48df
incq %r11
cmpq %r11, %rdi
jne 0xf48ca
movl %edi, %r11d
cmpl %r14d, %r11d
jg 0xf4937
incq %r9
cmpq %rcx, %r9
jne 0xf48b3
subq %rbp, %r13
xorl %eax, %eax
leaq 0x2d488(%rip), %rdx # 0x121d80
movzwl 0x2(%rdx,%rax,2), %ecx
incq %rax
cmpl %ecx, %r14d
jge 0xf48f8
leaq -0x1(%rax), %rbx
cmpq $0x16, %rbx
leaq 0x4(%rsp), %rbp
ja 0xf4975
xorl %edx, %edx
movl $0xfffffff9, %ecx # imm = 0xFFFFFFF9
movl %eax, %esi
andl $0x1, %esi
leal (%rsi,%rdx,2), %edx
shrl %eax
incl %ecx
jne 0xf491b
movl (%rsp), %ecx
shll %cl, %edx
orl %edx, 0x4(%rsp)
addl $0x7, %ecx
jmp 0xf499b
movzbl (%r13), %eax
cmpl $0x8f, %eax
ja 0xf4a77
addl $0x30, %eax
xorl %edx, %edx
movl $0xfffffff8, %ecx # imm = 0xFFFFFFF8
leaq 0x4(%rsp), %rbp
movl %eax, %esi
andl $0x1, %esi
leal (%rsi,%rdx,2), %edx
shrl %eax
incl %ecx
jne 0xf4956
movl (%rsp), %ecx
shll %cl, %edx
orl %edx, 0x4(%rsp)
addl $0x8, %ecx
jmp 0xf4aa2
addl $0xa8, %eax
xorl %edx, %edx
movl $0xfffffff8, %ecx # imm = 0xFFFFFFF8
movl %eax, %esi
andl $0x1, %esi
leal (%rsi,%rdx,2), %edx
shrl %eax
incl %ecx
jne 0xf4981
movl (%rsp), %ecx
shll %cl, %edx
orl %edx, 0x4(%rsp)
addl $0x8, %ecx
movl %ecx, (%rsp)
movq %r12, %rdi
movq %rbp, %rsi
movq %rsp, %r12
movq %r12, %rdx
callq 0xf4f5c
movl %ebx, %edx
leaq -0x1c(%rdx), %rcx
cmpq $-0x14, %rcx
jb 0xf49f2
leaq 0x2d3be(%rip), %rcx # 0x121d80
movzwl (%rcx,%rdx,2), %ecx
movl %r14d, %esi
subl %ecx, %esi
movl (%rsp), %ecx
shll %cl, %esi
orl %esi, 0x4(%rsp)
leaq 0x2d3e5(%rip), %rsi # 0x121dc0
movzbl (%rdx,%rsi), %edx
addl %ecx, %edx
movl %edx, (%rsp)
movq %rax, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0xf4f5c
leaq 0x2d3e7(%rip), %rdx # 0x121de0
movq $-0x1, %rbx
movzwl 0x4(%rdx,%rbx,2), %ecx
incq %rbx
cmpl %r13d, %ecx
jle 0xf4a00
xorl %edx, %edx
movl $0xfffffffb, %ecx # imm = 0xFFFFFFFB
movl %ebx, %esi
movl %esi, %edi
andl $0x1, %edi
leal (%rdi,%rdx,2), %edx
shrl %esi
incl %ecx
jne 0xf4a16
movl (%rsp), %ecx
shll %cl, %edx
orl %edx, 0x4(%rsp)
addl $0x5, %ecx
movl %ecx, (%rsp)
movq %rax, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0xf4f5c
movq %rax, %r12
cmpq $0x4, %rbx
jb 0xf4abc
movl %ebx, %eax
leaq 0x2d38d(%rip), %rcx # 0x121de0
movzwl (%rcx,%rax,2), %ecx
subl %ecx, %r13d
movl (%rsp), %ecx
shll %cl, %r13d
orl %r13d, 0x4(%rsp)
leaq 0x2d3b4(%rip), %rdx # 0x121e20
movzbl (%rax,%rdx), %eax
addl %ecx, %eax
movl %eax, (%rsp)
jmp 0xf4aab
orl $0x100, %eax # imm = 0x100
xorl %edx, %edx
movl $0xfffffff7, %ecx # imm = 0xFFFFFFF7
leaq 0x4(%rsp), %rbp
movl %eax, %esi
andl $0x1, %esi
leal (%rsi,%rdx,2), %edx
shrl %eax
incl %ecx
jne 0xf4a88
movl (%rsp), %ecx
shll %cl, %edx
orl %edx, 0x4(%rsp)
addl $0x9, %ecx
movl %ecx, (%rsp)
movl $0x1, %r14d
movq %r12, %rdi
movq %rbp, %rsi
movq %rsp, %rdx
callq 0xf4f5c
movq %rax, %r12
addl 0x38(%rsp), %r14d
movl %r14d, %esi
cmpl 0x24(%rsp), %r14d
jl 0xf46e0
movq %r12, 0x8(%rsp)
cmpl 0x10(%rsp), %r14d
jge 0xf4b60
movslq %r14d, %r14
leaq 0x4(%rsp), %rbx
movq %rsp, %rbp
movzbl (%r15,%r14), %eax
cmpl $0x8f, %eax
ja 0xf4b1c
addl $0x30, %eax
xorl %edx, %edx
movl $0xfffffff8, %ecx # imm = 0xFFFFFFF8
movl %eax, %esi
andl $0x1, %esi
leal (%rsi,%rdx,2), %edx
shrl %eax
incl %ecx
jne 0xf4b00
movl (%rsp), %ecx
shll %cl, %edx
orl %edx, 0x4(%rsp)
addl $0x8, %ecx
jmp 0xf4b42
orl $0x100, %eax # imm = 0x100
xorl %edx, %edx
movl $0xfffffff7, %ecx # imm = 0xFFFFFFF7
movl %eax, %esi
andl $0x1, %esi
leal (%rsi,%rdx,2), %edx
shrl %eax
incl %ecx
jne 0xf4b28
movl (%rsp), %ecx
shll %cl, %edx
orl %edx, 0x4(%rsp)
addl $0x9, %ecx
movl %ecx, (%rsp)
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0xf4f5c
movq %rax, %r12
incq %r14
cmpl 0x10(%rsp), %r14d
jne 0xf4aea
movq %r12, 0x8(%rsp)
movq %rsp, %rbx
addl $0x7, (%rbx)
leaq 0x4(%rsp), %rsi
movq %r12, %rdi
movq %rbx, %rdx
callq 0xf4f5c
movq %rax, %rbp
movl (%rbx), %eax
testl %eax, %eax
je 0xf4bc1
leaq 0x4(%rsp), %r13
movq %rsp, %rbx
movq 0x10(%rsp), %r14
incl %eax
movl %eax, (%rsp)
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0xf4f5c
movq %rax, %rbp
movl (%rsp), %eax
testl %eax, %eax
jne 0xf4b91
jmp 0xf4bc6
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %r14
movq %rbp, 0x8(%rsp)
xorl %ebx, %ebx
movq 0x18(%rsp), %rax
movq (%rax,%rbx,8), %rdi
testq %rdi, %rdi
je 0xf4be4
addq $-0x8, %rdi
callq 0x149b0
incq %rbx
cmpq $0x4000, %rbx # imm = 0x4000
jne 0xf4bcd
movq 0x18(%rsp), %rdi
callq 0x149b0
movl -0x4(%rbp), %eax
leal 0x7ffe(%r14), %ecx
movslq %ecx, %rcx
imulq $-0x7ffefffd, %rcx, %rcx # imm = 0x80010003
shrq $0x20, %rcx
addl %r14d, %ecx
addl $0x7ffe, %ecx # imm = 0x7FFE
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0xe, %ecx
addl %edx, %ecx
leal (%rcx,%rcx,4), %ecx
addl %r14d, %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jle 0xf4d7c
movl $0x2, -0x4(%rbp)
testl %r14d, %r14d
jle 0xf4e17
xorl %r13d, %r13d
movl $0x2, %eax
subl %r13d, %r14d
movl $0x7fff, %ecx # imm = 0x7FFF
cmpl %ecx, %r14d
movl $0x7fff, %ebx # imm = 0x7FFF
cmovll %r14d, %ebx
leal 0x1(%rax), %ecx
cmpl -0x8(%rbp), %ecx
jl 0xf4c84
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0xf4efe
movq 0x8(%rsp), %rbp
movl -0x4(%rbp), %eax
leal 0x1(%rax), %ecx
cmpl $0x8000, %r14d # imm = 0x8000
movl %ecx, -0x4(%rbp)
cltq
setl (%rbp,%rax)
movl -0x4(%rbp), %eax
incl %eax
cmpl -0x8(%rbp), %eax
jl 0xf4cae
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0xf4efe
movq 0x8(%rsp), %rax
movslq -0x4(%rax), %rcx
leal 0x1(%rcx), %edx
movl %edx, -0x4(%rax)
movb %bl, (%rax,%rcx)
movl -0x4(%rax), %ecx
leal 0x1(%rcx), %edx
cmpl -0x8(%rax), %edx
movq 0x10(%rsp), %r14
jl 0xf4cea
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0xf4efe
movq 0x8(%rsp), %rax
movl -0x4(%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, -0x4(%rax)
movslq %ecx, %rcx
movb %bh, (%rax,%rcx)
movl -0x4(%rax), %ecx
leal 0x1(%rcx), %edx
cmpl -0x8(%rax), %edx
jl 0xf4d18
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0xf4efe
movq 0x8(%rsp), %rax
movl -0x4(%rax), %ecx
leal 0x1(%rcx), %edx
movl %ebx, %r12d
notl %ebx
movl %edx, -0x4(%rax)
movslq %ecx, %rcx
movb %bl, (%rax,%rcx)
movl -0x4(%rax), %ecx
incl %ecx
cmpl -0x8(%rax), %ecx
jl 0xf4d3f
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0xf4efe
movq 0x8(%rsp), %rbp
movslq -0x4(%rbp), %rax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rbp)
movb %bh, (%rbp,%rax)
movslq -0x4(%rbp), %rdi
addq %rbp, %rdi
movslq %r13d, %rsi
addq %r15, %rsi
movslq %r12d, %rdx
callq 0x14690
movl -0x4(%rbp), %eax
addl %r12d, %eax
movl %eax, -0x4(%rbp)
addl %r12d, %r13d
cmpl %r14d, %r13d
jl 0xf4c4e
testl %r14d, %r14d
movq 0x28(%rsp), %r12
jle 0xf4e0d
movl %r14d, %ecx
imulq $0x5e6ea9af, %rcx, %rcx # imm = 0x5E6EA9AF
shrq $0x2b, %rcx
imull $0x15b0, %ecx, %edx # imm = 0x15B0
movl %r14d, %ecx
subl %edx, %ecx
movl $0x1, %r13d
xorl %ebx, %ebx
movl $0x80078071, %edx # imm = 0x80078071
xorl %esi, %esi
testl %ecx, %ecx
je 0xf4dfa
movl %esi, %edi
movl %ecx, %r8d
addq %r15, %rdi
xorl %r9d, %r9d
movzbl (%rdi,%r9), %r10d
addl %r10d, %r13d
addl %r13d, %ebx
incq %r9
cmpq %r9, %r8
jne 0xf4dc1
movl %r13d, %edi
imulq %rdx, %rdi
shrq $0x2f, %rdi
imull $0xfff1, %edi, %edi # imm = 0xFFF1
subl %edi, %r13d
movl %ebx, %edi
imulq %rdx, %rdi
shrq $0x2f, %rdi
imull $0xfff1, %edi, %edi # imm = 0xFFF1
subl %edi, %ebx
addl %ecx, %esi
movl $0x15b0, %ecx # imm = 0x15B0
cmpl %r14d, %esi
jl 0xf4db2
testq %rbp, %rbp
jne 0xf4e29
jmp 0xf4e31
movl $0x1, %r13d
xorl %ebx, %ebx
jmp 0xf4e29
movl $0x2, %eax
movl $0x1, %r13d
xorl %ebx, %ebx
movq 0x28(%rsp), %r12
leal 0x1(%rax), %ecx
cmpl -0x8(%rbp), %ecx
jl 0xf4e4c
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0xf4efe
movq (%r14), %rbp
movl -0x4(%rbp), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rbp)
cltq
movb %bh, (%rbp,%rax)
movl -0x4(%rbp), %eax
incl %eax
cmpl -0x8(%rbp), %eax
jl 0xf4e6e
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0xf4efe
movq 0x8(%rsp), %rsi
movslq -0x4(%rsi), %rax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rsi)
movb %bl, (%rsi,%rax)
movl -0x4(%rsi), %eax
leal 0x1(%rax), %ecx
cmpl -0x8(%rsi), %ecx
jl 0xf4ea6
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0xf4efe
movq (%r14), %rsi
movl -0x4(%rsi), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rsi)
cltq
movl %r13d, %ebx
movb %bh, (%rsi,%rax)
movl -0x4(%rsi), %eax
leal 0x1(%rax), %ecx
cmpl -0x8(%rsi), %ecx
jl 0xf4ed7
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x1, %esi
callq 0xf4efe
movq (%r14), %rsi
movl -0x4(%rsi), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%rsi)
cltq
movb %bl, (%rsi,%rax)
movslq -0x4(%rsi), %rdx
movl %edx, (%r12)
leaq -0x8(%rsi), %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x14e90
| /embree[P]embree/tutorials/common/image/stb_image_write.h |
stbiw__sbgrowf(void**, int, int) | static void *stbiw__sbgrowf(void **arr, int increment, int itemsize)
{
int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1;
void *p = STBIW_REALLOC_SIZED(*arr ? stbiw__sbraw(*arr) : 0, *arr ? (stbiw__sbm(*arr)*itemsize + sizeof(int)*2) : 0, itemsize * m + sizeof(int)*2);
STBIW_ASSERT(p);
if (p) {
if (!*arr) ((int *) p)[1] = 0;
*arr = (void *) ((int *) p + 2);
stbiw__sbm(*arr) = m;
}
return *arr;
} | pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0xf4f18
movl -0x8(%rax), %ecx
leal 0x1(,%rcx,2), %ebp
jmp 0xf4f1d
movl $0x2, %ebp
leaq -0x8(%rax), %rdi
testq %rax, %rax
cmoveq %rax, %rdi
imull %ebp, %esi
movslq %esi, %rsi
addq $0x8, %rsi
callq 0x14ec0
testq %rax, %rax
je 0xf4f55
cmpq $0x0, (%rbx)
jne 0xf4f49
movl $0x0, 0x4(%rax)
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, (%rbx)
movl %ebp, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image_write.h |
stbi_write_png_to_func | STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int stride_bytes)
{
int len;
unsigned char *png = stbi_write_png_to_mem((const unsigned char *) data, stride_bytes, x, y, comp, &len);
if (png == NULL) return 0;
func(context, png, len);
STBIW_FREE(png);
return 1;
} | pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %r9, %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x30(%rsp), %esi
leaq 0xc(%rsp), %r9
movq %rax, %rdi
callq 0xf4fd1
testq %rax, %rax
je 0xf56cb
movq %rax, %r15
movl 0xc(%rsp), %edx
movq %r14, %rdi
movq %rax, %rsi
callq *%rbx
movq %r15, %rdi
callq 0x149b0
movl $0x1, %eax
jmp 0xf56cd
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
| /embree[P]embree/tutorials/common/image/stb_image_write.h |
stbi_write_jpg_core(stbi__write_context*, int, int, int, void const*, int) | static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, int comp, const void* data, int quality) {
// Constants that don't pollute global namespace
static const unsigned char std_dc_luminance_nrcodes[] = {0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0};
static const unsigned char std_dc_luminance_values[] = {0,1,2,3,4,5,6,7,8,9,10,11};
static const unsigned char std_ac_luminance_nrcodes[] = {0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,0x7d};
static const unsigned char std_ac_luminance_values[] = {
0x01,0x02,0x03,0x00,0x04,0x11,0x05,0x12,0x21,0x31,0x41,0x06,0x13,0x51,0x61,0x07,0x22,0x71,0x14,0x32,0x81,0x91,0xa1,0x08,
0x23,0x42,0xb1,0xc1,0x15,0x52,0xd1,0xf0,0x24,0x33,0x62,0x72,0x82,0x09,0x0a,0x16,0x17,0x18,0x19,0x1a,0x25,0x26,0x27,0x28,
0x29,0x2a,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
0x5a,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x83,0x84,0x85,0x86,0x87,0x88,0x89,
0x8a,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xb2,0xb3,0xb4,0xb5,0xb6,
0xb7,0xb8,0xb9,0xba,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xe1,0xe2,
0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa
};
static const unsigned char std_dc_chrominance_nrcodes[] = {0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0};
static const unsigned char std_dc_chrominance_values[] = {0,1,2,3,4,5,6,7,8,9,10,11};
static const unsigned char std_ac_chrominance_nrcodes[] = {0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,0x77};
static const unsigned char std_ac_chrominance_values[] = {
0x00,0x01,0x02,0x03,0x11,0x04,0x05,0x21,0x31,0x06,0x12,0x41,0x51,0x07,0x61,0x71,0x13,0x22,0x32,0x81,0x08,0x14,0x42,0x91,
0xa1,0xb1,0xc1,0x09,0x23,0x33,0x52,0xf0,0x15,0x62,0x72,0xd1,0x0a,0x16,0x24,0x34,0xe1,0x25,0xf1,0x17,0x18,0x19,0x1a,0x26,
0x27,0x28,0x29,0x2a,0x35,0x36,0x37,0x38,0x39,0x3a,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x53,0x54,0x55,0x56,0x57,0x58,
0x59,0x5a,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x82,0x83,0x84,0x85,0x86,0x87,
0x88,0x89,0x8a,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xb2,0xb3,0xb4,
0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,
0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa
};
// Huffman tables
static const unsigned short YDC_HT[256][2] = { {0,2},{2,3},{3,3},{4,3},{5,3},{6,3},{14,4},{30,5},{62,6},{126,7},{254,8},{510,9}};
static const unsigned short UVDC_HT[256][2] = { {0,2},{1,2},{2,2},{6,3},{14,4},{30,5},{62,6},{126,7},{254,8},{510,9},{1022,10},{2046,11}};
static const unsigned short YAC_HT[256][2] = {
{10,4},{0,2},{1,2},{4,3},{11,4},{26,5},{120,7},{248,8},{1014,10},{65410,16},{65411,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{12,4},{27,5},{121,7},{502,9},{2038,11},{65412,16},{65413,16},{65414,16},{65415,16},{65416,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{28,5},{249,8},{1015,10},{4084,12},{65417,16},{65418,16},{65419,16},{65420,16},{65421,16},{65422,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{58,6},{503,9},{4085,12},{65423,16},{65424,16},{65425,16},{65426,16},{65427,16},{65428,16},{65429,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{59,6},{1016,10},{65430,16},{65431,16},{65432,16},{65433,16},{65434,16},{65435,16},{65436,16},{65437,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{122,7},{2039,11},{65438,16},{65439,16},{65440,16},{65441,16},{65442,16},{65443,16},{65444,16},{65445,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{123,7},{4086,12},{65446,16},{65447,16},{65448,16},{65449,16},{65450,16},{65451,16},{65452,16},{65453,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{250,8},{4087,12},{65454,16},{65455,16},{65456,16},{65457,16},{65458,16},{65459,16},{65460,16},{65461,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{504,9},{32704,15},{65462,16},{65463,16},{65464,16},{65465,16},{65466,16},{65467,16},{65468,16},{65469,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{505,9},{65470,16},{65471,16},{65472,16},{65473,16},{65474,16},{65475,16},{65476,16},{65477,16},{65478,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{506,9},{65479,16},{65480,16},{65481,16},{65482,16},{65483,16},{65484,16},{65485,16},{65486,16},{65487,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{1017,10},{65488,16},{65489,16},{65490,16},{65491,16},{65492,16},{65493,16},{65494,16},{65495,16},{65496,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{1018,10},{65497,16},{65498,16},{65499,16},{65500,16},{65501,16},{65502,16},{65503,16},{65504,16},{65505,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{2040,11},{65506,16},{65507,16},{65508,16},{65509,16},{65510,16},{65511,16},{65512,16},{65513,16},{65514,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{65515,16},{65516,16},{65517,16},{65518,16},{65519,16},{65520,16},{65521,16},{65522,16},{65523,16},{65524,16},{0,0},{0,0},{0,0},{0,0},{0,0},
{2041,11},{65525,16},{65526,16},{65527,16},{65528,16},{65529,16},{65530,16},{65531,16},{65532,16},{65533,16},{65534,16},{0,0},{0,0},{0,0},{0,0},{0,0}
};
static const unsigned short UVAC_HT[256][2] = {
{0,2},{1,2},{4,3},{10,4},{24,5},{25,5},{56,6},{120,7},{500,9},{1014,10},{4084,12},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{11,4},{57,6},{246,8},{501,9},{2038,11},{4085,12},{65416,16},{65417,16},{65418,16},{65419,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{26,5},{247,8},{1015,10},{4086,12},{32706,15},{65420,16},{65421,16},{65422,16},{65423,16},{65424,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{27,5},{248,8},{1016,10},{4087,12},{65425,16},{65426,16},{65427,16},{65428,16},{65429,16},{65430,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{58,6},{502,9},{65431,16},{65432,16},{65433,16},{65434,16},{65435,16},{65436,16},{65437,16},{65438,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{59,6},{1017,10},{65439,16},{65440,16},{65441,16},{65442,16},{65443,16},{65444,16},{65445,16},{65446,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{121,7},{2039,11},{65447,16},{65448,16},{65449,16},{65450,16},{65451,16},{65452,16},{65453,16},{65454,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{122,7},{2040,11},{65455,16},{65456,16},{65457,16},{65458,16},{65459,16},{65460,16},{65461,16},{65462,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{249,8},{65463,16},{65464,16},{65465,16},{65466,16},{65467,16},{65468,16},{65469,16},{65470,16},{65471,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{503,9},{65472,16},{65473,16},{65474,16},{65475,16},{65476,16},{65477,16},{65478,16},{65479,16},{65480,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{504,9},{65481,16},{65482,16},{65483,16},{65484,16},{65485,16},{65486,16},{65487,16},{65488,16},{65489,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{505,9},{65490,16},{65491,16},{65492,16},{65493,16},{65494,16},{65495,16},{65496,16},{65497,16},{65498,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{506,9},{65499,16},{65500,16},{65501,16},{65502,16},{65503,16},{65504,16},{65505,16},{65506,16},{65507,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{2041,11},{65508,16},{65509,16},{65510,16},{65511,16},{65512,16},{65513,16},{65514,16},{65515,16},{65516,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
{16352,14},{65517,16},{65518,16},{65519,16},{65520,16},{65521,16},{65522,16},{65523,16},{65524,16},{65525,16},{0,0},{0,0},{0,0},{0,0},{0,0},
{1018,10},{32707,15},{65526,16},{65527,16},{65528,16},{65529,16},{65530,16},{65531,16},{65532,16},{65533,16},{65534,16},{0,0},{0,0},{0,0},{0,0},{0,0}
};
static const int YQT[] = {16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,
37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99};
static const int UVQT[] = {17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,
99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99};
static const float aasf[] = { 1.0f * 2.828427125f, 1.387039845f * 2.828427125f, 1.306562965f * 2.828427125f, 1.175875602f * 2.828427125f,
1.0f * 2.828427125f, 0.785694958f * 2.828427125f, 0.541196100f * 2.828427125f, 0.275899379f * 2.828427125f };
int row, col, i, k, subsample;
float fdtbl_Y[64], fdtbl_UV[64];
unsigned char YTable[64], UVTable[64];
if(!data || !width || !height || comp > 4 || comp < 1) {
return 0;
}
quality = quality ? quality : 90;
subsample = quality <= 90 ? 1 : 0;
quality = quality < 1 ? 1 : quality > 100 ? 100 : quality;
quality = quality < 50 ? 5000 / quality : 200 - quality * 2;
for(i = 0; i < 64; ++i) {
int uvti, yti = (YQT[i]*quality+50)/100;
YTable[stbiw__jpg_ZigZag[i]] = (unsigned char) (yti < 1 ? 1 : yti > 255 ? 255 : yti);
uvti = (UVQT[i]*quality+50)/100;
UVTable[stbiw__jpg_ZigZag[i]] = (unsigned char) (uvti < 1 ? 1 : uvti > 255 ? 255 : uvti);
}
for(row = 0, k = 0; row < 8; ++row) {
for(col = 0; col < 8; ++col, ++k) {
fdtbl_Y[k] = 1 / (YTable [stbiw__jpg_ZigZag[k]] * aasf[row] * aasf[col]);
fdtbl_UV[k] = 1 / (UVTable[stbiw__jpg_ZigZag[k]] * aasf[row] * aasf[col]);
}
}
// Write Headers
{
static const unsigned char head0[] = { 0xFF,0xD8,0xFF,0xE0,0,0x10,'J','F','I','F',0,1,1,0,0,1,0,1,0,0,0xFF,0xDB,0,0x84,0 };
static const unsigned char head2[] = { 0xFF,0xDA,0,0xC,3,1,0,2,0x11,3,0x11,0,0x3F,0 };
const unsigned char head1[] = { 0xFF,0xC0,0,0x11,8,(unsigned char)(height>>8),STBIW_UCHAR(height),(unsigned char)(width>>8),STBIW_UCHAR(width),
3,1,(unsigned char)(subsample?0x22:0x11),0,2,0x11,1,3,0x11,1,0xFF,0xC4,0x01,0xA2,0 };
s->func(s->context, (void*)head0, sizeof(head0));
s->func(s->context, (void*)YTable, sizeof(YTable));
stbiw__putc(s, 1);
s->func(s->context, UVTable, sizeof(UVTable));
s->func(s->context, (void*)head1, sizeof(head1));
s->func(s->context, (void*)(std_dc_luminance_nrcodes+1), sizeof(std_dc_luminance_nrcodes)-1);
s->func(s->context, (void*)std_dc_luminance_values, sizeof(std_dc_luminance_values));
stbiw__putc(s, 0x10); // HTYACinfo
s->func(s->context, (void*)(std_ac_luminance_nrcodes+1), sizeof(std_ac_luminance_nrcodes)-1);
s->func(s->context, (void*)std_ac_luminance_values, sizeof(std_ac_luminance_values));
stbiw__putc(s, 1); // HTUDCinfo
s->func(s->context, (void*)(std_dc_chrominance_nrcodes+1), sizeof(std_dc_chrominance_nrcodes)-1);
s->func(s->context, (void*)std_dc_chrominance_values, sizeof(std_dc_chrominance_values));
stbiw__putc(s, 0x11); // HTUACinfo
s->func(s->context, (void*)(std_ac_chrominance_nrcodes+1), sizeof(std_ac_chrominance_nrcodes)-1);
s->func(s->context, (void*)std_ac_chrominance_values, sizeof(std_ac_chrominance_values));
s->func(s->context, (void*)head2, sizeof(head2));
}
// Encode 8x8 macroblocks
{
static const unsigned short fillBits[] = {0x7F, 7};
int DCY=0, DCU=0, DCV=0;
int bitBuf=0, bitCnt=0;
// comp == 2 is grey+alpha (alpha is ignored)
int ofsG = comp > 2 ? 1 : 0, ofsB = comp > 2 ? 2 : 0;
const unsigned char *dataR = (const unsigned char *)data;
const unsigned char *dataG = dataR + ofsG;
const unsigned char *dataB = dataR + ofsB;
int x, y, pos;
if(subsample) {
for(y = 0; y < height; y += 16) {
for(x = 0; x < width; x += 16) {
float Y[256], U[256], V[256];
for(row = y, pos = 0; row < y+16; ++row) {
// row >= height => use last input row
int clamped_row = (row < height) ? row : height - 1;
int base_p = (stbi__flip_vertically_on_write ? (height-1-clamped_row) : clamped_row)*width*comp;
for(col = x; col < x+16; ++col, ++pos) {
// if col >= width => use pixel from last input column
int p = base_p + ((col < width) ? col : (width-1))*comp;
float r = dataR[p], g = dataG[p], b = dataB[p];
Y[pos]= +0.29900f*r + 0.58700f*g + 0.11400f*b - 128;
U[pos]= -0.16874f*r - 0.33126f*g + 0.50000f*b;
V[pos]= +0.50000f*r - 0.41869f*g - 0.08131f*b;
}
}
DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+0, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT);
DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+8, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT);
DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+128, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT);
DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+136, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT);
// subsample U,V
{
float subU[64], subV[64];
int yy, xx;
for(yy = 0, pos = 0; yy < 8; ++yy) {
for(xx = 0; xx < 8; ++xx, ++pos) {
int j = yy*32+xx*2;
subU[pos] = (U[j+0] + U[j+1] + U[j+16] + U[j+17]) * 0.25f;
subV[pos] = (V[j+0] + V[j+1] + V[j+16] + V[j+17]) * 0.25f;
}
}
DCU = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, subU, 8, fdtbl_UV, DCU, UVDC_HT, UVAC_HT);
DCV = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, subV, 8, fdtbl_UV, DCV, UVDC_HT, UVAC_HT);
}
}
}
} else {
for(y = 0; y < height; y += 8) {
for(x = 0; x < width; x += 8) {
float Y[64], U[64], V[64];
for(row = y, pos = 0; row < y+8; ++row) {
// row >= height => use last input row
int clamped_row = (row < height) ? row : height - 1;
int base_p = (stbi__flip_vertically_on_write ? (height-1-clamped_row) : clamped_row)*width*comp;
for(col = x; col < x+8; ++col, ++pos) {
// if col >= width => use pixel from last input column
int p = base_p + ((col < width) ? col : (width-1))*comp;
float r = dataR[p], g = dataG[p], b = dataB[p];
Y[pos]= +0.29900f*r + 0.58700f*g + 0.11400f*b - 128;
U[pos]= -0.16874f*r - 0.33126f*g + 0.50000f*b;
V[pos]= +0.50000f*r - 0.41869f*g - 0.08131f*b;
}
}
DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y, 8, fdtbl_Y, DCY, YDC_HT, YAC_HT);
DCU = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, U, 8, fdtbl_UV, DCU, UVDC_HT, UVAC_HT);
DCV = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, V, 8, fdtbl_UV, DCV, UVDC_HT, UVAC_HT);
}
}
}
// Do the bit alignment of the EOI marker
stbiw__jpg_writeBits(s, &bitBuf, &bitCnt, fillBits);
}
// EOI
stbiw__putc(s, 0xFF);
stbiw__putc(s, 0xD9);
return 1;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10d8, %rsp # imm = 0x10D8
movl %ecx, %r15d
movq %rdi, 0x10(%rsp)
leal -0x5(%r15), %eax
xorl %ebp, %ebp
cmpl $-0x4, %eax
jb 0xf63c2
testl %edx, %edx
je 0xf63c2
movl %esi, %ebx
testl %esi, %esi
je 0xf63c2
testq %r8, %r8
je 0xf63c2
movq %rdx, 0x18(%rsp)
testl %r9d, %r9d
movl $0x5a, %edx
cmovnel %r9d, %edx
cmpl $0x64, %edx
movl $0x64, %eax
cmovll %edx, %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movl %edx, 0x8(%rsp)
cmpl $0x31, %edx
movq %r8, 0x48(%rsp)
jg 0xf57a9
movw $0x1388, %ax # imm = 0x1388
xorl %edx, %edx
divw %cx
movzwl %ax, %eax
jmp 0xf57b2
addl %ecx, %ecx
movl $0xc8, %eax
subl %ecx, %eax
leaq 0x2e417(%rip), %rcx # 0x123bd0
xorl %edx, %edx
leaq 0x2e20e(%rip), %rsi # 0x1239d0
leaq 0x2e307(%rip), %rdi # 0x123ad0
movl (%rdx,%rsi), %r8d
imull %eax, %r8d
addl $0x32, %r8d
movslq %r8d, %r8
imulq $0x51eb851f, %r8, %r10 # imm = 0x51EB851F
movq %r10, %r8
shrq $0x3f, %r8
sarq $0x25, %r10
addl %r8d, %r10d
movl $0xff, %r8d
cmpl %r8d, %r10d
jl 0xf57fe
movl $0xff, %r10d
cmpl $0x2, %r10d
jge 0xf580a
movl $0x1, %r10d
movzbl (%rcx), %r9d
movb %r10b, 0x90(%rsp,%r9)
movl (%rdx,%rdi), %r10d
imull %eax, %r10d
addl $0x32, %r10d
movslq %r10d, %r10
imulq $0x51eb851f, %r10, %r10 # imm = 0x51EB851F
movq %r10, %r11
shrq $0x3f, %r11
sarq $0x25, %r10
addl %r11d, %r10d
cmpl %r8d, %r10d
jl 0xf5845
movl $0xff, %r10d
cmpl $0x2, %r10d
jge 0xf5851
movl $0x1, %r10d
movb %r10b, 0x50(%rsp,%r9)
addq $0x4, %rdx
incq %rcx
cmpq $0x100, %rdx # imm = 0x100
jne 0xf57c9
xorl %eax, %eax
leaq 0x2ea4d(%rip), %rcx # 0x1242c0
pxor %xmm0, %xmm0
movaps 0x24422(%rip), %xmm1 # 0x119ca0
xorl %edx, %edx
movslq %edx, %r9
leaq 0x8(%r9), %rdx
movq %rdx, 0x38(%rsp)
movss (%rcx,%rax,4), %xmm2
shufps $0x0, %xmm2, %xmm2 # xmm2 = xmm2[0,0,0,0]
leaq 0x2e334(%rip), %rdx # 0x123bd0
leaq (%r9,%rdx), %rdi
addq $0x3, %rdi
leaq (%rsp,%r9,4), %r8
addq $0xd0, %r8
leaq (%rsp,%r9,4), %r9
addq $0x1d0, %r9 # imm = 0x1D0
xorl %r10d, %r10d
movzbl -0x3(%rdi), %r14d
movzbl -0x2(%rdi), %r12d
movzbl -0x1(%rdi), %r13d
movzbl (%rdi), %r11d
movzbl 0x90(%rsp,%r14), %ebp
movzbl 0x90(%rsp,%r12), %edx
movzbl 0x90(%rsp,%r13), %esi
shll $0x8, %edx
orl %ebp, %edx
shll $0x10, %esi
orl %edx, %esi
movzbl 0x90(%rsp,%r11), %edx
shll $0x18, %edx
orl %esi, %edx
movd %edx, %xmm3
punpcklbw %xmm0, %xmm3 # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1],xmm3[2],xmm0[2],xmm3[3],xmm0[3],xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
punpcklwd %xmm0, %xmm3 # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1],xmm3[2],xmm0[2],xmm3[3],xmm0[3]
cvtdq2ps %xmm3, %xmm3
mulps %xmm2, %xmm3
movaps (%r10,%rcx), %xmm4
mulps %xmm4, %xmm3
movaps %xmm1, %xmm5
divps %xmm3, %xmm5
movups %xmm5, (%r8,%r10)
movzbl 0x50(%rsp,%r14), %edx
movzbl 0x50(%rsp,%r12), %esi
movzbl 0x50(%rsp,%r13), %ebp
shll $0x8, %esi
orl %edx, %esi
shll $0x10, %ebp
orl %esi, %ebp
movzbl 0x50(%rsp,%r11), %edx
shll $0x18, %edx
orl %ebp, %edx
movd %edx, %xmm3
punpcklbw %xmm0, %xmm3 # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1],xmm3[2],xmm0[2],xmm3[3],xmm0[3],xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
punpcklwd %xmm0, %xmm3 # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1],xmm3[2],xmm0[2],xmm3[3],xmm0[3]
cvtdq2ps %xmm3, %xmm3
mulps %xmm2, %xmm3
mulps %xmm4, %xmm3
movaps %xmm1, %xmm4
divps %xmm3, %xmm4
movups %xmm4, (%r9,%r10)
addq $0x10, %r10
addq $0x4, %rdi
cmpq $0x20, %r10
jne 0xf58bd
incq %rax
cmpq $0x8, %rax
movq 0x38(%rsp), %rdx
jne 0xf5880
cmpl $0x5b, 0x8(%rsp)
leaq 0x2d0(%rsp), %r13
movl $0x1100c0ff, (%r13) # imm = 0x1100C0FF
movb $0x8, 0x4(%r13)
movq 0x18(%rsp), %rax
movb %ah, 0x2d5(%rsp)
movb %al, 0x6(%r13)
movb %bh, 0x2d7(%rsp)
movb %bl, 0x8(%r13)
movw $0x103, 0x9(%r13) # imm = 0x103
movl $0x22, %eax
movl $0x11, %ecx
cmovll %eax, %ecx
movb %cl, 0xb(%r13)
movabsq $-0xfeeefcfeeefe00, %rax # imm = 0xFF01110301110200
movq %rax, 0xc(%r13)
movl $0xa201c4, 0x14(%r13) # imm = 0xA201C4
movq 0x10(%rsp), %r14
movq 0x8(%r14), %rdi
leaq 0x2e20a(%rip), %rsi # 0x123c10
movl $0x19, %edx
callq *(%r14)
movq 0x8(%r14), %rdi
leaq 0x90(%rsp), %rsi
movl $0x40, %edx
callq *(%r14)
movq (%r14), %rax
movq 0x8(%r14), %rdi
movb $0x1, %bpl
leaq 0x6d0(%rsp), %r12
movb %bpl, (%r12)
movq %r12, %rsi
movl $0x1, %edx
callq *%rax
movq 0x8(%r14), %rdi
leaq 0x50(%rsp), %rsi
movl $0x40, %edx
callq *(%r14)
movq 0x8(%r14), %rdi
movq %r13, %rsi
movl $0x18, %edx
callq *(%r14)
movq 0x8(%r14), %rdi
leaq 0x2cd84(%rip), %rsi # 0x1227f1
movl $0x10, %edx
callq *(%r14)
movq 0x8(%r14), %rdi
leaq 0x2cd81(%rip), %rsi # 0x122801
movl $0xc, %edx
callq *(%r14)
movq (%r14), %rax
movq 0x8(%r14), %rdi
movb $0x10, (%r12)
leaq 0x6d0(%rsp), %r12
movq %r12, %rsi
movl $0x1, %edx
callq *%rax
movq 0x8(%r14), %rdi
leaq 0x2cd60(%rip), %rsi # 0x122811
movl $0x10, %edx
callq *(%r14)
movq 0x8(%r14), %rdi
leaq 0x2cd6c(%rip), %rsi # 0x122830
movl $0xa2, %edx
callq *(%r14)
movq (%r14), %rax
movq 0x8(%r14), %rdi
movb %bpl, (%r12)
leaq 0x6d0(%rsp), %r12
movq %r12, %rsi
movl $0x1, %edx
callq *%rax
movq 0x8(%r14), %rdi
leaq 0x2cded(%rip), %rsi # 0x1228e1
movl $0x10, %edx
callq *(%r14)
movq 0x8(%r14), %rdi
leaq 0x2cdea(%rip), %rsi # 0x1228f1
movl $0xc, %edx
callq *(%r14)
movq (%r14), %rax
movq 0x8(%r14), %rdi
movb $0x11, (%r12)
leaq 0x6d0(%rsp), %rsi
movl $0x1, %edx
callq *%rax
movq 0x8(%r14), %rdi
leaq 0x2cdcc(%rip), %rsi # 0x122901
movl $0x10, %edx
callq *(%r14)
movq 0x8(%r14), %rdi
leaq 0x2cdd8(%rip), %rsi # 0x122920
movl $0xa2, %edx
callq *(%r14)
movq 0x8(%r14), %rdi
leaq 0x2e0ce(%rip), %rsi # 0x123c29
movl $0xe, %edx
callq *(%r14)
xorl %eax, %eax
cmpl $0x3, %r15d
setge %al
movq 0x48(%rsp), %rdx
leaq (%rdx,%rax), %rbp
xorl %ecx, %ecx
movl %ecx, 0x4(%rsp)
movl %ecx, (%rsp)
leaq (%rdx,%rax,2), %r13
cmpl $0x5b, 0x8(%rsp)
jge 0xf6045
movq 0x18(%rsp), %rax
testl %eax, %eax
jle 0xf6368
decl %eax
movl %eax, 0x24(%rsp)
leal -0x1(%rbx), %r12d
movq $0x0, 0x28(%rsp)
movl $0x10, 0x8(%rsp)
movss 0x2be47(%rip), %xmm5 # 0x121a04
movss 0x2be43(%rip), %xmm6 # 0x121a08
movss 0x2be3f(%rip), %xmm7 # 0x121a0c
movss 0x2be3a(%rip), %xmm8 # 0x121a10
movss 0x2be35(%rip), %xmm9 # 0x121a14
movss 0x2be30(%rip), %xmm10 # 0x121a18
movss 0x23e67(%rip), %xmm11 # 0x119a58
movss 0x2be22(%rip), %xmm12 # 0x121a1c
movss 0x2be1d(%rip), %xmm13 # 0x121a20
movq $0x0, 0x30(%rsp)
xorl %eax, %eax
movl $0x0, 0xc(%rsp)
testl %ebx, %ebx
jle 0xf6026
xorl %r14d, %r14d
movq %rax, 0x40(%rsp)
movl 0x76f48(%rip), %eax # 0x16cb74
movl %eax, 0x38(%rsp)
leaq 0xcd0(%rsp), %rcx
leaq 0x6d0(%rsp), %rdx
leaq 0x2d0(%rsp), %rsi
movl 0xc(%rsp), %edi
cmpl 0x18(%rsp), %edi
movl 0x24(%rsp), %r8d
movl %r8d, %r9d
cmovll %edi, %r9d
subl %r9d, %r8d
cmpl $0x0, 0x38(%rsp)
cmovel %r9d, %r8d
imull %ebx, %r8d
xorl %r9d, %r9d
movq 0x48(%rsp), %rax
leal (%r14,%r9), %r10d
cmpl %ebx, %r10d
cmovgel %r12d, %r10d
addl %r8d, %r10d
imull %r15d, %r10d
movslq %r10d, %r10
movzbl (%rax,%r10), %r11d
xorps %xmm0, %xmm0
cvtsi2ss %r11d, %xmm0
movzbl (%rbp,%r10), %r11d
xorps %xmm2, %xmm2
cvtsi2ss %r11d, %xmm2
movzbl (%r13,%r10), %r10d
xorps %xmm1, %xmm1
cvtsi2ss %r10d, %xmm1
movaps %xmm2, %xmm3
mulss %xmm5, %xmm3
movaps %xmm0, %xmm4
mulss %xmm6, %xmm4
addss %xmm3, %xmm4
movaps %xmm1, %xmm3
mulss %xmm7, %xmm3
addss %xmm4, %xmm3
addss %xmm8, %xmm3
movss %xmm3, (%rsi,%r9,4)
movaps %xmm2, %xmm3
mulss %xmm9, %xmm3
movaps %xmm0, %xmm4
mulss %xmm10, %xmm4
addss %xmm3, %xmm4
movaps %xmm1, %xmm3
mulss %xmm11, %xmm3
addss %xmm4, %xmm3
movss %xmm3, (%rdx,%r9,4)
mulss %xmm12, %xmm2
mulss %xmm11, %xmm0
addss %xmm2, %xmm0
mulss %xmm13, %xmm1
addss %xmm0, %xmm1
movss %xmm1, (%rcx,%r9,4)
incq %r9
cmpl $0x10, %r9d
jne 0xf5c74
incl %edi
addq $0x40, %rsi
addq $0x40, %rdx
addq $0x40, %rcx
cmpl 0x8(%rsp), %edi
jne 0xf5c4c
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x2d8(%rsp), %rcx
movl $0x10, %r8d
leaq 0xd8(%rsp), %r9
leaq 0x2d45e(%rip), %rax # 0x1231d0
pushq %rax
leaq 0x2cc56(%rip), %rax # 0x1229d0
pushq %rax
pushq 0x40(%rsp)
callq 0x105878
addq $0x20, %rsp
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x2f8(%rsp), %rcx
movl $0x10, %r8d
leaq 0xd8(%rsp), %r9
leaq 0x2d418(%rip), %r10 # 0x1231d0
pushq %r10
leaq 0x2cc0f(%rip), %r10 # 0x1229d0
pushq %r10
pushq %rax
callq 0x105878
addq $0x20, %rsp
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x4d8(%rsp), %rcx
movl $0x10, %r8d
leaq 0xd8(%rsp), %r9
leaq 0x2d3d3(%rip), %r10 # 0x1231d0
pushq %r10
leaq 0x2cbca(%rip), %r10 # 0x1229d0
pushq %r10
pushq %rax
callq 0x105878
addq $0x20, %rsp
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x4f8(%rsp), %rcx
movl $0x10, %r8d
leaq 0xd8(%rsp), %r9
leaq 0x2d38e(%rip), %r10 # 0x1231d0
pushq %r10
leaq 0x2cb85(%rip), %r10 # 0x1229d0
pushq %r10
pushq %rax
callq 0x105878
addq $0x20, %rsp
movq %rax, 0x28(%rsp)
leaq 0x710(%rsp), %rax
leaq 0xd10(%rsp), %rcx
xorl %edx, %edx
xorl %esi, %esi
movaps 0x2bbc9(%rip), %xmm5 # 0x121a40
movl $0x80, %r10d
movslq %esi, %r8
leaq 0x8(%r8), %rsi
leaq (%rsp,%r8,4), %rdi
addq $0xbd0, %rdi # imm = 0xBD0
leaq (%rsp,%r8,4), %r8
addq $0xad0, %r8 # imm = 0xAD0
xorl %r9d, %r9d
movaps -0x40(%rax,%r9,2), %xmm0
movaps -0x30(%rax,%r9,2), %xmm1
movaps (%rax,%r9,2), %xmm2
movaps 0x10(%rax,%r9,2), %xmm3
movaps %xmm0, %xmm4
shufps $0x88, %xmm1, %xmm4 # xmm4 = xmm4[0,2],xmm1[0,2]
shufps $0xdd, %xmm1, %xmm0 # xmm0 = xmm0[1,3],xmm1[1,3]
addps %xmm4, %xmm0
movaps %xmm2, %xmm1
shufps $0x88, %xmm3, %xmm1 # xmm1 = xmm1[0,2],xmm3[0,2]
addps %xmm0, %xmm1
shufps $0xdd, %xmm3, %xmm2 # xmm2 = xmm2[1,3],xmm3[1,3]
addps %xmm1, %xmm2
mulps %xmm5, %xmm2
movups %xmm2, (%rdi,%r9)
movaps -0x40(%rcx,%r9,2), %xmm0
movaps -0x30(%rcx,%r9,2), %xmm1
movaps (%rcx,%r9,2), %xmm2
movaps 0x10(%rcx,%r9,2), %xmm3
movaps %xmm0, %xmm4
shufps $0x88, %xmm1, %xmm4 # xmm4 = xmm4[0,2],xmm1[0,2]
shufps $0xdd, %xmm1, %xmm0 # xmm0 = xmm0[1,3],xmm1[1,3]
addps %xmm4, %xmm0
movaps %xmm2, %xmm1
shufps $0x88, %xmm3, %xmm1 # xmm1 = xmm1[0,2],xmm3[0,2]
addps %xmm0, %xmm1
shufps $0xdd, %xmm3, %xmm2 # xmm2 = xmm2[1,3],xmm3[1,3]
addps %xmm1, %xmm2
mulps %xmm5, %xmm2
movups %xmm2, (%r8,%r9)
addq $0x10, %r9
cmpq $0x20, %r9
jne 0xf5e9d
incq %rdx
addq %r10, %rcx
addq %r10, %rax
cmpq $0x8, %rdx
jne 0xf5e7d
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0xbd8(%rsp), %rcx
movl $0x8, %r8d
leaq 0x1d8(%rsp), %r9
leaq 0x2d666(%rip), %rax # 0x1235d0
pushq %rax
leaq 0x2ce5e(%rip), %rax # 0x122dd0
pushq %rax
pushq 0x48(%rsp)
callq 0x105878
addq $0x20, %rsp
movq %rax, 0x30(%rsp)
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0xad8(%rsp), %rcx
movl $0x8, %r8d
leaq 0x1d8(%rsp), %r9
leaq 0x2d61b(%rip), %rax # 0x1235d0
pushq %rax
leaq 0x2ce13(%rip), %rax # 0x122dd0
pushq %rax
pushq 0x58(%rsp)
callq 0x105878
addq $0x20, %rsp
addq $0x10, %r14
cmpl %ebx, %r14d
movss 0x2ba2a(%rip), %xmm5 # 0x121a04
movss 0x2ba26(%rip), %xmm6 # 0x121a08
movss 0x2ba22(%rip), %xmm7 # 0x121a0c
movss 0x2ba1d(%rip), %xmm8 # 0x121a10
movss 0x2ba18(%rip), %xmm9 # 0x121a14
movss 0x2ba13(%rip), %xmm10 # 0x121a18
movss 0x23a4a(%rip), %xmm11 # 0x119a58
movss 0x2ba05(%rip), %xmm12 # 0x121a1c
movss 0x2ba00(%rip), %xmm13 # 0x121a20
jl 0xf5c21
movl 0xc(%rsp), %ecx
addl $0x10, %ecx
addl $0x10, 0x8(%rsp)
movl %ecx, 0xc(%rsp)
cmpl 0x18(%rsp), %ecx
jl 0xf5c16
jmp 0xf6368
movq 0x18(%rsp), %rax
testl %eax, %eax
jle 0xf6368
decl %eax
movl %eax, 0x24(%rsp)
leal -0x1(%rbx), %r12d
movq $0x0, 0x30(%rsp)
movl $0x8, 0x8(%rsp)
leaq 0xcd0(%rsp), %rcx
movss 0x2b987(%rip), %xmm5 # 0x121a04
movss 0x2b983(%rip), %xmm6 # 0x121a08
movss 0x2b97f(%rip), %xmm7 # 0x121a0c
movss 0x2b97a(%rip), %xmm8 # 0x121a10
movss 0x2b975(%rip), %xmm9 # 0x121a14
movss 0x2b970(%rip), %xmm10 # 0x121a18
movss 0x239a7(%rip), %xmm11 # 0x119a58
movss 0x2b962(%rip), %xmm12 # 0x121a1c
movss 0x2b95d(%rip), %xmm13 # 0x121a20
movq $0x0, 0x28(%rsp)
xorl %edx, %edx
movl $0x0, 0xc(%rsp)
testl %ebx, %ebx
jle 0xf634e
xorl %r14d, %r14d
leaq 0x2d0(%rsp), %rsi
leaq 0x6d0(%rsp), %rdi
movq %rdx, 0x40(%rsp)
movl 0x76a78(%rip), %eax # 0x16cb74
movl %eax, 0x38(%rsp)
movq %rdi, %rdx
movl 0xc(%rsp), %edi
cmpl 0x18(%rsp), %edi
movl 0x24(%rsp), %r8d
movl %r8d, %r9d
cmovll %edi, %r9d
subl %r9d, %r8d
cmpl $0x0, 0x38(%rsp)
cmovel %r9d, %r8d
imull %ebx, %r8d
xorl %r9d, %r9d
movq 0x48(%rsp), %rax
leal (%r14,%r9), %r10d
cmpl %ebx, %r10d
cmovgel %r12d, %r10d
addl %r8d, %r10d
imull %r15d, %r10d
movslq %r10d, %r10
movzbl (%rax,%r10), %r11d
xorps %xmm0, %xmm0
cvtsi2ss %r11d, %xmm0
movzbl (%rbp,%r10), %r11d
xorps %xmm2, %xmm2
cvtsi2ss %r11d, %xmm2
movzbl (%r13,%r10), %r10d
xorps %xmm1, %xmm1
cvtsi2ss %r10d, %xmm1
movaps %xmm2, %xmm3
mulss %xmm5, %xmm3
movaps %xmm0, %xmm4
mulss %xmm6, %xmm4
addss %xmm3, %xmm4
movaps %xmm1, %xmm3
mulss %xmm7, %xmm3
addss %xmm4, %xmm3
addss %xmm8, %xmm3
movss %xmm3, (%rsi,%r9,4)
movaps %xmm2, %xmm3
mulss %xmm9, %xmm3
movaps %xmm0, %xmm4
mulss %xmm10, %xmm4
addss %xmm3, %xmm4
movaps %xmm1, %xmm3
mulss %xmm11, %xmm3
addss %xmm4, %xmm3
movss %xmm3, (%rdx,%r9,4)
mulss %xmm12, %xmm2
mulss %xmm11, %xmm0
addss %xmm2, %xmm0
mulss %xmm13, %xmm1
addss %xmm0, %xmm1
movss %xmm1, (%rcx,%r9,4)
incq %r9
cmpl $0x8, %r9d
jne 0xf612f
incl %edi
addq $0x20, %rsi
addq $0x20, %rdx
addq $0x20, %rcx
cmpl 0x8(%rsp), %edi
jne 0xf6107
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x2d8(%rsp), %rcx
movl $0x8, %r8d
leaq 0xd8(%rsp), %r9
leaq 0x2cfa3(%rip), %rax # 0x1231d0
pushq %rax
leaq 0x2c79b(%rip), %rax # 0x1229d0
pushq %rax
pushq 0x48(%rsp)
callq 0x105878
addq $0x20, %rsp
movq %rax, 0x30(%rsp)
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x6d8(%rsp), %rcx
movl $0x8, %r8d
leaq 0x1d8(%rsp), %r9
leaq 0x2d358(%rip), %rax # 0x1235d0
pushq %rax
leaq 0x2cb50(%rip), %rax # 0x122dd0
pushq %rax
pushq 0x40(%rsp)
callq 0x105878
addq $0x20, %rsp
movq %rax, 0x28(%rsp)
subq $0x8, %rsp
movq 0x18(%rsp), %rdi
leaq 0xc(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0xcd8(%rsp), %rcx
movl $0x8, %r8d
leaq 0x1d8(%rsp), %r9
leaq 0x2d30d(%rip), %rax # 0x1235d0
pushq %rax
leaq 0x2cb05(%rip), %rax # 0x122dd0
pushq %rax
pushq 0x58(%rsp)
callq 0x105878
leaq 0x6f0(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
movss 0x2b732(%rip), %xmm13 # 0x121a20
movss 0x2b725(%rip), %xmm12 # 0x121a1c
movss 0x23758(%rip), %xmm11 # 0x119a58
movss 0x2b70f(%rip), %xmm10 # 0x121a18
movss 0x2b702(%rip), %xmm9 # 0x121a14
movss 0x2b6f5(%rip), %xmm8 # 0x121a10
movss 0x2b6e9(%rip), %xmm7 # 0x121a0c
movss 0x2b6dd(%rip), %xmm6 # 0x121a08
movss 0x2b6d1(%rip), %xmm5 # 0x121a04
leaq 0xcf0(%rsp), %rcx
addq $0x20, %rsp
movl %eax, %edx
addq $0x8, %r14
cmpl %ebx, %r14d
jl 0xf60f1
movl 0xc(%rsp), %eax
addl $0x8, %eax
addl $0x8, 0x8(%rsp)
movl %eax, 0xc(%rsp)
cmpl 0x18(%rsp), %eax
jl 0xf60d6
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
movq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0x7f, %ecx
movl $0x7, %r8d
callq 0x105c91
movq (%r14), %rax
movq 0x8(%r14), %rdi
leaq 0x2d0(%rsp), %rbx
movb $-0x1, (%rbx)
movl $0x1, %ebp
movq %rbx, %rsi
movl $0x1, %edx
callq *%rax
movq (%r14), %rax
movq 0x8(%r14), %rdi
movb $-0x27, (%rbx)
leaq 0x2d0(%rsp), %rsi
movl $0x1, %edx
callq *%rax
movl %ebp, %eax
addq $0x10d8, %rsp # imm = 0x10D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image_write.h |
embree::storeSTB(embree::Ref<embree::Image> const&, embree::FileName const&) | void storeSTB(const Ref<Image>& img, const FileName& fileName)
{
std::string ext = toLowerCase(fileName.ext());
if (ext != "bmp" && ext != "png" && ext != "jpg") {
THROW_RUNTIME_ERROR("Could not store image")
return;
}
int width = int(img->width);
int height = int(img->height);
int channels = 3;
std::vector<unsigned char> pixels(width*height*channels);
const float maxColor = 255.f;
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
Color4 c = img->get(x, y);
pixels[(y*img->width+x)*channels+0] = (unsigned char)(clamp(c.r) * maxColor);
pixels[(y*img->width+x)*channels+1] = (unsigned char)(clamp(c.g) * maxColor);
pixels[(y*img->width+x)*channels+2] = (unsigned char)(clamp(c.b) * maxColor);
}
}
if (ext == "bmp" ) { stbi_write_bmp(fileName.str().c_str(), width, height, channels, pixels.data()); return; }
if (ext == "png" ) { stbi_write_png(fileName.str().c_str(), width, height, channels, pixels.data(), width * channels); return; }
if (ext == "jpg" ) { stbi_write_jpg(fileName.str().c_str(), width, height, channels, pixels.data(), 100); return; }
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movq %rdi, %r12
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x7cafc
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0x117ac8
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf6771
callq 0x14760
leaq 0x2b0d8(%rip), %rsi # 0x121850
leaq 0x58(%rsp), %rdi
callq 0x14240
testl %eax, %eax
je 0xf67b4
leaq 0x23fe8(%rip), %rsi # 0x11a775
leaq 0x58(%rsp), %rdi
callq 0x14240
testl %eax, %eax
je 0xf67b4
leaq 0x2b0b2(%rip), %rsi # 0x121854
leaq 0x58(%rsp), %rdi
callq 0x14240
testl %eax, %eax
jne 0xf6a48
movq %r14, 0x38(%rsp)
movq (%r12), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rbx
movq %rcx, %rax
movq %rcx, 0x8(%rsp)
imull %ebx, %eax
shlq $0x20, %rax
leaq (%rax,%rax,2), %rsi
sarq $0x20, %rsi
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0xcc4f0
movq %rbx, 0x30(%rsp)
testl %ebx, %ebx
jle 0xf68fb
movl $0x7fffffff, %eax # imm = 0x7FFFFFFF
movq 0x30(%rsp), %r14
andq %rax, %r14
movq 0x8(%rsp), %r15
andq %rax, %r15
xorl %r13d, %r13d
leaq 0x10(%rsp), %rbp
cmpl $0x0, 0x8(%rsp)
jle 0xf68ef
xorl %ebx, %ebx
movq (%r12), %rsi
movq (%rsi), %rax
movq %rbp, %rdi
movq %rbx, %rdx
movq %r13, %rcx
callq *0x20(%rax)
movss 0x10(%rsp), %xmm0
movss 0x231fd(%rip), %xmm2 # 0x119a40
minss %xmm2, %xmm0
xorps %xmm1, %xmm1
maxss %xmm0, %xmm1
movss 0x2b0e2(%rip), %xmm3 # 0x121938
mulss %xmm3, %xmm1
cvttss2si %xmm1, %eax
movq (%r12), %rcx
movq 0x10(%rcx), %rcx
imulq %r13, %rcx
addq %rbx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x40(%rsp), %rdx
movb %al, (%rdx,%rcx)
movss 0x14(%rsp), %xmm0
minss %xmm2, %xmm0
xorps %xmm1, %xmm1
maxss %xmm0, %xmm1
mulss %xmm3, %xmm1
cvttss2si %xmm1, %eax
movq (%r12), %rcx
movq 0x10(%rcx), %rcx
imulq %r13, %rcx
addq %rbx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x40(%rsp), %rdx
movb %al, 0x1(%rdx,%rcx)
movss 0x18(%rsp), %xmm0
minss %xmm2, %xmm0
xorps %xmm1, %xmm1
maxss %xmm0, %xmm1
mulss %xmm3, %xmm1
cvttss2si %xmm1, %eax
movq (%r12), %rcx
movq 0x10(%rcx), %rcx
imulq %r13, %rcx
addq %rbx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x40(%rsp), %rdx
movb %al, 0x2(%rdx,%rcx)
incq %rbx
cmpq %rbx, %r15
jne 0xf6822
incq %r13
cmpq %r14, %r13
jne 0xf6815
leaq 0x2af4e(%rip), %rsi # 0x121850
leaq 0x58(%rsp), %rdi
callq 0x14240
testl %eax, %eax
je 0xf6989
leaq 0x23e5e(%rip), %rsi # 0x11a775
leaq 0x58(%rsp), %rdi
callq 0x14240
testl %eax, %eax
leaq 0x20(%rsp), %r14
je 0xf69ca
leaq 0x2af1f(%rip), %rsi # 0x121854
leaq 0x58(%rsp), %rdi
callq 0x14240
testl %eax, %eax
jne 0xf6a17
leaq 0x10(%rsp), %rdi
movq %r14, (%rdi)
movq 0x38(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0x621de
movq 0x10(%rsp), %rdi
movq 0x40(%rsp), %r8
movq 0x8(%rsp), %rsi
movq 0x30(%rsp), %rdx
movl $0x3, %ecx
movl $0x64, %r9d
callq 0xf63d6
jmp 0xf6a08
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %r14
movq %r14, (%rdi)
movq 0x38(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0x621de
movq 0x10(%rsp), %rdi
movq 0x40(%rsp), %r8
movq 0x8(%rsp), %rsi
movq 0x30(%rsp), %rdx
movl $0x3, %ecx
callq 0xf3a4f
jmp 0xf6a08
leaq 0x10(%rsp), %rdi
movq %r14, (%rdi)
movq 0x38(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0x621de
movq 0x10(%rsp), %rdi
movq 0x40(%rsp), %r8
movq 0x8(%rsp), %rsi
leal (%rsi,%rsi,2), %r9d
movq 0x30(%rsp), %rdx
movl $0x3, %ecx
callq 0xf5602
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xf6a17
callq 0x14760
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xf6a26
callq 0x14760
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf6a39
callq 0x14760
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x143c0
movq %rax, %r14
leaq 0x2d20b(%rip), %rsi # 0x123c67
movq %rax, %rdi
callq 0x14300
movq 0x7557d(%rip), %rsi # 0x16bfe8
movq 0x75506(%rip), %rdx # 0x16bf78
movq %r14, %rdi
callq 0x14f60
jmp 0xf6a8f
jmp 0xf6ab4
jmp 0xf6aa5
movq %rax, %rbx
movq %r14, %rdi
callq 0x145f0
jmp 0xf6ac6
jmp 0xf6ab4
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xf6ab7
callq 0x14760
jmp 0xf6ab7
jmp 0xf6ab4
movq %rax, %rbx
jmp 0xf6ac6
movq %rax, %rbx
leaq 0x20(%rsp), %rax
jmp 0xf6acb
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0xf6ac6
callq 0x14760
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xf6ad9
callq 0x14760
movq %rbx, %rdi
callq 0x14fb0
| /embree[P]embree/tutorials/common/image/stb.cpp |
stbi__pic_test(stbi__context*) | static int stbi__pic_test(stbi__context *s)
{
int r = stbi__pic_test_core(s);
stbi__rewind(s);
return r;
} | pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x2a507(%rip), %rsi # 0x123f29
callq 0x1012d8
testl %eax, %eax
je 0xf9a74
movq 0xc0(%rbx), %rax
movl $0x54, %ebp
cmpq 0xc8(%rbx), %rax
jb 0xf9a55
cmpl $0x0, 0x30(%rbx)
je 0xf9a5f
movq %rbx, %rdi
callq 0xfd694
movq 0xc0(%rbx), %rax
incq %rax
movq %rax, 0xc0(%rbx)
decl %ebp
jne 0xf9a37
leaq 0x2a4c4(%rip), %rsi # 0x123f2e
movq %rbx, %rdi
callq 0x1012d8
jmp 0xf9a76
xorl %eax, %eax
movups 0xd0(%rbx), %xmm0
movups %xmm0, 0xc0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi__pnm_load(stbi__context*, int*, int*, int*, int, stbi__result_info*) | static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
{
stbi_uc *out;
STBI_NOTUSED(ri);
ri->bits_per_channel = stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n);
if (ri->bits_per_channel == 0)
return 0;
if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)");
*x = s->img_x;
*y = s->img_y;
if (comp) *comp = s->img_n;
if (!stbi__mad4sizes_valid(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0))
return stbi__errpuc("too large", "PNM too large");
out = (stbi_uc *) stbi__malloc_mad4(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0);
if (!out) return stbi__errpuc("outofmem", "Out of memory");
stbi__getn(s, out, s->img_n * s->img_x * s->img_y * (ri->bits_per_channel / 8));
if (req_comp && req_comp != s->img_n) {
out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y);
if (out == NULL) return out; // stbi__convert_format frees input on failure
}
return out;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r12
movl %r8d, 0x4(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, %rbp
movq %rsi, %r13
movq %rdi, %r14
leaq 0x4(%rdi), %rbx
leaq 0x8(%rdi), %rcx
movq %rdi, %rsi
movq %rbx, %rdx
movq %rcx, %r15
callq 0x103c6e
movl %eax, (%r12)
testl %eax, %eax
je 0xfc2fc
cmpl $0x1000001, (%rbx) # imm = 0x1000001
jae 0xfc2e2
movl (%r14), %eax
cmpl $0x1000001, %eax # imm = 0x1000001
jae 0xfc2e2
movl %eax, (%r13)
movl (%rbx), %eax
movl %eax, (%rbp)
movl %eax, %ebp
movq %r15, 0x8(%rsp)
movl (%r15), %edi
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0xfc25c
movl %edi, (%rax)
movl (%rbx), %ebp
movl (%r14), %r13d
movl (%r12), %eax
leal 0x7(%rax), %ebx
testl %eax, %eax
cmovnsl %eax, %ebx
sarl $0x3, %ebx
movl %edi, %r15d
movl %r13d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x103e2b
testl %eax, %eax
je 0xfc2e2
movl %r15d, %edi
movl %r13d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x103e9b
testq %rax, %rax
je 0xfc311
movq %rax, %r12
imull %r15d, %r13d
imull %ebp, %r13d
imull %ebx, %r13d
movq %r14, %rdi
movq %rax, %rsi
movl %r13d, %edx
callq 0xfeec0
movl 0x4(%rsp), %edx
testl %edx, %edx
je 0xfc2ff
movq 0x8(%rsp), %rax
movl (%rax), %esi
cmpl %edx, %esi
je 0xfc2ff
movl (%r14), %ecx
movl 0x4(%r14), %r8d
movq %r12, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xfe55c
movq %fs:0x0, %rax
leaq 0x279e4(%rip), %rcx # 0x123cd9
movq %rcx, -0x20(%rax)
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %fs:0x0, %rax
leaq 0x27a84(%rip), %rcx # 0x123da8
jmp 0xfc2f5
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi__get8(stbi__context*) | stbi_inline static stbi_uc stbi__get8(stbi__context *s)
{
if (s->img_buffer < s->img_buffer_end)
return *s->img_buffer++;
if (s->read_from_callbacks) {
stbi__refill_buffer(s);
return *s->img_buffer++;
}
return 0;
} | pushq %rbx
movq %rdi, %rbx
movq 0xc0(%rdi), %rax
cmpq 0xc8(%rdi), %rax
jb 0xfd681
cmpl $0x0, 0x30(%rbx)
je 0xfd690
movq %rbx, %rdi
callq 0xfd694
movq 0xc0(%rbx), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0xc0(%rbx)
movb (%rax), %al
popq %rbx
retq
xorl %eax, %eax
jmp 0xfd68e
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi__getn(stbi__context*, unsigned char*, int) | static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n)
{
if (s->io.read) {
int blen = (int) (s->img_buffer_end - s->img_buffer);
if (blen < n) {
int res, count;
memcpy(buffer, s->img_buffer, blen);
count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen);
res = (count == (n-blen));
s->img_buffer = s->img_buffer_end;
return res;
}
}
if (s->img_buffer+n <= s->img_buffer_end) {
memcpy(buffer, s->img_buffer, n);
s->img_buffer += n;
return 1;
} else
return 0;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x0, 0x10(%rdi)
je 0xfef24
movq 0xc0(%rbx), %rsi
movq 0xc8(%rbx), %rcx
movq %rcx, %rax
subq %rsi, %rax
movl %edx, %ebp
subl %eax, %ebp
jle 0xfef32
movslq %eax, %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x14690
movq 0x28(%rbx), %rdi
addq %r15, %r14
movq %r14, %rsi
movl %ebp, %edx
callq *0x10(%rbx)
movl %eax, %ecx
xorl %eax, %eax
cmpl %ebp, %ecx
sete %al
movq 0xc8(%rbx), %rcx
movq %rcx, 0xc0(%rbx)
jmp 0xfef57
movq 0xc0(%rbx), %rsi
movq 0xc8(%rbx), %rcx
movslq %edx, %r15
leaq (%rsi,%r15), %rdx
xorl %eax, %eax
cmpq %rcx, %rdx
ja 0xfef57
movq %r14, %rdi
movq %r15, %rdx
callq 0x14690
addq %r15, 0xc0(%rbx)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi__compute_transparency16(stbi__png*, unsigned short*, int) | static int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3], int out_n)
{
stbi__context *s = z->s;
stbi__uint32 i, pixel_count = s->img_x * s->img_y;
stbi__uint16 *p = (stbi__uint16*) z->out;
// compute color-based transparency, assuming we've
// already got 65535 as the alpha value in the output
STBI_ASSERT(out_n == 2 || out_n == 4);
if (out_n == 2) {
for (i = 0; i < pixel_count; ++i) {
p[1] = (p[0] == tc[0] ? 0 : 65535);
p += 2;
}
} else {
for (i = 0; i < pixel_count; ++i) {
if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])
p[3] = 0;
p += 4;
}
}
return 1;
} | imull %esi, %edi
cmpl $0x2, %r8d
jne 0xfef93
testl %edi, %edi
je 0xfefc8
movl %edi, %eax
xorl %esi, %esi
movzwl (%rdx,%rsi,4), %edi
xorl %r8d, %r8d
cmpw (%rcx), %di
setne %r8b
negl %r8d
movw %r8w, 0x2(%rdx,%rsi,4)
incq %rsi
cmpl %esi, %eax
jne 0xfef73
jmp 0xfefc8
testl %edi, %edi
je 0xfefc8
movl %edi, %eax
xorl %esi, %esi
movzwl (%rdx,%rsi,8), %edi
cmpw (%rcx), %di
jne 0xfefc1
movzwl 0x2(%rdx,%rsi,8), %edi
cmpw 0x2(%rcx), %di
jne 0xfefc1
movzwl 0x4(%rdx,%rsi,8), %edi
cmpw 0x4(%rcx), %di
jne 0xfefc1
movw $0x0, 0x6(%rdx,%rsi,8)
incq %rsi
cmpl %esi, %eax
jne 0xfef9b
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi__compute_transparency(stbi__png*, unsigned char*, int) | static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n)
{
stbi__context *s = z->s;
stbi__uint32 i, pixel_count = s->img_x * s->img_y;
stbi_uc *p = z->out;
// compute color-based transparency, assuming we've
// already got 255 as the alpha value in the output
STBI_ASSERT(out_n == 2 || out_n == 4);
if (out_n == 2) {
for (i=0; i < pixel_count; ++i) {
p[1] = (p[0] == tc[0] ? 0 : 255);
p += 2;
}
} else {
for (i=0; i < pixel_count; ++i) {
if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])
p[3] = 0;
p += 4;
}
}
return 1;
} | imull %esi, %edi
cmpl $0x2, %r8d
jne 0xfeff6
testl %edi, %edi
je 0xff029
movl %edi, %eax
xorl %esi, %esi
movb (%rdx,%rsi,2), %dil
cmpb (%rcx), %dil
setne %dil
negb %dil
movb %dil, 0x1(%rdx,%rsi,2)
incq %rsi
cmpl %esi, %eax
jne 0xfefda
jmp 0xff029
testl %edi, %edi
je 0xff029
movl %edi, %eax
xorl %esi, %esi
movb (%rdx,%rsi,4), %dil
cmpb (%rcx), %dil
jne 0xff022
movb 0x1(%rdx,%rsi,4), %dil
cmpb 0x1(%rcx), %dil
jne 0xff022
movb 0x2(%rdx,%rsi,4), %dil
cmpb 0x2(%rcx), %dil
jne 0xff022
movb $0x0, 0x3(%rdx,%rsi,4)
incq %rsi
cmpl %esi, %eax
jne 0xfeffe
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
stbi__de_iphone(stbi__png*) | static void stbi__de_iphone(stbi__png *z)
{
stbi__context *s = z->s;
stbi__uint32 i, pixel_count = s->img_x * s->img_y;
stbi_uc *p = z->out;
if (s->img_out_n == 3) { // convert bgr to rgb
for (i=0; i < pixel_count; ++i) {
stbi_uc t = p[0];
p[0] = p[2];
p[2] = t;
p += 3;
}
} else {
STBI_ASSERT(s->img_out_n == 4);
if (stbi__unpremultiply_on_load) {
// convert bgr to rgb and unpremultiply
for (i=0; i < pixel_count; ++i) {
stbi_uc a = p[3];
stbi_uc t = p[0];
if (a) {
stbi_uc half = a / 2;
p[0] = (p[2] * 255 + half) / a;
p[1] = (p[1] * 255 + half) / a;
p[2] = ( t * 255 + half) / a;
} else {
p[0] = p[2];
p[2] = t;
}
p += 4;
}
} else {
// convert bgr to rgb
for (i=0; i < pixel_count; ++i) {
stbi_uc t = p[0];
p[0] = p[2];
p[2] = t;
p += 4;
}
}
}
} | pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x4(%rdi), %ebp
imull (%rdi), %ebp
cmpl $0x3, 0xc(%rdi)
jne 0xff05b
testl %ebp, %ebp
je 0xff120
movb (%rbx), %al
movb 0x2(%rbx), %cl
movb %cl, (%rbx)
movb %al, 0x2(%rbx)
addq $0x3, %rbx
decl %ebp
jne 0xff044
jmp 0xff120
movq %fs:0x0, %rax
cmpl $0x0, -0xc(%rax)
leaq -0x10(%rax), %rax
leaq 0x6daf0(%rip), %rcx # 0x16cb6c
cmovneq %rax, %rcx
cmpl $0x0, (%rcx)
je 0xff101
testl %ebp, %ebp
je 0xff120
movl %ebp, %ecx
xorl %esi, %esi
movzbl 0x3(%rbx,%rsi,4), %edi
movb (%rbx,%rsi,4), %al
testl %edi, %edi
je 0xff0ed
movzbl %al, %r9d
movl %edi, %r8d
shrl %r8d
movzbl 0x2(%rbx,%rsi,4), %edx
movl %edx, %eax
shll $0x8, %eax
subl %edx, %eax
addl %r8d, %eax
xorl %edx, %edx
divw %di
movb %al, (%rbx,%rsi,4)
movzbl 0x1(%rbx,%rsi,4), %edx
movl %edx, %eax
shll $0x8, %eax
subl %edx, %eax
addl %r8d, %eax
xorl %edx, %edx
divw %di
movb %al, 0x1(%rbx,%rsi,4)
movl %r9d, %eax
shll $0x8, %eax
subl %r9d, %eax
addl %r8d, %eax
xorl %edx, %edx
divw %di
movb %al, 0x2(%rbx,%rsi,4)
jmp 0xff0f8
movb 0x2(%rbx,%rsi,4), %dl
movb %dl, (%rbx,%rsi,4)
movb %al, 0x2(%rbx,%rsi,4)
incq %rsi
cmpl %esi, %ecx
jne 0xff091
jmp 0xff120
testl %ebp, %ebp
je 0xff120
movl %ebp, %eax
xorl %ecx, %ecx
movb (%rbx,%rcx,4), %dl
movb 0x2(%rbx,%rcx,4), %sil
movb %sil, (%rbx,%rcx,4)
movb %dl, 0x2(%rbx,%rcx,4)
incq %rcx
cmpl %ecx, %eax
jne 0xff109
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/stb_image.h |
InitEXRImage | void InitEXRImage(EXRImage *exr_image) {
if (exr_image == NULL) {
return;
}
exr_image->width = 0;
exr_image->height = 0;
exr_image->num_channels = 0;
exr_image->images = NULL;
exr_image->tiles = NULL;
exr_image->next_level = NULL;
exr_image->level_x = 0;
exr_image->level_y = 0;
exr_image->num_tiles = 0;
} | testq %rdi, %rdi
je 0x1072b8
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
retq
| /embree[P]embree/tutorials/common/image/tinyexr.h |
ParseEXRVersionFromMemory | int ParseEXRVersionFromMemory(EXRVersion *version, const unsigned char *memory,
size_t size) {
if (version == NULL || memory == NULL) {
return TINYEXR_ERROR_INVALID_ARGUMENT;
}
if (size < tinyexr::kEXRVersionSize) {
return TINYEXR_ERROR_INVALID_DATA;
}
const unsigned char *marker = memory;
// Header check.
{
const char header[] = {0x76, 0x2f, 0x31, 0x01};
if (memcmp(marker, header, 4) != 0) {
return TINYEXR_ERROR_INVALID_MAGIC_NUMBER;
}
marker += 4;
}
version->tiled = false;
version->long_name = false;
version->non_image = false;
version->multipart = false;
// Parse version header.
{
// must be 2
if (marker[0] != 2) {
return TINYEXR_ERROR_INVALID_EXR_VERSION;
}
if (version == NULL) {
return TINYEXR_SUCCESS; // May OK
}
version->version = 2;
if (marker[1] & 0x2) { // 9th bit
version->tiled = true;
}
if (marker[1] & 0x4) { // 10th bit
version->long_name = true;
}
if (marker[1] & 0x8) { // 11th bit
version->non_image = true; // (deep image)
}
if (marker[1] & 0x10) { // 12th bit
version->multipart = true;
}
}
return TINYEXR_SUCCESS;
} | testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
movl $0xfffffffd, %eax # imm = 0xFFFFFFFD
jne 0x1076eb
movl $0xfffffffc, %eax # imm = 0xFFFFFFFC
cmpq $0x8, %rdx
jb 0x1076eb
cmpl $0x1312f76, (%rsi) # imm = 0x1312F76
movl $0xffffffff, %eax # imm = 0xFFFFFFFF
je 0x1076ec
retq
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rdi)
movl $0xfffffffe, %eax # imm = 0xFFFFFFFE
cmpb $0x2, 0x4(%rsi)
jne 0x1076eb
movl $0x2, (%rdi)
movb 0x5(%rsi), %cl
testb $0x2, %cl
je 0x107719
leaq 0x4(%rdi), %rax
movl $0x1, (%rax)
movb 0x5(%rsi), %cl
testb $0x4, %cl
je 0x107728
movl $0x1, 0x8(%rdi)
movb 0x5(%rsi), %cl
testb $0x8, %cl
je 0x107737
movl $0x1, 0xc(%rdi)
movb 0x5(%rsi), %cl
xorl %eax, %eax
testb $0x10, %cl
je 0x1076eb
movl $0x1, 0x10(%rdi)
retq
| /embree[P]embree/tutorials/common/image/tinyexr.h |
tinyexr::ConvertHeader(TEXRHeader*, tinyexr::HeaderInfo const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*) | static bool ConvertHeader(EXRHeader *exr_header, const HeaderInfo &info, std::string *warn, std::string *err) {
exr_header->pixel_aspect_ratio = info.pixel_aspect_ratio;
exr_header->screen_window_center[0] = info.screen_window_center[0];
exr_header->screen_window_center[1] = info.screen_window_center[1];
exr_header->screen_window_width = info.screen_window_width;
exr_header->chunk_count = info.chunk_count;
exr_header->display_window.min_x = info.display_window.min_x;
exr_header->display_window.min_y = info.display_window.min_y;
exr_header->display_window.max_x = info.display_window.max_x;
exr_header->display_window.max_y = info.display_window.max_y;
exr_header->data_window.min_x = info.data_window.min_x;
exr_header->data_window.min_y = info.data_window.min_y;
exr_header->data_window.max_x = info.data_window.max_x;
exr_header->data_window.max_y = info.data_window.max_y;
exr_header->line_order = info.line_order;
exr_header->compression_type = info.compression_type;
exr_header->tiled = info.tiled;
exr_header->tile_size_x = info.tile_size_x;
exr_header->tile_size_y = info.tile_size_y;
exr_header->tile_level_mode = info.tile_level_mode;
exr_header->tile_rounding_mode = info.tile_rounding_mode;
EXRSetNameAttr(exr_header, info.name.c_str());
if (!info.type.empty()) {
bool valid = true;
if (info.type == "scanlineimage") {
if (exr_header->tiled) {
if (err) {
(*err) += "(ConvertHeader) tiled bit must be off for `scanlineimage` type.\n";
}
valid = false;
}
} else if (info.type == "tiledimage") {
if (!exr_header->tiled) {
if (err) {
(*err) += "(ConvertHeader) tiled bit must be on for `tiledimage` type.\n";
}
valid = false;
}
} else if (info.type == "deeptile") {
exr_header->non_image = 1;
if (!exr_header->tiled) {
if (err) {
(*err) += "(ConvertHeader) tiled bit must be on for `deeptile` type.\n";
}
valid = false;
}
} else if (info.type == "deepscanline") {
exr_header->non_image = 1;
if (exr_header->tiled) {
if (err) {
(*err) += "(ConvertHeader) tiled bit must be off for `deepscanline` type.\n";
}
//valid = false;
}
} else {
if (warn) {
std::stringstream ss;
ss << "(ConvertHeader) Unsupported or unknown info.type: " << info.type << "\n";
(*warn) += ss.str();
}
}
if (!valid) {
return false;
}
}
exr_header->num_channels = static_cast<int>(info.channels.size());
exr_header->channels = static_cast<EXRChannelInfo *>(malloc(
sizeof(EXRChannelInfo) * static_cast<size_t>(exr_header->num_channels)));
for (size_t c = 0; c < static_cast<size_t>(exr_header->num_channels); c++) {
#ifdef _MSC_VER
strncpy_s(exr_header->channels[c].name, info.channels[c].name.c_str(), 255);
#else
strncpy(exr_header->channels[c].name, info.channels[c].name.c_str(), 255);
#endif
// manually add '\0' for safety.
exr_header->channels[c].name[255] = '\0';
exr_header->channels[c].pixel_type = info.channels[c].pixel_type;
exr_header->channels[c].p_linear = info.channels[c].p_linear;
exr_header->channels[c].x_sampling = info.channels[c].x_sampling;
exr_header->channels[c].y_sampling = info.channels[c].y_sampling;
}
exr_header->pixel_types = static_cast<int *>(
malloc(sizeof(int) * static_cast<size_t>(exr_header->num_channels)));
for (size_t c = 0; c < static_cast<size_t>(exr_header->num_channels); c++) {
exr_header->pixel_types[c] = info.channels[c].pixel_type;
}
// Initially fill with values of `pixel_types`
exr_header->requested_pixel_types = static_cast<int *>(
malloc(sizeof(int) * static_cast<size_t>(exr_header->num_channels)));
for (size_t c = 0; c < static_cast<size_t>(exr_header->num_channels); c++) {
exr_header->requested_pixel_types[c] = info.channels[c].pixel_type;
}
exr_header->num_custom_attributes = static_cast<int>(info.attributes.size());
if (exr_header->num_custom_attributes > 0) {
// TODO(syoyo): Report warning when # of attributes exceeds
// `TINYEXR_MAX_CUSTOM_ATTRIBUTES`
if (exr_header->num_custom_attributes > TINYEXR_MAX_CUSTOM_ATTRIBUTES) {
exr_header->num_custom_attributes = TINYEXR_MAX_CUSTOM_ATTRIBUTES;
}
exr_header->custom_attributes = static_cast<EXRAttribute *>(malloc(
sizeof(EXRAttribute) * size_t(exr_header->num_custom_attributes)));
for (size_t i = 0; i < size_t(exr_header->num_custom_attributes); i++) {
memcpy(exr_header->custom_attributes[i].name, info.attributes[i].name,
256);
memcpy(exr_header->custom_attributes[i].type, info.attributes[i].type,
256);
exr_header->custom_attributes[i].size = info.attributes[i].size;
// Just copy pointer
exr_header->custom_attributes[i].value = info.attributes[i].value;
}
} else {
exr_header->custom_attributes = NULL;
}
exr_header->header_len = info.header_len;
return true;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp # imm = 0x1A8
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movss 0x60(%rsi), %xmm0
movss %xmm0, (%rdi)
movss 0x54(%rsi), %xmm0
movss %xmm0, 0x28(%rdi)
movss 0x58(%rsi), %xmm0
movss %xmm0, 0x2c(%rdi)
movss 0x5c(%rsi), %xmm0
movss %xmm0, 0x30(%rdi)
movl 0x64(%rsi), %eax
movl %eax, 0x34(%rdi)
movl 0x44(%rsi), %eax
movl %eax, 0x18(%rdi)
movl 0x48(%rsi), %eax
movl %eax, 0x1c(%rdi)
movl 0x4c(%rsi), %eax
movl %eax, 0x20(%rdi)
movl 0x50(%rsi), %eax
movl %eax, 0x24(%rdi)
movl 0x30(%rsi), %eax
movl %eax, 0x8(%rdi)
movl 0x34(%rsi), %eax
movl %eax, 0xc(%rdi)
movl 0x38(%rsi), %eax
movl %eax, 0x10(%rdi)
movl 0x3c(%rsi), %eax
movl %eax, 0x14(%rdi)
movl 0x40(%rsi), %eax
movl %eax, 0x4(%rdi)
movl 0x80(%rsi), %eax
movl %eax, 0x7c(%rdi)
movl 0x68(%rsi), %eax
movl %eax, 0x38(%rdi)
movl 0x6c(%rsi), %eax
movl %eax, 0x3c(%rdi)
movl 0x70(%rsi), %eax
movl %eax, 0x40(%rdi)
movl 0x74(%rsi), %eax
movl %eax, 0x44(%rdi)
movl 0x78(%rsi), %eax
movl %eax, 0x48(%rdi)
movq 0x88(%rsi), %rsi
callq 0x10cd7f
cmpq $0x0, 0xb0(%r14)
je 0x108a44
leaq 0xa8(%r14), %r13
leaq 0x1c44d(%rip), %rsi # 0x124d24
movq %r13, %rdi
callq 0x14240
testl %eax, %eax
je 0x1089d3
leaq 0x1c485(%rip), %rsi # 0x124d73
movq %r13, %rdi
callq 0x14240
testl %eax, %eax
je 0x1089e7
leaq 0x1c4b6(%rip), %rsi # 0x124dbb
movq %r13, %rdi
callq 0x14240
testl %eax, %eax
je 0x1089fb
leaq 0x1c4e3(%rip), %rsi # 0x124dff
movq %r13, %rdi
callq 0x14240
testl %eax, %eax
je 0x108a23
testq %r15, %r15
je 0x108a44
leaq 0x20(%rsp), %rdi
callq 0x145d0
leaq 0x30(%rsp), %r12
leaq 0x1c501(%rip), %rsi # 0x124e4c
movl $0x32, %edx
movq %r12, %rdi
callq 0x14900
movq 0xa8(%r14), %rsi
movq 0xb0(%r14), %rdx
movq %r12, %rdi
callq 0x14900
leaq 0x13144(%rip), %rsi # 0x11bab9
movl $0x1, %edx
movq %rax, %rdi
callq 0x14900
leaq 0x38(%rsp), %rsi
movq %rsp, %rdi
callq 0x14e20
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rdi
callq 0x14270
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1089b3
callq 0x14760
movq 0x6356e(%rip), %rsi # 0x16bf28
leaq 0x20(%rsp), %rdi
callq 0x14610
leaq 0xa0(%rsp), %rdi
callq 0x14290
jmp 0x108a44
cmpl $0x0, 0x38(%rbx)
je 0x108a44
testq %r12, %r12
je 0x108a1c
leaq 0x1c34d(%rip), %rsi # 0x124d32
jmp 0x108a14
cmpl $0x0, 0x38(%rbx)
jne 0x108a44
testq %r12, %r12
je 0x108a1c
leaq 0x1c385(%rip), %rsi # 0x124d7e
jmp 0x108a14
movl $0x1, 0x50(%rbx)
cmpl $0x0, 0x38(%rbx)
jne 0x108a44
testq %r12, %r12
je 0x108a1c
leaq 0x1c3b0(%rip), %rsi # 0x124dc4
movq %r12, %rdi
callq 0x15190
xorl %eax, %eax
jmp 0x108c8f
movl $0x1, 0x50(%rbx)
testq %r12, %r12
je 0x108a44
cmpl $0x0, 0x38(%rbx)
je 0x108a44
leaq 0x1c3d0(%rip), %rsi # 0x124e0c
movq %r12, %rdi
callq 0x15190
movq 0x8(%r14), %rax
subq (%r14), %rax
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %rcx
movl %ecx, 0x78(%rbx)
movslq %ecx, %r15
imulq $0x110, %r15, %rdi # imm = 0x110
callq 0x14b30
movq %rax, 0x68(%rbx)
testl %r15d, %r15d
je 0x108b24
xorl %r15d, %r15d
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x68(%rbx), %rdi
addq %r12, %rdi
movq (%r14), %rax
movq (%rax,%r15), %rsi
movl $0xff, %edx
callq 0x14410
movq 0x68(%rbx), %rax
movb $0x0, 0xff(%rax,%r12)
movq (%r14), %rax
movl 0x20(%rax,%r15), %eax
movq 0x68(%rbx), %rcx
movl %eax, 0x100(%rcx,%r12)
movq (%r14), %rax
movb 0x30(%rax,%r15), %al
movq 0x68(%rbx), %rcx
movb %al, 0x10c(%rcx,%r12)
movq (%r14), %rax
movl 0x28(%rax,%r15), %eax
movq 0x68(%rbx), %rcx
movl %eax, 0x104(%rcx,%r12)
movq (%r14), %rax
movl 0x2c(%rax,%r15), %eax
movq 0x68(%rbx), %rcx
movl %eax, 0x108(%rcx,%r12)
incq %r13
movslq 0x78(%rbx), %rax
addq $0x110, %r12 # imm = 0x110
addq $0x38, %r15
cmpq %rax, %r13
jb 0x108a85
movq %rax, %rdi
shlq $0x2, %rdi
testl %eax, %eax
sete %bpl
jmp 0x108b29
movb $0x1, %bpl
xorl %edi, %edi
callq 0x14b30
movq %rax, 0x70(%rbx)
testb %bpl, %bpl
je 0x108b47
xorl %edi, %edi
callq 0x14b30
movq %rax, 0x80(%rbx)
jmp 0x108baa
movl $0x8, %eax
xorl %ecx, %ecx
movq (%r14), %rdx
movl (%rdx,%rax,4), %edx
movq 0x70(%rbx), %rsi
movl %edx, (%rsi,%rcx,4)
incq %rcx
movslq 0x78(%rbx), %r15
addq $0xe, %rax
cmpq %r15, %rcx
jb 0x108b4e
movq %r15, %rdi
shlq $0x2, %rdi
callq 0x14b30
movq %rax, 0x80(%rbx)
testl %r15d, %r15d
je 0x108baa
movl $0x8, %eax
xorl %ecx, %ecx
movq (%r14), %rdx
movl (%rdx,%rax,4), %edx
movq 0x80(%rbx), %rsi
movl %edx, (%rsi,%rcx,4)
incq %rcx
movslq 0x78(%rbx), %rdx
addq $0xe, %rax
cmpq %rdx, %rcx
jb 0x108b8a
movq 0x20(%r14), %rcx
subq 0x18(%r14), %rcx
sarq $0x4, %rcx
movabsq $0xf83e0f83e0f83e1, %rax # imm = 0xF83E0F83E0F83E1
imulq %rcx, %rax
movl %eax, 0x5c(%rbx)
testl %eax, %eax
jle 0x108c7e
cmpl $0x81, %eax
jb 0x108be2
movl $0x80, 0x5c(%rbx)
movl $0x80, %eax
andl $0x7fffffff, %eax # imm = 0x7FFFFFFF
imulq $0x210, %rax, %rdi # imm = 0x210
callq 0x14b30
movq %rax, 0x60(%rbx)
xorl %r15d, %r15d
movl $0x100, %r12d # imm = 0x100
xorl %r13d, %r13d
movq 0x60(%rbx), %rdi
addq %r15, %rdi
movq 0x18(%r14), %rsi
addq %r15, %rsi
movl $0x100, %edx # imm = 0x100
callq 0x14690
movq 0x60(%rbx), %rdi
addq %r15, %rdi
addq %r12, %rdi
movq 0x18(%r14), %rsi
addq %r15, %rsi
addq %r12, %rsi
movl $0x100, %edx # imm = 0x100
callq 0x14690
movq 0x18(%r14), %rax
movl 0x208(%rax,%r15), %eax
movq 0x60(%rbx), %rcx
movl %eax, 0x208(%rcx,%r15)
movq 0x18(%r14), %rax
movq 0x200(%rax,%r15), %rax
movq 0x60(%rbx), %rcx
movq %rax, 0x200(%rcx,%r15)
incq %r13
movslq 0x5c(%rbx), %rax
addq $0x210, %r15 # imm = 0x210
cmpq %rax, %r13
jb 0x108c03
jmp 0x108c86
movq $0x0, 0x60(%rbx)
movl 0x7c(%r14), %eax
movl %eax, 0x58(%rbx)
movb $0x1, %al
addq $0x1a8, %rsp # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x108cbe
callq 0x14760
jmp 0x108cbe
jmp 0x108cbb
movq %rax, %rbx
movq 0x63263(%rip), %rsi # 0x16bf28
leaq 0x20(%rsp), %rdi
callq 0x14610
leaq 0xa0(%rsp), %rdi
callq 0x14290
movq %rbx, %rdi
callq 0x14fb0
| /embree[P]embree/tutorials/common/image/tinyexr.h |
SaveEXRImageToFile | int SaveEXRImageToFile(const EXRImage *exr_image, const EXRHeader *exr_header,
const char *filename, const char **err) {
if (exr_image == NULL || filename == NULL ||
exr_header->compression_type < 0) {
tinyexr::SetErrorMessage("Invalid argument for SaveEXRImageToFile", err);
return TINYEXR_ERROR_INVALID_ARGUMENT;
}
#if !TINYEXR_USE_PIZ
if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
tinyexr::SetErrorMessage("PIZ compression is not supported in this build",
err);
return TINYEXR_ERROR_UNSUPPORTED_FEATURE;
}
#endif
#if !TINYEXR_USE_ZFP
if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
tinyexr::SetErrorMessage("ZFP compression is not supported in this build",
err);
return TINYEXR_ERROR_UNSUPPORTED_FEATURE;
}
#endif
FILE *fp = NULL;
#ifdef _WIN32
#if defined(_MSC_VER) || (defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) // MSVC, MinGW GCC, or Clang
errno_t errcode =
_wfopen_s(&fp, tinyexr::UTF8ToWchar(filename).c_str(), L"wb");
if (errcode != 0) {
tinyexr::SetErrorMessage("Cannot write a file: " + std::string(filename),
err);
return TINYEXR_ERROR_CANT_WRITE_FILE;
}
#else
// Unknown compiler or MinGW without MINGW_HAS_SECURE_API.
fp = fopen(filename, "wb");
#endif
#else
fp = fopen(filename, "wb");
#endif
if (!fp) {
tinyexr::SetErrorMessage("Cannot write a file: " + std::string(filename),
err);
return TINYEXR_ERROR_CANT_WRITE_FILE;
}
unsigned char *mem = NULL;
size_t mem_size = SaveEXRImageToMemory(exr_image, exr_header, &mem, err);
if (mem_size == 0) {
return TINYEXR_ERROR_SERIALIZATION_FAILED;
}
size_t written_size = 0;
if ((mem_size > 0) && mem) {
written_size = fwrite(mem, 1, mem_size, fp);
}
free(mem);
fclose(fp);
if (written_size != mem_size) {
tinyexr::SetErrorMessage("Cannot write a file", err);
return TINYEXR_ERROR_CANT_WRITE_FILE;
}
return TINYEXR_SUCCESS;
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rcx, %rbx
testq %rdi, %rdi
sete %al
testq %rdx, %rdx
sete %cl
orb %al, %cl
jne 0x10b47d
movq %rsi, %r13
movl 0x7c(%rsi), %eax
testl %eax, %eax
js 0x10b47d
cmpl $0x80, %eax
jne 0x10b4d8
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x19152(%rip), %rsi # 0x124593
leaq 0x19179(%rip), %rdx # 0x1245c1
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x62274
movq (%r14), %r14
testq %rbx, %rbx
je 0x10b468
movq %r14, %rdi
callq 0x15080
movq %rax, (%rbx)
cmpq %r15, %r14
je 0x10b475
movq %r14, %rdi
callq 0x14760
movl $0xfffffff6, %r14d # imm = 0xFFFFFFF6
jmp 0x10b4c7
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x190de(%rip), %rsi # 0x12456b
leaq 0x190fe(%rip), %rdx # 0x124592
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x62274
movq (%r14), %r14
testq %rbx, %rbx
je 0x10b4b4
movq %r14, %rdi
callq 0x15080
movq %rax, (%rbx)
cmpq %r15, %r14
je 0x10b4c1
movq %r14, %rdi
callq 0x14760
movl $0xfffffffd, %r14d # imm = 0xFFFFFFFD
movl %r14d, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rdx, %r14
movq %rdi, %r12
leaq 0x1876f(%rip), %rsi # 0x123c54
movq %rdx, %rdi
callq 0x14980
testq %rax, %rax
je 0x10b548
movq %rax, %r15
leaq 0x30(%rsp), %rcx
movq $0x0, (%rcx)
leaq 0x10(%rsp), %rsi
movq %r13, (%rsi)
movq %r12, %rdi
movl $0x1, %edx
movq %rbx, %r8
callq 0x109b74
testq %rax, %rax
je 0x10b59d
movq %rax, %r12
movq 0x30(%rsp), %rdi
xorl %r14d, %r14d
testq %rdi, %rdi
je 0x10b5a8
movl $0x1, %esi
movq %r12, %rdx
movq %r15, %rcx
callq 0x151c0
movq %rax, %r13
movq 0x30(%rsp), %rdi
jmp 0x10b5ad
leaq 0x30(%rsp), %r15
leaq 0xf(%rsp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x14310
leaq 0x1905e(%rip), %rcx # 0x1245c2
movl $0x15, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x148d0
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %r14
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %r14
je 0x10b604
movq %r14, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x10b60e
movl $0xfffffff4, %r14d # imm = 0xFFFFFFF4
jmp 0x10b4c7
xorl %edi, %edi
xorl %r13d, %r13d
callq 0x149b0
movq %r15, %rdi
callq 0x147c0
cmpq %r12, %r13
je 0x10b4c7
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x19005(%rip), %rsi # 0x1245d8
leaq 0x19011(%rip), %rdx # 0x1245eb
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x62274
movq (%r14), %r14
testq %rbx, %rbx
je 0x10b5fa
movq %r14, %rdi
callq 0x15080
movq %rax, (%rbx)
cmpq %r15, %r14
je 0x10b656
movq %r14, %rdi
jmp 0x10b651
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq %r15, %r14
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
testq %rbx, %rbx
je 0x10b636
movq %r14, %rdi
callq 0x15080
movq %rax, (%rbx)
cmpq %r15, %r14
je 0x10b643
movq %r14, %rdi
callq 0x14760
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10b656
callq 0x14760
movl $0xfffffff5, %r14d # imm = 0xFFFFFFF5
jmp 0x10b4c7
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10b677
callq 0x14760
movq %rbx, %rdi
callq 0x14fb0
| /embree[P]embree/tutorials/common/image/tinyexr.h |
EXRNumLevels | int EXRNumLevels(const EXRImage* exr_image) {
if (exr_image == NULL) return 0;
if(exr_image->images) return 1; // scanlines
int levels = 1;
const EXRImage* level_image = exr_image;
while((level_image = level_image->next_level)) ++levels;
return levels;
} | testq %rdi, %rdi
je 0x10cdee
movl $0x1, %eax
cmpq $0x0, 0x18(%rdi)
je 0x10cdf1
retq
xorl %eax, %eax
retq
xorl %eax, %eax
movq 0x8(%rdi), %rdi
incl %eax
testq %rdi, %rdi
jne 0x10cdf3
jmp 0x10cded
| /embree[P]embree/tutorials/common/image/tinyexr.h |
ParseEXRMultipartHeaderFromMemory | int ParseEXRMultipartHeaderFromMemory(EXRHeader ***exr_headers,
int *num_headers,
const EXRVersion *exr_version,
const unsigned char *memory, size_t size,
const char **err) {
if (memory == NULL || exr_headers == NULL || num_headers == NULL ||
exr_version == NULL) {
// Invalid argument
tinyexr::SetErrorMessage(
"Invalid argument for ParseEXRMultipartHeaderFromMemory", err);
return TINYEXR_ERROR_INVALID_ARGUMENT;
}
if (size < tinyexr::kEXRVersionSize) {
tinyexr::SetErrorMessage("Data size too short", err);
return TINYEXR_ERROR_INVALID_DATA;
}
const unsigned char *marker = memory + tinyexr::kEXRVersionSize;
size_t marker_size = size - tinyexr::kEXRVersionSize;
std::vector<tinyexr::HeaderInfo> infos;
for (;;) {
tinyexr::HeaderInfo info;
info.clear();
std::string err_str;
bool empty_header = false;
int ret = ParseEXRHeader(&info, &empty_header, exr_version, &err_str,
marker, marker_size);
if (ret != TINYEXR_SUCCESS) {
// Free malloc-allocated memory here.
for (size_t i = 0; i < info.attributes.size(); i++) {
if (info.attributes[i].value) {
free(info.attributes[i].value);
}
}
tinyexr::SetErrorMessage(err_str, err);
return ret;
}
if (empty_header) {
marker += 1; // skip '\0'
break;
}
// `chunkCount` must exist in the header.
if (info.chunk_count == 0) {
// Free malloc-allocated memory here.
for (size_t i = 0; i < info.attributes.size(); i++) {
if (info.attributes[i].value) {
free(info.attributes[i].value);
}
}
tinyexr::SetErrorMessage(
"`chunkCount' attribute is not found in the header.", err);
return TINYEXR_ERROR_INVALID_DATA;
}
infos.push_back(info);
// move to next header.
marker += info.header_len;
size -= info.header_len;
}
// allocate memory for EXRHeader and create array of EXRHeader pointers.
(*exr_headers) =
static_cast<EXRHeader **>(malloc(sizeof(EXRHeader *) * infos.size()));
int retcode = TINYEXR_SUCCESS;
for (size_t i = 0; i < infos.size(); i++) {
EXRHeader *exr_header = static_cast<EXRHeader *>(malloc(sizeof(EXRHeader)));
memset(exr_header, 0, sizeof(EXRHeader));
std::string warn;
std::string _err;
if (!ConvertHeader(exr_header, infos[i], &warn, &_err)) {
// Free malloc-allocated memory here.
for (size_t k = 0; k < infos[i].attributes.size(); i++) {
if (infos[i].attributes[k].value) {
free(infos[i].attributes[k].value);
}
}
if (!_err.empty()) {
tinyexr::SetErrorMessage(
_err, err);
}
// continue to converting headers
retcode = TINYEXR_ERROR_INVALID_HEADER;
}
exr_header->multipart = exr_version->multipart ? 1 : 0;
(*exr_headers)[i] = exr_header;
}
(*num_headers) = static_cast<int>(infos.size());
return retcode;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp # imm = 0x158
movq %r9, %r15
movq %rcx, %xmm0
movq %rdi, %xmm1
punpcklqdq %xmm0, %xmm1 # xmm1 = xmm1[0],xmm0[0]
movq %rdx, %xmm0
movq %rsi, %xmm2
punpcklqdq %xmm0, %xmm2 # xmm2 = xmm2[0],xmm0[0]
pxor %xmm0, %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
movdqa %xmm1, %xmm0
shufps $0xdd, %xmm2, %xmm0 # xmm0 = xmm0[1,3],xmm2[1,3]
shufps $0x88, %xmm2, %xmm1 # xmm1 = xmm1[0,2],xmm2[0,2]
andps %xmm0, %xmm1
movmskps %xmm1, %eax
testl %eax, %eax
je 0x10cea3
leaq 0x80(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x17955(%rip), %rsi # 0x1247ba
leaq 0x17984(%rip), %rdx # 0x1247f0
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0x62274
movq (%rbx), %rbx
testq %r15, %r15
je 0x10ce8c
movq %rbx, %rdi
callq 0x15080
movq %rax, (%r15)
cmpq %r14, %rbx
je 0x10ce99
movq %rbx, %rdi
callq 0x14760
movl $0xfffffffd, %eax # imm = 0xFFFFFFFD
jmp 0x10d3a6
cmpq $0x7, %r8
ja 0x10cefa
leaq 0x80(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x17935(%rip), %rsi # 0x1247f1
leaq 0x17941(%rip), %rdx # 0x124804
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0x62274
movq (%rbx), %rbx
testq %r15, %r15
je 0x10cee3
movq %rbx, %rdi
callq 0x15080
movq %rax, (%r15)
cmpq %r14, %rbx
je 0x10cef0
movq %rbx, %rdi
callq 0x14760
movl $0xfffffffc, %eax # imm = 0xFFFFFFFC
jmp 0x10d3a6
movq %rcx, %rbp
movq %rdx, %r12
movq %rdi, 0x58(%rsp)
movq %rsi, 0x60(%rsp)
movq %r15, 0x38(%rsp)
addq $0x8, %rbp
addq $-0x8, %r8
movq %r8, 0x68(%rsp)
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rax
movaps %xmm0, (%rax)
movq $0x0, 0x10(%rax)
xorl %r15d, %r15d
leaq 0x70(%rsp), %rbx
movabsq $0xf83e0f83e0f83e1, %r13 # imm = 0xF83E0F83E0F83E1
movq %rdx, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
leaq 0x108(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq %r15, 0x100(%rsp)
movb %r15b, 0x108(%rsp)
leaq 0x128(%rsp), %rax
movq %rax, 0x118(%rsp)
movq %r15, 0x120(%rsp)
movb %r15b, 0x128(%rsp)
movq %rbx, %rdi
callq 0x114b0e
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movb %r15b, 0x28(%rsp)
movb %r15b, 0xb(%rsp)
movq %rbx, %rdi
leaq 0xb(%rsp), %rsi
movq %r12, %rdx
leaq 0x18(%rsp), %rcx
movq %rbp, %r8
movq 0x68(%rsp), %r9
callq 0x107a64
movl %eax, %r12d
testl %eax, %eax
je 0x10d05f
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rcx
cmpq %rax, %rcx
je 0x10d03b
movl $0x200, %ebx # imm = 0x200
xorl %r14d, %r14d
movq (%rax,%rbx), %rdi
testq %rdi, %rdi
je 0x10d01e
callq 0x149b0
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rcx
incq %r14
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x4, %rdx
imulq %r13, %rdx
addq $0x210, %rbx # imm = 0x210
cmpq %rdx, %r14
jb 0x10d000
movl $0x1, %r14d
movq 0x38(%rsp), %rbx
testq %rbx, %rbx
je 0x10d058
movq 0x18(%rsp), %rdi
callq 0x15080
movq %rax, (%rbx)
movl %r12d, 0xc(%rsp)
jmp 0x10d099
cmpb $0x1, 0xb(%rsp)
jne 0x10d071
incq %rbp
movl $0x2, %r14d
jmp 0x10d099
cmpl $0x0, 0xd4(%rsp)
je 0x10d113
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x114cee
movl 0xec(%rsp), %eax
addq %rax, %rbp
xorl %r14d, %r14d
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x10d0b2
callq 0x14760
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x10d0cc
callq 0x14760
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x10d0e6
callq 0x14760
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x10d0f8
callq 0x14760
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0x114ca4
testl %r14d, %r14d
je 0x10cf46
jmp 0x10d1e0
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rcx
cmpq %rax, %rcx
je 0x10d16b
movl $0x200, %ebx # imm = 0x200
xorl %r14d, %r14d
movq (%rax,%rbx), %rdi
testq %rdi, %rdi
je 0x10d14e
callq 0x149b0
movq 0x88(%rsp), %rax
movq 0x90(%rsp), %rcx
incq %r14
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x4, %rdx
imulq %r13, %rdx
addq $0x210, %rbx # imm = 0x210
cmpq %rdx, %r14
jb 0x10d130
leaq 0x148(%rsp), %rax
movq %rax, 0x138(%rsp)
leaq 0x138(%rsp), %rdi
leaq 0x1767b(%rip), %rsi # 0x124805
leaq 0x176a6(%rip), %rdx # 0x124837
callq 0x62274
movq 0x138(%rsp), %rbx
movq 0x38(%rsp), %r14
testq %r14, %r14
movq 0x10(%rsp), %r12
je 0x10d1b8
movq %rbx, %rdi
callq 0x15080
movq %rax, (%r14)
leaq 0x148(%rsp), %rax
cmpq %rax, %rbx
je 0x10d1cd
movq %rbx, %rdi
callq 0x14760
movl $0xfffffffc, 0xc(%rsp) # imm = 0xFFFFFFFC
movl $0x1, %r14d
jmp 0x10d09e
cmpl $0x2, %r14d
jne 0x10d398
movq 0x40(%rsp), %r12
movq 0x48(%rsp), %rbx
movq %rbx, %r15
subq %r12, %r15
sarq $0x3, %r15
movabsq $-0x70a3d70a3d70a3d7, %rax # imm = 0x8F5C28F5C28F5C29
movq %rax, %rbp
imulq %rax, %r15
leaq (,%r15,8), %rdi
callq 0x14b30
movq 0x58(%rsp), %rcx
movq %rax, (%rcx)
cmpq %r12, %rbx
je 0x10d388
xorl %r14d, %r14d
xorl %r13d, %r13d
movl $0x0, 0xc(%rsp)
movq %rbp, %rbx
movl $0x1, %edi
movl $0x188, %esi # imm = 0x188
callq 0x14550
movq %rax, %rbp
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq %r14, 0x78(%rsp)
movb %r14b, 0x80(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r14, 0x20(%rsp)
movb %r14b, 0x28(%rsp)
imulq $0xc8, %r13, %r15
addq %r15, %r12
movq %rbp, %rdi
movq %r12, %rsi
leaq 0x70(%rsp), %rdx
leaq 0x18(%rsp), %rcx
callq 0x108808
testb %al, %al
movq 0x10(%rsp), %r12
jne 0x10d320
movq 0x40(%rsp), %rax
movq 0x18(%rax,%r15), %rcx
cmpq %rcx, 0x20(%rax,%r15)
je 0x10d2ec
addq $0xe8, %r15
movq 0x200(%rcx), %rdi
testq %rdi, %rdi
je 0x10d2d4
callq 0x149b0
movq 0x40(%rsp), %rax
incq %r13
movq -0x8(%rax,%r15), %rcx
leaq 0xc8(%r15), %rdx
cmpq %rcx, (%rax,%r15)
movq %rdx, %r15
jne 0x10d2be
cmpq $0x0, 0x38(%rsp)
je 0x10d318
movl $0xfffffff7, 0xc(%rsp) # imm = 0xFFFFFFF7
cmpq $0x0, 0x20(%rsp)
je 0x10d320
movq 0x18(%rsp), %rdi
callq 0x15080
movq 0x38(%rsp), %rcx
movq %rax, (%rcx)
jmp 0x10d320
movl $0xfffffff7, 0xc(%rsp) # imm = 0xFFFFFFF7
xorl %eax, %eax
cmpl $0x0, 0x10(%r12)
setne %al
movl %eax, 0x54(%rbp)
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rbp, (%rax,%r13,8)
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x10d34e
callq 0x14760
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x10d365
callq 0x14760
incq %r13
movq 0x40(%rsp), %r12
movq 0x48(%rsp), %r15
subq %r12, %r15
sarq $0x3, %r15
imulq %rbx, %r15
cmpq %r15, %r13
jb 0x10d23e
jmp 0x10d390
movl $0x0, 0xc(%rsp)
movq 0x60(%rsp), %rax
movl %r15d, (%rax)
leaq 0x40(%rsp), %rdi
callq 0x114d1a
movl 0xc(%rsp), %eax
addq $0x158, %rsp # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x10d3ea
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x10d3d1
callq 0x14760
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x10d40b
callq 0x14760
jmp 0x10d40b
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x10d401
callq 0x14760
leaq 0x70(%rsp), %rdi
callq 0x114b6a
leaq 0x40(%rsp), %rdi
callq 0x114d1a
movq %rbx, %rdi
callq 0x14fb0
| /embree[P]embree/tutorials/common/image/tinyexr.h |
ParseEXRMultipartHeaderFromFile | int ParseEXRMultipartHeaderFromFile(EXRHeader ***exr_headers, int *num_headers,
const EXRVersion *exr_version,
const char *filename, const char **err) {
if (exr_headers == NULL || num_headers == NULL || exr_version == NULL ||
filename == NULL) {
tinyexr::SetErrorMessage(
"Invalid argument for ParseEXRMultipartHeaderFromFile()", err);
return TINYEXR_ERROR_INVALID_ARGUMENT;
}
FILE *fp = NULL;
#ifdef _WIN32
#if defined(_MSC_VER) || (defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) // MSVC, MinGW GCC, or Clang.
errno_t errcode =
_wfopen_s(&fp, tinyexr::UTF8ToWchar(filename).c_str(), L"rb");
if (errcode != 0) {
tinyexr::SetErrorMessage("Cannot read file " + std::string(filename), err);
return TINYEXR_ERROR_INVALID_FILE;
}
#else
// Unknown compiler or MinGW without MINGW_HAS_SECURE_API.
fp = fopen(filename, "rb");
#endif
#else
fp = fopen(filename, "rb");
#endif
if (!fp) {
tinyexr::SetErrorMessage("Cannot read file " + std::string(filename), err);
return TINYEXR_ERROR_CANT_OPEN_FILE;
}
size_t filesize;
// Compute size
fseek(fp, 0, SEEK_END);
filesize = static_cast<size_t>(ftell(fp));
fseek(fp, 0, SEEK_SET);
std::vector<unsigned char> buf(filesize); // @todo { use mmap }
{
size_t ret;
ret = fread(&buf[0], 1, filesize, fp);
assert(ret == filesize);
fclose(fp);
if (ret != filesize) {
tinyexr::SetErrorMessage("`fread' error. file may be corrupted.", err);
return TINYEXR_ERROR_INVALID_FILE;
}
}
return ParseEXRMultipartHeaderFromMemory(
exr_headers, num_headers, exr_version, &buf.at(0), filesize, err);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %rbp
movq %rsi, %xmm0
movq %rdi, %xmm1
punpcklqdq %xmm0, %xmm1 # xmm1 = xmm1[0],xmm0[0]
movq %rcx, %xmm0
movq %rdx, %xmm2
punpcklqdq %xmm0, %xmm2 # xmm2 = xmm2[0],xmm0[0]
pxor %xmm0, %xmm0
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
movdqa %xmm1, %xmm0
shufps $0xdd, %xmm2, %xmm0 # xmm0 = xmm0[1,3],xmm2[1,3]
shufps $0x88, %xmm2, %xmm1 # xmm1 = xmm1[0,2],xmm2[0,2]
andps %xmm0, %xmm1
movmskps %xmm1, %eax
testl %eax, %eax
je 0x10d4c7
leaq 0x48(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x173bc(%rip), %rsi # 0x124838
leaq 0x173eb(%rip), %rdx # 0x12486e
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
callq 0x62274
movq (%rbx), %r14
testq %rbp, %rbp
je 0x10d4a4
movq %r14, %rdi
callq 0x15080
movq %rax, (%rbp)
cmpq %r15, %r14
je 0x10d4b1
movq %r14, %rdi
callq 0x14760
movl $0xfffffffd, %ebx # imm = 0xFFFFFFFD
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq %rbp, 0x10(%rsp)
leaq 0x134ba(%rip), %rsi # 0x120999
movq %rcx, %rdi
callq 0x14980
testq %rax, %rax
je 0x10d581
movq %rax, %rbp
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x148c0
movq %rbp, %rdi
callq 0x14030
movq %rax, %r13
movq %rbp, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x148c0
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rdx
movq %r13, %rsi
callq 0xcc4f0
movq 0x18(%rsp), %rdi
movl $0x1, %esi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x14d00
movq %rax, %rbx
movq %rbp, %rdi
callq 0x147c0
cmpq %r13, %rbx
jne 0x10d5da
movq 0x18(%rsp), %rcx
cmpq %rcx, 0x20(%rsp)
movq 0x10(%rsp), %r9
je 0x10d69a
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %r8
callq 0x10ce00
movl %eax, %ebx
jmp 0x10d627
leaq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %r13, %rsi
callq 0x14310
leaq 0x16f57(%rip), %rcx # 0x1244f1
leaq 0x18(%rsp), %rdi
movl $0x11, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x148d0
movq 0x10(%rsp), %r15
leaq 0x48(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %r14
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %r14
je 0x10d63f
movq %r14, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
jmp 0x10d648
leaq 0x48(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x17285(%rip), %rsi # 0x12486f
leaq 0x172a3(%rip), %rdx # 0x124894
leaq 0x38(%rsp), %rdi
callq 0x62274
movq 0x10(%rsp), %r15
movq 0x38(%rsp), %r14
testq %r15, %r15
je 0x10d615
movq %r14, %rdi
callq 0x15080
movq %rax, (%r15)
cmpq %rbx, %r14
je 0x10d622
movq %r14, %rdi
callq 0x14760
movl $0xfffffffb, %ebx # imm = 0xFFFFFFFB
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x10d4b6
callq 0x14760
jmp 0x10d4b6
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq %rbx, %r14
movq 0x8(%rax), %rdx
movq %rdx, 0x40(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
testq %r15, %r15
je 0x10d670
movq %r14, %rdi
callq 0x15080
movq %rax, (%r15)
cmpq %rbx, %r14
je 0x10d67d
movq %r14, %rdi
callq 0x14760
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10d690
callq 0x14760
movl $0xfffffff9, %ebx # imm = 0xFFFFFFF9
jmp 0x10d4b6
leaq 0xe299(%rip), %rdi # 0x11b93a
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x14d40
jmp 0x10d6c5
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x10d6d2
jmp 0x10d6dc
jmp 0x10d6d9
jmp 0x10d6c5
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x10d6dc
callq 0x14760
jmp 0x10d6dc
movq %rax, %rbx
movq %rbx, %rdi
callq 0x14fb0
| /embree[P]embree/tutorials/common/image/tinyexr.h |
tinyexr::InitSingleResolutionOffsets(tinyexr::OffsetData&, unsigned long) | static void InitSingleResolutionOffsets(OffsetData& offset_data, size_t num_blocks) {
offset_data.offsets.resize(1);
offset_data.offsets[0].resize(1);
offset_data.offsets[0][0].resize(num_blocks);
offset_data.num_x_levels = 1;
offset_data.num_y_levels = 1;
} | pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %esi
callq 0x116d46
movq (%r14), %rdi
movl $0x1, %esi
callq 0x116dc2
movq (%r14), %rax
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x7e18a
movabsq $0x100000001, %rax # imm = 0x100000001
movq %rax, 0x18(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
| /embree[P]embree/tutorials/common/image/tinyexr.h |
tinyexr::PrecalculateTileInfo(std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, TEXRHeader const*) | static void PrecalculateTileInfo(std::vector<int>& num_x_tiles,
std::vector<int>& num_y_tiles,
const EXRHeader* exr_header) {
int min_x = exr_header->data_window.min_x;
int max_x = exr_header->data_window.max_x;
int min_y = exr_header->data_window.min_y;
int max_y = exr_header->data_window.max_y;
int num_x_levels = CalculateNumXLevels(exr_header);
int num_y_levels = CalculateNumYLevels(exr_header);
num_x_tiles.resize(size_t(num_x_levels));
num_y_tiles.resize(size_t(num_y_levels));
CalculateNumTiles(num_x_tiles,
max_x - min_x + 1,
exr_header->tile_size_x,
exr_header->tile_rounding_mode);
CalculateNumTiles(num_y_tiles,
max_y - min_y + 1,
exr_header->tile_size_y,
exr_header->tile_rounding_mode);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movl 0x8(%rdx), %ebx
movl 0xc(%rdx), %r9d
movl 0x10(%rdx), %r12d
movl 0x14(%rdx), %ebp
movl 0x44(%rdx), %ecx
movl $0x1, %r13d
testl %ecx, %ecx
movl %r9d, 0x4(%rsp)
movl %ebp, (%rsp)
je 0x10de69
cmpl $0x2, %ecx
je 0x10de2e
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0x10deae
movl %r12d, %eax
subl %ebx, %eax
incl %eax
movl %ebp, %edx
subl %r9d, %edx
incl %edx
cmpl %edx, %eax
cmovgl %eax, %edx
cmpl $0x0, 0x48(%r14)
je 0x10de91
cmpl $0x2, %edx
jb 0x10deaa
xorl %eax, %eax
movl $0x1, %r11d
xorl %r10d, %r10d
movl %edx, %r8d
testb $0x1, %dl
cmovnel %r11d, %eax
incl %r10d
shrl %r8d
cmpl $0x3, %edx
movl %r8d, %edx
ja 0x10de17
jmp 0x10de64
movl %r12d, %edx
subl %ebx, %edx
incl %edx
cmpl $0x0, 0x48(%r14)
je 0x10de78
cmpl $0x2, %edx
jb 0x10deaa
xorl %eax, %eax
movl $0x1, %r11d
xorl %r10d, %r10d
movl %edx, %r8d
testb $0x1, %dl
cmovnel %r11d, %eax
incl %r10d
shrl %r8d
cmpl $0x3, %edx
movl %r8d, %edx
ja 0x10de4f
addl %r10d, %eax
jmp 0x10deac
movl %ebx, %ebp
movq %rsi, %r15
movl $0x1, %eax
jmp 0x10df98
cmpl $0x2, %edx
jb 0x10deaa
xorl %eax, %eax
movl %edx, %r8d
incl %eax
shrl %r8d
cmpl $0x3, %edx
movl %r8d, %edx
ja 0x10de82
jmp 0x10deac
cmpl $0x2, %edx
jb 0x10deaa
xorl %eax, %eax
movl %edx, %r8d
incl %eax
shrl %r8d
cmpl $0x3, %edx
movl %r8d, %edx
ja 0x10de9b
jmp 0x10deac
xorl %eax, %eax
incl %eax
cmpl $0x2, %ecx
je 0x10df14
cmpl $0x1, %ecx
je 0x10decd
movl %ebx, %ebp
movq %rsi, %r15
testl %ecx, %ecx
je 0x10df98
xorl %r13d, %r13d
jmp 0x10df98
movl %r12d, %edx
subl %ebx, %edx
incl %edx
movl %ebp, %ecx
subl %r9d, %ecx
incl %ecx
cmpl %ecx, %edx
cmovgl %edx, %ecx
cmpl $0x0, 0x48(%r14)
je 0x10df53
cmpl $0x2, %ecx
jb 0x10df8d
xorl %r13d, %r13d
movl $0x1, %r8d
xorl %edx, %edx
movl %ecx, %r10d
testb $0x1, %cl
cmovnel %r8d, %r13d
incl %edx
shrl %r10d
cmpl $0x3, %ecx
movl %r10d, %ecx
ja 0x10defe
jmp 0x10df49
movl %ebp, %ecx
subl %r9d, %ecx
incl %ecx
cmpl $0x0, 0x48(%r14)
je 0x10df70
cmpl $0x2, %ecx
jb 0x10df8d
xorl %r13d, %r13d
movl $0x1, %r8d
xorl %edx, %edx
movl %ecx, %r10d
testb $0x1, %cl
cmovnel %r8d, %r13d
incl %edx
shrl %r10d
cmpl $0x3, %ecx
movl %r10d, %ecx
ja 0x10df35
movl %ebx, %ebp
movq %rsi, %r15
addl %edx, %r13d
jmp 0x10df95
cmpl $0x2, %ecx
jb 0x10df8d
movl %ebx, %ebp
movq %rsi, %r15
xorl %r13d, %r13d
movl %ecx, %edx
incl %r13d
shrl %edx
cmpl $0x3, %ecx
movl %edx, %ecx
ja 0x10df62
jmp 0x10df95
cmpl $0x2, %ecx
jb 0x10df8d
movl %ebx, %ebp
movq %rsi, %r15
xorl %r13d, %r13d
movl %ecx, %edx
incl %r13d
shrl %edx
cmpl $0x3, %ecx
movl %edx, %ecx
ja 0x10df7f
jmp 0x10df95
movl %ebx, %ebp
movq %rsi, %r15
xorl %r13d, %r13d
incl %r13d
movslq %eax, %rsi
movq %rdi, %rbx
callq 0x117154
movslq %r13d, %rsi
movq %r15, %rdi
callq 0x117154
subl %ebp, %r12d
incl %r12d
movl 0x3c(%r14), %edx
movl 0x48(%r14), %ecx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x1124b6
movl (%rsp), %esi
subl 0x4(%rsp), %esi
incl %esi
movl 0x40(%r14), %edx
movl 0x48(%r14), %ecx
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1124b6
| /embree[P]embree/tutorials/common/image/tinyexr.h |
tinyexr::InitTileOffsets(tinyexr::OffsetData&, TEXRHeader const*, std::vector<int, std::allocator<int>> const&, std::vector<int, std::allocator<int>> const&) | static int InitTileOffsets(OffsetData& offset_data,
const EXRHeader* exr_header,
const std::vector<int>& num_x_tiles,
const std::vector<int>& num_y_tiles) {
int num_tile_blocks = 0;
offset_data.num_x_levels = static_cast<int>(num_x_tiles.size());
offset_data.num_y_levels = static_cast<int>(num_y_tiles.size());
switch (exr_header->tile_level_mode) {
case TINYEXR_TILE_ONE_LEVEL:
case TINYEXR_TILE_MIPMAP_LEVELS:
assert(offset_data.num_x_levels == offset_data.num_y_levels);
offset_data.offsets.resize(size_t(offset_data.num_x_levels));
for (unsigned int l = 0; l < offset_data.offsets.size(); ++l) {
offset_data.offsets[l].resize(size_t(num_y_tiles[l]));
for (unsigned int dy = 0; dy < offset_data.offsets[l].size(); ++dy) {
offset_data.offsets[l][dy].resize(size_t(num_x_tiles[l]));
num_tile_blocks += num_x_tiles[l];
}
}
break;
case TINYEXR_TILE_RIPMAP_LEVELS:
offset_data.offsets.resize(static_cast<size_t>(offset_data.num_x_levels) * static_cast<size_t>(offset_data.num_y_levels));
for (int ly = 0; ly < offset_data.num_y_levels; ++ly) {
for (int lx = 0; lx < offset_data.num_x_levels; ++lx) {
int l = ly * offset_data.num_x_levels + lx;
offset_data.offsets[size_t(l)].resize(size_t(num_y_tiles[size_t(ly)]));
for (size_t dy = 0; dy < offset_data.offsets[size_t(l)].size(); ++dy) {
offset_data.offsets[size_t(l)][dy].resize(size_t(num_x_tiles[size_t(lx)]));
num_tile_blocks += num_x_tiles[size_t(lx)];
}
}
}
break;
default:
assert(false);
}
return num_tile_blocks;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x10(%rsp)
movq %rdi, %r15
movq 0x8(%rdx), %rax
subq (%rdx), %rax
shrq $0x2, %rax
movl %eax, 0x18(%rdi)
movq 0x8(%rcx), %rdx
movq %rcx, 0x18(%rsp)
subq (%rcx), %rdx
shrq $0x2, %rdx
movl %edx, 0x1c(%rdi)
xorl %ebp, %ebp
cmpl $0x2, 0x44(%rsi)
jae 0x10e100
movslq %eax, %rsi
movq %r15, %rdi
callq 0x116d46
movq (%r15), %rdi
cmpq %rdi, 0x8(%r15)
je 0x10e225
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x10(%rsp), %r14
leaq (,%r12,8), %rax
leaq (%rax,%rax,2), %rbx
addq %rbx, %rdi
movq 0x18(%rsp), %rax
movq (%rax), %rax
movslq (%rax,%r12,4), %rsi
callq 0x116dc2
movq (%r15), %rdi
movq (%rdi,%rbx), %rcx
cmpq %rcx, 0x8(%rdi,%rbx)
je 0x10e0d6
movq (%r14), %rax
movl (%rax,%r12,4), %eax
movl $0x1, %ebx
leaq (%r12,%r12,2), %r13
xorl %edx, %edx
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %rdi
movslq %eax, %rsi
callq 0x7e18a
movq (%r14), %rax
movl (%rax,%r12,4), %eax
addl %eax, %ebp
movl %ebx, %edx
movq (%r15), %rdi
movq (%rdi,%r13,8), %rcx
movq 0x8(%rdi,%r13,8), %rsi
subq %rcx, %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %r9 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r9, %rsi
incl %ebx
cmpq %rdx, %rsi
ja 0x10e093
incl %r12d
movq 0x8(%r15), %rax
subq %rdi, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
cmpq %r12, %rax
ja 0x10e053
jmp 0x10e225
jne 0x10e225
cltq
movslq %edx, %rsi
imulq %rax, %rsi
movq %r15, %rdi
callq 0x116d46
movl 0x1c(%r15), %ecx
testl %ecx, %ecx
jle 0x10e225
movl 0x18(%r15), %eax
movq $0x0, 0x8(%rsp)
xorl %ebp, %ebp
movq %r15, 0x20(%rsp)
testl %eax, %eax
jle 0x10e20c
movq (%r15), %rdi
xorl %esi, %esi
movq 0x8(%rsp), %rcx
imull %ecx, %eax
addl %esi, %eax
movslq %eax, %r14
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %r12
addq %r12, %rdi
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rsi, %rbx
movslq (%rax,%rcx,4), %rsi
callq 0x116dc2
movq (%r15), %rdi
movq (%rdi,%r12), %rax
cmpq %rax, 0x8(%rdi,%r12)
je 0x10e1f0
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
movl (%rcx,%rbx,4), %ecx
leaq (%r14,%r14,2), %r12
xorl %r13d, %r13d
xorl %r14d, %r14d
movq %rbx, %rsi
movabsq $-0x5555555555555555, %rbx # imm = 0xAAAAAAAAAAAAAAAB
addq %r13, %rax
movq %rsi, %r15
movslq %ecx, %rsi
movq %rax, %rdi
callq 0x7e18a
movq %r15, %rsi
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl (%rax,%r15,4), %ecx
addl %ecx, %ebp
incq %r14
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movq (%rdi,%r12,8), %rax
movq 0x8(%rdi,%r12,8), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
imulq %rbx, %rdx
addq $0x18, %r13
cmpq %rdx, %r14
jb 0x10e1a4
jmp 0x10e1f3
movq %rbx, %rsi
incq %rsi
movq 0x20(%rsp), %r15
movslq 0x18(%r15), %rax
cmpq %rax, %rsi
jl 0x10e144
movl 0x1c(%r15), %ecx
movq 0x8(%rsp), %rdi
incq %rdi
movslq %ecx, %rdx
movq %rdi, 0x8(%rsp)
cmpq %rdx, %rdi
jl 0x10e137
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/tinyexr.h |
tinyexr::DecodeChunk(TEXRImage*, TEXRHeader const*, tinyexr::OffsetData const&, unsigned char const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*) | static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header,
const OffsetData& offset_data,
const unsigned char *head, const size_t size,
std::string *err) {
int num_channels = exr_header->num_channels;
int num_scanline_blocks = 1;
if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZIP) {
num_scanline_blocks = 16;
} else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
num_scanline_blocks = 32;
} else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
num_scanline_blocks = 16;
#if TINYEXR_USE_ZFP
tinyexr::ZFPCompressionParam zfp_compression_param;
if (!FindZFPCompressionParam(&zfp_compression_param,
exr_header->custom_attributes,
int(exr_header->num_custom_attributes), err)) {
return TINYEXR_ERROR_INVALID_HEADER;
}
#endif
}
if (exr_header->data_window.max_x < exr_header->data_window.min_x ||
exr_header->data_window.max_y < exr_header->data_window.min_y) {
if (err) {
(*err) += "Invalid data window.\n";
}
return TINYEXR_ERROR_INVALID_DATA;
}
int data_width =
exr_header->data_window.max_x - exr_header->data_window.min_x + 1;
int data_height =
exr_header->data_window.max_y - exr_header->data_window.min_y + 1;
// Do not allow too large data_width and data_height. header invalid?
{
if ((data_width > TINYEXR_DIMENSION_THRESHOLD) || (data_height > TINYEXR_DIMENSION_THRESHOLD)) {
if (err) {
std::stringstream ss;
ss << "data_with or data_height too large. data_width: " << data_width
<< ", "
<< "data_height = " << data_height << std::endl;
(*err) += ss.str();
}
return TINYEXR_ERROR_INVALID_DATA;
}
if (exr_header->tiled) {
if ((exr_header->tile_size_x > TINYEXR_DIMENSION_THRESHOLD) || (exr_header->tile_size_y > TINYEXR_DIMENSION_THRESHOLD)) {
if (err) {
std::stringstream ss;
ss << "tile with or tile height too large. tile width: " << exr_header->tile_size_x
<< ", "
<< "tile height = " << exr_header->tile_size_y << std::endl;
(*err) += ss.str();
}
return TINYEXR_ERROR_INVALID_DATA;
}
}
}
const std::vector<tinyexr::tinyexr_uint64>& offsets = offset_data.offsets[0][0];
size_t num_blocks = offsets.size();
std::vector<size_t> channel_offset_list;
int pixel_data_size = 0;
size_t channel_offset = 0;
if (!tinyexr::ComputeChannelLayout(&channel_offset_list, &pixel_data_size,
&channel_offset, num_channels,
exr_header->channels)) {
if (err) {
(*err) += "Failed to compute channel layout.\n";
}
return TINYEXR_ERROR_INVALID_DATA;
}
#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
std::atomic<bool> invalid_data(false);
#else
bool invalid_data(false);
#endif
if (exr_header->tiled) {
// value check
if (exr_header->tile_size_x < 0) {
if (err) {
std::stringstream ss;
ss << "Invalid tile size x : " << exr_header->tile_size_x << "\n";
(*err) += ss.str();
}
return TINYEXR_ERROR_INVALID_HEADER;
}
if (exr_header->tile_size_y < 0) {
if (err) {
std::stringstream ss;
ss << "Invalid tile size y : " << exr_header->tile_size_y << "\n";
(*err) += ss.str();
}
return TINYEXR_ERROR_INVALID_HEADER;
}
if (exr_header->tile_level_mode != TINYEXR_TILE_RIPMAP_LEVELS) {
EXRImage* level_image = NULL;
for (int level = 0; level < offset_data.num_x_levels; ++level) {
if (!level_image) {
level_image = exr_image;
} else {
level_image->next_level = new EXRImage;
InitEXRImage(level_image->next_level);
level_image = level_image->next_level;
}
level_image->width =
LevelSize(exr_header->data_window.max_x - exr_header->data_window.min_x + 1, level, exr_header->tile_rounding_mode);
level_image->height =
LevelSize(exr_header->data_window.max_y - exr_header->data_window.min_y + 1, level, exr_header->tile_rounding_mode);
level_image->level_x = level;
level_image->level_y = level;
int ret = DecodeTiledLevel(level_image, exr_header,
offset_data,
channel_offset_list,
pixel_data_size,
head, size,
err);
if (ret != TINYEXR_SUCCESS) return ret;
}
} else {
EXRImage* level_image = NULL;
for (int level_y = 0; level_y < offset_data.num_y_levels; ++level_y)
for (int level_x = 0; level_x < offset_data.num_x_levels; ++level_x) {
if (!level_image) {
level_image = exr_image;
} else {
level_image->next_level = new EXRImage;
InitEXRImage(level_image->next_level);
level_image = level_image->next_level;
}
level_image->width =
LevelSize(exr_header->data_window.max_x - exr_header->data_window.min_x + 1, level_x, exr_header->tile_rounding_mode);
level_image->height =
LevelSize(exr_header->data_window.max_y - exr_header->data_window.min_y + 1, level_y, exr_header->tile_rounding_mode);
level_image->level_x = level_x;
level_image->level_y = level_y;
int ret = DecodeTiledLevel(level_image, exr_header,
offset_data,
channel_offset_list,
pixel_data_size,
head, size,
err);
if (ret != TINYEXR_SUCCESS) return ret;
}
}
} else { // scanline format
// Don't allow too large image(256GB * pixel_data_size or more). Workaround
// for #104.
size_t total_data_len =
size_t(data_width) * size_t(data_height) * size_t(num_channels);
const bool total_data_len_overflown =
sizeof(void *) == 8 ? (total_data_len >= 0x4000000000) : false;
if ((total_data_len == 0) || total_data_len_overflown) {
if (err) {
std::stringstream ss;
ss << "Image data size is zero or too large: width = " << data_width
<< ", height = " << data_height << ", channels = " << num_channels
<< std::endl;
(*err) += ss.str();
}
return TINYEXR_ERROR_INVALID_DATA;
}
exr_image->images = tinyexr::AllocateImage(
num_channels, exr_header->channels, exr_header->requested_pixel_types,
data_width, data_height);
#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
std::vector<std::thread> workers;
std::atomic<int> y_count(0);
int num_threads = std::max(1, int(std::thread::hardware_concurrency()));
if (num_threads > int(num_blocks)) {
num_threads = int(num_blocks);
}
for (int t = 0; t < num_threads; t++) {
workers.emplace_back(std::thread([&]() {
int y = 0;
while ((y = y_count++) < int(num_blocks)) {
#else
#if TINYEXR_USE_OPENMP
#pragma omp parallel for
#endif
for (int y = 0; y < static_cast<int>(num_blocks); y++) {
#endif
size_t y_idx = static_cast<size_t>(y);
if (offsets[y_idx] + sizeof(int) * 2 > size) {
invalid_data = true;
} else {
// 4 byte: scan line
// 4 byte: data size
// ~ : pixel data(uncompressed or compressed)
size_t data_size =
size_t(size - (offsets[y_idx] + sizeof(int) * 2));
const unsigned char *data_ptr =
reinterpret_cast<const unsigned char *>(head + offsets[y_idx]);
int line_no;
memcpy(&line_no, data_ptr, sizeof(int));
int data_len;
memcpy(&data_len, data_ptr + 4, sizeof(int));
tinyexr::swap4(&line_no);
tinyexr::swap4(&data_len);
if (size_t(data_len) > data_size) {
invalid_data = true;
} else if ((line_no > (2 << 20)) || (line_no < -(2 << 20))) {
// Too large value. Assume this is invalid
// 2**20 = 1048576 = heuristic value.
invalid_data = true;
} else if (data_len == 0) {
// TODO(syoyo): May be ok to raise the threshold for example
// `data_len < 4`
invalid_data = true;
} else {
// line_no may be negative.
int end_line_no = (std::min)(line_no + num_scanline_blocks,
(exr_header->data_window.max_y + 1));
int num_lines = end_line_no - line_no;
if (num_lines <= 0) {
invalid_data = true;
} else {
// Move to data addr: 8 = 4 + 4;
data_ptr += 8;
// Adjust line_no with data_window.bmin.y
// overflow check
tinyexr_int64 lno =
static_cast<tinyexr_int64>(line_no) -
static_cast<tinyexr_int64>(exr_header->data_window.min_y);
if (lno > std::numeric_limits<int>::max()) {
line_no = -1; // invalid
} else if (lno < -std::numeric_limits<int>::max()) {
line_no = -1; // invalid
} else {
line_no -= exr_header->data_window.min_y;
}
if (line_no < 0) {
invalid_data = true;
} else {
if (!tinyexr::DecodePixelData(
exr_image->images, exr_header->requested_pixel_types,
data_ptr, static_cast<size_t>(data_len),
exr_header->compression_type, exr_header->line_order,
data_width, data_height, data_width, y, line_no,
num_lines, static_cast<size_t>(pixel_data_size),
static_cast<size_t>(
exr_header->num_custom_attributes),
exr_header->custom_attributes,
static_cast<size_t>(exr_header->num_channels),
exr_header->channels, channel_offset_list)) {
invalid_data = true;
}
}
}
}
}
#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
}
}));
}
for (auto &t : workers) {
t.join();
}
#else
} // omp parallel
#endif
}
if (invalid_data) {
if (err) {
(*err) += "Invalid data found when decoding pixels.\n";
}
return TINYEXR_ERROR_INVALID_DATA;
}
// Overwrite `pixel_type` with `requested_pixel_type`.
{
for (int c = 0; c < exr_header->num_channels; c++) {
exr_header->pixel_types[c] = exr_header->requested_pixel_types[c];
}
}
{
exr_image->num_channels = num_channels;
exr_image->width = data_width;
exr_image->height = data_height;
}
return TINYEXR_SUCCESS;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp # imm = 0x228
movq %r9, %r13
movq %rsi, %r14
movl 0x7c(%rsi), %eax
movl $0x10, %r15d
cmpl $0x3, %eax
je 0x10e275
cmpl $0x80, %eax
je 0x10e275
cmpl $0x4, %eax
jne 0x10e26f
movl $0x20, %r15d
jmp 0x10e275
movl $0x1, %r15d
movl 0x10(%r14), %eax
subl 0x8(%r14), %eax
jl 0x10e289
movl 0x14(%r14), %r9d
subl 0xc(%r14), %r9d
jge 0x10e2b6
movl $0xfffffffc, %ebp # imm = 0xFFFFFFFC
testq %r13, %r13
je 0x10e2a2
leaq 0x16ecf(%rip), %rsi # 0x125169
movq %r13, %rdi
callq 0x15190
movl %ebp, %eax
addq $0x228, %rsp # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leal 0x1(%rax), %r12d
leal 0x1(%r9), %esi
movl $0x800000, %r10d # imm = 0x800000
cmpl %r10d, %eax
setge %al
cmpl %r10d, %r9d
setge %r9b
orb %al, %r9b
cmpb $0x1, %r9b
jne 0x10e3bb
movl $0xfffffffc, %ebp # imm = 0xFFFFFFFC
testq %r13, %r13
je 0x10e2a2
movq %rsi, %r14
leaq 0xa0(%rsp), %rdi
callq 0x145d0
leaq 0xb0(%rsp), %rbx
leaq 0x16e78(%rip), %rsi # 0x12517f
movl $0x30, %edx
movq %rbx, %rdi
callq 0x14900
movq %rbx, %rdi
movl %r12d, %esi
callq 0x14f70
movq %rax, %rbx
leaq 0xd51e(%rip), %rsi # 0x11b847
movl $0x2, %edx
movq %rax, %rdi
callq 0x14900
leaq 0x16e73(%rip), %rsi # 0x1251b0
movl $0xe, %edx
movq %rbx, %rdi
callq 0x14900
movq %rbx, %rdi
movl %r14d, %esi
callq 0x14f70
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x14790
movsbl %al, %esi
movq %rbx, %rdi
callq 0x14050
movq %rax, %rdi
callq 0x145a0
leaq 0xb8(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x14e20
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r13, %rdi
callq 0x14270
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10e3b6
callq 0x14760
jmp 0x10e4c2
movq %r12, 0x58(%rsp)
movl 0x78(%r14), %r12d
cmpl $0x0, 0x38(%r14)
je 0x10e4e8
cmpl $0x800000, 0x3c(%r14) # imm = 0x800000
jg 0x10e3e7
cmpl $0x800001, 0x40(%r14) # imm = 0x800001
jl 0x10e4e8
movl $0xfffffffc, %ebp # imm = 0xFFFFFFFC
testq %r13, %r13
je 0x10e2a2
leaq 0xa0(%rsp), %rdi
callq 0x145d0
leaq 0xb0(%rsp), %rbx
leaq 0x16dae(%rip), %rsi # 0x1251bf
movl $0x30, %edx
movq %rbx, %rdi
callq 0x14900
movl 0x3c(%r14), %esi
movq %rbx, %rdi
callq 0x14f70
movq %rax, %rbx
leaq 0xd413(%rip), %rsi # 0x11b847
movl $0x2, %edx
movq %rax, %rdi
callq 0x14900
leaq 0x16da8(%rip), %rsi # 0x1251f0
movl $0xe, %edx
movq %rbx, %rdi
callq 0x14900
movl 0x40(%r14), %esi
movq %rbx, %rdi
callq 0x14f70
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x14790
movsbl %al, %esi
movq %rbx, %rdi
callq 0x14050
movq %rax, %rdi
callq 0x145a0
leaq 0xb8(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x14e20
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r13, %rdi
callq 0x14270
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10e4c2
callq 0x14760
movq 0x5da5f(%rip), %rsi # 0x16bf28
leaq 0xa0(%rsp), %rdi
callq 0x14610
leaq 0x120(%rsp), %rdi
callq 0x14290
jmp 0x10e2a2
movq %rcx, 0x68(%rsp)
movq %r8, 0x60(%rsp)
movq %rdi, 0x18(%rsp)
movq %rsi, 0x50(%rsp)
movslq %r12d, %rbx
movq %rdx, 0x8(%rsp)
movq (%rdx), %rax
movq (%rax), %rax
movq 0x8(%rax), %rcx
movq %rax, 0x98(%rsp)
subq (%rax), %rcx
movq %rcx, 0x10(%rsp)
xorps %xmm0, %xmm0
leaq 0x70(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq 0x68(%r14), %rbp
movq %rbx, %rsi
callq 0x7e18a
movq %r13, 0x20(%rsp)
movl %r12d, 0x2c(%rsp)
testl %r12d, %r12d
je 0x10e5e1
movq %rbx, %rax
negq %rax
addq $0x100, %rbp # imm = 0x100
xorl %ecx, %ecx
movl $0x1, %edx
leaq 0x16d95(%rip), %rsi # 0x125300
leaq 0x16d9e(%rip), %rdi # 0x125310
xorl %r13d, %r13d
xorl %r8d, %r8d
movq 0x58(%rsp), %r12
movq 0x70(%rsp), %r9
movq %rcx, -0x8(%r9,%rdx,8)
movl (%rbp), %r9d
cmpq $0x2, %r9
ja 0x10e5b7
addl (%rsi,%r9,4), %r13d
addq (%rdi,%r9,8), %rcx
cmpq %rbx, %rdx
setae %r8b
leaq (%rax,%rdx), %r9
incq %r9
incq %rdx
addq $0x110, %rbp # imm = 0x110
cmpq $0x1, %r9
jne 0x10e57d
testb $0x1, %r8b
jne 0x10e5e9
movl $0xfffffffc, %ebp # imm = 0xFFFFFFFC
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x10ecaf
leaq 0x16c28(%rip), %rsi # 0x1251ff
callq 0x15190
jmp 0x10ecaf
xorl %r13d, %r13d
movq 0x58(%rsp), %r12
cmpl $0x0, 0x38(%r14)
je 0x10e77a
cmpl $0x0, 0x3c(%r14)
js 0x10e878
cmpl $0x0, 0x40(%r14)
js 0x10eaae
cmpl $0x2, 0x44(%r14)
jne 0x10eb67
movq 0x8(%rsp), %rax
movl 0x1c(%rax), %ecx
testl %ecx, %ecx
movq 0x18(%rsp), %rbx
jle 0x10ec70
movq 0x8(%rsp), %rax
movl 0x18(%rax), %eax
movq $0x0, 0x10(%rsp)
xorl %ebp, %ebp
testl %eax, %eax
jle 0x10e761
movl $0x1, %r12d
movq 0x10(%rsp), %rcx
shll %cl, %r12d
xorl %r15d, %r15d
movq 0x18(%rsp), %rbx
testq %rbp, %rbp
je 0x10e680
movl $0x30, %edi
callq 0x147e0
movq %rax, 0x8(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq 0x8(%rbp), %rbx
movl 0x10(%r14), %esi
movl 0x48(%r14), %edi
subl 0x8(%r14), %esi
leal 0x1(%rsi), %eax
movl $0x1, %r8d
movl %r15d, %ecx
shll %cl, %r8d
cltd
idivl %r8d
movl $0x1, %r8d
cmpl %r8d, %edi
sete %dl
movl %eax, %edi
shll %cl, %edi
cmpl %esi, %edi
setle %cl
andb %dl, %cl
movzbl %cl, %ecx
addl %eax, %ecx
cmpl $0x2, %ecx
cmovll %r8d, %ecx
movl %ecx, 0x20(%rbx)
movl 0x14(%r14), %esi
movl 0x48(%r14), %ecx
subl 0xc(%r14), %esi
leal 0x1(%rsi), %eax
cltd
idivl %r12d
cmpl $0x1, %ecx
sete %dl
movl %eax, %edi
movq 0x10(%rsp), %rcx
shll %cl, %edi
cmpl %esi, %edi
setle %sil
andb %dl, %sil
movzbl %sil, %edx
addl %eax, %edx
cmpl $0x2, %edx
cmovll %r8d, %edx
movl %edx, 0x24(%rbx)
movl %r15d, 0x10(%rbx)
movl %ecx, 0x14(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movl %r13d, %r8d
movq 0x68(%rsp), %r9
pushq 0x20(%rsp)
pushq 0x68(%rsp)
callq 0x112545
addq $0x10, %rsp
movl %eax, %ebp
testl %eax, %eax
jne 0x10ecaf
incl %r15d
movq 0x8(%rsp), %rax
movl 0x18(%rax), %eax
movq %rbx, %rbp
cmpl %eax, %r15d
jl 0x10e656
movq 0x8(%rsp), %rcx
movl 0x1c(%rcx), %ecx
movq %rbx, %rbp
movq 0x18(%rsp), %rbx
movq 0x10(%rsp), %rdx
incl %edx
movq %rdx, 0x10(%rsp)
cmpl %ecx, %edx
jl 0x10e63d
jmp 0x10ec70
movslq %r12d, %rax
movq 0x50(%rsp), %r8
movslq %r8d, %rcx
imulq %rbx, %rax
imulq %rcx, %rax
movabsq $-0x4000000000, %rcx # imm = 0xFFFFFFC000000000
addq %rcx, %rax
incq %rcx
cmpq %rcx, %rax
jae 0x10e910
movl $0xfffffffc, %ebp # imm = 0xFFFFFFFC
movq 0x20(%rsp), %r14
testq %r14, %r14
je 0x10ecaf
leaq 0xa0(%rsp), %rdi
callq 0x145d0
leaq 0xb0(%rsp), %rbx
leaq 0x16a7b(%rip), %rsi # 0x125250
movl $0x2e, %edx
movq %rbx, %rdi
callq 0x14900
movq %rbx, %rdi
movl %r12d, %esi
callq 0x14f70
movq %rax, %rbx
leaq 0x16a88(%rip), %rsi # 0x12527f
movl $0xb, %edx
movq %rax, %rdi
callq 0x14900
movq %rbx, %rdi
movq 0x50(%rsp), %rsi
callq 0x14f70
movq %rax, %rbx
leaq 0x16a70(%rip), %rsi # 0x12528b
movl $0xd, %edx
movq %rax, %rdi
callq 0x14900
movq %rbx, %rdi
movl 0x2c(%rsp), %esi
callq 0x14f70
movq %rax, %rdi
callq 0x143b0
leaq 0xb8(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x14e20
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r14, %rdi
callq 0x14270
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10e873
callq 0x14760
jmp 0x10eb41
movl $0xfffffff7, %ebp # imm = 0xFFFFFFF7
movq 0x20(%rsp), %r15
testq %r15, %r15
je 0x10ecaf
leaq 0xa0(%rsp), %rdi
callq 0x145d0
leaq 0xb0(%rsp), %rbx
leaq 0x1697b(%rip), %rsi # 0x125222
movl $0x16, %edx
movq %rbx, %rdi
callq 0x14900
movl 0x3c(%r14), %esi
movq %rbx, %rdi
callq 0x14f70
leaq 0xd1f2(%rip), %rsi # 0x11bab9
movl $0x1, %edx
movq %rax, %rdi
callq 0x14900
leaq 0xb8(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x14e20
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r15, %rdi
callq 0x14270
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10e90b
callq 0x14760
jmp 0x10eb41
movq 0x10(%rsp), %rbx
shrq $0x3, %rbx
movq 0x68(%r14), %rsi
movq 0x80(%r14), %rdx
movl 0x2c(%rsp), %edi
movl %r12d, %ecx
callq 0x1128a8
movq %rbx, %r9
movq 0x18(%rsp), %rbx
movq %rax, 0x18(%rbx)
testl %r9d, %r9d
jle 0x10ec70
movslq %r13d, %rax
movq %rax, 0x8(%rsp)
andl $0x7fffffff, %r9d # imm = 0x7FFFFFFF
xorl %r12d, %r12d
xorl %eax, %eax
movq 0x60(%rsp), %r8
movq 0x98(%rsp), %rbp
movl %eax, %ebx
movq (%rbp), %rax
movq (%rax,%r12,8), %rdx
leaq 0x8(%rdx), %rcx
movb $0x1, %al
movq %r8, %rsi
subq %rcx, %rsi
jb 0x10ea71
movq 0x68(%rsp), %rdi
movslq 0x4(%rdi,%rdx), %rcx
cmpq %rcx, %rsi
jb 0x10ea71
movslq (%rdi,%rdx), %r10
leal -0x200001(%r10), %esi
cmpl $0xffbfffff, %esi # imm = 0xFFBFFFFF
setb %sil
testl %ecx, %ecx
sete %dil
orb %sil, %dil
jne 0x10ea71
leal (%r10,%r15), %esi
movl 0x14(%r14), %r11d
incl %r11d
cmpl %esi, %r11d
cmovgel %esi, %r11d
subl %r10d, %r11d
jle 0x10ea71
movslq 0xc(%r14), %rsi
movq %r10, %rdi
subq %rsi, %rdi
addq $-0x80000000, %rdi # imm = 0x80000000
movabsq $-0xffffffff, %r13 # imm = 0xFFFFFFFF00000001
cmpq %r13, %rdi
jb 0x10ea71
subl %esi, %r10d
js 0x10ea71
movq %r9, 0x10(%rsp)
addq 0x68(%rsp), %rdx
addq $0x8, %rdx
movq 0x18(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x80(%r14), %rsi
movl 0x7c(%r14), %r8d
movl 0x4(%r14), %r9d
movslq 0x78(%r14), %rax
movq %rax, 0x90(%rsp)
leaq 0x70(%rsp), %r13
pushq %r13
movq 0x10(%rsp), %rax
pushq 0x68(%r14)
pushq 0xa0(%rsp)
pushq %rax
pushq %r11
pushq %r10
pushq %r12
movq 0x90(%rsp), %rax
pushq %rax
pushq 0x90(%rsp)
pushq %rax
callq 0x11294e
addq $0x50, %rsp
xorb $0x1, %al
orb %bl, %al
movq 0x60(%rsp), %r8
movq 0x10(%rsp), %r9
incq %r12
cmpq %r12, %r9
jne 0x10e966
testb $0x1, %al
movq 0x18(%rsp), %rbx
je 0x10ec70
movl $0xfffffffc, %ebp # imm = 0xFFFFFFFC
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x10ecaf
leaq 0x167f5(%rip), %rsi # 0x125299
callq 0x15190
jmp 0x10ecaf
movl $0xfffffff7, %ebp # imm = 0xFFFFFFF7
movq 0x20(%rsp), %r15
testq %r15, %r15
je 0x10ecaf
leaq 0xa0(%rsp), %rdi
callq 0x145d0
leaq 0xb0(%rsp), %rbx
leaq 0x1675c(%rip), %rsi # 0x125239
movl $0x16, %edx
movq %rbx, %rdi
callq 0x14900
movl 0x40(%r14), %esi
movq %rbx, %rdi
callq 0x14f70
leaq 0xcfbc(%rip), %rsi # 0x11bab9
movl $0x1, %edx
movq %rax, %rdi
callq 0x14900
leaq 0xb8(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x14e20
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %r15, %rdi
callq 0x14270
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10eb41
callq 0x14760
movq 0x5d3e0(%rip), %rsi # 0x16bf28
leaq 0xa0(%rsp), %rdi
callq 0x14610
leaq 0x120(%rsp), %rdi
callq 0x14290
jmp 0x10ecaf
movq 0x8(%rsp), %rax
cmpl $0x0, 0x18(%rax)
movq 0x18(%rsp), %rbx
jle 0x10ec70
xorl %ebp, %ebp
movl $0x1, %r12d
xorl %r15d, %r15d
testq %rbp, %rbp
je 0x10ebab
movl $0x30, %edi
callq 0x147e0
movq %rax, 0x8(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq 0x8(%rbp), %rbx
movl 0x10(%r14), %edi
movl 0x48(%r14), %r8d
subl 0x8(%r14), %edi
leal 0x1(%rdi), %eax
movl $0x1, %esi
movl %r15d, %ecx
shll %cl, %esi
cltd
idivl %esi
cmpl %r12d, %r8d
sete %dl
movl %eax, %r8d
shll %cl, %r8d
cmpl %edi, %r8d
setle %cl
andb %dl, %cl
movzbl %cl, %ecx
addl %eax, %ecx
cmpl $0x2, %ecx
cmovll %r12d, %ecx
movl %ecx, 0x20(%rbx)
movl 0x14(%r14), %edi
movl 0x48(%r14), %ecx
subl 0xc(%r14), %edi
leal 0x1(%rdi), %eax
cltd
idivl %esi
cmpl $0x1, %ecx
sete %dl
movl %eax, %esi
movl %r15d, %ecx
shll %cl, %esi
cmpl %edi, %esi
setle %cl
andb %dl, %cl
movzbl %cl, %ecx
addl %eax, %ecx
cmpl $0x2, %ecx
cmovll %r12d, %ecx
movl %ecx, 0x24(%rbx)
movl %r15d, 0x10(%rbx)
movl %r15d, 0x14(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movl %r13d, %r8d
movq 0x68(%rsp), %r9
pushq 0x20(%rsp)
pushq 0x68(%rsp)
callq 0x112545
addq $0x10, %rsp
movl %eax, %ebp
testl %eax, %eax
jne 0x10ecaf
incl %r15d
movq %rbx, %rbp
movq 0x8(%rsp), %rax
cmpl 0x18(%rax), %r15d
movq 0x18(%rsp), %rbx
jl 0x10eb86
cmpl $0x0, 0x78(%r14)
jle 0x10ec96
xorl %eax, %eax
movq 0x70(%r14), %rcx
movq 0x80(%r14), %rdx
movl (%rdx,%rax,4), %edx
movl %edx, (%rcx,%rax,4)
incq %rax
movslq 0x78(%r14), %rcx
cmpq %rcx, %rax
jl 0x10ec79
movl 0x2c(%rsp), %eax
movl %eax, 0x28(%rbx)
movq 0x58(%rsp), %rax
movl %eax, 0x20(%rbx)
movq 0x50(%rsp), %rax
movl %eax, 0x24(%rbx)
xorl %ebp, %ebp
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x10e2a2
callq 0x14760
jmp 0x10e2a2
jmp 0x10ed94
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10ece2
callq 0x14760
jmp 0x10ed51
jmp 0x10ed4e
jmp 0x10ed94
jmp 0x10ed94
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10ed06
callq 0x14760
jmp 0x10ed51
jmp 0x10ed4e
jmp 0x10ed94
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10ed30
callq 0x14760
jmp 0x10ed30
jmp 0x10ed2d
jmp 0x10ed94
jmp 0x10ed4e
movq %rax, %rbx
jmp 0x10ed51
jmp 0x10ed94
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10ed4a
callq 0x14760
jmp 0x10edb0
jmp 0x10eda8
movq %rax, %rbx
movq 0x5d1d0(%rip), %rsi # 0x16bf28
leaq 0xa0(%rsp), %rdi
callq 0x14610
leaq 0x120(%rsp), %rdi
callq 0x14290
jmp 0x10ed97
jmp 0x10ed94
jmp 0x10ed94
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x10edb0
callq 0x14760
jmp 0x10edb0
jmp 0x10edad
jmp 0x10ed94
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x10edd1
callq 0x14760
jmp 0x10edd1
movq %rax, %rbx
jmp 0x10edb0
movq %rax, %rbx
movq 0x5d171(%rip), %rsi # 0x16bf28
leaq 0xa0(%rsp), %rdi
callq 0x14610
leaq 0x120(%rsp), %rdi
callq 0x14290
movq %rbx, %rdi
callq 0x14fb0
| /embree[P]embree/tutorials/common/image/tinyexr.h |
SaveEXRToMemory | int SaveEXRToMemory(const float *data, int width, int height, int components,
const int save_as_fp16, const unsigned char **outbuf, const char **err) {
if ((components == 1) || components == 3 || components == 4) {
// OK
} else {
std::stringstream ss;
ss << "Unsupported component value : " << components << std::endl;
tinyexr::SetErrorMessage(ss.str(), err);
return TINYEXR_ERROR_INVALID_ARGUMENT;
}
EXRHeader header;
InitEXRHeader(&header);
if ((width < 16) && (height < 16)) {
// No compression for small image.
header.compression_type = TINYEXR_COMPRESSIONTYPE_NONE;
} else {
header.compression_type = TINYEXR_COMPRESSIONTYPE_ZIP;
}
EXRImage image;
InitEXRImage(&image);
image.num_channels = components;
std::vector<float> images[4];
if (components == 1) {
images[0].resize(static_cast<size_t>(width * height));
memcpy(images[0].data(), data, sizeof(float) * size_t(width * height));
} else {
images[0].resize(static_cast<size_t>(width * height));
images[1].resize(static_cast<size_t>(width * height));
images[2].resize(static_cast<size_t>(width * height));
images[3].resize(static_cast<size_t>(width * height));
// Split RGB(A)RGB(A)RGB(A)... into R, G and B(and A) layers
for (size_t i = 0; i < static_cast<size_t>(width * height); i++) {
images[0][i] = data[static_cast<size_t>(components) * i + 0];
images[1][i] = data[static_cast<size_t>(components) * i + 1];
images[2][i] = data[static_cast<size_t>(components) * i + 2];
if (components == 4) {
images[3][i] = data[static_cast<size_t>(components) * i + 3];
}
}
}
float *image_ptr[4] = {0, 0, 0, 0};
if (components == 4) {
image_ptr[0] = &(images[3].at(0)); // A
image_ptr[1] = &(images[2].at(0)); // B
image_ptr[2] = &(images[1].at(0)); // G
image_ptr[3] = &(images[0].at(0)); // R
} else if (components == 3) {
image_ptr[0] = &(images[2].at(0)); // B
image_ptr[1] = &(images[1].at(0)); // G
image_ptr[2] = &(images[0].at(0)); // R
} else if (components == 1) {
image_ptr[0] = &(images[0].at(0)); // A
}
image.images = reinterpret_cast<unsigned char **>(image_ptr);
image.width = width;
image.height = height;
header.num_channels = components;
header.channels = static_cast<EXRChannelInfo *>(malloc(
sizeof(EXRChannelInfo) * static_cast<size_t>(header.num_channels)));
// Must be (A)BGR order, since most of EXR viewers expect this channel order.
if (components == 4) {
#ifdef _MSC_VER
strncpy_s(header.channels[0].name, "A", 255);
strncpy_s(header.channels[1].name, "B", 255);
strncpy_s(header.channels[2].name, "G", 255);
strncpy_s(header.channels[3].name, "R", 255);
#else
strncpy(header.channels[0].name, "A", 255);
strncpy(header.channels[1].name, "B", 255);
strncpy(header.channels[2].name, "G", 255);
strncpy(header.channels[3].name, "R", 255);
#endif
header.channels[0].name[strlen("A")] = '\0';
header.channels[1].name[strlen("B")] = '\0';
header.channels[2].name[strlen("G")] = '\0';
header.channels[3].name[strlen("R")] = '\0';
} else if (components == 3) {
#ifdef _MSC_VER
strncpy_s(header.channels[0].name, "B", 255);
strncpy_s(header.channels[1].name, "G", 255);
strncpy_s(header.channels[2].name, "R", 255);
#else
strncpy(header.channels[0].name, "B", 255);
strncpy(header.channels[1].name, "G", 255);
strncpy(header.channels[2].name, "R", 255);
#endif
header.channels[0].name[strlen("B")] = '\0';
header.channels[1].name[strlen("G")] = '\0';
header.channels[2].name[strlen("R")] = '\0';
} else {
#ifdef _MSC_VER
strncpy_s(header.channels[0].name, "A", 255);
#else
strncpy(header.channels[0].name, "A", 255);
#endif
header.channels[0].name[strlen("A")] = '\0';
}
header.pixel_types = static_cast<int *>(
malloc(sizeof(int) * static_cast<size_t>(header.num_channels)));
header.requested_pixel_types = static_cast<int *>(
malloc(sizeof(int) * static_cast<size_t>(header.num_channels)));
for (int i = 0; i < header.num_channels; i++) {
header.pixel_types[i] =
TINYEXR_PIXELTYPE_FLOAT; // pixel type of input image
if (save_as_fp16 > 0) {
header.requested_pixel_types[i] =
TINYEXR_PIXELTYPE_HALF; // save with half(fp16) pixel format
} else {
header.requested_pixel_types[i] =
TINYEXR_PIXELTYPE_FLOAT; // save with float(fp32) pixel format(i.e.
// no precision reduction)
}
}
unsigned char *mem_buf;
size_t mem_size = SaveEXRImageToMemory(&image, &header, &mem_buf, err);
if (mem_size == 0) {
return TINYEXR_ERROR_SERIALIZATION_FAILED;
}
free(header.channels);
free(header.pixel_types);
free(header.requested_pixel_types);
if (mem_size > size_t(std::numeric_limits<int>::max())) {
free(mem_buf);
return TINYEXR_ERROR_DATA_TOO_LARGE;
}
(*outbuf) = mem_buf;
return int(mem_size);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp # imm = 0x268
movl %ecx, %ebp
movl %edx, 0xc(%rsp)
movq 0x2a0(%rsp), %r12
cmpl $0x4, %ecx
ja 0x10f236
movl $0x1a, %eax
btl %ebp, %eax
jae 0x10f236
movl %r8d, %r15d
movl %esi, %ebx
movq %rdi, %r14
movq %r9, 0x90(%rsp)
leaq 0xe0(%rsp), %r12
movl $0x188, %edx # imm = 0x188
movq %r12, %rdi
xorl %esi, %esi
callq 0x14470
xorl %eax, %eax
movl 0xc(%rsp), %r13d
cmpl $0x10, %r13d
setge %al
cmpl $0x10, %ebx
leal (%rax,%rax,2), %eax
movl $0x3, %ecx
cmovll %eax, %ecx
imull %ebx, %r13d
movl %ecx, 0x7c(%r12)
xorps %xmm0, %xmm0
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movl %ebp, 0xc8(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movslq %r13d, %r12
cmpl $0x1, %ebp
jne 0x10f128
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0xc632e
movq 0x30(%rsp), %rdi
shlq $0x2, %r12
movq %r14, %rsi
movq %r12, %rdx
callq 0x14690
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
movq 0x2a0(%rsp), %r12
je 0x10f594
movq %rax, 0x10(%rsp)
jmp 0x10f344
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0xc632e
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
callq 0xc632e
leaq 0x60(%rsp), %rdi
movq %r12, %rsi
callq 0xc632e
leaq 0x78(%rsp), %rdi
movq %r12, %rsi
callq 0xc632e
testl %r13d, %r13d
je 0x10f1bc
movl %ebp, %eax
addq $0xc, %r14
shlq $0x2, %rax
xorl %ecx, %ecx
movss -0xc(%r14), %xmm0
movq 0x30(%rsp), %rdx
movss %xmm0, (%rdx,%rcx,4)
movss -0x8(%r14), %xmm0
movq 0x48(%rsp), %rdx
movss %xmm0, (%rdx,%rcx,4)
movss -0x4(%r14), %xmm0
movq 0x60(%rsp), %rdx
movss %xmm0, (%rdx,%rcx,4)
cmpl $0x4, %ebp
jne 0x10f1b1
movss (%r14), %xmm0
movq 0x78(%rsp), %rdx
movss %xmm0, (%rdx,%rcx,4)
incq %rcx
addq %rax, %r14
cmpq %rcx, %r12
jne 0x10f16d
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
cmpl $0x4, %ebp
jne 0x10f2f8
movq 0x78(%rsp), %rax
cmpq %rax, 0x80(%rsp)
movq 0x2a0(%rsp), %r12
je 0x10f594
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rax
cmpq %rax, 0x68(%rsp)
je 0x10f594
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rax
cmpq %rax, 0x50(%rsp)
je 0x10f594
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x10f594
movq %rax, 0x28(%rsp)
jmp 0x10f344
leaq 0xe0(%rsp), %rdi
callq 0x145d0
leaq 0xf0(%rsp), %rbx
leaq 0x1571e(%rip), %rsi # 0x124970
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x14900
movq %rbx, %rdi
movl %ebp, %esi
callq 0x14f70
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x14790
movsbl %al, %esi
movq %rbx, %rdi
callq 0x14050
movq %rax, %rdi
callq 0x145a0
leaq 0xf8(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x14e20
movq 0x30(%rsp), %rbx
testq %r12, %r12
je 0x10f2bb
movq %rbx, %rdi
callq 0x15080
movq %rax, (%r12)
leaq 0x40(%rsp), %rax
cmpq %rax, %rbx
je 0x10f2cd
movq %rbx, %rdi
callq 0x14760
movq 0x5cc54(%rip), %rsi # 0x16bf28
leaq 0xe0(%rsp), %rdi
callq 0x14610
leaq 0x160(%rsp), %rdi
callq 0x14290
movl $0xfffffffd, %ebx # imm = 0xFFFFFFFD
jmp 0x10f580
cmpl $0x3, %ebp
movq 0x2a0(%rsp), %r12
jne 0x10f344
movq 0x60(%rsp), %rax
cmpq %rax, 0x68(%rsp)
je 0x10f594
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rax
cmpq %rax, 0x50(%rsp)
je 0x10f594
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x10f594
movq %rax, 0x20(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, 0xb8(%rsp)
movl %ebx, 0xc0(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0xc4(%rsp)
movl %ebp, 0x158(%rsp)
imull $0x110, %ebp, %edi # imm = 0x110
callq 0x14b30
movq %rax, %rbx
movq %rax, 0x148(%rsp)
cmpl $0x4, %ebp
jne 0x10f3fc
leaq 0xcd6c(%rip), %rsi # 0x11c0f8
movl $0xff, %edx
movq %rbx, %rdi
callq 0x14410
leaq 0x110(%rbx), %rdi
leaq 0xc68b(%rip), %rsi # 0x11ba32
movl $0xff, %edx
callq 0x14410
leaq 0x220(%rbx), %rdi
leaq 0x14a93(%rip), %rsi # 0x123e52
movl $0xff, %edx
callq 0x14410
movq %rbx, %rdi
addq $0x330, %rdi # imm = 0x330
leaq 0x14d0b(%rip), %rsi # 0x1240e5
movl $0xff, %edx
callq 0x14410
xorl %eax, %eax
movb %al, 0x1(%rbx)
movb %al, 0x111(%rbx)
movb %al, 0x221(%rbx)
movl $0x331, %eax # imm = 0x331
jmp 0x10f473
cmpl $0x3, %ebp
jne 0x10f45a
leaq 0xc62a(%rip), %rsi # 0x11ba32
movl $0xff, %edx
movq %rbx, %rdi
callq 0x14410
leaq 0x110(%rbx), %rdi
leaq 0x14a2f(%rip), %rsi # 0x123e52
movl $0xff, %edx
callq 0x14410
movq %rbx, %rdi
addq $0x220, %rdi # imm = 0x220
leaq 0x14ca7(%rip), %rsi # 0x1240e5
movl $0xff, %edx
callq 0x14410
xorl %eax, %eax
movb %al, 0x1(%rbx)
movb %al, 0x111(%rbx)
movl $0x221, %eax # imm = 0x221
jmp 0x10f473
leaq 0xcc97(%rip), %rsi # 0x11c0f8
movl $0xff, %edx
movq %rbx, %rdi
callq 0x14410
movl $0x1, %eax
movb $0x0, (%rbx,%rax)
movslq %ebp, %r14
shlq $0x2, %r14
movq %r14, %rdi
callq 0x14b30
movq %rax, %rbx
movq %rax, 0x150(%rsp)
movq %r14, %rdi
callq 0x14b30
movq %rax, 0x160(%rsp)
testl %ebp, %ebp
jle 0x10f4d3
xorl %ecx, %ecx
testl %r15d, %r15d
movl 0x158(%rsp), %edx
setle %cl
incl %ecx
xorl %esi, %esi
testl %r15d, %r15d
movl $0x2, (%rbx,%rsi,4)
cmovlel %edx, %ebp
movl %ecx, (%rax,%rsi,4)
incq %rsi
movslq %ebp, %rdi
cmpq %rdi, %rsi
jl 0x10f4b8
leaq 0xd8(%rsp), %rsi
leaq 0xe0(%rsp), %rax
movq %rax, (%rsi)
leaq 0xa0(%rsp), %rdi
leaq 0x98(%rsp), %rcx
movl $0x1, %edx
movq %r12, %r8
callq 0x109b74
movq %rax, %rbx
testq %rax, %rax
je 0x10f54f
movq 0x148(%rsp), %rdi
callq 0x149b0
movq 0x150(%rsp), %rdi
callq 0x149b0
movq 0x160(%rsp), %rdi
callq 0x149b0
movq %rbx, %rax
shrq $0x1f, %rax
movq 0x98(%rsp), %rdi
je 0x10f556
callq 0x149b0
movl $0xfffffff2, %ebx # imm = 0xFFFFFFF2
jmp 0x10f561
movl $0xfffffff4, %ebx # imm = 0xFFFFFFF4
jmp 0x10f561
movq 0x90(%rsp), %rax
movq %rdi, (%rax)
movl $0x48, %r14d
movq 0x30(%rsp,%r14), %rdi
testq %rdi, %rdi
je 0x10f576
callq 0x14760
addq $-0x18, %r14
cmpq $-0x18, %r14
jne 0x10f567
movl %ebx, %eax
addq $0x268, %rsp # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc39f(%rip), %rdi # 0x11b93a
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x14d40
jmp 0x10f5aa
jmp 0x10f5d2
movq %rax, %rbx
movq 0x5c974(%rip), %rsi # 0x16bf28
leaq 0xe0(%rsp), %rdi
callq 0x14610
leaq 0x160(%rsp), %rdi
callq 0x14290
jmp 0x10f5f4
jmp 0x10f5d2
movq %rax, %rbx
movl $0x48, %r14d
movq 0x30(%rsp,%r14), %rdi
testq %rdi, %rdi
je 0x10f5ea
callq 0x14760
addq $-0x18, %r14
cmpq $-0x18, %r14
jne 0x10f5db
movq %rbx, %rdi
callq 0x14fb0
| /embree[P]embree/tutorials/common/image/tinyexr.h |
SaveEXR | int SaveEXR(const float *data, int width, int height, int components,
const int save_as_fp16, const char *outfilename, const char **err) {
if ((components == 1) || components == 3 || components == 4) {
// OK
} else {
std::stringstream ss;
ss << "Unsupported component value : " << components << std::endl;
tinyexr::SetErrorMessage(ss.str(), err);
return TINYEXR_ERROR_INVALID_ARGUMENT;
}
EXRHeader header;
InitEXRHeader(&header);
if ((width < 16) && (height < 16)) {
// No compression for small image.
header.compression_type = TINYEXR_COMPRESSIONTYPE_NONE;
} else {
header.compression_type = TINYEXR_COMPRESSIONTYPE_ZIP;
}
EXRImage image;
InitEXRImage(&image);
image.num_channels = components;
std::vector<float> images[4];
if (components == 1) {
images[0].resize(static_cast<size_t>(width * height));
memcpy(images[0].data(), data, sizeof(float) * size_t(width * height));
} else {
images[0].resize(static_cast<size_t>(width * height));
images[1].resize(static_cast<size_t>(width * height));
images[2].resize(static_cast<size_t>(width * height));
images[3].resize(static_cast<size_t>(width * height));
// Split RGB(A)RGB(A)RGB(A)... into R, G and B(and A) layers
for (size_t i = 0; i < static_cast<size_t>(width * height); i++) {
images[0][i] = data[static_cast<size_t>(components) * i + 0];
images[1][i] = data[static_cast<size_t>(components) * i + 1];
images[2][i] = data[static_cast<size_t>(components) * i + 2];
if (components == 4) {
images[3][i] = data[static_cast<size_t>(components) * i + 3];
}
}
}
float *image_ptr[4] = {0, 0, 0, 0};
if (components == 4) {
image_ptr[0] = &(images[3].at(0)); // A
image_ptr[1] = &(images[2].at(0)); // B
image_ptr[2] = &(images[1].at(0)); // G
image_ptr[3] = &(images[0].at(0)); // R
} else if (components == 3) {
image_ptr[0] = &(images[2].at(0)); // B
image_ptr[1] = &(images[1].at(0)); // G
image_ptr[2] = &(images[0].at(0)); // R
} else if (components == 1) {
image_ptr[0] = &(images[0].at(0)); // A
}
image.images = reinterpret_cast<unsigned char **>(image_ptr);
image.width = width;
image.height = height;
header.num_channels = components;
header.channels = static_cast<EXRChannelInfo *>(malloc(
sizeof(EXRChannelInfo) * static_cast<size_t>(header.num_channels)));
// Must be (A)BGR order, since most of EXR viewers expect this channel order.
if (components == 4) {
#ifdef _MSC_VER
strncpy_s(header.channels[0].name, "A", 255);
strncpy_s(header.channels[1].name, "B", 255);
strncpy_s(header.channels[2].name, "G", 255);
strncpy_s(header.channels[3].name, "R", 255);
#else
strncpy(header.channels[0].name, "A", 255);
strncpy(header.channels[1].name, "B", 255);
strncpy(header.channels[2].name, "G", 255);
strncpy(header.channels[3].name, "R", 255);
#endif
header.channels[0].name[strlen("A")] = '\0';
header.channels[1].name[strlen("B")] = '\0';
header.channels[2].name[strlen("G")] = '\0';
header.channels[3].name[strlen("R")] = '\0';
} else if (components == 3) {
#ifdef _MSC_VER
strncpy_s(header.channels[0].name, "B", 255);
strncpy_s(header.channels[1].name, "G", 255);
strncpy_s(header.channels[2].name, "R", 255);
#else
strncpy(header.channels[0].name, "B", 255);
strncpy(header.channels[1].name, "G", 255);
strncpy(header.channels[2].name, "R", 255);
#endif
header.channels[0].name[strlen("B")] = '\0';
header.channels[1].name[strlen("G")] = '\0';
header.channels[2].name[strlen("R")] = '\0';
} else {
#ifdef _MSC_VER
strncpy_s(header.channels[0].name, "A", 255);
#else
strncpy(header.channels[0].name, "A", 255);
#endif
header.channels[0].name[strlen("A")] = '\0';
}
header.pixel_types = static_cast<int *>(
malloc(sizeof(int) * static_cast<size_t>(header.num_channels)));
header.requested_pixel_types = static_cast<int *>(
malloc(sizeof(int) * static_cast<size_t>(header.num_channels)));
for (int i = 0; i < header.num_channels; i++) {
header.pixel_types[i] =
TINYEXR_PIXELTYPE_FLOAT; // pixel type of input image
if (save_as_fp16 > 0) {
header.requested_pixel_types[i] =
TINYEXR_PIXELTYPE_HALF; // save with half(fp16) pixel format
} else {
header.requested_pixel_types[i] =
TINYEXR_PIXELTYPE_FLOAT; // save with float(fp32) pixel format(i.e.
// no precision reduction)
}
}
int ret = SaveEXRImageToFile(&image, &header, outfilename, err);
if (ret != TINYEXR_SUCCESS) {
return ret;
}
free(header.channels);
free(header.pixel_types);
free(header.requested_pixel_types);
return ret;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp # imm = 0x258
movl %ecx, %ebp
movl %edx, 0xc(%rsp)
movq 0x290(%rsp), %r14
cmpl $0x4, %ecx
ja 0x10f814
movl $0x1a, %eax
btl %ebp, %eax
jae 0x10f814
movl %r8d, %r15d
movl %esi, %r13d
movq %rdi, %rbx
movq %r9, 0x98(%rsp)
leaq 0xd0(%rsp), %r14
movl $0x188, %edx # imm = 0x188
movq %r14, %rdi
xorl %esi, %esi
callq 0x14470
xorl %eax, %eax
movl 0xc(%rsp), %r12d
cmpl $0x10, %r12d
setge %al
cmpl $0x10, %r13d
leal (%rax,%rax,2), %eax
movl $0x3, %ecx
cmovll %eax, %ecx
imull %r13d, %r12d
movl %ecx, 0x7c(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movl %ebp, 0xc8(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movslq %r12d, %r14
cmpl $0x1, %ebp
jne 0x10f712
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0xc632e
movq 0x30(%rsp), %rdi
shlq $0x2, %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x14690
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x10fb2e
movq %rax, 0x10(%rsp)
jmp 0x10f919
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0xc632e
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
callq 0xc632e
leaq 0x60(%rsp), %rdi
movq %r14, %rsi
callq 0xc632e
leaq 0x78(%rsp), %rdi
movq %r14, %rsi
callq 0xc632e
testl %r12d, %r12d
je 0x10f7a2
movl %ebp, %eax
addq $0xc, %rbx
shlq $0x2, %rax
xorl %ecx, %ecx
movss -0xc(%rbx), %xmm0
movq 0x30(%rsp), %rdx
movss %xmm0, (%rdx,%rcx,4)
movss -0x8(%rbx), %xmm0
movq 0x48(%rsp), %rdx
movss %xmm0, (%rdx,%rcx,4)
movss -0x4(%rbx), %xmm0
movq 0x60(%rsp), %rdx
movss %xmm0, (%rdx,%rcx,4)
cmpl $0x4, %ebp
jne 0x10f797
movss (%rbx), %xmm0
movq 0x78(%rsp), %rdx
movss %xmm0, (%rdx,%rcx,4)
incq %rcx
addq %rax, %rbx
cmpq %rcx, %r14
jne 0x10f757
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
cmpl $0x4, %ebp
jne 0x10f8d5
movq 0x78(%rsp), %rax
cmpq %rax, 0x80(%rsp)
je 0x10fb2e
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rax
cmpq %rax, 0x68(%rsp)
je 0x10fb2e
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rax
cmpq %rax, 0x50(%rsp)
je 0x10fb2e
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x10fb2e
movq %rax, 0x28(%rsp)
jmp 0x10f919
leaq 0xd0(%rsp), %rdi
callq 0x145d0
leaq 0xe0(%rsp), %rbx
leaq 0x15140(%rip), %rsi # 0x124970
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x14900
movq %rbx, %rdi
movl %ebp, %esi
callq 0x14f70
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x14790
movsbl %al, %esi
movq %rbx, %rdi
callq 0x14050
movq %rax, %rdi
callq 0x145a0
leaq 0xe8(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x14e20
movq 0x30(%rsp), %rbx
testq %r14, %r14
je 0x10f898
movq %rbx, %rdi
callq 0x15080
movq %rax, (%r14)
leaq 0x40(%rsp), %rax
cmpq %rax, %rbx
je 0x10f8aa
movq %rbx, %rdi
callq 0x14760
movq 0x5c677(%rip), %rsi # 0x16bf28
leaq 0xd0(%rsp), %rdi
callq 0x14610
leaq 0x150(%rsp), %rdi
callq 0x14290
movl $0xfffffffd, %ebx # imm = 0xFFFFFFFD
jmp 0x10fb1a
cmpl $0x3, %ebp
jne 0x10f919
movq 0x60(%rsp), %rax
cmpq %rax, 0x68(%rsp)
je 0x10fb2e
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rax
cmpq %rax, 0x50(%rsp)
je 0x10fb2e
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x10fb2e
movq %rax, 0x20(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, 0xb8(%rsp)
movl %r13d, 0xc0(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0xc4(%rsp)
movl %ebp, 0x148(%rsp)
imull $0x110, %ebp, %edi # imm = 0x110
callq 0x14b30
movq %rax, %rbx
movq %rax, 0x138(%rsp)
cmpl $0x4, %ebp
jne 0x10f9d2
leaq 0xc796(%rip), %rsi # 0x11c0f8
movl $0xff, %edx
movq %rbx, %rdi
callq 0x14410
leaq 0x110(%rbx), %rdi
leaq 0xc0b5(%rip), %rsi # 0x11ba32
movl $0xff, %edx
callq 0x14410
leaq 0x220(%rbx), %rdi
leaq 0x144bd(%rip), %rsi # 0x123e52
movl $0xff, %edx
callq 0x14410
movq %rbx, %rdi
addq $0x330, %rdi # imm = 0x330
leaq 0x14735(%rip), %rsi # 0x1240e5
movl $0xff, %edx
callq 0x14410
xorl %eax, %eax
movb %al, 0x1(%rbx)
movb %al, 0x111(%rbx)
movb %al, 0x221(%rbx)
movl $0x331, %eax # imm = 0x331
jmp 0x10fa49
cmpl $0x3, %ebp
jne 0x10fa30
leaq 0xc054(%rip), %rsi # 0x11ba32
movl $0xff, %edx
movq %rbx, %rdi
callq 0x14410
leaq 0x110(%rbx), %rdi
leaq 0x14459(%rip), %rsi # 0x123e52
movl $0xff, %edx
callq 0x14410
movq %rbx, %rdi
addq $0x220, %rdi # imm = 0x220
leaq 0x146d1(%rip), %rsi # 0x1240e5
movl $0xff, %edx
callq 0x14410
xorl %eax, %eax
movb %al, 0x1(%rbx)
movb %al, 0x111(%rbx)
movl $0x221, %eax # imm = 0x221
jmp 0x10fa49
leaq 0xc6c1(%rip), %rsi # 0x11c0f8
movl $0xff, %edx
movq %rbx, %rdi
callq 0x14410
movl $0x1, %eax
movb $0x0, (%rbx,%rax)
movslq %ebp, %r14
shlq $0x2, %r14
movq %r14, %rdi
callq 0x14b30
movq %rax, %rbx
movq %rax, 0x140(%rsp)
movq %r14, %rdi
callq 0x14b30
movq %rax, 0x150(%rsp)
testl %ebp, %ebp
jle 0x10faa9
xorl %ecx, %ecx
testl %r15d, %r15d
movl 0x148(%rsp), %edx
setle %cl
incl %ecx
xorl %esi, %esi
testl %r15d, %r15d
movl $0x2, (%rbx,%rsi,4)
cmovlel %edx, %ebp
movl %ecx, (%rax,%rsi,4)
incq %rsi
movslq %ebp, %rdi
cmpq %rdi, %rsi
jl 0x10fa8e
leaq 0xa0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq 0x290(%rsp), %rcx
callq 0x10b3fc
movl %eax, %ebx
testl %eax, %eax
jne 0x10fafb
movq 0x138(%rsp), %rdi
callq 0x149b0
movq 0x140(%rsp), %rdi
callq 0x149b0
movq 0x150(%rsp), %rdi
callq 0x149b0
movl $0x48, %r14d
movq 0x30(%rsp,%r14), %rdi
testq %rdi, %rdi
je 0x10fb10
callq 0x14760
addq $-0x18, %r14
cmpq $-0x18, %r14
jne 0x10fb01
movl %ebx, %eax
addq $0x258, %rsp # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbe05(%rip), %rdi # 0x11b93a
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x14d40
jmp 0x10fb44
jmp 0x10fb6c
movq %rax, %rbx
movq 0x5c3da(%rip), %rsi # 0x16bf28
leaq 0xd0(%rsp), %rdi
callq 0x14610
leaq 0x150(%rsp), %rdi
callq 0x14290
jmp 0x10fb8e
jmp 0x10fb6c
movq %rax, %rbx
movl $0x48, %r14d
movq 0x30(%rsp,%r14), %rdi
testq %rdi, %rdi
je 0x10fb84
callq 0x14760
addq $-0x18, %r14
cmpq $-0x18, %r14
jne 0x10fb75
movq %rbx, %rdi
callq 0x14fb0
| /embree[P]embree/tutorials/common/image/tinyexr.h |
embree::loadEXR(embree::FileName const&) | Ref<Image> loadEXR(const FileName& fileName)
{
float* rgba; // width * height * RGBA
int width;
int height;
const char* err = NULL; // or nullptr in C++11
int ret = LoadEXR(&rgba, &width, &height, fileName.str().c_str(), &err);
if (ret != TINYEXR_SUCCESS) {
if (err) {
std::cerr << "ERR: " << err;
FreeEXRErrorMessage(err);
}
THROW_RUNTIME_ERROR("Could not load image " + fileName.str())
}
/* create image and fill with data */
Ref<Image> img = new Image4f(width,height,fileName);
for (ssize_t y=0; y<height; y++) {
for (ssize_t x=0; x<width; x++) {
float* pix = rgba + (y * width + x) * 4;
img->set(x,y,Color4(pix[0],pix[1],pix[2],1.0f));
}
}
free(rgba);
return img;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r13
movq %rdi, 0x48(%rsp)
leaq 0x10(%rsp), %rbx
movq $0x0, (%rbx)
leaq 0x30(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rsi), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x621de
movq (%r14), %rcx
leaq 0x50(%rsp), %rdi
leaq 0x1c(%rsp), %rsi
leaq 0x18(%rsp), %rdx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x1065aa
movl %eax, %ebx
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x10fc09
callq 0x14760
testl %ebx, %ebx
jne 0x10fd33
movl $0x48, %edi
callq 0x147e0
movq %rax, %r14
movslq 0x1c(%rsp), %r15
movslq 0x18(%rsp), %rbx
leaq 0x20(%rsp), %rdi
movq %rbp, (%rdi)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
callq 0x621de
movb $0x1, %r12b
leaq 0x20(%rsp), %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xf0208
movq 0x48(%rsp), %rax
movq %r14, (%rax)
movq (%r14), %rax
xorl %r12d, %r12d
movq %r14, %rdi
callq *0x10(%rax)
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x10fc79
callq 0x14760
testl %ebx, %ebx
jle 0x10fd12
movq %r15, %rax
shlq $0x4, %rax
movq %rax, 0x58(%rsp)
movl $0x4, %eax
movq %rax, 0x8(%rsp)
xorl %r13d, %r13d
leaq 0x20(%rsp), %rbp
movq %rbx, 0x60(%rsp)
testl %r15d, %r15d
jle 0x10fcf6
movq 0x8(%rsp), %r12
xorl %ebx, %ebx
movq 0x50(%rsp), %rax
movsd (%rax,%r12), %xmm0
movss -0x4(%rax,%r12), %xmm1
shufpd $0x2, 0xa1a5(%rip), %xmm1 # xmm1 = xmm1[0],mem[1]
shufps $0x4c, %xmm0, %xmm1 # xmm1 = xmm1[0,3],xmm0[0,1]
shufps $0x78, %xmm1, %xmm1 # xmm1 = xmm1[0,2,3,1]
movaps %xmm1, 0x20(%rsp)
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq *0x28(%rax)
incq %rbx
addq $0x10, %r12
cmpq %rbx, %r15
jne 0x10fcb0
incq %r13
movq 0x8(%rsp), %rax
addq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rbx
cmpq %rbx, %r13
jne 0x10fca4
movq 0x50(%rsp), %rdi
callq 0x149b0
movq 0x48(%rsp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x10(%rsp)
je 0x10fd72
movq 0x5c29e(%rip), %rbx # 0x16bfe0
leaq 0x14c46(%rip), %rsi # 0x12498f
movl $0x5, %edx
movq %rbx, %rdi
callq 0x14900
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x147a0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x10fd72
callq 0x149b0
movl $0x10, %edi
callq 0x143c0
movq %rax, %r14
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x621de
leaq 0x14bf1(%rip), %rsi # 0x124995
leaq 0x20(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x34e3b
movb $0x1, %r12b
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
callq 0x14e80
xorl %r12d, %r12d
movq 0x5c21b(%rip), %rsi # 0x16bfe8
movq 0x5c1a4(%rip), %rdx # 0x16bf78
movq %r14, %rdi
callq 0x14f60
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x10fdee
callq 0x14760
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x10fdfd
callq 0x14760
testb %r12b, %r12b
jne 0x10fe1b
jmp 0x10fe66
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x10fe1b
callq 0x14760
jmp 0x10fe1b
movq %rax, %rbx
movq %r14, %rdi
callq 0x145f0
jmp 0x10fe66
movq %rax, %rbx
jmp 0x10fe50
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x10fe53
jmp 0x10fe66
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %rbp, %rdi
je 0x10fe4b
callq 0x14760
testb %r12b, %r12b
je 0x10fe66
movq %r14, %rdi
callq 0x14760
jmp 0x10fe66
movq %rax, %rbx
movq (%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq %rbx, %rdi
callq 0x14fb0
movq %rax, %rdi
callq 0x34e30
| /embree[P]embree/tutorials/common/image/exr.cpp |
embree::storeEXR(embree::Ref<embree::Image> const&, embree::FileName const&) | void storeEXR(const Ref<Image>& img, const FileName& fileName)
{
std::vector<Col3f> rgb(img->width * img->height);
for (size_t y=0; y<img->height; ++y) {
for (size_t x=0; x<img->width; ++x) {
Color4 c = img->get(x, y);
rgb[y * img->width + x] = Col3f(c.r, c.g, c.b);
}
}
const char* err = NULL;
int ret = SaveEXR((float*)rgb.data(), img->width, img->height, 3, 0, fileName.str().c_str(), &err);
if (ret != TINYEXR_SUCCESS) {
if (err) {
std::cerr << "ERR: " << err;
FreeEXRErrorMessage(err);
}
THROW_RUNTIME_ERROR("Could not save image " + fileName.str())
}
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
movq 0x18(%rax), %rsi
imulq 0x10(%rax), %rsi
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x114e7c
movq (%r14), %rsi
cmpq $0x0, 0x18(%rsi)
je 0x10ff2a
movq %rbx, 0x38(%rsp)
xorl %ebp, %ebp
leaq 0x10(%rsp), %r15
xorl %r12d, %r12d
cmpq $0x0, 0x10(%rsi)
je 0x10ff13
movl $0x8, %ebx
xorl %r13d, %r13d
movq (%rsi), %rax
movq %r15, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq *0x20(%rax)
movss 0x18(%rsp), %xmm0
movq (%r14), %rax
movq 0x10(%rax), %rax
imulq %rbp, %rax
addq 0x40(%rsp), %rax
movsd 0x10(%rsp), %xmm1
movsd %xmm1, -0x8(%rbx,%rax)
movss %xmm0, (%rbx,%rax)
incq %r13
movq (%r14), %rsi
addq $0xc, %rbx
cmpq 0x10(%rsi), %r13
jb 0x10fecd
incq %r12
movq 0x18(%rsi), %r13
addq $0xc, %rbp
cmpq %r13, %r12
jb 0x10febe
movq 0x38(%rsp), %rbx
jmp 0x10ff2d
xorl %r13d, %r13d
movq $0x0, 0x8(%rsp)
movq 0x40(%rsp), %r14
movq 0x10(%rsi), %r15
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x621de
movq 0x10(%rsp), %r9
leaq 0x8(%rsp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
movl %r15d, %esi
movl %r13d, %edx
movl $0x3, %ecx
xorl %r8d, %r8d
callq 0x10f5fc
movl %eax, %ebp
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x10ff92
callq 0x14760
testl %ebp, %ebp
jne 0x10ffb4
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x10ffa5
callq 0x14760
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x8(%rsp)
jne 0x110024
movl $0x10, %edi
callq 0x143c0
movq %rax, %r14
leaq 0x68(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0x621de
leaq 0x149be(%rip), %rsi # 0x1249ab
leaq 0x10(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x34e3b
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x14e80
xorl %ebp, %ebp
movq 0x5bfd3(%rip), %rsi # 0x16bfe8
movq 0x5bf5c(%rip), %rdx # 0x16bf78
movq %r14, %rdi
callq 0x14f60
movq 0x5bfb5(%rip), %rdi # 0x16bfe0
leaq 0x1495d(%rip), %rsi # 0x12498f
movl $0x5, %edx
callq 0x14900
movq 0x8(%rsp), %rsi
movq 0x5bf98(%rip), %rdi # 0x16bfe0
callq 0x147a0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x10ffbc
callq 0x149b0
jmp 0x10ffbc
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x110077
callq 0x14760
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x110086
callq 0x14760
testb %bpl, %bpl
jne 0x1100a4
jmp 0x1100c9
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x1100a4
callq 0x14760
jmp 0x1100a4
movq %rax, %rbx
movq %r14, %rdi
callq 0x145f0
jmp 0x1100c9
jmp 0x1100c6
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x1100c9
callq 0x14760
jmp 0x1100c9
jmp 0x1100c6
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1100d8
callq 0x14760
movq %rbx, %rdi
callq 0x14fb0
| /embree[P]embree/tutorials/common/image/exr.cpp |
tinyexr::ReconstructTileOffsets(tinyexr::OffsetData&, TEXRHeader const*, unsigned char const*, unsigned char const*, unsigned long, bool, bool) | static void ReconstructTileOffsets(OffsetData& offset_data,
const EXRHeader* exr_header,
const unsigned char* head, const unsigned char* marker, const size_t /*size*/,
bool isMultiPartFile,
bool isDeep) {
int numXLevels = offset_data.num_x_levels;
for (unsigned int l = 0; l < offset_data.offsets.size(); ++l) {
for (unsigned int dy = 0; dy < offset_data.offsets[l].size(); ++dy) {
for (unsigned int dx = 0; dx < offset_data.offsets[l][dy].size(); ++dx) {
tinyexr::tinyexr_uint64 tileOffset = tinyexr::tinyexr_uint64(marker - head);
if (isMultiPartFile) {
//int partNumber;
marker += sizeof(int);
}
int tileX;
memcpy(&tileX, marker, sizeof(int));
tinyexr::swap4(&tileX);
marker += sizeof(int);
int tileY;
memcpy(&tileY, marker, sizeof(int));
tinyexr::swap4(&tileY);
marker += sizeof(int);
int levelX;
memcpy(&levelX, marker, sizeof(int));
tinyexr::swap4(&levelX);
marker += sizeof(int);
int levelY;
memcpy(&levelY, marker, sizeof(int));
tinyexr::swap4(&levelY);
marker += sizeof(int);
if (isDeep) {
tinyexr::tinyexr_int64 packed_offset_table_size;
memcpy(&packed_offset_table_size, marker, sizeof(tinyexr::tinyexr_int64));
tinyexr::swap8(reinterpret_cast<tinyexr::tinyexr_uint64*>(&packed_offset_table_size));
marker += sizeof(tinyexr::tinyexr_int64);
tinyexr::tinyexr_int64 packed_sample_size;
memcpy(&packed_sample_size, marker, sizeof(tinyexr::tinyexr_int64));
tinyexr::swap8(reinterpret_cast<tinyexr::tinyexr_uint64*>(&packed_sample_size));
marker += sizeof(tinyexr::tinyexr_int64);
// next Int64 is unpacked sample size - skip that too
marker += packed_offset_table_size + packed_sample_size + 8;
} else {
int dataSize;
memcpy(&dataSize, marker, sizeof(int));
tinyexr::swap4(&dataSize);
marker += sizeof(int);
marker += dataSize;
}
if (!isValidTile(exr_header, offset_data,
tileX, tileY, levelX, levelY))
return;
int level_idx = LevelIndex(levelX, levelY, exr_header->tile_level_mode, numXLevels);
offset_data.offsets[size_t(level_idx)][size_t(tileY)][size_t(tileX)] = tileOffset;
}
}
}
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %r9d, -0x24(%rsp)
movq %rdx, -0x10(%rsp)
movq %rsi, -0x8(%rsp)
movq (%rdi), %r10
movq 0x8(%rdi), %rdx
cmpq %r10, %rdx
je 0x1105c2
movl 0x18(%rdi), %eax
movl %eax, -0x28(%rsp)
movzbl %r8b, %r8d
shll $0x2, %r8d
movq $0x0, -0x30(%rsp)
movq -0x30(%rsp), %rax
leaq (%rax,%rax,2), %rsi
movq (%r10,%rsi,8), %rax
movq %rsi, -0x20(%rsp)
cmpq %rax, 0x8(%r10,%rsi,8)
je 0x110594
xorl %r9d, %r9d
movq %r9, -0x18(%rsp)
leaq (%r9,%r9,2), %r12
movq 0x8(%rax,%r12,8), %rdx
cmpq (%rax,%r12,8), %rdx
je 0x110560
movl $0x1, %ebp
movq %rcx, %r13
leaq (%rcx,%r8), %rax
cmpb $0x0, -0x24(%rsp)
je 0x110371
movq 0x18(%rax), %rcx
addq 0x10(%rax), %rax
addq %rax, %rcx
addq $0x28, %rcx
jmp 0x11037c
movslq 0x10(%rax), %rcx
addq %rax, %rcx
addq $0x14, %rcx
movl (%r13,%r8), %eax
movl 0x4(%r13,%r8), %ebx
movl 0x8(%r13,%r8), %r15d
movl 0xc(%r13,%r8), %r11d
movl %r11d, %esi
orl %r15d, %esi
movl %eax, %edx
orl %ebx, %edx
orl %esi, %edx
js 0x1105c2
movslq 0x18(%rdi), %rdx
movl 0x1c(%rdi), %r9d
movq -0x8(%rsp), %r14
movl 0x44(%r14), %r14d
cmpl $0x2, %r14d
je 0x110497
cmpl $0x1, %r14d
je 0x110419
testl %r14d, %r14d
jne 0x1105c2
testl %esi, %esi
jne 0x1105c2
cmpq %r10, 0x8(%rdi)
je 0x1105c2
movq (%r10), %rdx
movq 0x8(%r10), %rsi
subq %rdx, %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %r9 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r9, %rsi
cmpq %rbx, %rsi
jbe 0x1105c2
leaq (%rbx,%rbx,2), %rsi
movq 0x8(%rdx,%rsi,8), %r9
subq (%rdx,%rsi,8), %r9
sarq $0x3, %r9
xorl %r15d, %r15d
jmp 0x110489
cmpl %r15d, %edx
jle 0x1105c2
cmpl %r11d, %r9d
jle 0x1105c2
movq 0x8(%rdi), %rdx
subq %r10, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
cmpq %r15, %rdx
jbe 0x1105c2
leaq (%r15,%r15,2), %rsi
movq (%r10,%rsi,8), %rdx
movq 0x8(%r10,%rsi,8), %rsi
subq %rdx, %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %r9 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r9, %rsi
cmpq %rbx, %rsi
jbe 0x1105c2
leaq (%rbx,%rbx,2), %rsi
movq 0x8(%rdx,%rsi,8), %r9
subq (%rdx,%rsi,8), %r9
sarq $0x3, %r9
cmpq %rax, %r9
ja 0x110519
jmp 0x1105c2
cmpl %r15d, %edx
jle 0x1105c2
cmpl %r11d, %r9d
jle 0x1105c2
imulq %r11, %rdx
addq %r15, %rdx
movq 0x8(%rdi), %rsi
subq %r10, %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %r9 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r9, %rsi
cmpq %rdx, %rsi
jbe 0x1105c2
leaq (%rdx,%rdx,2), %rsi
movq (%r10,%rsi,8), %rdx
movq 0x8(%r10,%rsi,8), %rsi
subq %rdx, %rsi
sarq $0x3, %rsi
imulq %r9, %rsi
cmpq %rbx, %rsi
jbe 0x1105c2
leaq (%rbx,%rbx,2), %rsi
movq 0x8(%rdx,%rsi,8), %r9
subq (%rdx,%rsi,8), %r9
sarq $0x3, %r9
cmpq %rax, %r9
jbe 0x1105c2
imull -0x28(%rsp), %r11d
addl %r15d, %r11d
movl %r11d, %r15d
subq -0x10(%rsp), %r13
movslq %r15d, %rdx
leaq (%rdx,%rdx,2), %rdx
movslq %ebx, %rsi
movq (%r10,%rdx,8), %rdx
leaq (%rsi,%rsi,2), %rsi
cltq
movq (%rdx,%rsi,8), %rdx
movq %r13, (%rdx,%rax,8)
movq (%rdi), %r10
movq -0x20(%rsp), %rax
movq (%r10,%rax,8), %rax
movq 0x8(%rax,%r12,8), %rdx
subq (%rax,%r12,8), %rdx
movl %ebp, %esi
sarq $0x3, %rdx
incl %ebp
cmpq %rsi, %rdx
ja 0x110352
movq -0x18(%rsp), %r9
incl %r9d
movq -0x20(%rsp), %rdx
movq 0x8(%r10,%rdx,8), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
cmpq %r9, %rdx
ja 0x110335
movq 0x8(%rdi), %rdx
movq -0x30(%rsp), %r9
incl %r9d
movq %rdx, %rax
subq %r10, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rax
movq %r9, -0x30(%rsp)
cmpq %r9, %rax
ja 0x110315
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/tinyexr.h |
tinyexr::WriteAttributeToMemory(std::vector<unsigned char, std::allocator<unsigned char>>*, char const*, char const*, unsigned char const*, int) | static void WriteAttributeToMemory(std::vector<unsigned char> *out,
const char *name, const char *type,
const unsigned char *data, int len) {
out->insert(out->end(), name, name + strlen(name) + 1);
out->insert(out->end(), type, type + strlen(type) + 1);
int outLen = len;
tinyexr::swap4(&outLen);
out->insert(out->end(), reinterpret_cast<unsigned char *>(&outLen),
reinterpret_cast<unsigned char *>(&outLen) + sizeof(int));
out->insert(out->end(), data, data + len);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq 0x8(%rdi), %r13
movq %rsi, %rdi
callq 0x14390
leaq (%r12,%rax), %rcx
incq %rcx
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x11582c
movq 0x8(%r14), %r12
movq %r15, %rdi
callq 0x14390
leaq (%r15,%rax), %rcx
incq %rcx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x11582c
leaq 0x8(%rsp), %rcx
movl %ebp, -0x4(%rcx)
movq 0x8(%r14), %rsi
leaq 0x4(%rsp), %rdx
movq %r14, %rdi
callq 0x115f96
movq 0x8(%r14), %rsi
movslq %ebp, %rcx
addq %rbx, %rcx
movq %r14, %rdi
movq %rbx, %rdx
callq 0x116178
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/tinyexr.h |
tinyexr::EncodePixelData(std::vector<unsigned char, std::allocator<unsigned char>>&, unsigned char const* const*, int, int, int, int, int, int, int, unsigned long, std::vector<tinyexr::TChannelInfo, std::allocator<tinyexr::TChannelInfo>> const&, std::vector<unsigned long, std::allocator<unsigned long>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, void const*) | static bool EncodePixelData(/* out */ std::vector<unsigned char>& out_data,
const unsigned char* const* images,
int compression_type,
int /*line_order*/,
int width, // for tiled : tile.width
int /*height*/, // for tiled : header.tile_size_y
int x_stride, // for tiled : header.tile_size_x
int line_no, // for tiled : 0
int num_lines, // for tiled : tile.height
size_t pixel_data_size,
const std::vector<ChannelInfo>& channels,
const std::vector<size_t>& channel_offset_list,
std::string *err,
const void* compression_param = 0) // zfp compression param
{
size_t buf_size = static_cast<size_t>(width) *
static_cast<size_t>(num_lines) *
static_cast<size_t>(pixel_data_size);
//int last2bit = (buf_size & 3);
// buf_size must be multiple of four
//if(last2bit) buf_size += 4 - last2bit;
std::vector<unsigned char> buf(buf_size);
size_t start_y = static_cast<size_t>(line_no);
for (size_t c = 0; c < channels.size(); c++) {
if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
if (channels[c].requested_pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
for (int y = 0; y < num_lines; y++) {
// Assume increasing Y
float *line_ptr = reinterpret_cast<float *>(&buf.at(
static_cast<size_t>(pixel_data_size * size_t(y) * size_t(width)) +
channel_offset_list[c] *
static_cast<size_t>(width)));
for (int x = 0; x < width; x++) {
tinyexr::FP16 h16;
h16.u = reinterpret_cast<const unsigned short * const *>(
images)[c][(y + start_y) * size_t(x_stride) + size_t(x)];
tinyexr::FP32 f32 = half_to_float(h16);
tinyexr::swap4(&f32.f);
// line_ptr[x] = f32.f;
tinyexr::cpy4(line_ptr + x, &(f32.f));
}
}
} else if (channels[c].requested_pixel_type == TINYEXR_PIXELTYPE_HALF) {
for (int y = 0; y < num_lines; y++) {
// Assume increasing Y
unsigned short *line_ptr = reinterpret_cast<unsigned short *>(
&buf.at(static_cast<size_t>(pixel_data_size * y *
width) +
channel_offset_list[c] *
static_cast<size_t>(width)));
for (int x = 0; x < width; x++) {
unsigned short val = reinterpret_cast<const unsigned short * const *>(
images)[c][(y + start_y) * x_stride + x];
tinyexr::swap2(&val);
// line_ptr[x] = val;
tinyexr::cpy2(line_ptr + x, &val);
}
}
} else {
if (err) {
(*err) += "Invalid requested_pixel_type.\n";
}
return false;
}
} else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
if (channels[c].requested_pixel_type == TINYEXR_PIXELTYPE_HALF) {
for (int y = 0; y < num_lines; y++) {
// Assume increasing Y
unsigned short *line_ptr = reinterpret_cast<unsigned short *>(
&buf.at(static_cast<size_t>(pixel_data_size * y *
width) +
channel_offset_list[c] *
static_cast<size_t>(width)));
for (int x = 0; x < width; x++) {
tinyexr::FP32 f32;
f32.f = reinterpret_cast<const float * const *>(
images)[c][(y + start_y) * x_stride + x];
tinyexr::FP16 h16;
h16 = float_to_half_full(f32);
tinyexr::swap2(reinterpret_cast<unsigned short *>(&h16.u));
// line_ptr[x] = h16.u;
tinyexr::cpy2(line_ptr + x, &(h16.u));
}
}
} else if (channels[c].requested_pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
for (int y = 0; y < num_lines; y++) {
// Assume increasing Y
float *line_ptr = reinterpret_cast<float *>(&buf.at(
static_cast<size_t>(pixel_data_size * y * width) +
channel_offset_list[c] *
static_cast<size_t>(width)));
for (int x = 0; x < width; x++) {
float val = reinterpret_cast<const float * const *>(
images)[c][(y + start_y) * x_stride + x];
tinyexr::swap4(&val);
// line_ptr[x] = val;
tinyexr::cpy4(line_ptr + x, &val);
}
}
} else {
if (err) {
(*err) += "Invalid requested_pixel_type.\n";
}
return false;
}
} else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
for (int y = 0; y < num_lines; y++) {
// Assume increasing Y
unsigned int *line_ptr = reinterpret_cast<unsigned int *>(&buf.at(
static_cast<size_t>(pixel_data_size * y * width) +
channel_offset_list[c] * static_cast<size_t>(width)));
for (int x = 0; x < width; x++) {
unsigned int val = reinterpret_cast<const unsigned int * const *>(
images)[c][(y + start_y) * x_stride + x];
tinyexr::swap4(&val);
// line_ptr[x] = val;
tinyexr::cpy4(line_ptr + x, &val);
}
}
}
}
if (compression_type == TINYEXR_COMPRESSIONTYPE_NONE) {
// 4 byte: scan line
// 4 byte: data size
// ~ : pixel data(uncompressed)
out_data.insert(out_data.end(), buf.begin(), buf.end());
} else if ((compression_type == TINYEXR_COMPRESSIONTYPE_ZIPS) ||
(compression_type == TINYEXR_COMPRESSIONTYPE_ZIP)) {
#if TINYEXR_USE_MINIZ
std::vector<unsigned char> block(mz_compressBound(
static_cast<unsigned long>(buf.size())));
#elif TINYEXR_USE_STB_ZLIB
// there is no compressBound() function, so we use a value that
// is grossly overestimated, but should always work
std::vector<unsigned char> block(256 + 2 * buf.size());
#else
std::vector<unsigned char> block(
compressBound(static_cast<uLong>(buf.size())));
#endif
tinyexr::tinyexr_uint64 outSize = block.size();
if (!tinyexr::CompressZip(&block.at(0), outSize,
reinterpret_cast<const unsigned char *>(&buf.at(0)),
static_cast<unsigned long>(buf.size()))) {
if (err) {
(*err) += "Zip compresssion failed.\n";
}
return false;
}
// 4 byte: scan line
// 4 byte: data size
// ~ : pixel data(compressed)
unsigned int data_len = static_cast<unsigned int>(outSize); // truncate
out_data.insert(out_data.end(), block.begin(), block.begin() + data_len);
} else if (compression_type == TINYEXR_COMPRESSIONTYPE_RLE) {
// (buf.size() * 3) / 2 would be enough.
std::vector<unsigned char> block((buf.size() * 3) / 2);
tinyexr::tinyexr_uint64 outSize = block.size();
tinyexr::CompressRle(&block.at(0), outSize,
reinterpret_cast<const unsigned char *>(&buf.at(0)),
static_cast<unsigned long>(buf.size()));
// 4 byte: scan line
// 4 byte: data size
// ~ : pixel data(compressed)
unsigned int data_len = static_cast<unsigned int>(outSize); // truncate
out_data.insert(out_data.end(), block.begin(), block.begin() + data_len);
} else if (compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
#if TINYEXR_USE_PIZ
unsigned int bufLen =
8192 + static_cast<unsigned int>(
2 * static_cast<unsigned int>(
buf.size())); // @fixme { compute good bound. }
std::vector<unsigned char> block(bufLen);
unsigned int outSize = static_cast<unsigned int>(block.size());
CompressPiz(&block.at(0), &outSize,
reinterpret_cast<const unsigned char *>(&buf.at(0)),
buf.size(), channels, width, num_lines);
// 4 byte: scan line
// 4 byte: data size
// ~ : pixel data(compressed)
unsigned int data_len = outSize;
out_data.insert(out_data.end(), block.begin(), block.begin() + data_len);
#else
if (err) {
(*err) += "PIZ compression is disabled in this build.\n";
}
return false;
#endif
} else if (compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
#if TINYEXR_USE_ZFP
const ZFPCompressionParam* zfp_compression_param = reinterpret_cast<const ZFPCompressionParam*>(compression_param);
std::vector<unsigned char> block;
unsigned int outSize;
tinyexr::CompressZfp(
&block, &outSize, reinterpret_cast<const float *>(&buf.at(0)),
width, num_lines, static_cast<int>(channels.size()), *zfp_compression_param);
// 4 byte: scan line
// 4 byte: data size
// ~ : pixel data(compressed)
unsigned int data_len = outSize;
out_data.insert(out_data.end(), block.begin(), block.begin() + data_len);
#else
if (err) {
(*err) += "ZFP compression is disabled in this build.\n";
}
(void)compression_param;
return false;
#endif
} else {
return false;
}
return true;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp # imm = 0x148
movl %r9d, 0x18(%rsp)
movl %r8d, 0x8(%rsp)
movl %ecx, %r14d
movl %edx, 0xb8(%rsp)
movq %rsi, %r12
movq %rdi, 0xc8(%rsp)
movslq 0x180(%rsp), %rsi
movq 0x1a0(%rsp), %rbp
movq 0x190(%rsp), %rbx
movq 0x188(%rsp), %r13
movslq %ecx, %r15
movq %rsi, 0x20(%rsp)
imulq %r15, %rsi
imulq %r13, %rsi
leaq 0x68(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0xcc4f0
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
movl %r14d, 0x28(%rsp)
je 0x110bf0
movl %r14d, %r9d
movq %r13, %rbx
movslq 0x18(%rsp), %rcx
movslq 0x8(%rsp), %rdx
movl 0x20(%rsp), %esi
movq %rsi, 0x8(%rsp)
movl %r14d, %r10d
imulq %rdx, %rcx
leaq (,%rcx,4), %rsi
movq %rsi, 0xa0(%rsp)
leaq (,%rdx,4), %rsi
movq %rsi, 0x18(%rsp)
addq %rcx, %rcx
movq %rcx, 0x50(%rsp)
addq %rdx, %rdx
movq %rdx, 0x58(%rsp)
xorl %r13d, %r13d
movl $0xf800000, %edi # imm = 0xF800000
movss 0x13b9c(%rip), %xmm0 # 0x1242e0
imulq $0x38, %r13, %rdx
leaq (%rax,%rdx), %rcx
movl 0x20(%rax,%rdx), %eax
cmpl $0x2, %eax
je 0x1108b2
cmpl $0x1, %eax
je 0x110807
testl %eax, %eax
jne 0x110bc0
cmpl $0x0, 0x20(%rsp)
jle 0x110bc0
movq 0xa0(%rsp), %rax
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r8, %rsi
imulq %rbx, %rsi
movq 0x198(%rsp), %rdx
movq (%rdx), %rdx
movq (%rdx,%r13,8), %r11
addq %r11, %rsi
imulq %r15, %rsi
movq 0x68(%rsp), %rbx
movq 0x70(%rsp), %rdx
subq %rbx, %rdx
cmpq %rsi, %rdx
jbe 0x1121b6
testl %r9d, %r9d
jle 0x1107e3
addq %rcx, %r11
imulq %r15, %r11
leaq (%rbx,%r11), %rdx
addq $0x3, %rdx
xorl %esi, %esi
movq (%r12,%r13,8), %r9
addq %rax, %r9
movl (%r9,%rsi,4), %r9d
movl %r9d, -0x3(%rdx,%rsi,4)
incq %rsi
cmpq %rsi, %r10
jne 0x1107cb
incq %r8
movq 0x188(%rsp), %rbx
addq %rbx, %rcx
addq 0x18(%rsp), %rax
cmpq 0x8(%rsp), %r8
movl 0x28(%rsp), %r9d
jne 0x110782
jmp 0x110bc0
movl 0x24(%rcx), %eax
cmpl $0x2, %eax
je 0x110964
cmpl $0x1, %eax
jne 0x111007
cmpl $0x0, 0x20(%rsp)
jle 0x110bc0
movq 0x50(%rsp), %rax
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r8, %rsi
imulq %rbx, %rsi
movq 0x198(%rsp), %rdx
movq (%rdx), %rdx
movq (%rdx,%r13,8), %r11
addq %r11, %rsi
imulq %r15, %rsi
movq 0x68(%rsp), %rbx
movq 0x70(%rsp), %rdx
subq %rbx, %rdx
cmpq %rsi, %rdx
jbe 0x1121ee
testl %r9d, %r9d
jle 0x110893
addq %rcx, %r11
imulq %r15, %r11
leaq (%rbx,%r11), %rdx
incq %rdx
xorl %esi, %esi
movq (%r12,%r13,8), %r11
addq %rax, %r11
movzwl (%r11,%rsi,2), %r11d
movw %r11w, -0x1(%rdx,%rsi,2)
incq %rsi
cmpq %rsi, %r10
jne 0x110879
incq %r8
movq 0x188(%rsp), %rbx
addq %rbx, %rcx
addq 0x58(%rsp), %rax
cmpq 0x8(%rsp), %r8
jne 0x110831
jmp 0x110bc0
movl 0x24(%rcx), %eax
cmpl $0x1, %eax
je 0x110a67
cmpl $0x2, %eax
jne 0x111007
cmpl $0x0, 0x20(%rsp)
jle 0x110bc0
movq 0xa0(%rsp), %rax
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r8, %rsi
imulq %rbx, %rsi
movq 0x198(%rsp), %rdx
movq (%rdx), %rdx
movq (%rdx,%r13,8), %r11
addq %r11, %rsi
imulq %r15, %rsi
movq 0x68(%rsp), %rbx
movq 0x70(%rsp), %rdx
subq %rbx, %rdx
cmpq %rsi, %rdx
jbe 0x1121c4
testl %r9d, %r9d
jle 0x110940
addq %rcx, %r11
imulq %r15, %r11
leaq (%rbx,%r11), %rdx
addq $0x3, %rdx
xorl %esi, %esi
movq (%r12,%r13,8), %r9
addq %rax, %r9
movl (%r9,%rsi,4), %r9d
movl %r9d, -0x3(%rdx,%rsi,4)
incq %rsi
cmpq %rsi, %r10
jne 0x110928
incq %r8
movq 0x188(%rsp), %rbx
addq %rbx, %rcx
addq 0x18(%rsp), %rax
cmpq 0x8(%rsp), %r8
movl 0x28(%rsp), %r9d
jne 0x1108df
jmp 0x110bc0
cmpl $0x0, 0x20(%rsp)
jle 0x110bc0
movq 0x50(%rsp), %rax
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r8, %rsi
imulq %rbx, %rsi
movq 0x198(%rsp), %rdx
movq (%rdx), %rdx
movq (%rdx,%r13,8), %r11
addq %r11, %rsi
imulq %r15, %rsi
movq 0x68(%rsp), %rbx
movq 0x70(%rsp), %rdx
subq %rbx, %rdx
cmpq %rsi, %rdx
jbe 0x1121e0
testl %r9d, %r9d
jle 0x110a3c
addq %rcx, %r11
imulq %r15, %r11
leaq (%rbx,%r11), %rdx
addq $0x3, %rdx
xorl %esi, %esi
movq (%r12,%r13,8), %r11
addq %rax, %r11
movzwl (%r11,%rsi,2), %r11d
movl %r11d, %ebx
shll $0xd, %ebx
movl %ebx, %ebp
andl %edi, %ebp
cmpl %edi, %ebp
jne 0x1109e8
orl $0x70000000, %ebx # imm = 0x70000000
jmp 0x110a0c
testl %ebp, %ebp
je 0x1109fa
andl $0xfffe000, %ebx # imm = 0xFFFE000
addl $0x38000000, %ebx # imm = 0x38000000
jmp 0x110a0c
orl $0x38800000, %ebx # imm = 0x38800000
movd %ebx, %xmm1
addss %xmm0, %xmm1
movd %xmm1, %ebx
movswl %r11w, %r11d
andl $0x80000000, %r11d # imm = 0x80000000
orl %ebx, %r11d
movl %ebx, %ebp
shrl $0x10, %ebp
shrl $0x18, %r11d
movb %bl, -0x3(%rdx,%rsi,4)
movb %bh, -0x2(%rdx,%rsi,4)
movb %bpl, -0x1(%rdx,%rsi,4)
movb %r11b, (%rdx,%rsi,4)
incq %rsi
cmpq %rsi, %r10
jne 0x1109c6
incq %r8
movq 0x188(%rsp), %rbx
addq %rbx, %rcx
addq 0x58(%rsp), %rax
cmpq 0x8(%rsp), %r8
movq 0x1a0(%rsp), %rbp
jne 0x110979
jmp 0x110bc0
cmpl $0x0, 0x20(%rsp)
jle 0x110bc0
movq 0xa0(%rsp), %r11
xorl %r8d, %r8d
xorl %eax, %eax
movq %rax, %rsi
imulq %rbx, %rsi
movq 0x198(%rsp), %rcx
movq (%rcx), %rcx
movq (%rcx,%r13,8), %rcx
addq %rcx, %rsi
imulq %r15, %rsi
movq 0x68(%rsp), %rbx
movq 0x70(%rsp), %rdx
subq %rbx, %rdx
cmpq %rsi, %rdx
jbe 0x1121d2
testl %r9d, %r9d
jle 0x110b9a
addq %r8, %rcx
imulq %r15, %rcx
leaq (%rbx,%rcx), %rdx
incq %rdx
xorl %esi, %esi
movq (%r12,%r13,8), %rcx
addq %r11, %rcx
movl (%rcx,%rsi,4), %ebx
movl %ebx, %ecx
shrl $0x17, %ecx
movzbl %cl, %ebp
testb %bpl, %bpl
je 0x110b7b
cmpl $0xff, %ebp
jne 0x110b02
xorl %ebp, %ebp
testl $0x7fffff, %ebx # imm = 0x7FFFFF
setne %bpl
orl $0x3e, %ebp
shll $0x9, %ebp
jmp 0x110b7b
movl $0x7c00, %r14d # imm = 0x7C00
cmpl $0x8e, %ebp
ja 0x110b71
cmpl $0x70, %ebp
ja 0x110b4b
xorl %r14d, %r14d
cmpl $0x66, %ebp
jb 0x110b71
movl %ebx, %r9d
andl $0x7fffff, %r9d # imm = 0x7FFFFF
orl $0x800000, %r9d # imm = 0x800000
movb $0x7e, %cl
subb %bpl, %cl
movl %r9d, %r14d
shrl %cl, %r14d
movl $0x7d, %ecx
subl %ebp, %ecx
btl %ecx, %r9d
movl 0x28(%rsp), %r9d
jmp 0x110b6d
andl $0x1f, %ecx
shll $0xa, %ecx
movl %ebx, %r14d
shrl $0xd, %r14d
andl $0x3ff, %r14d # imm = 0x3FF
orl %ecx, %r14d
xorl $0x4000, %r14d # imm = 0x4000
btl $0xc, %ebx
adcl $0x0, %r14d
andl $0x7fff, %r14d # imm = 0x7FFF
movl %r14d, %ebp
shrl $0x10, %ebx
andl $0x8000, %ebx # imm = 0x8000
orl %ebp, %ebx
movb %bpl, -0x1(%rdx,%rsi,2)
movb %bh, (%rdx,%rsi,2)
incq %rsi
cmpq %rsi, %r10
jne 0x110acb
incq %rax
movq 0x188(%rsp), %rbx
addq %rbx, %r8
addq 0x18(%rsp), %r11
cmpq 0x8(%rsp), %rax
movq 0x1a0(%rsp), %rbp
jne 0x110a7f
incq %r13
movq 0x190(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $0x6db6db6db6db6db7, %rdx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rdx, %rcx
cmpq %rcx, %r13
jb 0x110744
movl 0xb8(%rsp), %ecx
testl %ecx, %ecx
je 0x110d9e
movl %ecx, %eax
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0x110dbe
movq 0x70(%rsp), %rax
subq 0x68(%rsp), %rax
leaq 0x100(,%rax,2), %rsi
leaq 0x80(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0xcc4f0
movq 0x80(%rsp), %rbx
movq 0x88(%rsp), %r14
subq %rbx, %r14
je 0x1121fc
movq 0x68(%rsp), %r12
movq 0x70(%rsp), %r13
movq %r13, %r15
subq %r12, %r15
je 0x1121fc
leaq 0x30(%rsp), %rdi
leaq 0xf0(%rsp), %rdx
movq %r15, %rsi
callq 0xcc4f0
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rax
cmpq %rdi, %rax
je 0x11220e
testq %r15, %r15
jle 0x110cc9
leaq 0x1(%r15), %rax
shrq %rax
addq %rdi, %rax
xorl %ecx, %ecx
leaq (%r12,%rcx,2), %rdx
incq %rdx
movb -0x1(%rdx), %sil
movb %sil, (%rdi,%rcx)
cmpq %r13, %rdx
jae 0x110cbf
movb (%rdx), %sil
movb %sil, (%rax,%rcx)
incq %rcx
incq %rdx
cmpq %r13, %rdx
jb 0x110c99
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rax
cmpq %rdi, %rax
je 0x112220
cmpq $0x2, %r15
jl 0x110d03
leaq (%rdi,%r15), %rax
movb (%rdi), %cl
incq %rdi
movb (%rdi), %dl
movl %edx, %esi
subb %cl, %sil
addb $-0x80, %sil
movb %sil, (%rdi)
incq %rdi
movl %edx, %ecx
cmpq %rax, %rdi
jb 0x110ce1
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rax
cmpq %rdi, %rax
je 0x112232
leaq 0xf0(%rsp), %rdx
movl %r15d, %esi
movl $0x8, %ecx
callq 0xf45af
movq %rax, %r13
testq %rax, %rax
je 0x110d62
movslq 0xf0(%rsp), %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x14690
movq %r13, %rdi
callq 0x149b0
movslq 0xf0(%rsp), %r14
cmpq %r14, %r15
ja 0x110d62
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x14690
movq %r15, %r14
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x110d71
callq 0x14760
testq %r13, %r13
je 0x111024
movq 0xc8(%rsp), %rdi
movq 0x8(%rdi), %rsi
movq 0x80(%rsp), %rdx
movl %r14d, %ecx
addq %rdx, %rcx
callq 0x1168fe
jmp 0x111038
movq 0xc8(%rsp), %rdi
movq 0x8(%rdi), %rsi
movq 0x68(%rsp), %rdx
movq 0x70(%rsp), %rcx
callq 0x1168fe
jmp 0x112191
cmpl $0x80, %ecx
je 0x1111ce
cmpl $0x4, %ecx
je 0x111058
cmpl $0x1, %ecx
jne 0x1111e2
movq 0x70(%rsp), %rax
subq 0x68(%rsp), %rax
leaq (%rax,%rax,2), %rsi
shrq %rsi
leaq 0x80(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0xcc4f0
movq 0x80(%rsp), %r14
cmpq %r14, 0x88(%rsp)
je 0x112244
movq 0x68(%rsp), %r12
movq 0x70(%rsp), %rbx
movq %rbx, %r15
subq %r12, %r15
je 0x112244
leaq 0x30(%rsp), %rdi
leaq 0xf0(%rsp), %rdx
movq %r15, %rsi
callq 0xcc4f0
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
cmpq %rax, %rcx
je 0x112256
testq %r15, %r15
jle 0x110e8c
leaq 0x1(%r15), %rcx
shrq %rcx
movq %r12, %rdx
movb (%rdx), %sil
incq %rdx
movb %sil, (%rax)
cmpq %rbx, %rdx
jae 0x110e82
movb (%rdx), %sil
movb %sil, (%rax,%rcx)
incq %rax
incq %rdx
cmpq %rbx, %rdx
jb 0x110e62
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
cmpq %rax, %rcx
je 0x112268
cmpq $0x2, %r15
jl 0x110ec7
leaq (%rax,%r15), %rcx
movb (%rax), %dl
incq %rax
movb (%rax), %sil
movl %esi, %edi
subb %dl, %dil
addb $-0x80, %dil
movb %dil, (%rax)
incq %rax
movl %esi, %edx
cmpq %rcx, %rax
jb 0x110ea4
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
cmpq %rax, %rcx
je 0x11227a
testl %r15d, %r15d
jle 0x1112e2
movslq %r15d, %rdx
addq %rax, %rdx
movq %r14, %rcx
movq %rax, %rsi
movq %rax, %r9
notq %r9
addq %rsi, %r9
movl $0x1, %r8d
xorl %ebx, %ebx
movq %rbx, %r11
movq %r8, %rdi
leaq (%rax,%rbx), %r8
incq %r8
cmpq %rdx, %r8
jae 0x110f98
movb (%r8), %r10b
leaq 0x1(%r11), %rbx
cmpq $-0x7f, %r9
jl 0x110f25
decq %r9
leaq 0x1(%rdi), %r8
cmpb %r10b, (%rsi)
je 0x110ef6
movq %rax, %r8
subq %rsi, %r8
leaq (%r8,%rbx), %r13
cmpq $0x2, %r13
jg 0x110fae
leaq (%rax,%rbx), %r9
incq %r9
cmpq %rdx, %r9
jae 0x110f93
leaq (%rax,%rdi), %r9
addq $0x2, %r9
movb -0x1(%r9), %r11b
cmpb %r11b, %r10b
jne 0x110f6a
cmpq %rdx, %r9
jae 0x110f6a
leaq (%r8,%rdi), %rbx
cmpq $0x7e, %rbx
jg 0x110fcb
cmpb 0x2(%rax,%rdi), %r10b
jne 0x110f74
jmp 0x110fcb
leaq (%r8,%rdi), %r10
cmpq $0x7f, %r10
jge 0x110fcb
incq %rdi
movl %r11d, %r10d
cmpq %rdx, %r9
jb 0x110f41
addq %rdi, %r8
leaq (%rax,%rdi), %r10
cmpq $0x7f, %r8
leaq 0x1(%rax,%rdi), %r9
cmovgeq %r10, %r9
movq %r9, %r8
jmp 0x110fd5
movq %rax, %rdi
subq %rsi, %rdi
leaq (%rdi,%r11), %r13
incq %r13
movq %r8, %r9
cmpq $0x3, %r13
jl 0x110fd5
decb %r13b
movb %r13b, (%rcx)
movb (%rsi), %sil
movb %sil, 0x1(%rcx)
addq $0x2, %rcx
leaq (%rax,%r11), %rsi
incq %rsi
movq %rsi, %r8
jmp 0x110ff6
leaq (%rax,%rdi), %r9
addq %rdi, %rax
movq %rax, %r8
movl %esi, %eax
subl %r9d, %eax
movb %al, (%rcx)
incq %rcx
cmpq %r8, %rsi
jae 0x110ff6
subq %rsi, %r9
movb (%rsi), %al
incq %rsi
movb %al, (%rcx)
incq %rcx
decq %r9
jne 0x110fe7
movq %r8, %rax
cmpq %rdx, %rsi
jb 0x110ee5
jmp 0x1112e5
testq %rbp, %rbp
je 0x1111e2
leaq 0x140ed(%rip), %rsi # 0x125104
movq %rbp, %rdi
callq 0x15190
jmp 0x1111e2
testq %rbp, %rbp
je 0x111038
leaq 0x140f3(%rip), %rsi # 0x125123
movq %rbp, %rdi
callq 0x15190
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x11104a
callq 0x14760
testq %r13, %r13
jne 0x112191
jmp 0x1111e2
movl 0x70(%rsp), %eax
subl 0x68(%rsp), %eax
leal 0x2000(,%rax,2), %esi
leaq 0xf0(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0xcc4f0
movq 0xf0(%rsp), %r15
cmpq %r15, 0xf8(%rsp)
movq 0x190(%rsp), %r12
je 0x11228c
movq 0x68(%rsp), %rax
movq 0x70(%rsp), %r14
movq %rax, 0x108(%rsp)
subq %rax, %r14
movq %r14, 0x48(%rsp)
je 0x112295
movl $0x2000, %edi # imm = 0x2000
callq 0x147e0
movq %rax, %rbx
movl $0x2000, %edx # imm = 0x2000
movq %rax, %rdi
xorl %esi, %esi
callq 0x14470
movq %r14, %rsi
shrq %rsi
leaq 0x30(%rsp), %rdi
leaq 0x80(%rsp), %rdx
movq %rbx, 0x60(%rsp)
callq 0x116ae0
movq 0x8(%r12), %rax
subq (%r12), %rax
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %rsi # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %rsi
leaq 0x80(%rsp), %rdi
leaq 0x17(%rsp), %rdx
callq 0x116b6c
movq 0x30(%rsp), %rdx
cmpq %rdx, 0x38(%rsp)
movl 0x28(%rsp), %ecx
je 0x1122aa
movq 0x80(%rsp), %r14
movq 0x88(%rsp), %rax
cmpq %r14, %rax
movq %r15, 0x110(%rsp)
je 0x1111e9
movq 0x20(%rsp), %r11
movl %r11d, %esi
imull %ecx, %esi
movl $0x24, %edi
movl $0x1c, %r8d
movl %ecx, %ebx
xorl %r9d, %r9d
movq %rdx, -0x1c(%r14,%r8)
movq %rdx, -0x14(%r14,%r8)
movl %ebx, -0xc(%r14,%r8)
movl %r11d, -0x8(%r14,%r8)
movq (%r12), %rax
xorl %ecx, %ecx
cmpl $0x1, (%rax,%rdi)
setne %cl
leal 0x1(%rcx), %eax
movl %esi, %r10d
shll %cl, %r10d
movl %eax, (%r14,%r8)
movslq %r10d, %rax
leaq (%rdx,%rax,2), %rdx
incq %r9
movq 0x80(%rsp), %r14
movq 0x88(%rsp), %rax
movq %rax, %rcx
subq %r14, %rcx
sarq $0x5, %rcx
addq $0x38, %rdi
addq $0x20, %r8
cmpq %rcx, %r9
jb 0x11116d
jmp 0x1111ee
testq %rbp, %rbp
je 0x1111e2
leaq 0x13f63(%rip), %rsi # 0x12513d
movq %rbp, %rdi
callq 0x15190
xorl %ebx, %ebx
jmp 0x112193
movq 0x20(%rsp), %r11
testl %r11d, %r11d
jle 0x111270
xorl %ecx, %ecx
movq 0x108(%rsp), %rbx
movq %rcx, 0x8(%rsp)
cmpq %r14, %rax
je 0x111260
movl $0x8, %r13d
xorl %ebp, %ebp
movslq 0x8(%r14,%r13), %rax
movslq 0x14(%r14,%r13), %r12
imulq %rax, %r12
movq (%r14,%r13), %rdi
leaq (%r12,%r12), %r15
movq %rbx, %rsi
movq %r15, %rdx
callq 0x14690
leaq (%rbx,%r12,2), %rbx
addq %r15, (%r14,%r13)
incq %rbp
movq 0x80(%rsp), %r14
movq 0x88(%rsp), %rax
movq %rax, %rcx
subq %r14, %rcx
sarq $0x5, %rcx
addq $0x20, %r13
cmpq %rcx, %rbp
jb 0x11120f
jmp 0x111263
movq %r14, %rax
movq 0x8(%rsp), %rcx
incl %ecx
cmpl 0x20(%rsp), %ecx
jne 0x1111fd
movq 0x30(%rsp), %r14
movq 0x38(%rsp), %rax
movq %rax, %rbx
subq %r14, %rbx
sarq %rbx
cmpq %r14, %rax
je 0x1122bc
xorl %ebp, %ebp
movl $0x2000, %edx # imm = 0x2000
movq 0x60(%rsp), %rdi
xorl %esi, %esi
callq 0x14470
testl %ebx, %ebx
movq 0x48(%rsp), %r13
jle 0x11133b
andl $0x7fffffff, %ebx # imm = 0x7FFFFFFF
xorl %eax, %eax
movq 0x60(%rsp), %rdi
movzwl (%r14,%rax,2), %edx
movl %edx, %ecx
andb $0x7, %cl
movl $0x1, %esi
shll %cl, %esi
shrl $0x3, %edx
orb %sil, (%rdi,%rdx)
incq %rax
cmpq %rax, %rbx
jne 0x1112b9
movb (%rdi), %bpl
andb $-0x2, %bpl
jmp 0x111340
movq %r14, %rcx
subl %r14d, %ecx
movslq %ecx, %rbx
cmpq %r15, %rbx
jb 0x111301
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x14690
movq %r15, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x111310
callq 0x14760
movq 0xc8(%rsp), %rdi
movq 0x8(%rdi), %rsi
movq 0x80(%rsp), %rdx
movl %ebx, %ecx
addq %rdx, %rcx
callq 0x1168fe
movq 0x80(%rsp), %rdi
jmp 0x112187
movq 0x60(%rsp), %rdi
movb %bpl, (%rdi)
movw $0x1fff, %r14w # imm = 0x1FFF
xorl %ebx, %ebx
xorl %eax, %eax
xorl %ecx, %ecx
movq 0x60(%rsp), %rdx
cmpb $0x0, (%rdx,%rcx)
je 0x111373
movzwl %r14w, %r14d
cmpq %r14, %rcx
cmovbl %ecx, %r14d
cmovbl %ebx, %eax
movzwl %ax, %edx
cmpq %rdx, %rcx
cmoval %ecx, %ebx
cmoval %ecx, %eax
incq %rcx
cmpq $0x2000, %rcx # imm = 0x2000
jne 0x11134e
movl $0x20000, %edi # imm = 0x20000
callq 0x147e0
movq %rax, %rbp
xorl %r15d, %r15d
movl $0x20000, %edx # imm = 0x20000
movq %rax, %rdi
xorl %esi, %esi
callq 0x14470
movq $0x0, 0xb0(%rsp)
testq %r15, %r15
je 0x1113c9
movl %r15d, %eax
shrl $0x3, %eax
movq 0x60(%rsp), %rcx
movzbl (%rcx,%rax), %eax
movl %r15d, %ecx
andl $0x7, %ecx
btl %ecx, %eax
jae 0x1113df
movq 0xb0(%rsp), %rcx
movl %ecx, %eax
incl %ecx
movq %rcx, 0xb0(%rsp)
jmp 0x1113e1
xorl %eax, %eax
movw %ax, (%rbp,%r15,2)
incq %r15
cmpq $0x10000, %r15 # imm = 0x10000
jne 0x1113aa
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq %rdx
cmpq %rax, %rcx
movq %rbp, 0xe0(%rsp)
je 0x1122cf
testl %edx, %edx
jle 0x111438
andl $0x7fffffff, %edx # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movzwl (%rax,%rcx,2), %esi
movzwl (%rbp,%rsi,2), %esi
movw %si, (%rax,%rcx,2)
incq %rcx
cmpq %rcx, %rdx
jne 0x111423
movq 0x110(%rsp), %rax
movw %r14w, (%rax)
movw %bx, 0x2(%rax)
leaq 0x4(%rax), %r15
cmpw %bx, %r14w
jbe 0x111457
movq %r15, %rbx
jmp 0x11147b
movzwl %r14w, %eax
movq 0x60(%rsp), %rsi
addq %rax, %rsi
movzwl %bx, %ebx
subq %rax, %rbx
leaq 0x1(%rbx), %rdx
movq %r15, %rdi
callq 0x14690
addq %r15, %rbx
incq %rbx
movq 0x80(%rsp), %rdx
movq 0x88(%rsp), %rax
cmpq %rdx, %rax
movq %rbx, 0xb8(%rsp)
je 0x111905
movq 0xb0(%rsp), %rcx
decl %ecx
movq %rcx, 0xb0(%rsp)
xorl %edi, %edi
movl $0x8000, %esi # imm = 0x8000
movq %rdi, %rcx
shlq $0x5, %rcx
movl 0x1c(%rdx,%rcx), %r10d
testl %r10d, %r10d
jle 0x1118ef
addq %rcx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rdx, 0x128(%rsp)
movq %rdi, 0x120(%rsp)
movl 0x10(%rdx), %r14d
movl 0x14(%rdx), %r11d
cmpl %r11d, %r14d
movl %r11d, %eax
cmovll %r14d, %eax
movl %eax, 0xec(%rsp)
cmpl $0x2, %eax
jl 0x1118cc
movq (%rdx), %rax
movq %r8, 0x130(%rsp)
leaq (%rax,%r8,2), %rdx
movq %rdx, 0x118(%rsp)
movl %r14d, %edx
imull %r10d, %edx
movl %edx, 0xc0(%rsp)
movq %rcx, 0x138(%rsp)
addq %rcx, %rax
movq %rax, 0x140(%rsp)
movl $0x2, %edx
movl $0x1, %ecx
movl %r10d, 0xc4(%rsp)
movl %r14d, 0x50(%rsp)
movl %r11d, 0xe8(%rsp)
movl %r11d, %eax
subl %edx, %eax
imull 0xc0(%rsp), %eax
movl %ecx, 0x28(%rsp)
imull %r10d, %ecx
movq %rdx, 0xd0(%rsp)
movl %edx, %edi
imull %r10d, %edi
movslq %ecx, %rcx
movq %rcx, 0xa8(%rsp)
movslq %edi, %rcx
movq %rcx, 0x98(%rsp)
movzwl 0xb0(%rsp), %r8d
movq 0x118(%rsp), %rcx
testl %eax, %eax
js 0x1117cf
cltq
movq 0x118(%rsp), %rcx
leaq (%rcx,%rax,2), %rax
movq %rax, 0x58(%rsp)
movq 0xd0(%rsp), %rdi
movl %edi, %eax
movl 0xc0(%rsp), %edx
imull %edx, %eax
movl 0x28(%rsp), %ecx
imull %edx, %ecx
movl %r14d, %edx
subl %edi, %edx
imull 0xc4(%rsp), %edx
movl %edx, 0x20(%rsp)
movslq %edx, %rdx
movq %rdx, 0xd8(%rsp)
movslq %ecx, %rcx
cltq
addq %rax, %rax
movq %rax, 0xa0(%rsp)
movq 0x98(%rsp), %rax
leaq (%rax,%rax), %rdi
leaq (%rcx,%rcx), %r13
movq 0xa8(%rsp), %rax
addq %rax, %rax
movq %rcx, 0x18(%rsp)
leaq (%rax,%rcx,2), %r9
movq 0x140(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movq %rcx, %r15
cmpl $0x0, 0x20(%rsp)
js 0x111748
movq 0x8(%rsp), %r15
movq 0xd8(%rsp), %rcx
leaq (%r15,%rcx,2), %rcx
movswl (%r15), %ebp
movswl (%r15,%rax), %r14d
cmpl $0x3fff, %r8d # imm = 0x3FFF
ja 0x1116ae
movl %ebp, %r10d
subl %r14d, %r10d
movswl (%r15,%r13), %r12d
movswl (%r15,%r9), %ebx
movl %r12d, %edx
subl %ebx, %edx
addl %ebp, %r14d
movl %r14d, %r11d
shrl %r11d
sarl %r14d
addl %r12d, %ebx
movl %ebx, %ebp
shrl %ebp
subl %ebp, %r11d
sarl %ebx
addl %r14d, %ebx
shrl %ebx
movswl %r10w, %ebp
movswl %dx, %r14d
addl %ebp, %r14d
shrl %r14d
subl %edx, %r10d
jmp 0x111729
movl $0xffff, %r12d # imm = 0xFFFF
andl %r12d, %ebp
andl %r12d, %r14d
xorl %esi, %ebp
leal (%r14,%rbp), %r11d
shrl %r11d
subl %r14d, %ebp
movl %ebp, %edx
shrl $0x10, %edx
andl %esi, %edx
movzwl (%r15,%r13), %r10d
movzwl (%r15,%r9), %ebx
xorl %esi, %r10d
leal (%r10,%rbx), %r14d
shrl %r14d
subl %ebx, %r10d
movl %r10d, %ebx
shrl $0x10, %ebx
andl %esi, %ebx
xorl %r14d, %ebx
xorl %esi, %r11d
xorl %edx, %r11d
leal (%rbx,%r11), %edx
shrl %edx
subl %ebx, %r11d
movl %r11d, %ebx
shrl $0x10, %ebx
andl %esi, %ebx
xorl %edx, %ebx
andl %r12d, %ebp
xorl %esi, %ebp
andl %r12d, %r10d
leal (%r10,%rbp), %edx
shrl %edx
subl %r10d, %ebp
movl %ebp, %r14d
shrl $0x10, %r14d
andl %esi, %r14d
xorl %edx, %r14d
movl %ebp, %r10d
movw %bx, (%r15)
movw %r11w, (%r15,%r13)
movw %r14w, (%r15,%rax)
movw %r10w, (%r15,%r9)
addq %rdi, %r15
cmpq %rcx, %r15
jbe 0x111657
movl 0x50(%rsp), %r14d
testl %r14d, 0x28(%rsp)
movq 0xe0(%rsp), %rbp
movq 0xb8(%rsp), %rbx
je 0x1117b7
movswl (%r15), %ecx
movq 0x18(%rsp), %rdx
movswl (%r15,%rdx,2), %r10d
cmpl $0x3fff, %r8d # imm = 0x3FFF
ja 0x111787
leal (%r10,%rcx), %r11d
shrl %r11d
subl %r10d, %ecx
jmp 0x1117a9
movl $0xffff, %edx # imm = 0xFFFF
andl %edx, %ecx
andl %edx, %r10d
xorl %esi, %ecx
leal (%rcx,%r10), %edx
shrl %edx
subl %r10d, %ecx
movl %ecx, %r11d
shrl $0x10, %r11d
andl %esi, %r11d
xorl %edx, %r11d
movq 0x18(%rsp), %rdx
movw %cx, (%r15,%rdx,2)
movw %r11w, (%r15)
movq 0x8(%rsp), %rcx
addq 0xa0(%rsp), %rcx
cmpq 0x58(%rsp), %rcx
jbe 0x111633
movl 0xe8(%rsp), %r11d
testl %r11d, 0x28(%rsp)
movq 0x48(%rsp), %r13
movl 0xc4(%rsp), %r10d
movq 0xd0(%rsp), %r15
movq 0xa8(%rsp), %rdx
je 0x111892
movl %r14d, %eax
subl %r15d, %eax
imull %r10d, %eax
testl %eax, %eax
js 0x111892
cltq
leaq (%rcx,%rax,2), %rax
movq %rcx, %rdi
movq 0x98(%rsp), %rcx
addq %rcx, %rcx
movq %rcx, 0x98(%rsp)
movq %rdi, %rcx
movq %rcx, %rdi
movswl (%rcx), %ecx
movq %rdi, %r12
movswl (%rdi,%rdx,2), %edi
cmpl $0x3fff, %r8d # imm = 0x3FFF
ja 0x111851
leal (%rdi,%rcx), %r9d
shrl %r9d
subl %edi, %ecx
jmp 0x111870
movl $0xffff, %edx # imm = 0xFFFF
andl %edx, %ecx
andl %edx, %edi
xorl %esi, %ecx
leal (%rcx,%rdi), %edx
shrl %edx
subl %edi, %ecx
movl %ecx, %r9d
shrl $0x10, %r9d
andl %esi, %r9d
xorl %edx, %r9d
movq 0xa8(%rsp), %rdx
movw %cx, (%r12,%rdx,2)
movq %r12, %rcx
movw %r9w, (%r12)
addq 0x98(%rsp), %rcx
cmpq %rax, %rcx
jbe 0x111830
movl %r15d, %ecx
leal (%r15,%r15), %eax
movl %eax, %edx
cmpl 0xec(%rsp), %eax
jle 0x11155b
movq 0x128(%rsp), %rdx
movl 0x1c(%rdx), %r10d
movq 0x120(%rsp), %rdi
movq 0x138(%rsp), %rcx
movq 0x130(%rsp), %r8
incq %r8
movslq %r10d, %rax
addq $0x2, %rcx
cmpq %rax, %r8
jl 0x1114e2
movq 0x80(%rsp), %rdx
movq 0x88(%rsp), %rax
incq %rdi
movq %rax, %rcx
subq %rdx, %rcx
sarq $0x5, %rcx
cmpq %rcx, %rdi
jb 0x1114b5
movl $0x0, (%rbx)
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rax, %rdx
subq %rcx, %rdx
sarq %rdx
movq %rcx, 0x58(%rsp)
cmpq %rcx, %rax
je 0x1122df
leaq 0x4(%rbx), %r14
movq %rdx, 0x18(%rsp)
testl %edx, %edx
je 0x111d54
movl $0x80008, %edi # imm = 0x80008
callq 0x147e0
movq %rax, %rbx
movl $0x80008, %edx # imm = 0x80008
movq %rax, %rdi
xorl %esi, %esi
callq 0x14470
cmpl $0x0, 0x18(%rsp)
movq 0x58(%rsp), %rsi
jle 0x111981
movq 0x18(%rsp), %rax
andl $0x7fffffff, %eax # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movzwl (%rsi,%rcx,2), %edx
incq (%rbx,%rdx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x111971
movq %rbx, 0x8(%rsp)
movl $0x40004, %edi # imm = 0x40004
callq 0x147e0
movq %rax, %r12
movl $0x40004, %edx # imm = 0x40004
movq %rax, %rdi
xorl %esi, %esi
callq 0x14470
movl $0x80008, %edi # imm = 0x80008
callq 0x147e0
movq %rax, %rbx
movq %r14, 0xd8(%rsp)
movl $0x80008, %edx # imm = 0x80008
movq %rax, %rdi
xorl %esi, %esi
callq 0x14470
movq 0x8(%rsp), %rax
addq $-0x8, %rax
movq $-0x1, %rdx
incq %rdx
cmpq $0x0, 0x8(%rax)
leaq 0x8(%rax), %rax
je 0x1119d6
movl $0x0, 0x50(%rsp)
movl $0x0, %r14d
cmpq $0x10000, %rdx # imm = 0x10000
ja 0x111a31
movl $0x0, 0x50(%rsp)
movq %rdx, %rcx
xorl %r14d, %r14d
movl %ecx, (%r12,%rcx,4)
cmpq $0x0, (%rax)
je 0x111a21
movslq %r14d, %r14
movq %rax, (%rbx,%r14,8)
incl %r14d
movl %ecx, 0x50(%rsp)
incq %rcx
addq $0x8, %rax
cmpq $0x10001, %rcx # imm = 0x10001
jne 0x111a09
movq %rdx, 0x98(%rsp)
movslq 0x50(%rsp), %rcx
movq 0x8(%rsp), %rax
leaq (%rax,%rcx,8), %rdx
addq $0x8, %rdx
movq %rcx, 0xd0(%rsp)
movq $0x1, 0x8(%rax,%rcx,8)
movslq %r14d, %rax
movq %rdx, 0xa8(%rsp)
movq %rdx, (%rbx,%rax,8)
leaq 0x8(%rbx,%rax,8), %rsi
leaq 0x17(%rsp), %rdx
movq %rbx, %rdi
callq 0x116c55
movl $0x80008, %edi # imm = 0x80008
callq 0x147e0
movq %rax, %r15
movl $0x80008, %edx # imm = 0x80008
movq %rax, %rdi
xorl %esi, %esi
callq 0x14470
testl %r14d, %r14d
jle 0x111bb1
incl %r14d
leaq -0x8(%rbx), %rax
movq %rax, 0x28(%rsp)
movl %r14d, %r14d
movq (%rbx), %rbp
movq 0x28(%rsp), %rax
leaq (%rax,%r14,8), %rdx
movq -0x8(%rbx,%r14,8), %rcx
movq %rbp, -0x8(%rbx,%r14,8)
subq %rbx, %rdx
sarq $0x3, %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x116c92
leaq -0x1(%r14), %r9
movq (%rbx), %r13
leaq (%rbx,%r14,8), %rsi
addq $-0x8, %rsi
cmpq $0x2, %r9
jb 0x111b24
leaq -0x8(%rsi), %rdx
movq -0x8(%rsi), %rcx
movq %r13, -0x8(%rsi)
subq %rbx, %rdx
sarq $0x3, %rdx
movq %rbx, %rdi
movq %rsi, 0xa0(%rsp)
xorl %esi, %esi
movq %r9, 0x20(%rsp)
callq 0x116c92
movq 0xa0(%rsp), %rsi
movq 0x20(%rsp), %r9
movq 0x8(%rsp), %rdx
subq %rdx, %rbp
shrq $0x3, %rbp
subq %rdx, %r13
shrq $0x3, %r13
movslq %ebp, %rax
movq (%rdx,%rax,8), %rax
movslq %r13d, %rcx
addq %rax, (%rdx,%rcx,8)
leaq -0x2(%r14), %rcx
movq -0x8(%rsi), %rax
cmpq $0x2, %r9
jb 0x111b78
leaq -0x1(%rcx), %rdx
movq %rdx, %rsi
shrq %rsi
movq (%rbx,%rsi,8), %rdi
movq (%rdi), %r8
cmpq (%rax), %r8
jle 0x111b78
movq %rdi, (%rbx,%rcx,8)
movq %rsi, %rcx
cmpq $0x1, %rdx
ja 0x111b53
xorl %ecx, %ecx
movq %rax, (%rbx,%rcx,8)
movslq %r13d, %rax
incq (%r15,%rax,8)
movl (%r12,%rax,4), %r13d
cmpl %eax, %r13d
jne 0x111b7c
movl %ebp, (%r12,%rax,4)
movslq %ebp, %rax
incq (%r15,%rax,8)
movl (%r12,%rax,4), %ebp
cmpl %eax, %ebp
jne 0x111b90
cmpq $0x3, %r14
movq %r9, %r14
movq 0x48(%rsp), %r13
jge 0x111ab1
movq 0xd0(%rsp), %r14
incq %r14
movq %r15, %rdi
callq 0x112423
movl $0x80008, %edx # imm = 0x80008
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x14690
movq %r15, %rdi
callq 0x14760
movq %rbx, %rdi
callq 0x14760
movq %r12, %rdi
callq 0x14760
movq 0xb8(%rsp), %rax
leaq 0x18(%rax), %r8
movq %r8, 0x28(%rsp)
movq 0x98(%rsp), %rcx
movq %r14, %r9
cmpl %ecx, %r14d
movq 0xe0(%rsp), %rbp
jl 0x111d70
xorl %eax, %eax
movl %ecx, %edi
xorl %edx, %edx
movq 0x28(%rsp), %r8
movq 0x8(%rsp), %rbx
movl 0x50(%rsp), %r14d
movslq %edi, %r10
movq (%rbx,%r10,8), %rcx
andq $0x3f, %rcx
setne %sil
cmpl %r14d, %r10d
setg %r11b
orb %sil, %r11b
movl %edi, %esi
jne 0x111c7b
movl $0x1, %esi
testb $0x3f, 0x8(%rbx,%r10,8)
jne 0x111c71
incq %r10
leal 0x1(%rsi), %edi
cmpq %r9, %r10
jge 0x111c73
cmpl $0x104, %esi # imm = 0x104
movl %edi, %esi
jb 0x111c52
jmp 0x111c73
movl %esi, %edi
movl %r10d, %esi
cmpl $0x2, %edi
jae 0x111caa
shlq $0x6, %rdx
orq %rcx, %rdx
leal 0x6(%rax), %ecx
cmpl $0x2, %eax
jl 0x111d17
movl %ecx, %eax
addq $-0x8, %rax
movq %rdx, %rdi
movl %eax, %ecx
sarq %cl, %rdi
movb %dil, (%r8)
incq %r8
cmpq $0x7, %rax
ja 0x111c90
jmp 0x111d19
cmpl $0x6, %edi
jb 0x111ce9
shlq $0x6, %rdx
leal 0x6(%rax), %ecx
orq $0x3f, %rdx
cmpl $0x2, %eax
jl 0x111d27
movl %ecx, %ecx
addl $0xe, %eax
addq $-0x8, %rcx
movq %rdx, %r10
sarq %cl, %r10
movb %r10b, (%r8)
incq %r8
addl $-0x8, %eax
cmpq $0x7, %rcx
ja 0x111cc4
addl $-0x6, %edi
shlq $0x8, %rdx
orq %rdi, %rdx
jmp 0x111d38
addl $0x39, %edi
shlq $0x6, %rdx
orq %rdi, %rdx
leal 0x6(%rax), %ecx
cmpl $0x2, %eax
jl 0x111d17
movl %ecx, %eax
addq $-0x8, %rax
movq %rdx, %rdi
movl %eax, %ecx
sarq %cl, %rdi
movb %dil, (%r8)
incq %r8
cmpq $0x7, %rax
ja 0x111cfd
jmp 0x111d19
movl %ecx, %eax
leal 0x1(%rsi), %edi
cmpl %r14d, %esi
jle 0x111c30
jmp 0x111d5f
addl $-0x6, %edi
shlq $0x8, %rdx
orq %rdi, %rdx
addl $0xe, %eax
testl %ecx, %ecx
js 0x111d19
movl %eax, %eax
addq $-0x8, %rax
movq %rdx, %rdi
movl %eax, %ecx
sarq %cl, %rdi
movb %dil, (%r8)
incq %r8
cmpq $0x7, %rax
ja 0x111d3a
jmp 0x111d19
movq %r14, %r15
xorl %r14d, %r14d
jmp 0x1120fe
testl %eax, %eax
jle 0x111d70
movb $0x8, %cl
subb %al, %cl
shlq %cl, %rdx
movb %dl, (%r8)
incq %r8
movq 0x58(%rsp), %rax
movzwl (%rax), %ecx
movq 0x18(%rsp), %rax
cmpl $0x2, %eax
jl 0x111f1f
andl $0x7fffffff, %eax # imm = 0x7FFFFFFF
movq %rax, 0x18(%rsp)
xorl %r14d, %r14d
movl $0x1, %ebx
xorl %eax, %eax
xorl %r11d, %r11d
movq %r8, %r10
movq 0x58(%rsp), %rdx
cmpw (%rdx,%rbx,2), %cx
sete %dl
cmpl $0xff, %r14d
setl %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x111dcb
incl %r14d
movl %r14d, %esi
jmp 0x111f03
movzwl %cx, %ecx
movq 0x8(%rsp), %rdx
movq (%rdx,%rcx,8), %r12
movq 0xa8(%rsp), %rcx
movq (%rcx), %r13
movl %r12d, %edx
andl $0x3f, %edx
movl %r13d, %edi
andl $0x3f, %edi
leaq (%rdx,%rdi), %rcx
addq $0x8, %rcx
movslq %r14d, %r15
movq %rdx, %rsi
imulq %r15, %rsi
cmpq %rsi, %rcx
jge 0x111e80
movl %r12d, %esi
andl $0x3f, %esi
movl %edx, %ecx
shlq %cl, %r11
sarq $0x6, %r12
orq %r12, %r11
addl %eax, %esi
cmpl $0x8, %esi
jl 0x111e38
movl %esi, %esi
addq $-0x8, %rsi
movq %r11, %rax
movl %esi, %ecx
sarq %cl, %rax
movb %al, (%r10)
incq %r10
cmpq $0x7, %rsi
ja 0x111e20
movl %r13d, %eax
andl $0x3f, %eax
movl %edi, %ecx
shlq %cl, %r11
sarq $0x6, %r13
orq %r13, %r11
leal (%rsi,%rax), %ecx
cmpl $0x8, %ecx
jl 0x111ecd
movl %ecx, %ecx
addl %esi, %eax
addl $0x8, %eax
movq 0x48(%rsp), %r13
addq $-0x8, %rcx
movq %r11, %rdx
sarq %cl, %rdx
movb %dl, (%r10)
incq %r10
addl $-0x8, %eax
cmpq $0x7, %rcx
ja 0x111e5e
shlq $0x8, %r11
orq %r15, %r11
jmp 0x111ee0
xorl %esi, %esi
testl %r14d, %r14d
js 0x111efe
movl %r12d, %edi
andl $0x3f, %edi
sarq $0x6, %r12
movq 0x48(%rsp), %r13
movl %edx, %ecx
shlq %cl, %r11
addl %edi, %eax
orq %r12, %r11
cmpl $0x8, %eax
jl 0x111ebf
movl %eax, %eax
addq $-0x8, %rax
movq %r11, %r15
movl %eax, %ecx
sarq %cl, %r15
movb %r15b, (%r10)
incq %r10
cmpq $0x7, %rax
ja 0x111ea7
leal -0x1(%r14), %ecx
testl %r14d, %r14d
movl %ecx, %r14d
jg 0x111e96
jmp 0x111f03
shlq $0x8, %r11
leal 0x8(%rcx), %eax
orq %r15, %r11
testl %ecx, %ecx
movq 0x48(%rsp), %r13
js 0x111efa
movl %eax, %eax
addq $-0x8, %rax
movq %r11, %rdx
movl %eax, %ecx
sarq %cl, %rdx
movb %dl, (%r10)
incq %r10
cmpq $0x7, %rax
ja 0x111ee2
xorl %esi, %esi
jmp 0x111f03
movq 0x48(%rsp), %r13
movq 0x58(%rsp), %rdx
movzwl (%rdx,%rbx,2), %ecx
incq %rbx
movl %esi, %r14d
cmpq 0x18(%rsp), %rbx
jne 0x111da5
jmp 0x111f29
xorl %r11d, %r11d
movq %r8, %r10
xorl %eax, %eax
xorl %esi, %esi
movzwl %cx, %ecx
movq 0x8(%rsp), %rdx
movq (%rdx,%rcx,8), %r14
movq 0xa8(%rsp), %rcx
movq (%rcx), %r15
movl %r14d, %edx
andl $0x3f, %edx
movl %r15d, %edi
andl $0x3f, %edi
leaq (%rdx,%rdi), %rcx
addq $0x8, %rcx
movslq %esi, %rbx
movq %rdx, %r12
imulq %rbx, %r12
cmpq %r12, %rcx
jge 0x111fd9
movl %r14d, %esi
andl $0x3f, %esi
movl %edx, %ecx
shlq %cl, %r11
sarq $0x6, %r14
orq %r14, %r11
addl %eax, %esi
cmpl $0x8, %esi
jl 0x111f96
movl %esi, %esi
addq $-0x8, %rsi
movq %r11, %rax
movl %esi, %ecx
sarq %cl, %rax
movb %al, (%r10)
incq %r10
cmpq $0x7, %rsi
ja 0x111f7e
movl %r15d, %eax
andl $0x3f, %eax
movl %edi, %ecx
shlq %cl, %r11
sarq $0x6, %r15
orq %r15, %r11
leal (%rsi,%rax), %ecx
cmpl $0x8, %ecx
jl 0x11201b
movl %ecx, %ecx
addl %esi, %eax
addl $0x8, %eax
addq $-0x8, %rcx
movq %r11, %rdx
sarq %cl, %rdx
movb %dl, (%r10)
incq %r10
addl $-0x8, %eax
cmpq $0x7, %rcx
ja 0x111fb7
shlq $0x8, %r11
orq %rbx, %r11
jmp 0x112029
testl %esi, %esi
js 0x112043
movl %r14d, %edi
andl $0x3f, %edi
sarq $0x6, %r14
movl %edx, %ecx
shlq %cl, %r11
addl %edi, %eax
orq %r14, %r11
cmpl $0x8, %eax
jl 0x112010
movl %eax, %eax
addq $-0x8, %rax
movq %r11, %rbx
movl %eax, %ecx
sarq %cl, %rbx
movb %bl, (%r10)
incq %r10
cmpq $0x7, %rax
ja 0x111ff8
leal -0x1(%rsi), %ecx
testl %esi, %esi
movl %ecx, %esi
jg 0x111fe7
jmp 0x112043
shlq $0x8, %r11
leal 0x8(%rcx), %eax
orq %rbx, %r11
testl %ecx, %ecx
js 0x112043
movl %eax, %eax
addq $-0x8, %rax
movq %r11, %rdx
movl %eax, %ecx
sarq %cl, %rdx
movb %dl, (%r10)
incq %r10
cmpq $0x7, %rax
ja 0x11202b
testl %eax, %eax
je 0x112051
movb $0x8, %cl
subb %al, %cl
shlq %cl, %r11
movb %r11b, (%r10)
subl %r8d, %r10d
movq %r8, %rsi
subq 0x28(%rsp), %rsi
leal (%rax,%r10,8), %edx
addl $0x7, %edx
leal (%rax,%r10,8), %r14d
addl $0xe, %r14d
testl %edx, %edx
cmovnsl %edx, %r14d
movq 0xb8(%rsp), %rbx
movq 0x98(%rsp), %rcx
movb %cl, 0x4(%rbx)
movb %ch, 0x5(%rbx)
movl %ecx, %edx
shrl $0x10, %edx
movb %dl, 0x6(%rbx)
shrl $0x18, %ecx
movb %cl, 0x7(%rbx)
movq %r9, %rcx
movb %cl, 0x8(%rbx)
movb %ch, 0x9(%rbx)
movl %ecx, %edx
shrl $0x10, %edx
movb %dl, 0xa(%rbx)
shrl $0x18, %ecx
movb %cl, 0xb(%rbx)
movq %rsi, %rcx
movb %cl, 0xc(%rbx)
movb %ch, 0xd(%rbx)
movl %ecx, %edx
shrl $0x10, %edx
movb %dl, 0xe(%rbx)
shrl $0x18, %ecx
movb %cl, 0xf(%rbx)
leal (%rax,%r10,8), %eax
movb %al, 0x10(%rbx)
movb %ah, 0x11(%rbx)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x12(%rbx)
shrl $0x18, %eax
movb %al, 0x13(%rbx)
sarl $0x3, %r14d
addl %r8d, %r14d
movq 0xd8(%rsp), %r15
subl %r15d, %r14d
movl $0x0, 0x14(%rbx)
movq 0x8(%rsp), %rdi
callq 0x14760
movl %r14d, (%rbx)
movq 0x110(%rsp), %rdi
subl %edi, %r15d
addl %r14d, %r15d
cmpq %r15, %r13
movq %r15, %r14
ja 0x11212a
movq 0x108(%rsp), %rsi
movq %r13, %rdx
callq 0x14690
movl %r13d, %r14d
movq %rbp, %rdi
callq 0x14760
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
movq 0x60(%rsp), %rbx
je 0x112149
callq 0x14760
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x112158
callq 0x14760
movq %rbx, %rdi
callq 0x14760
movq 0xc8(%rsp), %rdi
movq 0x8(%rdi), %rsi
movq 0xf0(%rsp), %rdx
movl %r14d, %ecx
addq %rdx, %rcx
callq 0x1168fe
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0x112191
callq 0x14760
movb $0x1, %bl
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x1121a2
callq 0x14760
movl %ebx, %eax
addq $0x148, %rsp # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x977d(%rip), %rdi # 0x11b93a
xorl %eax, %eax
callq 0x14d40
leaq 0x976f(%rip), %rdi # 0x11b93a
xorl %eax, %eax
callq 0x14d40
leaq 0x9761(%rip), %rdi # 0x11b93a
xorl %eax, %eax
callq 0x14d40
leaq 0x9753(%rip), %rdi # 0x11b93a
xorl %eax, %eax
callq 0x14d40
leaq 0x9745(%rip), %rdi # 0x11b93a
xorl %eax, %eax
callq 0x14d40
leaq 0x9737(%rip), %rdi # 0x11b93a
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x14d40
leaq 0x9725(%rip), %rdi # 0x11b93a
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x14d40
leaq 0x9713(%rip), %rdi # 0x11b93a
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x14d40
leaq 0x9701(%rip), %rdi # 0x11b93a
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x14d40
leaq 0x96ef(%rip), %rdi # 0x11b93a
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x14d40
leaq 0x96dd(%rip), %rdi # 0x11b93a
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x14d40
leaq 0x96cb(%rip), %rdi # 0x11b93a
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x14d40
leaq 0x96b9(%rip), %rdi # 0x11b93a
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x14d40
movq $0x0, 0x48(%rsp)
leaq 0x969e(%rip), %rdi # 0x11b93a
xorl %esi, %esi
movq 0x48(%rsp), %rdx
xorl %eax, %eax
callq 0x14d40
leaq 0x9689(%rip), %rdi # 0x11b93a
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x14d40
leaq 0x9677(%rip), %rdi # 0x11b93a
xorl %esi, %esi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x14d40
leaq 0x9664(%rip), %rdi # 0x11b93a
xorl %esi, %esi
xorl %eax, %eax
callq 0x14d40
leaq 0x9654(%rip), %rdi # 0x11b93a
xorl %esi, %esi
xorl %eax, %eax
callq 0x14d40
jmp 0x1122f1
movq %rax, %r14
jmp 0x11238e
movq %rax, %r14
jmp 0x112396
movq %rax, %r14
jmp 0x11239e
jmp 0x112409
jmp 0x112348
jmp 0x11231c
jmp 0x11231c
jmp 0x11236f
jmp 0x11236f
jmp 0x11236f
jmp 0x112352
movq %rax, %r14
jmp 0x1123b5
jmp 0x1123ea
movq %rax, %r14
jmp 0x1123c7
movq %rax, %r14
jmp 0x1123d6
jmp 0x112409
jmp 0x112409
jmp 0x112409
movq %rax, %r14
jmp 0x1123a8
jmp 0x1123ea
movq %rax, %r14
jmp 0x1123e0
jmp 0x1123ea
jmp 0x11236f
jmp 0x11236f
jmp 0x112409
jmp 0x112409
jmp 0x112383
movq %rax, %r14
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1123ed
callq 0x14760
jmp 0x1123ed
movq %rax, %r14
movq %r15, %rdi
callq 0x14760
movq %rbx, %rdi
callq 0x14760
movq %r12, %rdi
callq 0x14760
movq 0x8(%rsp), %rdi
callq 0x14760
movq 0xe0(%rsp), %rdi
callq 0x14760
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x1123c7
callq 0x14760
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1123d6
callq 0x14760
movq 0x60(%rsp), %rdi
callq 0x14760
movq 0xf0(%rsp), %rdi
jmp 0x1123f5
movq %rax, %r14
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x11240c
callq 0x14760
jmp 0x11240c
jmp 0x112409
jmp 0x112409
jmp 0x112409
jmp 0x112409
movq %rax, %r14
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x11241b
callq 0x14760
movq %r14, %rdi
callq 0x14fb0
| /embree[P]embree/tutorials/common/image/tinyexr.h |
tinyexr::hufCanonicalCodeTable(long long*) | static void hufCanonicalCodeTable(long long hcode[HUF_ENCSIZE]) {
long long n[59];
//
// For each i from 0 through 58, count the
// number of different codes of length i, and
// store the count in n[i].
//
for (int i = 0; i <= 58; ++i) n[i] = 0;
for (int i = 0; i < HUF_ENCSIZE; ++i) n[hcode[i]] += 1;
//
// For each i from 58 through 1, compute the
// numerically lowest code with length i, and
// store that code in n[i].
//
long long c = 0;
for (int i = 58; i > 0; --i) {
long long nc = ((c + n[i]) >> 1);
n[i] = c;
c = nc;
}
//
// hcode[i] contains the length, l, of the
// code for symbol i. Assign the next available
// code of length l to the symbol and store both
// l and the code in hcode[i].
//
for (int i = 0; i < HUF_ENCSIZE; ++i) {
int l = static_cast<int>(hcode[i]);
if (l > 0) hcode[i] = l | (n[l]++ << 6);
}
} | pushq %r14
pushq %rbx
subq $0x1d8, %rsp # imm = 0x1D8
movq %rdi, %rbx
movq %rsp, %rdi
xorl %r14d, %r14d
movl $0x1d8, %edx # imm = 0x1D8
xorl %esi, %esi
callq 0x14470
movq (%rbx,%r14,8), %rax
incq (%rsp,%rax,8)
incq %r14
cmpq $0x10001, %r14 # imm = 0x10001
jne 0x112442
movl $0x3b, %eax
xorl %ecx, %ecx
movq -0x8(%rsp,%rax,8), %rdx
addq %rcx, %rdx
sarq %rdx
movq %rcx, -0x8(%rsp,%rax,8)
decq %rax
movq %rdx, %rcx
cmpq $0x1, %rax
ja 0x11245d
xorl %eax, %eax
movq (%rbx,%rax,8), %rcx
testl %ecx, %ecx
jle 0x1124a0
andl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
movq (%rsp,%rcx,8), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, (%rsp,%rcx,8)
shlq $0x6, %rdx
orq %rcx, %rdx
movq %rdx, (%rbx,%rax,8)
incq %rax
cmpq $0x10001, %rax # imm = 0x10001
jne 0x11247b
addq $0x1d8, %rsp # imm = 0x1D8
popq %rbx
popq %r14
retq
| /embree[P]embree/tutorials/common/image/tinyexr.h |
tinyexr::DecodeTiledLevel(TEXRImage*, TEXRHeader const*, tinyexr::OffsetData const&, std::vector<unsigned long, std::allocator<unsigned long>> const&, int, unsigned char const*, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*) | static int DecodeTiledLevel(EXRImage* exr_image, const EXRHeader* exr_header,
const OffsetData& offset_data,
const std::vector<size_t>& channel_offset_list,
int pixel_data_size,
const unsigned char* head, const size_t size,
std::string* err) {
int num_channels = exr_header->num_channels;
int level_index = LevelIndex(exr_image->level_x, exr_image->level_y, exr_header->tile_level_mode, offset_data.num_x_levels);
int num_y_tiles = int(offset_data.offsets[size_t(level_index)].size());
assert(num_y_tiles);
int num_x_tiles = int(offset_data.offsets[size_t(level_index)][0].size());
assert(num_x_tiles);
int num_tiles = num_x_tiles * num_y_tiles;
int err_code = TINYEXR_SUCCESS;
enum {
EF_SUCCESS = 0,
EF_INVALID_DATA = 1,
EF_INSUFFICIENT_DATA = 2,
EF_FAILED_TO_DECODE = 4
};
#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
std::atomic<unsigned> error_flag(EF_SUCCESS);
#else
unsigned error_flag(EF_SUCCESS);
#endif
// Although the spec says : "...the data window is subdivided into an array of smaller rectangles...",
// the IlmImf library allows the dimensions of the tile to be larger (or equal) than the dimensions of the data window.
#if 0
if ((exr_header->tile_size_x > exr_image->width || exr_header->tile_size_y > exr_image->height) &&
exr_image->level_x == 0 && exr_image->level_y == 0) {
if (err) {
(*err) += "Failed to decode tile data.\n";
}
err_code = TINYEXR_ERROR_INVALID_DATA;
}
#endif
exr_image->tiles = static_cast<EXRTile*>(
calloc(sizeof(EXRTile), static_cast<size_t>(num_tiles)));
#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
std::vector<std::thread> workers;
std::atomic<int> tile_count(0);
int num_threads = std::max(1, int(std::thread::hardware_concurrency()));
if (num_threads > int(num_tiles)) {
num_threads = int(num_tiles);
}
for (int t = 0; t < num_threads; t++) {
workers.emplace_back(std::thread([&]()
{
int tile_idx = 0;
while ((tile_idx = tile_count++) < num_tiles) {
#else
#if TINYEXR_USE_OPENMP
#pragma omp parallel for
#endif
for (int tile_idx = 0; tile_idx < num_tiles; tile_idx++) {
#endif
// Allocate memory for each tile.
exr_image->tiles[tile_idx].images = tinyexr::AllocateImage(
num_channels, exr_header->channels,
exr_header->requested_pixel_types, exr_header->tile_size_x,
exr_header->tile_size_y);
int x_tile = tile_idx % num_x_tiles;
int y_tile = tile_idx / num_x_tiles;
// 16 byte: tile coordinates
// 4 byte : data size
// ~ : data(uncompressed or compressed)
tinyexr::tinyexr_uint64 offset = offset_data.offsets[size_t(level_index)][size_t(y_tile)][size_t(x_tile)];
if (offset + sizeof(int) * 5 > size) {
// Insufficient data size.
error_flag |= EF_INSUFFICIENT_DATA;
continue;
}
size_t data_size =
size_t(size - (offset + sizeof(int) * 5));
const unsigned char* data_ptr =
reinterpret_cast<const unsigned char*>(head + offset);
int tile_coordinates[4];
memcpy(tile_coordinates, data_ptr, sizeof(int) * 4);
tinyexr::swap4(&tile_coordinates[0]);
tinyexr::swap4(&tile_coordinates[1]);
tinyexr::swap4(&tile_coordinates[2]);
tinyexr::swap4(&tile_coordinates[3]);
if (tile_coordinates[2] != exr_image->level_x) {
// Invalid data.
error_flag |= EF_INVALID_DATA;
continue;
}
if (tile_coordinates[3] != exr_image->level_y) {
// Invalid data.
error_flag |= EF_INVALID_DATA;
continue;
}
int data_len;
memcpy(&data_len, data_ptr + 16,
sizeof(int)); // 16 = sizeof(tile_coordinates)
tinyexr::swap4(&data_len);
if (data_len < 2 || size_t(data_len) > data_size) {
// Insufficient data size.
error_flag |= EF_INSUFFICIENT_DATA;
continue;
}
// Move to data addr: 20 = 16 + 4;
data_ptr += 20;
bool ret = tinyexr::DecodeTiledPixelData(
exr_image->tiles[tile_idx].images,
&(exr_image->tiles[tile_idx].width),
&(exr_image->tiles[tile_idx].height),
exr_header->requested_pixel_types, data_ptr,
static_cast<size_t>(data_len), exr_header->compression_type,
exr_header->line_order,
exr_image->width, exr_image->height,
tile_coordinates[0], tile_coordinates[1], exr_header->tile_size_x,
exr_header->tile_size_y, static_cast<size_t>(pixel_data_size),
static_cast<size_t>(exr_header->num_custom_attributes),
exr_header->custom_attributes,
static_cast<size_t>(exr_header->num_channels),
exr_header->channels, channel_offset_list);
if (!ret) {
// Failed to decode tile data.
error_flag |= EF_FAILED_TO_DECODE;
}
exr_image->tiles[tile_idx].offset_x = tile_coordinates[0];
exr_image->tiles[tile_idx].offset_y = tile_coordinates[1];
exr_image->tiles[tile_idx].level_x = tile_coordinates[2];
exr_image->tiles[tile_idx].level_y = tile_coordinates[3];
#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
}
}));
} // num_thread loop
for (auto& t : workers) {
t.join();
}
#else
} // parallel for
#endif
// Even in the event of an error, the reserved memory may be freed.
exr_image->num_channels = num_channels;
exr_image->num_tiles = static_cast<int>(num_tiles);
if (error_flag) err_code = TINYEXR_ERROR_INVALID_DATA;
if (err) {
if (error_flag & EF_INSUFFICIENT_DATA) {
(*err) += "Insufficient data length.\n";
}
if (error_flag & EF_FAILED_TO_DECODE) {
(*err) += "Failed to decode tile data.\n";
}
}
return err_code;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r9, %r12
movl %r8d, 0x20(%rsp)
movq %rcx, %r15
movq %rdx, 0x28(%rsp)
movq %rsi, %rbp
movq %rdi, %rbx
movl 0x44(%rsi), %edx
movl 0x10(%rdi), %ecx
cmpl $0x2, %edx
je 0x112582
xorl %eax, %eax
cmpl $0x1, %edx
jne 0x112590
movl %ecx, %eax
jmp 0x112590
movl 0x14(%rbx), %eax
movq 0x28(%rsp), %rdx
imull 0x18(%rdx), %eax
addl %ecx, %eax
movl 0x78(%rbp), %ecx
movl %ecx, 0xc(%rsp)
cltq
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
leaq (%rax,%rax,2), %rdx
movq (%rcx,%rdx,8), %rax
movq %rdx, 0x90(%rsp)
movq 0x8(%rcx,%rdx,8), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movq 0x8(%rax), %rdx
subq (%rax), %rdx
shrq $0x3, %rdx
movq %rdx, 0x88(%rsp)
imull %edx, %ecx
imull $0xaaaaaaab, %ecx, %r13d # imm = 0xAAAAAAAB
movslq %r13d, %r14
movl $0x20, %edi
movq %r14, %rsi
callq 0x14550
movq %rax, (%rbx)
testl %r14d, %r14d
movl %r13d, 0x3c(%rsp)
jle 0x11283f
movq %r15, 0x78(%rsp)
movslq 0x20(%rsp), %rax
movq %rax, 0x70(%rsp)
movl %r13d, %eax
shlq $0x5, %rax
movq %rax, 0x20(%rsp)
xorl %r15d, %r15d
xorl %r14d, %r14d
xorl %r13d, %r13d
movq %r12, 0x18(%rsp)
movq 0x68(%rbp), %rsi
movq 0x80(%rbp), %rdx
movl 0x3c(%rbp), %ecx
movl 0x40(%rbp), %r8d
movl 0xc(%rsp), %edi
callq 0x1128a8
movq (%rbx), %rcx
movq %rax, 0x18(%rcx,%r15)
movl %r14d, %eax
cltd
idivl 0x88(%rsp)
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
cltq
movq 0x90(%rsp), %rsi
movq (%rcx,%rsi,8), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %rax
movq (%rax,%rdx,8), %rax
leaq 0x14(%rax), %rcx
movq 0xd0(%rsp), %rsi
subq %rcx, %rsi
jae 0x11268e
orl $0x2, %r13d
jmp 0x11282b
movq %r12, %rcx
movl 0x8(%r12,%rax), %r12d
cmpl 0x10(%rbx), %r12d
jne 0x1126c3
movl 0xc(%rcx,%rax), %r8d
cmpl 0x14(%rbx), %r8d
jne 0x1126c3
leaq (%rcx,%rax), %rdx
movslq 0x10(%rdx), %rcx
cmpq $0x2, %rcx
jl 0x1126ba
cmpq %rcx, %rsi
jae 0x1126cf
orl $0x2, %r13d
jmp 0x112826
orl $0x1, %r13d
movq %rcx, %r12
jmp 0x11282b
movq 0x18(%rsp), %rsi
movl (%rsi,%rax), %r10d
movl 0x4(%rsi,%rax), %edi
movq (%rbx), %r11
movl 0x3c(%rbp), %eax
movl 0x20(%rbx), %r9d
movq %rax, 0x48(%rsp)
movl %eax, %esi
movq %r10, 0x50(%rsp)
imull %r10d, %esi
movl %r9d, %eax
subl %esi, %eax
movq %rdi, 0x80(%rsp)
jl 0x11271e
movl 0x24(%rbx), %r10d
movl 0x40(%rbp), %esi
movq %rsi, 0x40(%rsp)
imull %edi, %esi
movl %r10d, 0x10(%rsp)
subl %esi, %r10d
jge 0x112727
orl $0x4, %r13d
jmp 0x1127fd
addq $0x14, %rdx
movq 0x18(%r11,%r15), %rsi
movq %rsi, 0x68(%rsp)
movq 0x80(%rbp), %rsi
movq %rsi, 0x60(%rsp)
movl 0x7c(%rbp), %esi
movl %esi, 0x34(%rsp)
movl %r8d, 0x38(%rsp)
movq 0x50(%rsp), %r8
incl %r8d
movq %r10, %rsi
movq 0x48(%rsp), %r10
imull %r10d, %r8d
cmpl %r9d, %r8d
movl 0x4(%rbp), %r9d
cmovll %r10d, %eax
leal 0x1(%rdi), %r8d
movq 0x40(%rsp), %rdi
imull %edi, %r8d
cmpl 0x10(%rsp), %r8d
movslq 0x78(%rbp), %r8
movq %r8, 0x10(%rsp)
movq 0x68(%rbp), %r8
movq %r8, 0x58(%rsp)
movl %eax, 0x10(%r11,%r15)
cmovll %edi, %esi
movl %esi, 0x14(%r11,%r15)
movq %rsi, %r10
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movl 0x34(%rsp), %r8d
pushq 0x78(%rsp)
pushq 0x60(%rsp)
pushq 0x20(%rsp)
pushq 0x88(%rsp)
pushq %r10
movl $0x0, %r10d
pushq %r10
pushq %r10
pushq 0x80(%rsp)
pushq 0x80(%rsp)
pushq %rax
callq 0x11294e
movl 0x88(%rsp), %r8d
addq $0x50, %rsp
movl %r13d, %ecx
orl $0x4, %ecx
testb %al, %al
cmovel %ecx, %r13d
movq (%rbx), %r11
movq 0x50(%rsp), %rax
movl %eax, (%r11,%r15)
movq (%rbx), %rax
movq 0x80(%rsp), %rcx
movl %ecx, 0x4(%rax,%r15)
movq (%rbx), %rax
movl %r12d, 0x8(%rax,%r15)
movq (%rbx), %rax
movl %r8d, 0xc(%rax,%r15)
movq 0x18(%rsp), %r12
incl %r14d
addq $0x20, %r15
cmpq %r15, 0x20(%rsp)
jne 0x112624
jmp 0x112842
xorl %r13d, %r13d
movl 0xc(%rsp), %eax
movl %eax, 0x28(%rbx)
movl 0x3c(%rsp), %eax
movl %eax, 0x2c(%rbx)
movq 0xd8(%rsp), %rbx
testq %rbx, %rbx
je 0x112887
testb $0x2, %r13b
je 0x112872
leaq 0x12a59(%rip), %rsi # 0x1252c3
movq %rbx, %rdi
callq 0x15190
testb $0x4, %r13b
je 0x112887
leaq 0x12a5f(%rip), %rsi # 0x1252de
movq %rbx, %rdi
callq 0x15190
xorl %eax, %eax
testl %r13d, %r13d
sete %al
leal -0x4(,%rax,4), %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/tinyexr.h |
tinyexr::AllocateImage(int, TEXRChannelInfo const*, int const*, int, int) | static unsigned char **AllocateImage(int num_channels,
const EXRChannelInfo *channels,
const int *requested_pixel_types,
int data_width, int data_height) {
unsigned char **images =
reinterpret_cast<unsigned char **>(static_cast<float **>(
malloc(sizeof(float *) * static_cast<size_t>(num_channels))));
for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
size_t data_len =
static_cast<size_t>(data_width) * static_cast<size_t>(data_height);
if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
// pixel_data_size += sizeof(unsigned short);
// channel_offset += sizeof(unsigned short);
// Alloc internal image for half type.
if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_HALF) {
images[c] =
reinterpret_cast<unsigned char *>(static_cast<unsigned short *>(
malloc(sizeof(unsigned short) * data_len)));
} else if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT) {
images[c] = reinterpret_cast<unsigned char *>(
static_cast<float *>(malloc(sizeof(float) * data_len)));
} else {
assert(0);
}
} else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
// pixel_data_size += sizeof(float);
// channel_offset += sizeof(float);
images[c] = reinterpret_cast<unsigned char *>(
static_cast<float *>(malloc(sizeof(float) * data_len)));
} else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
// pixel_data_size += sizeof(unsigned int);
// channel_offset += sizeof(unsigned int);
images[c] = reinterpret_cast<unsigned char *>(
static_cast<unsigned int *>(malloc(sizeof(unsigned int) * data_len)));
} else {
assert(0);
}
}
return images;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, %r12d
movq %rdx, (%rsp)
movq %rsi, %r14
movslq %edi, %r13
leaq (,%r13,8), %rdi
callq 0x14b30
movq %rax, %r15
testl %r13d, %r13d
je 0x11293c
movslq %r12d, %rax
movslq %ebp, %r12
imulq %rax, %r12
leaq (,%r12,4), %rbp
addq %r12, %r12
addq $0x100, %r14 # imm = 0x100
xorl %ebx, %ebx
movl (%r14), %eax
movq %rbp, %rdi
testl %eax, %eax
je 0x112924
movq %rbp, %rdi
cmpl $0x2, %eax
je 0x112924
cmpl $0x1, %eax
jne 0x11292d
movq (%rsp), %rax
movl (%rax,%rbx,4), %eax
movq %r12, %rdi
cmpl $0x1, %eax
je 0x112924
cmpl $0x2, %eax
jne 0x11292d
movq %rbp, %rdi
callq 0x14b30
movq %rax, (%r15,%rbx,8)
incq %rbx
addq $0x110, %r14 # imm = 0x110
cmpq %rbx, %r13
jne 0x1128f6
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /embree[P]embree/tutorials/common/image/tinyexr.h |
embree::toUpperCase(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) | std::string toUpperCase(const std::string& s) { std::string dst(s); std::transform(dst.begin(), dst.end(), dst.begin(), to_upper); return dst; } | pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %rax, %rsi
callq 0x621de
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x117b69
movq (%rbx), %r15
xorl %r12d, %r12d
movsbl (%r15,%r12), %edi
callq 0x150e0
movb %al, (%r15,%r12)
incq %r12
cmpq %r12, %r14
jne 0x117b53
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
| /embree[P]embree/common/sys/estring.cpp |
embree::string_to_Vec3f(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>) | Vec3f string_to_Vec3f ( std::string str )
{
size_t next = 0;
const float x = std::stof(str,&next); str = str.substr(next+1);
const float y = std::stof(str,&next); str = str.substr(next+1);
const float z = std::stof(str,&next);
return Vec3f(x,y,z);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %r12
callq 0x14080
movq %rax, %rbx
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x18(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x14b60
movq (%r13), %rdx
subq %r12, %rdx
je 0x117e13
movl (%rbx), %eax
cmpl $0x22, %eax
je 0x117e1f
movss %xmm0, 0x14(%rsp)
testl %eax, %eax
jne 0x117cf8
movl %ebp, (%rbx)
incq %rdx
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x14830
movq %r15, %rdi
movq %r12, %rsi
callq 0x14a30
movq (%r12), %rdi
leaq 0x28(%rsp), %rbp
cmpq %rbp, %rdi
je 0x117d30
callq 0x14760
movq (%r15), %r12
movl (%rbx), %eax
movl %eax, 0xc(%rsp)
movl $0x0, (%rbx)
leaq 0x18(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x14b60
movq (%r13), %rdx
subq %r12, %rdx
je 0x117e2b
movl (%rbx), %eax
cmpl $0x22, %eax
je 0x117e37
movss %xmm0, 0x10(%rsp)
testl %eax, %eax
jne 0x117d77
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
incq %rdx
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x14830
movq %r15, %rdi
movq %r12, %rsi
callq 0x14a30
movq (%r12), %rdi
cmpq %rbp, %rdi
je 0x117daa
callq 0x14760
movq (%r15), %r15
movl (%rbx), %ebp
movl $0x0, (%rbx)
leaq 0x18(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x14b60
cmpq %r15, (%r12)
je 0x117e43
movl (%rbx), %eax
testl %eax, %eax
je 0x117de2
cmpl $0x22, %eax
jne 0x117de4
leaq 0x8c19(%rip), %rdi # 0x1209f6
callq 0x14c70
movl %ebp, (%rbx)
movss 0x14(%rsp), %xmm1
movss %xmm1, (%r14)
movss 0x10(%rsp), %xmm1
movss %xmm1, 0x4(%r14)
movss %xmm0, 0x8(%r14)
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8bdc(%rip), %rdi # 0x1209f6
callq 0x144b0
leaq 0x8bd0(%rip), %rdi # 0x1209f6
callq 0x14c70
leaq 0x8bc4(%rip), %rdi # 0x1209f6
callq 0x144b0
leaq 0x8bb8(%rip), %rdi # 0x1209f6
callq 0x14c70
leaq 0x8bac(%rip), %rdi # 0x1209f6
callq 0x144b0
jmp 0x117e5e
cmpl $0x0, (%rbx)
jne 0x117e65
movl 0xc(%rsp), %ecx
movl %ecx, (%rbx)
jmp 0x117e65
cmpl $0x0, (%rbx)
jne 0x117e65
movl %ebp, (%rbx)
movq %rax, %rdi
callq 0x14fb0
| /embree[P]embree/common/sys/estring.cpp |
embree::string_to_Vec4f(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>) | Vec4f string_to_Vec4f ( std::string str )
{
size_t next = 0;
const float x = std::stof(str,&next); str = str.substr(next+1);
const float y = std::stof(str,&next); str = str.substr(next+1);
const float z = std::stof(str,&next); str = str.substr(next+1);
const float w = std::stof(str,&next);
return Vec4f(x,y,z,w);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %r12
callq 0x14080
movq %rax, %rbx
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x18(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x14b60
movq (%r13), %rdx
subq %r12, %rdx
je 0x118067
movl (%rbx), %eax
cmpl $0x22, %eax
je 0x118073
movss %xmm0, 0x14(%rsp)
testl %eax, %eax
jne 0x117ec8
movl %ebp, (%rbx)
incq %rdx
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x14830
movq %r15, %rdi
movq %r12, %rsi
callq 0x14a30
movq (%r12), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x117f00
callq 0x14760
movq (%r15), %r12
movl (%rbx), %ebp
movl $0x0, (%rbx)
leaq 0x18(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x14b60
movq (%r13), %rdx
subq %r12, %rdx
je 0x11807f
movl (%rbx), %eax
cmpl $0x22, %eax
je 0x11808b
movss %xmm0, 0x10(%rsp)
testl %eax, %eax
jne 0x117f3f
movl %ebp, (%rbx)
incq %rdx
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x14830
movq %r15, %rdi
movq %r12, %rsi
callq 0x14a30
movq (%r12), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x117f77
callq 0x14760
movq (%r15), %r12
movl (%rbx), %ebp
movl $0x0, (%rbx)
leaq 0x18(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x14b60
movq (%r13), %rdx
subq %r12, %rdx
je 0x118097
movl (%rbx), %eax
cmpl $0x22, %eax
je 0x1180a3
movss %xmm0, 0xc(%rsp)
testl %eax, %eax
jne 0x117fb6
movl %ebp, (%rbx)
incq %rdx
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x14830
movq %r15, %rdi
movq %r12, %rsi
callq 0x14a30
movq (%r12), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x117fee
callq 0x14760
movq (%r15), %r15
movl (%rbx), %ebp
movl $0x0, (%rbx)
leaq 0x18(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x14b60
cmpq %r15, (%r12)
je 0x1180af
movl (%rbx), %eax
testl %eax, %eax
je 0x11802a
cmpl $0x22, %eax
jne 0x11802c
leaq 0x89d1(%rip), %rdi # 0x1209f6
callq 0x14c70
movl %ebp, (%rbx)
movss 0x14(%rsp), %xmm1
movss %xmm1, (%r14)
movss 0x10(%rsp), %xmm1
movss %xmm1, 0x4(%r14)
movss 0xc(%rsp), %xmm1
movss %xmm1, 0x8(%r14)
movss %xmm0, 0xc(%r14)
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8988(%rip), %rdi # 0x1209f6
callq 0x144b0
leaq 0x897c(%rip), %rdi # 0x1209f6
callq 0x14c70
leaq 0x8970(%rip), %rdi # 0x1209f6
callq 0x144b0
leaq 0x8964(%rip), %rdi # 0x1209f6
callq 0x14c70
leaq 0x8958(%rip), %rdi # 0x1209f6
callq 0x144b0
leaq 0x894c(%rip), %rdi # 0x1209f6
callq 0x14c70
leaq 0x8940(%rip), %rdi # 0x1209f6
callq 0x144b0
jmp 0x1180c1
jmp 0x1180c1
jmp 0x1180c1
cmpl $0x0, (%rbx)
jne 0x1180c8
movl %ebp, (%rbx)
movq %rax, %rdi
callq 0x14fb0
| /embree[P]embree/common/sys/estring.cpp |
spectest::JSONParser::SkipWhitespace() | void JSONParser::SkipWhitespace() {
while (1) {
switch (ReadChar()) {
case -1:
return;
case ' ':
case '\t':
case '\n':
case '\r':
break;
default:
PutbackChar();
return;
}
}
} | pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1c1c50
movl %eax, %ecx
movl %ecx, -0x14(%rbp)
subl $-0x1, %eax
je 0x1c1d5a
jmp 0x1c1d39
movl -0x14(%rbp), %eax
addl $-0x9, %eax
subl $0x2, %eax
jb 0x1c1d5c
jmp 0x1c1d46
movl -0x14(%rbp), %eax
subl $0xd, %eax
je 0x1c1d5c
jmp 0x1c1d50
movl -0x14(%rbp), %eax
subl $0x20, %eax
je 0x1c1d5c
jmp 0x1c1d5e
jmp 0x1c1d6b
jmp 0x1c1d69
movq -0x10(%rbp), %rdi
callq 0x1c1bd0
jmp 0x1c1d6b
jmp 0x1c1d24
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::JSONParser::ExpectKey(char const*) | wabt::Result JSONParser::ExpectKey(const char* key) {
size_t keylen = strlen(key);
size_t quoted_len = keylen + 2 + 1;
char* quoted = static_cast<char*>(alloca(quoted_len));
snprintf(quoted, quoted_len, "\"%s\"", key);
EXPECT(quoted);
EXPECT(":");
return wabt::Result::Ok;
} | pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1a6190
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
addq $0xf, %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rcx
leaq 0x13fb42(%rip), %rdx # 0x301a6f
movb $0x0, %al
callq 0x1a65e0
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x1c1e60
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c1f52
jmp 0x1c1f62
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c1fa4
jmp 0x1c1f64
jmp 0x1c1f66
movq -0x40(%rbp), %rdi
leaq 0x13f603(%rip), %rsi # 0x301574
callq 0x1c1e60
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c1f87
jmp 0x1c1f97
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c1fa4
jmp 0x1c1f99
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
callq 0x1cba40
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::JSONParser::ParseUint32(unsigned int*) | wabt::Result JSONParser::ParseUint32(uint32_t* out_int) {
uint32_t result = 0;
SkipWhitespace();
while (1) {
int c = ReadChar();
if (c >= '0' && c <= '9') {
uint32_t last_result = result;
result = result * 10 + static_cast<uint32_t>(c - '0');
if (result < last_result) {
PrintError("uint32 overflow");
return wabt::Result::Error;
}
} else {
PutbackChar();
break;
}
}
*out_int = result;
return wabt::Result::Ok;
} | pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movl $0x0, -0x1c(%rbp)
callq 0x1c1d10
movq -0x30(%rbp), %rdi
callq 0x1c1c50
movl %eax, -0x20(%rbp)
cmpl $0x30, -0x20(%rbp)
jl 0x1c202d
cmpl $0x39, -0x20(%rbp)
jg 0x1c202d
movl -0x1c(%rbp), %eax
movl %eax, -0x24(%rbp)
imull $0xa, -0x1c(%rbp), %eax
movl -0x20(%rbp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x1c202b
movq -0x30(%rbp), %rdi
leaq 0x13f562(%rip), %rsi # 0x301576
movb $0x0, %al
callq 0x1c1a10
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c204e
jmp 0x1c2038
movq -0x30(%rbp), %rdi
callq 0x1c1bd0
jmp 0x1c203a
jmp 0x1c1fd4
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
callq 0x1cba40
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::JSONParser::ParseOptNameStringValue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*) | wabt::Result JSONParser::ParseOptNameStringValue(std::string* out_string) {
out_string->clear();
if (Match("\"name\"")) {
EXPECT(":");
CHECK_RESULT(ParseString(out_string));
EXPECT(",");
}
return wabt::Result::Ok;
} | pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1a6510
movq -0x30(%rbp), %rdi
leaq 0x13f31d(%rip), %rsi # 0x3015e9
callq 0x1c1d80
testb $0x1, %al
jne 0x1c22da
jmp 0x1c2378
jmp 0x1c22dc
movq -0x30(%rbp), %rdi
leaq 0x13f28d(%rip), %rsi # 0x301574
callq 0x1c1e60
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c22fd
jmp 0x1c230d
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c2383
jmp 0x1c230f
jmp 0x1c2311
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1c2060
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c232f
jmp 0x1c233f
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c2383
jmp 0x1c2341
jmp 0x1c2343
movq -0x30(%rbp), %rdi
leaq 0x13f2a2(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c2364
jmp 0x1c2374
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c2383
jmp 0x1c2376
jmp 0x1c2378
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
callq 0x1cba40
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::JSONParser::ParseConstVector(std::vector<wabt::Type, std::allocator<wabt::Type>>*, std::vector<wabt::interp::Value, std::allocator<wabt::interp::Value>>*) | wabt::Result JSONParser::ParseConstVector(ValueTypes* out_types, Values* out_values) {
out_values->clear();
EXPECT("[");
bool first = true;
while (!Match("]")) {
if (!first) {
EXPECT(",");
}
TypedValue tv;
CHECK_RESULT(ParseConst(&tv));
out_types->push_back(tv.type);
out_values->push_back(tv.value);
first = false;
}
return wabt::Result::Ok;
} | pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1cc030
movq -0x60(%rbp), %rdi
leaq 0x14d75d(%rip), %rsi # 0x3114dd
callq 0x1c1e60
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c3d96
jmp 0x1c3da9
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c3e72
jmp 0x1c3dab
movb $0x1, -0x25(%rbp)
movq -0x60(%rbp), %rdi
leaq 0x1444e3(%rip), %rsi # 0x30829d
callq 0x1c1d80
xorb $-0x1, %al
testb $0x1, %al
jne 0x1c3dca
jmp 0x1c3e67
testb $0x1, -0x25(%rbp)
jne 0x1c3e07
jmp 0x1c3dd2
movq -0x60(%rbp), %rdi
leaq 0x13d813(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c3df3
jmp 0x1c3e03
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c3e72
jmp 0x1c3e05
jmp 0x1c3e07
leaq -0x50(%rbp), %rdi
callq 0x1cb9e0
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x1c2900
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c3e2e
jmp 0x1c3e3e
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c3e72
jmp 0x1c3e40
movq -0x18(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x1cbb00
movq -0x20(%rbp), %rdi
leaq -0x50(%rbp), %rsi
addq $0x8, %rsi
callq 0x1cc050
movb $0x0, -0x25(%rbp)
jmp 0x1c3daf
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
callq 0x1cba40
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::JSONParser::ParseCommand(std::unique_ptr<spectest::Command, std::default_delete<spectest::Command>>*) | wabt::Result JSONParser::ParseCommand(CommandPtr* out_command) {
EXPECT("{");
EXPECT_KEY("type");
if (Match("\"module\"")) {
auto command = MakeUnique<ModuleCommand>();
EXPECT(",");
CHECK_RESULT(ParseLine(&command->line));
EXPECT(",");
CHECK_RESULT(ParseOptNameStringValue(&command->name));
CHECK_RESULT(ParseFilename(&command->filename));
*out_command = std::move(command);
} else if (Match("\"action\"")) {
auto command = MakeUnique<ActionCommand>();
EXPECT(",");
CHECK_RESULT(ParseLine(&command->line));
EXPECT(",");
CHECK_RESULT(ParseAction(&command->action));
EXPECT(",");
CHECK_RESULT(ParseActionResult());
*out_command = std::move(command);
} else if (Match("\"register\"")) {
auto command = MakeUnique<RegisterCommand>();
EXPECT(",");
CHECK_RESULT(ParseLine(&command->line));
EXPECT(",");
CHECK_RESULT(ParseOptNameStringValue(&command->name));
PARSE_KEY_STRING_VALUE("as", &command->as);
*out_command = std::move(command);
} else if (Match("\"assert_malformed\"")) {
auto command = MakeUnique<AssertMalformedCommand>();
EXPECT(",");
CHECK_RESULT(ParseLine(&command->line));
EXPECT(",");
CHECK_RESULT(ParseFilename(&command->filename));
EXPECT(",");
PARSE_KEY_STRING_VALUE("text", &command->text);
EXPECT(",");
CHECK_RESULT(ParseModuleType(&command->type));
*out_command = std::move(command);
} else if (Match("\"assert_invalid\"")) {
auto command = MakeUnique<AssertInvalidCommand>();
EXPECT(",");
CHECK_RESULT(ParseLine(&command->line));
EXPECT(",");
CHECK_RESULT(ParseFilename(&command->filename));
EXPECT(",");
PARSE_KEY_STRING_VALUE("text", &command->text);
EXPECT(",");
CHECK_RESULT(ParseModuleType(&command->type));
*out_command = std::move(command);
} else if (Match("\"assert_unlinkable\"")) {
auto command = MakeUnique<AssertUnlinkableCommand>();
EXPECT(",");
CHECK_RESULT(ParseLine(&command->line));
EXPECT(",");
CHECK_RESULT(ParseFilename(&command->filename));
EXPECT(",");
PARSE_KEY_STRING_VALUE("text", &command->text);
EXPECT(",");
CHECK_RESULT(ParseModuleType(&command->type));
*out_command = std::move(command);
} else if (Match("\"assert_uninstantiable\"")) {
auto command = MakeUnique<AssertUninstantiableCommand>();
EXPECT(",");
CHECK_RESULT(ParseLine(&command->line));
EXPECT(",");
CHECK_RESULT(ParseFilename(&command->filename));
EXPECT(",");
PARSE_KEY_STRING_VALUE("text", &command->text);
EXPECT(",");
CHECK_RESULT(ParseModuleType(&command->type));
*out_command = std::move(command);
} else if (Match("\"assert_return\"")) {
auto command = MakeUnique<AssertReturnCommand>();
EXPECT(",");
CHECK_RESULT(ParseLine(&command->line));
EXPECT(",");
CHECK_RESULT(ParseAction(&command->action));
EXPECT(",");
EXPECT_KEY("expected");
CHECK_RESULT(ParseExpectedValues(&command->expected));
*out_command = std::move(command);
} else if (Match("\"assert_trap\"")) {
auto command = MakeUnique<AssertTrapCommand>();
EXPECT(",");
CHECK_RESULT(ParseLine(&command->line));
EXPECT(",");
CHECK_RESULT(ParseAction(&command->action));
EXPECT(",");
PARSE_KEY_STRING_VALUE("text", &command->text);
EXPECT(",");
CHECK_RESULT(ParseActionResult());
*out_command = std::move(command);
} else if (Match("\"assert_exhaustion\"")) {
auto command = MakeUnique<AssertExhaustionCommand>();
EXPECT(",");
CHECK_RESULT(ParseLine(&command->line));
EXPECT(",");
CHECK_RESULT(ParseAction(&command->action));
EXPECT(",");
PARSE_KEY_STRING_VALUE("text", &command->text);
EXPECT(",");
CHECK_RESULT(ParseActionResult());
*out_command = std::move(command);
} else {
PrintError("unknown command type");
return wabt::Result::Error;
}
EXPECT("}");
return wabt::Result::Ok;
} | pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp # imm = 0x1B0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x1a8(%rbp), %rdi
leaq 0x13cfb3(%rip), %rsi # 0x30162f
callq 0x1c1e60
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4692
jmp 0x1c46a5
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c605f
jmp 0x1c46a7
jmp 0x1c46a9
movq -0x1a8(%rbp), %rdi
leaq 0x149e3a(%rip), %rsi # 0x30e4f1
callq 0x1c1ed0
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c46cd
jmp 0x1c46e0
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c605f
jmp 0x1c46e2
movq -0x1a8(%rbp), %rdi
leaq 0x13d0e2(%rip), %rsi # 0x3017d2
callq 0x1c1d80
testb $0x1, %al
jne 0x1c46fe
jmp 0x1c489e
leaq -0x28(%rbp), %rdi
callq 0x1cc190
movq -0x1a8(%rbp), %rdi
leaq 0x13cedb(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c472b
jmp 0x1c4745
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4882
jmp 0x1c4747
jmp 0x1c4749
jmp 0x1c474b
leaq -0x28(%rbp), %rdi
callq 0x1cc1f0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0xc, %rsi
callq 0x1c2390
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4778
jmp 0x1c4792
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4882
jmp 0x1c4794
jmp 0x1c4796
jmp 0x1c4798
movq -0x1a8(%rbp), %rdi
leaq 0x13ce4a(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c47bc
jmp 0x1c47d6
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4882
jmp 0x1c47d8
jmp 0x1c47da
jmp 0x1c47dc
leaq -0x28(%rbp), %rdi
callq 0x1cc1f0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x38, %rsi
callq 0x1c22a0
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4809
jmp 0x1c4820
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4882
jmp 0x1c4822
jmp 0x1c4824
jmp 0x1c4826
leaq -0x28(%rbp), %rdi
callq 0x1cc1f0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x18, %rsi
callq 0x1c45b0
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4853
jmp 0x1c486a
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4882
jmp 0x1c486c
jmp 0x1c486e
movq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1cc210
movl $0x0, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x1cc270
movl -0x30(%rbp), %eax
testl %eax, %eax
je 0x1c4899
jmp 0x1c4894
jmp 0x1c605f
jmp 0x1c6016
movq -0x1a8(%rbp), %rdi
leaq 0x13cf6f(%rip), %rsi # 0x30181b
callq 0x1c1d80
testb $0x1, %al
jne 0x1c48ba
jmp 0x1c4a8e
leaq -0x48(%rbp), %rdi
callq 0x1cc2c0
movq -0x1a8(%rbp), %rdi
leaq 0x13cd1f(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c48e7
jmp 0x1c4901
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4a72
jmp 0x1c4903
jmp 0x1c4905
jmp 0x1c4907
leaq -0x48(%rbp), %rdi
callq 0x1cc320
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0xc, %rsi
callq 0x1c2390
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4934
jmp 0x1c494e
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4a72
jmp 0x1c4950
jmp 0x1c4952
jmp 0x1c4954
movq -0x1a8(%rbp), %rdi
leaq 0x13cc8e(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4978
jmp 0x1c4992
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4a72
jmp 0x1c4994
jmp 0x1c4996
jmp 0x1c4998
leaq -0x48(%rbp), %rdi
callq 0x1cc320
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x10, %rsi
callq 0x1c3e80
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c49c5
jmp 0x1c49df
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4a72
jmp 0x1c49e1
jmp 0x1c49e3
jmp 0x1c49e5
movq -0x1a8(%rbp), %rdi
leaq 0x13cbfd(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4a09
jmp 0x1c4a20
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4a72
jmp 0x1c4a22
jmp 0x1c4a24
jmp 0x1c4a26
movq -0x1a8(%rbp), %rdi
callq 0x1c41f0
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4a43
jmp 0x1c4a5a
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4a72
jmp 0x1c4a5c
jmp 0x1c4a5e
movq -0x18(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x1cc340
movl $0x0, -0x30(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x1cc3a0
movl -0x30(%rbp), %eax
testl %eax, %eax
je 0x1c4a89
jmp 0x1c4a84
jmp 0x1c605f
jmp 0x1c6014
movq -0x1a8(%rbp), %rdi
leaq 0x13cd88(%rip), %rsi # 0x301824
callq 0x1c1d80
testb $0x1, %al
jne 0x1c4aaa
jmp 0x1c4c51
leaq -0x68(%rbp), %rdi
callq 0x1cc3f0
movq -0x1a8(%rbp), %rdi
leaq 0x13cb2f(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4ad7
jmp 0x1c4af1
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4c35
jmp 0x1c4af3
jmp 0x1c4af5
jmp 0x1c4af7
leaq -0x68(%rbp), %rdi
callq 0x1cc450
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0xc, %rsi
callq 0x1c2390
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4b24
jmp 0x1c4b3e
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4c35
jmp 0x1c4b40
jmp 0x1c4b42
jmp 0x1c4b44
movq -0x1a8(%rbp), %rdi
leaq 0x13ca9e(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4b68
jmp 0x1c4b82
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4c35
jmp 0x1c4b84
jmp 0x1c4b86
jmp 0x1c4b88
leaq -0x68(%rbp), %rdi
callq 0x1cc450
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x30, %rsi
callq 0x1c22a0
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4bb5
jmp 0x1c4bcc
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4c35
jmp 0x1c4bce
jmp 0x1c4bd0
jmp 0x1c4bd2
leaq -0x68(%rbp), %rdi
callq 0x1cc450
movq -0x1a8(%rbp), %rdi
movq %rax, %rdx
addq $0x10, %rdx
leaq 0x13cc3f(%rip), %rsi # 0x30182f
callq 0x1c2230
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4c06
jmp 0x1c4c1d
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4c35
jmp 0x1c4c1f
jmp 0x1c4c21
movq -0x18(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x1cc470
movl $0x0, -0x30(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x1cc4d0
movl -0x30(%rbp), %eax
testl %eax, %eax
je 0x1c4c4c
jmp 0x1c4c47
jmp 0x1c605f
jmp 0x1c6012
movq -0x1a8(%rbp), %rdi
leaq 0x13cbd3(%rip), %rsi # 0x301832
callq 0x1c1d80
testb $0x1, %al
jne 0x1c4c6d
jmp 0x1c4f2e
leaq -0x88(%rbp), %rdi
callq 0x1cc520
movq -0x1a8(%rbp), %rdi
leaq 0x13c969(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x8c(%rbp)
movl -0x8c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4ca3
jmp 0x1c4cbd
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4f0f
jmp 0x1c4cbf
jmp 0x1c4cc1
jmp 0x1c4cc3
leaq -0x88(%rbp), %rdi
callq 0x1cc580
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0xc, %rsi
callq 0x1c2390
movl %eax, -0x90(%rbp)
movl -0x90(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4cf9
jmp 0x1c4d13
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4f0f
jmp 0x1c4d15
jmp 0x1c4d17
jmp 0x1c4d19
movq -0x1a8(%rbp), %rdi
leaq 0x13c8c9(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x94(%rbp)
movl -0x94(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4d43
jmp 0x1c4d5d
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4f0f
jmp 0x1c4d5f
jmp 0x1c4d61
jmp 0x1c4d63
leaq -0x88(%rbp), %rdi
callq 0x1cc580
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x18, %rsi
callq 0x1c45b0
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4d99
jmp 0x1c4db3
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4f0f
jmp 0x1c4db5
jmp 0x1c4db7
jmp 0x1c4db9
movq -0x1a8(%rbp), %rdi
leaq 0x13c829(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4de3
jmp 0x1c4dfd
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4f0f
jmp 0x1c4dff
jmp 0x1c4e01
jmp 0x1c4e03
leaq -0x88(%rbp), %rdi
callq 0x1cc580
movq -0x1a8(%rbp), %rdi
movq %rax, %rdx
addq $0x38, %rdx
leaq 0x13c9d1(%rip), %rsi # 0x3017f5
callq 0x1c2230
movl %eax, -0xa0(%rbp)
movl -0xa0(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4e40
jmp 0x1c4e5a
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4f0f
jmp 0x1c4e5c
jmp 0x1c4e5e
jmp 0x1c4e60
movq -0x1a8(%rbp), %rdi
leaq 0x13c782(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4e8a
jmp 0x1c4ea1
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4f0f
jmp 0x1c4ea3
jmp 0x1c4ea5
jmp 0x1c4ea7
leaq -0x88(%rbp), %rdi
callq 0x1cc580
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x10, %rsi
callq 0x1c42a0
movl %eax, -0xa8(%rbp)
movl -0xa8(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4edd
jmp 0x1c4ef4
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c4f0f
jmp 0x1c4ef6
jmp 0x1c4ef8
movq -0x18(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x1cc5a0
movl $0x0, -0x30(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x1cc600
movl -0x30(%rbp), %eax
testl %eax, %eax
je 0x1c4f29
jmp 0x1c4f24
jmp 0x1c605f
jmp 0x1c6010
movq -0x1a8(%rbp), %rdi
leaq 0x13c909(%rip), %rsi # 0x301845
callq 0x1c1d80
testb $0x1, %al
jne 0x1c4f4a
jmp 0x1c520b
leaq -0xb0(%rbp), %rdi
callq 0x1cc650
movq -0x1a8(%rbp), %rdi
leaq 0x13c68c(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0xb4(%rbp)
movl -0xb4(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4f80
jmp 0x1c4f9a
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c51ec
jmp 0x1c4f9c
jmp 0x1c4f9e
jmp 0x1c4fa0
leaq -0xb0(%rbp), %rdi
callq 0x1cc6b0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0xc, %rsi
callq 0x1c2390
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c4fd6
jmp 0x1c4ff0
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c51ec
jmp 0x1c4ff2
jmp 0x1c4ff4
jmp 0x1c4ff6
movq -0x1a8(%rbp), %rdi
leaq 0x13c5ec(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5020
jmp 0x1c503a
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c51ec
jmp 0x1c503c
jmp 0x1c503e
jmp 0x1c5040
leaq -0xb0(%rbp), %rdi
callq 0x1cc6b0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x18, %rsi
callq 0x1c45b0
movl %eax, -0xc0(%rbp)
movl -0xc0(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5076
jmp 0x1c5090
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c51ec
jmp 0x1c5092
jmp 0x1c5094
jmp 0x1c5096
movq -0x1a8(%rbp), %rdi
leaq 0x13c54c(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0xc4(%rbp)
movl -0xc4(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c50c0
jmp 0x1c50da
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c51ec
jmp 0x1c50dc
jmp 0x1c50de
jmp 0x1c50e0
leaq -0xb0(%rbp), %rdi
callq 0x1cc6b0
movq -0x1a8(%rbp), %rdi
movq %rax, %rdx
addq $0x38, %rdx
leaq 0x13c6f4(%rip), %rsi # 0x3017f5
callq 0x1c2230
movl %eax, -0xc8(%rbp)
movl -0xc8(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c511d
jmp 0x1c5137
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c51ec
jmp 0x1c5139
jmp 0x1c513b
jmp 0x1c513d
movq -0x1a8(%rbp), %rdi
leaq 0x13c4a5(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0xcc(%rbp)
movl -0xcc(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5167
jmp 0x1c517e
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c51ec
jmp 0x1c5180
jmp 0x1c5182
jmp 0x1c5184
leaq -0xb0(%rbp), %rdi
callq 0x1cc6b0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x10, %rsi
callq 0x1c42a0
movl %eax, -0xd0(%rbp)
movl -0xd0(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c51ba
jmp 0x1c51d1
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c51ec
jmp 0x1c51d3
jmp 0x1c51d5
movq -0x18(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x1cc6d0
movl $0x0, -0x30(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x1cc730
movl -0x30(%rbp), %eax
testl %eax, %eax
je 0x1c5206
jmp 0x1c5201
jmp 0x1c605f
jmp 0x1c600e
movq -0x1a8(%rbp), %rdi
leaq 0x13c63d(%rip), %rsi # 0x301856
callq 0x1c1d80
testb $0x1, %al
jne 0x1c5227
jmp 0x1c54e8
leaq -0xd8(%rbp), %rdi
callq 0x1cc780
movq -0x1a8(%rbp), %rdi
leaq 0x13c3af(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0xdc(%rbp)
movl -0xdc(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c525d
jmp 0x1c5277
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c54c9
jmp 0x1c5279
jmp 0x1c527b
jmp 0x1c527d
leaq -0xd8(%rbp), %rdi
callq 0x1cc7e0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0xc, %rsi
callq 0x1c2390
movl %eax, -0xe0(%rbp)
movl -0xe0(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c52b3
jmp 0x1c52cd
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c54c9
jmp 0x1c52cf
jmp 0x1c52d1
jmp 0x1c52d3
movq -0x1a8(%rbp), %rdi
leaq 0x13c30f(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0xe4(%rbp)
movl -0xe4(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c52fd
jmp 0x1c5317
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c54c9
jmp 0x1c5319
jmp 0x1c531b
jmp 0x1c531d
leaq -0xd8(%rbp), %rdi
callq 0x1cc7e0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x18, %rsi
callq 0x1c45b0
movl %eax, -0xe8(%rbp)
movl -0xe8(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5353
jmp 0x1c536d
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c54c9
jmp 0x1c536f
jmp 0x1c5371
jmp 0x1c5373
movq -0x1a8(%rbp), %rdi
leaq 0x13c26f(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0xec(%rbp)
movl -0xec(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c539d
jmp 0x1c53b7
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c54c9
jmp 0x1c53b9
jmp 0x1c53bb
jmp 0x1c53bd
leaq -0xd8(%rbp), %rdi
callq 0x1cc7e0
movq -0x1a8(%rbp), %rdi
movq %rax, %rdx
addq $0x38, %rdx
leaq 0x13c417(%rip), %rsi # 0x3017f5
callq 0x1c2230
movl %eax, -0xf0(%rbp)
movl -0xf0(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c53fa
jmp 0x1c5414
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c54c9
jmp 0x1c5416
jmp 0x1c5418
jmp 0x1c541a
movq -0x1a8(%rbp), %rdi
leaq 0x13c1c8(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0xf4(%rbp)
movl -0xf4(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5444
jmp 0x1c545b
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c54c9
jmp 0x1c545d
jmp 0x1c545f
jmp 0x1c5461
leaq -0xd8(%rbp), %rdi
callq 0x1cc7e0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x10, %rsi
callq 0x1c42a0
movl %eax, -0xf8(%rbp)
movl -0xf8(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5497
jmp 0x1c54ae
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c54c9
jmp 0x1c54b0
jmp 0x1c54b2
movq -0x18(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x1cc800
movl $0x0, -0x30(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x1cc860
movl -0x30(%rbp), %eax
testl %eax, %eax
je 0x1c54e3
jmp 0x1c54de
jmp 0x1c605f
jmp 0x1c600c
movq -0x1a8(%rbp), %rdi
leaq 0x13c374(%rip), %rsi # 0x30186a
callq 0x1c1d80
testb $0x1, %al
jne 0x1c5504
jmp 0x1c57c5
leaq -0x100(%rbp), %rdi
callq 0x1cc8b0
movq -0x1a8(%rbp), %rdi
leaq 0x13c0d2(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x104(%rbp)
movl -0x104(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c553a
jmp 0x1c5554
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c57a6
jmp 0x1c5556
jmp 0x1c5558
jmp 0x1c555a
leaq -0x100(%rbp), %rdi
callq 0x1cc910
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0xc, %rsi
callq 0x1c2390
movl %eax, -0x108(%rbp)
movl -0x108(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5590
jmp 0x1c55aa
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c57a6
jmp 0x1c55ac
jmp 0x1c55ae
jmp 0x1c55b0
movq -0x1a8(%rbp), %rdi
leaq 0x13c032(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x10c(%rbp)
movl -0x10c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c55da
jmp 0x1c55f4
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c57a6
jmp 0x1c55f6
jmp 0x1c55f8
jmp 0x1c55fa
leaq -0x100(%rbp), %rdi
callq 0x1cc910
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x18, %rsi
callq 0x1c45b0
movl %eax, -0x110(%rbp)
movl -0x110(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5630
jmp 0x1c564a
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c57a6
jmp 0x1c564c
jmp 0x1c564e
jmp 0x1c5650
movq -0x1a8(%rbp), %rdi
leaq 0x13bf92(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x114(%rbp)
movl -0x114(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c567a
jmp 0x1c5694
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c57a6
jmp 0x1c5696
jmp 0x1c5698
jmp 0x1c569a
leaq -0x100(%rbp), %rdi
callq 0x1cc910
movq -0x1a8(%rbp), %rdi
movq %rax, %rdx
addq $0x38, %rdx
leaq 0x13c13a(%rip), %rsi # 0x3017f5
callq 0x1c2230
movl %eax, -0x118(%rbp)
movl -0x118(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c56d7
jmp 0x1c56f1
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c57a6
jmp 0x1c56f3
jmp 0x1c56f5
jmp 0x1c56f7
movq -0x1a8(%rbp), %rdi
leaq 0x13beeb(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x11c(%rbp)
movl -0x11c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5721
jmp 0x1c5738
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c57a6
jmp 0x1c573a
jmp 0x1c573c
jmp 0x1c573e
leaq -0x100(%rbp), %rdi
callq 0x1cc910
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x10, %rsi
callq 0x1c42a0
movl %eax, -0x120(%rbp)
movl -0x120(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5774
jmp 0x1c578b
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c57a6
jmp 0x1c578d
jmp 0x1c578f
movq -0x18(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x1cc930
movl $0x0, -0x30(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x1cc990
movl -0x30(%rbp), %eax
testl %eax, %eax
je 0x1c57c0
jmp 0x1c57bb
jmp 0x1c605f
jmp 0x1c600a
movq -0x1a8(%rbp), %rdi
leaq 0x13c0af(%rip), %rsi # 0x301882
callq 0x1c1d80
testb $0x1, %al
jne 0x1c57e1
jmp 0x1c5a48
leaq -0x128(%rbp), %rdi
callq 0x1cc9e0
movq -0x1a8(%rbp), %rdi
leaq 0x13bdf5(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x12c(%rbp)
movl -0x12c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5817
jmp 0x1c5831
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5a29
jmp 0x1c5833
jmp 0x1c5835
jmp 0x1c5837
leaq -0x128(%rbp), %rdi
callq 0x1cca40
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0xc, %rsi
callq 0x1c2390
movl %eax, -0x130(%rbp)
movl -0x130(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c586d
jmp 0x1c5887
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5a29
jmp 0x1c5889
jmp 0x1c588b
jmp 0x1c588d
movq -0x1a8(%rbp), %rdi
leaq 0x13bd55(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x134(%rbp)
movl -0x134(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c58b7
jmp 0x1c58d1
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5a29
jmp 0x1c58d3
jmp 0x1c58d5
jmp 0x1c58d7
leaq -0x128(%rbp), %rdi
callq 0x1cca40
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x10, %rsi
callq 0x1c3e80
movl %eax, -0x138(%rbp)
movl -0x138(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c590d
jmp 0x1c5927
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5a29
jmp 0x1c5929
jmp 0x1c592b
jmp 0x1c592d
movq -0x1a8(%rbp), %rdi
leaq 0x13bcb5(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x13c(%rbp)
movl -0x13c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5957
jmp 0x1c5971
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5a29
jmp 0x1c5973
jmp 0x1c5975
jmp 0x1c5977
movq -0x1a8(%rbp), %rdi
leaq 0x13be5b(%rip), %rsi # 0x3017e0
callq 0x1c1ed0
movl %eax, -0x140(%rbp)
movl -0x140(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c59a1
jmp 0x1c59b8
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5a29
jmp 0x1c59ba
jmp 0x1c59bc
jmp 0x1c59be
leaq -0x128(%rbp), %rdi
callq 0x1cca40
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x88, %rsi
callq 0x1c3c30
movl %eax, -0x144(%rbp)
movl -0x144(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c59f7
jmp 0x1c5a0e
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5a29
jmp 0x1c5a10
jmp 0x1c5a12
movq -0x18(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x1cca60
movl $0x0, -0x30(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x1ccac0
movl -0x30(%rbp), %eax
testl %eax, %eax
je 0x1c5a43
jmp 0x1c5a3e
jmp 0x1c605f
jmp 0x1c6008
movq -0x1a8(%rbp), %rdi
leaq 0x13be3c(%rip), %rsi # 0x301892
callq 0x1c1d80
testb $0x1, %al
jne 0x1c5a64
jmp 0x1c5d15
leaq -0x150(%rbp), %rdi
callq 0x1ccb10
movq -0x1a8(%rbp), %rdi
leaq 0x13bb72(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x154(%rbp)
movl -0x154(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5a9a
jmp 0x1c5ab4
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5cf6
jmp 0x1c5ab6
jmp 0x1c5ab8
jmp 0x1c5aba
leaq -0x150(%rbp), %rdi
callq 0x1ccb70
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0xc, %rsi
callq 0x1c2390
movl %eax, -0x158(%rbp)
movl -0x158(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5af0
jmp 0x1c5b0a
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5cf6
jmp 0x1c5b0c
jmp 0x1c5b0e
jmp 0x1c5b10
movq -0x1a8(%rbp), %rdi
leaq 0x13bad2(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x15c(%rbp)
movl -0x15c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5b3a
jmp 0x1c5b54
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5cf6
jmp 0x1c5b56
jmp 0x1c5b58
jmp 0x1c5b5a
leaq -0x150(%rbp), %rdi
callq 0x1ccb70
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x10, %rsi
callq 0x1c3e80
movl %eax, -0x160(%rbp)
movl -0x160(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5b90
jmp 0x1c5baa
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5cf6
jmp 0x1c5bac
jmp 0x1c5bae
jmp 0x1c5bb0
movq -0x1a8(%rbp), %rdi
leaq 0x13ba32(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x164(%rbp)
movl -0x164(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5bda
jmp 0x1c5bf4
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5cf6
jmp 0x1c5bf6
jmp 0x1c5bf8
jmp 0x1c5bfa
leaq -0x150(%rbp), %rdi
callq 0x1ccb70
movq -0x1a8(%rbp), %rdi
movq %rax, %rdx
addq $0x88, %rdx
leaq 0x13bbd7(%rip), %rsi # 0x3017f5
callq 0x1c2230
movl %eax, -0x168(%rbp)
movl -0x168(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5c3a
jmp 0x1c5c54
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5cf6
jmp 0x1c5c56
jmp 0x1c5c58
jmp 0x1c5c5a
movq -0x1a8(%rbp), %rdi
leaq 0x13b988(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x16c(%rbp)
movl -0x16c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5c84
jmp 0x1c5c9b
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5cf6
jmp 0x1c5c9d
jmp 0x1c5c9f
jmp 0x1c5ca1
movq -0x1a8(%rbp), %rdi
callq 0x1c41f0
movl %eax, -0x170(%rbp)
movl -0x170(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5cc4
jmp 0x1c5cdb
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5cf6
jmp 0x1c5cdd
jmp 0x1c5cdf
movq -0x18(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x1ccb90
movl $0x0, -0x30(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x1ccbf0
movl -0x30(%rbp), %eax
testl %eax, %eax
je 0x1c5d10
jmp 0x1c5d0b
jmp 0x1c605f
jmp 0x1c6006
movq -0x1a8(%rbp), %rdi
leaq 0x13bb7d(%rip), %rsi # 0x3018a0
callq 0x1c1d80
testb $0x1, %al
jne 0x1c5d31
jmp 0x1c5fdf
leaq -0x178(%rbp), %rdi
callq 0x1ccc40
movq -0x1a8(%rbp), %rdi
leaq 0x13b8a5(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x17c(%rbp)
movl -0x17c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5d67
jmp 0x1c5d81
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5fc3
jmp 0x1c5d83
jmp 0x1c5d85
jmp 0x1c5d87
leaq -0x178(%rbp), %rdi
callq 0x1ccca0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0xc, %rsi
callq 0x1c2390
movl %eax, -0x180(%rbp)
movl -0x180(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5dbd
jmp 0x1c5dd7
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5fc3
jmp 0x1c5dd9
jmp 0x1c5ddb
jmp 0x1c5ddd
movq -0x1a8(%rbp), %rdi
leaq 0x13b805(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x184(%rbp)
movl -0x184(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5e07
jmp 0x1c5e21
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5fc3
jmp 0x1c5e23
jmp 0x1c5e25
jmp 0x1c5e27
leaq -0x178(%rbp), %rdi
callq 0x1ccca0
movq -0x1a8(%rbp), %rdi
movq %rax, %rsi
addq $0x10, %rsi
callq 0x1c3e80
movl %eax, -0x188(%rbp)
movl -0x188(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5e5d
jmp 0x1c5e77
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5fc3
jmp 0x1c5e79
jmp 0x1c5e7b
jmp 0x1c5e7d
movq -0x1a8(%rbp), %rdi
leaq 0x13b765(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x18c(%rbp)
movl -0x18c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5ea7
jmp 0x1c5ec1
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5fc3
jmp 0x1c5ec3
jmp 0x1c5ec5
jmp 0x1c5ec7
leaq -0x178(%rbp), %rdi
callq 0x1ccca0
movq -0x1a8(%rbp), %rdi
movq %rax, %rdx
addq $0x88, %rdx
leaq 0x13b90a(%rip), %rsi # 0x3017f5
callq 0x1c2230
movl %eax, -0x190(%rbp)
movl -0x190(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5f07
jmp 0x1c5f21
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5fc3
jmp 0x1c5f23
jmp 0x1c5f25
jmp 0x1c5f27
movq -0x1a8(%rbp), %rdi
leaq 0x13b6bb(%rip), %rsi # 0x3015f0
callq 0x1c1e60
movl %eax, -0x194(%rbp)
movl -0x194(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5f51
jmp 0x1c5f68
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5fc3
jmp 0x1c5f6a
jmp 0x1c5f6c
jmp 0x1c5f6e
movq -0x1a8(%rbp), %rdi
callq 0x1c41f0
movl %eax, -0x198(%rbp)
movl -0x198(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c5f91
jmp 0x1c5fa8
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x30(%rbp)
jmp 0x1c5fc3
jmp 0x1c5faa
jmp 0x1c5fac
movq -0x18(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x1cccc0
movl $0x0, -0x30(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x1ccd20
movl -0x30(%rbp), %eax
testl %eax, %eax
je 0x1c5fdd
jmp 0x1c5fd8
jmp 0x1c605f
jmp 0x1c6004
movq -0x1a8(%rbp), %rdi
leaq 0x13b8c7(%rip), %rsi # 0x3018b4
movb $0x0, %al
callq 0x1c1a10
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c605f
jmp 0x1c6006
jmp 0x1c6008
jmp 0x1c600a
jmp 0x1c600c
jmp 0x1c600e
jmp 0x1c6010
jmp 0x1c6012
jmp 0x1c6014
jmp 0x1c6016
jmp 0x1c6018
movq -0x1a8(%rbp), %rdi
leaq 0x13b60b(%rip), %rsi # 0x301631
callq 0x1c1e60
movl %eax, -0x19c(%rbp)
movl -0x19c(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c6042
jmp 0x1c6052
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c605f
jmp 0x1c6054
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
callq 0x1cba40
movl -0x4(%rbp), %eax
addq $0x1b0, %rsp # imm = 0x1B0
popq %rbp
retq
nopl (%rax,%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::CommandRunner::CommandRunner() | CommandRunner::CommandRunner() : store_(s_features) {
auto&& spectest = registry_["spectest"];
// Initialize print functions for the spec test.
struct {
const char* name;
interp::FuncType type;
} const print_funcs[] = {
{"print", interp::FuncType{{}, {}}},
{"print_i32", interp::FuncType{{ValueType::I32}, {}}},
{"print_f32", interp::FuncType{{ValueType::F32}, {}}},
{"print_f64", interp::FuncType{{ValueType::F64}, {}}},
{"print_i32_f32", interp::FuncType{{ValueType::I32, ValueType::F32}, {}}},
{"print_f64_f64", interp::FuncType{{ValueType::F64, ValueType::F64}, {}}},
};
for (auto&& print : print_funcs) {
auto import_name = StringPrintf("spectest.%s", print.name);
spectest[print.name] = HostFunc::New(
store_, print.type,
[=](Thread& inst, const Values& params, Values& results,
Trap::Ptr* trap) -> wabt::Result {
printf("called host ");
WriteCall(s_stdout_stream.get(), import_name, print.type, params,
results, *trap);
return wabt::Result::Ok;
});
}
spectest["table"] =
interp::Table::New(store_, TableType{ValueType::FuncRef, Limits{10, 20}});
spectest["memory"] = interp::Memory::New(store_, MemoryType{Limits{1, 2}});
spectest["global_i32"] = interp::Global::New(
store_, GlobalType{ValueType::I32, Mutability::Const}, Value::Make(u32{666}));
spectest["global_i64"] = interp::Global::New(
store_, GlobalType{ValueType::I64, Mutability::Const}, Value::Make(u64{666}));
spectest["global_f32"] = interp::Global::New(
store_, GlobalType{ValueType::F32, Mutability::Const}, Value::Make(f32{666}));
spectest["global_f64"] = interp::Global::New(
store_, GlobalType{ValueType::F64, Mutability::Const}, Value::Make(f64{666}));
} | pushq %rbp
movq %rsp, %rbp
subq $0x880, %rsp # imm = 0x880
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x810(%rbp)
leaq 0x1ee09f(%rip), %rsi # 0x3b4390
callq 0x26c2f0
movq -0x810(%rbp), %rdi
addq $0xe8, %rdi
callq 0x1cce20
movq -0x810(%rbp), %rdi
addq $0x118, %rdi # imm = 0x118
callq 0x1cce20
movq -0x810(%rbp), %rdi
addq $0x148, %rdi # imm = 0x148
callq 0x1cce40
movq -0x810(%rbp), %rdi
movl $0x0, 0x178(%rdi)
movl $0x0, 0x17c(%rdi)
addq $0x180, %rdi # imm = 0x180
callq 0x1a6560
movq -0x810(%rbp), %rax
addq $0xe8, %rax
movq %rax, -0x808(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x1a6650
leaq -0x30(%rbp), %rdi
leaq 0x13b564(%rip), %rsi # 0x3018e2
leaq -0x31(%rbp), %rdx
callq 0x1a6550
movq -0x808(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1cce60
movq %rax, -0x800(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x1a6250
leaq -0x31(%rbp), %rdi
callq 0x1a6440
movq -0x800(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0x13b529(%rip), %rax # 0x3018eb
movq %rax, -0x1f0(%rbp)
leaq -0x1f0(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x7f8(%rbp)
leaq -0x208(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1a61d0
leaq -0x208(%rbp), %rdi
callq 0x1cc0c0
leaq -0x220(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1a61d0
leaq -0x220(%rbp), %rdi
callq 0x1cc0c0
movq -0x7f8(%rbp), %rdi
leaq -0x208(%rbp), %rsi
leaq -0x220(%rbp), %rdx
callq 0x1ccf40
leaq -0x1f0(%rbp), %rax
addq $0x48, %rax
leaq 0x13b4ac(%rip), %rcx # 0x3018f1
movq %rcx, -0x1a8(%rbp)
addq $0x8, %rax
movq %rax, -0x7f0(%rbp)
leaq -0x24c(%rbp), %rdi
movl $0xffffffff, %esi # imm = 0xFFFFFFFF
callq 0x1cbac0
leaq -0x24c(%rbp), %rax
movq %rax, -0x248(%rbp)
movq $0x1, -0x240(%rbp)
leaq -0x24d(%rbp), %rdi
callq 0x1ccfb0
movq -0x248(%rbp), %rsi
movq -0x240(%rbp), %rdx
leaq -0x238(%rbp), %rdi
leaq -0x24d(%rbp), %rcx
callq 0x1ccfd0
leaq -0x268(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1a61d0
leaq -0x268(%rbp), %rdi
callq 0x1cc0c0
movq -0x7f0(%rbp), %rdi
leaq -0x238(%rbp), %rsi
leaq -0x268(%rbp), %rdx
callq 0x1ccf40
leaq -0x1f0(%rbp), %rax
addq $0x90, %rax
leaq 0x13b400(%rip), %rcx # 0x3018fb
movq %rcx, -0x160(%rbp)
addq $0x8, %rax
movq %rax, -0x7e8(%rbp)
leaq -0x294(%rbp), %rdi
movl $0xfffffffd, %esi # imm = 0xFFFFFFFD
callq 0x1cbac0
leaq -0x294(%rbp), %rax
movq %rax, -0x290(%rbp)
movq $0x1, -0x288(%rbp)
leaq -0x295(%rbp), %rdi
callq 0x1ccfb0
movq -0x290(%rbp), %rsi
movq -0x288(%rbp), %rdx
leaq -0x280(%rbp), %rdi
leaq -0x295(%rbp), %rcx
callq 0x1ccfd0
leaq -0x2b0(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1a61d0
leaq -0x2b0(%rbp), %rdi
callq 0x1cc0c0
movq -0x7e8(%rbp), %rdi
leaq -0x280(%rbp), %rsi
leaq -0x2b0(%rbp), %rdx
callq 0x1ccf40
leaq -0x1f0(%rbp), %rax
addq $0xd8, %rax
leaq 0x13b354(%rip), %rcx # 0x301905
movq %rcx, -0x118(%rbp)
addq $0x8, %rax
movq %rax, -0x7e0(%rbp)
leaq -0x2dc(%rbp), %rdi
movl $0xfffffffc, %esi # imm = 0xFFFFFFFC
callq 0x1cbac0
leaq -0x2dc(%rbp), %rax
movq %rax, -0x2d8(%rbp)
movq $0x1, -0x2d0(%rbp)
leaq -0x2dd(%rbp), %rdi
callq 0x1ccfb0
movq -0x2d8(%rbp), %rsi
movq -0x2d0(%rbp), %rdx
leaq -0x2c8(%rbp), %rdi
leaq -0x2dd(%rbp), %rcx
callq 0x1ccfd0
leaq -0x2f8(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1a61d0
leaq -0x2f8(%rbp), %rdi
callq 0x1cc0c0
movq -0x7e0(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
leaq -0x2f8(%rbp), %rdx
callq 0x1ccf40
leaq -0x1f0(%rbp), %rax
addq $0x120, %rax # imm = 0x120
leaq 0x13b2a8(%rip), %rcx # 0x30190f
movq %rcx, -0xd0(%rbp)
addq $0x8, %rax
movq %rax, -0x7d8(%rbp)
leaq -0x328(%rbp), %rdi
movl $0xffffffff, %esi # imm = 0xFFFFFFFF
callq 0x1cbac0
leaq -0x328(%rbp), %rdi
addq $0x4, %rdi
movl $0xfffffffd, %esi # imm = 0xFFFFFFFD
callq 0x1cbac0
leaq -0x328(%rbp), %rax
movq %rax, -0x320(%rbp)
movq $0x2, -0x318(%rbp)
leaq -0x329(%rbp), %rdi
callq 0x1ccfb0
movq -0x320(%rbp), %rsi
movq -0x318(%rbp), %rdx
leaq -0x310(%rbp), %rdi
leaq -0x329(%rbp), %rcx
callq 0x1ccfd0
leaq -0x348(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1a61d0
leaq -0x348(%rbp), %rdi
callq 0x1cc0c0
movq -0x7d8(%rbp), %rdi
leaq -0x310(%rbp), %rsi
leaq -0x348(%rbp), %rdx
callq 0x1ccf40
leaq -0x1f0(%rbp), %rax
addq $0x168, %rax # imm = 0x168
leaq 0x13b1eb(%rip), %rcx # 0x30191d
movq %rcx, -0x88(%rbp)
addq $0x8, %rax
movq %rax, -0x7d0(%rbp)
leaq -0x378(%rbp), %rdi
movl $0xfffffffc, %esi # imm = 0xFFFFFFFC
callq 0x1cbac0
leaq -0x378(%rbp), %rdi
addq $0x4, %rdi
movl $0xfffffffc, %esi # imm = 0xFFFFFFFC
callq 0x1cbac0
leaq -0x378(%rbp), %rax
movq %rax, -0x370(%rbp)
movq $0x2, -0x368(%rbp)
leaq -0x379(%rbp), %rdi
callq 0x1ccfb0
movq -0x370(%rbp), %rsi
movq -0x368(%rbp), %rdx
leaq -0x360(%rbp), %rdi
leaq -0x379(%rbp), %rcx
callq 0x1ccfd0
leaq -0x398(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1a61d0
leaq -0x398(%rbp), %rdi
callq 0x1cc0c0
movq -0x7d0(%rbp), %rdi
leaq -0x360(%rbp), %rsi
leaq -0x398(%rbp), %rdx
callq 0x1ccf40
leaq -0x398(%rbp), %rdi
callq 0x1cc0e0
leaq -0x360(%rbp), %rdi
callq 0x1cc0e0
leaq -0x379(%rbp), %rdi
callq 0x1cd030
leaq -0x348(%rbp), %rdi
callq 0x1cc0e0
leaq -0x310(%rbp), %rdi
callq 0x1cc0e0
leaq -0x329(%rbp), %rdi
callq 0x1cd030
leaq -0x2f8(%rbp), %rdi
callq 0x1cc0e0
leaq -0x2c8(%rbp), %rdi
callq 0x1cc0e0
leaq -0x2dd(%rbp), %rdi
callq 0x1cd030
leaq -0x2b0(%rbp), %rdi
callq 0x1cc0e0
leaq -0x280(%rbp), %rdi
callq 0x1cc0e0
leaq -0x295(%rbp), %rdi
callq 0x1cd030
leaq -0x268(%rbp), %rdi
callq 0x1cc0e0
leaq -0x238(%rbp), %rdi
callq 0x1cc0e0
leaq -0x24d(%rbp), %rdi
callq 0x1cd030
leaq -0x220(%rbp), %rdi
callq 0x1cc0e0
leaq -0x208(%rbp), %rdi
callq 0x1cc0e0
leaq -0x1f0(%rbp), %rax
movq %rax, -0x3a0(%rbp)
movq -0x3a0(%rbp), %rax
movq %rax, -0x3a8(%rbp)
movq -0x3a0(%rbp), %rax
addq $0x1b0, %rax # imm = 0x1B0
movq %rax, -0x3b0(%rbp)
movq -0x3a8(%rbp), %rax
cmpq -0x3b0(%rbp), %rax
je 0x1c6a6a
movq -0x3a8(%rbp), %rax
movq %rax, -0x3b8(%rbp)
movq -0x3b8(%rbp), %rax
movq (%rax), %rdx
leaq -0x3d8(%rbp), %rdi
leaq 0x13b00c(%rip), %rsi # 0x30192b
movb $0x0, %al
callq 0x1cd050
movq -0x3b8(%rbp), %rsi
addq $0x8, %rsi
leaq -0x430(%rbp), %rdi
callq 0x1cd240
leaq -0x4b8(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
callq 0x1a6180
leaq -0x4b8(%rbp), %rdi
addq $0x20, %rdi
movq -0x3b8(%rbp), %rsi
callq 0x1c7070
leaq -0x450(%rbp), %rdi
leaq -0x4b8(%rbp), %rsi
callq 0x1c70b0
movq -0x810(%rbp), %rsi
leaq -0x3f0(%rbp), %rdi
leaq -0x430(%rbp), %rdx
leaq -0x450(%rbp), %rcx
callq 0x1cd200
movq -0x10(%rbp), %rax
movq %rax, -0x818(%rbp)
movq -0x3b8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x820(%rbp)
leaq -0x4d9(%rbp), %rdi
callq 0x1a6650
movq -0x820(%rbp), %rsi
leaq -0x4d8(%rbp), %rdi
leaq -0x4d9(%rbp), %rdx
callq 0x1a6550
movq -0x818(%rbp), %rdi
leaq -0x4d8(%rbp), %rsi
callq 0x1cd2a0
movq %rax, %rdi
leaq -0x3f0(%rbp), %rsi
callq 0x1cd380
leaq -0x4d8(%rbp), %rdi
callq 0x1a6250
leaq -0x4d9(%rbp), %rdi
callq 0x1a6440
leaq -0x3f0(%rbp), %rdi
callq 0x1cd3f0
leaq -0x450(%rbp), %rdi
callq 0x1cd410
leaq -0x4b8(%rbp), %rdi
callq 0x1c7130
leaq -0x430(%rbp), %rdi
callq 0x1cd430
leaq -0x3d8(%rbp), %rdi
callq 0x1a6250
movq -0x3a8(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x3a8(%rbp)
jmp 0x1c68e5
leaq -0x524(%rbp), %rdi
movl $0xfffffff0, %esi # imm = 0xFFFFFFF0
callq 0x1cbac0
leaq -0x540(%rbp), %rdi
movl $0xa, %esi
movl $0x14, %edx
callq 0x1cd4c0
movl -0x524(%rbp), %esi
leaq -0x520(%rbp), %rdi
leaq -0x540(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x1cd500
movq -0x810(%rbp), %rsi
leaq -0x4f8(%rbp), %rdi
leaq -0x520(%rbp), %rdx
callq 0x1cd480
movq -0x10(%rbp), %rax
movq %rax, -0x860(%rbp)
leaq -0x561(%rbp), %rdi
callq 0x1a6650
leaq -0x560(%rbp), %rdi
leaq 0x13eb24(%rip), %rsi # 0x305626
leaq -0x561(%rbp), %rdx
callq 0x1a6550
movq -0x860(%rbp), %rdi
leaq -0x560(%rbp), %rsi
callq 0x1cd2a0
movq %rax, %rdi
leaq -0x4f8(%rbp), %rsi
callq 0x1cd580
leaq -0x560(%rbp), %rdi
callq 0x1a6250
leaq -0x561(%rbp), %rdi
callq 0x1a6440
leaq -0x4f8(%rbp), %rdi
callq 0x1cd5f0
leaq -0x520(%rbp), %rdi
callq 0x1cd610
leaq -0x5c0(%rbp), %rdi
movl $0x1, %esi
movl $0x2, %edx
callq 0x1cd4c0
leaq -0x5a8(%rbp), %rdi
leaq -0x5c0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x1cd670
movq -0x810(%rbp), %rsi
leaq -0x580(%rbp), %rdi
leaq -0x5a8(%rbp), %rdx
callq 0x1cd630
movq -0x10(%rbp), %rax
movq %rax, -0x858(%rbp)
leaq -0x5e1(%rbp), %rdi
callq 0x1a6650
leaq -0x5e0(%rbp), %rdi
leaq 0x13ce63(%rip), %rsi # 0x303a44
leaq -0x5e1(%rbp), %rdx
callq 0x1a6550
movq -0x858(%rbp), %rdi
leaq -0x5e0(%rbp), %rsi
callq 0x1cd2a0
movq %rax, %rdi
leaq -0x580(%rbp), %rsi
callq 0x1cd6e0
leaq -0x5e0(%rbp), %rdi
callq 0x1a6250
leaq -0x5e1(%rbp), %rdi
callq 0x1a6440
leaq -0x580(%rbp), %rdi
callq 0x1cd750
leaq -0x5a8(%rbp), %rdi
callq 0x1cd770
leaq -0x61c(%rbp), %rdi
movl $0xffffffff, %esi # imm = 0xFFFFFFFF
callq 0x1cbac0
movl -0x61c(%rbp), %esi
leaq -0x618(%rbp), %rdi
xorl %edx, %edx
callq 0x1cd7d0
leaq -0x638(%rbp), %rdi
movl $0x29a, %esi # imm = 0x29A
callq 0x1cd820
movq -0x810(%rbp), %rsi
leaq -0x600(%rbp), %rdi
leaq -0x618(%rbp), %rdx
leaq -0x638(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x1cd790
movq -0x10(%rbp), %rax
movq %rax, -0x850(%rbp)
leaq -0x659(%rbp), %rdi
callq 0x1a6650
leaq -0x658(%rbp), %rdi
leaq 0x13ac63(%rip), %rsi # 0x301937
leaq -0x659(%rbp), %rdx
callq 0x1a6550
movq -0x850(%rbp), %rdi
leaq -0x658(%rbp), %rsi
callq 0x1cd2a0
movq %rax, %rdi
leaq -0x600(%rbp), %rsi
callq 0x1cd870
leaq -0x658(%rbp), %rdi
callq 0x1a6250
leaq -0x659(%rbp), %rdi
callq 0x1a6440
leaq -0x600(%rbp), %rdi
callq 0x1cd8e0
leaq -0x618(%rbp), %rdi
callq 0x1cd900
leaq -0x694(%rbp), %rdi
movl $0xfffffffe, %esi # imm = 0xFFFFFFFE
callq 0x1cbac0
movl -0x694(%rbp), %esi
leaq -0x690(%rbp), %rdi
xorl %edx, %edx
callq 0x1cd7d0
leaq -0x6b0(%rbp), %rdi
movl $0x29a, %esi # imm = 0x29A
callq 0x1cd920
movq -0x810(%rbp), %rsi
leaq -0x678(%rbp), %rdi
leaq -0x690(%rbp), %rdx
leaq -0x6b0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x1cd790
movq -0x10(%rbp), %rax
movq %rax, -0x848(%rbp)
leaq -0x6d1(%rbp), %rdi
callq 0x1a6650
leaq -0x6d0(%rbp), %rdi
leaq 0x13ab7b(%rip), %rsi # 0x301942
leaq -0x6d1(%rbp), %rdx
callq 0x1a6550
movq -0x848(%rbp), %rdi
leaq -0x6d0(%rbp), %rsi
callq 0x1cd2a0
movq %rax, %rdi
leaq -0x678(%rbp), %rsi
callq 0x1cd870
leaq -0x6d0(%rbp), %rdi
callq 0x1a6250
leaq -0x6d1(%rbp), %rdi
callq 0x1a6440
leaq -0x678(%rbp), %rdi
callq 0x1cd8e0
leaq -0x690(%rbp), %rdi
callq 0x1cd900
leaq -0x70c(%rbp), %rdi
movl $0xfffffffd, %esi # imm = 0xFFFFFFFD
callq 0x1cbac0
movl -0x70c(%rbp), %esi
leaq -0x708(%rbp), %rdi
xorl %edx, %edx
callq 0x1cd7d0
leaq -0x728(%rbp), %rdi
movss 0x13a587(%rip), %xmm0 # 0x3013e0
callq 0x1cd970
movq -0x810(%rbp), %rsi
leaq -0x6f0(%rbp), %rdi
leaq -0x708(%rbp), %rdx
leaq -0x728(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x1cd790
movq -0x10(%rbp), %rax
movq %rax, -0x840(%rbp)
leaq -0x749(%rbp), %rdi
callq 0x1a6650
leaq -0x748(%rbp), %rdi
leaq 0x13aa90(%rip), %rsi # 0x30194d
leaq -0x749(%rbp), %rdx
callq 0x1a6550
movq -0x840(%rbp), %rdi
leaq -0x748(%rbp), %rsi
callq 0x1cd2a0
movq %rax, %rdi
leaq -0x6f0(%rbp), %rsi
callq 0x1cd870
leaq -0x748(%rbp), %rdi
callq 0x1a6250
leaq -0x749(%rbp), %rdi
callq 0x1a6440
leaq -0x6f0(%rbp), %rdi
callq 0x1cd8e0
leaq -0x708(%rbp), %rdi
callq 0x1cd900
leaq -0x784(%rbp), %rdi
movl $0xfffffffc, %esi # imm = 0xFFFFFFFC
callq 0x1cbac0
movl -0x784(%rbp), %esi
leaq -0x780(%rbp), %rdi
xorl %edx, %edx
callq 0x1cd7d0
leaq -0x7a0(%rbp), %rdi
movsd 0x13a489(%rip), %xmm0 # 0x3013d8
callq 0x1cd9c0
movq -0x810(%rbp), %rsi
leaq -0x768(%rbp), %rdi
leaq -0x780(%rbp), %rdx
leaq -0x7a0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x1cd790
movq -0x10(%rbp), %rax
movq %rax, -0x838(%rbp)
leaq -0x7c1(%rbp), %rdi
callq 0x1a6650
leaq -0x7c0(%rbp), %rdi
leaq 0x13a9a5(%rip), %rsi # 0x301958
leaq -0x7c1(%rbp), %rdx
callq 0x1a6550
movq -0x838(%rbp), %rdi
leaq -0x7c0(%rbp), %rsi
callq 0x1cd2a0
movq %rax, %rdi
leaq -0x768(%rbp), %rsi
callq 0x1cd870
leaq -0x7c0(%rbp), %rdi
callq 0x1a6250
leaq -0x7c1(%rbp), %rdi
callq 0x1a6440
leaq -0x768(%rbp), %rdi
callq 0x1cd8e0
leaq -0x780(%rbp), %rdi
callq 0x1cd900
leaq -0x1f0(%rbp), %rax
movq %rax, -0x830(%rbp)
addq $0x1b0, %rax # imm = 0x1B0
movq %rax, -0x828(%rbp)
movq -0x828(%rbp), %rdi
addq $-0x48, %rdi
movq %rdi, -0x868(%rbp)
callq 0x1c7160
movq -0x830(%rbp), %rcx
movq -0x868(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x828(%rbp)
jne 0x1c702c
addq $0x880, %rsp # imm = 0x880
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::CommandRunner::OnRegisterCommand(spectest::RegisterCommand const*) | wabt::Result CommandRunner::OnRegisterCommand(const RegisterCommand* command) {
if (!command->name.empty()) {
auto instance_iter = instances_.find(command->name);
if (instance_iter == instances_.end()) {
PrintError(command->line, "unknown module in register");
return wabt::Result::Error;
}
registry_[command->as] = instance_iter->second;
} else {
registry_[command->as] = last_instance_;
}
return wabt::Result::Ok;
} | pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
callq 0x1a6610
testb $0x1, %al
jne 0x1c7910
movq -0x30(%rbp), %rdi
addq $0x118, %rdi # imm = 0x118
movq -0x18(%rbp), %rsi
addq $0x30, %rsi
callq 0x1cec90
movq -0x30(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0x118, %rdi # imm = 0x118
callq 0x1cecf0
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x1cf4b0
testb $0x1, %al
jne 0x1c78b0
jmp 0x1c78d9
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %esi
leaq 0x13a1b2(%rip), %rdx # 0x301a74
movb $0x0, %al
callq 0x1c8470
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c794c
leaq -0x20(%rbp), %rdi
callq 0x1ced20
movq -0x30(%rbp), %rdi
addq $0x20, %rax
movq %rax, -0x38(%rbp)
addq $0xe8, %rdi
movq -0x18(%rbp), %rsi
addq $0x10, %rsi
callq 0x1cde50
movq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0x1cf3f0
jmp 0x1c7941
movq -0x30(%rbp), %rdi
movq %rdi, %rax
addq $0x148, %rax # imm = 0x148
movq %rax, -0x40(%rbp)
addq $0xe8, %rdi
movq -0x18(%rbp), %rsi
addq $0x10, %rsi
callq 0x1cde50
movq -0x40(%rbp), %rsi
movq %rax, %rdi
callq 0x1cf3f0
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
callq 0x1cba40
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::CommandRunner::OnAssertMalformedCommand(spectest::AssertModuleCommand<(wabt::CommandType)3> const*) | wabt::Result CommandRunner::OnAssertMalformedCommand(
const AssertMalformedCommand* command) {
wabt::Result result = ReadInvalidModule(command->line, command->filename,
command->type, "assert_malformed");
if (Succeeded(result)) {
PrintError(command->line, "expected module to be malformed: \"%s\"",
command->filename.c_str());
return wabt::Result::Error;
}
return wabt::Result::Ok;
} | pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x18(%rbp), %rsi
addq $0x18, %rsi
leaq -0x30(%rbp), %rdi
callq 0x1cbf50
movq -0x40(%rbp), %rdi
movl -0x38(%rbp), %esi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %r8d
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq 0x13a08c(%rip), %r9 # 0x301a3d
callq 0x1c8c70
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %edi
callq 0x1ce5c0
testb $0x1, %al
jne 0x1c79cd
jmp 0x1c7a0c
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
callq 0x1a6170
movq -0x40(%rbp), %rdi
movl -0x44(%rbp), %esi
movq %rax, %rcx
leaq 0x13a059(%rip), %rdx # 0x301a4e
movb $0x0, %al
callq 0x1c8470
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c7a17
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
callq 0x1cba40
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::CommandRunner::OnAssertInvalidCommand(spectest::AssertModuleCommand<(wabt::CommandType)4> const*) | wabt::Result CommandRunner::OnAssertInvalidCommand(
const AssertInvalidCommand* command) {
wabt::Result result = ReadInvalidModule(command->line, command->filename,
command->type, "assert_invalid");
if (Succeeded(result)) {
PrintError(command->line, "expected module to be invalid: \"%s\"",
command->filename.c_str());
return wabt::Result::Error;
}
return wabt::Result::Ok;
} | pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x18(%rbp), %rsi
addq $0x18, %rsi
leaq -0x30(%rbp), %rdi
callq 0x1cbf50
movq -0x40(%rbp), %rdi
movl -0x38(%rbp), %esi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %r8d
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq 0x13a095(%rip), %r9 # 0x301b06
callq 0x1c8c70
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %edi
callq 0x1ce5c0
testb $0x1, %al
jne 0x1c7a8d
jmp 0x1c7acc
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
callq 0x1a6170
movq -0x40(%rbp), %rdi
movl -0x44(%rbp), %esi
movq %rax, %rcx
leaq 0x13a060(%rip), %rdx # 0x301b15
movb $0x0, %al
callq 0x1c8470
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
jmp 0x1c7ad7
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
callq 0x1cba40
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::CommandRunner::OnAssertUnlinkableCommand(spectest::AssertModuleCommand<(wabt::CommandType)5> const*) | wabt::Result CommandRunner::OnAssertUnlinkableCommand(
const AssertUnlinkableCommand* command) {
Errors errors;
auto module = ReadModule(command->filename, &errors);
if (!module) {
PrintError(command->line, "unable to compile unlinkable module: \"%s\"",
command->filename.c_str());
return wabt::Result::Error;
}
RefVec imports;
PopulateImports(module, &imports);
Trap::Ptr trap;
auto instance = Instance::Instantiate(store_, module.ref(), imports, &trap);
if (!trap) {
PrintError(command->line, "expected module to be unlinkable: \"%s\"",
command->filename.c_str());
return wabt::Result::Error;
}
// TODO: Change to one-line error.
PrintError(command->line, "assert_unlinkable passed:\n error: %s",
trap->message().c_str());
return wabt::Result::Ok;
} | pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x1ce5a0
movq -0x18(%rbp), %rsi
addq $0x18, %rsi
leaq -0x58(%rbp), %rdi
callq 0x1cbf50
movq -0xd8(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x50(%rbp), %rcx
leaq -0x48(%rbp), %rdi
leaq -0x30(%rbp), %r8
callq 0x1c8a90
leaq -0x48(%rbp), %rdi
callq 0x1cec50
testb $0x1, %al
jne 0x1c7b93
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0xdc(%rbp)
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
callq 0x1a6170
movq -0xd8(%rbp), %rdi
movl -0xdc(%rbp), %esi
movq %rax, %rcx
leaq 0x139f1d(%rip), %rdx # 0x301a8f
movb $0x0, %al
callq 0x1c8470
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x5c(%rbp)
jmp 0x1c7ce1
leaq -0x78(%rbp), %rdi
callq 0x1cf2e0
movq -0xd8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x1c8ee0
leaq -0x90(%rbp), %rdi
callq 0x1ce0c0
leaq -0x48(%rbp), %rdi
callq 0x1cf300
movq -0xd8(%rbp), %rsi
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
leaq -0x78(%rbp), %rcx
leaq -0x90(%rbp), %r8
callq 0x26eb10
leaq -0x90(%rbp), %rdi
callq 0x1cf360
testb $0x1, %al
jne 0x1c7c50
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0xe0(%rbp)
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
callq 0x1a6170
movq -0xd8(%rbp), %rdi
movl -0xe0(%rbp), %esi
movq %rax, %rcx
leaq 0x139e87(%rip), %rdx # 0x301ab9
movb $0x0, %al
callq 0x1c8470
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x5c(%rbp)
jmp 0x1c7cc0
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0xe4(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x1cf3a0
movq %rax, %rsi
leaq -0xd0(%rbp), %rdi
callq 0x1cf3c0
leaq -0xd0(%rbp), %rdi
callq 0x1a6170
movq -0xd8(%rbp), %rdi
movl -0xe4(%rbp), %esi
movq %rax, %rcx
leaq 0x139e45(%rip), %rdx # 0x301ae0
movb $0x0, %al
callq 0x1c8470
leaq -0xd0(%rbp), %rdi
callq 0x1a6250
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
callq 0x1cba40
movl $0x1, -0x5c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x1cf420
leaq -0x90(%rbp), %rdi
callq 0x1cf440
leaq -0x78(%rbp), %rdi
callq 0x1cf460
leaq -0x48(%rbp), %rdi
callq 0x1cec70
leaq -0x30(%rbp), %rdi
callq 0x1ce7a0
movl -0x4(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
nop
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::CommandRunner::OnAssertUninstantiableCommand(spectest::AssertModuleCommand<(wabt::CommandType)6> const*) | wabt::Result CommandRunner::OnAssertUninstantiableCommand(
const AssertUninstantiableCommand* command) {
Errors errors;
auto module = ReadModule(command->filename, &errors);
if (!module) {
PrintError(command->line, "unable to compile uninstantiable module: \"%s\"",
command->filename.c_str());
return wabt::Result::Error;
}
RefVec imports;
PopulateImports(module, &imports);
Trap::Ptr trap;
auto instance = Instance::Instantiate(store_, module.ref(), imports, &trap);
if (!trap) {
PrintError(command->line, "expected module to be uninstantiable: \"%s\"",
command->filename.c_str());
return wabt::Result::Error;
}
// TODO: print error when assertion passes.
#if 0
PrintError(command->line, "assert_uninstantiable passed: %s",
trap->message().c_str());
#endif
return wabt::Result::Ok;
} | pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x1ce5a0
movq -0x18(%rbp), %rsi
addq $0x18, %rsi
leaq -0x58(%rbp), %rdi
callq 0x1cbf50
movq -0xb8(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x50(%rbp), %rcx
leaq -0x48(%rbp), %rdi
leaq -0x30(%rbp), %r8
callq 0x1c8a90
leaq -0x48(%rbp), %rdi
callq 0x1cec50
testb $0x1, %al
jne 0x1c7db3
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0xbc(%rbp)
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
callq 0x1a6170
movq -0xb8(%rbp), %rdi
movl -0xbc(%rbp), %esi
movq %rax, %rcx
leaq 0x139da7(%rip), %rdx # 0x301b39
movb $0x0, %al
callq 0x1c8470
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x5c(%rbp)
jmp 0x1c7ea3
leaq -0x78(%rbp), %rdi
callq 0x1cf2e0
movq -0xb8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x1c8ee0
leaq -0x90(%rbp), %rdi
callq 0x1ce0c0
leaq -0x48(%rbp), %rdi
callq 0x1cf300
movq -0xb8(%rbp), %rsi
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
leaq -0x78(%rbp), %rcx
leaq -0x90(%rbp), %r8
callq 0x26eb10
leaq -0x90(%rbp), %rdi
callq 0x1cf360
testb $0x1, %al
jne 0x1c7e70
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0xc0(%rbp)
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
callq 0x1a6170
movq -0xb8(%rbp), %rdi
movl -0xc0(%rbp), %esi
movq %rax, %rcx
leaq 0x139d15(%rip), %rdx # 0x301b67
movb $0x0, %al
callq 0x1c8470
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x5c(%rbp)
jmp 0x1c7e82
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
callq 0x1cba40
movl $0x1, -0x5c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x1cf420
leaq -0x90(%rbp), %rdi
callq 0x1cf440
leaq -0x78(%rbp), %rdi
callq 0x1cf460
leaq -0x48(%rbp), %rdi
callq 0x1cec70
leaq -0x30(%rbp), %rdi
callq 0x1ce7a0
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::CommandRunner::OnAssertReturnCommand(spectest::AssertReturnCommand const*) | wabt::Result CommandRunner::OnAssertReturnCommand(
const AssertReturnCommand* command) {
ActionResult action_result =
RunAction(command->line, &command->action, RunVerbosity::Quiet);
if (action_result.trap) {
PrintError(command->line, "unexpected trap: %s",
action_result.trap->message().c_str());
return wabt::Result::Error;
}
if (action_result.values.size() != command->expected.size()) {
PrintError(command->line,
"result length mismatch in assert_return: expected %" PRIzd
", got %" PRIzd,
command->expected.size(), action_result.values.size());
return wabt::Result::Error;
}
wabt::Result result = wabt::Result::Ok;
for (size_t i = 0; i < action_result.values.size(); ++i) {
const ExpectedValue& expected = command->expected[i];
TypedValue actual{action_result.types[i], action_result.values[i]};
result |= CheckAssertReturnResult(command, i, expected, actual, true);
}
return result;
} | pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp # imm = 0x1B0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0x120(%rbp)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edx
movq -0x18(%rbp), %rcx
addq $0x10, %rcx
leaq -0x60(%rbp), %rdi
xorl %r8d, %r8d
callq 0x1c85e0
leaq -0x60(%rbp), %rdi
addq $0x30, %rdi
callq 0x1cf360
testb $0x1, %al
jne 0x1c7f1c
jmp 0x1c7f8f
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x124(%rbp)
leaq -0x60(%rbp), %rdi
addq $0x30, %rdi
callq 0x1cf3a0
movq %rax, %rsi
leaq -0x80(%rbp), %rdi
callq 0x1cf3c0
leaq -0x80(%rbp), %rdi
callq 0x1a6170
movq -0x120(%rbp), %rdi
movl -0x124(%rbp), %esi
movq %rax, %rcx
leaq 0x139ac7(%rip), %rdx # 0x301a29
movb $0x0, %al
callq 0x1c8470
leaq -0x80(%rbp), %rdi
callq 0x1a6250
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x84(%rbp)
jmp 0x1c81e1
leaq -0x60(%rbp), %rdi
addq $0x18, %rdi
callq 0x1cf6b0
movq %rax, -0x130(%rbp)
movq -0x18(%rbp), %rdi
addq $0x88, %rdi
callq 0x1cf6e0
movq %rax, %rcx
movq -0x130(%rbp), %rax
cmpq %rcx, %rax
je 0x1c8035
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x13c(%rbp)
movq -0x18(%rbp), %rdi
addq $0x88, %rdi
callq 0x1cf6e0
movq %rax, -0x138(%rbp)
leaq -0x60(%rbp), %rdi
addq $0x18, %rdi
callq 0x1cf6b0
movq -0x120(%rbp), %rdi
movl -0x13c(%rbp), %esi
movq -0x138(%rbp), %rcx
movq %rax, %r8
leaq 0x139ccc(%rip), %rdx # 0x301cdd
movb $0x0, %al
callq 0x1c8470
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x84(%rbp)
jmp 0x1c81e1
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
callq 0x1cba40
movq $0x0, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x148(%rbp)
leaq -0x60(%rbp), %rdi
addq $0x18, %rdi
callq 0x1cf6b0
movq %rax, %rcx
movq -0x148(%rbp), %rax
cmpq %rcx, %rax
jae 0x1c81d7
movq -0x18(%rbp), %rdi
addq $0x88, %rdi
movq -0x90(%rbp), %rsi
callq 0x1cf710
movq %rax, -0x98(%rbp)
leaq -0x60(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x1cf730
movl (%rax), %eax
movl %eax, -0xb8(%rbp)
leaq -0x60(%rbp), %rdi
addq $0x18, %rdi
movq -0x90(%rbp), %rsi
callq 0x1cf750
movq (%rax), %rcx
movq %rcx, -0xb0(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xa8(%rbp)
movl 0x10(%rax), %eax
movl %eax, -0xa0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x90(%rbp), %rax
movl %eax, -0x14c(%rbp)
movq -0x98(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
movl $0x38, %edx
callq 0x1a6330
movq -0x120(%rbp), %rdi
movq -0x158(%rbp), %rsi
movl -0x14c(%rbp), %edx
movq -0xb8(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x100(%rbp)
movups -0x118(%rbp), %xmm0
movups -0x108(%rbp), %xmm1
movq %rsp, %rax
movups %xmm1, 0x48(%rax)
movups %xmm0, 0x38(%rax)
movq -0xc8(%rbp), %rcx
movq %rcx, 0x30(%rax)
movups -0xf8(%rbp), %xmm0
movups -0xe8(%rbp), %xmm1
movups -0xd8(%rbp), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movl $0x1, %ecx
callq 0x1c9100
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x1cf770
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x1c804b
movl $0x1, -0x84(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x1ce500
movl -0x4(%rbp), %eax
addq $0x1b0, %rsp # imm = 0x1B0
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::CommandRunner::RunAction(int, spectest::Action const*, RunVerbosity) | ActionResult CommandRunner::RunAction(int line_number,
const Action* action,
RunVerbosity verbose) {
ExportMap& module = !action->module_name.empty()
? instances_[action->module_name]
: last_instance_;
Extern::Ptr extern_ = module[action->field_name];
if (!extern_) {
PrintError(line_number, "unknown invoke \"%s.%s\"",
action->module_name.c_str(), action->field_name.c_str());
return {};
}
ActionResult result;
switch (action->type) {
case ActionType::Invoke: {
auto* func = cast<interp::Func>(extern_.get());
func->Call(store_, action->args, result.values, &result.trap,
s_trace_stream);
result.types = func->type().results;
if (verbose == RunVerbosity::Verbose) {
WriteCall(s_stdout_stream.get(), action->field_name, func->type(),
action->args, result.values, result.trap);
}
break;
}
case ActionType::Get: {
auto* global = cast<interp::Global>(extern_.get());
result.values.push_back(global->Get());
result.types.push_back(global->type().type);
break;
}
default:
WABT_UNREACHABLE;
}
return result;
} | pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0xa8(%rbp)
movq %rdi, %rax
movq %rax, -0xa0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x1a6610
testb $0x1, %al
jne 0x1c864f
movq -0x98(%rbp), %rdi
addq $0x118, %rdi # imm = 0x118
movq -0x20(%rbp), %rsi
addq $0x8, %rsi
callq 0x1cde50
movq %rax, -0xb0(%rbp)
jmp 0x1c8663
movq -0x98(%rbp), %rax
addq $0x148, %rax # imm = 0x148
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x28, %rsi
callq 0x1cdf30
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x1ce010
leaq -0x48(%rbp), %rdi
callq 0x1ce080
testb $0x1, %al
jne 0x1c8750
movl -0x14(%rbp), %eax
movl %eax, -0xc4(%rbp)
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
callq 0x1a6170
movq %rax, -0xc0(%rbp)
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
callq 0x1a6170
movq -0x98(%rbp), %rdi
movl -0xc4(%rbp), %esi
movq -0xc0(%rbp), %rcx
movq %rax, %r8
leaq 0x13928a(%rip), %rdx # 0x30196e
movb $0x0, %al
callq 0x1c8470
movq -0xa8(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1a61d0
movq -0xa8(%rbp), %rdi
callq 0x1cc0c0
movq -0xa8(%rbp), %rdi
addq $0x18, %rdi
movq %rdi, -0xb8(%rbp)
xorl %esi, %esi
movl $0x18, %edx
callq 0x1a61d0
movq -0xb8(%rbp), %rdi
callq 0x1ce0a0
movq -0xa8(%rbp), %rdi
addq $0x30, %rdi
callq 0x1ce0c0
movl $0x1, -0x4c(%rbp)
jmp 0x1c88e4
movq -0xa8(%rbp), %rdi
movb $0x0, -0x4d(%rbp)
callq 0x1ce0f0
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xc8(%rbp)
testl %eax, %eax
je 0x1c8786
jmp 0x1c8772
movl -0xc8(%rbp), %eax
subl $0x1, %eax
je 0x1c8855
jmp 0x1c88c0
leaq -0x48(%rbp), %rdi
callq 0x1ce180
movq %rax, %rdi
callq 0x1ce130
movq -0x98(%rbp), %rsi
movq -0xa8(%rbp), %r8
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movq -0x20(%rbp), %rdx
addq $0x60, %rdx
movq %r8, %rcx
addq $0x18, %rcx
addq $0x30, %r8
movq 0x22c661(%rip), %r9 # 0x3f4e28
callq 0x26cc40
movl %eax, -0x5c(%rbp)
movq -0x58(%rbp), %rdi
callq 0x1ce1a0
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
addq $0x28, %rsi
callq 0x1ce1c0
cmpl $0x1, -0x24(%rbp)
jne 0x1c8853
leaq 0x22c628(%rip), %rdi # 0x3f4e20
callq 0x1ce410
movq %rax, -0xd0(%rbp)
movq -0x20(%rbp), %rsi
addq $0x28, %rsi
leaq -0x70(%rbp), %rdi
callq 0x1cbf50
movq -0x58(%rbp), %rdi
callq 0x1ce1a0
movq -0xd0(%rbp), %rdi
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movq -0x20(%rbp), %r8
addq $0x60, %r8
movq %rax, %r9
addq $0x18, %r9
addq $0x30, %rax
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %rax, (%rsp)
callq 0x29ccf0
jmp 0x1c88c5
leaq -0x48(%rbp), %rdi
callq 0x1ce180
movq %rax, %rdi
callq 0x1ce430
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movq %rcx, -0x78(%rbp)
addq $0x18, %rax
movq %rax, -0xd8(%rbp)
movq -0x78(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x1ce4b0
movq -0xd8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x1ce480
movq -0x78(%rbp), %rdi
callq 0x1ce4e0
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
addq $0xc, %rsi
callq 0x1cbb00
jmp 0x1c88c5
callq 0x1a61e0
movb $0x1, -0x4d(%rbp)
movl $0x1, -0x4c(%rbp)
testb $0x1, -0x4d(%rbp)
jne 0x1c88e2
movq -0xa8(%rbp), %rdi
callq 0x1ce500
jmp 0x1c88e4
leaq -0x48(%rbp), %rdi
callq 0x1ce540
movq -0xa0(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::CommandRunner::ReadInvalidTextModule(wabt::string_view, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) | wabt::Result CommandRunner::ReadInvalidTextModule(string_view module_filename,
const std::string& header) {
std::vector<uint8_t> file_data;
wabt::Result result = ReadFile(module_filename, &file_data);
std::unique_ptr<WastLexer> lexer = WastLexer::CreateBufferLexer(
module_filename, file_data.data(), file_data.size());
Errors errors;
if (Succeeded(result)) {
std::unique_ptr<wabt::Module> module;
WastParseOptions options(s_features);
result = ParseWatModule(lexer.get(), &module, &errors, &options);
}
auto line_finder = lexer->MakeLineFinder();
FormatErrorsToFile(errors, Location::Type::Text, line_finder.get(), stdout,
header, PrintHeader::Once);
return result;
} | pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rsi, -0x18(%rbp)
movq %rdx, -0x10(%rbp)
movq %rdi, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x1ce560
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x1ee210
movl %eax, -0x4(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x1ce580
movq %rax, -0xb8(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x1cba00
movq -0xb8(%rbp), %rcx
movq %rax, %r8
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq -0x58(%rbp), %rdi
callq 0x201210
leaq -0x80(%rbp), %rdi
callq 0x1ce5a0
movl -0x4(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %edi
callq 0x1ce5c0
testb $0x1, %al
jne 0x1c89af
jmp 0x1c8a0c
leaq -0x90(%rbp), %rdi
callq 0x1ce5f0
leaq -0x9e(%rbp), %rdi
leaq 0x1eb9c7(%rip), %rsi # 0x3b4390
callq 0x1ce620
leaq -0x58(%rbp), %rdi
callq 0x1ce650
movq %rax, %rdi
leaq -0x90(%rbp), %rsi
leaq -0x80(%rbp), %rdx
leaq -0x9e(%rbp), %rcx
callq 0x229a60
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x1ce670
leaq -0x58(%rbp), %rdi
callq 0x1ce6c0
movq %rax, %rsi
leaq -0xb0(%rbp), %rdi
callq 0x1ce6e0
leaq -0xb0(%rbp), %rdi
callq 0x1ce730
movq %rax, %rdx
movq 0x1eb586(%rip), %rax # 0x3b3fc0
movq (%rax), %rcx
movq -0x28(%rbp), %r8
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %r9d
movl $0x50, (%rsp)
callq 0x1ef3c0
leaq -0xb0(%rbp), %rdi
callq 0x1ce750
leaq -0x80(%rbp), %rdi
callq 0x1ce7a0
leaq -0x58(%rbp), %rdi
callq 0x1ce7f0
leaq -0x40(%rbp), %rdi
callq 0x1ce840
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::CommandRunner::ReadModule(wabt::string_view, std::vector<wabt::Error, std::allocator<wabt::Error>>*) | interp::Module::Ptr CommandRunner::ReadModule(string_view module_filename,
Errors* errors) {
std::vector<uint8_t> file_data;
if (Failed(ReadFile(module_filename, &file_data))) {
return {};
}
const bool kReadDebugNames = true;
const bool kStopOnFirstError = true;
const bool kFailOnCustomSectionError = true;
ReadBinaryOptions options(s_features, s_log_stream.get(), kReadDebugNames,
kStopOnFirstError, kFailOnCustomSectionError);
ModuleDesc module_desc;
if (Failed(ReadBinaryInterp(file_data.data(), file_data.size(), options,
errors, &module_desc))) {
return {};
}
if (s_verbose) {
module_desc.istream.Disassemble(s_stdout_stream.get());
}
return interp::Module::New(store_, module_desc);
} | pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp # imm = 0x2F0
movq %rdi, -0x2e0(%rbp)
movq %rdi, %rax
movq %rax, -0x2d8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x10(%rbp)
movq %rsi, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x2d0(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x1ce560
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x1ee210
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c8b06
jmp 0x1c8b1e
movq -0x2e0(%rbp), %rdi
callq 0x1ce890
movl $0x1, -0x5c(%rbp)
jmp 0x1c8c48
movb $0x1, -0x5d(%rbp)
movb $0x1, -0x5e(%rbp)
movb $0x1, -0x5f(%rbp)
leaq 0x22c2e7(%rip), %rdi # 0x3f4e18
callq 0x1ce410
movq %rax, %rdx
leaq -0x80(%rbp), %rdi
leaq 0x1eb84c(%rip), %rsi # 0x3b4390
movl $0x1, %r9d
movl %r9d, %ecx
movl %r9d, %r8d
callq 0x1ce8c0
leaq -0x1a0(%rbp), %rdi
callq 0x1ce950
leaq -0x40(%rbp), %rdi
callq 0x1ce580
movq %rax, -0x2e8(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x1cba00
movq -0x2e8(%rbp), %rdi
movq %rax, %rsi
movq -0x28(%rbp), %rcx
leaq -0x80(%rbp), %rdx
leaq -0x1a0(%rbp), %r8
callq 0x2545f0
movl %eax, -0x1a4(%rbp)
movl -0x1a4(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c8baf
jmp 0x1c8bc4
movq -0x2e0(%rbp), %rdi
callq 0x1ce890
movl $0x1, -0x5c(%rbp)
jmp 0x1c8c3c
cmpl $0x0, 0x22c265(%rip) # 0x3f4e30
je 0x1c8bfc
leaq -0x1a0(%rbp), %rax
addq $0x108, %rax # imm = 0x108
movq %rax, -0x2f0(%rbp)
leaq 0x22c238(%rip), %rdi # 0x3f4e20
callq 0x1ce410
movq -0x2f0(%rbp), %rdi
movq %rax, %rsi
callq 0x29d630
leaq -0x2c8(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x1cea50
movq -0x2e0(%rbp), %rdi
movq -0x2d0(%rbp), %rsi
leaq -0x2c8(%rbp), %rdx
callq 0x1cea10
leaq -0x2c8(%rbp), %rdi
callq 0x1ceb90
movl $0x1, -0x5c(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x1ceb90
leaq -0x40(%rbp), %rdi
callq 0x1ce840
movq -0x2d8(%rbp), %rax
addq $0x2f0, %rsp # imm = 0x2F0
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::CommandRunner::ReadInvalidModule(int, wabt::string_view, spectest::ModuleType, char const*) | wabt::Result CommandRunner::ReadInvalidModule(int line_number,
string_view module_filename,
ModuleType module_type,
const char* desc) {
std::string header = StringPrintf(
"%s:%d: %s passed", source_filename_.c_str(), line_number, desc);
switch (module_type) {
case ModuleType::Text: {
return ReadInvalidTextModule(module_filename, header);
}
case ModuleType::Binary: {
Errors errors;
auto module = ReadModule(module_filename, &errors);
if (!module) {
FormatErrorsToFile(errors, Location::Type::Binary, {}, stdout, header,
PrintHeader::Once);
return wabt::Result::Error;
} else {
return wabt::Result::Ok;
}
}
}
WABT_UNREACHABLE;
} | pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdx, -0x18(%rbp)
movq %rcx, -0x10(%rbp)
movq %rdi, -0x20(%rbp)
movl %esi, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
addq $0x180, %rdi # imm = 0x180
callq 0x1a6170
movq %rax, %rdx
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
leaq 0x138ccb(%rip), %rsi # 0x301985
xorl %eax, %eax
leaq -0x50(%rbp), %rdi
callq 0x1cd050
movl -0x28(%rbp), %eax
movl %eax, -0xac(%rbp)
testl %eax, %eax
je 0x1c8ce4
jmp 0x1c8cd4
movl -0xac(%rbp), %eax
subl $0x1, %eax
je 0x1c8d1b
jmp 0x1c8dda
movq -0xb8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
leaq -0x50(%rbp), %rcx
callq 0x1c8900
movl %eax, -0x4(%rbp)
movl $0x1, -0x64(%rbp)
jmp 0x1c8ddf
leaq -0x80(%rbp), %rdi
callq 0x1ce5a0
movq -0xb8(%rbp), %rsi
movq -0x18(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa8(%rbp), %rdx
movq -0xa0(%rbp), %rcx
leaq -0x98(%rbp), %rdi
leaq -0x80(%rbp), %r8
callq 0x1c8a90
leaq -0x98(%rbp), %rdi
callq 0x1cec50
testb $0x1, %al
jne 0x1c8db1
movq 0x1eb24a(%rip), %rax # 0x3b3fc0
movq (%rax), %rcx
leaq -0x80(%rbp), %rdi
movl $0x1, %r9d
xorl %eax, %eax
movl %eax, %edx
leaq -0x50(%rbp), %r8
movl %r9d, %esi
movl $0x50, (%rsp)
callq 0x1ef3c0
leaq -0x4(%rbp), %rdi
movl $0x1, %esi
callq 0x1cba40
movl $0x1, -0x64(%rbp)
jmp 0x1c8dc3
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
callq 0x1cba40
movl $0x1, -0x64(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x1cec70
leaq -0x80(%rbp), %rdi
callq 0x1ce7a0
jmp 0x1c8ddf
callq 0x1a61e0
leaq -0x50(%rbp), %rdi
callq 0x1a6250
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::CommandRunner::GetImport(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) | Extern::Ptr CommandRunner::GetImport(const std::string& module,
const std::string& name) {
auto mod_iter = registry_.find(module);
if (mod_iter != registry_.end()) {
auto extern_iter = mod_iter->second.find(name);
if (extern_iter != mod_iter->second.end()) {
return extern_iter->second;
}
}
return {};
} | pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x58(%rbp)
movq %rdi, %rax
movq %rax, -0x50(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x48(%rbp)
addq $0xe8, %rdi
movq -0x18(%rbp), %rsi
callq 0x1cec90
movq -0x48(%rbp), %rdi
movq %rax, -0x28(%rbp)
addq $0xe8, %rdi
callq 0x1cecf0
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1cecc0
testb $0x1, %al
jne 0x1c8e66
jmp 0x1c8ecc
leaq -0x28(%rbp), %rdi
callq 0x1ced20
movq %rax, %rdi
addq $0x20, %rdi
movq -0x20(%rbp), %rsi
callq 0x1ced40
movq %rax, -0x38(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x1ced20
movq %rax, %rdi
addq $0x20, %rdi
callq 0x1ceda0
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1ced70
testb $0x1, %al
jne 0x1c8eaf
jmp 0x1c8eca
leaq -0x38(%rbp), %rdi
callq 0x1cedd0
movq -0x58(%rbp), %rdi
movq %rax, %rsi
addq $0x20, %rsi
callq 0x1ce010
jmp 0x1c8ed5
jmp 0x1c8ecc
movq -0x58(%rbp), %rdi
callq 0x1cedf0
movq -0x50(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nop
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::CommandRunner::PopulateExports(wabt::interp::RefPtr<wabt::interp::Instance> const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, wabt::interp::RefPtr<wabt::interp::Extern>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, wabt::interp::RefPtr<wabt::interp::Extern>>>>*) | void CommandRunner::PopulateExports(const Instance::Ptr& instance,
ExportMap* map) {
map->clear();
interp::Module::Ptr module{store_, instance->module()};
for (size_t i = 0; i < module->export_types().size(); ++i) {
const ExportType& export_type = module->export_types()[i];
(*map)[export_type.name] = store_.UnsafeGet<Extern>(instance->exports()[i]);
}
} | pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1cf010
movq -0x10(%rbp), %rdi
callq 0x1cf030
movq %rax, %rdi
callq 0x1cf050
movq -0x70(%rbp), %rsi
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x1cf070
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x1cee20
movq %rax, %rdi
callq 0x1cf190
movq %rax, %rdi
callq 0x1cf1b0
movq %rax, %rcx
movq -0x78(%rbp), %rax
cmpq %rcx, %rax
jae 0x1c90e0
leaq -0x30(%rbp), %rdi
callq 0x1cee20
movq %rax, %rdi
callq 0x1cf190
movq %rax, %rdi
movq -0x40(%rbp), %rsi
callq 0x1cf1e0
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1cf030
movq %rax, %rdi
callq 0x1cf240
movq %rax, %rdi
movq -0x40(%rbp), %rsi
callq 0x1cf260
movq -0x70(%rbp), %rsi
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdx
leaq -0x60(%rbp), %rdi
callq 0x1cf200
movq -0x18(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x1cdf30
movq %rax, %rdi
leaq -0x60(%rbp), %rsi
callq 0x1cf280
leaq -0x60(%rbp), %rdi
callq 0x1ce540
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x1c9026
leaq -0x30(%rbp), %rdi
callq 0x1cec70
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::CommandRunner::CheckAssertReturnResult(spectest::AssertReturnCommand const*, int, spectest::ExpectedValue, wabt::interp::TypedValue, bool) | wabt::Result CommandRunner::CheckAssertReturnResult(
const AssertReturnCommand* command,
int index,
ExpectedValue expected,
TypedValue actual,
bool print_error) {
assert(expected.value.type == actual.type ||
IsReference(expected.value.type));
bool ok = true;
switch (expected.value.type) {
case Type::I8:
case Type::I16:
case Type::I32:
ok = expected.value.value.Get<u32>() == actual.value.Get<u32>();
break;
case Type::I64:
ok = expected.value.value.Get<u64>() == actual.value.Get<u64>();
break;
case Type::F32:
switch (expected.nan[0]) {
case ExpectedNan::Arithmetic:
ok = IsArithmeticNan(actual.value.Get<f32>());
break;
case ExpectedNan::Canonical:
ok = IsCanonicalNan(actual.value.Get<f32>());
break;
case ExpectedNan::None:
ok = Bitcast<u32>(expected.value.value.Get<f32>()) ==
Bitcast<u32>(actual.value.Get<f32>());
break;
}
break;
case Type::F64:
switch (expected.nan[0]) {
case ExpectedNan::Arithmetic:
ok = IsArithmeticNan(actual.value.Get<f64>());
break;
case ExpectedNan::Canonical:
ok = IsCanonicalNan(actual.value.Get<f64>());
break;
case ExpectedNan::None:
ok = Bitcast<u64>(expected.value.value.Get<f64>()) ==
Bitcast<u64>(actual.value.Get<f64>());
break;
}
break;
case Type::V128: {
// Compare each lane as if it were its own value.
for (int lane = 0; lane < LaneCountFromType(expected.lane_type); ++lane) {
ExpectedValue lane_expected = GetLane(expected, lane);
TypedValue lane_actual = GetLane(actual, expected.lane_type, lane);
if (Failed(CheckAssertReturnResult(command, index, lane_expected,
lane_actual, false))) {
PrintError(command->line,
"mismatch in lane %u of result %u of assert_return: "
"expected %s, got %s",
lane, index, ExpectedValueToString(lane_expected).c_str(),
TypedValueToString(lane_actual).c_str());
ok = false;
}
}
break;
}
case Type::FuncRef:
// A funcref expectation only requires that the reference be a function,
// but it doesn't check the actual index.
ok = (actual.type == Type::FuncRef);
break;
case Type::ExternRef:
ok = expected.value.value.Get<Ref>() == actual.value.Get<Ref>();
break;
default:
WABT_UNREACHABLE;
}
if (!ok && print_error) {
PrintError(command->line,
"mismatch in result %u of assert_return: expected %s, got %s",
index, ExpectedValueToString(expected).c_str(),
TypedValueToString(actual).c_str());
}
return ok ? wabt::Result::Ok : wabt::Result::Error;
} | pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp # imm = 0x270
movl %ecx, %eax
movq %rdi, %rcx
leaq 0x48(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
leaq 0x10(%rbp), %rdi
movq %rdi, -0x1b0(%rbp)
movq %rcx, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
andb $0x1, %al
movb %al, -0x1d(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1a8(%rbp)
callq 0x1cb6e0
movq -0x1a0(%rbp), %rdi
movl %eax, -0x198(%rbp)
callq 0x1cb6e0
movl -0x198(%rbp), %ecx
movl %eax, %edx
movb $0x1, %al
cmpl %edx, %ecx
movb %al, -0x191(%rbp)
je 0x1c9186
movq -0x1b0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %edi
callq 0x1cf4e0
movb %al, -0x191(%rbp)
movb -0x191(%rbp), %al
testb $0x1, %al
jne 0x1c9192
jmp 0x1c9194
jmp 0x1c91b3
leaq 0x1389f7(%rip), %rdi # 0x301b92
leaq 0x138248(%rip), %rsi # 0x3013ea
movl $0x67e, %edx # imm = 0x67E
leaq 0x138a2b(%rip), %rcx # 0x301bd9
callq 0x1a6290
movq -0x1b0(%rbp), %rdi
movb $0x1, -0x25(%rbp)
callq 0x1cb6e0
addl $0x11, %eax
movl %eax, %ecx
movq %rcx, -0x1b8(%rbp)
subl $0x10, %eax
ja 0x1c966e
movq -0x1b8(%rbp), %rax
leaq 0x137f06(%rip), %rcx # 0x3010ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x1b0(%rbp), %rdi
addq $0x8, %rdi
callq 0x1cf500
movq -0x1a0(%rbp), %rdi
movl %eax, -0x1bc(%rbp)
addq $0x8, %rdi
callq 0x1cf500
movl %eax, %ecx
movl -0x1bc(%rbp), %eax
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movb %al, -0x25(%rbp)
jmp 0x1c9673
movq -0x1b0(%rbp), %rdi
addq $0x8, %rdi
callq 0x1cf540
movq -0x1a0(%rbp), %rdi
movq %rax, -0x1c8(%rbp)
addq $0x8, %rdi
callq 0x1cf540
movq %rax, %rcx
movq -0x1c8(%rbp), %rax
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movb %al, -0x25(%rbp)
jmp 0x1c9673
movq -0x1b0(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x1cc(%rbp)
testl %eax, %eax
je 0x1c92d9
jmp 0x1c9283
movl -0x1cc(%rbp), %eax
subl $0x1, %eax
je 0x1c92bd
jmp 0x1c9290
movl -0x1cc(%rbp), %eax
subl $0x2, %eax
jne 0x1c932d
jmp 0x1c92a1
movq -0x1a0(%rbp), %rdi
addq $0x8, %rdi
callq 0x1cf580
callq 0x1c9750
andb $0x1, %al
movb %al, -0x25(%rbp)
jmp 0x1c932d
movq -0x1a0(%rbp), %rdi
addq $0x8, %rdi
callq 0x1cf580
callq 0x1c9790
andb $0x1, %al
movb %al, -0x25(%rbp)
jmp 0x1c932d
movq -0x1b0(%rbp), %rdi
addq $0x8, %rdi
callq 0x1cf580
movss %xmm0, -0x2c(%rbp)
leaq -0x2c(%rbp), %rdi
callq 0x1cf5c0
movq -0x1a0(%rbp), %rdi
movl %eax, -0x1d0(%rbp)
addq $0x8, %rdi
callq 0x1cf580
movss %xmm0, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x1cf5c0
movl %eax, %ecx
movl -0x1d0(%rbp), %eax
cmpl %ecx, %eax
sete %al
andb $0x1, %al
movb %al, -0x25(%rbp)
jmp 0x1c9673
movq -0x1b0(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x1d4(%rbp)
testl %eax, %eax
je 0x1c939e
jmp 0x1c9348
movl -0x1d4(%rbp), %eax
subl $0x1, %eax
je 0x1c9382
jmp 0x1c9355
movl -0x1d4(%rbp), %eax
subl $0x2, %eax
jne 0x1c93f6
jmp 0x1c9366
movq -0x1a0(%rbp), %rdi
addq $0x8, %rdi
callq 0x1cf5e0
callq 0x1c97e0
andb $0x1, %al
movb %al, -0x25(%rbp)
jmp 0x1c93f6
movq -0x1a0(%rbp), %rdi
addq $0x8, %rdi
callq 0x1cf5e0
callq 0x1c9830
andb $0x1, %al
movb %al, -0x25(%rbp)
jmp 0x1c93f6
movq -0x1b0(%rbp), %rdi
addq $0x8, %rdi
callq 0x1cf5e0
movsd %xmm0, -0x38(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x1cf620
movq -0x1a0(%rbp), %rdi
movq %rax, -0x1e0(%rbp)
addq $0x8, %rdi
callq 0x1cf5e0
movsd %xmm0, -0x40(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x1cf620
movq %rax, %rcx
movq -0x1e0(%rbp), %rax
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movb %al, -0x25(%rbp)
jmp 0x1c9673
movl $0x0, -0x44(%rbp)
movq -0x1b0(%rbp), %rax
movl -0x44(%rbp), %ecx
movl %ecx, -0x1e4(%rbp)
movl 0x20(%rax), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %edi
callq 0x1c1490
movl %eax, %ecx
movl -0x1e4(%rbp), %eax
cmpl %ecx, %eax
jge 0x1c960b
movq -0x1b0(%rbp), %rsi
movl -0x44(%rbp), %edx
leaq -0x80(%rbp), %rdi
callq 0x1c1530
movq -0x1b0(%rbp), %rax
movq -0x1a0(%rbp), %rsi
movl 0x20(%rax), %eax
movl %eax, -0xa4(%rbp)
movl -0x44(%rbp), %ecx
movl -0xa4(%rbp), %edx
leaq -0xa0(%rbp), %rdi
callq 0x1c1790
movq -0x18(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x1e8(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl $0x38, %edx
callq 0x1a6330
movq -0x1a8(%rbp), %rdi
movq -0x1f0(%rbp), %rsi
movl -0x1e8(%rbp), %edx
movq -0xa0(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0xe8(%rbp)
xorl %eax, %eax
movups -0x100(%rbp), %xmm0
movups -0xf0(%rbp), %xmm1
movq %rsp, %rax
movups %xmm1, 0x48(%rax)
movups %xmm0, 0x38(%rax)
movq -0xb0(%rbp), %rcx
movq %rcx, 0x30(%rax)
movups -0xe0(%rbp), %xmm0
movups -0xd0(%rbp), %xmm1
movups -0xc0(%rbp), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
xorl %ecx, %ecx
callq 0x1c9100
movl %eax, -0xa8(%rbp)
movl -0xa8(%rbp), %edi
callq 0x1cba60
testb $0x1, %al
jne 0x1c954b
jmp 0x1c95fb
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x204(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x200(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x1fc(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x1c98a0
leaq -0x120(%rbp), %rdi
callq 0x1a6170
movq %rax, -0x1f8(%rbp)
leaq -0x140(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x29c8a0
leaq -0x140(%rbp), %rdi
callq 0x1a6170
movq -0x1a8(%rbp), %rdi
movl -0x204(%rbp), %esi
movl -0x200(%rbp), %ecx
movl -0x1fc(%rbp), %r8d
movq -0x1f8(%rbp), %r9
leaq 0x138686(%rip), %rdx # 0x301c5a
movq %rax, (%rsp)
movb $0x0, %al
callq 0x1c8470
leaq -0x140(%rbp), %rdi
callq 0x1a6250
leaq -0x120(%rbp), %rdi
callq 0x1a6250
movb $0x0, -0x25(%rbp)
jmp 0x1c95fd
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x1c9402
jmp 0x1c9673
movq -0x1a0(%rbp), %rdi
callq 0x1cb6e0
cmpl $-0x10, %eax
sete %al
andb $0x1, %al
movb %al, -0x25(%rbp)
jmp 0x1c9673
movq -0x1b0(%rbp), %rdi
addq $0x8, %rdi
callq 0x1cf660
movq -0x1a0(%rbp), %rdi
movq %rax, -0x148(%rbp)
addq $0x8, %rdi
callq 0x1cf660
movq %rax, -0x150(%rbp)
movq -0x148(%rbp), %rdi
movq -0x150(%rbp), %rsi
callq 0x1cf640
andb $0x1, %al
movb %al, -0x25(%rbp)
jmp 0x1c9673
callq 0x1a61e0
testb $0x1, -0x25(%rbp)
jne 0x1c9725
testb $0x1, -0x1d(%rbp)
je 0x1c9725
movq -0x1b0(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x218(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x214(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x1c98a0
leaq -0x170(%rbp), %rdi
callq 0x1a6170
movq -0x1a0(%rbp), %rsi
movq %rax, -0x210(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x29c8a0
leaq -0x190(%rbp), %rdi
callq 0x1a6170
movq -0x1a8(%rbp), %rdi
movl -0x218(%rbp), %esi
movl -0x214(%rbp), %ecx
movq -0x210(%rbp), %r8
movq %rax, %r9
leaq 0x13859b(%rip), %rdx # 0x301ca1
movb $0x0, %al
callq 0x1c8470
leaq -0x190(%rbp), %rdi
callq 0x1a6250
leaq -0x170(%rbp), %rdi
callq 0x1a6250
movb -0x25(%rbp), %cl
movl $0x1, %esi
xorl %eax, %eax
testb $0x1, %cl
cmovnel %eax, %esi
leaq -0x4(%rbp), %rdi
callq 0x1cba40
movl -0x4(%rbp), %eax
addq $0x270, %rsp # imm = 0x270
popq %rbp
retq
nopw (%rax,%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::ExpectedValueToString[abi:cxx11](spectest::ExpectedValue const&) | static std::string ExpectedValueToString(const ExpectedValue& ev) {
// Extend TypedValueToString to print expected nan values too.
switch (ev.value.type) {
case Type::F32:
case Type::F64:
switch (ev.nan[0]) {
case ExpectedNan::None:
return TypedValueToString(ev.value);
case ExpectedNan::Arithmetic:
return StringPrintf("%s:nan:arithmetic", ev.value.type.GetName());
case ExpectedNan::Canonical:
return StringPrintf("%s:nan:canonical", ev.value.type.GetName());
}
break;
case Type::V128: {
int lane_count = LaneCountFromType(ev.lane_type);
std::string result = "v128 ";
for (int lane = 0; lane < lane_count; ++lane) {
result += ExpectedValueToString(GetLane(ev, lane));
}
return result;
}
default:
break;
}
return TypedValueToString(ev.value);
} | pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x90(%rbp)
movq %rdi, %rax
movq %rax, -0x88(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1cb6e0
movl %eax, %ecx
movl %ecx, -0x7c(%rbp)
subl $-0x5, %eax
je 0x1c9981
jmp 0x1c98dd
movl -0x7c(%rbp), %eax
addl $0x4, %eax
subl $0x1, %eax
ja 0x1c9a2b
jmp 0x1c98ee
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
movl %eax, -0x94(%rbp)
testl %eax, %eax
je 0x1c991b
jmp 0x1c9901
movl -0x94(%rbp), %eax
subl $0x1, %eax
je 0x1c9956
jmp 0x1c990e
movl -0x94(%rbp), %eax
subl $0x2, %eax
je 0x1c9930
jmp 0x1c997c
movq -0x90(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x29c8a0
jmp 0x1c9a3d
movq -0x10(%rbp), %rdi
callq 0x1cbd60
movq -0x90(%rbp), %rdi
movq %rax, %rdx
leaq 0x138c1e(%rip), %rsi # 0x302568
movb $0x0, %al
callq 0x1cd050
jmp 0x1c9a3d
movq -0x10(%rbp), %rdi
callq 0x1cbd60
movq -0x90(%rbp), %rdi
movq %rax, %rdx
leaq 0x138c0a(%rip), %rsi # 0x30257a
movb $0x0, %al
callq 0x1cd050
jmp 0x1c9a3d
jmp 0x1c9a2d
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %edi
callq 0x1c1490
movl %eax, -0x14(%rbp)
movb $0x0, -0x19(%rbp)
leaq -0x1a(%rbp), %rdi
callq 0x1a6650
movq -0x90(%rbp), %rdi
leaq 0x138bda(%rip), %rsi # 0x30258b
leaq -0x1a(%rbp), %rdx
callq 0x1a6550
leaq -0x1a(%rbp), %rdi
callq 0x1a6440
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x1c9a13
movq -0x10(%rbp), %rsi
movl -0x20(%rbp), %edx
leaq -0x78(%rbp), %rdi
callq 0x1c1530
leaq -0x40(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x1c98a0
movq -0x90(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1a64f0
leaq -0x40(%rbp), %rdi
callq 0x1a6250
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1c99ca
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x1c9a29
movq -0x90(%rbp), %rdi
callq 0x1a6250
jmp 0x1c9a3d
jmp 0x1c9a2d
movq -0x90(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x29c8a0
movq -0x88(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
ParseOptions(int, char**) | static void ParseOptions(int argc, char** argv) {
OptionParser parser("spectest-interp", s_description);
parser.AddOption('v', "verbose", "Use multiple times for more info", []() {
s_verbose++;
s_log_stream = FileStream::CreateStderr();
});
s_features.AddOptions(&parser);
parser.AddOption('V', "value-stack-size", "SIZE",
"Size in elements of the value stack",
[](const std::string& argument) {
// TODO(binji): validate.
s_thread_options.value_stack_size = atoi(argument.c_str());
});
parser.AddOption('C', "call-stack-size", "SIZE",
"Size in elements of the call stack",
[](const std::string& argument) {
// TODO(binji): validate.
s_thread_options.call_stack_size = atoi(argument.c_str());
});
parser.AddOption('t', "trace", "Trace execution",
[]() { s_trace_stream = s_stdout_stream.get(); });
parser.AddArgument("filename", OptionParser::ArgumentCount::One,
[](const char* argument) { s_infile = argument; });
parser.Parse(argc, argv);
} | pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp # imm = 0x190
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0xa0(%rbp), %rdi
leaq 0x138ab1(%rip), %rsi # 0x302591
leaq 0x1376a9(%rip), %rdx # 0x301190
callq 0x1f9250
leaq -0xc0(%rbp), %rdi
leaq -0xc1(%rbp), %rsi
callq 0x1c9eb0
leaq -0xa0(%rbp), %rdi
movl $0x76, %esi
leaq 0x138a8f(%rip), %rdx # 0x3025a1
leaq 0x138a90(%rip), %rcx # 0x3025a9
leaq -0xc0(%rbp), %r8
callq 0x1f96f0
leaq -0xc0(%rbp), %rdi
callq 0x1e0c10
leaq 0x1ea858(%rip), %rdi # 0x3b4390
leaq -0xa0(%rbp), %rsi
callq 0x1ef760
leaq -0xe8(%rbp), %rdi
leaq -0xe9(%rbp), %rsi
callq 0x1c9f30
leaq -0xa0(%rbp), %rdi
movl $0x56, %esi
leaq 0x138a60(%rip), %rdx # 0x3025ca
leaq 0x138a6a(%rip), %rcx # 0x3025db
leaq 0x138a68(%rip), %r8 # 0x3025e0
leaq -0xe8(%rbp), %r9
callq 0x1f99b0
leaq -0xe8(%rbp), %rdi
callq 0x1e0c30
leaq -0x110(%rbp), %rdi
leaq -0x111(%rbp), %rsi
callq 0x1c9fb0
leaq -0xa0(%rbp), %rdi
movl $0x43, %esi
leaq 0x138a4e(%rip), %rdx # 0x302604
leaq 0x138a1e(%rip), %rcx # 0x3025db
leaq 0x138a50(%rip), %r8 # 0x302614
leaq -0x110(%rbp), %r9
callq 0x1f99b0
leaq -0x110(%rbp), %rdi
callq 0x1e0c30
leaq -0x138(%rbp), %rdi
leaq -0x139(%rbp), %rsi
callq 0x1ca030
leaq -0xa0(%rbp), %rdi
movl $0x74, %esi
leaq 0x138a35(%rip), %rdx # 0x302637
leaq 0x138a34(%rip), %rcx # 0x30263d
leaq -0x138(%rbp), %r8
callq 0x1f96f0
leaq -0x138(%rbp), %rdi
callq 0x1e0c10
leaq -0x161(%rbp), %rdi
callq 0x1a6650
leaq -0x160(%rbp), %rdi
leaq 0x137c95(%rip), %rsi # 0x3018d0
leaq -0x161(%rbp), %rdx
callq 0x1a6550
leaq -0x188(%rbp), %rdi
leaq -0x189(%rbp), %rsi
callq 0x1ca0b0
leaq -0xa0(%rbp), %rdi
leaq -0x160(%rbp), %rsi
xorl %edx, %edx
leaq -0x188(%rbp), %rcx
callq 0x1f96b0
leaq -0x188(%rbp), %rdi
callq 0x1e0c30
leaq -0x160(%rbp), %rdi
callq 0x1a6250
leaq -0x161(%rbp), %rdi
callq 0x1a6440
movl -0x4(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0x1f9f10
leaq -0xa0(%rbp), %rdi
callq 0x1e0c50
addq $0x190, %rsp # imm = 0x190
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
spectest::ReadAndRunSpecJSON(wabt::string_view) | static int ReadAndRunSpecJSON(string_view spec_json_filename) {
JSONParser parser;
if (parser.ReadFile(spec_json_filename) == wabt::Result::Error) {
return 1;
}
Script script;
if (parser.ParseScript(&script) == wabt::Result::Error) {
return 1;
}
CommandRunner runner;
if (runner.Run(script) == wabt::Result::Error) {
return 1;
}
printf("%d/%d tests passed.\n", runner.passed(), runner.total());
const int failed = runner.total() - runner.passed();
return failed;
} | pushq %rbp
movq %rsp, %rbp
subq $0x290, %rsp # imm = 0x290
movq %rdi, -0x18(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x1e1230
movq -0x18(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
leaq -0x80(%rbp), %rdi
callq 0x1c19b0
movl %eax, -0x84(%rbp)
leaq -0x84(%rbp), %rdi
callq 0x1cfc30
cmpl $0x1, %eax
jne 0x1c9d46
movl $0x1, -0x4(%rbp)
movl $0x1, -0x9c(%rbp)
jmp 0x1c9e65
leaq -0xd8(%rbp), %rdi
callq 0x1e1280
leaq -0x80(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x1c6070
movl %eax, -0xdc(%rbp)
leaq -0xdc(%rbp), %rdi
callq 0x1cfc30
cmpl $0x1, %eax
jne 0x1c9d8f
movl $0x1, -0x4(%rbp)
movl $0x1, -0x9c(%rbp)
jmp 0x1c9e59
leaq -0x280(%rbp), %rdi
callq 0x1c62d0
leaq -0x280(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x1c7180
movl %eax, -0x284(%rbp)
leaq -0x284(%rbp), %rdi
callq 0x1cfc30
cmpl $0x1, %eax
jne 0x1c9dd8
movl $0x1, -0x4(%rbp)
movl $0x1, -0x9c(%rbp)
jmp 0x1c9e4d
leaq -0x280(%rbp), %rdi
callq 0x1e12b0
movl %eax, -0x290(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x1e12d0
movl -0x290(%rbp), %esi
movl %eax, %edx
leaq 0x138848(%rip), %rdi # 0x30264d
movb $0x0, %al
callq 0x1a6080
leaq -0x280(%rbp), %rdi
callq 0x1e12d0
movl %eax, -0x28c(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x1e12b0
movl %eax, %ecx
movl -0x28c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x288(%rbp)
movl -0x288(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x9c(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x1e12f0
leaq -0xd8(%rbp), %rdi
callq 0x1e1350
leaq -0x80(%rbp), %rdi
callq 0x1e1380
movl -0x4(%rbp), %eax
addq $0x290, %rsp # imm = 0x290
popq %rbp
retq
nopw (%rax,%rax)
| /dcodeIO[P]wabt/src/tools/spectest-interp.cc |
wabt::Type::GetName() const | const char* GetName() const {
switch (enum_) {
case Type::I32: return "i32";
case Type::I64: return "i64";
case Type::F32: return "f32";
case Type::F64: return "f64";
case Type::V128: return "v128";
case Type::I8: return "i8";
case Type::I16: return "i16";
case Type::FuncRef: return "funcref";
case Type::Func: return "func";
case Type::ExnRef: return "exnref";
case Type::Void: return "void";
case Type::Any: return "any";
case Type::ExternRef: return "externref";
default: return "<type_index>";
}
} | pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
addl $0x40, %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x40, %eax
ja 0x1cbe49
movq -0x18(%rbp), %rax
leaq 0x135545(%rip), %rcx # 0x3012d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x13a100(%rip), %rax # 0x305e9b
movq %rax, -0x8(%rbp)
jmp 0x1cbe54
leaq 0x13ac03(%rip), %rax # 0x3069ae
movq %rax, -0x8(%rbp)
jmp 0x1cbe54
leaq 0x13a5d2(%rip), %rax # 0x30638d
movq %rax, -0x8(%rbp)
jmp 0x1cbe54
leaq 0x139ce6(%rip), %rax # 0x305ab1
movq %rax, -0x8(%rbp)
jmp 0x1cbe54
leaq 0x13581c(%rip), %rax # 0x3015f7
movq %rax, -0x8(%rbp)
jmp 0x1cbe54
leaq 0x135814(%rip), %rax # 0x3015fc
movq %rax, -0x8(%rbp)
jmp 0x1cbe54
leaq 0x13580a(%rip), %rax # 0x3015ff
movq %rax, -0x8(%rbp)
jmp 0x1cbe54
leaq 0x135801(%rip), %rax # 0x301603
movq %rax, -0x8(%rbp)
jmp 0x1cbe54
leaq 0x13a844(%rip), %rax # 0x306653
movq %rax, -0x8(%rbp)
jmp 0x1cbe54
leaq 0x1357f9(%rip), %rax # 0x301615
movq %rax, -0x8(%rbp)
jmp 0x1cbe54
leaq 0x1361b5(%rip), %rax # 0x301fde
movq %rax, -0x8(%rbp)
jmp 0x1cbe54
leaq 0x1361ad(%rip), %rax # 0x301fe3
movq %rax, -0x8(%rbp)
jmp 0x1cbe54
leaq 0x1357c8(%rip), %rax # 0x30160b
movq %rax, -0x8(%rbp)
jmp 0x1cbe54
leaq 0x136197(%rip), %rax # 0x301fe7
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
| /dcodeIO[P]wabt/src/type.h |
wabt::StringPrintf[abi:cxx11](char const*, ...) | StringPrintf(const char* format, ...) {
va_list args;
va_list args_copy;
va_start(args, format);
va_copy(args_copy, args);
size_t len = wabt_vsnprintf(nullptr, 0, format, args) + 1; // For \0.
std::vector<char> buffer(len);
va_end(args);
wabt_vsnprintf(buffer.data(), len, format, args_copy);
va_end(args_copy);
return std::string(buffer.data(), len - 1);
} | pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp # imm = 0x170
movq %rdi, -0x160(%rbp)
movq %rdi, %r10
movq %r10, -0x138(%rbp)
testb %al, %al
je 0x1cd0a8
movaps %xmm0, -0x100(%rbp)
movaps %xmm1, -0xf0(%rbp)
movaps %xmm2, -0xe0(%rbp)
movaps %xmm3, -0xd0(%rbp)
movaps %xmm4, -0xc0(%rbp)
movaps %xmm5, -0xb0(%rbp)
movaps %xmm6, -0xa0(%rbp)
movaps %xmm7, -0x90(%rbp)
movq %r9, -0x108(%rbp)
movq %r8, -0x110(%rbp)
movq %rcx, -0x118(%rbp)
movq %rdx, -0x120(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x130(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x30, -0x2c(%rbp)
movl $0x10, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movaps -0x30(%rbp), %xmm0
movaps %xmm0, -0x50(%rbp)
movq -0x10(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rcx
movq %rsi, %rdi
callq 0x1a6270
incl %eax
cltq
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x170(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x1a6650
movq -0x170(%rbp), %rsi
movq -0x168(%rbp), %rdx
leaq -0x70(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x1d0a00
movq -0x168(%rbp), %rdi
callq 0x1a6440
movq -0x140(%rbp), %rdi
callq 0x1d0a50
movq %rax, %rdi
movq -0x58(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0x50(%rbp), %rcx
callq 0x1a6270
movq -0x140(%rbp), %rdi
callq 0x1d0a50
movq %rax, -0x158(%rbp)
movq -0x58(%rbp), %rax
decq %rax
movq %rax, -0x150(%rbp)
leaq -0x72(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x1a6650
movq -0x160(%rbp), %rdi
movq -0x158(%rbp), %rsi
movq -0x150(%rbp), %rdx
movq -0x148(%rbp), %rcx
callq 0x1a6480
movq -0x148(%rbp), %rdi
callq 0x1a6440
movq -0x140(%rbp), %rdi
callq 0x1d0a70
movq -0x138(%rbp), %rax
addq $0x170, %rsp # imm = 0x170
popq %rbp
retq
nopl (%rax,%rax)
| /dcodeIO[P]wabt/src/common.h |
wabt::interp::RefPtr<wabt::interp::Extern>& wabt::interp::RefPtr<wabt::interp::Extern>::operator=<wabt::interp::Table>(wabt::interp::RefPtr<wabt::interp::Table> const&) | RefPtr<T>& RefPtr<T>::operator=(const RefPtr<U>& other){
obj_ = other.obj_;
store_ = other.store_;
root_index_ = store_ ? store_->CopyRoot(other.root_index_) : 0;
return *this;
} | pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x8(%rax)
je 0x1cd5d0
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x26c520
movq %rax, -0x20(%rbp)
jmp 0x1cd5d8
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x1cd5d8
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x10(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
| /dcodeIO[P]wabt/src/interp/interp-inl.h |
wabt::interp::RefPtr<wabt::interp::Extern>& wabt::interp::RefPtr<wabt::interp::Extern>::operator=<wabt::interp::Memory>(wabt::interp::RefPtr<wabt::interp::Memory> const&) | RefPtr<T>& RefPtr<T>::operator=(const RefPtr<U>& other){
obj_ = other.obj_;
store_ = other.store_;
root_index_ = store_ ? store_->CopyRoot(other.root_index_) : 0;
return *this;
} | pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x8(%rax)
je 0x1cd730
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x26c520
movq %rax, -0x20(%rbp)
jmp 0x1cd738
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x1cd738
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x10(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
| /dcodeIO[P]wabt/src/interp/interp-inl.h |
wabt::interp::RefPtr<wabt::interp::Extern>& wabt::interp::RefPtr<wabt::interp::Extern>::operator=<wabt::interp::Global>(wabt::interp::RefPtr<wabt::interp::Global> const&) | RefPtr<T>& RefPtr<T>::operator=(const RefPtr<U>& other){
obj_ = other.obj_;
store_ = other.store_;
root_index_ = store_ ? store_->CopyRoot(other.root_index_) : 0;
return *this;
} | pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x8(%rax)
je 0x1cd8c0
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x26c520
movq %rax, -0x20(%rbp)
jmp 0x1cd8c8
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x1cd8c8
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x10(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
| /dcodeIO[P]wabt/src/interp/interp-inl.h |
wabt::interp::RefPtr<wabt::interp::Module>::RefPtr(wabt::interp::Store&, wabt::interp::Ref) | RefPtr<T>::RefPtr(Store& store, Ref ref) {
#ifndef NDEBUG
if (!store.Is<T>(ref)) {
ObjectKind ref_kind;
if (ref == Ref::Null) {
ref_kind = ObjectKind::Null;
} else {
ref_kind = store.objects_.Get(ref.index)->kind();
}
fprintf(stderr, "Invalid conversion from Ref (%s) to RefPtr<%s>!\n",
GetName(ref_kind), T::GetTypeName());
abort();
}
#endif
root_index_ = store.NewRoot(ref);
obj_ = static_cast<T*>(store.objects_.Get(ref.index).get());
store_ = &store;
} | pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdx, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rsi
callq 0x1edeb0
testb $0x1, %al
jne 0x1cf13c
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x230280(%rip), %rax # 0x3ff338
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x1cf640
testb $0x1, %al
jne 0x1cf0d2
jmp 0x1cf0db
movl $0x0, -0x24(%rbp)
jmp 0x1cf0ff
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
movq -0x8(%rbp), %rsi
callq 0x1d4630
movq %rax, %rdi
callq 0x1d4690
movq %rax, %rdi
callq 0x1d46b0
movl %eax, -0x24(%rbp)
movq 0x1e4eda(%rip), %rax # 0x3b3fe0
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movl -0x24(%rbp), %edi
callq 0x26bb50
movq %rax, -0x50(%rbp)
callq 0x1edf20
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rdx
movq %rax, %rcx
leaq 0x13305d(%rip), %rsi # 0x30218d
movb $0x0, %al
callq 0x1a6580
callq 0x1a61e0
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rsi
callq 0x26c4f0
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
movq -0x8(%rbp), %rsi
callq 0x1d4630
movq %rax, %rdi
callq 0x1d46e0
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x8(%rax)
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
| /dcodeIO[P]wabt/src/interp/interp-inl.h |
unsigned long wabt::interp::FreeList<std::unique_ptr<wabt::interp::Object, std::default_delete<wabt::interp::Object>>>::New<wabt::interp::HostFunc*>(wabt::interp::HostFunc*&&) | auto FreeList<T>::New(Args&&... args) -> Index {
if (!free_.empty()) {
Index index = free_.back();
assert(is_free_[index]);
free_.pop_back();
is_free_[index] = false;
list_[index] = T(std::forward<Args>(args)...);
return index;
}
assert(list_.size() == is_free_.size());
is_free_.push_back(false);
list_.emplace_back(std::forward<Args>(args)...);
return list_.size() - 1;
} | pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x50(%rbp)
addq $0x18, %rdi
callq 0x1d1690
testb $0x1, %al
jne 0x1d1433
movq -0x50(%rbp), %rdi
addq $0x18, %rdi
callq 0x1d16d0
movq -0x50(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x20(%rbp)
addq $0x30, %rdi
movq -0x20(%rbp), %rsi
callq 0x1d1710
movq %rax, -0x30(%rbp)
movq %rdx, -0x28(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x1d1770
testb $0x1, %al
jne 0x1d13a5
jmp 0x1d13a7
jmp 0x1d13c6
leaq 0x130c77(%rip), %rdi # 0x302025
leaq 0x130c80(%rip), %rsi # 0x302035
movl $0x92, %edx
leaq 0x130cd2(%rip), %rcx # 0x302093
callq 0x1a6290
movq -0x50(%rbp), %rdi
addq $0x18, %rdi
callq 0x1d17a0
movq -0x50(%rbp), %rdi
addq $0x30, %rdi
movq -0x20(%rbp), %rsi
callq 0x1d1710
movq %rax, -0x40(%rbp)
movq %rdx, -0x38(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x1d17d0
movq -0x18(%rbp), %rax
movq (%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x1d1820
movq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x1d1850
movq %rax, %rdi
leaq -0x48(%rbp), %rsi
callq 0x1d1870
leaq -0x48(%rbp), %rdi
callq 0x1d18a0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1d14a7
movq -0x50(%rbp), %rdi
callq 0x1d18f0
movq -0x50(%rbp), %rdi
movq %rax, -0x58(%rbp)
addq $0x30, %rdi
callq 0x1d1910
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpq %rcx, %rax
jne 0x1d145b
jmp 0x1d147a
leaq 0x130cd5(%rip), %rdi # 0x302137
leaq 0x130bcc(%rip), %rsi # 0x302035
movl $0x98, %edx
leaq 0x130c1e(%rip), %rcx # 0x302093
callq 0x1a6290
movq -0x50(%rbp), %rdi
addq $0x30, %rdi
xorl %esi, %esi
callq 0x1d1970
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1d1a40
movq -0x50(%rbp), %rdi
callq 0x1d18f0
subq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
| /dcodeIO[P]wabt/src/interp/interp-inl.h |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.