#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*/ HD_RW(int /*<<< orphan*/, int, int, unsigned char *);
void setup_DPT(void) {
  unsigned char sect[512];
  HD_RW(0, 0x20, 1, sect);
  sect[0x1be] = 0x80;
  sect[0x1be + 0x04] = 0x2e;
  *(unsigned long *)&sect[0x1be + 0x08] = 1;
  *(unsigned long *)&sect[0x1be + 0x0c] = 1024 * 2 * 1024 * 2;
  sect[0x1ce + 0x04] = 0x2f;
  *(unsigned long *)&sect[0x1ce + 0x08] = 1024 * 2 * 1024 * 2 + 1;
  *(unsigned long *)&sect[0x1ce + 0x0c] = 1024 * 1024 * 2;
  sect[0x1fe] = 0x55;
  sect[0x1ff] = 0xaa;
  HD_RW(0, 0x30, 1, sect);
}


x86 assembly (clang, -O0):
<setup_DPT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    -0x200(%rbp),%rcx
xor    %edi,%edi
mov    $0x20,%esi
mov    $0x1,%edx
call   1030 <HD_RW@plt>
movb   $0x80,-0x42(%rbp)
movb   $0x2e,-0x3e(%rbp)
movq   $0x1,-0x3a(%rbp)
movq   $0x400000,-0x36(%rbp)
movb   $0x2f,-0x2e(%rbp)
movq   $0x400001,-0x2a(%rbp)
movq   $0x200000,-0x26(%rbp)
movb   $0x55,-0x2(%rbp)
movb   $0xaa,-0x1(%rbp)
lea    -0x200(%rbp),%rcx
xor    %edi,%edi
mov    $0x30,%esi
mov    $0x1,%edx
call   1030 <HD_RW@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_DPT>:
push   %rbx
sub    $0x200,%rsp
mov    %rsp,%rbx
xor    %edi,%edi
mov    $0x20,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <HD_RW@plt>
movb   $0x80,0x1be(%rsp)
80
movb   $0x2e,0x1c2(%rsp)
2e
movq   $0x1,0x1c6(%rsp)
movq   $0x400000,0x1ca(%rsp)
movb   $0x2f,0x1d2(%rsp)
2f
movq   $0x400001,0x1d6(%rsp)
movq   $0x200000,0x1da(%rsp)
movw   $0xaa55,0x1fe(%rsp)
xor    %edi,%edi
mov    $0x30,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <HD_RW@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @setup_DPT() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = call i32 @HD_RW(i32 0, i32 32, i32 1, i8* %2)
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 446
store i8 -128, i8* %4
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 450
store i8 46, i8* %5
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 454
%7 = bitcast i8* %6 to i64*
store i64 1, i64* %7
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 458
%9 = bitcast i8* %8 to i64*
store i64 4194304, i64* %9
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 466
store i8 47, i8* %10
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 470
%12 = bitcast i8* %11 to i64*
store i64 4194305, i64* %12
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 474
%14 = bitcast i8* %13 to i64*
store i64 2097152, i64* %14
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 510
store i8 85, i8* %15
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 511
store i8 -86, i8* %16
%17 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%18 = call i32 @HD_RW(i32 0, i32 48, i32 1, i8* %17)
ret void
}

LLVM IR (-O2):
define void @setup_DPT() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = call i32 @HD_RW(i32 0, i32 32, i32 1, i8* %2)
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 446
store i8 -128, i8* %4
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 450
store i8 46, i8* %5
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 454
%7 = bitcast i8* %6 to i64*
store i64 1, i64* %7
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 458
%9 = bitcast i8* %8 to i64*
store i64 4194304, i64* %9
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 466
store i8 47, i8* %10
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 470
%12 = bitcast i8* %11 to i64*
store i64 4194305, i64* %12
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 474
%14 = bitcast i8* %13 to i64*
store i64 2097152, i64* %14
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 510
store i8 85, i8* %15
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 511
store i8 -86, i8* %16
%17 = call i32 @HD_RW(i32 0, i32 48, i32 1, i8* %2)
ret void
}