.intel_syntax noprefix
/* Wave-9 GAS Intel-syntax acceptance contract for the runtime .S closure
   work: block comments, ';' statement separators, the COFF symbol
   definition family, and quoted .section flags. The same file assembles
   under host GNU as, so the script lane compares emitted COFF symbol
   records against the host reference. Expected exit code: 42. */

.section .rdata,"dr"
table_bytes: .byte 65, 66, 77, 78

.text
.globl main
.def main; .scl 2; .type 32; .endef
main:
    xor ebx, ebx
    movzx eax, byte ptr [rip+table_bytes]
    add ebx, eax
    movzx eax, byte ptr [rip+table_bytes+1]
    add ebx, eax
    movzx eax, byte ptr [rip+table_bytes+2]
    add ebx, eax
    movzx eax, byte ptr [rip+table_bytes+3]
    add ebx, eax
    # 65 + 66 + 77 + 78 = 286
    cmp ebx, 286
    jne fail
    mov eax, 40; add eax, 2
    ret
fail:
    mov eax, 1; ret
