#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ decl(int /*<<< orphan*/ *, int /*<<< orphan*/ *, char *,
                        char *, int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void outImage(FILE *fs, FILE *fh, char *id, int global) {
  decl(fs, fh, "Image", id, 2, global);
  fprintf(fs, "    dc.l    %s_palette\n", id);
  fprintf(fs, "    dc.l    %s_tileset\n", id);
  fprintf(fs, "    dc.l    %s_tilemap\n", id);
  fprintf(fs, "\n");
}


x86 assembly (clang, -O0):
<outImage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r9d
lea    0xeb2(%rip),%rdx
mov    $0x2,%r8d
call   1030 <decl@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe9e(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xea0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xea2(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outImage>:
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r9d
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0xebc(%rip),%rdx
mov    %r14,%rcx
mov    $0x2,%r8d
call   1030 <decl@plt>
lea    0xead(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fputc@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Image\00"
@.str.1 = [24 x i8] c" dc.l %s_palette\0A\00"
@.str.2 = [24 x i8] c" dc.l %s_tileset\0A\00"
@.str.3 = [24 x i8] c" dc.l %s_tilemap\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @outImage(i32* %0, i32* %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @decl(i32* %9, i32* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %11, i32 2, i32 %12)
%14 = load i32*, i32** %5
%15 = load i8*, i8** %7
%16 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = load i32*, i32** %5
%18 = load i8*, i8** %7
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%20 = load i32*, i32** %5
%21 = load i8*, i8** %7
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %21)
%23 = load i32*, i32** %5
%24 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Image\00"
@.str.1 = [24 x i8] c" dc.l %s_palette\0A\00"
@.str.2 = [24 x i8] c" dc.l %s_tileset\0A\00"
@.str.3 = [24 x i8] c" dc.l %s_tilemap\0A\00"
define void @outImage(i32* %0, i32* %1, i8* %2, i32 %3) {
%5 = tail call i32 @decl(i32* %0, i32* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2, i32 2, i32 %3)
%6 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%7 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%8 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%9 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}