         Edinburgh IMP77 Compiler - Version 8.4
    1 %begin
		.Ltext0:
				.section	.rodata
		.LC2:
				.string	"\n\nArguments:\n\n"
		.LC3:
				.string	"ARGC = %d\n"
		.LC4:
				.string	"ARGV @[%p]\n"
		.LC5:
				.string	"  ARGV(%d) = \"%s\"\n"
		.LC6:
				.string	"  ARGV(%d) = NULL\n"
		.LC7:
				.string	"\nLocal Variables:\n\n"
		.LC8:
				.string	"SMALLER = \"%.*s\"\n"
		.LC9:
				.string	"LARGER = \"%.*s\"\n"
		main_backtrace.6165:
		.LFB192:
				leal	4(%esp), %ecx
				andl	$-16, %esp
				pushl	-4(%ecx)
				pushl	%ebp
				movl	%esp, %ebp
				pushl	%edi
				pushl	%esi
				pushl	%ebx
				pushl	%ecx
				subl	$2360, %esp
				call	__x86.get_pc_thunk.bx
				addl	$_GLOBAL_OFFSET_TABLE_, %ebx
				movl	%ecx, %eax
				movl	(%eax), %edx
				movl	4(%eax), %eax
				movl	%gs:20, %esi
				movl	%esi, -28(%ebp)
				xorl	%esi, %esi
				leal	8(%ebp), %ecx
				movl	%ecx, -32(%ebp)
				movl	%edx, -560(%ebp)
				movl	%eax, -564(%ebp)
				leal	-564(%ebp), %eax
				addl	$520, %eax
				leal	-564(%ebp), %edx
				movb	$-71, (%eax)
				movl	%edx, 1(%eax)
				movb	$-23, 5(%eax)
				leal	main_backtrace.6165@GOTOFF(%ebx), %ecx
				leal	10(%eax), %edx
				subl	%edx, %ecx
				movl	%ecx, %edx
				movl	%edx, 6(%eax)
		.L8:
				leal	.LC10@GOTOFF(%ebx), %eax
				movl	%eax, -2372(%ebp)
				leal	-564(%ebp), %eax
				addl	$520, %eax
				movl	%eax, -2368(%ebp)
				leal	.L8@GOTOFF(%ebx), %eax
				movl	%eax, -2364(%ebp)
				movl	_imp_current_frame@GOT(%ebx), %eax
				movl	(%eax), %eax
				movl	%eax, -2360(%ebp)
				movl	_imp_current_frame@GOT(%ebx), %eax
				leal	-2372(%ebp), %edx
				movl	%edx, (%eax)
				movl	-560(%ebp), %eax
				movl	-564(%ebp), %edx
				subl	$8, %esp
				pushl	%edx
				pushl	%eax
				call	_imp_initialise@PLT
				addl	$16, %esp
		.LBB9:
    2   %string (15) smaller
    3   %string (63) larger
    4
    5   ! The assignment below should be checked at runtime but not fail
    6   larger="A string"
				leal	-820(%ebp), %eax
				leal	.LC0@GOTOFF(%ebx), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
				leal	-2356(%ebp), %eax
				leal	-820(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
		.LBE9:
				leal	-2100(%ebp), %eax
				leal	-2356(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
				subl	$4, %esp
				pushl	$63
				leal	-2100(%ebp), %eax
				pushl	%eax
				leal	-564(%ebp), %eax
				addl	$8, %eax
				pushl	%eax
				call	_imp_strcpy@PLT
				addl	$16, %esp
    7   smaller = larger
				leal	-1844(%ebp), %eax
				leal	-556(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
				subl	$4, %esp
				pushl	$15
				leal	-1844(%ebp), %eax
				pushl	%eax
				leal	-564(%ebp), %eax
				addl	$264, %eax
				pushl	%eax
				call	_imp_strcpy@PLT
				addl	$16, %esp
    8
    9   ! This should not need to be checked:
   10   larger = smaller
				leal	-1588(%ebp), %eax
				leal	-300(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
				subl	$4, %esp
				pushl	$63
				leal	-1588(%ebp), %eax
				pushl	%eax
				leal	-564(%ebp), %eax
				addl	$8, %eax
				pushl	%eax
				call	_imp_strcpy@PLT
				addl	$16, %esp
		.LBB10:
   11
   12   ! The assignment below should fail at run time
   13   larger="A string that is longer than 15 but less than 63"
				leal	-820(%ebp), %eax
				leal	.LC1@GOTOFF(%ebx), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
				leal	-1332(%ebp), %eax
				leal	-820(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
		.LBE10:
				leal	-1076(%ebp), %eax
				leal	-1332(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
				subl	$4, %esp
				pushl	$63
				leal	-1076(%ebp), %eax
				pushl	%eax
				leal	-564(%ebp), %eax
				addl	$8, %eax
				pushl	%eax
				call	_imp_strcpy@PLT
				addl	$16, %esp
   14   smaller = larger
				leal	-820(%ebp), %eax
				leal	-556(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
				subl	$4, %esp
				pushl	$15
				leal	-820(%ebp), %eax
				pushl	%eax
				leal	-564(%ebp), %eax
				addl	$264, %eax
				pushl	%eax
				call	_imp_strcpy@PLT
				addl	$16, %esp
				movl	$0, -2376(%ebp)
		.LBB11:
		.LBB12:
				subl	$12, %esp
				pushl	-2376(%ebp)
				call	exit@PLT
		.LBE12:
		.LBE11:
		.LFE191:
				.section	.text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
				.globl	__x86.get_pc_thunk.bx
				.hidden	__x86.get_pc_thunk.bx
		__x86.get_pc_thunk.bx:
		.LFB193:
				movl	(%esp), %ebx
				ret
		.LFE193:
		.Letext0:
   15
   16   ! This construct should (erroneously) allow the assignment, but maybe C's Undefined Behaviour checks will catch it at runtime...
   17   ! the STRING map which is declared as %string(*) is treated as if it were a %string(255).
   18
   19 ! STRING(ADDR(smaller)) = larger   { however for the moment, this type of assignment is not being typecast properly in genc.c and so issues an error from C }
   20
   21 %endofprogram
				pushl	%ebp
				movl	%esp, %ebp
				pushl	%esi
				pushl	%ebx
				subl	$32, %esp
				call	__x86.get_pc_thunk.bx
				addl	$_GLOBAL_OFFSET_TABLE_, %ebx
				movl	%ecx, %esi
				movl	%ecx, -28(%ebp)
				movl	%gs:20, %eax
				movl	%eax, -12(%ebp)
				xorl	%eax, %eax
				subl	$12, %esp
				leal	.LC2@GOTOFF(%ebx), %eax
				pushl	%eax
				call	_imp_diagf@PLT
				addl	$16, %esp
				movl	4(%esi), %eax
				subl	$8, %esp
				pushl	%eax
				leal	.LC3@GOTOFF(%ebx), %eax
				pushl	%eax
				call	_imp_diagf@PLT
				addl	$16, %esp
				movl	(%esi), %eax
				subl	$8, %esp
				pushl	%eax
				leal	.LC4@GOTOFF(%ebx), %eax
				pushl	%eax
				call	_imp_diagf@PLT
				addl	$16, %esp
		.LBB8:
				movl	$0, -16(%ebp)
				jmp	.L2
		.L3:
				movl	-16(%ebp), %eax
				leal	0(,%eax,4), %edx
				movl	(%esi), %eax
				addl	%edx, %eax
				movl	(%eax), %eax
				subl	$4, %esp
				pushl	%eax
				pushl	-16(%ebp)
				leal	.LC5@GOTOFF(%ebx), %eax
				pushl	%eax
				call	_imp_diagf@PLT
				addl	$16, %esp
				addl	$1, -16(%ebp)
		.L2:
				movl	4(%esi), %eax
				cmpl	%eax, -16(%ebp)
				jl	.L3
		.LBE8:
				movl	4(%esi), %eax
				leal	0(,%eax,4), %edx
				movl	(%esi), %eax
				addl	%edx, %eax
				movl	(%eax), %eax
				testl	%eax, %eax
				jne	.L4
				movl	4(%esi), %eax
				subl	$8, %esp
				pushl	%eax
				leal	.LC6@GOTOFF(%ebx), %eax
				pushl	%eax
				call	_imp_diagf@PLT
				addl	$16, %esp
				jmp	.L5
		.L4:
				movl	4(%esi), %eax
				leal	0(,%eax,4), %edx
				movl	(%esi), %eax
				addl	%edx, %eax
				movl	(%eax), %edx
				movl	4(%esi), %eax
				subl	$4, %esp
				pushl	%edx
				pushl	%eax
				leal	.LC5@GOTOFF(%ebx), %eax
				pushl	%eax
				call	_imp_diagf@PLT
				addl	$16, %esp
		.L5:
				subl	$12, %esp
				leal	.LC7@GOTOFF(%ebx), %eax
				pushl	%eax
				call	_imp_diagf@PLT
				addl	$16, %esp
				leal	265(%esi), %edx
				movzbl	264(%esi), %eax
				movzbl	%al, %eax
				subl	$4, %esp
				pushl	%edx
				pushl	%eax
				leal	.LC8@GOTOFF(%ebx), %eax
				pushl	%eax
				call	_imp_diagf@PLT
				addl	$16, %esp
				leal	9(%esi), %edx
				movzbl	8(%esi), %eax
				movzbl	%al, %eax
				subl	$4, %esp
				pushl	%edx
				pushl	%eax
				leal	.LC9@GOTOFF(%ebx), %eax
				pushl	%eax
				call	_imp_diagf@PLT
				addl	$16, %esp
				nop
				movl	-12(%ebp), %eax
				xorl	%gs:20, %eax
				je	.L6
				call	__stack_chk_fail_local
		.L6:
				leal	-8(%ebp), %esp
				popl	%ebx
				popl	%esi
				popl	%ebp
				ret
		.LFE192:
				.section	.rodata
		.LC10:
				.string	"main"
				.align 32
		.LC0:
				.byte	8
				.string	"A string"
				.zero	246
				.align 32
		.LC1:
				.byte	48
				.string	"A string that is longer than 15 but less than 63"
				.zero	206
				.globl	main
		main:
		.LFB191:
    9 Statements compiled
