#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*/ exit(int);
int /*<<< orphan*/ int2bin(int);
int /*<<< orphan*/ printf(char *, ...);
int str2int(char *);
int main(int argc, char *argv[]) {
  int x;
  if (argc == 2)
    x = str2int(argv[1]);
  else {
    printf("Integer arguments x missing!\n");
    exit(1);
  }
  printf("Bits counted from right to left:\nMost right bit is #0, and most "
         "left bit #7");
  printf("\n\nCheck if the integer is even or odd\n\n");
  printf("x              = ");
  int2bin(x);
  printf("1              = ");
  int2bin(1);
  printf("x & 1          = ");
  int2bin(x & 1);
  printf("(x & 1) == 0   = ");
  printf("%i ", (x & 1) == 0);
  if ((x & 1) == 0)
    printf(
        "(true) -> \"%i\" is even (the least significant bit #0 is \"0\") \n",
        x);
  else
    printf("(false) -> \"%i\" is odd (the least significant bit #0 is \"1\")\n",
           x);
  printf("\n\nTest if the n-th bit is set\n\n");
  int n;
  for (n = 0; n < 8; n++) {
    printf("Bit #%i set?\n", n);
    printf("1 << %i         = ", n);
    int2bin(1 << n);
    printf("x              = ");
    int2bin(x);
    printf("x & (1 << %i)   = ", n);
    int2bin(x & (1 << n));
    printf("               = %i ", x & (1 << n));
    if (x & (1 << n))
      printf("(true)\n", x);
    else
      printf("(false)\n", x);
  }
  printf("\n\nSet the n-th bit\n\n");
  n = 0;
  for (n = 0; n < 8; n++) {
    printf("Bit #%i\n", n);
    printf("1 << %i         = ", n);
    int2bin(1 << n);
    printf("x              = ");
    int2bin(x);
    printf("x | (1 << %i)   = ", n);
    int2bin(x | (1 << n));
    printf("\n");
  }
  printf("\nUnset the n-th bit\n\n");
  n = 0;
  for (n = 0; n < 8; n++) {
    printf("Bit #%i\n", n);
    printf("1 << %i         = ", n);
    int2bin(1 << n);
    printf("~(1 << %i)      = ", n);
    int2bin(~(1 << n));
    printf("x              = ");
    int2bin(x);
    printf("x & ~(1 << %i)  = ", n);
    int2bin(x & ~(1 << n));
    printf("\n");
  }
  printf("\nToggle the n-th bit\n\n");
  n = 0;
  for (n = 0; n < 8; n++) {
    printf("Bit #%i\n", n);
    printf("1 << %i         = ", n);
    int2bin(1 << n);
    printf("x              = ");
    int2bin(x);
    printf("x ^ (1 << %i)   = ", n);
    int2bin(x ^ (1 << n));
    printf("\n");
  }
  printf("\nTurn off the rightmost 1-bit\n\n");
  printf("x - 1          = ");
  int2bin(x - 1);
  printf("x              = ");
  int2bin(x);
  printf("x & (x - 1)    = ");
  int2bin(x & (x - 1));
  printf("\nIsolate the rightmost 1-bit\n\n");
  printf("-x             = ");
  int2bin(-x);
  printf("x              = ");
  int2bin(x);
  printf("x & (-x)       = ");
  int2bin(x & (-x));
  printf("\nRight propagate the rightmost 1-bit\n\n");
  printf("x - 1          = ");
  int2bin(x - 1);
  printf("x              = ");
  int2bin(x);
  printf("x | (x - 1)    = ");
  int2bin(x | (x - 1));
  printf("\nIsolate the rightmost 0-bit\n\n");
  printf("x + 1          = ");
  int2bin(x + 1);
  printf("~x             = ");
  int2bin(~x);
  printf("x              = ");
  int2bin(x);
  printf("~x & (x + 1)   = ");
  int2bin(~x & (x + 1));
  printf("\nTurn on the rightmost 0-bit\n\n");
  printf("x + 1          = ");
  int2bin(x + 1);
  printf("x              = ");
  int2bin(x);
  printf("x | (x + 1)    = ");
  int2bin(x | (x + 1));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1175 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <str2int@plt>
mov    %eax,-0x14(%rbp)
jmp    118d <main+0x4d>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <int2bin@plt>
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   1040 <int2bin@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
and    $0x1,%edi
call   1040 <int2bin@plt>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xfa6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1242 <main+0x102>
mov    -0x14(%rbp),%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1253 <main+0x113>
mov    -0x14(%rbp),%esi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    134f <main+0x20f>
mov    -0x18(%rbp),%esi
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%ecx
mov    $0x1,%edi
shl    %cl,%edi
call   1040 <int2bin@plt>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <int2bin@plt>
mov    -0x18(%rbp),%esi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edi
call   1040 <int2bin@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     132b <main+0x1eb>
mov    -0x14(%rbp),%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    133c <main+0x1fc>
mov    -0x14(%rbp),%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1341 <main+0x201>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1268 <main+0x128>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    13fd <main+0x2bd>
mov    -0x18(%rbp),%esi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%ecx
mov    $0x1,%edi
shl    %cl,%edi
call   1040 <int2bin@plt>
lea    0xce5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <int2bin@plt>
mov    -0x18(%rbp),%esi
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,%edi
call   1040 <int2bin@plt>
lea    0xca8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    136b <main+0x22b>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    14d1 <main+0x391>
mov    -0x18(%rbp),%esi
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd47(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%ecx
mov    $0x1,%edi
shl    %cl,%edi
call   1040 <int2bin@plt>
mov    -0x18(%rbp),%esi
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%ecx
mov    $0x1,%edi
shl    %cl,%edi
xor    $0xffffffff,%edi
call   1040 <int2bin@plt>
lea    0xc14(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <int2bin@plt>
mov    -0x18(%rbp),%esi
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    %eax,%edi
call   1040 <int2bin@plt>
lea    0xbd4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1419 <main+0x2d9>
lea    0xd66(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    157f <main+0x43f>
mov    -0x18(%rbp),%esi
lea    0xce5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xc73(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%ecx
mov    $0x1,%edi
shl    %cl,%edi
call   1040 <int2bin@plt>
lea    0xb63(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <int2bin@plt>
mov    -0x18(%rbp),%esi
lea    0xd0d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    %eax,%edi
call   1040 <int2bin@plt>
lea    0xb26(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    14ed <main+0x3ad>
lea    0xce2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xcf4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
sub    $0x1,%edi
call   1040 <int2bin@plt>
lea    0xae5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <int2bin@plt>
lea    0xcd7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
and    %eax,%edi
call   1040 <int2bin@plt>
lea    0xccb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xcdc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %edi,%edi
sub    -0x14(%rbp),%edi
call   1040 <int2bin@plt>
lea    0xa8b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <int2bin@plt>
lea    0xcc0(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
xor    %eax,%eax
sub    -0x14(%rbp),%eax
and    %eax,%edi
call   1040 <int2bin@plt>
lea    0xcb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc40(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
sub    $0x1,%edi
call   1040 <int2bin@plt>
lea    0xa31(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <int2bin@plt>
lea    0xc9f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
or     %eax,%edi
call   1040 <int2bin@plt>
lea    0xc93(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xca4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <int2bin@plt>
lea    0xc9d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
xor    $0xffffffff,%edi
call   1040 <int2bin@plt>
lea    0x9bd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <int2bin@plt>
lea    0xc80(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
xor    $0xffffffff,%edi
mov    -0x14(%rbp),%eax
add    $0x1,%eax
and    %eax,%edi
call   1040 <int2bin@plt>
lea    0xc71(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xc2d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <int2bin@plt>
lea    0x95f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <int2bin@plt>
lea    0xc53(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%eax
add    $0x1,%eax
or     %eax,%edi
call   1040 <int2bin@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    1657 <main+0x4f7>
mov    0x8(%rsi),%rdi
call   1050 <str2int@plt>
mov    %eax,%ebx
lea    0xe7a(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x10da(%rip),%rdi
call   1040 <puts@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   1060 <int2bin@plt>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   1060 <int2bin@plt>
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%ebp
and    $0x1,%ebp
mov    %ebp,%edi
call   1060 <int2bin@plt>
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebp,%esi
xor    $0x1,%esi
lea    0xf5c(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebp,%ebp
lea    0xe8a(%rip),%rax
lea    0xec2(%rip),%rdi
cmove  %rax,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x1070(%rip),%rdi
call   1040 <puts@plt>
lea    0x1161(%rip),%r13
lea    0x1162(%rip),%rbp
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
lea    0xeca(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xec7(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r15d
mov    %r14d,%ecx
shl    %cl,%r15d
mov    %r15d,%edi
call   1060 <int2bin@plt>
lea    0xdcf(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   1060 <int2bin@plt>
lea    0xea0(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
and    %ebx,%r15d
mov    %rbp,%r12
cmove  %r13,%r12
mov    %r15d,%edi
call   1060 <int2bin@plt>
lea    0xe90(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
add    $0x1,%r14d
cmp    $0x8,%r14d
jne    1240 <main+0xe0>
lea    0xfd8(%rip),%rdi
call   1040 <puts@plt>
lea    0xe72(%rip),%r14
lea    0xe30(%rip),%r15
lea    0xd56(%rip),%r12
lea    0xe66(%rip),%r13
xor    %ebp,%ebp
nop
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
mov    %ebp,%ecx
shl    %cl,%edi
call   1060 <int2bin@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   1060 <int2bin@plt>
mov    %r13,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
bts    %ebp,%edi
call   1060 <int2bin@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x8,%ebp
jne    1300 <main+0x1a0>
lea    0xf62(%rip),%rdi
call   1040 <puts@plt>
lea    0xdad(%rip),%r15
lea    0xdfd(%rip),%r12
lea    0xccc(%rip),%r13
lea    0xe02(%rip),%rbp
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
lea    0xdc3(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
mov    %r14d,%ecx
shl    %cl,%edi
call   1060 <int2bin@plt>
mov    %r12,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xfffffffe,%edi
mov    %r14d,%ecx
rol    %cl,%edi
call   1060 <int2bin@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   1060 <int2bin@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
btr    %r14d,%edi
call   1060 <int2bin@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
cmp    $0x8,%r14d
jne    1390 <main+0x230>
lea    0xebc(%rip),%rdi
call   1040 <puts@plt>
lea    0xd2d(%rip),%r14
lea    0xceb(%rip),%r15
lea    0xc11(%rip),%r12
lea    0xd5a(%rip),%r13
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
mov    %ebp,%ecx
shl    %cl,%edi
call   1060 <int2bin@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   1060 <int2bin@plt>
mov    %r13,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
btc    %ebp,%edi
call   1060 <int2bin@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x8,%ebp
jne    1450 <main+0x2f0>
lea    0xe3d(%rip),%rdi
call   1040 <puts@plt>
lea    0xced(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    -0x1(%rbx),%r12d
mov    %r12d,%edi
call   1060 <int2bin@plt>
lea    0xb6d(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   1060 <int2bin@plt>
lea    0xcca(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12d,%edi
and    %ebx,%edi
call   1060 <int2bin@plt>
lea    0xe03(%rip),%rdi
call   1040 <puts@plt>
lea    0xcb8(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%ebp
neg    %ebp
mov    %ebp,%edi
call   1060 <int2bin@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   1060 <int2bin@plt>
lea    0xca0(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
and    %ebx,%ebp
mov    %ebp,%edi
call   1060 <int2bin@plt>
lea    0xdd4(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12d,%edi
call   1060 <int2bin@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   1060 <int2bin@plt>
lea    0xc6c(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
or     %ebx,%r12d
mov    %r12d,%edi
call   1060 <int2bin@plt>
lea    0xdb2(%rip),%rdi
call   1040 <puts@plt>
lea    0xc59(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x1(%rbx),%r12d
mov    %r12d,%edi
call   1060 <int2bin@plt>
lea    0xc4e(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%ebp
not    %ebp
mov    %ebp,%edi
call   1060 <int2bin@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   1060 <int2bin@plt>
lea    0xc36(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
and    %r12d,%ebp
mov    %ebp,%edi
call   1060 <int2bin@plt>
lea    0xd65(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12d,%edi
call   1060 <int2bin@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %ebx,%edi
call   1060 <int2bin@plt>
lea    0xc01(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
or     %ebx,%r12d
mov    %r12d,%edi
call   1060 <int2bin@plt>
xor    %edi,%edi
call   1080 <exit@plt>
lea    0xbf3(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Integer arguments x missing!\0A\00"
@.str.1 = [76 x i8] c"Bits counted from right to left:\0AMost right bit is, and most left bit\00"
@.str.2 = [40 x i8] c"\0A\0ACheck if the integer is even or odd\0A\0A\00"
@.str.3 = [18 x i8] c"x = \00"
@.str.4 = [18 x i8] c"1 = \00"
@.str.5 = [18 x i8] c"x & 1 = \00"
@.str.6 = [18 x i8] c"(x & 1) == 0 = \00"
@.str.7 = [4 x i8] c"%i \00"
@.str.8 = [63 x i8] c"(true) -> \22%i\22 is even (the least significant bit is \220\22) \0A\00"
@.str.9 = [62 x i8] c"(false) -> \22%i\22 is odd (the least significant bit is \221\22)\0A\00"
@.str.10 = [32 x i8] c"\0A\0ATest if the n-th bit is set\0A\0A\00"
@.str.11 = [14 x i8] c"Bit #%i set?\0A\00"
@.str.12 = [19 x i8] c"1 << %i = \00"
@.str.13 = [19 x i8] c"x & (1 << %i) = \00"
@.str.14 = [21 x i8] c" = %i \00"
@.str.15 = [8 x i8] c"(true)\0A\00"
@.str.16 = [9 x i8] c"(false)\0A\00"
@.str.17 = [21 x i8] c"\0A\0ASet the n-th bit\0A\0A\00"
@.str.18 = [9 x i8] c"Bit #%i\0A\00"
@.str.19 = [19 x i8] c"x | (1 << %i) = \00"
@.str.20 = [2 x i8] c"\0A\00"
@.str.21 = [22 x i8] c"\0AUnset the n-th bit\0A\0A\00"
@.str.22 = [19 x i8] c"~(1 << %i) = \00"
@.str.23 = [19 x i8] c"x & ~(1 << %i) = \00"
@.str.24 = [23 x i8] c"\0AToggle the n-th bit\0A\0A\00"
@.str.25 = [19 x i8] c"x ^ (1 << %i) = \00"
@.str.26 = [32 x i8] c"\0ATurn off the rightmost 1-bit\0A\0A\00"
@.str.27 = [18 x i8] c"x - 1 = \00"
@.str.28 = [18 x i8] c"x & (x - 1) = \00"
@.str.29 = [31 x i8] c"\0AIsolate the rightmost 1-bit\0A\0A\00"
@.str.30 = [18 x i8] c"-x = \00"
@.str.31 = [18 x i8] c"x & (-x) = \00"
@.str.32 = [39 x i8] c"\0ARight propagate the rightmost 1-bit\0A\0A\00"
@.str.33 = [18 x i8] c"x | (x - 1) = \00"
@.str.34 = [31 x i8] c"\0AIsolate the rightmost 0-bit\0A\0A\00"
@.str.35 = [18 x i8] c"x + 1 = \00"
@.str.36 = [18 x i8] c"~x = \00"
@.str.37 = [18 x i8] c"~x & (x + 1) = \00"
@.str.38 = [31 x i8] c"\0ATurn on the rightmost 0-bit\0A\0A\00"
@.str.39 = [18 x i8] c"x | (x + 1) = \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @str2int(i8* %13)
store i32 %14, i32* %6
br label %18
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %10
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%22 = load i32, i32* %6
%23 = call i32 @int2bin(i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%25 = call i32 @int2bin(i32 1)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%27 = load i32, i32* %6
%28 = and i32 %27, 1
%29 = call i32 @int2bin(i32 %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%31 = load i32, i32* %6
%32 = and i32 %31, 1
%33 = icmp eq i32 %32, 0
%34 = zext i1 %33 to i32
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %6
%37 = and i32 %36, 1
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %18
%40 = load i32, i32* %6
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0), i32 %40)
br label %45
42: ; preds = %18
%43 = load i32, i32* %6
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.9, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %42, %39
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %7
br label %47
47: ; preds = %85, %45
%48 = load i32, i32* %7
%49 = icmp slt i32 %48, 8
br i1 %49, label %50, label %88
50: ; preds = %47
%51 = load i32, i32* %7
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %7
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i32 %53)
%55 = load i32, i32* %7
%56 = shl i32 1, %55
%57 = call i32 @int2bin(i32 %56)
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%59 = load i32, i32* %6
%60 = call i32 @int2bin(i32 %59)
%61 = load i32, i32* %7
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0), i32 %61)
%63 = load i32, i32* %6
%64 = load i32, i32* %7
%65 = shl i32 1, %64
%66 = and i32 %63, %65
%67 = call i32 @int2bin(i32 %66)
%68 = load i32, i32* %6
%69 = load i32, i32* %7
%70 = shl i32 1, %69
%71 = and i32 %68, %70
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0), i32 %71)
%73 = load i32, i32* %6
%74 = load i32, i32* %7
%75 = shl i32 1, %74
%76 = and i32 %73, %75
%77 = icmp ne i32 %76, 0
br i1 %77, label %78, label %81
78: ; preds = %50
%79 = load i32, i32* %6
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0), i32 %79)
br label %84
81: ; preds = %50
%82 = load i32, i32* %6
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0), i32 %82)
br label %84
84: ; preds = %81, %78
br label %85
85: ; preds = %84
%86 = load i32, i32* %7
%87 = add nsw i32 %86, 1
store i32 %87, i32* %7
br label %47
88: ; preds = %47
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0))
store i32 0, i32* %7
store i32 0, i32* %7
br label %90
90: ; preds = %112, %88
%91 = load i32, i32* %7
%92 = icmp slt i32 %91, 8
br i1 %92, label %93, label %115
93: ; preds = %90
%94 = load i32, i32* %7
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0), i32 %94)
%96 = load i32, i32* %7
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i32 %96)
%98 = load i32, i32* %7
%99 = shl i32 1, %98
%100 = call i32 @int2bin(i32 %99)
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%102 = load i32, i32* %6
%103 = call i32 @int2bin(i32 %102)
%104 = load i32, i32* %7
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.19, i64 0, i64 0), i32 %104)
%106 = load i32, i32* %6
%107 = load i32, i32* %7
%108 = shl i32 1, %107
%109 = or i32 %106, %108
%110 = call i32 @int2bin(i32 %109)
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
br label %112
112: ; preds = %93
%113 = load i32, i32* %7
%114 = add nsw i32 %113, 1
store i32 %114, i32* %7
br label %90
115: ; preds = %90
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.21, i64 0, i64 0))
store i32 0, i32* %7
store i32 0, i32* %7
br label %117
117: ; preds = %146, %115
%118 = load i32, i32* %7
%119 = icmp slt i32 %118, 8
br i1 %119, label %120, label %149
120: ; preds = %117
%121 = load i32, i32* %7
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0), i32 %121)
%123 = load i32, i32* %7
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i32 %123)
%125 = load i32, i32* %7
%126 = shl i32 1, %125
%127 = call i32 @int2bin(i32 %126)
%128 = load i32, i32* %7
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.22, i64 0, i64 0), i32 %128)
%130 = load i32, i32* %7
%131 = shl i32 1, %130
%132 = xor i32 %131, -1
%133 = call i32 @int2bin(i32 %132)
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%135 = load i32, i32* %6
%136 = call i32 @int2bin(i32 %135)
%137 = load i32, i32* %7
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.23, i64 0, i64 0), i32 %137)
%139 = load i32, i32* %6
%140 = load i32, i32* %7
%141 = shl i32 1, %140
%142 = xor i32 %141, -1
%143 = and i32 %139, %142
%144 = call i32 @int2bin(i32 %143)
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
br label %146
146: ; preds = %120
%147 = load i32, i32* %7
%148 = add nsw i32 %147, 1
store i32 %148, i32* %7
br label %117
149: ; preds = %117
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.24, i64 0, i64 0))
store i32 0, i32* %7
store i32 0, i32* %7
br label %151
151: ; preds = %173, %149
%152 = load i32, i32* %7
%153 = icmp slt i32 %152, 8
br i1 %153, label %154, label %176
154: ; preds = %151
%155 = load i32, i32* %7
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0), i32 %155)
%157 = load i32, i32* %7
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i32 %157)
%159 = load i32, i32* %7
%160 = shl i32 1, %159
%161 = call i32 @int2bin(i32 %160)
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%163 = load i32, i32* %6
%164 = call i32 @int2bin(i32 %163)
%165 = load i32, i32* %7
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.25, i64 0, i64 0), i32 %165)
%167 = load i32, i32* %6
%168 = load i32, i32* %7
%169 = shl i32 1, %168
%170 = xor i32 %167, %169
%171 = call i32 @int2bin(i32 %170)
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
br label %173
173: ; preds = %154
%174 = load i32, i32* %7
%175 = add nsw i32 %174, 1
store i32 %175, i32* %7
br label %151
176: ; preds = %151
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.26, i64 0, i64 0))
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.27, i64 0, i64 0))
%179 = load i32, i32* %6
%180 = sub nsw i32 %179, 1
%181 = call i32 @int2bin(i32 %180)
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%183 = load i32, i32* %6
%184 = call i32 @int2bin(i32 %183)
%185 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.28, i64 0, i64 0))
%186 = load i32, i32* %6
%187 = load i32, i32* %6
%188 = sub nsw i32 %187, 1
%189 = and i32 %186, %188
%190 = call i32 @int2bin(i32 %189)
%191 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.29, i64 0, i64 0))
%192 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.30, i64 0, i64 0))
%193 = load i32, i32* %6
%194 = sub nsw i32 0, %193
%195 = call i32 @int2bin(i32 %194)
%196 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%197 = load i32, i32* %6
%198 = call i32 @int2bin(i32 %197)
%199 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.31, i64 0, i64 0))
%200 = load i32, i32* %6
%201 = load i32, i32* %6
%202 = sub nsw i32 0, %201
%203 = and i32 %200, %202
%204 = call i32 @int2bin(i32 %203)
%205 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.32, i64 0, i64 0))
%206 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.27, i64 0, i64 0))
%207 = load i32, i32* %6
%208 = sub nsw i32 %207, 1
%209 = call i32 @int2bin(i32 %208)
%210 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%211 = load i32, i32* %6
%212 = call i32 @int2bin(i32 %211)
%213 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.33, i64 0, i64 0))
%214 = load i32, i32* %6
%215 = load i32, i32* %6
%216 = sub nsw i32 %215, 1
%217 = or i32 %214, %216
%218 = call i32 @int2bin(i32 %217)
%219 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.34, i64 0, i64 0))
%220 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.35, i64 0, i64 0))
%221 = load i32, i32* %6
%222 = add nsw i32 %221, 1
%223 = call i32 @int2bin(i32 %222)
%224 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.36, i64 0, i64 0))
%225 = load i32, i32* %6
%226 = xor i32 %225, -1
%227 = call i32 @int2bin(i32 %226)
%228 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%229 = load i32, i32* %6
%230 = call i32 @int2bin(i32 %229)
%231 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.37, i64 0, i64 0))
%232 = load i32, i32* %6
%233 = xor i32 %232, -1
%234 = load i32, i32* %6
%235 = add nsw i32 %234, 1
%236 = and i32 %233, %235
%237 = call i32 @int2bin(i32 %236)
%238 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.38, i64 0, i64 0))
%239 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.35, i64 0, i64 0))
%240 = load i32, i32* %6
%241 = add nsw i32 %240, 1
%242 = call i32 @int2bin(i32 %241)
%243 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%244 = load i32, i32* %6
%245 = call i32 @int2bin(i32 %244)
%246 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.39, i64 0, i64 0))
%247 = load i32, i32* %6
%248 = load i32, i32* %6
%249 = add nsw i32 %248, 1
%250 = or i32 %247, %249
%251 = call i32 @int2bin(i32 %250)
%252 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [76 x i8] c"Bits counted from right to left:\0AMost right bit is, and most left bit\00"
@.str.3 = [18 x i8] c"x = \00"
@.str.4 = [18 x i8] c"1 = \00"
@.str.5 = [18 x i8] c"x & 1 = \00"
@.str.6 = [18 x i8] c"(x & 1) == 0 = \00"
@.str.7 = [4 x i8] c"%i \00"
@.str.8 = [63 x i8] c"(true) -> \22%i\22 is even (the least significant bit is \220\22) \0A\00"
@.str.9 = [62 x i8] c"(false) -> \22%i\22 is odd (the least significant bit is \221\22)\0A\00"
@.str.11 = [14 x i8] c"Bit #%i set?\0A\00"
@.str.12 = [19 x i8] c"1 << %i = \00"
@.str.13 = [19 x i8] c"x & (1 << %i) = \00"
@.str.14 = [21 x i8] c" = %i \00"
@.str.18 = [9 x i8] c"Bit #%i\0A\00"
@.str.19 = [19 x i8] c"x | (1 << %i) = \00"
@.str.22 = [19 x i8] c"~(1 << %i) = \00"
@.str.23 = [19 x i8] c"x & ~(1 << %i) = \00"
@.str.25 = [19 x i8] c"x ^ (1 << %i) = \00"
@.str.27 = [18 x i8] c"x - 1 = \00"
@.str.28 = [18 x i8] c"x & (x - 1) = \00"
@.str.30 = [18 x i8] c"-x = \00"
@.str.31 = [18 x i8] c"x & (-x) = \00"
@.str.33 = [18 x i8] c"x | (x - 1) = \00"
@.str.35 = [18 x i8] c"x + 1 = \00"
@.str.36 = [18 x i8] c"~x = \00"
@.str.37 = [18 x i8] c"~x & (x + 1) = \00"
@.str.39 = [18 x i8] c"x | (x + 1) = \00"
@str = [29 x i8] c"Integer arguments x missing!\00"
@str.40 = [39 x i8] c"\0A\0ACheck if the integer is even or odd\0A\00"
@str.41 = [31 x i8] c"\0A\0ATest if the n-th bit is set\0A\00"
@str.42 = [20 x i8] c"\0A\0ASet the n-th bit\0A\00"
@str.43 = [21 x i8] c"\0AUnset the n-th bit\0A\00"
@str.44 = [22 x i8] c"\0AToggle the n-th bit\0A\00"
@str.45 = [31 x i8] c"\0ATurn off the rightmost 1-bit\0A\00"
@str.46 = [30 x i8] c"\0AIsolate the rightmost 1-bit\0A\00"
@str.47 = [38 x i8] c"\0ARight propagate the rightmost 1-bit\0A\00"
@str.48 = [30 x i8] c"\0AIsolate the rightmost 0-bit\0A\00"
@str.49 = [30 x i8] c"\0ATurn on the rightmost 0-bit\0A\00"
@str.50 = [8 x i8] c"(false)\00"
@str.51 = [7 x i8] c"(true)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %24
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @str2int(i8* %6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.40, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i32 @int2bin(i32 %7)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%13 = tail call i32 @int2bin(i32 1)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%15 = and i32 %7, 1
%16 = tail call i32 @int2bin(i32 %15)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%18 = icmp eq i32 %15, 0
%19 = xor i32 %15, 1
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %19)
%21 = select i1 %18, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.9, i64 0, i64 0)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %21, i32 %7)
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.41, i64 0, i64 0))
br label %27
24: ; preds = %2
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%26 = tail call i32 @exit(i32 1)
unreachable
27: ; preds = %4, %27
%28 = phi i32 [ 0, %4 ], [ %42, %27 ]
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), i32 %28)
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i32 %28)
%31 = shl nuw nsw i32 1, %28
%32 = tail call i32 @int2bin(i32 %31)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%34 = tail call i32 @int2bin(i32 %7)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0), i32 %28)
%36 = and i32 %31, %7
%37 = tail call i32 @int2bin(i32 %36)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0), i32 %36)
%39 = icmp eq i32 %36, 0
%40 = select i1 %39, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.50, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.51, i64 0, i64 0)
%41 = tail call i32 @puts(i8* dereferenceable(1) %40)
%42 = add nuw nsw i32 %28, 1
%43 = icmp eq i32 %42, 8
br i1 %43, label %44, label %27
44: ; preds = %27
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.42, i64 0, i64 0))
br label %46
46: ; preds = %44, %46
%47 = phi i32 [ 0, %44 ], [ %58, %46 ]
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0), i32 %47)
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i32 %47)
%50 = shl nuw nsw i32 1, %47
%51 = tail call i32 @int2bin(i32 %50)
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%53 = tail call i32 @int2bin(i32 %7)
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.19, i64 0, i64 0), i32 %47)
%55 = or i32 %50, %7
%56 = tail call i32 @int2bin(i32 %55)
%57 = tail call i32 @putchar(i32 10)
%58 = add nuw nsw i32 %47, 1
%59 = icmp eq i32 %58, 8
br i1 %59, label %60, label %46
60: ; preds = %46
%61 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.43, i64 0, i64 0))
br label %62
62: ; preds = %60, %62
%63 = phi i32 [ 0, %60 ], [ %77, %62 ]
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0), i32 %63)
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i32 %63)
%66 = shl nuw nsw i32 1, %63
%67 = tail call i32 @int2bin(i32 %66)
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.22, i64 0, i64 0), i32 %63)
%69 = xor i32 %66, -1
%70 = tail call i32 @int2bin(i32 %69)
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%72 = tail call i32 @int2bin(i32 %7)
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.23, i64 0, i64 0), i32 %63)
%74 = and i32 %7, %69
%75 = tail call i32 @int2bin(i32 %74)
%76 = tail call i32 @putchar(i32 10)
%77 = add nuw nsw i32 %63, 1
%78 = icmp eq i32 %77, 8
br i1 %78, label %79, label %62
79: ; preds = %62
%80 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.44, i64 0, i64 0))
br label %81
81: ; preds = %79, %81
%82 = phi i32 [ 0, %79 ], [ %93, %81 ]
%83 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0), i32 %82)
%84 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i32 %82)
%85 = shl nuw nsw i32 1, %82
%86 = tail call i32 @int2bin(i32 %85)
%87 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%88 = tail call i32 @int2bin(i32 %7)
%89 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.25, i64 0, i64 0), i32 %82)
%90 = xor i32 %85, %7
%91 = tail call i32 @int2bin(i32 %90)
%92 = tail call i32 @putchar(i32 10)
%93 = add nuw nsw i32 %82, 1
%94 = icmp eq i32 %93, 8
br i1 %94, label %95, label %81
95: ; preds = %81
%96 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.45, i64 0, i64 0))
%97 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.27, i64 0, i64 0))
%98 = add nsw i32 %7, -1
%99 = tail call i32 @int2bin(i32 %98)
%100 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%101 = tail call i32 @int2bin(i32 %7)
%102 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.28, i64 0, i64 0))
%103 = and i32 %98, %7
%104 = tail call i32 @int2bin(i32 %103)
%105 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.46, i64 0, i64 0))
%106 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.30, i64 0, i64 0))
%107 = sub nsw i32 0, %7
%108 = tail call i32 @int2bin(i32 %107)
%109 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%110 = tail call i32 @int2bin(i32 %7)
%111 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.31, i64 0, i64 0))
%112 = and i32 %7, %107
%113 = tail call i32 @int2bin(i32 %112)
%114 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.47, i64 0, i64 0))
%115 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.27, i64 0, i64 0))
%116 = tail call i32 @int2bin(i32 %98)
%117 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%118 = tail call i32 @int2bin(i32 %7)
%119 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.33, i64 0, i64 0))
%120 = or i32 %98, %7
%121 = tail call i32 @int2bin(i32 %120)
%122 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.48, i64 0, i64 0))
%123 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.35, i64 0, i64 0))
%124 = add nsw i32 %7, 1
%125 = tail call i32 @int2bin(i32 %124)
%126 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.36, i64 0, i64 0))
%127 = xor i32 %7, -1
%128 = tail call i32 @int2bin(i32 %127)
%129 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%130 = tail call i32 @int2bin(i32 %7)
%131 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.37, i64 0, i64 0))
%132 = and i32 %124, %127
%133 = tail call i32 @int2bin(i32 %132)
%134 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.49, i64 0, i64 0))
%135 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.35, i64 0, i64 0))
%136 = tail call i32 @int2bin(i32 %124)
%137 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%138 = tail call i32 @int2bin(i32 %7)
%139 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.39, i64 0, i64 0))
%140 = or i32 %124, %7
%141 = tail call i32 @int2bin(i32 %140)
%142 = tail call i32 @exit(i32 0)
unreachable
}