#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*/ udelay(int);
void pic_init() {
  outb(0x20, 0x11);
  udelay(1);
  outb(0xA0, 0x11);
  udelay(1);
  outb(0x21, 32);
  udelay(1);
  outb(0xA1, 32 + 8);
  udelay(1);
  outb(0x21, (1 << 0x02));
  udelay(1);
  outb(0xA1, 0x02);
  udelay(1);
  outb(0x21, 0x1);
  udelay(1);
  outb(0xA1, 0x1);
  udelay(1);
  outb(0x21, 0xFF ^ (1 << 0x02));
  udelay(1);
  outb(0xA1, 0xFF);
  udelay(1);
}


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

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

LLVM IR (-O0):
define void @pic_init() {
%1 = call i32 @outb(i32 32, i32 17)
%2 = call i32 @udelay(i32 1)
%3 = call i32 @outb(i32 160, i32 17)
%4 = call i32 @udelay(i32 1)
%5 = call i32 @outb(i32 33, i32 32)
%6 = call i32 @udelay(i32 1)
%7 = call i32 @outb(i32 161, i32 40)
%8 = call i32 @udelay(i32 1)
%9 = call i32 @outb(i32 33, i32 4)
%10 = call i32 @udelay(i32 1)
%11 = call i32 @outb(i32 161, i32 2)
%12 = call i32 @udelay(i32 1)
%13 = call i32 @outb(i32 33, i32 1)
%14 = call i32 @udelay(i32 1)
%15 = call i32 @outb(i32 161, i32 1)
%16 = call i32 @udelay(i32 1)
%17 = call i32 @outb(i32 33, i32 251)
%18 = call i32 @udelay(i32 1)
%19 = call i32 @outb(i32 161, i32 255)
%20 = call i32 @udelay(i32 1)
ret void
}

LLVM IR (-O2):
define void @pic_init() {
%1 = tail call i32 @outb(i32 32, i32 17)
%2 = tail call i32 @udelay(i32 1)
%3 = tail call i32 @outb(i32 160, i32 17)
%4 = tail call i32 @udelay(i32 1)
%5 = tail call i32 @outb(i32 33, i32 32)
%6 = tail call i32 @udelay(i32 1)
%7 = tail call i32 @outb(i32 161, i32 40)
%8 = tail call i32 @udelay(i32 1)
%9 = tail call i32 @outb(i32 33, i32 4)
%10 = tail call i32 @udelay(i32 1)
%11 = tail call i32 @outb(i32 161, i32 2)
%12 = tail call i32 @udelay(i32 1)
%13 = tail call i32 @outb(i32 33, i32 1)
%14 = tail call i32 @udelay(i32 1)
%15 = tail call i32 @outb(i32 161, i32 1)
%16 = tail call i32 @udelay(i32 1)
%17 = tail call i32 @outb(i32 33, i32 251)
%18 = tail call i32 @udelay(i32 1)
%19 = tail call i32 @outb(i32 161, i32 255)
%20 = tail call i32 @udelay(i32 1)
ret void
}