fn multi(a i16) i64 {
	one, two := a, 10
	return one + two
}

pub fn multireturn(a int) (int, i64, i64) {
	return 2, a + 2, 10 - a
}

pub fn test() (int, int) {
	return 25, 15
}

pub fn accept() int {
	mut a, _ := test()
	a += 20
	return a
}

pub fn side_effect() int {
	return 22
}

pub fn run_side_effect() int {
	mut a := 15

	_, a = side_effect(), 10

	return a
}

fn run_normal_stuff() {
	println(multi(2))
	{
		a, b, c := multireturn(20)
		println(a)
		println(b)
		println(c)
	}
	println(accept())
	println(run_side_effect())
}

fn if_cond(cond bool) (int, int) {
	return if cond { 10, 15 } else { 30, 35 }
}

struct AA {
	a int
	b int
}

fn take_struct(test AA) int {
	return test.a
}

fn give_two_struct(cond bool) (AA, AA) {
	return if cond {
		AA{
			a: 15
		}, AA{
			a: 15
		}
	} else {
		AA{
			a: 20
		}, AA{
			a: 592
		}
	}
}

fn give_struct() int {
	return take_struct(AA{ a: 15 })
}

fn if_struct_test(cond bool) AA {
	a := if cond {
		AA{}
	} else {
		AA{
			a: 125
		}
	}
	return a
}

fn run_stmt_exprs() {
	mut a := 0
	mut b := 0
	a, b = if_cond(true)
	println(true)
	println(a)
	println(b)
	a, b = if_cond(false)
	println(false)
	println(a)
	println(b)
	println(give_struct())
	mut struc := if_struct_test(false)
	println(struc.a)
	struc = if_struct_test(true)
	println(struc.a)
	c, d := give_two_struct(false)
	println(c.a)
	println(d.a)
}

fn main() {
	println('--- normal multi exprs')
	run_normal_stuff()
	println('--- struct based multi exprs/stmt exprs')
	run_stmt_exprs()
}
