#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, float *, float *);
int /*<<< orphan*/ stdin;
int main() {
  int k = 0;
  float num1, num2;
  double diference;
  do {
    printf("Enter two floating-point numbers (q - to quit): ");
    k = (scanf("%f %f", &num1, &num2));
    if (k) {
      diference = (double)(num1 - num2) / (num1 * num2);
      printf("diference = %lf\n", diference);
    }
    fflush(stdin);
  } while (k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <scanf@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11ad <main+0x7d>
movss  -0xc(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe91(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e34(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1146 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
test   %eax,%eax
je     11e0 <main+0xb0>
lea    0xecf(%rip),%r14
mov    0x2e79(%rip),%rbp
lea    0xe8a(%rip),%r15
lea    0xeb4(%rip),%r12
lea    0x4(%rsp),%r13
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movss  0x4(%rsp),%xmm1
movss  (%rsp),%xmm2
movaps %xmm1,%xmm0
subss  %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
mulss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x0(%rbp),%edi
call   1040 <fflush@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
test   %eax,%eax
jne    1190 <main+0x60>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Enter two floating-point numbers (q - to quit): \00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [17 x i8] c"diference = %lf\0A\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca double
store i32 0, i32* %1
store i32 0, i32* %2
br label %6
6: ; preds = %26, %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %3, float* %4)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %6
%12 = load float, float* %3
%13 = load float, float* %4
%14 = fsub float %12, %13
%15 = fpext float %14 to double
%16 = load float, float* %3
%17 = load float, float* %4
%18 = fmul float %16, %17
%19 = fpext float %18 to double
%20 = fdiv double %15, %19
store double %20, double* %5
%21 = load double, double* %5
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %21)
br label %23
23: ; preds = %11, %6
%24 = load i32, i32* @stdin
%25 = call i32 @fflush(i32 %24)
br label %26
26: ; preds = %23
%27 = load i32, i32* %2
%28 = icmp ne i32 %27, 0
br i1 %28, label %6, label %29
29: ; preds = %26
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"Enter two floating-point numbers (q - to quit): \00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [17 x i8] c"diference = %lf\0A\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %22, label %8
8: ; preds = %0, %8
%9 = load float, float* %1
%10 = load float, float* %2
%11 = fsub float %9, %10
%12 = fpext float %11 to double
%13 = fmul float %9, %10
%14 = fpext float %13 to double
%15 = fdiv double %12, %14
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %15)
%17 = load i32, i32* @stdin
%18 = call i32 @fflush(i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %8
22: ; preds = %8, %0
%23 = load i32, i32* @stdin
%24 = call i32 @fflush(i32 %23)
ret i32 0
}