#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*/ get_ports(unsigned long);
unsigned long get_shift_bits(int);
int /*<<< orphan*/ printf(char *, unsigned long, ...);
main() {
  unsigned long a, b, c, d;
  a = 0x80;
  b = 0x40;
  a |= b;
  c = a ^ b;
  printf("c: %lx, b: %lx\n", c, b);
  a = 0x1;
  a <<= get_shift_bits(9);
  printf("%lx\n", a);
  get_ports(a);
  b = 0x1;
  b <<= get_shift_bits(8);
  a |= b;
  printf("%lx\n", a);
  get_ports(a);
  int i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movq   $0x80,-0x8(%rbp)
movq   $0x40,-0x10(%rbp)
mov    -0x10(%rbp),%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x1,-0x8(%rbp)
mov    $0x9,%edi
call   1050 <get_shift_bits@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
shl    %cl,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <get_ports@plt>
movq   $0x1,-0x10(%rbp)
mov    $0x8,%edi
call   1050 <get_shift_bits@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
shl    %cl,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <get_ports@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%rdi
mov    $0x80,%esi
mov    $0x40,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x9,%edi
call   1050 <get_shift_bits@plt>
mov    %rax,%r14
mov    $0x1,%r15d
mov    $0x1,%ebx
mov    %r14d,%ecx
shl    %cl,%rbx
lea    0xe96(%rip),%r12
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <get_ports@plt>
mov    $0x8,%edi
call   1050 <get_shift_bits@plt>
mov    %eax,%ecx
shl    %cl,%r15
bts    %r14,%r15
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
call   1040 <get_ports@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"c: %lx, b: %lx\0A\00"
@.str.1 = [5 x i8] c"%lx\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 128, i64* %1
store i64 64, i64* %2
%6 = load i64, i64* %2
%7 = load i64, i64* %1
%8 = or i64 %7, %6
store i64 %8, i64* %1
%9 = load i64, i64* %1
%10 = load i64, i64* %2
%11 = xor i64 %9, %10
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = load i64, i64* %2
%14 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %12, i64 %13)
store i64 1, i64* %1
%15 = call i64 @get_shift_bits(i32 9)
%16 = load i64, i64* %1
%17 = shl i64 %16, %15
store i64 %17, i64* %1
%18 = load i64, i64* %1
%19 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %18)
%20 = load i64, i64* %1
%21 = call i32 @get_ports(i64 %20)
store i64 1, i64* %2
%22 = call i64 @get_shift_bits(i32 8)
%23 = load i64, i64* %2
%24 = shl i64 %23, %22
store i64 %24, i64* %2
%25 = load i64, i64* %2
%26 = load i64, i64* %1
%27 = or i64 %26, %25
store i64 %27, i64* %1
%28 = load i64, i64* %1
%29 = call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %28)
%30 = load i64, i64* %1
%31 = call i32 @get_ports(i64 %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"c: %lx, b: %lx\0A\00"
@.str.1 = [5 x i8] c"%lx\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 128, i64 64)
%2 = tail call i64 @get_shift_bits(i32 9)
%3 = shl nuw i64 1, %2
%4 = tail call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %3)
%5 = tail call i32 @get_ports(i64 %3)
%6 = tail call i64 @get_shift_bits(i32 8)
%7 = shl nuw i64 1, %6
%8 = or i64 %7, %3
%9 = tail call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %8)
%10 = tail call i32 @get_ports(i64 %8)
ret i32 0
}