#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 */
int findNumber(int **, int *, int *, int);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, const char *argv[]) {
  int row = 3;
  int col = 3;
  int matrix[4][4] = {
      {1, 2, 8, 9}, {2, 4, 9, 12}, {4, 7, 10, 13}, {6, 8, 11, 15}};
  int result = findNumber(matrix, &row, &col, 7);
  printf("%d,%d\n", row, col);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xea1(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x7,%ecx
call   1050 <findNumber@plt>
mov    %eax,-0x64(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movl   $0x3,0xc(%rsp)
movl   $0x3,0x8(%rsp)
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xea1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    $0x7,%ecx
call   1040 <findNumber@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.matrix = [4 x [4 x i32]] [[4 x i32] [i32 1, i32 2, i32 8, i32 9], [4 x i32] [i32 2, i32 4, i32 9, i32 12], [4 x i32] [i32 4, i32 7, i32 10, i32 13], [4 x i32] [i32 6, i32 8, i32 11, i32 15]]
@.str = [7 x i8] c"%d,%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [4 x [4 x i32]]
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 3, i32* %6
store i32 3, i32* %7
%10 = bitcast [4 x [4 x i32]]* %8 to i8*
%11 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %8, i64 0, i64 0
%12 = bitcast [4 x i32]* %11 to i32**
%13 = call i32 @findNumber(i32** %12, i32* %6, i32* %7, i32 7)
store i32 %13, i32* %9
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@__const.main.matrix = [4 x [4 x i32]] [[4 x i32] [i32 1, i32 2, i32 8, i32 9], [4 x i32] [i32 2, i32 4, i32 9, i32 12], [4 x i32] [i32 4, i32 7, i32 10, i32 13], [4 x i32] [i32 6, i32 8, i32 11, i32 15]]
@.str = [7 x i8] c"%d,%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x [4 x i32]]
%6 = bitcast i32* %3 to i8*
store i32 3, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 3, i32* %4
%8 = bitcast [4 x [4 x i32]]* %5 to i8*
%9 = bitcast [4 x [4 x i32]]* %5 to i32**
%10 = call i32 @findNumber(i32** %9, i32* %3, i32* %4, i32 7)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
ret i32 0
}