#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
void fourew(FILE *file[5], int *na, int *nb, int *nc, int *nd) {
  int i;
  FILE *ftemp;
  for (i = 1; i <= 4; i++)
    rewind(file[i]);
  ftemp = (file[2]);
  (file[2]) = (file[4]);
  (file[4]) = ftemp;
  ftemp = (file[1]);
  (file[1]) = (file[3]);
  (file[3]) = ftemp;
  *na = 3;
  *nb = 4;
  *nc = 1;
  *nd = 2;
}


x86 assembly (clang, -O0):
<fourew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jg     115c <fourew+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <rewind@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1133 <fourew+0x23>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x38(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x20(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x38(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x2,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fourew>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
mov    0x8(%rdi),%rdi
call   1030 <rewind@plt>
mov    0x10(%rbx),%rdi
call   1030 <rewind@plt>
mov    0x18(%rbx),%rdi
call   1030 <rewind@plt>
mov    0x20(%rbx),%rdi
call   1030 <rewind@plt>
movups 0x8(%rbx),%xmm0
movups 0x18(%rbx),%xmm1
movups %xmm1,0x8(%rbx)
movups %xmm0,0x18(%rbx)
movl   $0x3,0x0(%r13)
movl   $0x4,(%r12)
movl   $0x1,(%r15)
movl   $0x2,(%r14)
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fourew(i32** %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32*
store i32** %0, i32*** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
store i32 1, i32* %11
br label %13
13: ; preds = %23, %5
%14 = load i32, i32* %11
%15 = icmp sle i32 %14, 4
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = load i32**, i32*** %6
%18 = load i32, i32* %11
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32*, i32** %17, i64 %19
%21 = load i32*, i32** %20
%22 = call i32 @rewind(i32* %21)
br label %23
23: ; preds = %16
%24 = load i32, i32* %11
%25 = add nsw i32 %24, 1
store i32 %25, i32* %11
br label %13
26: ; preds = %13
%27 = load i32**, i32*** %6
%28 = getelementptr inbounds i32*, i32** %27, i64 2
%29 = load i32*, i32** %28
store i32* %29, i32** %12
%30 = load i32**, i32*** %6
%31 = getelementptr inbounds i32*, i32** %30, i64 4
%32 = load i32*, i32** %31
%33 = load i32**, i32*** %6
%34 = getelementptr inbounds i32*, i32** %33, i64 2
store i32* %32, i32** %34
%35 = load i32*, i32** %12
%36 = load i32**, i32*** %6
%37 = getelementptr inbounds i32*, i32** %36, i64 4
store i32* %35, i32** %37
%38 = load i32**, i32*** %6
%39 = getelementptr inbounds i32*, i32** %38, i64 1
%40 = load i32*, i32** %39
store i32* %40, i32** %12
%41 = load i32**, i32*** %6
%42 = getelementptr inbounds i32*, i32** %41, i64 3
%43 = load i32*, i32** %42
%44 = load i32**, i32*** %6
%45 = getelementptr inbounds i32*, i32** %44, i64 1
store i32* %43, i32** %45
%46 = load i32*, i32** %12
%47 = load i32**, i32*** %6
%48 = getelementptr inbounds i32*, i32** %47, i64 3
store i32* %46, i32** %48
%49 = load i32*, i32** %7
store i32 3, i32* %49
%50 = load i32*, i32** %8
store i32 4, i32* %50
%51 = load i32*, i32** %9
store i32 1, i32* %51
%52 = load i32*, i32** %10
store i32 2, i32* %52
ret void
}

LLVM IR (-O2):
define void @fourew(i32** nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = getelementptr inbounds i32*, i32** %0, i64 1
%7 = load i32*, i32** %6
%8 = tail call i32 @rewind(i32* %7)
%9 = getelementptr inbounds i32*, i32** %0, i64 2
%10 = load i32*, i32** %9
%11 = tail call i32 @rewind(i32* %10)
%12 = getelementptr inbounds i32*, i32** %0, i64 3
%13 = load i32*, i32** %12
%14 = tail call i32 @rewind(i32* %13)
%15 = getelementptr inbounds i32*, i32** %0, i64 4
%16 = load i32*, i32** %15
%17 = tail call i32 @rewind(i32* %16)
%18 = bitcast i32** %12 to <2 x i32*>*
%19 = load <2 x i32*>, <2 x i32*>* %18
%20 = bitcast i32** %6 to <2 x i32*>*
%21 = load <2 x i32*>, <2 x i32*>* %20
%22 = bitcast i32** %6 to <2 x i32*>*
store <2 x i32*> %19, <2 x i32*>* %22
%23 = bitcast i32** %12 to <2 x i32*>*
store <2 x i32*> %21, <2 x i32*>* %23
store i32 3, i32* %1
store i32 4, i32* %2
store i32 1, i32* %3
store i32 2, i32* %4
ret void
}