#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*/ create_gate(int, void (*)());
int /*<<< orphan*/ disable_interrupts();
int /*<<< orphan*/ enable_interrupts();
int /*<<< orphan*/ outb(int, int /*<<< orphan*/);
void init_interrupts() {
  disable_interrupts();
  outb(0x21, 0);
  outb(0xa1, 0);
  extern void irq0();
  create_gate(32, irq0);
  ;
  extern void irq1();
  create_gate(33, irq1);
  ;
  extern void irq2();
  create_gate(34, irq2);
  ;
  extern void irq3();
  create_gate(35, irq3);
  ;
  extern void irq4();
  create_gate(36, irq4);
  ;
  extern void irq5();
  create_gate(37, irq5);
  ;
  extern void irq6();
  create_gate(38, irq6);
  ;
  extern void irq7();
  create_gate(39, irq7);
  ;
  extern void irq8();
  create_gate(40, irq8);
  ;
  extern void irq9();
  create_gate(41, irq9);
  ;
  extern void irq10();
  create_gate(42, irq10);
  ;
  extern void irq11();
  create_gate(43, irq11);
  ;
  extern void irq12();
  create_gate(44, irq12);
  ;
  extern void irq13();
  create_gate(45, irq13);
  ;
  extern void irq14();
  create_gate(46, irq14);
  ;
  extern void irq15();
  create_gate(47, irq15);
  ;
  extern void isr0();
  create_gate(0, isr0);
  ;
  extern void isr1();
  create_gate(1, isr1);
  ;
  extern void isr2();
  create_gate(2, isr2);
  ;
  extern void isr3();
  create_gate(3, isr3);
  ;
  extern void isr4();
  create_gate(4, isr4);
  ;
  extern void isr5();
  create_gate(5, isr5);
  ;
  extern void isr6();
  create_gate(6, isr6);
  ;
  extern void isr7();
  create_gate(7, isr7);
  ;
  extern void isr8();
  create_gate(8, isr8);
  ;
  extern void isr9();
  create_gate(9, isr9);
  ;
  extern void isr10();
  create_gate(10, isr10);
  ;
  extern void isr11();
  create_gate(11, isr11);
  ;
  extern void isr12();
  create_gate(12, isr12);
  ;
  extern void isr13();
  create_gate(13, isr13);
  ;
  extern void isr14();
  create_gate(14, isr14);
  ;
  extern void isr15();
  create_gate(15, isr15);
  ;
  extern void isr16();
  create_gate(16, isr16);
  ;
  extern void isr17();
  create_gate(17, isr17);
  ;
  extern void isr18();
  create_gate(18, isr18);
  ;
  extern void isr19();
  create_gate(19, isr19);
  ;
  enable_interrupts();
}


