#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*/ outb(int, int);
int /*<<< orphan*/ set_pic0_mask(int);
int /*<<< orphan*/ set_pic1_mask(int);
void intr_init(void) {
  set_pic0_mask(0xFF);
  set_pic1_mask(0xFF);
  outb(0x0020, 0x11);
  outb(0x0021, 0x20);
  outb(0x0021, 1 << 2);
  outb(0x0021, 0x01);
  outb(0x00A0, 0x11);
  outb(0x00A1, 0x28);
  outb(0x00A1, 2);
  outb(0x00A1, 0x01);
  set_pic0_mask(0xFB);
  set_pic1_mask(0xFF);
}


x86 assembly (clang, -O0):
<intr_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%edi
call   1030 <set_pic0_mask@plt>
mov    $0xff,%edi
call   1050 <set_pic1_mask@plt>
mov    $0x20,%edi
mov    $0x11,%esi
call   1040 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1040 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1040 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1040 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1040 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1040 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1040 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1040 <outb@plt>
mov    $0xfb,%edi
call   1030 <set_pic0_mask@plt>
mov    $0xff,%edi
call   1050 <set_pic1_mask@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_init>:
push   %rax
mov    $0xff,%edi
call   1030 <set_pic0_mask@plt>
mov    $0xff,%edi
call   1050 <set_pic1_mask@plt>
mov    $0x20,%edi
mov    $0x11,%esi
call   1040 <outb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1040 <outb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1040 <outb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1040 <outb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1040 <outb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1040 <outb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1040 <outb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1040 <outb@plt>
mov    $0xfb,%edi
call   1030 <set_pic0_mask@plt>
mov    $0xff,%edi
pop    %rax
jmp    1050 <set_pic1_mask@plt>

LLVM IR (-O0):
define void @intr_init() {
%1 = call i32 @set_pic0_mask(i32 255)
%2 = call i32 @set_pic1_mask(i32 255)
%3 = call i32 @outb(i32 32, i32 17)
%4 = call i32 @outb(i32 33, i32 32)
%5 = call i32 @outb(i32 33, i32 4)
%6 = call i32 @outb(i32 33, i32 1)
%7 = call i32 @outb(i32 160, i32 17)
%8 = call i32 @outb(i32 161, i32 40)
%9 = call i32 @outb(i32 161, i32 2)
%10 = call i32 @outb(i32 161, i32 1)
%11 = call i32 @set_pic0_mask(i32 251)
%12 = call i32 @set_pic1_mask(i32 255)
ret void
}

LLVM IR (-O2):
define void @intr_init() {
%1 = tail call i32 @set_pic0_mask(i32 255)
%2 = tail call i32 @set_pic1_mask(i32 255)
%3 = tail call i32 @outb(i32 32, i32 17)
%4 = tail call i32 @outb(i32 33, i32 32)
%5 = tail call i32 @outb(i32 33, i32 4)
%6 = tail call i32 @outb(i32 33, i32 1)
%7 = tail call i32 @outb(i32 160, i32 17)
%8 = tail call i32 @outb(i32 161, i32 40)
%9 = tail call i32 @outb(i32 161, i32 2)
%10 = tail call i32 @outb(i32 161, i32 1)
%11 = tail call i32 @set_pic0_mask(i32 251)
%12 = tail call i32 @set_pic1_mask(i32 255)
ret void
}