#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*/ decompose_column(float *);
int /*<<< orphan*/ decompose_row(float *);
void decompose_image(float *image) {
  int row;
  for (row = 0; row < 64; ++row)
    decompose_row(image + 3 * 64 * row);
  for (row = 0; row < 64; ++row)
    decompose_column(image + 3 * row);
}


x86 assembly (clang, -O0):
<decompose_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    1164 <decompose_image+0x44>
mov    -0x8(%rbp),%rdi
imul   $0xc0,-0xc(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <decompose_row@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <decompose_image+0x13>
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    1199 <decompose_image+0x79>
mov    -0x8(%rbp),%rdi
imul   $0x3,-0xc(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
call   1040 <decompose_column@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116b <decompose_image+0x4b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decompose_image>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
lea    (%r14,%rbx,1),%rdi
call   1030 <decompose_row@plt>
add    $0x300,%rbx
cmp    $0xc000,%rbx
jne    1130 <decompose_image+0x10>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
lea    (%r14,%rbx,1),%rdi
call   1040 <decompose_column@plt>
add    $0xc,%rbx
cmp    $0x300,%rbx
jne    1150 <decompose_image+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @decompose_image(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 64
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load float*, float** %2
%9 = load i32, i32* %3
%10 = mul nsw i32 192, %9
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds float, float* %8, i64 %11
%13 = call i32 @decompose_row(float* %12)
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
store i32 0, i32* %3
br label %18
18: ; preds = %28, %17
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 64
br i1 %20, label %21, label %31
21: ; preds = %18
%22 = load float*, float** %2
%23 = load i32, i32* %3
%24 = mul nsw i32 3, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds float, float* %22, i64 %25
%27 = call i32 @decompose_column(float* %26)
br label %28
28: ; preds = %21
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %18
31: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @decompose_image(float* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = mul nuw nsw i64 %3, 192
%5 = getelementptr inbounds float, float* %0, i64 %4
%6 = tail call i32 @decompose_row(float* %5)
%7 = add nuw nsw i64 %3, 1
%8 = icmp eq i64 %7, 64
br i1 %8, label %9, label %2
9: ; preds = %2, %9
%10 = phi i64 [ %14, %9 ], [ 0, %2 ]
%11 = mul nuw nsw i64 %10, 3
%12 = getelementptr inbounds float, float* %0, i64 %11
%13 = tail call i32 @decompose_column(float* %12)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, 64
br i1 %15, label %16, label %9
16: ; preds = %9
ret void
}