#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*/ path;

/* Variables and functions */
int /*<<< orphan*/ DecodeBJIntermImages(int, int);
int /*<<< orphan*/ DecodeBJMapImage(int, int);
int /*<<< orphan*/ DecodeScreen(int, int, char *);
int /*<<< orphan*/ cs_snprintf(char *, int, char *, char *);
int /*<<< orphan*/ setPalette(long);
void RipScreens(void) {
  char path[256];
  setPalette(898370L);
  cs_snprintf(path, sizeof(path), "%s/macplaypic.tga", "macpics");
  DecodeScreen(899914, 46893, path);
  setPalette(899142L);
  cs_snprintf(path, sizeof(path), "%s/idpic.tga", "macpics");
  DecodeScreen(899914, 46893, path);
  setPalette(997211L);
  cs_snprintf(path, sizeof(path), "%s/intermissionpic.tga", "macpics");
  DecodeScreen(947583, 49624, path);
  DecodeBJIntermImages(1018931, 20766);
  setPalette(946811L);
  cs_snprintf(path, sizeof(path), "%s/getpsychedpic.tga", "macpics");
  DecodeScreen(997983, 3256, path);
  DecodeBJMapImage(2391746, 1281);
  setPalette(1011345L);
  cs_snprintf(path, sizeof(path), "%s/yummypic.tga", "macpics");
  DecodeScreen(1002299, 9042, path);
  setPalette(2235007L);
  cs_snprintf(path, sizeof(path), "%s/titlepic.tga", "macpics");
  DecodeScreen(2067971, 167032, path);
}


