// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: screencapture
int screencapture(char *filename, char mode)
{
	int ret;

	if (filename) {
		strcpy(capturename, filename);
	}
	if (qsetmode == 200 && (mode & 2) && !captureatnextpage) {
		captureatnextpage = mode;
		return 0;
	}
	switch (captureformat) {
		case 0: ret = screencapture_tga(mode&1); break;
		case 1: ret = screencapture_pcx(mode&1); break;
		default: ret = screencapture_png(mode&1); break;
	}
	if (ret == 0) {
		buildprintf("Saved screenshot to %s\n", capturename);
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movl %esi, %ebx
testq %rdi, %rdi
je 0x3474f
movq %rdi, %rsi
leaq 0x6f516(%rip), %rdi     # 0xa3c60
callq 0x6430
movl 0x1832d3(%rip), %eax    # 0x1b7a28
cmpl $0xc8, %eax
jne 0x34777
testb $0x2, %bl
je 0x34777
cmpb $0x0, 0x3ed71c(%rip)    # 0x421e84
jne 0x34777
movb %bl, 0x3ed714(%rip)     # 0x421e84
xorl %ebx, %ebx
jmp 0x34c84
movl 0x376d77(%rip), %ecx    # 0x3ab4f4
andb $0x1, %bl
cmpl $0x1, %ecx
je 0x34894
testl %ecx, %ecx
jne 0x349df
movaps 0x41768(%rip), %xmm0    # 0x75f00
movaps %xmm0, 0x20(%rsp)
movw $0x8, 0x30(%rsp)
leaq 0x3ecc2(%rip), %rdi     # 0x7346d
callq 0x3fa7e
testq %rax, %rax
je 0x34c66
movq %rax, %r14
leaq 0x5c518d(%rip), %r15    # 0x5f9950
cmpl $0x3, (%r15)
jl 0x347ee
cmpl $0xc8, 0x183255(%rip)   # 0x1b7a28
jne 0x347ee
movw $0x200, 0x21(%rsp)      # imm = 0x200
movl $0x0, 0x23(%rsp)
movb $0x0, 0x27(%rsp)
movb $0x18, 0x30(%rsp)
movzwl 0x3d27f7(%rip), %eax    # 0x406fec
leaq 0x20(%rsp), %rdi
movw %ax, 0xc(%rdi)
movzwl 0x3d27eb(%rip), %eax    # 0x406ff0
movw %ax, 0xe(%rdi)
movl $0x12, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x6b90
cmpl $0x3, (%r15)
jl 0x3482f
jne 0x3486e
cmpl $0xc8, 0x1831fb(%rip)   # 0x1b7a28
je 0x3486e
xorl %r15d, %r15d
leaq 0x401577(%rip), %r12    # 0x435db0
movzbl 0x2(%r12,%r15,4), %edi
movq %r14, %rsi
callq 0x6920
movzbl 0x1(%r12,%r15,4), %edi
movq %r14, %rsi
callq 0x6920
movzbl (%r12,%r15,4), %edi
movq %r14, %rsi
callq 0x6920
incq %r15
cmpq $0x100, %r15            # imm = 0x100
jne 0x34839
orb $0x6, %bl
movzbl %bl, %esi
leaq 0xb678(%rip), %rcx      # 0x3fef3
xorl %ebx, %ebx
movq %r14, %rdi
xorl %edx, %edx
callq 0x3fc0f
movq %r14, %rdi
callq 0x6480
jmp 0x34c6b
leaq 0x41daa(%rip), %rdi     # 0x76645
callq 0x3fa7e
testq %rax, %rax
je 0x34c66
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movl $0x801050a, 0x20(%rsp)  # imm = 0x801050A
movl $0x480048, 0x2c(%rsp)   # imm = 0x480048
movb $0x1, %al
movb %al, 0x61(%rsp)
movb %al, 0x64(%rsp)
leaq 0x5c5052(%rip), %r15    # 0x5f9950
cmpl $0x3, (%r15)
jl 0x34915
cmpl $0xc8, 0x18311a(%rip)   # 0x1b7a28
jne 0x34915
movb $0x3, 0x61(%rsp)
movl 0x3d26d1(%rip), %ecx    # 0x406fec
leal -0x1(%rcx), %eax
leaq 0x20(%rsp), %rdi
movb %al, 0x8(%rdi)
leal -0x1(%rcx), %eax
movb %ah, 0x29(%rsp)
movl 0x3d26bd(%rip), %eax    # 0x406ff0
leal -0x1(%rax), %edx
movb %dl, 0xa(%rdi)
decl %eax
movb %ah, 0x2b(%rsp)
movl %ecx, %eax
andl $0x1, %eax
addl %ecx, %eax
movb %al, 0x42(%rdi)
movb %ah, 0x63(%rsp)
movl $0x80, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x6b90
movzbl %bl, %esi
leaq 0xb595(%rip), %rcx      # 0x3fefe
movq %r14, %rdi
xorl %edx, %edx
callq 0x3fc0f
cmpl $0x3, (%r15)
jl 0x3498f
jne 0x34c5a
cmpl $0xc8, 0x18309f(%rip)   # 0x1b7a28
je 0x34c5a
movl $0xc, %edi
movq %r14, %rsi
callq 0x6920
xorl %ebx, %ebx
leaq 0x40140b(%rip), %r15    # 0x435db0
movzbl (%r15,%rbx,4), %edi
movq %r14, %rsi
callq 0x6920
movzbl 0x1(%r15,%rbx,4), %edi
movq %r14, %rsi
callq 0x6920
movzbl 0x2(%r15,%rbx,4), %edi
movq %r14, %rsi
callq 0x6920
incq %rbx
cmpq $0x100, %rbx            # imm = 0x100
jne 0x349a5
jmp 0x34c5a
xorl $0xc8, %eax
movabsq $0xa1a0a0d474e5089, %rcx # imm = 0xA1A0A0D474E5089
movq %rcx, 0x10(%rsp)
leaq 0x5c4f56(%rip), %r12    # 0x5f9950
movl (%r12), %ecx
xorl $0x3, %ecx
xorl %ebp, %ebp
orl %eax, %ecx
sete %r13b
leaq 0x40130(%rip), %rdi     # 0x74b40
callq 0x3fa7e
testq %rax, %rax
je 0x34c66
movq %rax, %r14
leaq 0x10(%rsp), %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x6b90
leaq 0x24(%rsp), %r15
movl 0x3d25a9(%rip), %eax    # 0x406fec
bswapl %eax
movl %eax, 0x4(%r15)
movl 0x3d25a1(%rip), %eax    # 0x406ff0
bswapl %eax
movl %eax, 0x8(%r15)
movb $0x8, 0xc(%r15)
movb %r13b, 0xf(%rsp)
movl %r13d, %eax
xorb $0x3, %al
movb %al, 0xd(%r15)
movw $0x0, 0xe(%r15)
movb $0x0, 0x10(%r15)
movabsq $0x524448490d000000, %rax # imm = 0x524448490D000000
movq %rax, -0x4(%r15)
movq %r15, %rdi
movl $0x11, %esi
callq 0x6e4ef
bswapl %eax
movl %eax, 0x11(%r15)
leaq 0x20(%rsp), %rdi
movl $0x19, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x6b90
cmpl $0x3, (%r12)
jl 0x34ac1
jne 0x34b32
cmpl $0xc8, 0x182f69(%rip)   # 0x1b7a28
je 0x34b32
movl $0x45544c50, 0x24(%rsp) # imm = 0x45544C50
movl $0xa, %eax
leaq 0x4012dd(%rip), %rcx    # 0x435db2
movb -0x2(%rcx), %dl
movb %dl, 0x1e(%rsp,%rax)
movb -0x1(%rcx), %dl
movb %dl, 0x1f(%rsp,%rax)
movb (%rcx), %dl
movb %dl, 0x20(%rsp,%rax)
addq $0x3, %rax
addq $0x4, %rcx
cmpq $0x30a, %rax            # imm = 0x30A
jne 0x34ad5
leaq 0x20(%rsp), %r12
movl $0x30000, (%r12)        # imm = 0x30000
movq %r15, %rdi
movl $0x304, %esi            # imm = 0x304
callq 0x6e4ef
bswapl %eax
movl %eax, 0x308(%r12)
movl $0x30c, %esi            # imm = 0x30C
movl $0x1, %edx
movq %r12, %rdi
movq %r14, %rcx
callq 0x6b90
leaq 0x20(%rsp), %r12
movl $0x54414449, 0x4(%r12)  # imm = 0x54414449
leaq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x6e522
movb 0xf(%rsp), %al
movb %al, %bpl
leal 0x1(,%rbp,2), %eax
imull 0x3d248a(%rip), %eax    # 0x406fec
addl $0x6, %eax
imull 0x3d2484(%rip), %eax    # 0x406ff0
movw $0x178, 0x8(%r12)       # imm = 0x178
addl $0xb, %eax
bswapl %eax
movl %eax, (%r12)
movq %r13, %rdi
movq %r15, %rsi
movl $0x6, %edx
callq 0x6e52e
movl $0xa, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %r14, %rcx
callq 0x6b90
movl $0x1, 0x4(%r13)
movzbl %bl, %esi
leaq 0xb495(%rip), %rcx      # 0x40049
movq %r14, %rdi
movq %r13, %rdx
callq 0x3fc0f
movb $-0x1, 0x4(%r12)
movl $0xff000001, (%r12)     # imm = 0xFF000001
movzwl 0x4(%r13), %eax
movzwl 0x6(%r13), %ecx
rolw $0x8, %cx
movw %cx, 0x5(%r12)
rolw $0x8, %ax
movw %ax, 0x7(%r12)
movq %r13, %rdi
movq %r12, %rsi
movl $0x9, %edx
callq 0x6e52e
movq %r13, %rdi
callq 0x6e55b
movl (%r13), %eax
bswapl %eax
movl %eax, 0x9(%r12)
movl $0xd, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %r14, %rcx
callq 0x6b90
movabsq $0x444e454900000000, %rax # imm = 0x444E454900000000
movq %rax, (%r12)
movq %r15, %rdi
movl $0x4, %esi
callq 0x6e4ef
bswapl %eax
movl %eax, 0x8(%r12)
movl $0xc, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %r14, %rcx
callq 0x6b90
movq %r14, %rdi
callq 0x6480
xorl %ebx, %ebx
jmp 0x34c6b
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %ebx, %ebx
jne 0x34c84
leaq 0x41720(%rip), %rdi     # 0x76396
leaq 0x6efe3(%rip), %rsi     # 0xa3c60
xorl %eax, %eax
callq 0x24cb4
movl %ebx, %eax
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq