#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*/ updateIndex(int, int, int, unsigned char *, unsigned char *,
                               int, int, int);
void updateCorners(int Ix, int Iy, int Iz, unsigned char *data,
                   unsigned char *newData, int rank) {
  int x = 1;
  int y = 1;
  int z = 1;
  updateIndex(Ix, Iy, Iz, data, newData, x, y, z);
  x = 1;
  y = 1;
  z = Iz;
  updateIndex(Ix, Iy, Iz, data, newData, x, y, z);
  x = 1;
  y = Iy;
  z = 1;
  updateIndex(Ix, Iy, Iz, data, newData, x, y, z);
  x = 1;
  y = Iy;
  z = Iz;
  updateIndex(Ix, Iy, Iz, data, newData, x, y, z);
  x = Ix;
  y = 1;
  z = 1;
  updateIndex(Ix, Iy, Iz, data, newData, x, y, z);
  x = Ix;
  y = 1;
  z = Iz;
  updateIndex(Ix, Iy, Iz, data, newData, x, y, z);
  x = Ix;
  y = Iy;
  z = 1;
  updateIndex(Ix, Iy, Iz, data, newData, x, y, z);
  x = Ix;
  y = Iy;
  z = Iz;
  updateIndex(Ix, Iy, Iz, data, newData, x, y, z);
}


