#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 mapPanorama(int, int, int *);
void sbrNoiseFloorLevelsQuantisation(int *iNoiseLevels, float *NoiseLevels,
                                     int coupling) {
  int i;
  int dummy;
  ;
  ;
  ;
  for (i = 0; i < 10; i++) {
    int tmp;
    ;
    ;
    tmp =
        NoiseLevels[i] > (float)30.0f ? 30 : (int)(NoiseLevels[i] + (float)0.5);
    ;
    if (coupling) {
      ;
      ;
      ;
      tmp = tmp < -30 ? -30 : tmp;
      ;
      tmp = mapPanorama(tmp, 1, &dummy);
    };
    iNoiseLevels[i] = tmp;
  };
}


x86 assembly (clang, -O0):
<sbrNoiseFloorLevelsQuantisation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    11de <sbrNoiseFloorLevelsQuantisation+0xce>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  0xeb7(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    115f <sbrNoiseFloorLevelsQuantisation+0x4f>
mov    $0x1e,%eax
mov    %eax,-0x24(%rbp)
jmp    117b <sbrNoiseFloorLevelsQuantisation+0x6b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  0xe95(%rip),%xmm0
addss  (%rax,%rcx,4),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11c2 <sbrNoiseFloorLevelsQuantisation+0xb2>
cmpl   $0xffffffe2,-0x20(%rbp)
jge    11a2 <sbrNoiseFloorLevelsQuantisation+0x92>
mov    $0xffffffe2,%eax
mov    %eax,-0x28(%rbp)
jmp    11a8 <sbrNoiseFloorLevelsQuantisation+0x98>
mov    -0x20(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    $0x1,%esi
lea    -0x1c(%rbp),%rdx
call   1030 <mapPanorama@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <sbrNoiseFloorLevelsQuantisation+0x1a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbrNoiseFloorLevelsQuantisation>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r12
mov    %rdi,%rbp
xor    %ebx,%ebx
mov    $0x1e,%r13d
lea    0x4(%rsp),%r15
jmp    115d <sbrNoiseFloorLevelsQuantisation+0x4d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
mov    $0x1,%esi
mov    %r15,%rdx
call   1030 <mapPanorama@plt>
mov    %eax,0x0(%rbp,%rbx,4)
add    $0x1,%rbx
cmp    $0xa,%rbx
je     118b <sbrNoiseFloorLevelsQuantisation+0x7b>
movss  (%r12,%rbx,4),%xmm0
ucomiss 0xe96(%rip),%xmm0
addss  0xe92(%rip),%xmm0
cvttss2si %xmm0,%eax
cmova  %r13d,%eax
test   %r14d,%r14d
je     114f <sbrNoiseFloorLevelsQuantisation+0x3f>
cmp    $0xffffffe3,%eax
jge    1140 <sbrNoiseFloorLevelsQuantisation+0x30>
mov    $0xffffffe2,%eax
jmp    1140 <sbrNoiseFloorLevelsQuantisation+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @sbrNoiseFloorLevelsQuantisation(i32* %0, float* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca float*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %4
store float* %1, float** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %10
10: ; preds = %49, %3
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %52
13: ; preds = %10
%14 = load float*, float** %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds float, float* %14, i64 %16
%18 = load float, float* %17
%19 = fcmp ogt float %18, 3.000000e+01
br i1 %19, label %20, label %21
20: ; preds = %13
br label %29
21: ; preds = %13
%22 = load float*, float** %5
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds float, float* %22, i64 %24
%26 = load float, float* %25
%27 = fadd float %26, 5.000000e-01
%28 = fptosi float %27 to i32
br label %29
29: ; preds = %21, %20
%30 = phi i32 [ 30, %20 ], [ %28, %21 ]
store i32 %30, i32* %9
%31 = load i32, i32* %6
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %43
33: ; preds = %29
%34 = load i32, i32* %9
%35 = icmp slt i32 %34, -30
br i1 %35, label %36, label %37
36: ; preds = %33
br label %39
37: ; preds = %33
%38 = load i32, i32* %9
br label %39
39: ; preds = %37, %36
%40 = phi i32 [ -30, %36 ], [ %38, %37 ]
store i32 %40, i32* %9
%41 = load i32, i32* %9
%42 = call i32 @mapPanorama(i32 %41, i32 1, i32* %8)
store i32 %42, i32* %9
br label %43
43: ; preds = %39, %29
%44 = load i32, i32* %9
%45 = load i32*, i32** %4
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i32, i32* %45, i64 %47
store i32 %44, i32* %48
br label %49
49: ; preds = %43
%50 = load i32, i32* %7
%51 = add nsw i32 %50, 1
store i32 %51, i32* %7
br label %10
52: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @sbrNoiseFloorLevelsQuantisation(i32* nocapture writeonly %0, float* nocapture %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = icmp eq i32 %2, 0
br label %7
7: ; preds = %3, %19
%8 = phi i64 [ 0, %3 ], [ %22, %19 ]
%9 = getelementptr inbounds float, float* %1, i64 %8
%10 = load float, float* %9
%11 = fcmp ogt float %10, 3.000000e+01
%12 = fadd float %10, 5.000000e-01
%13 = fptosi float %12 to i32
%14 = select i1 %11, i32 30, i32 %13
br i1 %6, label %19, label %15
15: ; preds = %7
%16 = icmp sgt i32 %14, -30
%17 = select i1 %16, i32 %14, i32 -30
%18 = call i32 @mapPanorama(i32 %17, i32 1, i32* %4)
br label %19
19: ; preds = %15, %7
%20 = phi i32 [ %18, %15 ], [ %14, %7 ]
%21 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %20, i32* %21
%22 = add nuw nsw i64 %8, 1
%23 = icmp eq i64 %22, 10
br i1 %23, label %24, label %7
24: ; preds = %19
ret void
}