#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 *, unsigned short, int, int);
int /*<<< orphan*/ bbm_word_write(void *, unsigned short, int, int);
int fc8300_set_tsif_clk(void *handle, unsigned short devid) {
  bbm_byte_write(handle, devid, 0x0010, 0x00);
  bbm_byte_write(handle, devid, 0x0060, 0x01);
  bbm_byte_write(handle, devid, 0x0061, 0x00);
  bbm_word_write(handle, devid, 0x0065, 0x0921);
  bbm_byte_write(handle, devid, 0x0062, 0x00);
  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    $0x10,%edx
xor    %ecx,%ecx
movzwl -0xa(%rbp),%esi
call   1030 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x60,%edx
mov    $0x1,%ecx
movzwl -0xa(%rbp),%esi
call   1030 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x61,%edx
xor    %ecx,%ecx
movzwl -0xa(%rbp),%esi
call   1030 <bbm_byte_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x65,%edx
mov    $0x921,%ecx
movzwl -0xa(%rbp),%esi
call   1040 <bbm_word_write@plt>
mov    -0x8(%rbp),%rdi
mov    $0x62,%edx
xor    %ecx,%ecx
movzwl -0xa(%rbp),%esi
call   1030 <bbm_byte_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x10,%edx
xor    %ecx,%ecx
call   1030 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x60,%edx
mov    $0x1,%ecx
call   1030 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x61,%edx
xor    %ecx,%ecx
call   1030 <bbm_byte_write@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x65,%edx
mov    $0x921,%ecx
call   1040 <bbm_word_write@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x62,%edx
xor    %ecx,%ecx
call   1030 <bbm_byte_write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fc8300_set_tsif_clk(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 = load i16, i16* %4
%7 = call i32 @bbm_byte_write(i8* %5, i16 zeroext %6, i32 16, i32 0)
%8 = load i8*, i8** %3
%9 = load i16, i16* %4
%10 = call i32 @bbm_byte_write(i8* %8, i16 zeroext %9, i32 96, i32 1)
%11 = load i8*, i8** %3
%12 = load i16, i16* %4
%13 = call i32 @bbm_byte_write(i8* %11, i16 zeroext %12, i32 97, i32 0)
%14 = load i8*, i8** %3
%15 = load i16, i16* %4
%16 = call i32 @bbm_word_write(i8* %14, i16 zeroext %15, i32 101, i32 2337)
%17 = load i8*, i8** %3
%18 = load i16, i16* %4
%19 = call i32 @bbm_byte_write(i8* %17, i16 zeroext %18, i32 98, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @fc8300_set_tsif_clk(i8* %0, i16 zeroext %1) {
%3 = tail call i32 @bbm_byte_write(i8* %0, i16 zeroext %1, i32 16, i32 0)
%4 = tail call i32 @bbm_byte_write(i8* %0, i16 zeroext %1, i32 96, i32 1)
%5 = tail call i32 @bbm_byte_write(i8* %0, i16 zeroext %1, i32 97, i32 0)
%6 = tail call i32 @bbm_word_write(i8* %0, i16 zeroext %1, i32 101, i32 2337)
%7 = tail call i32 @bbm_byte_write(i8* %0, i16 zeroext %1, i32 98, i32 0)
ret i32 0
}