#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*/ printf(char *, ...);
int scanf(char *, double *, double *);
int main(void) {
  double num1, num2;
  printf("Enter a pair of floating-point numbers, ");
  printf("or q to exit.\n");
  while (scanf("%lf %lf", &num1, &num2) == 2) {
    printf("(%lf - %lf) / (%lf * %lf) = %lf\n", num1, num2, num1, num2,
           (num1 - num2) / (num1 * num2));
    printf("Enter the next pair of floating-point numbers: ");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11b5 <main+0x95>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm4
subsd  -0x18(%rbp),%xmm4
movsd  -0x10(%rbp),%xmm5
mulsd  -0x18(%rbp),%xmm5
divsd  %xmm5,%xmm4
lea    0xea5(%rip),%rdi
mov    $0x5,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114b <main+0x2b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf30(%rip),%rdi
call   1030 <puts@plt>
lea    0xecb(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
jne    11de <main+0xae>
lea    0xeba(%rip),%r14
lea    0xed4(%rip),%r15
lea    0xea4(%rip),%r12
lea    0x8(%rsp),%r13
mov    %rsp,%rbx
nopl   (%rax)
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
movapd %xmm0,%xmm4
subsd  %xmm1,%xmm4
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm2,%xmm4
mov    %r14,%rdi
movapd %xmm0,%xmm2
movapd %xmm1,%xmm3
mov    $0x5,%al
call   1040 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
je     1190 <main+0x60>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Enter a pair of floating-point numbers, \00"
@.str.1 = [15 x i8] c"or q to exit.\0A\00"
@.str.2 = [8 x i8] c"%lf %lf\00"
@.str.3 = [33 x i8] c"(%lf - %lf) / (%lf * %lf) = %lf\0A\00"
@.str.4 = [48 x i8] c"Enter the next pair of floating-point numbers: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %9, %0
%7 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double* %2, double* %3)
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load double, double* %2
%11 = load double, double* %3
%12 = load double, double* %2
%13 = load double, double* %3
%14 = load double, double* %2
%15 = load double, double* %3
%16 = fsub double %14, %15
%17 = load double, double* %2
%18 = load double, double* %3
%19 = fmul double %17, %18
%20 = fdiv double %16, %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), double %10, double %11, double %12, double %13, double %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
br label %6
23: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"Enter a pair of floating-point numbers, \00"
@.str.2 = [8 x i8] c"%lf %lf\00"
@.str.3 = [33 x i8] c"(%lf - %lf) / (%lf * %lf) = %lf\0A\00"
@.str.4 = [48 x i8] c"Enter the next pair of floating-point numbers: \00"
@str = [14 x i8] c"or q to exit.\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double* %1, double* %2)
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %19
9: ; preds = %0, %9
%10 = load double, double* %1
%11 = load double, double* %2
%12 = fsub double %10, %11
%13 = fmul double %10, %11
%14 = fdiv double %12, %13
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), double %10, double %11, double %10, double %11, double %14)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double* %1, double* %2)
%18 = icmp eq i32 %17, 2
br i1 %18, label %9, label %19
19: ; preds = %9, %0
ret i32 0
}