#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, int);
int scanf(char *, int *, int *);
int main() {
  int n, m;
  while (scanf("%d %d", &n, &m), n || m)
    printf("%d %d %d %d \n", n + m, n < m ? m - n : n - m, n * m, n / m);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jne    115c <main+0x3c>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    116c <main+0x4c>
jmp    11c6 <main+0xa6>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118f <main+0x6f>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1198 <main+0x78>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    -0x1c(%rbp),%edx
mov    %eax,%r8d
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%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    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%edi
mov    %eax,%ecx
or     %edi,%ecx
je     11b1 <main+0x91>
lea    0xeae(%rip),%r14
lea    0xea1(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%r13
nopl   0x0(%rax)
mov    %eax,%ecx
sub    %edi,%ecx
neg    %ecx
mov    %eax,%ebx
sub    %edi,%ebx
cmovl  %ecx,%ebx
lea    (%rdi,%rax,1),%esi
mov    %edi,%ecx
imul   %eax,%ecx
cltd
idiv   %edi
mov    %r14,%rdi
mov    %ebx,%edx
mov    %eax,%r8d
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%edi
mov    %eax,%ecx
or     %edi,%ecx
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [14 x i8] c"%d %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 = icmp ne i32 %6, 0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
%10 = select i1 %7, i1 true, i1 %9
br i1 %10, label %11, label %28
11: ; preds = %0, %11
%12 = phi i32 [ %25, %11 ], [ %8, %0 ]
%13 = phi i32 [ %23, %11 ], [ %6, %0 ]
%14 = add nsw i32 %12, %13
%15 = icmp slt i32 %13, %12
%16 = sub nsw i32 %12, %13
%17 = sub nsw i32 %13, %12
%18 = select i1 %15, i32 %16, i32 %17
%19 = mul nsw i32 %12, %13
%20 = sdiv i32 %13, %12
%21 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %18, i32 %19, i32 %20)
%22 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%23 = load i32, i32* %1
%24 = icmp ne i32 %23, 0
%25 = load i32, i32* %2
%26 = icmp ne i32 %25, 0
%27 = select i1 %24, i1 true, i1 %26
br i1 %27, label %11, label %28
28: ; preds = %11, %0
ret i32 0
}