nimscript: `VM problem: dest register is set` for top-level `{.discardable.}`s
### Nim Version

Nim Compiler Version 2.1.9 [Linux: amd64]
Compiled at 2024-07-20
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 97f54745459b8651b7a38c174b3a8135224ebd09
active boot switches: -d:release

### Description

```nim
import std/[envvars, os, options, strutils, strformat, tables, cmdline, parseopt, syncio]

proc run*(cmd: string): tuple[output: string, exitCode: int] {.discardable.} = gorgeEx cmd

run "echo hi"
```

### Current Output

```text
$ nim test.nims
Hint: used config file '/home/mado/.choosenim/toolchains/nim-#devel/config/nim.cfg' [Conf]
Hint: used config file '/home/mado/.choosenim/toolchains/nim-#devel/config/config.nims' [Conf]
/home/mado/test.nims(1, 1) Error: VM problem: dest register is set
```

### Expected Output

```text
$ nim test.nims
Hint: used config file '/home/mado/.choosenim/toolchains/nim-#devel/config/nim.cfg' [Conf]
Hint: used config file '/home/mado/.choosenim/toolchains/nim-#devel/config/config.nims' [Conf]
Hint: used config file '/home/mado/test.nims' [Conf]
```

### Known Workarounds

**This is the weird part**. The following code snippets produce the expected output:

- ```nim
  # …
  proc main() =
    run "echo hi"
  main()
  ```
- ```nim
  # …
  discard block:
    run "echo hi"
    0
  ```
- ```nim
  # …
  block:
    run "echo hi"
    echo "test"
  ```
- ```nim
  # …
  proc run*(cmd: string): tuple[output: string, exitCode: int] #[{.discardable.}]# = gorgeEx cmd
  discard run "echo hi"
  ```

**Hypothesis: Nim VM gets confused by top-level `{.discardable.}`s** (hence the title).

Example: this works:
```nim
# …
block:
  run "echo hi"
  echo "test"
```
But this doesn't: (swap the 2 lines in the `block:`)
```nim
# …
block:
  echo "test"
  run "echo hi"
```


### Additional Information

- Same problem on Nim `1.0.0`
- Also tested on latest devel