ats_int_type
loop_1 (ats_int_type arg0) {
/* local vardec */
ATSlocal (ats_int_type, tmp1) ;
ATSlocal (ats_int_type, tmp2) ;
ATSlocal (ats_int_type, tmp3) ;
ATSlocal (ats_bool_type, tmp4) ;
ATSlocal (ats_bool_type, tmp5) ;
ATSlocal (ats_int_type, tmp6) ;

__ats_lab_loop_1:
tmp2 = atslib_close_err (arg0) ;
tmp3 = ats_selsin_mac(tmp2, atslab_1) ;
tmp4 = atspre_igte (tmp3, 0) ;
if (tmp4) {
tmp1 = tmp3 ;
} else {
tmp6 = atslib_errno_get () ;
tmp5 = atslib_eq_errno_errno (tmp6, EINTR) ;
if (tmp5) {
arg0 = arg0 ;
goto __ats_lab_loop_1 ; // tail call
} else {
tmp1 = tmp3 ;
} /* end of [if] */
} /* end of [if] */
return (tmp1) ;
} /* end of [loop_1] */
ats_int_type
ATS_2d0_2e2_2e10_2libc_2sys_2SATS_2stat_2esats__isfdtype (ats_int_type arg0, ats_mode_type arg1) {
/* local vardec */
ATSlocal (ats_int_type, tmp0) ;
ATSlocal (ats_stat_type, tmp1) ;
ATSlocal (ats_int_type, tmp2) ;
ATSlocal (ats_bool_type, tmp3) ;
ATSlocal (ats_mode_type, tmp4) ;
ATSlocal (ats_mode_type, tmp5) ;
ATSlocal (ats_bool_type, tmp6) ;

__ats_lab_ATS_2d0_2e2_2e10_2libc_2sys_2SATS_2stat_2esats__isfdtype:
/* ats_stat_type tmp1 ; */
tmp2 = atslib_fstat_err (arg0, (&tmp1)) ;
tmp3 = atspre_igte (tmp2, 0) ;
if (tmp3) {
tmp5 = ats_select_mac(tmp1, st_mode) ;
tmp4 = atslib_lor_mode_mode (tmp5, S_IFMT) ;
tmp6 = atslib_eq_mode_mode (arg1, tmp4) ;
if (tmp6) {
tmp0 = 1 ;
} else {
tmp0 = 0 ;
} /* end of [if] */
} else {
tmp0 = -1 ;
} /* end of [if] */
return (tmp0) ;
} /* end of [ATS_2d0_2e2_2e10_2libc_2sys_2SATS_2stat_2esats__isfdtype] */
ats_void_type
ATS_2d0_2e2_2e10_2libc_2sys_2SATS_2socket_in_2esats__bind_in_exn (ats_int_type arg0, ats_ref_type arg1) {
/* local vardec */
// ATSlocal_void (tmp0) ;
ATSlocal (ats_int_type, tmp1) ;
ATSlocal (ats_int_type, tmp2) ;
ATSlocal (ats_bool_type, tmp3) ;
// ATSlocal_void (tmp4) ;
// ATSlocal_void (tmp5) ;

__ats_lab_ATS_2d0_2e2_2e10_2libc_2sys_2SATS_2socket_in_2esats__bind_in_exn:
tmp1 = atslib_bind_err (arg0, arg1, atslib_socklen_in) ;
tmp2 = ats_selsin_mac(tmp1, atslab_1) ;
tmp3 = atspre_igte (tmp2, 0) ;
if (tmp3) {
/* empty */
} else {
/* tmp4 = */ atslib_perror (ATSstrcst("bind")) ;
/* tmp5 = */ ats_exit (EXIT_FAILURE) ;
arg0 = arg0 ;
arg1 = arg1 ;
goto __ats_lab_ATS_2d0_2e2_2e10_2libc_2sys_2SATS_2socket_in_2esats__bind_in_exn ; // tail call
} /* end of [if] */
return /* (tmp0) */ ;
} /* end of [ATS_2d0_2e2_2e10_2libc_2sys_2SATS_2socket_in_2esats__bind_in_exn] */
ats_void_type
ATS_2d0_2e2_2e10_2libc_2sys_2SATS_2socket_in_2esats__connect_in_exn (ats_int_type arg0, ats_ref_type arg1) {
/* local vardec */
// ATSlocal_void (tmp6) ;
ATSlocal (ats_int_type, tmp7) ;
ATSlocal (ats_int_type, tmp8) ;
ATSlocal (ats_bool_type, tmp9) ;
// ATSlocal_void (tmp10) ;
// ATSlocal_void (tmp11) ;

__ats_lab_ATS_2d0_2e2_2e10_2libc_2sys_2SATS_2socket_in_2esats__connect_in_exn:
tmp7 = atslib_connect_err (arg0, arg1, atslib_socklen_in) ;
tmp8 = ats_selsin_mac(tmp7, atslab_1) ;
tmp9 = atspre_igte (tmp8, 0) ;
if (tmp9) {
/* empty */
} else {
/* tmp10 = */ atslib_perror (ATSstrcst("connect")) ;
/* tmp11 = */ ats_exit (EXIT_FAILURE) ;
arg0 = arg0 ;
arg1 = arg1 ;
goto __ats_lab_ATS_2d0_2e2_2e10_2libc_2sys_2SATS_2socket_in_2esats__connect_in_exn ; // tail call
} /* end of [if] */
return /* (tmp6) */ ;
} /* end of [ATS_2d0_2e2_2e10_2libc_2sys_2SATS_2socket_in_2esats__connect_in_exn] */
ats_void_type
loop_6 (ats_int_type arg0, ats_ptr_type arg1, ats_int_type arg2) {
/* local vardec */
// ATSlocal_void (tmp30) ;
ATSlocal (ats_bool_type, tmp31) ;
ATSlocal (ats_int_type, tmp32) ;
ATSlocal (ats_int_type, tmp33) ;
ATSlocal (ats_int_type, tmp34) ;
// ATSlocal_void (tmp35) ;
ATSlocal (ats_ptr_type, tmp48) ;
ATSlocal (ats_int_type, tmp49) ;

__ats_lab_loop_6:
tmp32 = atspre_isub (arg0, arg2) ;
tmp31 = atspre_igte (tmp32, 2) ;
if (tmp31) {
tmp34 = atspre_isub (arg0, arg2) ;
tmp33 = atslib_randint (tmp34) ;
/* tmp35 = */ array_ptr_exch__intsz_01527_ats_int_type (arg1, 0, tmp33) ;
tmp48 = atspre_padd_size (arg1, sizeof(ats_int_type)) ;
tmp49 = atspre_iadd (arg2, 1) ;
arg0 = arg0 ;
arg1 = tmp48 ;
arg2 = tmp49 ;
goto __ats_lab_loop_6 ; // tail call
} else {
/* empty */
} /* end of [if] */
return /* (tmp30) */ ;
} /* end of [loop_6] */
ats_bool_type
_2opt_2ats_2d0_2e2_2e9_2src_2ats_label_2esats__gte_label_label (ats_ptr_type arg0, ats_ptr_type arg1) {
/* local vardec */
ATSlocal (ats_bool_type, tmp14) ;
ATSlocal (ats_int_type, tmp15) ;

__ats_lab__2opt_2ats_2d0_2e2_2e9_2src_2ats_label_2esats__gte_label_label:
tmp15 = _2opt_2ats_2d0_2e2_2e9_2src_2ats_label_2esats__compare_label_label (arg0, arg1) ;
tmp14 = atspre_igte (tmp15, 0) ;
return (tmp14) ;
} /* end of [_2opt_2ats_2d0_2e2_2e9_2src_2ats_label_2esats__gte_label_label] */
ats_int_type
markstack_pop (ats_ref_type arg0, ats_ref_type arg1, ats_ref_type arg2, ats_ref_type arg3) {
/* local vardec */
ATSlocal (ats_int_type, tmp5) ;
ATSlocal (ats_int_type, tmp6) ;
ATSlocal (ats_bool_type, tmp7) ;
// ATSlocal_void (tmp8) ;
ATSlocal (ats_ptr_type, tmp9) ;
ATSlocal (ats_bool_type, tmp10) ;
ATSlocal (ats_int_type, tmp11) ;
// ATSlocal_void (tmp12) ;

__ats_lab_markstack_pop:
#line 68 "gcats1_marking.dats"
tmp6 = atspre_isub (ats_ptrget_mac(ats_int_type, arg1), 1) ;
#line 70 "gcats1_marking.dats"
tmp7 = atspre_igte (tmp6, 0) ;
#line 70 "gcats1_marking.dats"
if (tmp7) {
#line 71 "gcats1_marking.dats"
/* tmp8 = */ markstackpagelst_entry_get (ats_ptrget_mac(ats_ptr_type, arg0), tmp6, arg2, arg3) ;
#line 73 "gcats1_marking.dats"
ats_ptrget_mac(ats_int_type, arg1) = tmp6 ;
#line 73 "gcats1_marking.dats"
tmp5 = 0 ;
} else {
#line 75 "gcats1_marking.dats"
tmp9 = markstackpagelst_prev_get (ats_ptrget_mac(ats_ptr_type, arg0)) ;
#line 77 "gcats1_marking.dats"
tmp10 = markstackpagelst_is_cons (tmp9) ;
#line 77 "gcats1_marking.dats"
if (tmp10) {
#line 78 "gcats1_marking.dats"
ats_ptrget_mac(ats_ptr_type, arg0) = tmp9 ;
#line 79 "gcats1_marking.dats"
tmp11 = atspre_isub (4000, 1) ;
#line 80 "gcats1_marking.dats"
/* tmp12 = */ markstackpagelst_entry_get (ats_ptrget_mac(ats_ptr_type, arg0), tmp11, arg2, arg3) ;
#line 82 "gcats1_marking.dats"
ats_ptrget_mac(ats_int_type, arg1) = tmp11 ;
#line 82 "gcats1_marking.dats"
tmp5 = 0 ;
} else {
#line 84 "gcats1_marking.dats"
ats_ptrget_mac(ats_ptr_type, arg2) = atspre_null_ptr ;
#line 84 "gcats1_marking.dats"
ats_ptrget_mac(ats_int_type, arg3) = 0 ;
#line 84 "gcats1_marking.dats"
tmp5 = 1 ;
} /* end of [if] */
} /* end of [if] */
return (tmp5) ;
} /* end of [markstack_pop] */
ats_void_type
ATS_2d0_2e2_2e12_2libc_2SATS_2fcntl_2esats__close_loop_exn (ats_int_type arg0) {
/* local vardec */
// ATSlocal_void (tmp7) ;
ATSlocal (ats_int_type, tmp8) ;
ATSlocal (ats_int_type, tmp9) ;
ATSlocal (ats_bool_type, tmp10) ;
// ATSlocal_void (tmp11) ;
// ATSlocal_void (tmp12) ;

__ats_lab_ATS_2d0_2e2_2e12_2libc_2SATS_2fcntl_2esats__close_loop_exn:
tmp8 = ATS_2d0_2e2_2e12_2libc_2SATS_2fcntl_2esats__close_loop_err (arg0) ;
tmp9 = ats_selsin_mac(tmp8, atslab_1) ;
tmp10 = atspre_igte (tmp9, 0) ;
if (tmp10) {
/* empty */
} else {
/* tmp11 = */ atslib_perror (ATSstrcst("close")) ;
/* tmp12 = */ atspre_prerrf_exn (ATSstrcst("exit(ATS): [close_loop] failed\n")) ;
/* tmp7 = */ ats_exit (EXIT_FAILURE) ;
} /* end of [if] */
return /* (tmp7) */ ;
} /* end of [ATS_2d0_2e2_2e12_2libc_2SATS_2fcntl_2esats__close_loop_exn] */
ats_ptr_type
avltree_rrotate_0121_ats_int_type (ats_ptr_type arg0, ats_int_type arg1, ats_ptr_type arg2, ats_int_type arg3, ats_ptr_type arg4, ats_ptr_type arg5) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp79) ;
ATSlocal (ats_ptr_type, tmp80) ;
ATSlocal (ats_ptr_type, tmp81) ;
ATSlocal (ats_ptr_type, tmp82) ;
ATSlocal (ats_ptr_type, tmp83) ;
ATSlocal (ats_int_type, tmp84) ;
ATSlocal (ats_ptr_type, tmp85) ;
ATSlocal (ats_int_type, tmp86) ;
ATSlocal (ats_ptr_type, tmp87) ;
ATSlocal (ats_bool_type, tmp88) ;
ATSlocal (ats_int_type, tmp89) ;
ATSlocal (ats_int_type, tmp90) ;
ATSlocal (ats_ptr_type, tmp91) ;
ATSlocal (ats_int_type, tmp92) ;
ATSlocal (ats_int_type, tmp93) ;
ATSlocal (ats_ptr_type, tmp94) ;
ATSlocal (ats_ptr_type, tmp95) ;
ATSlocal (ats_ptr_type, tmp96) ;
ATSlocal (ats_ptr_type, tmp97) ;
ATSlocal (ats_int_type, tmp98) ;
ATSlocal (ats_ptr_type, tmp99) ;
ATSlocal (ats_int_type, tmp100) ;
ATSlocal (ats_ptr_type, tmp101) ;
ATSlocal (ats_int_type, tmp102) ;
ATSlocal (ats_int_type, tmp103) ;
ATSlocal (ats_ptr_type, tmp104) ;
ATSlocal (ats_int_type, tmp105) ;
ATSlocal (ats_int_type, tmp106) ;
ATSlocal (ats_ptr_type, tmp107) ;

