#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 /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
int main(int argc, char *noargs[]) {
  int a, b, c, d;
  scanf("%d %d %d %d", &a, &b, &c, &d);
  if ((a == b + c + d) && (b + c == d) && (b == c))
    printf("S\n");
  else
    printf("N\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
add    -0x1c(%rbp),%ecx
add    -0x20(%rbp),%ecx
cmp    %ecx,%eax
jne    1192 <main+0x72>
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1192 <main+0x72>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1192 <main+0x72>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
jmp    119e <main+0x7e>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
mov    0xc(%rsp),%ecx
lea    (%rcx,%rax,1),%edx
mov    0x8(%rsp),%esi
lea    (%rdx,%rsi,1),%edi
xor    0x14(%rsp),%edi
xor    %edx,%esi
or     %edi,%esi
xor    %ecx,%eax
lea    0xea7(%rip),%rcx
lea    0xe9e(%rip),%rdi
or     %esi,%eax
cmove  %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d %d %d %d\00"
@str = [2 x i8] c"N\00"
@str.3 = [2 x i8] c"S\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6)
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = add nsw i32 %14, %13
%16 = load i32, i32* %6
%17 = add nsw i32 %15, %16
%18 = icmp eq i32 %12, %17
%19 = icmp eq i32 %15, %16
%20 = and i1 %19, %18
%21 = icmp eq i32 %13, %14
%22 = select i1 %20, i1 %21, i1 false
%23 = select i1 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0)
%24 = call i32 @puts(i8* dereferenceable(1) %23)
ret i32 0
}