#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*/ swap_ints(int *, int *);
void flipH(int mat[4][4]) {
  for (int i = 0; i < 4; i++)
    for (int j = 0; j < 4 / 2; j++)
      swap_ints(&mat[i][j], &mat[i][4 - j - 1]);
}


x86 assembly (clang, -O0):
<flipH>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    11a1 <flipH+0x91>
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    118e <flipH+0x7e>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x4,%rax
add    %rax,%rsi
mov    $0x4,%eax
sub    -0x10(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
call   1030 <swap_ints@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <flipH+0x24>
jmp    1193 <flipH+0x83>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <flipH+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flipH>:
push   %rbx
mov    %rdi,%rbx
lea    0xc(%rdi),%rsi
call   1030 <swap_ints@plt>
lea    0x4(%rbx),%rdi
lea    0x8(%rbx),%rsi
call   1030 <swap_ints@plt>
lea    0x10(%rbx),%rdi
lea    0x1c(%rbx),%rsi
call   1030 <swap_ints@plt>
lea    0x14(%rbx),%rdi
lea    0x18(%rbx),%rsi
call   1030 <swap_ints@plt>
lea    0x20(%rbx),%rdi
lea    0x2c(%rbx),%rsi
call   1030 <swap_ints@plt>
lea    0x24(%rbx),%rdi
lea    0x28(%rbx),%rsi
call   1030 <swap_ints@plt>
lea    0x30(%rbx),%rdi
lea    0x3c(%rbx),%rsi
call   1030 <swap_ints@plt>
lea    0x34(%rbx),%rdi
add    $0x38,%rbx
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <swap_ints@plt>

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

LLVM IR (-O2):
define void @flipH([4 x i32]* %0) {
%2 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 0
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 3
%4 = tail call i32 @swap_ints(i32* %2, i32* %3)
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 1
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 2
%7 = tail call i32 @swap_ints(i32* %5, i32* %6)
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 0
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 3
%10 = tail call i32 @swap_ints(i32* %8, i32* %9)
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 1
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 1, i64 2
%13 = tail call i32 @swap_ints(i32* %11, i32* %12)
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 2, i64 0
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 2, i64 3
%16 = tail call i32 @swap_ints(i32* %14, i32* %15)
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 2, i64 1
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 2, i64 2
%19 = tail call i32 @swap_ints(i32* %17, i32* %18)
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 3, i64 0
%21 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 3, i64 3
%22 = tail call i32 @swap_ints(i32* %20, i32* %21)
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 3, i64 1
%24 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 3, i64 2
%25 = tail call i32 @swap_ints(i32* %23, i32* %24)
ret void
}