#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*/ go_to_xy(unsigned int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ spacer(char, int);
void gfx_draw_striker(unsigned int oldX, unsigned int newX) {
  oldX >>= 8;
  newX >>= 8;
  char dX = (char)newX - (char)oldX;
  if (dX > 0) {
    go_to_xy(oldX - 5, 92);
    spacer(dX, (int)' ');
    printf("%c", 204);
    spacer(10, 205);
    printf("%c", 185);
  } else if (dX < 0) {
    go_to_xy(newX - 5, 92);
    printf("%c", 204);
    spacer(10, 205);
    printf("%c", 185);
    spacer(-dX, (int)' ');
  }
}


x86 assembly (clang, -O0):
<gfx_draw_striker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
mov    -0x4(%rbp),%ecx
movsbl %cl,%ecx
sub    %ecx,%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jle    11c2 <gfx_draw_striker+0x92>
mov    -0x4(%rbp),%edi
sub    $0x5,%edi
mov    $0x5c,%esi
call   1040 <go_to_xy@plt>
mov    $0x20,%esi
movsbl -0x9(%rbp),%edi
call   1050 <spacer@plt>
lea    0xe6d(%rip),%rdi
mov    $0xcc,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0xcd,%esi
call   1050 <spacer@plt>
lea    0xe4d(%rip),%rdi
mov    $0xb9,%esi
call   1030 <printf@plt>
jmp    122a <gfx_draw_striker+0xfa>
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jge    1225 <gfx_draw_striker+0xf5>
mov    -0x8(%rbp),%edi
sub    $0x5,%edi
mov    $0x5c,%esi
call   1040 <go_to_xy@plt>
lea    0xe1a(%rip),%rdi
mov    $0xcc,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0xcd,%esi
call   1050 <spacer@plt>
lea    0xdfa(%rip),%rdi
mov    $0xb9,%esi
call   1030 <printf@plt>
movsbl -0x9(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    $0x20,%esi
movsbl %al,%edi
call   1050 <spacer@plt>
jmp    122a <gfx_draw_striker+0xfa>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfx_draw_striker>:
push   %rbp
push   %rbx
push   %rax
shr    $0x8,%edi
shr    $0x8,%esi
mov    %esi,%ebp
sub    %edi,%ebp
mov    %ebp,%eax
shl    $0x18,%eax
test   %eax,%eax
jle    1197 <gfx_draw_striker+0x67>
add    $0xfffffffb,%edi
mov    $0x5c,%esi
call   1040 <go_to_xy@plt>
movsbl %bpl,%edi
mov    $0x20,%esi
call   1050 <spacer@plt>
lea    0xe98(%rip),%rbx
mov    %rbx,%rdi
mov    $0xcc,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0xcd,%esi
call   1050 <spacer@plt>
mov    %rbx,%rdi
mov    $0xb9,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>
js     11a0 <gfx_draw_striker+0x70>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
add    $0xfffffffb,%esi
mov    %esi,%edi
mov    $0x5c,%esi
call   1040 <go_to_xy@plt>
lea    0xe4a(%rip),%rbx
mov    %rbx,%rdi
mov    $0xcc,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
mov    $0xcd,%esi
call   1050 <spacer@plt>
mov    %rbx,%rdi
mov    $0xb9,%esi
call   1030 <printf@plt>
neg    %bpl
movsbl %bpl,%edi
mov    $0x20,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <spacer@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @gfx_draw_striker(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = lshr i32 %6, 8
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = lshr i32 %8, 8
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = trunc i32 %10 to i8
%12 = sext i8 %11 to i32
%13 = load i32, i32* %3
%14 = trunc i32 %13 to i8
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %12, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %5
%18 = load i8, i8* %5
%19 = sext i8 %18 to i32
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %30
21: ; preds = %2
%22 = load i32, i32* %3
%23 = sub i32 %22, 5
%24 = call i32 @go_to_xy(i32 %23, i32 92)
%25 = load i8, i8* %5
%26 = call i32 @spacer(i8 signext %25, i32 32)
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 204)
%28 = call i32 @spacer(i8 signext 10, i32 205)
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 185)
br label %47
30: ; preds = %2
%31 = load i8, i8* %5
%32 = sext i8 %31 to i32
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %46
34: ; preds = %30
%35 = load i32, i32* %4
%36 = sub i32 %35, 5
%37 = call i32 @go_to_xy(i32 %36, i32 92)
%38 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 204)
%39 = call i32 @spacer(i8 signext 10, i32 205)
%40 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 185)
%41 = load i8, i8* %5
%42 = sext i8 %41 to i32
%43 = sub nsw i32 0, %42
%44 = trunc i32 %43 to i8
%45 = call i32 @spacer(i8 signext %44, i32 32)
br label %46
46: ; preds = %34, %30
br label %47
47: ; preds = %46, %21
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @gfx_draw_striker(i32 %0, i32 %1) {
%3 = lshr i32 %0, 8
%4 = lshr i32 %1, 8
%5 = sub nsw i32 %4, %3
%6 = shl i32 %5, 24
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = trunc i32 %5 to i8
%10 = add nsw i32 %3, -5
%11 = tail call i32 @go_to_xy(i32 %10, i32 92)
%12 = tail call i32 @spacer(i8 signext %9, i32 32)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 204)
%14 = tail call i32 @spacer(i8 signext 10, i32 205)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 185)
br label %27
16: ; preds = %2
%17 = icmp slt i32 %6, 0
br i1 %17, label %18, label %27
18: ; preds = %16
%19 = add nsw i32 %4, -5
%20 = tail call i32 @go_to_xy(i32 %19, i32 92)
%21 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 204)
%22 = tail call i32 @spacer(i8 signext 10, i32 205)
%23 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 185)
%24 = trunc i32 %5 to i8
%25 = sub i8 0, %24
%26 = tail call i32 @spacer(i8 signext %25, i32 32)
br label %27
27: ; preds = %16, %18, %8
ret void
}