	.file	1 "gccbug.c"
	.set noat
	.set noreorder
	.arch ev6
.text
	.align 4
	.globl bugy_function
	.ent bugy_function
bugy_function:
	.frame $30,96,$26,0
	.mask 0x400fe00,-96
	ldgp $29,0($27)
$bugy_function..ng:
	lda $30,-96($30)
	stq $18,72($30)
	mov $31,$18
	stq $15,56($30)
	mov $16,$15
	ldq $16,72($30)
	stq $11,24($30)
	stq $12,32($30)
	stq $13,40($30)
	mov $19,$13
	stq $14,48($30)
	stq $26,0($30)
	stq $9,8($30)
	stq $10,16($30)
	.prologue 1
	stq $17,64($30)
	jsr $26,second_external_function
	ldgp $29,0($26)
	ldah $2,1
	mov $0,$12
	lda $2,-4096($2)
	ldl $1,80($12)
	ldq $14,288($12)
	ldq $11,480($12)
	and $1,$2,$1
	zapnot $1,15,$1
	lda $1,-16384($1)
	beq $1,$L782
// here we do the first half of the computation
// and store it on the stack.
	cmpult $31,$13,$1
	stl $1,80($30)
$L783:
	ldl $1,0($11)
	beq $1,$L784
	lda $10,96($14)
	1:	ldl_l	$1,0($10)
	blbs	$1,2f
	or	$1,1,$1
	stl_c	$1,0($10)
	beq	$1,2f
	mb
.subsection 2
2:	ldl	$1,0($10)
	blbs	$1,2b
	br	1b
.previous
	ldq $9,88($14)
	beq $9,$L800
	.align 4
$L787:
	mov $9,$16
	mov $12,$17
	mov $11,$18
	mov $15,$19
	beq $13,$L788
	jsr $26,external_function
	ldgp $29,0($26)
$L788:
	ldq $9,72($9)
	bne $9,$L787
$L800:
	ldq $9,80($14)
	beq $9,$L801
	.align 4
$L792:
	mov $9,$16
	mov $12,$17
	mov $11,$18
	mov $15,$19
	jsr $26,external_function
	ldgp $29,0($26)
	ldq $9,72($9)
	bne $9,$L792
$L801:
	mb
	stl $31,0($10)
$L784:
// here we fetch the first half of the computation
// and use it. The s8addq instruction is missing!
	ldl $18,80($30)
	ldq $16,64($30)
	mov $31,$19
	ldq $17,72($30)
	jsr $26,function_with_wrong_args
	ldgp $29,0($26)
	beq $13,$L797
	br $31,$L783
	.align 4
$L782:
	ldq $16,64($30)
	ldq $17,72($30)
// here we do the whole computation as it should
// be: cmpult + s8addq!
	cmpult $31,$13,$18
	mov $31,$19
	s8addq $18,3,$18
	jsr $26,function_with_wrong_args
	ldgp $29,0($26)
$L797:
	ldq $26,0($30)
	ldq $9,8($30)
	ldq $10,16($30)
	ldq $11,24($30)
	ldq $12,32($30)
	ldq $13,40($30)
	ldq $14,48($30)
	ldq $15,56($30)
	lda $30,96($30)
	ret $31,($26),1
	.end bugy_function
	.ident	"GCC: (GNU) 2.96 20000731 (Red Hat Linux 7.1 2.96-87)"
