#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*/ alu_reset();
void op_alu_reset(char rega[], char regb[], char accumulator[], char flags[]) {
  int i;
  alu_reset();
  for (i = 0; i < 8; i++) {
    rega[i] = '0';
    regb[i] = '0';
    accumulator[i] = '0';
    flags[i] = '0';
  }
}


x86 assembly (clang, -O0):
<op_alu_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <alu_reset@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x8,-0x24(%rbp)
jge    117e <op_alu_reset+0x6e>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x30,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x30,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x30,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movb   $0x30,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1136 <op_alu_reset+0x26>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_alu_reset>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <alu_reset@plt>
movb   $0x30,(%rbx)
movb   $0x30,(%r12)
movb   $0x30,(%r15)
movb   $0x30,(%r14)
movb   $0x30,0x1(%rbx)
movb   $0x30,0x1(%r12)
movb   $0x30,0x1(%r15)
movb   $0x30,0x1(%r14)
movb   $0x30,0x2(%rbx)
movb   $0x30,0x2(%r12)
movb   $0x30,0x2(%r15)
movb   $0x30,0x2(%r14)
movb   $0x30,0x3(%rbx)
movb   $0x30,0x3(%r12)
movb   $0x30,0x3(%r15)
movb   $0x30,0x3(%r14)
movb   $0x30,0x4(%rbx)
movb   $0x30,0x4(%r12)
movb   $0x30,0x4(%r15)
movb   $0x30,0x4(%r14)
movb   $0x30,0x5(%rbx)
movb   $0x30,0x5(%r12)
movb   $0x30,0x5(%r15)
movb   $0x30,0x5(%r14)
movb   $0x30,0x6(%rbx)
movb   $0x30,0x6(%r12)
movb   $0x30,0x6(%r15)
movb   $0x30,0x6(%r14)
movb   $0x30,0x7(%rbx)
movb   $0x30,0x7(%r12)
movb   $0x30,0x7(%r15)
movb   $0x30,0x7(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @op_alu_reset(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = call i32 (...) @alu_reset()
store i32 0, i32* %9
br label %11
11: ; preds = %31, %4
%12 = load i32, i32* %9
%13 = icmp slt i32 %12, 8
br i1 %13, label %14, label %34
14: ; preds = %11
%15 = load i8*, i8** %5
%16 = load i32, i32* %9
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 48, i8* %18
%19 = load i8*, i8** %6
%20 = load i32, i32* %9
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 48, i8* %22
%23 = load i8*, i8** %7
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 48, i8* %26
%27 = load i8*, i8** %8
%28 = load i32, i32* %9
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
store i8 48, i8* %30
br label %31
31: ; preds = %14
%32 = load i32, i32* %9
%33 = add nsw i32 %32, 1
store i32 %33, i32* %9
br label %11
34: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @op_alu_reset(i8* nocapture writeonly %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2, i8* nocapture writeonly %3) {
%5 = tail call i32 (...) @alu_reset()
store i8 48, i8* %0
store i8 48, i8* %1
store i8 48, i8* %2
store i8 48, i8* %3
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 48, i8* %6
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 48, i8* %7
%8 = getelementptr inbounds i8, i8* %2, i64 1
store i8 48, i8* %8
%9 = getelementptr inbounds i8, i8* %3, i64 1
store i8 48, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 48, i8* %10
%11 = getelementptr inbounds i8, i8* %1, i64 2
store i8 48, i8* %11
%12 = getelementptr inbounds i8, i8* %2, i64 2
store i8 48, i8* %12
%13 = getelementptr inbounds i8, i8* %3, i64 2
store i8 48, i8* %13
%14 = getelementptr inbounds i8, i8* %0, i64 3
store i8 48, i8* %14
%15 = getelementptr inbounds i8, i8* %1, i64 3
store i8 48, i8* %15
%16 = getelementptr inbounds i8, i8* %2, i64 3
store i8 48, i8* %16
%17 = getelementptr inbounds i8, i8* %3, i64 3
store i8 48, i8* %17
%18 = getelementptr inbounds i8, i8* %0, i64 4
store i8 48, i8* %18
%19 = getelementptr inbounds i8, i8* %1, i64 4
store i8 48, i8* %19
%20 = getelementptr inbounds i8, i8* %2, i64 4
store i8 48, i8* %20
%21 = getelementptr inbounds i8, i8* %3, i64 4
store i8 48, i8* %21
%22 = getelementptr inbounds i8, i8* %0, i64 5
store i8 48, i8* %22
%23 = getelementptr inbounds i8, i8* %1, i64 5
store i8 48, i8* %23
%24 = getelementptr inbounds i8, i8* %2, i64 5
store i8 48, i8* %24
%25 = getelementptr inbounds i8, i8* %3, i64 5
store i8 48, i8* %25
%26 = getelementptr inbounds i8, i8* %0, i64 6
store i8 48, i8* %26
%27 = getelementptr inbounds i8, i8* %1, i64 6
store i8 48, i8* %27
%28 = getelementptr inbounds i8, i8* %2, i64 6
store i8 48, i8* %28
%29 = getelementptr inbounds i8, i8* %3, i64 6
store i8 48, i8* %29
%30 = getelementptr inbounds i8, i8* %0, i64 7
store i8 48, i8* %30
%31 = getelementptr inbounds i8, i8* %1, i64 7
store i8 48, i8* %31
%32 = getelementptr inbounds i8, i8* %2, i64 7
store i8 48, i8* %32
%33 = getelementptr inbounds i8, i8* %3, i64 7
store i8 48, i8* %33
ret void
}