// File: /workspace/github_c_makefile_star2_O1/wjmelements[P]evm/tst/label.c
// Function: main
int main() {
    assert(labelCount == 0);
    assert(firstLabelAfter(0) == 0);

    const char *label = "hello";
    jump_t jump1;
    jump1.label.start = label;
    jump1.label.length = 5;
    jump1.programCounter = 0;
    registerLabel(jump1);
    assert(labelCount == 1);
    assert(labels[0].length == jump1.label.length);
    assert(labelLocations[0] == 0);
    assert(firstLabelAfter(0) == 1);


    labelLocations[0] = 1;
    assert(labelLocations[0] == 1);
    assert(firstLabelAfter(0) == 0);
    assert(firstLabelAfter(1) == 1);
    assert(firstLabelAfter(2) == 1);

    incrementLabelLocations(0, 1);
    assert(labelLocations[0] == 2);
    assert(firstLabelAfter(0) == 0);
    assert(firstLabelAfter(1) == 0);
    assert(firstLabelAfter(2) == 1);
    assert(firstLabelAfter(3) == 1);

    const char *label2 = "world";
    jump_t jump2;
    jump2.label.start = label2;
    jump2.label.length = 5;
    jump2.programCounter = 254;
    registerLabel(jump2);
    assert(labelCount == 2);
    assert(labels[0].length == jump2.label.length);
    assert(labelLocations[0] == 2);
    assert(labelLocations[1] == 254);
    incrementLabelLocations(10, 3);
    assert(labelLocations[0] == 2);
    assert(labelLocations[1] == 257);
    assert(firstLabelAfter(0) == 0);
    assert(firstLabelAfter(1) == 0);
    assert(firstLabelAfter(2) == 1);
    assert(firstLabelAfter(256) == 1);
    assert(firstLabelAfter(257) == 2);
    assert(firstLabelAfter(258) == 2);
}

