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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
cmp    $0x0,%rax
je     11c5 <main+0x85>
cvttss2si -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    11c5 <main+0x85>
jp     11c5 <main+0x85>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0xd(%rbp)
movss  -0xc(%rbp),%xmm0
call   1050 <is_prime@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11b4 <main+0x74>
lea    0xe5c(%rip),%rdi
call   1030 <printf@plt>
jmp    11c0 <main+0x80>
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
jmp    11d1 <main+0x91>
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
test   %rax,%rax
je     1199 <main+0x49>
movss  0x4(%rsp),%xmm0
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1199 <main+0x49>
jp     1199 <main+0x49>
xor    %eax,%eax
call   1050 <getchar@plt>
movss  0x4(%rsp),%xmm0
call   1060 <is_prime@plt>
cmp    $0x1,%eax
jne    11a7 <main+0x57>
mov    $0x31,%edi
jmp    11ac <main+0x5c>
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
jmp    11b1 <main+0x61>
mov    $0x30,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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