#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_dab(void) {
  si46xx_reset();
  si46xx_powerup();
  si46xx_hostload("firmware/rom00_patch.016.bin");
  si46xx_hostload("firmware/dab_radio_5_0_5.bin");
  si46xx_boot();
  si46xx_get_sys_state();
  si46xx_get_partinfo();
  si46xx_set_property(0x1712, 0x0001);
  si46xx_set_property(0x0800, 0x0002);
  si46xx_set_property(0x0200, 0x0000);
}


x86 assembly (clang, -O0):
<si46xx_init_dab>:
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    $0x1712,%edi
mov    $0x1,%esi
call   1060 <si46xx_set_property@plt>
mov    $0x800,%edi
mov    $0x2,%esi
call   1060 <si46xx_set_property@plt>
mov    $0x200,%edi
xor    %esi,%esi
call   1060 <si46xx_set_property@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<si46xx_init_dab>:
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    $0x1712,%edi
mov    $0x1,%esi
call   1060 <si46xx_set_property@plt>
mov    $0x800,%edi
mov    $0x2,%esi
call   1060 <si46xx_set_property@plt>
mov    $0x200,%edi
xor    %esi,%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 = [29 x i8] c"firmware/dab_radio_5_0_5.bin\00"
define void @si46xx_init_dab() {
%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 ([29 x i8], [29 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 5906, i32 1)
%9 = call i32 @si46xx_set_property(i32 2048, i32 2)
%10 = call i32 @si46xx_set_property(i32 512, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"firmware/rom00_patch.016.bin\00"
@.str.1 = [29 x i8] c"firmware/dab_radio_5_0_5.bin\00"
define void @si46xx_init_dab() {
%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 ([29 x i8], [29 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 5906, i32 1)
%9 = tail call i32 @si46xx_set_property(i32 2048, i32 2)
%10 = tail call i32 @si46xx_set_property(i32 512, i32 0)
ret void
}