#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*/ scanf(char *, ...);
int main(void) {
  int oreDiLavoro = 0;
  float pagaStandard = 0;
  int valoreSentinella = -1;
  unsigned int oreStraordinario = 0;
  float importoStraordinario = 0;
  float importoStandard = 0;
  float importoSalario = 0;
  do {
    printf("%s", "Inserire numero di ore di lavoro (-1 per uscire): ");
    scanf("%u", &oreDiLavoro);
    if (oreDiLavoro != valoreSentinella) {
      printf("%s", "Inserire paga oraria per il lavoratore ($00.00): ");
      scanf("%f", &pagaStandard);
      if (oreDiLavoro > (int)40) {
        oreStraordinario = (oreDiLavoro - (int)40);
        importoStraordinario =
            ((pagaStandard * (float)oreStraordinario) * (float)1.5);
        importoStandard = (pagaStandard * (float)40);
      } else {
        importoStandard = (pagaStandard * (float)oreDiLavoro);
      }
      importoSalario = (importoStandard + importoStraordinario);
      printf("Il Salario e: $%.02f\n", importoSalario);
    }
  } while (oreDiLavoro != valoreSentinella);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
lea    0xe9d(%rip),%rdi
lea    0xe99(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1243 <main+0x123>
lea    0xe6a(%rip),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x28,-0x8(%rbp)
jle    120a <main+0xea>
mov    -0x8(%rbp),%eax
add    $0xffffffd8,%eax
mov    %eax,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x14(%rbp),%eax
cvtsi2ss %rax,%xmm1
mulss  %xmm1,%xmm0
movss  0xe1a(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe05(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    121d <main+0xfd>
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1248 <main+0x128>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1164 <main+0x44>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x10(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x14(%rsp)
lea    0xeba(%rip),%rbx
lea    0xee9(%rip),%r15
lea    0xc(%rsp),%r12
lea    0xf12(%rip),%rbp
lea    0x10(%rsp),%r14
lea    0xf09(%rip),%r13
jmp    11a2 <main+0x82>
nop
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
movss  %xmm1,0x14(%rsp)
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cmpl   $0xffffffff,0xc(%rsp)
je     1218 <main+0xf8>
mov    %rbx,%rdi
lea    0xe5f(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0xffffffff,0xc(%rsp)
je     1218 <main+0xf8>
mov    %rbx,%rdi
lea    0xe70(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x29,%eax
jl     1170 <main+0x50>
add    $0xffffffd8,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
movss  0x10(%rsp),%xmm0
mulss  %xmm0,%xmm1
mulss  0xdf5(%rip),%xmm1
mulss  0xdf1(%rip),%xmm0
jmp    1183 <main+0x63>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [51 x i8] c"Inserire numero di ore di lavoro (-1 per uscire): \00"
@.str.2 = [3 x i8] c"%u\00"
@.str.3 = [50 x i8] c"Inserire paga oraria per il lavoratore ($00.00): \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [22 x i8] c"Il Salario e: $%.02f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
store float 0.000000e+00, float* %3
store i32 -1, i32* %4
store i32 0, i32* %5
store float 0.000000e+00, float* %6
store float 0.000000e+00, float* %7
store float 0.000000e+00, float* %8
br label %9
9: ; preds = %43, %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %42
15: ; preds = %9
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%18 = load i32, i32* %2
%19 = icmp sgt i32 %18, 40
br i1 %19, label %20, label %30
20: ; preds = %15
%21 = load i32, i32* %2
%22 = sub nsw i32 %21, 40
store i32 %22, i32* %5
%23 = load float, float* %3
%24 = load i32, i32* %5
%25 = uitofp i32 %24 to float
%26 = fmul float %23, %25
%27 = fmul float %26, 1.500000e+00
store float %27, float* %6
%28 = load float, float* %3
%29 = fmul float %28, 4.000000e+01
store float %29, float* %7
br label %35
30: ; preds = %15
%31 = load float, float* %3
%32 = load i32, i32* %2
%33 = sitofp i32 %32 to float
%34 = fmul float %31, %33
store float %34, float* %7
br label %35
35: ; preds = %30, %20
%36 = load float, float* %7
%37 = load float, float* %6
%38 = fadd float %36, %37
store float %38, float* %8
%39 = load float, float* %8
%40 = fpext float %39 to double
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), double %40)
br label %42
42: ; preds = %35, %9
br label %43
43: ; preds = %42
%44 = load i32, i32* %2
%45 = load i32, i32* %4
%46 = icmp ne i32 %44, %45
br i1 %46, label %9, label %47
47: ; preds = %43
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [51 x i8] c"Inserire numero di ore di lavoro (-1 per uscire): \00"
@.str.2 = [3 x i8] c"%u\00"
@.str.3 = [50 x i8] c"Inserire paga oraria per il lavoratore ($00.00): \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [22 x i8] c"Il Salario e: $%.02f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
br label %5
5: ; preds = %27, %0
%6 = phi float [ 0.000000e+00, %0 ], [ %28, %27 ]
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, -1
br i1 %10, label %35, label %11
11: ; preds = %5
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %2)
%14 = load i32, i32* %1
%15 = icmp sgt i32 %14, 40
br i1 %15, label %16, label %23
16: ; preds = %11
%17 = add nsw i32 %14, -40
%18 = load float, float* %2
%19 = uitofp i32 %17 to float
%20 = fmul float %18, %19
%21 = fmul float %20, 1.500000e+00
%22 = fmul float %18, 4.000000e+01
br label %27
23: ; preds = %11
%24 = load float, float* %2
%25 = sitofp i32 %14 to float
%26 = fmul float %24, %25
br label %27
27: ; preds = %16, %23
%28 = phi float [ %21, %16 ], [ %6, %23 ]
%29 = phi float [ %22, %16 ], [ %26, %23 ]
%30 = fadd float %28, %29
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), double %31)
%33 = load i32, i32* %1
%34 = icmp eq i32 %33, -1
br i1 %34, label %35, label %5
35: ; preds = %5, %27
ret i32 0
}