#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*/ delay_ms(int);
int /*<<< orphan*/ line(int, int, int /*<<< orphan*/, int, int, int, int);
void roll_apeak_xy(int n, int delay) {
  int i;
  switch (n) {
  case 1:
    for (i = 0; i < 7; i++) {
      line(0, i, 0, 0, i, 7, 0);
      line(i + 1, 7, 0, i + 1, 7, 7, 1);
      delay_ms(delay);
    };
    break;
  case 2:
    for (i = 0; i < 7; i++) {
      line(i, 7, 0, i, 7, 7, 0);
      line(7, 6 - i, 0, 7, 6 - i, 7, 1);
      delay_ms(delay);
    };
    break;
  case 3:
    for (i = 0; i < 7; i++) {
      line(7, 7 - i, 0, 7, 7 - i, 7, 0);
      line(6 - i, 0, 0, 6 - i, 0, 7, 1);
      delay_ms(delay);
    };
    break;
  case 0:
    for (i = 0; i < 7; i++) {
      line(7 - i, 0, 0, 7 - i, 0, 7, 0);
      line(0, i + 1, 0, 0, i + 1, 7, 1);
      delay_ms(delay);
    };
  }
}


x86 assembly (clang, -O0):
<roll_apeak_xy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     133c <roll_apeak_xy+0x21c>
mov    -0x18(%rbp),%rax
lea    0xeb6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    11bf <roll_apeak_xy+0x9f>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%r8d
xor    %ecx,%ecx
mov    $0x7,%r9d
mov    %ecx,%edi
mov    %ecx,%edx
movl   $0x0,(%rsp)
call   1040 <line@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    $0x7,%r9d
xor    %edx,%edx
mov    %r9d,%esi
mov    %r9d,%r8d
movl   $0x1,(%rsp)
call   1040 <line@plt>
mov    -0x8(%rbp),%edi
call   1030 <delay_ms@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115a <roll_apeak_xy+0x3a>
jmp    133c <roll_apeak_xy+0x21c>
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    1237 <roll_apeak_xy+0x117>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%ecx
mov    $0x7,%r9d
xor    %edx,%edx
mov    %r9d,%esi
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1040 <line@plt>
mov    $0x6,%esi
sub    -0xc(%rbp),%esi
mov    $0x6,%r8d
sub    -0xc(%rbp),%r8d
mov    $0x7,%r9d
xor    %edx,%edx
mov    %r9d,%edi
mov    %r9d,%ecx
movl   $0x1,(%rsp)
call   1040 <line@plt>
mov    -0x8(%rbp),%edi
call   1030 <delay_ms@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11cb <roll_apeak_xy+0xab>
jmp    133c <roll_apeak_xy+0x21c>
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    12ba <roll_apeak_xy+0x19a>
mov    $0x7,%esi
sub    -0xc(%rbp),%esi
mov    $0x7,%r8d
sub    -0xc(%rbp),%r8d
mov    $0x7,%r9d
xor    %edx,%edx
mov    %r9d,%edi
mov    %r9d,%ecx
movl   $0x0,(%rsp)
call   1040 <line@plt>
mov    $0x6,%edi
sub    -0xc(%rbp),%edi
mov    $0x6,%ecx
sub    -0xc(%rbp),%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
mov    %r8d,%esi
mov    %r8d,%edx
movl   $0x1,(%rsp)
call   1040 <line@plt>
mov    -0x8(%rbp),%edi
call   1030 <delay_ms@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1243 <roll_apeak_xy+0x123>
jmp    133c <roll_apeak_xy+0x21c>
movl   $0x0,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    1337 <roll_apeak_xy+0x217>
mov    $0x7,%edi
sub    -0xc(%rbp),%edi
mov    $0x7,%ecx
sub    -0xc(%rbp),%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
mov    %r8d,%esi
mov    %r8d,%edx
movl   $0x0,(%rsp)
call   1040 <line@plt>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%r8d
add    $0x1,%r8d
xor    %ecx,%ecx
mov    $0x7,%r9d
mov    %ecx,%edi
mov    %ecx,%edx
movl   $0x1,(%rsp)
call   1040 <line@plt>
mov    -0x8(%rbp),%edi
call   1030 <delay_ms@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12c6 <roll_apeak_xy+0x1a6>
jmp    133c <roll_apeak_xy+0x21c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roll_apeak_xy>:
cmp    $0x3,%edi
ja     134a <roll_apeak_xy+0x22a>
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%eax
lea    0xec7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,(%rsp)
mov    $0x7,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x7,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x6,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x6,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
xor    %edi,%edi
mov    $0x2,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x2,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x5,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x5,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
xor    %edi,%edi
mov    $0x3,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x4,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
xor    %edi,%edi
mov    $0x4,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x4,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x3,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
xor    %edi,%edi
mov    $0x5,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x5,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x2,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x2,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
xor    %edi,%edi
mov    $0x6,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x6,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
xor    %edi,%edi
mov    $0x7,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1572 <roll_apeak_xy+0x452>
ret
movl   $0x0,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x1,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x2,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x2,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
xor    %edi,%edi
mov    $0x2,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x2,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x3,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x3,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
xor    %edi,%edi
mov    $0x3,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x4,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x4,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
xor    %edi,%edi
mov    $0x4,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x4,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x5,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x5,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
xor    %edi,%edi
mov    $0x5,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x5,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x6,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x6,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
xor    %edi,%edi
mov    $0x6,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x6,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x7,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x7,%r8d
jmp    19fd <roll_apeak_xy+0x8dd>
movl   $0x0,(%rsp)
xor    %edi,%edi
mov    $0x7,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x7,%edi
mov    $0x6,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x6,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x1,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x7,%edi
mov    $0x5,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x5,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x2,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x2,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x7,%edi
mov    $0x4,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x4,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x3,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x3,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x7,%edi
mov    $0x3,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x3,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x4,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x4,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x7,%edi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x2,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x5,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x5,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x7,%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x1,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x6,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x6,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x7,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x7,%ecx
jmp    19fa <roll_apeak_xy+0x8da>
movl   $0x0,(%rsp)
mov    $0x7,%edi
mov    $0x7,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x6,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x6,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x7,%edi
mov    $0x6,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x6,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x5,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x5,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x7,%edi
mov    $0x5,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x5,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x4,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x7,%edi
mov    $0x4,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x4,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x3,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x7,%edi
mov    $0x3,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x3,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x2,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x2,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x7,%edi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x2,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
call   1030 <delay_ms@plt>
movl   $0x0,(%rsp)
mov    $0x7,%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x1,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
movl   $0x1,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0x7,%r9d
call   1040 <line@plt>
mov    %ebx,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <delay_ms@plt>

