#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*/ is_prime(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  int n;
  float f;
  if (!(scanf("%f", &f)) || f - (int)f != 0) {
    printf("-1");
  } else {
    n = f;
    is_prime(n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x0,%eax
je     1181 <main+0x51>
movss  -0xc(%rbp),%xmm0
cvttss2si -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1181 <main+0x51>
jp     1181 <main+0x51>
jmp    1192 <main+0x62>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
jmp    11a2 <main+0x72>
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
test   %eax,%eax
je     1164 <main+0x34>
movss  0x4(%rsp),%xmm0
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm2
jne    1164 <main+0x34>
jnp    1172 <main+0x42>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
jmp    117b <main+0x4b>
cvttss2si %xmm0,%edi
call   1040 <is_prime@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [3 x i8] c"-1\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load float, float* %3
%8 = load float, float* %3
%9 = fptosi float %8 to i32
%10 = sitofp i32 %9 to float
%11 = fsub float %7, %10
%12 = fcmp une float %11, 0.000000e+00
br i1 %12, label %13, label %15
13: ; preds = %6, %0
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %20
15: ; preds = %6
%16 = load float, float* %3
%17 = fptosi float %16 to i32
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = call i32 @is_prime(i32 %18)
br label %20
20: ; preds = %15, %13
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [3 x i8] c"-1\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %0
%6 = load float, float* %1
%7 = fptosi float %6 to i32
%8 = sitofp i32 %7 to float
%9 = fsub float %6, %8
%10 = fcmp une float %9, 0.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %5, %0
%12 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %15
13: ; preds = %5
%14 = call i32 @is_prime(i32 %7)
br label %15
15: ; preds = %13, %11
ret i32 0
}