#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);
void notify_intr_end(unsigned char irq) {
  if (0 <= irq && irq <= 7) {
    outb(0x0020, 0x60 + irq);
  } else if (8 <= irq && irq <= 15) {
    outb(0x00A0, 0x60 + irq - 8);
    outb(0x0020, 0x60 + 2);
  }
}


x86 assembly (clang, -O0):
<notify_intr_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     114f <notify_intr_end+0x3f>
movzbl -0x1(%rbp),%eax
cmp    $0x7,%eax
jg     114f <notify_intr_end+0x3f>
movzbl -0x1(%rbp),%esi
add    $0x60,%esi
mov    $0x20,%edi
call   1030 <outb@plt>
jmp    1195 <notify_intr_end+0x85>
movzbl -0x1(%rbp),%ecx
mov    $0x8,%eax
cmp    %ecx,%eax
jg     1190 <notify_intr_end+0x80>
movzbl -0x1(%rbp),%eax
cmp    $0xf,%eax
jg     1190 <notify_intr_end+0x80>
movzbl -0x1(%rbp),%esi
add    $0x60,%esi
sub    $0x8,%esi
mov    $0xa0,%edi
call   1030 <outb@plt>
mov    $0x20,%edi
mov    $0x62,%esi
call   1030 <outb@plt>
jmp    1195 <notify_intr_end+0x85>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notify_intr_end>:
mov    %edi,%esi
cmp    $0x7,%sil
ja     1125 <notify_intr_end+0x15>
add    $0x60,%esi
mov    $0x20,%edi
jmp    1030 <outb@plt>
cmp    $0xf,%sil
ja     114c <notify_intr_end+0x3c>
push   %rax
add    $0x58,%esi
mov    $0xa0,%edi
call   1030 <outb@plt>
mov    $0x62,%esi
add    $0x8,%rsp
mov    $0x20,%edi
jmp    1030 <outb@plt>
ret

LLVM IR (-O0):
define void @notify_intr_end(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 7
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = add nsw i32 96, %12
%14 = call i32 @outb(i32 32, i32 %13)
br label %31
15: ; preds = %6, %1
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
%18 = icmp sle i32 8, %17
br i1 %18, label %19, label %30
19: ; preds = %15
%20 = load i8, i8* %2
%21 = zext i8 %20 to i32
%22 = icmp sle i32 %21, 15
br i1 %22, label %23, label %30
23: ; preds = %19
%24 = load i8, i8* %2
%25 = zext i8 %24 to i32
%26 = add nsw i32 96, %25
%27 = sub nsw i32 %26, 8
%28 = call i32 @outb(i32 160, i32 %27)
%29 = call i32 @outb(i32 32, i32 98)
br label %30
30: ; preds = %23, %19, %15
br label %31
31: ; preds = %30, %10
ret void
}

LLVM IR (-O2):
define void @notify_intr_end(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = icmp ult i8 %0, 8
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nuw nsw i32 %2, 96
br label %11
6: ; preds = %1
%7 = icmp ult i8 %0, 16
br i1 %7, label %8, label %14
8: ; preds = %6
%9 = add nuw nsw i32 %2, 88
%10 = tail call i32 @outb(i32 160, i32 %9)
br label %11
11: ; preds = %4, %8
%12 = phi i32 [ 98, %8 ], [ %5, %4 ]
%13 = tail call i32 @outb(i32 32, i32 %12)
br label %14
14: ; preds = %11, %6
ret void
}