// File: karel-brinda[P]ococo/src/main.cpp
// Function: main
int main(int argc, const char **argv) {
    /* Use default configuration */
    ococo::params_t params = ococo::params_t(argc, argv);
    if (!params.correctly_initialized) {
        return EXIT_FAILURE;
    }

    switch (params.counter_configuration) {
        case ococo::OCOCO16: {
            ococo::caller_t<uint16_t, 3, 4> caller(&params);
            if (!caller.correctly_initialized) {
                return EXIT_FAILURE;
            }
            caller.run();
            return caller.return_code;
        }

        case ococo::OCOCO32: {
            ococo::caller_t<uint32_t, 7, 4> caller(&params);
            if (!caller.correctly_initialized) {
                return EXIT_FAILURE;
            }
            caller.run();
            return caller.return_code;
        }

        case ococo::OCOCO64: {
            ococo::caller_t<uint64_t, 15, 4> caller(&params);
            if (!caller.correctly_initialized) {
                return EXIT_FAILURE;
            }
            caller.run();
            return caller.return_code;
        }
    }

    return EXIT_FAILURE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x310, %rsp            # imm = 0x310
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0x248(%rbp), %rdi
callq 0xfa90
testb $0x1, -0x248(%rbp)
jne 0x4d7b
movl $0x1, -0x4(%rbp)
movl $0x1, -0x24c(%rbp)
jmp 0x4f6c
movl -0x220(%rbp), %eax
movl %eax, -0x30c(%rbp)
testl %eax, %eax
je 0x4db2
jmp 0x4d8d
movl -0x30c(%rbp), %eax
subl $0x1, %eax
je 0x4e51
jmp 0x4d9e
movl -0x30c(%rbp), %eax
subl $0x2, %eax
je 0x4ed9
jmp 0x4f5b
leaq -0x288(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x5aa0
jmp 0x4dc7
testb $0x1, -0x288(%rbp)
jne 0x4dfa
movl $0x1, -0x4(%rbp)
movl $0x1, -0x24c(%rbp)
jmp 0x4e40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x290(%rbp)
movl %eax, -0x294(%rbp)
jmp 0x4f84
leaq -0x288(%rbp), %rdi
callq 0x6530
jmp 0x4e08
movl -0x284(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x24c(%rbp)
jmp 0x4e40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x290(%rbp)
movl %eax, -0x294(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x6ab0
jmp 0x4f84
leaq -0x288(%rbp), %rdi
callq 0x6ab0
jmp 0x4f6c
leaq -0x2d0(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x6bb0
jmp 0x4e66
testb $0x1, -0x2d0(%rbp)
jne 0x4e82
movl $0x1, -0x4(%rbp)
movl $0x1, -0x24c(%rbp)
jmp 0x4ec8
leaq -0x2d0(%rbp), %rdi
callq 0x7640
jmp 0x4e90
movl -0x2cc(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x24c(%rbp)
jmp 0x4ec8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x290(%rbp)
movl %eax, -0x294(%rbp)
leaq -0x2d0(%rbp), %rdi
callq 0x7bc0
jmp 0x4f84
leaq -0x2d0(%rbp), %rdi
callq 0x7bc0
jmp 0x4f6c
leaq -0x308(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x7cc0
jmp 0x4eee
testb $0x1, -0x308(%rbp)
jne 0x4f0a
movl $0x1, -0x4(%rbp)
movl $0x1, -0x24c(%rbp)
jmp 0x4f4d
leaq -0x308(%rbp), %rdi
callq 0x8750
jmp 0x4f18
movl -0x304(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x24c(%rbp)
jmp 0x4f4d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x290(%rbp)
movl %eax, -0x294(%rbp)
leaq -0x308(%rbp), %rdi
callq 0x8cd0
jmp 0x4f84
leaq -0x308(%rbp), %rdi
callq 0x8cd0
jmp 0x4f6c
movl $0x1, -0x4(%rbp)
movl $0x1, -0x24c(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x103c0
movl -0x4(%rbp), %eax
addq $0x310, %rsp            # imm = 0x310
popq %rbp
retq
leaq -0x248(%rbp), %rdi
callq 0x103c0
movq -0x290(%rbp), %rdi
callq 0x4a30
nopl (%rax)