#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*/ loadtexturetgapartial(int, char *, int, int, int, int);
void loadbackground(int texturenum, char *filename) {
  loadtexturetgapartial(texturenum, filename, 0, 0, 256, 256);
  loadtexturetgapartial(texturenum + 1, filename, 256, 0, 256, 256);
  loadtexturetgapartial(texturenum + 2, filename, 512, 0, 256, 256);
  loadtexturetgapartial(texturenum + 3, filename, 768, 0, 256, 256);
  loadtexturetgapartial(texturenum + 4, filename, 0, 256, 256, 256);
  loadtexturetgapartial(texturenum + 5, filename, 256, 256, 256, 256);
  loadtexturetgapartial(texturenum + 6, filename, 512, 256, 256, 256);
  loadtexturetgapartial(texturenum + 7, filename, 768, 256, 256, 256);
  loadtexturetgapartial(texturenum + 8, filename, 0, 512, 256, 256);
  loadtexturetgapartial(texturenum + 9, filename, 256, 512, 256, 256);
  loadtexturetgapartial(texturenum + 10, filename, 512, 512, 256, 256);
  loadtexturetgapartial(texturenum + 11, filename, 768, 512, 256, 256);
}


x86 assembly (clang, -O0):
<loadbackground>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %ecx,%ecx
mov    $0x100,%r9d
mov    %ecx,%edx
mov    %r9d,%r8d
call   1030 <loadtexturetgapartial@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x10(%rbp),%rsi
mov    $0x100,%r9d
xor    %ecx,%ecx
mov    %r9d,%edx
mov    %r9d,%r8d
call   1030 <loadtexturetgapartial@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
mov    -0x10(%rbp),%rsi
mov    $0x200,%edx
xor    %ecx,%ecx
mov    $0x100,%r9d
mov    %r9d,%r8d
call   1030 <loadtexturetgapartial@plt>
mov    -0x4(%rbp),%edi
add    $0x3,%edi
mov    -0x10(%rbp),%rsi
mov    $0x300,%edx
xor    %ecx,%ecx
mov    $0x100,%r9d
mov    %r9d,%r8d
call   1030 <loadtexturetgapartial@plt>
mov    -0x4(%rbp),%edi
add    $0x4,%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x100,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <loadtexturetgapartial@plt>
mov    -0x4(%rbp),%edi
add    $0x5,%edi
mov    -0x10(%rbp),%rsi
mov    $0x100,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <loadtexturetgapartial@plt>
mov    -0x4(%rbp),%edi
add    $0x6,%edi
mov    -0x10(%rbp),%rsi
mov    $0x200,%edx
mov    $0x100,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <loadtexturetgapartial@plt>
mov    -0x4(%rbp),%edi
add    $0x7,%edi
mov    -0x10(%rbp),%rsi
mov    $0x300,%edx
mov    $0x100,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <loadtexturetgapartial@plt>
mov    -0x4(%rbp),%edi
add    $0x8,%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x200,%ecx
mov    $0x100,%r9d
mov    %r9d,%r8d
call   1030 <loadtexturetgapartial@plt>
mov    -0x4(%rbp),%edi
add    $0x9,%edi
mov    -0x10(%rbp),%rsi
mov    $0x100,%r9d
mov    $0x200,%ecx
mov    %r9d,%edx
mov    %r9d,%r8d
call   1030 <loadtexturetgapartial@plt>
mov    -0x4(%rbp),%edi
add    $0xa,%edi
mov    -0x10(%rbp),%rsi
mov    $0x200,%ecx
mov    $0x100,%r9d
mov    %ecx,%edx
mov    %r9d,%r8d
call   1030 <loadtexturetgapartial@plt>
mov    -0x4(%rbp),%edi
add    $0xb,%edi
mov    -0x10(%rbp),%rsi
mov    $0x300,%edx
mov    $0x200,%ecx
mov    $0x100,%r9d
mov    %r9d,%r8d
call   1030 <loadtexturetgapartial@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadbackground>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x100,%r8d
mov    $0x100,%r9d
call   1030 <loadtexturetgapartial@plt>
lea    0x1(%rbx),%edi
mov    %r14,%rsi
mov    $0x100,%edx
xor    %ecx,%ecx
mov    $0x100,%r8d
mov    $0x100,%r9d
call   1030 <loadtexturetgapartial@plt>
lea    0x2(%rbx),%edi
mov    %r14,%rsi
mov    $0x200,%edx
xor    %ecx,%ecx
mov    $0x100,%r8d
mov    $0x100,%r9d
call   1030 <loadtexturetgapartial@plt>
lea    0x3(%rbx),%edi
mov    %r14,%rsi
mov    $0x300,%edx
xor    %ecx,%ecx
mov    $0x100,%r8d
mov    $0x100,%r9d
call   1030 <loadtexturetgapartial@plt>
lea    0x4(%rbx),%edi
mov    %r14,%rsi
xor    %edx,%edx
mov    $0x100,%ecx
mov    $0x100,%r8d
mov    $0x100,%r9d
call   1030 <loadtexturetgapartial@plt>
lea    0x5(%rbx),%edi
mov    %r14,%rsi
mov    $0x100,%edx
mov    $0x100,%ecx
mov    $0x100,%r8d
mov    $0x100,%r9d
call   1030 <loadtexturetgapartial@plt>
lea    0x6(%rbx),%edi
mov    %r14,%rsi
mov    $0x200,%edx
mov    $0x100,%ecx
mov    $0x100,%r8d
mov    $0x100,%r9d
call   1030 <loadtexturetgapartial@plt>
lea    0x7(%rbx),%edi
mov    %r14,%rsi
mov    $0x300,%edx
mov    $0x100,%ecx
mov    $0x100,%r8d
mov    $0x100,%r9d
call   1030 <loadtexturetgapartial@plt>
lea    0x8(%rbx),%edi
mov    %r14,%rsi
xor    %edx,%edx
mov    $0x200,%ecx
mov    $0x100,%r8d
mov    $0x100,%r9d
call   1030 <loadtexturetgapartial@plt>
lea    0x9(%rbx),%edi
mov    %r14,%rsi
mov    $0x100,%edx
mov    $0x200,%ecx
mov    $0x100,%r8d
mov    $0x100,%r9d
call   1030 <loadtexturetgapartial@plt>
lea    0xa(%rbx),%edi
mov    %r14,%rsi
mov    $0x200,%edx
mov    $0x200,%ecx
mov    $0x100,%r8d
mov    $0x100,%r9d
call   1030 <loadtexturetgapartial@plt>
add    $0xb,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x300,%edx
mov    $0x200,%ecx
mov    $0x100,%r8d
mov    $0x100,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <loadtexturetgapartial@plt>

