#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 *, float, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float numeroInserito;
  unsigned int counter = 0;
  float numeroPiuGrande = 0;
  float secondoNumeroPiuGrande = 0;
  do {
    printf("Inserisci numero %u di %u da controllare: ", (counter + 1),
           (unsigned int)10);
    scanf("%f", &numeroInserito);
    if (numeroInserito > secondoNumeroPiuGrande) {
      if (numeroInserito > numeroPiuGrande) {
        secondoNumeroPiuGrande = numeroPiuGrande;
        numeroPiuGrande = numeroInserito;
      } else {
        secondoNumeroPiuGrande = numeroInserito;
      }
    }
    counter++;
  } while (counter != 10);
  printf("\nIl numero piu' grande tra quelli presi in esame e': %.2f",
         numeroPiuGrande);
  printf("\nIl secondo numero piu' grande tra quelli presi in esame e': %.2f",
         secondoNumeroPiuGrande);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %rax,%xmm0
lea    0xea8(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    11ba <main+0x9a>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11ab <main+0x8b>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11b5 <main+0x95>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    11ba <main+0x9a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jne    1146 <main+0x26>
movss  -0x10(%rbp),%xmm0
lea    0xe55(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
lea    0xe7c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
xorps  %xmm0,%xmm0
mov    $0x1,%ebp
lea    0xec7(%rip),%r14
lea    0xeeb(%rip),%r15
lea    0xc(%rsp),%rbx
xorps  %xmm1,%xmm1
jmp    1178 <main+0x58>
nopw   0x0(%rax,%rax,1)
movaps %xmm2,%xmm3
movaps 0x20(%rsp),%xmm1
cmpltss %xmm0,%xmm2
maxss  %xmm1,%xmm0
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm0,%xmm2
movaps %xmm2,%xmm0
add    $0x1,%ebp
movaps %xmm3,%xmm1
cmp    $0xb,%ebp
je     11c4 <main+0xa4>
movaps %xmm1,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
mov    %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mov    %r14,%rdi
mov    $0xa,%esi
mov    $0x1,%al
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movaps 0x10(%rsp),%xmm2
movss  0xc(%rsp),%xmm0
ucomiss %xmm2,%xmm0
jbe    1150 <main+0x30>
movaps 0x20(%rsp),%xmm1
movaps %xmm1,%xmm3
minss  %xmm0,%xmm3
jmp    1158 <main+0x38>
lea    0xe63(%rip),%rdi
mov    $0x1,%al
movaps %xmm3,0x10(%rsp)
call   1030 <printf@plt>
lea    0xe8a(%rip),%rdi
movaps 0x10(%rsp),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Inserisci numero %u di %u da controllare: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [58 x i8] c"\0AIl numero piu' grande tra quelli presi in esame e': %.2f\00"
@.str.3 = [66 x i8] c"\0AIl secondo numero piu' grande tra quelli presi in esame e': %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
store i32 0, i32* %3
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %5
br label %6
6: ; preds = %28, %0
%7 = load i32, i32* %3
%8 = add i32 %7, 1
%9 = uitofp i32 %8 to float
%10 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), float %9, i32 10)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%12 = load float, float* %2
%13 = load float, float* %5
%14 = fcmp ogt float %12, %13
br i1 %14, label %15, label %25
15: ; preds = %6
%16 = load float, float* %2
%17 = load float, float* %4
%18 = fcmp ogt float %16, %17
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load float, float* %4
store float %20, float* %5
%21 = load float, float* %2
store float %21, float* %4
br label %24
22: ; preds = %15
%23 = load float, float* %2
store float %23, float* %5
br label %24
24: ; preds = %22, %19
br label %25
25: ; preds = %24, %6
%26 = load i32, i32* %3
%27 = add i32 %26, 1
store i32 %27, i32* %3
br label %28
28: ; preds = %25
%29 = load i32, i32* %3
%30 = icmp ne i32 %29, 10
br i1 %30, label %6, label %31
31: ; preds = %28
%32 = load float, float* %4
%33 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0), float %32)
%34 = load float, float* %5
%35 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0), float %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"Inserisci numero %u di %u da controllare: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [58 x i8] c"\0AIl numero piu' grande tra quelli presi in esame e': %.2f\00"
@.str.3 = [66 x i8] c"\0AIl secondo numero piu' grande tra quelli presi in esame e': %.2f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 0, %0 ], [ %7, %3 ]
%5 = phi float [ 0.000000e+00, %0 ], [ %16, %3 ]
%6 = phi float [ 0.000000e+00, %0 ], [ %17, %3 ]
%7 = add nuw nsw i32 %4, 1
%8 = uitofp i32 %7 to float
%9 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), float %8, i32 10)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%11 = load float, float* %1
%12 = fcmp ogt float %11, %6
%13 = fcmp ogt float %11, %5
%14 = select i1 %13, float %5, float %11
%15 = select i1 %12, i1 %13, i1 false
%16 = select i1 %15, float %11, float %5
%17 = select i1 %12, float %14, float %6
%18 = icmp eq i32 %7, 10
br i1 %18, label %19, label %3
19: ; preds = %3
%20 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0), float %16)
%21 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0), float %17)
ret i32 0
}