#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 /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int r, w, t;
  scanf("%d %d", &r, &w);
  t = (w / 400);
  r += t;
  w -= t * 400;
  if (r > 0 && w > 0) {
    printf("%d r %d w", r, w);
  } else if (r > 0) {
    printf("%d r", r);
  } else if (w > 0) {
    printf("%d w", w);
  }
  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    -0xc(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
imul   $0x190,-0x10(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1196 <main+0x76>
cmpl   $0x0,-0xc(%rbp)
jle    1196 <main+0x76>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11db <main+0xbb>
cmpl   $0x0,-0x8(%rbp)
jle    11b6 <main+0x96>
mov    -0x8(%rbp),%esi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d6 <main+0xb6>
cmpl   $0x0,-0xc(%rbp)
jle    11d1 <main+0xb1>
mov    -0xc(%rbp),%esi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d6 <main+0xb6>
jmp    11db <main+0xbb>
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>
movslq (%rsp),%rax
imul   $0x51eb851f,%rax,%rsi
mov    %rsi,%rcx
shr    $0x3f,%rcx
sar    $0x27,%rsi
add    %ecx,%esi
imul   $0xfffffe70,%esi,%edx
add    %eax,%edx
mov    %edx,(%rsp)
add    0x4(%rsp),%esi
mov    %esi,0x4(%rsp)
jle    1176 <main+0x56>
test   %edx,%edx
jle    1176 <main+0x56>
lea    0xe99(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1197 <main+0x77>
test   %esi,%esi
jle    1183 <main+0x63>
lea    0xe8f(%rip),%rdi
jmp    1190 <main+0x70>
test   %edx,%edx
jle    1197 <main+0x77>
lea    0xe7d(%rip),%rdi
mov    %edx,%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 = [10 x i8] c"%d r %d w\00"
@.str.2 = [5 x i8] c"%d r\00"
@.str.3 = [5 x i8] c"%d w\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%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* %3
%7 = sdiv i32 %6, 400
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %4
%12 = mul nsw i32 %11, 400
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %24
17: ; preds = %0
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %21, i32 %22)
br label %38
24: ; preds = %17, %0
%25 = load i32, i32* %2
%26 = icmp sgt i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* %2
%29 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %28)
br label %37
30: ; preds = %24
%31 = load i32, i32* %3
%32 = icmp sgt i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load i32, i32* %3
%35 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %33, %30
br label %37
37: ; preds = %36, %27
br label %38
38: ; preds = %37, %20
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [10 x i8] c"%d r %d w\00"
@.str.2 = [5 x i8] c"%d r\00"
@.str.3 = [5 x i8] c"%d w\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* %2
%7 = sdiv i32 %6, 400
%8 = load i32, i32* %1
%9 = add nsw i32 %8, %7
store i32 %9, i32* %1
%10 = mul nsw i32 %7, -400
%11 = add i32 %10, %6
store i32 %11, i32* %2
%12 = icmp sgt i32 %9, 0
%13 = icmp sgt i32 %11, 0
%14 = select i1 %12, i1 %13, i1 false
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %11)
br label %23
17: ; preds = %0
br i1 %12, label %18, label %20
18: ; preds = %17
%19 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %23
20: ; preds = %17
br i1 %13, label %21, label %23
21: ; preds = %20
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %11)
br label %23
23: ; preds = %18, %21, %20, %15
ret i32 0
}