#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();
    if (c == '\n') {
      result = is_prime(n);
      if (result == 1)
        printf("1");
      else
        printf("0");
    } else
      printf("-1");
  } 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     11e3 <main+0xa3>
cvttss2si -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    11e3 <main+0xa3>
jp     11e3 <main+0xa3>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0xa,%eax
jne    11d2 <main+0x92>
movss  -0xc(%rbp),%xmm0
call   1050 <is_prime@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11c1 <main+0x81>
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
jmp    11cd <main+0x8d>
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
jmp    11de <main+0x9e>
lea    0xe2c(%rip),%rdi
call   1030 <printf@plt>
jmp    11ef <main+0xaf>
lea    0xe1b(%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     11a2 <main+0x52>
movss  0x4(%rsp),%xmm0
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11a2 <main+0x52>
jp     11a2 <main+0x52>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
jne    11a2 <main+0x52>
movss  0x4(%rsp),%xmm0
call   1060 <is_prime@plt>
cmp    $0x1,%eax
jne    11b2 <main+0x62>
mov    $0x31,%edi
call   1030 <putchar@plt>
jmp    11ae <main+0x5e>
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x30,%edi
call   1030 <putchar@plt>
jmp    11ae <main+0x5e>

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 %31
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 %31
13: ; preds = %7
%14 = call signext i8 (...) @getchar()
store i8 %14, i8* %4
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %28
18: ; preds = %13
%19 = load float, float* %3
%20 = call i32 @is_prime(float %19)
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %27
25: ; preds = %18
%26 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
br label %30
28: ; preds = %13
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %30
30: ; preds = %28, %27
br label %33
31: ; preds = %7, %0
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %33
33: ; preds = %31, %30
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 %23, 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 %23
10: ; preds = %5
%11 = call signext i8 (...) @getchar()
%12 = icmp eq i8 %11, 10
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = load float, float* %1
%15 = call i32 @is_prime(float %14)
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 @putchar(i32 49)
br label %25
19: ; preds = %13
%20 = call i32 @putchar(i32 48)
br label %25
21: ; preds = %10
%22 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %25
23: ; preds = %5, %0
%24 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %21, %19, %17, %23
ret i32 0
}