#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*/ resist_p_combine_accum_help(int const, int *);
void resist_p_vec(int n, const int *vals, const int *auxs, int *accum,
                  int *accum_aux) {
  int i;
  *accum = 100;
  *accum_aux = 100;
  for (i = 0; i < n; ++i) {
    resist_p_combine_accum_help(vals[i], accum);
    resist_p_combine_accum_help(auxs[i], accum_aux);
  }
}


x86 assembly (clang, -O0):
<resist_p_vec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x64,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x64,(%rax)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1188 <resist_p_vec+0x78>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x20(%rbp),%rsi
call   1030 <resist_p_combine_accum_help@plt>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x28(%rbp),%rsi
call   1030 <resist_p_combine_accum_help@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1146 <resist_p_vec+0x36>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resist_p_vec>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x64,(%rcx)
movl   $0x64,(%r8)
test   %edi,%edi
jle    1161 <resist_p_vec+0x51>
mov    %r8,%r14
mov    %rcx,%r13
mov    %rdx,%r15
mov    %rsi,%r12
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    (%r12,%rbp,4),%edi
mov    %r13,%rsi
call   1030 <resist_p_combine_accum_help@plt>
mov    (%r15,%rbp,4),%edi
mov    %r14,%rsi
call   1030 <resist_p_combine_accum_help@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1140 <resist_p_vec+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @resist_p_vec(i32 %0, i32* nocapture %1, i32* nocapture %2, i32* %3, i32* %4) {
store i32 100, i32* %3
store i32 100, i32* %4
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %19
7: ; preds = %5
%8 = zext i32 %0 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %17, %9 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = tail call i32 @resist_p_combine_accum_help(i32 %12, i32* %3)
%14 = getelementptr inbounds i32, i32* %2, i64 %10
%15 = load i32, i32* %14
%16 = tail call i32 @resist_p_combine_accum_help(i32 %15, i32* %4)
%17 = add nuw nsw i64 %10, 1
%18 = icmp eq i64 %17, %8
br i1 %18, label %19, label %9
19: ; preds = %9, %5
ret void
}