// File: hzeller[P]FlaschenTaschen-PixelPusher-bridge/composite-flaschen-taschen.cc
// Function: CompositeFlaschenTaschen::CompositeFlaschenTaschen(FlaschenTaschen*, int)
CompositeFlaschenTaschen::CompositeFlaschenTaschen(FlaschenTaschen *delegatee,
                                                   int layers)
    : delegatee_(delegatee),
      width_(delegatee->width()), height_(delegatee->height()),
      current_layer_(0), any_visible_pixel_drawn_(false),
      z_buffer_(new ZBuffer(width_, height_)),
      garbage_collect_(NULL) {
    assert(layers < 32);  // otherwise could getting slow.
    for (int i = 0; i < layers; ++i) {
        screens_.push_back(new ScreenBuffer(delegatee->width(),
                                            delegatee->height()));
        last_layer_update_time_.push_back(INT_MAX);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x48(%rbp)
callq 0x3930
movq -0x48(%rbp), %rax
leaq 0x8cb2(%rip), %rcx      # 0xbc20
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
addq $0x10, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movl %eax, -0x38(%rbp)
jmp 0x2f93
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
movl -0x38(%rbp), %edx
movl %edx, (%rcx)
addq $0x14, %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movl %eax, -0x4c(%rbp)
jmp 0x2fba
movq -0x48(%rbp), %rdi
movq -0x58(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl %ecx, (%rax)
movl $0x0, 0x18(%rdi)
movb $0x0, 0x1c(%rdi)
addq $0x28, %rdi
movq %rdi, -0x70(%rbp)
callq 0x3950
movq -0x48(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x68(%rbp)
movl $0x10, %edi
callq 0x21e0
movq %rax, -0x60(%rbp)
jmp 0x2ffb
movq -0x60(%rbp), %rdi
movq -0x48(%rbp), %rax
movl 0x10(%rax), %esi
movl 0x14(%rax), %edx
callq 0x3970
jmp 0x3010
movq -0x48(%rbp), %rdi
movq -0x68(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, (%rax)
addq $0x48, %rdi
movq %rdi, -0x78(%rbp)
callq 0x39a0
movq -0x48(%rbp), %rax
movq $0x0, 0x60(%rax)
cmpl $0x20, -0x14(%rbp)
jge 0x3040
jmp 0x30a0
leaq 0x5235(%rip), %rdi      # 0x827c
leaq 0x523a(%rip), %rsi      # 0x8288
movl $0x65, %edx
leaq 0x524c(%rip), %rcx      # 0x82a6
callq 0x2150
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x319c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x3193
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x10, %esi
callq 0x21f0
jmp 0x3193
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x3181
movq -0x48(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x88(%rbp)
movl $0x10, %edi
callq 0x21e0
movq %rax, -0x80(%rbp)
jmp 0x30d2
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movl %eax, -0x8c(%rbp)
jmp 0x30e7
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movl %eax, -0x90(%rbp)
jmp 0x30fc
movl -0x90(%rbp), %edx
movl -0x8c(%rbp), %esi
movq -0x80(%rbp), %rdi
callq 0x39f0
jmp 0x3113
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rsi
callq 0x39c0
jmp 0x312d
movq -0x48(%rbp), %rdi
addq $0x48, %rdi
movl $0x7fffffff, -0x34(%rbp) # imm = 0x7FFFFFFF
leaq -0x34(%rbp), %rsi
callq 0x3a20
jmp 0x3147
jmp 0x3149
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x30a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x318a
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x10, %esi
callq 0x21f0
jmp 0x318a
addq $0x90, %rsp
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x3a50
movq -0x70(%rbp), %rdi
callq 0x3ab0
movq -0x48(%rbp), %rdi
callq 0x3d50
movq -0x20(%rbp), %rdi
callq 0x2330
nop