#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*/ io_usleep(int);
int /*<<< orphan*/ pic24_nvmcon_write_completion(int, int);
int /*<<< orphan*/ pic24_program_verify();
int /*<<< orphan*/ pic24_restore_calibration();
int /*<<< orphan*/ pic24_six(int, int);
int /*<<< orphan*/ pic24_standby();
int /*<<< orphan*/ pic24_write_config_words();
int /*<<< orphan*/ pic24_write_fuid_words();
void pic24_dsPIC33F_PIC24H_erase(void) {
  pic24_program_verify();
  pic24_write_config_words();
  pic24_write_fuid_words();
  pic24_six(0x2404FA, 0);
  pic24_six(0x883B0A, 0);
  pic24_six(0x200000, 0);
  pic24_six(0x880190, 0);
  pic24_six(0xA8E761, 4);
  io_usleep(330001);
  pic24_nvmcon_write_completion(0x8000, 0x0000);
  pic24_restore_calibration();
  pic24_standby();
}


x86 assembly (clang, -O0):
<pic24_dsPIC33F_PIC24H_erase>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <pic24_program_verify@plt>
mov    $0x0,%al
call   1070 <pic24_write_config_words@plt>
mov    $0x0,%al
call   10a0 <pic24_write_fuid_words@plt>
mov    $0x2404fa,%edi
xor    %esi,%esi
call   1090 <pic24_six@plt>
mov    $0x883b0a,%edi
xor    %esi,%esi
call   1090 <pic24_six@plt>
mov    $0x200000,%edi
xor    %esi,%esi
call   1090 <pic24_six@plt>
mov    $0x880190,%edi
xor    %esi,%esi
call   1090 <pic24_six@plt>
mov    $0xa8e761,%edi
mov    $0x4,%esi
call   1090 <pic24_six@plt>
mov    $0x50911,%edi
call   1050 <io_usleep@plt>
mov    $0x8000,%edi
xor    %esi,%esi
call   1040 <pic24_nvmcon_write_completion@plt>
mov    $0x0,%al
call   1060 <pic24_restore_calibration@plt>
mov    $0x0,%al
call   1030 <pic24_standby@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic24_dsPIC33F_PIC24H_erase>:
push   %rax
xor    %eax,%eax
call   1080 <pic24_program_verify@plt>
xor    %eax,%eax
call   1070 <pic24_write_config_words@plt>
xor    %eax,%eax
call   10a0 <pic24_write_fuid_words@plt>
mov    $0x2404fa,%edi
xor    %esi,%esi
call   1090 <pic24_six@plt>
mov    $0x883b0a,%edi
xor    %esi,%esi
call   1090 <pic24_six@plt>
mov    $0x200000,%edi
xor    %esi,%esi
call   1090 <pic24_six@plt>
mov    $0x880190,%edi
xor    %esi,%esi
call   1090 <pic24_six@plt>
mov    $0xa8e761,%edi
mov    $0x4,%esi
call   1090 <pic24_six@plt>
mov    $0x50911,%edi
call   1050 <io_usleep@plt>
mov    $0x8000,%edi
xor    %esi,%esi
call   1040 <pic24_nvmcon_write_completion@plt>
xor    %eax,%eax
call   1060 <pic24_restore_calibration@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <pic24_standby@plt>

LLVM IR (-O0):
define void @pic24_dsPIC33F_PIC24H_erase() {
%1 = call i32 (...) @pic24_program_verify()
%2 = call i32 (...) @pic24_write_config_words()
%3 = call i32 (...) @pic24_write_fuid_words()
%4 = call i32 @pic24_six(i32 2360570, i32 0)
%5 = call i32 @pic24_six(i32 8928010, i32 0)
%6 = call i32 @pic24_six(i32 2097152, i32 0)
%7 = call i32 @pic24_six(i32 8913296, i32 0)
%8 = call i32 @pic24_six(i32 11069281, i32 4)
%9 = call i32 @io_usleep(i32 330001)
%10 = call i32 @pic24_nvmcon_write_completion(i32 32768, i32 0)
%11 = call i32 (...) @pic24_restore_calibration()
%12 = call i32 (...) @pic24_standby()
ret void
}

LLVM IR (-O2):
define void @pic24_dsPIC33F_PIC24H_erase() {
%1 = tail call i32 (...) @pic24_program_verify()
%2 = tail call i32 (...) @pic24_write_config_words()
%3 = tail call i32 (...) @pic24_write_fuid_words()
%4 = tail call i32 @pic24_six(i32 2360570, i32 0)
%5 = tail call i32 @pic24_six(i32 8928010, i32 0)
%6 = tail call i32 @pic24_six(i32 2097152, i32 0)
%7 = tail call i32 @pic24_six(i32 8913296, i32 0)
%8 = tail call i32 @pic24_six(i32 11069281, i32 4)
%9 = tail call i32 @io_usleep(i32 330001)
%10 = tail call i32 @pic24_nvmcon_write_completion(i32 32768, i32 0)
%11 = tail call i32 (...) @pic24_restore_calibration()
%12 = tail call i32 (...) @pic24_standby()
ret void
}