// Assembly:
pushq %rbx
subq $0x60, %rsp
cmpl $0x0, 0x5658(%rip)      # 0x7860
jne 0x2644
leaq 0x1e2e(%rip), %rax      # 0x4043
movq %rax, 0x50(%rsp)
movq $0x5, 0x58(%rsp)
movl $0x0, 0x40(%rsp)
movups 0x40(%rsp), %xmm0
movups 0x50(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x2891
movl 0x5617(%rip), %eax      # 0x7860
cmpl $0x1, %eax
jne 0x2663
cmpq $0x5, 0x561e(%rip)      # 0x7878
jne 0x2682
cmpl $0x0, 0x9609(%rip)      # 0xb870
jne 0x26a1
xorl %ecx, %ecx
leaq 0x95fa(%rip), %rbx      # 0xb870
movl %eax, %edx
leal (%rdx,%rcx), %esi
shrl %esi
cmpl $0x0, (%rbx,%rsi,4)
je 0x2287
movl %esi, %edx
jmp 0x228b
incl %esi
movl %esi, %ecx
cmpl %edx, %ecx
jb 0x2278
cmpl $0x1, %ecx
jne 0x26c0
movl $0x1, 0x95ce(%rip)      # 0xb870
xorl %ecx, %ecx
movl %eax, %edx
leal (%rdx,%rcx), %esi
shrl %esi
cmpl $0x0, (%rbx,%rsi,4)
je 0x22b5
movl %esi, %edx
jmp 0x22b9
incl %esi
movl %esi, %ecx
cmpl %edx, %ecx
jb 0x22a6
testl %ecx, %ecx
jne 0x26df
xorl %ecx, %ecx
movl %eax, %edx
leal (%rdx,%rcx), %esi
shrl %esi
cmpl $0x2, (%rbx,%rsi,4)
jae 0x22da
incl %esi
movl %esi, %ecx
jmp 0x22dc
movl %esi, %edx
cmpl %edx, %ecx
jb 0x22c9
cmpl $0x1, %ecx
jne 0x26fe
xorl %ecx, %ecx
leal (%rax,%rcx), %edx
shrl %edx
cmpl $0x3, (%rbx,%rdx,4)
jae 0x22fc
incl %edx
movl %edx, %ecx
jmp 0x22fe
movl %edx, %eax
cmpl %eax, %ecx
jb 0x22eb
cmpl $0x1, %ecx
jne 0x271d
xorl %edi, %edi
movl $0x1, %esi
callq 0x2931
cmpl $0x2, 0x9552(%rip)      # 0xb870
jne 0x273c
movl 0x5536(%rip), %eax      # 0x7860
testl %eax, %eax
je 0x258a
xorl %ecx, %ecx
movl %eax, %edx
leal (%rdx,%rcx), %esi
shrl %esi
cmpl $0x0, (%rbx,%rsi,4)
je 0x2345
movl %esi, %edx
jmp 0x2349
incl %esi
movl %esi, %ecx
cmpl %edx, %ecx
jb 0x2336
testl %ecx, %ecx
jne 0x275b
testl %eax, %eax
je 0x258a
xorl %ecx, %ecx
movl %eax, %edx
leal (%rdx,%rcx), %esi
shrl %esi
cmpl $0x2, (%rbx,%rsi,4)
jae 0x2372
incl %esi
movl %esi, %ecx
jmp 0x2374
movl %esi, %edx
cmpl %edx, %ecx
jb 0x2361
testl %ecx, %ecx
jne 0x277a
testl %eax, %eax
je 0x258a
xorl %ecx, %ecx
movl %eax, %edx
leal (%rdx,%rcx), %esi
shrl %esi
cmpl $0x3, (%rbx,%rsi,4)
jae 0x239d
incl %esi
movl %esi, %ecx
jmp 0x239f
movl %esi, %edx
cmpl %edx, %ecx
jb 0x238c
cmpl $0x1, %ecx
jne 0x258a
testl %eax, %eax
je 0x25c8
xorl %ecx, %ecx
leal (%rax,%rcx), %edx
shrl %edx
cmpl $0x4, (%rbx,%rdx,4)
jae 0x23c7
incl %edx
movl %edx, %ecx
jmp 0x23c9
movl %edx, %eax
cmpl %eax, %ecx
jb 0x23b6
cmpl $0x1, %ecx
jne 0x25c8
leaq 0x1d49(%rip), %rax      # 0x4126
movq %rax, 0x30(%rsp)
movq $0x5, 0x38(%rsp)
movl $0xfe, 0x20(%rsp)
movups 0x20(%rsp), %xmm0
movups 0x30(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x2891
cmpl $0x2, 0x544e(%rip)      # 0x7860
jne 0x2799
cmpq $0x5, 0x5458(%rip)      # 0x7878
jne 0x27b8
cmpl $0x2, 0x9443(%rip)      # 0xb870
jne 0x27d7
cmpl $0xfe, 0x9437(%rip)     # 0xb874
jne 0x27f6
movl $0xa, %edi
movl $0x3, %esi
callq 0x2931
cmpl $0x2, 0x9417(%rip)      # 0xb870
jne 0x2815
cmpl $0x101, 0x940b(%rip)    # imm = 0x101
jne 0x2834
movl 0x53eb(%rip), %eax      # 0x7860
testl %eax, %eax
je 0x25a9
xorl %ecx, %ecx
movl %eax, %edx
leal (%rdx,%rcx), %esi
shrl %esi
cmpl $0x0, (%rbx,%rsi,4)
je 0x2490
movl %esi, %edx
jmp 0x2494
incl %esi
movl %esi, %ecx
cmpl %edx, %ecx
jb 0x2481
testl %ecx, %ecx
jne 0x2853
testl %eax, %eax
je 0x25a9
xorl %ecx, %ecx
movl %eax, %edx
leal (%rdx,%rcx), %esi
shrl %esi
cmpl $0x2, (%rbx,%rsi,4)
jae 0x24bd
incl %esi
movl %esi, %ecx
jmp 0x24bf
movl %esi, %edx
cmpl %edx, %ecx
jb 0x24ac
testl %ecx, %ecx
jne 0x2872
testl %eax, %eax
je 0x25a9
xorl %ecx, %ecx
movl %eax, %edx
leal (%rdx,%rcx), %esi
shrl %esi
cmpl $0x3, (%rbx,%rsi,4)
jae 0x24e8
incl %esi
movl %esi, %ecx
jmp 0x24ea
movl %esi, %edx
cmpl %edx, %ecx
jb 0x24d7
cmpl $0x1, %ecx
jne 0x25a9
testl %eax, %eax
je 0x25e7
xorl %ecx, %ecx
movl %eax, %edx
leal (%rdx,%rcx), %esi
shrl %esi
cmpl $0x101, (%rbx,%rsi,4)   # imm = 0x101
jae 0x2517
incl %esi
movl %esi, %ecx
jmp 0x2519
movl %esi, %edx
cmpl %edx, %ecx
jb 0x2503
cmpl $0x1, %ecx
jne 0x25e7
testl %eax, %eax
je 0x2606
xorl %ecx, %ecx
movl %eax, %edx
leal (%rdx,%rcx), %esi
shrl %esi
cmpl $0x102, (%rbx,%rsi,4)   # imm = 0x102
jae 0x2546
incl %esi
movl %esi, %ecx
jmp 0x2548
movl %esi, %edx
cmpl %edx, %ecx
jb 0x2532
cmpl $0x2, %ecx
jne 0x2606
testl %eax, %eax
je 0x2625
xorl %ecx, %ecx
leal (%rax,%rcx), %edx
shrl %edx
cmpl $0x103, (%rbx,%rdx,4)   # imm = 0x103
jae 0x2573
incl %edx
movl %edx, %ecx
jmp 0x2575
movl %edx, %eax
cmpl %eax, %ecx
jb 0x255f
cmpl $0x2, %ecx
jne 0x2625
xorl %eax, %eax
addq $0x60, %rsp
popq %rbx
retq
leaq 0x1b36(%rip), %rdi      # 0x40c7
leaq 0x1a7c(%rip), %rsi      # 0x4014
leaq 0x1a81(%rip), %rcx      # 0x4020
movl $0x21, %edx
callq 0x2030
leaq 0x1b17(%rip), %rdi      # 0x40c7
leaq 0x1a5d(%rip), %rsi      # 0x4014
leaq 0x1a62(%rip), %rcx      # 0x4020
movl $0x33, %edx
callq 0x2030
leaq 0x1b3f(%rip), %rdi      # 0x410e
leaq 0x1a3e(%rip), %rsi      # 0x4014
leaq 0x1a43(%rip), %rcx      # 0x4020
movl $0x22, %edx
callq 0x2030
leaq 0x1ba7(%rip), %rdi      # 0x4195
leaq 0x1a1f(%rip), %rsi      # 0x4014
leaq 0x1a24(%rip), %rcx      # 0x4020
movl $0x34, %edx
callq 0x2030
leaq 0x1ba2(%rip), %rdi      # 0x41af
leaq 0x1a00(%rip), %rsi      # 0x4014
leaq 0x1a05(%rip), %rcx      # 0x4020
movl $0x35, %edx
callq 0x2030
leaq 0x1b9d(%rip), %rdi      # 0x41c9
leaq 0x19e1(%rip), %rsi      # 0x4014
leaq 0x19e6(%rip), %rcx      # 0x4020
movl $0x36, %edx
callq 0x2030
leaq 0x19b9(%rip), %rdi      # 0x4004
leaq 0x19c2(%rip), %rsi      # 0x4014
leaq 0x19c7(%rip), %rcx      # 0x4020
movl $0x8, %edx
callq 0x2030
leaq 0x19df(%rip), %rdi      # 0x4049
leaq 0x19a3(%rip), %rsi      # 0x4014
leaq 0x19a8(%rip), %rcx      # 0x4020
movl $0x11, %edx
callq 0x2030
leaq 0x19d0(%rip), %rdi      # 0x4059
leaq 0x1984(%rip), %rsi      # 0x4014
leaq 0x1989(%rip), %rcx      # 0x4020
movl $0x12, %edx
callq 0x2030
leaq 0x19d8(%rip), %rdi      # 0x4080
leaq 0x1965(%rip), %rsi      # 0x4014
leaq 0x196a(%rip), %rcx      # 0x4020
movl $0x13, %edx
callq 0x2030
leaq 0x19d0(%rip), %rdi      # 0x4097
leaq 0x1946(%rip), %rsi      # 0x4014
leaq 0x194b(%rip), %rcx      # 0x4020
movl $0x14, %edx
callq 0x2030
leaq 0x1945(%rip), %rdi      # 0x402b
leaq 0x1927(%rip), %rsi      # 0x4014
leaq 0x192c(%rip), %rcx      # 0x4020
movl $0x19, %edx
callq 0x2030
leaq 0x19aa(%rip), %rdi      # 0x40af
leaq 0x1908(%rip), %rsi      # 0x4014
leaq 0x190d(%rip), %rcx      # 0x4020
movl $0x1a, %edx
callq 0x2030
leaq 0x19a3(%rip), %rdi      # 0x40c7
leaq 0x18e9(%rip), %rsi      # 0x4014
leaq 0x18ee(%rip), %rcx      # 0x4020
movl $0x1b, %edx
callq 0x2030
leaq 0x199c(%rip), %rdi      # 0x40df
leaq 0x18ca(%rip), %rsi      # 0x4014
leaq 0x18cf(%rip), %rcx      # 0x4020
movl $0x1e, %edx
callq 0x2030
leaq 0x18c9(%rip), %rdi      # 0x402b
leaq 0x18ab(%rip), %rsi      # 0x4014
leaq 0x18b0(%rip), %rcx      # 0x4020
movl $0x1f, %edx
callq 0x2030
leaq 0x1975(%rip), %rdi      # 0x40f6
leaq 0x188c(%rip), %rsi      # 0x4014
leaq 0x1891(%rip), %rcx      # 0x4020
movl $0x20, %edx
callq 0x2030
leaq 0x198c(%rip), %rdi      # 0x412c
leaq 0x186d(%rip), %rsi      # 0x4014
leaq 0x1872(%rip), %rcx      # 0x4020
movl $0x2a, %edx
callq 0x2030
leaq 0x197d(%rip), %rdi      # 0x413c
leaq 0x184e(%rip), %rsi      # 0x4014
leaq 0x1853(%rip), %rcx      # 0x4020
movl $0x2b, %edx
callq 0x2030
leaq 0x1901(%rip), %rdi      # 0x40df
leaq 0x182f(%rip), %rsi      # 0x4014
leaq 0x1834(%rip), %rcx      # 0x4020
movl $0x2c, %edx
callq 0x2030
leaq 0x1966(%rip), %rdi      # 0x4163
leaq 0x1810(%rip), %rsi      # 0x4014
leaq 0x1815(%rip), %rcx      # 0x4020
movl $0x2d, %edx
callq 0x2030
leaq 0x18c3(%rip), %rdi      # 0x40df
leaq 0x17f1(%rip), %rsi      # 0x4014
leaq 0x17f6(%rip), %rcx      # 0x4020
movl $0x2f, %edx
callq 0x2030
leaq 0x1941(%rip), %rdi      # 0x417c
leaq 0x17d2(%rip), %rsi      # 0x4014
leaq 0x17d7(%rip), %rcx      # 0x4020
movl $0x30, %edx
callq 0x2030
leaq 0x17d1(%rip), %rdi      # 0x402b
leaq 0x17b3(%rip), %rsi      # 0x4014
leaq 0x17b8(%rip), %rcx      # 0x4020
movl $0x31, %edx
callq 0x2030
leaq 0x187d(%rip), %rdi      # 0x40f6
leaq 0x1794(%rip), %rsi      # 0x4014
leaq 0x1799(%rip), %rcx      # 0x4020
movl $0x32, %edx
callq 0x2030