#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 *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, char *argv[]) {
  printf("Please enter two integers: ");
  int i1, i2;
  scanf("%d %d", &i1, &i2);
  int orEd = (i1 ^ i2);
  printf("The following bits are the same\n: ");
  for (int i = 32768, j = 1; i > 0; i /= 2, j++) {
    if (!(orEd & i)) {
      printf("%d ", j);
    }
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x14(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x8000,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
cmpl   $0x0,-0x20(%rbp)
jle    11d8 <main+0xa8>
mov    -0x1c(%rbp),%eax
and    -0x20(%rbp),%eax
cmp    $0x0,%eax
jne    11b7 <main+0x87>
mov    -0x24(%rbp),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11bc <main+0x8c>
mov    -0x20(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    118d <main+0x5d>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x8(%rsp),%ebx
xor    0xc(%rsp),%ebx
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x8000,%ebx
je     1238 <main+0x108>
test   $0x4000,%ebx
je     1257 <main+0x127>
test   $0x2000,%ebx
je     1276 <main+0x146>
test   $0x1000,%ebx
je     1295 <main+0x165>
test   $0x800,%ebx
je     12b4 <main+0x184>
test   $0x400,%ebx
je     12d3 <main+0x1a3>
test   $0x200,%ebx
je     12f2 <main+0x1c2>
test   $0x100,%ebx
je     1311 <main+0x1e1>
test   $0x80,%bl
je     132d <main+0x1fd>
test   $0x40,%bl
je     1349 <main+0x219>
test   $0x20,%bl
je     1365 <main+0x235>
test   $0x10,%bl
je     1381 <main+0x251>
test   $0x8,%bl
je     139d <main+0x26d>
test   $0x4,%bl
je     13b9 <main+0x289>
test   $0x2,%bl
je     13d5 <main+0x2a5>
test   $0x1,%bl
jne    1226 <main+0xf6>
lea    0xe2b(%rip),%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe06(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x4000,%ebx
jne    1187 <main+0x57>
lea    0xde7(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x2000,%ebx
jne    1193 <main+0x63>
lea    0xdc8(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x1000,%ebx
jne    119f <main+0x6f>
lea    0xda9(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x800,%ebx
jne    11ab <main+0x7b>
lea    0xd8a(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x400,%ebx
jne    11b7 <main+0x87>
lea    0xd6b(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x200,%ebx
jne    11c3 <main+0x93>
lea    0xd4c(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x100,%ebx
jne    11cf <main+0x9f>
lea    0xd2d(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x80,%bl
jne    11d8 <main+0xa8>
lea    0xd11(%rip),%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x40,%bl
jne    11e1 <main+0xb1>
lea    0xcf5(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x20,%bl
jne    11ea <main+0xba>
lea    0xcd9(%rip),%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x10,%bl
jne    11f3 <main+0xc3>
lea    0xcbd(%rip),%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x8,%bl
jne    11fc <main+0xcc>
lea    0xca1(%rip),%rdi
mov    $0xd,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x4,%bl
jne    1205 <main+0xd5>
lea    0xc85(%rip),%rdi
mov    $0xe,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x2,%bl
jne    120e <main+0xde>
lea    0xc69(%rip),%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x1,%bl
je     1213 <main+0xe3>
jmp    1226 <main+0xf6>

LLVM IR (-O0):
@.str = [28 x i8] c"Please enter two integers: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [35 x i8] c"The following bits are the same\0A: \00"
@.str.3 = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7)
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = xor i32 %13, %14
store i32 %15, i32* %8
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
store i32 32768, i32* %9
store i32 1, i32* %10
br label %17
17: ; preds = %29, %2
%18 = load i32, i32* %9
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %34
20: ; preds = %17
%21 = load i32, i32* %8
%22 = load i32, i32* %9
%23 = and i32 %21, %22
%24 = icmp ne i32 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %20
%26 = load i32, i32* %10
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %25, %20
br label %29
29: ; preds = %28
%30 = load i32, i32* %9
%31 = sdiv i32 %30, 2
store i32 %31, i32* %9
%32 = load i32, i32* %10
%33 = add nsw i32 %32, 1
store i32 %33, i32* %10
br label %17
34: ; preds = %17
%35 = call i32 @putchar(i8 signext 10)
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
@.str = [28 x i8] c"Please enter two integers: \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [35 x i8] c"The following bits are the same\0A: \00"
@.str.3 = [4 x i8] c"%d \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = xor i32 %10, %9
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%13 = and i32 %11, 32768
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 1)
br label %17
17: ; preds = %2, %15
%18 = and i32 %11, 16384
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 2)
br label %22
22: ; preds = %20, %17
%23 = and i32 %11, 8192
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
br label %27
27: ; preds = %25, %22
%28 = and i32 %11, 4096
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 4)
br label %32
32: ; preds = %30, %27
%33 = and i32 %11, 2048
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 5)
br label %37
37: ; preds = %35, %32
%38 = and i32 %11, 1024
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 6)
br label %42
42: ; preds = %40, %37
%43 = and i32 %11, 512
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 7)
br label %47
47: ; preds = %45, %42
%48 = and i32 %11, 256
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %47
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 8)
br label %52
52: ; preds = %50, %47
%53 = and i32 %11, 128
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 9)
br label %57
57: ; preds = %55, %52
%58 = and i32 %11, 64
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 10)
br label %62
62: ; preds = %60, %57
%63 = and i32 %11, 32
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %62
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 11)
br label %67
67: ; preds = %65, %62
%68 = and i32 %11, 16
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %72
70: ; preds = %67
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 12)
br label %72
72: ; preds = %70, %67
%73 = and i32 %11, 8
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %77
75: ; preds = %72
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 13)
br label %77
77: ; preds = %75, %72
%78 = and i32 %11, 4
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %82
80: ; preds = %77
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 14)
br label %82
82: ; preds = %80, %77
%83 = and i32 %11, 2
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %87
85: ; preds = %82
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 15)
br label %87
87: ; preds = %85, %82
%88 = and i32 %11, 1
%89 = icmp eq i32 %88, 0
br i1 %89, label %90, label %92
90: ; preds = %87
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 16)
br label %92
92: ; preds = %90, %87
%93 = call i32 @putchar(i8 signext 10)
ret i32 0
}