#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*/ print_array(int **);
int /*<<< orphan*/ printf(char *);
void c2_(int a[3][3]) {
  int abs();
  int i;
  int j;
  printf("\n");
  printf("C2:\n");
  printf("  The input value of ARRAY:\n");
  print_array(a);
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      if (a[i][j] < 0) {
        a[i][j] = -a[i][j];
      }
      a[i][j] = a[i][j] + 1;
    }
  }
  printf("\n");
  printf("C2:\n");
  printf("  Modified value of ARRAY is:\n");
  print_array(a);
  return;
}


x86 assembly (clang, -O0):
<c2_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <print_array@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1216 <c2_+0xf6>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1203 <c2_+0xe3>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jge    11c6 <c2_+0xa6>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
xor    %edx,%edx
sub    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1171 <c2_+0x51>
jmp    1208 <c2_+0xe8>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1160 <c2_+0x40>
lea    0xde6(%rip),%rdi
call   1040 <printf@plt>
lea    0xdd7(%rip),%rdi
call   1040 <printf@plt>
lea    0xded(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <print_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2_>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xed4(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xea9(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <print_array@plt>
movdqu (%rbx),%xmm0
movdqu 0x10(%rbx),%xmm1
movdqa %xmm0,%xmm2
psrad  $0x1f,%xmm2
paddd  %xmm2,%xmm0
pxor   %xmm2,%xmm0
pcmpeqd %xmm2,%xmm2
psubd  %xmm2,%xmm0
movdqu %xmm0,(%rbx)
movdqa %xmm1,%xmm0
psrad  $0x1f,%xmm0
paddd  %xmm0,%xmm1
pxor   %xmm0,%xmm1
psubd  %xmm2,%xmm1
movdqu %xmm1,0x10(%rbx)
mov    0x20(%rbx),%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x20(%rbx)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xe53(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <print_array@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [5 x i8] c"C2:\0A\00"
@.str.2 = [29 x i8] c" The input value of ARRAY:\0A\00"
@.str.3 = [31 x i8] c" Modified value of ARRAY is:\0A\00"
define void @c2_([3 x i32]* %0) {
%2 = alloca [3 x i32]*
%3 = alloca i32
%4 = alloca i32
store [3 x i32]* %0, [3 x i32]** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = load [3 x i32]*, [3 x i32]** %2
%9 = bitcast [3 x i32]* %8 to i32**
%10 = call i32 @print_array(i32** %9)
store i32 0, i32* %3
br label %11
11: ; preds = %66, %1
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 3
br i1 %13, label %14, label %69
14: ; preds = %11
store i32 0, i32* %4
br label %15
15: ; preds = %62, %14
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 3
br i1 %17, label %18, label %65
18: ; preds = %15
%19 = load [3 x i32]*, [3 x i32]** %2
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %19, i64 %21
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [3 x i32], [3 x i32]* %22, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %45
28: ; preds = %18
%29 = load [3 x i32]*, [3 x i32]** %2
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [3 x i32], [3 x i32]* %29, i64 %31
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [3 x i32], [3 x i32]* %32, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = sub nsw i32 0, %36
%38 = load [3 x i32]*, [3 x i32]** %2
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [3 x i32], [3 x i32]* %38, i64 %40
%42 = load i32, i32* %4
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [3 x i32], [3 x i32]* %41, i64 0, i64 %43
store i32 %37, i32* %44
br label %45
45: ; preds = %28, %18
%46 = load [3 x i32]*, [3 x i32]** %2
%47 = load i32, i32* %3
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [3 x i32], [3 x i32]* %46, i64 %48
%50 = load i32, i32* %4
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [3 x i32], [3 x i32]* %49, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = add nsw i32 %53, 1
%55 = load [3 x i32]*, [3 x i32]** %2
%56 = load i32, i32* %3
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [3 x i32], [3 x i32]* %55, i64 %57
%59 = load i32, i32* %4
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [3 x i32], [3 x i32]* %58, i64 0, i64 %60
store i32 %54, i32* %61
br label %62
62: ; preds = %45
%63 = load i32, i32* %4
%64 = add nsw i32 %63, 1
store i32 %64, i32* %4
br label %15
65: ; preds = %15
br label %66
66: ; preds = %65
%67 = load i32, i32* %3
%68 = add nsw i32 %67, 1
store i32 %68, i32* %3
br label %11
69: ; preds = %11
%70 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%71 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%72 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%73 = load [3 x i32]*, [3 x i32]** %2
%74 = bitcast [3 x i32]* %73 to i32**
%75 = call i32 @print_array(i32** %74)
ret void
}

LLVM IR (-O2):
@str.4 = [28 x i8] c" The input value of ARRAY:\00"
@str.5 = [4 x i8] c"C2:\00"
@str.6 = [30 x i8] c" Modified value of ARRAY is:\00"
define void @c2_([3 x i32]* %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0))
%5 = bitcast [3 x i32]* %0 to i32**
%6 = tail call i32 @print_array(i32** %5)
%7 = bitcast [3 x i32]* %0 to <4 x i32>*
%8 = load <4 x i32>, <4 x i32>* %7
%9 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %8, i1 true)
%10 = add nuw nsw <4 x i32> %9, <i32 1, i32 1, i32 1, i32 1>
%11 = bitcast [3 x i32]* %0 to <4 x i32>*
store <4 x i32> %10, <4 x i32>* %11
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 1
%13 = bitcast i32* %12 to <4 x i32>*
%14 = load <4 x i32>, <4 x i32>* %13
%15 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %14, i1 true)
%16 = add nuw nsw <4 x i32> %15, <i32 1, i32 1, i32 1, i32 1>
%17 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> %16, <4 x i32>* %17
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 2, i64 2
%19 = load i32, i32* %18
%20 = call i32 @llvm.abs.i32(i32 %19, i1 true)
%21 = add nuw nsw i32 %20, 1
store i32 %21, i32* %18
%22 = tail call i32 @putchar(i32 10)
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.5, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.6, i64 0, i64 0))
%25 = tail call i32 @print_array(i32** %5)
ret void
}