#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*/ clr_keyboard_buffer();
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *, double *);
void validate_values(int *num_1, double *num_2, int non_int_char) {
  while (*num_1 < 0 || *num_2 < 0 || non_int_char == 0) {
    clr_keyboard_buffer();
    printf("\nI'm sorry that number is not valid\n");
    printf("Please enter a valid number: ");
    non_int_char = scanf("%d %lf", num_1, num_2);
  }
}


x86 assembly (clang, -O0):
<validate_values>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmpl   $0x0,(%rcx)
mov    %al,-0x15(%rbp)
jl     1175 <validate_values+0x45>
mov    -0x10(%rbp),%rcx
mov    $0x1,%al
xorps  %xmm0,%xmm0
ucomisd (%rcx),%xmm0
mov    %al,-0x15(%rbp)
ja     1175 <validate_values+0x45>
cmpl   $0x0,-0x14(%rbp)
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1185 <validate_values+0x55>
jmp    11c0 <validate_values+0x90>
mov    $0x0,%al
call   1030 <clr_keyboard_buffer@plt>
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe90(%rip),%rdi
call   1050 <scanf@plt>
mov    %eax,-0x14(%rbp)
jmp    1143 <validate_values+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_values>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %edx,%eax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xed5(%rip),%r15
lea    0xea9(%rip),%r12
lea    0xec0(%rip),%r13
jmp    1195 <validate_values+0x55>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <clr_keyboard_buffer@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1050 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <scanf@plt>
cmpl   $0x0,(%rbx)
js     1170 <validate_values+0x30>
test   %eax,%eax
je     1170 <validate_values+0x30>
xorpd  %xmm0,%xmm0
ucomisd (%r14),%xmm0
ja     1170 <validate_values+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [37 x i8] c"\0AI'm sorry that number is not valid\0A\00"
@.str.1 = [30 x i8] c"Please enter a valid number: \00"
@.str.2 = [7 x i8] c"%d %lf\00"
define void @validate_values(i32* %0, double* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca double*
%6 = alloca i32
store i32* %0, i32** %4
store double* %1, double** %5
store i32 %2, i32* %6
br label %7
7: ; preds = %20, %3
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = icmp slt i32 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %7
%12 = load double*, double** %5
%13 = load double, double* %12
%14 = fcmp olt double %13, 0.000000e+00
br i1 %14, label %18, label %15
15: ; preds = %11
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, 0
br label %18
18: ; preds = %15, %11, %7
%19 = phi i1 [ true, %11 ], [ true, %7 ], [ %17, %15 ]
br i1 %19, label %20, label %27
20: ; preds = %18
%21 = call i32 (...) @clr_keyboard_buffer()
%22 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32*, i32** %4
%25 = load double*, double** %5
%26 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32* %24, double* %25)
store i32 %26, i32* %6
br label %7
27: ; preds = %18
ret void
}

LLVM IR (-O2):
@.str.1 = [30 x i8] c"Please enter a valid number: \00"
@.str.2 = [7 x i8] c"%d %lf\00"
@str = [36 x i8] c"\0AI'm sorry that number is not valid\00"
define void @validate_values(i32* %0, double* %1, i32 %2) {
br label %4
4: ; preds = %13, %3
%5 = phi i32 [ %2, %3 ], [ %17, %13 ]
%6 = load i32, i32* %0
%7 = icmp slt i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = load double, double* %1
%10 = fcmp olt double %9, 0.000000e+00
%11 = icmp eq i32 %5, 0
%12 = or i1 %11, %10
br i1 %12, label %13, label %18
13: ; preds = %4, %8
%14 = tail call i32 (...) @clr_keyboard_buffer()
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%16 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%17 = tail call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32* %0, double* %1)
br label %4
18: ; preds = %8
ret void
}