#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_play_begin();
int /*<<< orphan*/ FS460_play_run(int);
int /*<<< orphan*/ negative_scaler_both(int, int);
int /*<<< orphan*/ negative_scaler_horizontal(int);
int /*<<< orphan*/ negative_scaler_tiny(int, int);
int /*<<< orphan*/ negative_scaler_vertical(int);
void negative_scaler_test(void) {
  static int mode = 0;
  FS460_play_begin();
  switch (mode++) {
  default:
    mode = 1;
  case 0:
    negative_scaler_both(60, 1);
    break;
  case 1:
    negative_scaler_both(60, 2);
    break;
  case 2:
    negative_scaler_vertical(60);
    break;
  case 3:
    negative_scaler_horizontal(60);
    break;
  case 4:
    negative_scaler_tiny(60, 0);
    break;
  case 5:
    negative_scaler_tiny(60, 1);
    break;
  }
  FS460_play_run(0x0001);
}


x86 assembly (clang, -O0):
<negative_scaler_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1070 <FS460_play_begin@plt>
mov    0x2edf(%rip),%eax
mov    %eax,%ecx
mov    %rcx,-0x8(%rbp)
mov    %ecx,%eax
add    $0x1,%eax
sub    $0x5,%rcx
mov    %eax,0x2eca(%rip)
ja     11a4 <negative_scaler_test+0x44>
mov    -0x8(%rbp),%rax
lea    0xe65(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,0x2ea6(%rip)
mov    $0x3c,%edi
mov    $0x1,%esi
call   1050 <negative_scaler_both@plt>
jmp    1214 <negative_scaler_test+0xb4>
mov    $0x3c,%edi
mov    $0x2,%esi
call   1050 <negative_scaler_both@plt>
jmp    1214 <negative_scaler_test+0xb4>
mov    $0x3c,%edi
call   1030 <negative_scaler_vertical@plt>
jmp    1214 <negative_scaler_test+0xb4>
mov    $0x3c,%edi
call   1080 <negative_scaler_horizontal@plt>
jmp    1214 <negative_scaler_test+0xb4>
mov    $0x3c,%edi
xor    %esi,%esi
call   1040 <negative_scaler_tiny@plt>
jmp    1214 <negative_scaler_test+0xb4>
mov    $0x3c,%edi
mov    $0x1,%esi
call   1040 <negative_scaler_tiny@plt>
mov    $0x1,%edi
call   1060 <FS460_play_run@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<negative_scaler_test>:
push   %rax
xor    %eax,%eax
call   1070 <FS460_play_begin@plt>
mov    0x2ee6(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2edd(%rip)
cmp    $0x5,%rax
ja     119e <negative_scaler_test+0x3e>
lea    0xe7c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x3c,%edi
mov    $0x2,%esi
call   1050 <negative_scaler_both@plt>
jmp    11e9 <negative_scaler_test+0x89>
movl   $0x1,0x2eac(%rip)
mov    $0x3c,%edi
mov    $0x1,%esi
call   1050 <negative_scaler_both@plt>
jmp    11e9 <negative_scaler_test+0x89>
mov    $0x3c,%edi
call   1030 <negative_scaler_vertical@plt>
jmp    11e9 <negative_scaler_test+0x89>
mov    $0x3c,%edi
call   1080 <negative_scaler_horizontal@plt>
jmp    11e9 <negative_scaler_test+0x89>
mov    $0x3c,%edi
xor    %esi,%esi
jmp    11e4 <negative_scaler_test+0x84>
mov    $0x3c,%edi
mov    $0x1,%esi
call   1040 <negative_scaler_tiny@plt>
mov    $0x1,%edi
pop    %rax
jmp    1060 <FS460_play_run@plt>

LLVM IR (-O0):
@negative_scaler_test.mode = internal global i32 0
define void @negative_scaler_test() {
%1 = call i32 (...) @FS460_play_begin()
%2 = load i32, i32* @negative_scaler_test.mode
%3 = add nsw i32 %2, 1
store i32 %3, i32* @negative_scaler_test.mode
switch i32 %2, label %4 [
i32 0, label %5
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
]
4: ; preds = %0
store i32 1, i32* @negative_scaler_test.mode
br label %5
5: ; preds = %0, %4
%6 = call i32 @negative_scaler_both(i32 60, i32 1)
br label %17
7: ; preds = %0
%8 = call i32 @negative_scaler_both(i32 60, i32 2)
br label %17
9: ; preds = %0
%10 = call i32 @negative_scaler_vertical(i32 60)
br label %17
11: ; preds = %0
%12 = call i32 @negative_scaler_horizontal(i32 60)
br label %17
13: ; preds = %0
%14 = call i32 @negative_scaler_tiny(i32 60, i32 0)
br label %17
15: ; preds = %0
%16 = call i32 @negative_scaler_tiny(i32 60, i32 1)
br label %17
17: ; preds = %15, %13, %11, %9, %7, %5
%18 = call i32 @FS460_play_run(i32 1)
ret void
}

LLVM IR (-O2):
@negative_scaler_test.mode = internal unnamed_addr global i32 0
define void @negative_scaler_test() {
%1 = tail call i32 (...) @FS460_play_begin()
%2 = load i32, i32* @negative_scaler_test.mode
%3 = add nsw i32 %2, 1
store i32 %3, i32* @negative_scaler_test.mode
switch i32 %2, label %4 [
i32 0, label %5
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
]
4: ; preds = %0
store i32 1, i32* @negative_scaler_test.mode
br label %5
5: ; preds = %0, %4
%6 = tail call i32 @negative_scaler_both(i32 60, i32 1)
br label %17
7: ; preds = %0
%8 = tail call i32 @negative_scaler_both(i32 60, i32 2)
br label %17
9: ; preds = %0
%10 = tail call i32 @negative_scaler_vertical(i32 60)
br label %17
11: ; preds = %0
%12 = tail call i32 @negative_scaler_horizontal(i32 60)
br label %17
13: ; preds = %0
%14 = tail call i32 @negative_scaler_tiny(i32 60, i32 0)
br label %17
15: ; preds = %0
%16 = tail call i32 @negative_scaler_tiny(i32 60, i32 1)
br label %17
17: ; preds = %15, %13, %11, %9, %7, %5
%18 = tail call i32 @FS460_play_run(i32 1)
ret void
}