#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 */
double Difference(float, float);
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;
  do {
    printf("Enter two floating-point numbers (q - to quit): ");
    k = (scanf("%f %f", &num1, &num2));
    double diference;
    if (k) {
      diference = Difference(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    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <scanf@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11ac <main+0x6c>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1060 <Difference@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe92(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1156 <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    0xeae(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
test   %eax,%eax
je     11de <main+0x9e>
lea    0xebf(%rip),%r14
mov    0x2e69(%rip),%rbp
lea    0xe7a(%rip),%r15
lea    0xea4(%rip),%r12
lea    0x4(%rsp),%r13
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm1
call   1060 <Difference@plt>
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    11a0 <main+0x60>
mov    0x2e03(%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 = %20, %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 %17
11: ; preds = %6
%12 = load float, float* %3
%13 = load float, float* %4
%14 = call double @Difference(float %12, float %13)
store double %14, double* %5
%15 = load double, double* %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %15)
br label %17
17: ; preds = %11, %6
%18 = load i32, i32* @stdin
%19 = call i32 @fflush(i32 %18)
br label %20
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp ne i32 %21, 0
br i1 %22, label %6, label %23
23: ; preds = %20
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 %18, label %8
8: ; preds = %0, %8
%9 = load float, float* %1
%10 = load float, float* %2
%11 = call double @Difference(float %9, float %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), double %11)
%13 = load i32, i32* @stdin
%14 = call i32 @fflush(i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %8
18: ; preds = %8, %0
%19 = load i32, i32* @stdin
%20 = call i32 @fflush(i32 %19)
ret i32 0
}