void write_lba48(unsigned int lba_low, unsigned int lba_high,
                 unsigned short count, unsigned char *buf) {
  unsigned char c;
  int i, j;
  outb(0x1f0 + 6, (1 << 6));
  outb(0x1f0 + 2, (count >> 8) & 0xff);
  outb(0x1f0 + 3, (lba_low >> 24) & 0xff);
  outb(0x1f0 + 4, lba_high & 0xff);
  outb(0x1f0 + 5, (lba_high >> 8) & 0xff);
  outb(0x1f0 + 2, count & 0xff);
  outb(0x1f0 + 3, lba_low & 0xff);
  outb(0x1f0 + 4, (lba_low >> 8) & 0xff);
  outb(0x1f0 + 5, (lba_low >> 16) & 0xff);
  outb(0x1f0 + 7, 0x34);
  for (i = 0; i < count; ++i) {
    (void)inb(0x3f6);
    (void)inb(0x3f6);
    (void)inb(0x3f6);
    (void)inb(0x3f6);
    do {
      c = inb(0x3f6);
      if ((c & (1 << 0)) || (c & (1 << 5)))
        break;
    } while ((c & (1 << 7)) && !(c & (1 << 3)));
    if ((c & (1 << 0)) || (c & (1 << 5)))
      print("ata: drive error\n");
    for (j = 0; j < 256; ++j) {
      asm volatile("outw %%ax, %%dx" ::"a"(((unsigned short *)buf)[j]),
                   "d"(0x1f0 + 0)
                   : "memory");
    }
    buf += 512;
  }
  (void)inb(0x3f6);
  (void)inb(0x3f6);
  (void)inb(0x3f6);
  (void)inb(0x3f6);
  do {
    c = inb(0x3f6);
    if ((c & (1 << 0)) || (c & (1 << 5)))
      break;
  } while ((c & (1 << 7)) && !(c & (1 << 3)));
  if ((c & (1 << 0)) || (c & (1 << 5)))
    print("ata: drive error\n");
  outb(0x1f0 + 7, 0xe7);
}


