#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 y;
typedef int x;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void p_move_abs(FILE *p, int x, int y) {
  if (x >= 0) {
    {
      fprintf(p, "\033[C");
      {
        (void)putc(((3) & 0xFF), (p));
        (void)putc((((3) & 0xFF00) >> 8), (p));
      };
    };
    (void)putc('\340', p);
    {
      (void)putc((((x)&0xFF00) >> 8), (p));
      (void)putc(((x)&0xFF), (p));
    };
  }
  if (y >= 0) {
    {
      fprintf(p, "\033[C");
      {
        (void)putc(((3) & 0xFF), (p));
        (void)putc((((3) & 0xFF00) >> 8), (p));
      };
    };
    (void)putc('\341', p);
    {
      (void)putc((((y)&0xFF00) >> 8), (p));
      (void)putc(((y)&0xFF), (p));
    };
  }
}


x86 assembly (clang, -O0):
<p_move_abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     119a <p_move_abs+0x7a>
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rsi
mov    $0x3,%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rsi
mov    $0xffffffe0,%edi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
and    $0xff00,%edi
sar    $0x8,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
cmpl   $0x0,-0x10(%rbp)
jl     1202 <p_move_abs+0xe2>
mov    -0x8(%rbp),%rdi
lea    0xe51(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rsi
mov    $0x3,%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rsi
mov    $0xffffffe1,%edi
call   1030 <putc@plt>
mov    -0x10(%rbp),%edi
and    $0xff00,%edi
sar    $0x8,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x10(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_move_abs>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
js     118b <p_move_abs+0x6b>
mov    %esi,%eax
lea    0xecc(%rip),%rdi
mov    $0x3,%esi
mov    %edx,%r14d
mov    $0x1,%edx
mov    %rbx,%rcx
mov    %eax,%ebp
call   1040 <fwrite@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
mov    $0xffffffe0,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
mov    %ebp,%eax
movzbl %ah,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
movzbl %bpl,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
mov    %r14d,%edx
test   %edx,%edx
js     11eb <p_move_abs+0xcb>
lea    0xe6a(%rip),%rdi
mov    $0x3,%esi
mov    %edx,%ebp
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
mov    $0xffffffe1,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
mov    %ebp,%eax
movzbl %ah,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
movzbl %bpl,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putc@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[C\00"
define void @p_move_abs(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %27
9: ; preds = %3
%10 = load i32*, i32** %4
%11 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = load i32*, i32** %4
%13 = call i32 @putc(i32 3, i32* %12)
%14 = load i32*, i32** %4
%15 = call i32 @putc(i32 0, i32* %14)
%16 = load i32*, i32** %4
%17 = call i32 @putc(i32 -32, i32* %16)
%18 = load i32, i32* %5
%19 = and i32 %18, 65280
%20 = ashr i32 %19, 8
%21 = load i32*, i32** %4
%22 = call i32 @putc(i32 %20, i32* %21)
%23 = load i32, i32* %5
%24 = and i32 %23, 255
%25 = load i32*, i32** %4
%26 = call i32 @putc(i32 %24, i32* %25)
br label %27
27: ; preds = %9, %3
%28 = load i32, i32* %6
%29 = icmp sge i32 %28, 0
br i1 %29, label %30, label %48
30: ; preds = %27
%31 = load i32*, i32** %4
%32 = call i32 @fprintf(i32* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%33 = load i32*, i32** %4
%34 = call i32 @putc(i32 3, i32* %33)
%35 = load i32*, i32** %4
%36 = call i32 @putc(i32 0, i32* %35)
%37 = load i32*, i32** %4
%38 = call i32 @putc(i32 -31, i32* %37)
%39 = load i32, i32* %6
%40 = and i32 %39, 65280
%41 = ashr i32 %40, 8
%42 = load i32*, i32** %4
%43 = call i32 @putc(i32 %41, i32* %42)
%44 = load i32, i32* %6
%45 = and i32 %44, 255
%46 = load i32*, i32** %4
%47 = call i32 @putc(i32 %45, i32* %46)
br label %48
48: ; preds = %30, %27
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[C\00"
define void @p_move_abs(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, -1
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %0)
%7 = tail call i32 @putc(i32 3, i32* %0)
%8 = tail call i32 @putc(i32 0, i32* %0)
%9 = tail call i32 @putc(i32 -32, i32* %0)
%10 = lshr i32 %1, 8
%11 = and i32 %10, 255
%12 = tail call i32 @putc(i32 %11, i32* %0)
%13 = and i32 %1, 255
%14 = tail call i32 @putc(i32 %13, i32* %0)
br label %15
15: ; preds = %5, %3
%16 = icmp sgt i32 %2, -1
br i1 %16, label %17, label %27
17: ; preds = %15
%18 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %0)
%19 = tail call i32 @putc(i32 3, i32* %0)
%20 = tail call i32 @putc(i32 0, i32* %0)
%21 = tail call i32 @putc(i32 -31, i32* %0)
%22 = lshr i32 %2, 8
%23 = and i32 %22, 255
%24 = tail call i32 @putc(i32 %23, i32* %0)
%25 = and i32 %2, 255
%26 = tail call i32 @putc(i32 %25, i32* %0)
br label %27
27: ; preds = %17, %15
ret void
}