#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*/ printf(char *);
unsigned long long int hamming_distance_64bits(unsigned long long int *a,
                                               unsigned long long int *b) {
  unsigned long long int val[2], tmp[2], dist;
  val[0] = a[0] ^ b[0];
  val[1] = a[1] ^ b[1];
  printf("vou entrar em loop infinito\n");
  while (val[0] || val[1]) {
    dist++;
    if (val[1])
      tmp[0] = val[0] - 1;
    tmp[1] = val[1] - 1;
    val[0] &= tmp[0];
    val[1] &= tmp[1];
    break;
  }
  return dist;
}


x86 assembly (clang, -O0):
<hamming_distance_64bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
xor    (%rcx),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x10(%rbp),%rcx
xor    0x8(%rcx),%rax
mov    %rax,-0x18(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%al
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x39(%rbp)
jne    116d <hamming_distance_64bits+0x5d>
cmpq   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
test   $0x1,%al
jne    117d <hamming_distance_64bits+0x6d>
jmp    11c4 <hamming_distance_64bits+0xb4>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11a0 <hamming_distance_64bits+0x90>
mov    -0x20(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
and    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x38(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hamming_distance_64bits>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"vou entrar em loop infinito\0A\00"
define i64 @hamming_distance_64bits(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [2 x i64]
%6 = alloca [2 x i64]
%7 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
%10 = load i64, i64* %9
%11 = load i64*, i64** %4
%12 = getelementptr inbounds i64, i64* %11, i64 0
%13 = load i64, i64* %12
%14 = xor i64 %10, %13
%15 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
store i64 %14, i64* %15
%16 = load i64*, i64** %3
%17 = getelementptr inbounds i64, i64* %16, i64 1
%18 = load i64, i64* %17
%19 = load i64*, i64** %4
%20 = getelementptr inbounds i64, i64* %19, i64 1
%21 = load i64, i64* %20
%22 = xor i64 %18, %21
%23 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 1
store i64 %22, i64* %23
%24 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %25
25: ; preds = %2
%26 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
%27 = load i64, i64* %26
%28 = icmp ne i64 %27, 0
br i1 %28, label %33, label %29
29: ; preds = %25
%30 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 1
%31 = load i64, i64* %30
%32 = icmp ne i64 %31, 0
br label %33
33: ; preds = %29, %25
%34 = phi i1 [ true, %25 ], [ %32, %29 ]
br i1 %34, label %35, label %61
35: ; preds = %33
%36 = load i64, i64* %7
%37 = add i64 %36, 1
store i64 %37, i64* %7
%38 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 1
%39 = load i64, i64* %38
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %46
41: ; preds = %35
%42 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
%43 = load i64, i64* %42
%44 = sub i64 %43, 1
%45 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 0
store i64 %44, i64* %45
br label %46
46: ; preds = %41, %35
%47 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 1
%48 = load i64, i64* %47
%49 = sub i64 %48, 1
%50 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 1
store i64 %49, i64* %50
%51 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 0
%52 = load i64, i64* %51
%53 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
%54 = load i64, i64* %53
%55 = and i64 %54, %52
store i64 %55, i64* %53
%56 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 1
%57 = load i64, i64* %56
%58 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 1
%59 = load i64, i64* %58
%60 = and i64 %59, %57
store i64 %60, i64* %58
br label %61
61: ; preds = %46, %33
%62 = load i64, i64* %7
ret i64 %62
}

LLVM IR (-O2):
@str = [28 x i8] c"vou entrar em loop infinito\00"
define i64 @hamming_distance_64bits(i64* nocapture %0, i64* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i64 undef
}