#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*/ inb(int);
int /*<<< orphan*/ outb(int, int);
int /*<<< orphan*/ print_debug(char *);
int /*<<< orphan*/ print_debug_hex8(int /*<<< orphan*/);
int /*<<< orphan*/ smbus_wait_until_ready();
void smbus_reset(void) {
  outb(0xff, 0xf00 + 0x0);
  outb(0xff, 0xf00 + 0x0);
  outb(0xff, 0xf00 + 0x0);
  outb(0xff, 0xf00 + 0x0);
  smbus_wait_until_ready();
  print_debug("After reset status ");
  print_debug_hex8(inb(0xf00 + 0x0));
  print_debug("\n");
}


x86 assembly (clang, -O0):
<smbus_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%edi
mov    $0xf00,%esi
call   1040 <outb@plt>
mov    $0xff,%edi
mov    $0xf00,%esi
call   1040 <outb@plt>
mov    $0xff,%edi
mov    $0xf00,%esi
call   1040 <outb@plt>
mov    $0xff,%edi
mov    $0xf00,%esi
call   1040 <outb@plt>
mov    $0x0,%al
call   1060 <smbus_wait_until_ready@plt>
lea    0xe62(%rip),%rdi
call   1070 <print_debug@plt>
mov    $0xf00,%edi
call   1050 <inb@plt>
mov    %eax,%edi
call   1030 <print_debug_hex8@plt>
lea    0xe59(%rip),%rdi
call   1070 <print_debug@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_reset>:
push   %rax
mov    $0xff,%edi
mov    $0xf00,%esi
call   1040 <outb@plt>
mov    $0xff,%edi
mov    $0xf00,%esi
call   1040 <outb@plt>
mov    $0xff,%edi
mov    $0xf00,%esi
call   1040 <outb@plt>
mov    $0xff,%edi
mov    $0xf00,%esi
call   1040 <outb@plt>
xor    %eax,%eax
call   1060 <smbus_wait_until_ready@plt>
lea    0xe65(%rip),%rdi
call   1070 <print_debug@plt>
mov    $0xf00,%edi
call   1050 <inb@plt>
mov    %eax,%edi
call   1030 <print_debug_hex8@plt>
lea    0xe5c(%rip),%rdi
pop    %rax
jmp    1070 <print_debug@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"After reset status \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @smbus_reset() {
%1 = call i32 @outb(i32 255, i32 3840)
%2 = call i32 @outb(i32 255, i32 3840)
%3 = call i32 @outb(i32 255, i32 3840)
%4 = call i32 @outb(i32 255, i32 3840)
%5 = call i32 (...) @smbus_wait_until_ready()
%6 = call i32 @print_debug(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @inb(i32 3840)
%8 = call i32 @print_debug_hex8(i32 %7)
%9 = call i32 @print_debug(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"After reset status \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @smbus_reset() {
%1 = tail call i32 @outb(i32 255, i32 3840)
%2 = tail call i32 @outb(i32 255, i32 3840)
%3 = tail call i32 @outb(i32 255, i32 3840)
%4 = tail call i32 @outb(i32 255, i32 3840)
%5 = tail call i32 (...) @smbus_wait_until_ready()
%6 = tail call i32 @print_debug(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @inb(i32 3840)
%8 = tail call i32 @print_debug_hex8(i32 %7)
%9 = tail call i32 @print_debug(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}