#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*/ vbiosAddInt(char *, int);
void vhdcInit() {
  vbiosAddInt(
      "test dl, 80                 \njnz $(label_int_13_hdd)     \nint 40      "
      "                \njmp near $(label_int_13_end)\n$(label_int_13_hdd):    "
      "    \n$(label_int_13_cmp_00):     \ncmp ah, 00                  \njnz "
      "$(label_int_13_cmp_01)  \njmp near $(label_int_13_00) "
      "\n$(label_int_13_cmp_01):     \ncmp ah, 01                  \njnz "
      "$(label_int_13_cmp_02)  \njmp near $(label_int_13_01) "
      "\n$(label_int_13_cmp_02):     \ncmp ah, 02                  \njnz "
      "$(label_int_13_cmp_03)  \njmp near $(label_int_13_02) "
      "\n$(label_int_13_cmp_03):     \ncmp ah, 03                  \njnz "
      "$(label_int_13_cmp_08)  \njmp near $(label_int_13_03) "
      "\n$(label_int_13_cmp_08):     \ncmp ah, 08                  \njnz "
      "$(label_int_13_cmp_15)  \njmp near $(label_int_13_08) "
      "\n$(label_int_13_cmp_15):     \ncmp ah, 15                  \njnz "
      "$(label_int_13_cmp_def) \njmp near $(label_int_13_15) "
      "\n$(label_int_13_cmp_def):    \nclc                         \njmp near "
      "$(label_int_13_end)\n$(label_int_13_00):         \n; reset drive        "
      "       \ncmp dl, 80                  \njnz $(label_int_13_00_x)    "
      "\nmov ah, 00                  \nclc                         \njmp near "
      "$(label_int_13_end)\n$(label_int_13_00_x):       \nmov ah, 0c           "
      "       \nstc                         \njmp near "
      "$(label_int_13_end)\n$(label_int_13_01):         \n; get hdd status "
      "byte       \npush bx                     \npush ds                     "
      "\nmov bx, 0040                \nmov ds, bx                  \nmov ah, "
      "ds:[0074]           \npop ds                      \npop bx              "
      "        \nclc                         \njmp near "
      "$(label_int_13_end)\n$(label_int_13_02):         \nqdx a2 \njmp near "
      "$(label_int_13_end)\n$(label_int_13_03):         \nqdx a3 \njmp near "
      "$(label_int_13_end)\n$(label_int_13_08):         \n; get hdd parameters "
      "       \npush ax                     \npush bx                     "
      "\npush ds                     \nmov ax, 0000                \nmov ds, "
      "ax                  \nmov bx, ds:[0104]           \nmov ax, ds:[0106]   "
      "        \nmov ds, ax                  \nmov cx, ds:[bx+00]          "
      "\ndec cx          ; ncyl - 1  \nxchg ch, cl                 \nshl cl, "
      "01                  \nshl cl, 01                  \nshl cl, 01          "
      "        \nshl cl, 01                  \nshl cl, 01                  "
      "\nshl cl, 01                  \nmov al, ds:[bx+04] ; nsector\nor  cl, "
      "al ; (ncyl>>2)&0xc0 \n           ; | nsector      \nmov dh, ds:[bx+02]  "
      "        \ndec dh          ; nhead - 1 \nmov ax, 0040                "
      "\nmov ds, ax                  \nmov dl, ds:[0075]           \npop ds    "
      "                  \npop bx                      \npop ax                "
      "      \nmov ah, 00                  \nclc                         \njmp "
      "near $(label_int_13_end)\n$(label_int_13_15):         \n; get drive "
      "type            \n; count=(ncyl-1)*nhead*nsec \npush bx                 "
      "    \npush ds                     \nmov ax, 0000                \nmov "
      "ds, ax                  \nmov bx, ds:[0104]           \nmov ax, "
      "ds:[0106]           \nmov ds, ax                  \nmov cx, ds:[bx+00]  "
      "        \ndec cx          ; ncyl - 1  \nmov al, ds:[bx+04] ; "
      "nsector\nmov dh, ds:[bx+02] ; nhead  \nmov ah, 00                  "
      "\nmul dh ; nhead * nsector    \nmul cx ; total size         \nmov cx, "
      "dx ; size high 16   \nmov dx, ax ; size low  16   \npop ds              "
      "        \npop bx                      \nmov ax, 0003                "
      "\nclc                         \njmp near "
      "$(label_int_13_end)\n$(label_int_13_end):        \n; set hdd status "
      "byte       \npush bx                     \npush ds                     "
      "\nmov bx, 0040                \nmov ds, bx                  \nmov "
      "ds:[0074], ah           \npop ds                      \npop bx          "
      "            \n; set/clear cf              \npush ax                     "
      "\npush bx                     \npushf                       \npop ax    "
      "                  \nand ax, 0001                \nmov bx, sp            "
      "      \nand word ss:[bx+08], fffe   \nor  word ss:[bx+08], ax     \npop "
      "bx                      \npop ax                      \niret            "
      "            \n",
      0x13);
}