LLVM IR (-O0):
define void @roll_apeak_xy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
switch i32 %6, label %87 [
i32 1, label %7
i32 2, label %26
i32 3, label %45
i32 0, label %66
]
7: ; preds = %2
store i32 0, i32* %5
br label %8
8: ; preds = %22, %7
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 7
br i1 %10, label %11, label %25
11: ; preds = %8
%12 = load i32, i32* %5
%13 = load i32, i32* %5
%14 = call i32 @line(i32 0, i32 %12, i32 0, i32 0, i32 %13, i32 7, i32 0)
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
%19 = call i32 @line(i32 %16, i32 7, i32 0, i32 %18, i32 7, i32 7, i32 1)
%20 = load i32, i32* %4
%21 = call i32 @delay_ms(i32 %20)
br label %22
22: ; preds = %11
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %8
25: ; preds = %8
br label %87
26: ; preds = %2
store i32 0, i32* %5
br label %27
27: ; preds = %41, %26
%28 = load i32, i32* %5
%29 = icmp slt i32 %28, 7
br i1 %29, label %30, label %44
30: ; preds = %27
%31 = load i32, i32* %5
%32 = load i32, i32* %5
%33 = call i32 @line(i32 %31, i32 7, i32 0, i32 %32, i32 7, i32 7, i32 0)
%34 = load i32, i32* %5
%35 = sub nsw i32 6, %34
%36 = load i32, i32* %5
%37 = sub nsw i32 6, %36
%38 = call i32 @line(i32 7, i32 %35, i32 0, i32 7, i32 %37, i32 7, i32 1)
%39 = load i32, i32* %4
%40 = call i32 @delay_ms(i32 %39)
br label %41
41: ; preds = %30
%42 = load i32, i32* %5
%43 = add nsw i32 %42, 1
store i32 %43, i32* %5
br label %27
44: ; preds = %27
br label %87
45: ; preds = %2
store i32 0, i32* %5
br label %46
46: ; preds = %62, %45
%47 = load i32, i32* %5
%48 = icmp slt i32 %47, 7
br i1 %48, label %49, label %65
49: ; preds = %46
%50 = load i32, i32* %5
%51 = sub nsw i32 7, %50
%52 = load i32, i32* %5
%53 = sub nsw i32 7, %52
%54 = call i32 @line(i32 7, i32 %51, i32 0, i32 7, i32 %53, i32 7, i32 0)
%55 = load i32, i32* %5
%56 = sub nsw i32 6, %55
%57 = load i32, i32* %5
%58 = sub nsw i32 6, %57
%59 = call i32 @line(i32 %56, i32 0, i32 0, i32 %58, i32 0, i32 7, i32 1)
%60 = load i32, i32* %4
%61 = call i32 @delay_ms(i32 %60)
br label %62
62: ; preds = %49
%63 = load i32, i32* %5
%64 = add nsw i32 %63, 1
store i32 %64, i32* %5
br label %46
65: ; preds = %46
br label %87
66: ; preds = %2
store i32 0, i32* %5
br label %67
67: ; preds = %83, %66
%68 = load i32, i32* %5
%69 = icmp slt i32 %68, 7
br i1 %69, label %70, label %86
70: ; preds = %67
%71 = load i32, i32* %5
%72 = sub nsw i32 7, %71
%73 = load i32, i32* %5
%74 = sub nsw i32 7, %73
%75 = call i32 @line(i32 %72, i32 0, i32 0, i32 %74, i32 0, i32 7, i32 0)
%76 = load i32, i32* %5
%77 = add nsw i32 %76, 1
%78 = load i32, i32* %5
%79 = add nsw i32 %78, 1
%80 = call i32 @line(i32 0, i32 %77, i32 0, i32 0, i32 %79, i32 7, i32 1)
%81 = load i32, i32* %4
%82 = call i32 @delay_ms(i32 %81)
br label %83
83: ; preds = %70
%84 = load i32, i32* %5
%85 = add nsw i32 %84, 1
store i32 %85, i32* %5
br label %67
86: ; preds = %67
br label %87
87: ; preds = %86, %2, %65, %44, %25
ret void
}

