#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*/ MAP_SHARED;
int O_RDWR;
int O_SYNC;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ dma_mm2s_status(unsigned int *);
int /*<<< orphan*/ dma_mm2s_sync(unsigned int *);
int /*<<< orphan*/ dma_s2mm_status(unsigned int *);
int /*<<< orphan*/ dma_s2mm_sync(unsigned int *);
int /*<<< orphan*/ dma_set(unsigned int *, int, int);
int /*<<< orphan*/ memdump(unsigned int *, int);
int /*<<< orphan*/ memset(unsigned int *, int /*<<< orphan*/, int);
unsigned int *mmap(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/, int,
                   int);
int open(char *, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int dh = open("/dev/mem", O_RDWR | O_SYNC);
  unsigned int *virtual_address =
      mmap(NULL, 65535, PROT_READ | PROT_WRITE, MAP_SHARED, dh, 0x40400000);
  unsigned int *virtual_source_address =
      mmap(NULL, 65535, PROT_READ | PROT_WRITE, MAP_SHARED, dh, 0x0e000000);
  unsigned int *virtual_destination_address =
      mmap(NULL, 65535, PROT_READ | PROT_WRITE, MAP_SHARED, dh, 0x0f000000);
  virtual_source_address[0] = 0x11223344;
  memset(virtual_destination_address, 0, 32);
  printf("Source memory block:      ");
  memdump(virtual_source_address, 32);
  printf("Destination memory block: ");
  memdump(virtual_destination_address, 32);
  printf("Resetting DMA\n");
  dma_set(virtual_address, 0x30, 4);
  dma_set(virtual_address, 0x00, 4);
  dma_s2mm_status(virtual_address);
  dma_mm2s_status(virtual_address);
  printf("Halting DMA\n");
  dma_set(virtual_address, 0x30, 0);
  dma_set(virtual_address, 0x00, 0);
  dma_s2mm_status(virtual_address);
  dma_mm2s_status(virtual_address);
  printf("Writing destination address\n");
  dma_set(virtual_address, 0x48, 0x0f000000);
  dma_s2mm_status(virtual_address);
  printf("Writing source address...\n");
  dma_set(virtual_address, 0x18, 0x0e000000);
  dma_mm2s_status(virtual_address);
  printf("Starting S2MM channel with all interrupts masked...\n");
  dma_set(virtual_address, 0x30, 0xf001);
  dma_s2mm_status(virtual_address);
  printf("Starting MM2S channel with all interrupts masked...\n");
  dma_set(virtual_address, 0x00, 0xf001);
  dma_mm2s_status(virtual_address);
  printf("Writing S2MM transfer length...\n");
  dma_set(virtual_address, 0x58, 32);
  dma_s2mm_status(virtual_address);
  printf("Writing MM2S transfer length...\n");
  dma_set(virtual_address, 0x28, 32);
  dma_mm2s_status(virtual_address);
  printf("Waiting for MM2S synchronization...\n");
  dma_mm2s_sync(virtual_address);
  printf("Waiting for S2MM sychronization...\n");
  dma_s2mm_sync(virtual_address);
  dma_s2mm_status(virtual_address);
  dma_mm2s_status(virtual_address);
  printf("Destination memory block: ");
  memdump(virtual_destination_address, 32);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2e29(%rip),%rax
mov    (%rax),%esi
mov    0x2e18(%rip),%rax
or     (%rax),%esi
lea    0xe3f(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e28(%rip),%rax
mov    (%rax),%edx
mov    0x2de7(%rip),%rax
or     (%rax),%edx
mov    0x2e06(%rip),%rax
mov    (%rax),%ecx
mov    -0x4(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0xffff,%esi
mov    $0x40400000,%r9d
call   1050 <mmap@plt>
mov    %rax,-0x10(%rbp)
mov    0x2df1(%rip),%rax
mov    (%rax),%edx
mov    0x2db0(%rip),%rax
or     (%rax),%edx
mov    0x2dcf(%rip),%rax
mov    (%rax),%ecx
mov    -0x4(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0xffff,%esi
mov    $0xe000000,%r9d
call   1050 <mmap@plt>
mov    %rax,-0x18(%rbp)
mov    0x2dba(%rip),%rax
mov    (%rax),%edx
mov    0x2d79(%rip),%rax
or     (%rax),%edx
mov    0x2d98(%rip),%rax
mov    (%rax),%ecx
mov    -0x4(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0xffff,%esi
mov    $0xf000000,%r9d
call   1050 <mmap@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x11223344,(%rax)
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1070 <memset@plt>
lea    0xd7a(%rip),%rdi
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x20,%esi
call   10b0 <memdump@plt>
lea    0xd7b(%rip),%rdi
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    $0x20,%esi
call   10b0 <memdump@plt>
lea    0xd7c(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x30,%esi
mov    $0x4,%edx
call   1080 <dma_set@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1080 <dma_set@plt>
mov    -0x10(%rbp),%rdi
call   1040 <dma_s2mm_status@plt>
mov    -0x10(%rbp),%rdi
call   1030 <dma_mm2s_status@plt>
lea    0xd4a(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x30,%esi
xor    %edx,%edx
call   1080 <dma_set@plt>
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1080 <dma_set@plt>
mov    -0x10(%rbp),%rdi
call   1040 <dma_s2mm_status@plt>
mov    -0x10(%rbp),%rdi
call   1030 <dma_mm2s_status@plt>
lea    0xd1c(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x48,%esi
mov    $0xf000000,%edx
call   1080 <dma_set@plt>
mov    -0x10(%rbp),%rdi
call   1040 <dma_s2mm_status@plt>
lea    0xd11(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x18,%esi
mov    $0xe000000,%edx
call   1080 <dma_set@plt>
mov    -0x10(%rbp),%rdi
call   1030 <dma_mm2s_status@plt>
lea    0xd04(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x30,%esi
mov    $0xf001,%edx
call   1080 <dma_set@plt>
mov    -0x10(%rbp),%rdi
call   1040 <dma_s2mm_status@plt>
lea    0xd11(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xf001,%edx
call   1080 <dma_set@plt>
mov    -0x10(%rbp),%rdi
call   1030 <dma_mm2s_status@plt>
lea    0xd21(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x58,%esi
mov    $0x20,%edx
call   1080 <dma_set@plt>
mov    -0x10(%rbp),%rdi
call   1040 <dma_s2mm_status@plt>
lea    0xd1a(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x28,%esi
mov    $0x20,%edx
call   1080 <dma_set@plt>
mov    -0x10(%rbp),%rdi
call   1030 <dma_mm2s_status@plt>
lea    0xd13(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   10c0 <dma_mm2s_sync@plt>
lea    0xd23(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1090 <dma_s2mm_sync@plt>
mov    -0x10(%rbp),%rdi
call   1040 <dma_s2mm_status@plt>
mov    -0x10(%rbp),%rdi
call   1030 <dma_mm2s_status@plt>
lea    0xbbc(%rip),%rdi
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    $0x20,%esi
call   10b0 <memdump@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    0x2e16(%rip),%rax
mov    0x2e07(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xe2c(%rip),%rdi
call   10b0 <open@plt>
mov    %eax,%ebp
mov    0x2e16(%rip),%r14
mov    0x2dd7(%rip),%r12
mov    (%r12),%edx
or     (%r14),%edx
mov    0x2df1(%rip),%r13
mov    0x0(%r13),%ecx
xor    %edi,%edi
mov    $0xffff,%esi
mov    %eax,%r8d
mov    $0x40400000,%r9d
call   1060 <mmap@plt>
mov    %rax,%rbx
mov    (%r12),%edx
or     (%r14),%edx
mov    0x0(%r13),%ecx
xor    %edi,%edi
mov    $0xffff,%esi
mov    %ebp,%r8d
mov    $0xe000000,%r9d
call   1060 <mmap@plt>
mov    %rax,%r15
mov    (%r12),%edx
or     (%r14),%edx
mov    0x0(%r13),%ecx
xor    %edi,%edi
mov    $0xffff,%esi
mov    %ebp,%r8d
mov    $0xf000000,%r9d
call   1060 <mmap@plt>
mov    %rax,%r14
movl   $0x11223344,(%r15)
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1080 <memset@plt>
lea    0xd93(%rip),%rdi
call   1070 <printf@plt>
mov    %r15,%rdi
mov    $0x20,%esi
call   10c0 <memdump@plt>
lea    0xd95(%rip),%r15
mov    %r15,%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x20,%esi
call   10c0 <memdump@plt>
lea    0xd94(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    $0x30,%esi
mov    $0x4,%edx
call   1090 <dma_set@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1090 <dma_set@plt>
mov    %rbx,%rdi
call   1040 <dma_s2mm_status@plt>
mov    %rbx,%rdi
call   1030 <dma_mm2s_status@plt>
lea    0xd65(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    $0x30,%esi
xor    %edx,%edx
call   1090 <dma_set@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1090 <dma_set@plt>
mov    %rbx,%rdi
call   1040 <dma_s2mm_status@plt>
mov    %rbx,%rdi
call   1030 <dma_mm2s_status@plt>
lea    0xd3a(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    $0x48,%esi
mov    $0xf000000,%edx
call   1090 <dma_set@plt>
mov    %rbx,%rdi
call   1040 <dma_s2mm_status@plt>
lea    0xd30(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    $0x18,%esi
mov    $0xe000000,%edx
call   1090 <dma_set@plt>
mov    %rbx,%rdi
call   1030 <dma_mm2s_status@plt>
lea    0xd24(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    $0x30,%esi
mov    $0xf001,%edx
call   1090 <dma_set@plt>
mov    %rbx,%rdi
call   1040 <dma_s2mm_status@plt>
lea    0xd32(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xf001,%edx
call   1090 <dma_set@plt>
mov    %rbx,%rdi
call   1030 <dma_mm2s_status@plt>
lea    0xd43(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    $0x58,%esi
mov    $0x20,%edx
call   1090 <dma_set@plt>
mov    %rbx,%rdi
call   1040 <dma_s2mm_status@plt>
lea    0xd3d(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
mov    $0x28,%esi
mov    $0x20,%edx
call   1090 <dma_set@plt>
mov    %rbx,%rdi
call   1030 <dma_mm2s_status@plt>
lea    0xd37(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   10d0 <dma_mm2s_sync@plt>
lea    0xd47(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   10a0 <dma_s2mm_sync@plt>
mov    %rbx,%rdi
call   1040 <dma_s2mm_status@plt>
mov    %rbx,%rdi
call   1030 <dma_mm2s_status@plt>
mov    %r15,%rdi
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x20,%esi
call   10c0 <memdump@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/mem\00"
@O_RDWR = global i32 0
@O_SYNC = global i32 0
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.1 = [27 x i8] c"Source memory block: \00"
@.str.2 = [27 x i8] c"Destination memory block: \00"
@.str.3 = [15 x i8] c"Resetting DMA\0A\00"
@.str.4 = [13 x i8] c"Halting DMA\0A\00"
@.str.5 = [29 x i8] c"Writing destination address\0A\00"
@.str.6 = [27 x i8] c"Writing source address...\0A\00"
@.str.7 = [53 x i8] c"Starting S2MM channel with all interrupts masked...\0A\00"
@.str.8 = [53 x i8] c"Starting MM2S channel with all interrupts masked...\0A\00"
@.str.9 = [33 x i8] c"Writing S2MM transfer length...\0A\00"
@.str.10 = [33 x i8] c"Writing MM2S transfer length...\0A\00"
@.str.11 = [37 x i8] c"Waiting for MM2S synchronization...\0A\00"
@.str.12 = [36 x i8] c"Waiting for S2MM sychronization...\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = load i32, i32* @O_RDWR
%6 = load i32, i32* @O_SYNC
%7 = or i32 %5, %6
%8 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %1
%9 = load i32, i32* @PROT_READ
%10 = load i32, i32* @PROT_WRITE
%11 = or i32 %9, %10
%12 = load i32, i32* @MAP_SHARED
%13 = load i32, i32* %1
%14 = call i32* @mmap(i32* null, i32 65535, i32 %11, i32 %12, i32 %13, i32 1077936128)
store i32* %14, i32** %2
%15 = load i32, i32* @PROT_READ
%16 = load i32, i32* @PROT_WRITE
%17 = or i32 %15, %16
%18 = load i32, i32* @MAP_SHARED
%19 = load i32, i32* %1
%20 = call i32* @mmap(i32* null, i32 65535, i32 %17, i32 %18, i32 %19, i32 234881024)
store i32* %20, i32** %3
%21 = load i32, i32* @PROT_READ
%22 = load i32, i32* @PROT_WRITE
%23 = or i32 %21, %22
%24 = load i32, i32* @MAP_SHARED
%25 = load i32, i32* %1
%26 = call i32* @mmap(i32* null, i32 65535, i32 %23, i32 %24, i32 %25, i32 251658240)
store i32* %26, i32** %4
%27 = load i32*, i32** %3
%28 = getelementptr inbounds i32, i32* %27, i64 0
store i32 287454020, i32* %28
%29 = load i32*, i32** %4
%30 = call i32 @memset(i32* %29, i32 0, i32 32)
%31 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%32 = load i32*, i32** %3
%33 = call i32 @memdump(i32* %32, i32 32)
%34 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%35 = load i32*, i32** %4
%36 = call i32 @memdump(i32* %35, i32 32)
%37 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%38 = load i32*, i32** %2
%39 = call i32 @dma_set(i32* %38, i32 48, i32 4)
%40 = load i32*, i32** %2
%41 = call i32 @dma_set(i32* %40, i32 0, i32 4)
%42 = load i32*, i32** %2
%43 = call i32 @dma_s2mm_status(i32* %42)
%44 = load i32*, i32** %2
%45 = call i32 @dma_mm2s_status(i32* %44)
%46 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%47 = load i32*, i32** %2
%48 = call i32 @dma_set(i32* %47, i32 48, i32 0)
%49 = load i32*, i32** %2
%50 = call i32 @dma_set(i32* %49, i32 0, i32 0)
%51 = load i32*, i32** %2
%52 = call i32 @dma_s2mm_status(i32* %51)
%53 = load i32*, i32** %2
%54 = call i32 @dma_mm2s_status(i32* %53)
%55 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%56 = load i32*, i32** %2
%57 = call i32 @dma_set(i32* %56, i32 72, i32 251658240)
%58 = load i32*, i32** %2
%59 = call i32 @dma_s2mm_status(i32* %58)
%60 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%61 = load i32*, i32** %2
%62 = call i32 @dma_set(i32* %61, i32 24, i32 234881024)
%63 = load i32*, i32** %2
%64 = call i32 @dma_mm2s_status(i32* %63)
%65 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.7, i64 0, i64 0))
%66 = load i32*, i32** %2
%67 = call i32 @dma_set(i32* %66, i32 48, i32 61441)
%68 = load i32*, i32** %2
%69 = call i32 @dma_s2mm_status(i32* %68)
%70 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.8, i64 0, i64 0))
%71 = load i32*, i32** %2
%72 = call i32 @dma_set(i32* %71, i32 0, i32 61441)
%73 = load i32*, i32** %2
%74 = call i32 @dma_mm2s_status(i32* %73)
%75 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
%76 = load i32*, i32** %2
%77 = call i32 @dma_set(i32* %76, i32 88, i32 32)
%78 = load i32*, i32** %2
%79 = call i32 @dma_s2mm_status(i32* %78)
%80 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0))
%81 = load i32*, i32** %2
%82 = call i32 @dma_set(i32* %81, i32 40, i32 32)
%83 = load i32*, i32** %2
%84 = call i32 @dma_mm2s_status(i32* %83)
%85 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0))
%86 = load i32*, i32** %2
%87 = call i32 @dma_mm2s_sync(i32* %86)
%88 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0))
%89 = load i32*, i32** %2
%90 = call i32 @dma_s2mm_sync(i32* %89)
%91 = load i32*, i32** %2
%92 = call i32 @dma_s2mm_status(i32* %91)
%93 = load i32*, i32** %2
%94 = call i32 @dma_mm2s_status(i32* %93)
%95 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%96 = load i32*, i32** %4
%97 = call i32 @memdump(i32* %96, i32 32)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/mem\00"
@O_RDWR = global i32 0
@O_SYNC = global i32 0
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.1 = [27 x i8] c"Source memory block: \00"
@.str.2 = [27 x i8] c"Destination memory block: \00"
@str = [14 x i8] c"Resetting DMA\00"
@str.13 = [12 x i8] c"Halting DMA\00"
@str.14 = [28 x i8] c"Writing destination address\00"
@str.15 = [26 x i8] c"Writing source address...\00"
@str.16 = [52 x i8] c"Starting S2MM channel with all interrupts masked...\00"
@str.17 = [52 x i8] c"Starting MM2S channel with all interrupts masked...\00"
@str.18 = [32 x i8] c"Writing S2MM transfer length...\00"
@str.19 = [32 x i8] c"Writing MM2S transfer length...\00"
@str.20 = [36 x i8] c"Waiting for MM2S synchronization...\00"
@str.21 = [35 x i8] c"Waiting for S2MM sychronization...\00"
define i32 @main() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_SYNC
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @PROT_READ
%6 = load i32, i32* @PROT_WRITE
%7 = or i32 %6, %5
%8 = load i32, i32* @MAP_SHARED
%9 = tail call i32* @mmap(i32* null, i32 65535, i32 %7, i32 %8, i32 %4, i32 1077936128)
%10 = load i32, i32* @PROT_READ
%11 = load i32, i32* @PROT_WRITE
%12 = or i32 %11, %10
%13 = load i32, i32* @MAP_SHARED
%14 = tail call i32* @mmap(i32* null, i32 65535, i32 %12, i32 %13, i32 %4, i32 234881024)
%15 = load i32, i32* @PROT_READ
%16 = load i32, i32* @PROT_WRITE
%17 = or i32 %16, %15
%18 = load i32, i32* @MAP_SHARED
%19 = tail call i32* @mmap(i32* null, i32 65535, i32 %17, i32 %18, i32 %4, i32 251658240)
store i32 287454020, i32* %14
%20 = tail call i32 @memset(i32* %19, i32 0, i32 32)
%21 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%22 = tail call i32 @memdump(i32* %14, i32 32)
%23 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%24 = tail call i32 @memdump(i32* %19, i32 32)
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%26 = tail call i32 @dma_set(i32* %9, i32 48, i32 4)
%27 = tail call i32 @dma_set(i32* %9, i32 0, i32 4)
%28 = tail call i32 @dma_s2mm_status(i32* %9)
%29 = tail call i32 @dma_mm2s_status(i32* %9)
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.13, i64 0, i64 0))
%31 = tail call i32 @dma_set(i32* %9, i32 48, i32 0)
%32 = tail call i32 @dma_set(i32* %9, i32 0, i32 0)
%33 = tail call i32 @dma_s2mm_status(i32* %9)
%34 = tail call i32 @dma_mm2s_status(i32* %9)
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.14, i64 0, i64 0))
%36 = tail call i32 @dma_set(i32* %9, i32 72, i32 251658240)
%37 = tail call i32 @dma_s2mm_status(i32* %9)
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.15, i64 0, i64 0))
%39 = tail call i32 @dma_set(i32* %9, i32 24, i32 234881024)
%40 = tail call i32 @dma_mm2s_status(i32* %9)
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.16, i64 0, i64 0))
%42 = tail call i32 @dma_set(i32* %9, i32 48, i32 61441)
%43 = tail call i32 @dma_s2mm_status(i32* %9)
%44 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.17, i64 0, i64 0))
%45 = tail call i32 @dma_set(i32* %9, i32 0, i32 61441)
%46 = tail call i32 @dma_mm2s_status(i32* %9)
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.18, i64 0, i64 0))
%48 = tail call i32 @dma_set(i32* %9, i32 88, i32 32)
%49 = tail call i32 @dma_s2mm_status(i32* %9)
%50 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.19, i64 0, i64 0))
%51 = tail call i32 @dma_set(i32* %9, i32 40, i32 32)
%52 = tail call i32 @dma_mm2s_status(i32* %9)
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.20, i64 0, i64 0))
%54 = tail call i32 @dma_mm2s_sync(i32* %9)
%55 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.21, i64 0, i64 0))
%56 = tail call i32 @dma_s2mm_sync(i32* %9)
%57 = tail call i32 @dma_s2mm_status(i32* %9)
%58 = tail call i32 @dma_mm2s_status(i32* %9)
%59 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%60 = tail call i32 @memdump(i32* %19, i32 32)
ret i32 0
}