#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 */
scalar_t__ isInt(double);
int /*<<< orphan*/ printf(char *, double, double, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double k, x, y;
  scanf("%lf", &k);
  for (y = 1; y <= 2 * k; ++y) {
    x = (k * y) / (y - k);
    if (x >= y && isInt(x))
      printf("1/%.0lf = 1/%.0lf + 1/%.0lf\n", k, x, y);
    else
      continue;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  0xea9(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  0xe9f(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11fa <main+0xca>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     11d9 <main+0xa9>
movsd  -0x18(%rbp),%xmm0
call   1040 <isInt@plt>
cmp    $0x0,%rax
je     11d9 <main+0xa9>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
jmp    11de <main+0xae>
jmp    11e3 <main+0xb3>
jmp    11e3 <main+0xb3>
movsd  0xe15(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    115c <main+0x2c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xecc(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1050 <scanf@plt>
movsd  0x10(%rsp),%xmm3
movapd %xmm3,%xmm1
addsd  %xmm3,%xmm1
ucomisd 0xea4(%rip),%xmm1
jae    1166 <main+0x36>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret
movsd  0xe92(%rip),%xmm2
lea    0xe97(%rip),%rbx
jmp    119c <main+0x6c>
nopw   0x0(%rax,%rax,1)
addsd  0xe78(%rip),%xmm2
movsd  0x10(%rsp),%xmm3
movapd %xmm3,%xmm1
addsd  %xmm3,%xmm1
ucomisd %xmm2,%xmm1
jb     115e <main+0x2e>
movapd %xmm2,%xmm0
mulsd  %xmm3,%xmm0
movapd %xmm2,%xmm1
subsd  %xmm3,%xmm1
divsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
jb     1180 <main+0x50>
movsd  %xmm2,0x8(%rsp)
movsd  %xmm0,0x18(%rsp)
call   1040 <isInt@plt>
movsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
test   %rax,%rax
je     1180 <main+0x50>
movsd  0x10(%rsp),%xmm0
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm2
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm2
jmp    1180 <main+0x50>

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [29 x i8] c"1/%.0lf = 1/%.0lf + 1/%.0lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
store double 1.000000e+00, double* %4
br label %6
6: ; preds = %33, %0
%7 = load double, double* %4
%8 = load double, double* %2
%9 = fmul double 2.000000e+00, %8
%10 = fcmp ole double %7, %9
br i1 %10, label %11, label %36
11: ; preds = %6
%12 = load double, double* %2
%13 = load double, double* %4
%14 = fmul double %12, %13
%15 = load double, double* %4
%16 = load double, double* %2
%17 = fsub double %15, %16
%18 = fdiv double %14, %17
store double %18, double* %3
%19 = load double, double* %3
%20 = load double, double* %4
%21 = fcmp oge double %19, %20
br i1 %21, label %22, label %31
22: ; preds = %11
%23 = load double, double* %3
%24 = call i64 @isInt(double %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %31
26: ; preds = %22
%27 = load double, double* %2
%28 = load double, double* %3
%29 = load double, double* %4
%30 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), double %27, double %28, double %29)
br label %32
31: ; preds = %22, %11
br label %33
32: ; preds = %26
br label %33
33: ; preds = %32, %31
%34 = load double, double* %4
%35 = fadd double %34, 1.000000e+00
store double %35, double* %4
br label %6
36: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [29 x i8] c"1/%.0lf = 1/%.0lf + 1/%.0lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 2.000000e+00
%6 = fcmp ult double %5, 1.000000e+00
br i1 %6, label %25, label %7
7: ; preds = %0, %20
%8 = phi double [ %22, %20 ], [ %4, %0 ]
%9 = phi double [ %21, %20 ], [ 1.000000e+00, %0 ]
%10 = fmul double %9, %8
%11 = fsub double %9, %8
%12 = fdiv double %10, %11
%13 = fcmp ult double %12, %9
br i1 %13, label %20, label %14
14: ; preds = %7
%15 = call i64 @isInt(double %12)
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load double, double* %1
%19 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), double %18, double %12, double %9)
br label %20
20: ; preds = %7, %14, %17
%21 = fadd double %9, 1.000000e+00
%22 = load double, double* %1
%23 = fmul double %22, 2.000000e+00
%24 = fcmp ugt double %21, %23
br i1 %24, label %25, label %7
25: ; preds = %20, %0
ret i32 0
}