#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 int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ gdev_test_memcpy(int *, int *, int, int, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int main(int argc, char *argv[]) {
  uint32_t *in, *out;
  uint32_t size = 0x1000000;
  uint32_t ch_size = 0x10000;
  int pl = 2;
  int i, tmp;
  for (i = 1; i < argc; i++) {
    if (strncmp(argv[i], "--chunk", (tmp = strlen("--chunk"))) == 0) {
      if (argv[i][tmp] != '=') {
        printf("option \"%s\" is invalid.\n", argv[i]);
        exit(1);
      }
      sscanf(&argv[i][tmp + 1], "%x", &ch_size);
    } else if (strncmp(argv[i], "--data", (tmp = strlen("--data"))) == 0) {
      if (argv[i][tmp] != '=') {
        printf("option \"%s\" is invalid.\n", argv[i]);
        exit(1);
      }
      sscanf(&argv[i][tmp + 1], "%x", &size);
    } else if (strncmp(argv[i], "--pl", (tmp = strlen("--pl"))) == 0) {
      if (argv[i][tmp] != '=') {
        printf("option \"%s\" is invalid.\n", argv[i]);
        exit(1);
      }
      sscanf(&argv[i][tmp + 1], "%d", &pl);
    }
  }
  in = (uint32_t *)malloc(size);
  out = (uint32_t *)malloc(size);
  for (i = 0; i < size / 4; i++) {
    in[i] = i + 1;
    out[i] = 0;
  }
  gdev_test_memcpy(in, out, size, ch_size, pl);
  for (i = 0; i < size / 4; i++) {
    if (in[i] != out[i]) {
      printf("in[%d] = %lu, out[%d] = %lu\n", i, in[i], i, out[i]);
      printf("Test failed.\n");
      goto end;
    }
  }
  free(in);
  free(out);
  return 0;
