#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*/ si46xx_boot();
int /*<<< orphan*/ si46xx_get_partinfo();
int /*<<< orphan*/ si46xx_get_sys_state();
int /*<<< orphan*/ si46xx_hostload(char *);
int /*<<< orphan*/ si46xx_powerup();
int /*<<< orphan*/ si46xx_reset();
int /*<<< orphan*/ si46xx_set_property(int, int);
void si46xx_init_fm(void) {
  si46xx_reset();
  si46xx_powerup();
  si46xx_hostload("firmware/rom00_patch.016.bin");
  si46xx_hostload("firmware/fmhd_radio_5_0_4.bin");
  si46xx_boot();
  si46xx_get_sys_state();
  si46xx_get_partinfo();
  si46xx_set_property(0x0800, 0x0002);
  si46xx_set_property(0x3C02, 0x0001);
  si46xx_set_property(0x3900, 0x01);
}


x86 assembly (clang, -O0):
<si46xx_init_fm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <si46xx_reset@plt>
mov    $0x0,%al
call   1050 <si46xx_powerup@plt>
lea    0xe77(%rip),%rdi
call   1080 <si46xx_hostload@plt>
lea    0xe88(%rip),%rdi
call   1080 <si46xx_hostload@plt>
mov    $0x0,%al
call   1070 <si46xx_boot@plt>
mov    $0x0,%al
call   1030 <si46xx_get_sys_state@plt>
mov    $0x0,%al
call   1090 <si46xx_get_partinfo@plt>
mov    $0x800,%edi
mov    $0x2,%esi
call   1060 <si46xx_set_property@plt>
mov    $0x3c02,%edi
mov    $0x1,%esi
call   1060 <si46xx_set_property@plt>
mov    $0x3900,%edi
mov    $0x1,%esi
call   1060 <si46xx_set_property@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<si46xx_init_fm>:
push   %rax
xor    %eax,%eax
call   1040 <si46xx_reset@plt>
xor    %eax,%eax
call   1050 <si46xx_powerup@plt>
lea    0xe7a(%rip),%rdi
call   1080 <si46xx_hostload@plt>
lea    0xe8b(%rip),%rdi
call   1080 <si46xx_hostload@plt>
xor    %eax,%eax
call   1070 <si46xx_boot@plt>
xor    %eax,%eax
call   1030 <si46xx_get_sys_state@plt>
xor    %eax,%eax
call   1090 <si46xx_get_partinfo@plt>
mov    $0x800,%edi
mov    $0x2,%esi
call   1060 <si46xx_set_property@plt>
mov    $0x3c02,%edi
mov    $0x1,%esi
call   1060 <si46xx_set_property@plt>
mov    $0x3900,%edi
mov    $0x1,%esi
pop    %rax
jmp    1060 <si46xx_set_property@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"firmware/rom00_patch.016.bin\00"
@.str.1 = [30 x i8] c"firmware/fmhd_radio_5_0_4.bin\00"
define void @si46xx_init_fm() {
%1 = call i32 (...) @si46xx_reset()
%2 = call i32 (...) @si46xx_powerup()
%3 = call i32 @si46xx_hostload(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @si46xx_hostload(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @si46xx_boot()
%6 = call i32 (...) @si46xx_get_sys_state()
%7 = call i32 (...) @si46xx_get_partinfo()
%8 = call i32 @si46xx_set_property(i32 2048, i32 2)
%9 = call i32 @si46xx_set_property(i32 15362, i32 1)
%10 = call i32 @si46xx_set_property(i32 14592, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"firmware/rom00_patch.016.bin\00"
@.str.1 = [30 x i8] c"firmware/fmhd_radio_5_0_4.bin\00"
define void @si46xx_init_fm() {
%1 = tail call i32 (...) @si46xx_reset()
%2 = tail call i32 (...) @si46xx_powerup()
%3 = tail call i32 @si46xx_hostload(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @si46xx_hostload(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @si46xx_boot()
%6 = tail call i32 (...) @si46xx_get_sys_state()
%7 = tail call i32 (...) @si46xx_get_partinfo()
%8 = tail call i32 @si46xx_set_property(i32 2048, i32 2)
%9 = tail call i32 @si46xx_set_property(i32 15362, i32 1)
%10 = tail call i32 @si46xx_set_property(i32 14592, i32 1)
ret void
}