#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*/ chr2init(int /*<<< orphan*/ *, scalar_t__);
int /*<<< orphan*/ ppuSetNameTblVertical();
int /*<<< orphan*/ prg8init(int /*<<< orphan*/ *, scalar_t__);
int /*<<< orphan*/ prg8setBank1(scalar_t__);
int /*<<< orphan*/ prg8setBank2(scalar_t__);
int /*<<< orphan*/ prg8setBank3(scalar_t__);
int /*<<< orphan*/ printf(char *);
void m193init(uint8_t *prgROMin, uint32_t prgROMsizeIn, uint8_t *prgRAMin,
              uint32_t prgRAMsizeIn, uint8_t *chrROMin, uint32_t chrROMsizeIn) {
  (void)prgRAMin;
  (void)prgRAMsizeIn;
  prg8init(prgROMin, prgROMsizeIn);
  prg8setBank1(prgROMsizeIn - 0x6000);
  prg8setBank2(prgROMsizeIn - 0x4000);
  prg8setBank3(prgROMsizeIn - 0x2000);
  chr2init(chrROMin, chrROMsizeIn);
  ppuSetNameTblVertical();
  printf("Mapper 193 inited\n");
}


x86 assembly (clang, -O0):
<m193init>:
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   1060 <prg8init@plt>
mov    -0x10(%rbp),%rdi
sub    $0x6000,%rdi
call   1080 <prg8setBank1@plt>
mov    -0x10(%rbp),%rdi
sub    $0x4000,%rdi
call   1030 <prg8setBank2@plt>
mov    -0x10(%rbp),%rdi
sub    $0x2000,%rdi
call   1070 <prg8setBank3@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1050 <chr2init@plt>
mov    $0x0,%al
call   1090 <ppuSetNameTblVertical@plt>
lea    0xe18(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m193init>:
push   %r15
push   %r14
push   %rbx
mov    %r9,%r14
mov    %r8,%r15
mov    %rsi,%rbx
call   1060 <prg8init@plt>
lea    -0x6000(%rbx),%rdi
call   1080 <prg8setBank1@plt>
lea    -0x4000(%rbx),%rdi
call   1040 <prg8setBank2@plt>
add    $0xffffffffffffe000,%rbx
mov    %rbx,%rdi
call   1070 <prg8setBank3@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <chr2init@plt>
xor    %eax,%eax
call   1090 <ppuSetNameTblVertical@plt>
lea    0xe3d(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Mapper 193 inited\0A\00"
define void @m193init(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** %9
%14 = load i64, i64* %10
%15 = load i32*, i32** %7
%16 = load i64, i64* %8
%17 = call i32 @prg8init(i32* %15, i64 %16)
%18 = load i64, i64* %8
%19 = sub nsw i64 %18, 24576
%20 = call i32 @prg8setBank1(i64 %19)
%21 = load i64, i64* %8
%22 = sub nsw i64 %21, 16384
%23 = call i32 @prg8setBank2(i64 %22)
%24 = load i64, i64* %8
%25 = sub nsw i64 %24, 8192
%26 = call i32 @prg8setBank3(i64 %25)
%27 = load i32*, i32** %11
%28 = load i64, i64* %12
%29 = call i32 @chr2init(i32* %27, i64 %28)
%30 = call i32 (...) @ppuSetNameTblVertical()
%31 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"Mapper 193 inited\00"
define void @m193init(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, -24576
%9 = tail call i32 @prg8setBank1(i64 %8)
%10 = add nsw i64 %1, -16384
%11 = tail call i32 @prg8setBank2(i64 %10)
%12 = add nsw i64 %1, -8192
%13 = tail call i32 @prg8setBank3(i64 %12)
%14 = tail call i32 @chr2init(i32* %4, i64 %5)
%15 = tail call i32 (...) @ppuSetNameTblVertical()
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}