#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 calculat_group_numbers(int, int);
int /*<<< orphan*/ memory_move_read(int, int, int *, int, int *, int);
int test_memory_move_read_6(void) {
  int buf_test1[4];
  int buf_test2[4];
  int group_read_from;
  int group_read_to;
  int group_write_from;
  int group_write_to;
  buf_test1[0] = 0x32100000;
  buf_test1[1] = 0xba987654;
  buf_test1[2] = 0x87654321;
  group_read_from = calculat_group_numbers(20, 60);
  group_read_to = (((60) + 31) / 32);
  memory_move_read(20, 60, buf_test1, group_read_from, buf_test2,
                   group_read_to);
  if (buf_test2[0] == 0x87654321 && buf_test2[1] == 0x04321ba9) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<test_memory_move_read_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x32100000,-0x20(%rbp)
movl   $0xba987654,-0x1c(%rbp)
movl   $0x87654321,-0x18(%rbp)
mov    $0x14,%edi
mov    $0x3c,%esi
call   1040 <calculat_group_numbers@plt>
mov    %eax,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
lea    -0x20(%rbp),%rdx
mov    -0x34(%rbp),%ecx
lea    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9d
mov    $0x14,%edi
mov    $0x3c,%esi
call   1030 <memory_move_read@plt>
cmpl   $0x87654321,-0x30(%rbp)
jne    119a <test_memory_move_read_6+0x7a>
cmpl   $0x4321ba9,-0x2c(%rbp)
jne    119a <test_memory_move_read_6+0x7a>
movl   $0x0,-0x4(%rbp)
jmp    11a1 <test_memory_move_read_6+0x81>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_memory_move_read_6>:
sub    $0x28,%rsp
movabs $0xba98765432100000,%rax
76 98 ba
mov    %rax,0x10(%rsp)
movl   $0x87654321,0x18(%rsp)
87
mov    $0x14,%edi
mov    $0x3c,%esi
call   1040 <calculat_group_numbers@plt>
lea    0x10(%rsp),%rdx
mov    %rsp,%r8
mov    $0x14,%edi
mov    $0x3c,%esi
mov    %eax,%ecx
mov    $0x2,%r9d
call   1030 <memory_move_read@plt>
mov    $0x87654321,%ecx
xor    (%rsp),%ecx
mov    $0x4321ba9,%edx
xor    0x4(%rsp),%edx
xor    %eax,%eax
or     %ecx,%edx
setne  %al
neg    %eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @test_memory_move_read_6() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca [4 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
store i32 839909376, i32* %8
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
store i32 -1164413356, i32* %9
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 2
store i32 -2023406815, i32* %10
%11 = call i32 @calculat_group_numbers(i32 20, i32 60)
store i32 %11, i32* %4
store i32 2, i32* %5
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%13 = load i32, i32* %4
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%15 = load i32, i32* %5
%16 = call i32 @memory_move_read(i32 20, i32 60, i32* %12, i32 %13, i32* %14, i32 %15)
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, -2023406815
br i1 %19, label %20, label %25
20: ; preds = %0
%21 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 1
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, 70392745
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 0, i32* %1
br label %26
25: ; preds = %20, %0
store i32 -1, i32* %1
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
define i32 @test_memory_move_read_6() {
%1 = alloca [4 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
store i32 839909376, i32* %5
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 1
store i32 -1164413356, i32* %6
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
store i32 -2023406815, i32* %7
%8 = tail call i32 @calculat_group_numbers(i32 20, i32 60)
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%10 = call i32 @memory_move_read(i32 20, i32 60, i32* %5, i32 %8, i32* %9, i32 2)
%11 = load i32, i32* %9
%12 = icmp ne i32 %11, -2023406815
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%14 = load i32, i32* %13
%15 = icmp ne i32 %14, 70392745
%16 = select i1 %12, i1 true, i1 %15
%17 = sext i1 %16 to i32
ret i32 %17
}