x86 assembly (clang, -O0):
<init_interrupts>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <disable_interrupts@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1040 <outb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1040 <outb@plt>
mov    $0x20,%edi
mov    0x2da1(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x21,%edi
mov    0x2e28(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x22,%edi
mov    0x2d5f(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x23,%edi
mov    0x2de6(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x24,%edi
mov    0x2d35(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x25,%edi
mov    0x2dbc(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x26,%edi
mov    0x2d03(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x27,%edi
mov    0x2d8a(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x28,%edi
mov    0x2ce9(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x29,%edi
mov    0x2d70(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x2a,%edi
mov    0x2da7(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x2b,%edi
mov    0x2cfe(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x2c,%edi
mov    0x2d7d(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x2d,%edi
mov    0x2cd4(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x2e,%edi
mov    0x2d53(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x2f,%edi
mov    0x2caa(%rip),%rsi
call   1030 <create_gate@plt>
xor    %edi,%edi
mov    0x2cbc(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x1,%edi
mov    0x2d3b(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x2,%edi
mov    0x2c92(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x3,%edi
mov    0x2d21(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x4,%edi
mov    0x2c80(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x5,%edi
mov    0x2d0f(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x6,%edi
mov    0x2c66(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x7,%edi
mov    0x2cfd(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x8,%edi
mov    0x2c4c(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x9,%edi
mov    0x2cd3(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0xa,%edi
mov    0x2c6a(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0xb,%edi
mov    0x2bc9(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0xc,%edi
mov    0x2c50(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0xd,%edi
mov    0x2b9f(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0xe,%edi
mov    0x2c36(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0xf,%edi
mov    0x2b45(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x10,%edi
mov    0x2bd4(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x11,%edi
mov    0x2b2b(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x12,%edi
mov    0x2bba(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x13,%edi
mov    0x2b11(%rip),%rsi
call   1030 <create_gate@plt>
mov    $0x0,%al
call   1060 <enable_interrupts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_interrupts>:
push   %rax
xor    %eax,%eax
call   1050 <disable_interrupts@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1040 <outb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1040 <outb@plt>
mov    0x2da9(%rip),%rsi
mov    $0x20,%edi
call   1030 <create_gate@plt>
mov    0x2e30(%rip),%rsi
mov    $0x21,%edi
call   1030 <create_gate@plt>
mov    0x2d67(%rip),%rsi
mov    $0x22,%edi
call   1030 <create_gate@plt>
mov    0x2dee(%rip),%rsi
mov    $0x23,%edi
call   1030 <create_gate@plt>
mov    0x2d3d(%rip),%rsi
mov    $0x24,%edi
call   1030 <create_gate@plt>
mov    0x2dc4(%rip),%rsi
mov    $0x25,%edi
call   1030 <create_gate@plt>
mov    0x2d0b(%rip),%rsi
mov    $0x26,%edi
call   1030 <create_gate@plt>
mov    0x2d92(%rip),%rsi
mov    $0x27,%edi
call   1030 <create_gate@plt>
mov    0x2cf1(%rip),%rsi
mov    $0x28,%edi
call   1030 <create_gate@plt>
mov    0x2d78(%rip),%rsi
mov    $0x29,%edi
call   1030 <create_gate@plt>
mov    0x2daf(%rip),%rsi
mov    $0x2a,%edi
call   1030 <create_gate@plt>
mov    0x2d06(%rip),%rsi
mov    $0x2b,%edi
call   1030 <create_gate@plt>
mov    0x2d85(%rip),%rsi
mov    $0x2c,%edi
call   1030 <create_gate@plt>
mov    0x2cdc(%rip),%rsi
mov    $0x2d,%edi
call   1030 <create_gate@plt>
mov    0x2d5b(%rip),%rsi
mov    $0x2e,%edi
call   1030 <create_gate@plt>
mov    0x2cb2(%rip),%rsi
mov    $0x2f,%edi
call   1030 <create_gate@plt>
mov    0x2cc1(%rip),%rsi
xor    %edi,%edi
call   1030 <create_gate@plt>
mov    0x2d43(%rip),%rsi
mov    $0x1,%edi
call   1030 <create_gate@plt>
mov    0x2c9a(%rip),%rsi
mov    $0x2,%edi
call   1030 <create_gate@plt>
mov    0x2d29(%rip),%rsi
mov    $0x3,%edi
call   1030 <create_gate@plt>
mov    0x2c88(%rip),%rsi
mov    $0x4,%edi
call   1030 <create_gate@plt>
mov    0x2d17(%rip),%rsi
mov    $0x5,%edi
call   1030 <create_gate@plt>
mov    0x2c6e(%rip),%rsi
mov    $0x6,%edi
call   1030 <create_gate@plt>
mov    0x2d05(%rip),%rsi
mov    $0x7,%edi
call   1030 <create_gate@plt>
mov    0x2c54(%rip),%rsi
mov    $0x8,%edi
call   1030 <create_gate@plt>
mov    0x2cdb(%rip),%rsi
mov    $0x9,%edi
call   1030 <create_gate@plt>
mov    0x2c72(%rip),%rsi
mov    $0xa,%edi
call   1030 <create_gate@plt>
mov    0x2bd1(%rip),%rsi
mov    $0xb,%edi
call   1030 <create_gate@plt>
mov    0x2c58(%rip),%rsi
mov    $0xc,%edi
call   1030 <create_gate@plt>
mov    0x2ba7(%rip),%rsi
mov    $0xd,%edi
call   1030 <create_gate@plt>
mov    0x2c3e(%rip),%rsi
mov    $0xe,%edi
call   1030 <create_gate@plt>
mov    0x2b4d(%rip),%rsi
mov    $0xf,%edi
call   1030 <create_gate@plt>
mov    0x2bdc(%rip),%rsi
mov    $0x10,%edi
call   1030 <create_gate@plt>
mov    0x2b33(%rip),%rsi
mov    $0x11,%edi
call   1030 <create_gate@plt>
mov    0x2bc2(%rip),%rsi
mov    $0x12,%edi
call   1030 <create_gate@plt>
mov    0x2b19(%rip),%rsi
mov    $0x13,%edi
call   1030 <create_gate@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <enable_interrupts@plt>

LLVM IR (-O0):
define void @init_interrupts() {
%1 = call i32 (...) @disable_interrupts()
%2 = call i32 @outb(i32 33, i32 0)
%3 = call i32 @outb(i32 161, i32 0)
%4 = call i32 @create_gate(i32 32, void (...)* @irq0)
%5 = call i32 @create_gate(i32 33, void (...)* @irq1)
%6 = call i32 @create_gate(i32 34, void (...)* @irq2)
%7 = call i32 @create_gate(i32 35, void (...)* @irq3)
%8 = call i32 @create_gate(i32 36, void (...)* @irq4)
%9 = call i32 @create_gate(i32 37, void (...)* @irq5)
%10 = call i32 @create_gate(i32 38, void (...)* @irq6)
%11 = call i32 @create_gate(i32 39, void (...)* @irq7)
%12 = call i32 @create_gate(i32 40, void (...)* @irq8)
%13 = call i32 @create_gate(i32 41, void (...)* @irq9)
%14 = call i32 @create_gate(i32 42, void (...)* @irq10)
%15 = call i32 @create_gate(i32 43, void (...)* @irq11)
%16 = call i32 @create_gate(i32 44, void (...)* @irq12)
%17 = call i32 @create_gate(i32 45, void (...)* @irq13)
%18 = call i32 @create_gate(i32 46, void (...)* @irq14)
%19 = call i32 @create_gate(i32 47, void (...)* @irq15)
%20 = call i32 @create_gate(i32 0, void (...)* @isr0)
%21 = call i32 @create_gate(i32 1, void (...)* @isr1)
%22 = call i32 @create_gate(i32 2, void (...)* @isr2)
%23 = call i32 @create_gate(i32 3, void (...)* @isr3)
%24 = call i32 @create_gate(i32 4, void (...)* @isr4)
%25 = call i32 @create_gate(i32 5, void (...)* @isr5)
%26 = call i32 @create_gate(i32 6, void (...)* @isr6)
%27 = call i32 @create_gate(i32 7, void (...)* @isr7)
%28 = call i32 @create_gate(i32 8, void (...)* @isr8)
%29 = call i32 @create_gate(i32 9, void (...)* @isr9)
%30 = call i32 @create_gate(i32 10, void (...)* @isr10)
%31 = call i32 @create_gate(i32 11, void (...)* @isr11)
%32 = call i32 @create_gate(i32 12, void (...)* @isr12)
%33 = call i32 @create_gate(i32 13, void (...)* @isr13)
%34 = call i32 @create_gate(i32 14, void (...)* @isr14)
%35 = call i32 @create_gate(i32 15, void (...)* @isr15)
%36 = call i32 @create_gate(i32 16, void (...)* @isr16)
%37 = call i32 @create_gate(i32 17, void (...)* @isr17)
%38 = call i32 @create_gate(i32 18, void (...)* @isr18)
%39 = call i32 @create_gate(i32 19, void (...)* @isr19)
%40 = call i32 (...) @enable_interrupts()
ret void
}

LLVM IR (-O2):
define void @init_interrupts() {
%1 = tail call i32 (...) @disable_interrupts()
%2 = tail call i32 @outb(i32 33, i32 0)
%3 = tail call i32 @outb(i32 161, i32 0)
%4 = tail call i32 @create_gate(i32 32, void (...)* @irq0)
%5 = tail call i32 @create_gate(i32 33, void (...)* @irq1)
%6 = tail call i32 @create_gate(i32 34, void (...)* @irq2)
%7 = tail call i32 @create_gate(i32 35, void (...)* @irq3)
%8 = tail call i32 @create_gate(i32 36, void (...)* @irq4)
%9 = tail call i32 @create_gate(i32 37, void (...)* @irq5)
%10 = tail call i32 @create_gate(i32 38, void (...)* @irq6)
%11 = tail call i32 @create_gate(i32 39, void (...)* @irq7)
%12 = tail call i32 @create_gate(i32 40, void (...)* @irq8)
%13 = tail call i32 @create_gate(i32 41, void (...)* @irq9)
%14 = tail call i32 @create_gate(i32 42, void (...)* @irq10)
%15 = tail call i32 @create_gate(i32 43, void (...)* @irq11)
%16 = tail call i32 @create_gate(i32 44, void (...)* @irq12)
%17 = tail call i32 @create_gate(i32 45, void (...)* @irq13)
%18 = tail call i32 @create_gate(i32 46, void (...)* @irq14)
%19 = tail call i32 @create_gate(i32 47, void (...)* @irq15)
%20 = tail call i32 @create_gate(i32 0, void (...)* @isr0)
%21 = tail call i32 @create_gate(i32 1, void (...)* @isr1)
%22 = tail call i32 @create_gate(i32 2, void (...)* @isr2)
%23 = tail call i32 @create_gate(i32 3, void (...)* @isr3)
%24 = tail call i32 @create_gate(i32 4, void (...)* @isr4)
%25 = tail call i32 @create_gate(i32 5, void (...)* @isr5)
%26 = tail call i32 @create_gate(i32 6, void (...)* @isr6)
%27 = tail call i32 @create_gate(i32 7, void (...)* @isr7)
%28 = tail call i32 @create_gate(i32 8, void (...)* @isr8)
%29 = tail call i32 @create_gate(i32 9, void (...)* @isr9)
%30 = tail call i32 @create_gate(i32 10, void (...)* @isr10)
%31 = tail call i32 @create_gate(i32 11, void (...)* @isr11)
%32 = tail call i32 @create_gate(i32 12, void (...)* @isr12)
%33 = tail call i32 @create_gate(i32 13, void (...)* @isr13)
%34 = tail call i32 @create_gate(i32 14, void (...)* @isr14)
%35 = tail call i32 @create_gate(i32 15, void (...)* @isr15)
%36 = tail call i32 @create_gate(i32 16, void (...)* @isr16)
%37 = tail call i32 @create_gate(i32 17, void (...)* @isr17)
%38 = tail call i32 @create_gate(i32 18, void (...)* @isr18)
%39 = tail call i32 @create_gate(i32 19, void (...)* @isr19)
%40 = tail call i32 (...) @enable_interrupts()
ret void
}