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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ code_ACC_word_DAT_number(int, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ derive_first_word(int, char const *, int *, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void code_ACC_word_PL(const uint8_t ACC_GEN_size,
                      const char *restrict ACC_independentClause,
                      uint8_t *restrict DAT_GEN_size,
                      uint16_t *restrict DAT_code_independentClause,
                      uint8_t *restrict DAT_GEN_remainder) {
  char DAT_word[0x05];
  uint8_t DAT_word_GEN_size = 0x05;
  uint8_t i = 0;
  uint8_t j = 0;
  uint16_t number = 0;
  memset(DAT_word, 0, 0x05);
  assert(ACC_independentClause != NULL);
  assert(ACC_GEN_size > 0);
  assert(DAT_code_independentClause != NULL);
  assert(*DAT_GEN_size >= ACC_GEN_size / 2);
  for (; i < ACC_GEN_size; j++) {
    derive_first_word((uint8_t)(ACC_GEN_size - i), ACC_independentClause + i,
                      &DAT_word_GEN_size, DAT_word);
    if (DAT_word_GEN_size == 0) {
      *DAT_GEN_remainder = (uint8_t)(ACC_GEN_size - i);
      break;
    }
    code_ACC_word_DAT_number(DAT_word_GEN_size, DAT_word, &number);
    i = (uint8_t)(i + DAT_word_GEN_size);
    DAT_code_independentClause[j] = number;
    DAT_word_GEN_size = 0x05;
  }
  *DAT_GEN_size = j;
}


x86 assembly (clang, -O0):
<code_ACC_word_PL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x5,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
lea    -0x2d(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1050 <memset@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpq   $0x0,-0x20(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
cmp    %ecx,%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1265 <code_ACC_word_PL+0x125>
mov    -0x4(%rbp),%edi
sub    -0x38(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x38(%rbp),%rax
add    %rax,%rsi
lea    -0x2d(%rbp),%rcx
lea    -0x34(%rbp),%rdx
call   1030 <derive_first_word@plt>
cmpl   $0x0,-0x34(%rbp)
jne    1229 <code_ACC_word_PL+0xe9>
mov    -0x4(%rbp),%ecx
sub    -0x38(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
jmp    1265 <code_ACC_word_PL+0x125>
mov    -0x34(%rbp),%edi
lea    -0x2d(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1040 <code_ACC_word_DAT_number@plt>
mov    -0x38(%rbp),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x40(%rbp),%edx
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
movl   $0x5,-0x34(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11e4 <code_ACC_word_PL+0xa4>
mov    -0x3c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code_ACC_word_PL>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,%r14
mov    %rcx,%rbp
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %edi,%r15d
movl   $0x5,(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xb(%rsp),%rdi
xor    %r13d,%r13d
xor    %esi,%esi
mov    $0x5,%edx
call   1050 <memset@plt>
xor    %edi,%edi
mov    %rbx,0x20(%rsp)
test   %rbx,%rbx
setne  %dil
call   1060 <assert@plt>
xor    %edi,%edi
test   %r15d,%r15d
setg   %dil
call   1060 <assert@plt>
xor    %edi,%edi
mov    %rbp,%rbx
test   %rbp,%rbp
setne  %dil
call   1060 <assert@plt>
mov    %r15d,%eax
shr    $0x1f,%eax
add    %r15d,%eax
sar    %eax
xor    %edi,%edi
cmp    %eax,(%r12)
setge  %dil
call   1060 <assert@plt>
test   %r15d,%r15d
jle    1249 <code_ACC_word_PL+0x109>
mov    %r14,0x18(%rsp)
mov    %r12,0x10(%rsp)
xor    %r13d,%r13d
lea    0xb(%rsp),%r14
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
mov    %r15d,%ebp
sub    %r12d,%ebp
movslq %r12d,%rsi
add    0x20(%rsp),%rsi
mov    %ebp,%edi
mov    %rsp,%rdx
mov    %r14,%rcx
call   1030 <derive_first_word@plt>
mov    (%rsp),%edi
test   %edi,%edi
je     123d <code_ACC_word_PL+0xfd>
mov    %r14,%rsi
lea    0x4(%rsp),%rdx
call   1040 <code_ACC_word_DAT_number@plt>
add    (%rsp),%r12d
mov    0x4(%rsp),%eax
mov    %eax,(%rbx,%r13,4)
movl   $0x5,(%rsp)
add    $0x1,%r13
cmp    %r15d,%r12d
jl     11f0 <code_ACC_word_PL+0xb0>
jmp    1244 <code_ACC_word_PL+0x104>
mov    0x18(%rsp),%rax
mov    %ebp,(%rax)
mov    0x10(%rsp),%r12
mov    %r13d,(%r12)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @code_ACC_word_PL(i32 %0, i8* noalias %1, i32* noalias %2, i32* noalias %3, i32* noalias %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca [5 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
store i32 5, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %11, i64 0, i64 0
%17 = call i32 @memset(i8* %16, i32 0, i32 5)
%18 = load i8*, i8** %7
%19 = icmp ne i8* %18, null
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = load i32, i32* %6
%23 = icmp sgt i32 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = load i32*, i32** %9
%27 = icmp ne i32* %26, null
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = load i32*, i32** %8
%31 = load i32, i32* %30
%32 = load i32, i32* %6
%33 = sdiv i32 %32, 2
%34 = icmp sge i32 %31, %33
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
br label %37
37: ; preds = %70, %5
%38 = load i32, i32* %13
%39 = load i32, i32* %6
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %73
41: ; preds = %37
%42 = load i32, i32* %6
%43 = load i32, i32* %13
%44 = sub nsw i32 %42, %43
%45 = load i8*, i8** %7
%46 = load i32, i32* %13
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8, i8* %45, i64 %47
%49 = getelementptr inbounds [5 x i8], [5 x i8]* %11, i64 0, i64 0
%50 = call i32 @derive_first_word(i32 %44, i8* %48, i32* %12, i8* %49)
%51 = load i32, i32* %12
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %58
53: ; preds = %41
%54 = load i32, i32* %6
%55 = load i32, i32* %13
%56 = sub nsw i32 %54, %55
%57 = load i32*, i32** %10
store i32 %56, i32* %57
br label %73
58: ; preds = %41
%59 = load i32, i32* %12
%60 = getelementptr inbounds [5 x i8], [5 x i8]* %11, i64 0, i64 0
%61 = call i32 @code_ACC_word_DAT_number(i32 %59, i8* %60, i32* %15)
%62 = load i32, i32* %13
%63 = load i32, i32* %12
%64 = add nsw i32 %62, %63
store i32 %64, i32* %13
%65 = load i32, i32* %15
%66 = load i32*, i32** %9
%67 = load i32, i32* %14
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i32, i32* %66, i64 %68
store i32 %65, i32* %69
store i32 5, i32* %12
br label %70
70: ; preds = %58
%71 = load i32, i32* %14
%72 = add nsw i32 %71, 1
store i32 %72, i32* %14
br label %37
73: ; preds = %53, %37
%74 = load i32, i32* %14
%75 = load i32*, i32** %8
store i32 %74, i32* %75
ret void
}

LLVM IR (-O2):
define void @code_ACC_word_PL(i32 %0, i8* noalias %1, i32* noalias nocapture %2, i32* noalias writeonly %3, i32* noalias nocapture writeonly %4) {
%6 = alloca [5 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%10 = bitcast i32* %7 to i8*
store i32 5, i32* %7
%11 = bitcast i32* %8 to i8*
store i32 0, i32* %8
%12 = call i32 @memset(i8* %9, i32 0, i32 5)
%13 = icmp ne i8* %1, null
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = icmp sgt i32 %0, 0
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = icmp ne i32* %3, null
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = load i32, i32* %2
%23 = sdiv i32 %0, 2
%24 = icmp sge i32 %22, %23
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
br i1 %16, label %27, label %48
27: ; preds = %5, %38
%28 = phi i64 [ %44, %38 ], [ 0, %5 ]
%29 = phi i32 [ %41, %38 ], [ 0, %5 ]
%30 = sub nsw i32 %0, %29
%31 = sext i32 %29 to i64
%32 = getelementptr inbounds i8, i8* %1, i64 %31
%33 = call i32 @derive_first_word(i32 %30, i8* %32, i32* %7, i8* %9)
%34 = load i32, i32* %7
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %27
%37 = trunc i64 %28 to i32
store i32 %30, i32* %4
br label %48
38: ; preds = %27
%39 = call i32 @code_ACC_word_DAT_number(i32 %34, i8* %9, i32* %8)
%40 = load i32, i32* %7
%41 = add nsw i32 %40, %29
%42 = load i32, i32* %8
%43 = getelementptr inbounds i32, i32* %3, i64 %28
store i32 %42, i32* %43
store i32 5, i32* %7
%44 = add nuw i64 %28, 1
%45 = icmp slt i32 %41, %0
br i1 %45, label %27, label %46
46: ; preds = %38
%47 = trunc i64 %44 to i32
br label %48
48: ; preds = %46, %5, %36
%49 = phi i32 [ %37, %36 ], [ 0, %5 ], [ %47, %46 ]
store i32 %49, i32* %2
ret void
}