#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 */
double round(double);
void crop(double quant_coefficient_matrix[8][8]) {
  int i, j;
  for (i = 0; i < 8; i++) {
    for (j = 0; j < 8; j++) {
      if (quant_coefficient_matrix[i][j] < 0) {
        quant_coefficient_matrix[i][j] = 0;
      }
      if (quant_coefficient_matrix[i][j] > 255) {
        quant_coefficient_matrix[i][j] = 255;
      }
      quant_coefficient_matrix[i][j] = round(quant_coefficient_matrix[i][j]);
    }
  }
}


x86 assembly (clang, -O0):
<crop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    121a <crop+0x10a>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    1207 <crop+0xf7>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jbe    117a <crop+0x6a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xe66(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11c4 <crop+0xb4>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  0xe41(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <round@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <crop+0x24>
jmp    120c <crop+0xfc>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <crop+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crop>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
jmp    113d <crop+0x2d>
nopl   0x0(%rax,%rax,1)
call   1030 <round@plt>
movsd  %xmm0,0x38(%r14,%rbx,1)
add    $0x40,%rbx
cmp    $0x200,%rbx
je     12e4 <crop+0x1d4>
movsd  (%r14,%rbx,1),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
xorpd  %xmm0,%xmm0
ja     1167 <crop+0x57>
ucomisd 0xea7(%rip),%xmm1
movapd %xmm1,%xmm0
jbe    1167 <crop+0x57>
movsd  0xe99(%rip),%xmm0
call   1030 <round@plt>
movsd  %xmm0,(%r14,%rbx,1)
movsd  0x8(%r14,%rbx,1),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     1199 <crop+0x89>
ucomisd 0xe75(%rip),%xmm1
movapd %xmm1,%xmm0
jbe    1199 <crop+0x89>
movsd  0xe67(%rip),%xmm0
call   1030 <round@plt>
movsd  %xmm0,0x8(%r14,%rbx,1)
movsd  0x10(%r14,%rbx,1),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
xorpd  %xmm0,%xmm0
ja     11d0 <crop+0xc0>
ucomisd 0xe3e(%rip),%xmm1
movapd %xmm1,%xmm0
jbe    11d0 <crop+0xc0>
movsd  0xe30(%rip),%xmm0
call   1030 <round@plt>
movsd  %xmm0,0x10(%r14,%rbx,1)
movsd  0x18(%r14,%rbx,1),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     1203 <crop+0xf3>
ucomisd 0xe0b(%rip),%xmm1
movapd %xmm1,%xmm0
jbe    1203 <crop+0xf3>
movsd  0xdfd(%rip),%xmm0
call   1030 <round@plt>
movsd  %xmm0,0x18(%r14,%rbx,1)
movsd  0x20(%r14,%rbx,1),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
xorpd  %xmm0,%xmm0
ja     123a <crop+0x12a>
ucomisd 0xdd4(%rip),%xmm1
movapd %xmm1,%xmm0
jbe    123a <crop+0x12a>
movsd  0xdc6(%rip),%xmm0
call   1030 <round@plt>
movsd  %xmm0,0x20(%r14,%rbx,1)
movsd  0x28(%r14,%rbx,1),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     126d <crop+0x15d>
ucomisd 0xda1(%rip),%xmm1
movapd %xmm1,%xmm0
jbe    126d <crop+0x15d>
movsd  0xd93(%rip),%xmm0
call   1030 <round@plt>
movsd  %xmm0,0x28(%r14,%rbx,1)
movsd  0x30(%r14,%rbx,1),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
xorpd  %xmm0,%xmm0
ja     12a4 <crop+0x194>
ucomisd 0xd6a(%rip),%xmm1
movapd %xmm1,%xmm0
jbe    12a4 <crop+0x194>
movsd  0xd5c(%rip),%xmm0
call   1030 <round@plt>
movsd  %xmm0,0x30(%r14,%rbx,1)
movsd  0x38(%r14,%rbx,1),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     1120 <crop+0x10>
ucomisd 0xd33(%rip),%xmm1
movapd %xmm1,%xmm0
jbe    1120 <crop+0x10>
movsd  0xd21(%rip),%xmm0
jmp    1120 <crop+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @crop([8 x double]* %0) {
%2 = alloca [8 x double]*
%3 = alloca i32
%4 = alloca i32
store [8 x double]* %0, [8 x double]** %2
store i32 0, i32* %3
br label %5
5: ; preds = %69, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %72
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %65, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 8
br i1 %11, label %12, label %68
12: ; preds = %9
%13 = load [8 x double]*, [8 x double]** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [8 x double], [8 x double]* %13, i64 %15
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [8 x double], [8 x double]* %16, i64 0, i64 %18
%20 = load double, double* %19
%21 = fcmp olt double %20, 0.000000e+00
br i1 %21, label %22, label %30
22: ; preds = %12
%23 = load [8 x double]*, [8 x double]** %2
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [8 x double], [8 x double]* %23, i64 %25
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [8 x double], [8 x double]* %26, i64 0, i64 %28
store double 0.000000e+00, double* %29
br label %30
30: ; preds = %22, %12
%31 = load [8 x double]*, [8 x double]** %2
%32 = load i32, i32* %3
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [8 x double], [8 x double]* %31, i64 %33
%35 = load i32, i32* %4
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [8 x double], [8 x double]* %34, i64 0, i64 %36
%38 = load double, double* %37
%39 = fcmp ogt double %38, 2.550000e+02
br i1 %39, label %40, label %48
40: ; preds = %30
%41 = load [8 x double]*, [8 x double]** %2
%42 = load i32, i32* %3
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [8 x double], [8 x double]* %41, i64 %43
%45 = load i32, i32* %4
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [8 x double], [8 x double]* %44, i64 0, i64 %46
store double 2.550000e+02, double* %47
br label %48
48: ; preds = %40, %30
%49 = load [8 x double]*, [8 x double]** %2
%50 = load i32, i32* %3
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [8 x double], [8 x double]* %49, i64 %51
%53 = load i32, i32* %4
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [8 x double], [8 x double]* %52, i64 0, i64 %54
%56 = load double, double* %55
%57 = call double @llvm.round.f64(double %56)
%58 = load [8 x double]*, [8 x double]** %2
%59 = load i32, i32* %3
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [8 x double], [8 x double]* %58, i64 %60
%62 = load i32, i32* %4
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [8 x double], [8 x double]* %61, i64 0, i64 %63
store double %57, double* %64
br label %65
65: ; preds = %48
%66 = load i32, i32* %4
%67 = add nsw i32 %66, 1
store i32 %67, i32* %4
br label %9
68: ; preds = %9
br label %69
69: ; preds = %68
%70 = load i32, i32* %3
%71 = add nsw i32 %70, 1
store i32 %71, i32* %3
br label %5
72: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @crop([8 x double]* nocapture %0) {
br label %2
2: ; preds = %1, %73
%3 = phi i64 [ 0, %1 ], [ %76, %73 ]
%4 = getelementptr inbounds [8 x double], [8 x double]* %0, i64 %3, i64 0
%5 = load double, double* %4
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = fcmp ogt double %5, 2.550000e+02
br i1 %8, label %9, label %10
9: ; preds = %7
br label %10
10: ; preds = %2, %9, %7
%11 = phi double [ 2.550000e+02, %9 ], [ %5, %7 ], [ 0.000000e+00, %2 ]
%12 = tail call double @llvm.round.f64(double %11)
store double %12, double* %4
%13 = getelementptr inbounds [8 x double], [8 x double]* %0, i64 %3, i64 1
%14 = load double, double* %13
%15 = fcmp olt double %14, 0.000000e+00
br i1 %15, label %19, label %16
16: ; preds = %10
%17 = fcmp ogt double %14, 2.550000e+02
br i1 %17, label %18, label %19
18: ; preds = %16
br label %19
19: ; preds = %10, %18, %16
%20 = phi double [ 2.550000e+02, %18 ], [ %14, %16 ], [ 0.000000e+00, %10 ]
%21 = tail call double @llvm.round.f64(double %20)
store double %21, double* %13
%22 = getelementptr inbounds [8 x double], [8 x double]* %0, i64 %3, i64 2
%23 = load double, double* %22
%24 = fcmp olt double %23, 0.000000e+00
br i1 %24, label %28, label %25
25: ; preds = %19
%26 = fcmp ogt double %23, 2.550000e+02
br i1 %26, label %27, label %28
27: ; preds = %25
br label %28
28: ; preds = %19, %27, %25
%29 = phi double [ 2.550000e+02, %27 ], [ %23, %25 ], [ 0.000000e+00, %19 ]
%30 = tail call double @llvm.round.f64(double %29)
store double %30, double* %22
%31 = getelementptr inbounds [8 x double], [8 x double]* %0, i64 %3, i64 3
%32 = load double, double* %31
%33 = fcmp olt double %32, 0.000000e+00
br i1 %33, label %37, label %34
34: ; preds = %28
%35 = fcmp ogt double %32, 2.550000e+02
br i1 %35, label %36, label %37
36: ; preds = %34
br label %37
37: ; preds = %28, %36, %34
%38 = phi double [ 2.550000e+02, %36 ], [ %32, %34 ], [ 0.000000e+00, %28 ]
%39 = tail call double @llvm.round.f64(double %38)
store double %39, double* %31
%40 = getelementptr inbounds [8 x double], [8 x double]* %0, i64 %3, i64 4
%41 = load double, double* %40
%42 = fcmp olt double %41, 0.000000e+00
br i1 %42, label %46, label %43
43: ; preds = %37
%44 = fcmp ogt double %41, 2.550000e+02
br i1 %44, label %45, label %46
45: ; preds = %43
br label %46
46: ; preds = %37, %45, %43
%47 = phi double [ 2.550000e+02, %45 ], [ %41, %43 ], [ 0.000000e+00, %37 ]
%48 = tail call double @llvm.round.f64(double %47)
store double %48, double* %40
%49 = getelementptr inbounds [8 x double], [8 x double]* %0, i64 %3, i64 5
%50 = load double, double* %49
%51 = fcmp olt double %50, 0.000000e+00
br i1 %51, label %55, label %52
52: ; preds = %46
%53 = fcmp ogt double %50, 2.550000e+02
br i1 %53, label %54, label %55
54: ; preds = %52
br label %55
55: ; preds = %46, %54, %52
%56 = phi double [ 2.550000e+02, %54 ], [ %50, %52 ], [ 0.000000e+00, %46 ]
%57 = tail call double @llvm.round.f64(double %56)
store double %57, double* %49
%58 = getelementptr inbounds [8 x double], [8 x double]* %0, i64 %3, i64 6
%59 = load double, double* %58
%60 = fcmp olt double %59, 0.000000e+00
br i1 %60, label %64, label %61
61: ; preds = %55
%62 = fcmp ogt double %59, 2.550000e+02
br i1 %62, label %63, label %64
63: ; preds = %61
br label %64
64: ; preds = %55, %63, %61
%65 = phi double [ 2.550000e+02, %63 ], [ %59, %61 ], [ 0.000000e+00, %55 ]
%66 = tail call double @llvm.round.f64(double %65)
store double %66, double* %58
%67 = getelementptr inbounds [8 x double], [8 x double]* %0, i64 %3, i64 7
%68 = load double, double* %67
%69 = fcmp olt double %68, 0.000000e+00
br i1 %69, label %73, label %70
70: ; preds = %64
%71 = fcmp ogt double %68, 2.550000e+02
br i1 %71, label %72, label %73
72: ; preds = %70
br label %73
73: ; preds = %64, %72, %70
%74 = phi double [ 2.550000e+02, %72 ], [ %68, %70 ], [ 0.000000e+00, %64 ]
%75 = tail call double @llvm.round.f64(double %74)
store double %75, double* %67
%76 = add nuw nsw i64 %3, 1
%77 = icmp eq i64 %76, 8
br i1 %77, label %78, label %2
78: ; preds = %73
ret void
}