#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 */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ step(int *, int, int, struct node *);
void move(char dir, int amt, int *cords, struct node *ll) {
  step(cords, dir == 'N' || dir == 'S' ? 1 : 0,
       dir == 'N' || dir == 'E' ? amt : amt * -1, ll);
}


x86 assembly (clang, -O0):
<move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x4e,%ecx
mov    %al,-0x19(%rbp)
je     1150 <move+0x40>
movsbl -0x1(%rbp),%eax
cmp    $0x53,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
mov    %eax,-0x2c(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x4e,%eax
je     117d <move+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x45,%eax
jne    1188 <move+0x78>
mov    -0x8(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    118f <move+0x7f>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <step@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move>:
mov    %rdx,%r8
cmp    $0x53,%dil
sete   %r9b
mov    %esi,%edx
neg    %edx
cmp    $0x45,%dil
cmove  %esi,%edx
cmp    $0x4e,%dil
sete   %al
cmove  %esi,%edx
or     %r9b,%al
movzbl %al,%esi
mov    %r8,%rdi
jmp    1030 <step@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
define void @move(i8 signext %0, i32 %1, i32* %2, %struct.node* %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32*
%8 = alloca %struct.node*
store i8 %0, i8* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store %struct.node* %3, %struct.node** %8
%9 = load i32*, i32** %7
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 78
br i1 %12, label %17, label %13
13: ; preds = %4
%14 = load i8, i8* %5
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 83
br label %17
17: ; preds = %13, %4
%18 = phi i1 [ true, %4 ], [ %16, %13 ]
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 1, i32 0
%21 = load i8, i8* %5
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 78
br i1 %23, label %28, label %24
24: ; preds = %17
%25 = load i8, i8* %5
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 69
br i1 %27, label %28, label %30
28: ; preds = %24, %17
%29 = load i32, i32* %6
br label %33
30: ; preds = %24
%31 = load i32, i32* %6
%32 = mul nsw i32 %31, -1
br label %33
33: ; preds = %30, %28
%34 = phi i32 [ %29, %28 ], [ %32, %30 ]
%35 = load %struct.node*, %struct.node** %8
%36 = call i32 @step(i32* %9, i32 %20, i32 %34, %struct.node* %35)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @move(i8 signext %0, i32 %1, i32* %2, %struct.node* %3) {
%5 = icmp eq i8 %0, 78
%6 = icmp eq i8 %0, 83
%7 = or i1 %5, %6
%8 = zext i1 %7 to i32
%9 = icmp eq i8 %0, 69
%10 = or i1 %5, %9
%11 = sub nsw i32 0, %1
%12 = select i1 %10, i32 %1, i32 %11
%13 = tail call i32 @step(i32* %2, i32 %8, i32 %12, %struct.node* %3)
ret void
}