#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*/ printf(char *, ...);
void mirror(int mat[5][3], int row, int col) {
  int i, j;
  for (i = 0; i < row; i++) {
    for (j = col - 1; j >= 0; j--) {
      printf("%d ", mat[i][j]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<mirror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1196 <mirror+0x86>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     117a <mirror+0x6a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    113e <mirror+0x2e>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <mirror+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mirror>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    119c <mirror+0x7c>
mov    %edx,%r14d
mov    %rdi,%rbx
mov    %edx,%eax
mov    %esi,%r12d
add    $0x1,%rax
mov    %rax,(%rsp)
lea    0xeb7(%rip),%r13
xor    %ebp,%ebp
jmp    1163 <mirror+0x43>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %r12,%rbp
je     119c <mirror+0x7c>
test   %r14d,%r14d
jle    1150 <mirror+0x30>
mov    (%rsp),%r15
nopl   0x0(%rax)
lea    -0x2(%r15),%eax
lea    0x0(,%rbp,2),%rcx
add    %rbp,%rcx
lea    (%rbx,%rcx,4),%rcx
mov    (%rcx,%rax,4),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffffffffffff,%r15
cmp    $0x1,%r15
jg     1170 <mirror+0x50>
jmp    1150 <mirror+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @mirror([3 x i32]* %0, i32 %1, i32 %2) {
%4 = alloca [3 x i32]*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store [3 x i32]* %0, [3 x i32]** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %9
9: ; preds = %34, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %37
13: ; preds = %9
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 1
store i32 %15, i32* %8
br label %16
16: ; preds = %29, %13
%17 = load i32, i32* %8
%18 = icmp sge i32 %17, 0
br i1 %18, label %19, label %32
19: ; preds = %16
%20 = load [3 x i32]*, [3 x i32]** %4
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [3 x i32], [3 x i32]* %20, i64 %22
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %23, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %19
%30 = load i32, i32* %8
%31 = add nsw i32 %30, -1
store i32 %31, i32* %8
br label %16
32: ; preds = %16
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %34
34: ; preds = %32
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
store i32 %36, i32* %7
br label %9
37: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @mirror([3 x i32]* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %23
5: ; preds = %3
%6 = icmp sgt i32 %2, 0
%7 = zext i32 %2 to i64
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %5, %19
%10 = phi i64 [ 0, %5 ], [ %21, %19 ]
br i1 %6, label %11, label %19
11: ; preds = %9, %11
%12 = phi i64 [ %13, %11 ], [ %7, %9 ]
%13 = add nsw i64 %12, -1
%14 = and i64 %13, 4294967295
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 %10, i64 %14
%16 = load i32, i32* %15
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = icmp sgt i64 %12, 1
br i1 %18, label %11, label %19
19: ; preds = %11, %9
%20 = tail call i32 @putchar(i32 10)
%21 = add nuw nsw i64 %10, 1
%22 = icmp eq i64 %21, %8
br i1 %22, label %23, label %9
23: ; preds = %19, %3
ret void
}