#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 uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int scanf(char *, int *);
int /*<<< orphan*/ swap4(int *, int *, int, int /*<<< orphan*/);
int main(void) {
  uint64_t str[8] = {1, 2, 3, 4, 5, 6, 7, 8};
  uint64_t s;
  if (scanf("%llu", &s) != 1)
    return -1;
  swap4(str, str + 4, s & 1, 0);
  for (unsigned i = 0; i < 8; ++i) {
    printf("%llu%s", str[i], i == 7 ? ".\n" : " ");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xeae(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1190 <main+0x60>
movl   $0xffffffff,-0x4(%rbp)
jmp    11fa <main+0xca>
lea    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rsi
add    $0x10,%rsi
mov    -0x34(%rbp),%edx
and    $0x1,%edx
xor    %ecx,%ecx
call   1050 <swap4@plt>
movl   $0x0,-0x38(%rbp)
cmpl   $0x8,-0x38(%rbp)
jae    11f3 <main+0xc3>
mov    -0x38(%rbp),%eax
mov    -0x30(%rbp,%rax,4),%esi
mov    -0x38(%rbp),%ecx
lea    0xe64(%rip),%rdx
lea    0xe5a(%rip),%rax
cmp    $0x7,%ecx
cmove  %rax,%rdx
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11b0 <main+0x80>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xec9(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xffffffff,%r14d
cmp    $0x1,%eax
jne    1215 <main+0xe5>
lea    0x20(%rsp),%rsi
mov    0xc(%rsp),%edx
and    $0x1,%edx
lea    0x10(%rsp),%rdi
xor    %r14d,%r14d
xor    %ecx,%ecx
call   1050 <swap4@plt>
mov    0x10(%rsp),%esi
lea    0xe8f(%rip),%rbx
lea    0xe92(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rdx
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
mov    %rbp,%rdx
call   1030 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
mov    %rbp,%rdx
call   1030 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
mov    %rbp,%rdx
call   1030 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
mov    %rbp,%rdx
call   1030 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
mov    %rbp,%rdx
call   1030 <printf@plt>
mov    0x28(%rsp),%esi
mov    %rbx,%rdi
mov    %rbp,%rdx
call   1030 <printf@plt>
mov    0x2c(%rsp),%esi
lea    0xe1f(%rip),%rdx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14d,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.str = [8 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8]
@.str = [5 x i8] c"%llu\00"
@.str.1 = [7 x i8] c"%llu%s\00"
@.str.2 = [3 x i8] c".\0A\00"
@.str.3 = [2 x i8] c" \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [8 x i32]* %2 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 -1, i32* %1
br label %33
9: ; preds = %0
%10 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%12 = getelementptr inbounds i32, i32* %11, i64 4
%13 = load i32, i32* %3
%14 = and i32 %13, 1
%15 = call i32 @swap4(i32* %10, i32* %12, i32 %14, i32 0)
store i32 0, i32* %4
br label %16
16: ; preds = %29, %9
%17 = load i32, i32* %4
%18 = icmp ult i32 %17, 8
br i1 %18, label %19, label %32
19: ; preds = %16
%20 = load i32, i32* %4
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = load i32, i32* %4
%25 = icmp eq i32 %24, 7
%26 = zext i1 %25 to i64
%27 = select i1 %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
%28 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %23, i8* %27)
br label %29
29: ; preds = %19
%30 = load i32, i32* %4
%31 = add i32 %30, 1
store i32 %31, i32* %4
br label %16
32: ; preds = %16
store i32 0, i32* %1
br label %33
33: ; preds = %32, %8
%34 = load i32, i32* %1
ret i32 %34
}

LLVM IR (-O2):
@__const.main.str = [8 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8]
@.str = [5 x i8] c"%llu\00"
@.str.1 = [7 x i8] c"%llu%s\00"
@.str.2 = [3 x i8] c".\0A\00"
@.str.3 = [2 x i8] c" \00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = alloca i32
%3 = bitcast [8 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %35
7: ; preds = %0
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 4
%10 = load i32, i32* %2
%11 = and i32 %10, 1
%12 = call i32 @swap4(i32* %8, i32* %9, i32 %11, i32 0)
%13 = load i32, i32* %8
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%15 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 1
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%18 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 2
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%21 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 3
%22 = load i32, i32* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%24 = load i32, i32* %9
%25 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%26 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 5
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%29 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 6
%30 = load i32, i32* %29
%31 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%32 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 7
%33 = load i32, i32* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %35
35: ; preds = %7, %0
%36 = phi i32 [ -1, %0 ], [ 0, %7 ]
ret i32 %36
}