#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*/ dprintf(char *, ...);
void DumpDCTValues(short dct[64]) {
  dprintf("\n#Extracted DCT values from SOS#\n");
  int c = 0;
  for (int i = 0; i < 64; i++) {
    dprintf("% 4d  ", dct[c++]);
    if ((c > 0) && (c % 8 == 0))
      dprintf("\n");
  }
  dprintf("\n");
}


x86 assembly (clang, -O0):
<DumpDCTValues>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <dprintf@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x40,-0x10(%rbp)
jge    11a5 <DumpDCTValues+0x95>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movswl (%rax,%rcx,2),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <dprintf@plt>
cmpl   $0x0,-0xc(%rbp)
jle    1192 <DumpDCTValues+0x82>
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1192 <DumpDCTValues+0x82>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <dprintf@plt>
jmp    1197 <DumpDCTValues+0x87>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <DumpDCTValues+0x28>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <dprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DumpDCTValues>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
lea    0xede(%rip),%rdi
xor    %eax,%eax
call   1030 <dprintf@plt>
mov    $0x1,%ebx
lea    0xeed(%rip),%r14
lea    0xee4(%rip),%r15
jmp    114a <DumpDCTValues+0x3a>
xchg   %ax,%ax
add    $0x1,%rbx
cmp    $0x41,%rbx
je     116b <DumpDCTValues+0x5b>
movswl -0x2(%r12,%rbx,2),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <dprintf@plt>
test   $0x7,%bl
jne    1140 <DumpDCTValues+0x30>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <dprintf@plt>
jmp    1140 <DumpDCTValues+0x30>
lea    0xeae(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <dprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0A#Extracted DCT values from SOS#\0A\00"
@.str.1 = [7 x i8] c"% 4d \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @DumpDCTValues(i16* %0) {
%2 = alloca i16*
%3 = alloca i32
%4 = alloca i32
store i16* %0, i16** %2
%5 = call i32 (i8*, ...) @dprintf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %27, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 64
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = load i16*, i16** %2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i16, i16* %10, i64 %13
%15 = load i16, i16* %14
%16 = sext i16 %15 to i32
%17 = call i32 (i8*, ...) @dprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %9
%21 = load i32, i32* %3
%22 = srem i32 %21, 8
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 (i8*, ...) @dprintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %24, %20, %9
br label %27
27: ; preds = %26
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
br label %6
30: ; preds = %6
%31 = call i32 (i8*, ...) @dprintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0A#Extracted DCT values from SOS#\0A\00"
@.str.1 = [7 x i8] c"% 4d \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @DumpDCTValues(i16* nocapture %0) {
%2 = tail call i32 (i8*, ...) @dprintf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %5
3: ; preds = %16
%4 = tail call i32 (i8*, ...) @dprintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
5: ; preds = %1, %16
%6 = phi i64 [ 0, %1 ], [ %7, %16 ]
%7 = add nuw nsw i64 %6, 1
%8 = getelementptr inbounds i16, i16* %0, i64 %6
%9 = load i16, i16* %8
%10 = sext i16 %9 to i32
%11 = tail call i32 (i8*, ...) @dprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = and i64 %7, 7
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %5
%15 = tail call i32 (i8*, ...) @dprintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %5, %14
%17 = icmp eq i64 %7, 64
br i1 %17, label %3, label %5
}