<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 06.09.2023 16:25, Jan Waclawek
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:PC195202309061625500429fefee25f@wekPC">
      <pre class="moz-quote-pre" wrap="">Majme funkcie int InputPin1(void) a int InputPin2(void) ktore vracaju 0
alebo 1 podla stavu vstupneho pinu1 a pinu2. 

Majme:

volatile int k;

if (InputPin1()) goto pin1_active;
if (InputPin2()) {
  pin1_active:
    k = 10;
} else {
    k = 20;
}

Aky je vysledny stav k, ak je pin1 v stave 1, pre obe moznosti pre pin 2?

</pre>
    </blockquote>
    Myslel jsem si, ze vzdy 10. Godbolt rika 10. Nevim, proc by to melo
    byt jinak a co je na tom hardcorove kvizoveho? Samozrejme goto
    doprostred ciziho bloku je zlo a mel by na to byt aspon warning ;)<br>
    <br>
    BTW: -O99<br>
    <div style="color: #000000;background-color: #fffffe;font-family: Consolas, 'Liberation Mono', Courier, monospace, Consolas, 'Courier New', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span style="color: #008080;">InputPin1:</span></div><div><span style="color: #000000;">        </span><span style="color: #0000ff;">mov</span><span style="color: #000000;">     </span><span style="color: #4864aa;">eax</span><span style="color: #000000;">, </span><span style="color: #098658;">1</span></div><div><span style="color: #000000;">        </span><span style="color: #0000ff;">ret</span></div><div><span style="color: #008080;">InputPin2:</span></div><div><span style="color: #000000;">        </span><span style="color: #0000ff;">mov</span><span style="color: #000000;">     </span><span style="color: #4864aa;">eax</span><span style="color: #000000;">, </span><span style="color: #098658;">1</span></div><div><span style="color: #000000;">        </span><span style="color: #0000ff;">ret</span></div><div><span style="color: #008080;">.LC0:</span></div><div><span style="color: #000000;">        </span><span style="color: #0000ff;">.string</span><span style="color: #000000;"> </span><span style="color: #a31515;">"%d\n"</span></div><div><span style="color: #008080;">main:</span></div><div><span style="color: #000000;">        </span><span style="color: #0000ff;">sub</span><span style="color: #000000;">     </span><span style="color: #4864aa;">rsp</span><span style="color: #000000;">, </span><span style="color: #098658;">24</span></div><div><span style="color: #000000;">        </span><span style="color: #0000ff;">mov</span><span style="color: #000000;">     </span><span style="color: #4864aa;">edi</span><span style="color: #000000;">, </span><span style="color: #008080;">OFFSET</span><span style="color: #000000;"> </span><span style="color: #008080;">FLAT</span><span style="color: #000000;">:</span><span style="color: #008080;">.LC0</span></div><div><span style="color: #000000;">        </span><span style="color: #0000ff;">xor</span><span style="color: #000000;">     </span><span style="color: #4864aa;">eax</span><span style="color: #000000;">, </span><span style="color: #4864aa;">eax</span></div><div><span style="color: #000000;">        </span><span style="color: #0000ff;">mov</span><span style="color: #000000;">     </span><span style="color: #808080;">DWORD</span><span style="color: #000000;"> </span><span style="color: #808080;">PTR</span><span style="color: #000000;"> [</span><span style="color: #4864aa;">rsp</span><span style="color: #000000;">+</span><span style="color: #098658;">12</span><span style="color: #000000;">], </span><span style="color: #098658;">10</span></div><div><span style="color: #000000;">        </span><span style="color: #0000ff;">mov</span><span style="color: #000000;">     </span><span style="color: #4864aa;">esi</span><span style="color: #000000;">, </span><span style="color: #808080;">DWORD</span><span style="color: #000000;"> </span><span style="color: #808080;">PTR</span><span style="color: #000000;"> [</span><span style="color: #4864aa;">rsp</span><span style="color: #000000;">+</span><span style="color: #098658;">12</span><span style="color: #000000;">]</span></div><div><span style="color: #000000;">        </span><span style="color: #0000ff;">call</span><span style="color: #000000;">    </span><span style="color: #008080;">printf</span></div><div><span style="color: #000000;">        </span><span style="color: #0000ff;">xor</span><span style="color: #000000;">     </span><span style="color: #4864aa;">eax</span><span style="color: #000000;">, </span><span style="color: #4864aa;">eax</span></div><div><span style="color: #000000;">        </span><span style="color: #0000ff;">add</span><span style="color: #000000;">     </span><span style="color: #4864aa;">rsp</span><span style="color: #000000;">, </span><span style="color: #098658;">24</span></div><div><span style="color: #000000;">        </span><span style="color: #0000ff;">ret</span></div></div>
    <pre class="moz-signature" cols="72">-- 
Jindroush <a class="moz-txt-link-rfc2396E" href="mailto:jindroush@seznam.cz"><jindroush@seznam.cz></a></pre>
  </body>
</html>