#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 /*<<< orphan*/ get_diff(int const, double const *, double, double *, int *,
                            int *);
int /*<<< orphan*/ print_diffmat(int const, double const *, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main(int argc, char *argv[]) {
  const int N = 8;
  const double a[] = {0.0, 27.2, 30.1, 97.9, 102.4, 190.9, 200.5, 210.3};
  print_diffmat(N, a, 0.0);
  double diff;
  printf("Enter the float number you wish to search:\n");
  scanf("%lf", &diff);
  print_diffmat(N, a, diff);
  int row, col;
  double val;
  get_diff(N, a, diff, &val, &row, &col);
  printf("  [%4d,%4d](%8.1lf)\n", row, col, val);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xe85(%rip),%rsi
mov    $0x40,%edx
call   1060 <memcpy@plt>
lea    -0x60(%rbp),%rsi
mov    $0x8,%edi
xorps  %xmm0,%xmm0
call   1040 <print_diffmat@plt>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x68(%rbp),%rsi
call   1070 <scanf@plt>
lea    -0x60(%rbp),%rsi
movsd  -0x68(%rbp),%xmm0
mov    $0x8,%edi
call   1040 <print_diffmat@plt>
lea    -0x60(%rbp),%rsi
movsd  -0x68(%rbp),%xmm0
mov    $0x8,%edi
lea    -0x78(%rbp),%rdx
lea    -0x6c(%rbp),%rcx
lea    -0x70(%rbp),%r8
call   1030 <get_diff@plt>
mov    -0x6c(%rbp),%esi
mov    -0x70(%rbp),%edx
movsd  -0x78(%rbp),%xmm0
lea    0xe78(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe9c(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe80(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x20(%rsp),%rbx
xorps  %xmm0,%xmm0
mov    $0x8,%edi
mov    %rbx,%rsi
call   1040 <print_diffmat@plt>
lea    0xeb8(%rip),%rdi
call   1050 <puts@plt>
lea    0xe93(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1070 <scanf@plt>
movsd  0x10(%rsp),%xmm0
mov    $0x8,%edi
mov    %rbx,%rsi
call   1040 <print_diffmat@plt>
movsd  0x10(%rsp),%xmm0
lea    0x18(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0x8,%edi
mov    %rbx,%rsi
call   1030 <get_diff@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
movsd  0x18(%rsp),%xmm0
lea    0xe43(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [8 x double] [double 0.000000e+00, double 2.720000e+01, double 3.010000e+01, double 9.790000e+01, double 1.024000e+02, double 1.909000e+02, double 2.005000e+02, double 2.103000e+02]
@.str = [44 x i8] c"Enter the float number you wish to search:\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [21 x i8] c" [%4d,%4d](%8.1lf)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [8 x double]
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 8, i32* %6
%12 = bitcast [8 x double]* %7 to i8*
%13 = getelementptr inbounds [8 x double], [8 x double]* %7, i64 0, i64 0
%14 = call i32 @print_diffmat(i32 8, double* %13, double 0.000000e+00)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %8)
%17 = getelementptr inbounds [8 x double], [8 x double]* %7, i64 0, i64 0
%18 = load double, double* %8
%19 = call i32 @print_diffmat(i32 8, double* %17, double %18)
%20 = getelementptr inbounds [8 x double], [8 x double]* %7, i64 0, i64 0
%21 = load double, double* %8
%22 = call i32 @get_diff(i32 8, double* %20, double %21, double* %11, i32* %9, i32* %10)
%23 = load i32, i32* %9
%24 = load i32, i32* %10
%25 = load double, double* %11
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %23, i32 %24, double %25)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [8 x double] [double 0.000000e+00, double 2.720000e+01, double 3.010000e+01, double 9.790000e+01, double 1.024000e+02, double 1.909000e+02, double 2.005000e+02, double 2.103000e+02]
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [21 x i8] c" [%4d,%4d](%8.1lf)\0A\00"
@str = [43 x i8] c"Enter the float number you wish to search:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x double]
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = bitcast [8 x double]* %3 to i8*
%9 = getelementptr inbounds [8 x double], [8 x double]* %3, i64 0, i64 0
%10 = call i32 @print_diffmat(i32 8, double* %9, double 0.000000e+00)
%11 = bitcast double* %4 to i8*
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%14 = load double, double* %4
%15 = call i32 @print_diffmat(i32 8, double* %9, double %14)
%16 = bitcast i32* %5 to i8*
%17 = bitcast i32* %6 to i8*
%18 = bitcast double* %7 to i8*
%19 = load double, double* %4
%20 = call i32 @get_diff(i32 8, double* %9, double %19, double* %7, i32* %5, i32* %6)
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = load double, double* %7
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %21, i32 %22, double %23)
ret i32 0
}