x86 assembly (clang, -O0):
<write_lba48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dx,%ax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0x1f6,%edi
mov    $0x40,%esi
mov    $0x0,%al
call   1030 <outb@plt>
movzwl -0xa(%rbp),%esi
sar    $0x8,%esi
and    $0xff,%esi
mov    $0x1f2,%edi
mov    $0x0,%al
call   1030 <outb@plt>
mov    -0x4(%rbp),%esi
shr    $0x18,%esi
and    $0xff,%esi
mov    $0x1f3,%edi
mov    $0x0,%al
call   1030 <outb@plt>
mov    -0x8(%rbp),%esi
and    $0xff,%esi
mov    $0x1f4,%edi
mov    $0x0,%al
call   1030 <outb@plt>
mov    -0x8(%rbp),%esi
shr    $0x8,%esi
and    $0xff,%esi
mov    $0x1f5,%edi
mov    $0x0,%al
call   1030 <outb@plt>
movzwl -0xa(%rbp),%esi
and    $0xff,%esi
mov    $0x1f2,%edi
mov    $0x0,%al
call   1030 <outb@plt>
mov    -0x4(%rbp),%esi
and    $0xff,%esi
mov    $0x1f3,%edi
mov    $0x0,%al
call   1030 <outb@plt>
mov    -0x4(%rbp),%esi
shr    $0x8,%esi
and    $0xff,%esi
mov    $0x1f4,%edi
mov    $0x0,%al
call   1030 <outb@plt>
mov    -0x4(%rbp),%esi
shr    $0x10,%esi
and    $0xff,%esi
mov    $0x1f5,%edi
mov    $0x0,%al
call   1030 <outb@plt>
mov    $0x1f7,%edi
mov    $0x34,%esi
mov    $0x0,%al
call   1030 <outb@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
movzwl -0xa(%rbp),%ecx
cmp    %ecx,%eax
jge    1357 <write_lba48+0x227>
mov    $0x3f6,%edi
mov    $0x0,%al
call   1050 <inb@plt>
mov    $0x3f6,%edi
mov    $0x0,%al
call   1050 <inb@plt>
mov    $0x3f6,%edi
mov    $0x0,%al
call   1050 <inb@plt>
mov    $0x3f6,%edi
mov    $0x0,%al
call   1050 <inb@plt>
mov    $0x3f6,%edi
mov    $0x0,%al
call   1050 <inb@plt>
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1299 <write_lba48+0x169>
movzbl -0x19(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     129e <write_lba48+0x16e>
jmp    12d8 <write_lba48+0x1a8>
jmp    12a3 <write_lba48+0x173>
movzbl -0x19(%rbp),%ecx
and    $0x80,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x25(%rbp)
je     12cd <write_lba48+0x19d>
movzbl -0x19(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
test   $0x1,%al
jne    126a <write_lba48+0x13a>
movzbl -0x19(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    12f8 <write_lba48+0x1c8>
movzbl -0x19(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1306 <write_lba48+0x1d6>
lea    0xd01(%rip),%rdi
mov    $0x0,%al
call   1040 <print@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x100,-0x24(%rbp)
jge    133b <write_lba48+0x20b>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,2),%ax
mov    $0x1f0,%edx
out    %ax,(%dx)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    130d <write_lba48+0x1dd>
mov    -0x18(%rbp),%rax
add    $0x200,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    122b <write_lba48+0xfb>
mov    $0x3f6,%edi
mov    $0x0,%al
call   1050 <inb@plt>
mov    $0x3f6,%edi
mov    $0x0,%al
call   1050 <inb@plt>
mov    $0x3f6,%edi
mov    $0x0,%al
call   1050 <inb@plt>
mov    $0x3f6,%edi
mov    $0x0,%al
call   1050 <inb@plt>
mov    $0x3f6,%edi
mov    $0x0,%al
call   1050 <inb@plt>
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    13b6 <write_lba48+0x286>
movzbl -0x19(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     13bb <write_lba48+0x28b>
jmp    13f5 <write_lba48+0x2c5>
jmp    13c0 <write_lba48+0x290>
movzbl -0x19(%rbp),%ecx
and    $0x80,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x26(%rbp)
je     13ea <write_lba48+0x2ba>
movzbl -0x19(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x26(%rbp)
mov    -0x26(%rbp),%al
test   $0x1,%al
jne    1387 <write_lba48+0x257>
movzbl -0x19(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1415 <write_lba48+0x2e5>
movzbl -0x19(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1423 <write_lba48+0x2f3>
lea    0xbe4(%rip),%rdi
mov    $0x0,%al
call   1040 <print@plt>
mov    $0x1f7,%edi
mov    $0xe7,%esi
mov    $0x0,%al
call   1030 <outb@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_lba48>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%r15d
mov    %esi,%r14d
mov    %edi,%ebp
mov    $0x1f6,%edi
mov    $0x40,%esi
xor    %eax,%eax
call   1030 <outb@plt>
mov    %r15d,%esi
shr    $0x8,%esi
mov    $0x1f2,%edi
xor    %eax,%eax
call   1030 <outb@plt>
mov    %ebp,%eax
shr    $0x18,%eax
mov    $0x1f3,%edi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <outb@plt>
movzbl %r14b,%esi
mov    $0x1f4,%edi
xor    %eax,%eax
call   1030 <outb@plt>
mov    %r14d,%eax
movzbl %ah,%esi
mov    $0x1f5,%edi
xor    %eax,%eax
call   1030 <outb@plt>
movzbl %r15b,%esi
mov    $0x1f2,%edi
xor    %eax,%eax
call   1030 <outb@plt>
movzbl %bpl,%esi
mov    $0x1f3,%edi
xor    %eax,%eax
call   1030 <outb@plt>
mov    %ebp,%eax
movzbl %ah,%esi
mov    $0x1f4,%edi
xor    %eax,%eax
call   1030 <outb@plt>
shr    $0x10,%ebp
movzbl %bpl,%esi
mov    $0x1f5,%edi
xor    %eax,%eax
call   1030 <outb@plt>
mov    $0x1f7,%edi
mov    $0x34,%esi
xor    %eax,%eax
call   1030 <outb@plt>
test   %r15d,%r15d
je     129b <write_lba48+0x16b>
lea    0xe01(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3f6,%edi
xor    %eax,%eax
call   1050 <inb@plt>
mov    $0x3f6,%edi
xor    %eax,%eax
call   1050 <inb@plt>
mov    $0x3f6,%edi
xor    %eax,%eax
call   1050 <inb@plt>
mov    $0x3f6,%edi
xor    %eax,%eax
call   1050 <inb@plt>
mov    $0x3f6,%edi
xor    %eax,%eax
call   1050 <inb@plt>
mov    %eax,%ecx
and    $0xa9,%ecx
cmp    $0x80,%ecx
je     1240 <write_lba48+0x110>
test   $0x21,%al
je     126a <write_lba48+0x13a>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <print@plt>
xor    %ecx,%ecx
nopl   0x0(%rax)
movzwl (%rbx,%rcx,2),%eax
mov    $0x1f0,%edx
out    %ax,(%dx)
add    $0x1,%rcx
cmp    $0x100,%rcx
jne    1270 <write_lba48+0x140>
add    $0x200,%rbx
add    $0x1,%ebp
cmp    %r15d,%ebp
jne    1210 <write_lba48+0xe0>
mov    $0x3f6,%edi
xor    %eax,%eax
call   1050 <inb@plt>
mov    $0x3f6,%edi
xor    %eax,%eax
call   1050 <inb@plt>
mov    $0x3f6,%edi
xor    %eax,%eax
call   1050 <inb@plt>
mov    $0x3f6,%edi
xor    %eax,%eax
call   1050 <inb@plt>
nopl   0x0(%rax,%rax,1)
mov    $0x3f6,%edi
xor    %eax,%eax
call   1050 <inb@plt>
mov    %eax,%ecx
and    $0xa9,%ecx
cmp    $0x80,%ecx
je     12d0 <write_lba48+0x1a0>
test   $0x21,%al
je     12fe <write_lba48+0x1ce>
lea    0xd09(%rip),%rdi
xor    %eax,%eax
call   1040 <print@plt>
mov    $0x1f7,%edi
mov    $0xe7,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"ata: drive error\0A\00"
define void @write_lba48(i32 %0, i32 %1, i16 zeroext %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i16
%8 = alloca i8*
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i16 %2, i16* %7
store i8* %3, i8** %8
%12 = call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 502, i32 64)
%13 = load i16, i16* %7
%14 = zext i16 %13 to i32
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 498, i32 %16)
%18 = load i32, i32* %5
%19 = lshr i32 %18, 24
%20 = and i32 %19, 255
%21 = call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 499, i32 %20)
%22 = load i32, i32* %6
%23 = and i32 %22, 255
%24 = call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 500, i32 %23)
%25 = load i32, i32* %6
%26 = lshr i32 %25, 8
%27 = and i32 %26, 255
%28 = call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 501, i32 %27)
%29 = load i16, i16* %7
%30 = zext i16 %29 to i32
%31 = and i32 %30, 255
%32 = call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 498, i32 %31)
%33 = load i32, i32* %5
%34 = and i32 %33, 255
%35 = call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 499, i32 %34)
%36 = load i32, i32* %5
%37 = lshr i32 %36, 8
%38 = and i32 %37, 255
%39 = call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 500, i32 %38)
%40 = load i32, i32* %5
%41 = lshr i32 %40, 16
%42 = and i32 %41, 255
%43 = call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 501, i32 %42)
%44 = call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 503, i32 52)
store i32 0, i32* %10
br label %45
45: ; preds = %111, %4
%46 = load i32, i32* %10
%47 = load i16, i16* %7
%48 = zext i16 %47 to i32
%49 = icmp slt i32 %46, %48
br i1 %49, label %50, label %114
50: ; preds = %45
%51 = call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%52 = call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%53 = call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%54 = call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
br label %55
55: ; preds = %80, %50
%56 = call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%57 = trunc i32 %56 to i8
store i8 %57, i8* %9
%58 = load i8, i8* %9
%59 = zext i8 %58 to i32
%60 = and i32 %59, 1
%61 = icmp ne i32 %60, 0
br i1 %61, label %67, label %62
62: ; preds = %55
%63 = load i8, i8* %9
%64 = zext i8 %63 to i32
%65 = and i32 %64, 32
%66 = icmp ne i32 %65, 0
br i1 %66, label %67, label %68
67: ; preds = %62, %55
br label %82
68: ; preds = %62
br label %69
69: ; preds = %68
%70 = load i8, i8* %9
%71 = zext i8 %70 to i32
%72 = and i32 %71, 128
%73 = icmp ne i32 %72, 0
br i1 %73, label %74, label %80
74: ; preds = %69
%75 = load i8, i8* %9
%76 = zext i8 %75 to i32
%77 = and i32 %76, 8
%78 = icmp ne i32 %77, 0
%79 = xor i1 %78, true
br label %80
80: ; preds = %74, %69
%81 = phi i1 [ false, %69 ], [ %79, %74 ]
br i1 %81, label %55, label %82
82: ; preds = %80, %67
%83 = load i8, i8* %9
%84 = zext i8 %83 to i32
%85 = and i32 %84, 1
%86 = icmp ne i32 %85, 0
br i1 %86, label %92, label %87
87: ; preds = %82
%88 = load i8, i8* %9
%89 = zext i8 %88 to i32
%90 = and i32 %89, 32
%91 = icmp ne i32 %90, 0
br i1 %91, label %92, label %94
92: ; preds = %87, %82
%93 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %94
94: ; preds = %92, %87
store i32 0, i32* %11
br label %95
95: ; preds = %105, %94
%96 = load i32, i32* %11
%97 = icmp slt i32 %96, 256
br i1 %97, label %98, label %108
98: ; preds = %95
%99 = load i8*, i8** %8
%100 = bitcast i8* %99 to i16*
%101 = load i32, i32* %11
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i16, i16* %100, i64 %102
%104 = load i16, i16* %103
br label %105
105: ; preds = %98
%106 = load i32, i32* %11
%107 = add nsw i32 %106, 1
store i32 %107, i32* %11
br label %95
108: ; preds = %95
%109 = load i8*, i8** %8
%110 = getelementptr inbounds i8, i8* %109, i64 512
store i8* %110, i8** %8
br label %111
111: ; preds = %108
%112 = load i32, i32* %10
%113 = add nsw i32 %112, 1
store i32 %113, i32* %10
br label %45
114: ; preds = %45
%115 = call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%116 = call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%117 = call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%118 = call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
br label %119
119: ; preds = %144, %114
%120 = call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%121 = trunc i32 %120 to i8
store i8 %121, i8* %9
%122 = load i8, i8* %9
%123 = zext i8 %122 to i32
%124 = and i32 %123, 1
%125 = icmp ne i32 %124, 0
br i1 %125, label %131, label %126
126: ; preds = %119
%127 = load i8, i8* %9
%128 = zext i8 %127 to i32
%129 = and i32 %128, 32
%130 = icmp ne i32 %129, 0
br i1 %130, label %131, label %132
131: ; preds = %126, %119
br label %146
132: ; preds = %126
br label %133
133: ; preds = %132
%134 = load i8, i8* %9
%135 = zext i8 %134 to i32
%136 = and i32 %135, 128
%137 = icmp ne i32 %136, 0
br i1 %137, label %138, label %144
138: ; preds = %133
%139 = load i8, i8* %9
%140 = zext i8 %139 to i32
%141 = and i32 %140, 8
%142 = icmp ne i32 %141, 0
%143 = xor i1 %142, true
br label %144
144: ; preds = %138, %133
%145 = phi i1 [ false, %133 ], [ %143, %138 ]
br i1 %145, label %119, label %146
146: ; preds = %144, %131
%147 = load i8, i8* %9
%148 = zext i8 %147 to i32
%149 = and i32 %148, 1
%150 = icmp ne i32 %149, 0
br i1 %150, label %156, label %151
151: ; preds = %146
%152 = load i8, i8* %9
%153 = zext i8 %152 to i32
%154 = and i32 %153, 32
%155 = icmp ne i32 %154, 0
br i1 %155, label %156, label %158
156: ; preds = %151, %146
%157 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %158
158: ; preds = %156, %151
%159 = call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 503, i32 231)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"ata: drive error\0A\00"
define void @write_lba48(i32 %0, i32 %1, i16 zeroext %2, i8* nocapture %3) {
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 502, i32 64)
%6 = zext i16 %2 to i32
%7 = lshr i32 %6, 8
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 498, i32 %7)
%9 = lshr i32 %0, 24
%10 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 499, i32 %9)
%11 = and i32 %1, 255
%12 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 500, i32 %11)
%13 = lshr i32 %1, 8
%14 = and i32 %13, 255
%15 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 501, i32 %14)
%16 = and i32 %6, 255
%17 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 498, i32 %16)
%18 = and i32 %0, 255
%19 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 499, i32 %18)
%20 = lshr i32 %0, 8
%21 = and i32 %20, 255
%22 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 500, i32 %21)
%23 = lshr i32 %0, 16
%24 = and i32 %23, 255
%25 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 501, i32 %24)
%26 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 503, i32 52)
%27 = icmp eq i16 %2, 0
br i1 %27, label %56, label %28
28: ; preds = %4, %52
%29 = phi i32 [ %54, %52 ], [ 0, %4 ]
%30 = phi i8* [ %53, %52 ], [ %3, %4 ]
%31 = tail call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%32 = tail call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%33 = tail call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%34 = tail call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
br label %35
35: ; preds = %35, %28
%36 = tail call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%37 = and i32 %36, 169
%38 = icmp eq i32 %37, 128
br i1 %38, label %35, label %39
39: ; preds = %35
%40 = and i32 %36, 33
%41 = icmp eq i32 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %39
%43 = tail call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %44
44: ; preds = %39, %42
%45 = bitcast i8* %30 to i16*
br label %46
46: ; preds = %44, %46
%47 = phi i64 [ 0, %44 ], [ %50, %46 ]
%48 = getelementptr inbounds i16, i16* %45, i64 %47
%49 = load i16, i16* %48
tail call void asm sideeffect "outw %ax, %dx", "{ax},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i16 %49, i32 496)
%50 = add nuw nsw i64 %47, 1
%51 = icmp eq i64 %50, 256
br i1 %51, label %52, label %46
52: ; preds = %46
%53 = getelementptr inbounds i8, i8* %30, i64 512
%54 = add nuw nsw i32 %29, 1
%55 = icmp eq i32 %54, %6
br i1 %55, label %56, label %28
56: ; preds = %52, %4
%57 = tail call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%58 = tail call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%59 = tail call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%60 = tail call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
br label %61
61: ; preds = %61, %56
%62 = tail call i32 (i32, ...) bitcast (i32 (...)* @inb to i32 (i32, ...)*)(i32 1014)
%63 = and i32 %62, 169
%64 = icmp eq i32 %63, 128
br i1 %64, label %61, label %65
65: ; preds = %61
%66 = and i32 %62, 33
%67 = icmp eq i32 %66, 0
br i1 %67, label %70, label %68
68: ; preds = %65
%69 = tail call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %70
70: ; preds = %65, %68
%71 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 503, i32 231)
ret void
}