x86 assembly (clang, -O0):
<vhdcInit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x13,%esi
call   1030 <vbiosAddInt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vhdcInit>:
lea    0xee9(%rip),%rdi
mov    $0x13,%esi
jmp    1030 <vbiosAddInt@plt>

LLVM IR (-O0):
@.str = [3961 x i8] c"test dl, 80 \0Ajnz $(label_int_13_hdd) \0Aint 40 \0Ajmp near $(label_int_13_end)\0A$(label_int_13_hdd): \0A$(label_int_13_cmp_00): \0Acmp ah, 00 \0Ajnz $(label_int_13_cmp_01) \0Ajmp near $(label_int_13_00) \0A$(label_int_13_cmp_01): \0Acmp ah, 01 \0Ajnz $(label_int_13_cmp_02) \0Ajmp near $(label_int_13_01) \0A$(label_int_13_cmp_02): \0Acmp ah, 02 \0Ajnz $(label_int_13_cmp_03) \0Ajmp near $(label_int_13_02) \0A$(label_int_13_cmp_03): \0Acmp ah, 03 \0Ajnz $(label_int_13_cmp_08) \0Ajmp near $(label_int_13_03) \0A$(label_int_13_cmp_08): \0Acmp ah, 08 \0Ajnz $(label_int_13_cmp_15) \0Ajmp near $(label_int_13_08) \0A$(label_int_13_cmp_15): \0Acmp ah, 15 \0Ajnz $(label_int_13_cmp_def) \0Ajmp near $(label_int_13_15) \0A$(label_int_13_cmp_def): \0Aclc \0Ajmp near $(label_int_13_end)\0A$(label_int_13_00): \0A; reset drive \0Acmp dl, 80 \0Ajnz $(label_int_13_00_x) \0Amov ah, 00 \0Aclc \0Ajmp near $(label_int_13_end)\0A$(label_int_13_00_x): \0Amov ah, 0c \0Astc \0Ajmp near $(label_int_13_end)\0A$(label_int_13_01): \0A; get hdd status byte \0Apush bx \0Apush ds \0Amov bx, 0040 \0Amov ds, bx \0Amov ah, ds:[0074] \0Apop ds \0Apop bx \0Aclc \0Ajmp near $(label_int_13_end)\0A$(label_int_13_02): \0Aqdx a2 \0Ajmp near $(label_int_13_end)\0A$(label_int_13_03): \0Aqdx a3 \0Ajmp near $(label_int_13_end)\0A$(label_int_13_08): \0A; get hdd parameters \0Apush ax \0Apush bx \0Apush ds \0Amov ax, 0000 \0Amov ds, ax \0Amov bx, ds:[0104] \0Amov ax, ds:[0106] \0Amov ds, ax \0Amov cx, ds:[bx+00] \0Adec cx ; ncyl - 1 \0Axchg ch, cl \0Ashl cl, 01 \0Ashl cl, 01 \0Ashl cl, 01 \0Ashl cl, 01 \0Ashl cl, 01 \0Ashl cl, 01 \0Amov al, ds:[bx+04] ; nsector\0Aor cl, al ; (ncyl>>2)&0xc0 \0A ; | nsector \0Amov dh, ds:[bx+02] \0Adec dh ; nhead - 1 \0Amov ax, 0040 \0Amov ds, ax \0Amov dl, ds:[0075] \0Apop ds \0Apop bx \0Apop ax \0Amov ah, 00 \0Aclc \0Ajmp near $(label_int_13_end)\0A$(label_int_13_15): \0A; get drive type \0A; count=(ncyl-1)*nhead*nsec \0Apush bx \0Apush ds \0Amov ax, 0000 \0Amov ds, ax \0Amov bx, ds:[0104] \0Amov ax, ds:[0106] \0Amov ds, ax \0Amov cx, ds:[bx+00] \0Adec cx ; ncyl - 1 \0Amov al, ds:[bx+04] ; nsector\0Amov dh, ds:[bx+02] ; nhead \0Amov ah, 00 \0Amul dh ; nhead * nsector \0Amul cx ; total size \0Amov cx, dx ; size high 16 \0Amov dx, ax ; size low 16 \0Apop ds \0Apop bx \0Amov ax, 0003 \0Aclc \0Ajmp near $(label_int_13_end)\0A$(label_int_13_end): \0A; set hdd status byte \0Apush bx \0Apush ds \0Amov bx, 0040 \0Amov ds, bx \0Amov ds:[0074], ah \0Apop ds \0Apop bx \0A; set/clear cf \0Apush ax \0Apush bx \0Apushf \0Apop ax \0Aand ax, 0001 \0Amov bx, sp \0Aand word ss:[bx+08], fffe \0Aor word ss:[bx+08], ax \0Apop bx \0Apop ax \0Airet \0A\00"
define void @vhdcInit() {
%1 = call i32 @vbiosAddInt(i8* getelementptr inbounds ([3961 x i8], [3961 x i8]* @.str, i64 0, i64 0), i32 19)
ret void
}

