// File: /workspace/github_c_makefile_star2_O2/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:
subq $0x68, %rsp
cmpl $0x0, 0x56d9(%rip)      # 0x7860
jne 0x239e
xorl %edi, %edi
callq 0x2668
testl %eax, %eax
jne 0x23ba
leaq 0x1ea0(%rip), %rax      # 0x4043
movq %rax, 0x58(%rsp)
movq $0x5, 0x60(%rsp)
andl $0x0, 0x48(%rsp)
movups 0x48(%rsp), %xmm0
movups 0x58(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x2696
cmpl $0x1, 0x568b(%rip)      # 0x7860
jne 0x23d6
cmpq $0x5, 0x5695(%rip)      # 0x7878
jne 0x23f2
cmpl $0x0, 0x9680(%rip)      # 0xb870
jne 0x240e
xorl %edi, %edi
callq 0x2668
cmpl $0x1, %eax
jne 0x242a
movl $0x1, 0x9660(%rip)      # 0xb870
xorl %edi, %edi
callq 0x2668
testl %eax, %eax
jne 0x2446
pushq $0x1
popq %rdi
callq 0x2668
cmpl $0x1, %eax
jne 0x2462
pushq $0x2
popq %rdi
callq 0x2668
cmpl $0x1, %eax
jne 0x247e
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0x2759
cmpl $0x2, 0x961e(%rip)      # 0xb870
jne 0x249a
xorl %edi, %edi
callq 0x2668
testl %eax, %eax
jne 0x24b6
pushq $0x1
popq %rdi
callq 0x2668
testl %eax, %eax
jne 0x24d2
pushq $0x2
popq %rdi
callq 0x2668
cmpl $0x1, %eax
jne 0x24ee
pushq $0x3
popq %rdi
callq 0x2668
cmpl $0x1, %eax
jne 0x250a
leaq 0x1e86(%rip), %rax      # 0x4126
movq %rax, 0x38(%rsp)
movq $0x5, 0x40(%rsp)
movl $0xfe, 0x28(%rsp)
movups 0x28(%rsp), %xmm0
movups 0x38(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x2696
cmpl $0x2, 0x558b(%rip)      # 0x7860
jne 0x2526
cmpq $0x5, 0x5595(%rip)      # 0x7878
jne 0x2542
cmpl $0x2, 0x9580(%rip)      # 0xb870
jne 0x255e
cmpl $0xfe, 0x9574(%rip)     # 0xb874
jne 0x257a
pushq $0xa
popq %rdi
pushq $0x3
popq %rsi
callq 0x2759
cmpl $0x2, 0x9558(%rip)      # 0xb870
jne 0x2596
cmpl $0x101, 0x954c(%rip)    # imm = 0x101
jne 0x25b2
xorl %edi, %edi
callq 0x2668
testl %eax, %eax
jne 0x25ce
pushq $0x1
popq %rdi
callq 0x2668
testl %eax, %eax
jne 0x25e7
pushq $0x2
popq %rdi
callq 0x2668
cmpl $0x1, %eax
jne 0x2600
movl $0x100, %edi            # imm = 0x100
callq 0x2668
cmpl $0x1, %eax
jne 0x2619
movl $0x101, %edi            # imm = 0x101
callq 0x2668
cmpl $0x2, %eax
jne 0x2632
movl $0x102, %edi            # imm = 0x102
callq 0x2668
cmpl $0x2, %eax
jne 0x264b
xorl %eax, %eax
addq $0x68, %rsp
retq
leaq 0x1c5f(%rip), %rdi      # 0x4004
leaq 0x1c68(%rip), %rsi      # 0x4014
leaq 0x1c6d(%rip), %rcx      # 0x4020
pushq $0x8
jmp 0x2662
leaq 0x1c6a(%rip), %rdi      # 0x402b
leaq 0x1c4c(%rip), %rsi      # 0x4014
leaq 0x1c51(%rip), %rcx      # 0x4020
pushq $0x9
jmp 0x2662
leaq 0x1c6c(%rip), %rdi      # 0x4049
leaq 0x1c30(%rip), %rsi      # 0x4014
leaq 0x1c35(%rip), %rcx      # 0x4020
pushq $0x11
jmp 0x2662
leaq 0x1c60(%rip), %rdi      # 0x4059
leaq 0x1c14(%rip), %rsi      # 0x4014
leaq 0x1c19(%rip), %rcx      # 0x4020
pushq $0x12
jmp 0x2662
leaq 0x1c6b(%rip), %rdi      # 0x4080
leaq 0x1bf8(%rip), %rsi      # 0x4014
leaq 0x1bfd(%rip), %rcx      # 0x4020
pushq $0x13
jmp 0x2662
leaq 0x1c66(%rip), %rdi      # 0x4097
leaq 0x1bdc(%rip), %rsi      # 0x4014
leaq 0x1be1(%rip), %rcx      # 0x4020
pushq $0x14
jmp 0x2662
leaq 0x1bde(%rip), %rdi      # 0x402b
leaq 0x1bc0(%rip), %rsi      # 0x4014
leaq 0x1bc5(%rip), %rcx      # 0x4020
pushq $0x19
jmp 0x2662
leaq 0x1c46(%rip), %rdi      # 0x40af
leaq 0x1ba4(%rip), %rsi      # 0x4014
leaq 0x1ba9(%rip), %rcx      # 0x4020
pushq $0x1a
jmp 0x2662
leaq 0x1c42(%rip), %rdi      # 0x40c7
leaq 0x1b88(%rip), %rsi      # 0x4014
leaq 0x1b8d(%rip), %rcx      # 0x4020
pushq $0x1b
jmp 0x2662
leaq 0x1c3e(%rip), %rdi      # 0x40df
leaq 0x1b6c(%rip), %rsi      # 0x4014
leaq 0x1b71(%rip), %rcx      # 0x4020
pushq $0x1e
jmp 0x2662
leaq 0x1b6e(%rip), %rdi      # 0x402b
leaq 0x1b50(%rip), %rsi      # 0x4014
leaq 0x1b55(%rip), %rcx      # 0x4020
pushq $0x1f
jmp 0x2662
leaq 0x1c1d(%rip), %rdi      # 0x40f6
leaq 0x1b34(%rip), %rsi      # 0x4014
leaq 0x1b39(%rip), %rcx      # 0x4020
pushq $0x20
jmp 0x2662
leaq 0x1bd2(%rip), %rdi      # 0x40c7
leaq 0x1b18(%rip), %rsi      # 0x4014
leaq 0x1b1d(%rip), %rcx      # 0x4020
pushq $0x21
jmp 0x2662
leaq 0x1bfd(%rip), %rdi      # 0x410e
leaq 0x1afc(%rip), %rsi      # 0x4014
leaq 0x1b01(%rip), %rcx      # 0x4020
pushq $0x22
jmp 0x2662
leaq 0x1bff(%rip), %rdi      # 0x412c
leaq 0x1ae0(%rip), %rsi      # 0x4014
leaq 0x1ae5(%rip), %rcx      # 0x4020
pushq $0x2a
jmp 0x2662
leaq 0x1bf3(%rip), %rdi      # 0x413c
leaq 0x1ac4(%rip), %rsi      # 0x4014
leaq 0x1ac9(%rip), %rcx      # 0x4020
pushq $0x2b
jmp 0x2662
leaq 0x1b7a(%rip), %rdi      # 0x40df
leaq 0x1aa8(%rip), %rsi      # 0x4014
leaq 0x1aad(%rip), %rcx      # 0x4020
pushq $0x2c
jmp 0x2662
leaq 0x1be2(%rip), %rdi      # 0x4163
leaq 0x1a8c(%rip), %rsi      # 0x4014
leaq 0x1a91(%rip), %rcx      # 0x4020
pushq $0x2d
jmp 0x2662
leaq 0x1b42(%rip), %rdi      # 0x40df
leaq 0x1a70(%rip), %rsi      # 0x4014
leaq 0x1a75(%rip), %rcx      # 0x4020
pushq $0x2f
jmp 0x2662
leaq 0x1bc3(%rip), %rdi      # 0x417c
leaq 0x1a54(%rip), %rsi      # 0x4014
leaq 0x1a59(%rip), %rcx      # 0x4020
pushq $0x30
jmp 0x2662
leaq 0x1a56(%rip), %rdi      # 0x402b
leaq 0x1a38(%rip), %rsi      # 0x4014
leaq 0x1a3d(%rip), %rcx      # 0x4020
pushq $0x31
jmp 0x2662
leaq 0x1b08(%rip), %rdi      # 0x40f6
leaq 0x1a1f(%rip), %rsi      # 0x4014
leaq 0x1a24(%rip), %rcx      # 0x4020
pushq $0x32
jmp 0x2662
leaq 0x1ac0(%rip), %rdi      # 0x40c7
leaq 0x1a06(%rip), %rsi      # 0x4014
leaq 0x1a0b(%rip), %rcx      # 0x4020
pushq $0x33
jmp 0x2662
leaq 0x1b75(%rip), %rdi      # 0x4195
leaq 0x19ed(%rip), %rsi      # 0x4014
leaq 0x19f2(%rip), %rcx      # 0x4020
pushq $0x34
jmp 0x2662
leaq 0x1b76(%rip), %rdi      # 0x41af
leaq 0x19d4(%rip), %rsi      # 0x4014
leaq 0x19d9(%rip), %rcx      # 0x4020
pushq $0x35
jmp 0x2662
leaq 0x1b77(%rip), %rdi      # 0x41c9
leaq 0x19bb(%rip), %rsi      # 0x4014
leaq 0x19c0(%rip), %rcx      # 0x4020
pushq $0x36
popq %rdx
callq 0x2030