#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*/ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ chr1init(int /*<<< orphan*/ *, scalar_t__);
int /*<<< orphan*/ prg8init(int /*<<< orphan*/ *, scalar_t__);
int /*<<< orphan*/ prg8setBank2(scalar_t__);
int /*<<< orphan*/ prg8setBank3(scalar_t__);
int /*<<< orphan*/ printf(char *);
void m33init(uint8_t *prgROMin, uint32_t prgROMsizeIn, uint8_t *prgRAMin,
             uint32_t prgRAMsizeIn, uint8_t *chrROMin, uint32_t chrROMsizeIn) {
  prg8init(prgROMin, prgROMsizeIn);
  prg8setBank2(prgROMsizeIn - 0x4000);
  prg8setBank3(prgROMsizeIn - 0x2000);
  (void)prgRAMin;
  (void)prgRAMsizeIn;
  chr1init(chrROMin, chrROMsizeIn);
  printf("Mapper 33 inited\n");
}


x86 assembly (clang, -O0):
<m33init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <prg8init@plt>
mov    -0x10(%rbp),%rdi
sub    $0x4000,%rdi
call   1030 <prg8setBank2@plt>
mov    -0x10(%rbp),%rdi
sub    $0x2000,%rdi
call   1060 <prg8setBank3@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1070 <chr1init@plt>
lea    0xe4f(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m33init>:
push   %r15
push   %r14
push   %rbx
mov    %r9,%r14
mov    %r8,%r15
mov    %rsi,%rbx
call   1050 <prg8init@plt>
lea    -0x4000(%rbx),%rdi
call   1040 <prg8setBank2@plt>
add    $0xffffffffffffe000,%rbx
mov    %rbx,%rdi
call   1060 <prg8setBank3@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1070 <chr1init@plt>
lea    0xe70(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Mapper 33 inited\0A\00"
define void @m33init(i32* %0, i64 %1, i32* %2, i64 %3, i32* %4, i64 %5) {
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i64
store i32* %0, i32** %7
store i64 %1, i64* %8
store i32* %2, i32** %9
store i64 %3, i64* %10
store i32* %4, i32** %11
store i64 %5, i64* %12
%13 = load i32*, i32** %7
%14 = load i64, i64* %8
%15 = call i32 @prg8init(i32* %13, i64 %14)
%16 = load i64, i64* %8
%17 = sub nsw i64 %16, 16384
%18 = call i32 @prg8setBank2(i64 %17)
%19 = load i64, i64* %8
%20 = sub nsw i64 %19, 8192
%21 = call i32 @prg8setBank3(i64 %20)
%22 = load i32*, i32** %9
%23 = load i64, i64* %10
%24 = load i32*, i32** %11
%25 = load i64, i64* %12
%26 = call i32 @chr1init(i32* %24, i64 %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"Mapper 33 inited\00"
define void @m33init(i32* %0, i64 %1, i32* nocapture readnone %2, i64 %3, i32* %4, i64 %5) {
%7 = tail call i32 @prg8init(i32* %0, i64 %1)
%8 = add nsw i64 %1, -16384
%9 = tail call i32 @prg8setBank2(i64 %8)
%10 = add nsw i64 %1, -8192
%11 = tail call i32 @prg8setBank3(i64 %10)
%12 = tail call i32 @chr1init(i32* %4, i64 %5)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}