x86 assembly (clang, -O0):
<updateCorners>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
movl   $0x1,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9d
mov    -0x2c(%rbp),%r10d
mov    -0x30(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <updateIndex@plt>
movl   $0x1,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9d
mov    -0x2c(%rbp),%r10d
mov    -0x30(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <updateIndex@plt>
movl   $0x1,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9d
mov    -0x2c(%rbp),%r10d
mov    -0x30(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <updateIndex@plt>
movl   $0x1,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9d
mov    -0x2c(%rbp),%r10d
mov    -0x30(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <updateIndex@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9d
mov    -0x2c(%rbp),%r10d
mov    -0x30(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <updateIndex@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9d
mov    -0x2c(%rbp),%r10d
mov    -0x30(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <updateIndex@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9d
mov    -0x2c(%rbp),%r10d
mov    -0x30(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <updateIndex@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9d
mov    -0x2c(%rbp),%r10d
mov    -0x30(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <updateIndex@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateCorners>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%r15
mov    %rcx,%r12
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    $0x1,%r9d
push   $0x1
push   $0x1
call   1030 <updateIndex@plt>
add    $0x10,%rsp
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %r12,%rcx
mov    %r15,%r8
mov    $0x1,%r9d
push   %rbx
push   $0x1
call   1030 <updateIndex@plt>
add    $0x10,%rsp
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %r12,%rcx
mov    %r15,%r8
mov    $0x1,%r9d
push   $0x1
push   %r14
call   1030 <updateIndex@plt>
add    $0x10,%rsp
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %r12,%rcx
mov    %r15,%r8
mov    $0x1,%r9d
push   %rbx
push   %r14
call   1030 <updateIndex@plt>
add    $0x10,%rsp
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %r12,%rcx
mov    %r15,%r8
mov    %ebp,%r9d
push   $0x1
push   $0x1
call   1030 <updateIndex@plt>
add    $0x10,%rsp
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %r12,%rcx
mov    %r15,%r8
mov    %ebp,%r9d
push   %rbx
push   $0x1
call   1030 <updateIndex@plt>
add    $0x10,%rsp
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %r12,%rcx
mov    %r15,%r8
mov    %ebp,%r9d
push   $0x1
push   %r14
call   1030 <updateIndex@plt>
add    $0x10,%rsp
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %r12,%rcx
mov    %r15,%r8
mov    %ebp,%r9d
push   %rbx
push   %r14
call   1030 <updateIndex@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @updateCorners(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
store i32 1, i32* %13
store i32 1, i32* %14
store i32 1, i32* %15
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = load i32, i32* %9
%19 = load i8*, i8** %10
%20 = load i8*, i8** %11
%21 = load i32, i32* %13
%22 = load i32, i32* %14
%23 = load i32, i32* %15
%24 = call i32 @updateIndex(i32 %16, i32 %17, i32 %18, i8* %19, i8* %20, i32 %21, i32 %22, i32 %23)
store i32 1, i32* %13
store i32 1, i32* %14
%25 = load i32, i32* %9
store i32 %25, i32* %15
%26 = load i32, i32* %7
%27 = load i32, i32* %8
%28 = load i32, i32* %9
%29 = load i8*, i8** %10
%30 = load i8*, i8** %11
%31 = load i32, i32* %13
%32 = load i32, i32* %14
%33 = load i32, i32* %15
%34 = call i32 @updateIndex(i32 %26, i32 %27, i32 %28, i8* %29, i8* %30, i32 %31, i32 %32, i32 %33)
store i32 1, i32* %13
%35 = load i32, i32* %8
store i32 %35, i32* %14
store i32 1, i32* %15
%36 = load i32, i32* %7
%37 = load i32, i32* %8
%38 = load i32, i32* %9
%39 = load i8*, i8** %10
%40 = load i8*, i8** %11
%41 = load i32, i32* %13
%42 = load i32, i32* %14
%43 = load i32, i32* %15
%44 = call i32 @updateIndex(i32 %36, i32 %37, i32 %38, i8* %39, i8* %40, i32 %41, i32 %42, i32 %43)
store i32 1, i32* %13
%45 = load i32, i32* %8
store i32 %45, i32* %14
%46 = load i32, i32* %9
store i32 %46, i32* %15
%47 = load i32, i32* %7
%48 = load i32, i32* %8
%49 = load i32, i32* %9
%50 = load i8*, i8** %10
%51 = load i8*, i8** %11
%52 = load i32, i32* %13
%53 = load i32, i32* %14
%54 = load i32, i32* %15
%55 = call i32 @updateIndex(i32 %47, i32 %48, i32 %49, i8* %50, i8* %51, i32 %52, i32 %53, i32 %54)
%56 = load i32, i32* %7
store i32 %56, i32* %13
store i32 1, i32* %14
store i32 1, i32* %15
%57 = load i32, i32* %7
%58 = load i32, i32* %8
%59 = load i32, i32* %9
%60 = load i8*, i8** %10
%61 = load i8*, i8** %11
%62 = load i32, i32* %13
%63 = load i32, i32* %14
%64 = load i32, i32* %15
%65 = call i32 @updateIndex(i32 %57, i32 %58, i32 %59, i8* %60, i8* %61, i32 %62, i32 %63, i32 %64)
%66 = load i32, i32* %7
store i32 %66, i32* %13
store i32 1, i32* %14
%67 = load i32, i32* %9
store i32 %67, i32* %15
%68 = load i32, i32* %7
%69 = load i32, i32* %8
%70 = load i32, i32* %9
%71 = load i8*, i8** %10
%72 = load i8*, i8** %11
%73 = load i32, i32* %13
%74 = load i32, i32* %14
%75 = load i32, i32* %15
%76 = call i32 @updateIndex(i32 %68, i32 %69, i32 %70, i8* %71, i8* %72, i32 %73, i32 %74, i32 %75)
%77 = load i32, i32* %7
store i32 %77, i32* %13
%78 = load i32, i32* %8
store i32 %78, i32* %14
store i32 1, i32* %15
%79 = load i32, i32* %7
%80 = load i32, i32* %8
%81 = load i32, i32* %9
%82 = load i8*, i8** %10
%83 = load i8*, i8** %11
%84 = load i32, i32* %13
%85 = load i32, i32* %14
%86 = load i32, i32* %15
%87 = call i32 @updateIndex(i32 %79, i32 %80, i32 %81, i8* %82, i8* %83, i32 %84, i32 %85, i32 %86)
%88 = load i32, i32* %7
store i32 %88, i32* %13
%89 = load i32, i32* %8
store i32 %89, i32* %14
%90 = load i32, i32* %9
store i32 %90, i32* %15
%91 = load i32, i32* %7
%92 = load i32, i32* %8
%93 = load i32, i32* %9
%94 = load i8*, i8** %10
%95 = load i8*, i8** %11
%96 = load i32, i32* %13
%97 = load i32, i32* %14
%98 = load i32, i32* %15
%99 = call i32 @updateIndex(i32 %91, i32 %92, i32 %93, i8* %94, i8* %95, i32 %96, i32 %97, i32 %98)
ret void
}

LLVM IR (-O2):
define void @updateCorners(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i32 %5) {
%7 = tail call i32 @updateIndex(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i32 1, i32 1, i32 1)
%8 = tail call i32 @updateIndex(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i32 1, i32 1, i32 %2)
%9 = tail call i32 @updateIndex(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i32 1, i32 %1, i32 1)
%10 = tail call i32 @updateIndex(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i32 1, i32 %1, i32 %2)
%11 = tail call i32 @updateIndex(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i32 %0, i32 1, i32 1)
%12 = tail call i32 @updateIndex(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i32 %0, i32 1, i32 %2)
%13 = tail call i32 @updateIndex(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i32 %0, i32 %1, i32 1)
%14 = tail call i32 @updateIndex(i32 %0, i32 %1, i32 %2, i8* %3, i8* %4, i32 %0, i32 %1, i32 %2)
ret void
}