#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;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void round2(uint64_t *out, const uint32_t *in) {
  int i;
  memset(out, 0, 128);
  for (i = 0; i < 1024; i++) {
    if (in[i] >= 1073741824 && in[i] <= 3221225471) {
      ((out)[(i) / 64] |= (((uint64_t)1) << (uint64_t)((i) % 64)));
    }
  }
}


x86 assembly (clang, -O0):
<round2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    11c2 <round2+0xb2>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x40000000,(%rax,%rcx,4)
jl     11af <round2+0x9f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movslq (%rax,%rcx,4),%rax
mov    $0xbfffffff,%ecx
cmp    %rcx,%rax
jg     11af <round2+0x9f>
mov    -0x14(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    -0x24(%rbp),%edx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
jmp    11b4 <round2+0xa4>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <round2+0x27>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round2>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
jmp    113d <round2+0x2d>
nopl   0x0(%rax,%rax,1)
add    $0x2,%rbx
cmp    $0x400,%rbx
je     118c <round2+0x7c>
cmpl   $0x40000000,(%r15,%rbx,4)
40
jl     1164 <round2+0x54>
mov    %ebx,%ecx
and    $0x3e,%cl
mov    $0x1,%eax
shl    %cl,%eax
mov    %rbx,%rcx
shr    $0x4,%rcx
and    $0xffffffc,%ecx
or     %eax,(%r14,%rcx,1)
cmpl   $0x40000000,0x4(%r15,%rbx,4)
jl     1130 <round2+0x20>
lea    0x1(%rbx),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %rbx,%rcx
shr    $0x4,%rcx
and    $0xffffffc,%ecx
or     %eax,(%r14,%rcx,1)
jmp    1130 <round2+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @round2(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = call i32 @memset(i32* %6, i32 0, i32 128)
store i32 0, i32* %5
br label %8
8: ; preds = %38, %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 1024
br i1 %10, label %11, label %41
11: ; preds = %8
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = icmp sge i32 %16, 1073741824
br i1 %17, label %18, label %37
18: ; preds = %11
%19 = load i32*, i32** %4
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = sext i32 %23 to i64
%25 = icmp sle i64 %24, 3221225471
br i1 %25, label %26, label %37
26: ; preds = %18
%27 = load i32, i32* %5
%28 = srem i32 %27, 64
%29 = shl i32 1, %28
%30 = load i32*, i32** %3
%31 = load i32, i32* %5
%32 = sdiv i32 %31, 64
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %30, i64 %33
%35 = load i32, i32* %34
%36 = or i32 %35, %29
store i32 %36, i32* %34
br label %37
37: ; preds = %26, %18, %11
br label %38
38: ; preds = %37
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %8
41: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @round2(i32* %0, i32* nocapture %1) {
%3 = tail call i32 @memset(i32* %0, i32 0, i32 128)
br label %4
4: ; preds = %32, %2
%5 = phi i64 [ 0, %2 ], [ %33, %32 ]
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
%8 = icmp sgt i32 %7, 1073741823
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = trunc i64 %5 to i32
%11 = and i32 %10, 62
%12 = shl nuw i32 1, %11
%13 = lshr i64 %5, 6
%14 = and i64 %13, 67108863
%15 = getelementptr inbounds i32, i32* %0, i64 %14
%16 = load i32, i32* %15
%17 = or i32 %16, %12
store i32 %17, i32* %15
br label %18
18: ; preds = %4, %9
%19 = or i64 %5, 1
%20 = getelementptr inbounds i32, i32* %1, i64 %19
%21 = load i32, i32* %20
%22 = icmp sgt i32 %21, 1073741823
br i1 %22, label %23, label %32
23: ; preds = %18
%24 = trunc i64 %19 to i32
%25 = and i32 %24, 63
%26 = shl nuw i32 1, %25
%27 = lshr i64 %5, 6
%28 = and i64 %27, 67108863
%29 = getelementptr inbounds i32, i32* %0, i64 %28
%30 = load i32, i32* %29
%31 = or i32 %30, %26
store i32 %31, i32* %29
br label %32
32: ; preds = %23, %18
%33 = add nuw nsw i64 %5, 2
%34 = icmp eq i64 %33, 1024
br i1 %34, label %35, label %4
35: ; preds = %32
ret void
}