#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 */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ Button1;
int /*<<< orphan*/ XCloseDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/);
int /*<<< orphan*/ XRootWindow(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ getMouseCoords(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int *, int *);
int /*<<< orphan*/ moveMouse(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                             int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sendClick(int /*<<< orphan*/ *, int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
void parseMessage(char message[]) {
  Display *dpy = XOpenDisplay(0);
  Window rootWindow = XRootWindow(dpy, 0);
  int x, y;
  getMouseCoords(dpy, rootWindow, &x, &y);
  if (strcmp(message, "MOVE LEFT") == 0) {
    printf("Moving to %d,%d\n", x - 5, y);
    moveMouse(dpy, rootWindow, x -= 5, y);
  } else if (strcmp(message, "MOVE RIGHT") == 0) {
    printf("Moving to %d,%d\n", x + 5, y);
    moveMouse(dpy, rootWindow, x += 5, y);
  } else if (strcmp(message, "MOVE UP") == 0) {
    printf("Moving to %d,%d\n", x, y);
    moveMouse(dpy, rootWindow, x, y -= 5);
  } else if (strcmp(message, "MOVE DOWN") == 0) {
    printf("Moving to %d,%d\n", x, y - 5);
    moveMouse(dpy, rootWindow, x, y += 5);
  } else if (strcmp(message, "RIGHT CLICK") == 0) {
    printf("Right clicking\n");
    sendClick(dpy, Button1);
  } else if (strcmp(message, "LEFT CLICK") == 0) {
    printf("Left clicking\n");
    sendClick(dpy, Button1);
  } else {
    printf("%s\n", message);
  }
  XCloseDisplay(dpy);
}


x86 assembly (clang, -O0):
<parseMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1070 <XOpenDisplay@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   10a0 <XRootWindow@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1030 <getMouseCoords@plt>
mov    -0x8(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1207 <parseMessage+0x87>
mov    -0x18(%rbp),%esi
sub    $0x5,%esi
mov    -0x1c(%rbp),%edx
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
sub    $0x5,%edx
mov    %edx,-0x18(%rbp)
mov    -0x1c(%rbp),%ecx
call   1090 <moveMouse@plt>
jmp    1397 <parseMessage+0x217>
mov    -0x8(%rbp),%rdi
lea    0xe09(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1255 <parseMessage+0xd5>
mov    -0x18(%rbp),%esi
add    $0x5,%esi
mov    -0x1c(%rbp),%edx
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
add    $0x5,%edx
mov    %edx,-0x18(%rbp)
mov    -0x1c(%rbp),%ecx
call   1090 <moveMouse@plt>
jmp    1392 <parseMessage+0x212>
mov    -0x8(%rbp),%rdi
lea    0xdc6(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12a0 <parseMessage+0x120>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xd8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
sub    $0x5,%ecx
mov    %ecx,-0x1c(%rbp)
call   1090 <moveMouse@plt>
jmp    138d <parseMessage+0x20d>
mov    -0x8(%rbp),%rdi
lea    0xd83(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12ee <parseMessage+0x16e>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
sub    $0x5,%edx
lea    0xd40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
add    $0x5,%ecx
mov    %ecx,-0x1c(%rbp)
call   1090 <moveMouse@plt>
jmp    1388 <parseMessage+0x208>
mov    -0x8(%rbp),%rdi
lea    0xd3f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    132d <parseMessage+0x1ad>
lea    0xd35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    0x2cc7(%rip),%rax
mov    (%rax),%esi
call   1050 <sendClick@plt>
jmp    1383 <parseMessage+0x203>
mov    -0x8(%rbp),%rdi
lea    0xd1c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    136c <parseMessage+0x1ec>
lea    0xd11(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    0x2c88(%rip),%rax
mov    (%rax),%esi
call   1050 <sendClick@plt>
jmp    137e <parseMessage+0x1fe>
mov    -0x8(%rbp),%rsi
lea    0xcf7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1383 <parseMessage+0x203>
jmp    1388 <parseMessage+0x208>
jmp    138d <parseMessage+0x20d>
jmp    1392 <parseMessage+0x212>
jmp    1397 <parseMessage+0x217>
mov    -0x10(%rbp),%rdi
call   1080 <XCloseDisplay@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseMessage>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbp
xor    %edi,%edi
call   1080 <XOpenDisplay@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   10b0 <XRootWindow@plt>
mov    %eax,%r14d
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <getMouseCoords@plt>
lea    0xe33(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1263 <parseMessage+0xd3>
lea    0xe36(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1285 <parseMessage+0xf5>
lea    0xe29(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12af <parseMessage+0x11f>
lea    0xe19(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     12d2 <parseMessage+0x142>
lea    0xe0b(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1316 <parseMessage+0x186>
lea    0xdff(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     131f <parseMessage+0x18f>
mov    %rbp,%rdi
call   1030 <puts@plt>
jmp    1305 <parseMessage+0x175>
mov    0xc(%rsp),%esi
add    $0xfffffffb,%esi
mov    0x8(%rsp),%edx
lea    0xd95(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edx
add    $0xfffffffb,%edx
jmp    12a5 <parseMessage+0x115>
mov    0xc(%rsp),%esi
add    $0x5,%esi
mov    0x8(%rsp),%edx
lea    0xd73(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edx
add    $0x5,%edx
mov    %edx,0xc(%rsp)
mov    0x8(%rsp),%ecx
jmp    12fa <parseMessage+0x16a>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xd4c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
add    $0xfffffffb,%ecx
jmp    12f6 <parseMessage+0x166>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
add    $0xfffffffb,%edx
lea    0xd26(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
add    $0x5,%ecx
mov    %ecx,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
call   10a0 <moveMouse@plt>
mov    %rbx,%rdi
call   1090 <XCloseDisplay@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0xd40(%rip),%rdi
jmp    1326 <parseMessage+0x196>
lea    0xd29(%rip),%rdi
call   1030 <puts@plt>
mov    0x2cb6(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1060 <sendClick@plt>
jmp    1305 <parseMessage+0x175>

LLVM IR (-O0):
@.str = [10 x i8] c"MOVE LEFT\00"
@.str.1 = [17 x i8] c"Moving to %d,%d\0A\00"
@.str.2 = [11 x i8] c"MOVE RIGHT\00"
@.str.3 = [8 x i8] c"MOVE UP\00"
@.str.4 = [10 x i8] c"MOVE DOWN\00"
@.str.5 = [12 x i8] c"RIGHT CLICK\00"
@.str.6 = [16 x i8] c"Right clicking\0A\00"
@Button1 = global i32 0
@.str.7 = [11 x i8] c"LEFT CLICK\00"
@.str.8 = [15 x i8] c"Left clicking\0A\00"
@.str.9 = [4 x i8] c"%s\0A\00"
define void @parseMessage(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = call i32* @XOpenDisplay(i32 0)
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = call i32 @XRootWindow(i32* %8, i32 0)
store i32 %9, i32* %4
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = call i32 @getMouseCoords(i32* %10, i32 %11, i32* %5, i32* %6)
%13 = load i8*, i8** %2
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %27
16: ; preds = %1
%17 = load i32, i32* %5
%18 = sub nsw i32 %17, 5
%19 = load i32, i32* %6
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %19)
%21 = load i32*, i32** %3
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = sub nsw i32 %23, 5
store i32 %24, i32* %5
%25 = load i32, i32* %6
%26 = call i32 @moveMouse(i32* %21, i32 %22, i32 %24, i32 %25)
br label %97
27: ; preds = %1
%28 = load i8*, i8** %2
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %42
31: ; preds = %27
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 5
%34 = load i32, i32* %6
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %33, i32 %34)
%36 = load i32*, i32** %3
%37 = load i32, i32* %4
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 5
store i32 %39, i32* %5
%40 = load i32, i32* %6
%41 = call i32 @moveMouse(i32* %36, i32 %37, i32 %39, i32 %40)
br label %96
42: ; preds = %27
%43 = load i8*, i8** %2
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %56
46: ; preds = %42
%47 = load i32, i32* %5
%48 = load i32, i32* %6
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %47, i32 %48)
%50 = load i32*, i32** %3
%51 = load i32, i32* %4
%52 = load i32, i32* %5
%53 = load i32, i32* %6
%54 = sub nsw i32 %53, 5
store i32 %54, i32* %6
%55 = call i32 @moveMouse(i32* %50, i32 %51, i32 %52, i32 %54)
br label %95
56: ; preds = %42
%57 = load i8*, i8** %2
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %71
60: ; preds = %56
%61 = load i32, i32* %5
%62 = load i32, i32* %6
%63 = sub nsw i32 %62, 5
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %61, i32 %63)
%65 = load i32*, i32** %3
%66 = load i32, i32* %4
%67 = load i32, i32* %5
%68 = load i32, i32* %6
%69 = add nsw i32 %68, 5
store i32 %69, i32* %6
%70 = call i32 @moveMouse(i32* %65, i32 %66, i32 %67, i32 %69)
br label %94
71: ; preds = %56
%72 = load i8*, i8** %2
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %80
75: ; preds = %71
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%77 = load i32*, i32** %3
%78 = load i32, i32* @Button1
%79 = call i32 @sendClick(i32* %77, i32 %78)
br label %93
80: ; preds = %71
%81 = load i8*, i8** %2
%82 = call i64 @strcmp(i8* %81, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %89
84: ; preds = %80
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0))
%86 = load i32*, i32** %3
%87 = load i32, i32* @Button1
%88 = call i32 @sendClick(i32* %86, i32 %87)
br label %92
89: ; preds = %80
%90 = load i8*, i8** %2
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %90)
br label %92
92: ; preds = %89, %84
br label %93
93: ; preds = %92, %75
br label %94
94: ; preds = %93, %60
br label %95
95: ; preds = %94, %46
br label %96
96: ; preds = %95, %31
br label %97
97: ; preds = %96, %16
%98 = load i32*, i32** %3
%99 = call i32 @XCloseDisplay(i32* %98)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"MOVE LEFT\00"
@.str.1 = [17 x i8] c"Moving to %d,%d\0A\00"
@.str.2 = [11 x i8] c"MOVE RIGHT\00"
@.str.3 = [8 x i8] c"MOVE UP\00"
@.str.4 = [10 x i8] c"MOVE DOWN\00"
@.str.5 = [12 x i8] c"RIGHT CLICK\00"
@Button1 = global i32 0
@.str.7 = [11 x i8] c"LEFT CLICK\00"
@str = [14 x i8] c"Left clicking\00"
@str.10 = [15 x i8] c"Right clicking\00"
define void @parseMessage(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = tail call i32* @XOpenDisplay(i32 0)
%5 = tail call i32 @XRootWindow(i32* %4, i32 0)
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = call i32 @getMouseCoords(i32* %4, i32 %5, i32* %2, i32* %3)
%9 = call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %1
%12 = load i32, i32* %2
%13 = add nsw i32 %12, -5
%14 = load i32, i32* %3
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
%16 = load i32, i32* %2
%17 = add nsw i32 %16, -5
store i32 %17, i32* %2
%18 = load i32, i32* %3
%19 = call i32 @moveMouse(i32* %4, i32 %5, i32 %17, i32 %18)
br label %71
20: ; preds = %1
%21 = call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %32
23: ; preds = %20
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 5
%26 = load i32, i32* %3
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %25, i32 %26)
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 5
store i32 %29, i32* %2
%30 = load i32, i32* %3
%31 = call i32 @moveMouse(i32* %4, i32 %5, i32 %29, i32 %30)
br label %71
32: ; preds = %20
%33 = call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %43
35: ; preds = %32
%36 = load i32, i32* %2
%37 = load i32, i32* %3
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %36, i32 %37)
%39 = load i32, i32* %2
%40 = load i32, i32* %3
%41 = add nsw i32 %40, -5
store i32 %41, i32* %3
%42 = call i32 @moveMouse(i32* %4, i32 %5, i32 %39, i32 %41)
br label %71
43: ; preds = %32
%44 = call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %55
46: ; preds = %43
%47 = load i32, i32* %2
%48 = load i32, i32* %3
%49 = add nsw i32 %48, -5
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %47, i32 %49)
%51 = load i32, i32* %2
%52 = load i32, i32* %3
%53 = add nsw i32 %52, 5
store i32 %53, i32* %3
%54 = call i32 @moveMouse(i32* %4, i32 %5, i32 %51, i32 %53)
br label %71
55: ; preds = %43
%56 = call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %62
58: ; preds = %55
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.10, i64 0, i64 0))
%60 = load i32, i32* @Button1
%61 = call i32 @sendClick(i32* %4, i32 %60)
br label %71
62: ; preds = %55
%63 = call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %69
65: ; preds = %62
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%67 = load i32, i32* @Button1
%68 = call i32 @sendClick(i32* %4, i32 %67)
br label %71
69: ; preds = %62
%70 = call i32 @puts(i8* dereferenceable(1) %0)
br label %71
71: ; preds = %23, %46, %65, %69, %58, %35, %11
%72 = call i32 @XCloseDisplay(i32* %4)
ret void
}