__ats_lab_avltree_rrotate_0121_ats_int_type:
tmp80 = ats_ptrget_mac(ats_ptr_type, arg2) ;
// if (tmp80 == (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
tmp81 = &ats_caselptrlab_mac(anairiats_sum_0, tmp80, atslab_0) ;
tmp82 = &ats_caselptrlab_mac(anairiats_sum_0, tmp80, atslab_2) ;
tmp83 = &ats_caselptrlab_mac(anairiats_sum_0, tmp80, atslab_3) ;
tmp85 = ats_ptrget_mac(ats_ptr_type, tmp82) ;
tmp84 = avltree_height_067_ats_int_type (tmp85) ;
tmp87 = ats_ptrget_mac(ats_ptr_type, tmp83) ;
tmp86 = avltree_height_067_ats_int_type (tmp87) ;
tmp89 = atspre_iadd (tmp84, 0) ;
tmp88 = atspre_igte (tmp89, tmp86) ;
if (tmp88) {
tmp90 = atspre_iadd (tmp86, 1) ;
ats_ptrget_mac(ats_int_type, arg0) = tmp90 ;
tmp91 = ats_ptrget_mac(ats_ptr_type, tmp83) ;
ats_ptrget_mac(ats_ptr_type, arg2) = tmp91 ;
tmp93 = atspre_imax (tmp84, tmp90) ;
tmp92 = atspre_iadd (1, tmp93) ;
ats_ptrget_mac(ats_int_type, tmp81) = tmp92 ;
ats_ptrget_mac(ats_ptr_type, tmp83) = arg5 ;
tmp79 = tmp80 ;
} else {
tmp94 = ats_ptrget_mac(ats_ptr_type, tmp83) ;
// if (tmp94 == (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
tmp95 = &ats_caselptrlab_mac(anairiats_sum_0, tmp94, atslab_0) ;
tmp96 = &ats_caselptrlab_mac(anairiats_sum_0, tmp94, atslab_2) ;
tmp97 = &ats_caselptrlab_mac(anairiats_sum_0, tmp94, atslab_3) ;
tmp99 = ats_ptrget_mac(ats_ptr_type, tmp96) ;
tmp98 = avltree_height_067_ats_int_type (tmp99) ;
tmp101 = ats_ptrget_mac(ats_ptr_type, tmp97) ;
tmp100 = avltree_height_067_ats_int_type (tmp101) ;
tmp103 = atspre_imax (tmp100, arg3) ;
tmp102 = atspre_iadd (1, tmp103) ;
ats_ptrget_mac(ats_int_type, arg0) = tmp102 ;
tmp104 = ats_ptrget_mac(ats_ptr_type, tmp97) ;
ats_ptrget_mac(ats_ptr_type, arg2) = tmp104 ;
tmp106 = atspre_imax (tmp84, tmp98) ;
tmp105 = atspre_iadd (1, tmp106) ;
ats_ptrget_mac(ats_int_type, tmp81) = tmp105 ;
tmp107 = ats_ptrget_mac(ats_ptr_type, tmp96) ;
ats_ptrget_mac(ats_ptr_type, tmp83) = tmp107 ;
ats_ptrget_mac(ats_int_type, tmp95) = arg1 ;
ats_ptrget_mac(ats_ptr_type, tmp96) = tmp80 ;
ats_ptrget_mac(ats_ptr_type, tmp97) = arg5 ;
tmp79 = tmp94 ;
} /* end of [if] */
return (tmp79) ;
} /* end of [avltree_rrotate_0121_ats_int_type] */
ats_ptr_type
avltree_rrotate_089_ats_uint_type_2cats_ptr_type (ats_ptr_type arg0, ats_int_type arg1, ats_ptr_type arg2, ats_int_type arg3, ats_ptr_type arg4, ats_ptr_type arg5) {
/* local vardec */
ATSlocal (ats_ptr_type, tmp54) ;
ATSlocal (ats_ptr_type, tmp55) ;
ATSlocal (ats_ptr_type, tmp56) ;
ATSlocal (ats_ptr_type, tmp57) ;
ATSlocal (ats_ptr_type, tmp58) ;
ATSlocal (ats_int_type, tmp59) ;
ATSlocal (ats_ptr_type, tmp60) ;
ATSlocal (ats_int_type, tmp61) ;
ATSlocal (ats_ptr_type, tmp62) ;
ATSlocal (ats_bool_type, tmp63) ;
ATSlocal (ats_int_type, tmp64) ;
ATSlocal (ats_int_type, tmp65) ;
ATSlocal (ats_ptr_type, tmp66) ;
ATSlocal (ats_int_type, tmp67) ;
ATSlocal (ats_int_type, tmp68) ;
ATSlocal (ats_ptr_type, tmp69) ;
ATSlocal (ats_ptr_type, tmp70) ;
ATSlocal (ats_ptr_type, tmp71) ;
ATSlocal (ats_ptr_type, tmp72) ;
ATSlocal (ats_int_type, tmp73) ;
ATSlocal (ats_ptr_type, tmp74) ;
ATSlocal (ats_int_type, tmp75) ;
ATSlocal (ats_ptr_type, tmp76) ;
ATSlocal (ats_int_type, tmp77) ;
ATSlocal (ats_int_type, tmp78) ;
ATSlocal (ats_ptr_type, tmp79) ;
ATSlocal (ats_int_type, tmp80) ;
ATSlocal (ats_int_type, tmp81) ;
ATSlocal (ats_ptr_type, tmp82) ;

__ats_lab_avltree_rrotate_089_ats_uint_type_2cats_ptr_type:
tmp55 = ats_ptrget_mac(ats_ptr_type, arg2) ;
// if (tmp55 == (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
tmp56 = &ats_caselptrlab_mac(anairiats_sum_0, tmp55, atslab_0) ;
tmp57 = &ats_caselptrlab_mac(anairiats_sum_0, tmp55, atslab_3) ;
tmp58 = &ats_caselptrlab_mac(anairiats_sum_0, tmp55, atslab_4) ;
tmp60 = ats_ptrget_mac(ats_ptr_type, tmp57) ;
tmp59 = avltree_height_036_ats_uint_type_2cats_ptr_type (tmp60) ;
tmp62 = ats_ptrget_mac(ats_ptr_type, tmp58) ;
tmp61 = avltree_height_036_ats_uint_type_2cats_ptr_type (tmp62) ;
tmp64 = atspre_iadd (tmp59, 0) ;
tmp63 = atspre_igte (tmp64, tmp61) ;
if (tmp63) {
tmp65 = atspre_iadd (tmp61, 1) ;
ats_ptrget_mac(ats_int_type, arg0) = tmp65 ;
tmp66 = ats_ptrget_mac(ats_ptr_type, tmp58) ;
ats_ptrget_mac(ats_ptr_type, arg2) = tmp66 ;
tmp68 = atspre_imax (tmp59, tmp65) ;
tmp67 = atspre_iadd (1, tmp68) ;
ats_ptrget_mac(ats_int_type, tmp56) = tmp67 ;
ats_ptrget_mac(ats_ptr_type, tmp58) = arg5 ;
tmp54 = tmp55 ;
} else {
tmp69 = ats_ptrget_mac(ats_ptr_type, tmp58) ;
// if (tmp69 == (ats_sum_ptr_type)0) { ats_deadcode_failure_handle () ; }
tmp70 = &ats_caselptrlab_mac(anairiats_sum_0, tmp69, atslab_0) ;
tmp71 = &ats_caselptrlab_mac(anairiats_sum_0, tmp69, atslab_3) ;
tmp72 = &ats_caselptrlab_mac(anairiats_sum_0, tmp69, atslab_4) ;
tmp74 = ats_ptrget_mac(ats_ptr_type, tmp71) ;
tmp73 = avltree_height_036_ats_uint_type_2cats_ptr_type (tmp74) ;
tmp76 = ats_ptrget_mac(ats_ptr_type, tmp72) ;
tmp75 = avltree_height_036_ats_uint_type_2cats_ptr_type (tmp76) ;
tmp78 = atspre_imax (tmp75, arg3) ;
tmp77 = atspre_iadd (1, tmp78) ;
ats_ptrget_mac(ats_int_type, arg0) = tmp77 ;
tmp79 = ats_ptrget_mac(ats_ptr_type, tmp72) ;
ats_ptrget_mac(ats_ptr_type, arg2) = tmp79 ;
tmp81 = atspre_imax (tmp59, tmp73) ;
tmp80 = atspre_iadd (1, tmp81) ;
ats_ptrget_mac(ats_int_type, tmp56) = tmp80 ;
tmp82 = ats_ptrget_mac(ats_ptr_type, tmp71) ;
ats_ptrget_mac(ats_ptr_type, tmp58) = tmp82 ;
ats_ptrget_mac(ats_int_type, tmp70) = arg1 ;
ats_ptrget_mac(ats_ptr_type, tmp71) = tmp55 ;
ats_ptrget_mac(ats_ptr_type, tmp72) = arg5 ;
tmp54 = tmp69 ;
} /* end of [if] */
return (tmp54) ;
} /* end of [avltree_rrotate_089_ats_uint_type_2cats_ptr_type] */