#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*/ delay(int /*<<< orphan*/, int, int, int, int, int, int, int);
int xxxxx(int start, int end, int a, int b, int c, int d) {
  int i = start + a + b + c + d;
  volatile unsigned long *gpmcon = (volatile unsigned long *)0x7F008820;
  volatile unsigned long *gpmdat = (volatile unsigned long *)0x7F008824;
  *gpmcon = 0x1111;
  while (1) {
    *gpmdat = i;
    i++;
    if (i == end)
      i = start;
    delay(0, 1, 2, 3, 4, 5, 6, 0x10000);
  }
  return 0;
}


x86 assembly (clang, -O0):
<xxxxx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x7f008820,%eax
mov    %rax,-0x28(%rbp)
mov    $0x7f008824,%eax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movq   $0x1111,(%rax)
movslq -0x1c(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1181 <xxxxx+0x71>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
movl   $0x6,(%rsp)
movl   $0x10000,0x8(%rsp)
call   1030 <delay@plt>
jmp    115b <xxxxx+0x4b>

x86 assembly (clang, -O2):
<xxxxx>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
add    %edi,%ebx
add    %ecx,%ebx
add    %r8d,%ebx
add    %r9d,%ebx
movq   $0x1111,0x7f008820
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq %ebx,%rbx
mov    %rbx,0x7f008824
7f
add    $0x1,%ebx
cmp    %r14d,%ebx
cmove  %ebp,%ebx
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
push   $0x10000
push   $0x6
call   1030 <delay@plt>
add    $0x10,%rsp
jmp    1140 <xxxxx+0x30>

LLVM IR (-O0):
define i32 @xxxxx(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i64*
%15 = alloca i64*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%16 = load i32, i32* %7
%17 = load i32, i32* %9
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %10
%20 = add nsw i32 %18, %19
%21 = load i32, i32* %11
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %12
%24 = add nsw i32 %22, %23
store i32 %24, i32* %13
store i64* inttoptr (i64 2130741280 to i64*), i64** %14
store i64* inttoptr (i64 2130741284 to i64*), i64** %15
%25 = load i64*, i64** %14
store volatile i64 4369, i64* %25
br label %26
26: ; preds = %6, %37
%27 = load i32, i32* %13
%28 = sext i32 %27 to i64
%29 = load i64*, i64** %15
store volatile i64 %28, i64* %29
%30 = load i32, i32* %13
%31 = add nsw i32 %30, 1
store i32 %31, i32* %13
%32 = load i32, i32* %13
%33 = load i32, i32* %8
%34 = icmp eq i32 %32, %33
br i1 %34, label %35, label %37
35: ; preds = %26
%36 = load i32, i32* %7
store i32 %36, i32* %13
br label %37
37: ; preds = %35, %26
%38 = call i32 @delay(i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 65536)
br label %26
}

LLVM IR (-O2):
define i32 @xxxxx(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = add nsw i32 %2, %0
%8 = add nsw i32 %7, %3
%9 = add nsw i32 %8, %4
%10 = add nsw i32 %9, %5
store volatile i64 4369, i64* inttoptr (i64 2130741280 to i64*)
br label %11
11: ; preds = %11, %6
%12 = phi i32 [ %10, %6 ], [ %16, %11 ]
%13 = sext i32 %12 to i64
store volatile i64 %13, i64* inttoptr (i64 2130741284 to i64*)
%14 = add nsw i32 %12, 1
%15 = icmp eq i32 %14, %1
%16 = select i1 %15, i32 %0, i32 %14
%17 = tail call i32 @delay(i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 65536)
br label %11
}