#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*/ FS460_get_tv_active_lines(int *);
int /*<<< orphan*/ FS460_play_begin();
int /*<<< orphan*/ FS460_play_run(int);
int /*<<< orphan*/ fade(int /*<<< orphan*/, int, int, int);
int /*<<< orphan*/ move(int, int, int, int, int);
int /*<<< orphan*/ pause(int);
int /*<<< orphan*/ scale(int, int, int, int, int, int, int, int, int);
int /*<<< orphan*/ set(int /*<<< orphan*/, int /*<<< orphan*/, int, int,
                       int /*<<< orphan*/, int);
int /*<<< orphan*/ shutters(int, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ wipe(int /*<<< orphan*/, int, int, int, int, int, int, int,
                        int, int);
void long_demo(void) {
  int full_height;
  FS460_play_begin();
  FS460_get_tv_active_lines(&full_height);
  set(0, 0, 720, full_height, 0, 0x0001 | 0x0010);
  set(0, 0, 720, full_height, 0, 0x0001 | 0x0010);
  set(0, 0, 720, full_height, 0, 0x0001 | 0x0010);
  set(0, 0, 720, full_height, 0, 0x0001 | 0x0010);
  fade(0, 0x7F, 30, 1);
  pause(30);
  move(0, 0, -720, 0, 31);
  move(720, 0, 0, 0, 31);
  pause(30);
  scale(0, 0, 720, full_height, 90, 60, 630, full_height - 60, 31);
  pause(30);
  move(90, 60, 90, full_height, (full_height - 60) / 16);
  pause(15);
  move(90, -full_height + 120, 90, 60, (full_height - 60) / 16);
  pause(30);
  move(90, 60, 720, full_height, 105);
  scale(0, 0, 0, 0, 180, full_height / 4, 540, full_height * 3 / 4, 30);
  scale(180, full_height / 4, 540, full_height * 3 / 4, 0, 0, 720, full_height,
        30);
  pause(30);
  scale(0, 0, 720, full_height, 360, 100, 660, 100 + full_height * 10 / 24, 15);
  pause(30);
  scale(360, 100, 660, 100 + full_height * 10 / 24, 300, 300, 300, 300, 15);
  scale(300, 300, 300, 300, 120, 240, 360, 240 + full_height / 3, 15);
  pause(30);
  scale(120, 240, 360, 240 + full_height / 3, 100, 100, 100, 100, 15);
  scale(100, 100, 100, 100, 288, full_height * 2 / 5, 432, full_height * 3 / 5,
        15);
  pause(30);
  scale(288, full_height * 2 / 5, 432, full_height * 3 / 5, 360,
        full_height * 2 / 5, 360, full_height * 3 / 5, 15);
  scale(360, full_height / 4, 360, full_height * 3 / 4, 180, full_height / 4,
        540, full_height * 3 / 4, 15);
  pause(30);
  scale(180, full_height / 4, 540, full_height * 3 / 4, 360, full_height / 4,
        360, full_height * 3 / 4, 15);
  scale(360, full_height * 1 / 6, 360, full_height * 5 / 6, 120,
        full_height * 1 / 6, 600, full_height * 5 / 6, 15);
  pause(30);
  scale(120, full_height * 1 / 6, 600, full_height * 5 / 6, 120,
        full_height / 2, 600, full_height / 2, 15);
  scale(0, full_height / 2, 720, full_height / 2, 0, 0, 720, full_height, 15);
  pause(30);
  wipe(0, 0, 720, full_height, 0x00, 0x40, 0x40, 0x7F, 60, 0);
  pause(30);
  wipe(0, full_height, 720, 0, 0x40, 0x00, 0x7F, 0x40, 60, 1);
  pause(30);
  shutters(0x7F, 0, 30, 8);
  pause(60);
  FS460_play_run(0x0001);
}


x86 assembly (clang, -O0):
<long_demo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   10a0 <FS460_play_begin@plt>
lea    -0x4(%rbp),%rdi
call   1040 <FS460_get_tv_active_lines@plt>
mov    -0x4(%rbp),%ecx
xor    %r8d,%r8d
mov    $0x2d0,%edx
mov    $0x11,%r9d
mov    %r8d,%edi
mov    %r8d,%esi
call   10b0 <set@plt>
mov    -0x4(%rbp),%ecx
xor    %r8d,%r8d
mov    $0x2d0,%edx
mov    $0x11,%r9d
mov    %r8d,%edi
mov    %r8d,%esi
call   10b0 <set@plt>
mov    -0x4(%rbp),%ecx
xor    %r8d,%r8d
mov    $0x2d0,%edx
mov    $0x11,%r9d
mov    %r8d,%edi
mov    %r8d,%esi
call   10b0 <set@plt>
mov    -0x4(%rbp),%ecx
xor    %r8d,%r8d
mov    $0x2d0,%edx
mov    $0x11,%r9d
mov    %r8d,%edi
mov    %r8d,%esi
call   10b0 <set@plt>
xor    %edi,%edi
mov    $0x7f,%esi
mov    $0x1e,%edx
mov    $0x1,%ecx
call   1080 <fade@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
xor    %ecx,%ecx
mov    $0xfffffd30,%edx
mov    $0x1f,%r8d
mov    %ecx,%edi
mov    %ecx,%esi
call   10c0 <move@plt>
mov    $0x2d0,%edi
xor    %ecx,%ecx
mov    $0x1f,%r8d
mov    %ecx,%esi
mov    %ecx,%edx
call   10c0 <move@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    $0x3c,%eax
xor    %esi,%esi
mov    $0x2d0,%edx
mov    $0x5a,%r8d
mov    $0x3c,%r9d
mov    %esi,%edi
movl   $0x276,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0x1f,0x10(%rsp)
call   1070 <scale@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    $0x3c,%eax
mov    $0x10,%esi
cltd
idiv   %esi
mov    %eax,%r8d
mov    $0x5a,%edx
mov    $0x3c,%esi
mov    %edx,%edi
call   10c0 <move@plt>
mov    $0xf,%edi
call   1060 <pause@plt>
xor    %esi,%esi
sub    -0x4(%rbp),%esi
add    $0x78,%esi
mov    -0x4(%rbp),%eax
sub    $0x3c,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%r8d
mov    $0x5a,%edx
mov    $0x3c,%ecx
mov    %edx,%edi
call   10c0 <move@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    -0x4(%rbp),%ecx
mov    $0x5a,%edi
mov    $0x3c,%esi
mov    $0x2d0,%edx
mov    $0x69,%r8d
call   10c0 <move@plt>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%r9d
imul   $0x3,-0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %ecx,%ecx
mov    $0xb4,%r8d
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
movl   $0x21c,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0x1e,0x10(%rsp)
call   1070 <scale@plt>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
imul   $0x3,-0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
mov    $0xb4,%edi
mov    $0x21c,%edx
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x2d0,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0x1e,0x10(%rsp)
call   1070 <scale@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    -0x4(%rbp),%ecx
imul   $0xa,-0x4(%rbp),%eax
mov    $0x18,%esi
cltd
idiv   %esi
add    $0x64,%eax
xor    %esi,%esi
mov    $0x2d0,%edx
mov    $0x168,%r8d
mov    $0x64,%r9d
mov    %esi,%edi
movl   $0x294,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0xf,0x10(%rsp)
call   1070 <scale@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
imul   $0xa,-0x4(%rbp),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
add    $0x64,%ecx
mov    $0x168,%edi
mov    $0x64,%esi
mov    $0x294,%edx
mov    $0x12c,%r9d
mov    %r9d,%r8d
movl   $0x12c,(%rsp)
movl   $0x12c,0x8(%rsp)
movl   $0xf,0x10(%rsp)
call   1070 <scale@plt>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0xf0,%eax
mov    $0x12c,%ecx
mov    $0x78,%r8d
mov    $0xf0,%r9d
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
movl   $0x168,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0xf,0x10(%rsp)
call   1070 <scale@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
add    $0xf0,%ecx
mov    $0x78,%edi
mov    $0xf0,%esi
mov    $0x168,%edx
mov    $0x64,%r9d
mov    %r9d,%r8d
movl   $0x64,(%rsp)
movl   $0x64,0x8(%rsp)
movl   $0xf,0x10(%rsp)
call   1070 <scale@plt>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,%r9d
imul   $0x3,-0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    $0x64,%ecx
mov    $0x120,%r8d
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
movl   $0x1b0,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0xf,0x10(%rsp)
call   1070 <scale@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
imul   $0x3,-0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    $0x5,%edi
cltd
idiv   %edi
mov    %eax,%r9d
imul   $0x3,-0x4(%rbp),%eax
mov    $0x5,%edi
cltd
idiv   %edi
mov    $0x120,%edi
mov    $0x1b0,%edx
mov    $0x168,%r8d
movl   $0x168,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0xf,0x10(%rsp)
call   1070 <scale@plt>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
imul   $0x3,-0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
mov    $0x4,%edi
cltd
idiv   %edi
mov    %eax,%r9d
imul   $0x3,-0x4(%rbp),%eax
mov    $0x4,%edi
cltd
idiv   %edi
mov    $0x168,%edx
mov    $0xb4,%r8d
mov    %edx,%edi
movl   $0x21c,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0xf,0x10(%rsp)
call   1070 <scale@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
imul   $0x3,-0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
mov    $0x4,%edi
cltd
idiv   %edi
mov    %eax,%r9d
imul   $0x3,-0x4(%rbp),%eax
mov    $0x4,%edi
cltd
idiv   %edi
mov    $0xb4,%edi
mov    $0x21c,%edx
mov    $0x168,%r8d
movl   $0x168,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0xf,0x10(%rsp)
call   1070 <scale@plt>
mov    -0x4(%rbp),%eax
shl    $0x0,%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
imul   $0x5,-0x4(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
shl    $0x0,%eax
mov    $0x6,%edi
cltd
idiv   %edi
mov    %eax,%r9d
imul   $0x5,-0x4(%rbp),%eax
mov    $0x6,%edi
cltd
idiv   %edi
mov    $0x168,%edx
mov    $0x78,%r8d
mov    %edx,%edi
movl   $0x258,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0xf,0x10(%rsp)
call   1070 <scale@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    -0x4(%rbp),%eax
shl    $0x0,%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
imul   $0x5,-0x4(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
mov    $0x2,%edi
cltd
idiv   %edi
mov    %eax,%r9d
mov    -0x4(%rbp),%eax
mov    $0x2,%edi
cltd
idiv   %edi
mov    $0x78,%r8d
mov    $0x258,%edx
mov    %r8d,%edi
movl   $0x258,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0xf,0x10(%rsp)
call   1070 <scale@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
xor    %r9d,%r9d
mov    $0x2d0,%edx
mov    %r9d,%edi
mov    %r9d,%r8d
movl   $0x2d0,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0xf,0x10(%rsp)
call   1070 <scale@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    -0x4(%rbp),%ecx
xor    %r8d,%r8d
mov    $0x2d0,%edx
mov    $0x40,%r9d
mov    %r8d,%edi
mov    %r8d,%esi
movl   $0x40,(%rsp)
movl   $0x7f,0x8(%rsp)
movl   $0x3c,0x10(%rsp)
movl   $0x0,0x18(%rsp)
call   1050 <wipe@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    -0x4(%rbp),%esi
xor    %r9d,%r9d
mov    $0x2d0,%edx
mov    $0x40,%r8d
mov    %r9d,%edi
mov    %r9d,%ecx
movl   $0x7f,(%rsp)
movl   $0x40,0x8(%rsp)
movl   $0x3c,0x10(%rsp)
movl   $0x1,0x18(%rsp)
call   1050 <wipe@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    $0x7f,%edi
xor    %esi,%esi
mov    $0x1e,%edx
mov    $0x8,%ecx
call   1030 <shutters@plt>
mov    $0x3c,%edi
call   1060 <pause@plt>
mov    $0x1,%edi
call   1090 <FS460_play_run@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_demo>:
push   %rax
xor    %eax,%eax
call   10a0 <FS460_play_begin@plt>
lea    0x4(%rsp),%rdi
call   1040 <FS460_get_tv_active_lines@plt>
mov    0x4(%rsp),%ecx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x2d0,%edx
xor    %r8d,%r8d
mov    $0x11,%r9d
call   10b0 <set@plt>
mov    0x4(%rsp),%ecx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x2d0,%edx
xor    %r8d,%r8d
mov    $0x11,%r9d
call   10b0 <set@plt>
mov    0x4(%rsp),%ecx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x2d0,%edx
xor    %r8d,%r8d
mov    $0x11,%r9d
call   10b0 <set@plt>
mov    0x4(%rsp),%ecx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x2d0,%edx
xor    %r8d,%r8d
mov    $0x11,%r9d
call   10b0 <set@plt>
xor    %edi,%edi
mov    $0x7f,%esi
mov    $0x1e,%edx
mov    $0x1,%ecx
call   1080 <fade@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0xfffffd30,%edx
xor    %ecx,%ecx
mov    $0x1f,%r8d
call   10c0 <move@plt>
mov    $0x2d0,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1f,%r8d
call   10c0 <move@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    0x4(%rsp),%ecx
lea    -0x3c(%rcx),%eax
sub    $0x8,%rsp
xor    %edi,%edi
xor    %esi,%esi
mov    $0x2d0,%edx
mov    $0x5a,%r8d
mov    $0x3c,%r9d
push   $0x1f
push   %rax
push   $0x276
call   1070 <scale@plt>
add    $0x20,%rsp
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    0x4(%rsp),%ecx
lea    -0x3c(%rcx),%eax
lea    -0x2d(%rcx),%r8d
test   %eax,%eax
cmovns %eax,%r8d
sar    $0x4,%r8d
mov    $0x5a,%edi
mov    $0x3c,%esi
mov    $0x5a,%edx
call   10c0 <move@plt>
mov    $0xf,%edi
call   1060 <pause@plt>
mov    0x4(%rsp),%r8d
mov    $0x78,%esi
sub    %r8d,%esi
lea    -0x3c(%r8),%eax
add    $0xffffffd3,%r8d
test   %eax,%eax
cmovns %eax,%r8d
sar    $0x4,%r8d
mov    $0x5a,%edi
mov    $0x5a,%edx
mov    $0x3c,%ecx
call   10c0 <move@plt>
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    0x4(%rsp),%ecx
mov    $0x5a,%edi
mov    $0x3c,%esi
mov    $0x2d0,%edx
mov    $0x69,%r8d
call   10c0 <move@plt>
mov    0x4(%rsp),%eax
lea    0x3(%rax),%r9d
test   %eax,%eax
cmovns %eax,%r9d
sar    $0x2,%r9d
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rax,2),%eax
add    $0x3,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x2,%eax
sub    $0x8,%rsp
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0xb4,%r8d
push   $0x1e
push   %rax
push   $0x21c
call   1070 <scale@plt>
add    $0x20,%rsp
mov    0x4(%rsp),%eax
lea    0x3(%rax),%esi
test   %eax,%eax
cmovns %eax,%esi
sar    $0x2,%esi
lea    (%rax,%rax,2),%edx
lea    (%rax,%rax,2),%ecx
add    $0x3,%ecx
test   %edx,%edx
cmovns %edx,%ecx
sar    $0x2,%ecx
sub    $0x8,%rsp
mov    $0xb4,%edi
mov    $0x21c,%edx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x1e
push   %rax
push   $0x2d0
call   1070 <scale@plt>
add    $0x20,%rsp
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    0x4(%rsp),%ecx
lea    (%rcx,%rcx,1),%eax
lea    (%rax,%rax,4),%eax
cltq
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rdx
shr    $0x20,%rdx
sar    $0x2,%edx
shr    $0x3f,%rax
add    %edx,%eax
add    $0x64,%eax
sub    $0x8,%rsp
xor    %edi,%edi
xor    %esi,%esi
mov    $0x2d0,%edx
mov    $0x168,%r8d
mov    $0x64,%r9d
push   $0xf
push   %rax
push   $0x294
call   1070 <scale@plt>
add    $0x20,%rsp
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    0x4(%rsp),%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
cltq
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x20,%rcx
sar    $0x2,%ecx
shr    $0x3f,%rax
add    %eax,%ecx
add    $0x64,%ecx
sub    $0x8,%rsp
mov    $0x168,%edi
mov    $0x64,%esi
mov    $0x294,%edx
mov    $0x12c,%r8d
mov    $0x12c,%r9d
push   $0xf
push   $0x12c
push   $0x12c
call   1070 <scale@plt>
add    $0x20,%rsp
movslq 0x4(%rsp),%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x20,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0xf0,%eax
sub    $0x8,%rsp
mov    $0x12c,%edi
mov    $0x12c,%esi
mov    $0x12c,%edx
mov    $0x12c,%ecx
mov    $0x78,%r8d
mov    $0xf0,%r9d
push   $0xf
push   %rax
push   $0x168
call   1070 <scale@plt>
add    $0x20,%rsp
mov    $0x1e,%edi
call   1060 <pause@plt>
movslq 0x4(%rsp),%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x20,%rcx
shr    $0x3f,%rax
add    %eax,%ecx
add    $0xf0,%ecx
sub    $0x8,%rsp
mov    $0x78,%edi
mov    $0xf0,%esi
mov    $0x168,%edx
mov    $0x64,%r8d
mov    $0x64,%r9d
push   $0xf
push   $0x64
push   $0x64
call   1070 <scale@plt>
add    $0x20,%rsp
mov    0x4(%rsp),%eax
lea    (%rax,%rax,1),%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%r9
mov    %r9,%rcx
shr    $0x3f,%rcx
shr    $0x20,%r9
sar    %r9d
add    %ecx,%r9d
lea    (%rax,%rax,2),%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
sar    %eax
add    %ecx,%eax
sub    $0x8,%rsp
mov    $0x64,%edi
mov    $0x64,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
mov    $0x120,%r8d
push   $0xf
push   %rax
push   $0x1b0
call   1070 <scale@plt>
add    $0x20,%rsp
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    0x4(%rsp),%eax
lea    (%rax,%rax,1),%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rsi
mov    %rsi,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rsi
sar    %esi
add    %ecx,%esi
lea    (%rax,%rax,2),%eax
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
shr    $0x20,%rcx
sar    %ecx
add    %eax,%ecx
sub    $0x8,%rsp
mov    $0x120,%edi
mov    $0x1b0,%edx
mov    $0x168,%r8d
mov    %esi,%r9d
push   $0xf
push   %rcx
push   $0x168
call   1070 <scale@plt>
add    $0x20,%rsp
mov    0x4(%rsp),%eax
lea    0x3(%rax),%esi
test   %eax,%eax
cmovns %eax,%esi
sar    $0x2,%esi
lea    (%rax,%rax,2),%edx
lea    (%rax,%rax,2),%ecx
add    $0x3,%ecx
test   %edx,%edx
cmovns %edx,%ecx
sar    $0x2,%ecx
sub    $0x8,%rsp
mov    $0x168,%edi
mov    $0x168,%edx
mov    $0xb4,%r8d
mov    %esi,%r9d
push   $0xf
push   %rcx
push   $0x21c
call   1070 <scale@plt>
add    $0x20,%rsp
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    0x4(%rsp),%eax
lea    0x3(%rax),%esi
test   %eax,%eax
cmovns %eax,%esi
sar    $0x2,%esi
lea    (%rax,%rax,2),%edx
lea    (%rax,%rax,2),%ecx
add    $0x3,%ecx
test   %edx,%edx
cmovns %edx,%ecx
sar    $0x2,%ecx
sub    $0x8,%rsp
mov    $0xb4,%edi
mov    $0x21c,%edx
mov    $0x168,%r8d
mov    %esi,%r9d
push   $0xf
push   %rcx
push   $0x168
call   1070 <scale@plt>
add    $0x20,%rsp
movslq 0x4(%rsp),%rax
imul   $0x2aaaaaab,%rax,%rsi
mov    %rsi,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rsi
add    %ecx,%esi
lea    (%rax,%rax,4),%eax
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
shr    $0x20,%rcx
add    %eax,%ecx
sub    $0x8,%rsp
mov    $0x168,%edi
mov    $0x168,%edx
mov    $0x78,%r8d
mov    %esi,%r9d
push   $0xf
push   %rcx
push   $0x258
call   1070 <scale@plt>
add    $0x20,%rsp
mov    $0x1e,%edi
call   1060 <pause@plt>
movslq 0x4(%rsp),%rax
imul   $0x2aaaaaab,%rax,%rsi
mov    %rsi,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rsi
add    %ecx,%esi
lea    (%rax,%rax,4),%ecx
movslq %ecx,%rcx
imul   $0x2aaaaaab,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
mov    %eax,%r9d
shr    $0x1f,%r9d
add    %eax,%r9d
sar    %r9d
sub    $0x8,%rsp
mov    $0x78,%edi
mov    $0x258,%edx
mov    $0x78,%r8d
push   $0xf
push   %r9
push   $0x258
call   1070 <scale@plt>
add    $0x20,%rsp
mov    0x4(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
sub    $0x8,%rsp
xor    %edi,%edi
mov    %ecx,%esi
mov    $0x2d0,%edx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0xf
push   %rax
push   $0x2d0
call   1070 <scale@plt>
add    $0x20,%rsp
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    0x4(%rsp),%ecx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x2d0,%edx
xor    %r8d,%r8d
mov    $0x40,%r9d
push   $0x0
push   $0x3c
push   $0x7f
push   $0x40
call   1050 <wipe@plt>
add    $0x20,%rsp
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    0x4(%rsp),%esi
xor    %edi,%edi
mov    $0x2d0,%edx
xor    %ecx,%ecx
mov    $0x40,%r8d
xor    %r9d,%r9d
push   $0x1
push   $0x3c
push   $0x40
push   $0x7f
call   1050 <wipe@plt>
add    $0x20,%rsp
mov    $0x1e,%edi
call   1060 <pause@plt>
mov    $0x7f,%edi
xor    %esi,%esi
mov    $0x1e,%edx
mov    $0x8,%ecx
call   1030 <shutters@plt>
mov    $0x3c,%edi
call   1060 <pause@plt>
mov    $0x1,%edi
call   1090 <FS460_play_run@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @long_demo() {
%1 = alloca i32
%2 = call i32 (...) @FS460_play_begin()
%3 = call i32 @FS460_get_tv_active_lines(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @set(i32 0, i32 0, i32 720, i32 %4, i32 0, i32 17)
%6 = load i32, i32* %1
%7 = call i32 @set(i32 0, i32 0, i32 720, i32 %6, i32 0, i32 17)
%8 = load i32, i32* %1
%9 = call i32 @set(i32 0, i32 0, i32 720, i32 %8, i32 0, i32 17)
%10 = load i32, i32* %1
%11 = call i32 @set(i32 0, i32 0, i32 720, i32 %10, i32 0, i32 17)
%12 = call i32 @fade(i32 0, i32 127, i32 30, i32 1)
%13 = call i32 @pause(i32 30)
%14 = call i32 @move(i32 0, i32 0, i32 -720, i32 0, i32 31)
%15 = call i32 @move(i32 720, i32 0, i32 0, i32 0, i32 31)
%16 = call i32 @pause(i32 30)
%17 = load i32, i32* %1
%18 = load i32, i32* %1
%19 = sub nsw i32 %18, 60
%20 = call i32 @scale(i32 0, i32 0, i32 720, i32 %17, i32 90, i32 60, i32 630, i32 %19, i32 31)
%21 = call i32 @pause(i32 30)
%22 = load i32, i32* %1
%23 = load i32, i32* %1
%24 = sub nsw i32 %23, 60
%25 = sdiv i32 %24, 16
%26 = call i32 @move(i32 90, i32 60, i32 90, i32 %22, i32 %25)
%27 = call i32 @pause(i32 15)
%28 = load i32, i32* %1
%29 = sub nsw i32 0, %28
%30 = add nsw i32 %29, 120
%31 = load i32, i32* %1
%32 = sub nsw i32 %31, 60
%33 = sdiv i32 %32, 16
%34 = call i32 @move(i32 90, i32 %30, i32 90, i32 60, i32 %33)
%35 = call i32 @pause(i32 30)
%36 = load i32, i32* %1
%37 = call i32 @move(i32 90, i32 60, i32 720, i32 %36, i32 105)
%38 = load i32, i32* %1
%39 = sdiv i32 %38, 4
%40 = load i32, i32* %1
%41 = mul nsw i32 %40, 3
%42 = sdiv i32 %41, 4
%43 = call i32 @scale(i32 0, i32 0, i32 0, i32 0, i32 180, i32 %39, i32 540, i32 %42, i32 30)
%44 = load i32, i32* %1
%45 = sdiv i32 %44, 4
%46 = load i32, i32* %1
%47 = mul nsw i32 %46, 3
%48 = sdiv i32 %47, 4
%49 = load i32, i32* %1
%50 = call i32 @scale(i32 180, i32 %45, i32 540, i32 %48, i32 0, i32 0, i32 720, i32 %49, i32 30)
%51 = call i32 @pause(i32 30)
%52 = load i32, i32* %1
%53 = load i32, i32* %1
%54 = mul nsw i32 %53, 10
%55 = sdiv i32 %54, 24
%56 = add nsw i32 100, %55
%57 = call i32 @scale(i32 0, i32 0, i32 720, i32 %52, i32 360, i32 100, i32 660, i32 %56, i32 15)
%58 = call i32 @pause(i32 30)
%59 = load i32, i32* %1
%60 = mul nsw i32 %59, 10
%61 = sdiv i32 %60, 24
%62 = add nsw i32 100, %61
%63 = call i32 @scale(i32 360, i32 100, i32 660, i32 %62, i32 300, i32 300, i32 300, i32 300, i32 15)
%64 = load i32, i32* %1
%65 = sdiv i32 %64, 3
%66 = add nsw i32 240, %65
%67 = call i32 @scale(i32 300, i32 300, i32 300, i32 300, i32 120, i32 240, i32 360, i32 %66, i32 15)
%68 = call i32 @pause(i32 30)
%69 = load i32, i32* %1
%70 = sdiv i32 %69, 3
%71 = add nsw i32 240, %70
%72 = call i32 @scale(i32 120, i32 240, i32 360, i32 %71, i32 100, i32 100, i32 100, i32 100, i32 15)
%73 = load i32, i32* %1
%74 = mul nsw i32 %73, 2
%75 = sdiv i32 %74, 5
%76 = load i32, i32* %1
%77 = mul nsw i32 %76, 3
%78 = sdiv i32 %77, 5
%79 = call i32 @scale(i32 100, i32 100, i32 100, i32 100, i32 288, i32 %75, i32 432, i32 %78, i32 15)
%80 = call i32 @pause(i32 30)
%81 = load i32, i32* %1
%82 = mul nsw i32 %81, 2
%83 = sdiv i32 %82, 5
%84 = load i32, i32* %1
%85 = mul nsw i32 %84, 3
%86 = sdiv i32 %85, 5
%87 = load i32, i32* %1
%88 = mul nsw i32 %87, 2
%89 = sdiv i32 %88, 5
%90 = load i32, i32* %1
%91 = mul nsw i32 %90, 3
%92 = sdiv i32 %91, 5
%93 = call i32 @scale(i32 288, i32 %83, i32 432, i32 %86, i32 360, i32 %89, i32 360, i32 %92, i32 15)
%94 = load i32, i32* %1
%95 = sdiv i32 %94, 4
%96 = load i32, i32* %1
%97 = mul nsw i32 %96, 3
%98 = sdiv i32 %97, 4
%99 = load i32, i32* %1
%100 = sdiv i32 %99, 4
%101 = load i32, i32* %1
%102 = mul nsw i32 %101, 3
%103 = sdiv i32 %102, 4
%104 = call i32 @scale(i32 360, i32 %95, i32 360, i32 %98, i32 180, i32 %100, i32 540, i32 %103, i32 15)
%105 = call i32 @pause(i32 30)
%106 = load i32, i32* %1
%107 = sdiv i32 %106, 4
%108 = load i32, i32* %1
%109 = mul nsw i32 %108, 3
%110 = sdiv i32 %109, 4
%111 = load i32, i32* %1
%112 = sdiv i32 %111, 4
%113 = load i32, i32* %1
%114 = mul nsw i32 %113, 3
%115 = sdiv i32 %114, 4
%116 = call i32 @scale(i32 180, i32 %107, i32 540, i32 %110, i32 360, i32 %112, i32 360, i32 %115, i32 15)
%117 = load i32, i32* %1
%118 = mul nsw i32 %117, 1
%119 = sdiv i32 %118, 6
%120 = load i32, i32* %1
%121 = mul nsw i32 %120, 5
%122 = sdiv i32 %121, 6
%123 = load i32, i32* %1
%124 = mul nsw i32 %123, 1
%125 = sdiv i32 %124, 6
%126 = load i32, i32* %1
%127 = mul nsw i32 %126, 5
%128 = sdiv i32 %127, 6
%129 = call i32 @scale(i32 360, i32 %119, i32 360, i32 %122, i32 120, i32 %125, i32 600, i32 %128, i32 15)
%130 = call i32 @pause(i32 30)
%131 = load i32, i32* %1
%132 = mul nsw i32 %131, 1
%133 = sdiv i32 %132, 6
%134 = load i32, i32* %1
%135 = mul nsw i32 %134, 5
%136 = sdiv i32 %135, 6
%137 = load i32, i32* %1
%138 = sdiv i32 %137, 2
%139 = load i32, i32* %1
%140 = sdiv i32 %139, 2
%141 = call i32 @scale(i32 120, i32 %133, i32 600, i32 %136, i32 120, i32 %138, i32 600, i32 %140, i32 15)
%142 = load i32, i32* %1
%143 = sdiv i32 %142, 2
%144 = load i32, i32* %1
%145 = sdiv i32 %144, 2
%146 = load i32, i32* %1
%147 = call i32 @scale(i32 0, i32 %143, i32 720, i32 %145, i32 0, i32 0, i32 720, i32 %146, i32 15)
%148 = call i32 @pause(i32 30)
%149 = load i32, i32* %1
%150 = call i32 @wipe(i32 0, i32 0, i32 720, i32 %149, i32 0, i32 64, i32 64, i32 127, i32 60, i32 0)
%151 = call i32 @pause(i32 30)
%152 = load i32, i32* %1
%153 = call i32 @wipe(i32 0, i32 %152, i32 720, i32 0, i32 64, i32 0, i32 127, i32 64, i32 60, i32 1)
%154 = call i32 @pause(i32 30)
%155 = call i32 @shutters(i32 127, i32 0, i32 30, i32 8)
%156 = call i32 @pause(i32 60)
%157 = call i32 @FS460_play_run(i32 1)
ret void
}

LLVM IR (-O2):
define void @long_demo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @FS460_play_begin()
%4 = call i32 @FS460_get_tv_active_lines(i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @set(i32 0, i32 0, i32 720, i32 %5, i32 0, i32 17)
%7 = load i32, i32* %1
%8 = call i32 @set(i32 0, i32 0, i32 720, i32 %7, i32 0, i32 17)
%9 = load i32, i32* %1
%10 = call i32 @set(i32 0, i32 0, i32 720, i32 %9, i32 0, i32 17)
%11 = load i32, i32* %1
%12 = call i32 @set(i32 0, i32 0, i32 720, i32 %11, i32 0, i32 17)
%13 = call i32 @fade(i32 0, i32 127, i32 30, i32 1)
%14 = call i32 @pause(i32 30)
%15 = call i32 @move(i32 0, i32 0, i32 -720, i32 0, i32 31)
%16 = call i32 @move(i32 720, i32 0, i32 0, i32 0, i32 31)
%17 = call i32 @pause(i32 30)
%18 = load i32, i32* %1
%19 = add nsw i32 %18, -60
%20 = call i32 @scale(i32 0, i32 0, i32 720, i32 %18, i32 90, i32 60, i32 630, i32 %19, i32 31)
%21 = call i32 @pause(i32 30)
%22 = load i32, i32* %1
%23 = add nsw i32 %22, -60
%24 = sdiv i32 %23, 16
%25 = call i32 @move(i32 90, i32 60, i32 90, i32 %22, i32 %24)
%26 = call i32 @pause(i32 15)
%27 = load i32, i32* %1
%28 = sub i32 120, %27
%29 = add nsw i32 %27, -60
%30 = sdiv i32 %29, 16
%31 = call i32 @move(i32 90, i32 %28, i32 90, i32 60, i32 %30)
%32 = call i32 @pause(i32 30)
%33 = load i32, i32* %1
%34 = call i32 @move(i32 90, i32 60, i32 720, i32 %33, i32 105)
%35 = load i32, i32* %1
%36 = sdiv i32 %35, 4
%37 = mul nsw i32 %35, 3
%38 = sdiv i32 %37, 4
%39 = call i32 @scale(i32 0, i32 0, i32 0, i32 0, i32 180, i32 %36, i32 540, i32 %38, i32 30)
%40 = load i32, i32* %1
%41 = sdiv i32 %40, 4
%42 = mul nsw i32 %40, 3
%43 = sdiv i32 %42, 4
%44 = call i32 @scale(i32 180, i32 %41, i32 540, i32 %43, i32 0, i32 0, i32 720, i32 %40, i32 30)
%45 = call i32 @pause(i32 30)
%46 = load i32, i32* %1
%47 = mul nsw i32 %46, 10
%48 = sdiv i32 %47, 24
%49 = add nsw i32 %48, 100
%50 = call i32 @scale(i32 0, i32 0, i32 720, i32 %46, i32 360, i32 100, i32 660, i32 %49, i32 15)
%51 = call i32 @pause(i32 30)
%52 = load i32, i32* %1
%53 = mul nsw i32 %52, 10
%54 = sdiv i32 %53, 24
%55 = add nsw i32 %54, 100
%56 = call i32 @scale(i32 360, i32 100, i32 660, i32 %55, i32 300, i32 300, i32 300, i32 300, i32 15)
%57 = load i32, i32* %1
%58 = sdiv i32 %57, 3
%59 = add nsw i32 %58, 240
%60 = call i32 @scale(i32 300, i32 300, i32 300, i32 300, i32 120, i32 240, i32 360, i32 %59, i32 15)
%61 = call i32 @pause(i32 30)
%62 = load i32, i32* %1
%63 = sdiv i32 %62, 3
%64 = add nsw i32 %63, 240
%65 = call i32 @scale(i32 120, i32 240, i32 360, i32 %64, i32 100, i32 100, i32 100, i32 100, i32 15)
%66 = load i32, i32* %1
%67 = shl nsw i32 %66, 1
%68 = sdiv i32 %67, 5
%69 = mul nsw i32 %66, 3
%70 = sdiv i32 %69, 5
%71 = call i32 @scale(i32 100, i32 100, i32 100, i32 100, i32 288, i32 %68, i32 432, i32 %70, i32 15)
%72 = call i32 @pause(i32 30)
%73 = load i32, i32* %1
%74 = shl nsw i32 %73, 1
%75 = sdiv i32 %74, 5
%76 = mul nsw i32 %73, 3
%77 = sdiv i32 %76, 5
%78 = call i32 @scale(i32 288, i32 %75, i32 432, i32 %77, i32 360, i32 %75, i32 360, i32 %77, i32 15)
%79 = load i32, i32* %1
%80 = sdiv i32 %79, 4
%81 = mul nsw i32 %79, 3
%82 = sdiv i32 %81, 4
%83 = call i32 @scale(i32 360, i32 %80, i32 360, i32 %82, i32 180, i32 %80, i32 540, i32 %82, i32 15)
%84 = call i32 @pause(i32 30)
%85 = load i32, i32* %1
%86 = sdiv i32 %85, 4
%87 = mul nsw i32 %85, 3
%88 = sdiv i32 %87, 4
%89 = call i32 @scale(i32 180, i32 %86, i32 540, i32 %88, i32 360, i32 %86, i32 360, i32 %88, i32 15)
%90 = load i32, i32* %1
%91 = sdiv i32 %90, 6
%92 = mul nsw i32 %90, 5
%93 = sdiv i32 %92, 6
%94 = call i32 @scale(i32 360, i32 %91, i32 360, i32 %93, i32 120, i32 %91, i32 600, i32 %93, i32 15)
%95 = call i32 @pause(i32 30)
%96 = load i32, i32* %1
%97 = sdiv i32 %96, 6
%98 = mul nsw i32 %96, 5
%99 = sdiv i32 %98, 6
%100 = sdiv i32 %96, 2
%101 = call i32 @scale(i32 120, i32 %97, i32 600, i32 %99, i32 120, i32 %100, i32 600, i32 %100, i32 15)
%102 = load i32, i32* %1
%103 = sdiv i32 %102, 2
%104 = call i32 @scale(i32 0, i32 %103, i32 720, i32 %103, i32 0, i32 0, i32 720, i32 %102, i32 15)
%105 = call i32 @pause(i32 30)
%106 = load i32, i32* %1
%107 = call i32 @wipe(i32 0, i32 0, i32 720, i32 %106, i32 0, i32 64, i32 64, i32 127, i32 60, i32 0)
%108 = call i32 @pause(i32 30)
%109 = load i32, i32* %1
%110 = call i32 @wipe(i32 0, i32 %109, i32 720, i32 0, i32 64, i32 0, i32 127, i32 64, i32 60, i32 1)
%111 = call i32 @pause(i32 30)
%112 = call i32 @shutters(i32 127, i32 0, i32 30, i32 8)
%113 = call i32 @pause(i32 60)
%114 = call i32 @FS460_play_run(i32 1)
ret void
}