#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 */
struct i2c_client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gslX680_shutdown_high(struct i2c_client *);
int /*<<< orphan*/ gslX680_shutdown_low(struct i2c_client *);
int /*<<< orphan*/ gsl_load_fw(struct i2c_client *, char *);
int /*<<< orphan*/ reset_chip(struct i2c_client *);
int /*<<< orphan*/ startup_chip(struct i2c_client *);
int /*<<< orphan*/ usleep(int);
void init_chip(struct i2c_client *client, char *fw_file) {
  reset_chip(client);
  gsl_load_fw(client, fw_file);
  startup_chip(client);
  reset_chip(client);
  gslX680_shutdown_low(client);
  usleep(50000);
  gslX680_shutdown_high(client);
  usleep(30000);
  gslX680_shutdown_low(client);
  usleep(5000);
  gslX680_shutdown_high(client);
  usleep(20000);
  reset_chip(client);
  startup_chip(client);
}


x86 assembly (clang, -O0):
<init_chip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reset_chip@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1070 <gsl_load_fw@plt>
mov    -0x8(%rbp),%rdi
call   1050 <startup_chip@plt>
mov    -0x8(%rbp),%rdi
call   1030 <reset_chip@plt>
mov    -0x8(%rbp),%rdi
call   1040 <gslX680_shutdown_low@plt>
mov    $0xc350,%edi
call   1080 <usleep@plt>
mov    -0x8(%rbp),%rdi
call   1060 <gslX680_shutdown_high@plt>
mov    $0x7530,%edi
call   1080 <usleep@plt>
mov    -0x8(%rbp),%rdi
call   1040 <gslX680_shutdown_low@plt>
mov    $0x1388,%edi
call   1080 <usleep@plt>
mov    -0x8(%rbp),%rdi
call   1060 <gslX680_shutdown_high@plt>
mov    $0x4e20,%edi
call   1080 <usleep@plt>
mov    -0x8(%rbp),%rdi
call   1030 <reset_chip@plt>
mov    -0x8(%rbp),%rdi
call   1050 <startup_chip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_chip>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <reset_chip@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <gsl_load_fw@plt>
mov    %rbx,%rdi
call   1050 <startup_chip@plt>
mov    %rbx,%rdi
call   1030 <reset_chip@plt>
mov    %rbx,%rdi
call   1040 <gslX680_shutdown_low@plt>
mov    $0xc350,%edi
call   1080 <usleep@plt>
mov    %rbx,%rdi
call   1060 <gslX680_shutdown_high@plt>
mov    $0x7530,%edi
call   1080 <usleep@plt>
mov    %rbx,%rdi
call   1040 <gslX680_shutdown_low@plt>
mov    $0x1388,%edi
call   1080 <usleep@plt>
mov    %rbx,%rdi
call   1060 <gslX680_shutdown_high@plt>
mov    $0x4e20,%edi
call   1080 <usleep@plt>
mov    %rbx,%rdi
call   1030 <reset_chip@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <startup_chip@plt>

LLVM IR (-O0):
%struct.i2c_client = type { i32 }
define void @init_chip(%struct.i2c_client* %0, i8* %1) {
%3 = alloca %struct.i2c_client*
%4 = alloca i8*
store %struct.i2c_client* %0, %struct.i2c_client** %3
store i8* %1, i8** %4
%5 = load %struct.i2c_client*, %struct.i2c_client** %3
%6 = call i32 @reset_chip(%struct.i2c_client* %5)
%7 = load %struct.i2c_client*, %struct.i2c_client** %3
%8 = load i8*, i8** %4
%9 = call i32 @gsl_load_fw(%struct.i2c_client* %7, i8* %8)
%10 = load %struct.i2c_client*, %struct.i2c_client** %3
%11 = call i32 @startup_chip(%struct.i2c_client* %10)
%12 = load %struct.i2c_client*, %struct.i2c_client** %3
%13 = call i32 @reset_chip(%struct.i2c_client* %12)
%14 = load %struct.i2c_client*, %struct.i2c_client** %3
%15 = call i32 @gslX680_shutdown_low(%struct.i2c_client* %14)
%16 = call i32 @usleep(i32 50000)
%17 = load %struct.i2c_client*, %struct.i2c_client** %3
%18 = call i32 @gslX680_shutdown_high(%struct.i2c_client* %17)
%19 = call i32 @usleep(i32 30000)
%20 = load %struct.i2c_client*, %struct.i2c_client** %3
%21 = call i32 @gslX680_shutdown_low(%struct.i2c_client* %20)
%22 = call i32 @usleep(i32 5000)
%23 = load %struct.i2c_client*, %struct.i2c_client** %3
%24 = call i32 @gslX680_shutdown_high(%struct.i2c_client* %23)
%25 = call i32 @usleep(i32 20000)
%26 = load %struct.i2c_client*, %struct.i2c_client** %3
%27 = call i32 @reset_chip(%struct.i2c_client* %26)
%28 = load %struct.i2c_client*, %struct.i2c_client** %3
%29 = call i32 @startup_chip(%struct.i2c_client* %28)
ret void
}

LLVM IR (-O2):
%struct.i2c_client = type { i32 }
define void @init_chip(%struct.i2c_client* %0, i8* %1) {
%3 = tail call i32 @reset_chip(%struct.i2c_client* %0)
%4 = tail call i32 @gsl_load_fw(%struct.i2c_client* %0, i8* %1)
%5 = tail call i32 @startup_chip(%struct.i2c_client* %0)
%6 = tail call i32 @reset_chip(%struct.i2c_client* %0)
%7 = tail call i32 @gslX680_shutdown_low(%struct.i2c_client* %0)
%8 = tail call i32 @usleep(i32 50000)
%9 = tail call i32 @gslX680_shutdown_high(%struct.i2c_client* %0)
%10 = tail call i32 @usleep(i32 30000)
%11 = tail call i32 @gslX680_shutdown_low(%struct.i2c_client* %0)
%12 = tail call i32 @usleep(i32 5000)
%13 = tail call i32 @gslX680_shutdown_high(%struct.i2c_client* %0)
%14 = tail call i32 @usleep(i32 20000)
%15 = tail call i32 @reset_chip(%struct.i2c_client* %0)
%16 = tail call i32 @startup_chip(%struct.i2c_client* %0)
ret void
}