LLVM IR (-O0):
define void @loadbackground(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @loadtexturetgapartial(i32 %5, i8* %6, i32 0, i32 0, i32 256, i32 256)
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = load i8*, i8** %4
%11 = call i32 @loadtexturetgapartial(i32 %9, i8* %10, i32 256, i32 0, i32 256, i32 256)
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 2
%14 = load i8*, i8** %4
%15 = call i32 @loadtexturetgapartial(i32 %13, i8* %14, i32 512, i32 0, i32 256, i32 256)
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 3
%18 = load i8*, i8** %4
%19 = call i32 @loadtexturetgapartial(i32 %17, i8* %18, i32 768, i32 0, i32 256, i32 256)
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 4
%22 = load i8*, i8** %4
%23 = call i32 @loadtexturetgapartial(i32 %21, i8* %22, i32 0, i32 256, i32 256, i32 256)
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 5
%26 = load i8*, i8** %4
%27 = call i32 @loadtexturetgapartial(i32 %25, i8* %26, i32 256, i32 256, i32 256, i32 256)
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 6
%30 = load i8*, i8** %4
%31 = call i32 @loadtexturetgapartial(i32 %29, i8* %30, i32 512, i32 256, i32 256, i32 256)
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 7
%34 = load i8*, i8** %4
%35 = call i32 @loadtexturetgapartial(i32 %33, i8* %34, i32 768, i32 256, i32 256, i32 256)
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 8
%38 = load i8*, i8** %4
%39 = call i32 @loadtexturetgapartial(i32 %37, i8* %38, i32 0, i32 512, i32 256, i32 256)
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 9
%42 = load i8*, i8** %4
%43 = call i32 @loadtexturetgapartial(i32 %41, i8* %42, i32 256, i32 512, i32 256, i32 256)
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 10
%46 = load i8*, i8** %4
%47 = call i32 @loadtexturetgapartial(i32 %45, i8* %46, i32 512, i32 512, i32 256, i32 256)
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 11
%50 = load i8*, i8** %4
%51 = call i32 @loadtexturetgapartial(i32 %49, i8* %50, i32 768, i32 512, i32 256, i32 256)
ret void
}

LLVM IR (-O2):
define void @loadbackground(i32 %0, i8* %1) {
%3 = tail call i32 @loadtexturetgapartial(i32 %0, i8* %1, i32 0, i32 0, i32 256, i32 256)
%4 = add nsw i32 %0, 1
%5 = tail call i32 @loadtexturetgapartial(i32 %4, i8* %1, i32 256, i32 0, i32 256, i32 256)
%6 = add nsw i32 %0, 2
%7 = tail call i32 @loadtexturetgapartial(i32 %6, i8* %1, i32 512, i32 0, i32 256, i32 256)
%8 = add nsw i32 %0, 3
%9 = tail call i32 @loadtexturetgapartial(i32 %8, i8* %1, i32 768, i32 0, i32 256, i32 256)
%10 = add nsw i32 %0, 4
%11 = tail call i32 @loadtexturetgapartial(i32 %10, i8* %1, i32 0, i32 256, i32 256, i32 256)
%12 = add nsw i32 %0, 5
%13 = tail call i32 @loadtexturetgapartial(i32 %12, i8* %1, i32 256, i32 256, i32 256, i32 256)
%14 = add nsw i32 %0, 6
%15 = tail call i32 @loadtexturetgapartial(i32 %14, i8* %1, i32 512, i32 256, i32 256, i32 256)
%16 = add nsw i32 %0, 7
%17 = tail call i32 @loadtexturetgapartial(i32 %16, i8* %1, i32 768, i32 256, i32 256, i32 256)
%18 = add nsw i32 %0, 8
%19 = tail call i32 @loadtexturetgapartial(i32 %18, i8* %1, i32 0, i32 512, i32 256, i32 256)
%20 = add nsw i32 %0, 9
%21 = tail call i32 @loadtexturetgapartial(i32 %20, i8* %1, i32 256, i32 512, i32 256, i32 256)
%22 = add nsw i32 %0, 10
%23 = tail call i32 @loadtexturetgapartial(i32 %22, i8* %1, i32 512, i32 512, i32 256, i32 256)
%24 = add nsw i32 %0, 11
%25 = tail call i32 @loadtexturetgapartial(i32 %24, i8* %1, i32 768, i32 512, i32 256, i32 256)
ret void
}