#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*/ printf(char *, long, long, long, long, long, long, long,
                          long);
long syscall(int, int);
int main(int argc, char **argv) {
  long int cpu0 = syscall(320, 0);
  long int cpu1 = syscall(320, 1);
  long int cpu2 = syscall(320, 2);
  long int cpu3 = syscall(320, 3);
  long int cpu4 = syscall(320, 4);
  long int cpu5 = syscall(320, 5);
  long int cpu6 = syscall(320, 6);
  long int cpu7 = syscall(320, 7);
  printf("cpu 0: weight :  %ld\ncpu 1: weight :  %ld\ncpu 2: weight :  "
         "%ld\ncpu 3: weight :  %ld\ncpu 4: weight :  %ld\ncpu 5: weight :  "
         "%ld\ncpu 6: weight :  %ld\ncpu 7: weight :  %ld\n",
         cpu0, cpu1, cpu2, cpu3, cpu4, cpu5, cpu6, cpu7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x140,%edi
xor    %esi,%esi
call   1040 <syscall@plt>
mov    %rax,-0x18(%rbp)
mov    $0x140,%edi
mov    $0x1,%esi
call   1040 <syscall@plt>
mov    %rax,-0x20(%rbp)
mov    $0x140,%edi
mov    $0x2,%esi
call   1040 <syscall@plt>
mov    %rax,-0x28(%rbp)
mov    $0x140,%edi
mov    $0x3,%esi
call   1040 <syscall@plt>
mov    %rax,-0x30(%rbp)
mov    $0x140,%edi
mov    $0x4,%esi
call   1040 <syscall@plt>
mov    %rax,-0x38(%rbp)
mov    $0x140,%edi
mov    $0x5,%esi
call   1040 <syscall@plt>
mov    %rax,-0x40(%rbp)
mov    $0x140,%edi
mov    $0x6,%esi
call   1040 <syscall@plt>
mov    %rax,-0x48(%rbp)
mov    $0x140,%edi
mov    $0x7,%esi
call   1040 <syscall@plt>
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    -0x40(%rbp),%r11
mov    -0x48(%rbp),%r10
mov    -0x50(%rbp),%rax
lea    0xe0e(%rip),%rdi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x140,%edi
xor    %esi,%esi
call   1040 <syscall@plt>
mov    %rax,(%rsp)
mov    $0x140,%edi
mov    $0x1,%esi
call   1040 <syscall@plt>
mov    %rax,%r15
mov    $0x140,%edi
mov    $0x2,%esi
call   1040 <syscall@plt>
mov    %rax,%r12
mov    $0x140,%edi
mov    $0x3,%esi
call   1040 <syscall@plt>
mov    %rax,%r13
mov    $0x140,%edi
mov    $0x4,%esi
call   1040 <syscall@plt>
mov    %rax,%rbx
mov    $0x140,%edi
mov    $0x5,%esi
call   1040 <syscall@plt>
mov    %rax,%rbp
mov    $0x140,%edi
mov    $0x6,%esi
call   1040 <syscall@plt>
mov    %rax,%r14
mov    $0x140,%edi
mov    $0x7,%esi
call   1040 <syscall@plt>
sub    $0x8,%rsp
lea    0xe3f(%rip),%rdi
mov    0x8(%rsp),%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %r13,%r8
mov    %rbx,%r9
push   %rax
push   %r14
push   %rbp
call   1030 <printf@plt>
add    $0x20,%rsp
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [169 x i8] c"cpu 0: weight : %ld\0Acpu 1: weight : %ld\0Acpu 2: weight : %ld\0Acpu 3: weight : %ld\0Acpu 4: weight : %ld\0Acpu 5: weight : %ld\0Acpu 6: weight : %ld\0Acpu 7: weight : %ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = call i64 @syscall(i32 320, i32 0)
store i64 %14, i64* %6
%15 = call i64 @syscall(i32 320, i32 1)
store i64 %15, i64* %7
%16 = call i64 @syscall(i32 320, i32 2)
store i64 %16, i64* %8
%17 = call i64 @syscall(i32 320, i32 3)
store i64 %17, i64* %9
%18 = call i64 @syscall(i32 320, i32 4)
store i64 %18, i64* %10
%19 = call i64 @syscall(i32 320, i32 5)
store i64 %19, i64* %11
%20 = call i64 @syscall(i32 320, i32 6)
store i64 %20, i64* %12
%21 = call i64 @syscall(i32 320, i32 7)
store i64 %21, i64* %13
%22 = load i64, i64* %6
%23 = load i64, i64* %7
%24 = load i64, i64* %8
%25 = load i64, i64* %9
%26 = load i64, i64* %10
%27 = load i64, i64* %11
%28 = load i64, i64* %12
%29 = load i64, i64* %13
%30 = call i32 @printf(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i64 %22, i64 %23, i64 %24, i64 %25, i64 %26, i64 %27, i64 %28, i64 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [169 x i8] c"cpu 0: weight : %ld\0Acpu 1: weight : %ld\0Acpu 2: weight : %ld\0Acpu 3: weight : %ld\0Acpu 4: weight : %ld\0Acpu 5: weight : %ld\0Acpu 6: weight : %ld\0Acpu 7: weight : %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @syscall(i32 320, i32 0)
%4 = tail call i64 @syscall(i32 320, i32 1)
%5 = tail call i64 @syscall(i32 320, i32 2)
%6 = tail call i64 @syscall(i32 320, i32 3)
%7 = tail call i64 @syscall(i32 320, i32 4)
%8 = tail call i64 @syscall(i32 320, i32 5)
%9 = tail call i64 @syscall(i32 320, i32 6)
%10 = tail call i64 @syscall(i32 320, i32 7)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9, i64 %10)
ret i32 0
}