#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*/ puts(char *);
void registraDistinta(float sales[][(4 + 1)], unsigned int numeroAgente,
                      unsigned int numeroProdotto, float quantitaVenduta) {
  if (quantitaVenduta >= 0) {
    sales[numeroProdotto][numeroAgente] += quantitaVenduta;
  } else {
    puts("Attenzione, importo vendite errato!");
  }
  return;
}


x86 assembly (clang, -O0):
<registraDistinta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     115d <registraDistinta+0x4d>
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
addss  (%rax,%rcx,4),%xmm0
movss  %xmm0,(%rax,%rcx,4)
jmp    1169 <registraDistinta+0x59>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<registraDistinta>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jae    1124 <registraDistinta+0x14>
lea    0xee1(%rip),%rdi
jmp    1030 <puts@plt>
mov    %edx,%eax
mov    %esi,%ecx
lea    (%rax,%rax,4),%rax
lea    (%rdi,%rax,4),%rax
addss  (%rax,%rcx,4),%xmm0
movss  %xmm0,(%rax,%rcx,4)
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Attenzione, importo vendite errato!\00"
define void @registraDistinta([5 x float]* %0, i32 %1, i32 %2, float %3) {
%5 = alloca [5 x float]*
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
store [5 x float]* %0, [5 x float]** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store float %3, float* %8
%9 = load float, float* %8
%10 = fcmp oge float %9, 0.000000e+00
br i1 %10, label %11, label %22
11: ; preds = %4
%12 = load float, float* %8
%13 = load [5 x float]*, [5 x float]** %5
%14 = load i32, i32* %7
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds [5 x float], [5 x float]* %13, i64 %15
%17 = load i32, i32* %6
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds [5 x float], [5 x float]* %16, i64 0, i64 %18
%20 = load float, float* %19
%21 = fadd float %20, %12
store float %21, float* %19
br label %24
22: ; preds = %4
%23 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %24
24: ; preds = %22, %11
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Attenzione, importo vendite errato!\00"
define void @registraDistinta([5 x float]* nocapture %0, i32 %1, i32 %2, float %3) {
%5 = fcmp ult float %3, 0.000000e+00
br i1 %5, label %12, label %6
6: ; preds = %4
%7 = zext i32 %2 to i64
%8 = zext i32 %1 to i64
%9 = getelementptr inbounds [5 x float], [5 x float]* %0, i64 %7, i64 %8
%10 = load float, float* %9
%11 = fadd float %10, %3
store float %11, float* %9
br label %14
12: ; preds = %4
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %6
ret void
}