#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 */
char *malloc(int);
char *memcpy(char *, unsigned long long *, int);
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  unsigned long long x = 4660046610375530309ULL;
  char *y = malloc(8);
  y = memcpy(y, &x, 8);
  printf("%u\n", y[0]);
  printf("%u\n", y[1]);
  printf("%u\n", y[2]);
  printf("%u\n", y[3]);
  printf("%u\n", y[4]);
  printf("%u\n", y[5]);
  printf("%u\n", y[6]);
  printf("%u\n", y[7]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x40abcfb3c0325745,%rax
cf ab 40
mov    %rax,-0x10(%rbp)
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
lea    0xe84(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
lea    0xe71(%rip),%rdi
movsbl 0x1(%rax),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
lea    0xe5d(%rip),%rdi
movsbl 0x2(%rax),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
lea    0xe49(%rip),%rdi
movsbl 0x3(%rax),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
lea    0xe35(%rip),%rdi
movsbl 0x4(%rax),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
lea    0xe21(%rip),%rdi
movsbl 0x5(%rax),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
lea    0xe0d(%rip),%rdi
movsbl 0x6(%rax),%esi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
lea    0xdf9(%rip),%rdi
movsbl 0x7(%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movabs $0x40abcfb3c0325745,%rax
cf ab 40
mov    %rax,(%rsp)
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rsp,%rsi
mov    %rax,%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    %rax,%rbx
movsbl (%rax),%esi
lea    0xe97(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl 0x1(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl 0x2(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl 0x3(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl 0x4(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl 0x5(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl 0x6(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl 0x7(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8*
store i32 0, i32* %1
store i64 4660046610375530309, i64* %2
%4 = call i8* @malloc(i32 8)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @memcpy(i8* %5, i64* %2, i32 8)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %13)
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %17)
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %21)
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 4
%25 = load i8, i8* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %25)
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 5
%29 = load i8, i8* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %29)
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i64 6
%33 = load i8, i8* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %33)
%35 = load i8*, i8** %3
%36 = getelementptr inbounds i8, i8* %35, i64 7
%37 = load i8, i8* %36
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 4660046610375530309, i64* %1
%3 = tail call dereferenceable_or_null(8) i8* @malloc(i32 8)
%4 = call i8* @memcpy(i8* %3, i64* %1, i32 8)
%5 = load i8, i8* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = load i8, i8* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = getelementptr inbounds i8, i8* %4, i64 2
%11 = load i8, i8* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %11)
%13 = getelementptr inbounds i8, i8* %4, i64 3
%14 = load i8, i8* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %14)
%16 = getelementptr inbounds i8, i8* %4, i64 4
%17 = load i8, i8* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %17)
%19 = getelementptr inbounds i8, i8* %4, i64 5
%20 = load i8, i8* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %20)
%22 = getelementptr inbounds i8, i8* %4, i64 6
%23 = load i8, i8* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %23)
%25 = getelementptr inbounds i8, i8* %4, i64 7
%26 = load i8, i8* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %26)
ret i32 0
}