#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, int, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int R, A;
  scanf("%d %d", &R, &A);
  if (R == A) {
    if (A < 6)
      printf("%d+3=%d\n", A - 3, R);
    else
      printf("3+%d=%d\n", A - 3, R);
  } else if (A < R - A)
    printf("%d+%d=%d\n", A, R - A, R);
  else
    printf("%d+%d=%d\n", R - A, A, R);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1191 <main+0x71>
cmpl   $0x6,-0xc(%rbp)
jge    1175 <main+0x55>
mov    -0xc(%rbp),%esi
sub    $0x3,%esi
mov    -0x8(%rbp),%edx
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118c <main+0x6c>
mov    -0xc(%rbp),%esi
sub    $0x3,%esi
mov    -0x8(%rbp),%edx
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e0 <main+0xc0>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    11c1 <main+0xa1>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
sub    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11db <main+0xbb>
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e0 <main+0xc0>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
mov    (%rsp),%edx
mov    %ecx,%eax
sub    %edx,%eax
jne    1153 <main+0x33>
lea    -0x3(%rcx),%esi
cmp    $0x5,%ecx
jg     1164 <main+0x44>
lea    0xeb5(%rip),%rdi
jmp    116b <main+0x4b>
lea    0xebe(%rip),%rdi
cmp    %eax,%edx
jge    1176 <main+0x56>
mov    %edx,%esi
mov    %eax,%edx
jmp    1178 <main+0x58>
lea    0xea4(%rip),%rdi
mov    %ecx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    117f <main+0x5f>
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [9 x i8] c"%d+3=%d\0A\00"
@.str.2 = [9 x i8] c"3+%d=%d\0A\00"
@.str.3 = [10 x i8] c"%d+%d=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %22
8: ; preds = %0
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 6
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 3
%14 = load i32, i32* %2
%15 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
br label %21
16: ; preds = %8
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 3
%19 = load i32, i32* %2
%20 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %18, i32 %19)
br label %21
21: ; preds = %16, %11
br label %43
22: ; preds = %0
%23 = load i32, i32* %3
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = sub nsw i32 %24, %25
%27 = icmp slt i32 %23, %26
br i1 %27, label %28, label %35
28: ; preds = %22
%29 = load i32, i32* %3
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = sub nsw i32 %30, %31
%33 = load i32, i32* %2
%34 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %29, i32 %32, i32 %33)
br label %42
35: ; preds = %22
%36 = load i32, i32* %2
%37 = load i32, i32* %3
%38 = sub nsw i32 %36, %37
%39 = load i32, i32* %3
%40 = load i32, i32* %2
%41 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %38, i32 %39, i32 %40)
br label %42
42: ; preds = %35, %28
br label %43
43: ; preds = %42, %21
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [9 x i8] c"%d+3=%d\0A\00"
@.str.2 = [9 x i8] c"3+%d=%d\0A\00"
@.str.3 = [10 x i8] c"%d+%d=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %0
%10 = icmp slt i32 %6, 6
%11 = add nsw i32 %6, -3
br i1 %10, label %12, label %14
12: ; preds = %9
%13 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %6)
br label %23
14: ; preds = %9
%15 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %11, i32 %6)
br label %23
16: ; preds = %0
%17 = sub nsw i32 %6, %7
%18 = icmp slt i32 %7, %17
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %7, i32 %17, i32 %6)
br label %23
21: ; preds = %16
%22 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %17, i32 %7, i32 %6)
br label %23
23: ; preds = %19, %21, %12, %14
ret i32 0
}