Repository: Konstantin8105/c4go
Pull request #317 (2019-03-14 09:11:05)

simplification of transpilation

codecov[bot]: # [Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/317?src=pr&el=h1) Report
> Merging [#317](https://codecov.io/gh/Konstantin8105/c4go/pull/317?src=pr&el=desc) into [master](https://codecov.io/gh/Konstantin8105/c4go/commit/7d15f0f4224ad639c126af576b2e928e5c2362a0?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/Konstantin8105/c4go/pull/317/graphs/tree.svg?width=650&token=esH2rHXlZ2&height=150&src=pr)](https://codecov.io/gh/Konstantin8105/c4go/pull/317?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master     #317   +/-   ##
=======================================
  Coverage   86.72%   86.72%           
=======================================
  Files         184      184           
  Lines       10457    10457           
=======================================
  Hits         9069     9069           
  Misses        970      970           
  Partials      418      418
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/317?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/Konstantin8105/c4go/pull/317?src=pr&el=footer). Last update [7d15f0f...aa73cb9](https://codecov.io/gh/Konstantin8105/c4go/pull/317?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/.travis.yml b/.travis.yml
index 4362a06..8ac6c47 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,12 +19,12 @@ matrix:
     - env: SCRIPT=test CLANG=3.4
       os: linux
       if: branch = master
+    - env: SCRIPT=test CLANG=3.5
+      os: linux
+      if: branch = master
 ####################################################
 #       commented for minimaze build
 #
-#   - env: SCRIPT=test CLANG=3.5
-#     os: linux
-#     # if: branch = master
 #   - env: SCRIPT=test CLANG=3.6
 #     os: linux
 #     if: branch = master
@@ -38,8 +38,7 @@ matrix:
 ####################################################
     - env: SCRIPT=test CLANG=7
       os: linux
-      if: branch = master
-    # lint checking
+####### lint checking ########
     - env: SCRIPT=lint CLANG=3.9
       os: linux
 
diff --git a/README.md b/README.md
index 3d820b2..e1fb7cd 100644
--- a/README.md
+++ b/README.md
@@ -203,7 +203,7 @@ int main() {
 	int *i6 = i5 + 1   ; a(i6); b(i6,1);
 	
 	// pointer arithmetic
-	int *i7 = 1 + 0+ i5; a(i7); b(i7,1);
+	int *i7 = 1 + 0 + i5 + 0; a(i7); b(i7,1);
 
 	return 0;
 }
@@ -253,11 +253,11 @@ func main() {
 	// C-pointer from array
 	a(i5)
 	b(i5, 1)
-	var i6 []int32 = i5[1:]
+	var i6 []int32 = (*[100000000]int32)(unsafe.Pointer(&i5[0+1]))[:]
 	// pointer arithmetic
 	a(i6)
 	b(i6, 1)
-	var i7 []int32 = (*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:]
+	var i7 []int32 = (*[100000000]int32)(unsafe.Pointer(&i5[1+0+0+0]))[:]
 	// pointer arithmetic
 	a(i7)
 	b(i7, 1)
diff --git a/examples/ap.c b/examples/ap.c
index 5db35df..2c1e37f 100644
--- a/examples/ap.c
+++ b/examples/ap.c
@@ -28,7 +28,7 @@ int main() {
 	int *i6 = i5 + 1   ; a(i6); b(i6,1);
 	
 	// pointer arithmetic
-	int *i7 = 1 + 0+ i5; a(i7); b(i7,1);
+	int *i7 = 1 + 0 + i5 + 0; a(i7); b(i7,1);
 
 	return 0;
 }
diff --git a/transpiler/binary.go b/transpiler/binary.go
index 268c603..d269e8f 100644
--- a/transpiler/binary.go
+++ b/transpiler/binary.go
@@ -226,6 +226,68 @@ func transpileBinaryOperator(n *ast.BinaryOperator, p *program.Program, exprIsSt
 		return stmts, st, preStmts, postStmts, nil
 	}
 
+	// pointer arithmetic
+	if util.IsPointer(n.Type) {
+		if operator == token.ADD || // +
+			false {
+
+			// not acceptable binaryOperator with operator `-`
+			haveSub := false
+			{
+				var check func(ast.Node)
+				check = func(node ast.Node) {
+					if node == nil {
+						return
+					}
+					if bin, ok := node.(*ast.BinaryOperator); ok && bin.Operator == "-" {
+						haveSub = true
+					}
+					for i := range node.Children() {
+						check(node.Children()[i])
+					}
+				}
+				check(n)
+			}
+
+			if !haveSub {
+				var def string
+				def, err = types.GetDereferenceType(n.Type)
+				if err != nil {
+					return
+				}
+
+				fakeUnary := &ast.UnaryOperator{
+					Type:     n.Type,
+					Operator: "&",
+					ChildNodes: []ast.Node{
+						&ast.UnaryOperator{
+							Type:     def,
+							Operator: "*",
+							ChildNodes: []ast.Node{
+								n,
+							},
+						},
+					},
+				}
+
+				var newPre, newPost []goast.Stmt
+				expr, eType, newPre, newPost, err =
+					transpileUnaryOperator(fakeUnary, p)
+
+				if err != nil {
+					return
+				}
+				if expr == nil {
+					return nil, "", nil, nil, fmt.Errorf("Expr is nil")
+				}
+				preStmts, postStmts =
+					combinePreAndPostStmts(preStmts, postStmts, newPre, newPost)
+
+				return
+			}
+		}
+	}
+
 	left, leftType, newPre, newPost, err := atomicOperation(n.Children()[0], p)
 	if err != nil {
 		err = fmt.Errorf("cannot atomic for left part. %v", err)
diff --git a/transpiler/unary.go b/transpiler/unary.go
index 2cc1bf5..8021275 100644
--- a/transpiler/unary.go
+++ b/transpiler/unary.go
@@ -291,195 +291,186 @@ func transpileUnaryOperatorAmpersant(n *ast.UnaryOperator, p *program.Program) (
 	return
 }
 
-// transpilePointerArith - transpile pointer aripthmetic
-// Example of using:
-// *(t + 1) = ...
-func transpilePointerArith(n *ast.UnaryOperator, p *program.Program) (
-	expr goast.Expr, eType string, preStmts []goast.Stmt, postStmts []goast.Stmt, err error) {
-	// pointer - expression with name of array pointer
-	var pointer ast.Node
-
-	// locationPointer
-	var locPointer ast.Node
-	var locPosition int
-
-	// counter - count of amount of changes in AST tree
-	var counter int
-
-	var parents []ast.Node
-	var found bool
-
-	var f func(ast.Node)
-	f = func(n ast.Node) {
-		for i := range n.Children() {
-			state := func() {
-				counter++
-				if counter > 1 {
-					err = fmt.Errorf("Not acceptable :"+
-						" change counter is more then 1. found = %T,%T",
-						pointer, n.Children()[i])
-					return
-				}
-				// found pointer
-				pointer = n.Children()[i]
-				// Replace pointer to zero
-				var zero ast.IntegerLiteral
-				zero.Type = "int"
-				zero.Value = "0"
-				locPointer = n
-				locPosition = i
-				n.Children()[i] = &zero
-				found = true
+// pointerParts - separate to pointer and value.
+// 	* change type for all nodes to `int`
+//
+// BinaryOperator <col:13, col:57> 'int *' '-'
+// |-BinaryOperator <col:13, col:40> 'int *' '+'
+// | |-BinaryOperator <col:13, col:32> 'int *' '+'
+// | | |-BinaryOperator <col:13, col:21> 'int *' '+'
+// | | | |-BinaryOperator <col:13, col:17> 'int' '+'
+// | | | | |-IntegerLiteral <col:13> 'int' 1
+// | | | | `-IntegerLiteral <col:17> 'int' 0
+// | | | `-ImplicitCastExpr <col:21> 'int *' <LValueToRValue>
+// | | |   `-DeclRefExpr <col:21> 'int *' lvalue Var 0x29a91a8 'i5' 'int *'
+// | | `-BinaryOperator <col:26, col:32> 'long' '*'
+// | |   |-ImplicitCastExpr <col:26> 'long' <IntegralCast>
+// | |   | `-IntegerLiteral <col:26> 'int' 5
+// | |   `-CallExpr <col:28, col:32> 'long'
+// | |     `-ImplicitCastExpr <col:28> 'long (*)()' <FunctionToPointerDecay>
+// | |       `-DeclRefExpr <col:28> 'long ()' Function 0x29a8470 'get' 'long ()'
+// | `-CallExpr <col:36, col:40> 'long'
+// |   `-ImplicitCastExpr <col:36> 'long (*)()' <FunctionToPointerDecay>
+// |     `-DeclRefExpr <col:36> 'long ()' Function 0x29a8470 'get' 'long ()'
+// `-BinaryOperator <col:44, col:57> 'long' '*'
+//   |-ImplicitCastExpr <col:44, col:51> 'long' <IntegralCast>
+//   | `-ParenExpr <col:44, col:51> 'int'
+//   |   `-BinaryOperator <col:45, col:50> 'int' '+'
+//   |     |-IntegerLiteral <col:45> 'int' 12
+//   |     `-IntegerLiteral <col:50> 'int' 3
+//   `-CallExpr <col:53, col:57> 'long'
+//     `-ImplicitCastExpr <col:53> 'long (*)()' <FunctionToPointerDecay>
+//       `-DeclRefExpr <col:53> 'long ()' Function 0x29a8470 'get' 'long ()'
+//
+// ParenExpr <col:25, col:31> 'char *'
+// `-UnaryOperator <col:26, col:29> 'char *' postfix '++'
+//   `-DeclRefExpr <col:26> 'char *' lvalue Var 0x3c05ae8 'pos' 'char *'
+//
+func pointerParts(node *ast.Node, p *program.Program) (
+	pnt ast.Node, value ast.Node, back func(), err error) {
+	defer func() {
+		if err != nil {
+			err = fmt.Errorf("Cannot pointerParts: err = %v", err)
+			if (*node) != nil {
+				err = fmt.Errorf("Code line: %d. %v", (*node).Position().Line, err)
 			}
+		}
+	}()
 
-			switch v := n.Children()[i].(type) {
-			case *ast.ArraySubscriptExpr,
-				*ast.UnaryOperator,
-				*ast.VAArgExpr,
-				*ast.DeclRefExpr:
-				state()
-				return
-
-			case *ast.CStyleCastExpr:
-				if v.Type == "int" {
-					continue
-				}
-				state()
-				return
+	var counter int
 
-			case *ast.MemberExpr:
-				// check - if member of union
-				a := n.Children()[i]
-				var isUnion bool
-				for {
-					if a == nil {
-						break
-					}
-					if len(a.Children()) == 0 {
-						break
-					}
-					switch vv := a.Children()[0].(type) {
-					case *ast.MemberExpr, *ast.DeclRefExpr:
-						var typeVV string
-						switch vt := vv.(type) {
-						case *ast.MemberExpr:
-							typeVV = vt.Type
-						case *ast.DeclRefExpr:
-							typeVV = vt.Type
-						}
-						typeVV = types.GetBaseType(typeVV)
-
-						if _, ok := p.Structs[typeVV]; ok {
-							isUnion = true
-						}
-						if _, ok := p.Structs["struct "+typeVV]; ok {
-							isUnion = true
-						}
-						if strings.HasPrefix(typeVV, "union ") || strings.HasPrefix(typeVV, "struct ") {
-							isUnion = true
-						}
-						if isUnion {
-							break
-						}
-						a = vv
-						continue
-					case *ast.ImplicitCastExpr, *ast.CStyleCastExpr,
-						*ast.ArraySubscriptExpr:
-						a = vv
-						continue
-					}
-					break
-				}
-				if isUnion {
-					state()
-					return
-				}
-				// member of struct
-				f(v)
+	var lastNode *ast.Node
 
-			case *ast.CallExpr:
-				if v.Type == "int" {
-					continue
-				}
-				state()
-				return
+	// replacer zero
+	zero := &ast.IntegerLiteral{Type: "int", Value: "0"}
 
+	var baseTypes []*string
+	var searcher func(*ast.Node) bool
+	replacer := func(node *ast.Node) {
+		pnt = *node
+		lastNode = node
+		*node = zero
+		counter++
+	}
+	searcher = func(node *ast.Node) (modify bool) {
+		// save types of all nodes
+		t, ok := ast.GetTypeIfExist(*node)
+		if !ok {
+			panic(fmt.Errorf("Not support parent type %T in pointer seaching", node))
+		}
+		baseTypes = append(baseTypes, t)
+
+		// find
+		if util.IsCPointer(*t) || util.IsCArray(*t) {
+			switch (*node).(type) {
+			case *ast.BinaryOperator,
+				*ast.ImplicitCastExpr,
+				*ast.ParenExpr:
+				// go deeper
 			default:
-				if found {
-					break
-				}
-				if len(v.Children()) > 0 {
-					if found {
-						break
-					}
-					parents = append(parents, v)
-					deep := true
-					if vv, ok := v.(*ast.ImplicitCastExpr); ok && types.IsCInteger(p, vv.Type) {
-						deep = false
-					}
-					if vv, ok := v.(*ast.CStyleCastExpr); ok && types.IsCInteger(p, vv.Type) {
-						deep = false
-					}
-					if deep {
-						f(v)
-					}
-					if !found {
-						parents = parents[:len(parents)-1]
-					}
-				}
+				return true
 			}
+		} else {
+			// type is not pointer
+			switch (*node).(type) {
+			case *ast.CallExpr,
+				*ast.CStyleCastExpr:
+				return
+			}
+		}
+		switch (*node).(type) {
+		case *ast.UnaryOperator:
+			baseTypes = baseTypes[:len(baseTypes)-1]
+			return
 		}
+		for i := range (*node).Children() {
+			if searcher(&((*node).Children()[i])) {
+				replacer(&((*node).Children()[i]))
+			}
+		}
+		return false
+	}
+	if searcher(node) {
+		pnt = *node
+		lastNode = node
+		*node = zero
+		counter++
 	}
-	f(n)
 
-	if err != nil {
+	if counter != 1 {
+		err = fmt.Errorf("counter is not 1: %d", counter)
 		return
 	}
-
-	if pointer == nil {
+	if pnt == nil {
 		err = fmt.Errorf("pointer is nil")
 		return
 	}
 
-	defer func() {
-		if pointer != nil && locPointer != nil {
-			locPointer.Children()[locPosition] = pointer.(ast.Node)
+	copyTypes := make([]string, len(baseTypes))
+	for i := range baseTypes {
+		copyTypes[i] = *(baseTypes[i])
+	}
+	back = func() {
+		// return back types
+		for i := range baseTypes {
+			*(baseTypes[i]) = copyTypes[i]
 		}
-	}()
+		// return back node
+		*lastNode = pnt
+	}
 
-	var typesParentBefore []string
-	for i := range parents {
-		if t, ok := ast.GetTypeIfExist(parents[i]); ok {
-			typesParentBefore = append(typesParentBefore, *t)
-			*t = "int"
-		} else {
-			panic(fmt.Errorf("Not support parent type %T in pointer seaching", parents[i]))
-		}
+	// replace all types to `int`
+	for i := range baseTypes {
+		*baseTypes[i] = `int`
 	}
+
+	value = *node
+
+	return
+}
+
+// transpilePointerArith - transpile pointer aripthmetic
+// Example of using:
+// *(t + 1) = ...
+func transpilePointerArith(n *ast.UnaryOperator, p *program.Program) (
+	expr goast.Expr, eType string, preStmts []goast.Stmt, postStmts []goast.Stmt, err error) {
 	defer func() {
-		for i := range parents {
-			if t, ok := ast.GetTypeIfExist(parents[i]); ok {
-				*t = typesParentBefore[i]
-			} else {
-				panic(fmt.Errorf("Not support parent type %T in pointer seaching", parents[i]))
-			}
+		if err != nil {
+			err = fmt.Errorf("Cannot transpilePointerArith: err = %v", err)
 		}
 	}()
 
-	e, eType, newPre, newPost, err := transpileToExpr(n.Children()[0], p, false)
+	if n.Operator != "*" {
+		err = fmt.Errorf("not valid operator : %s", n.Operator)
+		return
+	}
+
+	var pnt, value ast.Node
+	var back func()
+	pnt, value, back, err = pointerParts(&(n.Children()[0]), p)
+	if err != nil {
+		return
+	}
+
+	e, eType, newPre, newPost, err := atomicOperation(value, p)
 	if err != nil {
 		return
 	}
 	preStmts, postStmts = combinePreAndPostStmts(preStmts, postStmts, newPre, newPost)
 	eType = n.Type
 
-	switch v := pointer.(type) {
+	// return all types
+	back()
+
+	arr, arrType, newPre, newPost, err := atomicOperation(pnt, p)
+	if err != nil {
+		return
+	}
+	_ = arrType
+	preStmts, postStmts = combinePreAndPostStmts(preStmts, postStmts, newPre, newPost)
+
+	switch v := pnt.(type) {
 	case *ast.MemberExpr:
-		arr, _, newPre, newPost, err2 := transpileToExpr(v, p, false)
-		if err2 != nil {
-			return
-		}
-		preStmts, postStmts = combinePreAndPostStmts(preStmts, postStmts, newPre, newPost)
 		return &goast.IndexExpr{
 			X:     arr,
 			Index: e,
@@ -492,25 +483,15 @@ func transpilePointerArith(n *ast.UnaryOperator, p *program.Program) (
 		}, eType, preStmts, postStmts, err
 
 	case *ast.CStyleCastExpr, *ast.VAArgExpr, *ast.CallExpr, *ast.ArraySubscriptExpr:
-		arr, _, newPre, newPost, err2 := transpileToExpr(v, p, false)
-		if err2 != nil {
-			return
-		}
-		preStmts, postStmts = combinePreAndPostStmts(preStmts, postStmts, newPre, newPost)
 		return &goast.IndexExpr{
 			X: &goast.ParenExpr{
-				Lparen: 1,
 				X:      arr,
+				Lparen: 1,
 			},
 			Index: e,
 		}, eType, preStmts, postStmts, err
 
 	case *ast.UnaryOperator:
-		arr, _, newPre, newPost, err2 := atomicOperation(v, p)
-		if err2 != nil {
-			return
-		}
-		preStmts, postStmts = combinePreAndPostStmts(preStmts, postStmts, newPre, newPost)
 		if memberName, ok := getMemberName(n.Children()[0]); ok {
 			return &goast.IndexExpr{
 				X: &goast.SelectorExpr{
@@ -532,7 +513,7 @@ func transpilePointerArith(n *ast.UnaryOperator, p *program.Program) (
 		}, eType, preStmts, postStmts, err
 
 	}
-	return nil, "", nil, nil, fmt.Errorf("Cannot found : %#v", pointer)
+	return nil, "", nil, nil, fmt.Errorf("Cannot found : %#v", pnt)
 }
 
 func transpileUnaryOperator(n *ast.UnaryOperator, p *program.Program) (


Test patch:
diff --git a/tests/code_quality/ap.c b/tests/code_quality/ap.c
index 67a8a2c..0a66cff 100644
--- a/tests/code_quality/ap.c
+++ b/tests/code_quality/ap.c
@@ -30,15 +30,22 @@ int main() {
 
 	// pointer arithmetic
 	int *i6 = i5 + 1   ; a(i6); b(i6,1);
+
+	// pointer arithmetic
+	int val = 2-2;
+	int *i7 = 1 + (1 - 1) + val + 0*(100-2) + i5 + 0 - 0*0; a(i7); b(i7,1);
+	
+	// pointer arithmetic
+	int *i8 = i5 + 1 + 0 ; a(i8); b(i8,1);
 	
 	// pointer arithmetic
-	int *i7 = 1 + 0+ i5; a(i7); b(i7,1);
+	int i9[] = {*i3, *(i3+1)} ; a(i9); b(i9,1);
 
 	// pointer arithmetic
-	int *i8 = 1 + 0 + i5 + 5*get() + get() + (12 + 3)*get(); a(i8); b(i8,1);
+	int *i10 = 1 + 0 + i5 + 5*get() + get() + (12 + 3)*get(); a(i10); b(i10,1);
 
 	// pointer arithmetic
-	int *i9 = 1 + 0 + i5 + 5*get() + get() - (12 + 3)*get(); a(i9); b(i9,1);
+	int *i11 = 1 + 0 + i5 + 5*get() + get() - (12 + 3)*get(); a(i11); b(i11,1);
 
 	return 0;
 }
diff --git a/tests/code_quality/ap.expected.c b/tests/code_quality/ap.expected.c
index d763085..1b3c33d 100644
--- a/tests/code_quality/ap.expected.c
+++ b/tests/code_quality/ap.expected.c
@@ -53,21 +53,30 @@ func main() {
 	// C-pointer from array
 	a(i5)
 	b(i5, 1)
-	var i6 []int32 = i5[1:]
+	var i6 []int32 = (*[100000000]int32)(unsafe.Pointer(&i5[0+1]))[:]
 	// pointer arithmetic
 	a(i6)
 	b(i6, 1)
-	var i7 []int32 = (*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:]
+	var val int32 = 2 - 2
+	var i7 []int32 = (*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+(1-1)+val+0*(100-2))*unsafe.Sizeof(i5[0]))))[:][0])) + (uintptr)(0)*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+(1-1)+val+0*(100-2))*unsafe.Sizeof(i5[0]))))[:][0]))))[:][0])) - (uintptr)(0*0)*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+(1-1)+val+0*(100-2))*unsafe.Sizeof(i5[0]))))[:][0])) + (uintptr)(0)*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+(1-1)+val+0*(100-2))*unsafe.Sizeof(i5[0]))))[:][0]))))[:][0]))))[:]
 	// pointer arithmetic
 	a(i7)
 	b(i7, 1)
