// File: danomatika[P]miditester/src/main.cpp
// Function: sysex(std::vector<TestSet, std::allocator<TestSet>>&, int)
void sysex(TestQueue &queue, int channel) {
    TestSet set;
    set.name = "sysex";
    set.messages = {

        // test realtime messages within sysex
        {MIDI_SYSEX, 1, 2, MIDI_STOP, 3, 4, MIDI_CLOCK, 5, 6, MIDI_SYSEXEND},

        // test sysex without sysex end byte
        // not all of these bytes may go through as MIDI
        // backends handle this in different ways
        //{MIDI_SYSEX, 7, 8, 9, 10, 11, 12, 13, 14},

        // next status message should work fine
        {(unsigned char)(MIDI_NOTEON + channel), 64, 64}
    };
    queue.push_back(set);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x86b0
movq -0xe0(%rbp), %rdi
leaq 0x939f(%rip), %rsi      # 0x103ef
callq 0x3290
jmp 0x7057
movb $0x1, -0xd5(%rbp)
leaq -0x98(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq %rax, -0xa0(%rbp)
movb $-0x10, -0xba(%rbp)
movb $0x1, -0xb9(%rbp)
movb $0x2, -0xb8(%rbp)
movb $-0x4, -0xb7(%rbp)
movb $0x3, -0xb6(%rbp)
movb $0x4, -0xb5(%rbp)
movb $-0x8, -0xb4(%rbp)
movb $0x5, -0xb3(%rbp)
movb $0x6, -0xb2(%rbp)
movb $-0x9, -0xb1(%rbp)
leaq -0xba(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq $0xa, -0xa8(%rbp)
leaq -0xbb(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x86e0
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rcx
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
callq 0x8700
jmp 0x7108
leaq -0x80(%rbp), %rax
movq %rax, -0x100(%rbp)
movq %rax, -0xa0(%rbp)
movb -0xc(%rbp), %al
addb $-0x70, %al
movb %al, -0xd3(%rbp)
movb $0x40, -0xd2(%rbp)
movb $0x40, -0xd1(%rbp)
leaq -0xd3(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq $0x3, -0xc8(%rbp)
leaq -0xd4(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x86e0
movq -0x100(%rbp), %rdi
movq -0xf8(%rbp), %rcx
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
callq 0x8700
jmp 0x7182
movb $0x0, -0xd5(%rbp)
leaq -0x98(%rbp), %rax
movq %rax, -0x68(%rbp)
movq $0x2, -0x60(%rbp)
leaq -0x28(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
callq 0x8780
jmp 0x71af
leaq -0x98(%rbp), %rax
movq %rax, -0x110(%rbp)
addq $0x30, %rax
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rdi
addq $-0x18, %rdi
movq %rdi, -0x118(%rbp)
callq 0x83c0
movq -0x110(%rbp), %rcx
movq -0x118(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x108(%rbp)
jne 0x71c8
leaq -0xd4(%rbp), %rdi
callq 0x87d0
leaq -0xbb(%rbp), %rdi
callq 0x87d0
movq -0x8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x87f0
jmp 0x7220
leaq -0x48(%rbp), %rdi
callq 0x8860
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x7329
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x72c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x72b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x98(%rbp), %rax
movq %rax, -0x128(%rbp)
addq $0x30, %rax
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rdi
addq $-0x18, %rdi
movq %rdi, -0x130(%rbp)
callq 0x83c0
movq -0x128(%rbp), %rcx
movq -0x130(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x120(%rbp)
jne 0x7284
jmp 0x72b7
leaq -0xd4(%rbp), %rdi
callq 0x87d0
leaq -0xbb(%rbp), %rdi
callq 0x87d0
testb $0x1, -0xd5(%rbp)
jne 0x72da
jmp 0x7327
movq -0xa0(%rbp), %rax
leaq -0x98(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x138(%rbp)
je 0x7325
movq -0x138(%rbp), %rdi
addq $-0x18, %rdi
movq %rdi, -0x140(%rbp)
callq 0x83c0
movq -0x140(%rbp), %rax
leaq -0x98(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x138(%rbp)
jne 0x72f4
jmp 0x7327
jmp 0x7329
leaq -0x48(%rbp), %rdi
callq 0x8860
movq -0x50(%rbp), %rdi
callq 0x3320
nopl (%rax,%rax)