x86 assembly (clang, -O0):
<RipScreens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    $0xdb542,%edi
call   1050 <setPalette@plt>
lea    -0x100(%rbp),%rdi
mov    $0x100,%esi
lea    0xe88(%rip),%rdx
lea    0xe93(%rip),%rcx
call   1070 <cs_snprintf@plt>
lea    -0x100(%rbp),%rdx
mov    $0xdbb4a,%edi
mov    $0xb72d,%esi
call   1060 <DecodeScreen@plt>
mov    $0xdb846,%edi
call   1050 <setPalette@plt>
lea    -0x100(%rbp),%rdi
mov    $0x100,%esi
lea    0xe63(%rip),%rdx
lea    0xe54(%rip),%rcx
call   1070 <cs_snprintf@plt>
lea    -0x100(%rbp),%rdx
mov    $0xdbb4a,%edi
mov    $0xb72d,%esi
call   1060 <DecodeScreen@plt>
mov    $0xf375b,%edi
call   1050 <setPalette@plt>
lea    -0x100(%rbp),%rdi
mov    $0x100,%esi
lea    0xe31(%rip),%rdx
lea    0xe15(%rip),%rcx
call   1070 <cs_snprintf@plt>
lea    -0x100(%rbp),%rdx
mov    $0xe757f,%edi
mov    $0xc1d8,%esi
call   1060 <DecodeScreen@plt>
mov    $0xf8c33,%edi
mov    $0x511e,%esi
call   1030 <DecodeBJIntermImages@plt>
mov    $0xe727b,%edi
call   1050 <setPalette@plt>
lea    -0x100(%rbp),%rdi
mov    $0x100,%esi
lea    0xdfa(%rip),%rdx
lea    0xdc7(%rip),%rcx
call   1070 <cs_snprintf@plt>
lea    -0x100(%rbp),%rdx
mov    $0xf3a5f,%edi
mov    $0xcb8,%esi
call   1060 <DecodeScreen@plt>
mov    $0x247ec2,%edi
mov    $0x501,%esi
call   1040 <DecodeBJMapImage@plt>
mov    $0xf6e91,%edi
call   1050 <setPalette@plt>
lea    -0x100(%rbp),%rdi
mov    $0x100,%esi
lea    0xdc1(%rip),%rdx
lea    0xd79(%rip),%rcx
call   1070 <cs_snprintf@plt>
lea    -0x100(%rbp),%rdx
mov    $0xf4b3b,%edi
mov    $0x2352,%esi
call   1060 <DecodeScreen@plt>
mov    $0x221a7f,%edi
call   1050 <setPalette@plt>
lea    -0x100(%rbp),%rdi
mov    $0x100,%esi
lea    0xd92(%rip),%rdx
lea    0xd3a(%rip),%rcx
call   1070 <cs_snprintf@plt>
lea    -0x100(%rbp),%rdx
mov    $0x1f8e03,%edi
mov    $0x28c78,%esi
call   1060 <DecodeScreen@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RipScreens>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    $0xdb542,%edi
call   1050 <setPalette@plt>
lea    0xe95(%rip),%rdx
lea    0xea0(%rip),%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %r14,%rcx
call   1070 <cs_snprintf@plt>
mov    $0xdbb4a,%edi
mov    $0xb72d,%esi
mov    %rbx,%rdx
call   1060 <DecodeScreen@plt>
mov    $0xdb846,%edi
call   1050 <setPalette@plt>
lea    0xe72(%rip),%rdx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %r14,%rcx
call   1070 <cs_snprintf@plt>
mov    $0xdbb4a,%edi
mov    $0xb72d,%esi
mov    %rbx,%rdx
call   1060 <DecodeScreen@plt>
mov    $0xf375b,%edi
call   1050 <setPalette@plt>
lea    0xe4c(%rip),%rdx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %r14,%rcx
call   1070 <cs_snprintf@plt>
mov    $0xe757f,%edi
mov    $0xc1d8,%esi
mov    %rbx,%rdx
call   1060 <DecodeScreen@plt>
mov    $0xf8c33,%edi
mov    $0x511e,%esi
call   1030 <DecodeBJIntermImages@plt>
mov    $0xe727b,%edi
call   1050 <setPalette@plt>
lea    0xe21(%rip),%rdx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %r14,%rcx
call   1070 <cs_snprintf@plt>
mov    $0xf3a5f,%edi
mov    $0xcb8,%esi
mov    %rbx,%rdx
call   1060 <DecodeScreen@plt>
mov    $0x247ec2,%edi
mov    $0x501,%esi
call   1040 <DecodeBJMapImage@plt>
mov    $0xf6e91,%edi
call   1050 <setPalette@plt>
lea    0xdf4(%rip),%rdx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %r14,%rcx
call   1070 <cs_snprintf@plt>
mov    $0xf4b3b,%edi
mov    $0x2352,%esi
mov    %rbx,%rdx
call   1060 <DecodeScreen@plt>
mov    $0x221a7f,%edi
call   1050 <setPalette@plt>
lea    0xdd1(%rip),%rdx
mov    %rbx,%rdi
mov    $0x100,%esi
mov    %r14,%rcx
call   1070 <cs_snprintf@plt>
mov    $0x1f8e03,%edi
mov    $0x28c78,%esi
mov    %rbx,%rdx
call   1060 <DecodeScreen@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%s/macplaypic.tga\00"
@.str.1 = [8 x i8] c"macpics\00"
@.str.2 = [13 x i8] c"%s/idpic.tga\00"
@.str.3 = [23 x i8] c"%s/intermissionpic.tga\00"
@.str.4 = [21 x i8] c"%s/getpsychedpic.tga\00"
@.str.5 = [16 x i8] c"%s/yummypic.tga\00"
@.str.6 = [16 x i8] c"%s/titlepic.tga\00"
define void @RipScreens() {
%1 = alloca [256 x i8]
%2 = call i32 @setPalette(i64 898370)
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @cs_snprintf(i8* %3, i32 256, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @DecodeScreen(i32 899914, i32 46893, i8* %5)
%7 = call i32 @setPalette(i64 899142)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%9 = call i32 @cs_snprintf(i8* %8, i32 256, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%11 = call i32 @DecodeScreen(i32 899914, i32 46893, i8* %10)
%12 = call i32 @setPalette(i64 997211)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%14 = call i32 @cs_snprintf(i8* %13, i32 256, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%16 = call i32 @DecodeScreen(i32 947583, i32 49624, i8* %15)
%17 = call i32 @DecodeBJIntermImages(i32 1018931, i32 20766)
%18 = call i32 @setPalette(i64 946811)
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%20 = call i32 @cs_snprintf(i8* %19, i32 256, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%22 = call i32 @DecodeScreen(i32 997983, i32 3256, i8* %21)
%23 = call i32 @DecodeBJMapImage(i32 2391746, i32 1281)
%24 = call i32 @setPalette(i64 1011345)
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%26 = call i32 @cs_snprintf(i8* %25, i32 256, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%28 = call i32 @DecodeScreen(i32 1002299, i32 9042, i8* %27)
%29 = call i32 @setPalette(i64 2235007)
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%31 = call i32 @cs_snprintf(i8* %30, i32 256, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%33 = call i32 @DecodeScreen(i32 2067971, i32 167032, i8* %32)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s/macplaypic.tga\00"
@.str.1 = [8 x i8] c"macpics\00"
@.str.2 = [13 x i8] c"%s/idpic.tga\00"
@.str.3 = [23 x i8] c"%s/intermissionpic.tga\00"
@.str.4 = [21 x i8] c"%s/getpsychedpic.tga\00"
@.str.5 = [16 x i8] c"%s/yummypic.tga\00"
@.str.6 = [16 x i8] c"%s/titlepic.tga\00"
define void @RipScreens() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @setPalette(i64 898370)
%4 = call i32 @cs_snprintf(i8* %2, i32 256, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @DecodeScreen(i32 899914, i32 46893, i8* %2)
%6 = call i32 @setPalette(i64 899142)
%7 = call i32 @cs_snprintf(i8* %2, i32 256, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @DecodeScreen(i32 899914, i32 46893, i8* %2)
%9 = call i32 @setPalette(i64 997211)
%10 = call i32 @cs_snprintf(i8* %2, i32 256, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @DecodeScreen(i32 947583, i32 49624, i8* %2)
%12 = call i32 @DecodeBJIntermImages(i32 1018931, i32 20766)
%13 = call i32 @setPalette(i64 946811)
%14 = call i32 @cs_snprintf(i8* %2, i32 256, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @DecodeScreen(i32 997983, i32 3256, i8* %2)
%16 = call i32 @DecodeBJMapImage(i32 2391746, i32 1281)
%17 = call i32 @setPalette(i64 1011345)
%18 = call i32 @cs_snprintf(i8* %2, i32 256, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 @DecodeScreen(i32 1002299, i32 9042, i8* %2)
%20 = call i32 @setPalette(i64 2235007)
%21 = call i32 @cs_snprintf(i8* %2, i32 256, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 @DecodeScreen(i32 2067971, i32 167032, i8* %2)
ret void
}