-	var i8 []int32 = (*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0])) + (uintptr)(5*get())*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0]))))[:][0])) + (uintptr)(get())*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0])) + (uintptr)(5*get())*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0]))))[:][0]))))[:][0])) + (uintptr)((12+3)*get())*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0])) + (uintptr)(5*get())*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0]))))[:][0])) + (uintptr)(get())*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0])) + (uintptr)(5*get())*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0]))))[:][0]))))[:][0]))))[:]
+	var i8 []int32 = (*[100000000]int32)(unsafe.Pointer(&i5[0+1+0]))[:]
 	// pointer arithmetic
 	a(i8)
 	b(i8, 1)
-	var i9 []int32 = (*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0])) + (uintptr)(5*get())*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0]))))[:][0])) + (uintptr)(get())*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0])) + (uintptr)(5*get())*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0]))))[:][0]))))[:][0])) - (uintptr)((12+3)*get())*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0])) + (uintptr)(5*get())*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0]))))[:][0])) + (uintptr)(get())*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0])) + (uintptr)(5*get())*unsafe.Sizeof((*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&i5[0])) + (uintptr)(1+0)*unsafe.Sizeof(i5[0]))))[:][0]))))[:][0]))))[:][0]))))[:]
+	var i9 []int32 = []int32{i3[0], i3[(0 + 1)]}
 	// pointer arithmetic
 	a(i9)
 	b(i9, 1)
+	var i10 []int32 = (*[100000000]int32)(unsafe.Pointer(&i5[1+0+0+5*get()+get()+(12+3)*get()]))[:]
+	// pointer arithmetic
+	a(i10)
+	b(i10, 1)
+	var i11 []int32 = (*(*[1000000000]int32)(unsafe.Pointer(uintptr(unsafe.Pointer(&(*[100000000]int32)(unsafe.Pointer(&i5[1+0+0+5*get()+get()]))[:][0])) - (uintptr)((12+3)*get())*unsafe.Sizeof((*[100000000]int32)(unsafe.Pointer(&i5[1+0+0+5*get()+get()]))[:][0]))))[:]
+	// pointer arithmetic
+	a(i11)
+	b(i11, 1)
 	return
 }