LLVM IR (-O2):
define void @roll_apeak_xy(i32 %0, i32 %1) {
switch i32 %0, label %89 [
i32 1, label %66
i32 2, label %45
i32 3, label %24
i32 0, label %3
]
3: ; preds = %2
%4 = tail call i32 @line(i32 7, i32 0, i32 0, i32 7, i32 0, i32 7, i32 0)
%5 = tail call i32 @line(i32 0, i32 1, i32 0, i32 0, i32 1, i32 7, i32 1)
%6 = tail call i32 @delay_ms(i32 %1)
%7 = tail call i32 @line(i32 6, i32 0, i32 0, i32 6, i32 0, i32 7, i32 0)
%8 = tail call i32 @line(i32 0, i32 2, i32 0, i32 0, i32 2, i32 7, i32 1)
%9 = tail call i32 @delay_ms(i32 %1)
%10 = tail call i32 @line(i32 5, i32 0, i32 0, i32 5, i32 0, i32 7, i32 0)
%11 = tail call i32 @line(i32 0, i32 3, i32 0, i32 0, i32 3, i32 7, i32 1)
%12 = tail call i32 @delay_ms(i32 %1)
%13 = tail call i32 @line(i32 4, i32 0, i32 0, i32 4, i32 0, i32 7, i32 0)
%14 = tail call i32 @line(i32 0, i32 4, i32 0, i32 0, i32 4, i32 7, i32 1)
%15 = tail call i32 @delay_ms(i32 %1)
%16 = tail call i32 @line(i32 3, i32 0, i32 0, i32 3, i32 0, i32 7, i32 0)
%17 = tail call i32 @line(i32 0, i32 5, i32 0, i32 0, i32 5, i32 7, i32 1)
%18 = tail call i32 @delay_ms(i32 %1)
%19 = tail call i32 @line(i32 2, i32 0, i32 0, i32 2, i32 0, i32 7, i32 0)
%20 = tail call i32 @line(i32 0, i32 6, i32 0, i32 0, i32 6, i32 7, i32 1)
%21 = tail call i32 @delay_ms(i32 %1)
%22 = tail call i32 @line(i32 1, i32 0, i32 0, i32 1, i32 0, i32 7, i32 0)
%23 = tail call i32 @line(i32 0, i32 7, i32 0, i32 0, i32 7, i32 7, i32 1)
br label %87
24: ; preds = %2
%25 = tail call i32 @line(i32 7, i32 7, i32 0, i32 7, i32 7, i32 7, i32 0)
%26 = tail call i32 @line(i32 6, i32 0, i32 0, i32 6, i32 0, i32 7, i32 1)
%27 = tail call i32 @delay_ms(i32 %1)
%28 = tail call i32 @line(i32 7, i32 6, i32 0, i32 7, i32 6, i32 7, i32 0)
%29 = tail call i32 @line(i32 5, i32 0, i32 0, i32 5, i32 0, i32 7, i32 1)
%30 = tail call i32 @delay_ms(i32 %1)
%31 = tail call i32 @line(i32 7, i32 5, i32 0, i32 7, i32 5, i32 7, i32 0)
%32 = tail call i32 @line(i32 4, i32 0, i32 0, i32 4, i32 0, i32 7, i32 1)
%33 = tail call i32 @delay_ms(i32 %1)
%34 = tail call i32 @line(i32 7, i32 4, i32 0, i32 7, i32 4, i32 7, i32 0)
%35 = tail call i32 @line(i32 3, i32 0, i32 0, i32 3, i32 0, i32 7, i32 1)
%36 = tail call i32 @delay_ms(i32 %1)
%37 = tail call i32 @line(i32 7, i32 3, i32 0, i32 7, i32 3, i32 7, i32 0)
%38 = tail call i32 @line(i32 2, i32 0, i32 0, i32 2, i32 0, i32 7, i32 1)
%39 = tail call i32 @delay_ms(i32 %1)
%40 = tail call i32 @line(i32 7, i32 2, i32 0, i32 7, i32 2, i32 7, i32 0)
%41 = tail call i32 @line(i32 1, i32 0, i32 0, i32 1, i32 0, i32 7, i32 1)
%42 = tail call i32 @delay_ms(i32 %1)
%43 = tail call i32 @line(i32 7, i32 1, i32 0, i32 7, i32 1, i32 7, i32 0)
%44 = tail call i32 @line(i32 0, i32 0, i32 0, i32 0, i32 0, i32 7, i32 1)
br label %87
45: ; preds = %2
%46 = tail call i32 @line(i32 0, i32 7, i32 0, i32 0, i32 7, i32 7, i32 0)
%47 = tail call i32 @line(i32 7, i32 6, i32 0, i32 7, i32 6, i32 7, i32 1)
%48 = tail call i32 @delay_ms(i32 %1)
%49 = tail call i32 @line(i32 1, i32 7, i32 0, i32 1, i32 7, i32 7, i32 0)
%50 = tail call i32 @line(i32 7, i32 5, i32 0, i32 7, i32 5, i32 7, i32 1)
%51 = tail call i32 @delay_ms(i32 %1)
%52 = tail call i32 @line(i32 2, i32 7, i32 0, i32 2, i32 7, i32 7, i32 0)
%53 = tail call i32 @line(i32 7, i32 4, i32 0, i32 7, i32 4, i32 7, i32 1)
%54 = tail call i32 @delay_ms(i32 %1)
%55 = tail call i32 @line(i32 3, i32 7, i32 0, i32 3, i32 7, i32 7, i32 0)
%56 = tail call i32 @line(i32 7, i32 3, i32 0, i32 7, i32 3, i32 7, i32 1)
%57 = tail call i32 @delay_ms(i32 %1)
%58 = tail call i32 @line(i32 4, i32 7, i32 0, i32 4, i32 7, i32 7, i32 0)
%59 = tail call i32 @line(i32 7, i32 2, i32 0, i32 7, i32 2, i32 7, i32 1)
%60 = tail call i32 @delay_ms(i32 %1)
%61 = tail call i32 @line(i32 5, i32 7, i32 0, i32 5, i32 7, i32 7, i32 0)
%62 = tail call i32 @line(i32 7, i32 1, i32 0, i32 7, i32 1, i32 7, i32 1)
%63 = tail call i32 @delay_ms(i32 %1)
%64 = tail call i32 @line(i32 6, i32 7, i32 0, i32 6, i32 7, i32 7, i32 0)
%65 = tail call i32 @line(i32 7, i32 0, i32 0, i32 7, i32 0, i32 7, i32 1)
br label %87
66: ; preds = %2
%67 = tail call i32 @line(i32 0, i32 0, i32 0, i32 0, i32 0, i32 7, i32 0)
%68 = tail call i32 @line(i32 1, i32 7, i32 0, i32 1, i32 7, i32 7, i32 1)
%69 = tail call i32 @delay_ms(i32 %1)
%70 = tail call i32 @line(i32 0, i32 1, i32 0, i32 0, i32 1, i32 7, i32 0)
%71 = tail call i32 @line(i32 2, i32 7, i32 0, i32 2, i32 7, i32 7, i32 1)
%72 = tail call i32 @delay_ms(i32 %1)
%73 = tail call i32 @line(i32 0, i32 2, i32 0, i32 0, i32 2, i32 7, i32 0)
%74 = tail call i32 @line(i32 3, i32 7, i32 0, i32 3, i32 7, i32 7, i32 1)
%75 = tail call i32 @delay_ms(i32 %1)
%76 = tail call i32 @line(i32 0, i32 3, i32 0, i32 0, i32 3, i32 7, i32 0)
%77 = tail call i32 @line(i32 4, i32 7, i32 0, i32 4, i32 7, i32 7, i32 1)
%78 = tail call i32 @delay_ms(i32 %1)
%79 = tail call i32 @line(i32 0, i32 4, i32 0, i32 0, i32 4, i32 7, i32 0)
%80 = tail call i32 @line(i32 5, i32 7, i32 0, i32 5, i32 7, i32 7, i32 1)
%81 = tail call i32 @delay_ms(i32 %1)
%82 = tail call i32 @line(i32 0, i32 5, i32 0, i32 0, i32 5, i32 7, i32 0)
%83 = tail call i32 @line(i32 6, i32 7, i32 0, i32 6, i32 7, i32 7, i32 1)
%84 = tail call i32 @delay_ms(i32 %1)
%85 = tail call i32 @line(i32 0, i32 6, i32 0, i32 0, i32 6, i32 7, i32 0)
%86 = tail call i32 @line(i32 7, i32 7, i32 0, i32 7, i32 7, i32 7, i32 1)
br label %87
87: ; preds = %66, %45, %24, %3
%88 = tail call i32 @delay_ms(i32 %1)
br label %89
89: ; preds = %87, %2
ret void
}