#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ scanf(char *, int *, ...);
void getInput(int *width, int *heigth, int ***bitmap, int **startPoint,
              int **exitPoint) {
  int i, j;
  int sx, sy, ex, ey;
  int tWidth, tHeigth;
  int *tExitPoint;
  int *tStartPoint;
  int **tBitmap;
  scanf("%i", &tWidth);
  scanf("%i", &tHeigth);
  tBitmap = (int **)malloc(tHeigth * sizeof(int *));
  for (i = 0; i < tHeigth; i++) {
    tBitmap[i] = (int *)malloc(tWidth * sizeof(int));
    for (j = 0; j < tWidth; j++)
      scanf("%i", &tBitmap[i][j]);
  }
  scanf("%i%i", &ex, &ey);
  scanf("%i%i", &sx, &sy);
  tExitPoint = (int *)malloc(2 * sizeof(int));
  tExitPoint[1] = ex;
  tExitPoint[0] = ey;
  tStartPoint = (int *)malloc(2 * sizeof(int));
  tStartPoint[1] = sx;
  tStartPoint[0] = sy;
  *width = tWidth;
  *heigth = tHeigth;
  *startPoint = tStartPoint;
  *exitPoint = tExitPoint;
  *bitmap = tBitmap;
}


x86 assembly (clang, -O0):
<getInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xebf(%rip),%rdi
lea    -0x44(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xead(%rip),%rdi
lea    -0x48(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movslq -0x48(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    11fd <getInput+0xdd>
movslq -0x44(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rdx
mov    -0x60(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    11ea <getInput+0xca>
mov    -0x60(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
movslq -0x30(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11ab <getInput+0x8b>
jmp    11ef <getInput+0xcf>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    117a <getInput+0x5a>
lea    0xdfc(%rip),%rdi
lea    -0x3c(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xde6(%rip),%rdi
lea    -0x34(%rbp),%rsi
lea    -0x38(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x3c(%rbp),%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x40(%rbp),%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x34(%rbp),%ecx
mov    -0x58(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x38(%rbp),%ecx
mov    -0x58(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x44(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x48(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x58(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x50(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x60(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInput>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8,0x30(%rsp)
mov    %rcx,0x20(%rsp)
mov    %rdx,0x28(%rsp)
mov    %rsi,0x18(%rsp)
mov    %rdi,%r15
lea    0xeb6(%rip),%rbp
mov    %rsp,%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
shl    $0x3,%edi
call   1030 <malloc@plt>
mov    %rax,%rbp
cmpl   $0x0,0x4(%rsp)
jle    1205 <getInput+0xe5>
mov    (%rsp),%edi
lea    0xe76(%rip),%r14
xor    %ebx,%ebx
jmp    119e <getInput+0x7e>
add    $0x1,%rbx
movslq 0x4(%rsp),%rax
cmp    %rax,%rbx
jge    1205 <getInput+0xe5>
shl    $0x2,%edi
call   1030 <malloc@plt>
mov    %rax,0x0(%rbp,%rbx,8)
mov    (%rsp),%edi
test   %edi,%edi
jle    1190 <getInput+0x70>
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    (%rsp),%edi
cmp    $0x2,%edi
jl     1190 <getInput+0x70>
mov    $0x1,%r12d
mov    $0x4,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x0(%rbp,%rbx,8),%rsi
add    %r13,%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x1,%r12
movslq (%rsp),%rdi
add    $0x4,%r13
cmp    %rdi,%r12
jl     11e0 <getInput+0xc0>
jmp    1190 <getInput+0x70>
lea    0xdf4(%rip),%rbx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%eax
mov    %eax,0x4(%rbx)
mov    0x8(%rsp),%eax
mov    %eax,(%rbx)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    0x14(%rsp),%ecx
mov    %ecx,0x4(%rax)
mov    0x10(%rsp),%ecx
mov    %ecx,(%rax)
mov    (%rsp),%ecx
mov    %ecx,(%r15)
mov    0x4(%rsp),%ecx
mov    0x18(%rsp),%rdx
mov    %ecx,(%rdx)
mov    0x20(%rsp),%rcx
mov    %rax,(%rcx)
mov    0x30(%rsp),%rax
mov    %rbx,(%rax)
mov    0x28(%rsp),%rax
mov    %rbp,(%rax)
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [5 x i8] c"%i%i\00"
define void @getInput(i32* %0, i32* %1, i32*** %2, i32** %3, i32** %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32***
%9 = alloca i32**
%10 = alloca i32**
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32*
%20 = alloca i32*
%21 = alloca i32**
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32*** %2, i32**** %8
store i32** %3, i32*** %9
store i32** %4, i32*** %10
%22 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%23 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
%24 = load i32, i32* %18
%25 = sext i32 %24 to i64
%26 = mul i64 %25, 8
%27 = trunc i64 %26 to i32
%28 = call i64 @malloc(i32 %27)
%29 = inttoptr i64 %28 to i32**
store i32** %29, i32*** %21
store i32 0, i32* %11
br label %30
30: ; preds = %63, %5
%31 = load i32, i32* %11
%32 = load i32, i32* %18
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %66
34: ; preds = %30
%35 = load i32, i32* %17
%36 = sext i32 %35 to i64
%37 = mul i64 %36, 4
%38 = trunc i64 %37 to i32
%39 = call i64 @malloc(i32 %38)
%40 = inttoptr i64 %39 to i32*
%41 = load i32**, i32*** %21
%42 = load i32, i32* %11
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i32*, i32** %41, i64 %43
store i32* %40, i32** %44
store i32 0, i32* %12
br label %45
45: ; preds = %59, %34
%46 = load i32, i32* %12
%47 = load i32, i32* %17
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %62
49: ; preds = %45
%50 = load i32**, i32*** %21
%51 = load i32, i32* %11
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i32*, i32** %50, i64 %52
%54 = load i32*, i32** %53
%55 = load i32, i32* %12
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32, i32* %54, i64 %56
%58 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %57)
br label %59
59: ; preds = %49
%60 = load i32, i32* %12
%61 = add nsw i32 %60, 1
store i32 %61, i32* %12
br label %45
62: ; preds = %45
br label %63
63: ; preds = %62
%64 = load i32, i32* %11
%65 = add nsw i32 %64, 1
store i32 %65, i32* %11
br label %30
66: ; preds = %30
%67 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %15, i32* %16)
%68 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %13, i32* %14)
%69 = call i64 @malloc(i32 8)
%70 = inttoptr i64 %69 to i32*
store i32* %70, i32** %19
%71 = load i32, i32* %15
%72 = load i32*, i32** %19
%73 = getelementptr inbounds i32, i32* %72, i64 1
store i32 %71, i32* %73
%74 = load i32, i32* %16
%75 = load i32*, i32** %19
%76 = getelementptr inbounds i32, i32* %75, i64 0
store i32 %74, i32* %76
%77 = call i64 @malloc(i32 8)
%78 = inttoptr i64 %77 to i32*
store i32* %78, i32** %20
%79 = load i32, i32* %13
%80 = load i32*, i32** %20
%81 = getelementptr inbounds i32, i32* %80, i64 1
store i32 %79, i32* %81
%82 = load i32, i32* %14
%83 = load i32*, i32** %20
%84 = getelementptr inbounds i32, i32* %83, i64 0
store i32 %82, i32* %84
%85 = load i32, i32* %17
%86 = load i32*, i32** %6
store i32 %85, i32* %86
%87 = load i32, i32* %18
%88 = load i32*, i32** %7
store i32 %87, i32* %88
%89 = load i32*, i32** %20
%90 = load i32**, i32*** %9
store i32* %89, i32** %90
%91 = load i32*, i32** %19
%92 = load i32**, i32*** %10
store i32* %91, i32** %92
%93 = load i32**, i32*** %21
%94 = load i32***, i32**** %8
store i32** %93, i32*** %94
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [5 x i8] c"%i%i\00"
define void @getInput(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32*** nocapture writeonly %2, i32** nocapture writeonly %3, i32** nocapture writeonly %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = bitcast i32* %8 to i8*
%15 = bitcast i32* %9 to i8*
%16 = bitcast i32* %10 to i8*
%17 = bitcast i32* %11 to i8*
%18 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %10)
%19 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%20 = load i32, i32* %11
%21 = shl i32 %20, 3
%22 = call i64 @malloc(i32 %21)
%23 = inttoptr i64 %22 to i32**
%24 = load i32, i32* %11
%25 = icmp sgt i32 %24, 0
br i1 %25, label %26, label %56
26: ; preds = %5
%27 = load i32, i32* %10
br label %28
28: ; preds = %26, %50
%29 = phi i32 [ %27, %26 ], [ %51, %50 ]
%30 = phi i64 [ 0, %26 ], [ %52, %50 ]
%31 = shl i32 %29, 2
%32 = call i64 @malloc(i32 %31)
%33 = inttoptr i64 %32 to i32*
%34 = getelementptr inbounds i32*, i32** %23, i64 %30
store i32* %33, i32** %34
%35 = load i32, i32* %10
%36 = icmp sgt i32 %35, 0
br i1 %36, label %37, label %50
37: ; preds = %28
%38 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %33)
%39 = load i32, i32* %10
%40 = icmp sgt i32 %39, 1
br i1 %40, label %41, label %50
41: ; preds = %37, %41
%42 = phi i64 [ %46, %41 ], [ 1, %37 ]
%43 = load i32*, i32** %34
%44 = getelementptr inbounds i32, i32* %43, i64 %42
%45 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %44)
%46 = add nuw nsw i64 %42, 1
%47 = load i32, i32* %10
%48 = sext i32 %47 to i64
%49 = icmp slt i64 %46, %48
br i1 %49, label %41, label %50
50: ; preds = %41, %37, %28
%51 = phi i32 [ %35, %28 ], [ %39, %37 ], [ %47, %41 ]
%52 = add nuw nsw i64 %30, 1
%53 = load i32, i32* %11
%54 = sext i32 %53 to i64
%55 = icmp slt i64 %52, %54
br i1 %55, label %28, label %56
56: ; preds = %50, %5
%57 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %8, i32* %9)
%58 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7)
%59 = call i64 @malloc(i32 8)
%60 = inttoptr i64 %59 to i32*
%61 = load i32, i32* %8
%62 = getelementptr inbounds i32, i32* %60, i64 1
store i32 %61, i32* %62
%63 = load i32, i32* %9
store i32 %63, i32* %60
%64 = call i64 @malloc(i32 8)
%65 = inttoptr i64 %64 to i32*
%66 = load i32, i32* %6
%67 = getelementptr inbounds i32, i32* %65, i64 1
store i32 %66, i32* %67
%68 = load i32, i32* %7
store i32 %68, i32* %65
%69 = load i32, i32* %10
store i32 %69, i32* %0
%70 = load i32, i32* %11
store i32 %70, i32* %1
store i32* %65, i32** %3
store i32* %60, i32** %4
store i32** %23, i32*** %2
ret void
}