#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*/ chr8init(int /*<<< orphan*/ *, scalar_t__);
int /*<<< orphan*/ prg16init(int /*<<< orphan*/ *, scalar_t__);
int /*<<< orphan*/ prg16setBank1(scalar_t__);
int /*<<< orphan*/ printf(char *);
void p16c8init(uint8_t *prgROMin, uint32_t prgROMsizeIn, uint8_t *prgRAMin,
               uint32_t prgRAMsizeIn, uint8_t *chrROMin,
               uint32_t chrROMsizeIn) {
  prg16init(prgROMin, prgROMsizeIn);
  prg16setBank1(prgROMsizeIn - 0x4000);
  (void)prgRAMin;
  (void)prgRAMsizeIn;
  chr8init(chrROMin, chrROMsizeIn);
  printf("16k PRG 8k CHR Mapper inited\n");
}


x86 assembly (clang, -O0):
<p16c8init>:
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 <prg16init@plt>
mov    -0x10(%rbp),%rdi
sub    $0x4000,%rdi
call   1050 <prg16setBank1@plt>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1040 <chr8init@plt>
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p16c8init>:
push   %r15
push   %r14
push   %rbx
mov    %r9,%r14
mov    %r8,%r15
mov    %rsi,%rbx
call   1060 <prg16init@plt>
add    $0xffffffffffffc000,%rbx
mov    %rbx,%rdi
call   1050 <prg16setBank1@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <chr8init@plt>
lea    0xe8c(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"16k PRG 8k CHR Mapper inited\0A\00"
define void @p16c8init(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 @prg16init(i32* %13, i64 %14)
%16 = load i64, i64* %8
%17 = sub nsw i64 %16, 16384
%18 = call i32 @prg16setBank1(i64 %17)
%19 = load i32*, i32** %9
%20 = load i64, i64* %10
%21 = load i32*, i32** %11
%22 = load i64, i64* %12
%23 = call i32 @chr8init(i32* %21, i64 %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"16k PRG 8k CHR Mapper inited\00"
define void @p16c8init(i32* %0, i64 %1, i32* nocapture readnone %2, i64 %3, i32* %4, i64 %5) {
%7 = tail call i32 @prg16init(i32* %0, i64 %1)
%8 = add nsw i64 %1, -16384
%9 = tail call i32 @prg16setBank1(i64 %8)
%10 = tail call i32 @chr8init(i32* %4, i64 %5)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}