LLVM IR (-O2):
@.str = [3961 x i8] c"test dl, 80 \0Ajnz $(label_int_13_hdd) \0Aint 40 \0Ajmp near $(label_int_13_end)\0A$(label_int_13_hdd): \0A$(label_int_13_cmp_00): \0Acmp ah, 00 \0Ajnz $(label_int_13_cmp_01) \0Ajmp near $(label_int_13_00) \0A$(label_int_13_cmp_01): \0Acmp ah, 01 \0Ajnz $(label_int_13_cmp_02) \0Ajmp near $(label_int_13_01) \0A$(label_int_13_cmp_02): \0Acmp ah, 02 \0Ajnz $(label_int_13_cmp_03) \0Ajmp near $(label_int_13_02) \0A$(label_int_13_cmp_03): \0Acmp ah, 03 \0Ajnz $(label_int_13_cmp_08) \0Ajmp near $(label_int_13_03) \0A$(label_int_13_cmp_08): \0Acmp ah, 08 \0Ajnz $(label_int_13_cmp_15) \0Ajmp near $(label_int_13_08) \0A$(label_int_13_cmp_15): \0Acmp ah, 15 \0Ajnz $(label_int_13_cmp_def) \0Ajmp near $(label_int_13_15) \0A$(label_int_13_cmp_def): \0Aclc \0Ajmp near $(label_int_13_end)\0A$(label_int_13_00): \0A; reset drive \0Acmp dl, 80 \0Ajnz $(label_int_13_00_x) \0Amov ah, 00 \0Aclc \0Ajmp near $(label_int_13_end)\0A$(label_int_13_00_x): \0Amov ah, 0c \0Astc \0Ajmp near $(label_int_13_end)\0A$(label_int_13_01): \0A; get hdd status byte \0Apush bx \0Apush ds \0Amov bx, 0040 \0Amov ds, bx \0Amov ah, ds:[0074] \0Apop ds \0Apop bx \0Aclc \0Ajmp near $(label_int_13_end)\0A$(label_int_13_02): \0Aqdx a2 \0Ajmp near $(label_int_13_end)\0A$(label_int_13_03): \0Aqdx a3 \0Ajmp near $(label_int_13_end)\0A$(label_int_13_08): \0A; get hdd parameters \0Apush ax \0Apush bx \0Apush ds \0Amov ax, 0000 \0Amov ds, ax \0Amov bx, ds:[0104] \0Amov ax, ds:[0106] \0Amov ds, ax \0Amov cx, ds:[bx+00] \0Adec cx ; ncyl - 1 \0Axchg ch, cl \0Ashl cl, 01 \0Ashl cl, 01 \0Ashl cl, 01 \0Ashl cl, 01 \0Ashl cl, 01 \0Ashl cl, 01 \0Amov al, ds:[bx+04] ; nsector\0Aor cl, al ; (ncyl>>2)&0xc0 \0A ; | nsector \0Amov dh, ds:[bx+02] \0Adec dh ; nhead - 1 \0Amov ax, 0040 \0Amov ds, ax \0Amov dl, ds:[0075] \0Apop ds \0Apop bx \0Apop ax \0Amov ah, 00 \0Aclc \0Ajmp near $(label_int_13_end)\0A$(label_int_13_15): \0A; get drive type \0A; count=(ncyl-1)*nhead*nsec \0Apush bx \0Apush ds \0Amov ax, 0000 \0Amov ds, ax \0Amov bx, ds:[0104] \0Amov ax, ds:[0106] \0Amov ds, ax \0Amov cx, ds:[bx+00] \0Adec cx ; ncyl - 1 \0Amov al, ds:[bx+04] ; nsector\0Amov dh, ds:[bx+02] ; nhead \0Amov ah, 00 \0Amul dh ; nhead * nsector \0Amul cx ; total size \0Amov cx, dx ; size high 16 \0Amov dx, ax ; size low 16 \0Apop ds \0Apop bx \0Amov ax, 0003 \0Aclc \0Ajmp near $(label_int_13_end)\0A$(label_int_13_end): \0A; set hdd status byte \0Apush bx \0Apush ds \0Amov bx, 0040 \0Amov ds, bx \0Amov ds:[0074], ah \0Apop ds \0Apop bx \0A; set/clear cf \0Apush ax \0Apush bx \0Apushf \0Apop ax \0Aand ax, 0001 \0Amov bx, sp \0Aand word ss:[bx+08], fffe \0Aor word ss:[bx+08], ax \0Apop bx \0Apop ax \0Airet \0A\00"
define void @vhdcInit() {
%1 = tail call i32 @vbiosAddInt(i8* getelementptr inbounds ([3961 x i8], [3961 x i8]* @.str, i64 0, i64 0), i32 19)
ret void
}