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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x0,%eax
jne    1174 <main+0x44>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    1196 <main+0x66>
jp     1196 <main+0x66>
jmp    11b5 <main+0x85>
cmpl   $0x0,-0x10(%rbp)
je     11b5 <main+0x85>
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     11db <main+0xab>
mov    -0xc(%rbp),%edi
call   1040 <is_prime@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%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     1175 <main+0x45>
movss  0x4(%rsp),%xmm0
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1175 <main+0x45>
jp     1175 <main+0x45>
cvttss2si %xmm0,%edi
call   1040 <is_prime@plt>
lea    0xe9c(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1183 <main+0x53>
lea    0xe87(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@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"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %4
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %4
br label %10
10: ; preds = %8, %0
%11 = load float, float* %2
%12 = fptosi float %11 to i32
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = sitofp i32 %13 to float
%15 = load float, float* %2
%16 = fcmp une float %14, %15
br i1 %16, label %17, label %22
17: ; preds = %10
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %4
br label %22
22: ; preds = %20, %17, %10
%23 = load i32, i32* %4
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %22
%26 = load i32, i32* %3
%27 = call i32 @is_prime(i32 %26)
store i32 %27, i32* %5
%28 = load i32, i32* %5
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %25, %22
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [3 x i8] c"-1\00"
@.str.2 = [3 x i8] c"%d\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 %5, label %7
5: ; preds = %0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %17
7: ; preds = %0
%8 = load float, float* %1
%9 = fptosi float %8 to i32
%10 = sitofp i32 %9 to float
%11 = fcmp oeq float %8, %10
br i1 %11, label %14, label %12
12: ; preds = %7
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %17
14: ; preds = %7
%15 = call i32 @is_prime(i32 %9)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %5, %12, %14
ret i32 0
}