|
| 1 | +extern crate libcc2rs; |
| 2 | +use libcc2rs::*; |
| 3 | +use std::cell::RefCell; |
| 4 | +use std::collections::BTreeMap; |
| 5 | +use std::io::prelude::*; |
| 6 | +use std::io::{Read, Seek, Write}; |
| 7 | +use std::os::fd::AsFd; |
| 8 | +use std::rc::{Rc, Weak}; |
| 9 | +pub fn main() { |
| 10 | + std::process::exit(main_0()); |
| 11 | +} |
| 12 | +fn main_0() -> i32 { |
| 13 | + let arr: Value<Box<[i32]>> = Rc::new(RefCell::new(Box::new([1, 2, 3, 4]))); |
| 14 | + pub struct anon_0 { |
| 15 | + __bytes: Value<Box<[u8]>>, |
| 16 | + } |
| 17 | + impl anon_0 { |
| 18 | + pub fn p(&self) -> Ptr<Ptr<i32>> { |
| 19 | + (self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast() |
| 20 | + } |
| 21 | + pub fn bits(&self) -> Ptr<u64> { |
| 22 | + (self.__bytes.as_pointer() as Ptr<u8>).reinterpret_cast() |
| 23 | + } |
| 24 | + } |
| 25 | + impl Clone for anon_0 { |
| 26 | + fn clone(&self) -> Self { |
| 27 | + anon_0 { |
| 28 | + __bytes: Rc::new(RefCell::new(self.__bytes.borrow().clone())), |
| 29 | + } |
| 30 | + } |
| 31 | + } |
| 32 | + impl Default for anon_0 { |
| 33 | + fn default() -> Self { |
| 34 | + anon_0 { |
| 35 | + __bytes: Rc::new(RefCell::new(Box::from([0u8; 8]))), |
| 36 | + } |
| 37 | + } |
| 38 | + } |
| 39 | + impl ByteRepr for anon_0 { |
| 40 | + fn byte_size() -> usize { |
| 41 | + 8 |
| 42 | + } |
| 43 | + fn to_bytes(&self, buf: &mut [u8]) { |
| 44 | + buf.copy_from_slice(&self.__bytes.borrow()); |
| 45 | + } |
| 46 | + fn from_bytes(buf: &[u8]) -> Self { |
| 47 | + anon_0 { |
| 48 | + __bytes: Rc::new(RefCell::new(Box::from(buf))), |
| 49 | + } |
| 50 | + } |
| 51 | + }; |
| 52 | + let u: Value<anon_0> = <Value<anon_0>>::default(); |
| 53 | + (*u.borrow_mut()).p().write((arr.as_pointer() as Ptr<i32>)); |
| 54 | + let rhs_0 = ((((*u.borrow()).bits().read()) as u64) |
| 55 | + .wrapping_add(((100_usize).wrapping_mul((::std::mem::size_of::<i32>() as usize)) as u64))) |
| 56 | + as u64; |
| 57 | + (*u.borrow_mut()).bits().write(rhs_0); |
| 58 | + let p: Value<Ptr<i32>> = Rc::new(RefCell::new(((*u.borrow()).p().read()).clone())); |
| 59 | + return if (((((*p.borrow()).read()) == 0) as i32) != 0) { |
| 60 | + 0 |
| 61 | + } else { |
| 62 | + 1 |
| 63 | + }; |
| 64 | +} |
0 commit comments