#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*/ AddCPU(int *, int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int addcpu(void) {
  int a[10], b[10], c[10];
  for (int i = 0; i < 10; i++) {
    a[i] = -i;
    b[i] = i * i;
  }
  AddCPU(a, b, c);
  printf(" --- CPU --- \n");
  for (int i = 0; i < 10; i++) {
    printf("%d + %d = %d\n", a[i], b[i], c[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<addcpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x94(%rbp)
cmpl   $0xa,-0x94(%rbp)
jge    1181 <addcpu+0x61>
xor    %ecx,%ecx
sub    -0x94(%rbp),%ecx
movslq -0x94(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x94(%rbp),%ecx
imul   -0x94(%rbp),%ecx
movslq -0x94(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1135 <addcpu+0x15>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   1040 <AddCPU@plt>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x98(%rbp)
cmpl   $0xa,-0x98(%rbp)
jge    1200 <addcpu+0xe0>
movslq -0x98(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
movslq -0x98(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%edx
movslq -0x98(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%ecx
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    11ad <addcpu+0x8d>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addcpu>:
push   %rbx
sub    $0x90,%rsp
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xece(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0xfffffff7fffffff8,%rax
ff ff ff
mov    %rax,0x50(%rsp)
movabs $0x5100000040,%rax
mov    %rax,0x20(%rsp)
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
lea    0x60(%rsp),%rdx
call   1050 <AddCPU@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
mov    0x30(%rsp),%esi
mov    (%rsp),%edx
mov    0x60(%rsp),%ecx
lea    0xe8b(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x34(%rsp),%esi
mov    0x4(%rsp),%edx
mov    0x64(%rsp),%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x68(%rsp),%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x3c(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x6c(%rsp),%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x40(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0x70(%rsp),%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x44(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x74(%rsp),%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x48(%rsp),%esi
mov    0x18(%rsp),%edx
mov    0x78(%rsp),%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4c(%rsp),%esi
mov    0x1c(%rsp),%edx
mov    0x7c(%rsp),%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x50(%rsp),%esi
mov    0x20(%rsp),%edx
mov    0x80(%rsp),%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x54(%rsp),%esi
mov    0x24(%rsp),%edx
mov    0x84(%rsp),%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c" --- CPU --- \0A\00"
@.str.1 = [14 x i8] c"%d + %d = %d\0A\00"
define i32 @addcpu() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = alloca [10 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %4
br label %6
6: ; preds = %21, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sub nsw i32 0, %10
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %13
store i32 %11, i32* %14
%15 = load i32, i32* %4
%16 = load i32, i32* %4
%17 = mul nsw i32 %15, %16
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %19
store i32 %17, i32* %20
br label %21
21: ; preds = %9
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %6
24: ; preds = %6
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%28 = call i32 @AddCPU(i32* %25, i32* %26, i32* %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %30
30: ; preds = %47, %24
%31 = load i32, i32* %5
%32 = icmp slt i32 %31, 10
br i1 %32, label %33, label %50
33: ; preds = %30
%34 = load i32, i32* %5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = load i32, i32* %5
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %37, i32 %41, i32 %45)
br label %47
47: ; preds = %33
%48 = load i32, i32* %5
%49 = add nsw i32 %48, 1
store i32 %49, i32* %5
br label %30
50: ; preds = %30
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"%d + %d = %d\0A\00"
@str = [14 x i8] c" --- CPU --- \00"
define i32 @addcpu() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = alloca [10 x i32]
%4 = bitcast [10 x i32]* %1 to i8*
%5 = bitcast [10 x i32]* %2 to i8*
%6 = bitcast [10 x i32]* %3 to i8*
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%14 = bitcast [10 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 0, i32 -1, i32 -2, i32 -3>, <4 x i32>* %14
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%16 = bitcast [10 x i32]* %2 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 4, i32 9>, <4 x i32>* %16
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%24 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 -4, i32 -5, i32 -6, i32 -7>, <4 x i32>* %24
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%26 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 16, i32 25, i32 36, i32 49>, <4 x i32>* %26
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
store i32 -8, i32* %27
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
store i32 64, i32* %28
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
store i32 -9, i32* %29
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
store i32 81, i32* %30
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%32 = call i32 @AddCPU(i32* %7, i32* %8, i32* %31)
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%34 = load i32, i32* %7
%35 = load i32, i32* %8
%36 = load i32, i32* %31
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %34, i32 %35, i32 %36)
%38 = load i32, i32* %9
%39 = load i32, i32* %10
%40 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 1
%41 = load i32, i32* %40
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %38, i32 %39, i32 %41)
%43 = load i32, i32* %11
%44 = load i32, i32* %12
%45 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 2
%46 = load i32, i32* %45
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %43, i32 %44, i32 %46)
%48 = load i32, i32* %13
%49 = load i32, i32* %15
%50 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 3
%51 = load i32, i32* %50
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %48, i32 %49, i32 %51)
%53 = load i32, i32* %17
%54 = load i32, i32* %18
%55 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 4
%56 = load i32, i32* %55
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %53, i32 %54, i32 %56)
%58 = load i32, i32* %19
%59 = load i32, i32* %20
%60 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 5
%61 = load i32, i32* %60
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %58, i32 %59, i32 %61)
%63 = load i32, i32* %21
%64 = load i32, i32* %22
%65 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 6
%66 = load i32, i32* %65
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %63, i32 %64, i32 %66)
%68 = load i32, i32* %23
%69 = load i32, i32* %25
%70 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 7
%71 = load i32, i32* %70
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %68, i32 %69, i32 %71)
%73 = load i32, i32* %27
%74 = load i32, i32* %28
%75 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 8
%76 = load i32, i32* %75
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %73, i32 %74, i32 %76)
%78 = load i32, i32* %29
%79 = load i32, i32* %30
%80 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 9
%81 = load i32, i32* %80
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %78, i32 %79, i32 %81)
ret i32 0
}