#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 */
unsigned int inb(int);
int /*<<< orphan*/ outb(unsigned char, int);
short smbus_read_byte(unsigned int, int);
void test(void) {
  short byte;
  unsigned device;
  unsigned char i, j, k, l, m, n, o;
  i = 1;
  j = 2;
  k = 3;
  l = 4;
  m = 5;
  n = 6;
  o = 7;
  device = inb(0x50);
  byte = smbus_read_byte(device, 3);
  outb(i, 0xab);
  outb(j, 0xab);
  outb(k, 0xab);
  outb(l, 0x1234);
  outb(m, 0xab);
  outb(n, 0xab);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x1,-0x9(%rbp)
movb   $0x2,-0xa(%rbp)
movb   $0x3,-0xb(%rbp)
movb   $0x4,-0xc(%rbp)
movb   $0x5,-0xd(%rbp)
movb   $0x6,-0xe(%rbp)
movb   $0x7,-0xf(%rbp)
mov    $0x50,%edi
call   1040 <inb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
call   1050 <smbus_read_byte@plt>
mov    %ax,-0x2(%rbp)
mov    $0xab,%esi
movzbl -0x9(%rbp),%edi
call   1030 <outb@plt>
mov    $0xab,%esi
movzbl -0xa(%rbp),%edi
call   1030 <outb@plt>
mov    $0xab,%esi
movzbl -0xb(%rbp),%edi
call   1030 <outb@plt>
mov    $0x1234,%esi
movzbl -0xc(%rbp),%edi
call   1030 <outb@plt>
mov    $0xab,%esi
movzbl -0xd(%rbp),%edi
call   1030 <outb@plt>
mov    $0xab,%esi
movzbl -0xe(%rbp),%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x50,%edi
call   1040 <inb@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1050 <smbus_read_byte@plt>
mov    $0x1,%edi
mov    $0xab,%esi
call   1030 <outb@plt>
mov    $0x2,%edi
mov    $0xab,%esi
call   1030 <outb@plt>
mov    $0x3,%edi
mov    $0xab,%esi
call   1030 <outb@plt>
mov    $0x4,%edi
mov    $0x1234,%esi
call   1030 <outb@plt>
mov    $0x5,%edi
mov    $0xab,%esi
call   1030 <outb@plt>
mov    $0x6,%edi
mov    $0xab,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @test() {
%1 = alloca i16
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8 1, i8* %3
store i8 2, i8* %4
store i8 3, i8* %5
store i8 4, i8* %6
store i8 5, i8* %7
store i8 6, i8* %8
store i8 7, i8* %9
%10 = call i32 @inb(i32 80)
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call signext i16 @smbus_read_byte(i32 %11, i32 3)
store i16 %12, i16* %1
%13 = load i8, i8* %3
%14 = call i32 @outb(i8 zeroext %13, i32 171)
%15 = load i8, i8* %4
%16 = call i32 @outb(i8 zeroext %15, i32 171)
%17 = load i8, i8* %5
%18 = call i32 @outb(i8 zeroext %17, i32 171)
%19 = load i8, i8* %6
%20 = call i32 @outb(i8 zeroext %19, i32 4660)
%21 = load i8, i8* %7
%22 = call i32 @outb(i8 zeroext %21, i32 171)
%23 = load i8, i8* %8
%24 = call i32 @outb(i8 zeroext %23, i32 171)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @inb(i32 80)
%2 = tail call signext i16 @smbus_read_byte(i32 %1, i32 3)
%3 = tail call i32 @outb(i8 zeroext 1, i32 171)
%4 = tail call i32 @outb(i8 zeroext 2, i32 171)
%5 = tail call i32 @outb(i8 zeroext 3, i32 171)
%6 = tail call i32 @outb(i8 zeroext 4, i32 4660)
%7 = tail call i32 @outb(i8 zeroext 5, i32 171)
%8 = tail call i32 @outb(i8 zeroext 6, i32 171)
ret void
}