#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*/ delay();
int /*<<< orphan*/ hal_early_print_printf(char *);
int /*<<< orphan*/ hal_io_out_8(int, int);
void disbale_8259A() {
  hal_early_print_printf("Disabling 8259A...\n");
  hal_io_out_8(0x20, 0x11);
  delay();
  hal_io_out_8(0xA0, 0x11);
  delay();
  hal_io_out_8(0x21, 0x20);
  delay();
  hal_io_out_8(0xA1, 0x28);
  delay();
  hal_io_out_8(0x21, 0x04);
  delay();
  hal_io_out_8(0xA1, 0x02);
  delay();
  hal_io_out_8(0x21, 0x01);
  delay();
  hal_io_out_8(0xA1, 0x01);
  delay();
  hal_io_out_8(0x21, 0xFF);
  delay();
  hal_io_out_8(0xA1, 0xFF);
  delay();
  return;
}


x86 assembly (clang, -O0):
<disbale_8259A>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <hal_early_print_printf@plt>
mov    $0x20,%edi
mov    $0x11,%esi
call   1050 <hal_io_out_8@plt>
mov    $0x0,%al
call   1030 <delay@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1050 <hal_io_out_8@plt>
mov    $0x0,%al
call   1030 <delay@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1050 <hal_io_out_8@plt>
mov    $0x0,%al
call   1030 <delay@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1050 <hal_io_out_8@plt>
mov    $0x0,%al
call   1030 <delay@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1050 <hal_io_out_8@plt>
mov    $0x0,%al
call   1030 <delay@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1050 <hal_io_out_8@plt>
mov    $0x0,%al
call   1030 <delay@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1050 <hal_io_out_8@plt>
mov    $0x0,%al
call   1030 <delay@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1050 <hal_io_out_8@plt>
mov    $0x0,%al
call   1030 <delay@plt>
mov    $0x21,%edi
mov    $0xff,%esi
call   1050 <hal_io_out_8@plt>
mov    $0x0,%al
call   1030 <delay@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1050 <hal_io_out_8@plt>
mov    $0x0,%al
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disbale_8259A>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <hal_early_print_printf@plt>
mov    $0x20,%edi
mov    $0x11,%esi
call   1050 <hal_io_out_8@plt>
xor    %eax,%eax
call   1030 <delay@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1050 <hal_io_out_8@plt>
xor    %eax,%eax
call   1030 <delay@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1050 <hal_io_out_8@plt>
xor    %eax,%eax
call   1030 <delay@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1050 <hal_io_out_8@plt>
xor    %eax,%eax
call   1030 <delay@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1050 <hal_io_out_8@plt>
xor    %eax,%eax
call   1030 <delay@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1050 <hal_io_out_8@plt>
xor    %eax,%eax
call   1030 <delay@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1050 <hal_io_out_8@plt>
xor    %eax,%eax
call   1030 <delay@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1050 <hal_io_out_8@plt>
xor    %eax,%eax
call   1030 <delay@plt>
mov    $0x21,%edi
mov    $0xff,%esi
call   1050 <hal_io_out_8@plt>
xor    %eax,%eax
call   1030 <delay@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1050 <hal_io_out_8@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <delay@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Disabling 8259A...\0A\00"
define void @disbale_8259A() {
%1 = call i32 @hal_early_print_printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @hal_io_out_8(i32 32, i32 17)
%3 = call i32 (...) @delay()
%4 = call i32 @hal_io_out_8(i32 160, i32 17)
%5 = call i32 (...) @delay()
%6 = call i32 @hal_io_out_8(i32 33, i32 32)
%7 = call i32 (...) @delay()
%8 = call i32 @hal_io_out_8(i32 161, i32 40)
%9 = call i32 (...) @delay()
%10 = call i32 @hal_io_out_8(i32 33, i32 4)
%11 = call i32 (...) @delay()
%12 = call i32 @hal_io_out_8(i32 161, i32 2)
%13 = call i32 (...) @delay()
%14 = call i32 @hal_io_out_8(i32 33, i32 1)
%15 = call i32 (...) @delay()
%16 = call i32 @hal_io_out_8(i32 161, i32 1)
%17 = call i32 (...) @delay()
%18 = call i32 @hal_io_out_8(i32 33, i32 255)
%19 = call i32 (...) @delay()
%20 = call i32 @hal_io_out_8(i32 161, i32 255)
%21 = call i32 (...) @delay()
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Disabling 8259A...\0A\00"
define void @disbale_8259A() {
%1 = tail call i32 @hal_early_print_printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @hal_io_out_8(i32 32, i32 17)
%3 = tail call i32 (...) @delay()
%4 = tail call i32 @hal_io_out_8(i32 160, i32 17)
%5 = tail call i32 (...) @delay()
%6 = tail call i32 @hal_io_out_8(i32 33, i32 32)
%7 = tail call i32 (...) @delay()
%8 = tail call i32 @hal_io_out_8(i32 161, i32 40)
%9 = tail call i32 (...) @delay()
%10 = tail call i32 @hal_io_out_8(i32 33, i32 4)
%11 = tail call i32 (...) @delay()
%12 = tail call i32 @hal_io_out_8(i32 161, i32 2)
%13 = tail call i32 (...) @delay()
%14 = tail call i32 @hal_io_out_8(i32 33, i32 1)
%15 = tail call i32 (...) @delay()
%16 = tail call i32 @hal_io_out_8(i32 161, i32 1)
%17 = tail call i32 (...) @delay()
%18 = tail call i32 @hal_io_out_8(i32 33, i32 255)
%19 = tail call i32 (...) @delay()
%20 = tail call i32 @hal_io_out_8(i32 161, i32 255)
%21 = tail call i32 (...) @delay()
ret void
}