<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/54096>54096</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            wrong type conversion(int to uint64_t on x86) under some circumstance
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          versaloon
      </td>
    </tr>
</table>

<pre>
    https://developercommunity.visualstudio.com/t/x86%E4%B8%8Bclang-1300%E7%BC%96%E8%AF%91%E5%99%A8%EF%BC%8Cint%E7%B1%BB%E5%9E%8B%E5%8F%98%E9%87%8F%E4%BD%9C%E4%B8%BA%E5%8F%82%E6%95%B0%E8%BD%ACuint64_t/1669439

MS guys suggest me to issue here.

The first post is in Chinese, translation is blow:

The source code is index-pack.c from a patched git source code, which will cal start_progess in progess.c to display progress of git clone.
struct progress *start_progress(const char *title, uint64_t total);

The 1st picture(in the first post of the issue in microsoft community) is before calling start_progress, red lines are title parameter, yellow lines are total which is nr_objects of int type. All the values are right, nr_objects will be pushed into stack  as a 32-bit value.

The 2nd picture is after calling to start_progress, red lines are for title, yellow lines for total. Here total is 2 32-bit value read from stack, with lower 32-bit value corresponding to nr_objects, and wrong higher 32-bit value(should be zero). And afterwards, clone is OK, but the progress displayed is wrong.

I also tried to implement a simple demo to reproduce the issue, but it seems the issue only exists in the code above. And also there is a BUG in x64|Release, as I mentioned in the MS community. x64|Debug is OK.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9VVmPozgQ_jXkxWpEyAUPeUjS3TOj1WqkPZ5bxhTgGWMjH0lnfv1WmZBrpZGIg13XV1-Vi8rU523n_eCSxS7J3_Gp4QjKDGCF6fugpT-nR-kCV86HWpoUj1HL4--zWCf56m2Jy77ApdgLxXX7Ml9kGQk2JDjgUkY9Utm903ZO2xW9lXRGgrf3Sbk4SO2v5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