end:
  free(in);
  free(out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1000000,-0x24(%rbp)
movl   $0x10000,-0x28(%rbp)
movl   $0x2,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13ce <main+0x24e>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x40(%rbp)
lea    0xe2b(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%edx
mov    %edx,-0x34(%rbp)
lea    0xe16(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1266 <main+0xe6>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
je     123a <main+0xba>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cltq
add    %rax,%rdi
lea    0xdc9(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1090 <sscanf@plt>
jmp    13bb <main+0x23b>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x48(%rbp)
lea    0xda7(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%edx
mov    %edx,-0x34(%rbp)
lea    0xd92(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    130e <main+0x18e>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
je     12e2 <main+0x162>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xd37(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cltq
add    %rax,%rdi
lea    0xd21(%rip),%rsi
lea    -0x24(%rbp),%rdx
call   1090 <sscanf@plt>
jmp    13b6 <main+0x236>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x50(%rbp)
lea    0xd06(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x50(%rbp),%rdi
mov    %eax,%edx
mov    %edx,-0x34(%rbp)
lea    0xcf1(%rip),%rsi
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    13b1 <main+0x231>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
je     138a <main+0x20a>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xc8f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cltq
add    %rax,%rdi
lea    0xc88(%rip),%rsi
lea    -0x2c(%rbp),%rdx
call   1090 <sscanf@plt>
jmp    13b6 <main+0x236>
jmp    13bb <main+0x23b>
jmp    13c0 <main+0x240>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11b2 <main+0x32>
mov    -0x24(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x24(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
cmp    %ecx,%eax
jge    1439 <main+0x2b9>
mov    -0x30(%rbp),%edx
add    $0x1,%edx
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    13ed <main+0x26d>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x2c(%rbp),%r8d
call   1070 <gdev_test_memcpy@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
cmp    %ecx,%eax
jge    14e2 <main+0x362>
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x20(%rbp),%rcx
movslq -0x30(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     14cf <main+0x34f>
mov    -0x30(%rbp),%esi
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x30(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rdi
mov    (%rax,%rdi,4),%r8d
lea    0xb7e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xb8d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1500 <main+0x380>
jmp    14d4 <main+0x354>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1457 <main+0x2d7>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1519 <main+0x399>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x1000000,0x4(%rsp)
01
movl   $0x10000,0xc(%rsp)
movl   $0x2,0x8(%rsp)
mov    $0x1000000,%eax
cmp    $0x2,%edi
jl     12fb <main+0x16b>
mov    %rsi,%r13
mov    %edi,%eax
mov    %rax,0x10(%rsp)
mov    $0x1,%r14d
jmp    1216 <main+0x86>
cs nopw 0x0(%rax,%rax,1)
movslq %r15d,%rax
cmpb   $0x3d,0x0(%rbp,%rax,1)
jne    13d1 <main+0x241>
lea    (%rax,%rbp,1),%rdi
add    $0x1,%rdi
lea    0xe24(%rip),%rsi
lea    0x4(%rsp),%rdx
call   10a0 <sscanf@plt>
add    $0x1,%r14
cmp    %r14,0x10(%rsp)
je     12f7 <main+0x167>
mov    0x0(%r13,%r14,8),%rbx
lea    0xdde(%rip),%r15
mov    %r15,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
mov    0x0(%r13,%r14,8),%r12
test   %rax,%rax
je     12d0 <main+0x140>
lea    0xdd6(%rip),%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %eax,%r15d
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
mov    0x0(%r13,%r14,8),%rbp
test   %rax,%rax
je     11e0 <main+0x50>
lea    0xdb0(%rip),%r15
mov    %r15,%rdi
call   1060 <strlen@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    1207 <main+0x77>
mov    0x0(%r13,%r14,8),%rsi
movslq %ebx,%rax
cmpb   $0x3d,(%rsi,%rax,1)
jne    13dd <main+0x24d>
lea    (%rax,%rsi,1),%rdi
add    $0x1,%rdi
lea    0xd74(%rip),%rsi
lea    0x8(%rsp),%rdx
jmp    1202 <main+0x72>
cs nopw 0x0(%rax,%rax,1)
movslq %ebp,%rax
cmpb   $0x3d,(%r12,%rax,1)
jne    13c5 <main+0x235>
lea    (%rax,%r12,1),%rdi
add    $0x1,%rdi
lea    0xd34(%rip),%rsi
lea    0xc(%rsp),%rdx
jmp    1202 <main+0x72>
mov    0x4(%rsp),%eax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%rbp
mov    0x4(%rsp),%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
mov    0x4(%rsp),%edx
cmp    $0x4,%edx
jl     1349 <main+0x1b9>
xor    %eax,%eax
nopl   0x0(%rax)
lea    0x1(%rax),%rcx
mov    %ecx,0x0(%rbp,%rax,4)
movl   $0x0,(%rbx,%rax,4)
mov    0x4(%rsp),%edx
lea    0x3(%rdx),%eax
test   %edx,%edx
cmovns %edx,%eax
sar    $0x2,%eax
movslq %eax,%rsi
mov    %rcx,%rax
cmp    %rsi,%rcx
jl     1320 <main+0x190>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1080 <gdev_test_memcpy@plt>
mov    0x4(%rsp),%eax
cmp    $0x4,%eax
jl     13a4 <main+0x214>
shr    $0x2,%rax
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    0x0(%rbp,%rcx,4),%edx
mov    (%rbx,%rcx,4),%r8d
cmp    %r8d,%edx
jne    1388 <main+0x1f8>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1370 <main+0x1e0>
jmp    13a4 <main+0x214>
lea    0xca4(%rip),%rdi
mov    %ecx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xcb1(%rip),%rdi
call   1050 <puts@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc3c(%rip),%rdi
mov    %r12,%rsi
jmp    13e4 <main+0x254>
lea    0xc30(%rip),%rdi
mov    %rbp,%rsi
jmp    13e4 <main+0x254>
lea    0xc24(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"--chunk\00"
@.str.1 = [25 x i8] c"option \22%s\22 is invalid.\0A\00"
@.str.2 = [3 x i8] c"%x\00"
@.str.3 = [7 x i8] c"--data\00"
@.str.4 = [5 x i8] c"--pl\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [29 x i8] c"in[%d] = %lu, out[%d] = %lu\0A\00"
@.str.7 = [14 x i8] c"Test failed.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 16777216, i32* %8
store i32 65536, i32* %9
store i32 2, i32* %10
store i32 1, i32* %11
br label %13
13: ; preds = %140, %2
%14 = load i32, i32* %11
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %143
17: ; preds = %13
%18 = load i8**, i8*** %5
%19 = load i32, i32* %11
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %23, i32* %12
%24 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %57
26: ; preds = %17
%27 = load i8**, i8*** %5
%28 = load i32, i32* %11
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = load i32, i32* %12
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 61
br i1 %37, label %38, label %46
38: ; preds = %26
%39 = load i8**, i8*** %5
%40 = load i32, i32* %11
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8*, i8** %39, i64 %41
%43 = load i8*, i8** %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %43)
%45 = call i32 @exit(i32 1)
unreachable
46: ; preds = %26
%47 = load i8**, i8*** %5
%48 = load i32, i32* %11
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %47, i64 %49
%51 = load i8*, i8** %50
%52 = load i32, i32* %12
%53 = add nsw i32 %52, 1
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %51, i64 %54
%56 = call i32 @sscanf(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %9)
br label %139
57: ; preds = %17
%58 = load i8**, i8*** %5
%59 = load i32, i32* %11
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8*, i8** %58, i64 %60
%62 = load i8*, i8** %61
%63 = call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
store i32 %63, i32* %12
%64 = call i64 @strncmp(i8* %62, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %63)
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %97
66: ; preds = %57
%67 = load i8**, i8*** %5
%68 = load i32, i32* %11
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8*, i8** %67, i64 %69
%71 = load i8*, i8** %70
%72 = load i32, i32* %12
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8, i8* %71, i64 %73
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp ne i32 %76, 61
br i1 %77, label %78, label %86
78: ; preds = %66
%79 = load i8**, i8*** %5
%80 = load i32, i32* %11
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8*, i8** %79, i64 %81
%83 = load i8*, i8** %82
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %83)
%85 = call i32 @exit(i32 1)
unreachable
86: ; preds = %66
%87 = load i8**, i8*** %5
%88 = load i32, i32* %11
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8*, i8** %87, i64 %89
%91 = load i8*, i8** %90
%92 = load i32, i32* %12
%93 = add nsw i32 %92, 1
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i8, i8* %91, i64 %94
%96 = call i32 @sscanf(i8* %95, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %8)
br label %138
97: ; preds = %57
%98 = load i8**, i8*** %5
%99 = load i32, i32* %11
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8*, i8** %98, i64 %100
%102 = load i8*, i8** %101
%103 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i32 %103, i32* %12
%104 = call i64 @strncmp(i8* %102, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %103)
%105 = icmp eq i64 %104, 0
br i1 %105, label %106, label %137
106: ; preds = %97
%107 = load i8**, i8*** %5
%108 = load i32, i32* %11
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8*, i8** %107, i64 %109
%111 = load i8*, i8** %110
%112 = load i32, i32* %12
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8, i8* %111, i64 %113
%115 = load i8, i8* %114
%116 = sext i8 %115 to i32
%117 = icmp ne i32 %116, 61
br i1 %117, label %118, label %126
118: ; preds = %106
%119 = load i8**, i8*** %5
%120 = load i32, i32* %11
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8*, i8** %119, i64 %121
%123 = load i8*, i8** %122
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %123)
%125 = call i32 @exit(i32 1)
unreachable
126: ; preds = %106
%127 = load i8**, i8*** %5
%128 = load i32, i32* %11
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds i8*, i8** %127, i64 %129
%131 = load i8*, i8** %130
%132 = load i32, i32* %12
%133 = add nsw i32 %132, 1
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds i8, i8* %131, i64 %134
%136 = call i32 @sscanf(i8* %135, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %10)
br label %137
137: ; preds = %126, %97
br label %138
138: ; preds = %137, %86
br label %139
139: ; preds = %138, %46
br label %140
140: ; preds = %139
%141 = load i32, i32* %11
%142 = add nsw i32 %141, 1
store i32 %142, i32* %11
br label %13
143: ; preds = %13
%144 = load i32, i32* %8
%145 = call i64 @malloc(i32 %144)
%146 = inttoptr i64 %145 to i32*
store i32* %146, i32** %6
%147 = load i32, i32* %8
%148 = call i64 @malloc(i32 %147)
%149 = inttoptr i64 %148 to i32*
store i32* %149, i32** %7
store i32 0, i32* %11
br label %150
150: ; preds = %166, %143
%151 = load i32, i32* %11
%152 = load i32, i32* %8
%153 = sdiv i32 %152, 4
%154 = icmp slt i32 %151, %153
br i1 %154, label %155, label %169
155: ; preds = %150
%156 = load i32, i32* %11
%157 = add nsw i32 %156, 1
%158 = load i32*, i32** %6
%159 = load i32, i32* %11
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds i32, i32* %158, i64 %160
store i32 %157, i32* %161
%162 = load i32*, i32** %7
%163 = load i32, i32* %11
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds i32, i32* %162, i64 %164
store i32 0, i32* %165
br label %166
166: ; preds = %155
%167 = load i32, i32* %11
%168 = add nsw i32 %167, 1
store i32 %168, i32* %11
br label %150
169: ; preds = %150
%170 = load i32*, i32** %6
%171 = load i32*, i32** %7
%172 = load i32, i32* %8
%173 = load i32, i32* %9
%174 = load i32, i32* %10
%175 = call i32 @gdev_test_memcpy(i32* %170, i32* %171, i32 %172, i32 %173, i32 %174)
store i32 0, i32* %11
br label %176
176: ; preds = %209, %169
%177 = load i32, i32* %11
%178 = load i32, i32* %8
%179 = sdiv i32 %178, 4
%180 = icmp slt i32 %177, %179
br i1 %180, label %181, label %212
181: ; preds = %176
%182 = load i32*, i32** %6
%183 = load i32, i32* %11
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds i32, i32* %182, i64 %184
%186 = load i32, i32* %185
%187 = load i32*, i32** %7
%188 = load i32, i32* %11
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds i32, i32* %187, i64 %189
%191 = load i32, i32* %190
%192 = icmp ne i32 %186, %191
br i1 %192, label %193, label %208
193: ; preds = %181
%194 = load i32, i32* %11
%195 = load i32*, i32** %6
%196 = load i32, i32* %11
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds i32, i32* %195, i64 %197
%199 = load i32, i32* %198
%200 = load i32, i32* %11
%201 = load i32*, i32** %7
%202 = load i32, i32* %11
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds i32, i32* %201, i64 %203
%205 = load i32, i32* %204
%206 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %194, i32 %199, i32 %200, i32 %205)
%207 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
br label %217
208: ; preds = %181
br label %209
209: ; preds = %208
%210 = load i32, i32* %11
%211 = add nsw i32 %210, 1
store i32 %211, i32* %11
br label %176
212: ; preds = %176
%213 = load i32*, i32** %6
%214 = call i32 @free(i32* %213)
%215 = load i32*, i32** %7
%216 = call i32 @free(i32* %215)
store i32 0, i32* %3
br label %222
217: ; preds = %193
%218 = load i32*, i32** %6
%219 = call i32 @free(i32* %218)
%220 = load i32*, i32** %7
%221 = call i32 @free(i32* %220)
store i32 0, i32* %3
br label %222
222: ; preds = %217, %212
%223 = load i32, i32* %3
ret i32 %223
}

LLVM IR (-O2):
@.str = [8 x i8] c"--chunk\00"
@.str.1 = [25 x i8] c"option \22%s\22 is invalid.\0A\00"
@.str.2 = [3 x i8] c"%x\00"
@.str.3 = [7 x i8] c"--data\00"
@.str.4 = [5 x i8] c"--pl\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [29 x i8] c"in[%d] = %lu, out[%d] = %lu\0A\00"
@str = [13 x i8] c"Test failed.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
store i32 16777216, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 65536, i32* %4
%8 = bitcast i32* %5 to i8*
store i32 2, i32* %5
%9 = icmp sgt i32 %0, 1
br i1 %9, label %10, label %74
10: ; preds = %2
%11 = zext i32 %0 to i64
br label %12
12: ; preds = %10, %69
%13 = phi i64 [ 1, %10 ], [ %70, %69 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%17 = call i64 @strncmp(i8* %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = icmp eq i64 %17, 0
%19 = load i8*, i8** %14
br i1 %18, label %20, label %33
20: ; preds = %12
%21 = sext i32 %16 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 61
br i1 %24, label %28, label %25
25: ; preds = %20
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %20
%29 = add nsw i32 %16, 1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %19, i64 %30
%32 = call i32 @sscanf(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
br label %69
33: ; preds = %12
%34 = call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%35 = call i64 @strncmp(i8* %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %34)
%36 = icmp eq i64 %35, 0
%37 = load i8*, i8** %14
br i1 %36, label %38, label %51
38: ; preds = %33
%39 = sext i32 %34 to i64
%40 = getelementptr inbounds i8, i8* %37, i64 %39
%41 = load i8, i8* %40
%42 = icmp eq i8 %41, 61
br i1 %42, label %46, label %43
43: ; preds = %38
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %37)
%45 = call i32 @exit(i32 1)
unreachable
46: ; preds = %38
%47 = add nsw i32 %34, 1
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %37, i64 %48
%50 = call i32 @sscanf(i8* %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
br label %69
51: ; preds = %33
%52 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%53 = call i64 @strncmp(i8* %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %52)
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %69
55: ; preds = %51
%56 = load i8*, i8** %14
%57 = sext i32 %52 to i64
%58 = getelementptr inbounds i8, i8* %56, i64 %57
%59 = load i8, i8* %58
%60 = icmp eq i8 %59, 61
br i1 %60, label %64, label %61
61: ; preds = %55
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %56)
%63 = call i32 @exit(i32 1)
unreachable
64: ; preds = %55
%65 = add nsw i32 %52, 1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8, i8* %56, i64 %66
%68 = call i32 @sscanf(i8* %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %5)
br label %69
69: ; preds = %28, %51, %64, %46
%70 = add nuw nsw i64 %13, 1
%71 = icmp eq i64 %70, %11
br i1 %71, label %72, label %12
72: ; preds = %69
%73 = load i32, i32* %3
br label %74
74: ; preds = %72, %2
%75 = phi i32 [ %73, %72 ], [ 16777216, %2 ]
%76 = call i64 @malloc(i32 %75)
%77 = inttoptr i64 %76 to i32*
%78 = load i32, i32* %3
%79 = call i64 @malloc(i32 %78)
%80 = inttoptr i64 %79 to i32*
%81 = load i32, i32* %3
%82 = icmp sgt i32 %81, 3
br i1 %82, label %83, label %93
83: ; preds = %74, %83
%84 = phi i64 [ %85, %83 ], [ 0, %74 ]
%85 = add nuw nsw i64 %84, 1
%86 = getelementptr inbounds i32, i32* %77, i64 %84
%87 = trunc i64 %85 to i32
store i32 %87, i32* %86
%88 = getelementptr inbounds i32, i32* %80, i64 %84
store i32 0, i32* %88
%89 = load i32, i32* %3
%90 = sdiv i32 %89, 4
%91 = sext i32 %90 to i64
%92 = icmp slt i64 %85, %91
br i1 %92, label %83, label %93
93: ; preds = %83, %74
%94 = phi i32 [ %81, %74 ], [ %89, %83 ]
%95 = load i32, i32* %4
%96 = load i32, i32* %5
%97 = call i32 @gdev_test_memcpy(i32* %77, i32* %80, i32 %94, i32 %95, i32 %96)
%98 = load i32, i32* %3
%99 = icmp sgt i32 %98, 3
br i1 %99, label %100, label %119
100: ; preds = %93
%101 = lshr i32 %98, 2
%102 = zext i32 %101 to i64
br label %103
103: ; preds = %100, %116
%104 = phi i64 [ 0, %100 ], [ %117, %116 ]
%105 = getelementptr inbounds i32, i32* %77, i64 %104
%106 = load i32, i32* %105
%107 = getelementptr inbounds i32, i32* %80, i64 %104
%108 = load i32, i32* %107
%109 = icmp eq i32 %106, %108
br i1 %109, label %116, label %110
110: ; preds = %103
%111 = trunc i64 %104 to i32
%112 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i32 %111, i32 %106, i32 %111, i32 %108)
%113 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%114 = call i32 @free(i32* %77)
%115 = call i32 @free(i32* %80)
br label %122
116: ; preds = %103
%117 = add nuw nsw i64 %104, 1
%118 = icmp eq i64 %117, %102
br i1 %118, label %119, label %103
119: ; preds = %116, %93
%120 = call i32 @free(i32* %77)
%121 = call i32 @free(i32* %80)
br label %122
122: ; preds = %110, %119
ret i32 0
}