#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*/ scale2x(void *, unsigned int, void const *, unsigned int,
                           unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ scale2x3(void *, unsigned int, void const *, unsigned int,
                            unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ scale2x4(void *, unsigned int, void const *, unsigned int,
                            unsigned int, unsigned int, unsigned int);
void scale(unsigned scale, void *void_dst, unsigned dst_slice,
           const void *void_src, unsigned src_slice, unsigned pixel,
           unsigned width, unsigned height) {
  switch (scale) {
  case 202:
  case 2:
    scale2x(void_dst, dst_slice, void_src, src_slice, pixel, width, height);
    break;
  case 203:
    scale2x3(void_dst, dst_slice, void_src, src_slice, pixel, width, height);
    break;
  case 204:
    scale2x4(void_dst, dst_slice, void_src, src_slice, pixel, width, height);
    break;
  }
}


x86 assembly (clang, -O0):
<scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x2,%eax
je     11a1 <scale+0x71>
jmp    1168 <scale+0x38>
mov    -0x2c(%rbp),%eax
sub    $0xca,%eax
je     11a1 <scale+0x71>
jmp    117b <scale+0x4b>
mov    -0x2c(%rbp),%eax
sub    $0xcb,%eax
je     11c7 <scale+0x97>
jmp    118e <scale+0x5e>
mov    -0x2c(%rbp),%eax
sub    $0xcc,%eax
je     11ed <scale+0xbd>
jmp    120e <scale+0xde>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    0x10(%rbp),%r9d
mov    0x18(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <scale2x@plt>
jmp    120e <scale+0xde>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    0x10(%rbp),%r9d
mov    0x18(%rbp),%eax
mov    %eax,(%rsp)
call   1050 <scale2x3@plt>
jmp    120e <scale+0xde>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x28(%rbp),%r8d
mov    0x10(%rbp),%r9d
mov    0x18(%rbp),%eax
mov    %eax,(%rsp)
call   1040 <scale2x4@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale>:
push   %rax
mov    0x18(%rsp),%eax
mov    0x10(%rsp),%r10d
cmp    $0xca,%edi
jg     116a <scale+0x3a>
cmp    $0x2,%edi
je     114f <scale+0x1f>
cmp    $0xca,%edi
jne    1193 <scale+0x63>
mov    %eax,(%rsp)
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rcx,%rdx
mov    %r8d,%ecx
mov    %r9d,%r8d
mov    %r10d,%r9d
call   1030 <scale2x@plt>
pop    %rax
ret
cmp    $0xcb,%edi
je     1195 <scale+0x65>
cmp    $0xcc,%edi
jne    1193 <scale+0x63>
mov    %eax,(%rsp)
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rcx,%rdx
mov    %r8d,%ecx
mov    %r9d,%r8d
mov    %r10d,%r9d
call   1040 <scale2x4@plt>
pop    %rax
ret
mov    %eax,(%rsp)
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rcx,%rdx
mov    %r8d,%ecx
mov    %r9d,%r8d
mov    %r10d,%r9d
call   1050 <scale2x3@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @scale(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store i8* %1, i8** %10
store i32 %2, i32* %11
store i8* %3, i8** %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i32, i32* %9
switch i32 %17, label %45 [
i32 202, label %18
i32 2, label %18
i32 203, label %27
i32 204, label %36
]
18: ; preds = %8, %8
%19 = load i8*, i8** %10
%20 = load i32, i32* %11
%21 = load i8*, i8** %12
%22 = load i32, i32* %13
%23 = load i32, i32* %14
%24 = load i32, i32* %15
%25 = load i32, i32* %16
%26 = call i32 @scale2x(i8* %19, i32 %20, i8* %21, i32 %22, i32 %23, i32 %24, i32 %25)
br label %45
27: ; preds = %8
%28 = load i8*, i8** %10
%29 = load i32, i32* %11
%30 = load i8*, i8** %12
%31 = load i32, i32* %13
%32 = load i32, i32* %14
%33 = load i32, i32* %15
%34 = load i32, i32* %16
%35 = call i32 @scale2x3(i8* %28, i32 %29, i8* %30, i32 %31, i32 %32, i32 %33, i32 %34)
br label %45
36: ; preds = %8
%37 = load i8*, i8** %10
%38 = load i32, i32* %11
%39 = load i8*, i8** %12
%40 = load i32, i32* %13
%41 = load i32, i32* %14
%42 = load i32, i32* %15
%43 = load i32, i32* %16
%44 = call i32 @scale2x4(i8* %37, i32 %38, i8* %39, i32 %40, i32 %41, i32 %42, i32 %43)
br label %45
45: ; preds = %8, %36, %27, %18
ret void
}

LLVM IR (-O2):
define void @scale(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4, i32 %5, i32 %6, i32 %7) {
switch i32 %0, label %15 [
i32 202, label %9
i32 2, label %9
i32 203, label %11
i32 204, label %13
]
9: ; preds = %8, %8
%10 = tail call i32 @scale2x(i8* %1, i32 %2, i8* %3, i32 %4, i32 %5, i32 %6, i32 %7)
br label %15
11: ; preds = %8
%12 = tail call i32 @scale2x3(i8* %1, i32 %2, i8* %3, i32 %4, i32 %5, i32 %6, i32 %7)
br label %15
13: ; preds = %8
%14 = tail call i32 @scale2x4(i8* %1, i32 %2, i8* %3, i32 %4, i32 %5, i32 %6, i32 %7)
br label %15
15: ; preds = %8, %13, %11, %9
ret void
}