.data
x: .long 0
s: .string "%d\n\0"
.text
.global main
main:
pushl $x
pushl $s
addl $8, %esp
cmp $3, x
jl zero
bsr x, %ecx
xor %eax, %eax
inc %eax
shl %cl, %eax
mov %eax, %ecx
shr %ecx
add %ecx, %eax
sub x, %eax
cdq
xor %edx, %eax
sub %edx, %eax
sub %ecx, %eax
neg %eax
print:
mov %eax, x
pushl x
pushl $s
addl $8, %esp
xor %eax, %eax
ret
zero:
xor %eax, %eax
jmp print
LmRhdGEKeDoJLmxvbmcJMApzOgkuc3RyaW5nICIlZFxuXDAiCi50ZXh0Ci5nbG9iYWwgbWFpbgptYWluOgoJcHVzaGwJJHgKCXB1c2hsCSRzCgljYWxsCXNjYW5mCglhZGRsCSQ4LCAlZXNwCgljbXAJCSQzLCB4CglqbAkJemVybwoJYnNyCQl4LCAlZWN4Cgl4b3IJCSVlYXgsICVlYXgKCWluYwkJJWVheAoJc2hsCQklY2wsICVlYXgKCW1vdgkJJWVheCwgJWVjeAoJc2hyCQklZWN4CglhZGQJCSVlY3gsICVlYXgKCXN1YgkJeCwgJWVheAoJY2RxCgl4b3IJCSVlZHgsICVlYXgKCXN1YgkJJWVkeCwgJWVheAoJc3ViCQklZWN4LCAlZWF4CgluZWcJCSVlYXgKcHJpbnQ6Cgltb3YJCSVlYXgsIHgKCXB1c2hsCXgKCXB1c2hsCSRzCgljYWxsCXByaW50ZgoJYWRkbAkkOCwgJWVzcAoJeG9yCQklZWF4LCAlZWF4CglyZXQKemVybzoKCXhvcgkJJWVheCwgJWVheAoJam1wCQlwcmludA==