#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*/ irq_clear_mask(int);
int /*<<< orphan*/ outportb(int, int);
void init_pic() {
  outportb(0x20, 0x11);
  outportb(0xA0, 0x11);
  outportb(0x21, 0x20);
  outportb(0xA1, 0x28);
  outportb(0x21, 0x4);
  outportb(0xA1, 0x2);
  outportb(0x21, 0x1);
  outportb(0xA1, 0x1);
  outportb(0x21, 0x0);
  outportb(0xA1, 0x0);
  irq_clear_mask(0);
  irq_clear_mask(1);
}


x86 assembly (clang, -O0):
<init_pic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1040 <outportb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1040 <outportb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1040 <outportb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1040 <outportb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1040 <outportb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1040 <outportb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1040 <outportb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1040 <outportb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1040 <outportb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1040 <outportb@plt>
xor    %edi,%edi
call   1030 <irq_clear_mask@plt>
mov    $0x1,%edi
call   1030 <irq_clear_mask@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_pic>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1040 <outportb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1040 <outportb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1040 <outportb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1040 <outportb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1040 <outportb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1040 <outportb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1040 <outportb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1040 <outportb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1040 <outportb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1040 <outportb@plt>
xor    %edi,%edi
call   1030 <irq_clear_mask@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <irq_clear_mask@plt>

LLVM IR (-O0):
define void @init_pic() {
%1 = call i32 @outportb(i32 32, i32 17)
%2 = call i32 @outportb(i32 160, i32 17)
%3 = call i32 @outportb(i32 33, i32 32)
%4 = call i32 @outportb(i32 161, i32 40)
%5 = call i32 @outportb(i32 33, i32 4)
%6 = call i32 @outportb(i32 161, i32 2)
%7 = call i32 @outportb(i32 33, i32 1)
%8 = call i32 @outportb(i32 161, i32 1)
%9 = call i32 @outportb(i32 33, i32 0)
%10 = call i32 @outportb(i32 161, i32 0)
%11 = call i32 @irq_clear_mask(i32 0)
%12 = call i32 @irq_clear_mask(i32 1)
ret void
}

LLVM IR (-O2):
define void @init_pic() {
%1 = tail call i32 @outportb(i32 32, i32 17)
%2 = tail call i32 @outportb(i32 160, i32 17)
%3 = tail call i32 @outportb(i32 33, i32 32)
%4 = tail call i32 @outportb(i32 161, i32 40)
%5 = tail call i32 @outportb(i32 33, i32 4)
%6 = tail call i32 @outportb(i32 161, i32 2)
%7 = tail call i32 @outportb(i32 33, i32 1)
%8 = tail call i32 @outportb(i32 161, i32 1)
%9 = tail call i32 @outportb(i32 33, i32 0)
%10 = tail call i32 @outportb(i32 161, i32 0)
%11 = tail call i32 @irq_clear_mask(i32 0)
%12 = tail call i32 @irq_clear_mask(i32 1)
ret void
}