#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 __nv_popcll(int);
int /*<<< orphan*/ printf(char *, ...);
int test1() {
  int result;
#pragma omp target map(tofrom : result)
  { result = __nv_popcll(0xff00ff00ff000000); }
  int host = __nv_popcll(0xff00ff00ff000000);
  if (result != host) {
    printf("popcll test failed! result = %d, expecting %d\n", result, host);
    return 1;
  }
  printf("popcll test OK!\n");
  return 0;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xff000000,%edi
call   1040 <__nv_popcll@plt>
mov    %eax,-0x8(%rbp)
mov    $0xff000000,%edi
call   1040 <__nv_popcll@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     116e <test1+0x4e>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1183 <test1+0x63>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
mov    $0xff000000,%edi
call   1050 <__nv_popcll@plt>
mov    %eax,%ebx
mov    $0xff000000,%edi
call   1050 <__nv_popcll@plt>
cmp    %eax,%ebx
jne    115b <test1+0x2b>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe9e(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"popcll test failed! result = %d, expecting %d\0A\00"
@.str.1 = [17 x i8] c"popcll test OK!\0A\00"
define i32 @test1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @__nv_popcll(i32 -16777216)
store i32 %4, i32* %2
%5 = call i32 @__nv_popcll(i32 -16777216)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
store i32 1, i32* %1
br label %15
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [47 x i8] c"popcll test failed! result = %d, expecting %d\0A\00"
@str = [16 x i8] c"popcll test OK!\00"
define i32 @test1() {
%1 = tail call i32 @__nv_popcll(i32 -16777216)
%2 = tail call i32 @__nv_popcll(i32 -16777216)
%3 = icmp eq i32 %1, %2
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
br label %8
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %9
}