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

/* Variables and functions */
int /*<<< orphan*/ duffs_device(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ printf(char *, long long);
int main() {
  long long a[10], b[10];
  for (int i = 0; i < 10; i++)
    a[i] = i;
  duffs_device((unsigned char *)a, (unsigned char *)b, sizeof(a));
  for (int i = 0; i < 10; i++)
    printf("%d\n", b[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xb4(%rbp)
cmpl   $0xa,-0xb4(%rbp)
jge    1170 <main+0x50>
movslq -0xb4(%rbp),%rcx
movslq -0xb4(%rbp),%rax
mov    %rcx,-0x60(%rbp,%rax,8)
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    113c <main+0x1c>
lea    -0x60(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    $0x50,%edx
call   1040 <duffs_device@plt>
movl   $0x0,-0xb8(%rbp)
cmpl   $0xa,-0xb8(%rbp)
jge    11cb <main+0xab>
movslq -0xb8(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rsi
ff
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    118f <main+0x6f>
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xa0,%rsp
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
lea    0x50(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x50,%edx
call   1040 <duffs_device@plt>
mov    (%rsp),%rsi
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x38(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x40(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x48(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i64]
%2 = alloca [10 x i64]
%3 = bitcast [10 x i64]* %1 to i8*
%4 = bitcast [10 x i64]* %2 to i8*
%5 = bitcast [10 x i64]* %1 to <2 x i64>*
store <2 x i64> <i64 0, i64 1>, <2 x i64>* %5
%6 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 2
%7 = bitcast i64* %6 to <2 x i64>*
store <2 x i64> <i64 2, i64 3>, <2 x i64>* %7
%8 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 4
%9 = bitcast i64* %8 to <2 x i64>*
store <2 x i64> <i64 4, i64 5>, <2 x i64>* %9
%10 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 6
%11 = bitcast i64* %10 to <2 x i64>*
store <2 x i64> <i64 6, i64 7>, <2 x i64>* %11
%12 = getelementptr inbounds [10 x i64], [10 x i64]* %1, i64 0, i64 8
%13 = bitcast i64* %12 to <2 x i64>*
store <2 x i64> <i64 8, i64 9>, <2 x i64>* %13
%14 = call i32 @duffs_device(i8* %3, i8* %4, i32 80)
%15 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 0
%16 = load i64, i64* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %16)
%18 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 1
%19 = load i64, i64* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %19)
%21 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 2
%22 = load i64, i64* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %22)
%24 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 3
%25 = load i64, i64* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %25)
%27 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 4
%28 = load i64, i64* %27
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %28)
%30 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 5
%31 = load i64, i64* %30
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %31)
%33 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 6
%34 = load i64, i64* %33
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %34)
%36 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 7
%37 = load i64, i64* %36
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %37)
%39 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 8
%40 = load i64, i64* %39
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %40)
%42 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 9
%43 = load i64, i64* %42
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %43)
ret i32 0
}