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

/* Variables and functions */
int /*<<< orphan*/ bbm_byte_write(void *, int, int, int);
int /*<<< orphan*/ bbm_long_write(void *, int, int, int);
int /*<<< orphan*/ bbm_word_write(void *, int, int, int);
int /*<<< orphan*/ fc8300_reset(void *, int);
int /*<<< orphan*/ fc8300_set_default_core_clk(void *, int);
int /*<<< orphan*/ fc8300_set_tsif_clk(void *, int);
int /*<<< orphan*/ msWait(int);
int fc8300_init(void *handle, unsigned short devid) {
  bbm_byte_write(handle, 0x5800, 0x0013, 0x80);
  bbm_byte_write(handle, 0x5f04, 0x00c5, 0x03);
  msWait(1);
  bbm_byte_write(handle, 0x5f04, 0x00c5, 0x00);
  bbm_byte_write(handle, 0x5f04, 0x0050, 0x01);
  bbm_byte_write(handle, 0x5f04, 0x0051, 0x00);
  fc8300_set_default_core_clk(handle, 0x5f04);
  fc8300_set_tsif_clk(handle, 0x5800);
  fc8300_reset(handle, 0x5f04);
  bbm_byte_write(handle, 0x5f04, 0x00b4, 0x00);
  bbm_byte_write(handle, 0x5f04, 0x00b5, 0x00);
  bbm_byte_write(handle, 0x5f04, 0x00b3, 0x06);
  bbm_byte_write(handle, 0x5f04, 0x00ba, 0x01);
  bbm_byte_write(handle, 0x5f04, 0x00b9, 0x00);
  bbm_byte_write(handle, 0x5f04, 0x00ae, 0x00);
  bbm_long_write(handle, 0x5f04, 0x00e0, 0x07777777);
  bbm_byte_write(handle, 0x5f04, 0x1020, 0x71);
  bbm_byte_write(handle, 0x5f04, 0x1069, 0x0a);
  bbm_byte_write(handle, 0x5f04, 0x1000, 0x27);
  bbm_byte_write(handle, 0x5f04, 0x1083, 0x16);
  bbm_byte_write(handle, 0x5f04, 0x1084, 0x16);
  bbm_byte_write(handle, 0x5f04, 0x3052, 0x06);
  bbm_word_write(handle, 0x5f04, 0x3104, 0x1900);
  bbm_word_write(handle, 0x5f04, 0x1008, 0x03e0);
  bbm_word_write(handle, 0x5f04, 0x4070, 0x003f);
  bbm_word_write(handle, 0x5f04, 0x4200, 0x0620);
  bbm_byte_write(handle, 0x5f04, 0x1010, 0x00);
  bbm_byte_write(handle, 0x5800, 0x4208, 0x02);
  bbm_byte_write(handle, 0x5800, 0x4307, 0x16);
  bbm_word_write(handle, 0x5f04, 0x8010, (0x0000));
  bbm_word_write(handle, 0x5f04, 0x8020, ((0x0000) + (188 * 320) - 1));
  bbm_word_write(handle, 0x5f04, 0x8030, ((188 * 320) / 2 - 1));
  bbm_word_write(handle, 0x5f04, 0x8018,
                 (((((0x0000) + (188 * 320)) + (0)) + (0)) + (0)));
  bbm_word_write(
      handle, 0x5f04, 0x8028,
      ((((((0x0000) + (188 * 320)) + (0)) + (0)) + (0)) + (204) - 1));
  bbm_word_write(handle, 0x5f04, 0x8038, ((204) / 2 - 1));
  bbm_word_write(handle, 0x5f04, 0x801a,
                 ((((((0x0000) + (188 * 320)) + (0)) + (0)) + (0)) + (204)));
  bbm_word_write(handle, 0x5f04, 0x802a,
                 (((((((0x0000) + (188 * 320)) + (0)) + (0)) + (0)) + (204)) +
                  (2040) - 1));
  bbm_word_write(handle, 0x5f04, 0x803a, ((2040) / 2 - 1));
  bbm_word_write(
      handle, 0x5f04, 0x801c,
      (((((((0x0000) + (188 * 320)) + (0)) + (0)) + (0)) + (204)) + (2040)));
  bbm_word_write(
      handle, 0x5f04, 0x802c,
      ((((((((0x0000) + (188 * 320)) + (0)) + (0)) + (0)) + (204)) + (2040)) +
       (408) - 1));
  bbm_word_write(handle, 0x5f04, 0x803c, ((408) / 2 - 1));
  bbm_word_write(
      handle, 0x5f04, 0x801e,
      ((((((((0x0000) + (188 * 320)) + (0)) + (0)) + (0)) + (204)) + (2040)) +
       (408)));
  bbm_word_write(
      handle, 0x5f04, 0x802e,
      (((((((((0x0000) + (188 * 320)) + (0)) + (0)) + (0)) + (204)) + (2040)) +
        (408)) +
       (28) - 1));
  bbm_word_write(handle, 0x5f04, 0x803e, ((28) / 2 - 1));
  bbm_byte_write(handle, 0x5f04, 0x417f, 0x10);
  bbm_byte_write(handle, 0x5f04, 0x41c7, 0x02);
  bbm_byte_write(handle, 0x5f04, 0x0020, 0x00);
  bbm_byte_write(handle, 0x5f04, 0xa000, 0x00);
  bbm_byte_write(handle, 0x5f04, 0x4242, 0x09);
  bbm_byte_write(handle, 0x5f04, 0x9001, 0x04);
  bbm_byte_write(handle, 0x5f04, 0x9000, 0x04);
  bbm_byte_write(handle, 0x5800, 0x0017, 0x01);
  bbm_byte_write(handle, 0x5800, 0x8002, 0x01);
  bbm_byte_write(handle, 0x5800, 0x8003, 0x01);
  bbm_byte_write(handle, 0x5800, 0x0003, 0x01);
  bbm_byte_write(handle, 0x5800, 0x0006, 0x01);
  return 0;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5800,%esi
mov    $0x13,%edx
mov    $0x80,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0xc5,%edx
mov    $0x3,%ecx
call   1050 <bbm_byte_write@plt>
mov    $0x1,%edi
call   1060 <msWait@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0xc5,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x50,%edx
mov    $0x1,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x51,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
call   1030 <fc8300_set_default_core_clk@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5800,%esi
call   1090 <fc8300_set_tsif_clk@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
call   1070 <fc8300_reset@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0xb4,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0xb5,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0xb3,%edx
mov    $0x6,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0xba,%edx
mov    $0x1,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0xb9,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0xae,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0xe0,%edx
mov    $0x7777777,%ecx
call   1040 <bbm_long_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x1020,%edx
mov    $0x71,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x1069,%edx
mov    $0xa,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x1000,%edx
mov    $0x27,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x1083,%edx
mov    $0x16,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x1084,%edx
mov    $0x16,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x3052,%edx
mov    $0x6,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x3104,%edx
mov    $0x1900,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x1008,%edx
mov    $0x3e0,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x4070,%edx
mov    $0x3f,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x4200,%edx
mov    $0x620,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x1010,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5800,%esi
mov    $0x4208,%edx
mov    $0x2,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5800,%esi
mov    $0x4307,%edx
mov    $0x16,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x8010,%edx
xor    %ecx,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x8020,%edx
mov    $0xeaff,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x8030,%edx
mov    $0x757f,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x8018,%edx
mov    $0xeb00,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x8028,%edx
mov    $0xebcb,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x8038,%edx
mov    $0x65,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x801a,%edx
mov    $0xebcc,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x802a,%edx
mov    $0xf3c3,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x803a,%edx
mov    $0x3fb,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x801c,%edx
mov    $0xf3c4,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x802c,%edx
mov    $0xf55b,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x803c,%edx
mov    $0xcb,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x801e,%edx
mov    $0xf55c,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x802e,%edx
mov    $0xf577,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x803e,%edx
mov    $0xd,%ecx
call   1080 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x417f,%edx
mov    $0x10,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x41c7,%edx
mov    $0x2,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x20,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0xa000,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x4242,%edx
mov    $0x9,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x9001,%edx
mov    $0x4,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5f04,%esi
mov    $0x9000,%edx
mov    $0x4,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5800,%esi
mov    $0x17,%edx
mov    $0x1,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5800,%esi
mov    $0x8002,%edx
mov    $0x1,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5800,%esi
mov    $0x8003,%edx
mov    $0x1,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5800,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
call   1050 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5800,%esi
mov    $0x6,%edx
mov    $0x1,%ecx
call   1050 <bbm_byte_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
mov    $0x5800,%esi
mov    $0x13,%edx
mov    $0x80,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0xc5,%edx
mov    $0x3,%ecx
call   1050 <bbm_byte_write@plt>
mov    $0x1,%edi
call   1060 <msWait@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0xc5,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x50,%edx
mov    $0x1,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x51,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
call   1030 <fc8300_set_default_core_clk@plt>
mov    %rbx,%rdi
mov    $0x5800,%esi
call   1090 <fc8300_set_tsif_clk@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
call   1070 <fc8300_reset@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0xb4,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0xb5,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0xb3,%edx
mov    $0x6,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0xba,%edx
mov    $0x1,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0xb9,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0xae,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0xe0,%edx
mov    $0x7777777,%ecx
call   1040 <bbm_long_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x1020,%edx
mov    $0x71,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x1069,%edx
mov    $0xa,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x1000,%edx
mov    $0x27,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x1083,%edx
mov    $0x16,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x1084,%edx
mov    $0x16,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x3052,%edx
mov    $0x6,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x3104,%edx
mov    $0x1900,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x1008,%edx
mov    $0x3e0,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x4070,%edx
mov    $0x3f,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x4200,%edx
mov    $0x620,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x1010,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5800,%esi
mov    $0x4208,%edx
mov    $0x2,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5800,%esi
mov    $0x4307,%edx
mov    $0x16,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x8010,%edx
xor    %ecx,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x8020,%edx
mov    $0xeaff,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x8030,%edx
mov    $0x757f,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x8018,%edx
mov    $0xeb00,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x8028,%edx
mov    $0xebcb,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x8038,%edx
mov    $0x65,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x801a,%edx
mov    $0xebcc,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x802a,%edx
mov    $0xf3c3,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x803a,%edx
mov    $0x3fb,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x801c,%edx
mov    $0xf3c4,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x802c,%edx
mov    $0xf55b,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x803c,%edx
mov    $0xcb,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x801e,%edx
mov    $0xf55c,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x802e,%edx
mov    $0xf577,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x803e,%edx
mov    $0xd,%ecx
call   1080 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x417f,%edx
mov    $0x10,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x41c7,%edx
mov    $0x2,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x20,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0xa000,%edx
xor    %ecx,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x4242,%edx
mov    $0x9,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x9001,%edx
mov    $0x4,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5f04,%esi
mov    $0x9000,%edx
mov    $0x4,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5800,%esi
mov    $0x17,%edx
mov    $0x1,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5800,%esi
mov    $0x8002,%edx
mov    $0x1,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5800,%esi
mov    $0x8003,%edx
mov    $0x1,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5800,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
call   1050 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    $0x5800,%esi
mov    $0x6,%edx
mov    $0x1,%ecx
call   1050 <bbm_byte_write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fc8300_init(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i8*, i8** %3
%6 = call i32 @bbm_byte_write(i8* %5, i32 22528, i32 19, i32 128)
%7 = load i8*, i8** %3
%8 = call i32 @bbm_byte_write(i8* %7, i32 24324, i32 197, i32 3)
%9 = call i32 @msWait(i32 1)
%10 = load i8*, i8** %3
%11 = call i32 @bbm_byte_write(i8* %10, i32 24324, i32 197, i32 0)
%12 = load i8*, i8** %3
%13 = call i32 @bbm_byte_write(i8* %12, i32 24324, i32 80, i32 1)
%14 = load i8*, i8** %3
%15 = call i32 @bbm_byte_write(i8* %14, i32 24324, i32 81, i32 0)
%16 = load i8*, i8** %3
%17 = call i32 @fc8300_set_default_core_clk(i8* %16, i32 24324)
%18 = load i8*, i8** %3
%19 = call i32 @fc8300_set_tsif_clk(i8* %18, i32 22528)
%20 = load i8*, i8** %3
%21 = call i32 @fc8300_reset(i8* %20, i32 24324)
%22 = load i8*, i8** %3
%23 = call i32 @bbm_byte_write(i8* %22, i32 24324, i32 180, i32 0)
%24 = load i8*, i8** %3
%25 = call i32 @bbm_byte_write(i8* %24, i32 24324, i32 181, i32 0)
%26 = load i8*, i8** %3
%27 = call i32 @bbm_byte_write(i8* %26, i32 24324, i32 179, i32 6)
%28 = load i8*, i8** %3
%29 = call i32 @bbm_byte_write(i8* %28, i32 24324, i32 186, i32 1)
%30 = load i8*, i8** %3
%31 = call i32 @bbm_byte_write(i8* %30, i32 24324, i32 185, i32 0)
%32 = load i8*, i8** %3
%33 = call i32 @bbm_byte_write(i8* %32, i32 24324, i32 174, i32 0)
%34 = load i8*, i8** %3
%35 = call i32 @bbm_long_write(i8* %34, i32 24324, i32 224, i32 125269879)
%36 = load i8*, i8** %3
%37 = call i32 @bbm_byte_write(i8* %36, i32 24324, i32 4128, i32 113)
%38 = load i8*, i8** %3
%39 = call i32 @bbm_byte_write(i8* %38, i32 24324, i32 4201, i32 10)
%40 = load i8*, i8** %3
%41 = call i32 @bbm_byte_write(i8* %40, i32 24324, i32 4096, i32 39)
%42 = load i8*, i8** %3
%43 = call i32 @bbm_byte_write(i8* %42, i32 24324, i32 4227, i32 22)
%44 = load i8*, i8** %3
%45 = call i32 @bbm_byte_write(i8* %44, i32 24324, i32 4228, i32 22)
%46 = load i8*, i8** %3
%47 = call i32 @bbm_byte_write(i8* %46, i32 24324, i32 12370, i32 6)
%48 = load i8*, i8** %3
%49 = call i32 @bbm_word_write(i8* %48, i32 24324, i32 12548, i32 6400)
%50 = load i8*, i8** %3
%51 = call i32 @bbm_word_write(i8* %50, i32 24324, i32 4104, i32 992)
%52 = load i8*, i8** %3
%53 = call i32 @bbm_word_write(i8* %52, i32 24324, i32 16496, i32 63)
%54 = load i8*, i8** %3
%55 = call i32 @bbm_word_write(i8* %54, i32 24324, i32 16896, i32 1568)
%56 = load i8*, i8** %3
%57 = call i32 @bbm_byte_write(i8* %56, i32 24324, i32 4112, i32 0)
%58 = load i8*, i8** %3
%59 = call i32 @bbm_byte_write(i8* %58, i32 22528, i32 16904, i32 2)
%60 = load i8*, i8** %3
%61 = call i32 @bbm_byte_write(i8* %60, i32 22528, i32 17159, i32 22)
%62 = load i8*, i8** %3
%63 = call i32 @bbm_word_write(i8* %62, i32 24324, i32 32784, i32 0)
%64 = load i8*, i8** %3
%65 = call i32 @bbm_word_write(i8* %64, i32 24324, i32 32800, i32 60159)
%66 = load i8*, i8** %3
%67 = call i32 @bbm_word_write(i8* %66, i32 24324, i32 32816, i32 30079)
%68 = load i8*, i8** %3
%69 = call i32 @bbm_word_write(i8* %68, i32 24324, i32 32792, i32 60160)
%70 = load i8*, i8** %3
%71 = call i32 @bbm_word_write(i8* %70, i32 24324, i32 32808, i32 60363)
%72 = load i8*, i8** %3
%73 = call i32 @bbm_word_write(i8* %72, i32 24324, i32 32824, i32 101)
%74 = load i8*, i8** %3
%75 = call i32 @bbm_word_write(i8* %74, i32 24324, i32 32794, i32 60364)
%76 = load i8*, i8** %3
%77 = call i32 @bbm_word_write(i8* %76, i32 24324, i32 32810, i32 62403)
%78 = load i8*, i8** %3
%79 = call i32 @bbm_word_write(i8* %78, i32 24324, i32 32826, i32 1019)
%80 = load i8*, i8** %3
%81 = call i32 @bbm_word_write(i8* %80, i32 24324, i32 32796, i32 62404)
%82 = load i8*, i8** %3
%83 = call i32 @bbm_word_write(i8* %82, i32 24324, i32 32812, i32 62811)
%84 = load i8*, i8** %3
%85 = call i32 @bbm_word_write(i8* %84, i32 24324, i32 32828, i32 203)
%86 = load i8*, i8** %3
%87 = call i32 @bbm_word_write(i8* %86, i32 24324, i32 32798, i32 62812)
%88 = load i8*, i8** %3
%89 = call i32 @bbm_word_write(i8* %88, i32 24324, i32 32814, i32 62839)
%90 = load i8*, i8** %3
%91 = call i32 @bbm_word_write(i8* %90, i32 24324, i32 32830, i32 13)
%92 = load i8*, i8** %3
%93 = call i32 @bbm_byte_write(i8* %92, i32 24324, i32 16767, i32 16)
%94 = load i8*, i8** %3
%95 = call i32 @bbm_byte_write(i8* %94, i32 24324, i32 16839, i32 2)
%96 = load i8*, i8** %3
%97 = call i32 @bbm_byte_write(i8* %96, i32 24324, i32 32, i32 0)
%98 = load i8*, i8** %3
%99 = call i32 @bbm_byte_write(i8* %98, i32 24324, i32 40960, i32 0)
%100 = load i8*, i8** %3
%101 = call i32 @bbm_byte_write(i8* %100, i32 24324, i32 16962, i32 9)
%102 = load i8*, i8** %3
%103 = call i32 @bbm_byte_write(i8* %102, i32 24324, i32 36865, i32 4)
%104 = load i8*, i8** %3
%105 = call i32 @bbm_byte_write(i8* %104, i32 24324, i32 36864, i32 4)
%106 = load i8*, i8** %3
%107 = call i32 @bbm_byte_write(i8* %106, i32 22528, i32 23, i32 1)
%108 = load i8*, i8** %3
%109 = call i32 @bbm_byte_write(i8* %108, i32 22528, i32 32770, i32 1)
%110 = load i8*, i8** %3
%111 = call i32 @bbm_byte_write(i8* %110, i32 22528, i32 32771, i32 1)
%112 = load i8*, i8** %3
%113 = call i32 @bbm_byte_write(i8* %112, i32 22528, i32 3, i32 1)
%114 = load i8*, i8** %3
%115 = call i32 @bbm_byte_write(i8* %114, i32 22528, i32 6, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @fc8300_init(i8* %0, i16 zeroext %1) {
%3 = tail call i32 @bbm_byte_write(i8* %0, i32 22528, i32 19, i32 128)
%4 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 197, i32 3)
%5 = tail call i32 @msWait(i32 1)
%6 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 197, i32 0)
%7 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 80, i32 1)
%8 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 81, i32 0)
%9 = tail call i32 @fc8300_set_default_core_clk(i8* %0, i32 24324)
%10 = tail call i32 @fc8300_set_tsif_clk(i8* %0, i32 22528)
%11 = tail call i32 @fc8300_reset(i8* %0, i32 24324)
%12 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 180, i32 0)
%13 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 181, i32 0)
%14 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 179, i32 6)
%15 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 186, i32 1)
%16 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 185, i32 0)
%17 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 174, i32 0)
%18 = tail call i32 @bbm_long_write(i8* %0, i32 24324, i32 224, i32 125269879)
%19 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 4128, i32 113)
%20 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 4201, i32 10)
%21 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 4096, i32 39)
%22 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 4227, i32 22)
%23 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 4228, i32 22)
%24 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 12370, i32 6)
%25 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 12548, i32 6400)
%26 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 4104, i32 992)
%27 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 16496, i32 63)
%28 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 16896, i32 1568)
%29 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 4112, i32 0)
%30 = tail call i32 @bbm_byte_write(i8* %0, i32 22528, i32 16904, i32 2)
%31 = tail call i32 @bbm_byte_write(i8* %0, i32 22528, i32 17159, i32 22)
%32 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32784, i32 0)
%33 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32800, i32 60159)
%34 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32816, i32 30079)
%35 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32792, i32 60160)
%36 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32808, i32 60363)
%37 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32824, i32 101)
%38 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32794, i32 60364)
%39 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32810, i32 62403)
%40 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32826, i32 1019)
%41 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32796, i32 62404)
%42 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32812, i32 62811)
%43 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32828, i32 203)
%44 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32798, i32 62812)
%45 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32814, i32 62839)
%46 = tail call i32 @bbm_word_write(i8* %0, i32 24324, i32 32830, i32 13)
%47 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 16767, i32 16)
%48 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 16839, i32 2)
%49 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 32, i32 0)
%50 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 40960, i32 0)
%51 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 16962, i32 9)
%52 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 36865, i32 4)
%53 = tail call i32 @bbm_byte_write(i8* %0, i32 24324, i32 36864, i32 4)
%54 = tail call i32 @bbm_byte_write(i8* %0, i32 22528, i32 23, i32 1)
%55 = tail call i32 @bbm_byte_write(i8* %0, i32 22528, i32 32770, i32 1)
%56 = tail call i32 @bbm_byte_write(i8* %0, i32 22528, i32 32771, i32 1)
%57 = tail call i32 @bbm_byte_write(i8* %0, i32 22528, i32 3, i32 1)
%58 = tail call i32 @bbm_byte_write(i8* %0, i32 22528, i32 6, i32 1)
ret i32 0
}