#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*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void term_move_r(int x, int y) {
  if (x > 0)
    fprintf(stdout, "\033[%dC", x);
  else if (x < 0)
    fprintf(stdout, "\033[%dD", -x);
  if (y > 0)
    fprintf(stdout, "\033[%dB", y);
  else if (y < 0)
    fprintf(stdout, "\033[%dA", -y);
}


x86 assembly (clang, -O0):
<term_move_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1145 <term_move_r+0x35>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
jmp    116e <term_move_r+0x5e>
cmpl   $0x0,-0x4(%rbp)
jge    1169 <term_move_r+0x59>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
sub    -0x4(%rbp),%edx
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
jmp    116e <term_move_r+0x5e>
cmpl   $0x0,-0x8(%rbp)
jle    1195 <term_move_r+0x85>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe81(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11be <term_move_r+0xae>
cmpl   $0x0,-0x8(%rbp)
jge    11b9 <term_move_r+0xa9>
mov    0x2e3a(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
sub    -0x8(%rbp),%edx
lea    0xe5e(%rip),%rsi
call   1030 <fprintf@plt>
jmp    11be <term_move_r+0xae>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_move_r>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%edx
test   %edi,%edi
jle    1130 <term_move_r+0x20>
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1132 <term_move_r+0x22>
js     1152 <term_move_r+0x42>
test   %ebx,%ebx
jle    114e <term_move_r+0x3e>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <fprintf@plt>
js     1166 <term_move_r+0x56>
pop    %rbx
ret
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
neg    %edx
lea    0xea2(%rip),%rsi
jmp    1129 <term_move_r+0x19>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
neg    %ebx
lea    0xe9a(%rip),%rsi
jmp    1146 <term_move_r+0x36>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [6 x i8] c"\1B[%dC\00"
@.str.1 = [6 x i8] c"\1B[%dD\00"
@.str.2 = [6 x i8] c"\1B[%dB\00"
@.str.3 = [6 x i8] c"\1B[%dA\00"
define void @term_move_r(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stdout
%9 = load i32, i32* %3
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %20
11: ; preds = %2
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i32, i32* @stdout
%16 = load i32, i32* %3
%17 = sub nsw i32 0, %16
%18 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %14, %11
br label %20
20: ; preds = %19, %7
%21 = load i32, i32* %4
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %20
%24 = load i32, i32* @stdout
%25 = load i32, i32* %4
%26 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %25)
br label %36
27: ; preds = %20
%28 = load i32, i32* %4
%29 = icmp slt i32 %28, 0
br i1 %29, label %30, label %35
30: ; preds = %27
%31 = load i32, i32* @stdout
%32 = load i32, i32* %4
%33 = sub nsw i32 0, %32
%34 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %30, %27
br label %36
36: ; preds = %35, %23
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c"\1B[%dC\00"
@.str.1 = [6 x i8] c"\1B[%dD\00"
@.str.2 = [6 x i8] c"\1B[%dB\00"
@.str.3 = [6 x i8] c"\1B[%dA\00"
define void @term_move_r(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %13
7: ; preds = %2
%8 = icmp slt i32 %0, 0
br i1 %8, label %9, label %13
9: ; preds = %7
%10 = load i32, i32* @stdout
%11 = sub nsw i32 0, %0
%12 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %7, %9, %4
%14 = icmp sgt i32 %1, 0
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i32, i32* @stdout
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %1)
br label %24
18: ; preds = %13
%19 = icmp slt i32 %1, 0
br i1 %19, label %20, label %24
20: ; preds = %18
%21 = load i32, i32* @stdout
%22 = sub nsw i32 0, %1
%23 = tail call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %18, %20, %15
ret void
}