#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*/ assert(int);
bool judgeCircle(char *moves) {
  int x = 0;
  int y = 0;
  for (int i = 0; moves[i] != '\0'; i++) {
    switch (moves[i]) {
    case 'U':
      y++;
      break;
    case 'D':
      y--;
      break;
    case 'L':
      x--;
      break;
    case 'R':
      x++;
      break;
    default:
      assert(false);
      break;
    }
  }
  return (x == 0 && y == 0);
}


x86 assembly (clang, -O0):
<judgeCircle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11ca <judgeCircle+0xba>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0xffffffbc,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x11,%eax
ja     11b0 <judgeCircle+0xa0>
mov    -0x20(%rbp),%rax
lea    0xe91(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b7 <judgeCircle+0xa7>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    11b7 <judgeCircle+0xa7>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11b7 <judgeCircle+0xa7>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b7 <judgeCircle+0xa7>
xor    %edi,%edi
call   1030 <assert@plt>
jmp    11bc <judgeCircle+0xac>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1131 <judgeCircle+0x21>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x21(%rbp)
jne    11e3 <judgeCircle+0xd3>
cmpl   $0x0,-0x10(%rbp)
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<judgeCircle>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     11a6 <judgeCircle+0x96>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %r14d,%r14d
lea    0xece(%rip),%rbp
xor    %r15d,%r15d
jmp    115b <judgeCircle+0x4b>
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <assert@plt>
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     11ac <judgeCircle+0x9c>
movsbl %al,%eax
add    $0xffffffbc,%eax
cmp    $0x11,%eax
ja     1140 <judgeCircle+0x30>
movslq 0x0(%rbp,%rax,4),%rax
add    %rbp,%rax
jmp    *%rax
add    $0xffffffff,%r14d
jmp    1150 <judgeCircle+0x40>
cs nopw 0x0(%rax,%rax,1)
add    $0xffffffff,%r15d
jmp    1150 <judgeCircle+0x40>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r15d
jmp    1150 <judgeCircle+0x40>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r14d
jmp    1150 <judgeCircle+0x40>
xor    %r15d,%r15d
xor    %r14d,%r14d
xor    %eax,%eax
or     %r14d,%r15d
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @judgeCircle(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %36, %1
%7 = load i8*, i8** %2
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %39
14: ; preds = %6
%15 = load i8*, i8** %2
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
switch i32 %20, label %33 [
i32 85, label %21
i32 68, label %24
i32 76, label %27
i32 82, label %30
]
21: ; preds = %14
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %35
24: ; preds = %14
%25 = load i32, i32* %4
%26 = add nsw i32 %25, -1
store i32 %26, i32* %4
br label %35
27: ; preds = %14
%28 = load i32, i32* %3
%29 = add nsw i32 %28, -1
store i32 %29, i32* %3
br label %35
30: ; preds = %14
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %35
33: ; preds = %14
%34 = call i32 @assert(i32 0)
br label %35
35: ; preds = %33, %30, %27, %24, %21
br label %36
36: ; preds = %35
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %6
39: ; preds = %6
%40 = load i32, i32* %3
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %39
%43 = load i32, i32* %4
%44 = icmp eq i32 %43, 0
br label %45
45: ; preds = %42, %39
%46 = phi i1 [ false, %39 ], [ %44, %42 ]
%47 = zext i1 %46 to i32
ret i32 %47
}

LLVM IR (-O2):
define i32 @judgeCircle(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %27, %1
%5 = phi i32 [ 0, %1 ], [ %28, %27 ]
%6 = phi i32 [ 0, %1 ], [ %29, %27 ]
%7 = icmp eq i32 %5, 0
%8 = icmp eq i32 %6, 0
%9 = select i1 %7, i1 %8, i1 false
%10 = zext i1 %9 to i32
ret i32 %10
11: ; preds = %1, %27
%12 = phi i64 [ %30, %27 ], [ 0, %1 ]
%13 = phi i8 [ %32, %27 ], [ %2, %1 ]
%14 = phi i32 [ %29, %27 ], [ 0, %1 ]
%15 = phi i32 [ %28, %27 ], [ 0, %1 ]
%16 = sext i8 %13 to i32
switch i32 %16, label %25 [
i32 85, label %17
i32 68, label %19
i32 76, label %21
i32 82, label %23
]
17: ; preds = %11
%18 = add nsw i32 %14, 1
br label %27
19: ; preds = %11
%20 = add nsw i32 %14, -1
br label %27
21: ; preds = %11
%22 = add nsw i32 %15, -1
br label %27
23: ; preds = %11
%24 = add nsw i32 %15, 1
br label %27
25: ; preds = %11
%26 = tail call i32 @assert(i32 0)
br label %27
27: ; preds = %17, %19, %21, %23, %25
%28 = phi i32 [ %15, %25 ], [ %24, %23 ], [ %22, %21 ], [ %15, %19 ], [ %15, %17 ]
%29 = phi i32 [ %14, %25 ], [ %14, %23 ], [ %14, %21 ], [ %20, %19 ], [ %18, %17 ]
%30 = add nuw i64 %12, 1
%31 = getelementptr inbounds i8, i8* %0, i64 %30
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, 0
br i1 %33, label %4, label %11
}