#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 */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void convert_track_swap_2352(uint8_t *sector, uint32_t adr) {
  for (unsigned i = 0; i < 2352; i += 2) {
    uint8_t t = sector[i];
    sector[i] = sector[i + 1];
    sector[i + 1] = t;
  }
}


x86 assembly (clang, -O0):
<convert_track_swap_2352>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x930,-0x10(%rbp)
jae    1165 <convert_track_swap_2352+0x65>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <convert_track_swap_2352+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_track_swap_2352>:
mov    $0x2,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movdqu -0x10(%rdi,%rax,8),%xmm0
movdqu (%rdi,%rax,8),%xmm1
pshufd $0xb1,%xmm0,%xmm0
movdqu %xmm0,-0x10(%rdi,%rax,8)
pshufd $0xb1,%xmm1,%xmm0
movdqu %xmm0,(%rdi,%rax,8)
add    $0x4,%rax
cmp    $0x49a,%rax
jne    1110 <convert_track_swap_2352+0x10>
ret

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

LLVM IR (-O2):
define void @convert_track_swap_2352(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 -1
%4 = getelementptr inbounds i32, i32* %0, i64 -1
br label %5
5: ; preds = %5, %2
%6 = phi i64 [ 0, %2 ], [ %27, %5 ]
%7 = shl i64 %6, 1
%8 = or i64 %7, 4
%9 = getelementptr inbounds i32, i32* %0, i64 %7
%10 = getelementptr inbounds i32, i32* %0, i64 %8
%11 = bitcast i32* %9 to <4 x i32>*
%12 = bitcast i32* %10 to <4 x i32>*
%13 = load <4 x i32>, <4 x i32>* %11
%14 = load <4 x i32>, <4 x i32>* %12
%15 = shufflevector <4 x i32> %13, <4 x i32> poison, <2 x i32> <i32 0, i32 2>
%16 = shufflevector <4 x i32> %14, <4 x i32> poison, <2 x i32> <i32 0, i32 2>
%17 = shufflevector <4 x i32> %13, <4 x i32> poison, <2 x i32> <i32 1, i32 3>
%18 = shufflevector <4 x i32> %14, <4 x i32> poison, <2 x i32> <i32 1, i32 3>
%19 = or i64 %7, 1
%20 = or i64 %7, 5
%21 = getelementptr inbounds i32, i32* %3, i64 %19
%22 = bitcast i32* %21 to <4 x i32>*
%23 = getelementptr inbounds i32, i32* %4, i64 %20
%24 = bitcast i32* %23 to <4 x i32>*
%25 = shufflevector <2 x i32> %17, <2 x i32> %15, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %25, <4 x i32>* %22
%26 = shufflevector <2 x i32> %18, <2 x i32> %16, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %26, <4 x i32>* %24
%27 = add nuw i64 %6, 4
%28 = icmp eq i64 %27, 1176
br i1 %28, label %29, label %5
29: ; preds = %5
ret void
}