#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 lspcon_i2c_spi_write_register(int, int, int);
int lspcon_i2c_spi_enable_hw_write(int fd) {
  int ret = 0;
  ret |= lspcon_i2c_spi_write_register(fd, 0xda, 0xaa);
  ret |= lspcon_i2c_spi_write_register(fd, 0xda, 0x55);
  ret |= lspcon_i2c_spi_write_register(fd, 0xda, 0x50);
  ret |= lspcon_i2c_spi_write_register(fd, 0xda, 0x41);
  ret |= lspcon_i2c_spi_write_register(fd, 0xda, 0x52);
  ret |= lspcon_i2c_spi_write_register(fd, 0xda, 0x44);
  return ret;
}


x86 assembly (clang, -O0):
<lspcon_i2c_spi_enable_hw_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xda,%esi
mov    $0xaa,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xda,%esi
mov    $0x55,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xda,%esi
mov    $0x50,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xda,%esi
mov    $0x41,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xda,%esi
mov    $0x52,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xda,%esi
mov    $0x44,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lspcon_i2c_spi_enable_hw_write>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xda,%esi
mov    $0xaa,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0xda,%esi
mov    $0x55,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
mov    %eax,%r15d
or     %r14d,%r15d
mov    %ebx,%edi
mov    $0xda,%esi
mov    $0x50,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0xda,%esi
mov    $0x41,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
mov    %eax,%ebp
or     %r14d,%ebp
or     %r15d,%ebp
mov    %ebx,%edi
mov    $0xda,%esi
mov    $0x52,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0xda,%esi
mov    $0x44,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
or     %r14d,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @lspcon_i2c_spi_enable_hw_write(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @lspcon_i2c_spi_write_register(i32 %4, i32 218, i32 170)
%6 = load i32, i32* %3
%7 = or i32 %6, %5
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @lspcon_i2c_spi_write_register(i32 %8, i32 218, i32 85)
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = call i32 @lspcon_i2c_spi_write_register(i32 %12, i32 218, i32 80)
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %2
%17 = call i32 @lspcon_i2c_spi_write_register(i32 %16, i32 218, i32 65)
%18 = load i32, i32* %3
%19 = or i32 %18, %17
store i32 %19, i32* %3
%20 = load i32, i32* %2
%21 = call i32 @lspcon_i2c_spi_write_register(i32 %20, i32 218, i32 82)
%22 = load i32, i32* %3
%23 = or i32 %22, %21
store i32 %23, i32* %3
%24 = load i32, i32* %2
%25 = call i32 @lspcon_i2c_spi_write_register(i32 %24, i32 218, i32 68)
%26 = load i32, i32* %3
%27 = or i32 %26, %25
store i32 %27, i32* %3
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @lspcon_i2c_spi_enable_hw_write(i32 %0) {
%2 = tail call i32 @lspcon_i2c_spi_write_register(i32 %0, i32 218, i32 170)
%3 = tail call i32 @lspcon_i2c_spi_write_register(i32 %0, i32 218, i32 85)
%4 = or i32 %3, %2
%5 = tail call i32 @lspcon_i2c_spi_write_register(i32 %0, i32 218, i32 80)
%6 = or i32 %4, %5
%7 = tail call i32 @lspcon_i2c_spi_write_register(i32 %0, i32 218, i32 65)
%8 = or i32 %6, %7
%9 = tail call i32 @lspcon_i2c_spi_write_register(i32 %0, i32 218, i32 82)
%10 = or i32 %8, %9
%11 = tail call i32 @lspcon_i2c_spi_write_register(i32 %0, i32 218, i32 68)
%12 = or i32 %10, %11
ret i32 %12
}