#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main(void) {
  unsigned int numeroIniziale;
  float primaCifra = 0;
  float secondaCifra = 0;
  float terzaCifra = 0;
  float quartaCifra = 0;
  unsigned int variabileTermporanea;
  unsigned int valoreSentinella = 0;
  unsigned int sceltaEffettuata = 0;
  printf("%s", "Selezionare la modalita' di utilizzo inserendo il relativo "
               "numero e premendo invio:\n1. Criptazione.\n2. "
               "Decriptazione.\nScelta effettuata: ");
  scanf("%u", &sceltaEffettuata);
  if (sceltaEffettuata == 1) {
    do {
      printf("%s", "Inserire numero da criptare (4 cifre >= 1000): ");
      scanf("%u", &numeroIniziale);
      if (((float)numeroIniziale / 1000) > 0) {
        primaCifra = ((float)numeroIniziale / 1000);
        secondaCifra =
            ((((float)numeroIniziale / 1000) - (int)primaCifra)) * 10;
        terzaCifra = (((((float)numeroIniziale / 1000) - (int)primaCifra)) -
                      (int)secondaCifra) *
                     10;
        quartaCifra = ((((((float)numeroIniziale / 1000) - (int)primaCifra)) -
                        (int)secondaCifra) -
                       (int)terzaCifra) *
                      10;
        valoreSentinella = 1;
      } else {
        puts("Attenzione non e' stato inserito un intero di 4 cifre >= 1000.\n "
             "Ripetere inserimento.");
      }
    } while (valoreSentinella == 0);
    primaCifra += (unsigned int)7;
    secondaCifra += (unsigned int)7;
    terzaCifra += (unsigned int)7;
    quartaCifra += (unsigned int)7;
    primaCifra = ((unsigned int)primaCifra % (unsigned int)10);
    secondaCifra = ((unsigned int)secondaCifra % (unsigned int)10);
    terzaCifra = ((unsigned int)terzaCifra % (unsigned int)10);
    quartaCifra = ((unsigned int)quartaCifra % (unsigned int)10);
    variabileTermporanea = primaCifra;
    primaCifra = terzaCifra;
    terzaCifra = variabileTermporanea;
    variabileTermporanea = secondaCifra;
    secondaCifra = quartaCifra;
    quartaCifra = variabileTermporanea;
    if (primaCifra == 0) {
      if (secondaCifra == 0) {
        if (terzaCifra == 0) {
          if (quartaCifra == 0) {
            puts("\nIl numero criptato e': 0000");
          } else {
            printf("\nIl numero criptato e': 000%u\n",
                   (unsigned int)quartaCifra);
          }
        } else {
          printf("\nIl numero criptato e': 00%u%u\n", (unsigned int)terzaCifra,
                 (unsigned int)quartaCifra);
        }
      } else {
        printf("\nIl numero criptato e': 0%u%u%u\n", (unsigned int)secondaCifra,
               (unsigned int)terzaCifra, (unsigned int)quartaCifra);
      }
    } else {
      printf("\nIl numero criptato e': %u%u%u%u\n", (unsigned int)primaCifra,
             (unsigned int)secondaCifra, (unsigned int)terzaCifra,
             (unsigned int)quartaCifra);
    }
  } else if (sceltaEffettuata == 2) {
    do {
      printf("%s",
             "Inserire numero da decriptare (4 cifre compresi gli zeri): ");
      scanf("%u", &numeroIniziale);
      if (numeroIniziale <= 9999) {
        if (numeroIniziale <= 9) {
          primaCifra = 0;
          secondaCifra = 0;
          terzaCifra = 0;
          quartaCifra = (numeroIniziale);
          valoreSentinella = 1;
        } else if (numeroIniziale <= 99) {
          primaCifra = 0;
          secondaCifra = 0;
          terzaCifra = (numeroIniziale / 10);
          quartaCifra = (((float)numeroIniziale / 10) - terzaCifra) * 10;
          valoreSentinella = 1;
          printf("\n%f\n%f\n%f\n%f\n", primaCifra, secondaCifra, terzaCifra,
                 quartaCifra);
        } else if (numeroIniziale <= 999) {
          primaCifra = 0;
          secondaCifra = (numeroIniziale / 100);
          terzaCifra = (((float)numeroIniziale / 100) - terzaCifra) * 10;
          quartaCifra =
              ((((float)numeroIniziale / 100) - terzaCifra) - quartaCifra) * 10;
          valoreSentinella = 1;
        } else if (numeroIniziale <= 9999) {
          primaCifra = ((float)numeroIniziale / 1000);
          secondaCifra = (((float)numeroIniziale / 1000) - primaCifra) * 10;
          terzaCifra =
              ((((float)numeroIniziale / 1000) - primaCifra) - secondaCifra) *
              10;
          quartaCifra =
              (((((float)numeroIniziale / 1000) - primaCifra) - secondaCifra) -
               terzaCifra) *
              10;
          valoreSentinella = 1;
        }
      } else {
        puts("Attenzione non e' stato inserito un numero valido.\n Ripetere "
             "inserimento.");
      }
    } while (valoreSentinella == 0);
    variabileTermporanea = primaCifra;
    primaCifra = terzaCifra;
    terzaCifra = variabileTermporanea;
    variabileTermporanea = secondaCifra;
    secondaCifra = quartaCifra;
    quartaCifra = variabileTermporanea;
    if (primaCifra == 0) {
      primaCifra = (int)10;
    }
    if (secondaCifra == 0) {
      secondaCifra = (int)10;
    }
    if (terzaCifra == 0) {
      terzaCifra = (int)10;
    }
    if (quartaCifra == 0) {
      quartaCifra = (int)10;
    }
    primaCifra -= (unsigned int)7;
    secondaCifra -= (unsigned int)7;
    terzaCifra -= (unsigned int)7;
    quartaCifra -= (unsigned int)7;
    if (primaCifra == 0) {
      if (secondaCifra == 0) {
        if (terzaCifra == 0) {
          if (quartaCifra == 0) {
            puts("\nIl numero criptato e': 0000");
          } else {
            printf("\nIl numero criptato e': 000%u\n",
                   (unsigned int)quartaCifra);
          }
        } else {
          printf("\nIl numero criptato e': 00%u%u\n", (unsigned int)terzaCifra,
                 (unsigned int)quartaCifra);
        }
      } else {
        printf("\nIl numero criptato e': 0%u%u%u\n", (unsigned int)secondaCifra,
               (unsigned int)terzaCifra, (unsigned int)quartaCifra);
      }
    } else {
      printf("\nIl numero criptato e': %u%u%u%u\n", (unsigned int)primaCifra,
             (unsigned int)secondaCifra, (unsigned int)terzaCifra,
             (unsigned int)quartaCifra);
    }
  } else {
    puts("E' stato inserito un valore non valido (la scelta era 1 o 2) il "
         "programma verra' terminato");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe9c(%rip),%rdi
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf14(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x1,-0x24(%rbp)
jne    14f3 <main+0x3c3>
jmp    11a1 <main+0x71>
lea    0xe68(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xe2e(%rip),%xmm1
divss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    12b9 <main+0x189>
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xe0e(%rip),%xmm2
divss  %xmm2,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
divss  %xmm2,%xmm0
movss  -0xc(%rbp),%xmm1
cvttps2dq %xmm1,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
movss  0xddd(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
divss  %xmm2,%xmm0
movss  -0xc(%rbp),%xmm2
cvttps2dq %xmm2,%xmm2
cvtdq2ps %xmm2,%xmm2
subss  %xmm2,%xmm0
movss  -0x10(%rbp),%xmm2
cvttps2dq %xmm2,%xmm2
cvtdq2ps %xmm2,%xmm2
subss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xd93(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
cvttss2si -0x10(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
cvttss2si -0x14(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
movss  0xd5c(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
jmp    12c5 <main+0x195>
lea    0xe10(%rip),%rdi
call   1030 <puts@plt>
jmp    12ca <main+0x19a>
cmpl   $0x0,-0x20(%rbp)
je     11a1 <main+0x71>
movss  -0xc(%rbp),%xmm0
movss  0xd2b(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x14(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x18(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
cvttss2si -0xc(%rbp),%rax
mov    %eax,%ecx
mov    $0xcccccccd,%edx
imul   %rdx,%rcx
shr    $0x23,%rcx
mov    %ecx,%esi
add    %esi,%esi
mov    %esi,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
cvttss2si -0x10(%rbp),%rax
mov    %eax,%ecx
imul   %rdx,%rcx
shr    $0x23,%rcx
mov    %ecx,%esi
add    %esi,%esi
mov    %esi,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
cvttss2si -0x14(%rbp),%rax
mov    %eax,%ecx
imul   %rdx,%rcx
shr    $0x23,%rcx
mov    %ecx,%esi
add    %esi,%esi
mov    %esi,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
cvttss2si -0x18(%rbp),%rax
mov    %eax,%ecx
imul   %rdx,%rcx
shr    $0x23,%rcx
mov    %ecx,%edx
add    %edx,%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
cvttss2si -0xc(%rbp),%rax
mov    %eax,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x1c(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x14(%rbp)
cvttss2si -0x10(%rbp),%rax
mov    %eax,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    14bf <main+0x38f>
jp     14bf <main+0x38f>
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1494 <main+0x364>
jp     1494 <main+0x364>
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1471 <main+0x341>
jp     1471 <main+0x341>
movss  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1456 <main+0x326>
jp     1456 <main+0x326>
lea    0xcda(%rip),%rdi
call   1030 <puts@plt>
jmp    146c <main+0x33c>
cvttss2si -0x18(%rbp),%rax
mov    %eax,%esi
lea    0xcde(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    148f <main+0x35f>
cvttss2si -0x14(%rbp),%rax
mov    %eax,%esi
cvttss2si -0x18(%rbp),%rax
mov    %eax,%edx
lea    0xcda(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    14ba <main+0x38a>
cvttss2si -0x10(%rbp),%rax
mov    %eax,%esi
cvttss2si -0x14(%rbp),%rax
mov    %eax,%edx
cvttss2si -0x18(%rbp),%rax
mov    %eax,%ecx
lea    0xccf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    14ee <main+0x3be>
cvttss2si -0xc(%rbp),%rax
mov    %eax,%esi
cvttss2si -0x10(%rbp),%rax
mov    %eax,%edx
cvttss2si -0x14(%rbp),%rax
mov    %eax,%ecx
cvttss2si -0x18(%rbp),%rax
mov    %eax,%r8d
lea    0xcbc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    19b9 <main+0x889>
cmpl   $0x2,-0x24(%rbp)
jne    19a8 <main+0x878>
jmp    1502 <main+0x3d2>
lea    0xb07(%rip),%rdi
lea    0xcb5(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xb7f(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x270f,-0x8(%rbp)
ja     175b <main+0x62b>
cmpl   $0x9,-0x8(%rbp)
ja     156c <main+0x43c>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
jmp    1756 <main+0x626>
cmpl   $0x63,-0x8(%rbp)
ja     1605 <main+0x4d5>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xcccccccd,%ecx
imul   %rcx,%rax
shr    $0x23,%rax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xa53(%rip),%xmm1
divss  %xmm1,%xmm0
subss  -0x14(%rbp),%xmm0
movss  0xa42(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x18(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
lea    0xc08(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
jmp    1751 <main+0x621>
cmpl   $0x3e7,-0x8(%rbp)
ja     1699 <main+0x569>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0x9c8(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  0x9ab(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0x99a(%rip),%xmm1
divss  %xmm1,%xmm0
subss  -0x14(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
movss  0x97c(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
jmp    174c <main+0x61c>
cmpl   $0x270f,-0x8(%rbp)
ja     1747 <main+0x617>
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0x94e(%rip),%xmm2
divss  %xmm2,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
divss  %xmm2,%xmm0
movss  -0xc(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  0x924(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
divss  %xmm2,%xmm0
movss  -0xc(%rbp),%xmm2
subss  %xmm2,%xmm0
movss  -0x10(%rbp),%xmm2
subss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0x8e8(%rip),%xmm1
divss  %xmm1,%xmm0
subss  -0xc(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  0x8c9(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
jmp    174c <main+0x61c>
jmp    1751 <main+0x621>
jmp    1756 <main+0x626>
jmp    1767 <main+0x637>
lea    0xaad(%rip),%rdi
call   1030 <puts@plt>
jmp    176c <main+0x63c>
cmpl   $0x0,-0x20(%rbp)
je     1502 <main+0x3d2>
cvttss2si -0xc(%rbp),%rax
mov    %eax,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x1c(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x14(%rbp)
cvttss2si -0x10(%rbp),%rax
mov    %eax,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    17da <main+0x6aa>
jp     17da <main+0x6aa>
movss  0x82b(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    17fe <main+0x6ce>
jp     17fe <main+0x6ce>
movss  0x807(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1822 <main+0x6f2>
jp     1822 <main+0x6f2>
movss  0x7e3(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1846 <main+0x716>
jp     1846 <main+0x716>
movss  0x7bf(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0x7b9(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0x7a3(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0x78d(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x18(%rbp),%xmm0
movss  0x777(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1974 <main+0x844>
jp     1974 <main+0x844>
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1949 <main+0x819>
jp     1949 <main+0x819>
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1926 <main+0x7f6>
jp     1926 <main+0x7f6>
movss  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    190b <main+0x7db>
jp     190b <main+0x7db>
lea    0x825(%rip),%rdi
call   1030 <puts@plt>
jmp    1921 <main+0x7f1>
cvttss2si -0x18(%rbp),%rax
mov    %eax,%esi
lea    0x829(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1944 <main+0x814>
cvttss2si -0x14(%rbp),%rax
mov    %eax,%esi
cvttss2si -0x18(%rbp),%rax
mov    %eax,%edx
lea    0x825(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    196f <main+0x83f>
cvttss2si -0x10(%rbp),%rax
mov    %eax,%esi
cvttss2si -0x14(%rbp),%rax
mov    %eax,%edx
cvttss2si -0x18(%rbp),%rax
mov    %eax,%ecx
lea    0x81a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    19a3 <main+0x873>
cvttss2si -0xc(%rbp),%rax
mov    %eax,%esi
cvttss2si -0x10(%rbp),%rax
mov    %eax,%edx
cvttss2si -0x14(%rbp),%rax
mov    %eax,%ecx
cvttss2si -0x18(%rbp),%rax
mov    %eax,%r8d
lea    0x807(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    19b4 <main+0x884>
lea    0x8aa(%rip),%rdi
call   1030 <puts@plt>
jmp    19b9 <main+0x889>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
movl   $0x0,0xc(%rsp)
lea    0xecc(%rip),%rdi
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf44(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x1,%eax
je     1228 <main+0xf8>
cmp    $0x2,%eax
jne    13bd <main+0x28d>
lea    0xe90(%rip),%rdi
lea    0x103e(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf08(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
cmp    $0x2710,%eax
jb     120b <main+0xdb>
lea    0x105e(%rip),%r14
lea    0xe58(%rip),%r15
lea    0x1006(%rip),%r12
lea    0xed7(%rip),%r13
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
cmp    $0x2710,%eax
jae    11e0 <main+0xb0>
cmp    $0x9,%eax
ja     13ce <main+0x29e>
mov    %eax,%eax
cvtsi2ss %rax,%xmm6
xorps  %xmm0,%xmm0
xor    %ecx,%ecx
xorps  %xmm7,%xmm7
jmp    14ec <main+0x3bc>
lea    0xde9(%rip),%rdi
lea    0xe72(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe61(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
cvtsi2ss %rax,%xmm2
divss  0xda1(%rip),%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm2
ja     12cc <main+0x19c>
lea    0xe6a(%rip),%r14
lea    0xda3(%rip),%r15
lea    0xe2c(%rip),%r12
lea    0xe22(%rip),%r13
lea    0x8(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
xorps  %xmm0,%xmm0
mov    0x8(%rsp),%eax
xorps  %xmm2,%xmm2
cvtsi2ss %rax,%xmm2
divss  0xd39(%rip),%xmm2
ucomiss %xmm0,%xmm2
jbe    1290 <main+0x160>
cvttps2dq %xmm2,%xmm0
cvtdq2ps %xmm0,%xmm1
movaps %xmm2,%xmm0
subss  %xmm1,%xmm0
movss  0xd22(%rip),%xmm3
movaps %xmm0,%xmm4
mulss  %xmm3,%xmm4
cvttps2dq %xmm4,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
movaps %xmm0,%xmm1
mulss  %xmm3,%xmm1
cvttps2dq %xmm1,%xmm5
cvtdq2ps %xmm5,%xmm5
subss  %xmm5,%xmm0
mulss  %xmm3,%xmm0
movss  0xd02(%rip),%xmm3
addss  %xmm3,%xmm2
addss  %xmm3,%xmm4
cvttss2si %xmm2,%rcx
mov    %ecx,%edx
mov    $0xcccccccd,%eax
imul   %rax,%rdx
shr    $0x23,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
xorps  %xmm2,%xmm2
cvtsi2ss %ecx,%xmm2
addss  %xmm3,%xmm1
cvttss2si %xmm4,%rcx
mov    %ecx,%edx
imul   %rax,%rdx
shr    $0x23,%rdx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
xorps  %xmm4,%xmm4
cvtsi2ss %ecx,%xmm4
addss  %xmm3,%xmm0
cvttss2si %xmm1,%rdx
mov    %edx,%edi
imul   %rax,%rdi
cvttss2si %xmm0,%rsi
mov    %esi,%ecx
imul   %rax,%rcx
shr    $0x23,%rcx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%eax
sub    %eax,%esi
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
shr    $0x23,%rdi
add    %edi,%edi
cvttss2si %xmm2,%rcx
lea    (%rdi,%rdi,4),%eax
cvttss2si %xmm4,%r8
sub    %eax,%edx
je     1438 <main+0x308>
mov    %edx,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
cvttss2si %xmm1,%rsi
cvttss2si %xmm0,%rdx
jmp    159d <main+0x46d>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
jmp    160a <main+0x4da>
cmp    $0x63,%eax
ja     1452 <main+0x322>
movzbl %al,%ecx
imul   $0xcd,%ecx,%ecx
shr    $0xb,%ecx
cvtsi2ss %ecx,%xmm1
movaps %xmm1,0x20(%rsp)
mov    %eax,%eax
cvtsi2ss %rax,%xmm3
movss  0xc0d(%rip),%xmm0
divss  %xmm0,%xmm3
subss  %xmm1,%xmm3
mulss  %xmm0,%xmm3
movaps %xmm3,0x10(%rsp)
cvtsi2sd %ecx,%xmm2
cvtss2sd %xmm3,%xmm3
lea    0xdf2(%rip),%rdi
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    $0x4,%al
call   1040 <printf@plt>
movaps 0x20(%rsp),%xmm7
movaps 0x10(%rsp),%xmm6
xorps  %xmm0,%xmm0
xor    %ecx,%ecx
jmp    14ec <main+0x3bc>
test   %esi,%esi
je     1496 <main+0x366>
cvttss2si %xmm0,%rsi
lea    0xd42(%rip),%rdi
mov    %ecx,%edx
mov    %r8d,%ecx
jmp    15c3 <main+0x493>
cmp    $0x3e7,%eax
ja     14af <main+0x37f>
movzwl %ax,%ecx
shr    $0x2,%ecx
imul   $0x147b,%ecx,%ecx
shr    $0x11,%ecx
cvtsi2ss %ecx,%xmm0
mov    %eax,%eax
cvtsi2ss %rax,%xmm6
divss  0xb8d(%rip),%xmm6
movss  0xb81(%rip),%xmm1
movaps %xmm6,%xmm7
mulss  %xmm1,%xmm7
subss  %xmm7,%xmm6
mulss  %xmm1,%xmm6
xor    %ecx,%ecx
jmp    14ec <main+0x3bc>
test   %ecx,%ecx
je     15f4 <main+0x4c4>
lea    0xcc5(%rip),%rdi
mov    %ecx,%esi
mov    %r8d,%edx
jmp    15dd <main+0x4ad>
mov    %eax,%eax
cvtsi2ss %rax,%xmm0
divss  0xb42(%rip),%xmm0
cvttss2si %xmm0,%rcx
movaps %xmm0,%xmm6
subss  %xmm0,%xmm6
movss  0xb32(%rip),%xmm1
movaps %xmm6,%xmm0
mulss  %xmm1,%xmm0
subss  %xmm0,%xmm6
movaps %xmm6,%xmm7
mulss  %xmm1,%xmm7
subss  %xmm7,%xmm6
mulss  %xmm1,%xmm6
cvttss2si %xmm0,%rax
movss  0xb13(%rip),%xmm2
movss  0xb0f(%rip),%xmm0
movaps %xmm0,%xmm1
test   %ecx,%ecx
je     1516 <main+0x3e6>
mov    %ecx,%ecx
xorps  %xmm1,%xmm1
cvtsi2ss %rcx,%xmm1
addss  %xmm2,%xmm1
movaps %xmm7,%xmm4
addss  %xmm2,%xmm4
xorps  %xmm3,%xmm3
cmpeqss %xmm3,%xmm7
movaps %xmm7,%xmm5
andnps %xmm4,%xmm5
andps  %xmm0,%xmm7
orps   %xmm5,%xmm7
movaps %xmm6,%xmm4
addss  %xmm2,%xmm4
cmpeqss %xmm3,%xmm6
movaps %xmm6,%xmm5
andnps %xmm4,%xmm5
andps  %xmm0,%xmm6
orps   %xmm5,%xmm6
test   %eax,%eax
je     155b <main+0x42b>
mov    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  %xmm2,%xmm0
ucomiss %xmm3,%xmm7
jne    1589 <main+0x459>
jp     1589 <main+0x459>
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm6
jne    15ad <main+0x47d>
jp     15ad <main+0x47d>
ucomiss %xmm2,%xmm1
jne    15cc <main+0x49c>
jp     15cc <main+0x49c>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    15e6 <main+0x4b6>
jp     15e6 <main+0x4b6>
lea    0xbaa(%rip),%rdi
jmp    13c4 <main+0x294>
cvttss2si %xmm7,%rsi
cvttss2si %xmm6,%rdx
cvttss2si %xmm1,%rcx
cvttss2si %xmm0,%r8
lea    0xc07(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    160a <main+0x4da>
cvttss2si %xmm6,%rsi
cvttss2si %xmm1,%rdx
cvttss2si %xmm0,%rcx
lea    0xbc7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    160a <main+0x4da>
cvttss2si %xmm1,%rsi
cvttss2si %xmm0,%rdx
lea    0xb8d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    160a <main+0x4da>
cvttss2si %xmm0,%rsi
lea    0xb59(%rip),%rdi
jmp    1603 <main+0x4d3>
test   %r8d,%r8d
je     157d <main+0x44d>
lea    0xb4b(%rip),%rdi
mov    %r8d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [138 x i8] c"Selezionare la modalita' di utilizzo inserendo il relativo numero e premendo invio:\0A1. Criptazione.\0A2. Decriptazione.\0AScelta effettuata: \00"
@.str.2 = [3 x i8] c"%u\00"
@.str.3 = [48 x i8] c"Inserire numero da criptare (4 cifre >= 1000): \00"
@.str.4 = [86 x i8] c"Attenzione non e' stato inserito un intero di 4 cifre >= 1000.\0A Ripetere inserimento.\00"
@.str.5 = [29 x i8] c"\0AIl numero criptato e': 0000\00"
@.str.6 = [31 x i8] c"\0AIl numero criptato e': 000%u\0A\00"
@.str.7 = [32 x i8] c"\0AIl numero criptato e': 00%u%u\0A\00"
@.str.8 = [33 x i8] c"\0AIl numero criptato e': 0%u%u%u\0A\00"
@.str.9 = [34 x i8] c"\0AIl numero criptato e': %u%u%u%u\0A\00"
@.str.10 = [60 x i8] c"Inserire numero da decriptare (4 cifre compresi gli zeri): \00"
@.str.11 = [14 x i8] c"\0A%f\0A%f\0A%f\0A%f\0A\00"
@.str.12 = [74 x i8] c"Attenzione non e' stato inserito un numero valido.\0A Ripetere inserimento.\00"
@.str.13 = [91 x i8] c"E' stato inserito un valore non valido (la scelta era 1 o 2) il programma verra' terminato\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
store i32 0, i32* %8
store i32 0, i32* %9
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %9)
%12 = load i32, i32* %9
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %148
14: ; preds = %0
br label %15
15: ; preds = %65, %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%18 = load i32, i32* %2
%19 = uitofp i32 %18 to float
%20 = fdiv float %19, 1.000000e+03
%21 = fcmp ogt float %20, 0.000000e+00
br i1 %21, label %22, label %62
22: ; preds = %15
%23 = load i32, i32* %2
%24 = uitofp i32 %23 to float
%25 = fdiv float %24, 1.000000e+03
store float %25, float* %3
%26 = load i32, i32* %2
%27 = uitofp i32 %26 to float
%28 = fdiv float %27, 1.000000e+03
%29 = load float, float* %3
%30 = fptosi float %29 to i32
%31 = sitofp i32 %30 to float
%32 = fsub float %28, %31
%33 = fmul float %32, 1.000000e+01
store float %33, float* %4
%34 = load i32, i32* %2
%35 = uitofp i32 %34 to float
%36 = fdiv float %35, 1.000000e+03
%37 = load float, float* %3
%38 = fptosi float %37 to i32
%39 = sitofp i32 %38 to float
%40 = fsub float %36, %39
%41 = load float, float* %4
%42 = fptosi float %41 to i32
%43 = sitofp i32 %42 to float
%44 = fsub float %40, %43
%45 = fmul float %44, 1.000000e+01
store float %45, float* %5
%46 = load i32, i32* %2
%47 = uitofp i32 %46 to float
%48 = fdiv float %47, 1.000000e+03
%49 = load float, float* %3
%50 = fptosi float %49 to i32
%51 = sitofp i32 %50 to float
%52 = fsub float %48, %51
%53 = load float, float* %4
%54 = fptosi float %53 to i32
%55 = sitofp i32 %54 to float
%56 = fsub float %52, %55
%57 = load float, float* %5
%58 = fptosi float %57 to i32
%59 = sitofp i32 %58 to float
%60 = fsub float %56, %59
%61 = fmul float %60, 1.000000e+01
store float %61, float* %6
store i32 1, i32* %8
br label %64
62: ; preds = %15
%63 = call i32 @puts(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.4, i64 0, i64 0))
br label %64
64: ; preds = %62, %22
br label %65
65: ; preds = %64
%66 = load i32, i32* %8
%67 = icmp eq i32 %66, 0
br i1 %67, label %15, label %68
68: ; preds = %65
%69 = load float, float* %3
%70 = fadd float %69, 7.000000e+00
store float %70, float* %3
%71 = load float, float* %4
%72 = fadd float %71, 7.000000e+00
store float %72, float* %4
%73 = load float, float* %5
%74 = fadd float %73, 7.000000e+00
store float %74, float* %5
%75 = load float, float* %6
%76 = fadd float %75, 7.000000e+00
store float %76, float* %6
%77 = load float, float* %3
%78 = fptoui float %77 to i32
%79 = urem i32 %78, 10
%80 = uitofp i32 %79 to float
store float %80, float* %3
%81 = load float, float* %4
%82 = fptoui float %81 to i32
%83 = urem i32 %82, 10
%84 = uitofp i32 %83 to float
store float %84, float* %4
%85 = load float, float* %5
%86 = fptoui float %85 to i32
%87 = urem i32 %86, 10
%88 = uitofp i32 %87 to float
store float %88, float* %5
%89 = load float, float* %6
%90 = fptoui float %89 to i32
%91 = urem i32 %90, 10
%92 = uitofp i32 %91 to float
store float %92, float* %6
%93 = load float, float* %3
%94 = fptoui float %93 to i32
store i32 %94, i32* %7
%95 = load float, float* %5
store float %95, float* %3
%96 = load i32, i32* %7
%97 = uitofp i32 %96 to float
store float %97, float* %5
%98 = load float, float* %4
%99 = fptoui float %98 to i32
store i32 %99, i32* %7
%100 = load float, float* %6
store float %100, float* %4
%101 = load i32, i32* %7
%102 = uitofp i32 %101 to float
store float %102, float* %6
%103 = load float, float* %3
%104 = fcmp oeq float %103, 0.000000e+00
br i1 %104, label %105, label %137
105: ; preds = %68
%106 = load float, float* %4
%107 = fcmp oeq float %106, 0.000000e+00
br i1 %107, label %108, label %128
108: ; preds = %105
%109 = load float, float* %5
%110 = fcmp oeq float %109, 0.000000e+00
br i1 %110, label %111, label %121
111: ; preds = %108
%112 = load float, float* %6
%113 = fcmp oeq float %112, 0.000000e+00
br i1 %113, label %114, label %116
114: ; preds = %111
%115 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
br label %120
116: ; preds = %111
%117 = load float, float* %6
%118 = fptoui float %117 to i32
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i32 %118)
br label %120
120: ; preds = %116, %114
br label %127
121: ; preds = %108
%122 = load float, float* %5
%123 = fptoui float %122 to i32
%124 = load float, float* %6
%125 = fptoui float %124 to i32
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i32 %123, i32 %125)
br label %127
127: ; preds = %121, %120
br label %136
128: ; preds = %105
%129 = load float, float* %4
%130 = fptoui float %129 to i32
%131 = load float, float* %5
%132 = fptoui float %131 to i32
%133 = load float, float* %6
%134 = fptoui float %133 to i32
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 %130, i32 %132, i32 %134)
br label %136
136: ; preds = %128, %127
br label %147
137: ; preds = %68
%138 = load float, float* %3
%139 = fptoui float %138 to i32
%140 = load float, float* %4
%141 = fptoui float %140 to i32
%142 = load float, float* %5
%143 = fptoui float %142 to i32
%144 = load float, float* %6
%145 = fptoui float %144 to i32
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i32 %139, i32 %141, i32 %143, i32 %145)
br label %147
147: ; preds = %137, %136
br label %330
148: ; preds = %0
%149 = load i32, i32* %9
%150 = icmp eq i32 %149, 2
br i1 %150, label %151, label %327
151: ; preds = %148
br label %152
152: ; preds = %244, %151
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.10, i64 0, i64 0))
%154 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%155 = load i32, i32* %2
%156 = icmp ule i32 %155, 9999
br i1 %156, label %157, label %241
157: ; preds = %152
%158 = load i32, i32* %2
%159 = icmp ule i32 %158, 9
br i1 %159, label %160, label %163
160: ; preds = %157
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %5
%161 = load i32, i32* %2
%162 = uitofp i32 %161 to float
store float %162, float* %6
store i32 1, i32* %8
br label %240
163: ; preds = %157
%164 = load i32, i32* %2
%165 = icmp ule i32 %164, 99
br i1 %165, label %166, label %185
166: ; preds = %163
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %4
%167 = load i32, i32* %2
%168 = udiv i32 %167, 10
%169 = uitofp i32 %168 to float
store float %169, float* %5
%170 = load i32, i32* %2
%171 = uitofp i32 %170 to float
%172 = fdiv float %171, 1.000000e+01
%173 = load float, float* %5
%174 = fsub float %172, %173
%175 = fmul float %174, 1.000000e+01
store float %175, float* %6
store i32 1, i32* %8
%176 = load float, float* %3
%177 = fpext float %176 to double
%178 = load float, float* %4
%179 = fpext float %178 to double
%180 = load float, float* %5
%181 = fpext float %180 to double
%182 = load float, float* %6
%183 = fpext float %182 to double
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), double %177, double %179, double %181, double %183)
br label %239
185: ; preds = %163
%186 = load i32, i32* %2
%187 = icmp ule i32 %186, 999
br i1 %187, label %188, label %206
188: ; preds = %185
store float 0.000000e+00, float* %3
%189 = load i32, i32* %2
%190 = udiv i32 %189, 100
%191 = uitofp i32 %190 to float
store float %191, float* %4
%192 = load i32, i32* %2
%193 = uitofp i32 %192 to float
%194 = fdiv float %193, 1.000000e+02
%195 = load float, float* %5
%196 = fsub float %194, %195
%197 = fmul float %196, 1.000000e+01
store float %197, float* %5
%198 = load i32, i32* %2
%199 = uitofp i32 %198 to float
%200 = fdiv float %199, 1.000000e+02
%201 = load float, float* %5
%202 = fsub float %200, %201
%203 = load float, float* %6
%204 = fsub float %202, %203
%205 = fmul float %204, 1.000000e+01
store float %205, float* %6
store i32 1, i32* %8
br label %238
206: ; preds = %185
%207 = load i32, i32* %2
%208 = icmp ule i32 %207, 9999
br i1 %208, label %209, label %237
209: ; preds = %206
%210 = load i32, i32* %2
%211 = uitofp i32 %210 to float
%212 = fdiv float %211, 1.000000e+03
store float %212, float* %3
%213 = load i32, i32* %2
%214 = uitofp i32 %213 to float
%215 = fdiv float %214, 1.000000e+03
%216 = load float, float* %3
%217 = fsub float %215, %216
%218 = fmul float %217, 1.000000e+01
store float %218, float* %4
%219 = load i32, i32* %2
%220 = uitofp i32 %219 to float
%221 = fdiv float %220, 1.000000e+03
%222 = load float, float* %3
%223 = fsub float %221, %222
%224 = load float, float* %4
%225 = fsub float %223, %224
%226 = fmul float %225, 1.000000e+01
store float %226, float* %5
%227 = load i32, i32* %2
%228 = uitofp i32 %227 to float
%229 = fdiv float %228, 1.000000e+03
%230 = load float, float* %3
%231 = fsub float %229, %230
%232 = load float, float* %4
%233 = fsub float %231, %232
%234 = load float, float* %5
%235 = fsub float %233, %234
%236 = fmul float %235, 1.000000e+01
store float %236, float* %6
store i32 1, i32* %8
br label %237
237: ; preds = %209, %206
br label %238
238: ; preds = %237, %188
br label %239
239: ; preds = %238, %166
br label %240
240: ; preds = %239, %160
br label %243
241: ; preds = %152
%242 = call i32 @puts(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.12, i64 0, i64 0))
br label %243
243: ; preds = %241, %240
br label %244
244: ; preds = %243
%245 = load i32, i32* %8
%246 = icmp eq i32 %245, 0
br i1 %246, label %152, label %247
247: ; preds = %244
%248 = load float, float* %3
%249 = fptoui float %248 to i32
store i32 %249, i32* %7
%250 = load float, float* %5
store float %250, float* %3
%251 = load i32, i32* %7
%252 = uitofp i32 %251 to float
store float %252, float* %5
%253 = load float, float* %4
%254 = fptoui float %253 to i32
store i32 %254, i32* %7
%255 = load float, float* %6
store float %255, float* %4
%256 = load i32, i32* %7
%257 = uitofp i32 %256 to float
store float %257, float* %6
%258 = load float, float* %3
%259 = fcmp oeq float %258, 0.000000e+00
br i1 %259, label %260, label %261
260: ; preds = %247
store float 1.000000e+01, float* %3
br label %261
261: ; preds = %260, %247
%262 = load float, float* %4
%263 = fcmp oeq float %262, 0.000000e+00
br i1 %263, label %264, label %265
264: ; preds = %261
store float 1.000000e+01, float* %4
br label %265
265: ; preds = %264, %261
%266 = load float, float* %5
%267 = fcmp oeq float %266, 0.000000e+00
br i1 %267, label %268, label %269
268: ; preds = %265
store float 1.000000e+01, float* %5
br label %269
269: ; preds = %268, %265
%270 = load float, float* %6
%271 = fcmp oeq float %270, 0.000000e+00
br i1 %271, label %272, label %273
272: ; preds = %269
store float 1.000000e+01, float* %6
br label %273
273: ; preds = %272, %269
%274 = load float, float* %3
%275 = fsub float %274, 7.000000e+00
store float %275, float* %3
%276 = load float, float* %4
%277 = fsub float %276, 7.000000e+00
store float %277, float* %4
%278 = load float, float* %5
%279 = fsub float %278, 7.000000e+00
store float %279, float* %5
%280 = load float, float* %6
%281 = fsub float %280, 7.000000e+00
store float %281, float* %6
%282 = load float, float* %3
%283 = fcmp oeq float %282, 0.000000e+00
br i1 %283, label %284, label %316
284: ; preds = %273
%285 = load float, float* %4
%286 = fcmp oeq float %285, 0.000000e+00
br i1 %286, label %287, label %307
287: ; preds = %284
%288 = load float, float* %5
%289 = fcmp oeq float %288, 0.000000e+00
br i1 %289, label %290, label %300
290: ; preds = %287
%291 = load float, float* %6
%292 = fcmp oeq float %291, 0.000000e+00
br i1 %292, label %293, label %295
293: ; preds = %290
%294 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
br label %299
295: ; preds = %290
%296 = load float, float* %6
%297 = fptoui float %296 to i32
%298 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i32 %297)
br label %299
299: ; preds = %295, %293
br label %306
300: ; preds = %287
%301 = load float, float* %5
%302 = fptoui float %301 to i32
%303 = load float, float* %6
%304 = fptoui float %303 to i32
%305 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i32 %302, i32 %304)
br label %306
306: ; preds = %300, %299
br label %315
307: ; preds = %284
%308 = load float, float* %4
%309 = fptoui float %308 to i32
%310 = load float, float* %5
%311 = fptoui float %310 to i32
%312 = load float, float* %6
%313 = fptoui float %312 to i32
%314 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 %309, i32 %311, i32 %313)
br label %315
315: ; preds = %307, %306
br label %326
316: ; preds = %273
%317 = load float, float* %3
%318 = fptoui float %317 to i32
%319 = load float, float* %4
%320 = fptoui float %319 to i32
%321 = load float, float* %5
%322 = fptoui float %321 to i32
%323 = load float, float* %6
%324 = fptoui float %323 to i32
%325 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i32 %318, i32 %320, i32 %322, i32 %324)
br label %326
326: ; preds = %316, %315
br label %329
327: ; preds = %148
%328 = call i32 @puts(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.13, i64 0, i64 0))
br label %329
329: ; preds = %327, %326
br label %330
330: ; preds = %329, %147
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [138 x i8] c"Selezionare la modalita' di utilizzo inserendo il relativo numero e premendo invio:\0A1. Criptazione.\0A2. Decriptazione.\0AScelta effettuata: \00"
@.str.2 = [3 x i8] c"%u\00"
@.str.3 = [48 x i8] c"Inserire numero da criptare (4 cifre >= 1000): \00"
@.str.4 = [86 x i8] c"Attenzione non e' stato inserito un intero di 4 cifre >= 1000.\0A Ripetere inserimento.\00"
@.str.5 = [29 x i8] c"\0AIl numero criptato e': 0000\00"
@.str.6 = [31 x i8] c"\0AIl numero criptato e': 000%u\0A\00"
@.str.7 = [32 x i8] c"\0AIl numero criptato e': 00%u%u\0A\00"
@.str.8 = [33 x i8] c"\0AIl numero criptato e': 0%u%u%u\0A\00"
@.str.9 = [34 x i8] c"\0AIl numero criptato e': %u%u%u%u\0A\00"
@.str.10 = [60 x i8] c"Inserire numero da decriptare (4 cifre compresi gli zeri): \00"
@.str.11 = [14 x i8] c"\0A%f\0A%f\0A%f\0A%f\0A\00"
@.str.12 = [74 x i8] c"Attenzione non e' stato inserito un numero valido.\0A Ripetere inserimento.\00"
@.str.13 = [91 x i8] c"E' stato inserito un valore non valido (la scelta era 1 o 2) il programma verra' terminato\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
switch i32 %7, label %172 [
i32 1, label %13
i32 2, label %8
]
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.10, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = icmp ult i32 %11, 10000
br i1 %12, label %80, label %119
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%16 = load i32, i32* %1
%17 = uitofp i32 %16 to float
%18 = fdiv float %17, 1.000000e+03
%19 = fcmp ogt float %18, 0.000000e+00
br i1 %19, label %28, label %20
20: ; preds = %13, %20
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%24 = load i32, i32* %1
%25 = uitofp i32 %24 to float
%26 = fdiv float %25, 1.000000e+03
%27 = fcmp ogt float %26, 0.000000e+00
br i1 %27, label %28, label %20
28: ; preds = %20, %13
%29 = phi float [ %18, %13 ], [ %26, %20 ]
%30 = fptosi float %29 to i32
%31 = sitofp i32 %30 to float
%32 = fsub float %29, %31
%33 = fmul float %32, 1.000000e+01
%34 = fptosi float %33 to i32
%35 = sitofp i32 %34 to float
%36 = fsub float %32, %35
%37 = fmul float %36, 1.000000e+01
%38 = fptosi float %37 to i32
%39 = sitofp i32 %38 to float
%40 = fsub float %36, %39
%41 = fmul float %40, 1.000000e+01
%42 = fadd float %29, 7.000000e+00
%43 = fadd float %33, 7.000000e+00
%44 = fadd float %37, 7.000000e+00
%45 = fadd float %41, 7.000000e+00
%46 = fptoui float %42 to i32
%47 = urem i32 %46, 10
%48 = uitofp i32 %47 to float
%49 = fptoui float %43 to i32
%50 = urem i32 %49, 10
%51 = uitofp i32 %50 to float
%52 = fptoui float %44 to i32
%53 = urem i32 %52, 10
%54 = fptoui float %45 to i32
%55 = urem i32 %54, 10
%56 = uitofp i32 %55 to float
%57 = fptoui float %48 to i32
%58 = fptoui float %51 to i32
%59 = icmp eq i32 %53, 0
br i1 %59, label %60, label %75
60: ; preds = %28
%61 = icmp eq i32 %55, 0
br i1 %61, label %62, label %72
62: ; preds = %60
%63 = icmp eq i32 %57, 0
br i1 %63, label %64, label %70
64: ; preds = %62
%65 = icmp eq i32 %58, 0
br i1 %65, label %66, label %68
66: ; preds = %64
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
br label %174
68: ; preds = %64
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i32 %58)
br label %174
70: ; preds = %62
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i32 %57, i32 %58)
br label %174
72: ; preds = %60
%73 = fptoui float %56 to i32
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 %73, i32 %57, i32 %58)
br label %174
75: ; preds = %28
%76 = uitofp i32 %53 to float
%77 = fptoui float %76 to i32
%78 = fptoui float %56 to i32
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i32 %77, i32 %78, i32 %57, i32 %58)
br label %174
80: ; preds = %119, %8
%81 = phi i32 [ %11, %8 ], [ %123, %119 ]
%82 = icmp ult i32 %81, 10
br i1 %82, label %83, label %85
83: ; preds = %80
%84 = uitofp i32 %81 to float
br label %125
85: ; preds = %80
%86 = icmp ult i32 %81, 100
br i1 %86, label %87, label %98
87: ; preds = %85
%88 = trunc i32 %81 to i8
%89 = udiv i8 %88, 10
%90 = uitofp i8 %89 to float
%91 = uitofp i32 %81 to float
%92 = fdiv float %91, 1.000000e+01
%93 = fsub float %92, %90
%94 = fmul float %93, 1.000000e+01
%95 = uitofp i8 %89 to double
%96 = fpext float %94 to double
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), double 0.000000e+00, double 0.000000e+00, double %95, double %96)
br label %125
98: ; preds = %85
%99 = icmp ult i32 %81, 1000
br i1 %99, label %100, label %109
100: ; preds = %98
%101 = trunc i32 %81 to i16
%102 = udiv i16 %101, 100
%103 = uitofp i16 %102 to float
%104 = uitofp i32 %81 to float
%105 = fdiv float %104, 1.000000e+02
%106 = fmul float %105, 1.000000e+01
%107 = fsub float %105, %106
%108 = fmul float %107, 1.000000e+01
br label %125
109: ; preds = %98
%110 = uitofp i32 %81 to float
%111 = fdiv float %110, 1.000000e+03
%112 = fsub float %111, %111
%113 = fmul float %112, 1.000000e+01
%114 = fsub float %112, %113
%115 = fmul float %114, 1.000000e+01
%116 = fsub float %114, %115
%117 = fmul float %116, 1.000000e+01
%118 = fptoui float %111 to i32
br label %125
119: ; preds = %8, %119
%120 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str.12, i64 0, i64 0))
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.10, i64 0, i64 0))
%122 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%123 = load i32, i32* %1
%124 = icmp ult i32 %123, 10000
br i1 %124, label %80, label %119
125: ; preds = %83, %87, %100, %109
%126 = phi i32 [ %118, %109 ], [ 0, %100 ], [ 0, %87 ], [ 0, %83 ]
%127 = phi float [ %113, %109 ], [ %103, %100 ], [ 0.000000e+00, %87 ], [ 0.000000e+00, %83 ]
%128 = phi float [ %115, %109 ], [ %106, %100 ], [ %90, %87 ], [ 0.000000e+00, %83 ]
%129 = phi float [ %117, %109 ], [ %108, %100 ], [ %94, %87 ], [ %84, %83 ]
%130 = uitofp i32 %126 to float
%131 = fptoui float %127 to i32
%132 = uitofp i32 %131 to float
%133 = fcmp oeq float %128, 0.000000e+00
%134 = fcmp oeq float %129, 0.000000e+00
%135 = icmp eq i32 %126, 0
%136 = icmp eq i32 %131, 0
%137 = fadd float %128, -7.000000e+00
%138 = select i1 %133, float 3.000000e+00, float %137
%139 = fadd float %129, -7.000000e+00
%140 = select i1 %134, float 3.000000e+00, float %139
%141 = fadd float %130, -7.000000e+00
%142 = select i1 %135, float 3.000000e+00, float %141
%143 = fadd float %132, -7.000000e+00
%144 = select i1 %136, float 3.000000e+00, float %143
%145 = fcmp oeq float %138, 0.000000e+00
br i1 %145, label %146, label %166
146: ; preds = %125
%147 = fcmp oeq float %140, 0.000000e+00
br i1 %147, label %148, label %161
148: ; preds = %146
%149 = fcmp oeq float %142, 0.000000e+00
br i1 %149, label %150, label %157
150: ; preds = %148
%151 = fcmp oeq float %144, 0.000000e+00
br i1 %151, label %152, label %154
152: ; preds = %150
%153 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
br label %174
154: ; preds = %150
%155 = fptoui float %144 to i32
%156 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i32 %155)
br label %174
157: ; preds = %148
%158 = fptoui float %142 to i32
%159 = fptoui float %144 to i32
%160 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i32 %158, i32 %159)
br label %174
161: ; preds = %146
%162 = fptoui float %140 to i32
%163 = fptoui float %142 to i32
%164 = fptoui float %144 to i32
%165 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 %162, i32 %163, i32 %164)
br label %174
166: ; preds = %125
%167 = fptoui float %138 to i32
%168 = fptoui float %140 to i32
%169 = fptoui float %142 to i32
%170 = fptoui float %144 to i32
%171 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i32 %167, i32 %168, i32 %169, i32 %170)
br label %174
172: ; preds = %0
%173 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @.str.13, i64 0, i64 0))
br label %174
174: ; preds = %172, %161, %152, %154, %157, %166, %75, %70, %68, %66, %72
ret i32 0
}