#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 uint64_t;

/* Variables and functions */
void __attribute__((noipa))
test_0xffffffff_uint64_t(uint64_t *restrict r, uint64_t *restrict a,
                         uint64_t *restrict b) {
  for (int i = 0; i < (320 / sizeof(uint64_t)); ++i)
    r[i] = a[i] > 20 ? b[i] & 0xffffffff : 0;
}


x86 assembly (clang, -O0):
<test_0xffffffff_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x50,%rax
jae    1173 <test_0xffffffff_uint64_t+0x73>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpl   $0x14,(%rax,%rcx,4)
jle    114d <test_0xffffffff_uint64_t+0x4d>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
and    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1157 <test_0xffffffff_uint64_t+0x57>
xor    %eax,%eax
mov    %eax,-0x20(%rbp)
jmp    1157 <test_0xffffffff_uint64_t+0x57>
mov    -0x20(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <test_0xffffffff_uint64_t+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_0xffffffff_uint64_t>:
mov    $0x1,%eax
jmp    111e <test_0xffffffff_uint64_t+0x1e>
nopw   0x0(%rax,%rax,1)
mov    %r8d,(%rdi,%rax,4)
add    $0x2,%rax
cmp    $0x51,%rax
je     1141 <test_0xffffffff_uint64_t+0x41>
xor    %r8d,%r8d
cmpl   $0x15,-0x4(%rsi,%rax,4)
mov    $0x0,%ecx
jl     1131 <test_0xffffffff_uint64_t+0x31>
mov    -0x4(%rdx,%rax,4),%ecx
mov    %ecx,-0x4(%rdi,%rax,4)
cmpl   $0x15,(%rsi,%rax,4)
jl     1110 <test_0xffffffff_uint64_t+0x10>
mov    (%rdx,%rax,4),%r8d
jmp    1110 <test_0xffffffff_uint64_t+0x10>
ret

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

LLVM IR (-O2):
define void @test_0xffffffff_uint64_t(i32* noalias nocapture writeonly %0, i32* noalias nocapture %1, i32* noalias nocapture %2) {
br label %5
4: ; preds = %23
ret void
5: ; preds = %23, %3
%6 = phi i64 [ 0, %3 ], [ %26, %23 ]
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, 20
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = getelementptr inbounds i32, i32* %2, i64 %6
%12 = load i32, i32* %11
br label %13
13: ; preds = %5, %10
%14 = phi i32 [ %12, %10 ], [ 0, %5 ]
%15 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %14, i32* %15
%16 = or i64 %6, 1
%17 = getelementptr inbounds i32, i32* %1, i64 %16
%18 = load i32, i32* %17
%19 = icmp sgt i32 %18, 20
br i1 %19, label %20, label %23
20: ; preds = %13
%21 = getelementptr inbounds i32, i32* %2, i64 %16
%22 = load i32, i32* %21
br label %23
23: ; preds = %20, %13
%24 = phi i32 [ %22, %20 ], [ 0, %13 ]
%25 = getelementptr inbounds i32, i32* %0, i64 %16
store i32 %24, i32* %25
%26 = add nuw nsw i64 %6, 2
%27 = icmp eq i64 %26, 80
br i1 %27, label %4, label %5
}