#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 doubleOK(char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ system(char *);
int main() {
  system("cls");
  char val[21];
  int check;
  printf("Value for checking : ");
  scanf("%s", val);
  fflush(stdin);
  check = doubleOK(val);
  if (check == 1) {
    printf("Value OK");
  } else {
    printf("Value KO");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1030 <system@plt>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1060 <scanf@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    -0x20(%rbp),%rdi
call   1070 <doubleOK@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x1,-0x24(%rbp)
jne    11bc <main+0x6c>
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
jmp    11c8 <main+0x78>
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xea4(%rip),%rdi
call   1030 <system@plt>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
lea    0xea6(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    %rbx,%rdi
call   1070 <doubleOK@plt>
cmp    $0x1,%eax
lea    0xe7e(%rip),%rax
lea    0xe80(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [22 x i8] c"Value for checking : \00"
@.str.2 = [3 x i8] c"%s\00"
@stdin = global i32 0
@.str.3 = [9 x i8] c"Value OK\00"
@.str.4 = [9 x i8] c"Value KO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [21 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stdin
%9 = call i32 @fflush(i32 %8)
%10 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%11 = call i32 @doubleOK(i8* %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %18
16: ; preds = %0
%17 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [22 x i8] c"Value for checking : \00"
@.str.2 = [3 x i8] c"%s\00"
@stdin = global i32 0
@.str.3 = [9 x i8] c"Value OK\00"
@.str.4 = [9 x i8] c"Value KO\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%6 = load i32, i32* @stdin
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @doubleOK(i8* %3)
%9 = icmp eq i32 %8, 1
%10 = select i1 %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0)
%11 = call i32 @printf(i8* dereferenceable(1) %10)
ret i32 0
}