#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 realtek_mst_i2c_spi_write_register(int, int, int);
int realtek_mst_i2c_spi_enter_isp_mode(int fd) {
  int ret = realtek_mst_i2c_spi_write_register(fd, 0x6F, 0x80);
  ret |= realtek_mst_i2c_spi_write_register(fd, 0xF4, 0x9F);
  ret |= realtek_mst_i2c_spi_write_register(fd, 0xF5, 0x06);
  ret |= realtek_mst_i2c_spi_write_register(fd, 0xF4, 0xA0);
  ret |= realtek_mst_i2c_spi_write_register(fd, 0xF5, 0x74);
  return ret;
}


x86 assembly (clang, -O0):
<realtek_mst_i2c_spi_enter_isp_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x6f,%esi
mov    $0x80,%edx
call   1030 <realtek_mst_i2c_spi_write_register@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xf4,%esi
mov    $0x9f,%edx
call   1030 <realtek_mst_i2c_spi_write_register@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xf5,%esi
mov    $0x6,%edx
call   1030 <realtek_mst_i2c_spi_write_register@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xf4,%esi
mov    $0xa0,%edx
call   1030 <realtek_mst_i2c_spi_write_register@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xf5,%esi
mov    $0x74,%edx
call   1030 <realtek_mst_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):
<realtek_mst_i2c_spi_enter_isp_mode>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x6f,%esi
mov    $0x80,%edx
call   1030 <realtek_mst_i2c_spi_write_register@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0xf4,%esi
mov    $0x9f,%edx
call   1030 <realtek_mst_i2c_spi_write_register@plt>
mov    %eax,%r15d
or     %r14d,%r15d
mov    %ebx,%edi
mov    $0xf5,%esi
mov    $0x6,%edx
call   1030 <realtek_mst_i2c_spi_write_register@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0xf4,%esi
mov    $0xa0,%edx
call   1030 <realtek_mst_i2c_spi_write_register@plt>
mov    %eax,%ebp
or     %r14d,%ebp
or     %r15d,%ebp
mov    %ebx,%edi
mov    $0xf5,%esi
mov    $0x74,%edx
call   1030 <realtek_mst_i2c_spi_write_register@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @realtek_mst_i2c_spi_enter_isp_mode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @realtek_mst_i2c_spi_write_register(i32 %4, i32 111, i32 128)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @realtek_mst_i2c_spi_write_register(i32 %6, i32 244, i32 159)
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = call i32 @realtek_mst_i2c_spi_write_register(i32 %10, i32 245, i32 6)
%12 = load i32, i32* %3
%13 = or i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = call i32 @realtek_mst_i2c_spi_write_register(i32 %14, i32 244, i32 160)
%16 = load i32, i32* %3
%17 = or i32 %16, %15
store i32 %17, i32* %3
%18 = load i32, i32* %2
%19 = call i32 @realtek_mst_i2c_spi_write_register(i32 %18, i32 245, i32 116)
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @realtek_mst_i2c_spi_enter_isp_mode(i32 %0) {
%2 = tail call i32 @realtek_mst_i2c_spi_write_register(i32 %0, i32 111, i32 128)
%3 = tail call i32 @realtek_mst_i2c_spi_write_register(i32 %0, i32 244, i32 159)
%4 = or i32 %3, %2
%5 = tail call i32 @realtek_mst_i2c_spi_write_register(i32 %0, i32 245, i32 6)
%6 = or i32 %4, %5
%7 = tail call i32 @realtek_mst_i2c_spi_write_register(i32 %0, i32 244, i32 160)
%8 = or i32 %6, %7
%9 = tail call i32 @realtek_mst_i2c_spi_write_register(i32 %0, i32 245, i32 116)
%10 = or i32 %8, %9
ret i32 %10
}