#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 scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char *, int);
void _ld_str_to_blocks(char *message, uint8_t str_size, uint64_t *blocks) {
  uint8_t i = 0, j = 0;
  for (; j < str_size; i++, j += 8) {
    memcpy(&blocks[i], message + j, sizeof(uint64_t));
  }
}


x86 assembly (clang, -O0):
<_ld_str_to_blocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1180 <_ld_str_to_blocks+0x70>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
add    -0x28(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
jmp    1134 <_ld_str_to_blocks+0x24>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ld_str_to_blocks>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
jle    114e <_ld_str_to_blocks+0x3e>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
lea    (%r15,%rbx,1),%rsi
mov    %r12,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x8,%rbx
add    $0x4,%r12
cmp    %r14,%rbx
jl     1130 <_ld_str_to_blocks+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @_ld_str_to_blocks(i8* %0, i64 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
store i64 0, i64* %7
store i64 0, i64* %8
br label %9
9: ; preds = %21, %3
%10 = load i64, i64* %8
%11 = load i64, i64* %5
%12 = icmp slt i64 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load i32*, i32** %6
%15 = load i64, i64* %7
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = load i8*, i8** %4
%18 = load i64, i64* %8
%19 = getelementptr inbounds i8, i8* %17, i64 %18
%20 = call i32 @memcpy(i32* %16, i8* %19, i32 4)
br label %21
21: ; preds = %13
%22 = load i64, i64* %7
%23 = add nsw i64 %22, 1
store i64 %23, i64* %7
%24 = load i64, i64* %8
%25 = add nsw i64 %24, 8
store i64 %25, i64* %8
br label %9
26: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @_ld_str_to_blocks(i8* %0, i64 %1, i32* %2) {
%4 = icmp sgt i64 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi i64 [ %12, %5 ], [ 0, %3 ]
%7 = phi i64 [ %11, %5 ], [ 0, %3 ]
%8 = getelementptr inbounds i32, i32* %2, i64 %7
%9 = getelementptr inbounds i8, i8* %0, i64 %6
%10 = tail call i32 @memcpy(i32* %8, i8* %9, i32 4)
%11 = add nuw nsw i64 %7, 1
%12 = add nuw nsw i64 %6, 8
%13 = icmp slt i64 %12, %1
br i1 %13, label %5, label %14
14: ; preds = %5, %3
ret void
}