// Lean compiler output
// Module: Init.System.IOError
// Imports: Init.Core Init.Data.UInt.Basic Init.Data.ToString.Basic Init.Data.String.Basic
#include <lean/lean.h>
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-label"
#elif defined(__GNUC__) && !defined(__CLANG__)
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-label"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
#ifdef __cplusplus
extern "C" {
#endif
static lean_object* l_IO_Error_toString___closed__14;
static lean_object* l_IO_Error_toString___closed__15;
static lean_object* l_IO_Error_toString___closed__13;
static lean_object* l_IO_Error_fopenErrorToString___closed__2;
LEAN_EXPORT lean_object* lean_mk_io_error_unsupported_operation(uint32_t, lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_unsatisfied_constraints(uint32_t, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkAlreadyExists___boxed(lean_object*, lean_object*);
lean_object* lean_uint32_to_nat(uint32_t);
LEAN_EXPORT lean_object* lean_mk_io_error_protocol_error(uint32_t, lean_object*);
static lean_object* l_IO_Error_toString___closed__16;
LEAN_EXPORT lean_object* l_IO_Error_mkPermissionDenied___boxed(lean_object*, lean_object*);
static lean_object* l_IO_Error_toString___closed__10;
LEAN_EXPORT lean_object* l_IO_Error_otherErrorToString___boxed(lean_object*, lean_object*, lean_object*);
static uint32_t l_IO_instInhabitedError___closed__1;
static lean_object* l_IO_Error_toString___closed__1;
LEAN_EXPORT lean_object* l_IO_Error_otherErrorToString(lean_object*, uint32_t, lean_object*);
static lean_object* l_IO_Error_fopenErrorToString___closed__3;
LEAN_EXPORT lean_object* l_IO_Error_fopenErrorToString___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkPermissionDeniedFile___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkNoSuchThingFile___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_resource_busy(uint32_t, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkHardwareFault___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l___private_Init_System_IOError_0__IO_Error_downCaseFirst(lean_object*);
static lean_object* l_IO_Error_otherErrorToString___closed__1;
LEAN_EXPORT lean_object* lean_mk_io_error_resource_vanished(uint32_t, lean_object*);
static lean_object* l_IO_Error_toString___closed__7;
LEAN_EXPORT lean_object* lean_mk_io_error_no_such_thing(uint32_t, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_instToString;
LEAN_EXPORT lean_object* lean_mk_io_error_no_such_thing_file(lean_object*, uint32_t, lean_object*);
LEAN_EXPORT lean_object* l_instCoeStringError;
static lean_object* l_instCoeStringError___closed__1;
LEAN_EXPORT lean_object* l_IO_Error_mkResourceExhaustedFile___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkTimeExpired___boxed(lean_object*, lean_object*);
static lean_object* l_IO_Error_toString___closed__6;
LEAN_EXPORT lean_object* lean_mk_io_error_eof(lean_object*);
static lean_object* l_IO_Error_toString___closed__9;
LEAN_EXPORT lean_object* lean_mk_io_error_permission_denied(uint32_t, lean_object*);
lean_object* l_Char_toLower___boxed(lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_user_error(lean_object*);
static lean_object* l_IO_Error_toString___closed__11;
LEAN_EXPORT lean_object* l_IO_instInhabitedError;
static lean_object* l_IO_instInhabitedError___closed__2;
LEAN_EXPORT lean_object* l_IO_Error_mkOtherError___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkIllegalOperation___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_no_file_or_directory(lean_object*, uint32_t, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkNoFileOrDirectory___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_time_expired(uint32_t, lean_object*);
static lean_object* l_IO_instInhabitedError___closed__3;
LEAN_EXPORT lean_object* l_IO_Error_mkInvalidArgumentFile___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkInappropriateType___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkInvalidArgument___boxed(lean_object*, lean_object*);
static lean_object* l_IO_Error_toString___closed__5;
LEAN_EXPORT lean_object* l_IO_Error_fopenErrorToString(lean_object*, lean_object*, uint32_t, lean_object*);
lean_object* l_String_modify(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkNoSuchThing___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkUnsupportedOperation___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkResourceVanished___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_already_exists(uint32_t, lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_invalid_argument(uint32_t, lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_hardware_fault(uint32_t, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkAlreadyExistsFile___boxed(lean_object*, lean_object*, lean_object*);
static lean_object* l_IO_Error_fopenErrorToString___closed__1;
static lean_object* l_IO_Error_toString___closed__4;
static lean_object* l_IO_Error_toString___closed__2;
LEAN_EXPORT lean_object* lean_mk_io_error_resource_exhausted(uint32_t, lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_inappropriate_type(uint32_t, lean_object*);
static lean_object* l_IO_Error_toString___closed__8;
static lean_object* l_IO_Error_toString___closed__3;
uint32_t lean_uint32_of_nat(lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_other_error(uint32_t, lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_invalid_argument_file(lean_object*, uint32_t, lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_resource_exhausted_file(lean_object*, uint32_t, lean_object*);
static lean_object* l_IO_Error_toString___closed__12;
LEAN_EXPORT lean_object* l_IO_Error_mkResourceBusy___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_already_exists_file(lean_object*, uint32_t, lean_object*);
LEAN_EXPORT lean_object* lean_io_error_to_string(lean_object*);
static lean_object* l___private_Init_System_IOError_0__IO_Error_downCaseFirst___closed__1;
LEAN_EXPORT lean_object* lean_mk_io_error_illegal_operation(uint32_t, lean_object*);
lean_object* lean_string_append(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkInappropriateTypeFile___boxed(lean_object*, lean_object*, lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_permission_denied_file(lean_object*, uint32_t, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkUnsatisfiedConstraints___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkInterrupted___boxed(lean_object*, lean_object*, lean_object*);
static lean_object* l_IO_Error_instToString___closed__1;
lean_object* l___private_Init_Data_Repr_0__Nat_reprFast(lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkProtocolError___boxed(lean_object*, lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_interrupted(lean_object*, uint32_t, lean_object*);
LEAN_EXPORT lean_object* lean_mk_io_error_inappropriate_type_file(lean_object*, uint32_t, lean_object*);
LEAN_EXPORT lean_object* l_IO_Error_mkResourceExhausted___boxed(lean_object*, lean_object*);
static uint32_t _init_l_IO_instInhabitedError___closed__1() {
_start:
{
lean_object* x_1; uint32_t x_2; 
x_1 = lean_unsigned_to_nat(0u);
x_2 = lean_uint32_of_nat(x_1);
return x_2;
}
}
static lean_object* _init_l_IO_instInhabitedError___closed__2() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("", 0, 0);
return x_1;
}
}
static lean_object* _init_l_IO_instInhabitedError___closed__3() {
_start:
{
lean_object* x_1; uint32_t x_2; lean_object* x_3; lean_object* x_4; 
x_1 = lean_box(0);
x_2 = l_IO_instInhabitedError___closed__1;
x_3 = l_IO_instInhabitedError___closed__2;
x_4 = lean_alloc_ctor(0, 2, 4);
lean_ctor_set(x_4, 0, x_1);
lean_ctor_set(x_4, 1, x_3);
lean_ctor_set_uint32(x_4, sizeof(void*)*2, x_2);
return x_4;
}
}
static lean_object* _init_l_IO_instInhabitedError() {
_start:
{
lean_object* x_1; 
x_1 = l_IO_instInhabitedError___closed__3;
return x_1;
}
}
LEAN_EXPORT lean_object* lean_mk_io_user_error(lean_object* x_1) {
_start:
{
lean_object* x_2; 
x_2 = lean_alloc_ctor(18, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
static lean_object* _init_l_instCoeStringError___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_alloc_closure((void*)(lean_mk_io_user_error), 1, 0);
return x_1;
}
}
static lean_object* _init_l_instCoeStringError() {
_start:
{
lean_object* x_1; 
x_1 = l_instCoeStringError___closed__1;
return x_1;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_already_exists_file(lean_object* x_1, uint32_t x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; lean_object* x_5; 
x_4 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_4, 0, x_1);
x_5 = lean_alloc_ctor(0, 2, 4);
lean_ctor_set(x_5, 0, x_4);
lean_ctor_set(x_5, 1, x_3);
lean_ctor_set_uint32(x_5, sizeof(void*)*2, x_2);
return x_5;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkAlreadyExistsFile___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
uint32_t x_4; lean_object* x_5; 
x_4 = lean_unbox_uint32(x_2);
lean_dec(x_2);
x_5 = lean_mk_io_error_already_exists_file(x_1, x_4, x_3);
return x_5;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_eof(lean_object* x_1) {
_start:
{
lean_object* x_2; 
lean_dec(x_1);
x_2 = lean_box(17);
return x_2;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_inappropriate_type_file(lean_object* x_1, uint32_t x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; lean_object* x_5; 
x_4 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_4, 0, x_1);
x_5 = lean_alloc_ctor(15, 2, 4);
lean_ctor_set(x_5, 0, x_4);
lean_ctor_set(x_5, 1, x_3);
lean_ctor_set_uint32(x_5, sizeof(void*)*2, x_2);
return x_5;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkInappropriateTypeFile___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
uint32_t x_4; lean_object* x_5; 
x_4 = lean_unbox_uint32(x_2);
lean_dec(x_2);
x_5 = lean_mk_io_error_inappropriate_type_file(x_1, x_4, x_3);
return x_5;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_interrupted(lean_object* x_1, uint32_t x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; 
x_4 = lean_alloc_ctor(10, 2, 4);
lean_ctor_set(x_4, 0, x_1);
lean_ctor_set(x_4, 1, x_3);
lean_ctor_set_uint32(x_4, sizeof(void*)*2, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkInterrupted___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
uint32_t x_4; lean_object* x_5; 
x_4 = lean_unbox_uint32(x_2);
lean_dec(x_2);
x_5 = lean_mk_io_error_interrupted(x_1, x_4, x_3);
return x_5;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_invalid_argument_file(lean_object* x_1, uint32_t x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; lean_object* x_5; 
x_4 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_4, 0, x_1);
x_5 = lean_alloc_ctor(12, 2, 4);
lean_ctor_set(x_5, 0, x_4);
lean_ctor_set(x_5, 1, x_3);
lean_ctor_set_uint32(x_5, sizeof(void*)*2, x_2);
return x_5;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkInvalidArgumentFile___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
uint32_t x_4; lean_object* x_5; 
x_4 = lean_unbox_uint32(x_2);
lean_dec(x_2);
x_5 = lean_mk_io_error_invalid_argument_file(x_1, x_4, x_3);
return x_5;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_no_file_or_directory(lean_object* x_1, uint32_t x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; 
x_4 = lean_alloc_ctor(11, 2, 4);
lean_ctor_set(x_4, 0, x_1);
lean_ctor_set(x_4, 1, x_3);
lean_ctor_set_uint32(x_4, sizeof(void*)*2, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkNoFileOrDirectory___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
uint32_t x_4; lean_object* x_5; 
x_4 = lean_unbox_uint32(x_2);
lean_dec(x_2);
x_5 = lean_mk_io_error_no_file_or_directory(x_1, x_4, x_3);
return x_5;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_no_such_thing_file(lean_object* x_1, uint32_t x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; lean_object* x_5; 
x_4 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_4, 0, x_1);
x_5 = lean_alloc_ctor(16, 2, 4);
lean_ctor_set(x_5, 0, x_4);
lean_ctor_set(x_5, 1, x_3);
lean_ctor_set_uint32(x_5, sizeof(void*)*2, x_2);
return x_5;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkNoSuchThingFile___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
uint32_t x_4; lean_object* x_5; 
x_4 = lean_unbox_uint32(x_2);
lean_dec(x_2);
x_5 = lean_mk_io_error_no_such_thing_file(x_1, x_4, x_3);
return x_5;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_permission_denied_file(lean_object* x_1, uint32_t x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; lean_object* x_5; 
x_4 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_4, 0, x_1);
x_5 = lean_alloc_ctor(13, 2, 4);
lean_ctor_set(x_5, 0, x_4);
lean_ctor_set(x_5, 1, x_3);
lean_ctor_set_uint32(x_5, sizeof(void*)*2, x_2);
return x_5;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkPermissionDeniedFile___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
uint32_t x_4; lean_object* x_5; 
x_4 = lean_unbox_uint32(x_2);
lean_dec(x_2);
x_5 = lean_mk_io_error_permission_denied_file(x_1, x_4, x_3);
return x_5;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_resource_exhausted_file(lean_object* x_1, uint32_t x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; lean_object* x_5; 
x_4 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_4, 0, x_1);
x_5 = lean_alloc_ctor(14, 2, 4);
lean_ctor_set(x_5, 0, x_4);
lean_ctor_set(x_5, 1, x_3);
lean_ctor_set_uint32(x_5, sizeof(void*)*2, x_2);
return x_5;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkResourceExhaustedFile___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
uint32_t x_4; lean_object* x_5; 
x_4 = lean_unbox_uint32(x_2);
lean_dec(x_2);
x_5 = lean_mk_io_error_resource_exhausted_file(x_1, x_4, x_3);
return x_5;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_unsupported_operation(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = lean_alloc_ctor(4, 1, 4);
lean_ctor_set(x_3, 0, x_2);
lean_ctor_set_uint32(x_3, sizeof(void*)*1, x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkUnsupportedOperation___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_unsupported_operation(x_3, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_resource_exhausted(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; lean_object* x_4; 
x_3 = lean_box(0);
x_4 = lean_alloc_ctor(14, 2, 4);
lean_ctor_set(x_4, 0, x_3);
lean_ctor_set(x_4, 1, x_2);
lean_ctor_set_uint32(x_4, sizeof(void*)*2, x_1);
return x_4;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkResourceExhausted___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_resource_exhausted(x_3, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_already_exists(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; lean_object* x_4; 
x_3 = lean_box(0);
x_4 = lean_alloc_ctor(0, 2, 4);
lean_ctor_set(x_4, 0, x_3);
lean_ctor_set(x_4, 1, x_2);
lean_ctor_set_uint32(x_4, sizeof(void*)*2, x_1);
return x_4;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkAlreadyExists___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_already_exists(x_3, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_inappropriate_type(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; lean_object* x_4; 
x_3 = lean_box(0);
x_4 = lean_alloc_ctor(15, 2, 4);
lean_ctor_set(x_4, 0, x_3);
lean_ctor_set(x_4, 1, x_2);
lean_ctor_set_uint32(x_4, sizeof(void*)*2, x_1);
return x_4;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkInappropriateType___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_inappropriate_type(x_3, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_no_such_thing(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; lean_object* x_4; 
x_3 = lean_box(0);
x_4 = lean_alloc_ctor(16, 2, 4);
lean_ctor_set(x_4, 0, x_3);
lean_ctor_set(x_4, 1, x_2);
lean_ctor_set_uint32(x_4, sizeof(void*)*2, x_1);
return x_4;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkNoSuchThing___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_no_such_thing(x_3, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_resource_vanished(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = lean_alloc_ctor(3, 1, 4);
lean_ctor_set(x_3, 0, x_2);
lean_ctor_set_uint32(x_3, sizeof(void*)*1, x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkResourceVanished___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_resource_vanished(x_3, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_resource_busy(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = lean_alloc_ctor(2, 1, 4);
lean_ctor_set(x_3, 0, x_2);
lean_ctor_set_uint32(x_3, sizeof(void*)*1, x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkResourceBusy___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_resource_busy(x_3, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_invalid_argument(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; lean_object* x_4; 
x_3 = lean_box(0);
x_4 = lean_alloc_ctor(12, 2, 4);
lean_ctor_set(x_4, 0, x_3);
lean_ctor_set(x_4, 1, x_2);
lean_ctor_set_uint32(x_4, sizeof(void*)*2, x_1);
return x_4;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkInvalidArgument___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_invalid_argument(x_3, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_other_error(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = lean_alloc_ctor(1, 1, 4);
lean_ctor_set(x_3, 0, x_2);
lean_ctor_set_uint32(x_3, sizeof(void*)*1, x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkOtherError___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_other_error(x_3, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_permission_denied(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; lean_object* x_4; 
x_3 = lean_box(0);
x_4 = lean_alloc_ctor(13, 2, 4);
lean_ctor_set(x_4, 0, x_3);
lean_ctor_set(x_4, 1, x_2);
lean_ctor_set_uint32(x_4, sizeof(void*)*2, x_1);
return x_4;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkPermissionDenied___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_permission_denied(x_3, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_hardware_fault(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = lean_alloc_ctor(5, 1, 4);
lean_ctor_set(x_3, 0, x_2);
lean_ctor_set_uint32(x_3, sizeof(void*)*1, x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkHardwareFault___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_hardware_fault(x_3, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_unsatisfied_constraints(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = lean_alloc_ctor(6, 1, 4);
lean_ctor_set(x_3, 0, x_2);
lean_ctor_set_uint32(x_3, sizeof(void*)*1, x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkUnsatisfiedConstraints___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_unsatisfied_constraints(x_3, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_illegal_operation(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = lean_alloc_ctor(7, 1, 4);
lean_ctor_set(x_3, 0, x_2);
lean_ctor_set_uint32(x_3, sizeof(void*)*1, x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkIllegalOperation___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_illegal_operation(x_3, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_protocol_error(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = lean_alloc_ctor(8, 1, 4);
lean_ctor_set(x_3, 0, x_2);
lean_ctor_set_uint32(x_3, sizeof(void*)*1, x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkProtocolError___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_protocol_error(x_3, x_2);
return x_4;
}
}
LEAN_EXPORT lean_object* lean_mk_io_error_time_expired(uint32_t x_1, lean_object* x_2) {
_start:
{
lean_object* x_3; 
x_3 = lean_alloc_ctor(9, 1, 4);
lean_ctor_set(x_3, 0, x_2);
lean_ctor_set_uint32(x_3, sizeof(void*)*1, x_1);
return x_3;
}
}
LEAN_EXPORT lean_object* l_IO_Error_mkTimeExpired___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint32_t x_3; lean_object* x_4; 
x_3 = lean_unbox_uint32(x_1);
lean_dec(x_1);
x_4 = lean_mk_io_error_time_expired(x_3, x_2);
return x_4;
}
}
static lean_object* _init_l___private_Init_System_IOError_0__IO_Error_downCaseFirst___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_alloc_closure((void*)(l_Char_toLower___boxed), 1, 0);
return x_1;
}
}
LEAN_EXPORT lean_object* l___private_Init_System_IOError_0__IO_Error_downCaseFirst(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3; lean_object* x_4; 
x_2 = lean_unsigned_to_nat(0u);
x_3 = l___private_Init_System_IOError_0__IO_Error_downCaseFirst___closed__1;
x_4 = l_String_modify(x_1, x_2, x_3);
return x_4;
}
}
static lean_object* _init_l_IO_Error_fopenErrorToString___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked(" (error code: ", 14, 14);
return x_1;
}
}
static lean_object* _init_l_IO_Error_fopenErrorToString___closed__2() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked(")\n  file: ", 10, 10);
return x_1;
}
}
static lean_object* _init_l_IO_Error_fopenErrorToString___closed__3() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked(", ", 2, 2);
return x_1;
}
}
LEAN_EXPORT lean_object* l_IO_Error_fopenErrorToString(lean_object* x_1, lean_object* x_2, uint32_t x_3, lean_object* x_4) {
_start:
{
if (lean_obj_tag(x_4) == 0)
{
lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; 
x_5 = lean_unsigned_to_nat(0u);
x_6 = l___private_Init_System_IOError_0__IO_Error_downCaseFirst___closed__1;
x_7 = l_String_modify(x_1, x_5, x_6);
x_8 = l_IO_Error_fopenErrorToString___closed__1;
x_9 = lean_string_append(x_7, x_8);
x_10 = lean_uint32_to_nat(x_3);
x_11 = l___private_Init_Data_Repr_0__Nat_reprFast(x_10);
x_12 = lean_string_append(x_9, x_11);
lean_dec(x_11);
x_13 = l_IO_Error_fopenErrorToString___closed__2;
x_14 = lean_string_append(x_12, x_13);
x_15 = lean_string_append(x_14, x_2);
return x_15;
}
else
{
lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; 
x_16 = lean_ctor_get(x_4, 0);
lean_inc(x_16);
lean_dec(x_4);
x_17 = lean_unsigned_to_nat(0u);
x_18 = l___private_Init_System_IOError_0__IO_Error_downCaseFirst___closed__1;
x_19 = l_String_modify(x_1, x_17, x_18);
x_20 = l_IO_Error_fopenErrorToString___closed__1;
x_21 = lean_string_append(x_19, x_20);
x_22 = lean_uint32_to_nat(x_3);
x_23 = l___private_Init_Data_Repr_0__Nat_reprFast(x_22);
x_24 = lean_string_append(x_21, x_23);
lean_dec(x_23);
x_25 = l_IO_Error_fopenErrorToString___closed__3;
x_26 = lean_string_append(x_24, x_25);
x_27 = l_String_modify(x_16, x_17, x_18);
x_28 = lean_string_append(x_26, x_27);
lean_dec(x_27);
x_29 = l_IO_Error_fopenErrorToString___closed__2;
x_30 = lean_string_append(x_28, x_29);
x_31 = lean_string_append(x_30, x_2);
return x_31;
}
}
}
LEAN_EXPORT lean_object* l_IO_Error_fopenErrorToString___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
uint32_t x_5; lean_object* x_6; 
x_5 = lean_unbox_uint32(x_3);
lean_dec(x_3);
x_6 = l_IO_Error_fopenErrorToString(x_1, x_2, x_5, x_4);
lean_dec(x_2);
return x_6;
}
}
static lean_object* _init_l_IO_Error_otherErrorToString___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked(")", 1, 1);
return x_1;
}
}
LEAN_EXPORT lean_object* l_IO_Error_otherErrorToString(lean_object* x_1, uint32_t x_2, lean_object* x_3) {
_start:
{
if (lean_obj_tag(x_3) == 0)
{
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; 
x_4 = lean_unsigned_to_nat(0u);
x_5 = l___private_Init_System_IOError_0__IO_Error_downCaseFirst___closed__1;
x_6 = l_String_modify(x_1, x_4, x_5);
x_7 = l_IO_Error_fopenErrorToString___closed__1;
x_8 = lean_string_append(x_6, x_7);
x_9 = lean_uint32_to_nat(x_2);
x_10 = l___private_Init_Data_Repr_0__Nat_reprFast(x_9);
x_11 = lean_string_append(x_8, x_10);
lean_dec(x_10);
x_12 = l_IO_Error_otherErrorToString___closed__1;
x_13 = lean_string_append(x_11, x_12);
return x_13;
}
else
{
lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; 
x_14 = lean_ctor_get(x_3, 0);
lean_inc(x_14);
lean_dec(x_3);
x_15 = lean_unsigned_to_nat(0u);
x_16 = l___private_Init_System_IOError_0__IO_Error_downCaseFirst___closed__1;
x_17 = l_String_modify(x_1, x_15, x_16);
x_18 = l_IO_Error_fopenErrorToString___closed__1;
x_19 = lean_string_append(x_17, x_18);
x_20 = lean_uint32_to_nat(x_2);
x_21 = l___private_Init_Data_Repr_0__Nat_reprFast(x_20);
x_22 = lean_string_append(x_19, x_21);
lean_dec(x_21);
x_23 = l_IO_Error_fopenErrorToString___closed__3;
x_24 = lean_string_append(x_22, x_23);
x_25 = l_String_modify(x_14, x_15, x_16);
x_26 = lean_string_append(x_24, x_25);
lean_dec(x_25);
x_27 = l_IO_Error_otherErrorToString___closed__1;
x_28 = lean_string_append(x_26, x_27);
return x_28;
}
}
}
LEAN_EXPORT lean_object* l_IO_Error_otherErrorToString___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
uint32_t x_4; lean_object* x_5; 
x_4 = lean_unbox_uint32(x_2);
lean_dec(x_2);
x_5 = l_IO_Error_otherErrorToString(x_1, x_4, x_3);
return x_5;
}
}
static lean_object* _init_l_IO_Error_toString___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("already exists", 14, 14);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__2() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("resource busy", 13, 13);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__3() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("resource vanished", 17, 17);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__4() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("unsupported operation", 21, 21);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__5() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("hardware fault", 14, 14);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__6() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("directory not empty", 19, 19);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__7() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("illegal operation", 17, 17);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__8() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("protocol error", 14, 14);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__9() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("time expired", 12, 12);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__10() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("interrupted system call", 23, 23);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__11() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("no such file or directory", 25, 25);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__12() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("invalid argument", 16, 16);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__13() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("resource exhausted", 18, 18);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__14() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("inappropriate type", 18, 18);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__15() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("no such thing", 13, 13);
return x_1;
}
}
static lean_object* _init_l_IO_Error_toString___closed__16() {
_start:
{
lean_object* x_1; 
x_1 = lean_mk_string_unchecked("end of file", 11, 11);
return x_1;
}
}
LEAN_EXPORT lean_object* lean_io_error_to_string(lean_object* x_1) {
_start:
{
switch (lean_obj_tag(x_1)) {
case 0:
{
lean_object* x_2; 
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
if (lean_obj_tag(x_2) == 0)
{
uint32_t x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; 
x_3 = lean_ctor_get_uint32(x_1, sizeof(void*)*2);
x_4 = lean_ctor_get(x_1, 1);
lean_inc(x_4);
lean_dec(x_1);
x_5 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_5, 0, x_4);
x_6 = l_IO_Error_toString___closed__1;
x_7 = l_IO_Error_otherErrorToString(x_6, x_3, x_5);
return x_7;
}
else
{
uint32_t x_8; lean_object* x_9; uint8_t x_10; 
x_8 = lean_ctor_get_uint32(x_1, sizeof(void*)*2);
x_9 = lean_ctor_get(x_1, 1);
lean_inc(x_9);
lean_dec(x_1);
x_10 = !lean_is_exclusive(x_2);
if (x_10 == 0)
{
lean_object* x_11; lean_object* x_12; lean_object* x_13; 
x_11 = lean_ctor_get(x_2, 0);
lean_ctor_set(x_2, 0, x_9);
x_12 = l_IO_Error_toString___closed__1;
x_13 = l_IO_Error_fopenErrorToString(x_12, x_11, x_8, x_2);
lean_dec(x_11);
return x_13;
}
else
{
lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; 
x_14 = lean_ctor_get(x_2, 0);
lean_inc(x_14);
lean_dec(x_2);
x_15 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_15, 0, x_9);
x_16 = l_IO_Error_toString___closed__1;
x_17 = l_IO_Error_fopenErrorToString(x_16, x_14, x_8, x_15);
lean_dec(x_14);
return x_17;
}
}
}
case 1:
{
uint32_t x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; 
x_18 = lean_ctor_get_uint32(x_1, sizeof(void*)*1);
x_19 = lean_ctor_get(x_1, 0);
lean_inc(x_19);
lean_dec(x_1);
x_20 = lean_box(0);
x_21 = l_IO_Error_otherErrorToString(x_19, x_18, x_20);
return x_21;
}
case 2:
{
uint32_t x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; 
x_22 = lean_ctor_get_uint32(x_1, sizeof(void*)*1);
x_23 = lean_ctor_get(x_1, 0);
lean_inc(x_23);
lean_dec(x_1);
x_24 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_24, 0, x_23);
x_25 = l_IO_Error_toString___closed__2;
x_26 = l_IO_Error_otherErrorToString(x_25, x_22, x_24);
return x_26;
}
case 3:
{
uint32_t x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; 
x_27 = lean_ctor_get_uint32(x_1, sizeof(void*)*1);
x_28 = lean_ctor_get(x_1, 0);
lean_inc(x_28);
lean_dec(x_1);
x_29 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_29, 0, x_28);
x_30 = l_IO_Error_toString___closed__3;
x_31 = l_IO_Error_otherErrorToString(x_30, x_27, x_29);
return x_31;
}
case 4:
{
uint32_t x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; 
x_32 = lean_ctor_get_uint32(x_1, sizeof(void*)*1);
x_33 = lean_ctor_get(x_1, 0);
lean_inc(x_33);
lean_dec(x_1);
x_34 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_34, 0, x_33);
x_35 = l_IO_Error_toString___closed__4;
x_36 = l_IO_Error_otherErrorToString(x_35, x_32, x_34);
return x_36;
}
case 5:
{
uint32_t x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; 
x_37 = lean_ctor_get_uint32(x_1, sizeof(void*)*1);
lean_dec(x_1);
x_38 = lean_box(0);
x_39 = l_IO_Error_toString___closed__5;
x_40 = l_IO_Error_otherErrorToString(x_39, x_37, x_38);
return x_40;
}
case 6:
{
uint32_t x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; 
x_41 = lean_ctor_get_uint32(x_1, sizeof(void*)*1);
lean_dec(x_1);
x_42 = lean_box(0);
x_43 = l_IO_Error_toString___closed__6;
x_44 = l_IO_Error_otherErrorToString(x_43, x_41, x_42);
return x_44;
}
case 7:
{
uint32_t x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; 
x_45 = lean_ctor_get_uint32(x_1, sizeof(void*)*1);
x_46 = lean_ctor_get(x_1, 0);
lean_inc(x_46);
lean_dec(x_1);
x_47 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_47, 0, x_46);
x_48 = l_IO_Error_toString___closed__7;
x_49 = l_IO_Error_otherErrorToString(x_48, x_45, x_47);
return x_49;
}
case 8:
{
uint32_t x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; 
x_50 = lean_ctor_get_uint32(x_1, sizeof(void*)*1);
x_51 = lean_ctor_get(x_1, 0);
lean_inc(x_51);
lean_dec(x_1);
x_52 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_52, 0, x_51);
x_53 = l_IO_Error_toString___closed__8;
x_54 = l_IO_Error_otherErrorToString(x_53, x_50, x_52);
return x_54;
}
case 9:
{
uint32_t x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; 
x_55 = lean_ctor_get_uint32(x_1, sizeof(void*)*1);
x_56 = lean_ctor_get(x_1, 0);
lean_inc(x_56);
lean_dec(x_1);
x_57 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_57, 0, x_56);
x_58 = l_IO_Error_toString___closed__9;
x_59 = l_IO_Error_otherErrorToString(x_58, x_55, x_57);
return x_59;
}
case 10:
{
lean_object* x_60; uint32_t x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; 
x_60 = lean_ctor_get(x_1, 0);
lean_inc(x_60);
x_61 = lean_ctor_get_uint32(x_1, sizeof(void*)*2);
x_62 = lean_ctor_get(x_1, 1);
lean_inc(x_62);
lean_dec(x_1);
x_63 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_63, 0, x_62);
x_64 = l_IO_Error_toString___closed__10;
x_65 = l_IO_Error_fopenErrorToString(x_64, x_60, x_61, x_63);
lean_dec(x_60);
return x_65;
}
case 11:
{
lean_object* x_66; uint32_t x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; 
x_66 = lean_ctor_get(x_1, 0);
lean_inc(x_66);
x_67 = lean_ctor_get_uint32(x_1, sizeof(void*)*2);
lean_dec(x_1);
x_68 = lean_box(0);
x_69 = l_IO_Error_toString___closed__11;
x_70 = l_IO_Error_fopenErrorToString(x_69, x_66, x_67, x_68);
lean_dec(x_66);
return x_70;
}
case 12:
{
lean_object* x_71; 
x_71 = lean_ctor_get(x_1, 0);
lean_inc(x_71);
if (lean_obj_tag(x_71) == 0)
{
uint32_t x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; 
x_72 = lean_ctor_get_uint32(x_1, sizeof(void*)*2);
x_73 = lean_ctor_get(x_1, 1);
lean_inc(x_73);
lean_dec(x_1);
x_74 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_74, 0, x_73);
x_75 = l_IO_Error_toString___closed__12;
x_76 = l_IO_Error_otherErrorToString(x_75, x_72, x_74);
return x_76;
}
else
{
uint32_t x_77; lean_object* x_78; uint8_t x_79; 
x_77 = lean_ctor_get_uint32(x_1, sizeof(void*)*2);
x_78 = lean_ctor_get(x_1, 1);
lean_inc(x_78);
lean_dec(x_1);
x_79 = !lean_is_exclusive(x_71);
if (x_79 == 0)
{
lean_object* x_80; lean_object* x_81; lean_object* x_82; 
x_80 = lean_ctor_get(x_71, 0);
lean_ctor_set(x_71, 0, x_78);
x_81 = l_IO_Error_toString___closed__12;
x_82 = l_IO_Error_fopenErrorToString(x_81, x_80, x_77, x_71);
lean_dec(x_80);
return x_82;
}
else
{
lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; 
x_83 = lean_ctor_get(x_71, 0);
lean_inc(x_83);
lean_dec(x_71);
x_84 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_84, 0, x_78);
x_85 = l_IO_Error_toString___closed__12;
x_86 = l_IO_Error_fopenErrorToString(x_85, x_83, x_77, x_84);
lean_dec(x_83);
return x_86;
}
}
}
case 13:
{
lean_object* x_87; 
x_87 = lean_ctor_get(x_1, 0);
lean_inc(x_87);
if (lean_obj_tag(x_87) == 0)
{
uint32_t x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; 
x_88 = lean_ctor_get_uint32(x_1, sizeof(void*)*2);
x_89 = lean_ctor_get(x_1, 1);
lean_inc(x_89);
lean_dec(x_1);
x_90 = lean_box(0);
x_91 = l_IO_Error_otherErrorToString(x_89, x_88, x_90);
return x_91;
}
else
{
uint32_t x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; 
x_92 = lean_ctor_get_uint32(x_1, sizeof(void*)*2);
x_93 = lean_ctor_get(x_1, 1);
lean_inc(x_93);
lean_dec(x_1);
x_94 = lean_ctor_get(x_87, 0);
lean_inc(x_94);
lean_dec(x_87);
x_95 = lean_box(0);
x_96 = l_IO_Error_fopenErrorToString(x_93, x_94, x_92, x_95);
lean_dec(x_94);
return x_96;
}
}
case 14:
{
lean_object* x_97; 
x_97 = lean_ctor_get(x_1, 0);
lean_inc(x_97);
if (lean_obj_tag(x_97) == 0)
{
uint32_t x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; 
x_98 = lean_ctor_get_uint32(x_1, sizeof(void*)*2);
x_99 = lean_ctor_get(x_1, 1);
lean_inc(x_99);
lean_dec(x_1);
x_100 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_100, 0, x_99);
x_101 = l_IO_Error_toString___closed__13;
x_102 = l_IO_Error_otherErrorToString(x_101, x_98, x_100);
return x_102;
}
else
{
uint32_t x_103; lean_object* x_104; uint8_t x_105; 
x_103 = lean_ctor_get_uint32(x_1, sizeof(void*)*2);
x_104 = lean_ctor_get(x_1, 1);
lean_inc(x_104);
lean_dec(x_1);
x_105 = !lean_is_exclusive(x_97);
if (x_105 == 0)
{
lean_object* x_106; lean_object* x_107; lean_object* x_108; 
x_106 = lean_ctor_get(x_97, 0);
lean_ctor_set(x_97, 0, x_104);
x_107 = l_IO_Error_toString___closed__13;
x_108 = l_IO_Error_fopenErrorToString(x_107, x_106, x_103, x_97);
lean_dec(x_106);
return x_108;
}
else
{
lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; 
x_109 = lean_ctor_get(x_97, 0);
lean_inc(x_109);
lean_dec(x_97);
x_110 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_110, 0, x_104);
x_111 = l_IO_Error_toString___closed__13;
x_112 = l_IO_Error_fopenErrorToString(x_111, x_109, x_103, x_110);
lean_dec(x_109);
return x_112;
}
}
}
case 15:
{
lean_object* x_113; 
x_113 = lean_ctor_get(x_1, 0);
lean_inc(x_113);
if (lean_obj_tag(x_113) == 0)
{
uint32_t x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; 
x_114 = lean_ctor_get_uint32(x_1, sizeof(void*)*2);
x_115 = lean_ctor_get(x_1, 1);
lean_inc(x_115);
lean_dec(x_1);
x_116 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_116, 0, x_115);
x_117 = l_IO_Error_toString___closed__14;
x_118 = l_IO_Error_otherErrorToString(x_117, x_114, x_116);
return x_118;
}
else
{
uint32_t x_119; lean_object* x_120; uint8_t x_121; 
x_119 = lean_ctor_get_uint32(x_1, sizeof(void*)*2);
x_120 = lean_ctor_get(x_1, 1);
lean_inc(x_120);
lean_dec(x_1);
x_121 = !lean_is_exclusive(x_113);
if (x_121 == 0)
{
lean_object* x_122; lean_object* x_123; lean_object* x_124; 
x_122 = lean_ctor_get(x_113, 0);
lean_ctor_set(x_113, 0, x_120);
x_123 = l_IO_Error_toString___closed__14;
x_124 = l_IO_Error_fopenErrorToString(x_123, x_122, x_119, x_113);
lean_dec(x_122);
return x_124;
}
else
{
lean_object* x_125; lean_object* x_126; lean_object* x_127; lean_object* x_128; 
x_125 = lean_ctor_get(x_113, 0);
lean_inc(x_125);
lean_dec(x_113);
x_126 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_126, 0, x_120);
x_127 = l_IO_Error_toString___closed__14;
x_128 = l_IO_Error_fopenErrorToString(x_127, x_125, x_119, x_126);
lean_dec(x_125);
return x_128;
}
}
}
case 16:
{
lean_object* x_129; 
x_129 = lean_ctor_get(x_1, 0);
lean_inc(x_129);
if (lean_obj_tag(x_129) == 0)
{
uint32_t x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; 
x_130 = lean_ctor_get_uint32(x_1, sizeof(void*)*2);
x_131 = lean_ctor_get(x_1, 1);
lean_inc(x_131);
lean_dec(x_1);
x_132 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_132, 0, x_131);
x_133 = l_IO_Error_toString___closed__15;
x_134 = l_IO_Error_otherErrorToString(x_133, x_130, x_132);
return x_134;
}
else
{
uint32_t x_135; lean_object* x_136; uint8_t x_137; 
x_135 = lean_ctor_get_uint32(x_1, sizeof(void*)*2);
x_136 = lean_ctor_get(x_1, 1);
lean_inc(x_136);
lean_dec(x_1);
x_137 = !lean_is_exclusive(x_129);
if (x_137 == 0)
{
lean_object* x_138; lean_object* x_139; lean_object* x_140; 
x_138 = lean_ctor_get(x_129, 0);
lean_ctor_set(x_129, 0, x_136);
x_139 = l_IO_Error_toString___closed__15;
x_140 = l_IO_Error_fopenErrorToString(x_139, x_138, x_135, x_129);
lean_dec(x_138);
return x_140;
}
else
{
lean_object* x_141; lean_object* x_142; lean_object* x_143; lean_object* x_144; 
x_141 = lean_ctor_get(x_129, 0);
lean_inc(x_141);
lean_dec(x_129);
x_142 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_142, 0, x_136);
x_143 = l_IO_Error_toString___closed__15;
x_144 = l_IO_Error_fopenErrorToString(x_143, x_141, x_135, x_142);
lean_dec(x_141);
return x_144;
}
}
}
case 17:
{
lean_object* x_145; 
x_145 = l_IO_Error_toString___closed__16;
return x_145;
}
default: 
{
lean_object* x_146; 
x_146 = lean_ctor_get(x_1, 0);
lean_inc(x_146);
lean_dec(x_1);
return x_146;
}
}
}
}
static lean_object* _init_l_IO_Error_instToString___closed__1() {
_start:
{
lean_object* x_1; 
x_1 = lean_alloc_closure((void*)(lean_io_error_to_string), 1, 0);
return x_1;
}
}
static lean_object* _init_l_IO_Error_instToString() {
_start:
{
lean_object* x_1; 
x_1 = l_IO_Error_instToString___closed__1;
return x_1;
}
}
lean_object* initialize_Init_Core(uint8_t builtin, lean_object*);
lean_object* initialize_Init_Data_UInt_Basic(uint8_t builtin, lean_object*);
lean_object* initialize_Init_Data_ToString_Basic(uint8_t builtin, lean_object*);
lean_object* initialize_Init_Data_String_Basic(uint8_t builtin, lean_object*);
static bool _G_initialized = false;
LEAN_EXPORT lean_object* initialize_Init_System_IOError(uint8_t builtin, lean_object* w) {
lean_object * res;
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
_G_initialized = true;
res = initialize_Init_Core(builtin, lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Init_Data_UInt_Basic(builtin, lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Init_Data_ToString_Basic(builtin, lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Init_Data_String_Basic(builtin, lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_IO_instInhabitedError___closed__1 = _init_l_IO_instInhabitedError___closed__1();
l_IO_instInhabitedError___closed__2 = _init_l_IO_instInhabitedError___closed__2();
lean_mark_persistent(l_IO_instInhabitedError___closed__2);
l_IO_instInhabitedError___closed__3 = _init_l_IO_instInhabitedError___closed__3();
lean_mark_persistent(l_IO_instInhabitedError___closed__3);
l_IO_instInhabitedError = _init_l_IO_instInhabitedError();
lean_mark_persistent(l_IO_instInhabitedError);
l_instCoeStringError___closed__1 = _init_l_instCoeStringError___closed__1();
lean_mark_persistent(l_instCoeStringError___closed__1);
l_instCoeStringError = _init_l_instCoeStringError();
lean_mark_persistent(l_instCoeStringError);
l___private_Init_System_IOError_0__IO_Error_downCaseFirst___closed__1 = _init_l___private_Init_System_IOError_0__IO_Error_downCaseFirst___closed__1();
lean_mark_persistent(l___private_Init_System_IOError_0__IO_Error_downCaseFirst___closed__1);
l_IO_Error_fopenErrorToString___closed__1 = _init_l_IO_Error_fopenErrorToString___closed__1();
lean_mark_persistent(l_IO_Error_fopenErrorToString___closed__1);
l_IO_Error_fopenErrorToString___closed__2 = _init_l_IO_Error_fopenErrorToString___closed__2();
lean_mark_persistent(l_IO_Error_fopenErrorToString___closed__2);
l_IO_Error_fopenErrorToString___closed__3 = _init_l_IO_Error_fopenErrorToString___closed__3();
lean_mark_persistent(l_IO_Error_fopenErrorToString___closed__3);
l_IO_Error_otherErrorToString___closed__1 = _init_l_IO_Error_otherErrorToString___closed__1();
lean_mark_persistent(l_IO_Error_otherErrorToString___closed__1);
l_IO_Error_toString___closed__1 = _init_l_IO_Error_toString___closed__1();
lean_mark_persistent(l_IO_Error_toString___closed__1);
l_IO_Error_toString___closed__2 = _init_l_IO_Error_toString___closed__2();
lean_mark_persistent(l_IO_Error_toString___closed__2);
l_IO_Error_toString___closed__3 = _init_l_IO_Error_toString___closed__3();
lean_mark_persistent(l_IO_Error_toString___closed__3);
l_IO_Error_toString___closed__4 = _init_l_IO_Error_toString___closed__4();
lean_mark_persistent(l_IO_Error_toString___closed__4);
l_IO_Error_toString___closed__5 = _init_l_IO_Error_toString___closed__5();
lean_mark_persistent(l_IO_Error_toString___closed__5);
l_IO_Error_toString___closed__6 = _init_l_IO_Error_toString___closed__6();
lean_mark_persistent(l_IO_Error_toString___closed__6);
l_IO_Error_toString___closed__7 = _init_l_IO_Error_toString___closed__7();
lean_mark_persistent(l_IO_Error_toString___closed__7);
l_IO_Error_toString___closed__8 = _init_l_IO_Error_toString___closed__8();
lean_mark_persistent(l_IO_Error_toString___closed__8);
l_IO_Error_toString___closed__9 = _init_l_IO_Error_toString___closed__9();
lean_mark_persistent(l_IO_Error_toString___closed__9);
l_IO_Error_toString___closed__10 = _init_l_IO_Error_toString___closed__10();
lean_mark_persistent(l_IO_Error_toString___closed__10);
l_IO_Error_toString___closed__11 = _init_l_IO_Error_toString___closed__11();
lean_mark_persistent(l_IO_Error_toString___closed__11);
l_IO_Error_toString___closed__12 = _init_l_IO_Error_toString___closed__12();
lean_mark_persistent(l_IO_Error_toString___closed__12);
l_IO_Error_toString___closed__13 = _init_l_IO_Error_toString___closed__13();
lean_mark_persistent(l_IO_Error_toString___closed__13);
l_IO_Error_toString___closed__14 = _init_l_IO_Error_toString___closed__14();
lean_mark_persistent(l_IO_Error_toString___closed__14);
l_IO_Error_toString___closed__15 = _init_l_IO_Error_toString___closed__15();
lean_mark_persistent(l_IO_Error_toString___closed__15);
l_IO_Error_toString___closed__16 = _init_l_IO_Error_toString___closed__16();
lean_mark_persistent(l_IO_Error_toString___closed__16);
l_IO_Error_instToString___closed__1 = _init_l_IO_Error_instToString___closed__1();
lean_mark_persistent(l_IO_Error_instToString___closed__1);
l_IO_Error_instToString = _init_l_IO_Error_instToString();
lean_mark_persistent(l_IO_Error_instToString);
return lean_io_result_mk_ok(lean_box(0));
}
#ifdef __cplusplus
}
#endif
