#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);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
int main(void) {
  int x, flag;
  flag = 0;
  printf("Is your number less than 0? If yes - input 1; If no - input any "
         "other number: ");
  if (scanf("%d", &flag) != 1) {
    printf("-1");
    return 0;
  }
  printf("\nInsert your number - ");
  if (scanf("%d", &x) != 1) {
    printf("-1");
    return 0;
  }
  is_prime(x, flag);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     1183 <main+0x53>
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11cb <main+0x9b>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     11c0 <main+0x90>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11cb <main+0x9b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <is_prime@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,(%rsp)
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1188 <main+0x58>
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1188 <main+0x58>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <is_prime@plt>
jmp    1194 <main+0x64>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [79 x i8] c"Is your number less than 0? If yes - input 1; If no - input any other number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"-1\00"
@.str.3 = [23 x i8] c"\0AInsert your number - \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %19
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%12 = icmp ne i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %19
15: ; preds = %9
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 @is_prime(i32 %16, i32 %17)
br label %19
19: ; preds = %15, %13, %7
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [79 x i8] c"Is your number less than 0? If yes - input 1; If no - input any other number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"-1\00"
@.str.3 = [23 x i8] c"\0AInsert your number - \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %20
10: ; preds = %0
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%13 = icmp eq i32 %12, 1
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %20
16: ; preds = %10
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = call i32 @is_prime(i32 %17, i32 %18)
br label %20
20: ; preds = %16, %14, %8
ret i32 0
}