#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*/ gen_spline_lookup_tex(int);
int /*<<< orphan*/ mp_msg(int, int, char *, int);
void create_scaler_textures(int scaler, int *texu, char *texs) {
  switch (scaler) {
  case 0:
    break;
  case 1:
  case 2:
    texs[0] = (*texu)++;
    gen_spline_lookup_tex(0x84C0 + texs[0]);
    texs[0] += '0';
    break;
  default:
    mp_msg(3, 1, "[gl] unknown scaler type %i\n", scaler);
  }
}


x86 assembly (clang, -O0):
<create_scaler_textures>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
test   %eax,%eax
je     115a <create_scaler_textures+0x3a>
jmp    1146 <create_scaler_textures+0x26>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     115f <create_scaler_textures+0x3f>
jmp    1197 <create_scaler_textures+0x77>
jmp    11b0 <create_scaler_textures+0x90>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,(%rcx)
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
add    $0x84c0,%edi
call   1030 <gen_spline_lookup_tex@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
add    $0x30,%ecx
mov    %cl,(%rax)
jmp    11b0 <create_scaler_textures+0x90>
mov    -0x4(%rbp),%ecx
mov    $0x3,%edi
mov    $0x1,%esi
lea    0xe55(%rip),%rdx
call   1040 <mp_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_scaler_textures>:
mov    %edi,%ecx
lea    -0x1(%rcx),%eax
cmp    $0x2,%eax
jae    114b <create_scaler_textures+0x2b>
push   %rbx
mov    %rdx,%rbx
mov    (%rsi),%eax
lea    0x1(%rax),%ecx
mov    %ecx,(%rsi)
mov    %al,(%rdx)
movsbl %al,%edi
add    $0x84c0,%edi
call   1030 <gen_spline_lookup_tex@plt>
addb   $0x30,(%rbx)
pop    %rbx
jmp    114f <create_scaler_textures+0x2f>
test   %ecx,%ecx
jne    1150 <create_scaler_textures+0x30>
ret
lea    0xea9(%rip),%rdx
mov    $0x3,%edi
mov    $0x1,%esi
jmp    1040 <mp_msg@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"[gl] unknown scaler type %i\0A\00"
define void @create_scaler_textures(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
switch i32 %7, label %28 [
i32 0, label %8
i32 1, label %9
i32 2, label %9
]
8: ; preds = %3
br label %31
9: ; preds = %3, %3
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
%13 = trunc i32 %11 to i8
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 %13, i8* %15
%16 = load i8*, i8** %6
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = add nsw i32 33984, %19
%21 = call i32 @gen_spline_lookup_tex(i32 %20)
%22 = load i8*, i8** %6
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = add nsw i32 %25, 48
%27 = trunc i32 %26 to i8
store i8 %27, i8* %23
br label %31
28: ; preds = %3
%29 = load i32, i32* %4
%30 = call i32 @mp_msg(i32 3, i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28, %9, %8
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"[gl] unknown scaler type %i\0A\00"
define void @create_scaler_textures(i32 %0, i32* nocapture %1, i8* nocapture %2) {
switch i32 %0, label %14 [
i32 0, label %16
i32 1, label %4
i32 2, label %4
]
4: ; preds = %3, %3
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = trunc i32 %5 to i8
store i8 %7, i8* %2
%8 = shl i32 %5, 24
%9 = ashr exact i32 %8, 24
%10 = add nsw i32 %9, 33984
%11 = tail call i32 @gen_spline_lookup_tex(i32 %10)
%12 = load i8, i8* %2
%13 = add i8 %12, 48
store i8 %13, i8* %2
br label %16
14: ; preds = %3
%15 = tail call i32 @mp_msg(i32 3, i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %16
16: ; preds = %14, %4, %3
ret void
}