#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 *, float *);
void thresholdDef(float *threshold, int min, int max) {
  printf("Podaj wartosc progu\n");
  printf("Wartosc progu powinna byc z przedzialu %d - %d\n", min, max);
  scanf("%f", &*threshold);
  if (*threshold > (float)max || *threshold < (float)min) {
    printf("Wartos progu moze byc nieprawidlowa\n");
  }
}


x86 assembly (clang, -O0):
<thresholdDef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee6(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
ucomiss %xmm1,%xmm0
ja     1190 <thresholdDef+0x70>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
cvtsi2ssl -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    119e <thresholdDef+0x7e>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thresholdDef>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb1(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cvtsi2ss %ebp,%xmm1
movss  (%rbx),%xmm0
ucomiss %xmm1,%xmm0
ja     1189 <thresholdDef+0x59>
xorps  %xmm1,%xmm1
cvtsi2ss %r14d,%xmm1
ucomiss %xmm0,%xmm1
ja     1189 <thresholdDef+0x59>
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xeb7(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Podaj wartosc progu\0A\00"
@.str.1 = [48 x i8] c"Wartosc progu powinna byc z przedzialu %d - %d\0A\00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [37 x i8] c"Wartos progu moze byc nieprawidlowa\0A\00"
define void @thresholdDef(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
%11 = load float*, float** %4
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %11)
%13 = load float*, float** %4
%14 = load float, float* %13
%15 = load i32, i32* %6
%16 = sitofp i32 %15 to float
%17 = fcmp ogt float %14, %16
br i1 %17, label %24, label %18
18: ; preds = %3
%19 = load float*, float** %4
%20 = load float, float* %19
%21 = load i32, i32* %5
%22 = sitofp i32 %21 to float
%23 = fcmp olt float %20, %22
br i1 %23, label %24, label %26
24: ; preds = %18, %3
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
br label %26
26: ; preds = %24, %18
ret void
}

LLVM IR (-O2):
@.str.1 = [48 x i8] c"Wartosc progu powinna byc z przedzialu %d - %d\0A\00"
@.str.2 = [3 x i8] c"%f\00"
@str = [20 x i8] c"Podaj wartosc progu\00"
@str.4 = [36 x i8] c"Wartos progu moze byc nieprawidlowa\00"
define void @thresholdDef(float* %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %2)
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %0)
%7 = load float, float* %0
%8 = sitofp i32 %2 to float
%9 = fcmp ogt float %7, %8
%10 = sitofp i32 %1 to float
%11 = fcmp olt float %7, %10
%12 = or i1 %9, %11
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.4, i64 0, i64 0))
br label %15
15: ; preds = %3, %13
ret void
}